diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 60477ee5..61127eef 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -49,6 +49,16 @@ Node 18+ required (see `.nvmrc`). - Run `npm run typecheck && npm run test && npm run lint` before pushing. - Snapshot test updates: justify the diff in your PR description. +### Sort-repair performance comparison + +From the repository root, run `node scripts/bench-sort-repair.mjs ` +after installing workspace dependencies. It compares the baseline sort-repair +module with the working copy in three interleaved rounds, verifies matching +outputs, and emits raw JSON timings and V8 sampled allocation estimates for +1,000- and 100,000-row tables. Run it without competing builds or benchmarks. +Sampling can miss small allocations; these figures are not exact allocation +counts, retained heap, or end-to-end chart-rendering measurements. + ## Public API & semver The public surface is whatever is re-exported from [`src/index.ts`](../src/index.ts) diff --git a/.github/extensions/flint-chart/.mcp.json b/.github/extensions/flint-chart/.mcp.json index 3137998f..03cc8827 100644 --- a/.github/extensions/flint-chart/.mcp.json +++ b/.github/extensions/flint-chart/.mcp.json @@ -4,7 +4,7 @@ "command": "npx", "args": [ "--yes", - "flint-chart-mcp@1.0.1" + "flint-chart-mcp@1.1.0" ], "cwd": "${PLUGIN_ROOT}" } diff --git a/.github/extensions/flint-chart/.plugin/plugin.json b/.github/extensions/flint-chart/.plugin/plugin.json index befee487..d784e0c0 100644 --- a/.github/extensions/flint-chart/.plugin/plugin.json +++ b/.github/extensions/flint-chart/.plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "flint-chart", "description": "Flint chart authoring MCP, skill, and native interactive chart canvas for Copilot CLI.", - "version": "1.0.1", + "version": "1.1.0", "author": { "name": "Microsoft", "url": "https://github.com/microsoft/flint-chart" diff --git a/.github/extensions/flint-chart/assets/flint-app.html b/.github/extensions/flint-chart/assets/flint-app.html index f2efeba1..448f9271 100644 --- a/.github/extensions/flint-chart/assets/flint-app.html +++ b/.github/extensions/flint-chart/assets/flint-app.html @@ -5,18 +5,18 @@ Flint Chart - +`;function nun(e,t){let n=t.flatMap(t=>t.ops.flatMap(t=>t.op!==`set-style`||t.value.state!==`emphasized`&&t.value.state!==`focused`?[]:t.targets.flatMap(t=>{if(!(`select`in t))return[];let n=qln(e,t);return n?[n]:[]})));return n.length>0?e=>n.some(t=>t(e)):null}function run(e,t){return typeof e==`number`&&typeof t==`number`?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0})}function iun(e,t){let n=e.rows.map((e,t)=>t);if(!t)return n;let r=t.descending?-1:1;return n.sort((n,i)=>r*run(e.rows[n][t.column].order,e.rows[i][t.column].order))}function aun(e,t,n){let r=e.columns[n].align===`end`;return t?.column===n?t.descending===r?{column:n,descending:!t.descending}:null:{column:n,descending:r}}function oun(e,t){return[te.rows.length?`the chart draws ${e.rows.length} of ${e.total} rows`:``,e.computes.length>0?`the chart computes its ${e.computes.join(`, `)} from these rows`:``].filter(Boolean)}function sun(e,t){return(0,Z.createElement)(`div`,{key:t,className:`flint-table-rule`,style:{height:e.height,background:e.color??`currentColor`,...e.stated?{width:e.width}:{}}})}function cun(e){let t=e.runs.map((e,t)=>(0,Z.createElement)(`span`,{key:t,style:{fontWeight:e.fontWeight,fontStyle:e.fontStyle}},(t>0?` `:``)+e.text));return e.href?(0,Z.createElement)(`a`,{href:e.href,target:`_blank`,rel:`noopener`},t):t}function lun(e){let t=[...new Set(e.lines.map(e=>e.bottom))].sort((e,t)=>t-e),n=e.creditImage;return(0,Z.createElement)(`div`,{className:`flint-table-source`,style:{fontFamily:e.font,fontSize:e.fontSize,color:e.color,lineHeight:`${e.lineHeight}px`}},e.rule?(0,Z.createElement)(`div`,{style:{borderTop:`${e.rule.width}px ${e.rule.dash?`dashed`:`solid`} ${e.rule.color}`,marginBottom:6}}):null,t.map((t,r)=>{let i=e.lines.filter(e=>e.bottom===t),a=i.filter(e=>e.align===`start`),o=i.filter(e=>e.align===`end`),s=r===0&&n?(0,Z.createElement)(`img`,{src:n.src,alt:n.alt,width:n.width,height:n.height,style:{verticalAlign:`middle`}}):null;return(0,Z.createElement)(`p`,{key:t,className:`flint-table-source-line`},(0,Z.createElement)(`span`,null,a.map((e,t)=>(0,Z.createElement)(`span`,{key:t},cun(e))),n?.align===`start`?s:null),(0,Z.createElement)(`span`,{style:{textAlign:`right`}},o.map((e,t)=>(0,Z.createElement)(`span`,{key:t},cun(e))),n?.align===`end`?s:null))}))}function uun(e){let t=(0,Z.useRef)(null),[n,r]=(0,Z.useState)(0);return(0,Z.useEffect)(()=>{let n=t.current;if(!e||!n||typeof ResizeObserver>`u`)return;let i=new ResizeObserver(([e])=>r(Math.round(e.contentRect.width)));return i.observe(n),()=>i.disconnect()},[e]),[t,n]}function c9(e){return{fontFamily:e.font,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,color:e.color}}var dun=[];function l9({table:e,updates:t=dun,className:n,style:r}){let[i,a]=(0,Z.useState)(null),o=(0,Z.useMemo)(()=>iun(e,i),[e,i]),s=(0,Z.useMemo)(()=>nun(e,t),[e,t]),c=o.slice(0,500),l=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{let e=l.current,t=e?.querySelector(`tbody tr[data-emphasized]`);if(!e||!t)return;let n=e.querySelector(`thead`)?.getBoundingClientRect().height??0,r=e.getBoundingClientRect(),i=t.getBoundingClientRect();(i.topr.bottom)&&(e.scrollTop+=i.top-r.top-n)},[s,o]);let{style:u}=e,d=oun(e,c.length),f=e.furniture,p=f?.header,[m,h]=uun(!!p),g=p&&h>0?Jln(p,{left:s9,right:s9,top:0}):[],_=p?p.edge+p.line:0,v=f?.rules.filter(e=>e.edge===`top`)??[],y=f?.rules.filter(e=>e.edge===`bottom`)??[],b=e.columns.map((t,n)=>(0,Z.createElement)(`th`,{key:t.field,scope:`col`,className:t.align===`end`?`flint-table-end`:void 0,style:c9(u.header),"aria-sort":i?.column===n?i.descending?`descending`:`ascending`:`none`},(0,Z.createElement)(`button`,{type:`button`,title:`Sort by ${t.title}`,onClick:()=>a(t=>aun(e,t,n))},t.title,(0,Z.createElement)(`span`,{className:`flint-table-sort`,"aria-hidden":!0},i?.column===n?i.descending?`▼`:`▲`:``)))),x=c.map(t=>(0,Z.createElement)(`tr`,{key:t,"data-emphasized":s?.(t)||void 0,style:s&&!s(t)?{opacity:eun}:void 0},e.rows[t].map((t,n)=>(0,Z.createElement)(`td`,{key:e.columns[n].field,className:e.columns[n].align===`end`?`flint-table-end`:void 0},t.text))));return(0,Z.createElement)(`div`,{ref:m,className:n?`flint-table ${n}`:`flint-table`,style:{"--flint-table-bg":u.background,"--flint-table-rule":u.rule,"--flint-table-header-rule":u.headerRule,...r}},(0,Z.createElement)(`style`,null,tun),g.length>0?(0,Z.createElement)(`svg`,{className:`flint-table-furniture`,width:h,height:Math.max(...g.map(e=>(e.y??0)+e.height)),"aria-hidden":!0,dangerouslySetInnerHTML:{__html:$ln(g,h)}}):null,p&&!e.heading?(0,Z.createElement)(`div`,{className:`flint-table-room`,style:{height:_}}):null,e.heading?(0,Z.createElement)(`div`,{className:`flint-table-heading`,style:p?{paddingTop:_+2,paddingLeft:s9+p.beside.start,paddingRight:s9+p.beside.end}:void 0},e.heading.title?(0,Z.createElement)(`p`,{className:`flint-table-title`,style:c9(e.heading.style.title)},e.heading.title):null,e.heading.subtitle?(0,Z.createElement)(`p`,{className:`flint-table-subtitle`,style:c9(e.heading.style.subtitle)},e.heading.subtitle):null):null,...v.map((e,t)=>sun(e,t)),(0,Z.createElement)(`div`,{ref:l,className:`flint-table-scroll`},(0,Z.createElement)(`table`,null,(0,Z.createElement)(`thead`,null,(0,Z.createElement)(`tr`,null,b)),(0,Z.createElement)(`tbody`,{style:c9(u.body)},x))),d.length>0?(0,Z.createElement)(`p`,{className:`flint-table-note`,style:{...c9(u.header),fontSize:Math.max(10,u.header.fontSize-1)}},d.join(` · `)):null,...y.map((e,t)=>sun(e,t)),f?.source?lun(f.source):null)}function fun(e){try{return sln(e.interaction_spec).interactions}catch{return null}}var pun={width:400,height:320},mun=150,hun=4,gun=40,_un={boxSizing:`border-box`,width:`100%`,height:`100%`,overflow:`auto`,padding:12,display:`flex`,alignItems:`center`,justifyContent:`center`,textAlign:`center`,border:`1px dashed rgba(0, 0, 0, 0.15)`,borderRadius:4,background:`rgba(0, 0, 0, 0.02)`,color:`rgba(0, 0, 0, 0.5)`,font:`12px/1.5 system-ui, sans-serif`,overflowWrap:`anywhere`},vun=typeof window>`u`?Z.useEffect:Z.useLayoutEffect,yun=new WeakMap,bun=0;function xun(e){if(!e)return`none`;let t=yun.get(e);return t===void 0&&(t=++bun,yun.set(e,t)),`#${t}`}function Sun(e){let{data:t,...n}=e,{values:r,...i}=t??{};return`${JSON.stringify(n)}|${JSON.stringify(i)}|${xun(r)}`}function Cun(e){return JSON.stringify(e,(e,t)=>e===`rows`&&Array.isArray(t)||typeof Node<`u`&&t instanceof Node?xun(t):t)}function wun(e,t,n){let r=new Set(n.map(e=>e.id));return{apply:n.filter(t=>e.get(t.id)!==Cun(t)),clear:[...e.keys()].filter(e=>!r.has(e)&&t.get(e)!==`reader`)}}function Tun(e){return JSON.stringify(e.map(e=>U7(e)?[e.id,e.preset,e.filterControls.options]:L7(e)?[e.id,e.preset??`canvas`,e.presetOptions??null]:[e.id,`external`]))}function Eun(e){return typeof e==`number`?`${e}px`:e}function Dun(e,t,n){if(n===`crop`)return 1;let r=[];return t.width!==void 0&&r.push(t.width/e.width),t.height!==void 0&&r.push(t.height/e.height),Math.min(1,...r)}function Oun(e,t){let n=e=>e!==void 0&&eMath.abs((e??0)-(t??0))Sun(r),[r]),te=(0,Z.useMemo)(()=>fun(r),[U]),ne=(0,Z.useMemo)(()=>typeof a==`function`?{input:r.interaction_spec&&te?{...r,interaction_spec:{...r.interaction_spec,interactions:[]}}:r,definitions:a(te??[])}:{input:r,definitions:a??[]},[U,te,a]),W=(0,Z.useRef)(new Map);W.current=new Map(ne.definitions.map(e=>[e.id,e]));let G=Tun(ne.definitions),re=o!==void 0||(r.updates?.length??0)>0,K=te===null?1:typeof a==`function`?0:te.length,ie=re||ne.definitions.length>0||K>0,ae=(0,Z.useRef)(ie);ae.current=ie,(0,Z.useEffect)(()=>{let t=y.current;if(!t||R)return;let n=!0;k(null);let r=ne.definitions.map(e=>L7(e)?!e.handle||e.origin===`spec`||e.preset?e:{...e,handle:(t,n)=>{let r=W.current.get(e.id);return(r&&L7(r)?r:e).handle?.(t,n)??null}}:U7(e)?e:{...e,handle:(t,n)=>{let r=W.current.get(e.id)??e;return L7(r)?null:r.handle(t,n)}}),a=x.current.updates??[];S.current=new Map(a.map(e=>[e.id,Cun(e)])),C.current=new Map(a.map(e=>[e.id,`host`]));let o,l=document.createElement(`div`);D.current.length>0&&Object.assign(l.style,kun),t.append(l);let u=()=>{for(let e of D.current)e.surface.destroy(),e.stage.remove();D.current=[],l.removeAttribute(`style`)},d=e=>{let t=e instanceof Error?e:Error(String(e));u(),T(null),k(t.message),x.current.onError?.(t)};try{o=Kln(e,l,ne.input,{backend:i,renderer:s,background:c,chartId:g,renderers:x.current.renderers,expressionInterpreter:x.current.expressionInterpreter,ariaLabel:x.current.ariaLabel,interactions:r,updates:a,semanticUpdates:re,availableSize:F&&B.current?B.current:void 0}),ee.current=z}catch(e){l.remove(),d(e);return}b.current=o;let f=o.onChange(e=>{e.source===`reader`&&e.interactionId&&C.current.set(e.interactionId,`reader`),x.current.onChange?.(e)}),p=o.onInteraction(e=>x.current.onInteraction?.(e));return o.warnings.then(e=>{n&&x.current.onWarnings?.(e)}),o.ready.then(()=>{n&&(u(),A.current=o,T(o))},e=>{n&&d(e)}),()=>{n=!1,A.current=null,f(),p(),b.current===o&&(b.current=null),l.style.pointerEvents=`none`,D.current.push({surface:o,stage:l})}},[U,G,re,i,s,c,g,R,F,V]),(0,Z.useEffect)(()=>{let e=b.current;if(!e||!F||!z||z===ee.current)return;ee.current=z;let t=!0;return e.relayout(B.current??{}).then(n=>{!t||b.current!==e||(n?x.current.onRender?.(e):H(e=>e+1))}),()=>{t=!1}},[z,F]),(0,Z.useEffect)(()=>()=>{for(let e of D.current)e.surface.destroy(),e.stage.remove();D.current=[]},[]),vun(()=>{let e=_.current;if(!F||!e||typeof ResizeObserver>`u`){L(null);return}let t=()=>{L(t=>Oun(t,{width:l===void 0?void 0:Math.floor(e.clientWidth),height:u===void 0?void 0:Math.floor(e.clientHeight)}))};t();let n,r=new ResizeObserver(()=>{clearTimeout(n),n=setTimeout(t,mun)});return r.observe(e),()=>{r.disconnect(),clearTimeout(n)}},[F,l,u]),(0,Z.useEffect)(()=>{for(let e of y.current?.querySelectorAll(`[data-flint-chart-id]`)??[])e.setAttribute(`aria-label`,h??ne.input.chart_spec.title??`Interactive chart`)},[h]),(0,Z.useEffect)(()=>{let e=b.current;if(!e)return;let t=wun(S.current,C.current,o??[]);if(!(t.apply.length===0&&t.clear.length===0)){for(let e of t.apply)S.current.set(e.id,Cun(e)),C.current.set(e.id,`host`);for(let e of[...S.current.keys()])(o??[]).some(t=>t.id===e)||S.current.delete(e);(async()=>{for(let n of t.apply)await e.applyUpdate(n);for(let n of t.clear)await e.clearUpdate(n);b.current===e&&x.current.onRender?.(e)})()}},[o]),vun(()=>{let e=_.current,t=v.current;if(!e||!t||!E||typeof ResizeObserver>`u`)return;let n=()=>{let n=t.offsetWidth,r=t.offsetHeight;if(n===0||r===0)return;let i=Dun({width:n,height:r},{width:l===void 0?void 0:e.clientWidth,height:u===void 0?void 0:e.clientHeight},d);P(e=>e?.width===n&&e.height===r?e:{width:n,height:r}),M(e=>Math.abs(e-i)<.001?e:i)},r=new ResizeObserver(n);return r.observe(e),r.observe(t),n(),()=>r.disconnect()},[w,l,u,d]),(0,Z.useEffect)(()=>{b.current?.refresh()},[j]),vun(()=>{let e=A.current;!e||e!==w||(A.current=null,x.current.onRender?.(e))},[w]),(0,Z.useImperativeHandle)(n,()=>({get surface(){return b.current},applyUpdate:async(e,t)=>{let n=b.current;return n?ae.current?(C.current.set(e.id,`host`),n.applyUpdate(e,t)):(console.warn("FlintChart: this chart has no interactions, so it renders static. Pass `updates` (even `[]`) to update it."),null):null},clearUpdate:async e=>{await b.current?.clearUpdate(e)},dispatch:async(e,t)=>b.current?.dispatch(e,t)??null,getState:()=>b.current?.getState(),refresh:()=>b.current?.refresh()}),[]);let oe=r.chart_spec.baseSize??pun,se={width:Math.min(oe.width,I?.width??1/0),height:Math.min(oe.height,I?.height??1/0)},ce=N&&j!==1?{width:N.width*j,height:N.height*j}:null,le={position:`relative`,width:Eun(l)??(ce?ce.width:void 0),height:Eun(u)??(ce?ce.height:void 0),overflow:l===void 0&&u===void 0?void 0:`hidden`,...l!==void 0||u!==void 0?{display:`flex`,justifyContent:d===`crop`?`safe center`:`center`,alignItems:d===`crop`?`safe center`:`center`,minWidth:0,minHeight:0}:{},...m},ue={width:`max-content`,flex:`none`,transformOrigin:`center`,...j===1?{}:{transform:`scale(${j})`}},q=E?{position:`relative`}:{position:`relative`,width:se.width,height:se.height},J=O===null?f===void 0?null:f:(0,Z.createElement)(`div`,{role:`alert`,"data-flint-chart-error":``,style:_un},`Chart could not render: ${O}`);return(0,Z.createElement)(`div`,{ref:_,className:p,style:le},!E&&J!==null?(0,Z.createElement)(`div`,{style:{position:`absolute`,inset:0}},J):null,(0,Z.createElement)(`div`,{ref:v,style:ue},(0,Z.createElement)(`div`,{ref:y,style:q})))})}var jun=Aun({vegalite:()=>np(()=>Promise.resolve().then(()=>(irn(),FAt)).then(e=>e.createVegaInteractiveRenderer),void 0,import.meta.url)});bk();function Mun(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Nun={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},Pun={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Fun={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e},Iun=Array.prototype.slice,u9=(e,t,n)=>{let r=n?n(t[0]):t[0];return r[e].apply(r,Iun.call(t,1))},Lun={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t=0,n=1,r=0,i=0,a=0,o=0)=>mk(e)?new Date(e):new Date(e,t,n,r,i,a,o),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return u9(`join`,arguments)},indexof:function(){return u9(`indexOf`,arguments)},lastindexof:function(){return u9(`lastIndexOf`,arguments)},slice:function(){return u9(`slice`,arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(nk),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return u9(`substring`,arguments,String)},split:function(){return u9(`split`,arguments,String)},replace:function(){return u9(`replace`,arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)},Run=[`view`,`item`,`group`,`xy`,`x`,`y`],zun=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate==`function`&&zun.add(setImmediate);var Bun={Literal:(e,t)=>t.value,Identifier:(e,t)=>{let n=t.name;return e.memberDepth>0?n:n===`datum`?e.datum:n===`event`?e.event:n===`item`?e.item:Nun[n]||e.params[`$`+n]},MemberExpression:(e,t)=>{let n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);let i=e(t.property);if(n&&--e.memberDepth,zun.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{let n=t.arguments,r=t.callee.name;return r.startsWith(`_`)&&(r=r.slice(1)),r===`if`?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||Lun[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Pun[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Fun[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator===`&&`?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((t,n)=>{e.memberDepth+=1;let r=e(n.key);--e.memberDepth;let i=e(n.value);return KJe.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):zun.has(i)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):t[r]=i,t},{})};function d9(e,t,n,r,i,a){let o=e=>Bun[e.type](o,e);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=r,o.event=i,o.item=a,Run.forEach(e=>o.fn[e]=(...t)=>i.vega[e](...t)),o(e)}var f9={operator(e,t){let n=t.ast,r=e.functions;return e=>d9(n,r,e)},parameter(e,t){let n=t.ast,r=e.functions;return(e,t)=>d9(n,r,t,e)},event(e,t){let n=t.ast,r=e.functions;return e=>d9(n,r,void 0,void 0,e)},handler(e,t){let n=t.ast,r=e.functions;return(e,t)=>{let i=t.item&&t.item.datum;return d9(n,r,e,i,t)}},encode(e,t){let{marktype:n,channels:r}=t,i=e.functions,a=n===`group`||n===`image`||n===`rect`;return(e,t)=>{let o=e.datum,s=0,c;for(let n in r)c=d9(r[n].ast,i,t,o,void 0,e),e[n]!==c&&(e[n]=c,s=1);return n!==`rule`&&Mun(e,r,a),s}}},Vun={compact:180,standard:340,tall:468},Hun=new Set([`Line Chart`,`Area Chart`,`Streamgraph`,`Range Area Chart`,`Bump Chart`,`Candlestick Chart`,`Calendar Heatmap`,`Gantt Chart`,`Map`,`Choropleth`]),Uun={compact:0,standard:1,tall:2},p9=e=>e===`KPI Card`;function Wun(e,t){return t?Math.max(1,Math.min(4,Math.round(t))):e.filter(e=>!p9(e.chartType)).length>=2?2:1}function Gun(e,t){let n=e.layout?.span??(Hun.has(e.chartType)?t:1);return Math.max(1,Math.min(t,Math.round(n)))}var Kun=720,qun=(e,t)=>Math.max(1,Math.floor((e+24)/(t+24)));function Jun(e,t,n){let r=n===void 0?t:Math.min(t,qun(n,340)),i=n===void 0?4:Math.min(4,qun(n,140)),a=r===1,o=n===void 0||n>=Kun,s=[],c=0;for(;c({id:e.id,kpi:!0,units:12/r.length}))})}continue}let n=[],l=0;for(;c0&&l+t>r||(n.push({chart:e[c],span:t}),l+=t,c+=1,l>=r))break}let u=n.map(({span:e})=>Math.round(12*e/l));u[u.length-1]+=12-u.reduce((e,t)=>e+t,0);let d=o&&n.length===1&&Hun.has(n[0].chart.chartType)&&!n[0].chart.layout?.height;s.push({kpi:!1,height:d?`tall`:Yun(n.map(({chart:e})=>e),`standard`),charts:n.map(({chart:e},t)=>({id:e.id,kpi:!1,units:u[t]}))})}return s}function Yun(e,t){return e.map(e=>e.layout?.height??t).reduce((e,t)=>Uun[t]>Uun[e]?t:e,e.length?`compact`:t)}var Xun={12:`full width`,9:`three quarters`,8:`two thirds`,6:`half`,4:`a third`,3:`a quarter`},Zun=[`color`,`group`];function Qun(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.field;return typeof t==`string`?t:void 0}}function $un(e){return Zun.find(t=>Qun(e.chart_spec.encodings?.[t])!==void 0)}function edn(e){let t=$un(e);return t?Qun(e.chart_spec.encodings?.[t]):void 0}function tdn(e){let t=new Map;for(let n of e){let e=edn(n);e&&t.set(e,(t.get(e)??0)+1)}let n=new Map;for(let[r,i]of t){if(i<2)continue;let t=new Map;for(let n of e)if(edn(n)===r)for(let e of n.data.values??[]){let n=e?.[r];n!=null&&!t.has(String(n))&&t.set(String(n),n)}[...t.values()].every(e=>typeof e==`number`)||n.set(r,[...t.values()])}return n}function ndn(e,t){let n=$un(e);if(!n)return e;let r=e.chart_spec.encodings?.[n],i=typeof r==`string`?{field:r}:r;return i.sortBy!==void 0||i.sortOrder!==void 0?e:{...e,chart_spec:{...e.chart_spec,encodings:{...e.chart_spec.encodings,[n]:{...i,sortBy:JSON.stringify(t)}}}}}var rdn={w:3,h:9},idn={w:2,h:6},m9=(e,t)=>e.id!==t.id&&e.xe.ye===t)},i=e.filter(({id:e})=>e!==t).map(e=>({...e}));for(let e of i)if(!(!adn(r,e)||!m9(r,e))){if(e.x>=r.x+r.w/2){let t=e.x+e.w,i=r.x+r.w;t-i>=n(e.id)&&(e.x=i,e.w=t-i)}else if(e.x+e.w<=r.x+r.w/2){let t=r.x-e.x;t>=n(e.id)&&(e.w=t)}}let a=[r];for(let e of i.sort((e,t)=>e.y-t.y||e.x-t.x)){let t=a.find(t=>m9(t,e));for(;t;)e.y=t.y+t.h,t=a.find(t=>m9(t,e));a.push(e)}let o=[r];for(let e of a.slice(1).sort((e,t)=>e.y-t.y||e.x-t.x)){for(let t=0;tm9(n,{...e,y:t}))){e.y=t;break}o.push(e)}return e.map(({id:e})=>o.find(t=>t.id===e))}function odn(e,t,n,r){let i=e.find(({id:e})=>e===t),a=e.find(({id:e})=>e===n);return!i||!a?[...e]:h9(e.map(e=>e.id===t?{...a,id:t}:e.id===n?{...i,id:n}:e),t,r)}function sdn(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x).map(e=>`- ${e.id}: columns ${e.x+1}–${e.x+e.w}, rows ${e.y+1}–${e.y+e.h} (${Xun[e.w]??`${e.w}/12`}, ${e.h*20}px tall)`)}function g9(e,t){let n=t?.chartType,r=t?.arrange;return{chartType:n?.labels[n.index]??e.chart_spec.chartType,...r&&r.index>0?{arrange:r.labels[r.index]}:{}}}var cdn=new Set([`chartType`,`arrange`,`pivot`]);function _9(e){if(e==null)return``;if(e instanceof Date)return e.toISOString().slice(0,10);if(typeof e==`object`){let t=e;return`start`in t&&`end`in t?`${v9(t.start)} to ${v9(t.end)}`:JSON.stringify(e)}return String(e).replace(/\s+/g,` `)}function v9(e){return typeof e==`number`?String(Number(e.toPrecision(6))):_9(e)}function y9(e,t){return`${e} ${t}${e===1?``:`s`}`}function b9(e,t){return JSON.stringify(e??null)===JSON.stringify(t??null)}function x9(e){return(Array.isArray(e)?e:e===void 0?[]:[e]).map(e=>typeof e==`string`?e:e.field??e.aggregate).filter(e=>e!==void 0)}function ldn(e,t){return x9(e.chart_spec.encodings?.[t])[0]}function S9(e){let t=e.theme_spec;return t===void 0?`default`:typeof t==`string`?t:t.extends?`${t.extends} (customized)`:t.id??`custom`}function udn(e){return Object.entries(e.chart_spec.encodings??{}).map(([e,t])=>`${e} = ${x9(t).join(` + `)||`(none)`}`).join(`, `)}function ddn(e,t,n,r){let i=e.chart_spec,a=t.chart_spec,o=[];n.chartType!==r.chartType&&o.push(`chart type ${n.chartType} → ${r.chartType}`),n.arrange!==r.arrange&&o.push(`view ${n.arrange??`default`} → ${r.arrange??`default`}`),b9(i.title,a.title)||o.push(`title "${i.title??``}" → "${a.title??``}"`),b9(e.theme_spec,t.theme_spec)||o.push(`theme ${S9(e)} → ${S9(t)}`);for(let e of new Set([...Object.keys(i.encodings??{}),...Object.keys(a.encodings??{})])){let t=x9(i.encodings?.[e]).join(` + `)||`(none)`,n=x9(a.encodings?.[e]).join(` + `)||`(none)`;t!==n&&o.push(`${e} ${t} → ${n}`)}let s=[...new Set([...Object.keys(i.chartProperties??{}),...Object.keys(a.chartProperties??{})].filter(e=>!cdn.has(e)))].filter(e=>!b9(i.chartProperties?.[e],a.chartProperties?.[e])).length;for(let e of[`subtitle`,`label`,`source`,`chrome`,`baseSize`,`canvasSize`])b9(i[e],a[e])||(s+=1);return s>0&&o.push(`${o.length>0?`and `:``}${y9(s,`style option`)}`),o}function fdn(e){if(typeof e==`number`)return e;if(e instanceof Date)return e.getTime();if(typeof e==`string`){let t=Date.parse(e);return Number.isNaN(t)?void 0:t}}function pdn(e,t,n,r){if(!t)return!1;let i=fdn(n),a=fdn(r);if(i===void 0||a===void 0)return!1;let o=e.map(e=>fdn(e[t])).filter(e=>e!==void 0);return o.length!==0&&Math.min(i,a)<=Math.min(...o)&&Math.max(i,a)>=Math.max(...o)}function mdn(e,t,n){if(n?.kind===`interval`)return`${e??t} from ${v9(n.start)} to ${v9(n.end)}`}function hdn(e,t,n,r){if(t?.kind!==`interval`)return;let i=ldn(r,e);if(!pdn(n,i,t.start,t.end))return`The ${e} axis shows ${mdn(i,e,t)}.`}function gdn(e){return new Set((e.data.values??[]).flatMap(e=>Object.keys(e)))}function C9(e,t){return e.map(e=>{let n=Object.entries(e.value).filter(([e])=>!e.startsWith(`__`)),r=n.filter(([e])=>t.has(e));return Object.fromEntries(r.length>0?r:n)})}function _dn(e){return Object.entries(e).map(([e,t])=>`${e} = ${_9(t)}`).join(`, `)}function vdn(e){let[t,...n]=e;return t?Object.fromEntries(Object.entries(t).filter(([e,t])=>n.every(n=>JSON.stringify(n[e])===JSON.stringify(t)))):{}}var ydn=new Set([`brush-x`,`brush-y`,`select-region`]);function bdn(e,t){if(!e?.action||!ydn.has(e.action))return;let n=e.geometry?.plot,r=n?.kind===`rect`?n.axis:`xy`,i=[`x`,`y`].filter(e=>r===`xy`||r===e).map(n=>mdn(ldn(t,n),n,e.geometry?.domain?.[n])).filter(e=>e!==void 0);return i.length>0?i.join(` and `):void 0}function xdn(e,t){let n=y9(e.length,`mark`),r=e.length>1?vdn(e):e[0],i=t??(Object.keys(r).length>0?_dn(r):void 0);if(i)return[`emphasizes ${n} where ${i}`];let a=e.slice(0,20),o=[`emphasizes ${n}:`,...a.map(e=>` - ${_dn(e)}`)];return e.length>a.length&&o.push(` … and ${y9(e.length-a.length,`more mark`)}`),o}function Sdn(e,t){if(`select`in e)return qy(e);let n=C9(e.elements,t),r=n.length>1?vdn(n):n[0]??{};return Object.keys(r).length>0?_dn(r):y9(n.length,`mark`)}var Cdn=` (out of view at the current zoom, so not drawn)`;function wdn(e,t){return`note${e.text===void 0?``:` "${e.text}"`} at ${Sdn(e.target,t)}${e.inView===!1?Cdn:``}`}function Tdn(e,t){return`in`in t?`${e} in [${t.in.map(_9).join(`, `)}]`:`${e} from ${v9(t.range[0])} to ${v9(t.range[1])}`}function Edn(e){switch(e.op){case`set-style`:return e.targets;case`annotate-text`:case`set-annotation`:return[e.target];case`annotate-enclosure`:return e.value?.targets??[];case`set-freeform-overlay`:return e.value?.body.flatMap(e=>e.type===`clone`?e.targets:[])??[];default:return[]}}function Ddn(e,t,n){if(!n)return{ok:!0};if(n.unsupportedOps.includes(e.op))return{ok:!1,reason:t.reason??`the chart could not apply it.`};let r=new Set(n.unresolvedTargets.map(e=>JSON.stringify(e)));return Edn(e).some(e=>r.has(JSON.stringify(e)))?{ok:!1,reason:t.reason??`its target matched no mark.`}:{ok:!0}}function Odn(e,t,n,r,i,a){let o=[`- ${e.id}:`];return e.ops.forEach((s,c)=>{let l=t?.ops[c]??{op:s.op,text:s.op,ok:!0},u=r?Ddn(s,l,i):{ok:l.ok,reason:l.reason},d=l.text,f=[];if(u.ok&&n&&s.op===`set-style`&&(s.value.state===`emphasized`||s.value.state===`focused`)&&s.targets.length>0){let t=C9(n.entries?.get(e.id)?.elements??[],a);t.length===0?(u.ok=!1,u.reason=l.reason??`its targets matched no mark.`):[d,...f]=xdn(t,void 0)}u.ok&&(s.op===`annotate-text`||s.op===`set-annotation`)&&s.value&&n?.annotations?.find(t=>t.id===e.id&&JSON.stringify(t.target)===JSON.stringify(s.target))?.inView===!1&&(d+=Cdn),o.push(u.ok?` ✓ ${d}`:` ✗ ${d}: ${u.reason}`,...f.map(e=>` ${e}`))}),o}function kdn(e){let t=(e.interaction_spec?.interactions??[]).map(e=>typeof e==`string`?e:e?.type).filter(e=>typeof e==`string`);return t.length>0?t.join(`, `):void 0}function Adn(e){let{agent:t,shown:n,updates:r=[],warnings:i=[],gestures:a}=e,o=e.state,s=e.checks??[],c=e.agentView??g9(t),l=e.shownView??g9(n),u=n.chart_spec,d=n.data.values??[],f=new Set(r.map(e=>e.id)),p=gdn(n),m=[],h=l.arrange?`, view ${l.arrange}`:``;m.push(`Chart "${u.title??l.chartType}": ${l.chartType}${h}, theme ${S9(n)}.`);let g=ddn(t,n,c,l);g.length>0&&m.push(`Edited in panel: ${g.join(`, `)}.`),m.push(`Encodings: ${udn(n)}.`);let _=kdn(n);_&&m.push(`Interactions: ${_}.`);let v=e.table;if(v){let e=v.total>v.rows.length?` (the chart draws ${v.rows.length} of ${v.total})`:``,t=v.computes.length>0?`; the chart computes its ${v.computes.join(`, `)} from these rows`:``,n=wT(u.chartType)?`A table of`:`Shown as a table:`;m.push(`${n} ${v.rows.length} rows${e}, columns ${v.columns.map(e=>e.title).join(`, `)}${t}.`)}let y=new Map(i.flatMap(e=>e.update?[[e.update.id,e.update]]:[])),b=new Set((e.drawnUpdates??[]).map(e=>JSON.stringify(e)));if(r.length>0){m.push(`Agent updates (yours):`);for(let e of r){let t=!!o&&b.has(JSON.stringify(e)),n=s.find(t=>t.id===e.id);m.push(...Odn(e,n,o,t,y.get(e.id),p))}}let x=[],S=[];for(let[e,t]of o?.entries??[]){if(f.has(e)||t.layer!==`retained`||t.elements.length===0)continue;let r=C9(t.elements,p);S.push({id:e,marks:r});let[i,...o]=xdn(r,bdn(a?.get(e),n));x.push(`- ${e}: ${i}${o.length>0?``:`.`}`,...o)}let C=(o?.annotations??[]).filter(e=>!f.has(e.id));for(let e of C)x.push(`- ${e.id}: ${wdn(e,p)}.`);let w=o?.hidden??[];w.length>0&&x.push(`- Hidden: ${w.map(e=>_9(e.value)).join(`, `)}.`);let T=Object.entries(o?.filters??{});T.length>0&&x.push(`- Filters: ${T.map(([e,t])=>Tdn(e,t)).join(`; `)}.`),m.push(x.length>0?`User interactions:`:`User interactions: none.`,...x);for(let e of[`x`,`y`]){let t=hdn(e,o?.viewport?.[e],d,n);t&&m.push(t)}let E=i.filter(e=>!e.update&&e.code!==`update_not_applied`);return E.length>0&&m.push(`Warnings:`,...E.map(e=>`- ${e.message}`)),{text:m.join(` +`),data:{chartType:l.chartType,...l.arrange?{view:l.arrange}:{},...v?{shownAs:`table`,table:{columns:v.columns.map(({field:e,title:t})=>({field:e,title:t})),rows:v.rows.length,total:v.total,computes:v.computes}}:{},title:u.title,theme:S9(n),encodings:Object.fromEntries(Object.entries(u.encodings??{}).map(([e,t])=>[e,x9(t)])),editedInPanel:g,agentUpdates:r.map(e=>({id:e.id,ops:s.find(t=>t.id===e.id)?.ops??[],marks:C9(o?.entries?.get(e.id)?.elements??[],p),annotations:(o?.annotations??[]).filter(t=>t.id===e.id)})),userInteractions:S,userAnnotations:C,hidden:w,filters:o?.filters??{},viewport:o?.viewport,warnings:E.map(({code:e,message:t})=>({code:e,message:t}))}}}vAt(),mG();var jdn=`#ffffff`,Mdn={width:300,height:300},w9={width:588,height:468},Ndn=240,Pdn=1920,Fdn=4;function Idn(e,t){let n=Math.max(e,t);return!Number.isFinite(n)||n<=0?2:Math.min(Fdn,Math.max(1,Pdn/n))}function Ldn(e){try{return Lv(e.theme_spec)?.compileDefaults?.baseSize}catch{return}}function Rdn(e){let t=Number.isFinite(e?.height)&&e.height>0?Math.floor(e.height):w9.height,n=Math.floor(e?.width??NaN);return!Number.isFinite(n)||nvoid 0),e&&t.complete&&t.naturalWidth&&(e.clearRect(0,0,u.width,u.height),e.drawImage(t,0,0,u.width,u.height))}if(d.length&&!f.length){let e=u.getContext(`2d`);if(e){e.setTransform(1,0,0,1,0,0);let t=u.width/c,n=u.height/c;for(let r of d){let i=Fve(r,t,n);if(r.text!==void 0){let n=r.fontSize??11,a=r.left===void 0&&r.x===void 0&&r.right!==void 0;e.font=`${r.fontStyle??`normal`} ${r.fontWeight??`normal`} ${n*c}px ${r.font??`sans-serif`}`,e.fillStyle=r.color??`#000000`,e.textAlign=r.center?`center`:a?`right`:`left`;let o=r.center?((r.left??0)+t-(r.right??0))/2:a?t-(r.right??0):i.x;e.fillText(r.text,o*c,(i.y+n*.82)*c)}else if(r.src){let t=new Image;t.src=r.src,await t.decode().catch(()=>void 0),t.complete&&t.naturalWidth&&e.drawImage(t,i.x*c,i.y*c,i.width*c,i.height*c)}else e.fillStyle=r.color??`#000000`,e.fillRect(i.x*c,i.y*c,i.width*c,i.height*c)}}}let m=await new Promise((e,t)=>{u.toBlob(n=>n?e(n):t(Error(`Could not encode chart PNG`)),`image/png`)});return s.finalize(),{svg:p,png:m,pngSize:{width:u.width,height:u.height},vlSpec:a,warnings:i}}var T9=2;function Gdn(e,t,n){let r=t.getBoundingClientRect(),i=r.left-n.left,a=r.top-n.top,o=getComputedStyle(t);e.save(),e.beginPath(),e.rect(i,a,r.width,r.height),e.clip(),e.fillStyle=o.backgroundColor,e.fillRect(i,a,r.width,r.height);let s=o.getPropertyValue(`--flint-table-header-rule`).trim(),c=t.querySelector(`thead`)?.getBoundingClientRect();for(let i of t.querySelectorAll(`th, td`)){let t=i.getBoundingClientRect();if(t.bottomr.bottom||i.tagName===`TD`&&c&&t.bottom<=c.bottom)continue;let a=getComputedStyle(i),l=i.parentElement?Number(getComputedStyle(i.parentElement).opacity):1;e.globalAlpha=Number.isFinite(l)?l:1;let u=t.left-n.left,d=t.top-n.top;i.tagName===`TH`&&(e.fillStyle=o.backgroundColor,e.fillRect(u,d,t.width,t.height));let f=i.tagName===`TH`?s:a.borderBottomColor,p=i.tagName===`TH`?1:parseFloat(a.borderBottomWidth);f&&p>0&&(e.fillStyle=f,e.fillRect(u,d+t.height-p,t.width,p));let m=i.textContent?.trim();if(!m)continue;let h=getComputedStyle(i.querySelector(`button`)??i);e.font=`${h.fontStyle} ${h.fontWeight} ${h.fontSize} ${h.fontFamily}`,e.fillStyle=h.color,e.textBaseline=`middle`;let g=a.textAlign===`right`||i.classList.contains(`flint-table-end`);e.textAlign=g?`right`:`left`;let _=parseFloat(h.paddingLeft)||parseFloat(a.paddingLeft)||0;e.fillText(m,g?u+t.width-_:u+_,d+t.height/2)}e.globalAlpha=1;for(let r of t.querySelectorAll(`.flint-table-furniture rect, .flint-table-rule`)){let t=r.getBoundingClientRect(),i=r instanceof HTMLElement?getComputedStyle(r).backgroundColor:r.getAttribute(`fill`);!i||t.width===0||t.height===0||(e.fillStyle=i,e.fillRect(t.left-n.left,t.top-n.top,t.width,t.height))}e.textAlign=`left`;for(let i of t.querySelectorAll(`.flint-table-source-line`)){let t=i.getBoundingClientRect();if(t.bottomr.bottom)continue;let a=getComputedStyle(i);e.font=`${a.fontStyle} ${a.fontWeight} ${a.fontSize} ${a.fontFamily}`,e.fillStyle=a.color,e.textBaseline=`middle`;let[o,s]=[...i.children],c=t.top-n.top+t.height/2;o?.textContent?.trim()&&e.fillText(o.textContent.trim(),t.left-n.left,c),s?.textContent?.trim()&&(e.textAlign=`right`,e.fillText(s.textContent.trim(),t.right-n.left,c),e.textAlign=`left`)}for(let i of t.querySelectorAll(`.flint-table-title, .flint-table-subtitle, .flint-table-note`)){let t=i.textContent?.trim();if(!t)continue;let a=i.getBoundingClientRect();if(a.bottomr.bottom)continue;let o=getComputedStyle(i);e.font=`${o.fontStyle} ${o.fontWeight} ${o.fontSize} ${o.fontFamily}`,e.fillStyle=o.color,e.textBaseline=`middle`;let s=parseFloat(o.paddingLeft)||0;e.fillText(t,a.left-n.left+s,a.top-n.top+a.height/2)}e.restore()}function Kdn(e){let t=e.getBoundingClientRect(),n=document.createElement(`canvas`);n.width=Math.ceil(t.width*T9),n.height=Math.ceil(t.height*T9);let r=n.getContext(`2d`);return r?(r.scale(T9,T9),Gdn(r,e,t),new Promise((e,t)=>{n.toBlob(n=>n?e(n):t(Error(`The table could not be exported`)),`image/png`)})):Promise.reject(Error(`No canvas to draw on`))}var E9=2,qdn=`.board-title, .board-subtitle, .board-source`,Jdn=`.board-header, .board-cell, .board-tile, .board-source`;function Ydn(e,t){let n=e.cloneNode(!0);n.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),t&&(n.setAttribute(`width`,String(t.width)),n.setAttribute(`height`,String(t.height)));let r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(n))}`;return new Promise((e,t)=>{let n=new Image;n.onload=()=>e(n),n.onerror=()=>t(Error(`A chart could not be drawn`)),n.src=r})}function Xdn(e,t,n){let r=[],i=``;for(let a of t.split(/\s+/).filter(Boolean)){let t=i?`${i} ${a}`:a;i&&e.measureText(t).width>n?(r.push(i),i=a):i=t}return i&&r.push(i),r}async function Zdn(e){let t=e.getBoundingClientRect(),n=e.querySelector(`.board-bar`)?.getBoundingClientRect(),r=(n?n.top:t.bottom)-t.top,i=document.createElement(`canvas`);i.width=Math.ceil(t.width*E9),i.height=Math.ceil(r*E9);let a=i.getContext(`2d`);if(!a)throw Error(`No canvas to draw on`);a.scale(E9,E9),a.fillStyle=getComputedStyle(e).backgroundColor||`#ffffff`,a.fillRect(0,0,t.width,r);let o=e=>({x:e.left-t.left,y:e.top-t.top});for(let t of e.querySelectorAll(`:scope > .board-furniture`)){let e=t.getBoundingClientRect(),{x:n,y:r}=o(e);a.drawImage(await Ydn(t),n,r,e.width,e.height)}for(let t of e.querySelectorAll(`.board-rule`)){let e=t.getBoundingClientRect(),{x:n,y:r}=o(e);a.fillStyle=getComputedStyle(t).backgroundColor,a.fillRect(n,r,e.width,e.height)}for(let t of e.querySelectorAll(Jdn)){if(t.closest(`.board-bar`))continue;let e=getComputedStyle(t),n=t.getBoundingClientRect(),{x:r,y:i}=o(n);for(let[t,o]of[[`Top`,i],[`Bottom`,i+n.height]]){let i=parseFloat(e.getPropertyValue(`border-${t.toLowerCase()}-width`)),s=e.getPropertyValue(`border-${t.toLowerCase()}-color`);!(i>0)||e.getPropertyValue(`border-${t.toLowerCase()}-style`)===`none`||s===`rgba(0, 0, 0, 0)`||(a.fillStyle=s,a.fillRect(r,t===`Top`?o:o-i,n.width,i))}}for(let t of e.querySelectorAll(qdn)){let e=t.textContent?.trim();if(!e)continue;let n=getComputedStyle(t),r=t.getBoundingClientRect(),{x:i,y:s}=o(r);a.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,a.fillStyle=n.color,a.textBaseline=`top`;let c=parseFloat(n.fontSize),l=parseFloat(n.lineHeight)||c*1.25,u=s+(t.matches(`.board-source`)&&parseFloat(n.paddingTop)||0);Xdn(a,e,r.width).forEach((e,t)=>{a.fillText(e,i,u+t*l+(l-c)/2)})}for(let t of e.querySelectorAll(`.board-cell-chart svg`)){if(t.parentElement?.closest(`svg`)||getComputedStyle(t).visibility===`hidden`)continue;let e=t.classList.contains(`flint-canvas-furniture`)?t.previousElementSibling:null,n=t.getBoundingClientRect(),r=e?e.getBoundingClientRect():n;if(r.width===0||r.height===0)continue;let{x:i,y:s}=o(n);a.drawImage(await Ydn(t,e?r:void 0),i,s,r.width,r.height)}for(let n of e.querySelectorAll(`.board-cell-chart .flint-table`))Gdn(a,n,t);return new Promise((e,t)=>{i.toBlob(n=>n?e(n):t(Error(`The board could not be exported`)),`image/png`)})}var Qdn=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),$=n(((e,t)=>{t.exports=Qdn()}))(),$dn=3;function D9(e,t,n){let r=(t?.data.values??[]).find(e=>e?.[n]!=null)?.[n];if(typeof e==`number`&&typeof r==`string`){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,r.length<=7?7:10)}if(typeof e==`number`&&t?.semantic_types?.[n]===`Year`&&Math.abs(e)>=1e5){let t=new Date(e);if(!Number.isNaN(t.getTime()))return String(t.getUTCFullYear())}return String(e)}function efn(e,t){let n=(e,n)=>{let r=new Map;for(let i of t){let t=JSON.stringify(i?.[e]),a=JSON.stringify(i?.[n]);if(r.has(t)&&r.get(t)!==a)return!1;r.set(t,a)}return t.length>0},r={};for(let t of e){let i=e.find(i=>i!==t&&!(i in r)&&n(i,t)&&(!n(t,i)||e.indexOf(i)D9(t,n,e);if(`range`in t)return`${e} from ${r(t.range[0])} to ${r(t.range[1])}`;let i=t.in.slice(0,8).map(r).join(`, `);return`${e} ${t.in.length===1?i:`in ${i}${t.in.length>8?`, and ${t.in.length-8} more`:``}`}`}function rfn(e){let{chips:t,onRemove:n,onClear:r}=e;if(t.length===0)return null;let i=t.slice(0,$dn),a=t.slice($dn);return(0,$.jsxs)(`div`,{className:`board-selection`,role:`status`,"aria-label":`Selection`,children:[i.map(e=>(0,$.jsxs)(`span`,{className:n?`board-chip board-chip-removable`:`board-chip`,title:e.full,children:[(0,$.jsx)(`span`,{className:`board-chip-text`,children:e.label}),n&&(0,$.jsx)(`button`,{type:`button`,className:`board-chip-clear`,"aria-label":`Remove ${e.full}`,onClick:()=>n(e.field),children:`×`})]},e.field)),a.length>0&&(0,$.jsxs)(`span`,{className:`board-chip board-chip-more`,title:a.map(e=>e.full).join(` +`),children:[`+`,a.length]}),n?t.length>1&&(0,$.jsx)(`button`,{type:`button`,className:`board-selection-clear-all`,onClick:r,children:`Clear`}):(0,$.jsx)(`button`,{type:`button`,className:`board-chip-clear`,"aria-label":`Clear the selection`,title:`Clear the selection`,onClick:r,children:`×`})]})}function ifn(e){let[t,n]=(0,Z.useState)({}),r=(0,Z.useRef)(e);return r.current=e,(0,Z.useEffect)(()=>n(t=>{let n=Object.entries(t).filter(([t,n])=>e.find(e=>e.id===t)?.view===n.agent);return n.length===Object.keys(t).length?t:Object.fromEntries(n)}),[e]),{viewOf:(0,Z.useCallback)(e=>{if(wT(e.input.chart_spec.chartType))return`table`;let n=t[e.id];return n&&n.agent===e.view?n.view:e.view??`chart`},[t]),setView:(0,Z.useCallback)((e,t)=>{let i=r.current.find(t=>t.id===e)?.view;n(n=>({...n,[e]:{view:t,agent:i}}))},[])}}function afn(e,t){return(0,Z.useMemo)(()=>{if(t!==`table`||!e)return null;try{return aPe(e)}catch{return null}},[e,t])}function ofn({view:e,onView:t,name:n}){return(0,$.jsx)(`button`,{type:`button`,className:`bar-link board-view-switch`,"aria-pressed":e===`table`,"aria-label":`${sfn[e]}: ${n}`,title:sfn[e],onClick:()=>t(e===`chart`?`table`:`chart`),children:(0,$.jsx)(cfn,{view:e})})}var sfn={chart:`Show as table`,table:`Show as chart`};function cfn({view:e}){return e===`chart`?(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`1.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,$.jsx)(`path`,{d:`M1.5 6.2H14.5M1.5 9.8H14.5M6 6.2V13.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`})]}):(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`path`,{d:`M2 14.5H14.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`}),(0,$.jsx)(`path`,{d:`M3.5 12.5V8M7.2 12.5V3.5M11 12.5V6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}var lfn=u();function ufn(e){return`data:image/svg+xml,${encodeURIComponent(e)}`}var O9=[{value:void 0,label:`Flint default`,icon:vfe,description:`Flint's own defaults — no house applied.`},...Object.values(Iv).map(e=>({value:e.id,label:e.label,icon:e.icon,description:e.description}))];function dfn(e){let{themeSpec:t,customTheme:n,onTheme:r}=e,[i,a]=(0,Z.useState)(!1),o=(0,Z.useRef)(null),s=n??(typeof t==`object`?t:void 0),c=s?.extends?Iv[s.extends]:void 0,l=s?{value:s,label:s.label??s.id??`Custom theme`,icon:c?.icon??vfe,description:`Custom ThemeSpec supplied with this chart.`}:void 0,u=l?[l,...O9]:O9,d=typeof t==`object`?l??O9[0]:O9.find(e=>e.value===t)??O9[0];return(0,Z.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),(0,$.jsxs)(`div`,{className:`transform-control tc-theme`,ref:o,children:[(0,$.jsxs)(`button`,{type:`button`,className:`tc-type tc-type-theme`,"aria-haspopup":`listbox`,"aria-expanded":i,"aria-label":`Theme: ${d.label}`,title:`Theme: ${d.label}`,onClick:()=>a(e=>!e),children:[(0,$.jsx)(`img`,{className:`tc-icon`,src:ufn(d.icon),alt:``}),(0,$.jsx)(`svg`,{className:`tc-caret`,width:`11`,height:`11`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M3 4.5 L6 7.5 L9 4.5`})})]}),i&&(0,$.jsx)(`ul`,{className:`tc-menu`,role:`listbox`,"aria-label":`Theme`,children:u.map(e=>{let t=e===d;return(0,$.jsxs)(`li`,{role:`option`,"aria-selected":t,title:e.description,className:t?`tc-opt tc-opt-selected`:`tc-opt`,onClick:()=>{r(e.value),a(!1)},children:[(0,$.jsx)(`img`,{className:`tc-opt-icon`,src:ufn(e.icon),alt:``}),(0,$.jsx)(`span`,{children:e.label})]},typeof e.value==`string`?e.value:e.value?`custom`:`default`)})})]})}function k9(e){let{label:t,className:n=``,disabled:r=!1,onClick:i,children:a}=e,[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)({left:0,top:0}),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null);return(0,Z.useLayoutEffect)(()=>{if(!o||!u.current||!d.current)return;let e=u.current.getBoundingClientRect(),t=d.current.getBoundingClientRect(),n=Math.min(window.innerWidth-t.width-6,Math.max(6,e.left+(e.width-t.width)/2)),r=e.top-t.height-6,i=r>=6?r:e.bottom+6;l({left:n,top:i})},[t,o]),(0,Z.useEffect)(()=>{if(!o)return;let e=()=>s(!1);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[o]),(0,$.jsxs)(`span`,{ref:u,className:`action-tip-anchor`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),children:[(0,$.jsx)(`button`,{type:`button`,className:`bar-link ${n}`.trim(),onClick:i,disabled:r,"aria-label":t,children:a}),o&&(0,lfn.createPortal)((0,$.jsx)(`span`,{ref:d,className:`action-tooltip`,role:`tooltip`,style:{left:c.left,top:c.top},children:t}),document.body)]})}function ffn(e){let t=e?.containerDimensions,n=t?.maxHeight??t?.height;return typeof n==`number`&&Number.isFinite(n)&&n>0?n:void 0}var pfn=16;function mfn(e,t){let n=t?void 0:ffn(e),[r,i]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{if(n===void 0||typeof ResizeObserver>`u`){i(!1);return}let e=()=>{let e=document.body.scrollHeight;i(t=>t?e>n-pfn:e>n+1)};e();let t=new ResizeObserver(e);return t.observe(document.body),()=>t.disconnect()},[n]);let a=t||r;(0,Z.useEffect)(()=>{document.documentElement.style.overflow=a?`hidden auto`:`hidden`,document.documentElement.style.scrollbarGutter=a?`stable`:``,document.body.style.overflow=a?`visible`:`hidden`},[a])}var hfn=Object.defineProperty,gfn=Object.getOwnPropertyNames,_fn=(e,t)=>function(){return e&&(t=(0,e[gfn(e)[0]])(e=0)),t},vfn=(e,t)=>{for(var n in t)hfn(e,n,{get:t[n],enumerable:!0})};function A9(e){return j9[e]??xfn}function yfn(e){return e in j9}function bfn(){return Object.keys(j9)}var j9,xfn,Sfn=_fn({"src/core/type-registry.ts"(){j9={DateTime:{t0:`Temporal`,t1:`DateTime`,visEncodings:[`temporal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Date:{t0:`Temporal`,t1:`DateTime`,visEncodings:[`temporal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Time:{t0:`Temporal`,t1:`DateTime`,visEncodings:[`temporal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Timestamp:{t0:`Temporal`,t1:`DateTime`,visEncodings:[`temporal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Year:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`temporal`,`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`integer`,zeroBaseline:`arbitrary`,zeroPad:.03},Quarter:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`cyclic`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Month:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`cyclic`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Week:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`cyclic`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Day:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`cyclic`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Hour:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`cyclic`,diverging:`none`,formatClass:`integer`,zeroBaseline:`arbitrary`,zeroPad:0},YearMonth:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`temporal`,`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},YearQuarter:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`temporal`,`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},YearWeek:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`temporal`,`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Decade:{t0:`Temporal`,t1:`DateGranule`,visEncodings:[`temporal`,`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`integer`,zeroBaseline:`arbitrary`,zeroPad:.03},Duration:{t0:`Temporal`,t1:`Duration`,visEncodings:[`quantitative`],aggRole:`additive`,domainShape:`open`,diverging:`none`,formatClass:`unit-suffix`,zeroBaseline:`meaningful`,zeroPad:0},Amount:{t0:`Measure`,t1:`Amount`,visEncodings:[`quantitative`],aggRole:`additive`,domainShape:`open`,diverging:`none`,formatClass:`currency`,zeroBaseline:`meaningful`,zeroPad:0},Price:{t0:`Measure`,t1:`Amount`,visEncodings:[`quantitative`],aggRole:`intensive`,domainShape:`open`,diverging:`none`,formatClass:`currency`,zeroBaseline:`meaningful`,zeroPad:0},Quantity:{t0:`Measure`,t1:`Physical`,visEncodings:[`quantitative`],aggRole:`additive`,domainShape:`open`,diverging:`none`,formatClass:`unit-suffix`,zeroBaseline:`meaningful`,zeroPad:0},Temperature:{t0:`Measure`,t1:`Physical`,visEncodings:[`quantitative`],aggRole:`intensive`,domainShape:`open`,diverging:`conditional`,formatClass:`unit-suffix`,zeroBaseline:`arbitrary`,zeroPad:.05},Percentage:{t0:`Measure`,t1:`Proportion`,visEncodings:[`quantitative`],aggRole:`intensive`,domainShape:`bounded`,diverging:`none`,formatClass:`percent`,zeroBaseline:`contextual`,zeroPad:0},Profit:{t0:`Measure`,t1:`SignedMeasure`,visEncodings:[`quantitative`],aggRole:`signed-additive`,domainShape:`open`,diverging:`conditional`,formatClass:`decimal`,zeroBaseline:`meaningful`,zeroPad:0},PercentageChange:{t0:`Measure`,t1:`SignedMeasure`,visEncodings:[`quantitative`],aggRole:`intensive`,domainShape:`open`,diverging:`conditional`,formatClass:`percent`,zeroBaseline:`contextual`,zeroPad:.05},Sentiment:{t0:`Measure`,t1:`SignedMeasure`,visEncodings:[`quantitative`],aggRole:`intensive`,domainShape:`open`,diverging:`inherent`,formatClass:`decimal`,zeroBaseline:`meaningful`,zeroPad:0},Correlation:{t0:`Measure`,t1:`SignedMeasure`,visEncodings:[`quantitative`],aggRole:`intensive`,domainShape:`bounded`,diverging:`inherent`,formatClass:`decimal`,zeroBaseline:`meaningful`,zeroPad:0},Count:{t0:`Measure`,t1:`GenericMeasure`,visEncodings:[`quantitative`],aggRole:`additive`,domainShape:`open`,diverging:`none`,formatClass:`integer`,zeroBaseline:`meaningful`,zeroPad:0},Number:{t0:`Measure`,t1:`GenericMeasure`,visEncodings:[`quantitative`],aggRole:`measure`,domainShape:`open`,diverging:`none`,formatClass:`decimal`,zeroBaseline:`meaningful`,zeroPad:0},Rank:{t0:`Discrete`,t1:`Rank`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`integer`,zeroBaseline:`arbitrary`,zeroPad:.08},Score:{t0:`Discrete`,t1:`Score`,visEncodings:[`quantitative`,`ordinal`],aggRole:`intensive`,domainShape:`bounded`,diverging:`conditional`,formatClass:`decimal`,zeroBaseline:`contextual`,zeroPad:.05},ID:{t0:`Identifier`,t1:`ID`,visEncodings:[`nominal`],aggRole:`identifier`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`arbitrary`,zeroPad:0},Latitude:{t0:`Geographic`,t1:`GeoCoordinate`,visEncodings:[`quantitative`,`geographic`],aggRole:`dimension`,domainShape:`fixed`,diverging:`none`,formatClass:`decimal`,zeroBaseline:`arbitrary`,zeroPad:.02},Longitude:{t0:`Geographic`,t1:`GeoCoordinate`,visEncodings:[`quantitative`,`geographic`],aggRole:`dimension`,domainShape:`fixed`,diverging:`none`,formatClass:`decimal`,zeroBaseline:`arbitrary`,zeroPad:.02},Country:{t0:`Geographic`,t1:`GeoPlace`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},State:{t0:`Geographic`,t1:`GeoPlace`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},City:{t0:`Geographic`,t1:`GeoPlace`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Region:{t0:`Geographic`,t1:`GeoPlace`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Address:{t0:`Geographic`,t1:`GeoPlace`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},ZipCode:{t0:`Geographic`,t1:`GeoPlace`,visEncodings:[`nominal`],aggRole:`identifier`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Category:{t0:`Categorical`,t1:`Entity`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Name:{t0:`Categorical`,t1:`Entity`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Status:{t0:`Categorical`,t1:`Coded`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Boolean:{t0:`Categorical`,t1:`Coded`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`fixed`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Direction:{t0:`Categorical`,t1:`Coded`,visEncodings:[`ordinal`,`nominal`],aggRole:`dimension`,domainShape:`cyclic`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Range:{t0:`Categorical`,t1:`Binned`,visEncodings:[`ordinal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0},Unknown:{t0:`Categorical`,t1:`Entity`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0}},xfn={t0:`Categorical`,t1:`Entity`,visEncodings:[`nominal`],aggRole:`dimension`,domainShape:`open`,diverging:`none`,formatClass:`plain`,zeroBaseline:`none`,zeroPad:0}}});function M9(e,t){return!Number.isInteger(e)||e<1e3||e>2999||!Number.isInteger(t)||t<1||t>12?null:`${e}-${Dfn(t)}`}function N9(e,t,n){let r=M9(e,t);return!r||!Number.isInteger(n)||n<1||new Date(Date.UTC(e,t-1,n)).getUTCDate()!==n?null:`${r}-${Dfn(n)}`}function Cfn(e,t){let n=Afn[t];if(!n)return null;if(typeof e==`number`){if(!Number.isInteger(e))return null;e=String(e)}if(typeof e!=`string`)return null;let r=e.trim();if(!r)return null;for(let[e,t]of n){let n=r.match(e);if(n){let e=t(n);if(e)return e}}return null}var wfn,P9,F9,I9,Tfn,L9,R9,z9,Efn,Dfn,Ofn,kfn,Afn,jfn=_fn({"src/core/temporal-parse.ts"(){wfn={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},P9=`(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sep(?:t(?:ember)?)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)\\.?`,F9=`[\\s\\-/._,]*`,I9=`(\\d{4})`,Tfn=`'?(\\d{2})`,L9=`(?:st|nd|rd|th)?`,R9=e=>RegExp(`^${e}$`,`i`),z9=e=>wfn[e.slice(0,3).toLowerCase()],Efn=e=>{let t=Number(e);return t<=49?2e3+t:1900+t},Dfn=e=>String(e).padStart(2,`0`),Ofn=[[R9(`(\\d{4})(\\d{2})`),e=>M9(+e[1],+e[2])],[R9(`${I9}[\\-/. ](\\d{1,2})`),e=>M9(+e[1],+e[2])],[R9(`${I9}\\s*M(\\d{1,2})`),e=>M9(+e[1],+e[2])],[R9(`(\\d{1,2})[\\-/. ]${I9}`),e=>M9(+e[2],+e[1])],[R9(`${I9}${F9}${P9}`),e=>M9(+e[1],z9(e[2]))],[R9(`${P9}${F9}${I9}`),e=>M9(+e[2],z9(e[1]))],[R9(`${P9}[\\s\\-/.]*${Tfn}`),e=>M9(Efn(e[2]),z9(e[1]))]],kfn=[[R9(`(\\d{4})(\\d{2})(\\d{2})`),e=>N9(+e[1],+e[2],+e[3])],[R9(`${I9}[/.](\\d{1,2})[/.](\\d{1,2})`),e=>N9(+e[1],+e[2],+e[3])],[R9(`${I9}${F9}${P9}${F9}(\\d{1,2})${L9}`),e=>N9(+e[1],z9(e[2]),+e[3])],[R9(`${P9}${F9}(\\d{1,2})${L9}${F9}${I9}`),e=>N9(+e[3],z9(e[1]),+e[2])],[R9(`(\\d{1,2})${L9}${F9}${P9}${F9}${I9}`),e=>N9(+e[3],z9(e[2]),+e[1])]],Afn={YearMonth:Ofn,Date:kfn,DateTime:kfn}}});function Mfn(e){let t=e.trim();return Pfn.test(t)||Ffn.test(t)?Number.isFinite(Date.parse(t)):Cfn(t,`Date`)!==null}function Nfn(e){if(e.length===0)return`nominal`;let t=e=>e===!0||e===!1||Object.prototype.toString.call(e)===`[object Boolean]`,n=e=>!isNaN(+e)&&Object.prototype.toString.call(e)!==`[object Date]`,r=e=>e instanceof Date?!isNaN(e.getTime()):typeof e==`string`?Mfn(e):!isNaN(Date.parse(e)),i=e.filter(e=>e!=null);return i.length===0||i.every(t)?`nominal`:i.every(n)?`quantitative`:i.every(r)?`temporal`:`nominal`}var Pfn,Ffn,Ifn=_fn({"src/core/semantic-types.ts"(){Sfn(),jfn(),new Set(bfn().filter(e=>{let t=A9(e);return[`additive`,`intensive`,`signed-additive`,`measure`].includes(t.aggRole)&&t.t1!==`Score`})),new Set(bfn().filter(e=>{let t=A9(e);return t.visEncodings.includes(`nominal`)&&t.aggRole!==`identifier`||t.t1===`Binned`})),new Set(bfn().filter(e=>A9(e).visEncodings.includes(`ordinal`))),Pfn=/^\d{4}-\d{2}(-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?)?$/,Ffn=/^\d{1,2}\/\d{1,2}\/\d{4}$/}});function B9(e){if(!e)return null;let t=String(e).trim(),n=Gfn.exec(t);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:parseInt(n[4],16)/255}:(n=Wfn.exec(t),n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:1}:(n=Ufn.exec(t),n?{r:parseInt(n[1]+n[1],16),g:parseInt(n[2]+n[2],16),b:parseInt(n[3]+n[3],16),a:1}:null))}function Lfn(e){let t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`);return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function Rfn(e,t,n){let r=Math.max(0,Math.min(1,n));return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:1}}function zfn(e,t,n,r=`#000000`){let i=B9(e),a=B9(t);return!i||!a?r:Lfn(Rfn(i,a,n))}function Bfn(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Vfn(e){let t=B9(e);return t?Bfn(t)<.45:!1}function V9(e,t){let n=B9(e),r=B9(t);if(!n||!r)return 21;let i=Bfn(n),a=Bfn(r);return(Math.max(i,a)+.05)/(Math.min(i,a)+.05)}function Hfn(e,t,n=3){if(V9(e,t)>=n)return e;let r=Vfn(t)?`#ffffff`:`#000000`;for(let i=.05;i<=.800000001;i+=.05){let a=zfn(e,r,i,e);if(V9(a,t)>=n)return a}return zfn(e,r,.8,e)}var Ufn,Wfn,Gfn;function Kfn(e){if(e instanceof Date)return Number.isFinite(e.getTime())?e.getTime():void 0;if(typeof e==`number`)return Number.isInteger(e)&&e>=1e3&&e<=2999?Date.UTC(e,0,1):Number.isFinite(e)?e:void 0;if(typeof e!=`string`)return;let t=e.trim();if(/^\d{4}$/.test(t))return Date.UTC(Number(t),0,1);let n=Date.parse(t);return Number.isFinite(n)?n:void 0}function qfn(e,t){if(e&&yfn(e)){let t=A9(e);return t.t0===`Temporal`&&t.t1!==`Duration`&&t.domainShape!==`cyclic`}return Nfn([...t])===`temporal`}function Jfn(e,t,n,r,i,a,o=W9){if(e.length<=1||i<=0||a<=0)return{stretchX:1,stretchY:1,rawStretchX:1,rawStretchY:1};let s=Math.sqrt(o.markCrossSection),c=(e,t,n,r)=>{if(n<=0||e.length<=1)return[1,1];let i=t[1]-t[0];if(i<=0)return[1,1];let a=n/i,s=new Set;for(let n of e)s.add(Math.round((n-t[0])*a));let c=s.size*r/n;if(c<=1)return[1,1];let l=c**+o.elasticity;return[Math.min(o.maxStretch,l),l]},l=o.markCrossSectionX==null?s:Math.sqrt(o.markCrossSectionX),u=o.markCrossSectionY==null?s:Math.sqrt(o.markCrossSectionY),d=(e,t,n,r,i,a)=>{if(a!=null&&i>0){let e=a*i/n;if(e<=1)return[1,1];let t=e**+o.elasticity;return[Math.min(o.maxStretch,t),t]}return r>0?c(e,t,n,r):[1,1]},f=o.markCrossSectionX??o.markCrossSection,p=o.markCrossSectionY??o.markCrossSection,[m,h]=d(e,n,i,l,f,o.xItemCountOverride),[g,_]=d(t,r,a,u,p,o.yItemCountOverride);return{stretchX:m,stretchY:g,rawStretchX:h,rawStretchY:_}}function Yfn(e,t,n){if(e<=0)return{budget:t,stretchFactor:1};let r=e*n.defaultStepSize/t;if(r<=1)return{budget:t,stretchFactor:1};let i=Math.min(n.maxStretch,r**+n.elasticity);return{budget:t*i,stretchFactor:i}}function H9(e,t,n,r){let i=e>0?e:t;if(i>0){let e=Math.max(0,Math.min(1,r.bandStepFit??0)),t=n/i,a=n*(r.bandStepFitCapacity??1)/i,o=e>0&&t>r.defaultStepSize&&(r.bandStepFitCapacity??1)>1,s=t>r.defaultStepSize?r.defaultStepSize*(1-e)+a*e:r.defaultStepSize;if(s<=t)return{step:Math.floor(s),budget:n,itemCount:i,fitted:o};let{budget:c}=Yfn(i,n,{...r,defaultStepSize:s});return{step:Math.floor(Math.min(s,c/i)),budget:c,itemCount:i,fitted:o}}return{step:r.defaultStepSize,budget:n,itemCount:0,fitted:!1}}function Xfn(e,t,n,r=!1,i=e=>e.length*t*.62){let a=[],o=0;for(let t of e){if(i(t)<=n){a.push([t]),o=Math.max(o,i(t));continue}let e,s=1/0;for(let r of t.matchAll(/\s+/g)){let a=[t.slice(0,r.index),t.slice(r.index+r[0].length)];if(a.some(e=>!e))continue;let o=Math.max(...a.map(i)),c=/\s/.test(a[1].trim()),l=e&&/\s/.test(e[1].trim());(o<=n?s>n||c||!l:s>n&&on){if(!r)return null;let s;for(let e of t.matchAll(/\s+/g))i(t.slice(0,e.index))<=n&&(s=e);s?a.push([t.slice(0,s.index),t.slice(s.index+s[0].length)]):a.push(e??[t]),o=Math.max(o,n);continue}a.push(e),o=Math.max(o,s)}return a.some(e=>e.length>1)?{lines:a,width:o}:null}function Zfn(e){let{labels:t,axis:n,fontSize:r,step:i,baseSpan:a,maxSpan:o,gutterLimit:s,baselineLimit:c,elasticity:l,measure:u}=e;if(!t.length||a<=0||o<=0)return null;let d=u??(e=>e.length*r*.62),f=Math.ceil(r*1.2),p=t.map(d),m=t.map((e,t)=>{let n=p[t];for(let t of e.matchAll(/\s+/g))!t.index||t.index+t[0].length===e.length||(n=Math.min(n,Math.max(d(e.slice(0,t.index)),d(e.slice(t.index+t[0].length)))));return n}),h=t.length,g=a/h,_=Math.min(Math.max(...m),s),v=e=>e>1?Math.ceil((r+(e-1)*f)/.75):r+4,y=n===`x`?m.map(e=>e+6):p.map(e=>e>_?v(2):f+6),b=y.reduce((e,t)=>e+Math.min(g,Math.max(0,t-g)),0)/h,x=Math.max(i,Math.min(Math.max(...y),g)+b),S=H9(h,0,a,{defaultStepSize:Math.ceil(x),minStep:Math.min(i,g),elasticity:l,maxStretch:Math.max(1,o/a)}),C=v(p.some(e=>e>_)?2:1),w=e.stretchToFit&&n===`x`?Math.ceil(Math.max(...y)):0,T=Math.min(o/h,Math.max(i,S.step,w,n===`y`?C:0)),E=n===`x`?T-6:_,D=Math.max(0,...t.flatMap(e=>e.split(/\s+/)).map(d));if((u?Ee>E))return null;let O=Xfn(t,r,E,!0,d),k=O?.lines??t.map(e=>[e]),A=Math.max(...k.map(e=>e.length));if(n===`y`&&v(A)>T)return null;let j=(e,t)=>d(e)<=t?d(e):Math.max(0,t-r),M=(e,t)=>e.reduce((e,n,r)=>{let i=n.reduce((e,n)=>e+j(n,t),0)+(n.length-1)*d(` `);return e+Math.max(0,1-i/Math.max(1,p[r]))},0)/h,N=(e,t)=>{let n=e.map(e=>Math.min(t,Math.max(...e.map(d))));return(Math.max(...n)-n.reduce((e,t)=>e+t,0)/h)/Math.max(1,s)},P=t.map(e=>[e]),F=Math.max(0,(Math.min(T*h,a)-Math.min(i*h,a))/a),I=Math.max(0,T*h/a-1),L=Math.max(0,i*h/a-1),R=k.filter(e=>e.length>1).length/h,z=M(k,E)+.18*F+Math.max(0,I*I-L*L)+.04*R+(n===`y`?.15*N(k,E):0),B=M(P,c)+(n===`x`?.3:.15*N(P,c));return e.compareBaseline!==!1&&z>B||n===`x`&&!O&&p.some(e=>e>E)||n===`y`&&!O?null:{step:T,width:E,lines:k,lineHeight:f,cost:z}}function U9(e,t,n){let r=n?.baseFont??10,i=n?.minFont??6;if(!t)return{fontSize:r,labelLimit:100};let a=Math.floor(e),o=Math.max(i,Math.min(r,a-1)),s=Math.max(30,Math.min(100,e*8)),c,l,u;return e<10?(c=-90,o=Math.max(i,Math.min(r-2,a)),s=40,l=`right`,u=`middle`):e<16&&(c=-90,o=Math.max(i,Math.min(r-1,a)),s=60,l=`right`,u=`middle`),{fontSize:o,labelLimit:s,labelAngle:c,labelAlign:l,labelBaseline:u}}function Qfn(e,t){let n=t?.baseLabelFontSize??10,r=t?.baseTitleFontSize??11,i=e||320,a=i>=220?1:Math.max(.7,i/220),o=e=>Math.round(Math.max(e-2,Math.min(e,e*a))),s=o(n),c=o(r);return{tickBase:s,titleFontSize:c,legendFontSize:Math.max(r-2,c-1)}}var W9;function $fn(e,t){if(!e||!t||t===`asIs`)return e;if(t===`upper`)return e.toUpperCase();if(t===`lower`)return e.toLowerCase();if(t===`sentence`)return tpn(e);let n=e.split(/(\s+)/),r=n.length-1;return n.map((e,t)=>e.trim()?t>0&&tNumber(n.match(/-?\d+(\.\d+)?/)?.[0]??NaN);switch(e){case`minute`:{let e=n.match(/(\d{1,2}):(\d{2})/);if(e)return Number(e[1])*60+Number(e[2]);let t=Date.parse(n);return Number.isFinite(t)?Math.round(t/6e4):NaN}case`hour`:{let e=n.match(/^(\d{1,2})(:00)?/);return e?Number(e[1]):NaN}case`day`:{let e=Date.parse(n);return Number.isFinite(e)?Math.round(e/864e5):NaN}case`month`:{let e=n.match(/^(\d{4})-(\d{1,2})/);if(e)return Number(e[1])*12+Number(e[2])-1;let t=new Date(Date.parse(n));return Number.isFinite(t.getTime())?t.getFullYear()*12+t.getMonth():NaN}case`monthOfYear`:{let e=apn.indexOf(n.slice(0,3).toLowerCase());return e>=0?e:r()-1}case`quarter`:{let e=n.match(/(\d{4})\D*Q?([1-4])$/i)??n.match(/Q([1-4])\D*(\d{4})/i);if(!e)return NaN;let[t,r]=e[1].length===4?[e[1],e[2]]:[e[2],e[1]];return Number(t)*4+Number(r)-1}case`cycle`:{let e=opn.indexOf(n.slice(0,3).toLowerCase());return e>=0?e:r()}default:return r()}}function rpn(e,t,n,r){let i=t.map(t=>npn(e,t));if(i.some(e=>!Number.isFinite(e)))return;let a=[...new Set(i)].sort((e,t)=>e-t),o=1/0;for(let e=1;e(i[t]%a+a)%a===0);if(e.length>=2)return{shown:e,spacing:a/o};break}}var ipn,apn,opn;function G9(e,t,n,r){if(!Number.isFinite(n))return 0;let i=0;for(let a of e){let e=a.reduce((e,n)=>e+t(n),0);if(e<=0)continue;let o=a.reduce((e,i)=>e+(t(i)<=n?t(i):Math.max(0,n-r)),0);i+=Math.max(0,1-o/e)}return i/Math.max(1,e.length)}function spn(e,t){return e.gapEm===void 0?Math.max(6,t/2):e.gapEm*t}function cpn(e,t,n){return e>=(n+1)*t*.6}function lpn(e){let{values:t,shown:n,stated:r,floor:i,step:a,fillStep:o,thresholds:s}=e;if(!n.length||!(a>0))return;let c=t=>e.steps.includes(t)&&(t!==`skip`||e.sequence!==void 0),l=!e.noTrim,u=n.length,d=Math.max(1,e.baseSpan),f=e=>mpn*Math.max(0,Math.min(e*u,d)-Math.min(a*u,d))/d,p=[],m=[];for(let e=r;e>=i-1e-9;e-=.5)m.push(Math.round(e*2)/2);m.length||m.push(r);for(let i of m){let u=e.measure(i),d=Math.max(0,...n.map(u)),h=spn(s,i),g=d+h,_=dpn*(r-i)/r,v=n.map(e=>[e]),y=Math.max(a,o);if(g<=a){p.push({step:`fit`,trimmed:!1,fontSize:i,angle:0,band:a,needed:g,cost:_});continue}for(let t of i===m[m.length-1]?[!1,!0]:[!1]){let n=e.wrapAt(i,t);if(!n)continue;let r=n.lines.some(e=>e.length>1),a=G9(n.lines,u,n.width,i);if(!(a>0&&(!l||!cpn(n.width,i,s.minChars)))&&!((r||a>0)&&!c(`wrap`))){p.push({step:r||a>0?`wrap`:`fit`,trimmed:a>0,fontSize:i,angle:0,band:n.step,limit:n.width,...r?{lines:n.lines,lineHeight:n.lineHeight}:{},needed:g,cost:n.cost+_});break}}let b=y-h;if(c(`wrap`)&&l&&cpn(b,i,s.minChars)){let e=Xfn(n,i,b,!0,u)?.lines??v,t=e.filter(e=>e.length>1).length/e.length;p.push({step:`wrap`,trimmed:!0,fontSize:i,angle:0,band:y,limit:Math.floor(b),...t>0?{lines:e,lineHeight:Math.ceil(i*1.2)}:{},needed:g,cost:G9(e,u,b,i)+ppn*t+f(y)+_})}if(c(`skip`)&&e.sequence){let r=rpn(e.sequence,t,y,g),a=l?rpn(e.sequence,t,y,(s.minChars+1)*i*.6+h):void 0;for(let[e,o]of[[r,!1],[r?void 0:a,!0]]){if(!e)continue;let r=Math.floor(e.spacing*y-h),a=e.shown.map(e=>[n[t.indexOf(e)]??e]);p.push({step:`skip`,trimmed:o,fontSize:i,angle:0,band:y,shown:e.shown,...o?{limit:r}:{},needed:g,cost:fpn*(1-e.shown.length/t.length)+(o?G9(a,u,r,i):0)+f(y)+_})}}let x=i*1.2;for(let[e,t]of[[`rotate45`,x*Math.SQRT2],[`rotate90`,x]]){if(!c(e)||a0,fontSize:i,angle:e===`rotate45`?-45:-90,band:a,...l&&Number.isFinite(s.turnedLimit)?{limit:Math.floor(s.turnedLimit)}:{},needed:g,cost:upn[e]+n+_})}}let h=t=>t.step===`fit`?-1:e.steps.indexOf(t.step),g=Math.min(...p.filter(e=>!e.trimmed).map(h)),_=Number.isFinite(g)?p.filter(e=>h(e)<=g):p;if(_.some(e=>e.step===`skip`)&&(_=_.filter(e=>e.angle===0)),_.some(e=>e.angle===-45)&&(_=_.filter(e=>e.angle!==-90)),_.length)return _.reduce((e,t)=>t.costs.turnedLimit,fontSize:v,angle:-90,band:a,...l&&Number.isFinite(s.turnedLimit)?{limit:Math.floor(s.turnedLimit)}:{},needed:b+spn(s,v),cost:1/0}}var upn,dpn,fpn,ppn,mpn,hpn,gpn;function _pn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function vpn(e,t){if(!_pn(t))return t===void 0?e:t;let n=_pn(e)?{...e}:{};for(let[e,r]of Object.entries(t))n[e]=_pn(r)?vpn(n[e],r):r===void 0?n[e]:r;return n}function ypn(e){if(e===void 0)return;if(typeof e==`string`)return ypn(xpn(e));if(e.extends===void 0)return e;let{extends:t,...n}=e,r=ypn(xpn(t));return bpn(r,n,vpn(r,n))}function bpn(e,t,n){let r=t.ink?.text,i=t.ink?.surface;if(!r&&!i||!n.type)return n;let a=e.ink?.text??{},o=n.ink?.text??{},s=i?.canvas??i?.plot,c={...n.type};for(let e of Cpn){let n=c[e];if(!n||typeof n.color!=`string`||t.type?.[e]?.color!==void 0)continue;let i=Object.keys(a).find(e=>wpn(a[e],n.color)),l=i&&r?.[i]?o[i]:n.color;if(s&&V9(l,s)<3){let e=o[i??`primary`];l=e&&V9(e,s)>=3?e:Hfn(l,s)}l!==n.color&&(c[e]={...n,color:l})}return{...n,type:c}}function xpn(e){let t=Spn[e];if(!t)throw Error(`Unknown theme \`${e}\`. Flint ships: ${Object.keys(Spn).join(`, `)}.`);return t.spec}var Spn,Cpn,wpn;function Tpn(e){if(e.length<2)return;let t=[];for(let n of e){let e=Kfn(n);if(e===void 0)return;t.push(e)}let n=t.map(e=>new Date(e));if(!n.every(e=>e.getUTCHours()===0&&e.getUTCMinutes()===0&&e.getUTCSeconds()===0&&e.getUTCMilliseconds()===0))return;let r=n.every(e=>e.getUTCDate()===1);if(r&&n.every(e=>e.getUTCMonth()===0))return;let i=t.every((e,n)=>n===0||e>t[n-1]);return n.map((e,t)=>{let a=e.getUTCFullYear(),o=!i||t===0||n[t-1].getUTCFullYear()!==a,s=Epn[e.getUTCMonth()],c=r?s:`${s} ${e.getUTCDate()}`;return o?[c,String(a)]:[c]})}var Epn;function Dpn(e,t,n,r){return e<=1||n>=r?`none`:e>=t?`global`:`local`}function Opn(e,t,n,r){let i=new Map,a=new Set;for(let r of e){a.add(r[n]);let e=r[t],o=i.get(e);o||i.set(e,o=new Set),o.add(r[n])}let o=Math.max(1,a.size),s=i.size,c=0,l=0,u=0;for(let e of i.values())e.size>c&&(c=e.size),e.size<=1&&l++,e.size===o&&u++;let d=kpn,f=s>0?l/s:1,p=Dpn(c,o,f,d);return{mode:p,dodge:p!==`none`,laneCount:o,ambiguous:c>1&&u0?n.centre:e.width/Math.max(1,e.height);return n.spread&&n.spread>=1?{lo:r/n.spread,hi:r*n.spread}:{lo:r/Math.max(Npn,t.y),hi:r*Math.max(Npn,t.x)}}function jpn(e,t){return{lo:e.lo/t,hi:e.hi*t}}function Mpn(e,t){return e.lo>t.hi?e.lo/t.hi:e.hicmn,DEFAULT_BASE_SIZE:()=>omn,DEFAULT_MAX_STRETCH:()=>X9,DEFAULT_MIN_STEP:()=>Y9,adaptiveRowNameCap:()=>zpn,computeChannelBudgets:()=>Zpn,computeFacetGrid:()=>Qpn,computeLayout:()=>Jpn,computeMinSubplotDimensions:()=>$pn,deriveStretchCaps:()=>qpn,facetPanelLength:()=>Wpn,labelFitThresholds:()=>Vpn,planBandLabels:()=>Lpn,resolveBaseSize:()=>Upn,resolveFacetColumnsOption:()=>Kpn,resolveStretchCaps:()=>q9,rowLabelLimit:()=>Hpn,rowNameCap:()=>Rpn,withCanvasSize:()=>Gpn});function K9(e,t){if(!e)return null;let n=new Set;for(let r of t){let t=r[e];t==null||t===``||n.add(String(t))}if(n.size===0)return null;let r=[...n];return{count:r.length,maxLen:Math.max(...r.map(e=>e.length)),meanLen:r.reduce((e,t)=>e+t.length,0)/r.length,allNumeric:r.every(e=>e.trim()!==``&&isFinite(Number(e)))}}function Fpn(e,t,n){if(!e)return!1;if(t===`quantitative`)return!0;let r=K9(e,n);return!r||r.count>emn?!1:r.maxLen<=tmn}function q9(e){let t=e.maxStretch??X9;return{x:Math.max(1,e.maxStretchX??t),y:Math.max(1,e.maxStretchY??t)}}function Ipn(e,t){let n=Math.max(1,t.baseSpan),r=e.length,i;for(let a=t.stated;a>=t.floor-1e-9;a-=.5){let o=t.measure(a),s=t.gapEm===void 0?Math.max(6,a/2):t.gapEm*a,c=Math.max(0,...e.flat().map(o))+s,l=Math.max(t.step,c);if(l>t.step&&l*r>n+1e-9)continue;let u=dpn*(t.stated-a)/t.stated+mpn*Math.max(0,l*r-t.step*r)/n;(!i||u0:n.yNominalCount>0)||!c?.field||![`nominal`,`ordinal`].includes(c.type)||t.skip?.(s))continue;let l=[...new Set(e.table.map(e=>e[c.field]).filter(e=>e!=null).map(String))],u=l.every(e=>e.trim()!==``&&Number.isFinite(Number(e)));if(!l.length||u&&!(s===`x`&&t.sequence))continue;let d=s===`x`?n.xLabel:n.yLabel,f=s===`x`?n.xStep:n.yStep,p=s===`x`?n.facet?.columns??1:n.facet?.rows??1,m=s===`x`?a.facetFixedPadding?.width??0:a.facetFixedPadding?.height??0,h=s===`x`?r.width:r.height,g=s===`x`?n.subplotWidth:n.subplotHeight,_=(h*o[s]-m)/p-n.effectiveFacetGap,v=Math.min(g,(h-m)/p-n.effectiveFacetGap),y=t.fontSize??(s===`x`?Math.max(d.fontSize,mmn):d.fontSize),b=l.map(e=>$fn(e,t.textCase)),x=s===`y`?a.canvasTreatment?.rowNames:void 0,S=Hpn(t.fit,r.width,n.subplotWidth),C=(e,n=!1,r=!0,i=x??S,o=b)=>Zfn({labels:o,axis:s,fontSize:e,step:f,baseSpan:v,maxSpan:_,gutterLimit:i,baselineLimit:d.labelLimit,elasticity:a.elasticity??.5,...t.measure?{measure:t.measure(e)}:{},...n?{stretchToFit:n}:{},...r?{}:{compareBaseline:r}});if(s===`x`){let e=t.overflow??(t.sequence?gpn:hpn),r=Math.min(y,Math.max(t.minFontSize??0,y*.75)),i=t.measure??(e=>t=>t.length*e*J9),a=lpn({values:l,shown:b,stated:y,floor:r,measure:i,step:f,fillStep:Math.floor(v/l.length),baseSpan:v,wrapAt:(e,t)=>C(e,t,!1),steps:e,...t.sequence?{sequence:t.sequence}:{},noTrim:t.noLimit===!0,thresholds:Vpn(t.fit,n.subplotHeight)});if(!a)continue;let o;if((a.step!==`fit`||a.fontSizee.includes(t))?e.filter(e=>l.includes(e)):l,u=Tpn(s);if(u){let e=new Map(s.map((e,t)=>[e,u[t]])),c=l.map(n=>(e.get(n)??[n]).map(e=>$fn(e,t.textCase))),d=Ipn(c,{stated:y,floor:r,measure:i,step:f,baseSpan:v,gapEm:Vpn(t.fit,n.subplotHeight).gapEm});d&&d.cost+smne.length>1)?Math.ceil(a.fontSize*1.2):void 0}:{labelValues:void 0,labelLines:void 0,labelLineHeight:void 0},labelForm:o?`calendar`:void 0,...a.fontSize{if(!e||x===void 0)return e;let r=t.measure?.(n)??(e=>e.length*n*J9);return e.lines.every(t=>t.length<=2&&t.every(t=>r(t)<=e.width+1))?e:null},T=y,E=w(C(y,!1,x===void 0),y);if(!E&&x!==void 0){let e=Math.min(y,Math.max(t.minFontSize??0,y*.75),d.fontSize);for(let t=y-1;!E&&t>=e;t--)E=w(C(t,!1,!1),t),T=t;E||=(T=y,C(y,!1,!0,S))}let D=t.measure?.(T)??(e=>e.length*T*J9),O=t.rowCodes?void 0:zpn(b.map(D),n.subplotWidth,T),k=Math.max(...E?E.lines.flat().map(D):b.map(D)),A=!1;if(O!==void 0&&k>O+1){let e=C(T,!1,!1,O);if(!e){Object.assign(d,{fontSize:T,labelAngle:0,labelAlign:`right`,labelBaseline:`middle`,labelLimit:Math.floor(O),labelCut:!0,labelValues:void 0,labelLines:void 0,labelLineHeight:void 0});continue}E=e,A=!e.lines.every(t=>t.length<=2&&t.every(t=>D(t)<=e.width+1))}E&&(n.yStep=E.step,Object.assign(d,{fontSize:T,labelAngle:0,labelAlign:`right`,labelBaseline:`middle`,labelLimit:A?Math.floor(O):Math.ceil(E.width)+2,labelValues:l,labelLines:E.lines,labelLineHeight:E.lineHeight,...A?{labelCut:!0}:{}}))}}function Rpn(e,t){return Math.max(lmn*t,e*fmn-pmn)}function zpn(e,t,n){let r=Rpn(t,n);if(!e.length)return r;let i=Math.max(r,t-pmn),a=e.filter(e=>e>r).map(e=>Math.min(e,i));if(!a.length)return r;let o=a.reduce((e,t)=>e+t,0)/a.length,s=Bpn((a.length/e.length-umn)/(dmn-umn));return Math.min(i,r+(o-r)*s)}function Bpn(e){let t=Math.min(1,Math.max(0,e));return t*t*(3-2*t)}function Vpn(e,t){let n=e?.turnedLimit??`40%`,r=typeof n==`number`?n:Math.max(30,Number.parseFloat(n)/100*Math.max(1,t));return{minChars:e?.minChars??4,turnedLimit:r,...e?.gap===void 0?{}:{gapEm:e.gap}}}function Hpn(e,t,n){let r=Math.min(t,n||t),i=e?.rowLimit;return typeof i==`number`?i:typeof i==`string`?Number.parseFloat(i)/100*t:Math.max(cmn,r/4)}function Upn(e,t){let n=e??{...omn};return t?{width:Math.min(n.width,t.width),height:Math.min(n.height,t.height)}:{width:n.width,height:n.height}}function Wpn(e,t,n,r,i,a){return(e*Math.min(n,t**+r)-i)/t-a}function Gpn(e,t){let n;try{n=ypn(e.theme_spec)?.compileDefaults}catch{n=void 0}let r=e.chart_spec.baseSize??n?.baseSize??omn,i=e.options?.maxStretch??n?.maxStretch??X9,a=e.chart_spec.canvasSize??n?.canvasSize??{width:r.width*i,height:r.height*i};return{...e,chart_spec:{...e.chart_spec,canvasSize:{width:t.width??a.width,height:t.height??a.height}}}}function Kpn(e){let t=e?.facetColumns;if(t==null)return;let n=Number(t);return Number.isFinite(n)&&n>=1?Math.floor(n):void 0}function qpn(e,t,n){let r=n.maxStretch??X9;return{maxStretchX:t?Math.max(1,t.width/e.width):r,maxStretchY:t?Math.max(1,t.height/e.height):r}}function Jpn(e,t,n,r,i={},a,o){let{elasticity:s=.5,facetElasticity:c=.3,minStep:l=Y9,minSubplotSize:u=60,stepPadding:d=.1,bandStepFit:f=0,maintainContinuousAxisRatio:p=!1,continuousMarkCrossSection:m,facetAspectRatioResistance:h=0}=i,{x:g,y:_}=q9(i),v=r.width,y=r.height,b=i.facetFixedPadding?.width??0,x=i.facetFixedPadding?.height??0,S=i.facetGapColumn??i.facetGap??0,C=i.facetGapRow??i.facetGap??0,w=Math.max(v,y)/300,T=i.defaultBandSize??20,E=Math.round(T*Math.max(1,w)),D=e=>Math.round(e*10)/10,O={width:[],height:[],xStep:[],yStep:[]},k=(e,t,n,r,i)=>{O[e].push({rule:t,value:typeof n==`number`?D(n):n,...r?{read:r}:{},...i?{note:i}:{}})};k(`width`,`canvas`,v,{base:r.width,stretchCap:D(g)},`the base width; the plot may stretch past it up to the cap`),k(`height`,`canvas`,y,{base:r.height,stretchCap:D(_)},`the base height; the plot may stretch past it up to the cap`);for(let e of[`xStep`,`yStep`])k(e,`house band`,E,{band:T,sizeRatio:D(w)},`the band one category gets, scaled with the canvas past 300 px`);let A=e=>e===`nominal`||e===`ordinal`,j={};for(let[n,r]of Object.entries(e))j[n]=t.resolvedTypes?.[n]||r.type;let M=t.axisFlags||{},N=M.x?.banded??!1,P=M.y?.banded??!1,F=N&&P?0:f,I=i.maxBandSize==null?F>0?Math.max(T,nmn):T:Math.max(T,i.maxBandSize),L=i.maxBandSize==null&&F>0?Math.max(E,nmn):Math.round(I*Math.max(1,w)),R=Math.max(1,i.rowNamesAbove?.scale??1),z=Math.round(E*R),B=Math.max(Math.round(l*R),i.rowNamesAbove?.minStep??0),ee=Math.round(L*R),V={x:0,y:0,column:0,row:0,group:0};for(let t of[`x`,`y`,`column`,`row`,`color`]){let r=e[t];r?.field&&A(j[t]||r.type)&&(V[t]=[...new Set(n.map(e=>e[r.field]))].length)}let H=e.group?.field;if(!H&&t.colorActsAsGroup){let t=e.color,n=j.color??t?.type,r=A(j.x??e.x?.type)?e.x?.field:e.y?.field;t?.field&&A(n)&&t.field!==r&&(H=t.field)}if(H){let t=A(j.x??e.x?.type)?e.x?.field:e.y?.field;(t===H||t&&Opn(n,t,H).maxPerBand<=1)&&(H=void 0)}let U;H&&(V.group=t.groupLaneCount??new Set(n.map(e=>e[H])).size,A(j.x??e.x?.type)?U=`x`:A(j.y??e.y?.type)&&(U=`y`));let te=U===`x`&&V.group>1?V.group:1,ne=U===`y`&&V.group>1?V.group:1,W=V.x*te,G=V.y*ne,re=0,K=0;for(let r of[`x`,`y`]){let i=e[r];if(!i?.field||A(j[r]||i.type))continue;let a=r===`x`?N:P,o=t.binnedAxes?.[r];if(!a&&!o)continue;let s;if(o){let e=t.binnedAxes[r];s=typeof e==`object`&&e.maxbins?e.maxbins:10}else s=new Set(n.map(e=>e[i.field])).size;s<=1||(r===`x`?re=s:K=s)}let ie=1,ae=1;a?(ie=a.columns,ae=a.rows):(V.column>0&&(ie=V.column),V.row>0&&(ae=V.row));let oe=0,se=0;for(let t of[`x`,`y`]){let r=e[t];if(!r?.field||!r.scaleType||r.scaleType!==`log`&&r.scaleType!==`symlog`)continue;let i=n.map(e=>e[r.field]).filter(e=>typeof e==`number`&&e>0&&isFinite(e));if(i.length<2)continue;let a=Math.log10(Math.max(...i))-Math.log10(Math.min(...i)),o=Math.ceil(Math.max(1,a))*40;t===`x`?oe=o:se=o}let ce=Math.max(10,l),le=Math.max(ce,oe),ue=Math.max(ce,se),q;q=ie>1?Math.round(Math.max(le,Wpn(v,ie,g,c,b,S))):v;let J;J=ae>1?Math.round(Math.max(ue,Wpn(y,ae,_,c,x,C))):y,ie>1&&k(`width`,`facet panel`,q,{columns:ie,allowance:b,gap:S,elasticity:c},`the canvas stretched a little for its columns, less the allowance, shared between them`),ae>1&&k(`height`,`facet panel`,J,{rows:ae,allowance:x,gap:C,elasticity:c},`the canvas stretched a little for its rows, less the allowance, shared between them`);let de=W===0&&re===0,fe=G===0&&K===0,pe=de&&fe;if(h>0&&!pe&&(ie>1||ae>1)){let e=v/y,t=q/J/e;t<1?J=Math.round(Math.max(ue,J*t**+h)):t>1&&(q=Math.round(Math.max(le,q*(1/t)**h)))}if(pe){let t=e.x,r=e.y;if(t?.field&&r?.field){let i=(j.x||t.type)===`temporal`,a=(j.y||r.type)===`temporal`,o=[],s=[];for(let e of n){let n=e[t.field],c=e[r.field];n==null||c==null||(n=i?+new Date(n):+n,c=a?+new Date(c):+c,!(isNaN(n)||isNaN(c))&&(o.push(n),s.push(c)))}if(o.length>1){let l=Math.min(...o),u=Math.max(...o),d=Math.min(...s),f=Math.max(...s),p=[l,u],h=[d,f];t.zero?.zero&&(p[0]>0&&(p[0]=0),p[1]<0&&(p[1]=0)),r.zero?.zero&&(h[0]>0&&(h[0]=0),h[1]<0&&(h[1]=0));let w=p[1]-p[0]>0?(u-l)/(p[1]-p[0]):1,T=h[1]-h[0]>0?(f-d)/(h[1]-h[0]):1,E=.2,O=W9;if(m!=null)if(typeof m==`number`)O={...W9,markCrossSection:m};else{let t=Math.max(m.x,m.y);if(O={...W9,markCrossSection:t,markCrossSectionX:m.x,markCrossSectionY:m.y,...m.elasticity!=null&&{elasticity:m.elasticity},...m.maxStretch!=null&&{maxStretch:m.maxStretch}},m.seriesCountAxis){let t=m.seriesCountAxis===`auto`?`y`:m.seriesCountAxis,r=Ypn(e,n);t===`y`?O.yItemCountOverride=r:O.xItemCountOverride=r}}let A=ie>1?Math.max(le,(v*Math.min(g,ie**+c)-b)/ie-S):v,j=ae>1?Math.max(ue,(y*Math.min(_,ae**+c)-x)/ae-C):y,M=Jfn(o,s,p,h,A,j,O),N=typeof m==`object`&&!!m.seriesCountAxis,P=w>=E&&T>=E,F,I,L=A*M.rawStretchX,R=j*M.rawStretchY;if(P){let c=[],l=e.color?.field,u=e.detail?.field;l&&c.push(l),u&&u!==l&&c.push(u);let d=Array(o.length);if(c.length===0)d.fill(``);else{let e=0;for(let o of n){let n=t?.field?o[t.field]:void 0,s=r?.field?o[r.field]:void 0;if(n==null||s==null)continue;let l=i?+new Date(n):+n,u=a?+new Date(s):+s;isNaN(l)||isNaN(u)||(d[e++]=c.map(e=>String(o[e]??``)).join(`\0`))}}let f=Xpn(o,s,p,h,d,N),m=.5,v=L/R,y=v>0&&f>0?Math.exp((1-m)*Math.log(v)+m*Math.log(f)):f,b=L*R,x=A*j*Math.max(g,_),S=Math.min(b,x);F=Math.sqrt(S*y),I=Math.sqrt(S/y)}else F=L,I=R;let z=ie>1?Math.max(le,(v*g-b)/ie-S):v*g,B=ae>1?Math.max(ue,(y*_-x)/ae-C):y*_,ee=F>z?z/F:1,V=I>B?B/I:1,H=Math.min(ee,V),U=F*H,te=I*H;U=Math.max(U,le),te=Math.max(te,ue),q=Math.round(U),J=Math.round(te),k(`width`,`crowding`,q,{points:o.length,stretchX:D(M.rawStretchX),banked:P,budget:D(z)},`both axes continuous: the points press the plot wider by their crowding, the shape is banked toward readable slopes, then fitted to the stretch budget`),k(`height`,`crowding`,J,{points:s.length,stretchY:D(M.rawStretchY),banked:P,budget:D(B)},`both axes continuous: the points press the plot taller by their crowding, the shape is banked toward readable slopes, then fitted to the stretch budget`)}}}else if(de||fe){let t=de?`x`:`y`,r=t===`x`?G>0||K>0:W>0||re>0,i=!1;if(typeof m==`object`&&m.seriesCountAxis&&(m.seriesCountAxis===`auto`?t:m.seriesCountAxis)===t){let r=t===`x`?m.x:m.y,a=t===`x`?q:J,o=Ypn(e,n)*r/a,s=m.elasticity??W9.elasticity,c=m.maxStretch??W9.maxStretch;if(o>1){let e=Math.min(c,o**+s);t===`x`?q=Math.round(q*e):J=Math.round(J*e)}i=!0}if(!i&&!r){let r=e[t];if(r?.field){let e=(j[t]||r.type)===`temporal`,i=[];for(let t of n){let n=t[r.field];n!=null&&(n=e?+new Date(n):+n,isNaN(n)||i.push(n))}let a=Math.sqrt(W9.markCrossSection),o=t===`x`?q:J,s=i.length*a/o;if(s>1){let e=Math.min(W9.maxStretch,s**+W9.elasticity);t===`x`?q=Math.round(q*e):J=Math.round(J*e)}}}}if(!pe&&(de||fe)){let e=de?`width`:`height`,t=de?q:J;O[e][O[e].length-1].value!==D(t)&&k(e,`crowding`,t,{rows:n.length},`the values along the continuous axis press it longer, by a power of their crowding`)}let me={elasticity:s,maxStretch:g,defaultStepSize:E,bandStepFit:F,bandStepFitCapacity:Math.max(1,(i.bandStepFitCapacityX??v)/v),minStep:l},he={elasticity:s,maxStretch:_,defaultStepSize:z,bandStepFit:F,bandStepFitCapacity:Math.max(1,(i.bandStepFitCapacityY??y)/y),minStep:B},ge=H9(W,re,q,me),_e=H9(G,K,J,he),ve=W>0,ye=G>0,be=U===`x`&&V.group>0,xe=U===`y`&&V.group>0,Y,Se,Ce,we,Te=!1,Ee=!1;if(ve&&be){let e=V.group,t=e*L,n=Math.max(Math.ceil(3/d),2*e),r={...me,defaultStepSize:me.defaultStepSize*e},i=H9(V.x,0,q,r);Y=Math.max(n,Math.min(t,i.step)),Ce=`group`,Te=i.fitted}else ve||re>0?(Y=Math.max(l,Math.min(L,ge.step)),Te=ge.fitted):Y=E;if(ye&&xe){let e=V.group,t=e*L,n=Math.max(Math.ceil(3/d),2*e),r={...he,defaultStepSize:he.defaultStepSize*e},i=H9(V.y,0,J,r);Se=Math.max(n,Math.min(t,i.step)),we=`group`,Ee=i.fitted}else ye||K>0?(Se=Math.max(B,Math.min(ee,_e.step)),Ee=_e.fitted):Se=E;for(let e of[`x`,`y`]){let t=e===`x`?`xStep`:`yStep`,n=e===`x`?W||re:G||K,r=e===`x`?Y:Se;if(n<=0){k(t,`no bands`,r,{},`the axis is continuous: no step sizes it`);continue}let i=e===`x`?ve&&be:ye&&xe,a=e===`x`?q:J,o=e===`x`?ge:_e;if(i){k(t,`group step`,r,{groups:e===`x`?V.x:V.y,lanes:V.group,span:a},`one step holds a group of lanes: a house band per lane, held within the room the groups share`);continue}let s=a/n,c=o.stepa+.5;k(t,`bands in the span`,o.step,{bands:n,span:a,spanPerBand:D(s),budget:D(o.budget),stretch:D(o.budget/a),fitted:o.fitted},c&&u?`the house band would overrun the span: the span stretches by a power of the pressure, to its cap, and the step shrinks to share it`:c?`the house band would overrun the span and the cap allows no stretch, so the step is the span per band`:o.fitted?`sparse bands grow toward the room the canvas leaves`:`the house band fits the span and keeps its size`),r!==o.step&&k(t,`clamped`,r,e===`y`?{min:B,max:ee}:{min:l,max:L},`held between the smallest readable step and the widest a band may be`)}let De=i.sparseFill;if(De&&!o&&ie===1&&W>0&&G===0&&K===0){let e=typeof De==`object`?De:{},t=Math.max(0,Math.min(1,e.share??rmn)),n=i.bandStepFitCapacityX??v,r=Qfn(Math.min(q,J),{baseLabelFontSize:i.baseLabelFontSize,baseTitleFontSize:i.baseTitleFontSize}).tickBase,a=bmn[1]*r*J9+Z9,o=ve&&be,s=o?V.x:W,c=o?V.group:1,l=(i.sparseFillBars===!1?e.pointCap??amn:e.barCap??imn)*c,u=Math.floor(Math.min(l,Math.max(0,t*n-a)/s));if(u>Y){let e=Y;Y=u,k(`xStep`,`sparse fill`,Y,{from:e,bands:s,room:D(n),gutter:D(a),share:t,cap:l},`few bands thicken until the drawing spans a share of the room the canvas leaves it, each band no wider than one mark reads`)}}for(let e of[`x`,`y`]){let t=i.labelStep?.[e],n=e===`x`?ve||re>0:ye||K>0,r=e===`x`?Y:Se;!t||!n||t<=r||(e===`x`?Y=t:Se=t,k(e===`x`?`xStep`:`yStep`,`widened for value labels`,t,{from:r},`each band widens to hold its value label, into the room the canvas has`))}for(let e of[`x`,`y`]){let t=e===`x`?re:K;if(t<=0)continue;let n=Math.round((e===`x`?Y:Se)*(t+1));e===`x`?q=n:J=n}let Oe=(v*g-b)/ie-S,ke=(y*_-x)/ae-C,Ae=`the plot may stretch only to the cap times the base, less the allowance; the bands share that`;if(W>0){let e=Ce===`group`?V.x:W,t=Math.max(l,Math.floor(Oe/e));Y>t&&(Y=t,k(`xStep`,`stretch budget`,t,{budget:D(Oe),bands:e,stretchCap:D(g),allowance:b},Ae))}if(re>0){let e=Math.max(l,Math.floor(Oe/(re+1)));Y>e&&(Y=e,k(`xStep`,`stretch budget`,e,{budget:D(Oe),bands:re+1,stretchCap:D(g),allowance:b},Ae))}let je;if(G>0){let e=we===`group`?V.y:G;R>1&&(je=Math.floor(ke/e)>=B);let t=Math.max(we===`group`?l:B,Math.floor(ke/e));Se>t&&(Se=t,k(`yStep`,`stretch budget`,t,{budget:D(ke),bands:e,stretchCap:D(_),allowance:x},Ae))}if(K>0){let e=Math.max(l,Math.floor(ke/(K+1)));Se>e&&(Se=e,k(`yStep`,`stretch budget`,e,{budget:D(ke),bands:K+1,stretchCap:D(_),allowance:x},Ae))}for(let e of[`x`,`y`]){let t=e===`x`?re:K;if(t<=0)continue;let n=e===`x`?Y:Se;e===`x`?q=Math.round(n*(t+1)):J=Math.round(n*(t+1)),k(e===`x`?`width`:`height`,`banded values`,Math.round(n*(t+1)),{values:t,step:D(n)},`a continuous field drawn in bands spans one step per value, plus one`)}let Me=typeof m==`object`&&!!m.seriesCountAxis&&W>0&&G>0&&!be&&!xe;if(Me&&typeof m==`object`){let e=m.x??0,t=m.y??0;if(e>0&&t>0){let n=e>=t,r=n?t:e,i=Math.floor(n?Oe/W:ke/G),a=Math.max(l,Math.min(n?Se:Y,r)),o=Math.min(2,Math.max(1,Math.max(e,t)/Math.min(e,t))),s=Math.max(n?Y:Se,Math.min(i,Math.round(a*o)));n?(Y=s,Se=a):(Se=s,Y=a)}}let Ne=!1;if(W>0&&G>0&&!be&&!xe&&!Me){let e=Math.floor(Oe/W),t=Math.floor(ke/G),n=Math.min(v/W,y/G),r=Math.min(1,Math.max(0,i.cellGrowth??0)),a=hmn+Math.max(0,Math.min(n,hmn*_mn)-hmn)*r,o=Math.max(a,Math.min(Y,Se)),s=Math.min(e,t,o),c=Math.max(Y,Se);if(s>=l&&s*gmn>=c){Y=s,Se=s,Ne=!0;for(let n of[`xStep`,`yStep`])k(n,`square cells`,s,{wanted:o,capX:e,capY:t},`both axes banded: the marks are cells, pulled to one size so tones compare by area`)}}q>Math.round(Oe)&&k(`width`,`stretch budget`,Math.round(Oe),{stretchCap:D(g),allowance:b,columns:ie,gap:S},`held to the cap times the base, less the allowance and the gaps, shared by the columns`),J>Math.round(ke)&&k(`height`,`stretch budget`,Math.round(ke),{stretchCap:D(_),allowance:x,rows:ae,gap:C},`held to the cap times the base, less the allowance and the gaps, shared by the rows`),q=Math.min(q,Math.round(Oe)),J=Math.min(J,Math.round(ke)),re>0&&(Y=Math.min(Y,q/(re+1))),K>0&&(Se=Math.min(Se,J/(K+1)));let Pe=i.targetBandAR;if(Pe&&Pe>0){let e=W>0||re>0,t=G>0||K>0;if(e&&!t){let e=J/Y;if(e>Pe){let t=Y*Pe,n=Math.exp(.5*Math.log(J)+.5*Math.log(t));J=Math.round(Math.max(ue,Math.min(n,J))),k(`height`,`band shape`,J,{bandRatio:D(e),target:Pe,step:D(Y),ideal:D(t)},`bars taller than the target ratio of their step blend halfway toward it, in log space`)}}else if(t&&!e){let e=q/Se;if(e>Pe){let t=Se*Pe,n=Math.exp(.5*Math.log(q)+.5*Math.log(t));q=Math.round(Math.max(le,Math.min(n,q))),k(`width`,`band shape`,q,{bandRatio:D(e),target:Pe,step:D(Se),ideal:D(t)},`bars longer than the target ratio of their step blend halfway toward it, in log space`)}}}{let t=W>0&&re===0?Ce===`group`?V.x:W:0,r=G>0&&K===0?we===`group`?V.y:G:0,a=t>0&&!r&&fe||r>0&&!t&&de;if(i.bandBalance!==!1&&!o&&a){let a=t?K9(e.x?.field,n):null,o=r&&R===1?K9(e.y?.field,n):null,s=e=>t?e.xStep*t:e.w,c=e=>r?e.yStep*r:e.h,l=e=>ie*s(e)+(ie-1)*S,u=e=>ae*c(e)+(ae-1)*C,d=e=>Qfn(Math.min(s(e),c(e)),{baseLabelFontSize:i.baseLabelFontSize,baseTitleFontSize:i.baseTitleFontSize}),f=(e,t)=>U9(e,!0,{baseFont:d(t).tickBase,minFont:6}),p=(e,t)=>e*t*J9,m=e=>d(e).titleFontSize*1.25+4,h=e=>{let t=d(e).tickBase,n=p(bmn[0],t),r=p(bmn[1],t);if(o){let t=f(e.yStep,e).fontSize,i=Math.max(ymn,vmn*s(e));n=Math.min(i,p(o.meanLen,t)),r=Math.min(i,p(o.maxLen,t))}return{lo:n+Z9,hi:r+Z9+m(e)+(ae>1?m(e):0)}},b=e=>{let t=d(e).tickBase*1.25,n=t;if(a){let r=f(e.xStep,e),i=r.fontSize*1.25,o=Math.max(ymn,vmn*c(e)),s=p(a.meanLen,r.fontSize),l=p(a.maxLen,r.fontSize);r.labelAngle===-90?(t=Math.min(o,s),n=Math.min(o,l)):(t=s<=e.xStep?i:2*i,n=l<=e.xStep?i:Math.max(2*i,Math.min(o,l)))}return{lo:t+Z9,hi:n+Z9+m(e)+(ie>1?m(e):0)}},x=e=>{let t=h(e),n=b(e);return{lo:(l(e)+t.lo)/(u(e)+n.hi),hi:(l(e)+t.hi)/(u(e)+n.lo)}},w=(e,t)=>Math.abs(Math.log(Mpn(x(e),t)))>.01,T=(e,t,n)=>(e-(t-1)*n)/t,O=(e,t,n=!1)=>Math.min(Math.floor(t/e),n?Math.max(ee,Math.round(z*xmn)):Math.max(L,Math.round(E*xmn))),A=Math.max(Math.round(v*Smn/ie),le),j=Math.max(Math.round(y*Smn/ae),ue),M=(e,n)=>{let i={...n};if(Mpn(x(i),e)>1){let t=()=>T((l(i)+h(i).lo)/e.hi-b(i).hi,ae,C);r?i.yStep=Math.max(i.yStep,Math.min(O(r,ke,!0),Math.ceil(t()/r))):i.h=Math.max(i.h,Math.min(Math.round(ke),Math.ceil(t()))),r&&w(i,e)&&(i.w=Math.min(i.w,Math.max(A,Math.floor(T(e.hi*(u(i)+b(i).hi)-h(i).lo,ie,S)))))}else{let n=()=>T(e.lo*(u(i)+b(i).lo)-h(i).hi,ie,S);t?i.xStep=Math.max(i.xStep,Math.min(O(t,Oe),Math.ceil(n()/t))):i.w=Math.max(i.w,Math.min(Math.round(Oe),Math.ceil(n()))),t&&w(i,e)&&(i.h=Math.min(i.h,Math.max(j,Math.floor(T((l(i)+h(i).hi)/e.lo-b(i).lo,ae,C)))))}return i},N=Apn({width:v,height:y},{x:g,y:_},{centre:i.targetAspect,spread:i.aspectTolerance}),P={w:q,h:J,xStep:Y,yStep:Se};if(w(P,N)){let e=N,t=`its own range`,n=M(N,P);w(n,N)&&(e=jpn(N,Ppn),t=`the looser range round its base`,n=M(e,P));let r=x(P),i={shape:`${D(r.lo)}\u2013${D(r.hi)}`,range:`${D(e.lo)}\u2013${D(e.hi)}`,columns:ie,rows:ae},a=`with the labels it cannot drop, the chart fell outside the shapes its base takes on its own; it leans back to the nearer end of ${t}, by its free sides`;n.xStep!==Y&&(Y=n.xStep,k(`xStep`,`band balance`,Y,i,a)),n.yStep!==Se&&(Se=n.yStep,k(`yStep`,`band balance`,Se,i,a)),n.w!==q&&(q=n.w,k(`width`,`band balance`,q,i,a)),n.h!==J&&(J=n.h,k(`height`,`band balance`,J,i,a))}}}let Fe=i.canvasTreatment?.plotSpace;if(Fe&&!o&&ie===1&&ae===1){let e=`the room the box leaves once what is around the chart is settled`;Fe.width&&de&&(q=Math.max(le,Math.round(Fe.width)),k(`width`,`given space`,q,{given:D(Fe.width)},e)),Fe.height&&fe&&(J=Math.max(ue,Math.round(Fe.height)),k(`height`,`given space`,J,{given:D(Fe.height)},e))}o&&(q=o.width,J=o.height,k(`width`,`pinned`,q,{},`the plot is held at the size it was pinned to`),k(`height`,`pinned`,J,{},`the plot is held at the size it was pinned to`));let Ie=!t.binnedAxes?.x&&(W>0||re>0),Le=!t.binnedAxes?.y&&(G>0||K>0),Re=Qfn(Math.min(q,J),{baseLabelFontSize:i.baseLabelFontSize,baseTitleFontSize:i.baseTitleFontSize}),ze={baseFont:Re.tickBase,minFont:i.minLabelFontSize??6},Be=U9(Y,Ie,ze),Ve=U9(Se,Le,ze);if(Ie){let t=e.x?.field,r=j.x||e.x?.type,i=K9(t,n);if(i){let e=r===`quantitative`||i.allNumeric,t=i.maxLen*Be.fontSize*J9;if(!e&&i.count<=emn&&i.maxLen<=tmn||e&&t<=Y){if(t>Y){let e=Math.ceil(t)+6,n=Math.max(l,Math.floor(Oe/i.count));e<=n&&(Y=Math.max(Y,e),k(`xStep`,`room for names`,Y,{widestName:D(t),wanted:e,cap:n},`a few short names read straight, so the band widens to hold the widest with a gap, within the stretch budget`),Ne&&SeY&&Be.labelAngle===void 0&&(Be={...Be,labelAngle:-90,labelAlign:`right`,labelBaseline:`middle`})}}if(Le){let t=e.y?.field;Fpn(t,j.y||e.y?.type,n)&&(Ve={...Ve,labelAngle:0,labelAlign:`right`,labelBaseline:`middle`})}let He=Math.min(Be.fontSize,Ve.fontSize);return Be.fontSize!==He&&(Be={...Be,fontSize:He}),Ve.fontSize!==He&&(Ve={...Ve,fontSize:He}),{subplotWidth:q,subplotHeight:J,xStep:Y,yStep:Se,...je===void 0?{}:{rowNamesAboveFit:je},xStepUnit:Ce,yStepUnit:we,xStepFitted:Te,yStepFitted:Ee,xContinuousAsDiscrete:re,yContinuousAsDiscrete:K,xNominalCount:W,yNominalCount:G,xLabel:Be,yLabel:Ve,titleFontSize:Re.titleFontSize,legendFontSize:Re.legendFontSize,stepPadding:d,facet:ie>1||ae>1?{columns:ie,rows:ae,subplotWidth:q,subplotHeight:J}:void 0,effectiveFacetGap:S,truncations:[],trace:O}}function Ypn(e,t){let n=[],r=e.color?.field,i=e.detail?.field;if(r&&n.push(r),i&&i!==r&&n.push(i),n.length===0)return 1;let a=new Set;for(let e of t){let t=n.map(t=>String(e[t]??``)).join(`\0`);a.add(t)}return a.size}function Xpn(e,t,n,r,i,a){let o=.5,s=n[1]-n[0],c=r[1]-r[0];if(s<=0||c<=0)return 1;if(!a){let i=e.length,a=0,l=0;for(let o=0;o1?1+(g-1)*.3:1-(1-g)*.3;return Math.min(3,Math.max(o,_))}let l=new Map;for(let n=0;ne.x-t.x);let u=[],d=0;for(let e of l.values())e.length>d&&(d=e.length);let f=Math.max(0,Math.floor(Math.log2(d))-1);for(let e=0;e<=f;e++){let t=1<e-t);let r=n.length>>1,i=n.length%2==1?n[r]:(n[r-1]+n[r])/2;i>0&&u.push(i)}if(u.length===0)return 1;let p=0;for(let e of u)p+=Math.log(e);let m=Math.exp(p/u.length);return m<=0?3:Math.min(3,Math.max(o,Math.max(1,m)))}function Zpn(e,t,n,r,i){let{minStep:a=Y9,stepPadding:o=.1,maxColorValues:s=24}=i,{x:c,y:l}=q9(i),u=i.facetFixedPadding?.width??0,d=i.facetFixedPadding?.height??0,f=i.facetGap??0,p=e=>e===`nominal`||e===`ordinal`,m=n=>t.resolvedTypes?.[n]??e[n]?.type,h=Qpn(e,t,n,r,i),g=h?.columns??1,_=h?.rows??1,v=Math.max(i.minSubplotSize??60,(r.width*c-u)/g-f),y=Math.max(i.minSubplotSize??60,(r.height*l-d)/_-f),b=e.group?.field,x=0,S;b&&(x=new Set(n.map(e=>e[b])).size,p(m(`x`))?S=`x`:p(m(`y`))&&(S=`y`));let C=S===`x`&&x>1?x:1,w=S===`y`&&x>1?x:1,T=C>1?Math.max(Math.ceil(3/o),2*C):a,E=w>1?Math.max(Math.ceil(3/o),2*w):a,D=Math.floor(v/T),O=Math.floor(y/E);if(h){let t=Math.max(1,Math.floor(r.width/T)),a=Math.max(1,Math.floor(r.height/E));if(D>t||O>a){D=Math.min(D,t),O=Math.min(O,a);let o=e.column?.field,s=e.row?.field,p=o?new Set(n.map(e=>e[o])).size:0;if(p>1&&!s){let e=Math.max(i.minSubplotSize??60,D*T),t=r.width*c-u,n=r.height*l-d,a=Math.max(1,Math.floor(t/(e+f))),o=a*Math.max(1,Math.floor(n/((i.minSubplotSize??60)+f))),s=Math.min(p,o),m=Math.ceil(s/a);h.columns=Math.ceil(s/m),h.rows=m,h.maxColumnValues=o}}}return{maxValues:{x:D,y:O,column:h?.maxColumnValues??1/0,row:h?.maxRowValues??1/0,color:s},facetGrid:h}}function Qpn(e,t,n,r,i){let{x:a,y:o}=q9(i),s=i.facetFixedPadding?.width??0,c=i.facetFixedPadding?.height??0,l=i.facetGap??0,u=i.minStep??Y9,d=i.stepPadding??.1,f=i.minSubplotSize??60,p=e=>e===`nominal`||e===`ordinal`,m=r.width*a-s,h=r.height*o-c,g=e.group?.field,_=0,v;if(g){_=new Set(n.map(e=>e[g])).size;let r=t.resolvedTypes?.x??e.x?.type,i=t.resolvedTypes?.y??e.y?.type;p(r)?v=`x`:p(i)&&(v=`y`)}let y=f,b=f;for(let t of[`x`,`y`]){let r=e[t];if(!r?.field||!r.scaleType||r.scaleType!==`log`&&r.scaleType!==`symlog`)continue;let i=n.map(e=>e[r.field]).filter(e=>typeof e==`number`&&e>0&&isFinite(e));if(i.length<2)continue;let a=Math.log10(Math.max(...i))-Math.log10(Math.min(...i)),o=Math.ceil(Math.max(1,a))*40;t===`x`?y=Math.max(y,o):b=Math.max(b,o)}for(let r of[`x`,`y`]){let i=e[r];if(!i?.field)continue;let a=t.resolvedTypes?.[r]??i.type,o=t.axisFlags?.[r]?.banded===!0;if(!p(a)&&!o)continue;let s=new Set(n.map(e=>e[i.field])).size,c=v===r&&_>1?_:1,l=r===`x`?m:h,g;if(c>1){let e=Math.max(Math.ceil(3/d),2*c);g=Math.max(u*c,e)}else g=u;let x=Math.min(g*s,l),S=Math.max(f,x);r===`x`?y=S:b=S}let x=(()=>{let n=e.x;if(!n?.field)return!1;let r=t.resolvedTypes?.x??n.type;return!p(r)&&t.axisFlags?.x?.banded!==!0})(),S=(()=>{let n=e.y;if(!n?.field)return!1;let r=t.resolvedTypes?.y??n.type;return!p(r)&&t.axisFlags?.y?.banded!==!0})();if(x&&S){let r=e.x,s=e.y;if(r?.field&&s?.field){let c=(t.resolvedTypes?.x??r.type)===`temporal`,l=(t.resolvedTypes?.y??s.type)===`temporal`,u=i.continuousMarkCrossSection,d=typeof u==`object`&&!!u.seriesCountAxis,p=[],m=[],h=[],g=[],_=e.column?.field,v=e.row?.field;_&&g.push(_),v&&g.push(v);let x=e.color?.field,S=e.detail?.field;x&&g.push(x),S&&S!==x&&g.push(S);for(let e of n){let t=e[r.field],n=e[s.field];if(t==null||n==null)continue;let i=c?+new Date(t):+t,a=l?+new Date(n):+n;isNaN(i)||isNaN(a)||(p.push(i),m.push(a),h.push(g.length>0?g.map(t=>String(e[t]??``)).join(`\0`):``))}if(p.length>1){let e=Math.min(...p),t=Math.max(...p),n=Math.min(...m),i=Math.max(...m),c=[e,t],l=[n,i];r.zero?.zero&&(c[0]>0&&(c[0]=0),c[1]<0&&(c[1]=0)),s.zero?.zero&&(l[0]>0&&(l[0]=0),l[1]<0&&(l[1]=0));let u=Xpn(p,m,c,l,h,d);u>=1?(y=Math.max(y,Math.round(f*Math.min(u,a))),b=Math.max(b,f)):(y=Math.max(y,f),b=Math.max(b,Math.round(f*Math.min(1/u,o))))}}}let C=m,w=h,T=Math.max(1,Math.floor(C/(y+l))),E=Math.max(1,Math.floor(w/(b+l))),D=e.column?.field,O=e.row?.field;if(!D&&!O)return;let k=D?new Set(n.map(e=>e[D])).size:0,A=O?new Set(n.map(e=>e[O])).size:0;if(k===0&&A===0)return;let j=i.facetColumns!=null&&i.facetColumns>=1?Math.min(Math.max(1,Math.floor(i.facetColumns)),Math.max(1,k)):void 0;if(k>0&&A===0){if(j!=null){let e=Math.ceil(k/j);return{columns:j,rows:e,maxColumnValues:j*e,maxRowValues:Math.max(E,e)}}if(k<=T)return{columns:k,rows:1,maxColumnValues:k,maxRowValues:E};let e=T,t=Math.ceil(k/e);for(;e>2&&k%e===1;)e--,t=Math.ceil(k/e);let n=Math.min(t,E),r=e*n;return{columns:e,rows:n,maxColumnValues:r,maxRowValues:E}}return{columns:Math.max(1,Math.min(k,T)),rows:Math.max(1,Math.min(A,E)),maxColumnValues:T,maxRowValues:E}}function $pn(e,t,n,r){let i=r.minStep??Y9,a=r.minSubplotSize??60,o=a,s=a;for(let t of[`x`,`y`]){let r=e[t];if(!r?.field||!r.scaleType||r.scaleType!==`log`&&r.scaleType!==`symlog`)continue;let i=n.map(e=>e[r.field]).filter(e=>typeof e==`number`&&e>0&&isFinite(e));if(i.length<2)continue;let a=Math.log10(Math.max(...i))-Math.log10(Math.min(...i)),c=Math.ceil(Math.max(1,a))*40;t===`x`?o=Math.max(o,c):s=Math.max(s,c)}let c=e=>e===`nominal`||e===`ordinal`;for(let r of[`x`,`y`]){let l=e[r];if(!l?.field)continue;let u=t.resolvedTypes?.[r]??l.type,d=t.axisFlags?.[r]?.banded===!0,f=c(u),p=0;if((d||f)&&(p=new Set(n.map(e=>e[l.field])).size),p>0){let e=Math.max(a,p*i);r===`x`?o=Math.max(o,e):s=Math.max(s,e)}}return{minSubplotWidth:o,minSubplotHeight:s}}var emn,tmn,J9,nmn,rmn,imn,amn,Y9,omn,smn,cmn,lmn,umn,dmn,fmn,pmn,mmn,X9,hmn,gmn,_mn,vmn,ymn,bmn,Z9,xmn,Smn;Object.freeze({color:`#47525c`,opacity:.58,width:1,fillOpacity:.07,haloColor:`#ffffff`,haloOpacity:.64,haloWidth:.5}),Object.freeze({fill:`#2563eb`,fillOpacity:.12,stroke:`#2563eb`,strokeOpacity:.85,strokeWidth:1}),Object.freeze({type:`element`,gesture:`click`}),Object.freeze({type:`element`,gesture:`hover`}),Object.freeze({type:`element`,gesture:`keyboard`}),Object.freeze({type:`element`,gesture:`context`}),Object.freeze({type:`element`,gesture:`double`}),Ifn(),Sfn(),Object.freeze({interactions:Object.freeze([]),surface:Object.freeze({})}),`${[``,``,``,``].join(``)}`;var Cmn=`linked-selection`,wmn=.2;function Tmn(e,t){let n=new Map,r=e=>{let r={};for(let n of t){let t=e[n];if(t==null)return;r[n]=t}n.set(JSON.stringify(r),r)};for(let n of e)if(t.every(e=>n.value?.[e]!==void 0))r(n.value);else for(let e of n.records??[])r(e);return[...n.values()]}var Emn=e=>e===`brush-x`||e===`brush-y`;function Dmn(e,t){let n=Tmn(e,t.fields),r={};for(let e of t.fields){let i=[...new Map(n.map(t=>[JSON.stringify(t[e]),t[e]])).values()];if(i.length!==0)if(Emn(t.preset)&&i.every(e=>typeof e==`number`)){let t=i;r[e]={range:[Math.min(...t),Math.max(...t)]}}else r[e]={in:i}}return r}function Omn(e,t){return Object.keys(t).filter(t=>e.receives.includes(t))}function kmn(e,t){let n=new Map;for(let[r,i]of Object.entries(e)){let e=Omn(i,t);e.length!==0&&n.set(r,{id:Cmn,ops:[{op:`set-style`,targets:[{select:{where:Object.fromEntries(e.map(e=>[e,t[e]]))}}],value:{state:`emphasized`,mutedOpacity:wmn}}]})}return n}function Amn(e,t,n,r){let i=e.gestures[t];if(!i||i.hover!==r)return null;let a=n.entries?.get(t);if(!a||a.elements.length===0||a.layer!==(r?`preview`:`retained`))return null;let o=Dmn(a.elements,i);return Object.keys(o).length>0?o:null}var jmn={idle:`Copy board as PNG`,working:`Copying the board…`,copied:`Board copied`,downloaded:`Board downloaded`,error:`Could not export the board`};function Mmn(e){if(e===void 0)return`Flint default`;if(typeof e==`string`)return e;let t=e;return t.label??t.id??(t.extends?`custom (${t.extends})`:`custom`)}var Nmn=[],Pmn={parts:{},from:{},impliedBy:{}};function Fmn(e){return e.entries?.has(`linked-selection`)?{...e,entries:new Map([...e.entries].filter(([e])=>e!==Cmn))}:e}var Imn=new WeakMap;function Lmn(e){return Imn.has(e)||Imn.set(e,e.updates?.length?pqe(e.input,`vegalite`,{updates:e.updates}).updates:void 0),Imn.get(e)}var Q9={background:`#ffffff`,ink:`#1a1a1a`,muted:`#6b6b6b`,font:`Arial, Roboto, "Helvetica Neue", sans-serif`,titleFont:`Arial, Roboto, "Helvetica Neue", sans-serif`};function Rmn(e){if(e===void 0)return Q9;try{let t=PT({data:{values:[{a:`a`,b:1}]},theme_spec:e,chart_spec:{chartType:`Bar Chart`,title:`t`,subtitle:`s`,encodings:{x:{field:`a`},y:{field:`b`}}}}),n=t.config?.title??{};return{background:typeof t.background==`string`?t.background:Q9.background,ink:typeof n.color==`string`?n.color:Q9.ink,muted:typeof n.subtitleColor==`string`?n.subtitleColor:Q9.muted,font:t.config?.font??Q9.font,titleFont:typeof n.font==`string`?n.font:t.config?.font??Q9.titleFont}}catch{return Q9}}function zmn(e){let t=new Map(e.filter(e=>e.input.theme_spec!==void 0).map(e=>[JSON.stringify(e.input.theme_spec),e.input.theme_spec]));return t.size===1?[...t.values()][0]:void 0}function Bmn(e){if(!e||e.clientWidth===0)return;let t=getComputedStyle(e);return{width:e.clientWidth,left:parseFloat(t.paddingLeft)||0,right:parseFloat(t.paddingRight)||0,top:parseFloat(t.paddingTop)||0}}function Vmn(e,t){return{height:e.height,background:e.color??t,...e.stated?{width:e.width}:{}}}function Hmn(e){let{baseSize:t,canvasSize:n,...r}=e.chart_spec;return t===void 0&&n===void 0?e:{...e,chart_spec:r}}function Umn(e,t){return Hdn(Hmn(e),{width:w9.width,height:t})}var Wmn=260;function Gmn(e,t,n){let r={width:p9(e.chart_spec.chartType)?Math.min(t,Wmn):t,height:n};return{...e,chart_spec:{...e.chart_spec,baseSize:r,canvasSize:r},options:{...e.options,bandStepFit:e.options?.bandStepFit??1}}}function Kmn(){let[e,t]=(0,Z.useState)(null),n=(0,Z.useRef)(null),r=(0,Z.useCallback)(e=>{if(n.current?.disconnect(),!e)return;let r=()=>{let n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),i=Math.floor(r/8)*8;i>0&&t(e=>e===i?e:i)};r(),n.current=new ResizeObserver(r),n.current.observe(e)},[]);return(0,Z.useEffect)(()=>()=>n.current?.disconnect(),[]),[r,e]}var qmn=160,Jmn=120;function Ymn({chart:e,input:t,units:n,height:r,kpi:i,updates:a,view:o,onView:s,onTable:c,onRender:l,onChange:u,onWarnings:d}){let[f,p]=Kmn(),m=(0,Z.useMemo)(()=>i?p?Gmn(t,p,r):null:Umn(t,r),[i,t,p,r]),h=(0,Z.useCallback)(t=>l(e.id,t),[e.id,l]),g=(0,Z.useCallback)(t=>u(e.id,t),[e.id,u]),_=(0,Z.useCallback)(t=>d(e.id,t),[e.id,d]),v=Zmn(e.id,m,o,c),y=wT(t.chart_spec.chartType),{title:b}=t.chart_spec;return(0,$.jsxs)(`section`,{className:i?`board-cell board-cell-kpi`:`board-cell`,"data-chart-id":e.id,style:{gridColumn:`span ${n}`},children:[!y&&(0,$.jsx)(ofn,{view:o,onView:t=>s(e.id,t),name:b??e.id}),(0,$.jsxs)(`div`,{className:Xmn(`board-cell-chart`,y,v),style:y?{height:r}:void 0,ref:i?f:void 0,children:[!y&&m&&(0,$.jsx)(jun,{className:`chart-interactive`,spec:m,updates:a,renderer:`svg`,expressionInterpreter:f9,chartId:`flint-board-${e.id}`,width:`100%`,fit:i?`scale-down`:`relayout`,fallback:(0,$.jsx)(`span`,{className:`chart-pending`,children:`Rendering…`}),onRender:h,onChange:g,onWarnings:_}),v&&(0,$.jsx)(l9,{table:v,updates:a})]})]})}function Xmn(e,t,n){return t?`${e} table-cell`:n?`${e} view-table`:e}function Zmn(e,t,n,r){let i=afn(t,n);return(0,Z.useEffect)(()=>r(e,i),[e,i,r]),(0,Z.useEffect)(()=>()=>r(e,null),[e,r]),i}function Qmn(e,t,n){let r=(0,Z.useRef)(new Map);return(0,Z.useMemo)(()=>{let i=e.map(e=>({chart:e,input:n?{...e.input,theme_spec:t}:e.input.theme_spec!==void 0||t===void 0?e.input:{...e.input,theme_spec:t}})),a=tdn(i.map(({input:e})=>e)),o=new Map;for(let{chart:e,input:t}of i){let n=edn(t),i=n?a.get(n):void 0,s=JSON.stringify([t.theme_spec??null,i??null]),c=r.current.get(e.id);if(c&&c.chart===e&&c.key===s){o.set(e.id,c);continue}let l=n&&i?ndn(t,i):t;o.set(e.id,{chart:e,key:s,input:l})}return r.current=o,new Map([...o].map(([e,t])=>[e,t.input]))},[e,t,n])}var $mn=16,ehn=11;function thn({chart:e,input:t,box:n,settled:r,kpi:i,editing:a,active:o,updates:s,view:c,onView:l,onTable:u,onGesture:d,onRender:f,onChange:p,onWarnings:m}){let h=Math.max(60,n.height-ehn),g=Math.max(60,r.height-ehn),[_,v]=(0,Z.useState)(null),y=_&&_.input===t&&_.width===r.width&&_.height===g?_:null,b=(0,Z.useMemo)(()=>Gmn(t,Math.max(qmn,r.width-(y?.over.width??0)),Math.max(Jmn,g-(y?.over.height??0))),[t,r.width,g,y?.over.width,y?.over.height]),x=n.width!==r.width||n.height!==r.height,S=(0,Z.useCallback)(n=>{if(!y&&!x){let e=n.element.querySelector(`svg`),i={width:Number(e?.getAttribute(`width`))||0,height:Number(e?.getAttribute(`height`))||0},a={width:Math.max(0,Math.ceil(i.width-r.width)),height:Math.max(0,Math.ceil(i.height-g))};v({input:t,width:r.width,height:g,over:a.width>1||a.height>1?a:{width:0,height:0}})}f(e.id,n)},[e.id,f,y,x,t,r.width,g]),C=(0,Z.useCallback)(t=>p(e.id,t),[e.id,p]),w=(0,Z.useCallback)(t=>m(e.id,t),[e.id,m]),{title:T}=t.chart_spec,E=t=>({onPointerDown:n=>d(t,e.id,n)}),D=Zmn(e.id,b,c,u),O=wT(t.chart_spec.chartType);return(0,$.jsxs)(`section`,{className:[`board-tile`,i?`board-cell-kpi`:``,o?`board-tile-active`:``].filter(Boolean).join(` `),"data-chart-id":e.id,style:n,children:[!a&&!O&&(0,$.jsx)(ofn,{view:c,onView:t=>l(e.id,t),name:T??e.id}),(0,$.jsxs)(`div`,{className:Xmn(`board-cell-chart board-tile-chart`,O,D),style:O?{height:h}:void 0,children:[!O&&(0,$.jsx)(jun,{className:`chart-interactive`,spec:b,updates:s,renderer:`svg`,expressionInterpreter:f9,chartId:`flint-board-${e.id}`,width:n.width,height:h,fit:`relayout`,fallback:(0,$.jsx)(`span`,{className:`chart-pending`,children:`Rendering…`}),onRender:S,onChange:C,onWarnings:w}),D&&(0,$.jsx)(l9,{table:D,updates:s})]}),a&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,className:`board-tile-handle`,"aria-label":`Move ${T??e.id}`,title:`Drag to move`,...E(`move`),children:(0,$.jsx)(`svg`,{width:`10`,height:`14`,viewBox:`0 0 10 14`,"aria-hidden":`true`,children:[2,7,12].flatMap(e=>[2,8].map(t=>(0,$.jsx)(`circle`,{cx:t,cy:e,r:`1.4`,fill:`currentColor`},`${t}-${e}`)))})}),(0,$.jsx)(`div`,{className:`board-tile-edge board-tile-edge-right`,"aria-label":`Resize ${e.id} width`,...E(`right`)}),(0,$.jsx)(`div`,{className:`board-tile-edge board-tile-edge-bottom`,"aria-label":`Resize ${e.id} height`,...E(`bottom`)}),(0,$.jsx)(`div`,{className:`board-tile-corner`,"aria-label":`Resize ${e.id}`,...E(`corner`)}),(0,$.jsx)(`div`,{className:`board-tile-corner board-tile-corner-left`,"aria-label":`Resize ${e.id} from the left`,...E(`corner-left`)})]})]})}function nhn(e){let t=(0,Z.useRef)(new Map);return(0,Z.useMemo)(()=>{let n=new Map,r=e.charts.map(e=>{let r=JSON.stringify(e),i=t.current.get(e.id),a=i&&i.key===r?i:{key:r,chart:e};return n.set(e.id,a),a.chart});return t.current=n,r},[e])}function rhn({app:e,initial:t,hostContext:n}){let[r,i]=(0,Z.useState)(t),[a,o]=(0,Z.useState)(null),s=(0,Z.useRef)(a);s.current=a;let[c,l]=(0,Z.useState)(`idle`),[u,d]=(0,Z.useState)(Pmn),[f,p]=(0,Z.useState)(null),m=(0,Z.useRef)(new Map),h=nhn(r),{viewOf:g,setView:_}=ifn(h),v=(0,Z.useRef)(new Map),y=(0,Z.useRef)(new Map),b=(0,Z.useRef)(new Map),x=(0,Z.useRef)(new Map),S=(0,Z.useRef)(null),C=(0,Z.useRef)(r);C.current=r;let w=(0,Z.useRef)(h);w.current=h;let T=(0,Z.useRef)(u);T.current=u;let[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(null),[A,j]=(0,Z.useState)(null);(0,Z.useEffect)(()=>i(t),[t]);let M=(0,Z.useCallback)(()=>{d(e=>Object.keys(e.parts).length===0?e:Pmn)},[]),N=(0,Z.useCallback)((e,t)=>{let n=C.current.linked?.[e],r=t.interactionId;if(!n||!r||!n.gestures[r]||n.gestures[r].hover)return;let i=Amn(n,r,t.state,!1);if(!i){M();return}let a=w.current.find(t=>t.id===e)?.input.data.values??[],o=efn(Object.keys(i),a);d(t=>{let n=Object.fromEntries(Object.entries(t.impliedBy).filter(([e,t])=>!(e in i)&&!(t in i)));return{parts:{...t.parts,...i},from:{...t.from,...Object.fromEntries(Object.keys(i).map(t=>[t,e]))},impliedBy:{...n,...o}}}),m.current.get(e)?.clearUpdate(r)},[M]),P=(0,Z.useCallback)(e=>{d(t=>{let n=new Set([e,...Object.entries(t.impliedBy).filter(([,t])=>t===e).map(([e])=>e)]),r=Object.fromEntries(Object.entries(t.parts).filter(([e])=>!n.has(e)));return Object.keys(r).length===0?Pmn:{parts:r,from:Object.fromEntries(Object.entries(t.from).filter(([e])=>!n.has(e))),impliedBy:Object.fromEntries(Object.entries(t.impliedBy).filter(([e,t])=>!n.has(e)&&!n.has(t)))}})},[]),F=(0,Z.useCallback)((e,t)=>{let n=C.current.linked?.[e],r=t.interactionId;if(!n||!r||!n.gestures[r]?.hover)return!1;let i=t.phase===`preview`?Amn(n,r,t.state,!0):null;return p(t=>i?t&&t.source===e&&JSON.stringify(t.parts)===JSON.stringify(i)?t:{source:e,parts:i}:t?.source===e?null:t),!0},[]);(0,Z.useEffect)(()=>{let e=new Set(r.link_spec?.fields??[]);d(t=>{let n=Object.entries(t.parts).filter(([t])=>e.has(t));return n.length===Object.keys(t.parts).length?t:{...t,parts:Object.fromEntries(n)}})},[r.link_spec]),(0,Z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&M()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M]);let I=(0,Z.useMemo)(()=>{let e=f?{...u.parts,...f.parts}:u.parts,t=r.linked?kmn(r.linked,e):new Map,n=new Map;for(let e of h){let r=[...e.updates??[]],i=t.get(e.id);i&&r.push(i),n.set(e.id,r.length>0?r:Nmn)}return n},[h,r.linked,u,f]),L=(0,Z.useCallback)(()=>{let t=C.current,n=[`Board${t.title?` "${t.title}"`:``}: ${t.charts.length} charts, as the reader sees them now. To change it, change the board spec and call show again.`];for(let e of w.current){let r=v.current.get(e.id),i=e.input.theme_spec!==void 0||t.theme_spec===void 0?e.input:{...e.input,theme_spec:t.theme_spec},a=Adn({state:r&&Fmn(r),agent:i,shown:i,updates:e.updates,checks:Lmn(e),warnings:y.current.get(e.id),drawnUpdates:e.updates,gestures:x.current.get(e.id),table:b.current.get(e.id)}).text;n.push(``,`## ${e.id}`,a)}let r=t.link_spec;if(r&&t.linked){n.push(``,`Links (fields: ${r.fields.join(`, `)}):`);let e=T.current,i=Object.keys(e.parts);if(i.length===0)n.push(`- No selection: every chart shows all its marks.`);else{let r=i.map(n=>`${nfn(n,e.parts[n],t.charts.find(t=>t.id===e.from[n])?.input)} (selected on ${e.from[n]})`),a=Object.entries(t.linked).map(([t,n])=>{let r=Omn(n,e.parts);return`${t} ${r.length>0?`by ${r.join(` and `)}`:`unaffected`}`});n.push(`- The board is narrowed to ${r.join(` and `)}.`,`- Each chart shows it on the fields its marks carry: ${a.join(`; `)}.`)}}let i=s.current;i&&n.push(``,i.theme===null?`The reader picked Flint's default theme for every chart. To keep it in the next show, leave theme_spec out of the board and the charts.`:`The reader picked the theme ${Mmn(i.theme)} for every chart. To keep it in the next show, pass theme_spec: ${JSON.stringify(i.theme)} on the board and leave it out of the charts.`),t.grid&&n.push(``,`Layout, as the reader arranged it on a 12-column grid:`,...sdn(t.grid),`To keep it in the next show, pass grid: ${JSON.stringify(t.grid)} on the board.`);let a=n.join(` +`);a!==S.current&&(S.current=a,e.updateModelContext({content:[{type:`text`,text:a}]}).catch(e=>console.warn(`The host declined the board context`,e)))},[e]);(0,Z.useEffect)(()=>L(),[r,h,u,a,L]);let R=(0,Z.useCallback)((e,t)=>{t?b.current.set(e,t):b.current.delete(e),L()},[L]),z=(0,Z.useCallback)((e,t)=>{let n=t.getState();m.current.set(e,t),n&&v.current.set(e,n),L()},[L]),B=(0,Z.useCallback)((e,t)=>{y.current.set(e,t)},[]),ee=(0,Z.useCallback)((e,t)=>{if(!(t.source!==`host`&&F(e,t))&&(t.source===`reader`&&t.reset&&M(),t.phase===`commit`)){if(v.current.set(e,t.state),t.source===`host`){L();return}if(t.interactionId){let n=x.current.get(e);n||x.current.set(e,n=new Map),n.set(t.interactionId,{action:t.action,geometry:t.geometry})}N(e,t),L()}},[L,N,F,M]),[V,H]=Kmn(),U=(0,Z.useMemo)(()=>{let e=h.map(e=>({id:e.id,chartType:e.input.chart_spec.chartType,layout:e.layout}));return Jun(e,Wun(e,r.columns),H??void 0)},[h,r.columns,H]),te=a?a.theme??void 0:r.theme_spec,ne=Qmn(h,te,a!==null),W=(0,Z.useCallback)(e=>{let t=JSON.stringify(e??null)===JSON.stringify(C.current.theme_spec??null);o(t?null:{theme:e??null})},[]),G=(0,Z.useMemo)(()=>a!==null||te!==void 0?te:zmn(h),[a,te,h]),re=(0,Z.useMemo)(()=>Rmn(G),[G]);(0,Z.useEffect)(()=>{document.documentElement.style.background=re.background,document.body.style.background=re.background},[re.background]),mfn(n,n?.displayMode===`fullscreen`||n?.displayMode===`pip`);let K=(0,Z.useMemo)(()=>new Map(h.map(e=>[e.id,e])),[h]),ie=E??r.grid,ae=(0,Z.useRef)(null),oe=H?(H-264)/12:0,se=(0,Z.useCallback)(e=>({left:Math.round(e.x*(oe+24)),top:e.y*20,width:Math.round(e.w*oe+(e.w-1)*24),height:e.h*20-$mn}),[oe]),ce=(0,Z.useCallback)(e=>{let t=w.current.find(t=>t.id===e);return t&&p9(t.input.chart_spec.chartType)?idn.w:rdn.w},[]),le=(0,Z.useCallback)(e=>{let t=w.current.find(t=>t.id===e);return t&&p9(t.input.chart_spec.chartType)?idn.h:rdn.h},[]),ue=(0,Z.useCallback)(()=>{let e=ae.current;if(!e)return[];let t=e.getBoundingClientRect().top,n=[],r=0;for(let i of U){let a=0,o=0;for(let s of i.charts){let i=e.querySelector(`.board-cell[data-chart-id="${CSS.escape(s.id)}"]`)?.getBoundingClientRect(),c=i?Math.max(le(s.id),Math.round((i.bottom-Math.max(t,i.top)+$mn)/20)):17;n.push({id:s.id,x:a,y:r,w:s.units,h:c}),a+=s.units,o=Math.max(o,c)}for(let e of n.slice(n.length-i.charts.length))e.h=o;r+=o}return n},[U,le]),q=(0,Z.useCallback)(()=>{j(null),D(r.grid?r.grid.map(e=>({...e})):ue())},[r.grid,ue]),J=(0,Z.useCallback)(e=>{i(t=>{let{grid:n,...r}=t;return e?{...r,grid:e}:r}),D(null)},[]),de=(0,Z.useRef)(null),fe=(0,Z.useCallback)((e,t,n)=>{E&&(n.preventDefault(),n.stopPropagation(),n.currentTarget.setPointerCapture(n.pointerId),de.current={kind:e,id:t,x:n.clientX,y:n.clientY,start:E},k(t))},[E]),pe=(0,Z.useRef)(null),me=(0,Z.useCallback)(e=>{let t=de.current;if(!t||!oe)return;let n=Math.round((e.clientX-t.x)/(oe+24)),r=Math.round((e.clientY-t.y)/20),i=t.start.find(({id:e})=>e===t.id);if(t.kind===`move`){let a=pe.current?.getBoundingClientRect(),o=a&&t.start.find(n=>{if(n.id===t.id)return!1;let r=se(n),i=e.clientX-a.left,o=e.clientY-a.top;return i>=r.left&&i<=r.left+r.width&&o>=r.top&&o<=r.top+r.height}),s=!!o&&o.ye.id===t.id?r:e),t.id,ce));return}let c={...i,x:Math.min(12-i.w,Math.max(0,i.x+n)),y:Math.max(0,i.y+r)};D(h9(t.start.map(e=>e.id===t.id?c:e),t.id,ce));return}let a={...i};if((t.kind===`right`||t.kind===`corner`)&&(a.w=Math.min(12-a.x,Math.max(ce(a.id),i.w+n))),t.kind===`corner-left`){let e=i.x+i.w;a.x=Math.min(e-ce(a.id),Math.max(0,i.x+n)),a.w=e-a.x}(t.kind===`bottom`||t.kind===`corner`||t.kind===`corner-left`)&&(a.h=Math.max(le(a.id),i.h+r)),D(h9(t.start.map(e=>e.id===t.id?a:e),t.id,ce))},[oe,se,ce,le]),he=(0,Z.useCallback)(()=>{de.current=null,k(null)},[]),ge=(0,Z.useRef)(new Map),_e=e=>{let t=se(e);return(O===null||!ge.current.has(e.id))&&ge.current.set(e.id,{width:t.width,height:t.height}),ge.current.get(e.id)},ve=(0,Z.useRef)(null),[ye,be]=(0,Z.useState)();(0,Z.useLayoutEffect)(()=>{let e=Bmn(ve.current);be(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)},[H,n?.safeAreaInsets]);let xe=(0,Z.useMemo)(()=>{if(ye)try{return Bge(G,ye.width-ye.left-ye.right)}catch{return}},[G,ye]),Y=xe?.header,Se=Y&&ye?Ave(Y,ye):[],Ce=xe?.rules.filter(e=>e.edge===`top`)??[],we=xe?.rules.filter(e=>e.edge===`bottom`)??[],Te=(0,Z.useCallback)(async()=>{let t=ve.current;if(!t)return;l(`working`);let n=Zdn(t);n.catch(()=>void 0);try{if(navigator.clipboard?.write&&typeof ClipboardItem<`u`){await navigator.clipboard.write([new ClipboardItem({"image/png":n})]),l(`copied`);return}}catch{}try{if(!e.getHostCapabilities()?.downloadFile)throw Error(`no download`);let t=new Uint8Array(await(await n).arrayBuffer()),r=``;for(let e of t)r+=String.fromCharCode(e);let i=await e.downloadFile({contents:[{type:`resource`,resource:{uri:`file:///flint-board.png`,mimeType:`image/png`,blob:btoa(r)}}]});l(i.isError?`error`:`downloaded`)}catch(e){console.error(`The board could not be exported`,e),l(`error`)}},[e]);(0,Z.useEffect)(()=>{if(c===`idle`||c===`working`)return;let e=window.setTimeout(()=>l(`idle`),2500);return()=>window.clearTimeout(e)},[c]);let Ee=Object.entries(u.parts).filter(([e])=>!(e in u.impliedBy)).map(([e,t])=>{let n=K.get(u.from[e]);return{field:e,label:tfn(e,t,n?.input),full:nfn(e,t,n?.input)}}),De=E!==null,Oe=ie?Math.max(...ie.map(e=>e.y+e.h),0)*20:0;return(0,$.jsxs)(`main`,{className:De?`board board-editing`:`board`,ref:e=>{ve.current=e,V(e)},onPointerMove:me,onPointerUp:he,onPointerCancel:he,style:{"--board-bg":re.background,"--board-ink":re.ink,"--board-muted":re.muted,"--board-font":re.font,"--board-title-font":re.titleFont,"--inset-top":`${n?.safeAreaInsets?.top??0}px`,"--inset-right":`${n?.safeAreaInsets?.right??0}px`,"--inset-bottom":`${n?.safeAreaInsets?.bottom??0}px`,"--inset-left":`${n?.safeAreaInsets?.left??0}px`},children:[Se.length>0&&ye&&(0,$.jsx)(`svg`,{className:`board-furniture`,"aria-hidden":`true`,width:ye.width,height:Math.max(...Se.map(e=>(e.y??0)+e.height)),dangerouslySetInnerHTML:{__html:Lve(Se,ye.width)}}),(0,$.jsxs)(`header`,{className:Ce.length?`board-header board-header-themed`:`board-header`,style:Y?{paddingTop:Y.edge+Y.line}:void 0,children:[(0,$.jsx)(`div`,{className:`board-heading`,style:Y?{paddingLeft:Y.beside.start,paddingRight:Y.beside.end}:void 0,children:(0,$.jsxs)(`div`,{className:`board-heading-text`,children:[r.title&&(0,$.jsx)(`h1`,{className:`board-title`,children:r.title}),r.subtitle&&(0,$.jsx)(`p`,{className:`board-subtitle`,children:r.subtitle})]})}),Ce.map((e,t)=>(0,$.jsx)(`div`,{className:`board-rule`,style:Vmn(e,re.ink)},t)),De&&(0,$.jsx)(`p`,{className:`board-hint`,children:`Drag a chart by its handle at the top right: dropped on a chart in its row the two swap; dropped on another row it is inserted there and the rest move down (Shift does the other). Drag the right or bottom edge, or a bottom corner, to resize.`}),A&&(0,$.jsx)(`p`,{className:`board-status`,children:A})]}),h.length===0?(0,$.jsx)(`div`,{className:`board-empty`,children:`No charts on this board yet.`}):ie&&oe>0?(0,$.jsx)(`div`,{className:`board-grid`,ref:pe,style:{height:Oe},children:ie.map(e=>{let t=K.get(e.id),n=ne.get(e.id);return!t||!n?null:(0,$.jsx)(thn,{chart:t,input:n,box:se(e),settled:_e(e),kpi:p9(t.input.chart_spec.chartType),editing:De,active:O===e.id,updates:I.get(e.id)??Nmn,view:g(t),onView:_,onTable:R,onGesture:fe,onRender:z,onChange:ee,onWarnings:B},e.id)})}):(0,$.jsx)(`div`,{className:`board-flow`,ref:ae,children:U.map((e,t)=>(0,$.jsx)(`div`,{className:e.kpi?`board-row board-row-kpi`:`board-row`,style:{gridTemplateColumns:`repeat(12, minmax(0, 1fr))`},children:e.charts.map(t=>{let n=K.get(t.id),r=ne.get(t.id);return!n||!r?null:(0,$.jsx)(Ymn,{chart:n,input:r,units:t.units,height:Vun[e.height],kpi:t.kpi,updates:I.get(t.id)??Nmn,view:g(n),onView:_,onTable:R,onRender:z,onChange:ee,onWarnings:B},t.id)})},e.charts.map(e=>e.id).join(`|`)||t))}),we.map((e,t)=>(0,$.jsx)(`div`,{className:`board-rule board-foot-rule`,style:Vmn(e,re.ink)},t)),r.source&&(0,$.jsx)(`footer`,{className:we.length?`board-source board-source-ruled`:`board-source`,children:r.source}),h.length>0&&(0,$.jsx)(`div`,{className:`optionsbar board-bar`,role:`toolbar`,"aria-label":`Board options`,children:(0,$.jsxs)(`div`,{className:`optionsbar-grid`,children:[(0,$.jsx)(`div`,{className:`optionsbar-pinned`,children:(0,$.jsx)(dfn,{themeSpec:te,customTheme:typeof r.theme_spec==`object`?r.theme_spec:void 0,onTheme:e=>void W(e)})}),(0,$.jsx)(rfn,{chips:Ee,onRemove:P,onClear:M}),(0,$.jsx)(`span`,{className:`board-bar-fill`}),De?(0,$.jsxs)(`span`,{className:`bar-actions`,children:[(0,$.jsx)(`button`,{type:`button`,className:`board-tool`,onClick:()=>D(null),children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,className:`board-tool board-tool-primary`,onClick:()=>J(E),children:`Done`})]}):(0,$.jsxs)(`span`,{className:`bar-actions`,children:[(0,$.jsx)(k9,{label:`Edit layout`,onClick:q,children:(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`rect`,{x:`1.5`,y:`1.5`,width:`5.5`,height:`5.5`,rx:`1`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,$.jsx)(`rect`,{x:`9`,y:`1.5`,width:`5.5`,height:`5.5`,rx:`1`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,$.jsx)(`rect`,{x:`1.5`,y:`9`,width:`13`,height:`5.5`,rx:`1`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`})]})}),(0,$.jsx)(k9,{label:`Reset layout`,className:`bar-reset`,disabled:!r.grid,onClick:()=>J(null),children:(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`path`,{d:`M4 5.5H1.5V3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,$.jsx)(`path`,{d:`M2 5.5A6 6 0 1 1 2.8 11`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})]})}),(0,$.jsx)(k9,{label:jmn[c],disabled:c===`working`,onClick:()=>void Te(),children:c===`copied`||c===`downloaded`?(0,$.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})}):(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`rect`,{x:`5.5`,y:`5.5`,width:`8`,height:`8`,rx:`1.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,$.jsx)(`path`,{d:`M3.5 10.5 A1.5 1.5 0 0 1 2.5 9.5 V3 A1.5 1.5 0 0 1 4 1.5 H10.5 A1.5 1.5 0 0 1 11.5 2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})]})})]})]})})]})}var ihn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Gray%20area%20(bottom%20series)%20--%3e%3cpath%20d='M48,216%20L48,180%20L95,165%20L135,178%20L175,160%20L210,170%20L236,158%20L236,216%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c!--%20Blue%20area%20(top%20series)%20--%3e%3cpath%20d='M48,180%20L75,145%20L105,115%20L135,130%20L165,105%20L195,80%20L220,60%20L236,72%20L236,158%20L210,170%20L175,160%20L135,178%20L95,165%20L48,180%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,ahn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Bar%20Table:%20category%20label%20|%20horizontal%20bar%20|%20value%20--%3e%3c!--%20Row%201%20(longest,%20blue)%20--%3e%3cline%20x1='20'%20y1='64'%20x2='58'%20y2='64'%20stroke='%23B8B8B8'%20stroke-width='4'%20stroke-linecap='round'/%3e%3crect%20x='74'%20y='54'%20width='118'%20height='20'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='210'%20y1='64'%20x2='232'%20y2='64'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Row%202%20(medium,%20blue)%20--%3e%3cline%20x1='20'%20y1='106'%20x2='58'%20y2='106'%20stroke='%23B8B8B8'%20stroke-width='4'%20stroke-linecap='round'/%3e%3crect%20x='74'%20y='96'%20width='88'%20height='20'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='210'%20y1='106'%20x2='228'%20y2='106'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Row%203%20(short,%20blue)%20--%3e%3cline%20x1='20'%20y1='148'%20x2='58'%20y2='148'%20stroke='%23B8B8B8'%20stroke-width='4'%20stroke-linecap='round'/%3e%3crect%20x='74'%20y='138'%20width='58'%20height='20'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='210'%20y1='148'%20x2='224'%20y2='148'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Row%204%20('Others',%20grayed)%20--%3e%3cline%20x1='20'%20y1='190'%20x2='58'%20y2='190'%20stroke='%23D8D8D8'%20stroke-width='4'%20stroke-linecap='round'/%3e%3crect%20x='74'%20y='180'%20width='34'%20height='20'%20fill='%23D8D8D8'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='210'%20y1='190'%20x2='222'%20y2='190'%20stroke='%23B8B8B8'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Column%20separators%20(subtle)%20--%3e%3cline%20x1='66'%20y1='36'%20x2='66'%20y2='218'%20stroke='%23363636'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cline%20x1='200'%20y1='36'%20x2='200'%20y2='218'%20stroke='%23363636'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c!--%20Header%20underline%20--%3e%3cline%20x1='20'%20y1='36'%20x2='236'%20y2='36'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c!--%20Baseline%20--%3e%3cline%20x1='20'%20y1='218'%20x2='236'%20y2='218'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c/svg%3e`,ohn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Box%201%20--%3e%3cline%20x1='90'%20y1='60'%20x2='90'%20y2='190'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3crect%20x='70'%20y='95'%20width='40'%20height='70'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3cline%20x1='70'%20y1='135'%20x2='110'%20y2='135'%20stroke='%23363636'%20stroke-width='3'/%3e%3cline%20x1='78'%20y1='60'%20x2='102'%20y2='60'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cline%20x1='78'%20y1='190'%20x2='102'%20y2='190'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c!--%20Box%202%20--%3e%3cline%20x1='180'%20y1='80'%20x2='180'%20y2='200'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3crect%20x='160'%20y='115'%20width='40'%20height='60'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3cline%20x1='160'%20y1='150'%20x2='200'%20y2='150'%20stroke='%23363636'%20stroke-width='3'/%3e%3cline%20x1='168'%20y1='80'%20x2='192'%20y2='80'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cline%20x1='168'%20y1='200'%20x2='192'%20y2='200'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c/svg%3e`,shn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Bubble%20chart:%20scatter%20with%20size-encoded%20circles%20--%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Bubbles%20(varying%20radii)%20--%3e%3ccircle%20cx='92'%20cy='150'%20r='26'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20opacity='0.85'/%3e%3ccircle%20cx='196'%20cy='122'%20r='32'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20opacity='0.75'/%3e%3ccircle%20cx='146'%20cy='170'%20r='14'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20opacity='0.9'/%3e%3ccircle%20cx='158'%20cy='92'%20r='18'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20opacity='0.85'/%3e%3ccircle%20cx='206'%20cy='186'%20r='10'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='86'%20cy='86'%20r='11'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,chn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Bullet%20chart%20icon:%20value%20bars%20with%20target%20ticks%20over%20context%20bands%20--%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='60'%20y1='36'%20x2='60'%20y2='212'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='56'%20y1='208'%20x2='234'%20y2='208'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Row%201%20--%3e%3crect%20x='62'%20y='58'%20width='150'%20height='30'%20fill='%23E6E6E6'/%3e%3crect%20x='62'%20y='66'%20width='92'%20height='14'%20fill='%233a6ea5'/%3e%3crect%20x='178'%20y='54'%20width='5'%20height='38'%20fill='%231a1a1a'/%3e%3c!--%20Row%202%20--%3e%3crect%20x='62'%20y='106'%20width='150'%20height='30'%20fill='%23E6E6E6'/%3e%3crect%20x='62'%20y='114'%20width='120'%20height='14'%20fill='%233a6ea5'/%3e%3crect%20x='150'%20y='102'%20width='5'%20height='38'%20fill='%231a1a1a'/%3e%3c!--%20Row%203%20--%3e%3crect%20x='62'%20y='154'%20width='150'%20height='30'%20fill='%23E6E6E6'/%3e%3crect%20x='62'%20y='162'%20width='68'%20height='14'%20fill='%233a6ea5'/%3e%3crect%20x='162'%20y='150'%20width='5'%20height='38'%20fill='%231a1a1a'/%3e%3c/svg%3e`,lhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Bump%20Chart%20icon:%204%20lines%20crossing%20ranks%20across%204%20time%20points%20--%3e%3c!--%20Line%201%20(blue):%20rank%201%20→%201%20→%203%20→%202%20--%3e%3cpolyline%20points='68,46%20120,46%20176,134%20228,90'%20fill='none'%20stroke='%234a8acb'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Line%202%20(gray):%20rank%202%20→%204%20→%201%20→%201%20--%3e%3cpolyline%20points='68,90%20120,178%20176,46%20228,46'%20fill='none'%20stroke='%237a7a7a'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Line%203%20(dark%20blue):%20rank%203%20→%202%20→%204%20→%203%20--%3e%3cpolyline%20points='68,134%20120,90%20176,178%20228,134'%20fill='none'%20stroke='%233d7ebf'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Line%204%20(light%20gray):%20rank%204%20→%203%20→%202%20→%204%20--%3e%3cpolyline%20points='68,178%20120,134%20176,90%20228,178'%20fill='none'%20stroke='%23a8a8a8'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Dots%20--%3e%3ccircle%20cx='68'%20cy='46'%20r='8'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='120'%20cy='46'%20r='8'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='176'%20cy='134'%20r='8'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='228'%20cy='90'%20r='8'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='68'%20cy='90'%20r='8'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='120'%20cy='178'%20r='8'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='176'%20cy='46'%20r='8'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='228'%20cy='46'%20r='8'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='68'%20cy='134'%20r='8'%20fill='%235ba8e0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='120'%20cy='90'%20r='8'%20fill='%235ba8e0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='176'%20cy='178'%20r='8'%20fill='%235ba8e0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='228'%20cy='134'%20r='8'%20fill='%235ba8e0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='68'%20cy='178'%20r='8'%20fill='%23d0d0d0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='120'%20cy='134'%20r='8'%20fill='%23d0d0d0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='176'%20cy='90'%20r='8'%20fill='%23d0d0d0'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='228'%20cy='178'%20r='8'%20fill='%23d0d0d0'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Y%20axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X%20axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,uhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Calendar%20heatmap:%20a%20grid%20of%20day%20cells%20with%20varying%20intensity%20(weeks%20x%20days)%20--%3e%3c!--%20Row%200%20--%3e%3crect%20x='44'%20y='60'%20width='26'%20height='26'%20rx='3'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='76'%20y='60'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='108'%20y='60'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='140'%20y='60'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='172'%20y='60'%20width='26'%20height='26'%20rx='3'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='204'%20y='60'%20width='26'%20height='26'%20rx='3'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%201%20--%3e%3crect%20x='44'%20y='92'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='76'%20y='92'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='108'%20y='92'%20width='26'%20height='26'%20rx='3'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='140'%20y='92'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='172'%20y='92'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='204'%20y='92'%20width='26'%20height='26'%20rx='3'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%202%20--%3e%3crect%20x='44'%20y='124'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='76'%20y='124'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='108'%20y='124'%20width='26'%20height='26'%20rx='3'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='140'%20y='124'%20width='26'%20height='26'%20rx='3'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='172'%20y='124'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='204'%20y='124'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%203%20--%3e%3crect%20x='44'%20y='156'%20width='26'%20height='26'%20rx='3'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='76'%20y='156'%20width='26'%20height='26'%20rx='3'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='108'%20y='156'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='140'%20y='156'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='172'%20y='156'%20width='26'%20height='26'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='204'%20y='156'%20width='26'%20height='26'%20rx='3'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,dhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%20fill='none'%3e%3c!--%20Candlestick%20chart%20icon:%204%20candles,%202%20bullish%20(green),%202%20bearish%20(red)%20--%3e%3c!--%20Candle%201:%20bearish%20(red)%20--%3e%3cline%20x1='80'%20y1='45'%20x2='80'%20y2='195'%20stroke='%23363636'%20stroke-width='3'/%3e%3crect%20x='68'%20y='80'%20width='24'%20height='70'%20fill='%23e8868f'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3c!--%20Candle%202:%20bullish%20(green)%20--%3e%3cline%20x1='120'%20y1='55'%20x2='120'%20y2='185'%20stroke='%23363636'%20stroke-width='3'/%3e%3crect%20x='108'%20y='65'%20width='24'%20height='80'%20fill='%236dc48d'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3c!--%20Candle%203:%20bearish%20(red)%20--%3e%3cline%20x1='160'%20y1='40'%20x2='160'%20y2='170'%20stroke='%23363636'%20stroke-width='3'/%3e%3crect%20x='148'%20y='55'%20width='24'%20height='80'%20fill='%23e8868f'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3c!--%20Candle%204:%20bullish%20(green)%20--%3e%3cline%20x1='200'%20y1='70'%20x2='200'%20y2='200'%20stroke='%23363636'%20stroke-width='3'/%3e%3crect%20x='188'%20y='90'%20width='24'%20height='75'%20fill='%236dc48d'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,fhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Group%201%20--%3e%3crect%20x='64'%20y='120'%20width='20'%20height='94'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='84'%20y='100'%20width='20'%20height='114'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Group%202%20--%3e%3crect%20x='128'%20y='80'%20width='20'%20height='134'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='148'%20y='140'%20width='20'%20height='74'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Group%203%20--%3e%3crect%20x='192'%20y='60'%20width='20'%20height='154'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='212'%20y='110'%20width='20'%20height='104'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,phn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Stacked%20bar%201%20--%3e%3crect%20x='72'%20y='160'%20width='32'%20height='54'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='72'%20y='100'%20width='32'%20height='60'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Stacked%20bar%202%20--%3e%3crect%20x='124'%20y='180'%20width='32'%20height='34'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='124'%20y='140'%20width='32'%20height='40'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Stacked%20bar%203%20--%3e%3crect%20x='176'%20y='140'%20width='32'%20height='74'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='176'%20y='60'%20width='32'%20height='80'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,mhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Bars%20--%3e%3crect%20x='72'%20y='120'%20width='28'%20height='94'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='112'%20y='80'%20width='28'%20height='134'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='152'%20y='150'%20width='28'%20height='64'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='192'%20y='60'%20width='28'%20height='154'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,hhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Combo%20chart:%20bars%20(left%20axis)%20overlaid%20with%20a%20trend%20line%20(right%20axis)%20--%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Bars%20--%3e%3crect%20x='70'%20y='140'%20width='30'%20height='74'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='112'%20y='112'%20width='30'%20height='102'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='154'%20y='130'%20width='30'%20height='84'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='196'%20y='92'%20width='30'%20height='122'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Trend%20line%20--%3e%3cpolyline%20points='85,118%20127,78%20169,104%20211,62'%20fill='none'%20stroke='%233aa6ee'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='85'%20cy='118'%20r='7'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='127'%20cy='78'%20r='7'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='169'%20cy='104'%20r='7'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='211'%20cy='62'%20r='7'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,ghn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Connected%20Scatter%20Plot%20icon:%20scattered%20dots%20joined%20by%20a%20winding,%20self-crossing%20straight-segment%20path%20(the%20ordered%20trajectory)%20--%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Connecting%20path:%20straight%20segments%20that%20wind%20back%20and%20forth%20and%20cross%20--%3e%3cpolyline%20points='78,170%20150,80%20100,140%20200,110%20130,55%20210,180'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Scatter%20points%20at%20every%20vertex%20--%3e%3ccircle%20cx='78'%20cy='170'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='150'%20cy='80'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='100'%20cy='140'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='200'%20cy='110'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='130'%20cy='55'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='210'%20cy='180'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,_hn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Single%20area%20polygon%20--%3e%3cpolygon%20points='60,216%2060,170%20110,120%20160,150%20220,70%20220,216'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3c/svg%3e`,vhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20One%20bold%20bar%20--%3e%3crect%20x='110'%20y='70'%20width='60'%20height='144'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3c/svg%3e`,yhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Single%20bold%20custom%20segment%20--%3e%3cline%20x1='70'%20y1='180'%20x2='220'%20y2='70'%20stroke='%2376c6ff'%20stroke-width='10'%20stroke-linecap='round'/%3e%3ccircle%20cx='70'%20cy='180'%20r='8'%20fill='%23fff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='220'%20cy='70'%20r='8'%20fill='%23fff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,bhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Center%20point%20with%20crosshair%20guides%20--%3e%3cline%20x1='48'%20y1='120'%20x2='138'%20y2='120'%20stroke='%23B8B8B8'%20stroke-width='2'%20stroke-dasharray='6%205'/%3e%3cline%20x1='138'%20y1='216'%20x2='138'%20y2='120'%20stroke='%23B8B8B8'%20stroke-width='2'%20stroke-dasharray='6%205'/%3e%3ccircle%20cx='138'%20cy='120'%20r='22'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3c/svg%3e`,xhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Rectangle%20(bands%20of%20a%20heatmap%20cell,%20or%20an%20annotation%20rect)%20--%3e%3crect%20x='80'%20y='70'%20width='130'%20height='120'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3c/svg%3e`,Shn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Density%20curve%20filled%20area%20—%20smooth%20bell-like%20shape%20--%3e%3cpath%20d='M48,216%20Q68,214%2088,200%20Q108,178%20128,130%20Q148,82%20158,75%20Q168,82%20178,110%20Q198,165%20218,195%20Q230,210%20236,216%20Z'%20fill='%2376c6ff'/%3e%3c!--%20Density%20curve%20outline%20--%3e%3cpath%20d='M48,216%20Q68,214%2088,200%20Q108,178%20128,130%20Q148,82%20158,75%20Q168,82%20178,110%20Q198,165%20218,195%20Q230,210%20236,216'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,Chn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Row%201%20--%3e%3cline%20x1='80'%20y1='70'%20x2='180'%20y2='70'%20stroke='%23B8B8B8'%20stroke-width='3'%20stroke-linecap='round'/%3e%3ccircle%20cx='80'%20cy='70'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='180'%20cy='70'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%202%20--%3e%3cline%20x1='110'%20y1='118'%20x2='210'%20y2='118'%20stroke='%23B8B8B8'%20stroke-width='3'%20stroke-linecap='round'/%3e%3ccircle%20cx='110'%20cy='118'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='210'%20cy='118'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%203%20--%3e%3cline%20x1='70'%20y1='166'%20x2='150'%20y2='166'%20stroke='%23B8B8B8'%20stroke-width='3'%20stroke-linecap='round'/%3e%3ccircle%20cx='70'%20cy='166'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='150'%20cy='166'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,whn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Secondary%20dashed%20line%20(gray)%20--%3e%3cpolyline%20points='60,150%20100,170%20140,110%20180,140%20220,130'%20fill='none'%20stroke='%23B8B8B8'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-dasharray='10%207'/%3e%3ccircle%20cx='60'%20cy='150'%20r='6'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='100'%20cy='170'%20r='6'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='140'%20cy='110'%20r='6'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='180'%20cy='140'%20r='6'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='220'%20cy='130'%20r='6'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Primary%20dashed%20line%20(blue)%20--%3e%3cpolyline%20points='60,170%20100,130%20140,150%20180,80%20220,100'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-dasharray='10%207'/%3e%3ccircle%20cx='60'%20cy='170'%20r='6'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='100'%20cy='130'%20r='6'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='140'%20cy='150'%20r='6'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='180'%20cy='80'%20r='6'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='220'%20cy='100'%20r='6'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Thn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Doughnut%20chart:%20pie%20wedges%20with%20a%20hollow%20centre%20(radius%2088,%20hole%2044)%20--%3e%3cpath%20d='M%20128%20128%20L%20128%2040%20A%2088%2088%200%200%201%20204.21%20172%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%20204.21%20172%20A%2088%2088%200%200%201%2071.43%20195.41%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%2071.43%20195.41%20A%2088%2088%200%200%201%2051.79%2084%20Z'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%2051.79%2084%20A%2088%2088%200%200%201%20128%2040%20Z'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3c!--%20Hollow%20centre%20--%3e%3ccircle%20cx='128'%20cy='128'%20r='44'%20fill='%23ffffff'%20stroke='%23363636'%20stroke-width='3'/%3e%3c/svg%3e`,Ehn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Empirical%20CDF%20—%20monotonic%20rising%20step%20curve%20(step-after),%20bottom-left%20to%20top-right%20--%3e%3cpolyline%20points='60,200%2092,200%2092,168%20124,168%20124,132%20156,132%20156,96%20188,96%20188,64%20228,64'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Dhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Funnel%20stages%20(widest%20at%20top,%20narrowest%20at%20bottom)%20--%3e%3cpolygon%20points='38,48%20218,48%20198,98%2058,98'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3cpolygon%20points='58,104%20198,104%20182,154%2074,154'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3cpolygon%20points='74,160%20182,160%20166,210%2090,210'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20opacity='0.7'/%3e%3c/svg%3e`,Ohn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Gantt%20chart%20icon:%20horizontal%20task%20bars%20across%20a%20timeline%20--%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='60'%20y1='36'%20x2='60'%20y2='212'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='56'%20y1='208'%20x2='234'%20y2='208'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Task%20bars%20(offset%20+%20width%20vary%20to%20read%20as%20a%20schedule)%20--%3e%3crect%20x='68'%20y='52'%20width='72'%20height='20'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='98'%20y='84'%20width='94'%20height='20'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='80'%20y='116'%20width='58'%20height='20'%20rx='3'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='138'%20y='148'%20width='80'%20height='20'%20rx='3'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='116'%20y='180'%20width='50'%20height='20'%20rx='3'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,khn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Gauge:%20semicircular%20track%20with%20value%20arc%20+%20needle%20--%3e%3cpath%20d='M%2042%20158%20A%2086%2086%200%200%201%20214%20158'%20fill='none'%20stroke='%23B8B8B8'%20stroke-width='20'%20stroke-linecap='round'/%3e%3cpath%20d='M%2042%20158%20A%2086%2086%200%200%201%20173.57%2085.07'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='20'%20stroke-linecap='round'/%3e%3cline%20x1='128'%20y1='158'%20x2='149.89'%20y2='97.86'%20stroke='%23363636'%20stroke-width='6'%20stroke-linecap='round'/%3e%3ccircle%20cx='128'%20cy='158'%20r='11'%20fill='%23363636'/%3e%3c/svg%3e`,Ahn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%204x4%20grid%20(no%20axes)%20--%3e%3cg%20stroke='%23363636'%20stroke-width='2'%3e%3crect%20x='40'%20y='40'%20width='44'%20height='44'%20fill='%23cfe9fa'/%3e%3crect%20x='84'%20y='40'%20width='44'%20height='44'%20fill='%2376c6ff'/%3e%3crect%20x='128'%20y='40'%20width='44'%20height='44'%20fill='%233aa6ee'/%3e%3crect%20x='172'%20y='40'%20width='44'%20height='44'%20fill='%23cfe9fa'/%3e%3crect%20x='40'%20y='84'%20width='44'%20height='44'%20fill='%2376c6ff'/%3e%3crect%20x='84'%20y='84'%20width='44'%20height='44'%20fill='%233aa6ee'/%3e%3crect%20x='128'%20y='84'%20width='44'%20height='44'%20fill='%231f6fb0'/%3e%3crect%20x='172'%20y='84'%20width='44'%20height='44'%20fill='%2376c6ff'/%3e%3crect%20x='40'%20y='128'%20width='44'%20height='44'%20fill='%23cfe9fa'/%3e%3crect%20x='84'%20y='128'%20width='44'%20height='44'%20fill='%2376c6ff'/%3e%3crect%20x='128'%20y='128'%20width='44'%20height='44'%20fill='%233aa6ee'/%3e%3crect%20x='172'%20y='128'%20width='44'%20height='44'%20fill='%23cfe9fa'/%3e%3crect%20x='40'%20y='172'%20width='44'%20height='44'%20fill='%23eaf4fc'/%3e%3crect%20x='84'%20y='172'%20width='44'%20height='44'%20fill='%23cfe9fa'/%3e%3crect%20x='128'%20y='172'%20width='44'%20height='44'%20fill='%2376c6ff'/%3e%3crect%20x='172'%20y='172'%20width='44'%20height='44'%20fill='%23eaf4fc'/%3e%3c/g%3e%3c/svg%3e`,jhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Histogram%20bars%20(adjacent,%20bell-curve-ish)%20--%3e%3crect%20x='56'%20y='180'%20width='26'%20height='34'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='82'%20y='140'%20width='26'%20height='74'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='108'%20y='90'%20width='26'%20height='124'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='134'%20y='60'%20width='26'%20height='154'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='160'%20y='100'%20width='26'%20height='114'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='186'%20y='150'%20width='26'%20height='64'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3crect%20x='212'%20y='185'%20width='26'%20height='29'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Mhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20KPI%20Card:%20caption%20strip%20+%20big-number%20digits%20+%20trend%20sparkline%20--%3e%3c!--%20Card%20outline%20(rounded)%20--%3e%3crect%20x='20'%20y='40'%20width='216'%20height='176'%20rx='14'%20ry='14'%20fill='none'%20stroke='%23363636'%20stroke-width='4'/%3e%3c!--%20Caption%20(thin%20gray%20label,%20top-left)%20--%3e%3cline%20x1='40'%20y1='68'%20x2='118'%20y2='68'%20stroke='%23B8B8B8'%20stroke-width='6'%20stroke-linecap='round'/%3e%3c!--%20Big%20number:%20three%20equal%20blocks%20suggesting%20digits%20--%3e%3crect%20x='40'%20y='92'%20width='34'%20height='60'%20rx='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3crect%20x='82'%20y='92'%20width='34'%20height='60'%20rx='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3crect%20x='124'%20y='92'%20width='34'%20height='60'%20rx='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'/%3e%3c!--%20Trailing%20unit/suffix%20block%20(smaller,%20gray)%20--%3e%3crect%20x='172'%20y='106'%20width='44'%20height='46'%20rx='5'%20fill='%23D8D8D8'%20stroke='%23363636'%20stroke-width='3'/%3e%3c!--%20Sparkline%20(trend%20overlay,%20bottom%20band)%20--%3e%3cpolyline%20points='40,196%2070,182%20100,192%20130,172%20160,186%20190,166%20216,180'%20fill='none'%20stroke='%235b8def'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Sparkline%20endpoint%20dot%20for%20emphasis%20--%3e%3ccircle%20cx='216'%20cy='180'%20r='5'%20fill='%235b8def'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Nhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Secondary%20line%20(gray)%20--%3e%3cpolyline%20points='60,150%20100,170%20140,110%20180,140%20220,130'%20fill='none'%20stroke='%23B8B8B8'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Primary%20line%20(blue)%20--%3e%3cpolyline%20points='60,170%20100,130%20140,150%20180,80%20220,100'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Phn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Regression%20line%20--%3e%3cline%20x1='62'%20y1='190'%20x2='232'%20y2='58'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Scatter%20points%20--%3e%3ccircle%20cx='78'%20cy='180'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='108'%20cy='140'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='138'%20cy='160'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='168'%20cy='95'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='198'%20cy='110'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='220'%20cy='70'%20r='9'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Fhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Lollipop%201:%20blue%20--%3e%3cline%20x1='72'%20y1='216'%20x2='72'%20y2='100'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3ccircle%20cx='72'%20cy='100'%20r='12'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Lollipop%202:%20gray%20--%3e%3cline%20x1='120'%20y1='216'%20x2='120'%20y2='65'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3ccircle%20cx='120'%20cy='65'%20r='12'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Lollipop%203:%20blue%20--%3e%3cline%20x1='168'%20y1='216'%20x2='168'%20y2='140'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3ccircle%20cx='168'%20cy='140'%20r='12'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Lollipop%204:%20gray%20--%3e%3cline%20x1='216'%20y1='216'%20x2='216'%20y2='85'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3ccircle%20cx='216'%20cy='85'%20r='12'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,Ihn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Network%20graph:%20nodes%20connected%20by%20edges%20(force/circular%20layout)%20--%3e%3c!--%20Edges%20--%3e%3cline%20x1='128'%20y1='132'%20x2='128'%20y2='58'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='128'%20y1='132'%20x2='200'%20y2='104'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='128'%20y1='132'%20x2='178'%20y2='196'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='128'%20y1='132'%20x2='74'%20y2='196'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='128'%20y1='132'%20x2='56'%20y2='104'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='128'%20y1='58'%20x2='200'%20y2='104'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='74'%20y1='196'%20x2='56'%20y2='104'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3cline%20x1='200'%20y1='104'%20x2='178'%20y2='196'%20stroke='%23B8B8B8'%20stroke-width='3'/%3e%3c!--%20Nodes%20--%3e%3ccircle%20cx='128'%20cy='132'%20r='18'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='128'%20cy='58'%20r='15'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='200'%20cy='104'%20r='13'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='178'%20cy='196'%20r='14'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='74'%20cy='196'%20r='12'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='56'%20cy='104'%20r='13'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Lhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Parallel%20coordinates:%20vertical%20axes%20crossed%20by%20multi-segment%20lines%20--%3e%3c!--%20Axes%20--%3e%3cline%20x1='52'%20y1='40'%20x2='52'%20y2='216'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cline%20x1='118'%20y1='40'%20x2='118'%20y2='216'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cline%20x1='184'%20y1='40'%20x2='184'%20y2='216'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cline%20x1='226'%20y1='40'%20x2='226'%20y2='216'%20stroke='%23363636'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c!--%20Series%20lines%20--%3e%3cpolyline%20points='52,80%20118,150%20184,72%20226,120'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpolyline%20points='52,150%20118,90%20184,160%20226,76'%20fill='none'%20stroke='%23B8B8B8'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpolyline%20points='52,112%20118,180%20184,116%20226,170'%20fill='none'%20stroke='%233aa6ee'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Rhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Pie%20chart:%204%20wedges%20around%20center%20(128,128),%20radius%2088.%20Wedge%20boundary%20angles%20(clockwise%20from%20top):%200,%20120,%20220,%20300.%20--%3e%3cpath%20d='M%20128%20128%20L%20128%2040%20A%2088%2088%200%200%201%20204.21%20172%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%20204.21%20172%20A%2088%2088%200%200%201%2071.43%20195.41%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%2071.43%20195.41%20A%2088%2088%200%200%201%2051.79%2084%20Z'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%2051.79%2084%20A%2088%2088%200%200%201%20128%2040%20Z'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3c/svg%3e`,zhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Row%201%20(top,%20narrowest)%20--%3e%3crect%20x='100'%20y='40'%20width='38'%20height='34'%20fill='%23B8B8B8'/%3e%3crect%20x='138'%20y='40'%20width='34'%20height='34'%20fill='%2376c6ff'/%3e%3crect%20x='100'%20y='40'%20width='72'%20height='34'%20fill='none'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='138'%20y1='40'%20x2='138'%20y2='74'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%202%20--%3e%3crect%20x='68'%20y='82'%20width='70'%20height='34'%20fill='%23B8B8B8'/%3e%3crect%20x='138'%20y='82'%20width='62'%20height='34'%20fill='%2376c6ff'/%3e%3crect%20x='68'%20y='82'%20width='132'%20height='34'%20fill='none'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='138'%20y1='82'%20x2='138'%20y2='116'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%203%20--%3e%3crect%20x='42'%20y='124'%20width='96'%20height='34'%20fill='%23B8B8B8'/%3e%3crect%20x='138'%20y='124'%20width='84'%20height='34'%20fill='%2376c6ff'/%3e%3crect%20x='42'%20y='124'%20width='180'%20height='34'%20fill='none'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='138'%20y1='124'%20x2='138'%20y2='158'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Row%204%20(bottom,%20widest)%20--%3e%3crect%20x='30'%20y='166'%20width='108'%20height='34'%20fill='%23B8B8B8'/%3e%3crect%20x='138'%20y='166'%20width='98'%20height='34'%20fill='%2376c6ff'/%3e%3crect%20x='30'%20y='166'%20width='206'%20height='34'%20fill='none'%20stroke='%23363636'%20stroke-width='2'/%3e%3cline%20x1='138'%20y1='166'%20x2='138'%20y2='200'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='20'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,Bhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Radar%20/%20Spider%20Chart%20icon%20--%3e%3c!--%20Outer%20ring%20(serves%20as%20chart%20boundary%20—%20standard%20axis%20style)%20--%3e%3cpolygon%20points='128,18%20233,94%20193,217%2063,217%2023,94'%20fill='none'%20stroke='%23363636'%20stroke-width='4'%20stroke-linejoin='round'/%3e%3c!--%20Data%20polygon%20A%20(blue)%20--%3e%3cpolygon%20points='128,39%20210,106%20179,204%2075,185%2039,106'%20fill='%2376c6ff'%20stroke='%234a8acb'%20stroke-width='2'/%3e%3c!--%20Data%20polygon%20B%20(gray)%20--%3e%3cpolygon%20points='128,63%20185,124%20161,192%2088,167%2057,112'%20fill='%23d0d0d0'%20stroke='%237a7a7a'%20stroke-width='2'/%3e%3c!--%20Guidelines%20on%20top%20--%3e%3c!--%20Middle%20ring%20--%3e%3cpolygon%20points='128,55%20198,105%20171,187%2085,187%2058,105'%20fill='none'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3c!--%20Inner%20ring%20--%3e%3cpolygon%20points='128,91%20163,117%20150,158%20106,158%2093,117'%20fill='none'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3c!--%20Spokes%20--%3e%3cline%20x1='128'%20y1='128'%20x2='128'%20y2='18'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3cline%20x1='128'%20y1='128'%20x2='233'%20y2='94'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3cline%20x1='128'%20y1='128'%20x2='193'%20y2='217'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3cline%20x1='128'%20y1='128'%20x2='63'%20y2='217'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3cline%20x1='128'%20y1='128'%20x2='23'%20y2='94'%20stroke='%23b0b0b0'%20stroke-width='1.5'/%3e%3c/svg%3e`,Vhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Range%20band:%20filled%20ribbon%20between%20a%20lower%20and%20an%20upper%20wavy%20bound%20--%3e%3cpath%20d='M48,150%20Q80,120%20112,135%20Q150,153%20188,118%20Q214,94%20236,108%20L236,150%20Q214,132%20188,158%20Q150,196%20112,176%20Q80,162%2048,186%20Z'%20fill='%2376c6ff'%20fill-opacity='0.55'%20stroke='none'/%3e%3c!--%20Upper%20bound%20line%20--%3e%3cpath%20d='M48,150%20Q80,120%20112,135%20Q150,153%20188,118%20Q214,94%20236,108'%20fill='none'%20stroke='%232b7fb8'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Lower%20bound%20line%20--%3e%3cpath%20d='M48,186%20Q80,162%20112,176%20Q150,196%20188,158%20Q214,132%20236,150'%20fill='none'%20stroke='%232b7fb8'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,Hhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Rose%20/%20Nightingale%20Chart%20icon:%206%20wedges%20(60°%20each),%20varied%20radii,%202%20colors%20--%3e%3c!--%20Center%20(128,128).%20Radii:%2095,%2060,%2080,%2045,%20100,%2070%20—%20non-alternating%20variation%20--%3e%3c!--%20Wedge%201:%200°–60°,%20r=95%20--%3e%3cpath%20d='M128,128%20L128,33%20A95,95,0,0,1,210,81%20Z'%20fill='%2376c6ff'%20stroke='white'%20stroke-width='2'/%3e%3c!--%20Wedge%202:%2060°–120°,%20r=60%20--%3e%3cpath%20d='M128,128%20L180,98%20A60,60,0,0,1,180,158%20Z'%20fill='%23B8B8B8'%20stroke='white'%20stroke-width='2'/%3e%3c!--%20Wedge%203:%20120°–180°,%20r=80%20--%3e%3cpath%20d='M128,128%20L197,168%20A80,80,0,0,1,128,208%20Z'%20fill='%2376c6ff'%20stroke='white'%20stroke-width='2'/%3e%3c!--%20Wedge%204:%20180°–240°,%20r=45%20--%3e%3cpath%20d='M128,128%20L128,173%20A45,45,0,0,1,89,151%20Z'%20fill='%2376c6ff'%20stroke='white'%20stroke-width='2'/%3e%3c!--%20Wedge%205:%20240°–300°,%20r=100%20--%3e%3cpath%20d='M128,128%20L41,178%20A100,100,0,0,1,41,78%20Z'%20fill='%23B8B8B8'%20stroke='white'%20stroke-width='2'/%3e%3c!--%20Wedge%206:%20300°–360°,%20r=70%20--%3e%3cpath%20d='M128,128%20L67,93%20A70,70,0,0,1,128,58%20Z'%20fill='%23B8B8B8'%20stroke='white'%20stroke-width='2'/%3e%3c!--%20Dark%20border%20outlines%20--%3e%3cpath%20d='M128,128%20L128,33%20A95,95,0,0,1,210,81%20Z'%20fill='none'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3cpath%20d='M128,128%20L180,98%20A60,60,0,0,1,180,158%20Z'%20fill='none'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3cpath%20d='M128,128%20L197,168%20A80,80,0,0,1,128,208%20Z'%20fill='none'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3cpath%20d='M128,128%20L128,173%20A45,45,0,0,1,89,151%20Z'%20fill='none'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3cpath%20d='M128,128%20L41,178%20A100,100,0,0,1,41,78%20Z'%20fill='none'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3cpath%20d='M128,128%20L67,93%20A70,70,0,0,1,128,58%20Z'%20fill='none'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3c/svg%3e`,Uhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Left%20nodes%20--%3e%3crect%20x='38'%20y='48'%20width='16'%20height='70'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3crect%20x='38'%20y='138'%20width='16'%20height='70'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3c!--%20Right%20nodes%20--%3e%3crect%20x='202'%20y='38'%20width='16'%20height='50'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3crect%20x='202'%20y='108'%20width='16'%20height='50'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3crect%20x='202'%20y='178'%20width='16'%20height='40'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20rx='2'%20opacity='0.6'/%3e%3c!--%20Flow%20paths%20--%3e%3cpath%20d='M%2054%2063%20C%20128%2063,%20128%2053,%20202%2053'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='20'%20opacity='0.3'/%3e%3cpath%20d='M%2054%2098%20C%20128%2098,%20128%20123,%20202%20123'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='14'%20opacity='0.3'/%3e%3cpath%20d='M%2054%20163%20C%20128%20163,%20128%20188,%20202%20188'%20fill='none'%20stroke='%23B8B8B8'%20stroke-width='18'%20opacity='0.3'/%3e%3c/svg%3e`,Whn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20Scatter%20points%20--%3e%3ccircle%20cx='78'%20cy='170'%20r='10'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='110'%20cy='120'%20r='10'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='140'%20cy='155'%20r='10'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='170'%20cy='80'%20r='10'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='195'%20cy='135'%20r='10'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='215'%20cy='55'%20r='10'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Ghn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Slope%20Chart%20icon:%20straight%20lines%20connecting%20values%20at%20two%20periods,%20with%20end%20dots%20--%3e%3c!--%20Two%20period%20guide%20columns%20--%3e%3cline%20x1='80'%20y1='36'%20x2='80'%20y2='208'%20stroke='%23dcdcdc'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cline%20x1='200'%20y1='36'%20x2='200'%20y2='208'%20stroke='%23dcdcdc'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c!--%20Line%201%20(blue):%20rises%20--%3e%3cpolyline%20points='80,170%20200,60'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Line%202%20(gray):%20falls,%20crosses%20line%201%20--%3e%3cpolyline%20points='80,70%20200,150'%20fill='none'%20stroke='%23B8B8B8'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20Line%203%20(dark%20blue):%20gentle%20rise%20--%3e%3cpolyline%20points='80,120%20200,100'%20fill='none'%20stroke='%233d7ebf'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c!--%20End%20dots,%20period%201%20--%3e%3ccircle%20cx='80'%20cy='170'%20r='8'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='80'%20cy='70'%20r='8'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='80'%20cy='120'%20r='8'%20fill='%233d7ebf'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20End%20dots,%20period%202%20--%3e%3ccircle%20cx='200'%20cy='60'%20r='8'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='200'%20cy='150'%20r='8'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='200'%20cy='100'%20r='8'%20fill='%233d7ebf'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Y%20axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X%20axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,Khn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Sparkline:%20a%20chrome-less%20trend%20line%20(no%20axes),%20in%20the%20family%20blue.%20--%3e%3cline%20x1='30'%20y1='198'%20x2='226'%20y2='198'%20stroke='%23E2E2E2'%20stroke-width='8'%20stroke-linecap='round'/%3e%3cpolyline%20points='30,152%2070,88%20110,130%20150,58%20190,106%20226,76'%20fill='none'%20stroke='%2376c6ff'%20stroke-width='13'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='226'%20cy='76'%20r='13'%20fill='%2376c6ff'/%3e%3c/svg%3e`,qhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Top%20gray%20band%20--%3e%3cpath%20d='M8,82%20Q48,55%2096,48%20Q144,42%20192,62%20Q224,74%20248,58%20L248,106%20Q224,100%20192,104%20Q144,110%2096,102%20Q48,94%208,112%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c!--%20Middle%20blue%20band%20--%3e%3cpath%20d='M8,112%20Q48,94%2096,102%20Q144,110%20192,104%20Q224,100%20248,106%20L248,156%20Q224,160%20192,152%20Q144,144%2096,154%20Q48,164%208,150%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c!--%20Bottom%20gray%20band%20--%3e%3cpath%20d='M8,150%20Q48,164%2096,154%20Q144,144%20192,152%20Q224,160%20248,156%20L248,200%20Q224,208%20192,196%20Q144,184%2096,198%20Q48,212%208,190%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Jhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Strip%20/%20Jitter%20Plot%20icon%20--%3e%3c!--%20Group%20A%20points%20(jittered%20around%20x=100)%20--%3e%3ccircle%20cx='92'%20cy='65'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='108'%20cy='80'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='96'%20cy='100'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='104'%20cy='95'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='88'%20cy='120'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='112'%20cy='110'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='100'%20cy='140'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='94'%20cy='155'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='106'%20cy='170'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='98'%20cy='190'%20r='5'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3c!--%20Group%20B%20points%20(jittered%20around%20x=170)%20--%3e%3ccircle%20cx='162'%20cy='50'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='178'%20cy='60'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='166'%20cy='75'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='174'%20cy='90'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='158'%20cy='105'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='182'%20cy='100'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='170'%20cy='130'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='164'%20cy='150'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='176'%20cy='175'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3ccircle%20cx='168'%20cy='200'%20r='5'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='1.5'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,Yhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Sunburst:%20hierarchical%20concentric%20rings%20--%3e%3cpath%20d='M%20128%2038%20A%2090%2090%200%200%200%2050.06%2083%20L%2088.16%20105%20A%2046%2046%200%200%201%20128%2082%20Z'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20d='M%2050.06%2083%20A%2090%2090%200%200%200%2050.06%20173%20L%2088.16%20151%20A%2046%2046%200%200%201%2088.16%20105%20Z'%20fill='%239fd6ff'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20d='M%2050.06%20173%20A%2090%2090%200%200%200%20128%20218%20L%20128%20174%20A%2046%2046%200%200%201%2088.16%20151%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20218%20A%2090%2090%200%200%200%20205.94%20173%20L%20167.84%20151%20A%2046%2046%200%200%201%20128%20174%20Z'%20fill='%23d0d0d0'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20205.94%20173%20A%2090%2090%200%200%200%20205.94%2083%20L%20167.84%20105%20A%2046%2046%200%200%201%20167.84%20151%20Z'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20205.94%2083%20A%2090%2090%200%200%200%20128%2038%20L%20128%2082%20A%2046%2046%200%200%201%20167.84%20105%20Z'%20fill='%23a7dbff'%20stroke='%23363636'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%20128%2082%20A%2046%2046%200%200%200%2088.16%20151%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2.5'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%2088.16%20151%20A%2046%2046%200%200%200%20167.84%20151%20Z'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2.5'%20stroke-linejoin='round'/%3e%3cpath%20d='M%20128%20128%20L%20167.84%20151%20A%2046%2046%200%200%200%20128%2082%20Z'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2.5'%20stroke-linejoin='round'/%3e%3c/svg%3e`,Xhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Tree%20/%20dendrogram:%20a%20root%20branching%20left-to-right%20into%20leaves%20--%3e%3c!--%20Edges%20(orthogonal%20connectors)%20--%3e%3c!--%20root%20-%3e%20level-1%20--%3e%3cpath%20d='M%2052%20128%20H%2092%20V%2076%20H%20124'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3cpath%20d='M%2092%20128%20V%20180%20H%20124'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c!--%20level-1%20(top)%20-%3e%20leaves%20--%3e%3cpath%20d='M%20136%2076%20H%20176%20V%2052%20H%20208'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3cpath%20d='M%20176%2076%20V%20100%20H%20208'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c!--%20level-1%20(bottom)%20-%3e%20leaves%20--%3e%3cpath%20d='M%20136%20180%20H%20176%20V%20156%20H%20208'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3cpath%20d='M%20176%20180%20V%20204%20H%20208'%20fill='none'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'%20stroke-linecap='round'/%3e%3c!--%20Nodes%20--%3e%3ccircle%20cx='52'%20cy='128'%20r='14'%20fill='%233aa6ee'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='128'%20cy='76'%20r='12'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='128'%20cy='180'%20r='12'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='212'%20cy='52'%20r='9'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='212'%20cy='100'%20r='9'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='212'%20cy='156'%20r='9'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3ccircle%20cx='212'%20cy='204'%20r='9'%20fill='%23cfe9fa'%20stroke='%23363636'%20stroke-width='2'/%3e%3c/svg%3e`,Zhn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Treemap%20rectangles%20--%3e%3crect%20x='38'%20y='38'%20width='110'%20height='130'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3crect%20x='154'%20y='38'%20width='64'%20height='70'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20rx='2'/%3e%3crect%20x='154'%20y='114'%20width='64'%20height='54'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20rx='2'%20opacity='0.6'/%3e%3crect%20x='38'%20y='174'%20width='70'%20height='44'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'%20rx='2'%20opacity='0.8'/%3e%3crect%20x='114'%20y='174'%20width='104'%20height='44'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'%20rx='2'%20opacity='0.4'/%3e%3c/svg%3e`,Qhn=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20version='1.0'%20width='256'%20height='256'%20viewBox='0%200%20192%20192'%20preserveAspectRatio='xMidYMid'%20id='svg6'%20sodipodi:docname='chart-icon-us-map-v2.svg'%20xml:space='preserve'%20inkscape:version='1.4.2%20(ebf0e940,%202025-05-08)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs6'%20/%3e%3csodipodi:namedview%20id='namedview6'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:document-units='pt'%20showguides='false'%20inkscape:zoom='0.4265625'%20inkscape:cx='466.52015'%20inkscape:cy='548.57143'%20inkscape:window-width='1752'%20inkscape:window-height='867'%20inkscape:window-x='95'%20inkscape:window-y='91'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg6'%20/%3e%3cmetadata%20id='metadata1'%3e%20Created%20by%20potrace%201.15,%20written%20by%20Peter%20Selinger%202001-2017%20%3c/metadata%3e%3cg%20transform='matrix(0.01493949,0,0,-0.01493949,2.209624,156.7245)'%20fill='%23000000'%20stroke='none'%20id='g6'%20style='fill:%23757472;fill-opacity:1'%3e%3cpath%20d='m%201215,8038%20c%20-6,-15%201,-229%209,-303%20l%206,-50%20-14,59%20c%20-15,62%20-26,76%20-65,76%20-14,0%20-32,6%20-40,14%20-9,8%20-28,17%20-42,19%20-14,3%20-74,37%20-132,77%20-76,51%20-111,70%20-125,66%20-26,-9%20-47,-60%20-46,-111%201,-22%202,-67%202,-100%201,-103%201,-144%202,-167%201,-13%20-1,-60%20-4,-105%20-4,-70%20-2,-84%2012,-92%209,-5%2015,-11%2012,-13%20-3,-2%20-17,-12%20-32,-21%20-19,-12%20-28,-26%20-28,-43%200,-35%20-26,-134%20-55,-208%20-13,-34%20-42,-110%20-64,-171%20-38,-105%20-128,-325%20-153,-372%20-6,-12%20-28,-40%20-49,-62%20-22,-22%20-39,-50%20-39,-63%200,-12%20-14,-37%20-32,-55%20-31,-32%20-32,-35%20-22,-82%206,-27%207,-57%203,-67%20-4,-11%20-8,-83%20-8,-161%20-1,-140%20-1,-143%20-31,-190%20-17,-26%20-30,-51%20-30,-55%200,-5%20-22,-42%20-50,-83%20-46,-69%20-50,-79%20-50,-135%200,-39%2010,-91%2028,-149%2028,-84%2028,-89%2012,-112%20-27,-37%20-38,-88%20-38,-166%200,-69%202,-75%2049,-145%2046,-69%2049,-77%2049,-138%200,-60%203,-69%2038,-112%2020,-26%2043,-47%2051,-48%209,0%203,-10%20-14,-25%20-26,-25%20-27,-29%20-23,-105%20l%203,-79%2055,-56%2054,-55%20-22,-23%20c%20-24,-25%20-52,-97%20-52,-133%200,-14%2014,-36%2034,-54%2020,-18%2037,-45%2040,-64%207,-38%2079,-191%2094,-200%206,-4%208,-22%205,-41%20-4,-25%200,-41%2015,-61%2019,-28%2019,-29%201,-72%20-31,-71%20-26,-94%2027,-135%2026,-20%2063,-40%2083,-43%2020,-4%2066,-22%20103,-40%2050,-25%2069,-41%2074,-59%209,-36%2066,-82%20113,-90%2047,-8%2066,-26%2058,-57%20-9,-32%2010,-58%2041,-58%2032,0%2082,-48%20129,-125%2028,-45%2032,-62%2040,-167%206,-64%2015,-123%2022,-131%207,-10%2050,-19%20124,-26%20188,-19%20419,-41%20434,-41%207,0%2017,-10%2022,-23%205,-13%2035,-39%2068,-59%2032,-19%20171,-106%20308,-193%20138,-86%20307,-193%20377,-237%20l%20128,-79%20302,-40%20c%20374,-50%20433,-55%20452,-40%208,7%2017,34%2021,62%204,27%2011,49%2015,49%2029,0%20354,-41%20361,-46%205,-3%2015,-20%2023,-37%207,-18%2084,-105%20169,-193%20175,-180%20221,-250%20211,-314%20-8,-49%2022,-108%2078,-152%20106,-85%20282,-200%20313,-205%2028,-5%2039,0%2077,36%2030,27%2054,63%2073,106%2025,61%2029,65%2059,65%2018,0%2036,4%2041,9%206,6%2031,4%2065,-5%2030,-8%2075,-14%20100,-14%2053,0%2062,-5%2078,-45%207,-16%2041,-54%2077,-83%2054,-46%2066,-62%2079,-106%2027,-91%2085,-207%20131,-260%2025,-28%2045,-58%2045,-66%200,-27%2048,-87%2075,-94%2022,-6%2025,-12%2025,-50%200,-23%208,-67%2019,-97%2023,-68%2085,-191%20103,-207%2032,-26%20243,-112%20301,-122%2034,-7%2082,-24%20107,-40%2038,-23%2053,-27%2099,-24%2030,2%2058,9%2063,16%2016,26%208,72%20-17,98%20-16,17%20-35,60%20-52,119%20-24,83%20-25,97%20-14,140%206,26%209,55%206,64%20-4,9%200,26%209,39%209,12%2019,43%2022,69%205,34%2011,49%2025,52%2010,3%2028,21%2039,40%2013,23%2031,37%2049,40%2020,4%2032,15%2039,35%207,20%2019,32%2038,36%2040,10%2054,24%2054,53%200,20%203,22%2017,14%2022,-12%2077,10%20206,80%2080,44%2099,59%20107,85%206,18%2026,43%2045,56%2023,15%2035,31%2035,47%200,20%204,23%2026,18%2015,-2%2061,4%20103,14%2042,11%20124,30%20182,43%20l%20106,24%2084,-19%20c%2046,-10%20108,-24%20137,-31%2063,-14%2085,-5%2090,36%203,23%207,25%2030,20%2015,-3%2040,-21%2055,-40%2016,-19%2038,-34%2049,-34%2011,0%2036,-16%2054,-35%2033,-35%20109,-75%20143,-75%2010,0%2028,11%2041,25%2027,28%2045,32%2054,10%2012,-33%2090,-11%20106,30%20l%209,24%2050,-21%20c%2028,-12%2054,-31%2060,-44%2016,-37%2044,-38%20110,-4%2050,25%2061,35%2061,55%200,25%20-2,27%20-138,112%20l%20-24,15%2024,25%20c%2012,14%2035,31%2051,39%2031,17%2036,52%2013,95%20-13,26%20-13,27%2024,44%2031,14%2053,16%20103,11%2045,-5%2067,-4%2072,4%204,6%2013,9%2020,6%207,-2%2021,1%2032,9%2016,12%2021,11%2040,-7%2011,-11%2038,-22%2060,-25%2032,-4%2042,-1%2062,21%2015,16%2035,26%2052,26%2014,0%2032,6%2038,14%2011,13%20135,16%20171,4%20111,-37%20163,-50%20185,-46%2020,4%2025,2%2020,-9%20-3,-9%208,-28%2029,-47%2019,-17%2036,-42%2038,-56%205,-42%2044,-37%20154,20%2055,29%20110,65%20124,81%2055,61%20131,31%20260,-101%2055,-56%2096,-90%20115,-94%2046,-11%2090,-85%2089,-151%20-1,-28%20-6,-61%20-13,-72%20-19,-36%20-14,-121%209,-153%2011,-16%2028,-31%2038,-34%2011,-4%2017,-17%2018,-40%200,-25%2010,-46%2035,-73%2019,-22%2049,-60%2066,-86%2024,-35%2039,-47%2058,-47%2016,0%2025,-6%2025,-15%200,-9%2020,-37%2044,-63%2050,-55%2066,-82%2066,-114%200,-27%2017,-48%2039,-48%2034,0%20100,-43%20130,-86%2018,-25%2044,-49%2056,-54%2013,-5%2025,-19%2027,-32%202,-13%2011,-24%2022,-26%2036,-7%20130,29%20175,67%20l%2044,38%20-10,51%20c%20-9,47%20-8,53%2015,83%2024,30%2025,35%2014,86%20-8,41%20-8,67%200,103%2010,43%209,54%20-12,102%20-12,29%20-43,81%20-67,115%20-24,34%20-55,95%20-69,136%20-18,53%20-32,78%20-49,87%20-28,15%20-41,61%20-31,118%205,34%200,45%20-42,104%20-26,37%20-61,73%20-79,82%20-18,9%20-33,23%20-33,31%200,9%20-25,46%20-55,82%20-51,62%20-55,71%20-54,115%202,37%20-3,54%20-19,71%20-12,13%20-25,38%20-28,57%20-4,19%20-13,44%20-20,55%20-21,34%20-38,214%20-24,266%2013,46%2051,127%2080,169%209,14%2020,38%2024,54%2013,54%2065,114%20160,185%2071,53%2097,79%20105,104%207,19%2020,42%2031,52%2010,9%2030,46%2044,81%2052,130%2096,176%20178,188%2057,8%20101,53%20113,112%2013,72%20109,180%20185,210%2025,10%2060,29%2078,42%2027,21%2032,30%2032,68%200,33%20-5,46%20-20,54%20-11,6%20-25,8%20-30,5%20-6,-3%20-10,5%20-10,19%200,20%205,26%2021,26%2032,0%2085,36%20108,74%2029,46%2029,138%201,166%20-16,16%20-25,18%20-45,10%20-48,-18%20-66,-3%20-21,18%2035,16%2043,63%2018,110%20-11,21%20-23,52%20-26,70%20-10,42%20-58,82%20-101,82%20-25,0%20-34,5%20-39,22%20-3,13%20-1,27%204,32%2015,15%2012,58%20-5,80%20-8,11%20-15,32%20-15,47%200,42%20-18,82%20-46,105%20-19,15%20-24,27%20-20,42%206,18%2011,19%2040,10%2024,-8%2035,-18%2042,-42%206,-21%2016,-32%2032,-34%2020,-3%2023,-8%2017,-25%20-4,-12%20-9,-49%20-12,-82%20-4,-49%20-2,-65%2014,-84%2014,-17%2025,-22%2040,-17%2029,9%2069,90%2089,178%209,40%2025,87%2035,104%2014,24%2019,51%2019,108%200,79%20-8,105%20-43,144%20-20,22%20-20,22%20-1,22%2031,0%2078,57%20123,147%20l%2041,83%20v%20137%20138%20l%2068,41%20c%2037,23%2095,54%20129,69%2051,22%2068,37%2094,76%2034,53%2035,79%202,93%20-18,9%20-12,14%2059,49%2048,23%2083,47%2089,61%208,17%2017,21%2038,18%2023,-3%2034,3%2060,37%2028,35%2036,40%2062,34%2018,-3%2035,0%2045,8%209,8%2035,23%2058,34%2039,19%2041,23%2044,68%204,61%20-39,147%20-73,147%20-39,0%20-75,-37%20-75,-78%20v%20-36%20l%20-31,42%20c%20-17,23%20-39,42%20-48,42%20-28,0%20-30,9%20-13,56%2015,40%2015,46%20-1,79%20-19,39%20-18,47%2019,173%2014,45%2023,95%2022,110%20-3,23%201,27%2025,30%2016,2%2034,14%2043,28%209,13%2025,24%2036,24%2030,0%2074,53%2087,105%209,37%2017,48%2041,56%2016,6%2040,25%2054,43%2019,26%2031,32%2050,29%2017,-4%2031,2%2047,21%2012,14%2039,37%2060,52%2021,14%2048,40%2060,58%2012,18%2031,37%2043,42%2028,12%2032,48%208,81%20-11,16%20-23,38%20-26,50%20-5,16%20-21,27%20-54,36%20-38,11%20-50,21%20-64,48%20-9,19%20-32,43%20-51,53%20-36,20%20-39,28%20-113,271%20-14,50%20-33,97%20-41,106%20-19,23%20-128,89%20-145,89%20-7,0%20-39,-16%20-71,-35%20-32,-19%20-60,-35%20-62,-35%20-2,0%20-5,12%20-7,28%20-2,22%20-9,28%20-34,30%20-54,5%20-71,-20%20-118,-179%20l%20-44,-146%204,-136%20c%203,-126%202,-137%20-18,-163%20-13,-16%20-22,-40%20-21,-60%201,-20%20-3,-31%20-11,-29%20-18,6%20-77,-28%20-99,-56%20-10,-15%20-22,-41%20-26,-60%20l%20-7,-33%20-124,-28%20c%20-151,-34%20-390,-87%20-445,-98%20-22,-5%20-50,-12%20-61,-17%20-33,-12%20-200,-196%20-208,-228%20-4,-15%20-27,-51%20-52,-79%20-49,-57%20-57,-96%20-25,-130%2010,-12%2022,-31%2026,-44%2017,-56%20-181,-181%20-242,-153%20-13,6%20-40,11%20-59,11%20-37,0%20-214,-39%20-227,-50%20-5,-4%20-15,-33%20-23,-64%20-15,-57%20-15,-58%2011,-92%2016,-21%2024,-41%2020,-53%20-9,-29%20-140,-154%20-187,-178%20-24,-12%20-52,-32%20-63,-46%20-27,-32%20-103,-83%20-168,-112%20-31,-13%20-65,-39%20-84,-62%20-27,-34%20-36,-39%20-61,-35%20-23,3%20-40,-3%20-69,-26%20-34,-27%20-42,-30%20-83,-23%20-49,8%20-150,49%20-150,61%200,4%209,19%2020,33%2011,14%2020,38%2020,55%200,16%209,37%2020,47%2011,10%2020,28%2020,41%200,21%207,30%2043,60%208,7%2019,45%2026,86%20l%2013,74%20-42,125%20c%20-24,68%20-50,132%20-58,141%20-8,9%20-39,23%20-69,29%20l%20-56,13%20-31,-35%20c%20-17,-19%20-43,-50%20-58,-69%20-15,-19%20-30,-31%20-34,-27%20-4,4%208,24%2028,45%2020,20%2041,47%2047,59%2016,32%2013,155%20-5,209%20-12,37%20-13,52%20-4,74%207,16%209,37%206,47%20-8,24%20-80,68%20-136,83%20-25,6%20-54,20%20-65,30%20-11,10%20-44,23%20-72,31%20-29,7%20-53,16%20-53,20%200,4%2033,9%2073,11%2090,5%20151,32%20155,69%204,32%20-4,38%20-108,79%20-55,22%20-102,34%20-135,35%20h%20-50%20l%20-5,39%20c%20-7,55%20-28,65%20-88,43%20-27,-9%20-85,-24%20-128,-32%20-57,-11%20-92,-24%20-129,-50%20-47,-32%20-54,-34%20-110,-28%20-44,4%20-70,13%20-95,32%20-47,36%20-84,51%20-125,51%20-49,0%20-46,23%2010,77%2070,67%2060,96%20-38,107%20-54,7%20-58,6%20-80,-20%20-59,-71%20-168,-158%20-225,-179%20-26,-10%20-58,-27%20-72,-39%20-52,-45%20-58,-48%20-103,-41%20-36,6%20-44,10%20-40,24%207,27%20-24,51%20-63,51%20-19,0%20-61,-14%20-94,-30%20-33,-17%20-60,-28%20-60,-26%200,8%2072,79%20122,120%2026,21%20110,79%20185,130%20116,76%20138,95%20138,116%200,39%20-44,55%20-145,53%20-58,-2%20-95,3%20-117,13%20-30,13%20-37,13%20-104,-11%20-79,-27%20-96,-26%20-145,11%20-17,13%20-38,24%20-46,24%20-9,0%20-31,15%20-50,34%20-29,29%20-43,35%20-118,46%20-57,8%20-96,9%20-120,3%20-29,-8%20-45,-6%20-89,14%20-29,12%20-62,23%20-72,23%20-14,0%20-20,14%20-30,76%20-11,72%20-14,77%20-45,90%20-65,27%20-108,10%20-116,-46%20-3,-24%20-7,-25%20-93,-32%20-141,-11%20-367,-10%20-815,1%20-510,14%20-627,23%20-1305,100%20-311,36%20-335,39%20-575,76%20-129,19%20-262,40%20-295,45%20-33,5%20-91,14%20-130,20%20-497,74%20-646,100%20-865,150%20-140,32%20-291,66%20-335,75%20-100,22%20-160,35%20-205,45%20-19,4%20-78,17%20-130,29%20-186,41%20-257,59%20-441,110%20-192,53%20-236,60%20-244,39%20z%20m%20270,-84%20c%20110,-30%20218,-59%20240,-64%2063,-15%20578,-129%20855,-190%2019,-4%2085,-19%20145,-33%2061,-14%20250,-46%20420,-71%20312,-47%20457,-68%20573,-86%2034,-6%2091,-14%20127,-20%20156,-24%20202,-31%20230,-36%2017,-3%2066,-9%20110,-14%2044,-5%20242,-27%20440,-49%20503,-56%20539,-59%201105,-77%20459,-15%20788,-14%20907,2%2039,6%2042,8%2048,45%206,34%2010,39%2035,39%2038,0%2047,-14%2055,-90%2010,-99%2011,-102%2049,-94%2025,4%2046,-1%2083,-19%2044,-23%2053,-24%2097,-14%2036,8%2066,8%20119,-1%2062,-11%2075,-17%20100,-47%2016,-20%2038,-35%2050,-35%2011,0%2030,-8%2041,-18%2012,-10%2037,-23%2058,-30%2032,-11%2043,-10%20104,13%2067,25%2070,25%20107,9%2031,-14%2047,-16%2094,-7%2055,10%20121,0%20126,-19%201,-4%20-52,-42%20-118,-84%20-130,-84%20-262,-190%20-326,-263%20l%20-40,-45%2034,-12%20c%2033,-12%2040,-10%20111,27%2050,27%2083,38%2096,34%2022,-7%2026,-20%2010,-30%20-6,-3%20-10,-19%20-10,-35%200,-28%201,-28%2033,-19%2017,5%2053,7%2079,4%2043,-6%2049,-4%2085,28%2021,19%2068,48%20104,65%2037,16%2085,48%20107,70%2022,22%2048,43%2059,46%2010,3%2027,22%2037,41%2016,30%2024,35%2055,35%2060,0%2068,-14%2027,-45%20-26,-20%20-40,-41%20-51,-78%20-8,-28%20-15,-53%20-15,-57%200,-3%2018,-4%2040,-2%2047,5%20109,-18%20160,-58%2032,-25%2047,-29%20107,-31%2065,-3%2074,-1%20124,33%2038,25%2074,39%20124,47%2039,7%2087,19%20108,27%2051,19%2057,18%2057,-11%200,-13%205,-35%2011,-49%2011,-23%2016,-24%2059,-19%2038,4%2064,-1%20134,-27%2048,-18%2089,-37%2092,-41%209,-16%20-69,-39%20-132,-39%20-53,0%20-65,-3%20-78,-22%20-14,-20%20-17,-20%20-33,-5%20-10,8%20-41,19%20-69,22%20-55,8%20-93,-5%20-128,-44%20-13,-14%20-31,-21%20-57,-21%20-33,0%20-41,-5%20-54,-30%20-18,-35%20-52,-41%20-57,-9%20l%20-3,21%20-27,-21%20c%20-33,-26%20-38,-26%20-38,0%200,35%20-24,15%20-31,-27%20-4,-21%20-19,-62%20-33,-90%20-14,-29%20-26,-59%20-26,-67%200,-9%20-22,-45%20-49,-81%20-49,-64%20-71,-119%20-53,-130%206,-3%2018,7%2028,22%209,15%2036,45%2058,67%2023,23%2055,59%2073,80%2030,38%2032,39%2032,15%201,-14%20-15,-61%20-34,-105%20-20,-44%20-38,-105%20-42,-135%20-3,-30%20-15,-67%20-25,-82%20-15,-22%20-19,-42%20-17,-95%201,-43%20-3,-81%20-13,-103%20-13,-32%20-13,-44%208,-145%2013,-60%2023,-136%2023,-167%201,-48%205,-59%2026,-76%2014,-11%2032,-43%2041,-70%2014,-44%2022,-53%2055,-66%2037,-15%2040,-15%2082,10%2087,53%20125,142%20143,330%206,64%204,77%20-24,140%20-47,108%20-65,189%20-57,259%204,33%2010,90%2013,127%207,66%2028,109%2065,132%2013,8%2020,6%2030,-8%2013,-18%2015,-18%2045,4%2027,20%2032,30%2032,65%200,31%206,47%2025,65%2017,16%2023,30%2019,45%20-6,25%2051,104%2076,104%2032,1%20114,-30%20126,-48%208,-11%2031,-21%2058,-24%2044,-6%20126,-51%20126,-68%200,-4%20-4,-11%20-10,-14%20-15,-9%20-12,-66%205,-95%209,-16%2014,-55%2015,-109%20v%20-85%20l%20-44,-40%20c%20-38,-36%20-43,-45%20-38,-74%205,-35%2046,-67%2060,-46%2034,51%20106,134%20115,134%2016,0%2087,-20%2087,-24%200,-2%2018,-57%2041,-121%2036,-105%2040,-124%2034,-174%20-8,-65%20-20,-91%20-40,-91%20-9,0%20-19,-17%20-26,-45%20-6,-24%20-17,-50%20-25,-56%20-8,-6%20-14,-24%20-14,-40%200,-15%20-13,-48%20-30,-72%20-39,-59%20-40,-87%20-1,-87%2016,0%2050,-10%2077,-22%2027,-12%2071,-25%2099,-28%2045,-6%2053,-4%2095,25%2038,28%2048,31%2069,22%2019,-9%2026,-8%2037,7%2032,45%2086,96%20101,96%2019,0%20154,83%20179,111%2010,12%2042,36%2069,54%2028,17%2082,64%20121,102%2086,85%2097,117%2058,168%20-23,30%20-24,37%20-14,74%2012,45%2016,47%20164,78%2066,13%2071,13%2097,-6%20l%2027,-20%2077,31%20c%2053,22%2093,47%20131,82%2050,48%2054,55%2054,99%200,26%20-4,47%20-10,47%20-5,0%20-17,11%20-26,25%20-16,25%20-16,26%2029,74%2025,27%2051,67%2057,89%209,29%2037,64%2099,126%20l%2087,87%20315,70%20c%20173,38%20322,72%20332,75%2014,4%2017,12%2013,30%20-13,49%2056,124%2098,108%2028,-11%2048,16%2041,53%20-4,25%200,40%2017,64%2023,31%2025,52%2020,174%20-4,95%206,168%2042,285%2035,115%2057,157%2077,145%204,-3%205,-13%202,-24%20-3,-12%203,-24%2017,-34%2021,-15%2026,-13%2085,24%2034,21%2067,39%2072,39%205,0%2037,-17%2069,-38%2055,-36%2060,-43%2073,-93%208,-30%2031,-109%2052,-176%2036,-111%2042,-123%2074,-142%2019,-11%2043,-37%2052,-56%2014,-29%2026,-38%2061,-48%2034,-9%2046,-18%2057,-43%207,-17%2018,-35%2024,-38%2016,-10%2014,-36%20-3,-36%20-8,0%20-25,-15%20-37,-32%20-13,-18%20-32,-40%20-44,-48%20-11,-8%20-37,-30%20-57,-48%20-27,-24%20-43,-32%20-57,-27%20-15,5%20-31,-5%20-64,-39%20-24,-25%20-51,-46%20-59,-46%20-11,0%20-26,-24%20-43,-71%20-15,-39%20-32,-72%20-39,-74%20-6,-2%20-23,-6%20-38,-9%20-15,-3%20-30,-15%20-33,-27%20-5,-15%20-13,-19%20-29,-15%20-34,8%20-68,-31%20-60,-70%203,-17%20-4,-63%20-19,-114%20-31,-107%20-34,-135%20-18,-182%2011,-33%2010,-45%20-8,-92%20-22,-59%20-18,-66%2034,-66%2013,0%2030,-10%2040,-26%2029,-45%2054,-64%2085,-64%2024,0%2030,4%2030,23%200,12%20-5,29%20-10,37%20-9,14%2013,50%2030,50%2013,0%2040,-71%2040,-105%200,-30%20-4,-36%20-27,-41%20-16,-4%20-36,-13%20-45,-22%20-14,-11%20-21,-12%20-32,-3%20-22,18%20-59,-2%20-90,-50%20l%20-29,-43%20-24,28%20c%20-30,35%20-53,28%20-53,-17%200,-20%20-7,-40%20-17,-49%20-29,-26%20-94,-54%20-153,-68%20-91,-21%20-161,-59%20-222,-122%20-57,-57%20-69,-78%20-47,-78%2015,0%20134,57%20190,92%2041,25%20119,40%20119,22%200,-23%20-62,-79%20-114,-103%20-34,-16%20-88,-45%20-120,-65%20-33,-20%20-72,-36%20-86,-36%20-25,0%20-50,-16%20-50,-32%200,-4%208,-8%2018,-8%2036,0%2042,-21%2042,-133%200,-109%200,-111%20-43,-201%20-24,-50%20-54,-100%20-66,-111%20-23,-20%20-23,-20%20-40,1%20-9,12%20-33,29%20-52,39%20-19,10%20-50,35%20-70,57%20-32,34%20-37,36%20-42,20%20-6,-25%2085,-169%20116,-183%2012,-5%2032,-25%2045,-43%2029,-43%2031,-158%204,-214%20-10,-20%20-24,-64%20-32,-97%20-7,-33%20-24,-82%20-39,-110%20l%20-26,-50%20-3,49%20c%20-2,26%202,62%207,79%206,16%2011,43%2011,59%200,28%20-2,29%20-30,23%20-29,-6%20-30,-5%20-30,29%200,22%20-5,36%20-12,36%20-7,0%20-30,5%20-50,11%20-29,7%20-38,15%20-38,31%200,12%20-10,61%20-21,109%20-21,83%20-21,90%20-5,128%2019,50%2021,94%204,89%20-7,-3%20-28,-24%20-45,-47%20-30,-39%20-33,-49%20-33,-115%200,-53%207,-89%2025,-136%2034,-88%2033,-100%20-9,-100%20-66,0%20-49,-41%2022,-55%2049,-9%2072,-37%2072,-88%200,-23%207,-53%2016,-66%2014,-19%2014,-27%204,-46%20-7,-13%20-10,-35%20-6,-49%205,-19%203,-26%20-9,-26%20-22,0%20-18,-37%205,-50%2014,-7%2026,-8%2039,0%2050,26%20111,0%20111,-49%200,-14%209,-37%2020,-51%2026,-33%2026,-77%201,-85%20-10,-3%20-47,-24%20-81,-46%20-48,-31%20-60,-43%20-51,-52%209,-9%2022,-8%2056,4%2041,15%2045,15%2063,-4%2020,-19%2020,-19%2041,2%2030,30%2041,19%2041,-41%200,-64%20-27,-105%20-76,-114%20-27,-5%20-38,-2%20-48,11%20-16,22%20-46,14%20-46,-12%200,-10%207,-26%2015,-36%2022,-30%200,-76%20-47,-97%20-29,-13%20-36,-20%20-26,-26%2020,-13%2069,-5%20105,17%2034,21%2049,13%2038,-21%20-4,-12%20-38,-35%20-88,-59%20-73,-34%20-89,-47%20-139,-112%20-38,-48%20-61,-88%20-68,-120%20-14,-59%20-36,-79%20-96,-90%20-81,-15%20-139,-76%20-187,-193%20-12,-28%20-36,-73%20-54,-100%20-18,-26%20-33,-54%20-33,-60%200,-7%20-41,-43%20-91,-81%20-92,-69%20-153,-138%20-165,-185%20-4,-14%20-21,-50%20-39,-80%20-18,-30%20-45,-88%20-59,-129%20-26,-72%20-26,-77%20-16,-174%206,-55%2020,-122%2031,-149%2010,-27%2019,-57%2019,-67%200,-9%2011,-28%2025,-41%2021,-19%2025,-33%2025,-76%200,-49%204,-58%2045,-106%2025,-29%2053,-70%2061,-90%2010,-23%2025,-39%2040,-42%2013,-4%2042,-31%2065,-61%2039,-52%2041,-58%2043,-131%202,-72%203,-77%2034,-102%2022,-19%2039,-47%2053,-91%2012,-35%2041,-92%2064,-125%2023,-34%2053,-81%2065,-106%2021,-41%2022,-50%2012,-98%20-8,-39%20-8,-66%200,-102%2010,-43%209,-51%20-11,-79%20-19,-26%20-21,-39%20-16,-84%206,-49%205,-53%20-23,-74%20-36,-26%20-98,-53%20-123,-53%20-14,0%20-19,7%20-19,25%200,20%20-5,25%20-23,25%20-16,0%20-33,14%20-56,45%20-38,52%20-74,80%20-119,90%20-18,4%20-36,14%20-39,23%20-18,57%20-32,82%20-69,122%20-26,27%20-44,57%20-46,75%20-3,27%20-7,30%20-40,33%20-31,3%20-41,10%20-59,40%20-13,20%20-38,54%20-56,75%20-36,41%20-40,58%20-19,76%2021,18%2030,69%2016,86%20-16,19%20-40,19%20-40,1%200,-7%20-6,-19%20-13,-25%20-11,-8%20-18,-7%20-29,7%20-26,28%20-31,76%20-13,118%2029,70%2024,130%20-19,207%20-32,58%20-42,67%20-66,67%20-21,0%20-47,20%20-116,88%20-106,105%20-165,142%20-226,142%20-38,0%20-49,-5%20-80,-37%20-32,-35%20-188,-123%20-216,-123%20-7,0%20-12,11%20-12,25%200,17%20-9,29%20-30,40%20-33,17%20-34,19%20-20,45%2012,23%20-12,33%20-80,36%20-65,2%20-144,28%20-148,48%20-3,14%20-10,16%20-35,9%20-18,-4%20-62,-7%20-99,-5%20-59,2%20-69,0%20-78,-18%20-7,-13%20-21,-20%20-39,-20%20-15,0%20-36,-9%20-46,-20%20-21,-23%20-67,-26%20-85,-5%20-6,8%20-18,34%20-25,57%20l%20-13,43%20-21,-47%20c%20-22,-48%20-34,-58%20-46,-37%20-5,7%20-13,5%20-25,-6%20-14,-12%20-29,-15%20-68,-9%20-54,7%20-87,-2%20-189,-54%20l%20-52,-26%20-73,17%20c%20-40,10%20-84,17%20-98,17%20-32,0%20-54,-33%20-40,-60%209,-17%2018,-18%2079,-13%2067,6%2069,5%2082,-20%20l%2014,-26%2055,34%20c%2030,19%2058,35%2061,35%203,0%2010,-10%2016,-22%208,-18%201,-29%20-49,-78%20-32,-31%20-58,-60%20-58,-66%200,-5%2038,-32%2085,-59%2046,-28%2085,-53%2085,-57%200,-8%20-73,-48%20-88,-48%20-6,0%20-12,9%20-15,20%20-3,13%20-26,29%20-60,44%20-30,14%20-57,32%20-60,40%20-4,9%20-15,16%20-26,16%20-15,0%20-22,-10%20-28,-42%20-9,-47%20-38,-64%20-56,-33%20-12,22%20-76,12%20-95,-16%20-16,-23%20-25,-23%20-77,-4%20-24,10%20-50,30%20-64,50%20-16,24%20-31,35%20-48,35%20-22,0%20-73,42%20-73,61%200,5%20-8,9%20-18,9%20-10,0%20-27,7%20-40,15%20-31,22%20-62,4%20-62,-35%200,-37%201,-37%20-164,-1%20-86,19%20-138,26%20-155,21%20-85,-26%20-343,-81%20-356,-77%20-8,4%20-15,16%20-15,27%200,22%20-3,23%20-37,14%20-29,-8%20-37,-35%20-21,-68%2011,-25%209,-29%20-16,-50%20-16,-12%20-36,-37%20-45,-56%20-13,-27%20-38,-45%20-139,-98%20-112,-58%20-124,-63%20-140,-49%20-15,14%20-21,14%20-51,1%20-33,-14%20-33,-15%20-17,-38%2018,-28%2015,-31%20-37,-41%20-32,-6%20-39,-12%20-44,-37%20-5,-23%20-10,-29%20-25,-24%20-30,7%20-48,-3%20-48,-28%200,-33%20-27,-64%20-58,-68%20-26,-3%20-27,-5%20-27,-60%200,-45%20-5,-61%20-23,-81%20-20,-21%20-22,-28%20-11,-45%2010,-16%2010,-28%20-1,-61%20-12,-38%20-11,-50%2015,-144%2017,-64%2037,-112%2051,-128%2013,-14%2024,-35%2024,-47%200,-20%20-3,-21%20-20,-12%20-14,7%20-25,7%20-38,-1%20-16,-10%20-25,-8%20-53,14%20-21,16%20-62,31%20-110,41%20-42,9%20-125,38%20-185,65%20l%20-109,49%20-37,68%20c%20-41,75%20-68,155%20-68,202%200,52%20-19,92%20-45,92%20-23,0%20-65,55%20-65,84%200,8%20-21,37%20-46,65%20-32,36%20-58,81%20-89,158%20-25,59%20-45,118%20-45,129%200,12%20-12,29%20-27,40%20-55,35%20-123,107%20-123,128%200,32%20-53,54%20-145,60%20-67,4%20-83,8%20-98,27%20l%20-18,22%20-15,-21%20c%20-10,-14%20-27,-22%20-55,-24%20-40,-3%20-41,-4%20-71,-73%20-35,-81%20-81,-135%20-116,-135%20-20,0%20-108,58%20-300,197%20-47,35%20-66,77%20-58,131%205,35%202,49%20-14,69%20-11,14%20-20,34%20-20,45%200,12%20-70,92%20-172,199%20-114,118%20-174,189%20-176,205%20-5,40%20-50,60%20-170,73%20-59,7%20-134,16%20-168,22%20-33,5%20-74,9%20-91,9%20-30,0%20-31,-2%20-42,-61%20-6,-34%20-12,-63%20-13,-64%20-4,-3%20-292,33%20-528,66%20-36,5%20-92,12%20-125,15%20-56,6%20-79,19%20-315,167%20-632,395%20-610,381%20-610,404%200,26%20-6,27%20-190,43%20-69,6%20-170,15%20-225,20%20-55,6%20-116,11%20-135,13%20l%20-35,2%20-10,120%20c%20-9,112%20-12,124%20-45,175%20-66,105%20-101,140%20-138,140%20-31,0%20-34,2%20-28,25%204,15%200,37%20-8,53%20-12,23%20-26,31%20-69,41%20-58,13%20-76,27%20-96,77%20-10,25%20-29,39%20-99,73%20-48,22%20-97,41%20-109,41%20-12,0%20-39,14%20-60,32%20-21,18%20-39,33%20-41,34%20-1,1%208,30%2021,66%2024,63%2024,65%206,89%20-15,18%20-17,34%20-13,66%205,35%203,44%20-11,49%20-20,8%20-95,162%20-95,194%200,11%20-17,39%20-39,63%20-38,42%20-38,42%20-24,82%207,21%2022,49%2033,60%2035,37%2026,75%20-30,130%20l%20-50,49%20v%2073%20c%200,69%201,73%2023,73%2012,0%2033,-7%2046,-16%2022,-16%2023,-16%2018,2%20-3,11%20-9,37%20-12,59%20-13,78%20-14,80%20-40,55%20l%20-22,-21%20-32,36%20c%20-28,33%20-31,42%20-31,104%200,62%20-3,72%20-33,112%20-18,24%20-43,60%20-54,81%20-19,33%20-20,38%20-6,57%2013,20%2013,24%20-1,46%20-14,21%20-14,28%20-1,65%208,23%2023,54%2034,69%20l%2020,27%20-35,109%20c%20-46,147%20-45,158%2021,255%2030,44%2055,85%2055,91%200,5%2011,27%2025,47%2024,35%2025,44%2025,175%200,98%204,148%2015,173%2010,25%2012,42%205,60%20-17,43%20-11,69%2020,99%2017,16%2030,39%2030,52%200,13%2016,40%2038,62%2039,41%20130,240%20211,466%2022,61%2051,140%2064,176%2013,37%2030,96%2037,132%2010,48%2018,67%2031,70%2010,3%2024,17%2030,31%2010,22%209,29%20-6,46%20-21,24%20-13,70%2013,70%2014,0%2012,4%20-8,19%20-23,19%20-24,21%20-11,56%2011,31%2011,42%200,62%20-10,19%20-11,35%20-2,77%208,38%208,66%201,95%20-10,41%20-4,126%2011,135%204,3%2054,-26%20112,-64%2057,-39%20111,-70%20120,-70%209,0%2028,-9%2042,-20%2014,-11%2037,-20%2051,-20%2014,0%2026,-3%2026,-7%201,-5%205,-28%2010,-53%206,-35%204,-52%20-9,-80%20-10,-19%20-21,-50%20-24,-67%20-6,-28%20-4,-33%2012,-33%2013,0%2034,25%2067,81%20l%2047,81%20-15,81%20c%20-14,71%20-14,85%20-1,116%2013,31%2013,35%20-1,43%20-10,5%20-16,22%20-16,43%200,29%203,33%2023,28%2012,-3%20112,-30%20222,-59%20z%20M%208824,6504%20c%2021,-21%2021,-21%20-20,-66%20-22,-25%20-34,-47%20-32,-62%201,-12%20-7,-35%20-20,-50%20-12,-16%20-22,-43%20-22,-61%200,-41%20-5,-45%20-39,-32%20-61,23%20-119,-59%20-134,-192%20-20,-164%20-9,-247%2049,-380%2055,-125%205,-349%20-93,-416%20-47,-32%20-71,-22%20-95,41%20-10,27%20-28,56%20-38,66%20-14,11%20-20,29%20-20,60%20-1,23%20-11,95%20-25,158%20-21,103%20-22,117%20-9,143%2010,18%2014,52%2013,96%20-2,55%202,76%2020,104%2014,23%2021,51%2021,85%200,28%204,53%209,56%2018,11%2063,147%2064,194%202,42%200,47%20-22,50%20-13,2%20-28,-1%20-34,-7%20-25,-25%20-25,-8%200,43%2027,56%2048,70%2090,60%2031,-8%2081,13%2088,37%204,11%2020,21%2043,25%2020,4%2046,14%2057,24%2049,42%20120,54%20149,24%20z%20m%202491,-1655%20c%2011,-17%20-1,-21%20-15,-4%20-8,9%20-8,15%20-2,15%206,0%2014,-5%2017,-11%20z'%20id='path1'%20style='fill:%23757472;fill-opacity:1'%20/%3e%3cpath%20d='m%201230,2197%20c%20-80,-36%20-98,-48%20-116,-80%20-32,-58%20-35,-59%20-94,-45%20l%20-53,12%20-28,-33%20c%20-39,-48%20-41,-65%20-8,-109%2019,-27%2031,-56%2035,-94%20l%206,-55%20-58,-7%20c%20-151,-18%20-173,-23%20-188,-35%20-21,-18%20-20,-34%205,-84%2018,-34%2020,-46%2011,-71%20-13,-33%20-7,-49%2036,-89%2033,-32%20147,-77%20193,-77%2037,0%2030,-16%20-10,-25%20-16,-3%20-37,-15%20-46,-25%20-17,-19%20-18,-19%20-43,0%20-34,27%20-53,25%20-88,-11%20-16,-17%20-57,-47%20-92,-66%20-35,-20%20-66,-42%20-69,-50%20-3,-8%201,-40%2010,-71%2010,-37%2012,-62%206,-73%20-17,-32%20-9,-75%2020,-117%2023,-31%2038,-41%2069,-47%2022,-3%2048,-13%2059,-20%2015,-12%2016,-17%206,-34%20-20,-32%20-16,-85%207,-106%2014,-13%2028,-16%2054,-11%2033,6%2036,4%2066,-39%2022,-33%2038,-45%2055,-45%2030,0%2031,-6%207,-43%20-11,-18%20-50,-46%20-107,-76%20-50,-26%20-107,-57%20-126,-68%20-19,-12%20-44,-20%20-55,-17%20-10,3%20-46,-4%20-78,-16%20-33,-11%20-74,-20%20-93,-20%20-47,0%20-123,-52%20-123,-84%200,-43%2021,-49%20133,-42%2056,4%20116,11%20132,16%2017,6%2082,26%20145,44%20231,69%20275,88%20346,146%20163,134%20184,154%20184,181%200,23%2054,89%2073,89%204,0%207,-17%207,-39%200,-61%2018,-69%20103,-47%20111,28%20131,40%20163,89%2025,40%2034,46%2063,47%2027,0%2047,-11%2093,-51%2058,-51%2098,-69%20152,-69%2037,0%20145,-39%20243,-88%20l%2078,-40%2035,-82%20c%2026,-60%2053,-101%20104,-158%2093,-102%20234,-231%20262,-238%2020,-5%20151,44%20182,68%208,7%2012,40%2012,98%200,102%202,100%20-116,154%20l%20-81,38%20-112,153%20c%20-61,84%20-118,155%20-126,159%20-18,7%20-39,0%20-89,-32%20l%20-40,-25%20-30,39%20c%20-62,79%20-71,84%20-131,84%20h%20-55%20v%20534%20535%20l%20-67,75%20c%20-36,42%20-74,76%20-84,76%20-10,0%20-30,-7%20-46,-16%20-27,-16%20-30,-16%20-102,21%20-68,34%20-79,36%20-128,30%20-51,-6%20-53,-6%20-53,18%200,14%20-6,29%20-12,34%20-22,17%20-158,65%20-181,64%20-12,-1%20-33,-2%20-47,-3%20-14,-1%20-38,1%20-55,5%20-23,5%20-52,-4%20-125,-36%20z%20m%20146,-8%20c%2034,-9%2048,-9%2059,1%2011,9%2031,5%2099,-20%2083,-31%2085,-33%2079,-61%20-5,-24%20-2,-29%2021,-35%2015,-3%2045,-2%2068,4%2038,10%2046,8%20124,-31%20l%2084,-42%2036,20%20c%2036,19%2036,19%2052,-2%2010,-11%2034,-41%2054,-65%20l%2038,-45%202,-544%203,-544%2065,-3%2065,-2%2057,-63%2056,-62%2062,34%20c%2059,32%2062,32%2075,15%208,-11%2058,-80%20112,-154%20l%2098,-135%2093,-44%2092,-45%20v%20-75%20-76%20l%20-68,-28%20c%20-37,-15%20-72,-27%20-79,-27%20-6,0%20-75,62%20-152,138%20-133,131%20-142,141%20-184,234%20l%20-45,97%20-94,47%20c%20-113,57%20-219,94%20-268,94%20-40,0%20-66,15%20-125,71%20-36,34%20-47,38%20-112,45%20l%20-73,7%20v%20-29%20c%20-1,-49%20-37,-80%20-121,-103%20-98,-27%20-99,-27%20-99,12%200,23%2012,50%2040,87%2022,29%2038,55%2035,58%20-7,7%20-76,-38%20-133,-87%20-30,-25%20-68,-58%20-85,-73%20-29,-24%20-31,-28%20-15,-40%2015,-12%207,-21%20-74,-88%20C%201070,507%201064,503%20932,461%20689,383%20628,368%20530,364%20l%20-95,-5%2030,25%20c%2019,16%2042,26%2062,26%2018,0%2056,9%2085,20%2029,11%2067,20%2084,20%2019,0%2084,27%20168,71%20135,70%20138,72%20161,123%2013,28%2033,66%2045,83%20l%2022,33%20-49,-15%20c%20-69,-21%20-75,-19%20-105,31%20-28,45%20-28,45%20-72,39%20-38,-6%20-44,-4%20-48,13%20-3,12%201,30%209,42%2024,34%200,100%20-36,100%20-83,0%20-136,59%20-113,124%2010,27%209,41%20-3,76%20-8,23%20-15,48%20-15,55%200,7%2024,28%2053,45%2028,18%2067,46%2084,63%20l%2033,31%2029,-29%2030,-28%2036,32%20c%2025,21%2046,31%2069,31%2033,0%2034,0%2041,57%204,31%209,63%2013,72%204,11%20-3,9%20-30,-7%20-19,-12%20-43,-22%20-53,-22%20-39,0%20-124,34%20-160,64%20-34,29%20-36,33%20-24,58%2010,23%209,35%20-9,78%20-24,58%20-30,53%2083,70%2044,6%2088,13%2098,15%2014,3%2017,-5%2017,-45%200,-50%2010,-60%2067,-60%2028,0%2030,5%2039,68%20l%206,51%20-36,17%20c%20-20,10%20-36,20%20-36,23%20-1,52%20-24,129%20-46,152%20-25,26%20-25,28%20-9,53%2019,28%2033,31%2083,17%2045,-13%2079,3%20103,52%2017,32%2033,45%20102,77%2045,21%2083,39%2085,39%202,1%2023,-4%2048,-10%20z%20m%20-341,-464%20c%200,-16%20-6,-30%20-12,-32%20-9,-3%20-13,7%20-13,32%200,25%204,35%2013,33%206,-3%2012,-17%2012,-33%20z'%20id='path2'%20style='fill:%23757472;fill-opacity:1'%20/%3e%3cpath%20d='m%203320,1204%20c%20-57,-25%20-70,-42%20-70,-94%200,-25%205,-51%2012,-58%2017,-17%20162,-16%20176,1%205,6%2016,32%2023,56%20l%2013,44%20-37,33%20c%20-40,37%20-64,41%20-117,18%20z%20m%2094,-43%20c%2014,-16%2016,-26%209,-48%20-9,-26%20-14,-28%20-71,-31%20l%20-62,-3%20v%2034%20c%200,28%205,36%2033,50%2043,21%2070,21%2091,-2%20z'%20id='path3'%20style='fill:%23757472;fill-opacity:1'%20/%3e%3cpath%20d='m%203733,1037%20-36,-33%2011,-65%20c%2015,-83%2034,-99%20113,-99%2074,0%2099,20%2099,82%200,36%20-6,47%20-53,95%20-32,31%20-63,53%20-76,53%20-12,0%20-38,-15%20-58,-33%20z%20m%20105,-46%20c%2035,-32%2042,-45%2042,-75%20v%20-36%20h%20-59%20-60%20l%20-12,56%20c%20-12,55%20-12,57%2010,75%2013,11%2026,19%2030,19%203,-1%2025,-18%2049,-39%20z'%20id='path4'%20style='fill:%23757472;fill-opacity:1'%20/%3e%3cpath%20d='m%203979,893%20c%20-14,-11%20-19,-26%20-19,-59%200,-40%203,-46%2028,-57%2018,-8%2026,-18%2024,-30%20-2,-10%203,-29%2012,-42%209,-13%2016,-34%2016,-45%200,-22%2035,-41%2060,-32%2029,11%2072,47%2080,67%207,19%209,18%2021,-8%2017,-37%2045,-42%2099,-19%2061,26%2094,64%2086,96%20-9,35%20-69,70%20-108,62%20-26,-5%20-39,-1%20-68,22%20-46,38%20-199,67%20-231,45%20z%20m%20115,-43%20c%2032,-5%2061,-11%2063,-13%206,-6%20-19,-57%20-28,-57%20-4,0%20-9,7%20-13,15%20-4,11%20-21,15%20-61,15%20-52,0%20-55,1%20-55,25%200,29%206,30%2094,15%20z%20m%20178,-67%20c%2037,7%2087,-21%2074,-42%20-8,-12%20-79,-51%20-95,-51%20-5,0%20-14,14%20-20,30%20-7,20%20-17,30%20-30,30%20-17,0%20-21,6%20-21,35%20v%2036%20l%2029,-22%20c%2022,-16%2038,-20%2063,-16%20z%20m%20-158,-45%2026,-33%20-21,-17%20c%20-29,-24%20-31,-23%20-51,19%20-13,27%20-14,40%20-6,50%2016,19%2024,16%2052,-19%20z'%20id='path5'%20style='fill:%23757472;fill-opacity:1'%20/%3e%3cpath%20d='m%204372,608%20c%20-7,-7%20-12,-23%20-12,-36%200,-13%20-12,-43%20-26,-68%20-29,-50%20-29,-66%205,-206%2022,-90%2025,-96%2057,-109%2064,-24%2071,-23%20111,20%2036,39%20101,69%20186,86%2055,11%2061,108%208,126%20-15,6%20-34,22%20-42,38%20-25,49%20-104,111%20-175,137%20-75,27%20-95,29%20-112,12%20z%20m%2093,-48%20c%2070,-24%20140,-79%20163,-128%2011,-23%2026,-38%2042,-42%2018,-4%2025,-13%2025,-29%200,-20%20-8,-26%20-50,-37%20-82,-21%20-141,-50%20-163,-82%20-17,-23%20-27,-28%20-46,-25%20-35,7%20-41,17%20-65,115%20-26,109%20-26,114%204,163%2013,22%2025,50%2025,63%200,27%20-6,26%2065,2%20z'%20id='path6'%20style='fill:%23757472;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20style='opacity:1;fill:%2376c6ff;fill-opacity:1;stroke:%23757472;stroke-width:0.52953;stroke-dasharray:none'%20d='m%2091.025948,149.93112%20c%20-3.43363,-1.23976%20-4.5405,-2.34033%20-4.95393,-4.9258%20-0.158859,-0.99346%20-0.44971,-1.80629%20-0.64633,-1.80629%20-0.52643,0%20-3.13292,-4.22453%20-3.48388,-5.64659%20-0.87561,-3.54784%20-7.89117,-6.50849%20-8.83847,-3.72995%20-0.143339,0.42042%20-0.550309,1.14514%20-0.90438,1.61049%20-0.6111,0.80315%20-0.76407,0.76772%20-3.01473,-0.69829%20-1.867459,-1.2164%20-2.477969,-1.9322%20-2.87486,-3.3707%20-0.316289,-1.14633%20-1.63853,-3.08907%20-3.55125,-5.21775%20-2.762309,-3.0742%20-3.24846,-3.41736%20-5.19746,-3.66895%20-1.182559,-0.15264%20-2.621449,-0.37483%20-3.19753,-0.49375%20-0.70668,-0.14588%20-1.047419,0.005%20-1.047419,0.46346%200,1.19499%20-0.895711,1.30893%20-5.736254,0.72965%20l%20-4.73797,-0.56699%20-6.051772,-3.74838%20c%20-3.328476,-2.06161%20-6.406754,-4.04971%20-6.840619,-4.41801%20-0.433865,-0.3683%20-2.520156,-0.86333%20-4.636206,-1.10008%20-3.998173,-0.44731%20-4.562533,-0.78382%20-4.579589,-2.73063%20-0.01517,-1.7321%20-3.245106,-6.05176%20-4.525073,-6.05176%20-0.345917,0%20-0.757352,-0.33465%20-0.914299,-0.74365%20-0.156949,-0.409%20-1.197797,-1.13474%20-2.312996,-1.61278%20-1.886707,-0.80874%20-2.027636,-0.99252%20-2.027636,-2.644226%200,-1.07247%20-0.565209,-2.864469%20-1.4279511,-4.527319%20-1.236639,-2.38351%20-1.3511629,-2.89573%20-0.8547989,-3.823191%200.477424,-0.892079%200.443791,-1.213889%20-0.2013721,-1.926789%20-0.82901,-0.916041%20-1.087174,-3.125551%20-0.3090029,-2.64461%200.261811,0.16181%200.46552,-0.209831%200.46552,-0.849271%200,-0.745479%20-0.320592,-1.220829%20-0.931042,-1.380459%20-0.650486,-0.17011%20-0.935503,-0.64237%20-0.945847,-1.56724%20-0.0081,-0.72807%20-0.322369,-1.7304%20-0.6982811,-2.2274%20-0.7697849,-1.017751%20-0.9069369,-3.10569%20-0.2479619,-3.77485%200.270522,-0.274711%200.2339469,-1.1923%20-0.09655,-2.422111%20-0.4847371,-1.803759%20-0.419961,-2.20124%200.728288,-4.46896%200.965089,-1.905979%201.2603469,-3.162139%201.2603469,-5.36207%200,-2.297509%200.2369231,-3.230989%201.1828161,-4.660329%201.147567,-1.73409%204.400518,-9.48037%204.406304,-10.49277%200.0016,-0.275959%200.321478,-1.11271%200.710887,-1.85943%200.471691,-0.90452%200.689011,-2.53604%200.651078,-4.88798%20-0.03132,-1.941649%20-0.03699,-3.7073%20-0.01261,-3.92365%200.03912,-0.3471%203.873887,1.61605%204.833226,2.4743%200.20154,0.18031%200.157176,0.87824%20-0.09859,1.55096%20-0.64076,1.68532%200.19005,2.05572%201.18953,0.53033%200.539651,-0.82362%200.765181,-1.98391%200.693016,-3.56543%20-0.101771,-2.23046%20-0.05478,-2.33249%200.966161,-2.09794%200.590225,0.13559%205.601976,1.29773%2011.137224,2.58251%2018.824553,4.36937%2038.600173,6.95995%2056.376603,7.38524%2010.865142,0.25994%2012.002072,0.21525%2012.269732,-0.48227%200.44705,-1.16499%201.12643,-0.91977%201.12643,0.40658%200,1.35734%201.41084,2.08332%204.04866,2.08332%200.91325,0%202.36505,0.43546%203.22622,0.96769%200.91146,0.56331%202.19887,0.92409%203.08083,0.86337%200.8333,-0.0574%202.22734,-0.0739%203.09787,-0.0366%20l%201.58279,0.0677%20-2.04831,1.45596%20c%20-2.60121,1.84898%20-4.60869,3.71254%20-4.60869,4.2783%200,0.242109%200.73143,0.32064%201.62934,0.17493%200.89611,-0.14542%201.62932,-0.0681%201.62932,0.17185%200,1.09033%203.05664,0.337319%205.64391,-1.390391%202.5244,-1.68573%202.71469,-1.744079%202.4668,-0.75638%20-0.23056,0.918601%20-0.0491,1.115211%201.28021,1.387481%203.40891,0.69821%205.08477,0.807729%205.63089,0.367989%200.31523,-0.25382%201.22741,-0.601239%202.02707,-0.772039%201.08759,-0.23229%201.52375,-0.128551%201.73108,0.41177%200.15745,0.41029%200.83649,0.725379%201.57197,0.729429%200.71213,0.004%201.60902,0.2102%201.99308,0.458401%200.52891,0.34181%200.30309,0.46599%20-0.93104,0.51199%20-0.89613,0.0334%20-2.01255,0.0206%20-2.48092,-0.0284%20-0.46837,-0.049%20-1.62054,0.28237%20-2.56036,0.73642%20-0.93983,0.45405%20-2.18012,0.76927%20-2.7562,0.70048%20-0.57608,-0.0688%20-1.04742,0.1126%20-1.04742,0.40308%200,0.29048%20-0.55801,1.66774%20-1.24002,3.06058%20-1.34639,2.74969%20-1.2003,3.79348%200.28184,2.01373%201.05685,-1.26905%201.17801,-1.04562%200.45269,0.834789%20-1.38799,3.598391%20-1.18789,9.099511%200.44137,12.13385%200.74233,1.38253%202.1034,1.328061%203.25037,-0.130089%201.39556,-1.77416%201.68259,-4.45637%200.77068,-7.201871%20-0.96739,-2.912539%20-0.59364,-6.044559%200.76366,-6.3995%200.49247,-0.12879%201.31291,-1.150659%201.82321,-2.27082%200.51029,-1.120159%201.06166,-2.036659%201.22525,-2.036659%200.16362,0%201.09378,0.35133%202.06707,0.78074%201.57149,0.69335%201.80465,1.01456%202.08281,2.86947%200.19425,1.295349%200.11198,2.41097%20-0.2166,2.93711%20-1.2717,2.036289%20-0.0299,3.088879%201.56502,1.32654%201.19323,-1.318511%201.45348,-1.19026%202.23419,1.101019%200.58109,1.70539%200.59419,2.247961%200.0816,3.375031%20-0.33596,0.73863%20-0.9695,2.13602%20-1.40786,3.10531%20-0.43836,0.96929%20-0.69326,1.866109%20-0.56644,1.99292%200.12681,0.12681%201.25403,0.338379%202.50492,0.470139%202.48143,0.261371%202.50583,0.251091%207.52832,-3.173199%204.02592,-2.744851%204.52198,-3.340521%204.52198,-5.430091%20v%20-1.673889%20l%202.17623,-0.0531%20c%201.22529,-0.0299%202.85263,-0.44834%203.72417,-0.95761%201.27494,-0.744989%201.55646,-1.198719%201.59631,-2.572669%200.0495,-1.70594%201.10516,-3.55213%203.04838,-5.330991%200.71536,-0.654849%202.74136,-1.364929%205.86453,-2.055409%202.94751,-0.65165%204.77158,-1.2776%204.77158,-1.63742%200,-0.32038%200.54974,-0.98297%201.22165,-1.47241%201.08528,-0.79057%201.2626,-1.32755%201.58847,-4.81042%200.42388,-4.530191%200.74795,-5.58436%201.61449,-5.25184%200.34285,0.13157%201.02633,0.0236%201.51882,-0.24001%201.40432,-0.751571%202.7183,0.49659%203.36628,3.19766%200.43073,1.79551%201.00099,2.715789%202.45303,3.95868%201.86527,1.59659%201.87966,1.63281%201.02435,2.5779%20-0.47712,0.52722%20-1.66404,1.40626%20-2.6376,1.953429%20-0.97356,0.547171%20-1.77011,1.154971%20-1.77011,1.35067%200,0.558011%20-2.14572,2.73139%20-2.69662,2.73139%20-0.27227,0%20-0.6226,1.20453%20-0.77853,2.676741%20-0.15594,1.47221%20-0.36687,3.210939%20-0.46876,3.86385%20-0.18972,1.21562%200.756,2.18165%202.78011,2.8398%200.88179,0.28673%200.87708,0.305199%20-0.0889,0.34914%20-0.56097,0.0255%20-1.14942,0.25589%20-1.30766,0.511929%20-0.15824,0.256041%20-0.64392,0.465521%20-1.0793,0.465521%20-0.43537,0%20-1.02817,0.378829%20-1.31732,0.841849%20-0.28917,0.463021%20-1.34205,1.08642%20-2.33977,1.385341%20-1.82983,0.548229%20-3.87575,2.08524%20-3.87575,2.91168%200,0.575779%200.30879,0.56402%201.46704,-0.0559%200.51717,-0.27679%201.05304,-0.39051%201.19083,-0.252721%200.13779,0.13779%20-0.56098,0.619891%20-1.55281,1.07134%20-0.99184,0.45144%20-1.87023,0.858991%20-1.95198,0.905661%20-0.0817,0.0467%200.10494,0.49088%200.41486,0.98713%200.65304,1.04571%200.28544,3.69504%20-0.69962,5.0422%20-0.64091,0.876499%20-0.6837,0.873099%20-2.08893,-0.16583%20-1.77776,-1.31435%20-1.98272,-0.372661%20-0.35003,1.60825%201.56931,1.90403%201.71443,2.606069%201.00731,4.872879%20-0.34817,1.116101%20-0.64705,1.647721%20-0.66417,1.18136%20-0.0346,-0.94277%20-1.08948,-2.17797%20-1.85998,-2.17797%20-0.53336,0%20-0.73841,-1.5578%20-0.54956,-4.175199%20l%200.11651,-1.61483%20-1.01428,0.916549%20c%20-0.86022,0.77734%20-0.9746,1.252411%20-0.75307,3.12778%200.15046,1.273651%200.0731,2.21122%20-0.18239,2.21122%20-0.83955,0%20-0.44234,1.01853%200.49256,1.263011%201.07721,0.281699%201.62454,1.934649%201.2003,3.624959%20-0.25441,1.013611%20-0.13881,1.1638%200.89557,1.1638%201.80679,0%202.3535,1.827711%200.8819,2.94834%20-1.56347,1.19059%20-1.39907,1.651671%200.53424,1.49827%201.28534,-0.101982%201.59729,0.0191%201.39656,0.54224%20-0.14216,0.370465%20-0.25845,0.761165%20-0.25845,0.868245%200,0.10708%20-0.53784,0.19469%20-1.19519,0.19469%20-0.96797,0%20-1.14108,0.17042%20-0.91064,0.89649%200.18318,0.57713%200.007,1.05169%20-0.49392,1.33214%20-0.56675,0.31717%20-0.6263,0.5297%20-0.21898,0.78144%200.39751,0.24567%200.27825,0.54278%20-0.41197,1.02622%20-0.53431,0.37425%20-1.37923,1.47972%20-1.8776,2.45661%20-0.56781,1.11299%20-1.34621,1.88662%20-2.08478,2.07199%20-0.79531,0.19961%20-1.54488,1.01241%20-2.30471,2.49914%20-0.61934,1.21182%20-1.90344,2.93651%20-2.85354,3.83264%20-2.29331,2.163%20-4.44003,6.63496%20-4.10984,8.56147%200.54427,3.17564%201.83293,6.2096%203.51722,8.28081%200.97429,1.1981%201.77143,2.59199%201.77143,3.09754%200,0.50555%200.7549,2.24859%201.67754,3.87341%201.54365,2.71845%201.65794,3.17559%201.43193,5.72774%20-0.32536,3.67425%20-1.2185,4.40742%20-3.24313,2.66225%20-2.30202,-1.9843%20-3.53945,-3.37775%20-3.83974,-4.32386%20-0.15346,-0.48353%20-0.52875,-0.87914%20-0.83396,-0.87914%20-0.7983,0%20-1.92628,-1.89734%20-1.93513,-3.25503%20-0.005,-0.70901%20-0.27555,-1.16157%20-0.69672,-1.1638%20-0.51249,-0.003%20-0.65945,-0.48094%20-0.5733,-1.86571%200.13881,-2.23129%200.039,-2.39669%20-2.9187,-4.83681%20-2.63862,-2.17687%20-3.6712,-2.33013%20-6.08885,-0.90369%20l%20-1.71108,1.00957%20-0.75951,-0.95323%20c%20-1.27871,-1.60484%20-5.86772,-2.38841%20-7.88339,-1.34608%20-1.37139,0.70918%20-1.44058,0.69826%20-1.7498,-0.27603%20-0.29467,-0.92845%20-0.37062,-0.94786%20-0.89619,-0.22909%20-0.31583,0.43191%20-1.1796,0.79273%20-1.91948,0.80179%20-0.73988,0.009%20-1.85403,0.29835%20-2.47589,0.64283%20-0.67151,0.37198%20-1.85301,0.52944%20-2.90951,0.38773%20-1.43214,-0.19209%20-1.77885,-0.0906%20-1.77885,0.52098%200,0.71542%200.79757,0.9333%203.37503,0.92199%200.9459,-0.004%201.03577,0.3613%200.27576,1.12132%20-0.40817,0.40818%20-0.39435,0.71305%200.057,1.2569%200.36849,0.444%200.40698,0.718%200.10085,0.718%20-0.27228,0%20-0.62452,-0.20947%20-0.78275,-0.46551%20-0.41028,-0.66383%20-1.62913,-0.57683%20-1.63039,0.11638%20-0.002,1.00555%20-2.91308,0.79661%20-4.42139,-0.31733%20-1.95916,-1.44688%20-3.01356,-1.76942%20-3.30463,-1.01086%20-0.18914,0.49285%20-0.66886,0.53901%20-2.14816,0.20663%20-1.23749,-0.27804%20-2.75818,-0.25074%20-4.34144,0.0779%20-1.34025,0.27823%20-2.98421,0.36849%20-3.65325,0.20058%20-0.99517,-0.24977%20-1.21643,-0.14274%20-1.21643,0.58842%200,0.49156%20-0.42505,1.34997%20-0.94454,1.90759%20-1.13183,1.21485%20-3.48196,2.4939%20-3.86977,2.10607%20-0.15243,-0.15242%20-0.755071,0.16612%20-1.339211,0.70787%20-0.584129,0.54176%20-1.634769,1.49964%20-2.334749,2.12862%20-1.66655,1.49753%20-2.20888,5.26198%20-1.13006,7.84396%200.39926,0.95555%200.5795,1.71705%200.400529,1.69221%20-0.178959,-0.0248%20-1.685669,-0.53632%20-3.348229,-1.13661%20z'%20id='path13'%20sodipodi:nodetypes='ssssssssssssscsssssssssssssssssssssssssssssssssssssscssssssssssssssssssssssssssssssssssssscssssssssssssssssssssssssssssssssssssscsssssssssssssssssssssssssssssssscssssssssssssscssssssssssssss'%20/%3e%3cpath%20style='opacity:0.82;fill:%23b3b3b3;fill-opacity:1;stroke:%23757472;stroke-width:0;stroke-dasharray:none'%20d='m%2015.349804,149.12651%20c%201.009878,-0.57202%202.239741,-1.73108%202.733027,-2.57571%20l%200.896887,-1.53568%20-1.156992,0.29039%20c%20-0.81622,0.20486%20-1.239826,0.0745%20-1.438233,-0.44252%20-0.154686,-0.4031%20-0.602047,-0.73292%20-0.994138,-0.73292%20-0.392091,0%20-0.688085,-0.15711%20-0.657764,-0.34914%200.160586,-1.01704%20-0.159024,-1.58138%20-1.09083,-1.92607%20-1.452925,-0.53748%20-1.571791,-3.16483%20-0.194157,-4.29155%200.548405,-0.44852%201.171452,-0.64553%201.384552,-0.4378%200.704677,0.68691%203.103953,-0.89199%203.103953,-2.04264%200,-0.88579%20-0.196421,-1.0276%20-1.166476,-0.84216%20-0.641563,0.12264%20-1.456301,-0.0176%20-1.810533,-0.31154%20-0.889462,-0.73818%20-1.250275,-2.83368%20-0.487917,-2.83368%200.32761,0%200.899482,-0.11659%201.27083,-0.2591%200.427827,-0.16417%200.771592,0.10961%200.93836,0.74733%200.145976,0.55822%200.536025,0.91651%200.87584,0.80454%200.715205,-0.23569%201.112009,-2.21897%200.527532,-2.63669%20-0.613297,-0.43832%20-1.517343,-2.71746%20-1.202706,-3.03209%200.15356,-0.15356%200.768001,-0.27921%201.365416,-0.27921%200.597422,0%201.086218,-0.2041%201.086218,-0.45356%200,-0.24946%200.660881,-0.79532%201.46862,-1.21301%201.665799,-0.86142%204.364681,-0.63772%205.214593,0.43222%200.489839,0.61665%202.081564,1.07472%204.904071,1.41128%202.139719,0.25515%202.378345,1.25054%202.378345,9.92075%200,7.52167%200.05713,8.05765%200.858894,8.05765%200.472391,0%201.257957,0.45448%201.745704,1.00997%200.874821,0.99632%200.874223,1.00501%20-0.04423,0.64233%20-0.512072,-0.20221%20-1.826003,-0.64808%20-2.919846,-0.99083%20-1.093842,-0.34274%20-2.449731,-0.94601%20-3.013089,-1.3406%20-1.283703,-0.89915%20-3.144724,-0.93743%20-3.144724,-0.0647%200,0.35901%20-0.628455,0.87182%20-1.396564,1.13959%20-1.608772,0.56082%20-1.670325,0.45482%20-0.64474,-1.11043%201.428075,-2.17951%20-0.343685,-1.24071%20-3.126383,1.65659%20-2.492597,2.59525%20-5.732295,4.62031%20-7.401381,4.62644%20-0.384054,0.001%200.127983,-0.46544%201.137862,-1.03745%20z'%20id='path14'%20/%3e%3c/svg%3e`,$hn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Violin%201%20—%20single-bulge%20symmetric%20KDE%20silhouette%20--%3e%3cpath%20d='M98,52%20Q80,68%2076,98%20Q74,128%2082,160%20Q88,186%2098,200%20Q108,186%20114,160%20Q122,128%20120,98%20Q116,68%2098,52%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cline%20x1='98'%20y1='56'%20x2='98'%20y2='196'%20stroke='%23363636'%20stroke-width='2'%20stroke-linecap='round'%20opacity='0.55'/%3e%3c!--%20Violin%202%20—%20bimodal%20(two-hump)%20symmetric%20KDE%20silhouette%20--%3e%3cpath%20d='M180,66%20Q164,76%20162,102%20Q160,122%20174,138%20Q160,156%20160,172%20Q160,194%20180,206%20Q200,194%20200,172%20Q200,156%20186,138%20Q200,122%20198,102%20Q196,76%20180,66%20Z'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='3'%20stroke-linejoin='round'/%3e%3cline%20x1='180'%20y1='70'%20x2='180'%20y2='202'%20stroke='%23363636'%20stroke-width='2'%20stroke-linecap='round'%20opacity='0.55'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,egn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20width='256'%20height='256'%3e%3c!--%20Waterfall%20chart%20icon:%20blue%20totals,%20gray%20deltas%20--%3e%3c!--%20Start%20bar%20(total%20—%20blue)%20--%3e%3crect%20x='60'%20y='60'%20width='28'%20height='156'%20rx='2'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Connector%20line%20from%20top%20of%20start%20bar%20--%3e%3cline%20x1='88'%20y1='60'%20x2='97'%20y2='60'%20stroke='%23999'%20stroke-width='1.5'%20stroke-dasharray='4,3'/%3e%3c!--%20Delta%20bar%20(gray,%20floating%20—%20top%20aligns%20with%20start%20bar%20top)%20--%3e%3crect%20x='97'%20y='60'%20width='28'%20height='60'%20rx='2'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Connector%20line%20from%20bottom%20of%20first%20delta%20--%3e%3cline%20x1='125'%20y1='120'%20x2='134'%20y2='120'%20stroke='%23999'%20stroke-width='1.5'%20stroke-dasharray='4,3'/%3e%3c!--%20Delta%20bar%20(gray,%20floating%20down)%20--%3e%3crect%20x='134'%20y='120'%20width='28'%20height='50'%20rx='2'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Connector%20line%20--%3e%3cline%20x1='162'%20y1='170'%20x2='171'%20y2='170'%20stroke='%23999'%20stroke-width='1.5'%20stroke-dasharray='4,3'/%3e%3c!--%20Delta%20bar%20(gray)%20--%3e%3crect%20x='171'%20y='170'%20width='28'%20height='30'%20rx='2'%20fill='%23B8B8B8'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Connector%20line%20--%3e%3cline%20x1='199'%20y1='200'%20x2='208'%20y2='200'%20stroke='%23999'%20stroke-width='1.5'%20stroke-dasharray='4,3'/%3e%3c!--%20End%20bar%20(total%20—%20blue)%20--%3e%3crect%20x='208'%20y='200'%20width='28'%20height='16'%20rx='2'%20fill='%2376c6ff'%20stroke='%23363636'%20stroke-width='2'/%3e%3c!--%20Y-axis%20--%3e%3cline%20x1='48'%20y1='28'%20x2='48'%20y2='220'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c!--%20X-axis%20--%3e%3cline%20x1='44'%20y1='216'%20x2='240'%20y2='216'%20stroke='%23363636'%20stroke-width='4'%20stroke-linecap='round'/%3e%3c/svg%3e`,tgn=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20class='svg-icon'%20style='width:%201em;%20height:%201em;vertical-align:%20middle;fill:%20currentColor;overflow:%20hidden;'%20viewBox='0%200%201024%201024'%20version='1.1'%20id='svg2'%20sodipodi:docname='chart-icon-world-map.svg'%20inkscape:version='1.4.2%20(ebf0e940,%202025-05-08)'%20inkscape:export-filename='../src/assets/chart-icon-world-map.png'%20inkscape:export-xdpi='24'%20inkscape:export-ydpi='24'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs2'%20/%3e%3csodipodi:namedview%20id='namedview2'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:zoom='0.78808594'%20inkscape:cx='486.62206'%20inkscape:cy='612.87732'%20inkscape:window-width='1712'%20inkscape:window-height='925'%20inkscape:window-x='125'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg2'%20/%3e%3cpath%20d='m%20817.80254,600.94722%20c%200,-2.687%20-19.755,-28.658%20-25.074,-47.464%20-5.319,-18.807%20-15.196,-31.344%20-9.118,-34.031%206.078,-2.687%204.559,24.18%2016.716,17.015%2012.157,-7.164%2034.951,-3.582%202.279,-41.195%20l%201.52,-12.538%20c%200,0%2030.392,0%2034.951,-22.389%204.559,-22.389%20-21.275,-53.733%20-18.235,-57.315%203.039,-3.582%2016.278,3.582%2018.776,7.164%202.498,3.582%2013.895,31.344%2023.773,29.553%203.014,-0.547%203.745,-3.532%203.051,-8.024%201.492,2.259%206.606,4.129%2023.542,-2.701%2026.593,-10.725%20-4.559,-24.191%20-4.559,-24.191%20l%207.598,-14.339%20-11.359,-9.851%20-7.878,11.642%20c%200,0%20-2.038,34.926%20-7.878,36.739%200,0%20-0.004,0.026%20-0.006,0.031%20-2.514,-10.518%20-10.645,-26.963%20-16.948,-41.248%20-3.072,-6.962%204.611,2.021%209.118,-3.582%209.986,-12.416%2026.593,-18.807%20-8.358,-42.986%20-15.956,2.687%20-25.074,-21.493%20-12.157,-19.702%2012.917,1.791%2035.271,-7.221%2040.59,-6.325%205.319,0.896%203.479,18.863%203.479,18.863%200,0%2015.706,21.493%2017.476,25.075%201.77,3.582%200.76,-22.389%200.76,-22.389%200,0%20-17.476,-11.642%20-12.157,-17.015%205.319,-5.373%2013.677,-0.896%2018.995,-3.582%205.319,-2.687%200,-17.911%200,-17.911%200,0%20-24.314,-10.747%20-28.873,-17.911%20-4.559,-7.164%20-39.51,-7.164%20-56.985,-5.373%20-17.476,-8.06%20-77.5,-8.955%20-77.5,-8.955%20l%20-96.495,-19.702%20c%200,0%207.091,15.523%200,19.105%20-7.091,3.582%20-23.301,-7.164%20-26.34,0%20-3.039,7.164%20-24.314,13.135%20-27.353,15.523%20-3.039,2.388%20-11.144,13.135%20-11.144,13.135%20l%20-6.078,-9.553%20-3.546,9.553%20-10.637,8.657%20-4.562,-6.453%20-3.036,-4.294%20h%2012.157%20c%200,0%205.319,-13.433%20-17.476,-10.747%20-20.515,-8.956%20-35.711,-3.582%20-42.549,1.791%20-6.838,5.373%20-11.397,17.015%20-17.476,19.702%20-6.079,2.687%20-5.319,25.971%200,25.971%20h%2018.236%20l%206.838,-8.06%20c%200,0%209.118,-34.031%2012.917,-24.18%203.799,9.851%20-18.235,20.598%2013.677,20.598%20-9.633,14.33%20-21.275,18.807%20-21.275,18.807%20h%20-19.755%20c%200,0%20-21.275,12.538%20-25.074,15.224%20-3.799,2.687%20-18.235,-15.224%20-18.235,-15.224%200,0%204.559,23.284%204.559,34.926%200,11.642%20-18.995,15.224%20-18.995,15.224%200,0%203.039,25.075%203.799,37.613%20-9.118,8.956%20-9.118,25.075%20-9.118,25.075%20l%20-13.677,8.06%20-6.078,49.255%20c%200,0%20-9.118,15.224%200,20.598%209.118,5.373%2024.314,31.344%2024.314,31.344%200,0%2015.956,3.582%2022.794,0%206.838,-3.582%209.877,-24.18%2018.995,-5.373%209.118,18.807%209.877,2.687%209.877,2.687%200,0%2012.157,8.06%203.799,29.553%205.319,6.269%209.118,14.329%209.118,33.135%20v%2038.509%20c%200,0%2024.314,56.42%2019.755,69.853%20-4.559,13.433%2016.716,-4.478%2024.314,0%207.598,4.478%2031.152,-42.091%2028.113,-58.211%20-3.039,-16.12%2018.995,-22.389%2020.515,-30.449%201.52,-8.06%20-1.52,-32.24%20-9.877,-39.404%20-8.358,-7.164%2051.667,-58.211%2041.789,-72.539%20-9.878,-14.329%20-19.755,9.851%20-27.353,5.373%20-7.598,-4.478%20-5.319,-13.433%20-5.319,-13.433%200,0%2045.054,-3.582%2052.539,-22.389%207.485,-18.807%2015.083,-47.464%2040.157,-2.687%2025.074,44.777%2034.951,62.688%2041.029,56.42%206.078,-6.268%20-15.196,-42.986%200,-47.464%2015.196,-4.478%205.319,-20.598%2016.716,-20.598%2011.397,0%2055.466,100.302%2041.029,85.973%20-14.436,-14.329%20-20.515,-8.06%20-20.515,-8.06%200,0%2019.755,19.702%2034.951,51.046%209.877,-0.896%2031.152,0.896%2031.152,0.896%200,0%20-16.715,-7.164%20-16.715,-9.851%20z%20m%2035.598,-10.919%205.431,10.92%20c%200,-10e-4%200.734,-8.163%20-5.431,-10.92%20z'%20fill='%2335A0D6'%20id='path1'%20style='fill:%2376c6ff;fill-opacity:1;stroke:%23363636;stroke-width:3;stroke-dasharray:none;stroke-opacity:1'%20/%3e%3cpath%20d='m%20836.79754,549.00622%20c%200,0%20-13.676,14.329%20-18.235,17.911%20-4.559,3.582%205.319,28.658%2023.554,23.284%205.235,-1.542%208.803,-1.283%2011.285,-0.173%20l%20-7.486,-15.051%20c%200,-10e-4%204.558,-25.971%20-9.118,-25.971%20z%20m%2080.539,79.703%206.078,-20.598%2015.956,9.851%20c%200,0%2011.566,-8.955%20-30.308,-37.613%200,0%20-18.32,3.582%20-21.359,-5.373%20-3.039,-8.956%200,23.284%200,23.284%20l%2013.022,2.687%208.337,17.015%20c%200,0%2013.761,41.195%200,32.24%20-13.761,-8.956%20-15.281,1.791%20-13.761,-8.956%201.52,-10.747%20-6.559,-19.702%20-12.017,-14.329%20-5.458,5.373%20-33.571,19.702%20-41.169,36.718%20-7.598,17.016%20-9.878,0%20-9.878,0%20l%20-9.877,13.433%208.358,10.747%20-8.358,9.851%20c%200,0%20-13.607,23.284%20-4.904,27.762%208.703,4.478%2053.532,-8.06%2053.532,-8.06%20l%2012.297,24.18%20c%200,0%202.14,23.284%207.458,24.18%205.318,0.896%2013.845,-23.284%2018.32,-27.762%204.474,-4.478%2021.19,-9.851%2030.308,-47.464%209.117,-37.613%20-22.035,-61.793%20-22.035,-61.793%20z%20m%20-573.653,-327.771%20c%209.118,11.642%2015.956,19.702%2018.235,19.702%202.279,0%2055.466,-36.129%2055.466,-36.129%200,0%2025.256,-20.311%2019.755,-36.129%20-19.755,-30.73%20-90.417,-6.55%20-104.853,-2.072%20-14.436,4.478%209.118,-9.851%209.118,-9.851%200,0%20-37.182,-1.791%20-47.083,5.373%20-9.902,7.164%20-30.417,23.284%20-33.456,23.284%20-3.039,0%20-17.476,-8.06%20-17.476,-8.06%20l%20-51.667,10.747%20c%200,0%20-18.995,9.652%20-32.672,10.647%20-13.677,0.995%20-53.946,-9.752%20-53.946,-9.752%200,0%20-38.749997,39.404%20-43.308997,39.404%20-4.559,0%20-21.275,16.12%20-16.716,18.807%204.559,2.687%2024.314,-25.971%2046.347997,-8.06%2022.034,17.911%2031.152,24.18%2022.794,51.942%20-8.358,27.762%20-3.799,86.868%2011.397,103.884%2015.196,17.015%2040.27,12.538%2050.907,30.449%2010.637,17.911%2019.755,30.449%2034.191,34.926%2014.436,4.477%20-4.559,35.822%20-0.76,47.464%203.799,11.642%2010.637,33.135%2010.637,33.135%200,0%209.877,23.284%2025.833,34.031%2015.956,10.747%20-18.235,155.826%2044.829,163.886%20-13.677,-42.091%20-18.995,-67.166%20-8.358,-70.748%2010.637,-3.582%2015.956,-3.582%2015.956,-3.582%20l%2027.353,-68.957%20c%200,0%2018.995,-4.258%2017.476,-5.711%20-1.52,-1.453%204.559,-38.171%206.078,-40.857%201.519,-2.686%2011.397,-16.12%206.838,-23.284%20-4.559,-7.164%20-15.956,-18.807%20-34.191,-25.075%20-8.358,-6.945%20-15.196,-28.658%20-25.074,-31.344%20-9.877,-2.687%20-24.314,-21.593%20-24.314,-21.593%200,0%20-12.917,6.269%20-26.593,0%20-13.677,-6.269%20-42.549,4.577%20-42.549,4.577%200,0%203.799,-16.12%20-0.76,-25.075%20-4.559,-8.956%20-11.397,1.791%20-11.397,1.791%200,0%205.319,-17.911%202.279,-27.762%20-3.039,-9.851%20-18.311,7.922%20-18.311,7.922%200,0%20-15.121,-4.34%20-13.601,-29.415%201.52,-25.075%2054.706,-10.747%2054.706,-10.747%20l%203.039,20.598%206.838,-35.512%2025.289,-26.574%2050.692,-46.276%20c%200,0%2014.436,25.971%2020.515,15.224%20-4.112,-8.212%20-9.877,-17.911%20-3.799,-27.762%20-31.912,-49.255%205.319,-50.151%205.319,-50.151%20l%20-21.275,-26.866%20c%200,0%20-12.157,-7.164%20-8.358,-8.956%203.799,-1.791%209.118,-20.598%2022.794,-11.642%2013.676,8.956%2025.833,26.866%2025.833,26.866%200,0%20-9.115,11.641%200.003,23.283%20z'%20fill='%2335A0D6'%20id='path2'%20style='fill:%2376c6ff;fill-opacity:1;stroke:%23363636;stroke-width:3;stroke-dasharray:none;stroke-opacity:1'%20/%3e%3c/svg%3e`,ngn={"Scatter Plot":`chart-icon-scatter.svg`,Regression:`chart-icon-linear-regression.svg`,"Connected Scatter Plot":`chart-icon-connected-scatter.svg`,"Ranged Dot Plot":`chart-icon-dot-plot-horizontal.svg`,"Strip Plot":`chart-icon-strip-plot.svg`,Boxplot:`chart-icon-box-plot.svg`,"Bubble Chart":`chart-icon-bubble.svg`,"Bar Chart":`chart-icon-column.svg`,"Grouped Bar Chart":`chart-icon-column-grouped.svg`,"Stacked Bar Chart":`chart-icon-column-stacked.svg`,"Pyramid Chart":`chart-icon-pyramid.svg`,Histogram:`chart-icon-histogram.svg`,Heatmap:`chart-icon-heat-map.svg`,"Calendar Heatmap":`chart-icon-calendar.svg`,"Lollipop Chart":`chart-icon-lollipop.svg`,"Waterfall Chart":`chart-icon-waterfall.svg`,"Gantt Chart":`chart-icon-gantt.svg`,"Bullet Chart":`chart-icon-bullet.svg`,"Combo Chart":`chart-icon-combo.svg`,"Bar Table":`chart-icon-bar-table.svg`,"Density Plot":`chart-icon-density.svg`,"ECDF Plot":`chart-icon-ecdf.svg`,"Violin Plot":`chart-icon-violin.svg`,"Candlestick Chart":`chart-icon-candlestick.svg`,"Parallel Coordinates":`chart-icon-parallel.svg`,"Line Chart":`chart-icon-line.svg`,Sparkline:`chart-icon-sparkline.svg`,"Bump Chart":`chart-icon-bump.svg`,"Slope Chart":`chart-icon-slope.svg`,"Area Chart":`chart-icon-area.svg`,Streamgraph:`chart-icon-streamgraph.svg`,"Range Area Chart":`chart-icon-range-area.svg`,"Pie Chart":`chart-icon-pie.svg`,"Doughnut Chart":`chart-icon-doughnut.svg`,"Scatter Pie Chart":`chart-icon-pie.svg`,"Rose Chart":`chart-icon-rose.svg`,"Radar Chart":`chart-icon-radar.svg`,"Gauge Chart":`chart-icon-gauge.svg`,"Funnel Chart":`chart-icon-funnel.svg`,Treemap:`chart-icon-treemap.svg`,"Sunburst Chart":`chart-icon-sunburst.svg`,Tree:`chart-icon-tree.svg`,"Sankey Diagram":`chart-icon-sankey.svg`,"Network Graph":`chart-icon-network.svg`,"KPI Card":`chart-icon-kpi-card.svg`,Map:`chart-icon-world-map.svg`,Choropleth:`chart-icon-us-map.svg`},rgn=Object.assign({"./assets/chart-icons/chart-icon-area.svg":ihn,"./assets/chart-icons/chart-icon-bar-table.svg":ahn,"./assets/chart-icons/chart-icon-box-plot.svg":ohn,"./assets/chart-icons/chart-icon-bubble.svg":shn,"./assets/chart-icons/chart-icon-bullet.svg":chn,"./assets/chart-icons/chart-icon-bump.svg":lhn,"./assets/chart-icons/chart-icon-calendar.svg":uhn,"./assets/chart-icons/chart-icon-candlestick.svg":dhn,"./assets/chart-icons/chart-icon-column-grouped.svg":fhn,"./assets/chart-icons/chart-icon-column-stacked.svg":phn,"./assets/chart-icons/chart-icon-column.svg":mhn,"./assets/chart-icons/chart-icon-combo.svg":hhn,"./assets/chart-icons/chart-icon-connected-scatter.svg":ghn,"./assets/chart-icons/chart-icon-custom-area.svg":_hn,"./assets/chart-icons/chart-icon-custom-bar.svg":vhn,"./assets/chart-icons/chart-icon-custom-line.svg":yhn,"./assets/chart-icons/chart-icon-custom-point.svg":bhn,"./assets/chart-icons/chart-icon-custom-rect.svg":xhn,"./assets/chart-icons/chart-icon-density.svg":Shn,"./assets/chart-icons/chart-icon-dot-plot-horizontal.svg":Chn,"./assets/chart-icons/chart-icon-dotted-line.svg":whn,"./assets/chart-icons/chart-icon-doughnut.svg":Thn,"./assets/chart-icons/chart-icon-ecdf.svg":Ehn,"./assets/chart-icons/chart-icon-funnel.svg":Dhn,"./assets/chart-icons/chart-icon-gantt.svg":Ohn,"./assets/chart-icons/chart-icon-gauge.svg":khn,"./assets/chart-icons/chart-icon-heat-map.svg":Ahn,"./assets/chart-icons/chart-icon-histogram.svg":jhn,"./assets/chart-icons/chart-icon-kpi-card.svg":Mhn,"./assets/chart-icons/chart-icon-line.svg":Nhn,"./assets/chart-icons/chart-icon-linear-regression.svg":Phn,"./assets/chart-icons/chart-icon-lollipop.svg":Fhn,"./assets/chart-icons/chart-icon-network.svg":Ihn,"./assets/chart-icons/chart-icon-parallel.svg":Lhn,"./assets/chart-icons/chart-icon-pie.svg":Rhn,"./assets/chart-icons/chart-icon-pyramid.svg":zhn,"./assets/chart-icons/chart-icon-radar.svg":Bhn,"./assets/chart-icons/chart-icon-range-area.svg":Vhn,"./assets/chart-icons/chart-icon-rose.svg":Hhn,"./assets/chart-icons/chart-icon-sankey.svg":Uhn,"./assets/chart-icons/chart-icon-scatter.svg":Whn,"./assets/chart-icons/chart-icon-slope.svg":Ghn,"./assets/chart-icons/chart-icon-sparkline.svg":Khn,"./assets/chart-icons/chart-icon-streamgraph.svg":qhn,"./assets/chart-icons/chart-icon-strip-plot.svg":Jhn,"./assets/chart-icons/chart-icon-sunburst.svg":Yhn,"./assets/chart-icons/chart-icon-tree.svg":Xhn,"./assets/chart-icons/chart-icon-treemap.svg":Zhn,"./assets/chart-icons/chart-icon-us-map.svg":Qhn,"./assets/chart-icons/chart-icon-violin.svg":$hn,"./assets/chart-icons/chart-icon-waterfall.svg":egn,"./assets/chart-icons/chart-icon-world-map.svg":tgn});function ign(e){let t=ngn[e];if(t)return rgn[`./assets/chart-icons/${t}`]}function $9(e){return JSON.stringify(e??null)}function agn(){return ST.map(e=>e.chart).sort((e,t)=>e.localeCompare(t))}function ogn(e){if(e!=null){if(typeof e==`string`)return e;if(!Array.isArray(e))return e.field}}function sgn(e,t){let n=e.semantic_types?.[t];return n?typeof n==`string`?n:n.type??``:``}function cgn(e){let t=e.data?.values??[],n={};for(let[r,i]of Object.entries(e.chart_spec.encodings??{})){let a=ogn(i);if(!a)continue;let o=typeof i==`string`?{field:a}:{...i};if(!o.type)try{let n=t.map(e=>e[a]),i=Nle(sgn(e,a),n,r,t,a);i?.vlType&&(o.type=i.vlType)}catch{}n[r]=o}return n}function lgn(e,t,n){let r=e.chart_spec.chartProperties?.[t.key];if(r!==void 0)return r;try{return t.get(n)}catch{return}}function ugn(e){let t=CT(e.chart_spec.chartType),n=t?.channels??[],r={};for(let t of n)r[t]=ogn(e.chart_spec.encodings?.[t]);let i=[];try{i=sPe(e).filter(e=>e.applicable)}catch{i=[]}let a=cgn(e),o={encodings:a,data:e.data?.values??[],chartProperties:e.chart_spec.chartProperties},s=(t?.encodingActions??[]).filter(e=>!e.isApplicable||e.isApplicable(o)).map(t=>({key:t.key,label:t.label,control:t.control,value:lgn(e,t,a)})),c;try{c=cPe(e)}catch{c=void 0}let l,u;try{let t=lPe(e);l=t?.chartType,u=t?.arrange}catch{l=void 0,u=void 0}return{chartTypes:agn(),channels:n,bindings:r,properties:i,actions:s,pivot:c,chartType:l,arrange:u}}function dgn(e){return{...e,chart_spec:{...e.chart_spec,encodings:{...e.chart_spec.encodings??{}},chartProperties:{...e.chart_spec.chartProperties??{}}}}}function fgn(e){let t=e.chart_spec.chartProperties,n=Object.keys(t??{});if(!n.length)return e;let r={};for(let i of n){let n={...t};delete n[i];let a={...e,chart_spec:{...e.chart_spec,chartProperties:n}},o;try{o=sPe(a).find(e=>e.key===i)?.value}catch{o=void 0}(o===void 0||$9(o)!==$9(t[i]))&&(r[i]=t[i])}return{...e,chart_spec:{...e.chart_spec,chartProperties:r}}}function pgn(e,t){let n=dgn(fgn(e));return t===void 0?delete n.theme_spec:n.theme_spec=t,n}function mgn(e,t,n){let r=dgn(e);return n===void 0?delete r.chart_spec.chartProperties[t]:r.chart_spec.chartProperties[t]=n,r}var hgn=new Set([`unsupported_update`,`partially_applied_update`]);function ggn(e){let t=e.replace(/\s*\([^)]*\)\s*$/u,``).trim();return t.length<=16?t:`${t.slice(0,13).trimEnd()}...`}function _gn(e){let{label:t,options:n,selectedIndex:r,width:i,onChange:a}=e,[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(null),l=n[r];return(0,Z.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,$.jsxs)(`div`,{ref:c,className:`opt opt-discrete`,style:{"--opt-width":`${i}px`},onKeyDown:e=>{e.key===`Escape`&&o&&(e.preventDefault(),e.stopPropagation(),s(!1))},children:[(0,$.jsxs)(`button`,{type:`button`,className:`select-trigger`,"aria-haspopup":`listbox`,"aria-expanded":o,"aria-label":`${t}: ${l?.label??``}`,title:l?.label,onClick:()=>s(e=>!e),children:[(0,$.jsx)(`span`,{className:`opt-label`,title:t,children:t}),(0,$.jsx)(`span`,{className:`select-value`,children:ggn(l?.label??``)}),(0,$.jsx)(`svg`,{className:`select-chev`,width:`9`,height:`9`,viewBox:`0 0 10 10`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M2.5 4 5 6.5 7.5 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),o&&(0,$.jsx)(`ul`,{className:`select-menu select-menu-top`,role:`listbox`,"aria-label":t,children:n.map((e,t)=>{let n=t===r;return(0,$.jsx)(`li`,{role:`option`,"aria-selected":n,children:(0,$.jsx)(`button`,{type:`button`,className:n?`select-option select-option-selected`:`select-option`,onClick:()=>{a(e.value),s(!1)},children:e.label})},t)})})]})}var vgn=6,ygn=96,bgn=6,xgn=10,Sgn={continuous:92,discrete:104,binary:24,pivot:78},Cgn=[96,116,136,156,180,204];function wgn(e,t){let n=Math.min(ygn,Math.ceil(e.length*vgn))+bgn+(Sgn[t]??120)+xgn;return Cgn.find(e=>e>=n)??Cgn[Cgn.length-1]}function Tgn(e){let{label:t,spec:n,value:r,width:i,onChange:a}=e;if(n.type===`discrete`){let e=$9(r),o=n.options.findIndex(t=>$9(t.value)===e);return(0,$.jsx)(_gn,{label:t,options:n.options,selectedIndex:o<0?0:o,width:i,onChange:a})}let o=null;if(n.type===`continuous`){let e=n.step??((n.max-n.min)/100||1),t=typeof r==`number`?r:n.min,i=n.max>n.min?(t-n.min)/(n.max-n.min)*100:0,s=e=>Number(e).toLocaleString(),c=(String(e).split(`.`)[1]??``).length,l=e=>Number(e.toFixed(c)),u=e>0?e:n.max-n.min||1,d=Math.min(200,Math.max(1,Math.floor((n.max-n.min)/u))),f=1;for(let e=0;e<=d;e++){let t=l(n.min+e*u);if(t>n.max+1e-9)break;f=Math.max(f,s(t).length)}o=(0,$.jsxs)(`span`,{className:`control-inline`,children:[(0,$.jsx)(`input`,{type:`range`,min:n.min,max:n.max,step:e,value:t,style:{"--pct":`${i}%`},onChange:e=>a(Number(e.target.value))}),(0,$.jsx)(`span`,{className:`control-readout`,style:{minWidth:`${f}ch`},children:s(t)})]})}else o=(0,$.jsxs)(`span`,{className:`switch`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:!!r,onChange:e=>a(e.target.checked)}),(0,$.jsx)(`span`,{className:`switch-track`,"aria-hidden":`true`,children:(0,$.jsx)(`span`,{className:`switch-thumb`})})]});return(0,$.jsxs)(`label`,{className:`opt`,style:{"--opt-width":`${i}px`},children:[(0,$.jsx)(`span`,{className:`opt-label`,title:t,children:t}),o]})}function Egn(e){let{chartType:t,arrange:n,onChartType:r,onArrange:i}=e,[a,o]=(0,Z.useState)(!1),s=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]);let c=!!t&&t.length>1,l=!!n&&n.length>1,u=t?t.labels[t.index]:void 0,d=u?ign(u):void 0,f=l?n.labels[n.index]:``,p=e=>{if(!n)return;let t=(n.index+e+n.length)%n.length;i(t===0?void 0:n.ids[t])};return(0,$.jsxs)(`div`,{className:`transform-control`,ref:s,children:[t&&(c?(0,$.jsxs)(`button`,{type:`button`,className:`tc-type tc-type-chart`,"aria-haspopup":`listbox`,"aria-expanded":a,"aria-label":`${t.label}: ${u??``}`,title:u,onClick:()=>o(e=>!e),children:[d&&(0,$.jsx)(`img`,{className:`tc-icon`,src:d,alt:``}),(0,$.jsx)(`svg`,{className:`tc-caret`,width:`11`,height:`11`,viewBox:`0 0 12 12`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M3 4.5 L6 7.5 L9 4.5`})})]}):(0,$.jsx)(`span`,{className:`tc-type tc-type-static`,title:u,children:d&&(0,$.jsx)(`img`,{className:`tc-icon`,src:d,alt:``})})),t&&l&&(0,$.jsx)(`span`,{className:`tc-divider`}),l&&(0,$.jsx)(`div`,{className:`tc-arrange`,role:`group`,"aria-label":n.label,children:(0,$.jsxs)(`button`,{type:`button`,className:`tc-arrange-next`,"aria-label":`Next view; current: ${f}`,title:f,onClick:()=>p(1),children:[(0,$.jsx)(`span`,{className:`arrange-state`,children:f}),(0,$.jsx)(`span`,{className:`tc-arrange-arrow`,"aria-hidden":`true`,children:`›`})]})}),a&&c&&t&&(0,$.jsx)(`ul`,{className:`tc-menu`,role:`listbox`,"aria-label":t.label,children:t.labels.map((e,n)=>{let i=ign(e),a=n===t.index;return(0,$.jsxs)(`li`,{role:`option`,"aria-selected":a,className:a?`tc-opt tc-opt-selected`:`tc-opt`,onClick:()=>{r(n===0?void 0:t.ids[n]),o(!1)},children:[i&&(0,$.jsx)(`img`,{className:`tc-opt-icon`,src:i,alt:``}),(0,$.jsx)(`span`,{children:e})]},n)})})]})}function Dgn(e){let{input:t,customTheme:n,model:r,onInput:i,onReset:a,canReset:o,onCopyPng:s,copyStatus:c,copyError:l,selection:u,view:d,onView:f}=e,p=(0,Z.useRef)(null),m=(0,Z.useRef)(null),h=(0,Z.useRef)(null),g=(0,Z.useRef)(null),_=(0,Z.useRef)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(new Map),[b,x]=(0,Z.useState)(2**53-1),[S,C]=(0,Z.useState)(!1),w={idle:`Copy PNG`,copying:`Copying PNG…`,copied:`PNG copied`,downloaded:`PNG downloaded`,error:l?`Copy failed: ${l}`:`Could not copy PNG`}[c],T=[...r.properties.map(e=>({key:e.key,label:e.label,spec:e,value:e.value})),...r.actions.map(e=>({key:e.key,label:e.label,spec:e.control,value:e.value}))],E=!!(r.chartType&&r.chartType.length>1||r.arrange&&r.arrange.length>1);(0,Z.useLayoutEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=T.map(e=>y.current.get(e.key)?.getBoundingClientRect().width??0);if(t.some(e=>e===0))return;let n=[m.current,E?h.current:null,g.current].filter(e=>!!e),r=n.reduce((e,t)=>e+t.getBoundingClientRect().width,0),i=_.current?.getBoundingClientRect().width??0,a=T.length;for(let o=T.length;o>=0;--o){let s=oe+t,0)+(s?i:0)+Math.max(0,c-1)*8<=e.clientWidth){a=o;break}}x(a),a===T.length&&C(!1)};t();let n=new ResizeObserver(t);return n.observe(e),g.current&&n.observe(g.current),()=>n.disconnect()},[E,T.map(e=>`${e.key}:${e.label}:${e.spec.type}`).join(`|`)]),(0,Z.useEffect)(()=>{if(!S)return;let e=e=>{v.current&&!v.current.contains(e.target)&&C(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[S]);let D=e=>(0,$.jsx)(Tgn,{label:e.label,spec:e.spec,value:e.value,width:wgn(e.label,e.spec.type),onChange:n=>i(mgn(t,e.key,n))}),O=T.slice(Math.min(b,T.length));return(0,$.jsx)(`div`,{className:`optionsbar`,role:`toolbar`,"aria-label":`${t.chart_spec.chartType} options`,children:(0,$.jsxs)(`div`,{className:`optionsbar-grid`,ref:p,children:[(0,$.jsx)(`div`,{className:`optionsbar-pinned`,ref:m,children:(0,$.jsx)(dfn,{themeSpec:t.theme_spec,customTheme:n,onTheme:e=>i(pgn(t,e))})}),E&&(0,$.jsx)(`div`,{className:`optionsbar-pinned`,ref:h,children:(0,$.jsx)(Egn,{chartType:r.chartType,arrange:r.arrange,onChartType:e=>i(mgn(t,r.chartType.key,e)),onArrange:e=>i(mgn(t,r.arrange.key,e))})}),T.length===0?!E&&(0,$.jsx)(`span`,{className:`opt-empty`,children:`No adjustable options for this chart.`}):T.map((e,t)=>(0,$.jsx)(`div`,{ref:t=>{t?y.current.set(e.key,t):y.current.delete(e.key)},className:t=b||void 0,children:D(e)},e.key)),(0,$.jsx)(`div`,{className:O.length>0?`optionsbar-more`:`optionsbar-more optionsbar-more-measure`,ref:_,children:(0,$.jsxs)(`div`,{ref:v,children:[(0,$.jsx)(`button`,{type:`button`,className:`bar-link optionsbar-more-trigger`,"aria-label":`More options (${O.length})`,title:`More options`,"aria-haspopup":`true`,"aria-expanded":S,onClick:()=>C(e=>!e),children:(0,$.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`circle`,{cx:`3`,cy:`8`,r:`1.2`,fill:`currentColor`}),(0,$.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.2`,fill:`currentColor`}),(0,$.jsx)(`circle`,{cx:`13`,cy:`8`,r:`1.2`,fill:`currentColor`})]})}),S&&O.length>0&&(0,$.jsx)(`div`,{className:`optionsbar-more-menu`,role:`group`,"aria-label":`More chart options`,children:O.map(e=>(0,$.jsx)(`div`,{className:`optionsbar-more-control`,children:D(e)},e.key))})]})}),(0,$.jsxs)(`span`,{className:`bar-actions`,ref:g,children:[u,d&&(0,$.jsx)(k9,{onClick:()=>f(d===`chart`?`table`:`chart`),label:sfn[d],children:(0,$.jsx)(cfn,{view:d})}),(0,$.jsx)(k9,{className:`bar-reset`,onClick:a,disabled:!o,label:`Reset chart`,children:(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`path`,{d:`M4 5.5H1.5V3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,$.jsx)(`path`,{d:`M2 5.5A6 6 0 1 1 2.8 11`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})]})}),(0,$.jsx)(k9,{onClick:s,disabled:c===`copying`,label:w,children:c===`copied`||c===`downloaded`?(0,$.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,$.jsx)(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})}):(0,$.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,$.jsx)(`rect`,{x:`5.5`,y:`5.5`,width:`8`,height:`8`,rx:`1.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,$.jsx)(`path`,{d:`M3.5 10.5 A1.5 1.5 0 0 1 2.5 9.5 V3 A1.5 1.5 0 0 1 4 1.5 H10.5 A1.5 1.5 0 0 1 11.5 2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})]})})]})]})})}function Ogn({app:e,shown:t,hostContext:n}){let{charts:[{input:r,updates:i=kgn,view:a=`chart`}]}=t,[o,s]=(0,Z.useState)(r),[c,l]=(0,Z.useState)([]),[u,d]=(0,Z.useState)(`idle`),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(a);(0,Z.useEffect)(()=>h(a),[a]);let g=wT(o.chart_spec.chartType),[_,v]=(0,Z.useState)(null),[y,b]=(0,Z.useState)(!1),x=(0,Z.useRef)(null),S=(0,Z.useRef)(null),C=(0,Z.useCallback)(e=>{if(S.current?.disconnect(),S.current=null,x.current=e,!e||typeof ResizeObserver>`u`)return;let t=()=>{let t=window.getComputedStyle(e),n=e.clientWidth-parseFloat(t.paddingLeft||`0`)-parseFloat(t.paddingRight||`0`);if(!(n>0))return;let r=Math.max(0,Math.floor(n/8)*8);v(e=>e===r?e:r)};t();let n=new ResizeObserver(t);n.observe(e),S.current=n},[]);(0,Z.useEffect)(()=>()=>S.current?.disconnect(),[]);let w=n?.displayMode===`fullscreen`||n?.displayMode===`pip`;mfn(n,w),(0,Z.useEffect)(()=>s(r),[r]),(0,Z.useEffect)(()=>{if(u===`idle`||u===`copying`)return;let e=window.setTimeout(()=>d(`idle`),2500);return()=>window.clearTimeout(e)},[u]),(0,Z.useEffect)(()=>d(`idle`),[o]);let T=(0,Z.useMemo)(()=>{try{let e=Udn(o,_?{width:_}:void 0);return{spec:e,warnings:e._warnings??[],error:null}}catch(e){return{spec:null,warnings:[],error:e instanceof Error?e.message:String(e)}}},[o,_]),E=(0,Z.useMemo)(()=>ugn(o),[o]),D=typeof T.spec?.background==`string`?T.spec.background:void 0,O=(0,Z.useMemo)(()=>JSON.stringify(o.chart_spec)!==JSON.stringify(r.chart_spec)||JSON.stringify(o.theme_spec??null)!==JSON.stringify(r.theme_spec??null),[o.chart_spec,r.chart_spec,o.theme_spec,r.theme_spec]),k=(0,Z.useMemo)(()=>Hdn(o),[o]),A=afn(k,g?`table`:m),j=(0,Z.useCallback)(async()=>{d(`copying`),p(null);let t=A?document.querySelector(`.chart .flint-table`):null,n=t?Kdn(t):Wdn(o,void 0,_?{width:_}:void 0).then(e=>e.png);n.catch(()=>void 0);let r;try{if(navigator.clipboard?.write&&typeof ClipboardItem<`u`){await navigator.clipboard.write([new ClipboardItem({"image/png":n})]),d(`copied`);return}}catch(e){r=e}if(!e.getHostCapabilities()?.downloadFile){let e=r instanceof Error?r.message:`Image clipboard access is unavailable in this host`;p(e),d(`error`);return}try{let t=new Uint8Array(await(await n).arrayBuffer()),r=``;for(let e of t)r+=String.fromCharCode(e);(await e.downloadFile({contents:[{type:`resource`,resource:{uri:`file:///flint-chart.png`,mimeType:`image/png`,blob:btoa(r)}}]})).isError?(p(`The host declined the PNG download`),d(`error`)):d(`downloaded`)}catch(e){p(e instanceof Error?e.message:`PNG export failed`),d(`error`)}},[e,o,_,A]),M=Vdn(o),N=(0,Z.useRef)(null),P=(0,Z.useRef)(null),F=(0,Z.useRef)([]),I=(0,Z.useRef)([]),L=(0,Z.useMemo)(()=>i.length>0?pqe(o,`vegalite`,{updates:i}).updates:void 0,[o,i]),R=(0,Z.useRef)(new Map),z=(0,Z.useMemo)(()=>{try{return g9(r,lPe(r))}catch{return g9(r)}},[r]),B=(0,Z.useMemo)(()=>g9(o,E),[o,E]),ee=(0,Z.useCallback)(t=>{let n=Adn({state:t,agent:r,shown:o,agentView:z,shownView:B,updates:i,checks:L,warnings:F.current,drawnUpdates:I.current,gestures:R.current,table:A}),a=JSON.stringify(o.chart_spec)===JSON.stringify(r.chart_spec)?``:`\nTo keep the reader's edits in the next show, pass chart_spec: ${JSON.stringify(o.chart_spec)}.`,s=`Chart on screen, as the reader sees it now. To change it, change the spec and call show again.\n${n.text}${a}`;s!==N.current&&(N.current=s,e.updateModelContext({content:[{type:`text`,text:s}],structuredContent:n.data}).catch(e=>console.warn(`The host declined the chart context`,e)))},[e,r,o,z,B,i,L,A]);(0,Z.useEffect)(()=>{let e=P.current?.getState()??void 0;(e||g)&&ee(e)},[A,g,ee]);let V=(0,Z.useCallback)(async e=>{let t=x.current?.querySelector(`.chart-interactive > div:last-child`);t&&b(t.offsetHeight>w9.height);let n=P.current!==e;n&&(R.current.clear(),I.current=i),P.current=e;let r=await e.warnings;if(P.current!==e)return;let a=n?r:r.filter(e=>!hgn.has(e.code));F.current=[...T.warnings,...a];let o=e.getState();o&&(W(o),ee(o))},[T.warnings,ee,i]),H=(0,Z.useCallback)(e=>{e.phase===`commit`&&W(e.state),!(e.phase!==`commit`||e.source===`host`)&&(e.interactionId&&R.current.set(e.interactionId,{action:e.action,geometry:e.geometry}),ee(e.state))},[ee]),U=[...T.warnings,...c],te=T.error,[ne,W]=(0,Z.useState)(null),G=(0,Z.useMemo)(()=>{let e=o.chart_spec.encodings??{},t=Object.entries(e).sort(([e],[t])=>Number(t===`detail`)-Number(e===`detail`)||Number(t===`color`)-Number(e===`color`)),n=[...new Set(t.map(([,e])=>e).map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`))];try{return ZKe({chart:o},{fields:n}).chart}catch{return}},[o]),re=(0,Z.useMemo)(()=>{if(!ne||!G)return{chips:[],layers:[],parts:{}};let e=new Set(i.map(e=>e.id)),t={},n=[];for(let[r,i]of Object.entries(G.gestures)){let a=ne.entries?.get(r);i.hover||e.has(r)||!a||a.layer!==`retained`||a.elements.length===0||(Object.assign(t,Dmn(a.elements,i)),n.push(r))}let r=efn(Object.keys(t),o.data.values??[]);return{chips:Object.entries(t).filter(([e])=>!(e in r)).map(([e,t])=>({field:e,label:tfn(e,t,o),full:nfn(e,t,o)})),layers:n,parts:t}},[ne,G,i,o]),K=(0,Z.useMemo)(()=>{let e=G?kmn({chart:G},re.parts).get(`chart`):void 0;return e?[...i,e]:i},[G,re.parts,i]),ie=(0,Z.useCallback)(()=>{for(let e of re.layers)P.current?.clearUpdate(e)},[re.layers]);return(0,$.jsxs)(`main`,{className:w?`app app-paned`:`app`,style:{"--inset-top":`${n?.safeAreaInsets?.top??0}px`,"--inset-right":`${n?.safeAreaInsets?.right??0}px`,"--inset-bottom":`${n?.safeAreaInsets?.bottom??0}px`,"--inset-left":`${n?.safeAreaInsets?.left??0}px`},children:[(0,$.jsxs)(`div`,{className:`preview`,children:[te?(0,$.jsxs)(`div`,{className:`error`,children:[(0,$.jsx)(`strong`,{children:`Could not render chart`}),(0,$.jsx)(`pre`,{children:te})]}):(0,$.jsx)(`div`,{className:g?`chart chart-table`:A?`chart view-table`:`chart`,ref:C,style:D?{background:D}:void 0,children:g?A&&(0,$.jsx)(l9,{table:A,updates:K}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(jun,{className:`chart-interactive`,spec:k,updates:i.length>0?i:void 0,renderer:`svg`,expressionInterpreter:f9,chartId:`flint-chart-view`,width:`100%`,height:w?`100%`:y?w9.height:void 0,fit:`relayout`,style:w?void 0:{maxWidth:M,marginInline:`auto`},fallback:(0,$.jsx)(`span`,{className:`chart-pending`,children:`Rendering…`}),onWarnings:l,onRender:V,onChange:H}),A&&(0,$.jsx)(l9,{table:A,updates:K})]})}),U.length>0&&(0,$.jsx)(`ul`,{className:`warnings`,children:U.map((e,t)=>(0,$.jsxs)(`li`,{children:[(0,$.jsx)(`span`,{className:`warn-sev`,children:e.severity}),` `,e.message]},t))})]}),(0,$.jsx)(Dgn,{input:o,customTheme:typeof r.theme_spec==`object`?r.theme_spec:void 0,model:E,onInput:s,onReset:()=>s(r),canReset:O,onCopyPng:j,copyStatus:u,copyError:f,selection:(0,$.jsx)(rfn,{chips:re.chips,onClear:ie}),view:g?void 0:m,onView:h})]})}var kgn=[],Agn=6e3,jgn=`The chart cannot be redrawn here. Ask the agent to show it again.`;function Mgn(e){let t=e._meta,n=e.structuredContent;return t?.flint?.board??n?.flint?.board}var Ngn=`The assistant is revising this spec; the fixed chart follows in a new card.`;function Pgn(){let[e,t]=(0,Z.useState)(null),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(),o=(0,Z.useRef)(!1);o.current=e!==null;let s=(0,Z.useRef)(null),{app:c,error:l}=lne({appInfo:{name:`Flint`,version:`1.1.0`},capabilities:{},autoResize:!0,onAppCreated:e=>{e.onteardown=async()=>({}),e.onerror=e=>console.error(e),e.onhostcontextchanged=e=>a(t=>({...t,...e})),e.ontoolinput=e=>{s.current=e.arguments??null},e.ontoolresult=e=>{let{content:n}=e;if(e.isError){let t=e._meta?.flint?.held;r(t?Ngn:n?.find(e=>e.type===`text`)?.text??``);return}let i=Mgn(e);i&&(r(null),t(i))}}});return(0,Z.useEffect)(()=>{c&&a(c.getHostContext())},[c]),(0,Z.useEffect)(()=>{if(!c)return;let e=window.setTimeout(()=>{if(o.current)return;let e=s.current;if(!e||!c.getHostCapabilities()?.serverTools){r(e=>e??jgn);return}c.callServerTool({name:`show`,arguments:e}).then(e=>{let n=e.isError?void 0:Mgn(e);n?t(n):r(e=>e??jgn)},()=>r(e=>e??jgn))},Agn);return()=>window.clearTimeout(e)},[c]),l?(0,$.jsxs)(`div`,{className:`status`,children:[(0,$.jsx)(`strong`,{children:`App error:`}),` `,l.message]}):c?n===null?e?e.kind===`chart`?(0,$.jsx)(Ogn,{app:c,shown:e,hostContext:i}):(0,$.jsx)(rhn,{app:c,initial:e,hostContext:i}):(0,$.jsx)(`div`,{className:`status`,children:`Waiting for the chart…`}):(0,$.jsxs)(`div`,{className:`status`,children:[(0,$.jsx)(`strong`,{children:`Not drawn`}),n&&(0,$.jsx)(`div`,{className:`status-reason`,children:n})]}):(0,$.jsx)(`div`,{className:`status`,children:`Connecting…`})}(0,$s.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(Z.StrictMode,{children:(0,$.jsx)(Pgn,{})})); diff --git a/.github/extensions/flint-chart/skills/flint-chart-author/SKILL.md b/.github/extensions/flint-chart/skills/flint-chart-author/SKILL.md index abe6f955..fa6690c4 100644 --- a/.github/extensions/flint-chart/skills/flint-chart-author/SKILL.md +++ b/.github/extensions/flint-chart/skills/flint-chart-author/SKILL.md @@ -3,7 +3,12 @@ name: flint-chart-author description: "Use when: the user asks to make or render charts with flint-chart, visualize tabular data, generate a ChartAssemblyInput, validate/render through MCP, or add Flint to a JS/TS project. Author the semantic spec, transform data before Flint when needed, install/import Flint only when executable code is needed, and reserve backend-specific style tweaks for after compiling from Flint." --- -# flint-chart: authoring and using a chart spec +# flint-chart: authoring a chart spec + +You write a `ChartAssemblyInput`: the data, the `semantic_types` of its +fields, and a `chart_spec` naming the chart type and which field goes on +which channel. Flint compiles it to Vega-Lite, ECharts, Chart.js or Plotly and +decides the rest (scales, formats, layout, colours) from the semantic types. ## What you produce (and what you do NOT) @@ -16,11 +21,8 @@ or `assembleChartjs` to get a backend spec. - **DO** emit `chart_spec` (chart type, channel→field mapping, properties) and `semantic_types` (field → semantic type). -- **DO** add `interaction_spec` when the user asks for behaviour (highlight, - legend toggle, pan and zoom, brush), asks for an interactive chart, or the - session's goal is to explore the data. List presets by name; see - "Interactions", and load the `flint-interaction-author` skill for an intent, - an interactive chart with nothing named, or a combination. +- **DO** add `interaction_spec` or `updates` only for a reason (see + "Interactions and updates"). - **Reference columns by name.** How `data` itself gets bound depends on the situation — a URL, a host-side variable, or embedded rows (see "How data gets bound"). Embedding is fine for small tables; just don't @@ -30,93 +32,62 @@ or `assembleChartjs` to get a backend spec. filtering, joins, pivots, derived columns, or long/wide reshaping beyond Flint's built-in static-series fold, use a coding, notebook, SQL, or data tool first. Then author the Flint spec against the transformed table. -- **Style after Flint, only when needed.** Author structure in Flint. For a - presentation tweak Flint does not express (a reference line, annotation, or - shaded band), use the Vega-Lite escape hatch — see "Post-Flint style - customization". Never feed edited Vega-Lite JSON back to `render_chart`. - -## When the user wants more than a spec - -First decide which workflow the user is asking for: - -- **Spec authoring only:** return a `ChartAssemblyInput` or its - `semantic_types` + `chart_spec` pieces. Do not install packages or write - renderer code unless asked. -- **MCP chart output:** if Flint MCP tools are available, **default to - `validate_chart` then `show`** whenever the user asks to see a chart. - `validate_chart` checks the spec and returns a report without drawing; fix - what it asks in the spec, then call `show({ "chart": … })` once with the - whole spec, which opens an interactive, live-rendered card with a - customization panel. The server keeps nothing between calls: the spec in - the conversation is the chart. Only fall back to `render_chart` (PNG/SVG) - when the host has no App UI support or the user explicitly wants a static - image. Use `compile_chart` when the user wants backend-native JSON, and - `list_chart_types` when you need the supported chart catalog. -- **DO** pass `updates` beside the input to `validate_chart` and `show` when the user - asks the chart to open in a state: rows to stand out, a note on a mark, a - framed range. It is a list of ChartUpdate layers, state not behaviour; the - shapes are in `flint://interaction-skill` under "Update the chart". To change a - chart in a later turn, change its spec or `updates` and call `show` again: a - new card shows it, earlier cards stay as they were. The reader's edits in the - card's panel live on that card; its context gives the `chart_spec` that keeps - them, so pass it unless the user asked for something else. -- **DO** pass `view: "table"` to `show` when the user wants to see - a chart's numbers: the card opens on the table of the rows the chart draws, - and the reader can switch to the chart. When the user wants records listed and - no chart at all, use `chartType: "Table"` instead. -- **Project integration, only when the user asks for code:** add Flint to an - app, notebook, script, or agentic product, install/import the library, and - call an assembler in code. Keep the same `ChartAssemblyInput` contract, then - let the host render the backend result. - -For MCP clients, the server can run with `npx`: - -```bash -npx -y flint-chart-mcp -``` - -For JavaScript or TypeScript projects, install Flint first and add only the -renderer peer dependencies needed by the backend you will render: - -```bash -npm install flint-chart -npm install vega vega-lite vega-embed # browser Vega-Lite rendering -npm install echarts # ECharts rendering -npm install chart.js # Chart.js rendering -``` - -Then compile with the requested backend: +- **Style after Flint, only when needed** (see "Post-Flint style + customization"). Notes, shaded regions, emphasis and reference lines are + Flint `updates`, not style edits. + +## On the Flint MCP server + +- **Show it.** When the user asks to see a chart, pass the whole spec to + `show({ "chart": … })`: a live card with an editing panel. There is no + need to validate first: `show` checks the spec, and one with errors draws + nothing and returns them, so fix and call `show` again. What it notes + (warnings, update ops that will not apply) is drawn with; change nothing + now unless the user asks, and fix it the next time the spec changes. + `validate_chart` gives the same report without a card, for a host with no + card UI. +- **The lightest view that answers.** One question is one chart. An open + question ("how did X do", "what does this data say", "tell me something + interesting") gets the one chart that answers it best, or two side by side + only when it has two halves; name in your reply what else you could show, + and draw it when the user asks. One view split by a category (a panel per + region, same measure) is still one chart: put the category on `column` or + `row`. A board is for when the user asks for one (a dashboard, an overview, + KPI tiles, linked views, or several charts named in one turn): load the + `flint-board-author` skill (`get_flint_skill` with `board`). +- **Nothing is kept.** The spec in the conversation is the chart. To change + it, change the spec and call `show` again: a new card opens and earlier ones + stay. A card's context gives the `chart_spec` with the reader's panel edits; + pass it on unless the user asked for something else. +- **Numbers.** `view: "table"` on `show` opens the card on the rows the chart + draws. Records with no chart are `chartType: "Table"`. +- **Other tools.** `render_chart` (PNG/SVG) only when the host has no app UI or + the user wants a static image; `compile_chart` for backend JSON. +- **Code.** Adding Flint to an app, a notebook or a script is the + `flint-app-author` skill. -```ts -import { assembleChartjs, assembleECharts, assembleVegaLite } from 'flint-chart'; +## Data transformation before charting -const vegaLiteSpec = assembleVegaLite(input); -const echartsOption = assembleECharts(input); -const chartjsConfig = assembleChartjs(input); -``` +Flint is a chart compiler, not a data-wrangling layer. If the chart needs grouped +totals, time buckets, filters, joins, pivots, derived ratios, or a long-form +table, transform the data first with a host tool, then bind the prepared table +(see "How data gets bound"). Pick semantic types and channels for the transformed +columns, not for columns that no longer exist. -Python support is planned for a later release. Until the PyPI package is -published, use the npm package or MCP server for released workflows. +**Sanity-read the values first — don't chart blind.** Inspect the actual data +with your data tool (distinct values per category column, min/max per measure), +not just the column names, and watch for: -```ts -interface ChartAssemblyInput { - // Bound by the HOST or by you, depending on the situation (see below). - data: { values: any[] } | { url: string }; - semantic_types?: Record; // field → type ( ← you write this) - chart_spec: { // ← you write this - chartType: string; // e.g. "Scatter Plot" - title?: string; // the headline — write one - subtitle?: string; // what is measured, of whom, when, in what units - encodings: Record; // channel → { field, ... } (or array) - baseSize?: { width: number; height: number }; // target layout size, default 400×320 - canvasSize?: { width: number; height: number }; // optional hard ceiling on stretch - chartProperties?: Record; // per-chart tuning (optional) - }; - options?: Record; // global layout options (rarely needed) - field_display_names?: Record; // field → readable axis/legend title - theme_spec?: string | { extends: string; [key: string]: any }; // preset or preset override (Vega-Lite only) -} -``` +- **Embedded totals.** A category column may mix an aggregate level with its + parts (e.g. `all` alongside `cage-free`/`caged`, or a `Total` region). Charting + the total with its parts double-counts and flattens the parts — keep one or the + other on a stacked/grouped/colored channel, not both. +- **Units.** `Percentage` accepts either a fraction (0–1) or a percent (0–100): + Flint reads which from the values and formats both as `%`. Don't rescale a + column for Flint, and don't scale it twice. +- **One real entity.** If your breakdown column has a single distinct value, the + per-group chart collapses to one mark — the intended breakdown is likely a + different column. ## How data gets bound @@ -155,276 +126,64 @@ state how the host should bind data. In the worked examples below, `data` is shown as `{ values: [] }` to signal "host binds this" — focus on `chart_spec` and `semantic_types`. -## Data transformation before charting - -Flint is a chart compiler, not a data-wrangling layer. If the chart needs grouped -totals, time buckets, filters, joins, pivots, derived ratios, or a long-form -table, transform the data first with a host tool, then bind the prepared table -(see "How data gets bound"). Pick semantic types and channels for the transformed -columns, not for columns that no longer exist. - -**Sanity-read the values first — don't chart blind.** Inspect the actual data -with your data tool (distinct values per category column, min/max per measure), -not just the column names, and watch for: - -- **Embedded totals.** A category column may mix an aggregate level with its - parts (e.g. `all` alongside `cage-free`/`caged`, or a `Total` region). Charting - the total with its parts double-counts and flattens the parts — keep one or the - other on a stacked/grouped/colored channel, not both. -- **Units.** `Percentage` accepts either a fraction (0–1) or a percent (0–100): - Flint reads which from the values and formats both as `%`. Don't rescale a - column for Flint, and don't scale it twice. -- **One real entity.** If your breakdown column has a single distinct value, the - per-group chart collapses to one mark — the intended breakdown is likely a - different column. - -## Post-Flint style customization +## Choose the chart type -Stay at the Flint level for structure (data, chart type, channels, transforms, -sizing, properties) — Flint specs stay portable and regenerate safely. Drop to -backend JSON only after a valid Flint chart exists, and only for a narrow -presentation change Flint does not expose (exact axis/legend/mark styling, -titles, annotations, reference lines, layout polish). Never use it to change the -data, chart type, field mappings, or transforms — fix those upstream. - -For a Vega-Lite-specific style tweak: - -1. Author and validate the Flint `ChartAssemblyInput`. -2. Render or inspect the Flint chart first, when possible. -3. Call `compile_chart` with `backend: "vegalite"`. -4. Make the smallest necessary style/presentation edit to the returned - Vega-Lite spec. -5. Render the edited spec in the host environment with a Vega-Lite renderer. +`list_chart_types` lists every chart type with its channels and a one-line +note on what it is for. Pick the type that answers the question, then call +`list_chart_types` with that `chartType` before writing its encodings: it +returns the type's guidance (what a map's `id` accepts, which bar chart takes +a second category, a waterfall's Type column), its `chartProperties` with +values and defaults, and the interaction presets it supports. Use names +exactly as listed. Vega-Lite draws every type; the other backends draw a +subset. -This edited Vega-Lite spec is no longer a portable Flint spec. Do not send it to -`render_chart`; use `render_chart` only for Flint `ChartAssemblyInput`. - -## Write a headline - -Set `chart_spec.title` to the finding, in a sentence, and `chart_spec.subtitle` -to the reading of it — what is measured, of whom, when, in what units: +Without the tool, these are the Vega-Lite types and their channels; each +type's properties and guidance are in the chart reference, +https://microsoft.github.io/flint-chart/#/documentation/reference-vegalite: ``` -title: "A pyramid that is no longer a pyramid" -subtitle: "United States population by age and sex, 2020, millions" +"Area Chart": x, y, color, opacity, column, row +"Bar Chart": x, y, color, detail, opacity, column, row +"Bar Table": y, x, color, column, row +"Boxplot": x, y, color, opacity, column, row +"Bullet Chart": y, x, goal, color, column, row +"Bump Chart": x, y, color, detail, column, row +"Calendar Heatmap": x, color +"Candlestick Chart": x, open, high, low, close, column, row +"Choropleth": id, color, detail, text +"Connected Scatter Plot": x, y, order, color, detail, column, row +"Density Plot": x, color, column, row +"Donut Chart": size, color, column, row +"ECDF Plot": x, color, detail, column, row +"Gantt Chart": y, x, x2, color, detail, column, row +"Grouped Bar Chart": x, y, group, color, detail, column, row +"Heatmap": x, y, color, column, row +"Histogram": x, color, column, row +"KPI Card": metric, value, goal +"Line Chart": x, y, color, strokeDash, detail, opacity, column, row +"Lollipop Chart": x, y, color, column, row +"Map": longitude, latitude, color, size, shape, opacity, order, detail, strokeWidth, text +"Marginal Plot": x, y, color, size, shape, opacity +"Pie Chart": size, color, column, row +"Pyramid Chart": x, y, color +"Radar Chart": x, y, color, column, row +"Range Area Chart": x, y, y2, color, column, row +"Ranged Dot Plot": x, y, color +"Regression": x, y, size, color, column, row +"Ridgeline Plot": x, y, color +"Rose Chart": x, y, color, column, row +"Scatter Plot": x, y, color, size, shape, detail, opacity, column, row +"Slope Chart": x, y, color, detail, column, row +"Sparkline": x, y, color, detail, row, column +"Stacked Bar Chart": x, y, color, detail, column, row +"Streamgraph": x, y, color, column, row +"Strip Plot": x, y, color, size, column, row +"Table": none (`encodings: {}`) +"Violin Plot": x, y, color, row +"Waterfall Chart": x, y, color, column, row ``` -Add `chart_spec.label` only when the chart sits in a numbered sequence or -under a section name: `label: "Figure 2"`. It is drawn above the headline in -the theme's kicker style. - -`chart_spec.source` is optional. Add it only when the user names the source or -asks for a source line, or the data itself states where it comes from: -`source: "UN World Population Prospects 2024"` (or `{ text, href }` to link -it). Never invent or guess one. The theme decides how it reads ("Source:", -side, rule, credit); a chart without one draws no footer. - -`chart_spec.chrome` is the house decoration the theme draws around the chart: -header rules, tabs, wordmarks, logos, the footer rule and the house credit. It is -not the chart's own title, label or source. The theme draws it by default; leave -`chrome` out unless the user asks to drop it: `chrome: false` -drops all of it; `chrome: { logos: false }` (or `header`, `footer: false`) drops -one part. Without logos a credit keeps its words. - -`Jan`, `Cairo`, `Chrome` name their own kind; `26`, `5,300`, `0.42` do not, and -the headline is where they get named. Leave it out only where the chart is not -read on its own — a sparkline in a cell, a tile under its own caption. Nothing -breaks: with no headline to lean on, the compiler keeps the axis titles instead. - -## Visual themes (`theme_spec`) - -Use one of two forms. Prefer a preset unless the user asks for a specific -brand adjustment. - -### 1. Use a preset - -Call `list_themes` to choose an id, then place it beside `chart_spec`: - -```json -{ "chart_spec": { ... }, "theme_spec": "economist" } -``` - -| id | what it is for | -| --- | --- | -| `nyt` | Newsroom graphics: headline states the finding, values on the marks, series named at their ends. | -| `economist` | Print weekly: compact, flat headline over a deck, units repeated down the ruler. | -| `swiss` | International Typographic Style: strong grid structure, black typography, and a focused red accent. | -| `nature` | Journal figure: small panel, axis titles with units, statistics beside the fit. | -| `mckinsey` | Consulting deck: wide bands, every value printed, headline states the takeaway. | -| `datawrapper` | Embedded web chart: narrow column, plain headline and deck, rule under the footer. | -| `powerbi` | Dashboard tile: compact, legend to the right, latest point emphasised. | -| `powerbi-light` | Light dashboard tile: white canvas, fine gridlines, and bright categorical color. | -| `cartoon` | Playful illustration: warm paper, rounded type, bold outlines, and bright color. | -| `apple` | App-interface chart: light labels, trailing value axis, symbols beside color. | -| `de-stijl` | De Stijl composition: primary planes in heavy black lines, steps not slopes, title under the picture. | -| `bbc` | BBC News graphic: big bold headline, gridlines only, heavy zero rule, footer rule with the source. | -| `material` | Material Design 3 product chart: purple-led tonal palette, Roboto type, light gridlines, rounded bars. | - -### 2. Override a preset - -Keep overrides narrow and state only what the user wants to change: - -```json -{ - "theme_spec": { - "extends": "economist", - "id": "our-brand", - "ink": { - "series": { - "single": "#6b3fa0" - } - } - } -} -``` - -Common simple overrides are `ink.surface.canvas`, `ink.series.single`, -`ink.series.categorical`, `type.headline.family`, and `layout.density` -(`"compact"`, `"normal"`, or `"airy"`). If replacing -`ink.series.categorical`, also replace `categoricalExtended` so charts with -many series keep the requested brand palette. - -Do not copy an entire preset or invent theme keys. A theme controls -presentation; fields, aggregation, filtering, and sorting still belong in the -chart input. ThemeSpec applies to Vega-Lite and Plotly; ECharts, Chart.js, and Excel ignore it. - -Full reference: -https://microsoft.github.io/flint-chart/#/documentation/theme-spec - -## Interactions (`interaction_spec`) - -Add `interaction_spec` beside `chart_spec` when the user asks for behaviour, -or when the goal of the session is to explore or analyse the data. A static -image never needs it. - -```json -{ - "chart_spec": { "chartType": "Line Chart", "encodings": { "x": "date", "y": "value", "color": "series" } }, - "interaction_spec": { "interactions": [ { "type": "brush-x" } ] } -} -``` - -Every entry is `{ "type": , "options": { ... } }`, one per behaviour. -Take the presets and their options for the chart type from -`list_interaction_presets` with `chartType`; never invent one. Options nest under -`options`; `id` sits on the entry. - -Which presets answer a request, how they combine, and what the warnings mean -is the `flint-interaction-author` skill (`flint://interaction-skill` on the -MCP server). Load it for anything beyond a single named gesture: an intent -(explore, compare, analyse, find outliers), "make it interactive" with -nothing named, several presets together, behaviour on a chart that already -exists, or an update to a chart on screen. - -Full reference: -https://microsoft.github.io/flint-chart/#/documentation/interaction-spec - -## Step 1 — pick `chartType` - -Use one of the registered names **exactly**. Vega-Lite is the default and -broadest backend; the table below lists each Vega-Lite chart type, the -channels it accepts, and its tuning properties (see "Chart-level -properties"). Required channels are noted. - -| chartType | Channels | Notes / required | -|---|---|---| -| `"Scatter Plot"` | x, y, color, size, shape, detail, opacity, column, row | x + y required; `detail` carries a field (e.g. `country`) on each point without a visual channel, for tooltips and linking | -| `"Regression"` | x, y, size, color, column, row | scatter + fit line; props `regressionMethod`, `polyOrder` | -| `"Connected Scatter Plot"` | x, y, order, color, detail, column, row | x + y required; `order` = connection sequence (time/index), so the line traces a trajectory and may self-cross | -| `"Ranged Dot Plot"` | x, y, color | dumbbell of two x per category | -| `"Strip Plot"` | x, y, color, size, column, row | jittered points; props `stepWidth`, `pointSize`, `opacity` | -| `"Bar Chart"` | x, y, color, opacity, column, row | one discrete + one measure; prop `cornerRadius` | -| `"Grouped Bar Chart"` | x, y, group, column, row | `group` = the clustering category; prop `dodge` | -| `"Stacked Bar Chart"` | x, y, color, column, row | prop `stackMode` | -| `"Pyramid Chart"` | x, y, color | diverging horizontal bars | -| `"Lollipop Chart"` | x, y, color, column, row | prop `dotSize` | -| `"Waterfall Chart"` | x, y, color, column, row | `color` = Type column, values `start`/`delta`/`end` only; omit it for auto sign coloring; props `cornerRadius`, `totals` | -| `"Gantt Chart"` | y, x, x2, color, detail, column, row | x = start, x2 = end | -| `"Bullet Chart"` | y, x, goal, color, column, row | `goal` required (target) | -| `"Histogram"` | x, color, column, row | x = measure to bin; prop `binCount` | -| `"Boxplot"` | x, y, color, opacity, column, row | category + measure; props `whiskerMethod`, `showOutliers`, `dodge` | -| `"ECDF Plot"` | x, color, detail, column, row | x = measure; cumulative distribution (step line); prop `showPoints` | -| `"Heatmap"` | x, y, color, column, row | color = the measure | -| `"Calendar Heatmap"` | x, color | x = date; color = daily value (summed per day); GitHub-style week × weekday grid | -| `"Line Chart"` | x, y, color, strokeDash, detail, opacity, column, row | props `interpolate`, `showPoints` | -| `"Sparkline"` | x, y, color, detail, row, column | x + y required; small-multiple mini trend lines, one per series (series from `color` or `detail`); props `interpolate`, `baseline`, `trendWidth` | -| `"Bump Chart"` | x, y, color, detail, column, row | rank-over-time lines | -| `"Slope Chart"` | x, y, color, detail, column, row | two-period value change; straight segments + end points, one line per category | -| `"Area Chart"` | x, y, color, opacity, column, row | props `interpolate`, `opacity`, `stackMode` | -| `"Range Area Chart"` | x, y, y2, color, column, row | x + y + y2 required; translucent band from `y` (low) to `y2` (high), value axis fits the band (not zero) | -| `"Violin Plot"` | x, y, color, row | x (category) + y (measure) required; mirrored KDE density per category, prop `bandwidth`; **Vega-Lite only**; a genuine `color` subgroup splits two groups or grids 3+ groups | -| `"Streamgraph"` | x, y, color, column, row | centre-stacked areas | -| `"Density Plot"` | x, color, column, row | props `bandwidth`, `stackMode` (series stack; `layered` overlaps them), `opacity` | -| `"Ridgeline Plot"` | x, y, color | x = measure; `color` (or a discrete `y`) names the ridges, each the KDE of x on its own baseline; a measure `y` draws each series' curve instead; props `overlap`, `order`, `tailCut`, `colorBy`, `perspective` (plans unset `skew`, `tilt`, `overlap` from the ridge count so the depth takes about 40% of the plot), `skew`, `tilt`, `valueMax`, `markAt` (`true` marks the x ticks, or a list of x values; each ridge's value is dotted and labelled, joined across ridges), `opacity`, `interpolate`, `bandwidth`; named ridges share one ink unless `colorBy` asks otherwise; a numeric `color` keeps a gradient key; **Vega-Lite only** | -| `"Marginal Plot"` | x, y, color, size, shape, opacity | the plot follows the axis types (measure × measure = scatter, category × measure = strip, category × category = heatmap of counts) with each axis's distribution along it (density, histogram or boxplot on a measure axis, a bar of counts on a category axis, split by `color`; density margins layer by default); props `marginal`, `stackMode`, `bandwidth`, `binCount`, `whiskerMethod`, `showOutliers`; **Vega-Lite only** | -| `"Pie Chart"` | size, color, column, row | `size` = slice value (→ angle), `color` = category; props `innerRadius`, `sortSlices` | -| `"Rose Chart"` | x, y, color, column, row | polar bars; props `alignment`, `padAngle`, `sortSlices` | -| `"Radar Chart"` | x, y, color, column, row | props `filled`, `fillOpacity`, `strokeWidth` | -| `"Candlestick Chart"` | x, open, high, low, close, column, row | OHLC all required | -| `"Bar Table"` | y, x, color, column, row | compact bars + value labels | -| `"KPI Card"` | metric, value, goal | big-number tile; prop `behindThreshold` | -| `"Table"` | none (`encodings: {}`) | the rows as given, one column per field in row order; shape `data.values` to the rows and fields to list, name columns with `field_display_names`; numbers and dates print by `semantic_types`; receives links and `updates`, sends no selection | -| `"Map"` | longitude, latitude, color, size, opacity | bubble map; props `region`, `projection` | -| `"Choropleth"` | id, color, detail | `id` = region key (see **Maps** below); props `region` (`"world"`/`"us"`), `level` (US: `"state"`/`"county"`/`"auto"`), `projection` (world) | - -**Maps: what `id` accepts.** Flint joins the key to its own base map; you never -supply geometry or a lookup. A **world** map takes country names ("India", -"DR Congo", "United Kingdom"), ISO 3166 alpha-2 / alpha-3 codes ("IN", "IND"), -or ISO numeric codes (356), all in one column. A **US** map takes state names, -USPS codes ("CA") or FIPS codes (6), and county FIPS (6037) with -`level: "county"`. Declare the key `Country` or `State` in `semantic_types` -(or set `chartProperties.region`) whenever codes could collide: "CA", "IN", -"Georgia", or small numbers. A key that matches no region is not drawn. Map -marks carry only `id`, `color` and `detail`: to link a map with charts keyed by -a name column, encode that column as `id` (names resolve too) or put it on -`detail` (e.g. `id: "map_id", detail: "country"`), which also labels the tooltip. - -**Donut chart:** use `"Pie Chart"` with `chartProperties.innerRadius > 0`. - -**Choosing a bar chart (most common mix-up).** All three take one discrete -category on `x` (or `y`) plus one measure. They differ in how a **second** -category is shown — and each reads that second category from a **different -channel**: - -- `"Bar Chart"` — use for a single series. When multiple rows share an `x`, a - second category on `color` produces stacked segments. For side-by-side bars, - use `"Grouped Bar Chart"` with the second category on `group`. -- `"Stacked Bar Chart"` — second category on `color`, drawn as **stacked** - segments within each bar (totals matter). Tune with `stackMode` - (`stacked` / `normalize` / `layered`). -- `"Grouped Bar Chart"` — second category on the **`group`** channel, drawn as - **side-by-side (dodged)** bars within each `x` cluster (compare values - directly). Put the clustering category on `group`, *not* `color`. - -Rule of thumb: comparing parts-to-whole → Stacked; comparing values -side-by-side → Grouped (use `group`); single series → Bar. - -**Waterfall color is a special "Type" column, not a free category.** On a -`"Waterfall Chart"` the `color` channel is reserved for a *type* field whose -values are literally `start`, `delta`, and `end` — it drives which bars anchor -to zero, not an arbitrary grouping. Do **not** bind `color` to an -`Increase`/`Decrease` (or up/down, gain/loss) category: the up/down direction is -already derived from the **sign** of the `y` value and colored automatically -(green up / red down). For the common case, **omit `color` entirely** and let -Flint infer the start/delta/end and per-bar sign coloring. To force which bars -are anchored totals, use the `totals` property (`first`/`last`/`both`), not a -color field. Only bind `color` when you genuinely have a `start`/`delta`/`end` -type column. - -**Backend coverage.** Vega-Lite supports all of the above. Other backends -support a subset (verify if targeting a non-VL backend): - -- **ECharts** adds: `"Gauge"`, - `"Funnel"`, `"Treemap"`, `"Sunburst"`, `"Sankey"`, - `"Parallel Coordinates"`, `"Graph"`, `"Tree"`. -- **Chart.js** supports: Scatter, Bubble, Bar, Grouped Bar, Stacked Bar, - Lollipop, Bump, Combo, Line, Area, Range Area, Pie, Doughnut, Histogram, - Radar, Rose, Slope, Connected Scatter. - -You do not need to call the library or inspect its source to author the -input — pick from this table. - -## Step 2 — map fields to channels +## Map fields to channels Each channel maps to an **encoding object** `{ field, ... }` (or a bare string shorthand, expanded to `{ field: "" }`): @@ -495,9 +254,9 @@ Arquero/`Array.map`/SQL, or a data/MCP tool — and pass the result as `data.values`. If you have no way to transform, surface the gap to the developer rather than inventing a transform property that does not exist. -## Step 3 — annotate with semantic types +## Semantic types -**This is the most important step.** Semantic types drive all downstream +**This matters most.** Semantic types drive all downstream decisions — formatting, zero baseline, color scheme, scale direction, and more. Pick the most specific type for each field. Full registered set: @@ -506,7 +265,8 @@ more. Pick the most specific type for each field. Full registered set: | Temporal (point) | `DateTime`, `Date`, `Time`, `Timestamp` | | Temporal (granule) | `Year`, `Quarter`, `Month`, `Week`, `Day`, `Hour`, `YearMonth`, `YearQuarter`, `YearWeek`, `Decade` | | Temporal (span) | `Duration` | -| Measure (amount) | `Amount`, `Price`, `Quantity`, `Count`, `Number` | +| Measure (amount) | `Amount`, `Price`, `Quantity`, `Count` | +| Measure (generic) | `Number` — a measure whose values should not be added up (or whose additivity is unknown); use `Count`, `Amount`, `Quantity` or `Profit` for totals | | Measure (proportion) | `Percentage` | | Measure (signed/diverging) | `Profit`, `PercentageChange`, `Sentiment`, `Correlation` | | Measure (physical) | `Temperature` | @@ -527,7 +287,8 @@ What choosing well gets you (automatically): - `Date` / `DateTime` → temporal axis with auto-granularity formatting - `Percentage` → percent formatting, 0–100 domain awareness -If you don't know, use `Quantity` for numbers, `Category` for strings, +If you don't know, use `Quantity` for numbers that add up to a total and +`Number` for ones that don't, `Category` for strings, `Date`/`DateTime` for date-shaped values. Do **not** invent type names. ### Saying more than the type name @@ -559,9 +320,19 @@ understates what you know: - `intrinsicDomain` — the field's own bounds, for bounded scales only: `[1, 5]` for a five-star rating, `[0, 100]` for a percentage score. Not for open-ended measures. +- `percentScale` — `"fraction"` or `"percent"`: how a `Percentage` or + `PercentageChange` field is stored (0.45 or 45 for 45%). Set it when you know; + otherwise Flint guesses from the values, which misreads fractions mostly past + 1 (growth of 2.4 meaning 240%). - `divergingMidpoint` — where the middle colour of a diverging scale sits. Set it if you can tell what the reader is comparing against; leave it out if you can't. +- `divergingNeutral` — for a colour stepped into classes, how far either side + of the midpoint still reads as neither side: `0.1` makes correlations within + ±0.1 one neutral class; `false` makes the midpoint a break, so a small gain + never looks like a small loss. Leave it out and the type decides + (`Correlation`, `Sentiment`: a neutral class; `Profit`, `PercentageChange`: + a break). - `sortOrder` — the order the categories should appear in, when the order in the data is not the one you want and it isn't alphabetical either: `["Low", "Medium", "High"]`. For a handful of categories, not a long list. @@ -576,10 +347,42 @@ understates what you know: `"lower-is-better"` for costs, errors, churn or delays, so their highs, not their lows, take the warm end, under any theme. -## Step 4 — write the spec +## Write a headline + +Set `chart_spec.title` to the finding, in a sentence, and `chart_spec.subtitle` +to the reading of it — what is measured, of whom, when, in what units: + +``` +title: "A pyramid that is no longer a pyramid" +subtitle: "United States population by age and sex, 2020, millions" +``` + +Add `chart_spec.label` only when the chart sits in a numbered sequence or +under a section name: `label: "Figure 2"`. It is drawn above the headline in +the theme's kicker style. + +`chart_spec.source` is optional. Add it only when the user names the source or +asks for a source line, or the data itself states where it comes from: +`source: "UN World Population Prospects 2024"` (or `{ text, href }` to link +it). Never invent or guess one. The theme decides how it reads ("Source:", +side, rule, credit); a chart without one draws no footer. -Put the three steps into one `ChartAssemblyInput`, with the data bound as in -"How data gets bound" and a headline as in "Write a headline": +`chart_spec.chrome` is the house decoration the theme draws around the chart: +header rules, tabs, wordmarks, logos, the footer rule and the house credit. It is +not the chart's own title, label or source. The theme draws it by default; leave +`chrome` out unless the user asks to drop it: `chrome: false` +drops all of it; `chrome: { logos: false }` (or `header`, `footer: false`) drops +one part. Without logos a credit keeps its words. + +`Jan`, `Cairo`, `Chrome` name their own kind; `26`, `5,300`, `0.42` do not, and +the headline is where they get named. Leave it out only where the chart is not +read on its own — a sparkline in a cell, a tile under its own caption. Nothing +breaks: with no headline to lean on, the compiler keeps the axis titles instead. + +## Write the spec + +One `ChartAssemblyInput`, with the data bound as in "How data gets bound" and +a headline as in "Write a headline": ```json { @@ -590,89 +393,66 @@ Put the three steps into one `ChartAssemblyInput`, with the data bound as in "title": "Europe climbed every month after the April dip", "subtitle": "Revenue by region, $m", "encodings": { "x": { "field": "month" }, "y": { "field": "revenue" }, "color": { "field": "region" } } - }, - "theme_spec": "economist" + } +} +``` + +The full shape: + +```ts +interface ChartAssemblyInput { + // Bound by the HOST or by you, as in "How data gets bound". + data: { values: any[] } | { url: string }; + semantic_types?: Record; // field → type ( ← you write this) + chart_spec: { // ← you write this + chartType: string; // e.g. "Scatter Plot" + title?: string; // the headline — write one + subtitle?: string; // what is measured, of whom, when, in what units + label?: string; // a figure number or kicker, above the headline + source?: string | { text: string; href?: string }; // only when known; never invented + chrome?: false | { header?: false; footer?: false; logos?: false }; // drop the house's decoration + encodings: Record; // channel → { field, ... } (or array) + baseSize?: { width: number; height: number }; // target layout size, default 400×320 + canvasSize?: { width: number; height: number }; // optional hard ceiling on stretch + chartProperties?: Record; // per-chart tuning (optional) + }; + options?: Record; // global layout options (rarely needed) + field_display_names?: Record; // field → readable axis/legend title + theme_spec?: string | { extends: string; [key: string]: any }; // preset or preset override (Vega-Lite, Plotly) + interaction_spec?: { interactions: { type: string; id?: string; options?: Record }[] }; // behaviour (interaction skill) + updates?: { id: string; ops: any[] }[]; // the agent's marks on the chart (interaction skill) } ``` -Add `theme_spec`, `chartProperties`, `interaction_spec` or `updates` only when -the request asks for them. With the MCP tools, check it with `validate_chart`, -fix what the report asks in the spec, then pass the whole spec to `show` as -`chart`. Without them, run the "Validation checklist". - -## Chart-level properties (`chartProperties`) - -`chartProperties` is an optional per-chart tuning map. Set a property only -when the user asks for that behavior — defaults are sensible. These are -**design choices**, not styling overrides (colors/fonts/ticks are still -derived). Values are clamped to the ranges shown. - -| Chart type | Property | Type / range (default) | Effect | -|---|---|---|---| -| Bar Chart | `cornerRadius` | 0–15 (0) | Round bar corners (px) | -| Area / Stacked Bar | `stackMode` | `stacked` \| `normalize` \| `center` \| `layered` (unset) | Stacking behavior; `normalize` = 100%, `center` = streamgraph | -| Density Plot | `stackMode` | `normalize` \| `layered` (unset = stacked) | `layered` overlaps the series, translucent | -| Density Plot | `opacity` | 0.1–1 (0.7) | Layered series opacity | -| Marginal Plot | `stackMode` | `stacked` (unset = layered) | Stack the density margins instead of layering them | -| Grouped Bar / Boxplot | `dodge` | `auto` \| `local` \| `global` (`auto`) | `local` compacts sparse groups per category; `global` preserves aligned group lanes; leave `auto` unless the user requests one | -| Line / Area / Sparkline | `interpolate` | `linear` \| `monotone` \| `step` \| `step-before` \| `step-after` \| `basis` \| `cardinal` \| `catmull-rom` (`linear`) | Curve shape | -| Line / ECDF Plot | `showPoints` | boolean (false) | Draw point markers on the line | -| Sparkline | `baseline` | `mean` \| `zero` \| `median` \| `none` (`mean`) | Reference line per spark row | -| Sparkline | `trendWidth` | 80–600 (240) | Mini line-plot width (px) | -| Boxplot | `whiskerMethod` | `iqr` \| `minmax` (`iqr`) | Whisker rule (Tukey 1.5×IQR vs min–max) | -| Boxplot | `showOutliers` | boolean (true) | Show outlier points (Tukey only) | -| Area | `opacity` | 0.1–1 (0.7) | Fill opacity | -| Scatter | `opacity` | 0.1–1 (1) | Point opacity | -| Strip Plot | `stepWidth` | 10–100 (20) | Jitter spread | -| Strip Plot | `pointSize` | 0–150 (0=auto) | Point size | -| Strip Plot | `opacity` | 0–1 (0=auto) | Point opacity | -| Histogram | `binCount` | 5–50 (10) | Number of bins | -| Density Plot / Ridgeline / Marginal Plot | `bandwidth` | 0.05–2 (0=auto) | Kernel bandwidth | -| Ridgeline | `overlap` | 0.5–4 (1.8) | How many baselines up the tallest ridge reaches | -| Ridgeline | `order` | `mean`, `reverse` (unset = as given; a quantitative series lowest at the front) | Highest mean on top, or reversed | -| Ridgeline | `tailCut` | 0–0.2 (0) | Trim each ridge to where its density is at least this share of its peak | -| Ridgeline | `colorBy` | `series`, `x` (unset = one colour) | Named ridges share one ink by default; `series` colours each ridge, `x` fills each with a ramp along x | -| Ridgeline | `perspective` | boolean (false) | Stand the ridges on a floor seen in perspective: `skew`, `tilt`, `overlap` left unset are planned so the depth takes about 40% of the plot's width and more of its height as ridges are added; the depth names, edge and value ticks give way (along the axis, then level, then every n-th) before they touch | -| Ridgeline | `skew` | 0–0.4 (0) | Perspective: shift the back ridges left by this share of the x range | -| Ridgeline | `tilt` | 0–6 (0) | Perspective: the x axis rises this many baselines across its range, labels following its edge | -| Ridgeline | `opacity` | 0.1–1 (0.5) | Ridge opacity, as the Range Area Chart; solid in perspective unless set | -| Ridgeline | `valueMax` | number (0 = tallest peak) | Perspective: the value the full ridge height stands for, read on the back-left value axis | -| Ridgeline | `markAt` | boolean \| number[] | Mark and label every ridge's value at the x ticks inside the range (`true`) or at these x; a dashed line joins the marks at one x across the ridges | -| Marginal Plot | `marginal` | `density` \| `histogram` \| `boxplot` (`density`) | What each margin draws along a measure axis; a category axis gets a bar of counts | -| Pie Chart | `innerRadius` | 0–100 (0) | Donut hole size (>0 → donut) | -| Pie / Rose | `sortSlices` | `none` \| `descending` \| `ascending` (`none`) | Order wedges and their legend by slice value | -| Rose Chart | `alignment` | `left` \| `center` (`left`) | Wedge alignment | -| Rose Chart | `padAngle` | 0–0.1 (0) | Gap between slices | -| Lollipop | `dotSize` | 20–300 (80) | Circle size (px) | -| Waterfall | `cornerRadius` | 0–8 (0) | Round bar corners | -| Waterfall | `totals` | `auto` \| `none` \| `first` \| `last` \| `both` (`auto`) | Which bars anchor to zero as totals (only when no Type column) | -| Waterfall | `showTextLabels` | boolean (false) | Legacy spelling of `showValueLabels`; still accepted | -| Bar / Grouped Bar / Stacked Bar / Lollipop / Pyramid / Pie / Donut / Heatmap / Waterfall | `showValueLabels` | boolean | Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks. | -| Regression | `regressionMethod` | `linear` \| `log` \| `exp` \| `pow` \| `quad` \| `poly` (`linear`) | Fit method | -| Regression | `polyOrder` | 1–5 (3) | Polynomial order (when `poly`) | -| Radar | `filled` | boolean (true) | Fill the polygon | -| Radar | `fillOpacity` | 0–0.5 (0.15) | Polygon fill opacity | -| Radar | `strokeWidth` | 0.5–4 (1.5) | Line width | -| KPI Card | `behindThreshold` | 0–1 (0.5) | Value/goal ratio cutoff for color | -| Map | `region` | `us` \| `world` \| `auto` (`auto`) | Geographic scope | -| Map | `projection` | `mercator` \| `equalEarth` \| `orthographic` \| `stereographic` \| `conic` \| `mollweide` | Map projection | - -**Cross-cutting properties** (apply to position/faceted charts when -relevant; set only to force non-default behavior): - -- `independentYAxis` (boolean) — faceted charts: give each panel its own - y-scale. -- `logScale_x` / `logScale_y` (boolean) — force a logarithmic axis. -- `includeZero_x` / `includeZero_y` (boolean) — force the axis to include 0. -- `xAxisType` / `yAxisType` (`temporal` | `nominal`) — force a temporal - field to render as discrete bands (or vice-versa). -- `labelOverflow` (list of steps) — the path x category names that do not - fit their band take. Leave it out: names wrap, then stand upright (trimmed - if need be), every name printed; a run of times, dates, years or ranks - wraps, then prints only round values (16:45, 17:00) flat. Set it only when - the user asks, e.g. `["wrap", "rotate90"]` to label every year, or - `["wrap", "rotate45", "rotate90"]` for 45° labels. Steps: `wrap`, `skip` - (sequences only), `rotate45`, `rotate90`. +Set `chartProperties` only when the user asks for that behaviour; defaults +are sensible. Global layout `options` are rarely needed. + +## Interactions and updates + +A mounted chart already shows a tooltip and lets a legend click dim a group. +Add more only for a reason: + +- `interaction_spec` (behaviour): the user asks for a gesture or describes + what the chart should do, the chart is linked to others on a board, or the + data has more detail than the chart can show at its size. +- `updates` (marks the agent leaves: a note, emphasis, a shaded range, a + reference line): the user asks for marks on the chart, asks about a chart + on screen, or asks a concrete question the chart can point at lightly. + +Otherwise the chart stays clean and your reply carries the answer. Both are +the `flint-interaction-author` skill (`get_flint_skill` with `interaction`). + +## Visual themes (`theme_spec`) + +Add `theme_spec` only when the user names a look, a house or a brand; without +one the chart draws in the host's style. Pick a preset id from `list_themes` +(`list_themes` with an `id` gives that house's authoring advice) and place it +beside `chart_spec`: `"theme_spec": "economist"`. For a brand adjustment, +extend a preset with only what changes: +`{ "extends": "economist", "id": "our-brand", "ink": { "series": { "single": "#6b3fa0" } } }`. +Do not copy a whole preset or invent theme keys; a new or substantially +customised theme is the `flint-theme-author` skill. ThemeSpec applies to +Vega-Lite and Plotly. ## Parameter overrides — when to reach for them @@ -687,19 +467,45 @@ default: - **Override an inferred type:** `encodings.x = { field: "year", type: "ordinal" }` (e.g. treat a year as discrete bands). - **Use readable field titles:** `field_display_names = { percentageOfCountries: "Percentage of countries" }`. Keep encodings bound to the real column name; Flint uses the display name for axis titles and legend headers. -- **Resize the chart:** Flint sizes from two numbers — `baseSize` (the *target* +- **Resize the chart:** set `baseSize` to suit where the chart is shown when + you know it (a wide panel or page, a narrow side bar, a size the user asked + for); otherwise leave it out and the MCP card starts at 300×300. The card + lets a dense chart grow up to 1.5× and always fits it to the host's width. + Flint sizes from two numbers — `baseSize` (the *target* it aims for, default 400×320) and `canvasSize` (a *hard ceiling* it may never exceed). With dense data the chart stretches from base toward the ceiling. - Want a comfortable size that may grow for dense data → set `chart_spec.baseSize = { width, height }`. - - Want a fixed slot it must fit inside → set `chart_spec.canvasSize = { width, height }` alone; the chart fills it and shrinks to fit, never overflowing. *What you ask for is what you get.* + - Want a fixed slot it must fit inside → set `chart_spec.canvasSize = { width, height }` alone; the chart fills it and shrinks to fit (a host narrower than the slot lays the chart out again for the room it has). - Both → aims for `baseSize`, grows toward `canvasSize`, never beyond. - **Force log / zero baseline:** the `logScale_*` / `includeZero_*` chart - properties above. + properties (`list_chart_types` with a `chartType` lists them). Global layout tuning lives in the top-level `options` object (e.g. `addTooltips`, band padding, facet sizing). It is rarely needed for authoring — omit it unless asked. +## Post-Flint style customization + +Stay at the Flint level for structure (data, chart type, channels, transforms, +sizing, properties) — Flint specs stay portable and regenerate safely. Drop to +backend JSON only after a valid Flint chart exists, and only for a narrow +presentation change Flint does not expose (exact axis/legend/mark styling, +layout polish). Titles are `chart_spec.title`; notes, regions and reference +lines are `updates`. Never use it to change the +data, chart type, field mappings, or transforms — fix those upstream. + +For a Vega-Lite-specific style tweak: + +1. Author and validate the Flint `ChartAssemblyInput`. +2. Render or inspect the Flint chart first, when possible. +3. Call `compile_chart` with `backend: "vegalite"`. +4. Make the smallest necessary style/presentation edit to the returned + Vega-Lite spec. +5. Render the edited spec in the host environment with a Vega-Lite renderer. + +This edited Vega-Lite spec is no longer a portable Flint spec. Do not send it to +`render_chart`; use `render_chart` only for Flint `ChartAssemblyInput`. + ## Worked examples In each example `data` is a placeholder — the host binds real rows or a @@ -723,8 +529,7 @@ User: "Plot car weight vs fuel economy, colored by origin." "x": { "field": "weight" }, "y": { "field": "mpg" }, "color": { "field": "origin" } - }, - "baseSize": { "width": 400, "height": 300 } + } } } ``` @@ -775,12 +580,13 @@ User: "Line chart of monthly sales and profit." } ``` -### Donut chart (Pie + innerRadius), value on `size` +### Donut chart, value on `size` User: "Show market share by vendor as a donut." -Pie/donut maps the slice value to `size` (rendered as angle) and the +Pie and Donut map the slice value to `size` (rendered as angle) and the category to `color`. Data is already long (one row per vendor). +`innerRadius` sizes the hole (a Pie with `innerRadius` is a donut too). ```json { @@ -790,7 +596,7 @@ category to `color`. Data is already long (one row per vendor). "share": "Percentage" }, "chart_spec": { - "chartType": "Pie Chart", + "chartType": "Donut Chart", "encodings": { "size": { "field": "share" }, "color": { "field": "vendor" } @@ -843,8 +649,8 @@ User: "Show each rep's sales against their quota." `color` encoding's `scheme`, `reverse`, `mid`, `domain`, `bins` and `colors`. - **Don't invent semantic type names.** If none fit, use the family default (`Quantity`, `Category`, `Date`). -- **Don't call the library to discover channels/types** — this document is - the authoring reference. +- **Don't read the library's source** to find channels or properties: + `list_chart_types` lists them. ## Validation checklist @@ -855,7 +661,7 @@ Before returning, verify: 3. Every encoded field has an entry in `semantic_types` (specific type). 4. Required channels for the chart type are present (e.g. Bullet→`goal`, Candlestick→`open/high/low/close`, Pie→`size`+`color`). -5. Any `chartProperties` keys are valid for that chart type and in range. +5. Any `chartProperties` keys are ones `list_chart_types` lists for the type. 6. You did **not** inline large data or hand-tune derived styling. 7. The data carries no embedded total/subtotal level (e.g. an `all` / `total` row) mixed with its components on a stacked, grouped, or colored channel. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 355cf92f..31156c48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: fail-fast: false matrix: node: [20, 22] + env: + # The package's type declarations outgrow Node's default heap. + NODE_OPTIONS: --max-old-space-size=8192 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -40,6 +43,9 @@ jobs: cache: npm - run: npm ci - run: npm run build + env: + # The package's type declarations outgrow Node's default heap. + NODE_OPTIONS: --max-old-space-size=8192 - run: npm run site:build env: # The site bundle outgrows Node's default ~4 GB heap; the runner has 16 GB. diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 02ad62ed..786139f0 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -20,6 +20,9 @@ jobs: if: >- github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[deploy]') + env: + # The package's type declarations outgrow Node's default heap. + NODE_OPTIONS: --max-old-space-size=8192 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index fa5b1f8e..95b29c6a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -25,6 +25,9 @@ jobs: cache: npm - run: npm ci - run: npm run build + env: + # The package's type declarations outgrow Node's default heap. + NODE_OPTIONS: --max-old-space-size=8192 - run: npm run site:build env: # The site bundle outgrows Node's default ~4 GB heap; the runner has 16 GB. @@ -33,6 +36,9 @@ jobs: run: | mkdir -p _site cp -R site/dist/* _site/ + - name: Publish map boundaries + # Compiled maps name these URLs: a published file must never change or disappear. + run: node scripts/publish-site-geo.mjs _site - uses: actions/upload-pages-artifact@v3 with: path: _site diff --git a/.gitignore b/.gitignore index 2be3d2f7..a2312821 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,9 @@ df-reference/ docs/HANDOFF.md docs/flint-spinout-plan.md +# Local-only Copilot instruction files +.github/instructions/ + # Local-only maintainer runbooks maintainer-notes/ @@ -87,10 +90,27 @@ design-docs/ # not published (not polished for a public audience). loops/ +# Local-only output, promo and talk material +/out/ +/promo/ +/promo-en/ +/talk/ + # Generated eval-results data for the flint-py results viewer (8.5MB+, contains # run-specific paths/tracebacks). Regenerate locally via tools/build_results_page.py. packages/flint-py/tools/viewer/results.js +# Benchmark outputs: each run is one machine's record, regenerated by its script +# (npm run benchmark:render, scripts/bench-overflow-order/run.sh, packages/flint-py/tools/benchmark_*.py). +/artifacts/ +scripts/bench-overflow-order/results/ +packages/flint-py/tools/benchmark-results/ +packages/flint-py/tools/*_results.json + +# Eval run exports for the dev-only Eval page (#/playground/eval); regenerate with the export +# scripts in experiments/interaction and experiments/mcp-app. +site/public/eval/ + # Theme audit renders and bundled audit scripts audit-out/ scripts/.*.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index dd20223e..328ac999 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,518 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2026-11-15 + +Released together for `flint-chart`, `flint-chart-mcp`, and the Copilot Canvas plugin. + +### Added + +- Maps draw the boundaries `chartProperties.boundaries` names. `"world-bank"`, the default world + map, is World Bank Official Boundaries (CC BY 4.0): areas of non-determined legal status are + regions of their own, the borders they share are dotted, and the map credits the World Bank at + its foot, with its disclaimer on hover. `"natural-earth"` draws Natural Earth's de facto borders. + A chart can instead give a file of its own, by URL or inline: + `{ url | values, feature, ids, key, disputed, attribution }`. `ids` says what the file's feature + ids are (`iso-numeric`, `iso3`, `iso2`, `fips` or `as-is`), and the rows are read into that form, + so country names and codes still join a file keyed by ISO alpha-3. A file of country codes is + framed and drawn as the world map is; one keyed by FIPS or by its own keys is fitted to its + shapes. A name Flint does not ship, or a malformed file, draws the default with a warning. +- The named boundaries are published at `https://microsoft.github.io/flint-chart/geo/v1/`, a + version whose files never change once deployed, so a compiled spec draws them wherever it is + rendered. Flint's renderers load the copies bundled in the package on a map's first draw and + fetch nothing; `withBundledBoundaries` gives a Vega view of a host's own the same loader, and + `inlineBoundaries` (new `flint-chart/geo` entry) writes them into a compiled spec for a renderer + with no network. Sources and licences are in `src/geo/NOTICE.md`. +- A map frames its data (`chartProperties.fit`: `auto`, `data`, `continent`, `whole`): the + country, region or continent the rows cover, drawn in a projection centred on it, Antarctica + only where the data names it. The plot fills the canvas once the title and keys have their room. + A globe (`projection: "orthographic"`) floats with its sea and rim and hides its far side; a + world map sharpens from the coarse to the medium boundaries as it is zoomed; a flat map can be + dragged half its plot past its edges. +- Choropleth classes (`classes`: `auto`, `quantile`, `equal`, `jenks`, `continuous`; `classCount` + 3–9), map styles (`mapStyle`: `auto` from the theme, `light`, `muted`, `atlas`, `dark`, + `minimal`), `graticule` and `borderWidth`. +- A `Map` with an `order` encoding joins its points into routes: one per `detail` value, else per + value of a categorical `color`, which the route takes. A route of stops bows each leg to the left + of travel (so a leg out and the leg back part ways) and puts an arrowhead at its end, short of the + stop's dot; a track of more than 24 legs follows great circles with one head at its end. + `chartProperties.arrows` (default `true`) turns the heads off and `curve` (`auto`, `arc`, + `great-circle`, `straight`) chooses the legs. The lines are geoshapes the projection draws, cut at + the antimeridian and hidden past a globe's horizon, over a casing in the ground's light; each + head reads its heading from the live projection inside the spec, so it turns with a pan, zoom or + globe drag in any Vega renderer. Plotly draws the same routes, its heads at mid-leg. +- A `Map`'s `strokeWidth` channel sets each leg's width, from the row it leaves (zero-based, 1 to 8 px, + with a line-width key), as Data Formulator draws flows; `size` stays the dots' area on a route map as + on any point map, so one map can widen its legs by one measure and size its stops by another. Each arrowhead is sized to its line and joined to it — the line + ends square inside the head — and set on its line: its tip at the stop and the middle of its base + on the line a head's length back, however sharply the line turns there. A leg too short on screen + for its head shrinks it to fit, and below 60% of its size keeps its line alone. Both are worked out + through the live projection (the head's on its own data, its tail of points projected once), so + they follow a pan or zoom. A route is + drawn as its arrows alone: its stops are not drawn, but still carry the tooltips, the hover and + notes on a stop, and the colour key. A route without a series colour takes the theme's mark colour + (a neutral ink beside points coloured by another field). Lines are square-ended and mitred, and a + hairline halo — white on a light map, the ground on a dark one, as Data Formulator draws it — runs + round the line and its head alike. Route + expressions use only functions a CSP-safe Vega (`vega-interpreter`) provides. +- A route's legs are targets, as a line chart's segments are: each is keyed to the row it leaves + from, so hover, emphasis and hiding reach it with its stop, and `annotate-text` with + `visual: { kind: 'path' }` notes the leg, the caption seated on its curve and joined to it by its + leader. The leg is not drawn again over itself, which would cover the stops and heads it meets. + Notes on stops and `annotate-enclosure` round groups of stops work as on any chart. +- On a map, `set-overlay` and `annotate-region` are placed by longitude and latitude through the + map's projection, following a pan, a zoom or a turning globe: an overlay's `longitude` and + `latitude` (with `longitude2` and `latitude2` for a rule or a rect) place points, text, lines along + great circles and boxes; a region's `longitude: [west, east]` and `latitude: [south, north]` shade + the box between them, its edges along the meridians and parallels. +- `keyType` declares what a choropleth's key holds (`iso3`, `iso2`, `iso-numeric`, `country-name`, + `us-state`, `fips`), so "CA" reads as Canada or as California. The join keeps every region (no + value: the no-data fill), combines rows that name one region by the encoding's aggregate, and + warns of keys that match no region, groups of countries ("World", "OECD"), countries the map + leaves out, and a total coloured by area. +- A template can owe a credit for what it draws (`ChartTemplateDef.credit`): a line of its own at + the chart's foot, with a link and a note on hover, drawn whether or not the chart gives a source. + A template can grow its plot to the canvas (`fillsCanvas`), its furniture measured first. + +- Two update ops that annotate a stretch of the chart or a group of its marks, after Blabber's + `region` and `enclose`, in Vega-Lite. `annotate-region` shades a period, a band of values, a + box or a run of adjacent categories, with an optional caption centred on it, clear of the + series it crosses, or outside on a leader when nothing inside is clear. Its options are + `color`, `opacity`, `layer: 'under' | 'over'` and `placement`. Regions on one chart take + distinct muted washes. A wash under the marks is cut away where they stand; over an area or + a heatmap it is drawn over them. `annotate-enclosure` outlines each target group: bars and + cells by a rectangle, other marks by a padded hull, pie slices by their own wedge. + `shape: 'ellipse' | 'circle'` is also offered. A cluster that shares a colour is outlined in + it, any other group in Blabber's neutral grey, over a thin halo of the page so the line reads + on dark marks, and one caption is shared, with leaders to two or three outlines (`connect: 'auto' + | 'all' | 'none'`). Both are named, so several stand together, and `value: null` clears + one. `validateChart` checks a region's bounds against the chart's axes. A captioned stretch of x + whose marks reach too near the plot's top for its caption (`AssembleOptions.regions`, set from + the first updates) gets room as a note does. The axis runs on past the stretch's tallest mark, + enough for the caption just inside the plot's top with 8 px of air. A stretch that has room + above its marks, or a line that has room below, takes none. A histogram's bins and counts are + worked out as Vega bins them, so its notes and regions get that room too. A histogram's bars, + standing on one baseline, are not taken for a heatmap's cells, so a region's wash stays under them. + The caption on a mark is now `annotate-text`; + `set-annotation` stays as its older name. +- ECharts, Chart.js and Plotly lay out their frame with the layout's own rules, in each library's + look: a headline and deck broken to full lines with no widow (set a size down where that fits one + line), band labels wrapped, turned, thinned or cut by the shared band-label plan, axis gutters and + names measured (a title longer than its axis on two lines), keys with long names on lines beside + the plot or moved to the foot, many lines thinned, and a canvas fit that holds key names short, + moves keys to the foot or lays the plot out smaller where the host would otherwise shrink the + drawing past legibility. ECharts and Chart.js now draw `chart_spec.title` and `subtitle`. The + verdict rides on the spec as `_canvasFit`. The dev site's *Backend layout* pages draw the + Vega-Lite layout labs' cases in each backend. +- Themed Plotly charts draw the house's header (`planHeader`: tabs, rules) and source line + (`planSource`), start the headline, key and source at the chart's left edge, stand the value + axis on the right where the house does, title the key where the house titles keys, and give + back foot room kept for names the house laid flat or an axis title it moved into the deck. +- Each backend states how its library draws the layout's furniture in a profile (`BackendProfile`: + key entry geometry, row wrapping, axis label and title spacing), read off the library's defaults + and source, and the shared estimators (`keyBlock`) measure with it. Plotly's keys, margins and + facet grids are now measured as Plotly draws them: no fixed 64 px gutter, keys estimated as + Plotly wraps them (a grid at the widest entry), axis titles taken away removed rather than left + empty, a tall key of long names stood beside the plot where that fits the box, and facets with + one shared title per axis, x labels only under each column's last panel and flat thinned times. +- Plotly bars over a run of dates (a temporal field on the band axis) stand on Plotly's date + axis with its calendar ticks, flat and thinned, rather than one turned label a month. The + backends' canvas fit scores a treatment by how far its host would shrink the drawing as well as + by its flags, and may set the key's text a size smaller (`canvasTreatment.keyScale`, 10 px floor). + Key names held short by the canvas fit are held to the same width in every backend, past each + library's own symbol room (Plotly's key had left its names 70 px, so the treatment did nothing). +- A narrow chart's title (two bars under a long headline) is broken to the width its box allows, + not the chart's own, and the drawing widens to hold it: the backends no longer stack a headline + into many lines over a thin plot. Plotly measures a house's headline in the case it draws it + (an upper-cased headline had run past the figure's edge). +- A Plotly key that a house sets in a row above or below the plot sets its names for the row (whole, + or broken where that lets more share a row) rather than keeping names broken for a column beside + the plot. +- Plotly scatter and line axes start and end on labelled ticks, as Vega-Lite's nice domains do (a + range rounded out to its tick step, a step further where an edge bubble would be clipped), and a + log axis over a few decades is labelled at 1·2·5 of each decade where those labels fit. +- A Plotly pie whose slice names run long beside its radius names its slices in a key beside it + (long names on lines) and prints the shares inside, rather than standing the names outside and + shrinking the pie to a small disc among them; a house's key on top stands beside a pie. + A themed pie whose callouts would stand outside it is keyed too (in the house's row where it + fits), so Plotly's automargin no longer moves the plot, and the header hung from it, after the + frame placed them. + Plotly pies and donuts take a `sliceNames` chart property (`auto`, `onSlices`, `key`), which a + house may also set in `chartDefaults`, to keep the names on the slices or always set them in a key. +- A Plotly key in rows above or below the plot flows, each entry its own width, rather than standing + as Plotly's grid at its widest entry, where one long name left one entry a row. +- Plotly facet panels are ticked from their own height (y) and width (x), the range rounded to the + step; a house's tick count is no longer shared out over the grid, which had left a panel's y axis + two labels (0, 20). +- Plotly facet panels tick their years by the width each panel is drawn at, with Vega-Lite's + temporal rule: the finest calendar step (1, 2, 5, 10 … years) whose labels stand apart by half + of each one's width and 0.6 em. Plotly's own `nticks` had left a wide panel two labels. +- Plotly keys in rows are measured as Plotly wraps its grouped rows (an entry steps on by its gap, + its text box a little wider than its advance), so a key on top no longer runs its last row into + the plot; a key at the foot stands under the x labels in room of its own rather than letting + automargin take its height from the plot; a few px separate a title from a key hung under it; and + a time axis's labels are measured as Plotly prints them (a second line for the year under days). +- Plotly draws a key to a size channel, which Plotly has none of: a few round values + (`roundSample`, as many as the edge holds) as circles at the size the chart draws them, with the + field's name, in a row under a key in rows or beside the plot under the colour key. +- Cartoon's dots are solid (`marks.point.opacity: 1`): stickers stack, the dark edge of one keeping + the one beneath readable, in Vega-Lite as in Plotly, whose dots now take a house's outline. +- The backends' canvas fit may set the library's type a size down (`canvasTreatment.labelScale`, + `titleScale`: Plotly 12 → 10 px ticks, 14 → 12 px axis titles, 17 → 14.5 px headline, never below + 10 / 13 px), alongside key names and key text; type is taken smaller only where the host then + shrinks the drawing less by enough that the text reads at least as large on screen. A Plotly key + is set at its ticks' size (12 px), not the axis titles' (14 px). +- Plotly sizes a bubble chart's points on one scale over every series, from zero, as Vega-Lite does + (a house's size range had been applied to each series apart, so each series' largest bubble drew + at the largest size), and draws them largest first, so small bubbles stay in sight. +- Plotly leaves off the line along the index axis where the value scale's floor is not zero and the + house grids its values (`floating: 'omit'`), as Vega-Lite does: zero carries the base (no second + baseline under a scatter that crosses zero). A banded axis of dates names its bands as a calendar + does (`Jan` over `2025`, `Mar`, …), flat, every few bands where one will not hold a name, as + ECharts and Chart.js already did, rather than one turned `2025-01` a band. +- ECharts binned colour scales break at round values (`roundBinEdges`), labelled as ranges; a + continuous size or colour ramp beside the plot stands from the plot's top with its title + centred over the bar. +- A spec carries its own `updates` (`ChartAssemblyInput.updates`): the notes, overlays, emphasis and + viewport the chart applies once it is drawn, the same layers a host passes to `mountChart` or + ``, so a copied spec keeps them. The spec's are applied first; a host update + with the same id replaces the spec's; `validateChart` checks both. The interactive runtime applies + them; a static output (`assembleVegaLite`, `renderSvg`, the other backends) draws the chart without + them, with an `info` warning (`updates-not-compiled`). +- A `Map`'s `text` names its points beside them, as an atlas names its places: each label is placed + at compile time, through the projection the map will draw, right of its dot, else left, above or + below — clear of every dot, every label placed before it, the plot's edge and, where it can, a + route's lines. The largest dots are named first where `size` sizes them; a point whose label has no + room is left unnamed, with an `info` warning (`map-labels-dropped`). A label keeps its point and its + offset in px, so it stays beside its point through a pan, a zoom or a globe's turn. +- A `Choropleth`'s `text` names its regions at their middles, through the live projection, each + shown only while its region is wider and taller on screen than its label: a small region's name + appears as a zoom brings it close. Each label is white or a dark ink, whichever reads better on its + region's fill (its colour scale's own value, so classes and schemes are followed), haloed in that + fill: unseen inside the region, readable where the label runs past a coast. +- A `Map`'s `shape` tells its points apart by symbol (filled, with a key), as a scatter's does. +- Plotly draws a map's `text` beside its points and a choropleth's at its regions, and a map's + `shape` as its markers' symbols. +- `mapStyle` takes a style of the caller's own besides the named ones: `{ base?, sea?, land?, + coast?, border?, noData?, graticule?, disputed? }`, a named style (`auto` when unset) with any of + its colours restated. A stated `sea` fills a flat map's plot as well as a globe's water. A + property's other accepted values (a `boundaries` file, this style) are now listed in the chart + reference. +- An overlay's `style.fontStyle` (`'italic'`) sets its text in italic, as a map's sea names are. +- A route map's `stops` property draws its stops as dots: `'all'` (or `true`) at every stop, `'ends'` + only where each run of legs in one colour starts and ends (a chapter of a voyage), the stops between + marked by their arrows alone. Dots are one size (from the routes' typical width, 2.5–4 px), sized by `size` + (zero-based by area, 2.5–7 px, with its own key; `size` draws them at every stop unless `stops` + says otherwise), or all at `stopRadius`. Plotly draws them alike. A leg leaves from + the edge of its dot's halo and its head's tip stops at the next one's. +- `list_chart_types` with `chartType` returns that one type in full: what it is for and how its + channels read, the guidance that applies whenever it is used, its `chartProperties` (values, + default and effect) and its interaction presets. A near name (`"scatter"`, `"choropleth map"`) + resolves when it points at one type. +- The MCP server serves a fifth skill, `app` (`flint-app-author`, also the resource + `flint://app-skill`): writing code that uses `flint-chart` in an app, a React component, a + notebook or a script, mounting a chart with interactions, reading selections and applying updates. +- A board's `colors` binds colours to values, per field (`{ "Category": { "Jewelry": "#c0392b" } }`): + every chart on the board that colours by the field takes them, under any colours the chart binds + itself, so a value keeps one colour across the board and across turns. +- `resolveDisplayAggregate` and `resolvePivotAggregate`: how a chart combines a measure's rows for a + label or share, and how an exporter that pivots raw rows reduces several rows on one cell. + +### Changed + +- **Visible change:** world maps draw World Bank Official Boundaries, credited at their foot, + where they drew Natural Earth's; choropleths are classed in five quantile classes where they + shaded a continuous ramp; a map frames its data rather than the whole world; and maps (`Map`, + `Choropleth`) draw no house chrome (header, rules, logos, footer credit) unless `chrome` asks. +- **Visible change:** on a dark map style the borders are gaps in the ground's colour rather than + bright lines, land and no-data regions are lifted off the dark water, and points wear a thin ring + so they hold against both. A map's credit is set a size under the source line (0.8 of it, 9 px + floor), and a point map's land is outlined at the map's own border width (0.4 px on the world, + 0.5 px on the US) rather than 1 px; borders keep their width at any zoom. +- **Visible change:** a point or route map left to the theme stands on a reference map's ground: + water fills a world map's frame in a cool tint, land lies light on it, the coast outlines the land, + and the borders between countries are thin lines drawn over that outline (a mesh of their own) + rather than gaps, which vanish between regions of one fill. A US map, or land of the caller's own, + stays on the page with its land toned. Every style outlines a point map's land at its coast. + Choropleths take the same ground: water behind a world map, regions outlined at the coast, and the + borders between them thin lines of their own (a mesh over the regions) rather than white gaps; a + US map stays on the page. A map of runtime levels (`level: 'auto'`) keeps its outlines. +- A map keeps its frame's shape and grows until one side meets the canvas; its key stands on the + side with the room left over (beside a wide map in a tall box, above or below a tall one) when + that leaves the map larger. +- **MCP:** the chart view carries no boundary files and declares + `https://microsoft.github.io` in its CSP (`connectDomains`); a map fetches its named boundaries + from there. +- A note on a bar whose value is printed past its end continues the printed value instead of + pointing past it: it stands after the label, joined to it, so "0.616 — Down from 0.706 before + taxes" reads as one statement rather than a value label and a second annotation. +- **Visible change:** `set-style` emphasis (`state: 'emphasized'` or `'focused'`) recedes the other + marks to 0.6 of their own opacity by default instead of to 0.25, so the rest of the chart stays + readable. A new `emphasis: 'light' | 'strong' | 'exclusive'` sets how far they recede (0.6, + 0.35, 0.2 of their opacity, so a dot drawn at 0.7 recedes from 0.7), like a note's `highlight`; + `mutedOpacity` still states the receded opacity outright, and the presets keep their 0.25. + A region caption asked for a side its region is too narrow for stands as near that side as fits. + The value labels of the marks set back recede no further than half, and a label drawn on its + mark switches to the page's ink, so values stay readable under every house: before, faded bars + kept a label ink chosen for the full-strength fill (black on dark blue, white on pale blue). + +- **Visible change:** a note that points at one mark (a dot, a bar's value end, a cell, a line's + point) is now drawn as a caption beside the mark instead of a card, in Vega-Lite. The caption + uses the chart's own axis-label face one size up, haloed in the chart's background. A short + leader to the mark's outline is drawn only when the caption stands off the mark or another mark + sits as close. Placement (`core/annotation`) tries a ring of seats around the mark and keeps the + cheapest. Leaving the canvas costs most, then covering marks, text or lines, then leader length. + Notes are placed one at a time, each clear of the captions and leaders placed before it. There is + no joint search. Notes on a stretch of a line or area, a slice, or a region keep their card. + Restyle captions with `--flint-annotation-color`, `--flint-annotation-halo` and + `--flint-annotation-line-color`. +- **Visible change:** the chart now helps its notes. A note's `highlight` sets how much the + mark it names stands out. `'light'` is the default: the mark is lifted above its + neighbours with a halo, a line's point is drawn as a dot in the line's colour, and a bar + or cell gets a faint outline. `'strong'` adds a ring round a dot and a full outline round + a bar. `'exclusive'` is strong and fades every other mark, as `set-style` `emphasized` + does. `'none'` leaves the mark as drawn. The notes a chart mounts with (its first + `updates`, or `AssembleOptions.notes`) also get room: a noted mark at the top of a measure + axis (the tallest bar, a peak) makes the axis run on just far enough for the caption and the + nearest seat over it (0.9 of a font size), ending at a fine round step (a twentieth of the + span) rather than the next major tick, so a one-line caption takes about 30 px. This uses at + most a third of the axis and keeps any domain end the spec states. Long captions now + break into even lines, preferring a break after a colon or comma, instead of leaving one + word alone on the last line. A caption too wide for the gap beside its mark may stand in two + even lines. A note on a bar's value stands past the value face, centred on it (or slid aside + as far as its own edge), with a straight leader to the face's centre, as Blabber's bar + captions do; the ring round the bar's end is only an escape. A note now resolves to its mark + rather than to the mark's value label. +- `validateChart` now gives an info `note_repeats_chart` when a note repeats a value the + chart already prints on its mark, such as "Online leads: 61" over a bar labelled 61. A + note should say what the chart does not. The interaction skill now says so too. +- A heatmap's cells along a time axis now tile. Each date stands for the period it repeats at, + read from the values, whatever the field's type or form (dates, timestamps, epoch + milliseconds): its month, quarter or year where the dates step by months, whatever day each + falls on (month ends, the 5th, quarter ends); a day, a week or an hour where they keep an + exact step; until the next date where they keep about one (13 or 14 days, the 1st and 15th). + Before, a cell took the smallest gap in days, so month ends and dates 13 or 14 days apart drew + one-day slivers; a whole run of months is no longer turned into named bands. A missing period + stays an empty gap, and dates that keep no step are still named one band each. The axis title + no longer reads `Date, __cell_x_end`. The same reading decides whether dates on a bar chart + are a run of time: dates about 45 days apart, which read as sparse snapshots in days, now + stand on a time scale; eight or fewer are still named one band each. +- A continuous colour key shortened to stand beside a short plot keeps round labels (−40,000 … + 40,000). Vega-Lite labelled a ramp given a length under 200 px at its two raw ends only + (−53,901 and 43,635). +- A stepped colour scale — a house that bins its ramp (`consumption: 'quantize'`: pop, swiss, + cartoon, de-stijl) or an author's `bins` — is cut at round values (`roundColorClasses`). The + step is round (1, 2, 2.5 or 5 of a power of ten), chosen by Talbot, Lin & Hanrahan's extended + labeling score; a diverging field's pivot is a break, and each side takes only the classes its + data reaches, the short arm the pale end of the ramp. A heatmap of −6.7 … 33.5 °C reads 0, 10, + 20, 30, where equal cuts of a domain made symmetric at ±33.5 read "−20, −7, 7, 20" for breaks at + ±20.1 and ±6.7 and left two cold classes empty. A house's count is a target (about 5); an + author's `bins` is held where a round step closes that many classes, else the outer two open. + Neither side of the pivot takes more than four classes where a coarser step holds it, and each + class takes the colour at its far edge, so the classes beside a break show their sign. A pivot + the type always has (`Correlation`, `Sentiment`, a stated `divergingMidpoint`) centres a neutral + class instead; the new `divergingNeutral` annotation sets its half-width, or `false` for a break. + Vega-Lite draws a threshold scale whose key prints each break in full; ECharts' author bins break + at the pivot too. Grounding reports a diverging ramp whose arms differ by more than 3 L* at + mirrored points (`diverging-ramp-unbalanced`): pop, de-stijl, swiss and cartoon do today. +- Every `annotate-text` note is a caption after Blabber's `text`: plain words in the chart's label + face, haloed in the page, with a leader only where the caption is not plainly beside what it + names. The card (a bordered, shadowed box) that notes on a stretch of a line or area, a pie + slice, a whole shape, a map region or a bullet's two parts still drew is gone; a host that wants + a callout box draws one with `set-overlay` or `set-freeform-overlay`. Each note is placed by the + same lightweight search, from places that suit what it names: a stretch at its middle or a + quarter along (an area's caption off the side away from its fill), a slice from inside its wedge + out past the pie, a violin at the ellipse its box holds, a region at its middle with the other + regions as ground. `highlight` now marks these too: a stretch is drawn again in its ink, a slice + or a shape faintly outlined. A bullet's note names its actual bar, with one leader. +- `AnnotationSpec` is what an update writes: `text`, `anchor` and `highlight`. The `candidates` and + `subject` a template's presenter adds are on the internal `PresentedAnnotationSpec`. + `AnnotationCandidate`'s `anglePreference`, `textAlign`, `maxDistance`, `priority` and + `connectorAnchors` are ignored and deprecated. +- Annotations take their colours from the house and read on its page and on its marks. A note is set + a step heavier than the chart's labels (semibold over regular ones) in the primary text ink, so it + is not taken for a label beside it; a house's `type.annotation` role sets it otherwise. Leaders + are Blabber's neutral grey. A region's wash is the house's `ink.accent` where that stands apart + from the page and every mark (in most houses it is the data's own ink), else the hue of the + house's categorical palette furthest from them (never a grey), else a callout hue. Halos are the + plot's own surface, and a caption standing on a wash has none. A cue drawn on a mark (an area's + edge, a dot on its fill) is in the note's ink or the page's colour, whichever reads on the mark. + A stretch of an area is cued in that ink, not its own fill; one too short to read is cued as a dot. +- A note's leader leaves its mark square to the side it names and is never drawn along the mark's + own edge. From a bar's value end it runs out along the bar first (at least ~0.7 of a font size) + and turns square toward a caption that is not straight ahead: down into one below the end, or + along and in to one beside it. A leader that would graze a cell's or a bar's side runs out from + it the same way. +- `Number` is a measure whose additivity is unknown: it is no longer summed or stacked by default. + Where a chart combines its rows (a bar's label, a share of the total) it takes the encoding's own + `aggregate`, else the mean; exporters that pivot rows (Excel, Image-Charts) do the same. A total + should be typed `Count`, `Amount`, `Quantity` or `Profit`. An untyped numeric field still sums. +- The value axis of a distribution (Boxplot, Violin Plot, Density Plot, Ridgeline Plot, ECDF Plot) + fits its data instead of reaching to zero: where values fall is the read, not a length. +- A bar split only by `detail` reads as one bar: its segments stay for selection and links, but it + draws no seams between them, and its value label and layout use the bar's total. +- A "% of total" label is offered only for a measure whose rows add up. +- Tooltips are set in the house's label face, at its label size kept between 11 and 13 px. +- Hovering a line shows its vertex as a dot a little wider than the line, in its colour; a hovered + point is redrawn a little larger, outline and all. +- `swiss` sets its labels in the structural ink and its areas as flat fills under their own edge; + `pop` keeps solid areas parted by its black separator. +- `show` reports what keeps a chart or board from drawing ("Fix before it draws") apart from what it + draws with ("Noted"); a board says a finding several charts share once, under all their ids. + +### Performance + +Contributed by Shayne Boyer (@spboyer, #160). Output is unchanged; each change ships with the +script that measured it. + +- Trimming an overflowing category axis to an explicit order looks values up in a set instead of + scanning the order for each one, in JS and Python: at 10,000 categories, 118.6 ms → 6.3 ms (JS) + and 420.8 ms → 2.2 ms (Python). Duplicates, missing entries and descending order behave as before + (#167). +- Sort repair skips enumerating rows and fields when no sort needs a raw-field lookup (100k rows × + 10 fields: ~21 ms → ~0.001 ms) and otherwise collects the fields once, without a rows × fields + intermediate (~21 ms → 6.5 ms, ~44 MB → ~16 MB allocated per call) (#168). +- Python: temporal columns are inferred one at a time instead of holding every first-row column + vector, cutting peak memory by 90% on a 10k × 20 numeric table and 16% on a mixed temporal one; + timing is unchanged (#169). +- Python: only preliminary encoding types are resolved before overrides are composed, with the + final full resolution still authoritative: a 10k-row scatter assembles in ~121 ms instead of + ~152 ms (20.6%); all 705 fixture outputs are identical (#170). +- `npm run benchmark:render` (`scripts/render-baselines.mjs`) records deterministic cold and warm + compiler and MCP render baselines per backend: timing, memory and artifact checks in bounded + workers. It is opt-in and sets no CI threshold (#171). + +### Fixed + +- A compact number that rounds up to the next power of a thousand is written in that power: + `999,600` prints `1M`, not `1000k` (or `1,000k` where a set shares one unit), and `999,600,000` + prints `1B`, as d3's `~s` and the KPI tile already do. A stated precision decides where it + rolls over: at two decimals `999,960` stays `999.96k`. + ([#172](https://github.com/microsoft/flint-chart/issues/172)) +- A note's, a region's or an enclosure's caption no longer stands on the source line, a map's + credit or a house's header and rules, which are drawn beside the chart rather than in it; and a + caption round a map's marks no longer treats the land and water as marks it must keep off. +- The canvas fit reserved 8 px of padding round the drawing where Vega-Lite pads by 5, so a chart + sized to its box ran a few px over it. +- Dates that arrive as ISO timestamps (`"2005-05-01T00:00:00.000"`, `"…Z"`, `"2005-05-01 00:00:00"`, + as a database `DATE` column serialised to JSON often is) are read as dates under `Year`, + `YearMonth`, `Date` and the other calendar types: a midnight timestamp becomes its date, so the + axis shortens its labels (`Jun · Jul · Aug`) as it does for `"2005-05-01"` instead of printing the + full timestamp. A `Date` object at local midnight reads the same way, so marks sit on their date + whatever the machine's time zone (before, a Pacific machine drew them 7 h late). A timestamp with + a time of day and no zone stays a wall-clock time, labelled at the hour it says in every time zone + (a space before the time is read as `T`); one with a zone offset is kept as written. +- An enclosure round dots at the edge of the plot is drawn whole: where a dot it encloses sits + within 12 px of a continuous axis's end, that axis is padded by 12 px (`AssembleOptions.enclosures`, + set from the chart's first updates), instead of the outline being cut at the plot's edge. +- The room kept for value labels past the ends of horizontal bars now runs the axis on rather than + cutting the axis short. The domain extends by the share of the plot the labels take (Flint's own + ticks continue at their step), so the axis line, its ticks and the gridlines reach the plot's + edge; before, they stopped at the last tick and left an empty stretch with no scale. Bars keep + their lengths. Bars that grow both ways, or run on a reversed scale (a pyramid), keep the inset. +- Four kinds of chart update that `validateChart` reported as applying were dropped when drawn + (found by the annotation experiment's pilot). A key with a number now matches a field drawn as + categories, whose values Vega-Lite carries as text (`{ Year: 2016 }` on a banded year). A + series with a single row on a line chart is drawn as a point, so its value shows and a note + can point at it. A region caption asked for a placement its region is too small to hold is + placed where it fits instead of dropped, and `placement: 'above'` or `'below'` stands just past + a band's own edge, or moves inside a full-height stretch where the header holds the seat over + the plot. An overlay with `strokeDash: 'dash'` or `'dot'` draws, and an overlay the renderer + cannot read no longer stops the chart's other updates from drawing. +- An enclosure round a cluster of dots takes the cluster's fill colour, not the outline a house + draws round every dot (every cluster came out black under `pop`). + +- A stepped colour key standing beside the plot (an author's `bins` without a theme) runs no + longer than the plot. Vega-Lite drops a binned key's own `gradientLength` and drew the ramp at + its 200 px default, twice the height of a short heatmap; the planned length now goes on the + legend config, which the ramp reads. +- A size key prints the values it lists. Vega-Lite labelled the round values it sampled with the + scale's tick format, so a key for 0.5, 1 and 2.5 read "1, 1, 3" (a Map's "0, 1, 1, 3"); each key + now carries a format precise enough for its values, keeping the field's own (a share, a currency) + with its precision raised, and the key's width is measured from those labels. Plotly's size key + no longer rounds values below 0.001 to "0", nor ECharts' size map its ends below 1. +- A tooltip on an interactively filtered stacked chart (a bar coloured by its own category) no + longer lists Vega-Lite's `__sort_index`: the colour domain the filter pins made Vega-Lite + order the stack by that index, which a tooltip on every encoding listed. +- Bars sorted by value (`sortBy: "x"`) stay in value order under every house. A house's value + labels and row names draw on the bars' band, and Vega-Lite drops a sort the layers cannot share, + so nyt, economist, powerbi, powerbi-light, pop and de-stijl drew the bars in name order (and + datawrapper's names above the bars failed to compile in 1.0.1). Every layer on such a band now + states the same order, computed as Vega-Lite sorts the bars. +- A Vega-Lite chart given a `canvasSize` is drawn within it. The canvas fit left a chart that read + well drawn larger than its box — keys beside a plot that filled the width, a title over one that + filled the height — for the host to scale; a host that drew the SVG at its own size cut them off. + The chart is now laid out again for a smaller room, so the plot gives up the room and the keys, + labels and title stand inside the canvas (`_canvasFit.treatment.contain`, reported as + `canvas-contain`). The plot keeps at least half of each side, and no value is cut or label turned + for the room; what cannot be brought within is left nearer, for the host to scale. Charts without + a `canvasSize`, composite charts, the other backends and `canvasFit: 'off'` are unchanged. A + chart that ran past its `canvasSize` now draws a smaller plot; `canvasFit: 'off'` keeps the + drawing as it was. +- `filterControls` filters a Vega-Lite chart with an `aggregate` encoding (an average, a count, a + sum) or several y fields. The rows a filter left were swapped in raw, while the chart's data had + been folded and aggregated when it was built, so the bars found no value and the plot emptied + (clearing the filter emptied it too). Swapped-in rows (`set-data`) are now shaped as the chart's + own rows were; rows the host aggregated already pass through as before. +- A note (`set-annotation`) keyed to an interior point of a line drawn with points attaches to that + point. The key matched both the point and the segment that starts there, so every point but a + series' last reported `unsupported_update: … matched nothing`. +- A chart with no theme draws on the host's background: `options.background`, and the + `background` the React view, the interactive renderer and `renderSvg` take, now reach the spec, + where Vega-Lite's default white outranked them. A theme whose surface defers to the host + (`ink.surface.source: 'host'`) follows it too; a theme with its own canvas keeps it. +- A `Percentage` stored as fractions prints as percentages (`16.4%`, not `0.164`) with no + `intrinsicDomain` stated, read from the values as its domain and a KPI already were. +- An app no longer fails to build for want of a backend it does not draw with (#155): + `flint-chart` now depends on every backend it draws with (`vega`, `vega-lite`, `vega-tooltip`, + `echarts`, `chart.js`, `plotly.js-dist-min`), so `npm install flint-chart` is the whole install + and `flint-chart/react` and `flint-chart/interactive` draw on any backend as installed. React + stays an optional peer; the unused `plotly.js` peer is dropped. Plotly is held to `^2.35.0`, the + line Flint's Plotly layout is tested against. + - For an app bundled into one file (no code splitting), new entries `flint-chart/react/` + and `flint-chart/interactive/` (`vegalite`, `echarts`, `chartjs`, `plotly`) export + the same names but reach only that backend, so the file carries one library. `` + and `mountChart` take a `renderers` map of factories from `flint-chart//interactive` + to draw another backend from such an entry. The MCP view imports the Vega-Lite entries in + place of stubbing the other backends at build time. +- A percentage field's storage is no longer guessed from the values where the annotation states + it: the new `percentScale` (`"fraction"` | `"percent"`) annotation is used as stated, and an + `intrinsicDomain` within ±1 (fractions) or reaching 100 (percent points) settles it too. A growth + rate stored as fractions mostly past 1 (2.4 for 240%) was printed as "2.4%", and the same column + was formatted two ways depending on which rows a query returned. Axes, tooltips, value domains + and KPI cards all read the stated scale (#154). +- A map's overlay labels and points are cut at the plot's edge, as its land and lines are: a label + whose place sits by the edge no longer runs out over the frame. +- A theme that `extends` a house and recolours its text ink or page takes the house's type with it: + a role the house set in one of its text inks (the NYT's headline, its deck) follows that ink, and + on a recoloured page a role colour that would no longer read is moved until it does. A dark page + extending `nyt` no longer sets its title in near-black. A colour the extension states is kept. +- A size key keys the data's least value where that is round and its smallest value lands just + off it: a crew that dwindles to one man keys 1, not 2. +- A route's line ends at its arrowhead's base (a hair past it, so no seam shows) instead of running + well into the head: a faded route no longer shows the line's end through its translucent head. +- A one-letter unit keeps its case: `M` is millions, not metres. +- An area's edge takes the area's ink: a single series inked on the mark alone drew Vega-Lite's + default blue edge. +- In the live view, a line chart's dots are drawn once under a house that sets its own vertex dots + (`cartoon`, `pop`): moving the dots into their own layer for interactions let the house's + `config.line.point` draw a second, full-size set beneath them. +- In the live view, an unsorted colour (`sort: null`) keeps its legend in the rows' order instead + of alphabetical, so each series keeps the colour the static chart gives it; a faint ink's darker + edge (`ink.series.minContrast`) follows the same order instead of edging each mark in another + series' colour. + +### Deprecated + +- The `set-annotation` op. Write `annotate-text`, which it means. It is still read in 1.x, but no + longer listed in `CHART_UPDATE_OPS` (it is in `DEPRECATED_UPDATE_OPS`); `validateChart` reports + it as a `deprecated_op` warning, the runtime warns once on the console, and the MCP schema marks + it deprecated. It will be removed in 2.0. + +## [1.0.1] - 2026-10-21 + +Released together for `flint-chart`, `flint-chart-mcp`, and the Copilot Canvas plugin. + ### Changed - **Breaking (MCP):** the server keeps nothing between calls, so it runs @@ -25,10 +537,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 the next `show`. A card the host draws again without its result calls `show` with the spec it was given. -## [1.0.1] - 2026-10-21 - -Released together for `flint-chart`, `flint-chart-mcp`, and the Copilot Canvas plugin. - ### Fixed - Plotly: a Line or Area Chart's `chartProperties.interpolate` now outranks the theme's line @@ -521,11 +1029,12 @@ Released together for `flint-chart`, `flint-chart-mcp`, and the Copilot Canvas p - Treated only lowercase `start` and `end` Waterfall Type values as total anchors in Vega-Lite; other values now remain floating deltas colored by sign. -[Unreleased]: https://github.com/microsoft/flint-chart/compare/1.0.1...HEAD -[1.0.1]: https://github.com/microsoft/flint-chart/compare/1.0.0...1.0.1 -[1.0.0]: https://github.com/microsoft/flint-chart/compare/0.5.1...1.0.0 +[Unreleased]: https://github.com/microsoft/flint-chart/compare/1.1...HEAD +[1.1.0]: https://github.com/microsoft/flint-chart/compare/f098e497...1.1 +[1.0.1]: https://github.com/microsoft/flint-chart/compare/1.0...f098e497 +[1.0.0]: https://github.com/microsoft/flint-chart/compare/0.5.1...1.0 [0.5.1]: https://github.com/microsoft/flint-chart/compare/0.5...0.5.1 -[0.5.0]: https://github.com/microsoft/flint-chart/compare/0.4.0...0.5.0 +[0.5.0]: https://github.com/microsoft/flint-chart/compare/0.4.0...0.5 [0.4.1]: https://github.com/microsoft/flint-chart/compare/0.4.0...0.4.1 [0.4.0]: https://github.com/microsoft/flint-chart/compare/0.3.0...0.4.0 [0.3.0]: https://github.com/microsoft/flint-chart/compare/88fbeb5ebf07f18a1cf661ebef71cc570b7425d6...0.3.0 diff --git a/README.md b/README.md index a8ec486b..d293b85d 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ https://github.com/user-attachments/assets/c1cda0fa-3ea7-41af-b3fd-a127bc83d641 ## Updates +- **November 15, 2026** — Flint 1.1 brings maps and layout: maps with + customizable boundaries, globes, routes and labelled points, framed to + their data; charts that fit their canvas on every backend; and + annotations as captions beside what they name. + ([release notes](https://github.com/microsoft/flint-chart/releases/tag/1.1), [changelog](CHANGELOG.md)) - **October 19, 2026** — Flint 1.0 introduces [Flint Interactive](https://microsoft.github.io/flint-chart/#/interactions): interaction presets, semantic events, and an interaction API that connects @@ -106,7 +111,9 @@ npm install flint-chart ``` The library compiles Flint specs into backend-native chart specs and provides -React and vanilla JavaScript APIs for embedding interactive charts. +React and vanilla JavaScript APIs for embedding interactive charts. It comes +with every backend it draws with (Vega-Lite, ECharts, Chart.js, Plotly); React +is an optional peer for ``. A Flint spec describes the data, semantic types, and field mappings, with optional theme and interaction settings. In React, pass it to `` @@ -142,7 +149,7 @@ https://github.com/microsoft/flint-chart/blob/main/agent-skills/flint-chart-auth https://github.com/microsoft/flint-chart/blob/main/agent-skills/flint-interaction-author/SKILL.md Use these skills to add a chart to this app. -Install flint-chart and the renderer dependencies needed for this project. +Install flint-chart (it includes its chart renderers) and add it to this project. Plot monthly users by region from our data in Economist style. Let readers hover to compare regions at each month, and add a region selector that updates the chart. diff --git a/agent-skills/README.md b/agent-skills/README.md index 126317b7..a66e0331 100644 --- a/agent-skills/README.md +++ b/agent-skills/README.md @@ -34,7 +34,7 @@ sort order — all derived deterministically by the compiler. When the user wants more than a spec, the skill also tells the agent how to: - validate and render charts with the Flint MCP server; -- install `flint-chart` and the needed renderer peer dependencies; +- install `flint-chart`, which comes with every chart renderer; - call `assembleVegaLite`, `assembleECharts`, or `assembleChartjs` in JS/TS; - use the Python package when it is published in a later release. diff --git a/agent-skills/flint-app-author/SKILL.md b/agent-skills/flint-app-author/SKILL.md new file mode 100644 index 00000000..8ab3ac87 --- /dev/null +++ b/agent-skills/flint-app-author/SKILL.md @@ -0,0 +1,628 @@ +--- +name: flint-app-author +description: "Use when: the user asks for code that uses flint-chart: add Flint to a JS/TS app, a React component, a notebook or a script; mount a chart with interactions; read selections with onChange; apply updates from code; link charts in an app; or build a gesture no preset gives. Not for chart specs shown through the MCP tools." +--- + +# flint-chart: Flint in an application + +The chart input is the same `ChartAssemblyInput` the `flint-chart-author` +skill writes, and the `interaction_spec` and update ops are the +`flint-interaction-author` skill's. This skill is the code around them: +install, compile, mount, read the chart, link charts, and bespoke gestures. +Write code only when the user asks for it. + +In code, data is a runtime value: load it with normal code (a real CSV +parser, never `line.split(',')`) and pass `data: { values: rows }`. Keep the +values as the data has them; `semantic_types` reads them. + +## Install and compile + +For MCP clients, the server can run with `npx`: + +```bash +npx -y flint-chart-mcp +``` + +For JavaScript or TypeScript projects: + +```bash +npm install flint-chart +``` + +- `npm install flint-chart` is the whole install: it comes with every backend + (Vega-Lite, ECharts, Chart.js, Plotly). React is an optional peer, needed only + for `flint-chart/react`. +- Draw with `` from `flint-chart/react`, or `mountChart` + from `flint-chart/interactive`; presets, update helpers and types come from + `flint-chart/interactive` too. +- Compile with `assembleVegaLite`, `assembleECharts`, `assembleChartjs` or + `assemblePlotly` from `flint-chart`; `renderSvg` from `flint-chart/render` + draws a static SVG (Vega-Lite or ECharts). +- Only for an app bundled into one file (no code splitting): import + `flint-chart/react/` or `flint-chart/interactive/` + (`vegalite`, `echarts`, `chartjs`, `plotly`), which reaches no other backend, + so the file carries one library. + +Then compile with the requested backend: + +```ts +import { assembleChartjs, assembleECharts, assembleVegaLite } from 'flint-chart'; + +const vegaLiteSpec = assembleVegaLite(input); +const echartsOption = assembleECharts(input); +const chartjsConfig = assembleChartjs(input); +``` + +Python support is planned for a later release. Until the PyPI package is +published, use the npm package or MCP server for released workflows. + +## Mount + +```ts +import { mountChart, navigate, legendToggle } from 'flint-chart/interactive'; + +const surface = mountChart(container, input, { + backend: 'vegalite', + renderer: 'svg', + interactions: [navigate({ axes: 'x' }), legendToggle()], + chartId: 'sales', +}); +await surface.ready; +const warnings = await surface.warnings; // interactions the chart could not honour +// … +surface.destroy(); +``` + +| Member | What it does | +| --- | --- | +| `ready`, `warnings` | Promises: the first render; the dropped or yielded interactions. Every call below waits for `ready` itself. | +| `applyUpdate(update, options?)` | Retains one update by id; replaces the layer with the same id. `options.transition.duration` animates a viewport. | +| `setUpdates(updates)` | Replaces every retained update. | +| `clearUpdate(id)` | Removes one layer. | +| `dispatch(id, payload)` | Runs an `externalInteraction` handler and applies what it returns. | +| `getState()` | What the chart shows now; `undefined` before `ready`. | +| `onChange(callback)` | Every change to that state, after the render; returns the unsubscribe. | +| `layout` | Once ready: `plot`, the plot box `{ width, height }` on a chart that draws one plot; `views`, each drawn view as `{ role, box: { x, y, width, height } }` (role `plot`, `text`, `tile` or `rule`; facet panels row by row); `block`, the box the views take with their axes and headers, without title and keys. Boxes are in pixels from the drawn chart's top left, read from what it drew, so they follow filters and resizes. `undefined` on charts with a category rail and on non-Vega-Lite backends. | +| `refresh()` | Re-projects overlays after the host rescales the chart. | +| `element`, `chartId` | The mount's root and the stable chart id. | +| `destroy()` | Removes listeners, the renderer, and the DOM. | + +- `input` is a `ChartAssemblyInput`. Presets go in `input.interaction_spec` as + JSON or in `options.interactions` as factory calls. Both may appear; spec + entries mount first, and a code definition with a spec entry's `id` + replaces it with an `interaction_overridden` info warning. +- A malformed `interaction_spec`, a repeated code `id`, or a code definition + the chart cannot honour fails the mount with an error that names it. A spec + entry the chart cannot honour is dropped with a warning instead. +- `options.availableSize: { width?, height? }` is the room the host gives the + chart. It becomes the `canvasSize` ceiling on the sides given, so the chart + lays out for that room rather than being scaled into it. +- `options.updates` holds retained updates present at the first render, for a + chart that starts with a part hidden or framed. +- `renderer: 'svg'` for charts whose marks a host reads from the DOM, or under + a few thousand marks; `'canvas'` for maps and dense charts. +- A `Year` or `Date` field makes a temporal axis whose rows hold `Date`s or + ISO strings; a bare number such as `2013` reads as milliseconds after 1970. + A `semantic_types` entry may be an object, + `{ semanticType, intrinsicDomain: [lo, hi] }`; the intrinsic domain holds an + axis still while the rows change. +- `options: { addTooltips: false }` on the input is the switch for the + tooltip, for a chart whose hidden values it would give away. +- Build with a bundler. The interactive entry reaches every backend through + lazy imports with no file extension; when `echarts`, `chart.js`, and + `plotly.js-dist-min` are not installed, mark them external (esbuild + `--splitting --external:echarts --external:chart.js --external:plotly.js-dist-min`; + Vite `build.rollupOptions.external`). +- In React, use `` from `flint-chart/react` rather than mounting + in an effect; see "In React" below. + +## In React + +```tsx +import { FlintChart, type FlintChartHandle } from 'flint-chart/react'; +import { clickHighlight } from 'flint-chart/interactive'; + +const chartRef = useRef(null); + + setSelected(change.state.selected)} + onError={(error) => report(error)} +/>; +``` + +| Prop | What it does | +| --- | --- | +| `spec` | The `ChartAssemblyInput`, `interaction_spec` included. A change of content remounts; rows compare by reference. | +| `interactions` | Factory calls added to the spec's entries, or `(fromSpec) => definitions` for the full list. A factory rebuilt with the same id and options keeps the chart; a changed option remounts it. | +| `updates` | Host updates, diffed by id. Passing even `[]` mounts the runtime on a chart with no interactions. | +| `width`, `height`, `fit` | The box. `fit` is `scale-down` (default; never scales up), `crop` (natural size, clipped), or `relayout` (the box becomes the layout room; a resize remounts once it settles, so a selection does not survive it). | +| `onChange`, `onInteraction` | The state after a change, and the raw gesture record. | +| `onRender`, `onWarnings`, `onError` | Each mount's render and warnings; a failed mount, shown in the box as a muted error. | +| `fallback` | Shown until the chart mounts. | +| `ariaLabel`, `chartId` | `ariaLabel` applies in place; a new `chartId` remounts. | + +The ref's `FlintChartHandle` holds `surface` (the mounted surface or `null`), +`applyUpdate`, `clearUpdate`, `dispatch`, `getState`, and `refresh`. A remount +keeps the old chart on screen until the new one is ready. + +## Read the chart + +| `getState()` field | Holds | +| --- | --- | +| `selected` | The marks the chart emphasizes now, previews included. | +| `entries` | The same marks per update id, with `layer: 'retained' \| 'preview'`. | +| `hidden` | Legend values a `legend-toggle` hides, as `{ channel, value }`. | +| `viewport` | The domain on view after a pan or zoom; absent on a chart that does not navigate. | +| `categoryOrder` | The order of the reorderable axis now. | +| `windows` | Category rail windows, `{ start, count, total }` per channel. | + +Each element's `value` is the mark in field terms: a bar's category and +measure, a legend item's `{ channel, field, domain }`, a histogram bar's +`{ field, range }`. The host owns the rows and queries them from the value and +the geometry. + +`onChange` fires after every render with a `ChartChange`: `phase` (`preview` +while a gesture runs, `commit` for a committed change or a host call, `cancel` +when a gesture ends with nothing), `interactionId` and `action` (absent for a +host call and for a reset), the gesture's own `target` and `geometry`, and the +`state` after. An overlay or a data swap leaves no trace in the state, so the +host keeps that model itself. + +```ts +const valuesOf = (elements: readonly SemanticElement[]) => elements.map((element) => element.value); + +// A panel follows the gesture live, else shows what the chart shows. +surface.onChange(({ phase, target, state }) => { + const hit = valuesOf(target?.elements ?? []); + panel.show(phase === 'preview' && hit.length > 0 ? hit : valuesOf(state.selected)); +}); + +// An agent context reads committed state only: values and ranges, never rows. +surface.onChange(({ phase, state, geometry }) => { + if (phase !== 'commit') return; + sendContext({ selected: valuesOf(state.selected), range: geometry?.domain, hidden: state.hidden, viewport: state.viewport }); +}); +``` + +The container also emits a bubbling DOM event, `flint-interaction`, for every +canvas interaction, before the chart reacts: `detail.chartId`, +`detail.interactionId`, and `detail.event`, the same `CanvasInteractionEvent` +a handler gets. It fires for a definition whose `handle` returns `null`, so it +is the path for a host that draws its own response to a gesture. + +Things the surface holds fixed: no preset changes the layout, so a zoom never +recomputes the bar step, the ticks, or the domain (filter the rows and mount +again for that); the mute level is set at mount; Escape reaches a chart after +a press on it, and only that chart; a preset's toggle (`select`, +`click-highlight`) needs Shift, Ctrl, or Meta, and a plain second click +replaces; a press on an overlay path resolves to no mark, so a `click-none` +reset on the definition that drew the overlay clears it at that press. + +## Apply updates and read the result + +`applyUpdate`, `setUpdates` and `dispatch` take the same `{ id, ops }` layers +as the interaction skill's "Update the chart", and return what applied. +**The result.** `applyUpdate`, `setUpdates`, and `dispatch` return a +`ChartUpdateResult`: `{ status: 'applied' | 'partially-applied' | +'unsupported', resolvedTargets, unresolvedTargets, unsupportedOps }`. An +unresolved target has a wrong field or value; an unsupported op needs a +preset the chart does not mount. What the chart shows is what the result says +it shows: fix an unresolved key or drop an unsupported op before describing +the chart. + +## Link charts + +`linkCharts` links mounted charts on the fields they share. A selection on one +chart (a click, a brush, a group focus, a hover) becomes one condition, a part +per field; every chart emphasizes the marks that meet it, the source included, +through one `linked-selection` layer; a reset on any chart clears it everywhere. + +```ts +import { linkCharts, mountChart, clickHighlight, brushX } from 'flint-chart/interactive'; + +const link = linkCharts({ + bars: { input: barsInput, surface: mountChart(barsEl, barsInput, { backend: 'vegalite', interactions: [clickHighlight()] }) }, + trend: { input: trendInput, surface: mountChart(trendEl, trendInput, { backend: 'vegalite', interactions: [brushX()] }) }, +}, { fields: ['region', 'month'] }); +for (const [id, chart] of Object.entries(await link.links)) console.log(id, chart.notes); // what each chart left out +link.onCondition(({ condition }) => table.filter(condition)); // { region: { in: ['Asia'] }, month: { range: [start, end] } } +// link.clear(); link.destroy(); +``` + +**A table, a filter or any control beside linked charts** joins the same +condition: `link.select(parts)` sets parts as if a chart had selected them, and +`onCondition` gives the table what to show. One condition, so a row click, a +region picker and a brush combine (AND) and a reset on any chart clears them all. + +```ts +row.addEventListener('click', () => link.select({ country: { in: [row.dataset.country] } })); +regionPicker.addEventListener('change', (e) => link.select({ region: e.target.value ? { in: [e.target.value] } : null })); // null lets go +link.onCondition(({ condition }) => renderTable(rows.filter((r) => meets(r, condition)))); +``` + +- `select` only takes fields in `fields`; a chart shows a part when its marks + carry the field (encode it, or put it on `detail`). +- The link emphasizes the matching marks; to drop rows instead (a filter), give + the charts filtered data as below. + +```tsx +import { FlintChart, useLinkedCharts } from 'flint-chart/react'; + +const link = useLinkedCharts({ bars: barsInput, trend: trendInput }, { fields: ['region', 'month'] }); +; +// link.select({ region: { in: ["Asia"] } }) from a table or control; link.clear() +; +// the chart's own onChange, onRender and updates go through chart(id, own); a prop after the spread replaces the link's +// link.condition.condition is the same condition; filtered rows in `spec` keep it +``` + +- A chart receives a field when its marks carry it (encode it, on `detail` if + nothing else shows it), and sends through each selecting interaction whose + subject includes a connected field. `{ charts: { trend: { receive: false } } }` + keeps a chart as drawn; `send: false` keeps its selections to itself. +- The link emphasizes; it never filters or re-aggregates. To filter, read the + condition (`onCondition`, `link.condition`) and give each chart its rows: + beside `linkCharts`, a `set-data` update (a new spec remounts the chart, and + the link holds the old surface); beside `useLinkedCharts`, a `spec` with the + filtered rows. +- `setUpdates` replaces every layer, the link's included, until the condition + next changes; use `applyUpdate` and `clearUpdate` beside a link. +- `linkCharts` checks the charts with the validator, loaded on first use; pass + `{ links }` from `validateLinks` (`flint-chart/validate`) to skip that load. + +For a link `linkCharts` does not express (a payload each chart reads its own +way), wire `onChange` to an `externalInteraction` on the other charts: + +```ts +const linked = externalInteraction<{ countries: string[] }>({ + id: 'linked', + handle: ({ countries }) => ({ + id: 'linked', + ops: [{ op: 'set-style', targets: [{ select: { where: { Country: { in: countries } } } }], value: { state: 'emphasized' } }], + }), +}); +source.onChange(({ phase, interactionId, state }) => { + if (phase !== 'commit' || !interactionId) return; // host writes carry no id: no loop + void other.dispatch('linked', { countries: state.selected.map((element) => String(element.value.Country)) }); +}); +``` + +Linked charts share one `theme_spec` so a value has one colour everywhere. + +The same `dispatch` drives a chart over time: a playback loop dispatches one +frame per animation frame, and the handler returns the whole layer for that +frame. + +## When no preset fits + +A host that runs code mounts a `CanvasInteractionDef` in `options.interactions` +beside presets: a trigger, what it affords, and a handler that returns the +layer for its id. + +```ts +import { rectangleTrigger, type CanvasInteractionDef } from 'flint-chart/interactive'; + +const timebox: CanvasInteractionDef = { + id: 'timebox', + eventSource: rectangleTrigger('contain'), + affordances: { plot: { cursor: 'region' } }, + reset: ['click-none', 'escape'], + handle(event) { + if (event.action !== 'select-region' || event.phase !== 'commit') return null; + const x = event.geometry.domain?.x; + const y = event.geometry.domain?.y; + if (x?.kind !== 'interval' || y?.kind !== 'interval') return null; + const keep = seriesInsideBox(x.start, x.end, Number(y.start), Number(y.end)); // host logic over host rows + return { + id: 'timebox', + ops: [{ op: 'set-style', + targets: keep.map((series) => ({ select: { key: { Series: series } } })), + value: { state: 'emphasized' } }], + }; + }, +}; +``` + +| Field | Role | +| --- | --- | +| `id` | Names the interaction in events and the layer it retains. | +| `eventSource` | The trigger: what to capture and how to read it. | +| `affordances` | The kinds of hit the handler receives, each with its cursor and hover; a hit of a kind not listed never reaches it. Keys: `mark`, `legend-item`, `axis-label`, `plot`. Cursors: `activate`, `drag`, `region`, `navigate`, `inspect`, `draw`. Hovers: `target` (the mark), `cohort` (its group). | +| `handle(event, context)` | Returns the whole layer for this id, or `null` for no change. | +| `reset` | Gestures that clear the layer: `click-none`, `double-click`, `escape`. A reset reports as a commit with no `interactionId`. It suits a layer of styles the state shows; an overlay or a data layer is cleared by the host. | + +**Triggers.** + +| Trigger | The reader does | `action` | `geometry.plot` | `geometry.domain` | Affordance key | +| --- | --- | --- | --- | --- | --- | +| `clickTrigger` | Clicks a mark, legend item, or axis label. | `click-element`, `click-legend`, `click-axis` | `point` | — | `mark`, `legend-item`, `axis-label` | +| `hoverTrigger` | Moves over a mark. | `hover-element`, `hover-legend`, `hover-axis` | `point` | — | same | +| `dragTrigger(tolerance?)` | Presses a mark, or a projectable overlay path, within `tolerance` px (12) and drags. | `drag` | `drag { start, current, delta }` | the pointer's values; `geometry.projection` while over a projectable overlay | `mark` | +| `rectangleTrigger(match?, guide?)` | Drags a rectangle. | `select-region` | `rect` | `x`, `y` intervals | `plot` | +| `xBrushTrigger(match?, mode?, guide?)`, `yBrushTrigger(…)` | Drags an interval along one axis. | `brush-x`, `brush-y` | `rect` | that axis's interval | `plot` | +| `lassoTrigger(match?, guide?)` | Draws a freehand region; previews begin at the third point. | `select-lasso` | `polygon` | `points`: the stroke so far, in data values | `plot` | +| `angularBrushTrigger(match?, mode?, guide?)` | Drags a sector on a polar chart. | `brush-angle` | `angular-sector` | — | `plot` | +| `inspectTrigger(mode?)` | Moves over the plot. | `inspect-x`, `inspect-y`, `inspect-xy` | `point` | `x`, `y` values | `plot` | +| `inspectIndexTrigger(axis?, show?, seriesBy?)` | Moves along the index axis. | `inspect-x`, `inspect-y` | `point` | the index value | `plot` | +| `navigationTrigger({ axes?, pan?, zoom?, reset? })` | Drags, wheels, pinches. | `pan-viewport`, `zoom-viewport`, `reset-viewport` | `viewport { delta, factor, anchor }` | the viewport after the move | `plot` | +| `contextTrigger`, `longPressTrigger(ms?)`, `doubleActivateTrigger` | Right-clicks, holds (500 ms), double-clicks a mark. | `context-element`, `long-press-element`, `double-activate-element` | `point` | — | `mark` | + +`match` is `'intersect'` (default) or `'contain'` and decides which marks the +region's `target` lists. `guide` styles the drawn shape; `false` hides it. A +region is ephemeral: its guide and its preview end at the commit. A brush or +`select` with `mode: 'stateful'` keeps its region on screen and editable, and +`event.operation` reads `create`, `move`, `resize-leading`, `resize-trailing`, +or `clear`. Spread a trigger to tune it: +`{ ...hoverTrigger, defaultAssistDistance: 28 }` acquires the nearest mark +within 28 px. A chart admits a trigger when it offers what the trigger needs, +per what `list_interaction_presets` says each preset requires; a code definition the chart cannot honour throws at +mount with a message that names what it needed. + +**The event.** + +```ts +interface CanvasInteractionEvent { + action: string; // from the table + phase: 'start' | 'preview' | 'commit' | 'cancel'; // clicks and hovers skip start + operation?: string; // a stateful brush's edit, or pan | zoom | reset + geometry: { plot?, domain?, projection? }; + target: { visual: { kind, role }, elements: [{ value, records? }] } | null; + modifiers?: { shift, ctrl, meta }; + description?: { kind, type, content, text }; // on focus-element from accessible-navigation +} +``` + +- `target.elements[i].value` holds the mark's encoded values, derived fields + included; `records` holds the source rows when the runtime can prove them. A + region target lists every mark inside. A legend hit's `value` is a + `LegendTargetValue`: `{ channel, field, domain: { kind: 'value', value } }`, + or `{ kind: 'interval', start, end }` on a continuous legend. An axis-label + hit's `value` is an `AxisTargetValue`: `{ axis, field, value }`. +- `geometry.domain` is inverted through the plot's scales: a brush on a time + axis gives `domain.x = { kind: 'interval', start: Date, end: Date }`, a linear + axis gives numbers, a discrete axis gives the category. +- `description` arrives on `focus-element` while `accessible-navigation` walks + the chart: what the focused element is (`type`, such as "Bar") and what it + represents (`content`), with the spoken `text`. The walk's emphasis reports + through `onChange` as a `preview`. +- `geometry.projection.kind === 'path'` during a drag over an overlay with + `projectable: true`: `segment.start.value` and `segment.end.value` are the + overlay rows on each side of the pointer and `segment.t` the fraction between + them. + +**The types.** `flint-chart/interactive` exports these, and `flint-chart/react` +re-exports them. `onChange` receives a `ChartChange`: the gesture's own +`target` and `geometry`, and the chart's `state` after it. Generated from the +source by `npm run gen:reference`: + + +```ts +interface ChartChange { + // `preview` while a gesture runs, `commit` for a committed change, `cancel` when a gesture ends with none. + phase: ChartChangePhase; + // `host` for `updates`, `applyUpdate`, `clearUpdate` and `dispatch`; always `commit`. + source: ChartChangeSource; + changed: ChartStateFacet[]; + // The interaction behind the change: a reader's gesture, or an external interaction run by `dispatch`. + interactionId?: string; + action?: CanvasInteractionAction; + // The gesture's own hit: the hovered point, or the marks at an inspected index. + target?: SemanticTarget | null; + // The gesture's geometry: a brushed range, an index value, or the viewport after a move. + geometry?: CanvasInteractionEvent['geometry']; + // The reset gesture a reader made: a click on nothing, Escape, or a double-click. Reported even when the chart held nothing to reset, so a host that shows a selection of its own can let it go. + reset?: InteractionResetGesture; + state: ChartState; + previous: ChartState; +} + +interface ChartState { + chartType: string; + // The marks the chart emphasizes or focuses now, previews included. + selected: SemanticElement[]; + // The emphasized marks of each update, by update id; `selected` is their union. + entries?: ReadonlyMap; + // The legend values a toggle hides now. + hidden?: ChartHiddenValue[]; + // The domain the plot shows now, when the chart navigates. + viewport?: DomainGeometry; + // The category window of each rail. + windows?: Partial>; + categoryOrder?: unknown[]; + // The notes the chart holds now, previews included; `inView` tells which ones it draws. + annotations?: ChartAnnotation[]; + // The active filter of each field, set by filter controls; absent fields show every value. + filters?: Readonly>; +} + +interface SemanticTarget { + visual: { + kind: 'mark' | 'path' | 'region' | 'widget' | 'handle' | 'legend' | 'axis' | 'chart' | 'title' | 'header'; + role: string; + }; + elements: SemanticElement[]; +} + +interface SemanticElement { + // Values represented by the mark's channels, or by a semantic control such as a legend item. + value: Record; + // Contributing input records when provenance is available; zero or many may support one value. + records?: Record[]; +} + +interface LegendTargetValue { + channel?: string; + field?: string; + // The entry's value on a reader's hit; read `domain`, which every legend target carries. + value?: unknown; + domain: LegendDomain; +} + +type LegendDomain = + | { kind: 'value'; value: unknown } + | { kind: 'interval'; start?: number; end?: number }; + +interface AxisTargetValue { + axis: 'x' | 'y'; + field: string; + value: unknown; +} + +interface DomainGeometry { + x?: DomainCoordinate; + y?: DomainCoordinate; + points?: DomainPoint[]; + // The detail level a multi-level projected chart draws for this viewport. + level?: string; + // On a multi-level projected chart, the coarsest-level region under the plot centre: its feature id and properties plus the joined row fields. + focus?: Record; +} + +type DomainCoordinate = + | { kind: 'value'; value: DomainValue } + | { kind: 'interval'; start: DomainValue; end: DomainValue }; + +type DomainValue = number | Date | string; + +interface DomainPoint { + x?: DomainValue; + y?: DomainValue; +} + +interface ChartHiddenValue { + channel: string; + value: unknown; +} + +type FilterValue = + | { in: unknown[] } + | { range: [unknown, unknown] }; +``` + +- `context` is the chart state plus `available`, every drawn mark, for + building refs, and `selected`, the current emphasis, for a toggle rule. + +**The handler.** + +- It returns the complete layer for the id on every `preview` and `commit`; + the runtime drops the preview on `cancel`. A `null` on a `preview` shows + nothing until the commit, which is how a rule applies to the committed box + only. A region gesture keeps a preview layer under the interaction's id + while the drag runs, so a commit after previews restates the layer; a + `null` there lets the last preview stand. +- It maps geometry to the host's model and the model to ops. Host side + effects (state, panels, overlays the host draws) come from + `flint-interaction` or `onChange`, which carry the same event; the handler + itself returns ops and leaves the DOM to the runtime. +- Triggers have one owner for code definitions as for presets; two code + definitions on one trigger throw at mount. `navigate({ pan: false })` goes + beside a region trigger. +- An element drag owns the press on the marks it affords. A press there is a + `drag` with phase `start`; `target` is the pressed mark through every phase. + The layer returned at `start` is kept as the gesture's preview, and a release + without movement commits that preview with no further call. No click + definition fires on those marks, so the definition that drags a mark also + answers its press. +- A click definition that affords `hover` on marks receives `preview` events + for the hover cue. Return `null` or an emphasis for them, and the layer on + `commit`. + +**Patterns.** + +| Pattern | Flow | Pieces | +| --- | --- | --- | +| Gesture rule | Flint in, Flint out | A region trigger reads `geometry.domain`; the host rule picks rows; `set-style` by key (the timebox above). | +| Host-drawn detail | Flint in, custom out | `hoverTrigger` or `inspectTrigger` with a `null` handle; the host listens to `flint-interaction` for the resolved element and draws a lens, a cursor, or a badge over the mount. | +| Application drives the chart | external in, Flint out | `externalInteraction` plus `dispatch` per frame: a playback year, a reveal progress. | +| Drag along a path | press, then drag | One `dragTrigger()` definition and one layer. At `start` on a mark it returns the mark's path as a `set-overlay` `line` with `interactive: true, projectable: true` and `order`, plus `set-data` for the current position. On `preview` and `commit` with `geometry.projection` it returns the same two ops for the pointer's position. `intrinsicDomain` on the x and y fields holds the axes still across the swaps. | +| Freehand stroke | draw | The rows to guess form their own series, and a mount update sets `opacity: 0` on that series, which keeps the axis. `lassoTrigger('contain', false)` with `plot: { cursor: 'draw' }` is the pen: `geometry.domain.points` become the rows of a `set-overlay` line. An `externalInteraction` reveals the truth as an overlay, then the host clears the hide. | +| Chart-level zoom | wheel | When the layout itself must change (bar step, ticks, domain), filter the rows and `mountChart` again in a hidden layer; swap on `ready`. No preset re-lays out. | +| Semantic zoom on a map | navigate | A Choropleth with `level: 'auto'` (US states, then counties) or with your own `levels: [{ value, url, feature?, enter?, exit? }]` (one GeoJSON or TopoJSON object per level, rows joined on the feature `id` or `featureKey`, `baseMapUrl` drawn beneath as land without data), or a Map with `levelField` and `levels`; `navigate()`, and `set-viewport { region: { key } }` with a `transition` to fly into a region. Navigation events carry `geometry.domain.level` and `focus` (the coarsest region under the centre). A hover reaches the host through a hover affordance (`hover: 'target'`); a handler that returns `null` leaves the map as drawn. | + +Host-drawn detail, the shape of it: + +```ts +const probe: CanvasInteractionDef = { + id: 'probe', + eventSource: { ...hoverTrigger, defaultAssistDistance: 28 }, + affordances: { mark: { hover: 'target' } }, + handle() { return null; }, +}; +container.addEventListener('flint-interaction', (e) => { + const { interactionId, event } = (e as CustomEvent).detail; + if (interactionId !== 'probe' || event.phase !== 'preview') return; + const row = event.target?.elements[0]?.records?.[0]; + if (row) lens.show(row); // the host draws; the chart is unchanged +}); +``` + +## Worked examples + +### A chart that drives the app + +User: "In my dashboard, a click selects the country and a double-click opens +its page. Zooming the y axis would help too." A scatter of `gdp` by `life` +with `color: continent` and `detail: country`. + +`navigate` holds the double-click by default for its reset, and +`double-activate` needs it; `reset: ["escape"]` frees it. `click-highlight` +takes `targets: ["mark"]` so the app's selection comes from marks only. + +```json +{ + "interactions": [ + { "type": "click-highlight", "options": { "targets": ["mark"] } }, + { "type": "double-activate" }, + { "type": "navigate", "options": { "axes": "y", "reset": ["escape"] } } + ] +} +``` + +The app reads the selection from `onChange` on a `commit` whose `action` is +`click-element`, and the activation from one whose `action` is +`double-activate-element`. + +### Code: two linked charts + +Two bar charts share a `Country` field: GDP per country, and population per +country. A click on one emphasizes the same country on both. + +```ts +import { mountChart, clickHighlight, linkCharts } from 'flint-chart/interactive'; + +const mount = (el: HTMLElement, input: ChartAssemblyInput) => + ({ input, surface: mountChart(el, input, { backend: 'vegalite', interactions: [clickHighlight({ targets: ['mark'] })] }) }); +const link = linkCharts({ gdp: mount(gdpEl, gdpInput), population: mount(popEl, popInput) }, { fields: ['Country'] }); +``` + +The clicked chart drops its own emphasis once the link shows the condition, so +both charts show one selection. A `click-none`, Escape, or double-click on +either chart clears it on both; the link's own writes are host changes, so no +chart echoes them back. + +### Bespoke: a rule over the brushed box + +A line chart of `Series` by `Month`. The reader drags a box; the series whose +every point in that month range lies inside the y range stay emphasized. No +preset applies a rule over series, so the definition is the `timebox` above: +`rectangleTrigger('contain')`, a `plot` affordance with the `region` cursor, +a handler that acts on `select-region` at `commit`, and `reset: +['click-none', 'escape']` so a click on empty plot clears it. It mounts beside +`navigate({ pan: false })` when the chart also zooms, since both ask for the +plot drag otherwise. + +## Validation checklist + +1. Every trigger, cursor, and field name is one from this skill or the + installed `flint-chart/interactive` types. +2. Every definition declares `affordances` for the hits its trigger yields. +3. No two definitions, and no definition and spec entry, share a trigger or + an `id`. +4. The surface is destroyed on unmount, and every `applyUpdate` or `dispatch` + result is read. + diff --git a/agent-skills/flint-board-author/SKILL.md b/agent-skills/flint-board-author/SKILL.md index 0c92b01e..a3be97f6 100644 --- a/agent-skills/flint-board-author/SKILL.md +++ b/agent-skills/flint-board-author/SKILL.md @@ -1,24 +1,31 @@ --- name: flint-board-author -description: "Use when: several Flint charts should be read together in one view: a dashboard, KPI tiles over a trend, a side-by-side comparison, an overview with its detail; or a board on screen should change (add, retitle, resize, reconnect a chart). Produce one board spec whose headline, chart choice, layout and connected fields are decided, check and refine it with validate_board, then put it on screen once with show." +description: "Use when: several Flint charts should be read together in one view: a dashboard, KPI tiles over a trend, a side-by-side comparison, an overview with its detail; or a board on screen should change (add, retitle, resize, reconnect a chart). Produce one board spec whose headline, chart choice, layout and connected fields are decided, and put it on screen with show, which checks it and returns any fixes before drawing." --- # flint-board: several charts, one view A board holds several Flint charts under one headline. The agent writes it as -one board spec, checks it with `validate_board`, which draws nothing, and puts -it on screen with `show({ "board": … })`, which opens a new card below the -conversation's latest message. The server keeps nothing between calls: the spec -in the conversation is the board. So call `show` once a turn, after the board -is right; to change it later, change the spec and call `show` again. +one board spec and puts it on screen with `show({ "board": … })`, which opens a +new card below the conversation's latest message. `show` checks the spec +first: when something must be fixed it draws nothing and returns the fixes, so +there is no need to validate first. The server keeps nothing between calls: +the spec in the conversation is the board; to change it later, change the +spec and call `show` again. + +A board is for when the user asks for several views read together: a +dashboard, an overview, KPI tiles, linked charts, or several charts named in +one turn. An open question is not a request for a board: it gets one chart +(the `flint-chart-author` skill), and the reply offers the next views. One view split by a category +(a panel per region, same measure) is one chart with `column` or `row`, not a +board. Two charts side by side need only a title; the headline, deck, KPI +tiles and links below are for a fuller board, used as far as it helps. Each chart on a board is a full chart spec (`flint-chart-author`), plus an `id` and a `layout`. This skill covers what a board adds: the headline, which charts, where they sit, how they connect, and how they look as one piece. -Work through the steps in order. A board is ready to show when its latest -report shows no `✗` and its `Review:` section is empty or says only that a -colour field is shared. +Work through the steps in order, then call `show` once. ## Step 1 — write the headline @@ -42,6 +49,18 @@ Start from the questions the reader brings, one chart per question, and keep the board to the charts that answer them: three to five KPI tiles and up to six charts. More than that is two boards. +Each card has to answer something no other card on the board answers: + +- Two charts of the same fields (the same measure by the same category, in + another form or sort) are one chart. +- A KPI tile is for a number the reader steers by and no chart prints. A + count of the rows ("12 albums") or a number a chart already shows at a + glance is not a tile. +- Small data holds few questions. A table of a few dozen rows or less makes + one or two charts, and tiles only where the user asked for them. +- An open request ("an overview", "a dashboard on …") takes the three or four + questions the data answers best, not every one it can. + | The reader asks | Chart | |---|---| | How are we doing on the numbers we steer by? | `KPI Card` per number, with `goal` when there is a target | @@ -104,20 +123,32 @@ not KPI tiles). Charts fill rows in the order given: | Many small series | one `Sparkline` chart, `height: compact` or `standard` | On a narrow card each chart takes its own row; the layout needs no second version. +`layout` is the only size a board chart takes: leave `baseSize` and `canvasSize` +out of its `chart_spec`, which the board does not use. **`view: "table"`** on a chart opens its cell on the table of the rows the chart draws; the reader can switch it back. Use it when the numbers matter more than the shape. A `Table` is a table either way. -## Step 5 — connect them +## Step 5 — connect them, where it helps -Connect the charts by the fields they share, not chart by chart: +Link charts when a selection in one should show up in the others: the user +asks to filter or explore across them, or the board is a dashboard on shared +dimensions. Charts that only sit side by side need no `link_spec`, and no +interactions either: on a board, a chart's `interaction_spec` is what sends a +selection, so add one only to a linked chart, or where the user asked for that +behaviour on that chart. Connect by the fields they share, not chart by chart: ```json "link_spec": { "fields": ["product", "region"] } ``` +A link emphasises; it never filters. The matching marks stay at full ink and +the rest recede, while every total, axis and KPI tile stays as drawn. When the +user asks for a click to filter the other charts, link them and say in the +reply that the other charts highlight the selection rather than recompute. + The board holds one selection that every chart shares, a part per field: a click on Asia sets `region` to Asia, a brush over March to June then adds `month` from March to June, and every chart shows the marks that meet both @@ -139,14 +170,18 @@ far as it can: - **It receives a field** when its marks carry it. Marks carry the fields the chart encodes; when a chart shows the field nowhere else, encode it on - `detail` (`encodings.detail: "product"`). + `detail` (`encodings.detail: "product"`). A bar chart of another category + then splits each bar into segments of its colour, one per value, so a + selection lights up that value's share of every bar; never move the field to + `color` for this. Titles and subtitles say what a chart shows, never how it + links. - **It sends** when it also has an interaction that selects, in its `interaction_spec`; pick the one whose subject is what the reader will ask about: | Chart | Interaction | |---|---| - | Bar, Stacked Bar, Pie, Heatmap | `click-highlight` | + | Bar, Stacked Bar, Pie, Heatmap, Choropleth, Map | `click-highlight` | | Line | `click-group-focus` (a series), `brush-x` (a period), `hover-group-focus` (a series, on hover) | | Scatter Plot | `select` (drag a region) | @@ -159,10 +194,11 @@ why a field is left out. Colour does the quiet linking: charts that colour by the same field (on `color`, or `group` on a grouped bar chart) get one value order, so a value -keeps one colour across the board. Colour each chart -by the same field as the others when it shows the same categories, and give -it the same set of values, since a chart missing a value shifts the colours -after it. +keeps one colour across the board. To fix the colours themselves, set `colors` +on the board, per field: `"colors": { "Category": { "Jewelry": "#c0392b" } }`. +Every chart that colours by the field takes them, whatever theme the board or +the reader picks; values left out take the palette. Pass the same map again in +a later turn so the next card keeps them. ## Step 6 — theme the board once @@ -171,21 +207,25 @@ draws its own furniture (the Economist's red tab); the board's headline and footer take its paper, ink and fonts, with the furniture above the headline. Pick it with `list_themes` as for one chart. -## Step 7 — read the report and refine +## Step 7 — read the report -`validate_board` returns the board as the model must judge it, and `show` -returns the same report: +`show` returns the layout in one line, then at most two sections. It does not +repeat the spec. -- `Layout:` the rows as the card draws them. Check that the lead chart sits - where the headline points and no row holds an orphan. -- `## ` per chart: its encodings and each update op, `✓` or `✗`. -- `Links:` what each chart sends and receives, `✓`, or `✗` when it joins no field, with the fix. -- `Review:` what the board should still fix: a missing headline, deck or chart - title, too many tiles or charts, themes set per chart. +- **Fix before it draws.** Nothing is on screen: errors (a chart that does + not compile), rows drawn as slices (sum them first), a chart that has a + linked field in its data but does not carry it, a link field fewer than two + charts carry. Fix each in the spec and call `show` again with the whole + spec. An item you cannot fix, such as an interaction a chart cannot take, is + something to tell the user. +- **Noted.** The board is on screen and draws with these: warnings, update + ops that will not apply, what linked charts leave out, and a review (a + missing deck or chart title, more tiles or charts than a board reads well + with). Change nothing now unless the user asks; mention what matters in the + reply, and fix the rest the next time the spec changes. -Fix each `✗` and each review note in the spec, check it again if the fix was -large, then call `show` once with the same spec. A chart with errors is left -off the report's board, and `show` draws nothing until every chart is valid. +`validate_board` gives the same report without drawing, for a host with no +card UI. What the reader then does on the card reaches the model with their next message: selections and link emphasis, one section per chart. The reader's @@ -196,7 +236,7 @@ the next `show`: `theme_spec` on the board and leave it out of the charts. - **An arrangement** made with **Edit layout** (moving, swapping, resizing charts on a 12-column grid). To keep it, pass the `grid` the context gives. - `Layout:` then reads "Arranged on a 12-column grid". A chart added to the + `Layout:` then reads "the reader's grid". A chart added to the spec takes a place below the rest and a chart left out drops its place; leave `grid` out to lay the board out in rows again, only when the user asks for a new layout. @@ -206,7 +246,7 @@ them gives the reader back the agent's theme and rows. ## Worked example -The board spec, passed as it is to `validate_board`, then as `board` to `show`: +The board spec, passed as it is as `board` to `show`: ```json { @@ -248,9 +288,9 @@ on a region's line lights that region on the bars and the scatter. - [ ] `title` says the finding or the purpose; `subtitle` says data, scope, period, units; `source` is set. - [ ] Three to five KPI tiles at most, up to six charts, the lead chart first after the tiles. -- [ ] Every chart but a KPI tile has a one-line `title` and a units `subtitle`. +- [ ] On a board of three or more charts or with KPI tiles, every chart but a tile has a one-line `title` and a units `subtitle`. - [ ] `layout` set where the default is wrong: the lead chart wide, a comparison at equal spans and heights. -- [ ] `link_spec.fields` names the shared dimensions; each chart that should take part encodes them and, to send, has the interaction whose subject the reader asks about. +- [ ] If the charts are linked: `link_spec.fields` names the shared dimensions; each chart that should take part encodes them and, to send, has the interaction whose subject the reader asks about. - [ ] `theme_spec` on the board only. -- [ ] `validate_board` reports no `✗` and no review note left but the shared colour field. +- [ ] `show` drew the board; what it noted is in the reply where it matters. - [ ] In a later turn: the reader's theme and `grid` from the context are kept unless the user asked to change them. diff --git a/agent-skills/flint-chart-author/SKILL.md b/agent-skills/flint-chart-author/SKILL.md index 295f40c7..7400c696 100644 --- a/agent-skills/flint-chart-author/SKILL.md +++ b/agent-skills/flint-chart-author/SKILL.md @@ -3,7 +3,12 @@ name: flint-chart-author description: "Use when: the user asks to make or render charts with flint-chart, visualize tabular data, generate a ChartAssemblyInput, validate/render through MCP, or add Flint to a JS/TS project. Author the semantic spec, transform data before Flint when needed, install/import Flint only when executable code is needed, and reserve backend-specific style tweaks for after compiling from Flint." --- -# flint-chart: authoring and using a chart spec +# flint-chart: authoring a chart spec + +You write a `ChartAssemblyInput`: the data, the `semantic_types` of its +fields, and a `chart_spec` naming the chart type and which field goes on +which channel. Flint compiles it to Vega-Lite, ECharts, Chart.js or Plotly and +decides the rest (scales, formats, layout, colours) from the semantic types. ## What you produce (and what you do NOT) @@ -16,11 +21,8 @@ or `assembleChartjs` to get a backend spec. - **DO** emit `chart_spec` (chart type, channel→field mapping, properties) and `semantic_types` (field → semantic type). -- **DO** add `interaction_spec` when the user asks for behaviour (highlight, - legend toggle, pan and zoom, brush), asks for an interactive chart, or the - session's goal is to explore the data. List presets by name; see - "Interactions", and load the `flint-interaction-author` skill for an intent, - an interactive chart with nothing named, or a combination. +- **DO** add `interaction_spec` or `updates` only for a reason (see + "Interactions and updates"). - **Reference columns by name.** How `data` itself gets bound depends on the situation — a URL, a host-side variable, or embedded rows (see "How data gets bound"). Embedding is fine for small tables; just don't @@ -30,93 +32,62 @@ or `assembleChartjs` to get a backend spec. filtering, joins, pivots, derived columns, or long/wide reshaping beyond Flint's built-in static-series fold, use a coding, notebook, SQL, or data tool first. Then author the Flint spec against the transformed table. -- **Style after Flint, only when needed.** Author structure in Flint. For a - presentation tweak Flint does not express (a reference line, annotation, or - shaded band), use the Vega-Lite escape hatch — see "Post-Flint style - customization". Never feed edited Vega-Lite JSON back to `render_chart`. - -## When the user wants more than a spec - -First decide which workflow the user is asking for: - -- **Spec authoring only:** return a `ChartAssemblyInput` or its - `semantic_types` + `chart_spec` pieces. Do not install packages or write - renderer code unless asked. -- **MCP chart output:** if Flint MCP tools are available, **default to - `validate_chart` then `show`** whenever the user asks to see a chart. - `validate_chart` checks the spec and returns a report without drawing; fix - what it asks in the spec, then call `show({ "chart": … })` once with the - whole spec, which opens an interactive, live-rendered card with a - customization panel. The server keeps nothing between calls: the spec in - the conversation is the chart. Only fall back to `render_chart` (PNG/SVG) - when the host has no App UI support or the user explicitly wants a static - image. Use `compile_chart` when the user wants backend-native JSON, and - `list_chart_types` when you need the supported chart catalog. -- **DO** pass `updates` beside the input to `validate_chart` and `show` when the user - asks the chart to open in a state: rows to stand out, a note on a mark, a - framed range. It is a list of ChartUpdate layers, state not behaviour; the - shapes are in `flint://interaction-skill` under "Update the chart". To change a - chart in a later turn, change its spec or `updates` and call `show` again: a - new card shows it, earlier cards stay as they were. The reader's edits in the - card's panel live on that card; its context gives the `chart_spec` that keeps - them, so pass it unless the user asked for something else. -- **DO** pass `view: "table"` to `show` when the user wants to see - a chart's numbers: the card opens on the table of the rows the chart draws, - and the reader can switch to the chart. When the user wants records listed and - no chart at all, use `chartType: "Table"` instead. -- **Project integration, only when the user asks for code:** add Flint to an - app, notebook, script, or agentic product, install/import the library, and - call an assembler in code. Keep the same `ChartAssemblyInput` contract, then - let the host render the backend result. - -For MCP clients, the server can run with `npx`: - -```bash -npx -y flint-chart-mcp -``` - -For JavaScript or TypeScript projects, install Flint first and add only the -renderer peer dependencies needed by the backend you will render: - -```bash -npm install flint-chart -npm install vega vega-lite vega-embed # browser Vega-Lite rendering -npm install echarts # ECharts rendering -npm install chart.js # Chart.js rendering -``` - -Then compile with the requested backend: +- **Style after Flint, only when needed** (see "Post-Flint style + customization"). Notes, shaded regions, emphasis and reference lines are + Flint `updates`, not style edits. + +## On the Flint MCP server + +- **Show it.** When the user asks to see a chart, pass the whole spec to + `show({ "chart": … })`: a live card with an editing panel. There is no + need to validate first: `show` checks the spec, and one with errors draws + nothing and returns them, so fix and call `show` again. What it notes + (warnings, update ops that will not apply) is drawn with; change nothing + now unless the user asks, and fix it the next time the spec changes. + `validate_chart` gives the same report without a card, for a host with no + card UI. +- **The lightest view that answers.** One question is one chart. An open + question ("how did X do", "what does this data say", "tell me something + interesting") gets the one chart that answers it best, or two side by side + only when it has two halves; name in your reply what else you could show, + and draw it when the user asks. One view split by a category (a panel per + region, same measure) is still one chart: put the category on `column` or + `row`. A board is for when the user asks for one (a dashboard, an overview, + KPI tiles, linked views, or several charts named in one turn): load the + `flint-board-author` skill (`get_flint_skill` with `board`). +- **Nothing is kept.** The spec in the conversation is the chart. To change + it, change the spec and call `show` again: a new card opens and earlier ones + stay. A card's context gives the `chart_spec` with the reader's panel edits; + pass it on unless the user asked for something else. +- **Numbers.** `view: "table"` on `show` opens the card on the rows the chart + draws. Records with no chart are `chartType: "Table"`. +- **Other tools.** `render_chart` (PNG/SVG) only when the host has no app UI or + the user wants a static image; `compile_chart` for backend JSON. +- **Code.** Adding Flint to an app, a notebook or a script is the + `flint-app-author` skill. -```ts -import { assembleChartjs, assembleECharts, assembleVegaLite } from 'flint-chart'; +## Data transformation before charting -const vegaLiteSpec = assembleVegaLite(input); -const echartsOption = assembleECharts(input); -const chartjsConfig = assembleChartjs(input); -``` +Flint is a chart compiler, not a data-wrangling layer. If the chart needs grouped +totals, time buckets, filters, joins, pivots, derived ratios, or a long-form +table, transform the data first with a host tool, then bind the prepared table +(see "How data gets bound"). Pick semantic types and channels for the transformed +columns, not for columns that no longer exist. -Python support is planned for a later release. Until the PyPI package is -published, use the npm package or MCP server for released workflows. +**Sanity-read the values first — don't chart blind.** Inspect the actual data +with your data tool (distinct values per category column, min/max per measure), +not just the column names, and watch for: -```ts -interface ChartAssemblyInput { - // Bound by the HOST or by you, depending on the situation (see below). - data: { values: any[] } | { url: string }; - semantic_types?: Record; // field → type ( ← you write this) - chart_spec: { // ← you write this - chartType: string; // e.g. "Scatter Plot" - title?: string; // the headline — write one - subtitle?: string; // what is measured, of whom, when, in what units - encodings: Record; // channel → { field, ... } (or array) - baseSize?: { width: number; height: number }; // target layout size, default 400×320 - canvasSize?: { width: number; height: number }; // optional hard ceiling on stretch - chartProperties?: Record; // per-chart tuning (optional) - }; - options?: Record; // global layout options (rarely needed) - field_display_names?: Record; // field → readable axis/legend title - theme_spec?: string | { extends: string; [key: string]: any }; // preset or preset override (Vega-Lite only) -} -``` +- **Embedded totals.** A category column may mix an aggregate level with its + parts (e.g. `all` alongside `cage-free`/`caged`, or a `Total` region). Charting + the total with its parts double-counts and flattens the parts — keep one or the + other on a stacked/grouped/colored channel, not both. +- **Units.** `Percentage` accepts either a fraction (0–1) or a percent (0–100): + Flint reads which from the values and formats both as `%`. Don't rescale a + column for Flint, and don't scale it twice. +- **One real entity.** If your breakdown column has a single distinct value, the + per-group chart collapses to one mark — the intended breakdown is likely a + different column. ## How data gets bound @@ -155,276 +126,64 @@ state how the host should bind data. In the worked examples below, `data` is shown as `{ values: [] }` to signal "host binds this" — focus on `chart_spec` and `semantic_types`. -## Data transformation before charting - -Flint is a chart compiler, not a data-wrangling layer. If the chart needs grouped -totals, time buckets, filters, joins, pivots, derived ratios, or a long-form -table, transform the data first with a host tool, then bind the prepared table -(see "How data gets bound"). Pick semantic types and channels for the transformed -columns, not for columns that no longer exist. - -**Sanity-read the values first — don't chart blind.** Inspect the actual data -with your data tool (distinct values per category column, min/max per measure), -not just the column names, and watch for: - -- **Embedded totals.** A category column may mix an aggregate level with its - parts (e.g. `all` alongside `cage-free`/`caged`, or a `Total` region). Charting - the total with its parts double-counts and flattens the parts — keep one or the - other on a stacked/grouped/colored channel, not both. -- **Units.** `Percentage` accepts either a fraction (0–1) or a percent (0–100): - Flint reads which from the values and formats both as `%`. Don't rescale a - column for Flint, and don't scale it twice. -- **One real entity.** If your breakdown column has a single distinct value, the - per-group chart collapses to one mark — the intended breakdown is likely a - different column. - -## Post-Flint style customization +## Choose the chart type -Stay at the Flint level for structure (data, chart type, channels, transforms, -sizing, properties) — Flint specs stay portable and regenerate safely. Drop to -backend JSON only after a valid Flint chart exists, and only for a narrow -presentation change Flint does not expose (exact axis/legend/mark styling, -titles, annotations, reference lines, layout polish). Never use it to change the -data, chart type, field mappings, or transforms — fix those upstream. - -For a Vega-Lite-specific style tweak: - -1. Author and validate the Flint `ChartAssemblyInput`. -2. Render or inspect the Flint chart first, when possible. -3. Call `compile_chart` with `backend: "vegalite"`. -4. Make the smallest necessary style/presentation edit to the returned - Vega-Lite spec. -5. Render the edited spec in the host environment with a Vega-Lite renderer. +`list_chart_types` lists every chart type with its channels and a one-line +note on what it is for. Pick the type that answers the question, then call +`list_chart_types` with that `chartType` before writing its encodings: it +returns the type's guidance (what a map's `id` accepts, which bar chart takes +a second category, a waterfall's Type column), its `chartProperties` with +values and defaults, and the interaction presets it supports. Use names +exactly as listed. Vega-Lite draws every type; the other backends draw a +subset. -This edited Vega-Lite spec is no longer a portable Flint spec. Do not send it to -`render_chart`; use `render_chart` only for Flint `ChartAssemblyInput`. - -## Write a headline - -Set `chart_spec.title` to the finding, in a sentence, and `chart_spec.subtitle` -to the reading of it — what is measured, of whom, when, in what units: +Without the tool, these are the Vega-Lite types and their channels; each +type's properties and guidance are in the chart reference, +https://microsoft.github.io/flint-chart/#/documentation/reference-vegalite: ``` -title: "A pyramid that is no longer a pyramid" -subtitle: "United States population by age and sex, 2020, millions" +"Area Chart": x, y, color, opacity, column, row +"Bar Chart": x, y, color, detail, opacity, column, row +"Bar Table": y, x, color, column, row +"Boxplot": x, y, color, opacity, column, row +"Bullet Chart": y, x, goal, color, column, row +"Bump Chart": x, y, color, detail, column, row +"Calendar Heatmap": x, color +"Candlestick Chart": x, open, high, low, close, column, row +"Choropleth": id, color, detail, text +"Connected Scatter Plot": x, y, order, color, detail, column, row +"Density Plot": x, color, column, row +"Donut Chart": size, color, column, row +"ECDF Plot": x, color, detail, column, row +"Gantt Chart": y, x, x2, color, detail, column, row +"Grouped Bar Chart": x, y, group, color, detail, column, row +"Heatmap": x, y, color, column, row +"Histogram": x, color, column, row +"KPI Card": metric, value, goal +"Line Chart": x, y, color, strokeDash, detail, opacity, column, row +"Lollipop Chart": x, y, color, column, row +"Map": longitude, latitude, color, size, shape, opacity, order, detail, strokeWidth, text +"Marginal Plot": x, y, color, size, shape, opacity +"Pie Chart": size, color, column, row +"Pyramid Chart": x, y, color +"Radar Chart": x, y, color, column, row +"Range Area Chart": x, y, y2, color, column, row +"Ranged Dot Plot": x, y, color +"Regression": x, y, size, color, column, row +"Ridgeline Plot": x, y, color +"Rose Chart": x, y, color, column, row +"Scatter Plot": x, y, color, size, shape, detail, opacity, column, row +"Slope Chart": x, y, color, detail, column, row +"Sparkline": x, y, color, detail, row, column +"Stacked Bar Chart": x, y, color, detail, column, row +"Streamgraph": x, y, color, column, row +"Strip Plot": x, y, color, size, column, row +"Table": none (`encodings: {}`) +"Violin Plot": x, y, color, row +"Waterfall Chart": x, y, color, column, row ``` -Add `chart_spec.label` only when the chart sits in a numbered sequence or -under a section name: `label: "Figure 2"`. It is drawn above the headline in -the theme's kicker style. - -`chart_spec.source` is optional. Add it only when the user names the source or -asks for a source line, or the data itself states where it comes from: -`source: "UN World Population Prospects 2024"` (or `{ text, href }` to link -it). Never invent or guess one. The theme decides how it reads ("Source:", -side, rule, credit); a chart without one draws no footer. - -`chart_spec.chrome` is the house decoration the theme draws around the chart: -header rules, tabs, wordmarks, logos, the footer rule and the house credit. It is -not the chart's own title, label or source. The theme draws it by default; leave -`chrome` out unless the user asks to drop it: `chrome: false` -drops all of it; `chrome: { logos: false }` (or `header`, `footer: false`) drops -one part. Without logos a credit keeps its words. - -`Jan`, `Cairo`, `Chrome` name their own kind; `26`, `5,300`, `0.42` do not, and -the headline is where they get named. Leave it out only where the chart is not -read on its own — a sparkline in a cell, a tile under its own caption. Nothing -breaks: with no headline to lean on, the compiler keeps the axis titles instead. - -## Visual themes (`theme_spec`) - -Use one of two forms. Prefer a preset unless the user asks for a specific -brand adjustment. - -### 1. Use a preset - -Call `list_themes` to choose an id, then place it beside `chart_spec`: - -```json -{ "chart_spec": { ... }, "theme_spec": "economist" } -``` - -| id | what it is for | -| --- | --- | -| `nyt` | Newsroom graphics: headline states the finding, values on the marks, series named at their ends. | -| `economist` | Print weekly: compact, flat headline over a deck, units repeated down the ruler. | -| `swiss` | International Typographic Style: strong grid structure, black typography, and a focused red accent. | -| `nature` | Journal figure: small panel, axis titles with units, statistics beside the fit. | -| `mckinsey` | Consulting deck: wide bands, every value printed, headline states the takeaway. | -| `datawrapper` | Embedded web chart: narrow column, plain headline and deck, rule under the footer. | -| `powerbi` | Dashboard tile: compact, legend to the right, latest point emphasised. | -| `powerbi-light` | Light dashboard tile: white canvas, fine gridlines, and bright categorical color. | -| `cartoon` | Playful illustration: warm paper, rounded type, bold outlines, and bright color. | -| `apple` | App-interface chart: light labels, trailing value axis, symbols beside color. | -| `de-stijl` | De Stijl composition: primary planes in heavy black lines, steps not slopes, title under the picture. | -| `bbc` | BBC News graphic: big bold headline, gridlines only, heavy zero rule, footer rule with the source. | -| `material` | Material Design 3 product chart: purple-led tonal palette, Roboto type, light gridlines, rounded bars. | - -### 2. Override a preset - -Keep overrides narrow and state only what the user wants to change: - -```json -{ - "theme_spec": { - "extends": "economist", - "id": "our-brand", - "ink": { - "series": { - "single": "#6b3fa0" - } - } - } -} -``` - -Common simple overrides are `ink.surface.canvas`, `ink.series.single`, -`ink.series.categorical`, `type.headline.family`, and `layout.density` -(`"compact"`, `"normal"`, or `"airy"`). If replacing -`ink.series.categorical`, also replace `categoricalExtended` so charts with -many series keep the requested brand palette. - -Do not copy an entire preset or invent theme keys. A theme controls -presentation; fields, aggregation, filtering, and sorting still belong in the -chart input. ThemeSpec applies to Vega-Lite and Plotly; ECharts, Chart.js, and Excel ignore it. - -Full reference: -https://microsoft.github.io/flint-chart/#/documentation/theme-spec - -## Interactions (`interaction_spec`) - -Add `interaction_spec` beside `chart_spec` when the user asks for behaviour, -or when the goal of the session is to explore or analyse the data. A static -image never needs it. - -```json -{ - "chart_spec": { "chartType": "Line Chart", "encodings": { "x": "date", "y": "value", "color": "series" } }, - "interaction_spec": { "interactions": [ { "type": "brush-x" } ] } -} -``` - -Every entry is `{ "type": , "options": { ... } }`, one per behaviour. -Take the presets and their options for the chart type from -`list_interaction_presets` with `chartType`; never invent one. Options nest under -`options`; `id` sits on the entry. - -Which presets answer a request, how they combine, and what the warnings mean -is the `flint-interaction-author` skill (`flint://interaction-skill` on the -MCP server). Load it for anything beyond a single named gesture: an intent -(explore, compare, analyse, find outliers), "make it interactive" with -nothing named, several presets together, behaviour on a chart that already -exists, or an update to a chart on screen. - -Full reference: -https://microsoft.github.io/flint-chart/#/documentation/interaction-spec - -## Step 1 — pick `chartType` - -Use one of the registered names **exactly**. Vega-Lite is the default and -broadest backend; the table below lists each Vega-Lite chart type, the -channels it accepts, and its tuning properties (see "Chart-level -properties"). Required channels are noted. - -| chartType | Channels | Notes / required | -|---|---|---| -| `"Scatter Plot"` | x, y, color, size, shape, detail, opacity, column, row | x + y required; `detail` carries a field (e.g. `country`) on each point without a visual channel, for tooltips and linking | -| `"Regression"` | x, y, size, color, column, row | scatter + fit line; props `regressionMethod`, `polyOrder` | -| `"Connected Scatter Plot"` | x, y, order, color, detail, column, row | x + y required; `order` = connection sequence (time/index), so the line traces a trajectory and may self-cross | -| `"Ranged Dot Plot"` | x, y, color | dumbbell of two x per category | -| `"Strip Plot"` | x, y, color, size, column, row | jittered points; props `stepWidth`, `pointSize`, `opacity` | -| `"Bar Chart"` | x, y, color, opacity, column, row | one discrete + one measure; prop `cornerRadius` | -| `"Grouped Bar Chart"` | x, y, group, column, row | `group` = the clustering category; prop `dodge` | -| `"Stacked Bar Chart"` | x, y, color, column, row | prop `stackMode` | -| `"Pyramid Chart"` | x, y, color | diverging horizontal bars | -| `"Lollipop Chart"` | x, y, color, column, row | prop `dotSize` | -| `"Waterfall Chart"` | x, y, color, column, row | `color` = Type column, values `start`/`delta`/`end` only; omit it for auto sign coloring; props `cornerRadius`, `totals` | -| `"Gantt Chart"` | y, x, x2, color, detail, column, row | x = start, x2 = end | -| `"Bullet Chart"` | y, x, goal, color, column, row | `goal` required (target) | -| `"Histogram"` | x, color, column, row | x = measure to bin; prop `binCount` | -| `"Boxplot"` | x, y, color, opacity, column, row | category + measure; props `whiskerMethod`, `showOutliers`, `dodge` | -| `"ECDF Plot"` | x, color, detail, column, row | x = measure; cumulative distribution (step line); prop `showPoints` | -| `"Heatmap"` | x, y, color, column, row | color = the measure | -| `"Calendar Heatmap"` | x, color | x = date; color = daily value (summed per day); GitHub-style week × weekday grid | -| `"Line Chart"` | x, y, color, strokeDash, detail, opacity, column, row | props `interpolate`, `showPoints` | -| `"Sparkline"` | x, y, color, detail, row, column | x + y required; small-multiple mini trend lines, one per series (series from `color` or `detail`); props `interpolate`, `baseline`, `trendWidth` | -| `"Bump Chart"` | x, y, color, detail, column, row | rank-over-time lines | -| `"Slope Chart"` | x, y, color, detail, column, row | two-period value change; straight segments + end points, one line per category | -| `"Area Chart"` | x, y, color, opacity, column, row | props `interpolate`, `opacity`, `stackMode` | -| `"Range Area Chart"` | x, y, y2, color, column, row | x + y + y2 required; translucent band from `y` (low) to `y2` (high), value axis fits the band (not zero) | -| `"Violin Plot"` | x, y, color, row | x (category) + y (measure) required; mirrored KDE density per category, prop `bandwidth`; **Vega-Lite only**; a genuine `color` subgroup splits two groups or grids 3+ groups | -| `"Streamgraph"` | x, y, color, column, row | centre-stacked areas | -| `"Density Plot"` | x, color, column, row | props `bandwidth`, `stackMode` (series stack; `layered` overlaps them), `opacity` | -| `"Ridgeline Plot"` | x, y, color | x = measure; `color` (or a discrete `y`) names the ridges, each the KDE of x on its own baseline; a measure `y` draws each series' curve instead; props `overlap`, `order`, `tailCut`, `colorBy`, `perspective` (plans unset `skew`, `tilt`, `overlap` from the ridge count so the depth takes about 40% of the plot), `skew`, `tilt`, `valueMax`, `markAt` (`true` marks the x ticks, or a list of x values; each ridge's value is dotted and labelled, joined across ridges), `opacity`, `interpolate`, `bandwidth`; named ridges share one ink unless `colorBy` asks otherwise; a numeric `color` keeps a gradient key; **Vega-Lite only** | -| `"Marginal Plot"` | x, y, color, size, shape, opacity | the plot follows the axis types (measure × measure = scatter, category × measure = strip, category × category = heatmap of counts) with each axis's distribution along it (density, histogram or boxplot on a measure axis, a bar of counts on a category axis, split by `color`; density margins layer by default); props `marginal`, `stackMode`, `bandwidth`, `binCount`, `whiskerMethod`, `showOutliers`; **Vega-Lite only** | -| `"Pie Chart"` | size, color, column, row | `size` = slice value (→ angle), `color` = category; props `innerRadius`, `sortSlices` | -| `"Rose Chart"` | x, y, color, column, row | polar bars; props `alignment`, `padAngle`, `sortSlices` | -| `"Radar Chart"` | x, y, color, column, row | props `filled`, `fillOpacity`, `strokeWidth` | -| `"Candlestick Chart"` | x, open, high, low, close, column, row | OHLC all required | -| `"Bar Table"` | y, x, color, column, row | compact bars + value labels | -| `"KPI Card"` | metric, value, goal | big-number tile; prop `behindThreshold` | -| `"Table"` | none (`encodings: {}`) | the rows as given, one column per field in row order; shape `data.values` to the rows and fields to list, name columns with `field_display_names`; numbers and dates print by `semantic_types`; receives links and `updates`, sends no selection | -| `"Map"` | longitude, latitude, color, size, opacity | bubble map; props `region`, `projection` | -| `"Choropleth"` | id, color, detail | `id` = region key (see **Maps** below); props `region` (`"world"`/`"us"`), `level` (US: `"state"`/`"county"`/`"auto"`), `projection` (world) | - -**Maps: what `id` accepts.** Flint joins the key to its own base map; you never -supply geometry or a lookup. A **world** map takes country names ("India", -"DR Congo", "United Kingdom"), ISO 3166 alpha-2 / alpha-3 codes ("IN", "IND"), -or ISO numeric codes (356), all in one column. A **US** map takes state names, -USPS codes ("CA") or FIPS codes (6), and county FIPS (6037) with -`level: "county"`. Declare the key `Country` or `State` in `semantic_types` -(or set `chartProperties.region`) whenever codes could collide: "CA", "IN", -"Georgia", or small numbers. A key that matches no region is not drawn. Map -marks carry only `id`, `color` and `detail`: to link a map with charts keyed by -a name column, encode that column as `id` (names resolve too) or put it on -`detail` (e.g. `id: "map_id", detail: "country"`), which also labels the tooltip. - -**Donut chart:** use `"Pie Chart"` with `chartProperties.innerRadius > 0`. - -**Choosing a bar chart (most common mix-up).** All three take one discrete -category on `x` (or `y`) plus one measure. They differ in how a **second** -category is shown — and each reads that second category from a **different -channel**: - -- `"Bar Chart"` — use for a single series. When multiple rows share an `x`, a - second category on `color` produces stacked segments. For side-by-side bars, - use `"Grouped Bar Chart"` with the second category on `group`. -- `"Stacked Bar Chart"` — second category on `color`, drawn as **stacked** - segments within each bar (totals matter). Tune with `stackMode` - (`stacked` / `normalize` / `layered`). -- `"Grouped Bar Chart"` — second category on the **`group`** channel, drawn as - **side-by-side (dodged)** bars within each `x` cluster (compare values - directly). Put the clustering category on `group`, *not* `color`. - -Rule of thumb: comparing parts-to-whole → Stacked; comparing values -side-by-side → Grouped (use `group`); single series → Bar. - -**Waterfall color is a special "Type" column, not a free category.** On a -`"Waterfall Chart"` the `color` channel is reserved for a *type* field whose -values are literally `start`, `delta`, and `end` — it drives which bars anchor -to zero, not an arbitrary grouping. Do **not** bind `color` to an -`Increase`/`Decrease` (or up/down, gain/loss) category: the up/down direction is -already derived from the **sign** of the `y` value and colored automatically -(green up / red down). For the common case, **omit `color` entirely** and let -Flint infer the start/delta/end and per-bar sign coloring. To force which bars -are anchored totals, use the `totals` property (`first`/`last`/`both`), not a -color field. Only bind `color` when you genuinely have a `start`/`delta`/`end` -type column. - -**Backend coverage.** Vega-Lite supports all of the above. Other backends -support a subset (verify if targeting a non-VL backend): - -- **ECharts** adds: `"Gauge"`, - `"Funnel"`, `"Treemap"`, `"Sunburst"`, `"Sankey"`, - `"Parallel Coordinates"`, `"Graph"`, `"Tree"`. -- **Chart.js** supports: Scatter, Bubble, Bar, Grouped Bar, Stacked Bar, - Lollipop, Bump, Combo, Line, Area, Range Area, Pie, Doughnut, Histogram, - Radar, Rose, Slope, Connected Scatter. - -You do not need to call the library or inspect its source to author the -input — pick from this table. - -## Step 2 — map fields to channels +## Map fields to channels Each channel maps to an **encoding object** `{ field, ... }` (or a bare string shorthand, expanded to `{ field: "" }`): @@ -495,9 +254,9 @@ Arquero/`Array.map`/SQL, or a data/MCP tool — and pass the result as `data.values`. If you have no way to transform, surface the gap to the developer rather than inventing a transform property that does not exist. -## Step 3 — annotate with semantic types +## Semantic types -**This is the most important step.** Semantic types drive all downstream +**This matters most.** Semantic types drive all downstream decisions — formatting, zero baseline, color scheme, scale direction, and more. Pick the most specific type for each field. Full registered set: @@ -506,7 +265,8 @@ more. Pick the most specific type for each field. Full registered set: | Temporal (point) | `DateTime`, `Date`, `Time`, `Timestamp` | | Temporal (granule) | `Year`, `Quarter`, `Month`, `Week`, `Day`, `Hour`, `YearMonth`, `YearQuarter`, `YearWeek`, `Decade` | | Temporal (span) | `Duration` | -| Measure (amount) | `Amount`, `Price`, `Quantity`, `Count`, `Number` | +| Measure (amount) | `Amount`, `Price`, `Quantity`, `Count` | +| Measure (generic) | `Number` — a measure whose values should not be added up (or whose additivity is unknown); use `Count`, `Amount`, `Quantity` or `Profit` for totals | | Measure (proportion) | `Percentage` | | Measure (signed/diverging) | `Profit`, `PercentageChange`, `Sentiment`, `Correlation` | | Measure (physical) | `Temperature` | @@ -527,7 +287,8 @@ What choosing well gets you (automatically): - `Date` / `DateTime` → temporal axis with auto-granularity formatting - `Percentage` → percent formatting, 0–100 domain awareness -If you don't know, use `Quantity` for numbers, `Category` for strings, +If you don't know, use `Quantity` for numbers that add up to a total and +`Number` for ones that don't, `Category` for strings, `Date`/`DateTime` for date-shaped values. Do **not** invent type names. ### Saying more than the type name @@ -559,9 +320,19 @@ understates what you know: - `intrinsicDomain` — the field's own bounds, for bounded scales only: `[1, 5]` for a five-star rating, `[0, 100]` for a percentage score. Not for open-ended measures. +- `percentScale` — `"fraction"` or `"percent"`: how a `Percentage` or + `PercentageChange` field is stored (0.45 or 45 for 45%). Set it when you know; + otherwise Flint guesses from the values, which misreads fractions mostly past + 1 (growth of 2.4 meaning 240%). - `divergingMidpoint` — where the middle colour of a diverging scale sits. Set it if you can tell what the reader is comparing against; leave it out if you can't. +- `divergingNeutral` — for a colour stepped into classes, how far either side + of the midpoint still reads as neither side: `0.1` makes correlations within + ±0.1 one neutral class; `false` makes the midpoint a break, so a small gain + never looks like a small loss. Leave it out and the type decides + (`Correlation`, `Sentiment`: a neutral class; `Profit`, `PercentageChange`: + a break). - `sortOrder` — the order the categories should appear in, when the order in the data is not the one you want and it isn't alphabetical either: `["Low", "Medium", "High"]`. For a handful of categories, not a long list. @@ -576,10 +347,42 @@ understates what you know: `"lower-is-better"` for costs, errors, churn or delays, so their highs, not their lows, take the warm end, under any theme. -## Step 4 — write the spec +## Write a headline + +Set `chart_spec.title` to the finding, in a sentence, and `chart_spec.subtitle` +to the reading of it — what is measured, of whom, when, in what units: + +``` +title: "A pyramid that is no longer a pyramid" +subtitle: "United States population by age and sex, 2020, millions" +``` + +Add `chart_spec.label` only when the chart sits in a numbered sequence or +under a section name: `label: "Figure 2"`. It is drawn above the headline in +the theme's kicker style. + +`chart_spec.source` is optional. Add it only when the user names the source or +asks for a source line, or the data itself states where it comes from: +`source: "UN World Population Prospects 2024"` (or `{ text, href }` to link +it). Never invent or guess one. The theme decides how it reads ("Source:", +side, rule, credit); a chart without one draws no footer. -Put the three steps into one `ChartAssemblyInput`, with the data bound as in -"How data gets bound" and a headline as in "Write a headline": +`chart_spec.chrome` is the house decoration the theme draws around the chart: +header rules, tabs, wordmarks, logos, the footer rule and the house credit. It is +not the chart's own title, label or source. The theme draws it by default; leave +`chrome` out unless the user asks to drop it: `chrome: false` +drops all of it; `chrome: { logos: false }` (or `header`, `footer: false`) drops +one part. Without logos a credit keeps its words. + +`Jan`, `Cairo`, `Chrome` name their own kind; `26`, `5,300`, `0.42` do not, and +the headline is where they get named. Leave it out only where the chart is not +read on its own — a sparkline in a cell, a tile under its own caption. Nothing +breaks: with no headline to lean on, the compiler keeps the axis titles instead. + +## Write the spec + +One `ChartAssemblyInput`, with the data bound as in "How data gets bound" and +a headline as in "Write a headline": ```json { @@ -590,89 +393,66 @@ Put the three steps into one `ChartAssemblyInput`, with the data bound as in "title": "Europe climbed every month after the April dip", "subtitle": "Revenue by region, $m", "encodings": { "x": { "field": "month" }, "y": { "field": "revenue" }, "color": { "field": "region" } } - }, - "theme_spec": "economist" + } +} +``` + +The full shape: + +```ts +interface ChartAssemblyInput { + // Bound by the HOST or by you, as in "How data gets bound". + data: { values: any[] } | { url: string }; + semantic_types?: Record; // field → type ( ← you write this) + chart_spec: { // ← you write this + chartType: string; // e.g. "Scatter Plot" + title?: string; // the headline — write one + subtitle?: string; // what is measured, of whom, when, in what units + label?: string; // a figure number or kicker, above the headline + source?: string | { text: string; href?: string }; // only when known; never invented + chrome?: false | { header?: false; footer?: false; logos?: false }; // drop the house's decoration + encodings: Record; // channel → { field, ... } (or array) + baseSize?: { width: number; height: number }; // target layout size, default 400×320 + canvasSize?: { width: number; height: number }; // optional hard ceiling on stretch + chartProperties?: Record; // per-chart tuning (optional) + }; + options?: Record; // global layout options (rarely needed) + field_display_names?: Record; // field → readable axis/legend title + theme_spec?: string | { extends: string; [key: string]: any }; // preset or preset override (Vega-Lite, Plotly) + interaction_spec?: { interactions: { type: string; id?: string; options?: Record }[] }; // behaviour (interaction skill) + updates?: { id: string; ops: any[] }[]; // the agent's marks on the chart (interaction skill) } ``` -Add `theme_spec`, `chartProperties`, `interaction_spec` or `updates` only when -the request asks for them. With the MCP tools, check it with `validate_chart`, -fix what the report asks in the spec, then pass the whole spec to `show` as -`chart`. Without them, run the "Validation checklist". - -## Chart-level properties (`chartProperties`) - -`chartProperties` is an optional per-chart tuning map. Set a property only -when the user asks for that behavior — defaults are sensible. These are -**design choices**, not styling overrides (colors/fonts/ticks are still -derived). Values are clamped to the ranges shown. - -| Chart type | Property | Type / range (default) | Effect | -|---|---|---|---| -| Bar Chart | `cornerRadius` | 0–15 (0) | Round bar corners (px) | -| Area / Stacked Bar | `stackMode` | `stacked` \| `normalize` \| `center` \| `layered` (unset) | Stacking behavior; `normalize` = 100%, `center` = streamgraph | -| Density Plot | `stackMode` | `normalize` \| `layered` (unset = stacked) | `layered` overlaps the series, translucent | -| Density Plot | `opacity` | 0.1–1 (0.7) | Layered series opacity | -| Marginal Plot | `stackMode` | `stacked` (unset = layered) | Stack the density margins instead of layering them | -| Grouped Bar / Boxplot | `dodge` | `auto` \| `local` \| `global` (`auto`) | `local` compacts sparse groups per category; `global` preserves aligned group lanes; leave `auto` unless the user requests one | -| Line / Area / Sparkline | `interpolate` | `linear` \| `monotone` \| `step` \| `step-before` \| `step-after` \| `basis` \| `cardinal` \| `catmull-rom` (`linear`) | Curve shape | -| Line / ECDF Plot | `showPoints` | boolean (false) | Draw point markers on the line | -| Sparkline | `baseline` | `mean` \| `zero` \| `median` \| `none` (`mean`) | Reference line per spark row | -| Sparkline | `trendWidth` | 80–600 (240) | Mini line-plot width (px) | -| Boxplot | `whiskerMethod` | `iqr` \| `minmax` (`iqr`) | Whisker rule (Tukey 1.5×IQR vs min–max) | -| Boxplot | `showOutliers` | boolean (true) | Show outlier points (Tukey only) | -| Area | `opacity` | 0.1–1 (0.7) | Fill opacity | -| Scatter | `opacity` | 0.1–1 (1) | Point opacity | -| Strip Plot | `stepWidth` | 10–100 (20) | Jitter spread | -| Strip Plot | `pointSize` | 0–150 (0=auto) | Point size | -| Strip Plot | `opacity` | 0–1 (0=auto) | Point opacity | -| Histogram | `binCount` | 5–50 (10) | Number of bins | -| Density Plot / Ridgeline / Marginal Plot | `bandwidth` | 0.05–2 (0=auto) | Kernel bandwidth | -| Ridgeline | `overlap` | 0.5–4 (1.8) | How many baselines up the tallest ridge reaches | -| Ridgeline | `order` | `mean`, `reverse` (unset = as given; a quantitative series lowest at the front) | Highest mean on top, or reversed | -| Ridgeline | `tailCut` | 0–0.2 (0) | Trim each ridge to where its density is at least this share of its peak | -| Ridgeline | `colorBy` | `series`, `x` (unset = one colour) | Named ridges share one ink by default; `series` colours each ridge, `x` fills each with a ramp along x | -| Ridgeline | `perspective` | boolean (false) | Stand the ridges on a floor seen in perspective: `skew`, `tilt`, `overlap` left unset are planned so the depth takes about 40% of the plot's width and more of its height as ridges are added; the depth names, edge and value ticks give way (along the axis, then level, then every n-th) before they touch | -| Ridgeline | `skew` | 0–0.4 (0) | Perspective: shift the back ridges left by this share of the x range | -| Ridgeline | `tilt` | 0–6 (0) | Perspective: the x axis rises this many baselines across its range, labels following its edge | -| Ridgeline | `opacity` | 0.1–1 (0.5) | Ridge opacity, as the Range Area Chart; solid in perspective unless set | -| Ridgeline | `valueMax` | number (0 = tallest peak) | Perspective: the value the full ridge height stands for, read on the back-left value axis | -| Ridgeline | `markAt` | boolean \| number[] | Mark and label every ridge's value at the x ticks inside the range (`true`) or at these x; a dashed line joins the marks at one x across the ridges | -| Marginal Plot | `marginal` | `density` \| `histogram` \| `boxplot` (`density`) | What each margin draws along a measure axis; a category axis gets a bar of counts | -| Pie Chart | `innerRadius` | 0–100 (0) | Donut hole size (>0 → donut) | -| Pie / Rose | `sortSlices` | `none` \| `descending` \| `ascending` (`none`) | Order wedges and their legend by slice value | -| Rose Chart | `alignment` | `left` \| `center` (`left`) | Wedge alignment | -| Rose Chart | `padAngle` | 0–0.1 (0) | Gap between slices | -| Lollipop | `dotSize` | 20–300 (80) | Circle size (px) | -| Waterfall | `cornerRadius` | 0–8 (0) | Round bar corners | -| Waterfall | `totals` | `auto` \| `none` \| `first` \| `last` \| `both` (`auto`) | Which bars anchor to zero as totals (only when no Type column) | -| Waterfall | `showTextLabels` | boolean (false) | Legacy spelling of `showValueLabels`; still accepted | -| Bar / Grouped Bar / Stacked Bar / Lollipop / Pyramid / Pie / Donut / Heatmap / Waterfall | `showValueLabels` | boolean | Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks. | -| Regression | `regressionMethod` | `linear` \| `log` \| `exp` \| `pow` \| `quad` \| `poly` (`linear`) | Fit method | -| Regression | `polyOrder` | 1–5 (3) | Polynomial order (when `poly`) | -| Radar | `filled` | boolean (true) | Fill the polygon | -| Radar | `fillOpacity` | 0–0.5 (0.15) | Polygon fill opacity | -| Radar | `strokeWidth` | 0.5–4 (1.5) | Line width | -| KPI Card | `behindThreshold` | 0–1 (0.5) | Value/goal ratio cutoff for color | -| Map | `region` | `us` \| `world` \| `auto` (`auto`) | Geographic scope | -| Map | `projection` | `mercator` \| `equalEarth` \| `orthographic` \| `stereographic` \| `conic` \| `mollweide` | Map projection | - -**Cross-cutting properties** (apply to position/faceted charts when -relevant; set only to force non-default behavior): - -- `independentYAxis` (boolean) — faceted charts: give each panel its own - y-scale. -- `logScale_x` / `logScale_y` (boolean) — force a logarithmic axis. -- `includeZero_x` / `includeZero_y` (boolean) — force the axis to include 0. -- `xAxisType` / `yAxisType` (`temporal` | `nominal`) — force a temporal - field to render as discrete bands (or vice-versa). -- `labelOverflow` (list of steps) — the path x category names that do not - fit their band take. Leave it out: names wrap, then stand upright (trimmed - if need be), every name printed; a run of times, dates, years or ranks - wraps, then prints only round values (16:45, 17:00) flat. Set it only when - the user asks, e.g. `["wrap", "rotate90"]` to label every year, or - `["wrap", "rotate45", "rotate90"]` for 45° labels. Steps: `wrap`, `skip` - (sequences only), `rotate45`, `rotate90`. +Set `chartProperties` only when the user asks for that behaviour; defaults +are sensible. Global layout `options` are rarely needed. + +## Interactions and updates + +A mounted chart already shows a tooltip and lets a legend click dim a group. +Add more only for a reason: + +- `interaction_spec` (behaviour): the user asks for a gesture or describes + what the chart should do, the chart is linked to others on a board, or the + data has more detail than the chart can show at its size. +- `updates` (marks the agent leaves: a note, emphasis, a shaded range, a + reference line): the user asks for marks on the chart, asks about a chart + on screen, or asks a concrete question the chart can point at lightly. + +Otherwise the chart stays clean and your reply carries the answer. Both are +the `flint-interaction-author` skill (`get_flint_skill` with `interaction`). + +## Visual themes (`theme_spec`) + +Add `theme_spec` only when the user names a look, a house or a brand; without +one the chart draws in the host's style. Pick a preset id from `list_themes` +(`list_themes` with an `id` gives that house's authoring advice) and place it +beside `chart_spec`: `"theme_spec": "economist"`. For a brand adjustment, +extend a preset with only what changes: +`{ "extends": "economist", "id": "our-brand", "ink": { "series": { "single": "#6b3fa0" } } }`. +Do not copy a whole preset or invent theme keys; a new or substantially +customised theme is the `flint-theme-author` skill. ThemeSpec applies to +Vega-Lite and Plotly. ## Parameter overrides — when to reach for them @@ -687,19 +467,45 @@ default: - **Override an inferred type:** `encodings.x = { field: "year", type: "ordinal" }` (e.g. treat a year as discrete bands). - **Use readable field titles:** `field_display_names = { percentageOfCountries: "Percentage of countries" }`. Keep encodings bound to the real column name; Flint uses the display name for axis titles and legend headers. -- **Resize the chart:** Flint sizes from two numbers — `baseSize` (the *target* +- **Resize the chart:** set `baseSize` to suit where the chart is shown when + you know it (a wide panel or page, a narrow side bar, a size the user asked + for); otherwise leave it out and the MCP card starts at 300×300. The card + lets a dense chart grow up to 1.5× and always fits it to the host's width. + Flint sizes from two numbers — `baseSize` (the *target* it aims for, default 400×320) and `canvasSize` (a *hard ceiling* it may never exceed). With dense data the chart stretches from base toward the ceiling. - Want a comfortable size that may grow for dense data → set `chart_spec.baseSize = { width, height }`. - - Want a fixed slot it must fit inside → set `chart_spec.canvasSize = { width, height }` alone; the chart fills it and shrinks to fit, never overflowing. *What you ask for is what you get.* + - Want a fixed slot it must fit inside → set `chart_spec.canvasSize = { width, height }` alone; the chart fills it and shrinks to fit (a host narrower than the slot lays the chart out again for the room it has). - Both → aims for `baseSize`, grows toward `canvasSize`, never beyond. - **Force log / zero baseline:** the `logScale_*` / `includeZero_*` chart - properties above. + properties (`list_chart_types` with a `chartType` lists them). Global layout tuning lives in the top-level `options` object (e.g. `addTooltips`, band padding, facet sizing). It is rarely needed for authoring — omit it unless asked. +## Post-Flint style customization + +Stay at the Flint level for structure (data, chart type, channels, transforms, +sizing, properties) — Flint specs stay portable and regenerate safely. Drop to +backend JSON only after a valid Flint chart exists, and only for a narrow +presentation change Flint does not expose (exact axis/legend/mark styling, +layout polish). Titles are `chart_spec.title`; notes, regions and reference +lines are `updates`. Never use it to change the +data, chart type, field mappings, or transforms — fix those upstream. + +For a Vega-Lite-specific style tweak: + +1. Author and validate the Flint `ChartAssemblyInput`. +2. Render or inspect the Flint chart first, when possible. +3. Call `compile_chart` with `backend: "vegalite"`. +4. Make the smallest necessary style/presentation edit to the returned + Vega-Lite spec. +5. Render the edited spec in the host environment with a Vega-Lite renderer. + +This edited Vega-Lite spec is no longer a portable Flint spec. Do not send it to +`render_chart`; use `render_chart` only for Flint `ChartAssemblyInput`. + ## Worked examples In each example `data` is a placeholder — the host binds real rows or a @@ -723,8 +529,7 @@ User: "Plot car weight vs fuel economy, colored by origin." "x": { "field": "weight" }, "y": { "field": "mpg" }, "color": { "field": "origin" } - }, - "baseSize": { "width": 400, "height": 300 } + } } } ``` @@ -775,12 +580,13 @@ User: "Line chart of monthly sales and profit." } ``` -### Donut chart (Pie + innerRadius), value on `size` +### Donut chart, value on `size` User: "Show market share by vendor as a donut." -Pie/donut maps the slice value to `size` (rendered as angle) and the +Pie and Donut map the slice value to `size` (rendered as angle) and the category to `color`. Data is already long (one row per vendor). +`innerRadius` sizes the hole (a Pie with `innerRadius` is a donut too). ```json { @@ -790,7 +596,7 @@ category to `color`. Data is already long (one row per vendor). "share": "Percentage" }, "chart_spec": { - "chartType": "Pie Chart", + "chartType": "Donut Chart", "encodings": { "size": { "field": "share" }, "color": { "field": "vendor" } @@ -843,8 +649,8 @@ User: "Show each rep's sales against their quota." `color` encoding's `scheme`, `reverse`, `mid`, `domain`, `bins` and `colors`. - **Don't invent semantic type names.** If none fit, use the family default (`Quantity`, `Category`, `Date`). -- **Don't call the library to discover channels/types** — this document is - the authoring reference. +- **Don't read the library's source** to find channels or properties: + `list_chart_types` lists them. ## Validation checklist @@ -855,7 +661,7 @@ Before returning, verify: 3. Every encoded field has an entry in `semantic_types` (specific type). 4. Required channels for the chart type are present (e.g. Bullet→`goal`, Candlestick→`open/high/low/close`, Pie→`size`+`color`). -5. Any `chartProperties` keys are valid for that chart type and in range. +5. Any `chartProperties` keys are ones `list_chart_types` lists for the type. 6. You did **not** inline large data or hand-tune derived styling. 7. The data carries no embedded total/subtotal level (e.g. an `all` / `total` row) mixed with its components on a stacked, grouped, or colored channel. diff --git a/agent-skills/flint-interaction-author/SKILL.md b/agent-skills/flint-interaction-author/SKILL.md index 8091af3a..e8be3b33 100644 --- a/agent-skills/flint-interaction-author/SKILL.md +++ b/agent-skills/flint-interaction-author/SKILL.md @@ -1,129 +1,93 @@ --- name: flint-interaction-author -description: "Use when: a Flint chart should respond to the reader (highlight, zoom, brush, legend toggle, reorder, annotate, explore, link charts); an application or an agent changes a mounted chart from outside or reads what it shows; or a gesture no preset gives must be built. Produce one valid interaction_spec, one ChartUpdate, or code against flint-chart/interactive, with no invented names." +description: "Use when: a chart should carry notes, shaded regions, outlines, emphasis or reference lines (updates); a Flint chart should respond to the reader (highlight, zoom, brush, legend toggle, reorder, filter); or an agent changes a chart on screen. Produce one valid interaction_spec or ChartUpdate, with no invented names. Code against flint-chart/interactive (mounting, linking in an app, a bespoke gesture) is the flint-app-author skill." --- # flint-chart: interactions and updates on a chart -A Flint chart is shared state. A reader's gesture becomes an event, a handler -turns the event into an update `{ id, ops }`, updates compose as layers, and -the layers render into a state the host and the agent read back. An -application and an agent write the same kind of update directly. The full -model is in the documentation: -https://microsoft.github.io/flint-chart/#/documentation/interaction-introduction - -The chart itself (`chart_spec`, `semantic_types`) is the `flint-chart-author` -skill. Everything here runs on the Vega-Lite backend; a static render and the -other backends leave `interaction_spec` and updates untouched. - -## What you produce (and what you do NOT) - -| The request says | You produce | Section | +Two things go beside a chart input, and both are optional: + +- `interaction_spec`: behaviour, what the reader can do. `{ "interactions": [ { "type": , "options"?: { … } } ] }`. +- `updates`: state, marks the agent leaves on the chart (notes, emphasis, a + shaded range, a reference line). A list of `{ "id", "ops": [ … ] }` layers. + +A gesture's handler and an agent write the same layers, so when the request +is for something the reader can do themselves, give them the gesture; when it +is a point the agent makes, write the update. The chart itself is the +`flint-chart-author` skill. Everything here runs on the Vega-Lite backend; a +static render and the other backends ignore both. Code (mounting, `onChange`, +linking charts in an app, a gesture no preset gives) is the `flint-app-author` +skill; on an MCP board, charts connect through `link_spec` (the +`flint-board-author` skill). + +Use only the names in this skill and in `list_interaction_presets`. When the +request asks for a behaviour no preset gives, say which preset comes closest +and what it leaves out. + +## Add interactions + +### When + +A mounted chart already shows each mark's values in a tooltip, and a click on +a legend item dims the other groups. Add behaviour only for a reason: + +1. **The user asks for it**, by naming a gesture ("brush a period", "zoom", + "toggle the legend") or by describing what the chart should do ("click a + line so it stands out", "slide along the years", "let me pick the year"). + "Make it interactive" is an ask with nothing named: one or two presets + that fit the chart. +2. **The chart works with other charts** on a board: behaviour is what + connects the views. +3. **The data needs it to be read**: more detail than the chart can show at + its size (a long dense series, a crowded cluster, a map) that the reader + will want to see closer. Shape the chart first (an aggregate, a scale, a + filter); behaviour is a way to move closer (`navigate`, `brush-zoom`). Many + series is not this reason: fewer series is a shaping choice, and picking + them apart waits for the user to ask. + +Otherwise add nothing. A question about the data is answered by the chart and +the reply, and a chart shown in a live view has asked for nothing. + +### Pick presets + +Take the preset whose gesture the user named, or whose purpose meets what +they described, one per job and as few jobs as the reason holds: one or two +entries for most charts, none added to round out a set. +`list_interaction_presets` with `chartType` lists the presets the type +supports, what each needs, its reset and every option. + +| Preset | Gesture | What it is for | | --- | --- | --- | -| A gesture or a behaviour on the chart: "highlight on click", "zoom", "brush a period", "make it interactive", "add behaviour to this chart". | One `interaction_spec`: `{ "interactions": [ ... ] }`, presets only. | Add interactions to the chart | -| A change to a chart that is already on screen, from outside: "point out Japan", "frame 2010 to 2020", "note this value", "reorder by value", an agent answering a user with the chart. | One `ChartUpdate`: `{ "id", "ops": [ ... ] }`. | Update the chart | -| Code around a chart: "in my app", "on click open the record", "a panel that follows the hover". | TypeScript against `flint-chart/interactive`: mount, presets as factories, `onChange`, `dispatch`. | Use Flint in an application | -| Code across charts or over time: "link these two charts", "a table that follows the selection", "play the years". | `linkCharts` or `useLinkedCharts`; `dispatch` on a timer. On an MCP board, `link_spec` instead (board skill, "Step 5 — connect them"). | Link charts | -| A gesture no preset gives: "drag along the path", "draw a guess", "a rule for the box", "a lens the app draws". | A `CanvasInteractionDef`: a trigger, affordances, a handler. | When no preset fits | - -- **DO** use only the names in this skill: preset types, options, ops, states, - triggers, cursors, event actions. Every name here is one the library ships. - When the request asks for a behaviour no preset gives, say which preset - comes closest and what it leaves out, then offer a bespoke definition if the - host runs code. -- **DO** add behaviour only when the request or the session asks for it. A - static image or a bare spec gets no `interaction_spec`. - -## Which workflow the user is asking for - -- **Presets through the MCP tools:** put the object beside `chart_spec` as - `interaction_spec` in the chart input; `validate_chart` reports its warnings - without drawing, and `show` draws it with the same report. `list_interaction_presets` - with `chartType` lists the presets that chart type supports, what each - does, and its options. -- **An update through the MCP tools:** there is no handle on the chart. Pass - the layers as the `updates` argument beside the input, to `validate_chart` - and `show`; see "Step 4 — send the layer and read the result". -- **Code, only when the user asks for code:** mount with `mountChart`, or - `` in React; presets as factory calls, updates with - `applyUpdate`, state with `getState` and `onChange`. The programming API - is documented at - https://microsoft.github.io/flint-chart/#/documentation/interaction-api -- **A bespoke interaction** needs a host that runs code. In the MCP view, the - answer is the closest preset and what it leaves out. - -## Add interactions to the chart - -### Step 1 — read the request and the chart - -Three things in the request decide the entries, read in this order: - -1. **What the user named.** A gesture or a preset in their words: "brush a - period", "zoom", "toggle the legend", "highlight on click". Each is one job. -2. **The goal they stated.** "Explore", "compare the regions", "find - outliers", "present this", "a control in my app". A goal is the set of - questions the reader will ask of this chart; each question is one job. -3. **Nothing named**, only "interactive", a live view, a dashboard. The chart - and the data say what the reader can do with it. - -Then read the chart spec: the chart type, the field on each channel, and the -shape of the data. What a chart invites a reader to do: - -| The chart | Invites | -| --- | --- | -| A time series, one or many series | Comparing the series at one x; focusing a period; hiding a series when a colour field is bound; moving along the series when it is long. | -| A scatter or a dense point chart | Focusing a cluster; moving closer; hiding a series when a colour field is bound. | -| A bar, lollipop, or other category chart | Singling out a category; ranking by hand; hiding a series when a colour field is bound. | -| A pie, donut, rose, or radar | Singling out a sector; focusing adjacent sectors. | -| A heatmap or a calendar | Singling out a cell; reading a whole row or column. | -| A map | Singling out a region; moving closer. | -| A chart that is a control in an app | A click the app reads as a selection; a stronger gesture the app reads as an activation. | -| A chart read without a pointer | Walking the chart from the keyboard. | - -### Step 2 — pick presets - -Before any entry, a mounted chart already shows a tooltip with the mark's -values on hover and nothing else. An entry adds one behaviour. - -Take one row of the map per job. A named gesture takes the row whose -"Gesture" is that gesture. A question takes the row whose "Answers" is that -question, on a chart whose "Needs" it offers; a broad goal takes two or three -rows, the ones the chart invites most. When nothing is named, the rows the -chart invites, two or three. A row that answers no job on the request stays -out. - -| Preset | Gesture | Answers | Needs | Default reset | -| --- | --- | --- | --- | --- | -| **Single one thing out** | | | | | -| `click-highlight` | Clicks a mark, a legend item, or an axis label; it stays emphasised and the rest mute. Shift-click adds. | Which mark, series, or category is this one? | elements | click-none, escape | -| `click-group-focus` | Clicks a mark; every mark in its group stays emphasised. `groupBy` names the group field. | Which marks belong with this one? | elements | click-none, escape | -| `hover-group-focus` | Hovers a mark; its group stands out until the pointer leaves. `groupBy` names the group field; `emphasis` is `"auto"` (a line widens and the rest stay as drawn; points, bars, and slices dim the rest), `"highlight"`, or `"spotlight"`. | Which marks belong with this one, at a glance? | elements | none | -| `axis-highlight` | Clicks (or with `event: "hover"`, hovers) a discrete axis label; that category's marks emphasise. | Which marks share this row or column? | discrete axis | click-none, escape | -| **Read values** | | | | | -| `inspect` | Moves over the plot; a guide follows the pointer and the nearest mark on the chosen axes reads out. `mode` picks the axes and a comparison (`"x>"` reads every mark past the pointer). | What is at this x, this y, or beyond it? | elements | none | -| `inspect-index` | Moves along the index axis; every series reads out at that position on one guide, each value labelled in its series colour and the position named at the axis. `show: "single"` reads one series and switches it through the legend; `seriesBy` names the series field when the chart draws one series at a time; `displayValue: false` keeps the guides and drops the labels. | What does each series hold at this point? | index axis | escape | -| **Focus a region** | | | | | -| `select` | Drags a rectangle; the marks inside emphasise. `mode: "stateful"` keeps the rectangle on screen to move and resize. | Which marks lie in this area? | elements, cartesian region | click-none, escape | -| `lasso-select` | Draws a freehand region; the marks inside emphasise. | Which marks lie in this irregular cluster? | elements, cartesian region | click-none, escape | -| `brush-x`, `brush-y` | Drags an interval along one axis; the marks in it emphasise. `mode: "stateful"` keeps the interval on screen to move and resize. On a polar chart the x brush is a sector. | Which marks fall in this period or this range? | elements, cartesian region | click-none, escape | -| `brush-angle` | Drags an angular sector on a pie, donut, rose, or radar; the slices in it emphasise. | Which adjacent slices make up this share? | elements, angular region | click-none, escape | -| `linked-brush` | Drags a region; the groups inside emphasise in every chart that mounts the same preset. `groupBy` names the shared field; `mode: 'stateful'` keeps the rectangle on screen to move or resize. | Where are these groups in the other charts? | elements, cartesian region | click-none, escape | -| **Move the view** | | | | | -| `navigate` | Drags to pan; wheels or pinches to zoom a continuous axis. `axes` limits it; `pan: false` leaves the plot drag free. On a map it moves the projection; on a globe (a world Choropleth with `projection: "orthographic"`) a drag turns the sphere and the zoom stays centred. On a map, `geometry.domain.focus` names the region at the centre. | What is in this part of the range, closer? | navigation | double-click | -| `brush-zoom` | Drags a rectangle; the chart flies into it. | What is in this box, closer? | navigation | double-click, escape | -| **Reduce or rearrange** | | | | | -| `legend-toggle` | Clicks a legend item; its series hides or returns. Hidden series are a setting and survive every reset. | What does the chart look like without this series? | discrete legend | none | -| `drag-reorder` | Drags a discrete axis label to a new place; the categories reorder. | How do these rank in the order I choose? | reorderable axis | none | -| `filter-controls` | Picks values in controls beside the chart; the rows that fail are removed, or muted with `mode: "highlight"`. One control per listed field. | What does the chart show for this subset of a field it does not draw? | inline data | none | -| **Mark for the reader** | | | | | -| `click-annotate` | Clicks a mark; a note with its value pins to it. | What is this value, left on the chart? | elements | click-none, escape | -| **Hand a gesture to the app** | | | | | -| `double-activate` | Double-clicks a mark; the mark activates and the host reads it. | Which record should the app open? | elements | click-none, escape | -| `long-press` | Holds a mark (500 ms); the mark activates. The touch spelling of the same activation. | Which record should the app open, on touch? | elements | click-none, escape | -| `context-activate` | Right-clicks or long-presses a mark; the host receives a context target and draws its own menu. | What can the app do with this mark? | elements | none | -| `context-menu` | The reader picks marks and a menu of the app's actions opens beside them; picking one emits `menu-select` with the item's id and the marks. `gesture` picks how: `rectangle` (default), `lasso`, `brush-x`, `brush-y`, `click`, `right-click`, `long-press`. `items` is required: `[{ "id", "label" }]`. One entry; it brings its own selection. | What can the app do with these marks? | elements, cartesian region | click-none, escape | -| **Read without a pointer** | | | | | -| `accessible-navigation` | Tabs into the chart and walks titles, axes, legends, facet headers, series, and marks with the arrow keys; Enter goes a level in, and inside a level Tab steps through it before moving on. Each step says what the element is and emphasises its data. Space on a focused element runs the click presets. | What is on this chart, from the keyboard or a screen reader? | elements | none | +| **Single one thing out** | | | +| `click-highlight` | Clicks a mark, a legend item, or an axis label; it stays emphasised and the rest mute. Shift-click adds. | Keeps one mark, series, or category in focus against the rest while the reader looks at it; in an app, the selection the app reads. | +| `click-group-focus` | Clicks a mark; every mark in its group stays emphasised. `groupBy` names the group field. | Follows one group (a country's line, a species' points) across the chart from any of its marks. | +| `hover-group-focus` | Hovers a mark; its group stands out until the pointer leaves. `groupBy` names the group field; `emphasis` is `"auto"` (a line widens and the rest stay as drawn; points, bars, and slices dim the rest), `"highlight"`, or `"spotlight"`. | Picks one group out of many overlapping ones at a glance, without a click. | +| `axis-highlight` | Clicks (or with `event: "hover"`, hovers) a discrete axis label; that category's marks emphasise. | Picks a whole row or column, a category or a month, through its axis label. | +| **Read values** | | | +| `inspect` | Moves over the plot; a guide follows the pointer and the nearest mark on the chosen axes reads out. `mode` picks the axes and a comparison (`"x>"` reads every mark past the pointer). | Reads exact positions on guides: a crosshair on one or both axes, or every mark past a threshold. One mark's values are already in the tooltip. | +| `inspect-index` | Moves along the index axis; every series reads out at that position on one guide, each value labelled in its series colour and the position named at the axis. `show: "single"` reads one series and switches it through the legend; `seriesBy` names the series field when the chart draws one series at a time; `displayValue: false` keeps the guides and drops the labels. | Reads several series at the same position side by side, on one guide. With one series it repeats the tooltip. | +| **Focus a region** | | | +| `select` | Drags a rectangle; the marks inside emphasise. `mode: "stateful"` keeps the rectangle on screen to move and resize. | Picks out the marks in an area of a two-dimensional spread, to see which they are. | +| `lasso-select` | Draws a freehand region; the marks inside emphasise. | Picks out an irregular cluster that a rectangle would not fit. | +| `brush-x`, `brush-y` | Drags an interval along one axis; the marks in it emphasise. `mode: "stateful"` keeps the interval on screen to move and resize. On a polar chart the x brush is a sector. | Marks a period or a value range, to see what falls in it. | +| `brush-angle` | Drags an angular sector on a pie, donut, rose, or radar; the slices in it emphasise. | Takes adjacent slices of a part-to-whole chart together. | +| `linked-brush` | Drags a region; the groups inside emphasise in every chart that mounts the same preset. `groupBy` names the shared field; `mode: 'stateful'` keeps the rectangle on screen to move or resize. | Connects charts: groups picked in one show in every chart that shares the field. | +| **Move the view** | | | +| `navigate` | Drags to pan; wheels or pinches to zoom a continuous axis. `axes` limits it; `pan: false` leaves the plot drag free. On a map it moves the projection; on a globe (a world Choropleth with `projection: "orthographic"`) a drag turns the sphere and the zoom stays centred. On a map, `geometry.domain.focus` names the region at the centre. | Moves through a chart that holds more detail than fits at its size: a long series, a dense cluster, a map. | +| `brush-zoom` | Drags a rectangle; the chart flies into it. | Jumps into one stretch or box of a dense chart, and back out. | +| **Reduce or rearrange** | | | +| `legend-toggle` | Clicks a legend item; its series hides or returns. Hidden series are a setting and survive every reset. | Takes series out of view and brings them back, so the rest read without them. | +| `drag-reorder` | Drags a discrete axis label to a new place; the categories reorder. | Lets the reader set the order of the categories. | +| `filter-controls` | Picks values in controls beside the chart; the rows that fail are removed, or muted with `mode: "highlight"`. One control per listed field. | Switches the chart between subsets of a field it does not draw: a year, a group, a scenario. | +| **Mark for the reader** | | | +| `click-annotate` | Clicks a mark; a note with its value pins to it. | Leaves the values of chosen marks written on the chart, where there is room beside them for a note. | +| **Hand a gesture to the app** | | | +| `double-activate` | Double-clicks a mark; the mark activates and the host reads it. | Hands a mark to the app as an action, apart from selecting it. | +| `long-press` | Holds a mark (500 ms); the mark activates. The touch spelling of the same activation. | The same hand-off, on touch. | +| `context-activate` | Right-clicks or long-presses a mark; the host receives a context target and draws its own menu. | Hands a mark to a menu the app draws. | +| `context-menu` | The reader picks marks and a menu of the app's actions opens beside them; picking one emits `menu-select` with the item's id and the marks. `gesture` picks how: `rectangle` (default), `lasso`, `brush-x`, `brush-y`, `click`, `right-click`, `long-press`. `items` is required: `[{ "id", "label" }]`. One entry; it brings its own selection. | Offers the app's actions on the marks the reader picks, in a menu Flint draws. | +| **Read without a pointer** | | | +| `accessible-navigation` | Tabs into the chart and walks titles, axes, legends, facet headers, series, and marks with the arrow keys; Enter goes a level in, and inside a level Tab steps through it before moving on. Each step says what the element is and emphasises its data. Space on a focused element runs the click presets. | Makes the chart readable from the keyboard and a screen reader. | Within a family the rows answer neighbouring questions, so one chart takes one of them: `inspect` reads the marks near the pointer, `inspect-index` reads @@ -132,12 +96,6 @@ a shape; `navigate` moves continuously, `brush-zoom` jumps into a box; `double-activate`, `long-press`, and `context-activate` are three spellings of "hand this mark to the app" for a mouse, a finger, and a menu. -"Needs" is what the chart type offers; `list_chart_types` has already applied -it to the list it returns. The data confirms a few at mount, in Step 3. A -viewport a gesture commits, and a reset, fly over 400 ms; -`"transition": { "duration": 0 }` or `"resetTransition": { "duration": 0 }` -jumps. Panning and wheel zooming follow the pointer. - **`filter-controls`.** It draws real controls beside the chart and changes the rows the chart shows, so it answers a request that names a field to filter by ("filter by region", "one year at a time", "let me pick the group"), or a data @@ -151,13 +109,11 @@ categorical and temporal fields itself. One entry per chart. A fixed subset belongs in the data, and slices side by side are a facet in the `flint-chart-author` skill. -### Step 3 — resolve conflicts +### Conflicts -Each trigger has one owner. At mount, admission gives a trigger to the first -entry that asks for it; a later entry that asks for the same trigger yields -it with an `info` warning when it can keep the rest, or is dropped with a -warning when it cannot. The chart still renders. Four triggers are asked for -by more than one preset: +Each trigger has one owner; a later entry that asks for a taken trigger +yields it with an `info` warning, or is dropped with a warning when it +cannot work without it. Four triggers are shared: | Trigger | Asked for by | Free it with | | --- | --- | --- | @@ -166,11 +122,8 @@ by more than one preset: | The legend click | `legend-toggle`, `click-highlight`, `inspect-index` with `show: "single"` | `"targets": ["mark"]` on `click-highlight` | | The retained mark focus | `click-highlight`, `click-group-focus` | one of them | -`click-highlight` yields a legend or an axis click on its own, with an `info` -warning; `targets` keeps the spec silent. `accessible-navigation` takes no -pointer trigger, so it sits beside any entry. - -The data confirms what the chart type cannot promise. An entry that fails one +`accessible-navigation` takes no pointer trigger, so it sits beside any +entry. The data confirms what the chart type cannot promise. An entry that fails one of these at mount is dropped with a warning: - `legend-toggle` needs a colour field bound to a discrete legend. @@ -183,371 +136,122 @@ of these at mount is dropped with a warning: - `click-group-focus`, `hover-group-focus`, and `linked-brush` need `groupBy`, a bound field. -### Step 4 — write and validate +### Write and validate -The object is `{ "interactions": [ ... ] }`, beside `chart_spec` as -`interaction_spec`. Every entry is -`{ "type": , "id"?: , "options"?: { ... } }`: - -- `type` is a preset from the map, supported by the chart type per - `list_chart_types`. -- `options` holds the preset's own options; `list_interaction_presets` lists - every one with its type (see "Preset options"). `reset` is one of them: omit it for the default list in the map, set it to - free a trigger. A preset that keeps nothing (`hover-group-focus`, `inspect`, - `context-activate`) accepts no `reset`. -- `id` sits on the entry and is needed only when one preset appears twice. -- In code, the same entry is a factory call with the same options: - `clickHighlight({ targets: ['mark'] })`, `brushX()`, `navigate({ axes: 'x' })`. +Every entry is `{ "type": , "id"?: , "options"?: { ... } }`: +options nest under `options` (`reset` is one of them, set only to free a +trigger), and `id` sits on the entry, needed only when one preset appears +twice. ```json { "interactions": [ { "type": "click-highlight", "options": { "targets": ["mark"] } }, - { "type": "navigate", "options": { "axes": "x" } }, { "type": "legend-toggle" } ] } ``` -`validate_chart` checks the object without drawing, and `show` runs the same -check when it draws. A malformed entry -is an error: an unknown `type`, an option beside `type`, an `id` inside -`options`, a bare string entry, a missing required option, an unsupported -`reset` gesture, a duplicate `id`. A dropped or yielded entry is a warning -that names the entry, what it needed, and the chart type: +`show` checks it as it draws (`validate_chart` without a card). +An unknown `type`, an option beside `type`, an `id` inside `options` or a +missing required option is an error. A dropped or yielded entry is a warning +that names the entry and what it needed: ``` Interaction "legend-toggle" requires a discrete legend; Bar Chart has none. The interaction was dropped. -Interaction "click-highlight" yields legend clicks to "legend-toggle". -``` - -Fix or drop what it warns about. Return the bare object, strict JSON, unless -the user asks for commentary. - -### When no preset fits - -A host that runs code mounts a `CanvasInteractionDef` in `options.interactions` -beside presets: a trigger, what it affords, and a handler that returns the -layer for its id. - -```ts -import { rectangleTrigger, type CanvasInteractionDef } from 'flint-chart/interactive'; - -const timebox: CanvasInteractionDef = { - id: 'timebox', - eventSource: rectangleTrigger('contain'), - affordances: { plot: { cursor: 'region' } }, - reset: ['click-none', 'escape'], - handle(event) { - if (event.action !== 'select-region' || event.phase !== 'commit') return null; - const x = event.geometry.domain?.x; - const y = event.geometry.domain?.y; - if (x?.kind !== 'interval' || y?.kind !== 'interval') return null; - const keep = seriesInsideBox(x.start, x.end, Number(y.start), Number(y.end)); // host logic over host rows - return { - id: 'timebox', - ops: [{ op: 'set-style', - targets: keep.map((series) => ({ select: { key: { Series: series } } })), - value: { state: 'emphasized' } }], - }; - }, -}; -``` - -| Field | Role | -| --- | --- | -| `id` | Names the interaction in events and the layer it retains. | -| `eventSource` | The trigger: what to capture and how to read it. | -| `affordances` | The kinds of hit the handler receives, each with its cursor and hover; a hit of a kind not listed never reaches it. Keys: `mark`, `legend-item`, `axis-label`, `plot`. Cursors: `activate`, `drag`, `region`, `navigate`, `inspect`, `draw`. Hovers: `target` (the mark), `cohort` (its group). | -| `handle(event, context)` | Returns the whole layer for this id, or `null` for no change. | -| `reset` | Gestures that clear the layer: `click-none`, `double-click`, `escape`. A reset reports as a commit with no `interactionId`. It suits a layer of styles the state shows; an overlay or a data layer is cleared by the host. | - -**Triggers.** - -| Trigger | The reader does | `action` | `geometry.plot` | `geometry.domain` | Affordance key | -| --- | --- | --- | --- | --- | --- | -| `clickTrigger` | Clicks a mark, legend item, or axis label. | `click-element`, `click-legend`, `click-axis` | `point` | — | `mark`, `legend-item`, `axis-label` | -| `hoverTrigger` | Moves over a mark. | `hover-element`, `hover-legend`, `hover-axis` | `point` | — | same | -| `dragTrigger(tolerance?)` | Presses a mark, or a projectable overlay path, within `tolerance` px (12) and drags. | `drag` | `drag { start, current, delta }` | the pointer's values; `geometry.projection` while over a projectable overlay | `mark` | -| `rectangleTrigger(match?, guide?)` | Drags a rectangle. | `select-region` | `rect` | `x`, `y` intervals | `plot` | -| `xBrushTrigger(match?, mode?, guide?)`, `yBrushTrigger(…)` | Drags an interval along one axis. | `brush-x`, `brush-y` | `rect` | that axis's interval | `plot` | -| `lassoTrigger(match?, guide?)` | Draws a freehand region; previews begin at the third point. | `select-lasso` | `polygon` | `points`: the stroke so far, in data values | `plot` | -| `angularBrushTrigger(match?, mode?, guide?)` | Drags a sector on a polar chart. | `brush-angle` | `angular-sector` | — | `plot` | -| `inspectTrigger(mode?)` | Moves over the plot. | `inspect-x`, `inspect-y`, `inspect-xy` | `point` | `x`, `y` values | `plot` | -| `inspectIndexTrigger(axis?, show?, seriesBy?)` | Moves along the index axis. | `inspect-x`, `inspect-y` | `point` | the index value | `plot` | -| `navigationTrigger({ axes?, pan?, zoom?, reset? })` | Drags, wheels, pinches. | `pan-viewport`, `zoom-viewport`, `reset-viewport` | `viewport { delta, factor, anchor }` | the viewport after the move | `plot` | -| `contextTrigger`, `longPressTrigger(ms?)`, `doubleActivateTrigger` | Right-clicks, holds (500 ms), double-clicks a mark. | `context-element`, `long-press-element`, `double-activate-element` | `point` | — | `mark` | - -`match` is `'intersect'` (default) or `'contain'` and decides which marks the -region's `target` lists. `guide` styles the drawn shape; `false` hides it. A -region is ephemeral: its guide and its preview end at the commit. A brush or -`select` with `mode: 'stateful'` keeps its region on screen and editable, and -`event.operation` reads `create`, `move`, `resize-leading`, `resize-trailing`, -or `clear`. Spread a trigger to tune it: -`{ ...hoverTrigger, defaultAssistDistance: 28 }` acquires the nearest mark -within 28 px. A chart admits a trigger when it offers what the trigger needs, -per the map's "Needs"; a code definition the chart cannot honour throws at -mount with a message that names what it needed. - -**The event.** - -```ts -interface CanvasInteractionEvent { - action: string; // from the table - phase: 'start' | 'preview' | 'commit' | 'cancel'; // clicks and hovers skip start - operation?: string; // a stateful brush's edit, or pan | zoom | reset - geometry: { plot?, domain?, projection? }; - target: { visual: { kind, role }, elements: [{ value, records? }] } | null; - modifiers?: { shift, ctrl, meta }; - description?: { kind, type, content, text }; // on focus-element from accessible-navigation -} -``` - -- `target.elements[i].value` holds the mark's encoded values, derived fields - included; `records` holds the source rows when the runtime can prove them. A - region target lists every mark inside. A legend hit's `value` is a - `LegendTargetValue`: `{ channel, field, domain: { kind: 'value', value } }`, - or `{ kind: 'interval', start, end }` on a continuous legend. An axis-label - hit's `value` is an `AxisTargetValue`: `{ axis, field, value }`. -- `geometry.domain` is inverted through the plot's scales: a brush on a time - axis gives `domain.x = { kind: 'interval', start: Date, end: Date }`, a linear - axis gives numbers, a discrete axis gives the category. -- `description` arrives on `focus-element` while `accessible-navigation` walks - the chart: what the focused element is (`type`, such as "Bar") and what it - represents (`content`), with the spoken `text`. The walk's emphasis reports - through `onChange` as a `preview`. -- `geometry.projection.kind === 'path'` during a drag over an overlay with - `projectable: true`: `segment.start.value` and `segment.end.value` are the - overlay rows on each side of the pointer and `segment.t` the fraction between - them. - -**The types.** `flint-chart/interactive` exports these, and `flint-chart/react` -re-exports them. `onChange` receives a `ChartChange`: the gesture's own -`target` and `geometry`, and the chart's `state` after it. Generated from the -source by `npm run gen:reference`: - - -```ts -interface ChartChange { - // `preview` while a gesture runs, `commit` for a committed change, `cancel` when a gesture ends with none. - phase: ChartChangePhase; - // `host` for `updates`, `applyUpdate`, `clearUpdate` and `dispatch`; always `commit`. - source: ChartChangeSource; - changed: ChartStateFacet[]; - // The interaction behind the change: a reader's gesture, or an external interaction run by `dispatch`. - interactionId?: string; - action?: CanvasInteractionAction; - // The gesture's own hit: the hovered point, or the marks at an inspected index. - target?: SemanticTarget | null; - // The gesture's geometry: a brushed range, an index value, or the viewport after a move. - geometry?: CanvasInteractionEvent['geometry']; - // The reset gesture a reader made: a click on nothing, Escape, or a double-click. Reported even when the chart held nothing to reset, so a host that shows a selection of its own can let it go. - reset?: InteractionResetGesture; - state: ChartState; - previous: ChartState; -} - -interface ChartState { - chartType: string; - // The marks the chart emphasizes or focuses now, previews included. - selected: SemanticElement[]; - // The emphasized marks of each update, by update id; `selected` is their union. - entries?: ReadonlyMap; - // The legend values a toggle hides now. - hidden?: ChartHiddenValue[]; - // The domain the plot shows now, when the chart navigates. - viewport?: DomainGeometry; - // The category window of each rail. - windows?: Partial>; - categoryOrder?: unknown[]; - // The notes the chart holds now, previews included; `inView` tells which ones it draws. - annotations?: ChartAnnotation[]; - // The active filter of each field, set by filter controls; absent fields show every value. - filters?: Readonly>; -} - -interface SemanticTarget { - visual: { - kind: 'mark' | 'path' | 'region' | 'widget' | 'handle' | 'legend' | 'axis' | 'chart' | 'title' | 'header'; - role: string; - }; - elements: SemanticElement[]; -} - -interface SemanticElement { - // Values represented by the mark's channels, or by a semantic control such as a legend item. - value: Record; - // Contributing input records when provenance is available; zero or many may support one value. - records?: Record[]; -} - -interface LegendTargetValue { - channel?: string; - field?: string; - // The entry's value on a reader's hit; read `domain`, which every legend target carries. - value?: unknown; - domain: LegendDomain; -} - -type LegendDomain = - | { kind: 'value'; value: unknown } - | { kind: 'interval'; start?: number; end?: number }; - -interface AxisTargetValue { - axis: 'x' | 'y'; - field: string; - value: unknown; -} - -interface DomainGeometry { - x?: DomainCoordinate; - y?: DomainCoordinate; - points?: DomainPoint[]; - // The detail level a multi-level projected chart draws for this viewport. - level?: string; - // On a multi-level projected chart, the coarsest-level region under the plot centre: its feature id and properties plus the joined row fields. - focus?: Record; -} - -type DomainCoordinate = - | { kind: 'value'; value: DomainValue } - | { kind: 'interval'; start: DomainValue; end: DomainValue }; - -type DomainValue = number | Date | string; - -interface DomainPoint { - x?: DomainValue; - y?: DomainValue; -} - -interface ChartHiddenValue { - channel: string; - value: unknown; -} - -type FilterValue = - | { in: unknown[] } - | { range: [unknown, unknown] }; ``` - -- `context` is the chart state plus `available`, every drawn mark, for - building refs, and `selected`, the current emphasis, for a toggle rule. - -**The handler.** - -- It returns the complete layer for the id on every `preview` and `commit`; - the runtime drops the preview on `cancel`. A `null` on a `preview` shows - nothing until the commit, which is how a rule applies to the committed box - only. A region gesture keeps a preview layer under the interaction's id - while the drag runs, so a commit after previews restates the layer; a - `null` there lets the last preview stand. -- It maps geometry to the host's model and the model to ops. Host side - effects (state, panels, overlays the host draws) come from - `flint-interaction` or `onChange`, which carry the same event; the handler - itself returns ops and leaves the DOM to the runtime. -- Triggers have one owner for code definitions as for presets; two code - definitions on one trigger throw at mount. `navigate({ pan: false })` goes - beside a region trigger. -- An element drag owns the press on the marks it affords. A press there is a - `drag` with phase `start`; `target` is the pressed mark through every phase. - The layer returned at `start` is kept as the gesture's preview, and a release - without movement commits that preview with no further call. No click - definition fires on those marks, so the definition that drags a mark also - answers its press. -- A click definition that affords `hover` on marks receives `preview` events - for the hover cue. Return `null` or an emphasis for them, and the layer on - `commit`. - -**Patterns.** - -| Pattern | Flow | Pieces | -| --- | --- | --- | -| Gesture rule | Flint in, Flint out | A region trigger reads `geometry.domain`; the host rule picks rows; `set-style` by key (the timebox above). | -| Host-drawn detail | Flint in, custom out | `hoverTrigger` or `inspectTrigger` with a `null` handle; the host listens to `flint-interaction` for the resolved element and draws a lens, a cursor, or a badge over the mount. | -| Application drives the chart | external in, Flint out | `externalInteraction` plus `dispatch` per frame: a playback year, a reveal progress. | -| Drag along a path | press, then drag | One `dragTrigger()` definition and one layer. At `start` on a mark it returns the mark's path as a `set-overlay` `line` with `interactive: true, projectable: true` and `order`, plus `set-data` for the current position. On `preview` and `commit` with `geometry.projection` it returns the same two ops for the pointer's position. `intrinsicDomain` on the x and y fields holds the axes still across the swaps. | -| Freehand stroke | draw | The rows to guess form their own series, and a mount update sets `opacity: 0` on that series, which keeps the axis. `lassoTrigger('contain', false)` with `plot: { cursor: 'draw' }` is the pen: `geometry.domain.points` become the rows of a `set-overlay` line. An `externalInteraction` reveals the truth as an overlay, then the host clears the hide. | -| Chart-level zoom | wheel | When the layout itself must change (bar step, ticks, domain), filter the rows and `mountChart` again in a hidden layer; swap on `ready`. No preset re-lays out. | -| Semantic zoom on a map | navigate | A Choropleth with `level: 'auto'` (US states, then counties) or with your own `levels: [{ value, url, feature?, enter?, exit? }]` (one GeoJSON or TopoJSON object per level, rows joined on the feature `id` or `featureKey`, `baseMapUrl` drawn beneath as land without data), or a Map with `levelField` and `levels`; `navigate()`, and `set-viewport { region: { key } }` with a `transition` to fly into a region. Navigation events carry `geometry.domain.level` and `focus` (the coarsest region under the centre). A hover reaches the host through a hover affordance (`hover: 'target'`); a handler that returns `null` leaves the map as drawn. | - -Host-drawn detail, the shape of it: -```ts -const probe: CanvasInteractionDef = { - id: 'probe', - eventSource: { ...hoverTrigger, defaultAssistDistance: 28 }, - affordances: { mark: { hover: 'target' } }, - handle() { return null; }, -}; -container.addEventListener('flint-interaction', (e) => { - const { interactionId, event } = (e as CustomEvent).detail; - if (interactionId !== 'probe' || event.phase !== 'preview') return; - const row = event.target?.elements[0]?.records?.[0]; - if (row) lens.show(row); // the host draws; the chart is unchanged -}); -``` +Fix or drop what it warns about. ## Update the chart -### Step 1 — read the state - -A host hands the model the chart input and the state, as text or as data. The -MCP chart view does this after every build (first mount, new `updates`, a -panel edit) and every committed gesture, and each send replaces the last: - -``` -Chart "Life expectancy": Line Chart, theme economist. -Edited in panel: theme default → economist. -Encodings: x = year, y = life, color = continent. -Interactions: legend-toggle, navigate. -Agent updates (yours): -- asia: - ✓ emphasizes 3 marks where continent = Asia -- oceania: - ✗ emphasizes marks where continent = Oceania: no row has continent = Oceania. -User interactions: -- Hidden: Africa. -The y axis shows life from 70 to 86. -``` - -The state is in field terms: what the chart is after the reader's panel edits, -each op of your updates as applied (✓) or not and why (✗), what the reader -selected, hid or filtered, and the viewport on view when the chart navigates. -`validate_chart` and `show` return the same report before the -reader touches the chart, with `User interactions: none.` From it, decide what the -reader should see next: which rows stand out, what one note says, which range -frames them. The rows you were given are the source of every value; the chart -hands over no copy of the data, and nothing is computed that the chart cannot -verify. - -### Step 2 — choose ops - -Every change from outside is one update, `{ id, ops }`. Each op does one kind -of thing: +A chart opens clean. `updates` add the agent's own marks to it only for one +of these reasons; without one, what the agent wants to say goes in its reply. + +1. **The user asks for marks on the chart.** They name one ("label the peak", + "highlight Japan", "a line at $3", "shade the recession"), or describe a + chart that has to tell its point on its own ("for a slide"). +2. **The user asks about a chart already on screen.** The answer points at + the chart: emphasise the rows, note the value, frame the range. +3. **A requested interaction needs a starting state.** "Look at one year, + then slide along" opens on that year with `set-viewport`. +4. **A concrete question, pointed at lightly**, as below. + +### Muted annotations + +A question about particular values (a peak, a value at a date, a difference, +a crossing, a threshold, which items pass one) may point at its answer +without being asked. An overview question ("how did it move", "is there a +relationship") gets none. + +- **The title says it; the annotation points.** The answer is in the title + (and the reply). On the chart, only what directly answers the question: one + mark, two for a difference or a crossing, one span, or one small set. +- **A label names what it points at.** A few words that still mean something + on their own: the value and what identifies it ("$5.01 · Jun 13, 2022", + "China 26, Russia 23"). Not a bare tag ("Peak", "Max"), not a sentence, not + a repeat of the title or of a value label the chart already prints. +- **Room decides the form, not the chart type.** Where there is open space + beside the answer, a short label. Where marks fill the space round it (a + full grid of cells, a dense cluster, a bar that already prints its value), + the highlight alone: `annotate-text` with `text: ""` draws the ring or + outline and no caption. Many answers (more than three or four) get emphasis + with no labels, and the list goes in the reply. +- **Light forms.** A mark: `annotate-text` with the default `highlight: + 'light'`, or `'strong'` for an outline. A span or band: one + `annotate-region` under the marks, low opacity, a caption only when the + title does not give the range and the plot has room above it. A small set: + `set-style` with `state: 'emphasized'`, `emphasis: 'light'`, or an outline + per member. A clear cluster: one `annotate-enclosure`, no caption when the + legend names it. A value the question names: a plain `set-overlay` rule. +- **The answer is in view.** A pointer on a mark the reader cannot see is + nothing. On a chart that scrolls or opens zoomed (a long heatmap, a wide + calendar), narrow the data to the stretch that holds the answer, or open + the viewport on it. +- **Not muted:** notes that tell a story, several shaded episodes, context the + question did not ask about, `strong` or `exclusive` emphasis. Those need an + ask (reason 1). + +Text and paint come from the theme: notes take its annotation type, rings, +outlines and enclosures its `interaction.highlight`. Set them per update +(`value.style`, `value.highlightStyle`) only when the user asks. + +### The state + +After every build and every committed gesture, the MCP chart view sends the +agent the card's state in field terms: the chart after the reader's panel +edits, each op of your updates as applied (✓) or not and why (✗), what the +reader selected, hid or filtered, and the viewport. Read it before writing, +so an update does not undo what the reader set. The rows you were given are +the source of every value; nothing is computed that the chart cannot verify. + +### Ops | Op | It is for | Effect | Shape | Needs | | --- | --- | --- | --- | --- | -| `set-style` | The marks the chart already draws: emphasize some, fade some, hide some, recolour some. A highlight is this op with `state: 'emphasized'`. | Emphasize the targets and mute the rest; recolour; fade; hide. | `{ op, targets: UpdateTarget[], value: StyleSpec }` | marks | -| `set-annotation` | One mark that should carry a note. | Pin a note on one mark; `null` clears it. | `{ op, target: UpdateTarget, value: { text, anchor?: 'segment' \| 'point' } \| null }` | one resolved element | +| `set-style` | The marks the chart already draws: emphasize some, fade some, hide some, recolour some. A highlight is this op with `state: 'emphasized'`. | Emphasize the targets and recede the rest; recolour; fade; hide. `emphasis` sets how far the rest recede: `'light'` (default; they stay readable), `'strong'`, `'exclusive'` (only the targets read). | `{ op, targets: UpdateTarget[], value: StyleSpec }` | marks | +| `annotate-text` | One mark, a stretch of a line or area, a leg of a map route (`visual: { kind: 'path' }` on the row it leaves from), a slice or a region that should carry a note. | Set a caption beside it: plain words haloed in the page, a leader only where needed, never a card; `null` clears it. `highlight` marks what it names: `'none'`, `'light'` (default), `'strong'`, `'exclusive'` (the rest recede, so no separate `set-style` emphasis is needed). The caption takes the theme's annotation type (else the axis labels' face a size up); `style` sets one note's `fontSize`, `fontWeight` or `color`; `highlightStyle: { color, width }` its ring or outline, over the theme's `interaction.highlight`. `text: ""` draws the highlight alone (an outline or ring, no caption); with `text` omitted the chart words the note itself. For a boxed callout use `set-overlay` or `set-freeform-overlay`. `set-annotation` is its deprecated name; do not write it. | `{ op, target: UpdateTarget, value: { text, anchor?: 'segment' \| 'point', highlight?, style?: { fontSize?, fontWeight?, color? }, highlightStyle?: { color?, width? } } \| null }` | one resolved element | +| `annotate-region` | A stretch of the plot: a period, a band of values, a box, a run of categories. | Shade it, with an optional caption set on it; `null` clears it. | `{ op, name, value: { x?: [lo, hi] \| categories, y?: [lo, hi] \| categories, text?, color?, opacity?, layer?: 'under' \| 'over', placement?: 'top' \| 'bottom' \| 'left' \| 'right' \| 'center' \| 'above' \| 'below' } \| null }`; on a map `longitude: [west, east], latitude: [south, north]` in place of x and y | x or y scales, or a map (not a pie or radar) | +| `annotate-enclosure` | A group of marks that belong together: a cluster, a run of bars, a block of cells. | Outline each target group; one optional caption shared by them, with leaders to two or three outlines; `null` clears it. | `{ op, name, value: { targets: UpdateTarget[], text?, shape?: 'hull' \| 'rect' \| 'ellipse' \| 'circle', connect?: 'auto' \| 'all' \| 'none', color?, width? } \| null }` | marks | | `set-viewport` | The range or region the chart should frame. | Frame a continuous domain. | `{ op, axes: 'x' \| 'y' \| 'xy', value: { x?: [lo, hi], y?: [lo, hi] } }`; on a multi-level map `value: { region: { key } }` | `navigate` or `brush-zoom` mounted on that axis | | `set-order` | The order of the categories on a discrete axis. | Reorder the axis; list every category in the order wanted. | `{ op, scope: 'category', field, values: unknown[] }` | `drag-reorder` mounted on that axis | -| `set-overlay` | Marks the chart does not draw: a reference line, a threshold band, a forecast, a sketch of rows. | Draw new rows through the plot's own scales. | `{ op, name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2?, order?, color?, text? }, role, interactive?, projectable?, style? } \| null }` | x and y scales | +| `set-overlay` | Marks the chart does not draw: a reference line, a threshold band, a forecast, a sketch of rows. | Draw new rows through the plot's own scales. | `{ op, name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2?, order?, color?, text? }, role, interactive?, projectable?, style? } \| null }`; on a map `longitude`, `latitude` (and `longitude2`, `latitude2` for a rule or rect) in place of x and y | x and y scales, or a map | | `set-freeform-overlay` | A custom shape with no data behind it. | Draw SVG, or a clone of marks, over the plot. | `{ op, name, value: { coordinateSpace: 'plot' \| 'renderer', body: [{ type: 'svg', content } \| { type: 'clone', targets, transform?, opacity? }] } \| null }` | — | | `set-data` | The rows the chart draws, for playback or a swap. | Replace every row; the rows carry every encoded field. | `{ op, source: 'main', value: { rows } }` | inline data | -`StyleSpec` is `{ state?, opacity?, visible?, fill?, stroke?, strokeWidth?, -mutedOpacity? }`. Two states matter from outside: `emphasized` keeps the -targets at full ink and mutes every other mark; `normal` with `targets: []` -clears the layer. `opacity` on the targets fades a subset and leaves the rest -alone; `opacity: 0` hides marks and keeps the axes, where `visible: false` -removes the rows and shrinks the scales. The mute level is one per chart, -fixed at mount from the lowest `mutedOpacity` the mounted interactions carry -(0.25 when none). +`StyleSpec` is `{ state?, emphasis?, opacity?, visible?, fill?, stroke?, +strokeWidth?, mutedOpacity? }`. Two states matter from outside: `emphasized` +keeps the targets at full ink and recedes every other mark by `emphasis` +(`'light'` by default, `'strong'`, `'exclusive'`; `mutedOpacity` sets the level +outright); `normal` with `targets: []` clears the layer. `opacity` on the +targets fades a subset and leaves the rest alone; `opacity: 0` hides marks and +keeps the axes, where `visible: false` removes the rows and shrinks the scales. Overlay marks are `line`, `point`, `rule`, `rect`, `text`. `encodings` name fields of the overlay's own rows, projected through the chart's x, y, and -colour scales. `style` takes `stroke`, `strokeWidth`, `strokeDash`, `fill`, -`fillOpacity`, `opacity`, `pointRadius`, `fontSize`, `fontWeight`, `textAlign` +colour scales. `style` takes `stroke`, `strokeWidth`, `strokeDash` (lengths, or +`'dash'` / `'dot'`), `fill`, +`fillOpacity`, `opacity`, `pointRadius`, `fontSize`, `fontWeight`, `fontStyle` (`italic`), `textAlign` (`start`, `middle`, `end`), `dx`, `dy`. A `line` takes its stroke and a `text` its fill from the `color` encoding; a `point` takes `style.fill`. A `text` sits on the data, so it draws a halo in the chart's background; `stroke` sets another @@ -562,7 +266,7 @@ what the chart shows and is not a frame. Legend values belong to `legend-toggle`: no update hides or restores one, and a series fades with `opacity` instead. -### Step 3 — name targets and values +### Targets and values A target is one of three forms: @@ -575,8 +279,18 @@ A target is one of three forms: - A `where` describes a set, in the words filters use: each field `in` a list or within a `range` (ends included; `null` leaves an end open), and every field must hold. Use it for a period, a band of values, or several categories - at once, where a key would need one target per row. Only `set-style` takes a - `where`; a note or an order names one mark, so it takes a key. + at once, where a key would need one target per row. `set-style` and an + enclosure's targets take a `where`; a note or an order names one mark, so it + takes a key. +- Use the annotation ops to put a message on the chart: a note + (`annotate-text`) on a mark, a shaded region (`annotate-region`) over a + stretch of the plot (two bounds on a continuous axis, `null` for the plot's + end, or adjacent categories on a banded one), or an outline + (`annotate-enclosure`) round a group of marks, each with optional text. + Leave colour, shape and placement to the chart unless the request names + them. A note marks its own target through `highlight`; do not pair it with + a `set-style` emphasis to make the mark stand out. A stretch of a line or + area that spans a period is a region, not a note on one segment. - A selector key names fields the chart encodes (`x`, `y`, `color`, `detail`, `size`, …) and matches rows by equality, so `'2007'` and `2007` differ. One @@ -589,6 +303,10 @@ A target is one of three forms: a change from one row to the next ("2019 → 2020: +4%"); `anchor: "point"` marks the row's own point, for its value ("Dec 2022: $0.87B"). A note on the last row is always at its point. +- Annotation text says what the chart does not ("Promotion launched", "Lowest + in Q3"), not a value or label it already prints (`note_repeats_chart`). The + title states the finding; a note puts its specifics on the mark, and names + the mark where the chart does not (a dot on a scatter). - A field the chart does not encode resolves to nothing. Encode the identity field (`detail` on a scatter), or pass elements from `event.target`, `state.selected`, or `context.available` through as `{ visual, elements }`, @@ -622,7 +340,7 @@ reported as unsupported. ] } ``` -### Step 4 — send the layer and read the result +### Layers **Ids are layers.** One id holds one concern: the agent's update, a story step, a linked selection. Use one stable id, such as `agent`, and send the @@ -644,17 +362,11 @@ whole layer each time: - After `set-data` the marks are new; a style layer is sent again with the data. -**The result.** `applyUpdate`, `setUpdates`, and `dispatch` return a -`ChartUpdateResult`: `{ status: 'applied' | 'partially-applied' | -'unsupported', resolvedTargets, unresolvedTargets, unsupportedOps }`. An -unresolved target has a wrong field or value; an unsupported op needs a -preset the chart does not mount. What the chart shows is what the result says -it shows: fix an unresolved key or drop an unsupported op before describing -the chart. +### Send it -**From the MCP view.** There is no `applyUpdate` to call. Pass the same layers -as the `updates` argument beside the chart input, not inside it, to -`validate_chart` and then to `show` as part of `chart`: +Pass the layers as `updates`, a key of the chart input beside `data` and +`chart_spec` (not inside `chart_spec`), to `show` as part of `chart`, or to +`validate_chart` for the report without a card: ```json { @@ -663,7 +375,7 @@ as the `updates` argument beside the chart input, not inside it, to "updates": [ { "id": "agent", "ops": [ { "op": "set-style", "targets": [{ "select": { "key": { "region": "East" } } }], "value": { "state": "emphasized" } }, - { "op": "set-annotation", "target": { "select": { "key": { "region": "West" } } }, "value": { "text": "Lowest in Q3" } } + { "op": "annotate-text", "target": { "select": { "key": { "region": "West" } } }, "value": { "text": "Lowest in Q3" } } ] } ] } @@ -677,252 +389,15 @@ each stays where it is. The reader's own brush or selection does not survive the new view; the context message reports it in field terms, and it is carried as a layer when it still serves the reader. -Check the input and `updates` with `validate_chart` first. A malformed layer -or an invalid spec is an error, and `show` draws nothing for it. Otherwise the -result is the report above, one line per op, led by a count when an op did not -apply. The chart draws without a ✗ op: fix it in the layer (a key no row has, +A malformed layer or an invalid spec is an error, and `show` draws nothing +for it. Otherwise the report lists each op that will not apply, and why, led +by a count. The chart draws without a ✗ op: fix it in the layer (a key no row has, an overlay encoding written as `"x": "start"` instead of `{ "field": "start" }`, a viewport with no navigation preset) before you call `show`, or tell the reader what is missing. The reader's later brushes and clicks reach you with their next message, not in the same turn. -## Use Flint in an application - -### Mount - -```bash -npm install flint-chart vega vega-lite vega-tooltip -``` - -```ts -import { mountChart, navigate, legendToggle } from 'flint-chart/interactive'; - -const surface = mountChart(container, input, { - backend: 'vegalite', - renderer: 'svg', - interactions: [navigate({ axes: 'x' }), legendToggle()], - chartId: 'sales', -}); -await surface.ready; -const warnings = await surface.warnings; // interactions the chart could not honour -// … -surface.destroy(); -``` - -| Member | What it does | -| --- | --- | -| `ready`, `warnings` | Promises: the first render; the dropped or yielded interactions. Every call below waits for `ready` itself. | -| `applyUpdate(update, options?)` | Retains one update by id; replaces the layer with the same id. `options.transition.duration` animates a viewport. | -| `setUpdates(updates)` | Replaces every retained update. | -| `clearUpdate(id)` | Removes one layer. | -| `dispatch(id, payload)` | Runs an `externalInteraction` handler and applies what it returns. | -| `getState()` | What the chart shows now; `undefined` before `ready`. | -| `onChange(callback)` | Every change to that state, after the render; returns the unsubscribe. | -| `layout` | Once ready: `plot`, the plot box `{ width, height }` on a chart that draws one plot; `views`, each drawn view as `{ role, box: { x, y, width, height } }` (role `plot`, `text`, `tile` or `rule`; facet panels row by row); `block`, the box the views take with their axes and headers, without title and keys. Boxes are in pixels from the drawn chart's top left, read from what it drew, so they follow filters and resizes. `undefined` on charts with a category rail and on non-Vega-Lite backends. | -| `refresh()` | Re-projects overlays after the host rescales the chart. | -| `element`, `chartId` | The mount's root and the stable chart id. | -| `destroy()` | Removes listeners, the renderer, and the DOM. | - -- `input` is a `ChartAssemblyInput`. Presets go in `input.interaction_spec` as - JSON or in `options.interactions` as factory calls. Both may appear; spec - entries mount first, and a code definition with a spec entry's `id` - replaces it with an `interaction_overridden` info warning. -- A malformed `interaction_spec`, a repeated code `id`, or a code definition - the chart cannot honour fails the mount with an error that names it. A spec - entry the chart cannot honour is dropped with a warning instead. -- `options.availableSize: { width?, height? }` is the room the host gives the - chart. It becomes the `canvasSize` ceiling on the sides given, so the chart - lays out for that room rather than being scaled into it. -- `options.updates` holds retained updates present at the first render, for a - chart that starts with a part hidden or framed. -- `renderer: 'svg'` for charts whose marks a host reads from the DOM, or under - a few thousand marks; `'canvas'` for maps and dense charts. -- A `Year` or `Date` field makes a temporal axis whose rows hold `Date`s or - ISO strings; a bare number such as `2013` reads as milliseconds after 1970. - A `semantic_types` entry may be an object, - `{ semanticType, intrinsicDomain: [lo, hi] }`; the intrinsic domain holds an - axis still while the rows change. -- `options: { addTooltips: false }` on the input is the switch for the - tooltip, for a chart whose hidden values it would give away. -- Build with a bundler. The interactive entry reaches every backend through - lazy imports with no file extension; when `echarts`, `chart.js`, and - `plotly.js-dist-min` are not installed, mark them external (esbuild - `--splitting --external:echarts --external:chart.js --external:plotly.js-dist-min`; - Vite `build.rollupOptions.external`). -- In React, use `` from `flint-chart/react` rather than mounting - in an effect; see "In React" below. - -### In React - -```tsx -import { FlintChart, type FlintChartHandle } from 'flint-chart/react'; -import { clickHighlight } from 'flint-chart/interactive'; - -const chartRef = useRef(null); - - setSelected(change.state.selected)} - onError={(error) => report(error)} -/>; -``` - -| Prop | What it does | -| --- | --- | -| `spec` | The `ChartAssemblyInput`, `interaction_spec` included. A change of content remounts; rows compare by reference. | -| `interactions` | Factory calls added to the spec's entries, or `(fromSpec) => definitions` for the full list. A factory rebuilt with the same id and options keeps the chart; a changed option remounts it. | -| `updates` | Host updates, diffed by id. Passing even `[]` mounts the runtime on a chart with no interactions. | -| `width`, `height`, `fit` | The box. `fit` is `scale-down` (default; never scales up), `crop` (natural size, clipped), or `relayout` (the box becomes the layout room; a resize remounts once it settles, so a selection does not survive it). | -| `onChange`, `onInteraction` | The state after a change, and the raw gesture record. | -| `onRender`, `onWarnings`, `onError` | Each mount's render and warnings; a failed mount, shown in the box as a muted error. | -| `fallback` | Shown until the chart mounts. | -| `ariaLabel`, `chartId` | `ariaLabel` applies in place; a new `chartId` remounts. | - -The ref's `FlintChartHandle` holds `surface` (the mounted surface or `null`), -`applyUpdate`, `clearUpdate`, `dispatch`, `getState`, and `refresh`. A remount -keeps the old chart on screen until the new one is ready. - -### Read the chart - -| `getState()` field | Holds | -| --- | --- | -| `selected` | The marks the chart emphasizes now, previews included. | -| `entries` | The same marks per update id, with `layer: 'retained' \| 'preview'`. | -| `hidden` | Legend values a `legend-toggle` hides, as `{ channel, value }`. | -| `viewport` | The domain on view after a pan or zoom; absent on a chart that does not navigate. | -| `categoryOrder` | The order of the reorderable axis now. | -| `windows` | Category rail windows, `{ start, count, total }` per channel. | - -Each element's `value` is the mark in field terms: a bar's category and -measure, a legend item's `{ channel, field, domain }`, a histogram bar's -`{ field, range }`. The host owns the rows and queries them from the value and -the geometry. - -`onChange` fires after every render with a `ChartChange`: `phase` (`preview` -while a gesture runs, `commit` for a committed change or a host call, `cancel` -when a gesture ends with nothing), `interactionId` and `action` (absent for a -host call and for a reset), the gesture's own `target` and `geometry`, and the -`state` after. An overlay or a data swap leaves no trace in the state, so the -host keeps that model itself. - -```ts -const valuesOf = (elements: readonly SemanticElement[]) => elements.map((element) => element.value); - -// A panel follows the gesture live, else shows what the chart shows. -surface.onChange(({ phase, target, state }) => { - const hit = valuesOf(target?.elements ?? []); - panel.show(phase === 'preview' && hit.length > 0 ? hit : valuesOf(state.selected)); -}); - -// An agent context reads committed state only: values and ranges, never rows. -surface.onChange(({ phase, state, geometry }) => { - if (phase !== 'commit') return; - sendContext({ selected: valuesOf(state.selected), range: geometry?.domain, hidden: state.hidden, viewport: state.viewport }); -}); -``` - -The container also emits a bubbling DOM event, `flint-interaction`, for every -canvas interaction, before the chart reacts: `detail.chartId`, -`detail.interactionId`, and `detail.event`, the same `CanvasInteractionEvent` -a handler gets. It fires for a definition whose `handle` returns `null`, so it -is the path for a host that draws its own response to a gesture. - -Things the surface holds fixed: no preset changes the layout, so a zoom never -recomputes the bar step, the ticks, or the domain (filter the rows and mount -again for that); the mute level is set at mount; Escape reaches a chart after -a press on it, and only that chart; a preset's toggle (`select`, -`click-highlight`) needs Shift, Ctrl, or Meta, and a plain second click -replaces; a press on an overlay path resolves to no mark, so a `click-none` -reset on the definition that drew the overlay clears it at that press. - -## Link charts - -`linkCharts` links mounted charts on the fields they share. A selection on one -chart (a click, a brush, a group focus, a hover) becomes one condition, a part -per field; every chart emphasizes the marks that meet it, the source included, -through one `linked-selection` layer; a reset on any chart clears it everywhere. - -```ts -import { linkCharts, mountChart, clickHighlight, brushX } from 'flint-chart/interactive'; - -const link = linkCharts({ - bars: { input: barsInput, surface: mountChart(barsEl, barsInput, { backend: 'vegalite', interactions: [clickHighlight()] }) }, - trend: { input: trendInput, surface: mountChart(trendEl, trendInput, { backend: 'vegalite', interactions: [brushX()] }) }, -}, { fields: ['region', 'month'] }); -for (const [id, chart] of Object.entries(await link.links)) console.log(id, chart.notes); // what each chart left out -link.onCondition(({ condition }) => table.filter(condition)); // { region: { in: ['Asia'] }, month: { range: [start, end] } } -// link.clear(); link.destroy(); -``` - -**A table, a filter or any control beside linked charts** joins the same -condition: `link.select(parts)` sets parts as if a chart had selected them, and -`onCondition` gives the table what to show. One condition, so a row click, a -region picker and a brush combine (AND) and a reset on any chart clears them all. - -```ts -row.addEventListener('click', () => link.select({ country: { in: [row.dataset.country] } })); -regionPicker.addEventListener('change', (e) => link.select({ region: e.target.value ? { in: [e.target.value] } : null })); // null lets go -link.onCondition(({ condition }) => renderTable(rows.filter((r) => meets(r, condition)))); -``` - -- `select` only takes fields in `fields`; a chart shows a part when its marks - carry the field (encode it, or put it on `detail`). -- The link emphasizes the matching marks; to drop rows instead (a filter), give - the charts filtered data as below. - -```tsx -import { FlintChart, useLinkedCharts } from 'flint-chart/react'; - -const link = useLinkedCharts({ bars: barsInput, trend: trendInput }, { fields: ['region', 'month'] }); -; -// link.select({ region: { in: ["Asia"] } }) from a table or control; link.clear() -; -// the chart's own onChange, onRender and updates go through chart(id, own); a prop after the spread replaces the link's -// link.condition.condition is the same condition; filtered rows in `spec` keep it -``` - -- A chart receives a field when its marks carry it (encode it, on `detail` if - nothing else shows it), and sends through each selecting interaction whose - subject includes a connected field. `{ charts: { trend: { receive: false } } }` - keeps a chart as drawn; `send: false` keeps its selections to itself. -- The link emphasizes; it never filters or re-aggregates. To filter, read the - condition (`onCondition`, `link.condition`) and give each chart its rows: - beside `linkCharts`, a `set-data` update (a new spec remounts the chart, and - the link holds the old surface); beside `useLinkedCharts`, a `spec` with the - filtered rows. -- `setUpdates` replaces every layer, the link's included, until the condition - next changes; use `applyUpdate` and `clearUpdate` beside a link. -- `linkCharts` checks the charts with the validator, loaded on first use; pass - `{ links }` from `validateLinks` (`flint-chart/validate`) to skip that load. - -For a link `linkCharts` does not express (a payload each chart reads its own -way), wire `onChange` to an `externalInteraction` on the other charts: - -```ts -const linked = externalInteraction<{ countries: string[] }>({ - id: 'linked', - handle: ({ countries }) => ({ - id: 'linked', - ops: [{ op: 'set-style', targets: [{ select: { where: { Country: { in: countries } } } }], value: { state: 'emphasized' } }], - }), -}); -source.onChange(({ phase, interactionId, state }) => { - if (phase !== 'commit' || !interactionId) return; // host writes carry no id: no loop - void other.dispatch('linked', { countries: state.selected.map((element) => String(element.value.Country)) }); -}); -``` - -Linked charts share one `theme_spec` so a value has one colour everywhere. - -The same `dispatch` drives a chart over time: a playback loop dispatches one -frame per animation frame, and the handler returns the whole layer for that -frame. - ## Worked examples In each example `data` is a placeholder; the host binds real rows. @@ -958,61 +433,24 @@ different trigger, a click on a bar and a drag on an axis label. } ``` -### Presets: a multi-series line chart in an explore session - -User: "Help me understand how these three regions moved." The chart: - -```json -{ - "data": { "values": [] }, - "semantic_types": { "month": "YearMonth", "sales": "Amount", "region": "Region" }, - "chart_spec": { "chartType": "Line Chart", "encodings": { "x": { "field": "month" }, "y": { "field": "sales" }, "color": { "field": "region" } } } -} -``` - -The reader compares the series at one month, hides a region, and points at a -period. `inspect-index` reads every series at one month; `legend-toggle` has a -colour field to work with; `brush-x` focuses a period. `inspect-index` with -`show: "all"` asks for no legend click, so it sits beside `legend-toggle`. - -```json -{ - "interactions": [ - { "type": "inspect-index" }, - { "type": "legend-toggle" }, - { "type": "brush-x" } - ] -} -``` - -### Presets: a chart that drives the app +### Presets: comparing a few series -User: "In my dashboard, a click selects the country and a double-click opens -its page. Zooming the y axis would help too." A scatter of `gdp` by `life` -with `color: continent` and `detail: country`. +User: "Make this interactive so I can compare the three regions month by +month." A line chart of `sales` by `month`, `color: region`. -`navigate` holds the double-click by default for its reset, and -`double-activate` needs it; `reset: ["escape"]` frees it. `click-highlight` -takes `targets: ["mark"]` so the app's selection comes from marks only. +The user asks for behaviour and names the job: comparing the series at one +month. `inspect-index` reads all three at the month under the pointer, which +the tooltip (one line at a time) does not. Nothing else was asked for. ```json -{ - "interactions": [ - { "type": "click-highlight", "options": { "targets": ["mark"] } }, - { "type": "double-activate" }, - { "type": "navigate", "options": { "axes": "y", "reset": ["escape"] } } - ] -} +{ "interactions": [ { "type": "inspect-index" } ] } ``` -The app reads the selection from `onChange` on a `commit` whose `action` is -`click-element`, and the activation from one whose `action` is -`double-activate-element`. - ### ChartUpdate: an agent points out rows -User: "Which Asian countries are past 80 years? Point them out." The chart is -the scatter above, with `navigate` on `y`, and the state says nothing is +User: "Which Asian countries are past 80 years? Point them out." The chart on +screen is a scatter of `gdp` by `life` with `color: continent`, +`detail: country` and `navigate` on `y`, and the state says nothing is emphasized. The agent finds Japan and Singapore in its rows and answers: ```json @@ -1025,7 +463,7 @@ emphasized. The agent finds Japan and Singapore in its rows and answers: { "select": { "key": { "country": "Singapore" } } } ], "value": { "state": "emphasized" } }, - { "op": "set-annotation", + { "op": "annotate-text", "target": { "select": { "key": { "country": "Japan" } } }, "value": { "text": "Japan, 82.6 years" } }, { "op": "set-viewport", "axes": "y", "value": { "y": [70, 86] } } @@ -1037,50 +475,21 @@ emphasized. The agent finds Japan and Singapore in its rows and answers: `applied` with two resolved targets; a key with `"Country"` would come back unresolved, and the agent fixes the spelling before it describes the chart. -### Code: two linked charts - -Two bar charts share a `Country` field: GDP per country, and population per -country. A click on one emphasizes the same country on both. - -```ts -import { mountChart, clickHighlight, linkCharts } from 'flint-chart/interactive'; - -const mount = (el: HTMLElement, input: ChartAssemblyInput) => - ({ input, surface: mountChart(el, input, { backend: 'vegalite', interactions: [clickHighlight({ targets: ['mark'] })] }) }); -const link = linkCharts({ gdp: mount(gdpEl, gdpInput), population: mount(popEl, popInput) }, { fields: ['Country'] }); -``` - -The clicked chart drops its own emphasis once the link shows the condition, so -both charts show one selection. A `click-none`, Escape, or double-click on -either chart clears it on both; the link's own writes are host changes, so no -chart echoes them back. - -### Bespoke: a rule over the brushed box - -A line chart of `Series` by `Month`. The reader drags a box; the series whose -every point in that month range lies inside the y range stay emphasized. No -preset applies a rule over series, so the definition is the `timebox` above: -`rectangleTrigger('contain')`, a `plot` affordance with the `region` cursor, -a handler that acts on `select-region` at `commit`, and `reset: -['click-none', 'escape']` so a click on empty plot clears it. It mounts beside -`navigate({ pan: false })` when the chart also zooms, since both ask for the -plot drag otherwise. - ## Validation checklist For an `interaction_spec`: 1. It parses as strict JSON and is a bare object with `interactions`. -2. Every entry answers a job from Step 1: a gesture the user named, a - question their goal raises, or something the chart invites. +2. Every entry has a reason (the user asked, the chart is linked, or the data + needs it to be read) and a job the tooltip and legend do not do. 3. Every `type` is in the chart type's list from `list_chart_types`, and every option is under `options` with `id` on the entry. 4. `groupBy` and `seriesBy` are present where required, and name bound fields. 5. At most one entry owns the plot drag, the double-click, the legend click, and the retained mark focus. -6. `validate_chart` returns no warning. +6. The report notes no dropped or yielded entry. -For a `ChartUpdate`: +For `updates` or a `ChartUpdate`: 1. Every `op` and `state` is one from the op table. 2. Every selector key names encoded fields with values that exist in the rows. @@ -1090,16 +499,6 @@ For a `ChartUpdate`: and acted on. 5. The result came back `applied` before you said what the chart shows. -For code: - -1. Every trigger, cursor, and field name is one from this skill or the - installed `flint-chart/interactive` types. -2. Every definition declares `affordances` for the hits its trigger yields. -3. No two definitions, and no definition and spec entry, share a trigger or - an `id`. -4. The surface is destroyed on unmount, and every `applyUpdate` or `dispatch` - result is read. - ## Preset options `list_interaction_presets` returns every preset with what it needs from the @@ -1111,3 +510,4 @@ option: it sits on the entry. A `ResetGesture` is `click-none`, `double-click`, or `escape`. `dimOpacity` is the opacity of the muted marks, 0.25 by default. A `guide` is `{ visible?, style? }`, or `false` to draw nothing while the gesture runs. + diff --git a/agent-skills/flint-theme-author/SKILL.md b/agent-skills/flint-theme-author/SKILL.md index 8a4df70c..51a98737 100644 --- a/agent-skills/flint-theme-author/SKILL.md +++ b/agent-skills/flint-theme-author/SKILL.md @@ -219,6 +219,8 @@ the authored blocks and their jobs: `interaction.selectionBoundary` accepts `color`, `width`, `opacity`, `haloColor`, `haloWidth`, and `haloOpacity`. Omitted paint is grounded from the theme: foreground from `ink.accent` then primary text, and halo from the plot or canvas surface. Use explicit values only when the house has a distinct interaction treatment. +`interaction.highlight` accepts `color`, `width`, `haloColor`, and `haloWidth`: the paint of the ring round a dot, the outline round a bar, cell, slice or region an annotation names, and an enclosure's outline. Unset, they take the neutral annotation grey; an update's own `highlightStyle` (or an enclosure's `color` and `width`) overrides it. + This is a shape example, not a palette recommendation. Derive actual values from the user's references. diff --git a/docs/api-reference.md b/docs/api-reference.md index 20a82ccf..ec5a3fc2 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -43,6 +43,7 @@ interface SemanticAnnotation { unit?: string; // e.g. USD, °C sortOrder?: string[]; // custom ordinal order colors?: Record; // colours bound to values, e.g. { DFL: "#0793AB" } + percentScale?: 'fraction' | 'percent'; // how a percentage is stored: 0.45 or 45 for 45% } ``` @@ -128,6 +129,7 @@ interface ChartAssemblyInput { }; theme_spec?: ThemeSpec | string; // presentation, Vega-Lite only interaction_spec?: InteractionSpec; // behaviour, Vega-Lite interactive surface only + updates?: ChartUpdate[]; // notes, overlays, emphasis applied once drawn; interactive runtime only options?: AssembleOptions; field_display_names?: Record; } @@ -179,6 +181,28 @@ cannot honour is dropped with an `unsupported_interaction` warning, and `validat reports the same warnings before anything renders. `supportedInteractionPresets(def.interactionSupport)` lists the presets a template supports by declaration. See [Using interactions](/documentation/interaction-spec). +### `updates` + +Updates the chart applies once it is drawn — notes, overlays, emphasis, a viewport — kept with the +spec, so a copied spec keeps them. They are the same `ChartUpdate` layers a host passes to +`mountChart(…, { updates })` or ``; the spec's are applied first, and a host +update with the same `id` replaces the spec's. `validateChart` checks them with the host's, op by op. + +The interactive runtime applies them (Vega-Lite). A static output — `assembleVegaLite`'s spec, +`renderSvg`, the other backends — draws the chart without them and says so with an `info` warning, +`updates-not-compiled`: notes and overlays are drawn by the runtime, not compiled into Vega-Lite. + +```jsonc +{ + "data": { … }, "chart_spec": { … }, + "updates": [ + { "id": "story", "ops": [ + { "op": "annotate-text", "target": { "select": { "key": { "Stop": 2 } } }, "value": { "text": "Ismarus sacked" } } + ] } + ] +} +``` + ### `chart_spec` | Field | Description | @@ -316,6 +340,14 @@ reads better (`canvasRefit: false` leaves this step out). The pass never lays a chart out larger for the host to shrink: a chart nothing mends is drawn at its own size, for the reader to scroll or the host to scale. +Given a `canvasSize`, a drawing the pass leaves running past it is then **contained**: the chart is +laid out again for a smaller room — the edits kept, the keys at the edge they stood at — so the plot +gives up the room and the keys, labels and title stand inside the canvas. The room is searched for a +few rounds; a round is kept only where the plot keeps at least half of each side, no value is cut +and no label is turned that stood flat, so what cannot be brought within is left nearer, for the +host to scale. This applies to single Vega-Lite views (`treatment.contain` in `_canvasFit`, reported +as `canvas-contain`); a chart without a `canvasSize` is unchanged. + Nothing is cut, no edit shrinks text past legibility — nor makes text already too small smaller still — and the chart's own shape is never changed. `'off'` lays every chart out as planned. What the pass judged and did is attached to a Vega-Lite spec as `_canvasFit`, and reported in `_theme.report` (`canvas-fit`). @@ -328,6 +360,99 @@ for larger tick labels across the whole chart. Full list: `packages/flint-js/src/core/types.ts` (`AssembleOptions`). Behavior: [Auto Layout Algorithm](/documentation/layout-model). +### Map boundaries + +A map draws the boundaries `chartProperties.boundaries` names. Unset, a world map draws World Bank +Official Boundaries and a US map the Census Bureau's (via us-atlas). + +```jsonc +"chartProperties": { "boundaries": "natural-earth" } // a named set: "world-bank" (default) or "natural-earth" + +"chartProperties": { + "boundaries": { // a file of the chart's own + "url": "/maps/india-view.topojson", // or { "coarse": …, "medium": … }; or "values": + "feature": "countries", // TopoJSON object of the regions (omit for GeoJSON) + "ids": "iso3", // iso-numeric (default) | iso3 | iso2 | fips | as-is + "key": "properties.iso", // where each feature keeps its id (default "id") + "disputed": "lines", // optional: an object of borders drawn dotted + "attribution": "Survey of India" // or { "text", "href", "title" }: credited at the map's foot + } +} +``` + +- **Named sets.** `world-bank` draws areas of non-determined legal status as regions of their own, + dots the borders they share, and credits the World Bank (CC BY 4.0) with its disclaimer; + `natural-earth` draws de facto borders and credits no one (public domain). A compiled spec names + them by URL on Flint's site, `https://microsoft.github.io/flint-chart/geo/v1/…` — a version whose + files never change — so it draws wherever it is rendered. Flint's renderers (`mountChart`, + ``, `renderSvg`) fetch nothing: they load the copies bundled in the package, and + `withBundledBoundaries(loader)` from `flint-chart/vegalite` does the same for a Vega view of your + own. For a renderer with no network (vl-convert, a sandboxed iframe, an offline app), + `inlineBoundaries(spec)` from `flint-chart/geo` writes the shapes into a compiled spec. Sources + and licences: `packages/flint-js/src/geo/NOTICE.md`. +- **A file of your own.** Flint takes no position on disputed boundaries, and a country's law may + require its own (India's and China's do): a chart whose audience needs other boundaries gives + them. `ids` says what the file's feature ids are, and the rows are read into that form: with + country codes (`iso-numeric`, `iso3`, `iso2`) the map frames, projects and joins as the world map + does, names and codes in the data resolving to the file's ids; with `fips` it draws the US in + longitude and latitude; with `as-is` the rows match the file's keys exactly. A file keyed by FIPS + or by its own keys is fitted to its shapes. Its credit is its `attribution`; its borders are + dotted only where `disputed` names an object; and Flint does not warn which countries it leaves + out, which only the file knows. +- **Unknown or malformed.** A name Flint does not ship, or a file with neither `url` nor `values`, + draws the default with an `invalid-option-value` warning. +- **Several levels of your own geography** (provinces, then counties): the Choropleth's + `chartProperties.levels` (`{ value, url, feature? }`, coarsest first) and `featureKey` join the + rows to your features by your own keys, and `baseMapUrl` draws land beneath them. + +### Map routes + +A `Map` with an `order` encoding joins its points into routes, in that field's order (numbers by +value, dates by time, text with its numbers read). Rows split into one route per `detail` value, +else per value of a categorical `color`, which the route then takes; otherwise the route is drawn +in a neutral ink and the points keep their colour. + +```jsonc +"chart_spec": { + "chartType": "Map", + "encodings": { "longitude": "lon", "latitude": "lat", "order": "Stop" }, + "chartProperties": { "arrows": true, "curve": "auto" } +} +``` + +- `curve`: `auto` bows the legs of a route of stops into arcs (to the left of travel, so a leg out + and the leg back part ways) and follows great circles on a globe or along a track of more than 24 + legs; `arc`, `great-circle` and `straight` (a constant compass bearing) choose one. +- `strokeWidth` is the routes' width, leg by leg from the row each leaves: zero-based, linear, 1 to + 8 px, with a line-width key. Where many long legs crowd the plot, the widest thins (to no less + than 40% of 8 px), so their ink stays about 6% of the plot. On a map without `order` it has no legs to widen and is left out, with + a warning. `size` stays the dots' area, so one map can carry both. +- A route is drawn as its lines and arrowheads, between the stops' true places; it draws no dot of + its own. The stops are the map's points, and the encodings say which take a dot: every stop where + the points carry something the routes do not — `size` (by value, zero-based by area, 2.5–7 px, with + a key), `shape`, `text` (a label's anchor) or a quantity's `color` — else only each route's first + stop, where no arrowhead marks it. A dot is one size by default (from the routes' typical width, + 2.5–4 px). An undrawn stop keeps its tooltip, hover and notes. Dots lie beneath the routes, drawn in + two passes: every halo (the lines', the heads', each dot's rim), then every ink (dots, lines, + heads), so a line, its dot and the head arriving at it read as one shape. A route without a series + colour is drawn in the theme's mark colour (a neutral ink beside points coloured by another + field), square-ended and mitred, with a hairline halo (white on a light map, the ground on a dark + one). Any other dot is the author's to add, as an update layer. +- `arrows` (default `true`): an arrowhead at the end of each leg, or at the end of a track only, + sized to its line and set on it: its tip at the stop, the middle of its base on the line a head's + length back, the line ending square inside it. Its length and width grow with the line's width. A + leg too short on screen for its head shrinks it, to 60% of its size and then to the leg's own + length, so a short leg keeps a small head; only a leg a few px long keeps its line alone. Where + three or more legs arrive at one stop, their heads stand on a ring round it, shrunk with their + number, and past twelve only the widest keep one. Each head reads its heading, and each line its + length, from the live projection inside the spec, so both follow a pan, zoom or globe drag in any + Vega renderer. +- `text` names points beside them, the most salient first (the largest dots by `size`, else the + ends of a quantity's `color`), at most one per 36,000 px² of the plot; the rest keep their + tooltips. +- The lines are geoshapes: the projection draws them, cut at the antimeridian and hidden past a + globe's horizon. They and their heads take no tooltip; the points keep theirs. + --- # §5 Complete example @@ -376,6 +501,26 @@ vlGetTemplateChannels('Scatter Plot'); // ["x", "y", "color", "size", "opacity", "column", "row"] ``` +### Map labels and shapes + +- `text` on a `Map` names each point beside it — right of its dot, else left, above or below, + whichever clears every dot, every label placed before it, the plot's edge and (where it can) a + route's lines. Placement is worked out once, at compile time, through the projection the map will + draw; the largest dots (by `size`) are named first. A point whose label has no room stays unnamed, + and an `info` warning (`map-labels-dropped`) says how many. Labels stay beside their points through + pan, zoom and a globe's turn. +- `text` on a `Choropleth` names each region with a row at its middle, shown while the region on + screen is wider and taller than its label (small regions' names appear on zoom). It is white or a + dark ink, whichever reads better on its region's fill, with a halo in that fill. +- `shape` on a `Map` draws its points as filled symbols, one per category, with a key. + +```jsonc +{ + "chartType": "Map", + "encodings": { "longitude": "lon", "latitude": "lat", "size": "Population", "text": "City", "shape": "Kind" } +} +``` + --- # §7 Core utilities @@ -469,8 +614,11 @@ Inspect `_warnings` or `ChartWarning` arrays in integration code to surface trun | `flint-chart/chartjs` | Chart.js templates and `assembleChartjs` | | `flint-chart/validate` | `validateChart` and input validation helpers | | `flint-chart/interactive` | `mountChart`, interaction presets, update helpers | +| `flint-chart/interactive/` | The same, reaching only that backend (`vegalite`, `echarts`, `chartjs`, `plotly`): for one-file bundles | | `flint-chart/react` | `` component (React is an optional peer dependency) | +| `flint-chart/react/` | The same, reaching only that backend: for one-file bundles | | `flint-chart/render` | `renderSvg` for static SVG without a DOM | +| `flint-chart/geo` | The named boundaries as TopoJSON, and `inlineBoundaries` to write them into a compiled spec | | `flint-chart/test-data` | Gallery generators (`TEST_GENERATORS`) | --- diff --git a/docs/design-interactions.md b/docs/design-interactions.md index 6523c883..15629d52 100644 --- a/docs/design-interactions.md +++ b/docs/design-interactions.md @@ -92,7 +92,7 @@ applies it: | Op | Effect | |---|---| | `set-style` | emphasise or mute targets, hide a series | -| `set-annotation` | pin or clear an annotation on a target | +| `annotate-text` | pin or clear an annotation on a target | | `set-viewport` | move a continuous domain or a projection | | `set-order` | reorder a discrete domain | | `set-overlay`, `set-freeform-overlay` | draw a guide or a free path | diff --git a/docs/design-layout-plan.md b/docs/design-layout-plan.md index cdeeae6e..b5dcf077 100644 --- a/docs/design-layout-plan.md +++ b/docs/design-layout-plan.md @@ -146,7 +146,7 @@ before it moved into the plan; a fix corrects its inputs (§13). ## §4.3 Title `planTitle` (`core/title-plan.ts`) fits a single-view chart's headline and deck to its block: set -down a size, or broken over even lines whose extra height comes out of the plot. The deck is the +down a size, or broken over lines filled to the block, with no widow at the end, whose extra height comes out of the plot. The deck is the author's plus the axis titles a theme moves there. A title is measured with the width table in its own font and weight, in every environment, since it is drawn with real glyphs even where a chart is compiled without a canvas; a title that runs past its block at all is fitted. A template whose diff --git a/docs/design-semantics.md b/docs/design-semantics.md index b607a26e..a9e717cc 100644 --- a/docs/design-semantics.md +++ b/docs/design-semantics.md @@ -360,6 +360,11 @@ interface SemanticAnnotation { * Well-known types (Month, DayOfWeek) need not provide this. */ sortOrder?: string[]; + /** + * How a percentage is stored: 'fraction' (0.45 is 45%) or 'percent' (45 is 45%). + * Skips representation detection (§3.4). + */ + percentScale?: 'fraction' | 'percent'; } ``` @@ -388,7 +393,7 @@ Some types appear in different numeric encodings. The builder resolves these rep | Type | Representations | Detection | |---|---|---| -| **Percentage** | 0–1 fractional vs 0–100 whole | `max(data) ≤ 1` → fractional; else whole; or `intrinsicDomain` | +| **Percentage** | 0–1 fractional vs 0–100 whole | `percentScale`; else a decisive `intrinsicDomain`; else ≥80% of `abs(data) ≤ 1` → fractional | | **Timestamp** | Unix s, Unix ms, ISO string | Magnitude >1e12 → ms; >1e9 → s; string → parse | | **Month / Day** | Numeric vs abbreviated vs full name | Data type + pattern matching | | **Boolean** | true/false, 0/1, Yes/No | Data type + distinct values | @@ -401,7 +406,7 @@ Some types appear in different numeric encodings. The builder resolves these rep | Domain | [0, 1] | [0, 100] | | Ticks | 0, 0.25, 0.5, 0.75, 1.0 | 0, 25, 50, 75, 100 | -Priority: (1) explicit `intrinsicDomain`, (2) data inspection, (3) conservative default. If at least 80% of absolute values are ≤1, treat the field as fractional. +Priority: (1) explicit `percentScale` (`'fraction'` or `'percent'`), (2) an `intrinsicDomain` that settles it (within ±1 is fractional; reaching 100 is whole), (3) data inspection, (4) conservative default. If at least 80% of absolute values are ≤1, treat the field as fractional. A growth rate stored as fractions mostly past 1 (2.4 for 240%) needs `percentScale: 'fraction'`: its values read as whole numbers. ## §3.5 Accepting string or object diff --git a/docs/design-stretch-model.md b/docs/design-stretch-model.md index 19f3fa38..92540b07 100644 --- a/docs/design-stretch-model.md +++ b/docs/design-stretch-model.md @@ -23,7 +23,7 @@ and a ceiling it may never exceed. | Field | Role in the model | Default | |-------|-------------------|---------| | `baseSize` | **Target.** The rest length $L_0$ / base canvas $W_0 \times H_0$ that every "pressure = demand ÷ supply" ratio below is measured against. | $400 \times 320$ | -| `canvasSize` | **Hard ceiling.** The maximum stretched size, in any dimension (facet grids included). | none → $\text{baseSize} \times \text{maxStretch}$ (default $1.5\times$) | +| `canvasSize` | **Ceiling on the stretch.** The plot (facet grids included) never stretches past it in any dimension; the title, keys and axes share the box, and a drawing the canvas fit leaves a little larger is the host's to scale into it (see the canvas fit in the sizing tutorial). | none → $\text{baseSize} \times \text{maxStretch}$ (default $1.5\times$) | The stretch multiplier $\beta$ caps how far an axis may grow past the base, and is set per dimension: @@ -558,8 +558,8 @@ else: Vega-Lite categorical axes also propose a horizontal label layout with at most two lines. The proposal uses the same elastic solver as mark packing; it does -not immediately expand to the stretch ceiling. Other backends currently retain -their existing label policies. +not immediately expand to the stretch ceiling. ECharts, Chart.js and Plotly +plan their band labels with the same rule; see [Other backends](#other-backends). 1. **Propose demand.** Find each label's balanced two-line width. On X this contributes to band width; on Y the number of lines contributes to band @@ -599,8 +599,7 @@ Dense rows retain single-line ellipsis. Full label text remains available in tooltip and accessibility encodings; the site enables native axis-guide hover. The current implementation uses approximate character widths and heuristic, -dimensionless comparison costs for generic axes. Font-aware measurement there and other backend -adapters remain follow-up work. Axis pressure does not yet apply to +dimensionless comparison costs for generic axes. Axis pressure does not yet apply to temporal/numeric tick formatting. Binned numeric axes use the bin declaration for geometry, but do not treat raw @@ -679,6 +678,78 @@ differ. Numeric and custom guide footprints are estimates rather than native renderer measurements. The search uses heuristic costs and a bounded set of joint candidates; it does not guarantee an optimal packing or pixel-exact bounds. +### Other backends + +ECharts, Chart.js and Plotly do not run the Vega-Lite plan. Each keeps its own +renderer's look and takes from the layout only the decisions that do not depend +on how Vega draws, measured in its own default face (ECharts `sans-serif`, +Chart.js Helvetica Neue, Plotly Verdana) with the same width table: + +| Decision | Shared rule | ECharts | Chart.js | Plotly | +|---|---|---|---|---| +| Title and deck | `planTitleBlock`: a size down where that fits one line, else fullest lines with no widow; broken lines come out of a continuous plot | `title` centred, 18 px bold over a 12 px `subtext` | `title` and `subtitle` plugins, line arrays | `layout.title` with `
` | +| Band labels | `planBandLabels` with the plan's overflow rules (`xLabelOverflow`) | `axisLabel.formatter` lines, `rotate`, `interval` | tick `callback` arrays, pinned rotation | `ticktext` with `
` | +| Axis gutters and titles | measured labels; `fitAxisTitle` past the axis length | `grid` margins, `nameGap` clear of the labels | canvas sized to the plot plus Chart.js' boxes | margins; `automargin` settles the rest | +| Keys | `planKeyLayout`: beside the plot, long names on lines, else a row at the foot | vertical legend `formatter`, else ECharts' foot legend | right column with line arrays, else a foot row with cut names | right legend `
` names, else horizontal at the foot | +| Line density | `denseLineWidth` (15% ink, 0.75 px floor) | from 2 px | from 3 px | from 2 px | +| Canvas fit | `judgeBackendCanvas` and `refitCanvas` over the plan's treatments: key names held to 120 px, keys at the foot, keys in rows above or below stood beside the plot, a smaller plot | | | | + +The canvas fit assembles each treatment once and keeps the one that reads best, +only where it reads better than the chart as planned; the verdict rides on the +spec as `_canvasFit`. The dev site's *Backend layout* pages draw the Vega-Lite +layout labs' cases in each backend and list the cases to check by eye. + +**Backend profiles.** What a library does on its own with the furniture the +layout plans is stated once per backend, read off the library's defaults and +source, as a `BackendProfile` (`core/backend-profile.ts`; `plotly/profile.ts`, +`echarts/profile.ts`, `chartjs/profile.ts`). The estimators take a profile and +know no library, so the room the layout keeps is the room the library takes: + +| Profile field | Plotly 2.35 | ECharts 6 | Chart.js 4 | +|---|---|---|---| +| Key entry: lead to text, gap | 40 px (30 px symbol room, 5 px either side), 5 px | icon + 5 px (30 px), `itemGap` 10 | box + ½ em, `padding` 10 | +| Entry height | `max(1.3 em × lines, 16) + 3` | `max(itemHeight, 1.2 em × lines)` | a line, or 1.2 em × lines | +| Row wrap | each entry its own width: Plotly's own row is a grid at the widest entry (`legend/draw.js`), so the frame groups each entry alone (`traceorder: 'grouped'`, `tracegroupgap: 0`), which Plotly flows | each entry its own width | each entry its own width | +| Key title in a row | at the start, 10 px before the entries | above | above | +| Side key | one column, scrolling | one column, scrolling | more columns past its height | +| Axis labels | `ticklabelstandoff` 7, a drawn tick + 2.4 px, then 11 px automargin keeps past the labels; a label's box 1.2 em | `axisLabel.margin` 8 | tick 8 + padding 3 | +| Axis title | standoff 16 + 0.7 em; an empty-text title still takes a line, so a title taken away is deleted | `nameGap` | padding 8 | + +`keyBlock(profile.key, entries)` gives the box a library draws for a key and +the inset of its first line; `keyPlanStyle` gives the planner the same entry. +Plotly's margins are set to what its automargin would grow them to, measured +from the profile, rather than left as floors for automargin to settle: a margin +automargin grows shrinks the plot under everything hung from it in paper units +(a key above the plot, a header). A Plotly facet grid is planned with the +profile's furniture (`facetFixedPadding`, `facetGap`) and laid out around its +measured labels: one shared title per axis, x labels under each column's last +panel, rows apart by the labels they show, times thinned to flat round ticks. + +ECharts and Chart.js read their profiles through the same estimators with the +constants their frames used before, so their output is unchanged. + +**Backend canvas fit.** A backend keeps the planned plot and grows its canvas +around the library's own furniture, so it is held to a closer fit than the +plan: each treatment is scored by its flags plus how far its host would shrink +it below 90% (`HOST_SCALE_TARGET`). The key gives way first — names held to +120 px (the names' own width: each library adds its symbol room from its profile, +`treatedKeySide`, so Plotly's 40 px lead does not leave the names 70 px), then 90 px +with smaller text where the host would still shrink the drawing, the key moved (rows above or below stood beside the plot, a side key +to the foot), its text a size smaller (`keyScale`, never below 10 px). The plot +is laid out smaller only past legibility: a smaller plot beside an unchanged +key leaves the key taller than the plot (Plotly scrolls it) and the marks small, +which reads worse than a drawing shrunk a little by its host. A title is broken to the +width its box allows (`fitBox`), not the chart's own width, and the drawing +widens to hold it — the plot takes the width (a banded axis fills it) — so a +narrow chart under a long headline grows wider rather than stacking the +headline into a tall, thin drawing. A temporal field +on a bar axis, which the layout keeps continuous but banded, stands on the +library's time axis (Plotly `type: 'date'`), whose own calendar ticks are thinned +and flat. Vega-Lite runs +the full plan (`planLayout`) with its own `BackendLayoutProfile`; the other +backends still assemble through `computeLayout` and take the plan's decisions +piecemeal. + --- # §3 Continuous Axis (Gas Pressure Model) diff --git a/docs/interaction-api.md b/docs/interaction-api.md index 6a2374fb..7869c260 100644 --- a/docs/interaction-api.md +++ b/docs/interaction-api.md @@ -42,6 +42,8 @@ import { clickHighlight } from 'flint-chart/interactive'; />; ``` +`flint-chart` comes with every backend's library, so any `backend` draws as installed. An app that bundles into one file (no code splitting) can import a backend's own entry, `flint-chart/react/vegalite`, `/echarts`, `/chartjs` or `/plotly` (and `flint-chart/interactive/` for `mountChart`), which reaches no other backend's library; the exports are the same. To draw a second backend from such an entry, pass its factory from `flint-chart//interactive` in `renderers`, e.g. `renderers={{ echarts: createEChartsInteractiveRenderer }}`. + A spec with no interactions renders a static chart; a chart is interactive only if its spec or the `interactions` prop declares an interaction. A static chart mounts no interaction runtime, so it costs about the same as a plain Vega-Lite embed. To drive a chart without interactions from the host, pass `updates`; even `updates={[]}` mounts the runtime so the ref's `applyUpdate` works. On a static chart `applyUpdate` warns and returns `null`. `interactions` takes preset factories, never JSON entries: an array adds to the spec's `interaction_spec`, and a function `(fromSpec) => definitions` receives the spec's definitions and returns the full list. A preset rebuilt with the same id and options keeps the mounted chart, so inline factory calls are fine; changing an option remounts it. Function-valued options, such as `clickAnnotate`'s `format`, are read at mount. | Prop | Purpose | @@ -55,6 +57,7 @@ A spec with no interactions renders a static chart; a chart is interactive only | `onError` | The chart failed: a compile error, a malformed `interaction_spec`, or a code interaction the chart cannot honour. The box shows a muted error in place of the chart | | `fallback` | Shown until the chart mounts, including in server rendering | | `ariaLabel`, `chartId` | `ariaLabel` applies in place; a new `chartId` remounts the chart. `expressionInterpreter` is read at mount | +| `backend`, `renderers` | The backend to draw with (default `vegalite`), and renderer factories by backend for backends the entry does not load. Read at mount | A ref gives a `FlintChartHandle` with `surface` (the mounted `InteractiveChartSurface`, or `null`), `applyUpdate`, `clearUpdate`, `dispatch`, `getState`, and `refresh`. The `selectionUpdate(id, selection)` and `viewportUpdate(id, viewport)` helpers build the updates a selection or navigation preset writes: `selection` takes elements or a field key, and `viewport` takes `[start, end]` per axis or a `ChartState.viewport`. `null` clears the selection or returns the viewport home. @@ -114,7 +117,7 @@ const countryDetails: CanvasInteractionDef = { targets: [target], value: { state: 'emphasized', mutedOpacity: 0.25 }, }, - { op: 'set-annotation', target, value: { text: country } }, + { op: 'annotate-text', target, value: { text: country } }, ], }; }, @@ -156,7 +159,7 @@ const countrySelection = externalInteraction<{ Country: string }>({ targets: [target], value: { state: 'emphasized', mutedOpacity: 0.25 }, }, - { op: 'set-annotation', target, value: { text: Country } }, + { op: 'annotate-text', target, value: { text: Country } }, ], }; }, @@ -220,7 +223,7 @@ container.addEventListener('flint-interaction', (event) => { ## Update operators and host responses -`set-style` controls emphasis or visibility, `set-annotation` adds or clears a label, and `set-viewport` changes the visible domains. Other operators reorder categories, add overlays, or replace data. A single handler can return multiple operators in one update. +`set-style` controls emphasis or visibility, `annotate-text` adds or clears a label, and `set-viewport` changes the visible domains. Other operators reorder categories, add overlays, or replace data. A single handler can return multiple operators in one update. The container emits `flint-interaction` events with the interaction id and semantic target. Your application can listen to those events to filter a table or update other widgets; Flint renders only the canvas updates. Applications can also submit operators directly through `surface.applyUpdate()` or `surface.setUpdates()`. See [Components](interaction-components.md) for the event envelope, action families, listener examples, and chart update API. diff --git a/docs/interaction-capability-roadmap.md b/docs/interaction-capability-roadmap.md index 0f9cce51..7b966c7a 100644 --- a/docs/interaction-capability-roadmap.md +++ b/docs/interaction-capability-roadmap.md @@ -65,7 +65,7 @@ cancel before asking the renderer to display the resulting collection. | Operator | State described | Vega-Lite status | | --- | --- | --- | | `set-style` | Visibility, appearance, and semantic style state for targets | Visibility, opacity, fill, stroke, stroke width, and emphasized/focused state supported | -| `set-annotation` | Annotation specification for one target, or `null` | Supported; effective annotations compose by update and target identity | +| `annotate-text` | Annotation specification for one target, or `null` | Supported; effective annotations compose by update and target identity | | `set-viewport` | Exact X and/or Y domains | Supported on declared continuous navigation axes | | `set-order` | Absolute category, series, or facet order | Category order supported; series and facet order missing | @@ -101,7 +101,7 @@ lower-level interaction and update remain independently available. | --- | --- | | `clickHighlight()` | Activate a configured mark, legend, or discrete-axis target -> `set-style` | | `clickGroupFocus()` | Activate target -> expand its cohort -> `set-style` | -| `clickAnnotate()` | Activate target -> `set-annotation` and `set-style` | +| `clickAnnotate()` | Activate target -> `annotate-text` and `set-style` | | `select()` | Rectangle selection -> temporary or retained `set-style` | | `brushX()` / `brushY()` | Axis interval -> temporary or retained `set-style` | | `brushAngle()` | Polar angular interval -> temporary or retained `set-style` | diff --git a/docs/interaction-components.md b/docs/interaction-components.md index b9d2e18a..1555a441 100644 --- a/docs/interaction-components.md +++ b/docs/interaction-components.md @@ -128,7 +128,7 @@ The selector field must exist in the chart's semantic data. Host-owned updates a | Operator | Effect | |---|---| | `set-style` | Emphasize, mute, or hide marks the chart draws, a run of line segments included. | -| `set-annotation` | Add or clear a note on one mark. | +| `annotate-text` | Add or clear a note on one mark. | | `set-viewport` | Change visible continuous domains or a geographic viewport. | | `set-order` | Reorder categories. | | `set-overlay` | Draw new rows through the chart's scales: `line`, `point`, `text` rows carry `x` and `y`; `rule` and `rect` rows carry `x`, `y`, `x2`, `y2`. Overlay text is haloed in the chart's background so it reads over the data; `style.stroke: 'none'` turns the halo off. | diff --git a/docs/reference-plotly.md b/docs/reference-plotly.md index 97abe2a3..aaef7c8a 100644 --- a/docs/reference-plotly.md +++ b/docs/reference-plotly.md @@ -231,6 +231,7 @@ _No template-specific parameters._ |---|---|---|---|---|---| | `sortSlices` | choice | `none` (Data order), `descending` (Largest first), `ascending` (Smallest first) | `none` | always | Sort slices | | `labelType` | choice | `categoryPercent` (Name + %), `category` (Name), `value` (Value), `percent` (Percent), `none` (None) | `categoryPercent` | always | Labels | +| `sliceNames` | choice | `auto` (Auto), `onSlices` (On slices), `key` (In a key) | `auto` | always | Slice names | ### ![](chart-icon-doughnut.svg) Donut Chart @@ -241,6 +242,7 @@ _No template-specific parameters._ | `innerRadius` | number | 20 – 80 (step 5) | `55` | always | Inner radius as a percentage of the outer radius. | | `sortSlices` | choice | `none` (Data order), `descending` (Largest first), `ascending` (Smallest first) | `none` | always | Sort slices | | `labelType` | choice | `categoryPercent` (Name + %), `category` (Name), `value` (Value), `percent` (Percent), `none` (None) | `categoryPercent` | always | Labels | +| `sliceNames` | choice | `auto` (Auto), `onSlices` (On slices), `key` (In a key) | `auto` | always | Slice names | ### ![](chart-icon-radar.svg) Radar Chart @@ -313,17 +315,19 @@ _No template-specific parameters._ ### ![](chart-icon-world-map.svg) Map -**Encoding channels:** `longitude`, `latitude`, `color`, `size`, `opacity` +**Encoding channels:** `longitude`, `latitude`, `color`, `size`, `shape`, `opacity`, `order`, `detail`, `strokeWidth`, `text` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| | `region` | choice | `auto` (Auto-detect), `us` (United States), `world` (World) | `auto` | always | Region | | `projection` | choice | `default` (Default), `mercator` (Mercator), `equalEarth` (Equal Earth), `orthographic` (Orthographic (Globe)), `stereographic` (Stereographic), `conicEqualArea` (Conic Equal Area), `conicEquidistant` (Conic Equidistant), `azimuthalEquidistant` (Azimuthal Equidistant), `mollweide` (Mollweide) | `default` | conditional | Projection | | `projectionCenter` | choice | Default _(default)_, `0,0` (World (Atlantic) [0, 0]), `150,0` (World (Pacific) [150, 0]), `105,35` (China [105, 35]), `-98,39` (USA [-98, 39]), `10,50` (Europe [10, 50]), `138,36` (Japan [138, 36]), `78,22` (India [78, 22]), `-52,-14` (Brazil [-52, -14]), `134,-25` (Australia [134, -25]), `100,60` (Russia [100, 60]), `20,0` (Africa [20, 0]), `45,28` (Middle East [45, 28]), `115,5` (Southeast Asia [115, 5]), `-60,-15` (South America [-60, -15]), `-100,45` (North America [-100, 45]), `-2,54` (UK [-2, 54]), `10,51` (Germany [10, 51]), `2,47` (France [2, 47]), `128,36` (Korea [128, 36]) | — | conditional | Center | +| `arrows` | toggle | on / off | `true` | conditional | Arrows | +| `curve` | choice | `auto` (Auto: arcs between stops, great circles on a globe or along a track), `arc` (Arcs, bowed left of travel), `great-circle` (Great circles), `straight` (Straight (constant bearing)) | `auto` | conditional | Route curve | ### ![](chart-icon-us-map.svg) Choropleth -**Encoding channels:** `id`, `color`, `detail` +**Encoding channels:** `id`, `color`, `detail`, `text` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| diff --git a/docs/reference-vegalite.md b/docs/reference-vegalite.md index fd8be513..ecccb583 100644 --- a/docs/reference-vegalite.md +++ b/docs/reference-vegalite.md @@ -116,7 +116,7 @@ The **Availability** column shows whether a parameter is `always` available or ` ### ![](chart-icon-column.svg) Bar Chart -**Encoding channels:** `x`, `y`, `color`, `opacity`, `column`, `row` +**Encoding channels:** `x`, `y`, `color`, `detail`, `opacity`, `column`, `row` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| @@ -128,7 +128,7 @@ The **Availability** column shows whether a parameter is `always` available or ` ### ![](chart-icon-column-grouped.svg) Grouped Bar Chart -**Encoding channels:** `x`, `y`, `group`, `color`, `column`, `row` +**Encoding channels:** `x`, `y`, `group`, `color`, `detail`, `column`, `row` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| @@ -138,7 +138,7 @@ The **Availability** column shows whether a parameter is `always` available or ` ### ![](chart-icon-column-stacked.svg) Stacked Bar Chart -**Encoding channels:** `x`, `y`, `color`, `column`, `row` +**Encoding channels:** `x`, `y`, `color`, `detail`, `column`, `row` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| @@ -487,21 +487,36 @@ _No template-specific parameters._ ### ![](chart-icon-world-map.svg) Map -**Encoding channels:** `longitude`, `latitude`, `color`, `size`, `opacity` +**Encoding channels:** `longitude`, `latitude`, `color`, `size`, `shape`, `opacity`, `order`, `detail`, `strokeWidth`, `text` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| | `region` | choice | `auto` (Auto-detect), `us` (United States), `world` (World) | `auto` | always | Region | +| `boundaries` | choice | `world-bank` (World Bank (official)), `natural-earth` (Natural Earth (de facto)), or a file { url | values, feature?, ids? (iso-numeric, iso3, iso2, fips, as-is), key?, disputed?, attribution? } | `world-bank` | conditional | Boundaries | | `projection` | choice | `default` (Default), `mercator` (Mercator), `equalEarth` (Equal Earth), `orthographic` (Orthographic (Globe)), `stereographic` (Stereographic), `conicEqualArea` (Conic Equal Area), `conicEquidistant` (Conic Equidistant), `azimuthalEquidistant` (Azimuthal Equidistant), `mollweide` (Mollweide) | `default` | conditional | Projection | | `projectionCenter` | choice | Default _(default)_, `0,0` (World (Atlantic) [0, 0]), `150,0` (World (Pacific) [150, 0]), `105,35` (China [105, 35]), `-98,39` (USA [-98, 39]), `10,50` (Europe [10, 50]), `138,36` (Japan [138, 36]), `78,22` (India [78, 22]), `-52,-14` (Brazil [-52, -14]), `134,-25` (Australia [134, -25]), `100,60` (Russia [100, 60]), `20,0` (Africa [20, 0]), `45,28` (Middle East [45, 28]), `115,5` (Southeast Asia [115, 5]), `-60,-15` (South America [-60, -15]), `-100,45` (North America [-100, 45]), `-2,54` (UK [-2, 54]), `10,51` (Germany [10, 51]), `2,47` (France [2, 47]), `128,36` (Korea [128, 36]) | — | conditional | Center | +| `fit` | choice | `auto` (Auto: the country, the region, or the continent the data covers), `data` (The data, padded), `continent` (The data’s continents), `whole` (Whole map) | `auto` | conditional | Frame | +| `mapStyle` | choice | `auto` (From the theme), `light` (Light), `muted` (Muted), `atlas` (Atlas (blue water, paper land)), `dark` (Dark), `minimal` (Minimal (outlines)), or a style of your own { base? (auto, light, muted, atlas, dark, minimal), sea?, land?, coast?, border?, noData?, graticule?, disputed? } in CSS colours | `auto` | always | Map style | +| `graticule` | toggle | on / off | `false` | always | Graticule | +| `borderWidth` | number | 0 – 2 (step 0.1) | — | always | Border width | +| `arrows` | toggle | on / off | `true` | conditional | Arrows | +| `curve` | choice | `auto` (Auto: arcs between stops, great circles on a globe or along a track), `arc` (Arcs, bowed left of travel), `great-circle` (Great circles), `straight` (Straight (constant bearing)) | `auto` | conditional | Route curve | ### ![](chart-icon-us-map.svg) Choropleth -**Encoding channels:** `id`, `color`, `detail` +**Encoding channels:** `id`, `color`, `detail`, `text` | Parameter | Control | Domain | Default | Availability | Description | |---|---|---|---|---|---| | `region` | choice | `auto` (Auto-detect), `us` (United States), `world` (World) | `auto` | always | Region | +| `keyType` | choice | `auto` (Auto-detect), `iso3` (ISO 3166-1 alpha-3 (USA)), `iso2` (ISO 3166-1 alpha-2 (US)), `iso-numeric` (ISO 3166-1 numeric (840)), `country-name` (Country name), `us-state` (US state name or USPS code), `fips` (US FIPS code (state or county)) | `auto` | always | Region key | | `level` | choice | `state` (States), `county` (Counties (FIPS ids)), `auto` (Zoom: states, then counties) | `state` | conditional | Level | +| `boundaries` | choice | `world-bank` (World Bank (official)), `natural-earth` (Natural Earth (de facto)), or a file { url | values, feature?, ids? (iso-numeric, iso3, iso2, fips, as-is), key?, disputed?, attribution? } | `world-bank` | conditional | Boundaries | | `projection` | choice | `default` (Default), `mercator` (Mercator), `equalEarth` (Equal Earth), `orthographic` (Orthographic (Globe)), `stereographic` (Stereographic), `conicEqualArea` (Conic Equal Area), `conicEquidistant` (Conic Equidistant), `azimuthalEquidistant` (Azimuthal Equidistant), `mollweide` (Mollweide) | `default` | conditional | Projection | | `projectionCenter` | choice | Default _(default)_, `0,0` (World (Atlantic) [0, 0]), `150,0` (World (Pacific) [150, 0]), `105,35` (China [105, 35]), `-98,39` (USA [-98, 39]), `10,50` (Europe [10, 50]), `138,36` (Japan [138, 36]), `78,22` (India [78, 22]), `-52,-14` (Brazil [-52, -14]), `134,-25` (Australia [134, -25]), `100,60` (Russia [100, 60]), `20,0` (Africa [20, 0]), `45,28` (Middle East [45, 28]), `115,5` (Southeast Asia [115, 5]), `-60,-15` (South America [-60, -15]), `-100,45` (North America [-100, 45]), `-2,54` (UK [-2, 54]), `10,51` (Germany [10, 51]), `2,47` (France [2, 47]), `128,36` (Korea [128, 36]) | — | conditional | Center | +| `fit` | choice | `auto` (Auto: the country, the region, or the continent the data covers), `data` (The data, padded), `continent` (The data’s continents), `whole` (Whole map) | `auto` | conditional | Frame | +| `classes` | choice | `auto` (Auto (quantiles; round steps when diverging)), `quantile` (Quantiles (equal counts)), `equal` (Equal round steps), `jenks` (Natural breaks (Jenks)), `continuous` (Continuous) | `auto` | conditional | Classes | +| `classCount` | number | 3 – 9 (step 1) | `5` | conditional | Class count | +| `mapStyle` | choice | `auto` (From the theme), `light` (Light), `muted` (Muted), `atlas` (Atlas (blue water, paper land)), `dark` (Dark), `minimal` (Minimal (outlines)), or a style of your own { base? (auto, light, muted, atlas, dark, minimal), sea?, land?, coast?, border?, noData?, graticule?, disputed? } in CSS colours | `auto` | always | Map style | +| `graticule` | toggle | on / off | `false` | always | Graticule | +| `borderWidth` | number | 0 – 2 (step 0.1) | — | always | Border width | diff --git a/docs/render-performance.md b/docs/render-performance.md new file mode 100644 index 00000000..b275838d --- /dev/null +++ b/docs/render-performance.md @@ -0,0 +1,63 @@ +# Reproducible render performance baseline + +This opt-in runner records repeatable timings for the Flint compiler assembly +and the supported in-process MCP renderers. It does not participate in normal +builds, tests, or CI, and it makes no performance threshold or speedup claim. + +## Run + +Use the repository's supported Node version (CI currently uses Node 20/22) and +an otherwise idle machine. Install dependencies and build both packages once: + +```sh +npm ci +npm run build +npm run benchmark:render -- --samples 5 --out artifacts/perf/render-baseline.json +``` + +The output path must not already exist. Use another path for each run. The +runner needs the built `flint-chart` and `flint-chart-mcp` package outputs; it +does not launch a server, browser, or external renderer. `--samples` applies to +the warm phase and must be at least three. Each case records one cold first-use +sample and the requested number of warm samples. `--help` lists the runner +options. + +The fixed fixture is the existing `STATIC_SERIES_LINE_BASIC` test-data fixture. +It benchmarks `assembleForBackend` for Vega-Lite, ECharts, and Chart.js, then +the MCP renderer for Vega-Lite and ECharts (SVG and PNG) and Chart.js (PNG). +Chart.js SVG is reported as an explicit skip because that renderer has no SVG +engine. + +## Reading the result + +The JSON records the source commit and dirty state, Node/V8 and OS/CPU +identities, fixture shape and serialized size, case/backend/format, output +dimensions and bytes when rendered, every individual sample, and min/median/ +mean/p95/max summaries. Each case runs in its own Node worker, which performs +one cold first operation, one excluded warm-up, then the requested warm +samples in sequence. Module loading is outside each operation's timer. The +worker is forcibly terminated after 15 seconds; completed records are retained, +the in-flight operation is an error sample, and unfinished work is reported as +not run. Isolating one case per worker bounds stuck native renderers and lets +the OS reclaim their process resources before the next case. The compiler +cases use the same cold/warm protocol for consistency. + +For each sample, `memory.before` and `memory.after` are snapshots of +`process.memoryUsage()` (`rss`, `heapTotal`, `heapUsed`, `external`, and +`arrayBuffers`); `memory.delta` is their difference. These are point-in-time +process snapshots, not allocation totals, retained-size measurements, or peak +memory. Garbage collection is not forced. Timings use `performance.now()`. +Failed attempts remain in the result with their error; a failed case makes the +runner exit nonzero. A renderer result is counted only after its artifact type, +signature/markup, and dimensions have been checked. The renderers finalize or +dispose Vega, ECharts, and Chart.js instances in `finally` blocks, including +when a render attempt throws. + +Raw records are intended for paired local or CI-runner comparisons made with +the same Node version, hardware, fixture, and command. Do not compare unlike +machines as if they were controlled measurements, infer allocation volume +from snapshot deltas, or treat this informational baseline as a CI gate. + +Records are written under `artifacts/`, which is git-ignored: no baseline is +committed, since one machine's record is no reference for another. The sample +measured when the runner was added (Node 26, two CPUs) is described in [#171](https://github.com/microsoft/flint-chart/pull/171). diff --git a/docs/tutorials/agent-workflows.md b/docs/tutorials/agent-workflows.md index fa0ba059..3496faa9 100644 --- a/docs/tutorials/agent-workflows.md +++ b/docs/tutorials/agent-workflows.md @@ -95,13 +95,12 @@ const echartsOption = assembleECharts(input); const chartjsConfig = assembleChartjs(input); ``` -Install only the renderer dependencies your product needs: +`flint-chart` comes with every backend's library (Vega-Lite, ECharts, Chart.js, +Plotly), so one install renders with any of them: ```bash npm install flint-chart -npm install vega vega-lite vega-embed # browser Vega-Lite rendering -npm install echarts # ECharts rendering -npm install chart.js # Chart.js rendering +npm install vega-embed # only to embed a compiled Vega-Lite spec yourself ``` Python support will use the same input shape, but it is planned for a later diff --git a/docs/tutorials/chart-sizing.md b/docs/tutorials/chart-sizing.md index 9b4a56b3..0a042581 100644 --- a/docs/tutorials/chart-sizing.md +++ b/docs/tutorials/chart-sizing.md @@ -65,8 +65,8 @@ Choose the mode by setting `baseSize`, `canvasSize`, or both: |------|-----|--------------| | **Default auto layout** | neither | Flint targets `400 × 320` and may grow when the data is dense. | | **Target size** | `baseSize` | Flint aims for your preferred size, but can still grow if readability needs it. | -| **Fixed slot** | `canvasSize` | Flint fits the chart inside that box and never overflows it. Use this for dashboards and cards with hard dimensions. | -| **Bounded growth** | both | Flint starts from `baseSize`, grows only when needed, and never exceeds `canvasSize`. | +| **Fixed slot** | `canvasSize` | Flint lays the chart out to read well inside that box. Use this for dashboards and cards with hard dimensions, and scale the drawing into the slot (see [When the box is tight](#when-the-box-is-tight)). | +| **Bounded growth** | both | Flint starts from `baseSize`, grows only when needed, and never stretches the plot past `canvasSize`. | For the full equations and implementation details, see [Auto Layout Algorithm](/documentation/layout-model). @@ -99,7 +99,7 @@ Drop `canvasSize` to let the chart grow to `baseSize × maxStretch`, or lower `options.maxStretch` to tighten the default ceiling for fixed dashboard cells. For a **fixed slot**, the simplest form is `canvasSize` on its own — Flint then -treats it as a box the chart fills and shrinks to fit, never overflowing: +treats it as a box the chart fills and shrinks to fit: ```json { @@ -146,12 +146,27 @@ never lays a chart out larger for the host to shrink: a chart nothing mends is d and whether to scroll or scale it is the reader's or the host's choice. A chart that reads well but is drawn a little larger than its box gets only the gentlest edits — keys -in a row on their edge, or names wrapped — and only where they bring it nearer its box with nothing +in a row on their edge, names wrapped, or names wrapped down the y axis set a size or two smaller (never +below three-quarters of the theme's size, so two-line rows stand shorter) — and only where they bring it nearer its box with nothing going wrong. A chart that reads well as planned is otherwise never changed, nothing is dropped, and the chart's own shape is never changed. A title spans the whole drawing, keys beside the plot included, and so does a row of keys above or below it. Each stands where the theme sets it — a centred title over the plot, keys from its start — and, where it would run past the drawing's edge there, moves the least that keeps it within. A partial edit that trades one problem for another — a drawing too wide made too tall — is not kept, nor one that makes text already too small smaller still. A headline that must break is broken at its own size, each line filled to the width (a lone last word evened out), unless a size down saves a line. Set `options.canvasFit` to `'off'` to lay a chart out exactly as planned. +**The drawing stands within its canvas.** Where a `canvasSize` is given and the drawing still runs +past it — keys beside a plot that fills the width, a title over a plot that fills the height — the +chart is laid out once more for a smaller room, the edits above kept, so the plot gives up the room +and the keys, labels and title stand inside the canvas. The plot never gives up more than half of a +side, and the room is never bought by cutting values or turning labels the chart kept flat. This +applies to single Vega-Lite views; it is reported as `canvas-contain` and skipped with +`canvasFit: 'off'`. A chart without a `canvasSize` is laid out as before. + +**Scale what is left into the slot.** A drawing that still runs a little past its box — a dense +banded axis, a facet grid, a chart from another backend — reads well once the host scales it into +the box (down to 70%). A host that draws charts at their own size should scale the SVG or canvas to +`min(1, box ÷ drawn)` on each side (contain), and, rendering on a server, measure text as its +renderer does (`setTextMeasurer`), so the plan's estimate matches the drawing. + ## Font size Text (axis tick labels, axis titles, legend, chart title) adapts to the canvas diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index e7fdeb2b..955b7d77 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -18,11 +18,13 @@ Install Flint: npm install flint-chart ``` -If you want to render Vega-Lite charts in the browser, also install the renderer -stack: +`flint-chart` comes with every backend it draws with (Vega-Lite, ECharts, +Chart.js, Plotly), so `` from `flint-chart/react` (with React) and +`mountChart` from `flint-chart/interactive` work on any backend as installed. To +embed a compiled Vega-Lite spec with your own code instead, add `vega-embed`: ```bash -npm install vega vega-lite vega-embed +npm install vega-embed ``` ### Python planned diff --git a/docs/tutorials/setup-flint-mcp.md b/docs/tutorials/setup-flint-mcp.md index 9923a99d..0db73a33 100644 --- a/docs/tutorials/setup-flint-mcp.md +++ b/docs/tutorials/setup-flint-mcp.md @@ -219,8 +219,9 @@ npx -y flint-chart-mcp --backends vegalite,echarts FLINT_MCP_BACKENDS=vegalite,echarts npx -y flint-chart-mcp ``` -Use `validate_chart` then `show` when the user wants to see and iterate on a -chart in a host with MCP App support. Use `render_chart` for a static artifact. Use +Use `show` when the user wants to see and iterate on a chart in a host with MCP +App support; for several views read together, check a board with +`validate_board`, then `show` it. Use `render_chart` for a static artifact. Use `compile_chart` when the user needs backend-native JSON for another renderer or editor. diff --git a/docs/zh-CN/api-reference.md b/docs/zh-CN/api-reference.md index e8280cb0..b3641744 100644 --- a/docs/zh-CN/api-reference.md +++ b/docs/zh-CN/api-reference.md @@ -42,6 +42,7 @@ interface SemanticAnnotation { unit?: string; // e.g. USD, °C sortOrder?: string[]; // custom ordinal order colors?: Record; // 绑定到取值的颜色,如 { DFL: "#0793AB" } + percentScale?: 'fraction' | 'percent'; // 百分比的存储方式:45% 存为 0.45 还是 45 } ``` @@ -218,6 +219,8 @@ interface AssembleOptions { 不满足的图表会以**读者最不易察觉的最小改动**来修正。每个问题都会归因到造成它的部分——过宽:图旁的图例;过高:上方或下方叠放的图例,只有当标题占了大部分时才归因于标题——并且只尝试这些部分的改动,先单独尝试再组合:图例在原来的一侧排成一行;图例名称折行(图例不动),或当图表区本身对框过宽时 y 轴类别名折行;标题缩小一级(不小于 13 / 11 px);多个图例共用一侧时把其中一个移到另一侧(其余不动);把所有图例移到另一侧;标题缩小两级。在能解决问题的改动中,保留对读者代价最小的一项——各项改动按上述顺序在同一尺度上计价,结果的可读性只用于区分代价相近的改动,绝不会让较大的改动胜过较温和的改动。若框无法清晰地容纳图表,则按原比例缩小绘图区。标题和图例确定后,绘图区会在框按显示比例留下的空间内**再布局一次**:连续轴的一侧向该空间延伸——不超过其拉伸上限,图表区保持在其自身形状的宽松范围内,band 轴保持其 step——只有当文字不更小、没有新问题且整张图更好读时才采用(`canvasRefit: false` 关闭此步)。该步骤不会把图表放大布局再交由宿主缩小:无法修正的图表按其自身尺寸绘制,由读者滚动或宿主缩放。 +给定 `canvasSize` 时,该步骤留下的仍超出画布的绘制结果会被**收进画布**:图表按更小的空间再布局(保留已选改动,图例留在原来的一侧),由绘图区让出空间,使图例、标签和标题留在画布内。空间经几轮搜索确定;只有绘图区每边至少保留一半、没有删去数值、且没有旋转原本水平的标签时才采用,无法收进的部分只会更接近画布,交由宿主缩放。该步骤适用于单视图的 Vega-Lite 图表(`_canvasFit` 中的 `treatment.contain`,报告代码 `canvas-contain`);未给定 `canvasSize` 的图表不变。 + 不会删去任何内容,不会把文字缩到难以阅读(也不会让本已过小的文字更小),也不会改变图表自身的形状。`'off'` 按原计划布局。该步骤的判断和处理会作为 `_canvasFit` 附在 Vega-Lite 规格上,并写入 `_theme.report`(`canvas-fit`)。 字体会围绕这些各后端基准值随画布尺寸自适应:默认画布下每个后端渲染其原生字号, @@ -364,7 +367,9 @@ const result = validateChart(input, 'vegalite', { updates }); | `flint-chart/chartjs` | Chart.js 模板与 `assembleChartjs` | | `flint-chart/validate` | `validateChart` 与输入校验辅助函数 | | `flint-chart/interactive` | `mountChart`、交互预设与更新辅助函数 | +| `flint-chart/interactive/` | 同上,只引用该后端(`vegalite`、`echarts`、`chartjs`、`plotly`):用于单文件打包 | | `flint-chart/react` | `` 组件(React 为可选 peer 依赖) | +| `flint-chart/react/` | 同上,只引用该后端:用于单文件打包 | | `flint-chart/render` | `renderSvg`,无需 DOM 即可输出静态 SVG | | `flint-chart/test-data` | 图库生成器(`TEST_GENERATORS`) | diff --git a/docs/zh-CN/design-interactions.md b/docs/zh-CN/design-interactions.md index 965d6003..fb65007f 100644 --- a/docs/zh-CN/design-interactions.md +++ b/docs/zh-CN/design-interactions.md @@ -73,7 +73,7 @@ | 操作 | 效果 | |---|---| | `set-style` | 强调或淡化目标,隐藏系列 | -| `set-annotation` | 在目标上固定或清除注释 | +| `annotate-text` | 在目标上固定或清除注释 | | `set-viewport` | 移动连续域或投影 | | `set-order` | 重排离散域 | | `set-overlay`、`set-freeform-overlay` | 绘制引导线或自由路径 | diff --git a/docs/zh-CN/design-layout-plan.md b/docs/zh-CN/design-layout-plan.md index b598db1b..b825e0fd 100644 --- a/docs/zh-CN/design-layout-plan.md +++ b/docs/zh-CN/design-layout-plan.md @@ -102,7 +102,7 @@ emit(plan, analysis) → 后端 spec ## §4.3 标题 -`planTitle`(`core/title-plan.ts`)把单视图图表的主标题和副标题适配到其区块:缩小一档字号,或均匀折成多行,多出的行高从绘图区扣除。副标题包括作者的副标题以及主题移入的坐标轴标题。标题在任何环境中都用宽度表按其自身字体与字重测量,因为即使在没有 canvas 的环境中编译,标题仍以真实字形绘制;只要超出区块就会适配。自行计算类别轴的模板会说明类别名称(`AxisDescription.categories`),使区块计入这些标签。 +`planTitle`(`core/title-plan.ts`)把单视图图表的主标题和副标题适配到其区块:缩小一档字号,或折成填满区块的多行(末行不留孤行),多出的行高从绘图区扣除。副标题包括作者的副标题以及主题移入的坐标轴标题。标题在任何环境中都用宽度表按其自身字体与字重测量,因为即使在没有 canvas 的环境中编译,标题仍以真实字形绘制;只要超出区块就会适配。自行计算类别轴的模板会说明类别名称(`AxisDescription.categories`),使区块计入这些标签。 ## §4.4 图例与序列名称 diff --git a/docs/zh-CN/design-semantics.md b/docs/zh-CN/design-semantics.md index 5d50222f..9249ecdb 100644 --- a/docs/zh-CN/design-semantics.md +++ b/docs/zh-CN/design-semantics.md @@ -360,6 +360,11 @@ interface SemanticAnnotation { * Well-known types (Month, DayOfWeek) need not provide this. */ sortOrder?: string[]; + /** + * How a percentage is stored: 'fraction' (0.45 is 45%) or 'percent' (45 is 45%). + * Skips representation detection (§3.4). + */ + percentScale?: 'fraction' | 'percent'; } ``` @@ -388,7 +393,7 @@ interface SemanticAnnotation { | Type | Representations | Detection | |---|---|---| -| **Percentage** | 0–1 分数 vs 0–100 整数 | `max(data) ≤ 1` → fractional;否则 whole;或 `intrinsicDomain` | +| **Percentage** | 0–1 分数 vs 0–100 整数 | `percentScale`;否则能定论的 `intrinsicDomain`;否则 ≥80% 的 `abs(data) ≤ 1` → fractional | | **Timestamp** | Unix s、Unix ms、ISO string | Magnitude >1e12 → ms;>1e9 → s;string → parse | | **Month / Day** | Numeric vs abbreviated vs full name | Data type + pattern matching | | **Boolean** | true/false、0/1、Yes/No | Data type + distinct values | @@ -401,7 +406,7 @@ interface SemanticAnnotation { | Domain | [0, 1] | [0, 100] | | Ticks | 0, 0.25, 0.5, 0.75, 1.0 | 0, 25, 50, 75, 100 | -优先级:(1)显式 `intrinsicDomain`,(2)数据检查,(3)保守默认。若至少 80% 的绝对值 ≤1,则将字段视为 fractional。 +优先级:(1)显式 `percentScale`(`'fraction'` 或 `'percent'`),(2)能定论的 `intrinsicDomain`(在 ±1 以内为 fractional;达到 100 为 whole),(3)数据检查,(4)保守默认。若至少 80% 的绝对值 ≤1,则将字段视为 fractional。以分数存储、多数值大于 1 的增长率(2.4 表示 240%)需要 `percentScale: 'fraction'`:仅凭数值会被读作 whole。 ## §3.5 接受字符串或对象 diff --git a/docs/zh-CN/design-stretch-model.md b/docs/zh-CN/design-stretch-model.md index d6605e7b..a3b64c60 100644 --- a/docs/zh-CN/design-stretch-model.md +++ b/docs/zh-CN/design-stretch-model.md @@ -22,7 +22,7 @@ | Field | Role in the model | Default | |-------|-------------------|---------| | `baseSize` | **目标。** 静息长度 $L_0$ / 基准画布 $W_0 \times H_0$,下方所有「pressure = demand ÷ supply」比率均相对此值衡量。 | $400 \times 320$ | -| `canvasSize` | **硬上限。** 任意维度(含 facet 网格)的最大 stretch 尺寸。 | none → $\text{baseSize} \times \text{maxStretch}$(默认 $1.5\times$) | +| `canvasSize` | **拉伸上限。** 绘图区(含 facet 网格)在任意维度上都不会拉伸超过它;标题、图例和坐标轴共用这个框,画布适配留下的略大的绘制结果由宿主缩放进框(见尺寸教程中的画布适配)。 | none → $\text{baseSize} \times \text{maxStretch}$(默认 $1.5\times$) | stretch 乘数 $\beta$ 限制轴相对基准可增长的距离,按维度设置: diff --git a/docs/zh-CN/reference-plotly.md b/docs/zh-CN/reference-plotly.md index c47696f0..4b8037ca 100644 --- a/docs/zh-CN/reference-plotly.md +++ b/docs/zh-CN/reference-plotly.md @@ -227,6 +227,7 @@ _无模板专用参数。_ |---|---|---|---|---|---| | `sortSlices` | choice | `none` (Data order), `descending` (Largest first), `ascending` (Smallest first) | `none` | always | 扇区排序方式。 | | `labelType` | choice | `categoryPercent` (Name + %), `category` (Name), `value` (Value), `percent` (Percent), `none` (None) | `categoryPercent` | always | 标签内容。 | +| `sliceNames` | choice | `auto` (Auto), `onSlices` (On slices), `key` (In a key) | `auto` | always | Slice names | ### ![](chart-icon-doughnut.svg) Donut Chart @@ -237,6 +238,7 @@ _无模板专用参数。_ | `innerRadius` | number | 20 – 80 (step 5) | `55` | always | 内半径占外半径的百分比。 | | `sortSlices` | choice | `none` (Data order), `descending` (Largest first), `ascending` (Smallest first) | `none` | always | 扇区排序方式。 | | `labelType` | choice | `categoryPercent` (Name + %), `category` (Name), `value` (Value), `percent` (Percent), `none` (None) | `categoryPercent` | always | 标签内容。 | +| `sliceNames` | choice | `auto` (Auto), `onSlices` (On slices), `key` (In a key) | `auto` | always | Slice names | ### ![](chart-icon-radar.svg) Radar Chart @@ -309,17 +311,19 @@ _无模板专用参数。_ ### ![](chart-icon-world-map.svg) Map -**编码通道:** `longitude`, `latitude`, `color`, `size`, `opacity` +**编码通道:** `longitude`, `latitude`, `color`, `size`, `shape`, `opacity`, `order`, `detail`, `strokeWidth`, `text` | 参数 | 控件 | 取值范围 | 默认值 | 可用性 | 说明 | |---|---|---|---|---|---| | `region` | choice | `auto` (Auto-detect), `us` (United States), `world` (World) | `auto` | always | 地图区域。 | | `projection` | choice | `default` (Default), `mercator` (Mercator), `equalEarth` (Equal Earth), `orthographic` (Orthographic (Globe)), `stereographic` (Stereographic), `conicEqualArea` (Conic Equal Area), `conicEquidistant` (Conic Equidistant), `azimuthalEquidistant` (Azimuthal Equidistant), `mollweide` (Mollweide) | `default` | conditional | 地图投影。 | | `projectionCenter` | choice | Default _(default)_, `0,0` (World (Atlantic) [0, 0]), `150,0` (World (Pacific) [150, 0]), `105,35` (China [105, 35]), `-98,39` (USA [-98, 39]), `10,50` (Europe [10, 50]), `138,36` (Japan [138, 36]), `78,22` (India [78, 22]), `-52,-14` (Brazil [-52, -14]), `134,-25` (Australia [134, -25]), `100,60` (Russia [100, 60]), `20,0` (Africa [20, 0]), `45,28` (Middle East [45, 28]), `115,5` (Southeast Asia [115, 5]), `-60,-15` (South America [-60, -15]), `-100,45` (North America [-100, 45]), `-2,54` (UK [-2, 54]), `10,51` (Germany [10, 51]), `2,47` (France [2, 47]), `128,36` (Korea [128, 36]) | — | conditional | 地图投影中心。 | +| `arrows` | toggle | on / off | `true` | conditional | Arrows | +| `curve` | choice | `auto` (Auto: arcs between stops, great circles on a globe or along a track), `arc` (Arcs, bowed left of travel), `great-circle` (Great circles), `straight` (Straight (constant bearing)) | `auto` | conditional | Route curve | ### ![](chart-icon-us-map.svg) Choropleth -**编码通道:** `id`, `color`, `detail` +**编码通道:** `id`, `color`, `detail`, `text` | 参数 | 控件 | 取值范围 | 默认值 | 可用性 | 说明 | |---|---|---|---|---|---| diff --git a/docs/zh-CN/tutorials/agent-workflows.md b/docs/zh-CN/tutorials/agent-workflows.md index d9e0889e..1cf976ee 100644 --- a/docs/zh-CN/tutorials/agent-workflows.md +++ b/docs/zh-CN/tutorials/agent-workflows.md @@ -75,13 +75,11 @@ const echartsOption = assembleECharts(input); const chartjsConfig = assembleChartjs(input); ``` -只安装产品需要的渲染器依赖: +`flint-chart` 自带全部后端的库(Vega-Lite、ECharts、Chart.js、Plotly),一次安装即可用任一后端渲染: ```bash npm install flint-chart -npm install vega vega-lite vega-embed # browser Vega-Lite rendering -npm install echarts # ECharts rendering -npm install chart.js # Chart.js rendering +npm install vega-embed # 仅在自行嵌入编译出的 Vega-Lite 规范时需要 ``` Python 支持将使用相同的输入结构,但计划在后续版本发布,不属于首次公开发版。目前请在已发布工作流中使用 npm 包或 MCP 服务器。 diff --git a/docs/zh-CN/tutorials/chart-sizing.md b/docs/zh-CN/tutorials/chart-sizing.md index c1749a4a..fbc37542 100644 --- a/docs/zh-CN/tutorials/chart-sizing.md +++ b/docs/zh-CN/tutorials/chart-sizing.md @@ -55,8 +55,8 @@ area |------|------|------| | **默认自动布局** | 均不设置 | Flint 以 `400 × 320` 为目标,数据密集时可以增大。 | | **目标尺寸** | `baseSize` | Flint 以指定尺寸为目标,需要更多空间时仍可增大。 | -| **固定空间** | `canvasSize` | Flint 将图表放入指定空间且不溢出,适合尺寸固定的仪表盘和卡片。 | -| **限制增长** | 两者都设置 | Flint 从 `baseSize` 开始,按需增大,但不超过 `canvasSize`。 | +| **固定空间** | `canvasSize` | Flint 按该空间布局图表,使其在其中易读,适合尺寸固定的仪表盘和卡片;宿主需将绘制结果缩放进槽位(见「空间紧张时」)。 | +| **限制增长** | 两者都设置 | Flint 从 `baseSize` 开始,按需增大,但绘图区不会拉伸超过 `canvasSize`。 | 完整公式与实现细节见 [Auto Layout Algorithm](/documentation/layout-model)。 @@ -87,7 +87,7 @@ area 去掉 `canvasSize` 可让图表增长至 `baseSize × maxStretch`,或降低 `options.maxStretch` 以收紧固定仪表盘单元格的默认上限。 -对于**固定槽位**,最简形式是单独设置 `canvasSize` —— Flint 将其视为图表填充且收缩适配、永不溢出的盒子: +对于**固定槽位**,最简形式是单独设置 `canvasSize` —— Flint 将其视为图表填充且收缩适配的盒子: ```json { @@ -119,7 +119,11 @@ area 若框仍无法清晰地容纳图表,则**按原比例缩小绘图区**。标题和图例确定后,**绘图区会在框留下的空间内再布局一次**——标题区较高的图表,其条形会延伸到框多出的宽度——只有当文字不更小且整张图更好读时才采用;只运行一次。该步骤不会把图表放大布局再交由宿主缩小:无法修正的图表按其自身尺寸绘制,滚动还是缩放由读者或宿主决定。 -读得好但比框略大的图表只会接受最温和的改动——图例在原侧排成一行,或名称折行——且只有在使整张图更接近其框且没有引入新问题时才采用。除此之外,本来就读得好的图表不会被改动,不会删去任何内容,也不会改变图表自身的形状。标题横跨整张图,包括图旁的图例;图上方或下方的一行图例也是如此。它们先按主题的位置摆放(居中的标题对准绘图区,图例从起始端排起),若在该位置会超出整张图的边缘,则只做最小的移动使其留在图内。只是把一个问题换成另一个问题的部分修正(例如把过宽的图改成过高)不会被采用,让本已过小的文字更小的改动也不会被采用。必须折行的标题按原字号折行,每行填满宽度(单独剩下的最后一个词会被均衡),只有当缩小一级能少占一行时才缩小。将 `options.canvasFit` 设为 `'off'` 可完全按原计划布局。 +读得好但比框略大的图表只会接受最温和的改动——图例在原侧排成一行、名称折行,或将 y 轴上折行的名称缩小一到两级(不小于主题字号的四分之三,使两行的行高变矮)——且只有在使整张图更接近其框且没有引入新问题时才采用。除此之外,本来就读得好的图表不会被改动,不会删去任何内容,也不会改变图表自身的形状。标题横跨整张图,包括图旁的图例;图上方或下方的一行图例也是如此。它们先按主题的位置摆放(居中的标题对准绘图区,图例从起始端排起),若在该位置会超出整张图的边缘,则只做最小的移动使其留在图内。只是把一个问题换成另一个问题的部分修正(例如把过宽的图改成过高)不会被采用,让本已过小的文字更小的改动也不会被采用。必须折行的标题按原字号折行,每行填满宽度(单独剩下的最后一个词会被均衡),只有当缩小一级能少占一行时才缩小。将 `options.canvasFit` 设为 `'off'` 可完全按原计划布局。 + +**绘制结果留在画布内。** 给定 `canvasSize` 时,若绘制结果仍超出画布(例如绘图区占满宽度时旁边的图例,或占满高度时上方的标题),图表会在保留上述改动的前提下按更小的空间再布局一次,由绘图区让出空间,使图例、标签和标题都留在画布内。绘图区每边最多让出一半,且不会为此删去数值或把原本水平的标签旋转。该步骤适用于单视图的 Vega-Lite 图表,报告代码为 `canvas-contain`,`canvasFit: 'off'` 时跳过;未给定 `canvasSize` 的图表布局不变。 + +**将剩余部分缩放进槽位。** 仍略超出框的绘制结果(密集的分类轴、分面网格、其他后端的图表)在宿主缩放进框后(不小于 70%)依然易读。按原始尺寸绘制图表的宿主,应将 SVG 或 canvas 按每边 `min(1, 框 ÷ 绘制尺寸)` 等比缩放(contain);在服务端渲染时,应通过 `setTextMeasurer` 按渲染器的方式测量文字,使布局估算与实际绘制一致。 ## 字体大小 diff --git a/docs/zh-CN/tutorials/getting-started.md b/docs/zh-CN/tutorials/getting-started.md index ffc7c93e..7e3d97cd 100644 --- a/docs/zh-CN/tutorials/getting-started.md +++ b/docs/zh-CN/tutorials/getting-started.md @@ -14,10 +14,13 @@ Flint 的思路很简单:先描述**数据代表什么**,再说明**你想 npm install flint-chart ``` -若要在浏览器中渲染 Vega-Lite 图表,还需安装渲染栈: +`flint-chart` 自带其绘制所用的全部后端(Vega-Lite、ECharts、Chart.js、Plotly), +因此 `flint-chart/react` 的 ``(需 React)与 `flint-chart/interactive` +的 `mountChart` 安装后即可在任一后端上使用。若要用自己的代码嵌入编译出的 Vega-Lite +规范,再添加 `vega-embed`: ```bash -npm install vega vega-lite vega-embed +npm install vega-embed ``` ### Python 规划中 diff --git a/package-lock.json b/package-lock.json index e3be42e7..aac28640 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3022,7 +3022,7 @@ }, "node_modules/@types/d3-geo": { "version": "3.1.1", - "resolved": "https://ms-feed-17.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/d3-geo/-/d3-geo-3.1.1.tgz", + "resolved": "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/d3-geo/-/d3-geo-3.1.1.tgz", "integrity": "sha1-nig68XlgHFSVgWALP+wllBkRMp0=", "dev": true, "license": "MIT", @@ -4567,7 +4567,7 @@ }, "node_modules/d3-geo": { "version": "3.1.1", - "resolved": "https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/d3-geo/-/d3-geo-3.1.1.tgz", + "resolved": "https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/d3-geo/-/d3-geo-3.1.1.tgz", "integrity": "sha1-YCfPUSRvmy69ZPmeAdx8M2QDOk0=", "license": "ISC", "dependencies": { @@ -11194,14 +11194,22 @@ }, "packages/flint-js": { "name": "flint-chart", - "version": "1.0.1", + "version": "1.1.0", "license": "MIT", "dependencies": { "@floating-ui/dom": "^1.7.4", + "chart.js": "^4.0.0", + "d3-geo": "^3.1.1", "d3-time": "^3.1.0", - "d3-time-format": "^4.1.0" + "d3-time-format": "^4.1.0", + "echarts": "^5.0.0 || ^6.0.0", + "plotly.js-dist-min": "^2.35.0", + "vega": "^5.0.0 || ^6.0.0", + "vega-lite": "^5.0.0 || ^6.0.0", + "vega-tooltip": "^1.0.0" }, "devDependencies": { + "@types/d3-geo": "^3.1.1", "@types/d3-time": "^3.0.4", "@types/d3-time-format": "^4.0.3", "@types/node": "^20.14.10", @@ -11220,45 +11228,17 @@ "node": ">=18" }, "peerDependencies": { - "chart.js": "^4.0.0", - "echarts": "^5.0.0 || ^6.0.0", - "plotly.js": "^2.0.0 || ^3.0.0", - "plotly.js-dist-min": "^2.0.0 || ^3.0.0", - "react": ">=18", - "vega": "^5.0.0 || ^6.0.0", - "vega-lite": "^5.0.0 || ^6.0.0", - "vega-tooltip": "^1.0.0" + "react": ">=18" }, "peerDependenciesMeta": { - "chart.js": { - "optional": true - }, - "echarts": { - "optional": true - }, - "plotly.js": { - "optional": true - }, - "plotly.js-dist-min": { - "optional": true - }, "react": { "optional": true - }, - "vega": { - "optional": true - }, - "vega-lite": { - "optional": true - }, - "vega-tooltip": { - "optional": true } } }, "packages/flint-mcp": { "name": "flint-chart-mcp", - "version": "1.0.1", + "version": "1.1.0", "license": "MIT", "dependencies": { "@modelcontextprotocol/ext-apps": "^1.7.4", @@ -11267,7 +11247,7 @@ "@resvg/resvg-js": "^2.6.2", "chart.js": "^4.4.0", "echarts": "^6.0.0", - "flint-chart": "^1.0.1", + "flint-chart": "^1.1.0", "vega": "^6.0.0", "vega-interpreter": "^2.2.1", "vega-lite": "^6.0.0", diff --git a/package.json b/package.json index 2383766d..ecca2e2e 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,10 @@ "test": "npm run test -w packages/flint-js && npm run test -w packages/flint-mcp", "test:js": "npm run test -w packages/flint-js", "test:mcp": "npm run test -w packages/flint-mcp", + "test:benchmark": "node --test scripts/render-baselines.test.mjs", "test:py": "cd packages/flint-py && uv run pytest", "test:all": "npm run test:js && npm run test:mcp && npm run test:py", + "benchmark:render": "node scripts/render-baselines.mjs", "lint": "npm run lint -w packages/flint-js", "lint:py": "cd packages/flint-py && uv run ruff check .", "lint:all": "npm run lint && npm run lint:py", diff --git a/packages/flint-js/README.md b/packages/flint-js/README.md index d7a6bd71..ceb46c61 100644 --- a/packages/flint-js/README.md +++ b/packages/flint-js/README.md @@ -20,6 +20,10 @@ own apps (React is an optional peer dependency). npm install flint-chart ``` +It comes with every backend it draws with: Vega-Lite (`vega`, `vega-lite`, +`vega-tooltip`), ECharts, Chart.js and Plotly (`plotly.js-dist-min`). React is +an optional peer, needed only for `flint-chart/react`. + ## Quick start ```ts @@ -75,12 +79,7 @@ const xl = assembleExcel(input); // Native Excel chart artifact Add `interaction_spec` to make a chart interactive with any of 23 presets, such as `click-highlight`, `brush-x`, `inspect-index`, `navigate`, or `legend-toggle`. -Interactions run on the Vega-Lite surface, so install `vega`, `vega-lite`, and -`vega-tooltip` alongside Flint: - -```bash -npm install flint-chart vega vega-lite vega-tooltip -``` +Interactions run on the Vega-Lite surface: ```tsx import { FlintChart } from 'flint-chart/react'; @@ -93,6 +92,15 @@ import { FlintChart } from 'flint-chart/react'; /> ``` +Pass `backend="echarts"` (or `chartjs`, `plotly`) to draw with another library. + +An app that bundles into one file (no code splitting) can import a backend's +own entry, `flint-chart/react/vegalite` (or `/echarts`, `/chartjs`, `/plotly`; +`flint-chart/interactive/` likewise), which reaches no other backend's +library, so the file carries only that one. To draw a second backend from such +an entry, pass its factory: `renderers={{ echarts: createEChartsInteractiveRenderer }}`, +with `createEChartsInteractiveRenderer` from `flint-chart/echarts/interactive`. + Without React, `mountChart(element, input, { backend: 'vegalite' })` from `flint-chart/interactive` mounts the same chart in any page. Bespoke interactions map semantic events to chart updates with the [interaction API](https://microsoft.github.io/flint-chart/#/documentation/interaction-api); @@ -112,7 +120,9 @@ and [advanced interactions](https://microsoft.github.io/flint-chart/#/interactio | `flint-chart/excel` | Native Excel / Office.js backend | | `flint-chart/validate` | `validateChart` — per-problem input validation for agent loops | | `flint-chart/interactive` | `mountChart`, interaction presets, and update helpers | +| `flint-chart/interactive/` | The same, reaching only `vegalite`, `echarts`, `chartjs` or `plotly`: for one-file bundles | | `flint-chart/react` | `` component (React is an optional peer dependency) | +| `flint-chart/react/` | The same, reaching only `vegalite`, `echarts`, `chartjs` or `plotly`: for one-file bundles | | `flint-chart/render` | `renderSvg` — static SVG output (Vega-Lite or ECharts) | | `flint-chart/image-charts` | Image-Charts URL backend | | `flint-chart/test-data` | Sample data generators used by the gallery and tests | diff --git a/packages/flint-js/package.json b/packages/flint-js/package.json index 23915a33..7b4adec2 100644 --- a/packages/flint-js/package.json +++ b/packages/flint-js/package.json @@ -1,6 +1,6 @@ { "name": "flint-chart", - "version": "1.0.1", + "version": "1.1.0", "description": "Semantic-level visualization library that compiles data + semantic types for Vega-Lite, ECharts, Chart.js, Plotly, and Excel.", "keywords": [ "visualization", @@ -80,16 +80,65 @@ "import": "./dist/interactive/index.js", "require": "./dist/interactive/index.cjs" }, + "./interactive/vegalite": { + "types": "./dist/interactive/vegalite.d.ts", + "import": "./dist/interactive/vegalite.js", + "require": "./dist/interactive/vegalite.cjs" + }, + "./interactive/echarts": { + "types": "./dist/interactive/echarts.d.ts", + "import": "./dist/interactive/echarts.js", + "require": "./dist/interactive/echarts.cjs" + }, + "./interactive/chartjs": { + "types": "./dist/interactive/chartjs.d.ts", + "import": "./dist/interactive/chartjs.js", + "require": "./dist/interactive/chartjs.cjs" + }, + "./interactive/plotly": { + "types": "./dist/interactive/plotly.d.ts", + "import": "./dist/interactive/plotly.js", + "require": "./dist/interactive/plotly.cjs" + }, "./render": { "types": "./dist/render/index.d.ts", "import": "./dist/render/index.js", "require": "./dist/render/index.cjs" }, + "./geo": { + "types": "./dist/geo/index.d.ts", + "import": "./dist/geo/index.js", + "require": "./dist/geo/index.cjs" + }, + "./geo/lazy/*": { + "types": "./src/geo/lazy/*.d.ts", + "default": "./dist/geo/lazy/*.js" + }, "./react": { "types": "./dist/react/index.d.ts", "import": "./dist/react/index.js", "require": "./dist/react/index.cjs" }, + "./react/vegalite": { + "types": "./dist/react/vegalite.d.ts", + "import": "./dist/react/vegalite.js", + "require": "./dist/react/vegalite.cjs" + }, + "./react/echarts": { + "types": "./dist/react/echarts.d.ts", + "import": "./dist/react/echarts.js", + "require": "./dist/react/echarts.cjs" + }, + "./react/chartjs": { + "types": "./dist/react/chartjs.d.ts", + "import": "./dist/react/chartjs.js", + "require": "./dist/react/chartjs.cjs" + }, + "./react/plotly": { + "types": "./dist/react/plotly.d.ts", + "import": "./dist/react/plotly.js", + "require": "./dist/react/plotly.cjs" + }, "./vegalite/interactive": { "types": "./dist/vegalite/interactive.d.ts", "import": "./dist/vegalite/interactive.js", @@ -141,42 +190,15 @@ "release": "npm publish --access public" }, "peerDependencies": { - "chart.js": "^4.0.0", - "echarts": "^5.0.0 || ^6.0.0", - "plotly.js": "^2.0.0 || ^3.0.0", - "plotly.js-dist-min": "^2.0.0 || ^3.0.0", - "react": ">=18", - "vega": "^5.0.0 || ^6.0.0", - "vega-lite": "^5.0.0 || ^6.0.0", - "vega-tooltip": "^1.0.0" + "react": ">=18" }, "peerDependenciesMeta": { - "vega": { - "optional": true - }, - "vega-lite": { - "optional": true - }, - "vega-tooltip": { - "optional": true - }, - "echarts": { - "optional": true - }, - "chart.js": { - "optional": true - }, - "plotly.js": { - "optional": true - }, - "plotly.js-dist-min": { - "optional": true - }, "react": { "optional": true } }, "devDependencies": { + "@types/d3-geo": "^3.1.1", "@types/d3-time": "^3.0.4", "@types/d3-time-format": "^4.0.3", "@types/node": "^20.14.10", @@ -204,7 +226,14 @@ }, "dependencies": { "@floating-ui/dom": "^1.7.4", + "chart.js": "^4.0.0", + "d3-geo": "^3.1.1", "d3-time": "^3.1.0", - "d3-time-format": "^4.1.0" + "d3-time-format": "^4.1.0", + "echarts": "^5.0.0 || ^6.0.0", + "plotly.js-dist-min": "^2.35.0", + "vega": "^5.0.0 || ^6.0.0", + "vega-lite": "^5.0.0 || ^6.0.0", + "vega-tooltip": "^1.0.0" } } diff --git a/packages/flint-js/src/chart-types/boundaries.ts b/packages/flint-js/src/chart-types/boundaries.ts new file mode 100644 index 00000000..e0990fd0 --- /dev/null +++ b/packages/flint-js/src/chart-types/boundaries.ts @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The boundaries a map draws: `chartProperties.boundaries`, a named set Flint ships or a file of + * the chart's own (by URL or inline), resolved into what the map templates read — the data for + * each object, how a feature's id is read, how a row's key is matched to it, the credit, and the + * dotted borders. + * + * A named set compiles to its URL on Flint's site, under a version folder that never changes once + * deployed (`scripts/publish-site-geo.mjs`), so a spec draws the same map for as long as the site + * stands. Flint's renderers never fetch those URLs: they load the copies bundled in the package + * (`vegalite/boundary-loader.ts`). Unset, a map draws the World Bank's, or the US Census Bureau's + * for US data. + */ + +import type { BoundaryFile, BoundaryIds, ChartCredit } from '../core/types'; +import { countryAlpha, keyTypeResolver, resolveCountry, resolveUsState, type GeoResolver, type MapScope } from './geo'; + +/** How fine a world map's coastlines and borders are drawn: `coarse` for the world, `medium` for a region or a zoom. */ +export type WorldDetail = 'coarse' | 'medium'; + +/** The named world boundaries a chart can choose. */ +export const BOUNDARY_NAMES = ['world-bank', 'natural-earth'] as const; +export type BoundaryName = typeof BOUNDARY_NAMES[number]; + +/** What a boundary file's ids can be. */ +export const BOUNDARY_IDS = ['iso-numeric', 'iso3', 'iso2', 'fips', 'as-is'] as const satisfies readonly BoundaryIds[]; + +/** Where Flint's site publishes the boundaries: one folder per version of the files under `src/geo`. */ +export const SITE_GEO = 'https://microsoft.github.io/flint-chart/geo'; + +/** + * The published version the package's `src/geo` files are. A published version never changes: + * new or corrected boundaries go out as the next version, and the site keeps serving the old one + * for the specs that name it (`scripts/publish-site-geo.mjs` refuses a deploy that would not). + */ +export const GEO_VERSION = 'v1'; + +const GEO = `${SITE_GEO}/${GEO_VERSION}`; + +/** The URL of every file the named sets and the US maps draw. */ +export const BOUNDARY_URLS = { + worldBank: { + coarse: `${GEO}/world-bank-coarse.json`, + medium: `${GEO}/world-bank-medium.json`, + }, + naturalEarth: `${GEO}/world-110m.json`, + usStates: `${GEO}/states-10m.json`, + usAlbers: `${GEO}/counties-albers-10m.json`, +} as const; + +/** The World Bank map's object holding the borders its areas of non-determined legal status share. */ +export const DISPUTED_FEATURE = 'disputed'; + +/** The World Bank's terms: credit under CC BY 4.0, and its disclaimer on the boundaries. */ +export const WORLD_BANK_CREDIT: ChartCredit = { + text: 'Map based on World Bank Official Boundaries (CC BY 4.0)', + href: 'https://datacatalog.worldbank.org/search/dataset/0038272/world-bank-official-boundaries', + title: 'The boundaries, colors, denominations, and any other information shown on this map do not imply any judgment on the part of The World Bank concerning the legal status of any territory or the endorsement or acceptance of such boundaries.', +}; + +const isUrl = (value: unknown): boolean => typeof value === 'string' && value.trim() !== ''; +const isObject = (value: unknown): value is Record => typeof value === 'object' && value !== null && !Array.isArray(value); + +/** Whether a value is a boundary file: a URL (or one per detail) or inline shapes, with the fields it may carry well-formed. */ +export function isBoundaryFile(value: unknown): value is BoundaryFile { + if (!isObject(value)) return false; + const { url, values, feature, ids, key, disputed, attribution } = value; + const urlOk = isUrl(url) || (isObject(url) && (isUrl(url.coarse) || isUrl(url.medium)) + && [url.coarse, url.medium].every((detail) => detail === undefined || isUrl(detail))); + const valuesOk = isObject(values); + if (urlOk === valuesOk) return false; + if (feature !== undefined && typeof feature !== 'string') return false; + if (ids !== undefined && !(BOUNDARY_IDS as readonly unknown[]).includes(ids)) return false; + if (key !== undefined && (typeof key !== 'string' || key === '')) return false; + if (disputed !== undefined && typeof disputed !== 'string') return false; + if (attribution !== undefined && typeof attribution !== 'string' && !(isObject(attribution) && typeof attribution.text === 'string')) return false; + return true; +} + +/** The chart's own boundary file, if it gives one. */ +export function boundaryFile(chartProperties: Record | undefined): BoundaryFile | undefined { + const value = chartProperties?.boundaries; + return isBoundaryFile(value) ? value : undefined; +} + +/** The named world boundaries a chart asked for, else the World Bank's. */ +export function worldBoundaries(chartProperties: Record | undefined): BoundaryName { + return chartProperties?.boundaries === 'natural-earth' ? 'natural-earth' : 'world-bank'; +} + +/** What a file's ids are: as stated, else FIPS for a US map and ISO numeric for any other. */ +export function fileIds(file: BoundaryFile, scope: MapScope): BoundaryIds { + return file.ids ?? (scope === 'us' ? 'fips' : 'iso-numeric'); +} + +/** Whether a file's ids name countries, so the world map's framing and globe apply to it. */ +export const idsNameCountries = (ids: BoundaryIds): boolean => ids === 'iso-numeric' || ids === 'iso3' || ids === 'iso2'; + +/** The map a file's ids put the chart on: the world for countries, the US for FIPS, none for the file's own. */ +export function fileScope(file: BoundaryFile, inferred: MapScope): MapScope | 'own' { + const ids = fileIds(file, inferred); + return idsNameCountries(ids) ? 'world' : ids === 'fips' ? 'us' : 'own'; +} + +/** A file's data for one object (or the whole GeoJSON), at a detail where it gives two. */ +export function fileData(file: BoundaryFile, feature: string | undefined, detail: WorldDetail = 'coarse'): Record { + const format = feature ? { type: 'topojson', feature } : { type: 'json', property: 'features' }; + if (file.values) return { values: file.values, format }; + const url = typeof file.url === 'string' ? file.url : (file.url?.[detail] ?? file.url?.coarse ?? file.url?.medium); + return { url, format }; +} + +/** The Vega expression reading a feature's id from its `key` (a dotted path), in the form its ids are matched in. */ +export function fileKeyExpr(file: BoundaryFile, ids: BoundaryIds): string { + const path = (file.key ?? 'id').split('.').map((part) => `[${JSON.stringify(part)}]`).join(''); + const value = `datum${path}`; + if (ids === 'iso-numeric' || ids === 'fips') return `toNumber(${value})`; + if (ids === 'iso3' || ids === 'iso2') return `upper(toString(${value}))`; + return `toString(${value})`; +} + +/** The field a file's normalised feature key is written to before the join. */ +export const FILE_KEY_FIELD = '__geo_key'; + +/** Match a row's key to a file's ids, as `fileKeyExpr` reads them; `keyType` says what the rows hold. */ +export function fileKeyResolver(ids: BoundaryIds, keyType: unknown): (value: unknown) => unknown { + if (ids === 'as-is') return (value) => (value == null || value === '' ? undefined : String(value).trim()); + if (ids === 'fips') return keyTypeResolver(keyType) ?? resolveUsState; + const country: GeoResolver = keyTypeResolver(keyType) ?? resolveCountry; + if (ids === 'iso-numeric') return country; + return (value) => { + const id = country(value); + return id === undefined ? undefined : countryAlpha(id, ids); + }; +} + +/** Antarctica's id in a file's ids, so a frame that leaves it out can; undefined where they cannot name it. */ +export function fileAntarctica(ids: BoundaryIds): number | string | undefined { + return ids === 'iso-numeric' ? 10 : ids === 'iso3' ? 'ATA' : ids === 'iso2' ? 'AQ' : undefined; +} + +/** The credit a file's `attribution` asks for. */ +export function fileCredit(file: BoundaryFile): ChartCredit | undefined { + const attribution = file.attribution; + if (typeof attribution === 'string') return attribution.trim() ? { text: `Boundaries: ${attribution.trim()}` } : undefined; + return attribution?.text?.trim() ? attribution : undefined; +} + +/** Who drew a file's boundaries, as the map reports it (`_attribution`). */ +export function fileAttribution(file: BoundaryFile): string | undefined { + const attribution = file.attribution; + const text = typeof attribution === 'string' ? attribution : attribution?.text; + return text?.trim() || undefined; +} + +/** Who drew each named set's and US map's boundaries, reported as a map's `_attribution`. */ +export const NAMED_ATTRIBUTION = { + 'world-bank': 'World Bank Official Boundaries (CC BY 4.0)', + 'natural-earth': 'Natural Earth', + us: 'US Census Bureau', + usAlbers: 'US Census Bureau, via us-atlas', +} as const; + +/** The credit a named set draws at the map's foot: the World Bank's; none for public-domain boundaries. */ +export function namedCredit(name: BoundaryName | 'us'): ChartCredit | undefined { + return name === 'world-bank' ? WORLD_BANK_CREDIT : undefined; +} + +/** The URL a named world set draws at a detail. */ +export function namedWorldUrl(name: BoundaryName, detail: WorldDetail = 'coarse'): string { + return name === 'natural-earth' ? BOUNDARY_URLS.naturalEarth : BOUNDARY_URLS.worldBank[detail]; +} diff --git a/packages/flint-js/src/chart-types/geo-bounds.ts b/packages/flint-js/src/chart-types/geo-bounds.ts new file mode 100644 index 00000000..82cb0c49 --- /dev/null +++ b/packages/flint-js/src/chart-types/geo-bounds.ts @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Generated by scripts/build-geo-bounds.mjs from Vega's world-110m.json (Natural Earth). Do not edit. + +/** + * Each country's body — its largest polygon and the large ones near it (scripts/lib/country-body.mjs) + * — as [ISO 3166-1 numeric id, west, south, east, north] in degrees. A body that crosses the + * antimeridian has west > east. + */ +export const COUNTRY_BOUNDS: ReadonlyArray = [ + [-99, 32.7, 35, 34.6, 35.7], + [-99, 20.1, 41.8, 21.8, 43.3], + [-99, 42.6, 8, 48.9, 11.5], + [4, 60.5, 29.3, 75.2, 38.5], + [8, 19.3, 39.6, 21, 42.7], + [10, -180, -90, 180, -63.3], + [12, -8.7, 19.1, 12, 37.1], + [24, 11.6, -17.9, 24.1, -5.9], + [31, 44.8, 38.3, 50.4, 41.9], + [32, -73.4, -52.4, -53.6, -21.8], + [36, 113.3, -39, 153.6, -10.7], + [40, 9.5, 46.4, 17, 49], + [44, -79, 23.7, -77, 27], + [50, 88.1, 20.7, 92.7, 26.4], + [51, 43.6, 38.7, 46.5, 41.2], + [56, 2.5, 49.5, 6.2, 51.5], + [64, 88.8, 26.7, 92.1, 28.3], + [68, -69.6, -22.9, -57.5, -9.8], + [70, 15.7, 42.6, 19.6, 45.2], + [72, 19.9, -26.8, 29.4, -17.7], + [76, -74, -33.8, -34.7, 5.2], + [84, -89.2, 15.9, -88.1, 18.5], + [90, 156.5, -10.8, 162.4, -6.6], + [96, 114.2, 4, 115.5, 5.4], + [100, 22.4, 41.2, 28.6, 44.2], + [104, 92.3, 9.9, 101.2, 28.3], + [108, 29, -4.5, 30.8, -2.3], + [112, 23.2, 51.3, 32.7, 56.2], + [116, 102.3, 10.5, 107.6, 14.6], + [120, 8.5, 1.7, 16, 12.9], + [124, -141, 41.7, -55.7, 73.8], + [140, 14.5, 2.3, 27.4, 11.1], + [144, 79.7, 6, 81.8, 9.8], + [148, 13.5, 7.4, 23.9, 23.4], + [152, -75.6, -55.6, -67, -17.6], + [156, 73.7, 20.3, 135, 53.5], + [158, 120.1, 22, 122, 25.3], + [170, -79, -4.3, -66.9, 12.4], + [178, 11.1, -5, 18.5, 3.7], + [180, 12.2, -13.3, 31.2, 5.3], + [188, -85.9, 8.2, -82.5, 11.2], + [191, 13.7, 42.5, 19.4, 46.5], + [192, -85, 19.9, -74.2, 23.2], + [196, 32.3, 34.6, 34, 35.2], + [203, 12.2, 48.6, 18.9, 51.1], + [204, 0.8, 6.1, 3.8, 12.2], + [208, 8.1, 54.8, 12.7, 57.7], + [214, -71.9, 17.6, -68.3, 19.9], + [218, -81, -5, -75.2, 1.4], + [222, -90.1, 13.1, -87.7, 14.4], + [226, 9.3, 1, 11.3, 2.3], + [231, 33, 3.4, 47.8, 15], + [232, 36.3, 12.5, 43.1, 18], + [233, 23.3, 57.5, 28.1, 59.6], + [238, -61.2, -52.3, -57.7, -51.1], + [242, 177.3, -18.3, 180, -16.1], + [246, 20.6, 59.8, 31.5, 70.2], + [250, -4.6, 42.3, 8.1, 51.1], + [260, 68.7, -49.8, 70.6, -48.6], + [262, 41.7, 10.9, 43.3, 12.7], + [266, 8.8, -4, 14.4, 2.3], + [268, 40, 41.1, 46.6, 43.6], + [270, -16.8, 13.1, -13.8, 13.9], + [275, 34.9, 31.4, 35.5, 32.5], + [276, 6, 47.3, 15, 55], + [288, -3.2, 4.7, 1.1, 11.1], + [300, 20.2, 34.9, 26.6, 41.8], + [304, -73.3, 60, -12.2, 83.6], + [320, -92.2, 13.7, -88.2, 17.8], + [324, -15.1, 7.3, -7.8, 12.6], + [328, -61.4, 1.3, -56.5, 8.4], + [332, -74.5, 18, -71.6, 19.9], + [340, -89.4, 13, -83.1, 16], + [348, 16.2, 45.8, 22.7, 48.6], + [352, -24.3, 63.5, -13.6, 66.5], + [356, 68.2, 8, 97.4, 35.5], + [360, 95.3, -9.1, 141, 5.5], + [364, 44.1, 25.1, 63.3, 39.7], + [368, 38.8, 29.1, 48.6, 37.4], + [372, -10, 51.7, -6, 55.1], + [376, 34.3, 29.5, 35.8, 33.3], + [380, 6.7, 36.6, 18.5, 47.1], + [384, -8.6, 4.3, -2.6, 10.5], + [388, -78.3, 17.7, -76.2, 18.5], + [392, 129.4, 31, 145.5, 45.6], + [398, 46.5, 40.7, 87.4, 55.4], + [400, 34.9, 29.2, 39.2, 33.4], + [404, 33.9, -4.7, 41.9, 5.5], + [408, 124.3, 37.7, 130.8, 43], + [410, 126.1, 34.4, 129.5, 38.6], + [414, 46.6, 28.5, 48.4, 30.1], + [417, 69.5, 39.3, 80.3, 43.3], + [418, 100.1, 13.9, 107.6, 22.5], + [422, 35.1, 33.1, 36.6, 34.6], + [426, 27, -30.6, 29.3, -28.6], + [428, 21.1, 55.6, 28.2, 58], + [430, -11.4, 4.4, -7.5, 8.5], + [434, 9.3, 19.6, 25.2, 33.1], + [440, 21.1, 53.9, 26.6, 56.4], + [442, 5.7, 49.4, 6.2, 50.1], + [450, 43.3, -25.6, 50.5, -12], + [454, 32.7, -16.8, 35.8, -9.2], + [458, 109.7, 0.8, 119.2, 6.9], + [466, -12.2, 10.1, 4.3, 25], + [478, -17.1, 14.6, -4.9, 27.4], + [484, -117.1, 14.5, -86.8, 32.7], + [496, 87.8, 41.6, 119.8, 52], + [498, 26.6, 45.5, 30, 48.5], + [499, 18.4, 41.9, 20.3, 43.5], + [504, -17, 21.4, -1.1, 35.8], + [508, 30.2, -26.7, 40.8, -10.3], + [512, 52, 16.7, 59.8, 24.9], + [516, 11.7, -29, 25.1, -16.9], + [524, 80.1, 26.4, 88.2, 30.4], + [528, 3.3, 50.8, 7.1, 53.5], + [540, 164, -22.4, 167.1, -20.1], + [548, 166.6, -16.6, 167.8, -14.6], + [554, 166.5, -46.6, 178.5, -34.5], + [558, -87.7, 10.7, -83.1, 15], + [562, 0.3, 11.7, 15.9, 23.5], + [566, 2.7, 4.2, 14.6, 13.9], + [578, 5, 58.1, 31.3, 71.2], + [586, 60.9, 23.7, 77.8, 37.1], + [591, -83, 7.2, -77.2, 9.6], + [598, 141, -10.7, 152.3, -2.6], + [600, -62.7, -27.5, -54.3, -19.3], + [604, -81.4, -18.3, -68.7, -0.1], + [608, 117.2, 5.6, 126.5, 18.5], + [616, 14.1, 49, 24, 54.9], + [620, -9.5, 36.8, -6.4, 42.3], + [624, -16.7, 11, -13.7, 12.6], + [626, 125, -9.4, 127.3, -8.3], + [630, -67.2, 17.9, -65.6, 18.5], + [634, 50.7, 24.6, 51.6, 26.1], + [642, 20.2, 43.7, 29.6, 48.2], + [643, 27.3, 41.2, 180, 77.7], + [646, 29, -2.9, 30.8, -1.1], + [682, 34.6, 16.3, 55.7, 32.2], + [686, -17.6, 12.3, -11.5, 16.6], + [688, 18.8, 42.2, 23, 46.2], + [694, -13.2, 6.8, -10.2, 10], + [703, 16.9, 47.8, 22.6, 49.6], + [704, 102.2, 8.6, 109.3, 23.4], + [705, 13.7, 45.5, 16.6, 46.9], + [706, 41, -1.7, 51.1, 12], + [710, 16.3, -34.8, 32.8, -22.1], + [716, 25.3, -22.3, 32.8, -15.5], + [724, -9.4, 35.9, 3, 43.7], + [728, 23.9, 3.5, 35.3, 12.2], + [729, 21.9, 8.6, 38.4, 22], + [732, -17.1, 21, -8.7, 27.7], + [740, -58, 1.8, -54, 6], + [748, 30.7, -27.3, 32.1, -25.7], + [752, 11, 55.4, 23.9, 69.1], + [756, 6, 45.8, 10.4, 47.8], + [760, 35.7, 32.3, 42.3, 37.2], + [762, 67.4, 36.7, 75, 41], + [764, 97.4, 5.7, 105.6, 20.4], + [768, 0, 5.9, 1.9, 11], + [780, -62, 10, -60.9, 10.9], + [784, 51.6, 22.5, 56.4, 26.1], + [788, 7.5, 30.3, 11.5, 37.4], + [792, 26.2, 35.8, 44.8, 42], + [795, 52.5, 35.3, 66.5, 42.8], + [800, 29.6, -1.4, 35, 4.3], + [804, 22.1, 44.4, 40.1, 52.3], + [807, 20.5, 40.8, 23, 42.3], + [818, 24.7, 22, 36.9, 31.6], + [826, -6.2, 50, 1.7, 58.6], + [834, 29.3, -11.7, 40.3, -1], + [840, -168.1, 25.1, -67, 71.4], + [854, -5.5, 9.6, 2.2, 15.1], + [858, -58.4, -35, -53.2, -30.1], + [860, 55.9, 37.1, 73.1, 45.6], + [862, -73.3, 0.7, -59.8, 12.2], + [887, 42.6, 12.6, 53.1, 19], + [894, 21.9, -18, 33.5, -8.2], +]; diff --git a/packages/flint-js/src/chart-types/geo-continents.ts b/packages/flint-js/src/chart-types/geo-continents.ts new file mode 100644 index 00000000..c6b61148 --- /dev/null +++ b/packages/flint-js/src/chart-types/geo-continents.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The continents a map's data can be framed by: which continent each country belongs to (the UN's + * M49 grouping: Russia in Europe, Turkey and the Caucasus in Asia, Central America and the Caribbean + * in North America), and the frame an atlas draws each continent in. + */ + +import { keyTypeResolver } from './geo'; +import type { GeoBox } from './geo-frame'; + +export const CONTINENTS = ['europe', 'africa', 'asia', 'northAmerica', 'southAmerica', 'oceania'] as const; +export type Continent = typeof CONTINENTS[number]; + +/** Each continent as an atlas frames it: its mainland and near islands, not every outlying territory. */ +export const CONTINENT_FRAMES: Record = { + europe: [-25, 34, 45, 72], + africa: [-18, -35, 52, 38], + asia: [26, -11, 146, 56], + northAmerica: [-168, 7, -52, 72], + southAmerica: [-82, -56, -34, 13], + // Across the antimeridian to Samoa and Tonga. + oceania: [112, -48, 189, 0], +}; + +/** ISO 3166-1 alpha-3 codes by continent. */ +const MEMBERS: Record = { + africa: 'DZA AGO BEN BWA BFA BDI CPV CMR CAF TCD COM COG COD CIV DJI EGY GNQ ERI SWZ ETH GAB GMB GHA GIN GNB KEN LSO LBR LBY MDG MWI MLI MRT MUS MAR MOZ NAM NER NGA RWA STP SEN SYC SLE SOM ZAF SSD SDN TZA TGO TUN UGA ZMB ZWE ESH SHN IOT', + europe: 'ALB AND AUT BLR BEL BIH BGR HRV CZE DNK EST FIN FRA DEU GRC HUN ISL IRL ITA LVA LIE LTU LUX MLT MDA MCO MNE NLD MKD NOR POL PRT ROU RUS SMR SRB SVK SVN ESP SWE CHE UKR GBR VAT XKX FRO GIB GGY JEY IMN ALA SJM', + asia: 'AFG ARM AZE BHR BGD BTN BRN KHM CHN CYP GEO IND IDN IRN IRQ ISR JPN JOR KAZ KWT KGZ LAO LBN MYS MDV MNG MMR NPL PRK OMN PAK PSE PHL QAT SAU SGP KOR LKA SYR TWN TJK THA TLS TUR TKM ARE UZB VNM YEM HKG MAC', + northAmerica: 'ATG BHS BRB BLZ CAN CRI CUB DMA DOM SLV GRD GTM HTI HND JAM MEX NIC PAN KNA LCA VCT TTO USA GRL BMU PRI ABW AIA BES BLM CUW MAF MSR SPM SXM TCA VGB VIR CYM', + southAmerica: 'ARG BOL BRA CHL COL ECU GUY PRY PER SUR URY VEN FLK SGS', + oceania: 'AUS FJI KIR MHL FSM NRU NZL PLW PNG WSM SLB TON TUV VUT ASM COK GUM MNP NCL NFK NIU PCN PYF TKL WLF UMI CCK CXR HMD', +}; + +/** ISO 3166-1 numeric codes of the territories the country gazetteer leaves out. */ +const TERRITORY_IDS: Record = { + ABW: 533, AIA: 660, ALA: 248, ASM: 16, BES: 535, BLM: 652, BMU: 60, CCK: 166, COK: 184, CUW: 531, + CXR: 162, CYM: 136, FRO: 234, GGY: 831, GIB: 292, GUM: 316, HMD: 334, IMN: 833, IOT: 86, JEY: 832, + MAF: 663, MNP: 580, MSR: 500, NFK: 574, NIU: 570, PCN: 612, PYF: 258, SGS: 239, SHN: 654, SJM: 744, + SPM: 666, SXM: 534, TCA: 796, TKL: 772, UMI: 581, VGB: 92, VIR: 850, WLF: 876, +}; + +const CONTINENT_BY_ID: ReadonlyMap = (() => { + const numeric = keyTypeResolver('iso3')!; + const out = new Map(); + for (const continent of CONTINENTS) { + for (const code of MEMBERS[continent].split(' ')) { + const id = numeric(code) ?? TERRITORY_IDS[code]; + if (id !== undefined) out.set(id, continent); + } + } + return out; +})(); + +/** The continent a country belongs to, by ISO numeric id. */ +export function continentOf(id: number): Continent | undefined { + return CONTINENT_BY_ID.get(id); +} + +/** The continent a place lies in: the frame that holds it, the one whose middle is nearer where two do (Istanbul in Europe, Cairo in Africa). */ +export function continentAt(lon: number, lat: number): Continent | undefined { + let best: Continent | undefined; + let nearest = Infinity; + for (const continent of CONTINENTS) { + const [w, s, e, n] = CONTINENT_FRAMES[continent]; + // A frame across the antimeridian holds a place west of it as that place plus 360°. + const at = lon < w && lon + 360 <= e ? lon + 360 : lon; + if (at < w || at > e || lat < s || lat > n) continue; + const distance = Math.hypot(at - (w + e) / 2, lat - (s + n) / 2); + if (distance < nearest) [best, nearest] = [continent, distance]; + } + return best; +} diff --git a/packages/flint-js/src/chart-types/geo-frame.ts b/packages/flint-js/src/chart-types/geo-frame.ts new file mode 100644 index 00000000..c717b699 --- /dev/null +++ b/packages/flint-js/src/chart-types/geo-frame.ts @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Map framing, shared by every backend that draws its own base map: what part of the earth a map + * shows, and the shape its plot takes for it. + * + * A map frames its data. Countries or points that sit in one part of the world frame that part; + * data that spans the world frames the world's land, without Antarctica unless the data names it. + * A globe frames the whole sphere. The plot takes the shape the frame projects to, as large as the + * canvas holds once its title, keys and axes have their room: a map is planned inside the box the + * host gives it, and fills it. + */ + +import { + geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEquidistant, geoConicEqualArea, geoConicEquidistant, geoDistance, geoEqualEarth, + geoMercator, geoNaturalEarth1, geoOrthographic, geoPath, geoStereographic, type GeoProjection, +} from 'd3-geo'; +import { COUNTRY_BOUNDS } from './geo-bounds'; +import { CONTINENT_FRAMES, type Continent } from './geo-continents'; +import { WORLD_BANK_EXTRA_BOUNDS, WORLD_BANK_IDS } from './world-bank-ids'; + +/** + * A box in degrees: west, south, east, north. A box across the antimeridian runs east past 180° + * (Fiji to Samoa: 177 to 188), or, as a country's body, has west > east. + */ +export type GeoBox = readonly [number, number, number, number]; + +/** The world's land without Antarctica: Tierra del Fuego to northern Greenland. */ +export const WORLD_LAND: GeoBox = [-180, -58, 180, 84]; +/** The world's land with Antarctica. */ +export const WORLD_ALL: GeoBox = [-180, -90, 180, 84]; + +/** ISO 3166-1 numeric id of Antarctica in the world TopoJSON. */ +export const ANTARCTICA_ID = 10; + +/** The narrowest a regional frame stands, in degrees, so one small country or a single point still reads in its region. */ +const MIN_SPAN: readonly [number, number] = [16, 10]; +/** Data spanning more than this, in degrees, frames the world rather than a region. */ +const REGIONAL_SPAN: readonly [number, number] = [150, 100]; +/** Margin around a frame drawn round the data, on each side, as a share of its span. */ +const FRAME_PAD = 0.12; +/** + * The share of its continent's frame the data must cover for the map to frame the whole continent: + * data that already spans much of it reads best against all of it, as an axis takes in zero when the + * data comes near it; less, and the map frames the data, so the part does not shrink into the whole. + */ +const CONTINENT_SNAP = 0.4; + +/** What a world map frames: one country (or place), several, their whole continent, or the world. */ +export type FrameLevel = 'country' | 'region' | 'continent' | 'world'; + +/** How a world map frames its data: `auto` judges by the data; `data` keeps to it; `continent` frames its continents. */ +export type FrameFit = 'auto' | 'data' | 'continent'; + +/** The world's boundaries: World Bank Official Boundaries (the default), or Natural Earth's. */ +export type WorldBoundaries = 'world-bank' | 'natural-earth'; + +const NATURAL_EARTH_IDS: ReadonlySet = new Set(COUNTRY_BOUNDS.map(([id]) => id)); +const BOUNDS_BY_ID = new Map([...COUNTRY_BOUNDS, ...WORLD_BANK_EXTRA_BOUNDS].map(([id, w, s, e, n]) => [id, [w, s, e, n] as GeoBox])); + +/** Each country's main body, by ISO numeric id; undefined for an id neither world map draws. */ +export function countryBox(id: number): GeoBox | undefined { + return BOUNDS_BY_ID.get(id); +} + +/** + * Whether a world map draws a country with this ISO numeric id. The World Bank's draws Taiwan as part + * of China and has no Antarctica; Natural Earth's 1:110m leaves out most small islands. + */ +export function isWorldFeature(id: number, boundaries: WorldBoundaries = 'world-bank'): boolean { + return (boundaries === 'natural-earth' ? NATURAL_EARTH_IDS : WORLD_BANK_IDS).has(id); +} + +/** + * The frame for a set of boxes (countries) or points (as zero-size boxes), each in its continent where + * known: the world's land where they span more than a region or cross the antimeridian; the whole of + * their continents where they cover enough of them (`CONTINENT_SNAP`), or where `fit` asks; else the + * box round them, padded on each side and no smaller than a small country's region. + */ +export function frameOf( + boxes: readonly GeoBox[], + antarctica = false, + options: { continents?: readonly (Continent | undefined)[]; fit?: FrameFit } = {}, +): { box: GeoBox; world: boolean; level: FrameLevel } { + const world = { box: antarctica ? WORLD_ALL : WORLD_LAND, world: true, level: 'world' as const }; + if (boxes.length === 0) return world; + const [west, east] = longitudeSpan(boxes); + const south = Math.min(...boxes.map(([, s]) => s)); + const north = Math.max(...boxes.map(([, , , n]) => n)); + if (east - west > REGIONAL_SPAN[0] || north - south > REGIONAL_SPAN[1]) return world; + const continental = continentFrame(options.continents); + if (continental && options.fit !== 'data') { + const [cw, cs, ce, cn] = continental; + const covered = ((east - west) * (north - south)) / ((ce - cw) * (cn - cs)); + if (options.fit === 'continent' || covered >= CONTINENT_SNAP) return { box: continental, world: false, level: 'continent' }; + } + const widen = (lo: number, hi: number, least: number): [number, number] => { + const span = Math.max(hi - lo, least); + const middle = (lo + hi) / 2; + const half = (span * (1 + 2 * FRAME_PAD)) / 2; + return [middle - half, middle + half]; + }; + const [w, e] = widen(west, east, MIN_SPAN[0]); + const [s, n] = widen(south, north, MIN_SPAN[1]); + const one = boxes.every(([bw, bs, be, bn]) => bw === boxes[0][0] && bs === boxes[0][1] && be === boxes[0][2] && bn === boxes[0][3]); + // Past 180° only where the data runs across the antimeridian; otherwise held to the map's edges. + const crosses = east > 180; + return { + box: [crosses ? w : Math.max(-180, w), Math.max(-90, s), crosses ? e : Math.min(180, e), Math.min(90, n)], + world: false, level: one ? 'country' : 'region', + }; +} + +/** + * The narrowest run of longitude, west to east, that holds every box: the circle less the widest gap + * between them. Where that run crosses the antimeridian its east end lies past 180° (New Zealand, + * Fiji and Samoa: 166° to 188°), so the data is framed as one region rather than the world. + */ +export function longitudeSpan(boxes: readonly GeoBox[]): [number, number] { + const arcs = boxes.map(([w, , e]): [number, number] => { + const start = ((w + 180) % 360 + 360) % 360 - 180; + const length = w <= e ? e - w : e + 360 - w; + return [start, start + length]; + }).sort((a, b) => a[0] - b[0]); + const merged: [number, number][] = []; + for (const [start, end] of arcs) { + const last = merged[merged.length - 1]; + if (last && start <= last[1]) last[1] = Math.max(last[1], end); + else merged.push([start, end]); + } + // Arcs that run past 180° may wrap round onto the first ones. + while (merged.length > 1 && merged[merged.length - 1][1] - 360 >= merged[0][0]) { + const last = merged.pop()!; + merged[0] = [last[0] - 360, Math.max(merged[0][1], last[1] - 360)]; + } + if (merged.length === 1) { + const [start, end] = merged[0]; + return end - start >= 360 ? [-180, 180] : start < -180 ? [start + 360, end + 360] : [start, end]; + } + let widest = -1; + let after = 0; + for (let i = 0; i < merged.length; i++) { + const next = merged[(i + 1) % merged.length]; + const gap = i + 1 < merged.length ? next[0] - merged[i][1] : next[0] + 360 - merged[i][1]; + if (gap > widest) [widest, after] = [gap, (i + 1) % merged.length]; + } + const west = merged[after][0]; + const before = merged[(after + merged.length - 1) % merged.length][1]; + return [west, before >= west ? before : before + 360]; +} + +/** The frame of the continents the data sits in, where every item has one and together they stand as a region. */ +function continentFrame(continents: readonly (Continent | undefined)[] | undefined): GeoBox | undefined { + if (!continents?.length || continents.some((continent) => continent === undefined)) return undefined; + let [w, s, e, n] = [Infinity, Infinity, -Infinity, -Infinity]; + for (const continent of new Set(continents as Continent[])) { + const [cw, cs, ce, cn] = CONTINENT_FRAMES[continent]; + [w, s, e, n] = [Math.min(w, cw), Math.min(s, cs), Math.max(e, ce), Math.max(n, cn)]; + } + return e - w > REGIONAL_SPAN[0] || n - s > REGIONAL_SPAN[1] ? undefined : [w, s, e, n]; +} + +/** + * A box as a GeoJSON feature a projection can fit: points along its edges, so the fit follows the + * box's curved outline in the projection rather than the great circles a polygon's edges would take. + */ +export function boxTarget(box: GeoBox): { type: 'Feature'; properties: Record; geometry: { type: 'MultiPoint'; coordinates: [number, number][] } } { + const [w, s, e, n] = box; + const coordinates: [number, number][] = []; + const steps = 24; + for (let i = 0; i <= steps; i++) { + const lon = w + ((e - w) * i) / steps; + const lat = s + ((n - s) * i) / steps; + coordinates.push([lon, s], [lon, n], [w, lat], [e, lat]); + } + return { type: 'Feature', properties: {}, geometry: { type: 'MultiPoint', coordinates } }; +} + +const PROJECTIONS: Record GeoProjection> = { + equalEarth: geoEqualEarth, + mercator: geoMercator, + orthographic: geoOrthographic, + stereographic: geoStereographic, + conicEqualArea: geoConicEqualArea, + conicEquidistant: geoConicEquidistant, + azimuthalEquidistant: geoAzimuthalEquidistant, + azimuthalEqualArea: geoAzimuthalEqualArea, + naturalEarth1: geoNaturalEarth1, + // Vega's Mollweide comes from an extension; Natural Earth's outline is close enough for the shape. + mollweide: geoNaturalEarth1, +}; + +/** The shapes a regional frame keeps to, as projected width over height: no flatter than a world map, no taller than a portrait page. */ +const REGIONAL_ASPECT: readonly [number, number] = [0.8, 2]; + +/** + * A regional frame widened, about its centre, until its projected shape falls within + * {@link REGIONAL_ASPECT}: a frame too flat gains latitude, one too tall gains longitude. + * Two points far apart east to west would otherwise frame a strip. + */ +export function shapedFrame(box: GeoBox, type: string, rotate?: readonly number[], parallels?: readonly [number, number]): GeoBox { + let [w, s, e, n] = box; + for (let pass = 0; pass < 4; pass++) { + const aspect = projectedAspect([w, s, e, n], type, rotate, parallels); + if (aspect > REGIONAL_ASPECT[1] * 1.01) { + const grow = ((n - s) * (aspect / REGIONAL_ASPECT[1] - 1)) / 2; + [s, n] = [Math.max(-89, s - grow), Math.min(89, n + grow)]; + } else if (aspect < REGIONAL_ASPECT[0] * 0.99) { + const grow = ((e - w) * (REGIONAL_ASPECT[0] / aspect - 1)) / 2; + // A frame across the antimeridian keeps running east; one inside the map stays inside it. + [w, e] = e > 180 ? [w - grow, e + grow] : [Math.max(-180, w - grow), Math.min(180, e + grow)]; + } else break; + } + return [w, s, e, n]; +} + +/** Width over height of a box as a projection draws it; the US frame's own shape for `albersUsa`. */ +export function projectedAspect(box: GeoBox, type: string, rotate?: readonly number[], parallels?: readonly [number, number]): number { + if (type === 'albersUsa') return US_FRAME_ASPECT; + const projection = (PROJECTIONS[type] ?? geoEqualEarth)(); + if (parallels && 'parallels' in projection) (projection as any).parallels(parallels); + if (rotate) projection.rotate([rotate[0] ?? 0, rotate[1] ?? 0, rotate[2] ?? 0]); + const [[x0, y0], [x1, y1]] = geoPath(projection).bounds(boxTarget(box) as any); + const width = x1 - x0; + const height = y1 - y0; + return width > 0 && height > 0 ? width / height : 2; +} + +/** A projection a frame is drawn in: its type, where it is turned to, and a conic's standard parallels. */ +export interface FrameProjection { + type: string; + rotate?: [number, number, number]; + parallels?: [number, number]; +} + +/** Within this many degrees of the equator a region is drawn in Equal Earth; past `POLAR_LATITUDE`, azimuthally. */ +const TROPICAL_LATITUDE = 15; +const POLAR_LATITUDE = 60; + +const tenth = (value: number): number => Math.round(value * 10) / 10 || 0; + +/** + * The projection a region reads truest in, centred on it, as an atlas draws a regional map: a + * conic equal-area for the middle latitudes, its standard parallels a sixth in from the frame's + * top and bottom (Japan, Europe, the US); Equal Earth turned to the region near the equator, where a + * cone flattens out; an azimuthal equal-area about a polar region. A world map's own projection, + * centred on 0°, shears a region far from its centre — Japan leans, Alaska sprawls. + */ +export function regionalProjection(box: GeoBox): FrameProjection { + const [w, s, e, n] = box; + const lon = (((w + e) / 2 + 180) % 360 + 360) % 360 - 180; + const lat = (s + n) / 2; + if (Math.abs(lat) >= POLAR_LATITUDE) return { type: 'azimuthalEqualArea', rotate: [tenth(-lon), tenth(-lat), 0] }; + if (Math.abs(lat) < TROPICAL_LATITUDE) return { type: 'equalEarth', rotate: [tenth(-lon), 0, 0] }; + const span = n - s; + return { type: 'conicEqualArea', rotate: [tenth(-lon), 0, 0], parallels: [tenth(s + span / 6), tenth(n - span / 6)] }; +} + +/** The us-atlas frame (975 × 610) the US maps are drawn in. */ +export const US_FRAME_ASPECT = 975 / 610; + +/** + * The rotation that turns a globe to face its data: the places' mean longitude (taken round the + * circle, so 170° and −170° average to 180°, not 0°) and their mean latitude, tilted no further than + * {@link MAX_FACING_TILT} — places spread round the northern hemisphere would otherwise turn the globe + * onto the pole. Undefined where there are none, or they spread evenly round the globe. + */ +export function facingRotation(places: readonly (readonly [number, number])[]): [number, number, number] | undefined { + if (places.length === 0) return undefined; + let east = 0; + let north = 0; + let lat = 0; + for (const [x, y] of places) { + east += Math.cos((x * Math.PI) / 180); + north += Math.sin((x * Math.PI) / 180); + lat += y; + } + if (Math.hypot(east, north) < 1e-9 * places.length) return undefined; + const lon = (Math.atan2(north, east) * 180) / Math.PI; + const tilt = Math.max(-MAX_FACING_TILT, Math.min(MAX_FACING_TILT, lat / places.length)); + const round = (value: number) => Math.round(value * 10) / 10 || 0; + return [round(-lon), round(-tilt), 0]; +} + +/** The furthest a globe tilts to face its data, in degrees of latitude. */ +const MAX_FACING_TILT = 60; + +/** + * A Vega expression, true where a place stands on the side of the globe that faces the viewer: + * the cosine of its angular distance from the centre the rotation faces is above zero (with a + * hair's margin, so a place on the rim does not flicker). `rotate` names a signal holding the + * projection's rotation in degrees. + */ +export function frontFacingExpr(lon: string, lat: string, rotate: string): string { + const rad = (degrees: string) => `(${degrees}) * PI / 180`; + const phi = rad(lat); + const phi0 = rad(`-${rotate}[1]`); + return `cos(${phi}) * cos(${phi0}) * cos(${rad(`${lon} + ${rotate}[0]`)}) + sin(${phi}) * sin(${phi0}) > 0.01`; +} + +/** + * The plot a map is drawn in: the largest of the frame's shape the room holds. A map has no data + * that presses for room, so it takes all the canvas leaves it. + */ +export function mapPlotSize(room: { width: number; height: number }, aspect: number): { width: number; height: number } { + const width = Math.min(room.width, room.height * aspect); + return { width: Math.max(1, Math.round(width)), height: Math.max(1, Math.round(width / aspect)) }; +} + +/** + * The US base map's states as `albersUsa` draws them at scale 1, about the origin: what Vega-Lite + * fits a US map to, worked out once from the bundled `states-10m` file. + */ +const US_STATES_BOUNDS: readonly [[number, number], [number, number]] = [[-0.41934, -0.224638], [0.361206, 0.231981]]; + +/** + * Where a map's points land in its plot, worked out as Vega will draw them: its projection (a + * Vega-Lite projection: type, rotation, parallels, and the shape it is fitted to) fitted to the + * plot's size. A projection fitted to nothing given is fitted as Vega-Lite fits it: the US to its + * states; a base map of the host's own, whose shapes are not known here, to `points` near enough. Undefined where the type is not one + * known here. A point a globe turns away returns undefined. + */ +export function planProjection( + projection: Record | undefined, size: readonly [number, number], points: readonly (readonly [number, number])[] = [], +): ((lonLat: readonly [number, number]) => [number, number] | undefined) | undefined { + const type = projection?.type ?? 'equalEarth'; + const make = type === 'albersUsa' ? geoAlbersUsa : PROJECTIONS[type]; + if (!make || !(size[0] > 0) || !(size[1] > 0)) return undefined; + const planned = make() as GeoProjection; + const rotate = Array.isArray(projection?.rotate) ? projection!.rotate.map(Number) : undefined; + if (rotate && 'rotate' in planned && type !== 'albersUsa') planned.rotate([rotate[0] ?? 0, rotate[1] ?? 0, rotate[2] ?? 0]); + if (Array.isArray(projection?.parallels) && 'parallels' in planned) (planned as any).parallels(projection!.parallels); + if (Array.isArray(projection?.center) && type !== 'albersUsa') planned.center([Number(projection!.center[0]), Number(projection!.center[1])]); + if (projection?.fit && typeof projection.fit === 'object') planned.fitSize([size[0], size[1]], projection.fit); + else if (type === 'albersUsa') { + // Fitted as d3 fits the states: scaled to the tighter side, centred. + const [[x0, y0], [x1, y1]] = US_STATES_BOUNDS; + const k = Math.min(size[0] / (x1 - x0), size[1] / (y1 - y0)); + planned.scale(k).translate([(size[0] - k * (x0 + x1)) / 2, (size[1] - k * (y0 + y1)) / 2]); + } else { + if (!points.length) return undefined; + planned.fitSize([size[0], size[1]], { type: 'MultiPoint', coordinates: points.map(([lon, lat]) => [lon, lat]) } as any); + } + const globe = type === 'orthographic'; + const facing: [number, number] = rotate ? [-(rotate[0] ?? 0), -(rotate[1] ?? 0)] : [0, 0]; + return (lonLat) => { + if (globe && geoDistance([lonLat[0], lonLat[1]], facing) > Math.PI / 2) return undefined; + const at = planned([lonLat[0], lonLat[1]]); + return at && Number.isFinite(at[0]) && Number.isFinite(at[1]) ? [at[0], at[1]] : undefined; + }; +} diff --git a/packages/flint-js/src/chart-types/geo.ts b/packages/flint-js/src/chart-types/geo.ts index 7429ff6e..65725cb9 100644 --- a/packages/flint-js/src/chart-types/geo.ts +++ b/packages/flint-js/src/chart-types/geo.ts @@ -249,6 +249,71 @@ export const resolveUsState: GeoResolver = (value) => resolveWith(US_STATE_LOOKU /** Resolve a country name / ISO alpha-2 / alpha-3 / numeric to its ISO numeric id. */ export const resolveCountry: GeoResolver = (value) => resolveWith(COUNTRY_LOOKUP, value); +// --------------------------------------------------------------------------- +// Declared key types — a choropleth's `keyType` says what its region key is, +// so the map skips guessing its region and reads the key in that namespace +// only: "CA" as an ISO 2 code is Canada, as a US state it is California. +// --------------------------------------------------------------------------- + +/** What a choropleth's region key holds. `auto` reads it as names, codes or ids and infers the map. */ +export const MAP_KEY_TYPES = ['auto', 'iso3', 'iso2', 'iso-numeric', 'country-name', 'us-state', 'fips'] as const; +export type MapKeyType = typeof MAP_KEY_TYPES[number]; + +const COUNTRY_BY_ALPHA2 = new Map(COUNTRIES.map(([id, , a2]) => [a2, id])); +const COUNTRY_BY_ALPHA3 = new Map(COUNTRIES.map(([id, , , a3]) => [a3, id])); +const COUNTRY_IDS = new Set(COUNTRIES.map(([id]) => id)); +COUNTRY_BY_ALPHA2.set('UK', 826); + +/** The map a declared key type draws, or undefined for `auto`. */ +export function keyTypeScope(keyType: unknown): MapScope | undefined { + if (keyType === 'us-state' || keyType === 'fips') return 'us'; + if (keyType === 'iso3' || keyType === 'iso2' || keyType === 'iso-numeric' || keyType === 'country-name') return 'world'; + return undefined; +} + +/** The resolver a declared key type reads its keys with; undefined for `auto` or an unknown type. */ +export function keyTypeResolver(keyType: unknown): GeoResolver | undefined { + const text = (value: unknown) => (value == null ? '' : String(value).trim()); + const digits = (value: unknown) => (/^\d+$/.test(text(value)) ? parseInt(text(value), 10) : undefined); + switch (keyType) { + case 'iso3': return (value) => COUNTRY_BY_ALPHA3.get(text(value).toUpperCase()); + case 'iso2': return (value) => COUNTRY_BY_ALPHA2.get(text(value).toUpperCase()); + case 'iso-numeric': return (value) => { + const id = digits(value); + return id !== undefined && COUNTRY_IDS.has(id) ? id : undefined; + }; + case 'country-name': return (value) => (digits(value) === undefined ? resolveCountry(value) : undefined); + case 'us-state': return (value) => (digits(value) === undefined ? resolveUsState(value) : undefined); + // A state's FIPS code runs 1–78, a county's five digits. + case 'fips': return (value) => digits(value); + default: return undefined; + } +} + +/** + * Groups of countries that statistics tables list beside the countries themselves — the world, + * income groups, blocs, continents and World Bank regions, by name or code. Such a row is not a + * typo to report as unmatched: no single region on the map is it. + */ +const AGGREGATE_REGIONS = new Set([ + 'world', 'oecd', 'oecdmembers', 'europeanunion', 'eu', 'eu27', 'eu28', 'euroarea', 'eurozone', 'g7', 'g20', + 'highincome', 'lowincome', 'middleincome', 'lowermiddleincome', 'uppermiddleincome', 'lowandmiddleincome', + 'highincomecountries', 'lowincomecountries', 'africa', 'asia', 'europe', 'oceania', 'americas', 'antarcticregion', + 'northamerica', 'southamerica', 'latinamerica', 'latinamericaandcaribbean', 'latinamericacaribbean', + 'subsaharanafrica', 'middleeast', 'middleeastandnorthafrica', 'middleeastnorthafrica', 'eastasiaandpacific', + 'eastasiapacific', 'southasia', 'europeandcentralasia', 'europecentralasia', 'arabworld', 'leastdevelopedcountries', + 'smallstates', 'fragileandconflictaffectedsituations', 'heavilyindebtedpoorcountries', 'idatotal', 'ibrdonly', + 'wld', 'oed', 'euu', 'emu', 'hic', 'lic', 'lmc', 'umc', 'mic', 'lmy', 'ssf', 'ssa', 'eas', 'eap', 'ecs', 'eca', + 'lcn', 'lac', 'mea', 'mna', 'nac', 'sas', 'arb', 'ldc', 'owid_wrl', +]); + +/** Whether a region key names a group of countries rather than one. */ +export function isAggregateRegion(value: unknown): boolean { + if (value == null) return false; + const key = norm(String(value)); + return AGGREGATE_REGIONS.has(key) || AGGREGATE_REGIONS.has(String(value).trim().toLowerCase()); +} + // --------------------------------------------------------------------------- // Code resolvers — for backends (Plotly) whose native geo traces key on a // short code rather than a TopoJSON numeric feature id. @@ -292,6 +357,13 @@ export const resolveUsStateCode: GeoCodeResolver = (value) => export const resolveCountryCode: GeoCodeResolver = (value) => resolveCodeWith(COUNTRY_LOOKUP, COUNTRY_ALPHA3_BY_ID, value); +const COUNTRY_ALPHA2_BY_ID = new Map(COUNTRIES.map(([id, , a2]) => [id, a2])); + +/** A country's ISO alpha-2 or alpha-3 code, from its ISO numeric id. */ +export function countryAlpha(id: number, form: 'iso2' | 'iso3'): string | undefined { + return (form === 'iso2' ? COUNTRY_ALPHA2_BY_ID : COUNTRY_ALPHA3_BY_ID).get(id); +} + // --------------------------------------------------------------------------- // Map scope inference (US vs World) — shared by every backend's Map / // Choropleth templates so "which base geography do we draw" is decided the @@ -335,6 +407,13 @@ const US_TERRITORY_FIPS = new Set([60, 66, 69, 72, 78]); */ export function inferChoroplethScope(rows: any[], idField?: string): MapScope { if (!idField) return 'us'; + // Named keys are weighed: the US map where US states are at least half of them and outnumber the + // keys that are only countries, so a total row ("United States") or a stray foreign key among + // states keeps the states' map, and is reported as unmatched there. + let named = 0; + let states = 0; + let countries = 0; + const seen = new Set(); for (const r of rows) { const v = r[idField]; if (v == null || v === '') continue; @@ -344,11 +423,14 @@ export function inferChoroplethScope(rows: any[], idField?: string): MapScope { if (n >= 57 && n <= 999 && !US_TERRITORY_FIPS.has(n)) return 'world'; continue; } - // A value that resolves as a US state (by name or USPS code) keeps us in the US; - // the first value that doesn't flips the whole map to world. - if (resolveUsState(v) === undefined) return 'world'; + if (seen.has(s)) continue; + seen.add(s); + named++; + if (resolveUsState(v) !== undefined) states++; + else if (resolveCountry(v) !== undefined) countries++; } - return 'us'; + if (named === 0) return 'us'; + return states >= named / 2 && states > countries ? 'us' : 'world'; } /** @@ -370,7 +452,7 @@ export function semanticScope(semType: string | undefined): MapScope | undefined : undefined; } -/** Honor an explicit `region` choice, else the id field's semantic type, else inference. */ +/** Honor an explicit `region` choice, else a declared `keyType`, else the id field's semantic type, else inference. */ export function pickMapScope( chartProperties: any, semScope: MapScope | undefined, @@ -378,6 +460,8 @@ export function pickMapScope( ): MapScope { const choice = chartProperties?.region; if (choice === 'us' || choice === 'world') return choice; + const declared = keyTypeScope(chartProperties?.keyType); + if (declared) return declared; if (semScope) return semScope; return infer(); } diff --git a/packages/flint-js/src/chart-types/map-routes.ts b/packages/flint-js/src/chart-types/map-routes.ts new file mode 100644 index 00000000..36d5b959 --- /dev/null +++ b/packages/flint-js/src/chart-types/map-routes.ts @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Routes on a map: the points of a `Map` joined in the order its `order` field gives, one route per + * series (`detail`, else a categorical `color`). The geometry is worked out here, in longitude and + * latitude, so every backend draws the same lines; where each line lands on screen is left to the + * renderer's projection, which a reader may pan, zoom or turn. + * + * A leg is drawn as one of three curves: + * - `great-circle`: the shortest way over the globe, the default on a globe; + * - `arc`: that great circle bowed a little to the left of travel, as flow maps draw their lines, so + * a leg out and the leg back part ways — the default for a route of stops on a flat map; + * - `straight`: a constant compass bearing (a rhumb line), straight on Mercator. + * A route with many legs is a track (a ship's log, a storm's path) rather than a list of stops: its + * legs follow great circles unbowed, and it carries one arrowhead, at its end. + */ + +import { geoBounds, geoDistance, geoInterpolate } from 'd3-geo'; +import type { ChartPropertyDef } from '../core/types'; + +export const ROUTE_CURVES = ['auto', 'arc', 'great-circle', 'straight'] as const; +export type RouteCurve = typeof ROUTE_CURVES[number]; + +type LonLat = [number, number]; + +/** A route of up to this many legs is a list of stops: its legs bow, each with an arrowhead. */ +export const STOP_LEGS_MAX = 24; + +/** How far a bowed leg stands off its great circle at the middle, as a share of the leg's length. */ +const BEND = 0.11; + +/** Where along a leg the arrowhead reads its heading from: just short of the end, so it follows the curve there. */ +const HEADING_FROM = 0.97; +/** Where a head stands on a leg placed at its middle: a little past it, as it reads pointing on. */ +const MIDDLE = 0.55; + +export interface RouteLeg { + /** The index, in the rows given, of the stop the leg leaves from. */ + from: number; + /** The index of the stop it arrives at. */ + to: number; + /** Its line, end to end, in longitude and latitude. */ + path: LonLat[]; + /** + * Points along its curve from its end back to its start, packed toward the end where its head + * sits: its length on screen is measured through them, and its head's base found among them. + */ + tail: LonLat[]; + /** It crosses the antimeridian, where a flat map cuts it in two. */ + cut: boolean; +} + +/** Where along a leg, as shares of it back from its end, its tail's points lie. */ +export const TAIL = [0, 0.02, 0.04, 0.07, 0.1, 0.14, 0.19, 0.25, 0.32, 0.4, 0.5, 0.62, 0.78, 1] as const; + +export interface Route { + /** The series value the route belongs to; undefined for a map of one route. */ + series: unknown; + /** The stops in order. */ + stops: LonLat[]; + /** The line through them, leg after leg, in longitude and latitude. */ + path: LonLat[]; + /** Its legs in order, each joining two stops. */ + legs: RouteLeg[]; +} + +export interface RouteArrow { + series: unknown; + /** The index, in the rows given, of the stop the arrow's leg leaves from. */ + from: number; + /** The leg it heads. */ + leg: RouteLeg; + /** + * Points back along the line from the tip, nearest first: the leg's tail, or on a track its last + * fixes. The head's base is the first of them a head's length from the tip on screen. + */ + tail: LonLat[]; + /** It heads a track: the end of many short legs, which the line before them leads into. */ + track: boolean; + /** The stop the leg arrives at. */ + tip: LonLat; + /** A point just before it on the leg: the arrowhead points from here to the tip. */ + base: LonLat; +} + +export interface RouteOptions { + longitude: string; + latitude: string; + order: string; + /** The field rows are split into routes by. */ + series?: string; + curve?: unknown; + globe?: boolean; +} + +const finite = (value: unknown): number | undefined => { + const number = typeof value === 'number' ? value : typeof value === 'string' && value.trim() !== '' ? Number(value) : NaN; + return Number.isFinite(number) ? number : undefined; +}; + +/** A sort key per row for the order field: numbers by value, dates by time, any other text as it reads (numbers within it by value). */ +function orderKeys(values: readonly unknown[]): (a: number, b: number) => number { + const present = values.filter((value) => value != null && value !== ''); + if (present.length && present.every((value) => finite(value) !== undefined)) { + const keys = values.map((value) => finite(value) ?? Infinity); + return (a, b) => keys[a] - keys[b]; + } + const times = values.map((value) => (value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : NaN)); + if (present.length && present.every((value) => { + const time = value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : NaN; + return Number.isFinite(time); + })) return (a, b) => (Number.isFinite(times[a]) ? times[a] : Infinity) - (Number.isFinite(times[b]) ? times[b] : Infinity); + const text = values.map((value) => (value == null ? '' : String(value))); + return (a, b) => text[a].localeCompare(text[b], undefined, { numeric: true }); +} + +/** The curve a route's legs follow: the caller's, else a great circle on a globe or along a track, an arc between stops. */ +export function routeCurve(curve: unknown, globe: boolean, legs: number): Exclude { + if (curve === 'arc' || curve === 'great-circle' || curve === 'straight') return curve; + return globe || legs > STOP_LEGS_MAX ? 'great-circle' : 'arc'; +} + +/** Longitude difference the short way round, in degrees. */ +const lonDelta = (from: number, to: number) => ((to - from + 540) % 360) - 180; + +/** The point a fraction `t` along a leg, on its curve. */ +export function legPoint(from: LonLat, to: LonLat, curve: Exclude): (t: number) => LonLat { + if (curve === 'straight') { + const dLon = lonDelta(from[0], to[0]); + return (t) => [from[0] + dLon * t, from[1] + (to[1] - from[1]) * t]; + } + const along = geoInterpolate(from, to); + if (curve === 'great-circle') return (t) => along(t) as LonLat; + // Bowed to the left of travel in a frame where a degree of longitude is as long as it is on + // the ground at the leg's middle latitude, so the bow keeps its shape away from the equator. + const mid = (from[1] + to[1]) / 2; + const squeeze = Math.max(0.2, Math.cos((mid * Math.PI) / 180)); + const dx = lonDelta(from[0], to[0]) * squeeze; + const dy = to[1] - from[1]; + return (t) => { + const [lon, lat] = along(t) as LonLat; + const k = 4 * t * (1 - t) * BEND; + return [lon - (dy * k) / squeeze, Math.max(-89.9, Math.min(89.9, lat + dx * k))]; + }; +} + +/** The vertices a leg is drawn through: its ends, and enough between for its curve to read smooth. */ +function legPath(from: LonLat, to: LonLat, curve: Exclude): LonLat[] { + // A great circle needs no vertices between its ends: d3-geo draws the arc between any two. + if (curve === 'great-circle') return [from, to]; + const degrees = (geoDistance(from, to) * 180) / Math.PI; + const steps = curve === 'arc' ? 24 : Math.max(1, Math.min(64, Math.ceil(degrees / 2))); + const at = legPoint(from, to, curve); + return Array.from({ length: steps + 1 }, (_, i) => (i === 0 ? from : i === steps ? to : at(i / steps))); +} + +/** The routes a table's rows make: per series, its placed rows in order, joined leg by leg. */ +export function buildRoutes(rows: readonly Record[], options: RouteOptions): Route[] { + const groups = new Map(); + const order = rows.map((row) => row?.[options.order]); + rows.forEach((row, index) => { + const lon = finite(row?.[options.longitude]); + const lat = finite(row?.[options.latitude]); + if (lon === undefined || lat === undefined || Math.abs(lat) > 90 || Math.abs(lon) > 180) return; + if (order[index] == null || order[index] === '') return; + const key = options.series ? row?.[options.series] : undefined; + const members = groups.get(key) ?? []; + members.push(index); + groups.set(key, members); + }); + const compare = orderKeys(order); + const routes: Route[] = []; + for (const [series, members] of groups) { + const order = members.slice().sort((a, b) => compare(a, b) || a - b); + const stops = order.map((index) => [finite(rows[index][options.longitude])!, finite(rows[index][options.latitude])!] as LonLat); + if (stops.length < 2) continue; + const curve = routeCurve(options.curve, options.globe === true, stops.length - 1); + const path: LonLat[] = [stops[0]]; + const legs: RouteLeg[] = []; + for (let i = 1; i < stops.length; i++) { + const leg = legPath(stops[i - 1], stops[i], curve); + const along = legPoint(stops[i - 1], stops[i], curve); + const tail = TAIL.map((back) => (back === 0 ? stops[i] : back === 1 ? stops[i - 1] : along(1 - back))); + const cut = tail.slice(1).some(([lon], k) => Math.abs(lon - tail[k][0]) > 180); + legs.push({ from: order[i - 1], to: order[i], path: leg, tail, cut }); + path.push(...leg.slice(1)); + } + routes.push({ series, stops, path, legs }); + } + return routes; +} + +/** + * Whether a route map draws a dot at every stop: where its points carry something its routes do not — + * a `size`, a `shape`, a `text` label (the dot its anchor), or a colour the lines do not take (a + * quantity's). Otherwise the routes say it all, and only each route's first stop takes a dot, where + * no arrowhead marks it. Any other dot is the author's to draw, as an update layer of its own. + */ +export function routeDotsEverywhere(carried: { size?: boolean; shape?: boolean; text?: boolean; pointColor?: boolean }): boolean { + return Boolean(carried.size || carried.shape || carried.text || carried.pointColor); +} + +/** The rows that take a dot where the routes say it all: each route's first stop, and every point no route passes through. */ +export function routeStartRows(routes: readonly Route[], rowCount: number): number[] { + const routed = new Set(routes.flatMap((route) => route.legs.flatMap((leg) => [leg.from, leg.to]))); + const starts = routes.map((route) => route.legs[0].from); + return [...starts, ...Array.from({ length: rowCount }, (_, row) => row).filter((row) => !routed.has(row))]; +} + +/** A stop's dot radius in px: one for every stop by default, kept between these. */ +export const STOP_RADIUS = { min: 2.5, max: 4 } as const; +/** A stop's dot radius by a measure (`size`): zero-based by area, between these. */ +export const STOP_RADIUS_BY_VALUE = { min: 2.5, max: 7 } as const; + +/** + * Each stop's dot radius in px, for every backend alike. Stops are places, not values: by default + * every dot is one size, from the routes' median width (`widths`, px) — half of it and a pixel, kept + * between 2.5 and 4 px. A `size` field sizes each dot by its row's value, zero-based by area from 2.5 + * to 7 px (`byValue`: the largest value, the scale's top). + */ +export function stopRadii( + sizeField: string | undefined, + rows: readonly Record[], + widths: readonly number[], +): { radius(row: number): number; byValue?: { max: number } } { + if (sizeField) { + const max = largestMagnitude(rows.map((row) => row[sizeField])) || 1; + const [low, high] = [(2 * STOP_RADIUS_BY_VALUE.min) ** 2, (2 * STOP_RADIUS_BY_VALUE.max) ** 2]; + return { + radius: (row) => { + const value = Math.abs(Number(rows[row]?.[sizeField])); + return Math.sqrt(low + (high - low) * Math.min(1, Number.isFinite(value) ? value / max : 0)) / 2; + }, + byValue: { max }, + }; + } + const sorted = [...widths].sort((a, b) => a - b); + const median = sorted.length ? sorted[Math.floor((sorted.length - 1) / 2)] : ROUTE_WIDTH.plain; + const radius = Math.min(STOP_RADIUS.max, Math.max(STOP_RADIUS.min, median / 2 + 1)); + return { radius: () => radius }; +} + +/** + * Where a route's arrowheads stand: on every leg of a route of stops, on the last leg of a track + * only — its tip at the leg's end, or at its middle (`at: 'middle'`) for a renderer whose head is a + * marker centred on its point, which cannot set its tip on the stop. A leg that returns to where it + * began has no heading and takes none. + */ +export function routeArrows(routes: readonly Route[], curve: unknown, globe: boolean, at: 'end' | 'middle' = 'end'): RouteArrow[] { + const arrows: RouteArrow[] = []; + for (const route of routes) { + const legs = route.stops.length - 1; + const shape = routeCurve(curve, globe, legs); + const from = legs > STOP_LEGS_MAX ? legs : 1; + for (let leg = from; leg <= legs; leg++) { + const a = route.stops[leg - 1]; + const b = route.stops[leg]; + if (geoDistance(a, b) === 0) continue; + const along = legPoint(a, b, shape); + const own = route.legs[leg - 1]; + const track = legs > STOP_LEGS_MAX; + // A track's last leg is too short to say which way it runs: its head reads the fixes before. + const tail = track ? route.stops.slice(Math.max(0, legs + 1 - TAIL.length), legs + 1).reverse() : own.tail; + arrows.push(at === 'end' + ? { series: route.series, from: own.from, leg: own, tip: b, base: along(HEADING_FROM), tail, track } + : { series: route.series, from: own.from, leg: own, tip: along(MIDDLE), base: along(MIDDLE - (1 - HEADING_FROM)), tail: [], track }); + } + } + return arrows; +} + +/** The compass bearing from one point to another, in degrees clockwise from north. */ +export function bearing(from: LonLat, to: LonLat): number { + const rad = Math.PI / 180; + const [l1, p1] = [from[0] * rad, from[1] * rad]; + const [l2, p2] = [to[0] * rad, to[1] * rad]; + const y = Math.sin(l2 - l1) * Math.cos(p2); + const x = Math.cos(p1) * Math.sin(p2) - Math.sin(p1) * Math.cos(p2) * Math.cos(l2 - l1); + return ((Math.atan2(y, x) / rad) + 360) % 360; +} + +/** A route's width range in px, as Data Formulator draws flows: the widest leg at the most, from zero. */ +export const ROUTE_WIDTH = { min: 1, max: 8, plain: 1.75 } as const; + +/** + * Each leg's width in px from the value its row gives: zero-based, linear, `max` (by default the + * largest value given) the widest, at `widest` px. + */ +export function legWidths(values: readonly unknown[], max = largestMagnitude(values), widest: number = ROUTE_WIDTH.max): number[] { + const numbers = values.map((value) => (value === null || value === '' ? NaN : Number(value))); + return numbers.map((value) => (Number.isFinite(value) && max > 0 + ? ROUTE_WIDTH.min + (widest - ROUTE_WIDTH.min) * Math.min(1, Math.abs(value) / max) + : ROUTE_WIDTH.min)); +} + +/** The share of the plot a map's widened legs may cover: their lengths on screen times their widths. */ +const LEG_COVERAGE = 0.06; +/** The widest leg never thins below this share of `ROUTE_WIDTH.max`, or widths stop reading. */ +const LEG_FLOOR = 0.4; + +/** + * The widest leg's width in px, as Data Formulator fits its flows: the legs' lengths on screen times + * their widths cover about 6% of the plot (`plotSide`, the side of a square of its area), so a map + * crowded with long legs draws thinner ones than a map of a few — never wider than `ROUTE_WIDTH.max` + * nor below 40% of it. A leg's length on screen is read as its length over the extent of every leg's + * ends, which the map is fitted to. + */ +export function widestLeg(legs: readonly RouteLeg[], values: readonly unknown[], plotSide: number): number { + const max = largestMagnitude(values); + const all = legs.flatMap((leg) => [leg.path[0], leg.path[leg.path.length - 1]]); + if (!max || !(plotSide > 0) || all.length < 2) return ROUTE_WIDTH.max; + const extent = geoDistance(...(geoBounds({ type: 'MultiPoint', coordinates: all } as any) as [LonLat, LonLat])); + if (!(extent > 0)) return ROUTE_WIDTH.max; + let ink = 0; + legs.forEach((leg, index) => { + const value = Math.abs(Number(values[index])); + if (!Number.isFinite(value)) return; + let length = 0; + for (let k = 1; k < leg.path.length; k++) length += geoDistance(leg.path[k - 1], leg.path[k]); + ink += (value / max) * Math.min(1.5, length / extent); + }); + if (!ink) return ROUTE_WIDTH.max; + return Math.max(LEG_FLOOR * ROUTE_WIDTH.max, Math.min(ROUTE_WIDTH.max, (LEG_COVERAGE * plotSide) / ink)); +} + +/** The largest magnitude among values that are numbers; 0 where none is. */ +export function largestMagnitude(values: readonly unknown[]): number { + return Math.max(0, ...values.map((value) => (value === null || value === '' ? NaN : Math.abs(Number(value)))).filter(Number.isFinite)); +} + +/** + * An arrowhead fitted to its line, as Data Formulator draws one: its length and half-width each grow + * with the line's width, so a hairline takes a slim small head and a broad line a broad one (to 22 px + * long) — not one fixed shape. + */ +export function headSize(width: number): { length: number; halfWidth: number } { + const w = Math.max(0, width); + return { length: Math.min(22, 4 + 2.6 * w), halfWidth: Math.min(12, 1 + 1.1 * w) }; +} + +/** How opaque routes are drawn: nearly solid, fading only once a map carries many (Data Formulator's flow maps). */ +export function routeOpacity(count: number): number { + return Math.max(0.55, Math.min(0.92, 0.92 - 0.11 * Math.log2(Math.max(1, count / 12)))); +} + +/** How a point map joins its points into routes, offered where an `order` field gives their sequence. */ +export const routeProperties: ChartPropertyDef[] = [ + { + key: 'arrows', label: 'Arrows', type: 'binary', defaultValue: true, + check: (ctx) => ({ applicable: Boolean(ctx.encodings?.order?.field) }), + }, + { + key: 'curve', + label: 'Route curve', + type: 'discrete', + options: [ + { value: 'auto', label: 'Auto: arcs between stops, great circles on a globe or along a track' }, + { value: 'arc', label: 'Arcs, bowed left of travel' }, + { value: 'great-circle', label: 'Great circles' }, + { value: 'straight', label: 'Straight (constant bearing)' }, + ] satisfies { value: typeof ROUTE_CURVES[number]; label: string }[], + defaultValue: 'auto', + check: (ctx) => ({ applicable: Boolean(ctx.encodings?.order?.field) }), + }, +]; diff --git a/packages/flint-js/src/chart-types/world-bank-ids.ts b/packages/flint-js/src/chart-types/world-bank-ids.ts new file mode 100644 index 00000000..208dc077 --- /dev/null +++ b/packages/flint-js/src/chart-types/world-bank-ids.ts @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Generated by scripts/build-world-bank.mjs. Do not edit. + +/** The ISO 3166-1 numeric ids the World Bank world map draws (Kosovo and Clipperton, which have none, aside). */ +export const WORLD_BANK_IDS: ReadonlySet = new Set([4, 8, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, 124, 132, 136, 140, 144, 148, 152, 156, 162, 166, 170, 174, 178, 180, 184, 188, 191, 192, 196, 203, 204, 208, 212, 214, 218, 222, 226, 231, 232, 233, 234, 238, 239, 242, 246, 248, 250, 258, 260, 262, 266, 268, 270, 275, 276, 288, 292, 296, 300, 304, 308, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 398, 400, 404, 408, 410, 414, 417, 418, 422, 426, 428, 430, 434, 438, 440, 442, 446, 450, 454, 458, 462, 466, 470, 478, 480, 484, 492, 496, 498, 499, 500, 504, 508, 512, 516, 520, 524, 528, 531, 533, 534, 535, 540, 548, 554, 558, 562, 566, 570, 574, 578, 580, 581, 583, 584, 585, 586, 591, 598, 600, 604, 608, 612, 616, 620, 624, 626, 630, 634, 642, 643, 646, 652, 654, 659, 660, 662, 663, 666, 670, 674, 678, 682, 686, 688, 690, 694, 702, 703, 704, 705, 706, 710, 716, 724, 728, 729, 732, 740, 744, 748, 752, 756, 760, 762, 764, 768, 772, 776, 780, 784, 788, 792, 795, 796, 798, 800, 804, 807, 818, 826, 831, 832, 833, 834, 840, 850, 854, 858, 860, 862, 876, 882, 887, 894]); + +/** [id, west, south, east, north] of each body (scripts/lib/country-body.mjs) the Natural Earth bounds table lacks: the territories it leaves out. */ +export const WORLD_BANK_EXTRA_BOUNDS: ReadonlyArray = [ + [16, -170.8, -14.4, -170.7, -14.2], + [20, 1.4, 42.4, 1.7, 42.6], + [28, -61.8, 17, -61.7, 17.2], + [48, 50.3, 26.1, 50.6, 26.2], + [52, -59.6, 13.1, -59.4, 13.3], + [60, -64.8, 32.3, -64.7, 32.3], + [74, 3.3, -54.5, 3.4, -54.4], + [86, 72.4, -7.3, 72.4, -7.3], + [92, -64.7, 18.4, -64.6, 18.5], + [132, -23.8, 15, -23.5, 15.3], + [136, -81.3, 19.3, -81.1, 19.4], + [162, 105.6, -10.5, 105.7, -10.4], + [166, 96.8, -12.2, 96.8, -12.2], + [174, 43.3, -11.9, 43.5, -11.4], + [184, -159.8, -21.3, -159.7, -21.2], + [212, -61.5, 15.2, -61.2, 15.6], + [234, -7.3, 62, -6.8, 62.3], + [239, -37.9, -54.9, -35.8, -54], + [248, 19.5, 60.1, 20.1, 60.4], + [258, -149.6, -17.8, -149.3, -17.5], + [292, -5.4, 36.1, -5.3, 36.2], + [296, -157.4, 1.7, -157.2, 1.9], + [308, -61.8, 12, -61.6, 12.2], + [316, 144.7, 13.4, 144.9, 13.6], + [334, 73.3, -53.2, 73.6, -53], + [336, 12.4, 41.9, 12.5, 41.9], + [344, 113.9, 22.3, 114.2, 22.5], + [438, 9.5, 47.1, 9.6, 47.3], + [446, 113.5, 22.1, 113.6, 22.2], + [462, 73.1, -0.7, 73.1, -0.6], + [470, 14.3, 35.8, 14.6, 35.9], + [480, 57.4, -20.5, 57.8, -20], + [492, 7.4, 43.7, 7.4, 43.7], + [500, -62.2, 16.7, -62.1, 16.8], + [520, 166.9, -0.6, 166.9, -0.5], + [531, -69.1, 12, -68.8, 12.2], + [533, -70.1, 12.4, -69.9, 12.6], + [534, -63.1, 18, -63, 18.1], + [535, -68.4, 12.2, -68.2, 12.3], + [570, -169.9, -19.1, -169.8, -19], + [574, 167.9, -29.1, 168, -29], + [580, 145.7, 15.1, 145.8, 15.2], + [581, 166.6, 19.3, 166.7, 19.3], + [583, 158.2, 6.8, 158.3, 7], + [584, 171, 7.1, 171.1, 7.2], + [585, 134.5, 7.4, 134.6, 7.7], + [612, -128.4, -24.4, -128.3, -24.3], + [652, -62.8, 17.9, -62.8, 17.9], + [654, -5.8, -16, -5.6, -15.9], + [659, -62.8, 17.3, -62.7, 17.4], + [660, -63.1, 18.2, -63, 18.3], + [662, -61.1, 13.8, -60.9, 14], + [663, -63.1, 18, -63, 18.1], + [666, -56.4, 46.9, -56.3, 47.1], + [670, -61.3, 13.1, -61.1, 13.4], + [674, 12.4, 43.9, 12.5, 44], + [678, 6.5, 0, 6.8, 0.4], + [690, 55.5, -4.7, 55.5, -4.6], + [702, 103.6, 1.2, 104, 1.5], + [744, 10.7, 76.6, 27, 80.3], + [772, -171.8, -9.2, -171.8, -9.2], + [776, -175.3, -21.2, -175.2, -21.1], + [796, -71.8, 21.8, -71.6, 21.8], + [798, 178.4, -8.1, 178.4, -8], + [831, -2.6, 49.4, -2.5, 49.5], + [832, -2.2, 49.2, -2, 49.3], + [833, -4.7, 54.1, -4.3, 54.4], + [850, -64.9, 17.7, -64.7, 17.8], + [876, -176.2, -13.3, -176.2, -13.2], + [882, -172.6, -13.8, -172.2, -13.5], +]; diff --git a/packages/flint-js/src/chartjs/assemble.ts b/packages/flint-js/src/chartjs/assemble.ts index 06c2afc6..4c799ac6 100644 --- a/packages/flint-js/src/chartjs/assemble.ts +++ b/packages/flint-js/src/chartjs/assemble.ts @@ -23,6 +23,7 @@ * This module has NO React, Redux, or UI framework dependencies. */ +import { noteSpecUpdates } from '../core/spec-updates'; import { withEncodingColorAnnotations } from '../core/color-controls'; import { ChartEncoding, @@ -38,9 +39,13 @@ import { applyAggregation, resolveImplicitAggregation } from '../core/aggregate' import { applyPivot, applyTransform, type PivotSurface, type TransformSurface } from '../core/pivot'; import { cjsGetTemplateDef } from './templates'; import { resolveChannelSemantics, convertTemporalData, repairEncodingSorts } from '../core/resolve-semantics'; -import { computeZeroDecision } from '../core/semantic-types'; +import { computeZeroDecision, zeroMarkType } from '../core/semantic-types'; import { filterOverflow } from '../core/filter-overflow'; -import { computeLayout, computeChannelBudgets, deriveStretchCaps, resolveBaseSize, resolveFacetColumnsOption } from '../core/compute-layout'; +import { computeLayout, computeChannelBudgets, deriveStretchCaps, planBandLabels, resolveBaseSize, resolveFacetColumnsOption } from '../core/compute-layout'; +import { xLabelOverflow } from '../core/plan'; +import { tableTextMeasurer } from '../core/text-width'; +import { BACKEND_MIN_LABEL_SIZE, canvasFitSummary, fitBox, judgeBackendCanvas, refitCanvas, withTreatment } from '../core/backend-frame'; +import { CJS_FONT, cjsFitFrame } from './frame'; import { decideColorMaps } from '../core/color-decisions'; import { cjsApplyLayoutToSpec, cjsApplyTooltips } from './instantiate-spec'; import { normalizeStaticSeries } from '../core/static-series'; @@ -163,7 +168,7 @@ export function assembleChartjs(input: ChartAssemblyInput): any { ); // Finalize zero-baseline (requires template mark knowledge) - const effectiveMarkType = templateMarkType || 'point'; + const effectiveMarkType = zeroMarkType(chartTemplate.chart, templateMarkType); for (const [channel, cs] of Object.entries(channelSemantics)) { if ((channel === 'x' || channel === 'y') && cs.type === 'quantitative') { const numericValues = data @@ -287,6 +292,19 @@ export function assembleChartjs(input: ChartAssemblyInput): any { }), }; + // Names along a banded axis are wrapped, turned, thinned or cut as the layout decides them for + // every backend, measured in Chart.js' type, before the template sizes its bands. + const labelsBefore = { x: JSON.stringify(layoutResult.xLabel), y: JSON.stringify(layoutResult.yLabel) }; + planBandLabels(instantiateContext, { + measure: (fontSize) => tableTextMeasurer(fontSize, CJS_FONT, 'normal', 'normal'), + minFontSize: BACKEND_MIN_LABEL_SIZE, + ...xLabelOverflow(undefined, chartProperties, channelSemantics), + }); + const plannedLabels = { + x: JSON.stringify(layoutResult.xLabel) !== labelsBefore.x, + y: JSON.stringify(layoutResult.yLabel) !== labelsBefore.y, + }; + const colField = channelSemantics.column?.field; const rowField = channelSemantics.row?.field; const hasFacet = !!(colField || rowField); @@ -375,6 +393,7 @@ export function assembleChartjs(input: ChartAssemblyInput): any { position: 'right', }; cjsApplyLayoutToSpec(panelConfig, panelContext, []); + delete panelConfig._plot; if (addTooltipsOpt) cjsApplyTooltips(panelConfig); if (chartTemplate.postProcess) chartTemplate.postProcess(panelConfig, panelContext); @@ -458,6 +477,23 @@ export function assembleChartjs(input: ChartAssemblyInput): any { cjsConfig._viewports = overflowResult.viewports; } + // Names are printed as the reader sees them before the frame measures them. + applyFieldDisplayNames(cjsConfig, input.field_display_names); + + // The frame: title broken over its block, scale gutters and titles measured, the legend placed. + // A facet grid is composed by the host, which draws no title of its own yet. + if (!(hasFacet && hasAxes)) { + const frame = cjsFitFrame(cjsConfig, instantiateContext, { title: input.chart_spec.title, subtitle: input.chart_spec.subtitle }, plannedLabels, + fitBox(baseSize, sizeCeiling, options.maxStretch).width); + // The canvas fit: where the host would shrink the drawing past legibility to enter its box, + // the plot is laid out smaller once instead, as the plan does for Vega-Lite. + const box = fitBox(baseSize, sizeCeiling, options.maxStretch); + const judged = judgeBackendCanvas({ plot: frame.plot, designed: frame.designed, parts: frame.parts, padding: 0, box, base: baseSize }); + const refit = refitCanvas(judged, options, (treatment) => assembleChartjs(withTreatment(input, treatment, box))); + if (refit) return refit; + cjsConfig._canvasFit = canvasFitSummary(judged.estimate, box, options.canvasTreatment); + } + cjsConfig._dataLength = values.length; if (transformed.surface) { @@ -470,9 +506,7 @@ export function assembleChartjs(input: ChartAssemblyInput): any { cjsConfig._pivot = legacyPivot.surface; } - applyFieldDisplayNames(cjsConfig, input.field_display_names); - - return cjsConfig; + return noteSpecUpdates(cjsConfig, input); } /** Inspect the Chart.js legacy (composed) view transformation surface for an input. */ diff --git a/packages/flint-js/src/chartjs/frame.ts b/packages/flint-js/src/chartjs/frame.ts new file mode 100644 index 00000000..e0f2d11c --- /dev/null +++ b/packages/flint-js/src/chartjs/frame.ts @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The frame around a Chart.js chart: its title and subtitle, the room its scales' labels and titles + * take, and its legend, measured the way the layout measures Vega-Lite's but drawn in Chart.js' own + * idiom: the title and subtitle plugins centred over the canvas in Chart.js' type (12 px, bold over + * normal), lines given as arrays, a legend whose long names stand on lines in a column beside the plot + * or, where they will not, a row at the foot with the names cut. + * + * Chart.js lays its boxes out inside the canvas it is given, so the plot keeps the size the layout + * planned only if the canvas (`_width`, `_height`) is the plot plus what Chart.js will set around it; + * that is what this measures. + */ + +import type { InstantiateContext } from '../core/types'; +import type { LabelSizingDecision } from '../core/decisions'; +import type { ReservePart } from '../core/furniture-reserve'; +import { tableTextMeasurer } from '../core/text-width'; +import { fitAxisTitle } from '../core/axis-title-fit'; +import { planKeyLayout, type KeyToLayout } from '../core/legend-layout'; +import { plotHeightAfter } from '../core/title-fit'; +import { denseLineWidth, linesPerPanel } from '../core/line-density'; +import { keyBlock, keyPlanStyle } from '../core/backend-profile'; +import { CJS_FONT, cjsKeyGeometry } from './profile'; +import { cutToWidth, onNiceTick, planTitleBlock, treatedKeyEdge, treatedKeyFontSize, treatedKeySide, valueTickLabels, widestLine, type BackendTextStyle, type TitleBlock } from '../core/backend-frame'; + +export { CJS_FONT }; +const FONT = CJS_FONT; + +/** Chart.js' own title plugins: a 12 px bold headline over a 12 px deck, both centred, 10 px around. */ +export const CJS_TITLE = { + padding: 10, + gap: 4, + headline: { fontSize: 12, fontWeight: 'bold', font: FONT, lineHeight: 1.2 } as BackendTextStyle, + deck: { fontSize: 12, fontWeight: 'normal', font: FONT, lineHeight: 1.2 } as BackendTextStyle, +}; + +/** Chart.js' tick length and the padding between a tick and its label. */ +const TICK = 8; +const TICK_PADDING = 3; +/** Chart.js' padding around a scale title, above and below. */ +const SCALE_TITLE_PADDING = 8; +/** Room at the plot's far end for the last tick label's overhang. */ +const END_ROOM = 12; +/** The gutter kept for a legend the template writes itself, as the layout pass keeps it. */ +const STATED_LEGEND = 96; +/** Chart.js' line width, which a line dataset draws where it sets none. */ +const CJS_LINE_WIDTH = 3; + +export interface CJSFrame { + plot: { width: number; height: number }; + designed: { width: number; height: number }; + parts: Partial>; + title?: TitleBlock; +} + +const measure = (fontSize: number, weight: string | number = 'normal') => tableTextMeasurer(fontSize, FONT, weight, 'normal'); + +const fontSizeOf = (font: any, fallback = 12): number => (typeof font?.size === 'number' ? font.size : fallback); + +/** The scale that runs names in bands (Chart.js' category scale), and the values it names. */ +function categoryValues(config: any, scale: any, channel: 'x' | 'y'): string[] | undefined { + const type = scale?.type ?? (channel === (config.options?.indexAxis === 'y' ? 'y' : 'x') ? 'category' : 'linear'); + if (type !== 'category') return undefined; + const labels = scale.labels ?? config.data?.labels; + return Array.isArray(labels) ? labels.map((label: unknown) => String(label)) : undefined; +} + +/** Each category's lines as the scale prints them, from the layout's decision, cut at its limit. */ +function bandTexts(values: string[], sizing: LabelSizingDecision, fontSize: number): Map { + const widthOf = measure(fontSize); + const lines = new Map((sizing.labelValues ?? []).map((value, index) => [value, sizing.labelLines?.[index]])); + const limit = sizing.labelLimit > 0 && sizing.labelForm !== 'calendar' ? sizing.labelLimit : undefined; + return new Map(values.map((value) => [value, (lines.get(value) ?? [value]).map((line) => cutToWidth(line, limit, widthOf))])); +} + +/** Write the layout's band-label decision in Chart.js' terms: a tick callback giving lines, the rotation pinned. */ +function realizeBandLabels(config: any, scale: any, channel: 'x' | 'y', sizing: LabelSizingDecision): void { + const values = categoryValues(config, scale, channel); + if (!values) return; + const ticks = (scale.ticks ??= {}); + if (sizing.fontSize) ticks.font = { ...(ticks.font ?? {}), size: sizing.fontSize }; + const texts = bandTexts(values, sizing, fontSizeOf(ticks.font)); + const shown = channel === 'x' && sizing.overflow?.step === 'skip' && sizing.overflow.shown ? new Set(sizing.overflow.shown) : undefined; + // A callback only where the names print otherwise than as written, so a plain config stays JSON. + const rewritten = Boolean(shown) || [...texts].some(([value, lines]) => lines.length !== 1 || lines[0] !== value); + if (rewritten) { + ticks.callback = function (this: any, value: number | string) { + const label = typeof this?.getLabelForValue === 'function' ? String(this.getLabelForValue(value)) : String(value); + if (shown && !shown.has(label)) return null; + const lines = texts.get(label) ?? [label]; + return lines.length > 1 ? lines : lines[0]; + }; + } else if (ticks.callback?._flintCalendar) { + delete ticks.callback; + ticks.minRotation = 0; + ticks.maxRotation = 0; + } + ticks.autoSkip = false; + if (channel === 'x') { + const angle = Math.abs(sizing.labelAngle ?? 0); + ticks.minRotation = angle; + ticks.maxRotation = angle; + } +} + +/** The numbers a value scale spans, from its datasets: stacked datasets summed. */ +function datasetExtent(config: any, channel: 'x' | 'y', stacked: boolean): [number, number] | undefined { + let lo = Infinity; + let hi = -Infinity; + const sums: number[] = []; + for (const dataset of config.data?.datasets ?? []) { + (dataset?.data ?? []).forEach((item: any, i: number) => { + const raw = item && typeof item === 'object' ? item[channel] : item; + const value = Array.isArray(raw) ? raw[1] : raw; + if (typeof value !== 'number' || !Number.isFinite(value)) return; + lo = Math.min(lo, value); + hi = Math.max(hi, value); + if (stacked) sums[i] = (sums[i] ?? 0) + value; + }); + } + for (const sum of sums) if (sum !== undefined) { lo = Math.min(lo, sum); hi = Math.max(hi, sum); } + return Number.isFinite(lo) ? [lo, hi] : undefined; +} + +/** The labels a scale prints, as lines, for measuring. */ +function printedLabels(config: any, scale: any, channel: 'x' | 'y'): string[][] { + if (!scale || scale.display === false || scale.ticks?.display === false) return []; + const callback = scale.ticks?.callback; + const format = (value: unknown, index = 0): string[] => { + if (typeof callback === 'function') { + try { + const out = callback.call({ getLabelForValue: (v: unknown) => v }, value, index, []); + if (out == null) return []; + return Array.isArray(out) ? out.map(String) : [String(out)]; + } catch { /* measured as written */ } + } + return [typeof value === 'number' ? value.toLocaleString('en-US') : String(value)]; + }; + const values = categoryValues(config, scale, channel); + if (values) return values.map((value, index) => format(value, index)).filter((lines) => lines.length); + if (scale.type === 'time' || scale.type === 'timeseries') return [['Sep 2024']]; + const extent = datasetExtent(config, channel, Boolean(scale.stacked)); + if (!extent) return []; + const min = typeof scale.min === 'number' ? scale.min : scale.beginAtZero === false ? extent[0] : Math.min(0, extent[0]); + const max = typeof scale.max === 'number' ? scale.max : Math.max(0, extent[1]); + return valueTickLabels([min, max]).map((text) => format(Number(text.replace(/,/g, '')))); +} + +/** How far a scale's labels run from its line, in px. */ +function labelRun(config: any, scale: any, channel: 'x' | 'y'): number { + const labels = printedLabels(config, scale, channel); + if (!labels.length) return 0; + const fontSize = fontSizeOf(scale.ticks?.font); + const widest = widestLine(labels, measure(fontSize)); + const lineHeight = Math.ceil(fontSize * 1.2); + const lines = Math.max(1, ...labels.map((l) => l.length)); + const angle = (Number(scale.ticks?.minRotation) || 0) * Math.PI / 180; + if (channel === 'y') return Math.ceil(widest); + return angle ? Math.ceil(Math.sin(angle) * widest + Math.cos(angle) * lines * lineHeight) : lines * lineHeight; +} + +/** Fit a scale's title to the scale's length, two lines where longer; the room it takes across. */ +function fitScaleTitle(scale: any, length: number): number { + const title = scale?.title; + if (!title?.display || !title.text) return 0; + const text = Array.isArray(title.text) ? title.text.join(' ') : String(title.text); + const fontSize = fontSizeOf(title.font); + const widthOf = measure(fontSize); + const fit = fitAxisTitle(text, length, widthOf, fontSize); + if (fit) title.text = fit.lines.map((line) => cutToWidth(line, fit.limit, widthOf)); + const lines = fit?.lines.length ?? 1; + return Math.ceil(lines * fontSize * 1.2) + SCALE_TITLE_PADDING; +} + +/** A padded value scale's ends are not round ticks: Chart.js would label them, crowding their neighbours. */ +function hidePaddedEnds(scale: any): void { + if (!scale || typeof scale.min !== 'number' || typeof scale.max !== 'number') return; + if (onNiceTick(scale.min, [scale.min, scale.max]) && onNiceTick(scale.max, [scale.min, scale.max])) return; + const ticks = (scale.ticks ??= {}); + if (ticks.includeBounds == null) ticks.includeBounds = false; +} + +/** The legend, where Chart.js would show one. */ +function shownLegend(config: any): any | undefined { + const legend = config.options?.plugins?.legend; + if (!legend || legend.display === false) return undefined; + if (legend.display !== true && (config.data?.datasets?.length ?? 0) < 2 && !['pie', 'doughnut', 'polarArea'].includes(config.type)) return undefined; + return legend; +} + +/** The names the legend lists. */ +function legendNames(config: any): string[] { + const pie = ['pie', 'doughnut', 'polarArea'].includes(config.type); + const names = pie ? config.data?.labels ?? [] : (config.data?.datasets ?? []).map((d: any) => d?.label); + return names.map((name: unknown) => String(name ?? '')).filter(Boolean); +} + +/** + * Lay the legend out as the layout lays Vega-Lite's keys ({@link planKeyLayout}): a column beside the + * plot whose long names stand on lines, or a row at the foot whose names are cut, as Chart.js can only + * set one line an entry in a row. Returns the room it takes beside and below the plot. + */ +function placeLegend(config: any, plot: { width: number; height: number }, canvasWidth: number, sideHeight: number, sideWidth: number, sideCap: number, moveTo?: 'top' | 'bottom'): { right?: number; bottom?: number } | undefined { + const legend = shownLegend(config); + if (!legend || (legend.position && legend.position !== 'right')) return undefined; + // A legend the template writes itself (a ramp's stops, a filter) keeps the gutter the layout pass gave it. + if (legend.labels?.generateLabels || legend.labels?.filter) return { right: STATED_LEGEND }; + const names = legendNames(config); + if (!names.length) return undefined; + const labels = (legend.labels ??= {}); + const fontSize = fontSizeOf(labels.font); + const geometry = cjsKeyGeometry(labels, fontSize); + const box = labels.boxWidth ?? 40; + const padding = geometry.pad.x; + const key: KeyToLayout = { + gradient: false, + labels: names, + count: names.length, + title: legend.title?.display && legend.title.text ? String(legend.title.text) : null, + style: { + labelFont: FONT, labelFontSize: fontSize, labelFontWeight: 'normal', labelFontStyle: 'normal', + titleFont: FONT, titleFontSize: fontSizeOf(legend.title?.font, fontSize), titleFontWeight: 'bold', titleFontStyle: 'normal', + // Chart.js wraps a side legend into more columns, as the planner does by default. + ...keyPlanStyle(geometry), + titlePadding: 4, + }, + orient: 'right', + edges: ['right', 'bottom'], + fixed: false, + fixedTitle: true, + ...(moveTo ? { moveTo: 'bottom' } : {}), + }; + const laid = planKeyLayout([key], plot, tableTextMeasurer, Number.isFinite(sideWidth) ? { sideWidth } : {}).keys[0]; + if (!laid) return undefined; + const widthOf = measure(fontSize); + const bottom = laid.orient === 'bottom' || laid.orient === 'top'; + const lines = new Map(names.map((name, index) => [name, laid.labelLines?.[index] ?? [name]])); + // Chart.js clips a side legend at its width cap rather than cut its names: they are cut first. + const room = sideWidth - box - fontSize / 2 - 2 * padding; + const limit = Math.min(laid.labelLimit > 0 ? laid.labelLimit : Infinity, bottom ? Infinity : room); + const textOf = (name: string): string | string[] => { + const own = lines.get(name) ?? [name]; + if (bottom) return cutToWidth(own.join(' '), Number.isFinite(limit) ? limit : Math.max(...own.map(widthOf)) + 1, widthOf); + const cut = own.map((line) => cutToWidth(line, Number.isFinite(limit) ? limit : undefined, widthOf)); + return cut.length > 1 ? cut : cut[0]; + }; + const changes = names.some((name) => { + const text = textOf(name); + return Array.isArray(text) || text !== name; + }); + if (changes) { + const stated = labels.generateLabels; + labels.generateLabels = function (this: any, chart: any) { + const Chart = chart?.constructor; + const base = stated + ?? Chart?.overrides?.[chart?.config?.type]?.plugins?.legend?.labels?.generateLabels + ?? Chart?.defaults?.plugins?.legend?.labels?.generateLabels; + const items: any[] = base ? base.call(this, chart) : []; + return items.map((item) => ({ ...item, text: textOf(String(item.text)) })); + }; + } + if (bottom) { + // Chart.js flows a legend at the foot in rows across the canvas, an entry a line each. + legend.position = 'bottom'; + const block = keyBlock(geometry, { + entries: names.map((name) => [String(textOf(name))]), fontSize, widthOf, orientation: 'horizontal', room: canvasWidth, + }); + return { bottom: block.height }; + } + // A column beside the plot, as Chart.js fits it: each entry its swatch, half an em, and its widest + // line; entries a line (or their lines) tall, `padding` apart, more columns where they overrun the height. + legend.position = 'right'; + const itemHeight = geometry.entryHeight(fontSize, 1); + const entries = names.map((name) => { + const text = textOf(name); + const lines = Array.isArray(text) ? text : [text]; + return { width: geometry.lead + Math.max(...lines.map(widthOf)), height: geometry.entryHeight(fontSize, lines.length) }; + }); + const titleHeight = legend.title?.display ? Math.ceil(fontSizeOf(legend.title.font, fontSize) * 1.2) + 2 * (legend.title.padding ?? 0) : 0; + const columnRoom = Math.max(itemHeight, sideHeight - titleHeight); + let width = padding; + let used = 0; + let column = 0; + entries.forEach((entry, index) => { + if (index > 0 && used + entry.height + 2 * padding > columnRoom) { width += column + padding; used = 0; column = 0; } + used += entry.height + padding; + column = Math.max(column, entry.width); + }); + width += column + 10; + // Chart.js holds a box beside the chart area to a quarter of the canvas, whatever its entries ask. + return { right: Math.ceil(Math.min(width, sideCap)) }; +} + +/** Write the title block in Chart.js' title and subtitle plugins. */ +function writeTitle(config: any, block: TitleBlock): void { + const plugins = ((config.options ??= {}).plugins ??= {}); + const lines = (part: { lines: string[] }) => (part.lines.length > 1 ? part.lines : part.lines[0]); + if (block.headline) { + plugins.title = { + ...(plugins.title ?? {}), + display: true, + text: lines(block.headline), + font: { ...(plugins.title?.font ?? {}), size: block.headline.fontSize, weight: 'bold', lineHeight: CJS_TITLE.headline.lineHeight }, + padding: { top: CJS_TITLE.padding, bottom: block.deck ? CJS_TITLE.gap : CJS_TITLE.padding }, + }; + } + if (block.deck) { + plugins.subtitle = { + ...(plugins.subtitle ?? {}), + display: true, + text: lines(block.deck), + font: { ...(plugins.subtitle?.font ?? {}), size: block.deck.fontSize, lineHeight: CJS_TITLE.deck.lineHeight }, + padding: { top: block.headline ? 0 : CJS_TITLE.padding, bottom: CJS_TITLE.padding }, + }; + } +} + +/** The height Chart.js gives the title block: its lines and the plugins' padding. */ +function titleRoom(block: TitleBlock): number { + return block.height - (block.headline && block.deck ? CJS_TITLE.gap : 0) + + (block.headline ? CJS_TITLE.padding + (block.deck ? CJS_TITLE.gap : CJS_TITLE.padding) : 0) + + (block.deck ? (block.headline ? 0 : CJS_TITLE.padding) + CJS_TITLE.padding : 0); +} + +/** Thin a chart's lines where many share the plot, from Chart.js' 3 px. */ +function thinLines(config: any, context: InstantiateContext, plotHeight: number): void { + const lines = (config.data?.datasets ?? []).filter((d: any) => (d?.type ?? config.type) === 'line'); + if (lines.length < 2) return; + const width = denseLineWidth(CJS_LINE_WIDTH, Math.max(lines.length, linesPerPanel(context.table, context.channelSemantics)), plotHeight); + if (width === undefined) return; + for (const dataset of lines) { + if (dataset.borderWidth != null && dataset.borderWidth !== CJS_LINE_WIDTH) continue; + dataset.borderWidth = width; + } +} + +/** + * Measure and set the frame of a finished config: band labels as the layout decided them, scale + * gutters measured, scale titles fitted, the legend placed, the title broken over its block, and the + * canvas the plot plus all that. Returns what it measured for the canvas fit. + */ +export function cjsFitFrame( + config: any, context: InstantiateContext, text: { title?: string; subtitle?: string }, planned: { x: boolean; y: boolean }, + titleWidth = 0, +): CJSFrame { + const { layout } = context; + const scales = config.options?.scales; + const x = scales?.x; + const y = scales?.y; + const cartesian = Boolean(x && y && config._plot && config.type !== 'radar' && config.type !== 'polarArea'); + const parts: Partial> = {}; + const width0 = Number(config._width) || context.canvasSize.width; + const height0 = Number(config._height) || context.canvasSize.height; + + if (!cartesian) { + const block = planTitleBlock(text, width0 - 2 * CJS_TITLE.padding, CJS_TITLE); + if (block) { + writeTitle(config, block); + const room = titleRoom(block); + config._height = Math.round(height0 + room); + parts.title = room; + } + delete config._plot; + const plot = { width: width0, height: height0 }; + return { plot, designed: plot, parts, ...(block ? { title: block } : {}) }; + } + + const plot = { width: Number(config._plot.width), height: Number(config._plot.height) }; + delete config._plot; + const designed = { ...plot }; + if (planned.x) realizeBandLabels(config, x, 'x', layout.xLabel); + if (planned.y) realizeBandLabels(config, y, 'y', layout.yLabel); + hidePaddedEnds(x); + hidePaddedEnds(y); + + const yLabels = labelRun(config, y, 'y') + TICK_PADDING + TICK; + const yTitle = fitScaleTitle(y, plot.height); + const xLabels = labelRun(config, x, 'x') + TICK_PADDING + TICK; + const xTitle = fitScaleTitle(x, plot.width); + // Chart.js gives a box beside the chart area at most half the canvas over the boxes beside it (the + // legend and the y scale): a quarter of the canvas, so a third of the rest. + const capped = (plot.width + yLabels + yTitle) / 3; + // A canvas fit that sets the key's text smaller does so before the key is measured. + const shown = shownLegend(config); + if (shown && context.assembleOptions?.canvasTreatment?.keyScale) { + const labels = (shown.labels ??= {}); + labels.font = { ...(labels.font ?? {}), size: treatedKeyFontSize(fontSizeOf(labels.font), context.assembleOptions) }; + } + const legend = placeLegend(config, plot, plot.width + yLabels + yTitle + END_ROOM, plot.height + xLabels + xTitle, Math.min(capped, treatedKeySide(context.assembleOptions, cjsKeyGeometry(shown?.labels ?? {}, fontSizeOf(shown?.labels?.font))) ?? Infinity), capped, treatedKeyEdge(context.assembleOptions)); + const right = legend?.right ?? END_ROOM; + const foot = legend?.bottom ?? 0; + const left = yLabels + yTitle; + // A narrow chart's title may run as wide as its box allows rather than stack into many lines; the + // chart area takes the width the title needs, so the drawing grows wider rather than taller. + const block = planTitleBlock(text, Math.max(plot.width + left + right, titleWidth) - 2 * CJS_TITLE.padding, CJS_TITLE); + if (block) plot.width = Math.max(plot.width, Math.ceil(block.width + 2 * CJS_TITLE.padding - left - right)); + const width = plot.width + left + right; + + let top = END_ROOM; + if (block) { + writeTitle(config, block); + top = titleRoom(block) + END_ROOM / 2; + // A broken title takes its extra lines from a continuous plot, not from the canvas. + if (!categoryValues(config, y, 'y') && block.broken > 0) plot.height = plotHeightAfter(plot.height, block.broken); + } + + thinLines(config, context, plot.height); + + config._width = Math.round(width); + config._height = Math.round(plot.height + top + xLabels + xTitle + foot); + // The plot the frame planned, for tools that compare it with what Chart.js draws. + config._planned = { plot: { width: Math.round(plot.width), height: Math.round(plot.height) }, left: Math.round(left), right: Math.round(right), top: Math.round(top), bottom: Math.round(xLabels + xTitle + foot) }; + Object.assign(parts, { + yLabels, ...(yTitle ? { yTitle } : {}), + xLabels, ...(xTitle ? { xTitle } : {}), + title: top, sideKeys: right, + ...(foot ? { stackedKeys: foot } : {}), + }); + return { plot, designed, parts, ...(block ? { title: block } : {}) }; +} diff --git a/packages/flint-js/src/chartjs/instantiate-spec.ts b/packages/flint-js/src/chartjs/instantiate-spec.ts index ff146ba7..05a92c80 100644 --- a/packages/flint-js/src/chartjs/instantiate-spec.ts +++ b/packages/flint-js/src/chartjs/instantiate-spec.ts @@ -79,6 +79,8 @@ export function cjsApplyLayoutToSpec( const legendGutter = cjsLegendLikelyVisible(config) ? 96 : 0; config._width = plotWidth + PADDING + legendGutter; config._height = plotHeight + PADDING; + // The plot the layout planned, for the frame to measure around (see `cjsFitFrame`). + config._plot = { width: plotWidth, height: plotHeight }; } // ── Bar sizing ─────────────────────────────────────────────────────── @@ -135,6 +137,8 @@ export function cjsApplyLayoutToSpec( const lines = byValue.get(label); return lines ? (lines.length > 1 ? lines : lines[0]) : label; }; + // Marked so a planned band-label decision can set it aside (see `cjsFitFrame`). + ticks.callback._flintCalendar = true; ticks.minRotation = 0; ticks.maxRotation = 0; } diff --git a/packages/flint-js/src/chartjs/profile.ts b/packages/flint-js/src/chartjs/profile.ts new file mode 100644 index 00000000..caadf53f --- /dev/null +++ b/packages/flint-js/src/chartjs/profile.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** How Chart.js (4) sets the furniture the layout plans, from its plugin and scale defaults. */ + +import type { BackendProfile, KeyGeometry } from '../core/backend-profile'; + +/** Chart.js' default family. */ +export const CJS_FONT = "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"; + +const lineHeight = 1.2; + +/** Chart.js' legend: a 40 px box, half an em to its text, entries `padding` (10 px) apart and around. */ +export const CHARTJS_PROFILE: BackendProfile = { + id: 'chartjs', + font: CJS_FONT, + key: { + lead: 40 + 6, + symbol: 12, + gap: 10, + rowGap: 10, + pad: { x: 10, y: 10 }, + entryHeight: (fontSize, lines) => (lines > 1 ? lines * fontSize * lineHeight : fontSize), + lineHeight, + wrap: 'flow', + breakAt: 'over', + rowTitle: 'top', + titleGap: 0, + titleRowGap: 0, + // A legend beside the chart area wraps into more columns where it overruns the height. + sideColumns: 'many', + }, + edge: 10, + // An 8 px tick and 3 px padding before its label. + tickLabelGap: 8 + 3, + axisTitleGap: 8, + labelLineHeight: lineHeight, + labelBoxHeight: lineHeight, + axisPad: 0, +}; + +/** The key geometry a legend draws with at this size, its own `labels` settings over the defaults. */ +export function cjsKeyGeometry(labels: any, fontSize: number): KeyGeometry { + const base = CHARTJS_PROFILE.key; + const box = labels?.boxWidth ?? 40; + const boxHeight = labels?.boxHeight ?? fontSize; + const padding = labels?.padding ?? 10; + return { + ...base, + lead: box + fontSize / 2, + symbol: Math.max(box, boxHeight), + gap: padding, + rowGap: padding, + pad: { x: padding, y: padding }, + entryHeight: (size, lines) => (lines > 1 ? lines * size * lineHeight : Math.max(size, boxHeight)), + }; +} diff --git a/packages/flint-js/src/core/analyze.ts b/packages/flint-js/src/core/analyze.ts index 3689b086..58e6c530 100644 --- a/packages/flint-js/src/core/analyze.ts +++ b/packages/flint-js/src/core/analyze.ts @@ -4,7 +4,7 @@ import { applyAggregation, resolveImplicitAggregation } from './aggregate'; import { applyEncodingOverrides } from './encoding-overrides'; import { applyTransform, TRANSFORM_ARRANGE_KEY, TRANSFORM_CHART_TYPE_KEY } from './pivot'; import { convertTemporalData, repairEncodingSorts, resolveChannelSemantics, resolveChannelTypes } from './resolve-semantics'; -import { computeZeroDecision } from './semantic-types'; +import { computeZeroDecision, zeroMarkType } from './semantic-types'; import { normalizeStaticSeries } from './static-series'; /** What a compile learns from the data and the chart spec, before any room or theme is read. */ @@ -156,7 +156,7 @@ export function analyzeChart( ); // Finalize zero-baseline (requires template mark knowledge) - const effectiveMarkType = templateMarkType || 'point'; + const effectiveMarkType = zeroMarkType(template.chart, templateMarkType); for (const [channel, cs] of Object.entries(channelSemantics)) { if ((channel === 'x' || channel === 'y') && cs.type === 'quantitative') { const numericValues = data diff --git a/packages/flint-js/src/core/annotation/color.ts b/packages/flint-js/src/core/annotation/color.ts new file mode 100644 index 00000000..623f7ef9 --- /dev/null +++ b/packages/flint-js/src/core/annotation/color.ts @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { luminance, parseColor as parseHex, toHex, type RGB } from '../theme/presence'; + +/** + * The colours an annotation is drawn in, after Blabber's: a region's wash distinct from the marks and + * the other regions, a cluster's outline in the colour its points share, other outlines in a neutral + * grey, and words in a readable shade of the colour they belong to. + */ + +const NAMED: Record = { + black: '#000000', white: '#ffffff', red: '#ff0000', blue: '#0000ff', green: '#008000', orange: '#ffa500', + purple: '#800080', brown: '#a52a2a', pink: '#ffc0cb', grey: '#808080', gray: '#808080', yellow: '#ffff00', + teal: '#008080', crimson: '#dc143c', navy: '#000080', gold: '#ffd700', goldenrod: '#daa520', + steelblue: '#4682b4', lightskyblue: '#87cefa', transparent: '', +}; + +/** A CSS colour as RGB: hex, `rgb()`/`rgba()`, or a common name. Null for anything else. */ +export function cssColor(input: string | null | undefined): RGB | null { + if (!input) return null; + const value = input.trim().toLowerCase(); + const named = NAMED[value]; + if (named !== undefined) return named ? parseHex(named) : null; + const rgb = /^rgba?\(([^)]+)\)$/.exec(value); + if (rgb) { + const parts = rgb[1].split(/[\s,/]+/).filter(Boolean).map(Number); + if (parts.length >= 3 && parts.slice(0, 3).every(Number.isFinite)) { + return { r: parts[0], g: parts[1], b: parts[2], a: parts[3] ?? 1 }; + } + return null; + } + return parseHex(value); +} + +function hexOf(input: string | null | undefined): string | undefined { + const color = cssColor(input); + return color && color.a > 0 ? toHex(color) : undefined; +} + +function contrast(a: RGB, b: RGB): number { + const la = luminance(a); + const lb = luminance(b); + return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05); +} + +function oklab({ r, g, b }: RGB): [number, number, number] { + const linear = (value: number): number => { + const x = value / 255; + return x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; + }; + const lr = linear(r); + const lg = linear(g); + const lb = linear(b); + const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb); + const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb); + const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb); + return [ + 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, + 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s, + 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s, + ]; +} + +function fromOklab([L, a, b]: [number, number, number]): RGB { + const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3; + const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3; + const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3; + const channel = (value: number): number => { + const x = value <= 0.0031308 ? value * 12.92 : 1.055 * value ** (1 / 2.4) - 0.055; + return Math.max(0, Math.min(255, Math.round(x * 255))); + }; + return { + r: channel(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s), + g: channel(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s), + b: channel(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s), + a: 1, + }; +} + +function distance(a: RGB, b: RGB): number { + const x = oklab(a); + const y = oklab(b); + return Math.hypot(x[0] - y[0], x[1] - y[1], x[2] - y[2]); +} + +const PAPER = '#ffffff'; + +/** The hues a region's wash is chosen from. */ +const CALLOUT_PALETTE = ['#e45756', '#f58518', '#54a24b', '#b279a2', '#ff9da6', '#9d755d', '#17becf', '#d95f02', '#7570b3']; + +/** + * A region's wash: of the `candidates` that read on the page (the callout hues unless a house names + * its own), the one furthest (in OKLab) from every mark's fill and every region already shaded. + */ +export function distinctRegionColor( + existing: readonly (string | null | undefined)[], + background = PAPER, + candidates: readonly string[] = CALLOUT_PALETTE, +): string { + const paper = cssColor(background) ?? cssColor(PAPER)!; + // The page is a colour a wash must stand apart from too, or it vanishes on a tinted page. + const colours = [...existing.map(cssColor).filter((colour): colour is RGB => colour !== null && colour.a > 0), paper]; + let best: string | undefined; + let bestScore = -Infinity; + for (const candidate of candidates) { + const rgb = cssColor(candidate); + if (!rgb || rgb.a === 0) continue; + const reads = contrast(rgb, paper); + if (reads < 2.5) continue; + const separation = Math.min(...colours.map((colour) => distance(rgb, colour))); + const score = separation + reads * 0.01; + if (score > bestScore) { + best = toHex(rgb); + bestScore = score; + } + } + return best ?? CALLOUT_PALETTE[0]; +} + +/** The least OKLab chroma a house's hue needs to wash a region: greys and blacks are left out. */ +const MIN_WASH_CHROMA = 0.08; + +function chroma(rgb: RGB): number { + const [, a, b] = oklab(rgb); + return Math.hypot(a, b); +} + +/** How far apart in OKLab a house's hue must stand from every mark to wash a region without reading as one. */ +const ACCENT_SEPARATION = 0.12; + +/** + * A region's wash, after the house where it can be: its `accent` where that reads on the page and + * stands apart from the page, every mark (`marks`) and every region already shaded (`regions`) — in most houses + * the accent is the data's own ink, and a wash in it would read as data; else the hue of its + * categorical `palette` furthest from them, where one stands apart; else the callout hue furthest + * from them ({@link distinctRegionColor}). + */ +export function regionColor( + regions: readonly (string | null | undefined)[], + marks: readonly (string | null | undefined)[], + background = PAPER, + accent?: string, + palette: readonly string[] = [], +): string { + const paper = cssColor(background) ?? cssColor(PAPER)!; + const taken = [...[...regions, ...marks].map(cssColor).filter((colour): colour is RGB => colour !== null && colour.a > 0), paper]; + // A grey or black hue washes the plot grey: a region is a hue, not a shade. + const apart = (rgb: RGB): boolean => chroma(rgb) >= MIN_WASH_CHROMA && contrast(rgb, paper) >= 2.5 + && taken.every((colour) => distance(rgb, colour) >= ACCENT_SEPARATION); + const house = cssColor(accent); + if (house && house.a > 0 && apart(house)) return toHex(house); + const own = palette.filter((hue) => { + const rgb = cssColor(hue); + return rgb !== null && rgb.a > 0 && apart(rgb); + }); + return distinctRegionColor([...marks, ...regions], background, own.length > 0 ? own : CALLOUT_PALETTE); +} + +/** + * The same hue, made darker (lighter on a dark page) in OKLab lightness only, so it keeps its hue and + * chroma, until it reaches `minimum`:1 against the page: words in the colour they belong to. + */ +export function readableShade(colour: string, background = PAPER, minimum = 4.5): string { + const paper = cssColor(background) ?? cssColor(PAPER)!; + let rgb = cssColor(colour); + if (!rgb) return luminance(paper) > 0.4 ? '#1a1a1a' : '#f5f5f5'; + const darken = luminance(paper) > 0.18; + for (let step = 0; step < 12 && contrast(rgb, paper) < minimum; step++) { + const [L, a, b] = oklab(rgb); + rgb = fromOklab([darken ? Math.max(0, L * 0.88) : Math.min(1, L + (1 - L) * 0.18), a, b]); + } + return toHex(rgb); +} + +/** A colour drawn at `alpha` over the page, as it reads there. */ +export function over(colour: string, background: string, alpha: number): string { + const fg = cssColor(colour); + const bg = cssColor(background) ?? cssColor(PAPER)!; + if (!fg) return toHex(bg); + const t = Math.max(0, Math.min(1, alpha)); + return toHex({ r: bg.r + (fg.r - bg.r) * t, g: bg.g + (fg.g - bg.g) * t, b: bg.b + (fg.b - bg.b) * t, a: 1 }); +} + +/** + * The neutral annotation ink: the grey Blabber draws leaders and unclaimed outlines in (#5a5a5a), or + * its counterpart on a dark page. It reads at 4.5:1 without the weight of black. + */ +export function neutralInk(background = PAPER): string { + return isDarkPage(background) ? '#b4b4b4' : readableShade('#5a5a5a', background, 4.5); +} + +/** + * A cluster's outline and caption colour: the colour most of its points share, where that reads at + * 4.5:1 on the page (their stroke, for hollow points); else that colour darkened until it does; else, + * with no shared colour, the neutral annotation ink. + */ +export function clusterColor(marks: readonly { fill?: string | null; stroke?: string | null }[], background = PAPER): string { + const page = hexOf(background) ?? PAPER; + const paper = cssColor(page)!; + const majority = (colours: (string | undefined)[]): string | undefined => { + const counts = new Map(); + for (const colour of colours) if (colour) counts.set(colour, (counts.get(colour) ?? 0) + 1); + const [top] = [...counts].sort((a, b) => b[1] - a[1]); + return top && top[1] > colours.length / 2 ? top[0] : undefined; + }; + // A cluster is known by its fill; its stroke only where it has none (a theme's outline round every + // dot is the same for all clusters, and would outline each in the same ink). + const hue = majority(marks.map((mark) => hexOf(mark.fill))) ?? majority(marks.map((mark) => hexOf(mark.stroke))); + if (!hue || hue === page) return neutralInk(page); + return contrast(cssColor(hue)!, paper) >= 4.5 ? hue : readableShade(hue, page, 4.5); +} + +/** The least contrast a cue needs on what it is drawn over before it is given a halo. */ +const CUE_CONTRAST = 3; + +/** + * Of `inks`, the one that reads best on every ground it is drawn over, by its weakest contrast: a + * cue on an area's edge lies half on the fill and half on the page, so it must read on both. The + * dark note ink wins on a mid-tone area on a light page; on a dark area (navy on white) no ink reads + * on both, and the cue takes a `halo` of the other ink so its edge shows on the side it does not. + */ +export function inkOn( + grounds: readonly (string | null | undefined)[], + inks: readonly string[], +): { ink: string; halo?: string } { + const under = grounds.map(cssColor).filter((rgb): rgb is RGB => rgb !== null && rgb.a > 0); + if (under.length === 0) return { ink: inks[0] }; + let best = inks[0]; + let bestContrast = -Infinity; + for (const ink of inks) { + const rgb = cssColor(ink); + if (!rgb) continue; + const weakest = Math.min(...under.map((ground) => contrast(rgb, ground))); + if (weakest > bestContrast) { + best = ink; + bestContrast = weakest; + } + } + const other = inks.find((ink) => ink !== best); + return bestContrast < CUE_CONTRAST && other ? { ink: best, halo: other } : { ink: best }; +} + +/** Whether the page is dark: a wash then lightens what it covers rather than darkening it. */ +export function isDarkPage(background: string | null | undefined): boolean { + const rgb = cssColor(background ?? PAPER); + return rgb ? luminance(rgb) < 0.18 : false; +} diff --git a/packages/flint-js/src/core/annotation/enclose.ts b/packages/flint-js/src/core/annotation/enclose.ts new file mode 100644 index 00000000..f29477ed --- /dev/null +++ b/packages/flint-js/src/core/annotation/enclose.ts @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BoxIndex, boxDistance, overflow, overlapArea, segmentBox, segmentCrossesBox, segmentsCross, type Box, type Point } from './geometry'; +import type { NoteObstacle, NoteSegment } from './place'; + +/** + * Outlines round sets of marks, after Blabber's `enclose`: one outline per group, a caption they share, + * and leaders from it to two or three outlines. Simplified for speed: each outline is built from the + * marks' boxes (a line's vertices for a stretch of a line), and the caption takes the cheapest of a + * fixed ring of seats round the outlines, one note at a time. + */ + +export type EnclosureShape = 'hull' | 'rect' | 'ellipse' | 'circle'; + +/** One mark in a group, as its box on the plot. */ +export interface EnclosedMark { + box: Box; + /** A bar, histogram bin or stacked segment; a heatmap cell or tile; a point; else another mark. */ + role: 'bar' | 'cell' | 'point' | 'other'; + /** A stretch of a line or area, by its vertices: the outline follows them. */ + points?: readonly Point[]; + /** A round point's radius. */ + radius?: number; + /** A pie or donut slice: its centre, radii and angles (radians clockwise from 12 o'clock). */ + sector?: { cx: number; cy: number; inner: number; outer: number; start: number; end: number }; +} + +export interface EnclosureOutline { + shape: EnclosureShape; + /** The SVG path the outline is drawn as. */ + d: string; + bounds: Box; + /** The outline as a closed polyline, for contacts and clearances. */ + ring: Point[]; +} + +/** The outline's stroke width, in px: lighter than Blabber's 2 px emphasis, with a page halo under it. */ +export const ENCLOSURE_STROKE = 1.5; + +/** Bars, bins, stacks, cells and tiles are enclosed by a rectangle; other marks by a hull. */ +export function defaultEnclosureShape(marks: readonly EnclosedMark[]): EnclosureShape { + return marks.length > 0 && marks.every((mark) => mark.role === 'bar' || mark.role === 'cell') ? 'rect' : 'hull'; +} + +function union(boxes: readonly Box[]): Box | undefined { + if (boxes.length === 0) return undefined; + let x1 = Infinity; + let y1 = Infinity; + let x2 = -Infinity; + let y2 = -Infinity; + for (const box of boxes) { + x1 = Math.min(x1, box.x); + y1 = Math.min(y1, box.y); + x2 = Math.max(x2, box.x + box.width); + y2 = Math.max(y2, box.y + box.height); + } + return { x: x1, y: y1, width: x2 - x1, height: y2 - y1 }; +} + +function expand(box: Box, by: number): Box { + return { x: box.x - by, y: box.y - by, width: box.width + 2 * by, height: box.height + 2 * by }; +} + +function clipBox(box: Box, frame: Box): Box { + const x = Math.max(box.x, frame.x); + const y = Math.max(box.y, frame.y); + return { + x, y, + width: Math.max(0, Math.min(box.x + box.width, frame.x + frame.width) - x), + height: Math.max(0, Math.min(box.y + box.height, frame.y + frame.height) - y), + }; +} + +function rectRing(box: Box): Point[] { + const { x, y, width, height } = box; + return [ + { x, y }, { x: x + width / 2, y }, { x: x + width, y }, { x: x + width, y: y + height / 2 }, + { x: x + width, y: y + height }, { x: x + width / 2, y: y + height }, { x, y: y + height }, { x, y: y + height / 2 }, + ]; +} + +function rectOutline(box: Box): EnclosureOutline { + const { x, y, width, height } = box; + return { shape: 'rect', d: `M ${x} ${y} H ${x + width} V ${y + height} H ${x} Z`, bounds: box, ring: rectRing(box) }; +} + +const cross = (a: Point, b: Point, c: Point): number => (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x); + +/** The convex hull of points, counter-clockwise in screen terms (Andrew's monotone chain). */ +export function convexHull(points: readonly Point[]): Point[] { + const sorted = [...points].sort((a, b) => a.x - b.x || a.y - b.y); + if (sorted.length < 3) return sorted; + const half = (ordered: readonly Point[]): Point[] => { + const chain: Point[] = []; + for (const point of ordered) { + while (chain.length >= 2 && cross(chain[chain.length - 2], chain[chain.length - 1], point) <= 0) chain.pop(); + chain.push(point); + } + chain.pop(); + return chain; + }; + return [...half(sorted), ...half([...sorted].reverse())]; +} + +/** A polygon cut to a rectangle (Sutherland–Hodgman). */ +function clipPolygon(polygon: readonly Point[], frame: Box): Point[] { + const edges: [(p: Point) => boolean, (a: Point, b: Point) => Point][] = [ + [(p) => p.x >= frame.x, (a, b) => ({ x: frame.x, y: a.y + (b.y - a.y) * (frame.x - a.x) / (b.x - a.x) })], + [(p) => p.x <= frame.x + frame.width, (a, b) => ({ x: frame.x + frame.width, y: a.y + (b.y - a.y) * (frame.x + frame.width - a.x) / (b.x - a.x) })], + [(p) => p.y >= frame.y, (a, b) => ({ x: a.x + (b.x - a.x) * (frame.y - a.y) / (b.y - a.y), y: frame.y })], + [(p) => p.y <= frame.y + frame.height, (a, b) => ({ x: a.x + (b.x - a.x) * (frame.y + frame.height - a.y) / (b.y - a.y), y: frame.y + frame.height })], + ]; + let output = [...polygon]; + for (const [inside, cut] of edges) { + const input = output; + output = []; + for (let index = 0; index < input.length; index++) { + const current = input[index]; + const previous = input[(index + input.length - 1) % input.length]; + if (inside(current)) { + if (!inside(previous)) output.push(cut(previous, current)); + output.push(current); + } else if (inside(previous)) output.push(cut(previous, current)); + } + if (output.length === 0) break; + } + return output; +} + +function polygonOutline(polygon: readonly Point[]): EnclosureOutline | undefined { + if (polygon.length < 3) return undefined; + const bounds = union(polygon.map((point) => ({ ...point, width: 0, height: 0 })))!; + const d = `${polygon.map((point, index) => `${index === 0 ? 'M' : 'L'} ${point.x} ${point.y}`).join(' ')} Z`; + return { shape: 'hull', d, bounds, ring: [...polygon] }; +} + +/** + * A padded hull round the marks: 6 px out from each box, or from each vertex of a stretch of line; a + * row or column of points only as far out as keeps it off its neighbours. Cut to the plot, the whole + * stroke inside. + */ +function hullOutline(marks: readonly EnclosedMark[], plot: Box): EnclosureOutline | undefined { + const span = union(marks.map((mark) => mark.box))!; + const pointsOnly = marks.length > 1 && marks.every((mark) => mark.role === 'point'); + const collinear = pointsOnly && (span.height <= Math.max(...marks.map((mark) => mark.box.height)) + 0.5 + || span.width <= Math.max(...marks.map((mark) => mark.box.width)) + 0.5); + const pad = collinear ? Math.min(6, Math.max(ENCLOSURE_STROKE / 2 + 1, Math.min(span.width, span.height) * 0.15)) : 6; + const candidates: Point[] = []; + for (const mark of marks) { + if (mark.points && mark.points.length >= 2) { + for (const point of mark.points) { + for (let index = 0; index < 8; index++) { + candidates.push({ x: point.x + Math.cos(index * Math.PI / 4) * pad, y: point.y + Math.sin(index * Math.PI / 4) * pad }); + } + } + continue; + } + const box = expand(mark.box, pad); + candidates.push({ x: box.x, y: box.y }, { x: box.x + box.width, y: box.y }, + { x: box.x + box.width, y: box.y + box.height }, { x: box.x, y: box.y + box.height }); + } + return polygonOutline(clipPolygon(convexHull(candidates), expand(plot, -ENCLOSURE_STROKE / 2 - 0.01))); +} + +interface Ellipse { + cx: number; + cy: number; + rx: number; + ry: number; + /** Radians, clockwise on screen. */ + angle: number; +} + +/** + * The smallest of a few enclosing ellipses round the boxes' corners: axis-aligned, along the cloud's + * principal axis, and at 17 angles between, each scaled until every corner is inside. Where a frame is + * given, an ellipse running past it is passed over. + */ +function enclosingEllipse(boxes: readonly Box[], padding: number, frame?: Box): Ellipse | undefined { + const corners = boxes.flatMap((box) => { + const padded = expand(box, padding); + return [padded.x, padded.x + padded.width].flatMap((x) => [padded.y, padded.y + padded.height].map((y) => ({ x, y }))); + }); + if (corners.length === 0) return undefined; + const origin = corners.reduce((sum, point) => ({ x: sum.x + point.x / corners.length, y: sum.y + point.y / corners.length }), { x: 0, y: 0 }); + const centred = corners.map((point) => ({ x: point.x - origin.x, y: point.y - origin.y })); + let xx = 0; + let xy = 0; + let yy = 0; + for (const point of centred) { + xx += point.x * point.x; + xy += point.x * point.y; + yy += point.y * point.y; + } + // An ellipse is convex: enclosing the hull encloses every corner. + const boundary = convexHull(centred); + const ring = boundary.length > 0 ? boundary : centred; + const principal = Math.atan2(2 * xy, xx - yy) / 2; + const angles = [0, principal, ...Array.from({ length: 17 }, (_, index) => (index + 1) * Math.PI / 36)]; + let best: Ellipse | undefined; + for (const angle of angles) { + const cos = Math.cos(angle); + const sin = Math.sin(angle); + const projected = ring.map((point) => ({ x: point.x * cos + point.y * sin, y: -point.x * sin + point.y * cos })); + let left = Infinity; + let right = -Infinity; + let top = Infinity; + let bottom = -Infinity; + for (const point of projected) { + left = Math.min(left, point.x); + right = Math.max(right, point.x); + top = Math.min(top, point.y); + bottom = Math.max(bottom, point.y); + } + const cx = (left + right) / 2; + const cy = (top + bottom) / 2; + const a = (right - left) / 2; + const b = (bottom - top) / 2; + if (a <= 1e-9 || b <= 1e-9) continue; + let scale = 1; + for (const point of projected) scale = Math.max(scale, Math.hypot((point.x - cx) / a, (point.y - cy) / b)); + const rx = a * scale; + const ry = b * scale; + if (best && rx * ry >= best.rx * best.ry - 1e-9) continue; + const centre = { x: origin.x + cx * cos - cy * sin, y: origin.y + cx * sin + cy * cos }; + const halfWidth = Math.hypot(rx * cos, ry * sin); + const halfHeight = Math.hypot(rx * sin, ry * cos); + if (frame && (centre.x - halfWidth < frame.x || centre.y - halfHeight < frame.y + || centre.x + halfWidth > frame.x + frame.width || centre.y + halfHeight > frame.y + frame.height)) continue; + best = { cx: centre.x, cy: centre.y, rx, ry, angle }; + } + return best; +} + +function ellipseOutline({ cx, cy, rx, ry, angle }: Ellipse, shape: EnclosureShape): EnclosureOutline { + const dx = rx * Math.cos(angle); + const dy = rx * Math.sin(angle); + const rotation = angle * 180 / Math.PI; + const d = `M ${cx - dx} ${cy - dy} A ${rx} ${ry} ${rotation} 1 0 ${cx + dx} ${cy + dy} A ${rx} ${ry} ${rotation} 1 0 ${cx - dx} ${cy - dy} Z`; + const halfWidth = Math.hypot(rx * Math.cos(angle), ry * Math.sin(angle)); + const halfHeight = Math.hypot(rx * Math.sin(angle), ry * Math.cos(angle)); + const ring = Array.from({ length: 48 }, (_, index) => { + const t = index * Math.PI / 24; + const x = rx * Math.cos(t); + const y = ry * Math.sin(t); + return { x: cx + x * Math.cos(angle) - y * Math.sin(angle), y: cy + x * Math.sin(angle) + y * Math.cos(angle) }; + }); + return { shape, d, bounds: { x: cx - halfWidth, y: cy - halfHeight, width: 2 * halfWidth, height: 2 * halfHeight }, ring }; +} + +/** + * One group's outline, by shape (Blabber's rules): + * - `rect`: one bar's own border; several bars their tight union, taking in any bar standing between + * them; cells their union, the stroke kept inside; other marks their box 5 px out. Kept in the plot. + * - `hull`: a padded convex hull ({@link hullOutline}). + * - `ellipse`: round points, the smallest enclosing ellipse 2 px out; other marks the ellipse through + * the corners of their box 5 px out. + * - `circle`: round one point, 2 px clear of it; round several, the circle through their box's corners. + */ +/** A slice's own boundary: its outer arc, its sides and its inner arc (or the centre). */ +function sectorPath(sector: NonNullable): { d: string; ring: Point[] } { + const { cx, cy, inner, outer } = sector; + // A reversed theta scale gives start > end; the path sweeps clockwise from the smaller angle. + const start = Math.min(sector.start, sector.end); + const end = Math.max(sector.start, sector.end); + const at = (radius: number, angle: number): Point => ({ x: cx + radius * Math.sin(angle), y: cy - radius * Math.cos(angle) }); + const large = end - start > Math.PI ? 1 : 0; + const a = at(outer, start); + const b = at(outer, end); + const c = at(inner, end); + const d0 = at(inner, start); + const d = inner > 0 + ? `M ${a.x} ${a.y} A ${outer} ${outer} 0 ${large} 1 ${b.x} ${b.y} L ${c.x} ${c.y} A ${inner} ${inner} 0 ${large} 0 ${d0.x} ${d0.y} Z` + : `M ${cx} ${cy} L ${a.x} ${a.y} A ${outer} ${outer} 0 ${large} 1 ${b.x} ${b.y} Z`; + const steps = Math.max(2, Math.ceil((end - start) / (Math.PI / 24))); + const ring: Point[] = []; + for (let step = 0; step <= steps; step++) ring.push(at(outer, start + (end - start) * step / steps)); + if (inner > 0) for (let step = steps; step >= 0; step--) ring.push(at(inner, start + (end - start) * step / steps)); + else ring.push({ x: cx, y: cy }); + return { d, ring }; +} + +export function enclosureOutline( + marks: readonly EnclosedMark[], + shape: EnclosureShape, + plot: Box, + siblings: readonly Box[] = [], +): EnclosureOutline | undefined { + if (marks.length === 0) return undefined; + // Slices are enclosed along their own wedge boundaries, never a box or a circle round them. + if (shape === 'hull' && marks.every((mark) => mark.sector)) { + const paths = marks.map((mark) => sectorPath(mark.sector!)); + const ring = paths.flatMap((path) => path.ring); + return { shape: 'hull', d: paths.map((path) => path.d).join(' '), bounds: union(ring.map((point) => ({ ...point, width: 0, height: 0 })))!, ring }; + } + const half = ENCLOSURE_STROKE / 2; + const span = union(marks.map((mark) => mark.box))!; + if (shape === 'hull') return hullOutline(marks, plot); + if (shape === 'rect') { + if (marks.length === 1 && marks[0].role === 'bar') return rectOutline(marks[0].box); + if (marks.every((mark) => mark.role === 'cell')) { + const inset = Math.min(half, span.width / 2, span.height / 2); + return rectOutline({ x: span.x + inset, y: span.y + inset, width: span.width - 2 * inset, height: span.height - 2 * inset }); + } + if (marks.every((mark) => mark.role === 'bar')) { + // A bar standing between the members reads as enclosed: the outline takes it in rather than cut it. + const vertical = span.width <= span.height || marks.every((mark) => mark.box.width <= mark.box.height); + let tight = span; + for (const other of siblings) { + const at = vertical ? other.x + other.width / 2 : other.y + other.height / 2; + const lo = vertical ? tight.x : tight.y; + const hi = lo + (vertical ? tight.width : tight.height); + if (at > lo && at < hi && overlapArea(other, tight) > 0) tight = union([tight, other])!; + } + return rectOutline(clipBox(tight, expand(plot, -half))); + } + return rectOutline(clipBox(expand(span, 5), expand(plot, -half))); + } + if (shape === 'circle') { + if (marks.length === 1 && marks[0].role === 'point') { + const box = marks[0].box; + const radius = (marks[0].radius ?? Math.hypot(box.width, box.height) / 2) + 2 + half; + return ellipseOutline({ cx: box.x + box.width / 2, cy: box.y + box.height / 2, rx: radius, ry: radius, angle: 0 }, 'circle'); + } + const box = expand(span, 5); + const radius = Math.hypot(box.width, box.height) / 2; + return ellipseOutline({ cx: box.x + box.width / 2, cy: box.y + box.height / 2, rx: radius, ry: radius, angle: 0 }, 'circle'); + } + if (marks.length > 1 && marks.every((mark) => mark.role === 'point' && !mark.points)) { + const boxes = marks.map((mark) => mark.box); + const fitted = enclosingEllipse(boxes, 2, expand(plot, -half - 1)) ?? enclosingEllipse(boxes, 2); + if (fitted) return ellipseOutline(fitted, 'ellipse'); + } + const box = expand(span, 5); + return ellipseOutline({ + cx: box.x + box.width / 2, cy: box.y + box.height / 2, rx: box.width / Math.SQRT2, ry: box.height / Math.SQRT2, angle: 0, + }, 'ellipse'); +} + +/** The point of a closed ring nearest `from`. */ +export function nearestOnRing(ring: readonly Point[], from: Point): Point { + let best = ring[0]; + let bestDistance = Infinity; + for (let index = 0; index < ring.length; index++) { + const a = ring[index]; + const b = ring[(index + 1) % ring.length]; + const dx = b.x - a.x; + const dy = b.y - a.y; + const length = dx * dx + dy * dy; + const t = length > 0 ? Math.max(0, Math.min(1, ((from.x - a.x) * dx + (from.y - a.y) * dy) / length)) : 0; + const point = { x: a.x + t * dx, y: a.y + t * dy }; + const distance = Math.hypot(point.x - from.x, point.y - from.y); + if (distance < bestDistance) { + best = point; + bestDistance = distance; + } + } + return best; +} + +/** The clear distance from a box to a closed ring's line; 0 where the line crosses or touches the box. */ +export function ringDistance(ring: readonly Point[], box: Box): number { + let best = Infinity; + for (let index = 0; index < ring.length; index++) { + const a = ring[index]; + const b = ring[(index + 1) % ring.length]; + if (segmentCrossesBox(a, b, box)) return 0; + best = Math.min(best, boxDistance({ ...a, width: 0, height: 0 }, box), boxDistance({ ...b, width: 0, height: 0 }, box)); + } + return best; +} + +/** A caption's lines and size, at one wrap. */ +export interface CaptionLayout { + lines: string[]; + width: number; + height: number; +} + +export interface EnclosureCaptionInput { + outlines: readonly EnclosureOutline[]; + /** Where the outlines enclose slices: the pie's centre and outer radius, and each slice's mid-angle. */ + pie?: { cx: number; cy: number; outer: number; angles: readonly number[] }; + layouts: readonly CaptionLayout[]; + plot: Box; + canvas: Box; + obstacles?: readonly NoteObstacle[]; + segments?: readonly NoteSegment[]; + connect?: 'auto' | 'all' | 'none'; +} + +export interface CaptionPlacement { + box: Box; + layout: number; + align: 'left' | 'center' | 'right'; + leaders: { from: Point; to: Point }[]; + cost: number; +} + +/** Per px² hidden; tiled cells are data too, so a caption over them costs as over any mark. */ +const AREA_COST = { mark: 8, text: 25, faint: 8 }; +const LINE_COST = 50; +const CUT_COST = 250; +const CROSS_COST = 150; +/** A seat off the plot stays in the paper it can: past the canvas it is not drawn. */ +const CANVAS_COST = 10_000; +const PLOT_COST = 20; +const PORT_GAP = 3; +/** A caption this near its outline reads as beside it, with no leader. */ +const NEAR_GAP = 16; + +/** + * Where the caption of one or more outlines stands, and the leaders to them. Seats are Blabber's: one + * outline's caption centred above or below it, beside it, or at a corner, 8 to 28 px out; a shared + * caption centred above, below or beside the outlines' union, or a quarter along it, 12 to 64 px out. + * A seat is passed over where its box comes within 4 px of an outline. Leaders run from the caption's + * edge to each outline's nearest point when there are two or three outlines (`connect: 'auto'`), to + * all of them (`'all'`), or to none. + */ +export function placeEnclosureCaption(input: EnclosureCaptionInput): CaptionPlacement | undefined { + const { outlines, layouts, plot, canvas } = input; + const box = union(outlines.map((outline) => outline.bounds)); + if (!box || layouts.length === 0) return undefined; + const connect = input.connect ?? 'auto'; + // One slice's caption outside the pie needs its leader to say which slice; Blabber's pie labels draw one. + const linked = connect === 'all' || (connect === 'auto' && ((outlines.length >= 2 && outlines.length <= 3) || !!input.pie)); + const shared = outlines.length > 1; + const obstacles = new BoxIndex(input.obstacles ?? []); + const segments = new BoxIndex((input.segments ?? []).map((segment) => ({ ...segment, box: segmentBox(segment.a, segment.b) }))); + let best: CaptionPlacement | undefined; + layouts.forEach((layout, index) => { + const { width: w, height: h } = layout; + const cx = box.x + (box.width - w) / 2; + const cy = box.y + (box.height - h) / 2; + const seats: { x: number; y: number; rank: number; align: CaptionPlacement['align'] }[] = []; + // Past the plot, over or beside the outlines: the paper a caption takes when the plot is full. + const outside = [ + { x: cx, y: plot.y - h - 8, rank: 300, align: 'center' as const }, + { x: cx, y: plot.y + plot.height + 8, rank: 320, align: 'center' as const }, + { x: plot.x + plot.width + 8, y: cy, rank: 310, align: 'left' as const }, + { x: plot.x - w - 8, y: cy, rank: 330, align: 'right' as const }, + ]; + seats.push(...outside); + // A slice's caption stands outside the pie on its own radius, as a pie label does. + if (input.pie) { + for (const angle of input.pie.angles) { + for (const reach of [12, 24, 40]) { + const rim = { x: input.pie.cx + (input.pie.outer + reach) * Math.sin(angle), y: input.pie.cy - (input.pie.outer + reach) * Math.cos(angle) }; + const right = Math.sin(angle) >= 0; + seats.push({ x: right ? rim.x : rim.x - w, y: rim.y - h / 2, rank: reach * 0.5, align: right ? 'left' : 'right' }); + } + } + } + if (shared) { + for (const gap of [12, 24, 40, 64]) { + seats.push( + { x: cx, y: box.y - gap - h, rank: gap, align: 'center' }, + { x: cx, y: box.y + box.height + gap, rank: gap + 1, align: 'center' }, + { x: box.x - gap - w, y: cy, rank: gap + 2, align: 'right' }, + { x: box.x + box.width + gap, y: cy, rank: gap + 2, align: 'left' }, + ...[-0.25, 0.25].flatMap((shift) => [ + { x: cx + box.width * shift, y: box.y - gap - h, rank: gap + 3, align: 'center' as const }, + { x: cx + box.width * shift, y: box.y + box.height + gap, rank: gap + 4, align: 'center' as const }, + ]), + ); + } + } else { + for (const gap of [8, 16, 28]) { + const step = (gap - 8) * 2; + seats.push( + { x: cx, y: box.y - gap - h, rank: step, align: 'center' }, + { x: cx, y: box.y + box.height + gap, rank: step + 1, align: 'center' }, + { x: box.x - gap - w, y: cy, rank: step + 2, align: 'right' }, + { x: box.x + box.width + gap, y: cy, rank: step + 2, align: 'left' }, + { x: box.x - gap - w, y: box.y - gap - h, rank: step + 3.5, align: 'right' }, + { x: box.x + box.width + gap, y: box.y - gap - h, rank: step + 3.5, align: 'left' }, + { x: box.x - gap - w, y: box.y + box.height + gap, rank: step + 4.5, align: 'right' }, + { x: box.x + box.width + gap, y: box.y + box.height + gap, rank: step + 4.5, align: 'left' }, + ); + } + } + for (const seat of seats) { + const rect: Box = { x: seat.x, y: seat.y, width: w, height: h }; + if (outlines.some((outline) => ringDistance(outline.ring, expand(rect, 4)) === 0)) continue; + let cost = CANVAS_COST * overflow(rect, canvas, 1) + PLOT_COST * overflow(rect, plot) + seat.rank + (layout.lines.length - 1) * LINE_COST; + if (best && cost >= best.cost) continue; + for (const obstacle of obstacles.near(rect)) cost += AREA_COST[obstacle.kind] * overlapArea(rect, obstacle.box); + for (const segment of segments.near(rect)) if (segmentCrossesBox(segment.a, segment.b, rect)) cost += CUT_COST; + if (best && cost >= best.cost) continue; + const centre = { x: rect.x + w / 2, y: rect.y + h / 2 }; + const leaders: CaptionPlacement['leaders'] = []; + if (linked) { + let length = 0; + for (const outline of outlines) { + const to = nearestOnRing(outline.ring, centre); + const from = portFrom(rect, to); + leaders.push({ from, to }); + length += Math.hypot(to.x - from.x, to.y - from.y); + for (const obstacle of obstacles.near(segmentBox(from, to))) if (segmentCrossesBox(from, to, obstacle.box)) cost += CROSS_COST; + for (const other of outlines) if (other !== outline && ringCrosses(other.ring, from, to)) cost += CROSS_COST; + } + cost += length / outlines.length; + for (let a = 0; a < leaders.length; a++) { + for (let b = a + 1; b < leaders.length; b++) { + if (segmentsCross(leaders[a].from, leaders[a].to, leaders[b].from, leaders[b].to)) cost += CROSS_COST; + } + } + } else { + const gap = Math.min(...outlines.map((outline) => ringDistance(outline.ring, rect))); + cost += gap; + // A caption standing off from its one outline, past where it reads as beside it, is + // joined to the outline by a leader, as a displaced caption is in Blabber. + if (outlines.length === 1 && connect !== 'none' && gap > NEAR_GAP) { + const to = nearestOnRing(outlines[0].ring, centre); + const from = portFrom(rect, to); + leaders.push({ from, to }); + cost += Math.hypot(to.x - from.x, to.y - from.y) + 30; + for (const obstacle of obstacles.near(segmentBox(from, to))) if (segmentCrossesBox(from, to, obstacle.box)) cost += CROSS_COST; + } + } + if (!best || cost < best.cost) best = { box: rect, layout: index, align: seat.align, leaders, cost }; + } + }); + return best; +} + +function ringCrosses(ring: readonly Point[], a: Point, b: Point): boolean { + for (let index = 0; index < ring.length; index++) { + if (segmentsCross(a, b, ring[index], ring[(index + 1) % ring.length])) return true; + } + return false; +} + +/** Where a leader to `to` leaves a caption: the middle of the facing edge, a few px out. */ +function portFrom(rect: Box, to: Point): Point { + if (to.y < rect.y) return { x: Math.max(rect.x, Math.min(rect.x + rect.width, to.x)), y: rect.y - PORT_GAP }; + if (to.y > rect.y + rect.height) return { x: Math.max(rect.x, Math.min(rect.x + rect.width, to.x)), y: rect.y + rect.height + PORT_GAP }; + return to.x < rect.x + ? { x: rect.x - PORT_GAP, y: rect.y + rect.height / 2 } + : { x: rect.x + rect.width + PORT_GAP, y: rect.y + rect.height / 2 }; +} diff --git a/packages/flint-js/src/core/annotation/geometry.ts b/packages/flint-js/src/core/annotation/geometry.ts new file mode 100644 index 00000000..6a9a93d3 --- /dev/null +++ b/packages/flint-js/src/core/annotation/geometry.ts @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** A point in the drawing, in px, y downward. */ +export interface Point { + x: number; + y: number; +} + +/** An axis-aligned box in the drawing, in px. */ +export interface Box { + x: number; + y: number; + width: number; + height: number; +} + +/** + * The mark a note points at, as its visible outline: a circle (a scatter dot, a line's point) or a + * rectangle (a bar, a cell), by its centre and half extents. An ellipse is a circle with unequal + * half extents. + */ +export interface NoteTarget { + shape: 'circle' | 'rect'; + x: number; + y: number; + rx: number; + ry: number; +} + +export function boxCenter(box: Box): Point { + return { x: box.x + box.width / 2, y: box.y + box.height / 2 }; +} + +export function overlapArea(a: Box, b: Box): number { + const width = Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x); + const height = Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y); + return width > 0 && height > 0 ? width * height : 0; +} + +/** The clear distance between two boxes; 0 where they touch or overlap. */ +export function boxDistance(a: Box, b: Box): number { + const dx = Math.max(b.x - a.x - a.width, a.x - b.x - b.width, 0); + const dy = Math.max(b.y - a.y - a.height, a.y - b.y - b.height, 0); + return Math.hypot(dx, dy); +} + +/** How far a box runs past another it should stay inside, summed over its four sides. */ +export function overflow(inner: Box, outer: Box, margin = 0): number { + return Math.max(0, outer.x + margin - inner.x) + + Math.max(0, inner.x + inner.width - (outer.x + outer.width - margin)) + + Math.max(0, outer.y + margin - inner.y) + + Math.max(0, inner.y + inner.height - (outer.y + outer.height - margin)); +} + +/** How far a target's outline stands from its centre along the unit vector (ux, uy). */ +export function rimExtent(target: NoteTarget, ux: number, uy: number): number { + const rx = Math.max(target.rx, 1e-6); + const ry = Math.max(target.ry, 1e-6); + if (target.shape === 'circle') return 1 / Math.sqrt((ux * ux) / (rx * rx) + (uy * uy) / (ry * ry)); + const tx = Math.abs(ux) > 1e-9 ? rx / Math.abs(ux) : Infinity; + const ty = Math.abs(uy) > 1e-9 ? ry / Math.abs(uy) : Infinity; + return Math.min(tx, ty); +} + +/** Where the ray from a target's centre toward `toward` leaves its outline: a leader's tip. */ +export function rimPoint(target: NoteTarget, toward: Point): Point { + const dx = toward.x - target.x; + const dy = toward.y - target.y; + const length = Math.hypot(dx, dy) || 1; + const extent = rimExtent(target, dx / length, dy / length); + return { x: target.x + (dx / length) * extent, y: target.y + (dy / length) * extent }; +} + +/** The target's bounding box. */ +export function targetBox(target: NoteTarget): Box { + return { x: target.x - target.rx, y: target.y - target.ry, width: target.rx * 2, height: target.ry * 2 }; +} + +/** The clear distance from a target's visible outline to a box; 0 where the box touches or covers it. */ +export function targetGap(target: NoteTarget, box: Box): number { + if (target.shape === 'rect') return boxDistance(box, targetBox(target)); + const nearest = { + x: Math.min(Math.max(target.x, box.x), box.x + box.width), + y: Math.min(Math.max(target.y, box.y), box.y + box.height), + }; + const dx = nearest.x - target.x; + const dy = nearest.y - target.y; + const distance = Math.hypot(dx, dy); + if (distance < 1e-9) return 0; + return Math.max(0, distance - rimExtent(target, dx / distance, dy / distance)); +} + +/** + * A box of the given size set along the direction (ux, uy) from the target's centre, as near as it + * can stand while keeping `gap` clear of the outline — a seat. Found by bisection on the distance + * of the box's centre, which the clear gap grows with along any one direction. + */ +export function seatBox(target: NoteTarget, width: number, height: number, ux: number, uy: number, gap: number): Box { + const at = (distance: number): Box => ({ + x: target.x + ux * distance - width / 2, + y: target.y + uy * distance - height / 2, + width, + height, + }); + let low = 0; + let high = Math.hypot(target.rx + width, target.ry + height) + gap + 1; + for (let step = 0; step < 24; step++) { + const middle = (low + high) / 2; + if (targetGap(target, at(middle)) >= gap) high = middle; + else low = middle; + } + return at(high); +} + +/** + * Where a leader leaves its caption: the ray from the caption's centre toward the target crosses the + * caption's edge there, so a caption beside its mark is met at mid-height and one above or below at + * the middle of its top or bottom — the point the reader's eye would draw from. + */ +export function portToward(box: Box, target: Point): Point { + const center = boxCenter(box); + const dx = target.x - center.x; + const dy = target.y - center.y; + if (Math.abs(dx) < 1e-9 && Math.abs(dy) < 1e-9) return center; + const sx = Math.abs(dx) > 1e-9 ? (box.width / 2) / Math.abs(dx) : Infinity; + const sy = Math.abs(dy) > 1e-9 ? (box.height / 2) / Math.abs(dy) : Infinity; + const scale = Math.min(sx, sy, 1); + return { x: center.x + dx * scale, y: center.y + dy * scale }; +} + +/** Whether the segment from `a` to `b` passes through the box (Liang–Barsky clip). */ +export function segmentCrossesBox(a: Point, b: Point, box: Box): boolean { + const dx = b.x - a.x; + const dy = b.y - a.y; + let enter = 0; + let leave = 1; + const clip = (direction: number, offset: number): boolean => { + if (Math.abs(direction) < 1e-12) return offset >= 0; + const ratio = offset / direction; + if (direction < 0) enter = Math.max(enter, ratio); + else leave = Math.min(leave, ratio); + return enter <= leave; + }; + return clip(-dx, a.x - box.x) && clip(dx, box.x + box.width - a.x) + && clip(-dy, a.y - box.y) && clip(dy, box.y + box.height - a.y); +} + +/** Whether two segments cross at a point inside both (touching ends do not count). */ +export function segmentsCross(a: Point, b: Point, c: Point, d: Point): boolean { + const side = (p: Point, q: Point, r: Point) => (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x); + const d1 = side(c, d, a); + const d2 = side(c, d, b); + const d3 = side(a, b, c); + const d4 = side(a, b, d); + return d1 * d2 < 0 && d3 * d4 < 0; +} + +/** The smallest absolute difference between two angles, in radians. */ +export function angularDistance(a: number, b: number): number { + const difference = Math.abs(a - b) % (Math.PI * 2); + return Math.min(difference, Math.PI * 2 - difference); +} + +/** + * Boxes bucketed on a uniform grid, so a seat tests only the ink near it: a caption search over a + * dense chart touches a few cells' worth of marks per seat rather than all of them. + */ +export class BoxIndex { + private readonly cells = new Map(); + private readonly stamp = new Map(); + private query = 0; + + constructor(readonly items: readonly T[], private readonly size = 32) { + for (const item of items) { + const { box } = item; + if (![box.x, box.y, box.width, box.height].every(Number.isFinite)) continue; + for (let cx = Math.floor(box.x / size); cx <= Math.floor((box.x + box.width) / size); cx++) { + for (let cy = Math.floor(box.y / size); cy <= Math.floor((box.y + box.height) / size); cy++) { + const key = cx * 100_003 + cy; + const cell = this.cells.get(key); + if (cell) cell.push(item); + else this.cells.set(key, [item]); + } + } + } + } + + /** Every item whose box shares a grid cell with `box`, each once. */ + near(box: Box): T[] { + const found: T[] = []; + const query = ++this.query; + const { size } = this; + for (let cx = Math.floor(box.x / size); cx <= Math.floor((box.x + box.width) / size); cx++) { + for (let cy = Math.floor(box.y / size); cy <= Math.floor((box.y + box.height) / size); cy++) { + const cell = this.cells.get(cx * 100_003 + cy); + if (!cell) continue; + for (const item of cell) { + if (this.stamp.get(item) === query) continue; + this.stamp.set(item, query); + found.push(item); + } + } + } + return found; + } +} + +/** A segment's box, for indexing. */ +export function segmentBox(a: Point, b: Point): Box { + return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) }; +} diff --git a/packages/flint-js/src/core/annotation/index.ts b/packages/flint-js/src/core/annotation/index.ts new file mode 100644 index 00000000..d43066ac --- /dev/null +++ b/packages/flint-js/src/core/annotation/index.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Notes that name one mark: where the caption stands, whether a leader joins it to the mark, and how + * it is set. A lightweight start on Blabber-style annotation — greedy, one note at a time. + */ +export * from './color'; +export * from './enclose'; +export * from './geometry'; +export * from './place'; +export * from './region'; +export * from './room'; +export * from './style'; diff --git a/packages/flint-js/src/core/annotation/place.ts b/packages/flint-js/src/core/annotation/place.ts new file mode 100644 index 00000000..e60cb23d --- /dev/null +++ b/packages/flint-js/src/core/annotation/place.ts @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + angularDistance, + boxDistance, + overflow, + overlapArea, + portToward, + rimPoint, + seatBox, + segmentCrossesBox, + segmentsCross, + targetGap, + type Box, + type NoteTarget, + type Point, +} from './geometry'; + +/** + * Where a note that names one mark stands, and whether a leader joins them. A lightweight reading of + * Blabber's caption placement (the `blabber` placement notes): the caption is set at a ring of + * seats round the mark's visible outline, each a few px further out, and the one with the least cost + * is kept — one note at a time, no joint search. The cost is tiered so a fault of meaning always + * outranks a tidiness term: running off the canvas, then covering ink (marks and text by the area + * hidden, a thin line by being cut), then distance from the mark and the leader it needs, then a + * preferred side. + */ + +/** What a caption must not cover: a mark, a piece of text (axis labels, a legend), or faint ink. */ +export interface NoteObstacle { + box: Box; + kind: 'mark' | 'text' | 'faint'; +} + +/** Thin ink a caption should not cut: a line between two of its points, a rule, an axis domain. */ +export interface NoteSegment { + a: Point; + b: Point; +} + +export interface PlaceNoteInput { + /** The mark the note names. */ + target: NoteTarget; + /** + * The rest of the mark where the note names one end of it — a bar whose value end is the target: + * a caption keeps off it as off any mark, but standing beside it is no ambiguity. + */ + body?: Box; + /** The caption's box size, its halo included. */ + label: { width: number; height: number }; + /** The plot the caption should stay within, and the canvas it must. */ + plot: Box; + canvas: Box; + obstacles?: readonly NoteObstacle[]; + segments?: readonly NoteSegment[]; + /** The side the mark's own geometry suggests (a bar's value end), in radians, y downward. */ + preferredAngle?: number; + /** `'none'` never draws a leader; `'auto'` draws one only where the caption is not plainly beside its mark. */ + connector?: 'auto' | 'none'; + /** The caption's font size, in px: a bar's direct seats stand off by multiples of it. */ + fontSize?: number; + /** + * Seats on the mark itself: the caption centred at `point`, with no leader, where `fits` says its + * box lies inside the room (a big slice's band, a donut's hole, a long bar). Its halo keeps the + * words readable on the fill, and standing on the mark names it outright, so such a seat beats a + * long leader and any seat over text. `own` lists boxes the seat may cover at no cost (the mark). + */ + inside?: readonly { point: Point; fits: (box: Box) => boolean; own?: readonly Box[]; fill?: string }[]; + /** Offer only the `inside` seats: the anchor names its mark from on it, not from around it. */ + insideOnly?: boolean; +} + +/** + * A leader from a caption (`from`) to its mark (`to`), turning at its `elbows` (in order from the + * caption to the mark) where it has any. + */ +export interface NoteLeader { + from: Point; + to: Point; + elbows?: readonly Point[]; +} + +/** A leader's straight runs, from the caption to the mark. */ +export function leaderSegments(leader: NoteLeader): NoteSegment[] { + const points = [leader.from, ...(leader.elbows ?? []), leader.to]; + return points.slice(1).map((point, index) => ({ a: points[index], b: point })); +} + +export interface NotePlacement { + box: Box; + /** How the caption's lines align: toward the mark beside it, centred above or below it. */ + align: 'left' | 'center' | 'right'; + /** + * From the caption's edge to the mark's outline, where one is drawn. It leaves the outline square + * to it: where the caption is not straight out from the side it names, the leader runs out from + * that side first and turns at its `elbows`, square, so it is never drawn along the mark's own edge. + */ + leader?: NoteLeader; + /** The seat's direction from the mark's centre, in radians, and its clear gap from the outline, in px. */ + angle: number; + gap: number; + cost: number; + /** What the seat covers: px² of text under it, and whether it runs past the canvas. */ + covers?: { text: number; offCanvas: boolean }; + /** The caption stands on the mark itself. */ + inside?: boolean; + /** The mark's fill under a caption that stands on it: the caption is set in an ink that reads on it, with no halo. */ + insideFill?: string; + /** No seat kept the chart's text readable on the canvas: the mark is pointed at by its highlight alone. */ + unplaced?: boolean; +} + +/** Directions round the mark, every 22.5°. */ +const DIRECTIONS = Array.from({ length: 16 }, (_, index) => (index * Math.PI * 2) / 16); +/** Clear gaps from the mark's outline, in px: near seats first, as association is meaning. */ +const GAPS = [2, 5, 9, 14, 20, 28, 40, 56]; +/** A caption nearer its mark than this needs no leader, unless another mark is about as near. */ +const MAX_UNLED_GAP = 10; +/** A leader shorter than this reads as a stub. */ +const MIN_LEADER = 6; +/** Up to this reach the eye carries from caption to mark in one movement. */ +const COMFORTABLE_REACH = 34; + +const COST = { + canvas: 10_000, + plot: 40, + /** Per px² of ink hidden. Text is the dearest: a covered axis label is a lost value. */ + area: { mark: 8, text: 25, faint: 1 }, + /** Per thin line the caption cuts. */ + cut: 250, + /** Per mark, piece of text or line a leader runs across. */ + leaderCross: 150, + leaderFixed: 30, + leaderLength: 1.5, + /** Per px² beyond a comfortable reach: past it, a leader is a hunt across the plot. */ + leaderReach: 0.06, + stub: 200, + /** Per turn a leader takes: a straight one reads quicker. */ + elbow: 12, + /** A seat on the mark: dearer than a near empty seat, cheaper than a leader across the chart. */ + inside: 45, + gapLinear: 1.2, + gapSquare: 0.3, + /** Per radian away from the side the mark suggests. */ + preferred: 25, + /** Per radian away from above-right, the conventional reading side, where nothing else decides. */ + reading: 2, + /** + * A seat round a bar's value end where the face itself offers a direct seat: Blabber offers the + * value-face centre first and the ring only as an escape. + */ + escape: 300, +}; + +/** A place a caption may stand: its box, its direction and gap from the mark, how its lines align. */ +interface Seat { + box: Box; + angle: number; + gap: number; + align: NotePlacement['align']; + /** A direct seat past a bar's value face, with the leader it always draws. */ + direct?: NoteLeader; + escape?: boolean; + /** A seat on the mark: no leader, no gap cost, its own boxes not charged. */ + inside?: readonly Box[]; + /** The fill the caption stands on, where the seat is on the mark's paint. */ + fill?: string; +} + +/** + * The side a bar's value face looks toward, from its body: the face a note on the bar's end names, an + * edge of no width across the bar. Undefined for any other target. + */ +function valueDirection(target: NoteTarget, body: Box | undefined): Point | undefined { + if (!body || target.shape !== 'rect' || (target.rx > 0 && target.ry > 0)) return undefined; + const dx = target.x - (body.x + body.width / 2); + const dy = target.y - (body.y + body.height / 2); + if (target.rx === 0 && Math.abs(dx) > 1e-6) return { x: Math.sign(dx), y: 0 }; + if (target.ry === 0 && Math.abs(dy) > 1e-6) return { x: 0, y: Math.sign(dy) }; + return undefined; +} + +/** How far past a bar's value face a direct seat stands, in font sizes (Blabber's bar routes). */ +const FACE_REACHES = [0.9, 1.5, 2.5, 4, 6, 8]; +/** The clear gap between a caption and the leader that leaves it, in px. */ +const PORT_GAP = 2.5; + +/** + * Blabber's direct routes for a caption on a bar's value: the caption past the value face, centred on + * it and free to slide aside as far as its own edge, with a straight leader from the caption to the + * face's centre. A vertical bar's caption is centred over the face, a horizontal bar's beside it. + */ +function faceSeats( + target: NoteTarget, label: { width: number; height: number }, forward: Point, fontSize: number, canvas: Box, +): Seat[] { + const vertical = forward.x === 0; + const sign = vertical ? forward.y : forward.x; + const face = { x: target.x, y: target.y }; + const extent = vertical ? label.width : label.height; + const centre = vertical ? face.x : face.y; + const lo = vertical ? canvas.x : canvas.y; + const hi = lo + (vertical ? canvas.width : canvas.height); + const fitShift = Math.max(lo + extent / 2, Math.min(hi - extent / 2, centre)) - centre; + const edgeSlide = Math.max(0, extent / 2 - Math.min(6, extent / 4)); + const seats: Seat[] = []; + for (const reach of FACE_REACHES.map((multiple) => multiple * fontSize)) { + const slides = new Set([fitShift, ...[0, -0.5, 0.5, -1, 1].map((fraction) => fraction * reach), + ...[-1, -0.5, 0.5, 1].map((fraction) => fraction * edgeSlide)]); + for (const slide of slides) { + const box: Box = vertical + ? { x: face.x - label.width / 2 + slide, y: sign < 0 ? face.y - reach - label.height : face.y + reach, ...label } + : { x: sign < 0 ? face.x - reach - label.width : face.x + reach, y: face.y - label.height / 2 + slide, ...label }; + const from = vertical + ? { x: Math.max(box.x + 0.5, Math.min(box.x + box.width - 0.5, face.x)), y: sign < 0 ? box.y + box.height + PORT_GAP : box.y - PORT_GAP } + : { x: sign < 0 ? box.x + box.width + PORT_GAP : box.x - PORT_GAP, y: Math.max(box.y + 0.5, Math.min(box.y + box.height - 0.5, face.y)) }; + seats.push({ + box, angle: Math.atan2(forward.y, forward.x), gap: reach, align: vertical ? 'center' : sign < 0 ? 'right' : 'left', + direct: { from, to: face }, + }); + } + } + return seats; +} + +/** + * How near a mark that is not its own may stand before the caption could be read as naming it: two + * thirds of a line, between 6 and 12 px. + */ +function associationMargin(height: number): number { + return Math.max(6, Math.min(12, height * 0.65)); +} + +function textAlign(angle: number): NotePlacement['align'] { + const cos = Math.cos(angle); + return cos > 0.38 ? 'left' : cos < -0.38 ? 'right' : 'center'; +} + +/** How far a leader runs straight out from the side it names before it turns, in font sizes; at least 6 px. */ +const ELBOW_REACH = 0.7; +/** A leader that meets a side at more than this from square to it (60°) runs out square first. */ +const GRAZING_COS = 0.5; + +/** + * A leader that leaves `to`, on a side whose outward normal is `normal` (one axis), square to it. A + * caption straight out from the side is joined by one straight run. Otherwise the leader runs out a + * stub to an elbow and turns there: on toward a caption beyond the elbow; straight across into the + * caption's near edge where the caption spans the elbow (a caption below a bar's end, under it); or + * square again, along and then into its side, where it does not — never back along the mark's edge. + */ +function squareLeader(to: Point, normal: Point, box: Box, reach: number): NoteLeader { + const centre = { x: box.x + box.width / 2, y: box.y + box.height / 2 }; + const along = (centre.x - to.x) * normal.x + (centre.y - to.y) * normal.y; + const across = Math.abs((centre.x - to.x) * normal.y - (centre.y - to.y) * normal.x); + if (along >= reach && across <= along * 0.27) return { from: portToward(box, to), to }; + const elbow = { x: to.x + normal.x * reach, y: to.y + normal.y * reach }; + // Where the caption's near edge lies past the elbow, the leader turns toward it from there. + const near = normal.x !== 0 + ? (normal.x > 0 ? box.x - elbow.x : elbow.x - (box.x + box.width)) + : (normal.y > 0 ? box.y - elbow.y : elbow.y - (box.y + box.height)); + if (near >= 0) return { from: portToward(box, elbow), to, elbows: [elbow] }; + if (normal.x !== 0) { + if (box.x <= elbow.x && elbow.x <= box.x + box.width) { + return { from: { x: elbow.x, y: centre.y > elbow.y ? box.y - PORT_GAP : box.y + box.height + PORT_GAP }, to, elbows: [elbow] }; + } + const side = elbow.x < box.x ? box.x - PORT_GAP : box.x + box.width + PORT_GAP; + const from = { x: side, y: centre.y }; + return { from, to, elbows: [{ x: elbow.x, y: centre.y }, elbow] }; + } + if (box.y <= elbow.y && elbow.y <= box.y + box.height) { + return { from: { x: centre.x > elbow.x ? box.x - PORT_GAP : box.x + box.width + PORT_GAP, y: elbow.y }, to, elbows: [elbow] }; + } + const side = elbow.y < box.y ? box.y - PORT_GAP : box.y + box.height + PORT_GAP; + return { from: { x: centre.x, y: side }, to, elbows: [{ x: centre.x, y: elbow.y }, elbow] }; +} + +/** + * The leader from a caption to its mark, leaving the mark square to the side it names. A bar's value + * face (`forward`, the way it looks) is named at its centre and left along the bar. Any other + * rectangle is met at its outline, and left square to the side it meets where a straight leader + * would graze it. A dot or a point is met straight. + */ +function leaderTo(target: NoteTarget, box: Box, forward: Point | undefined, reach: number): NoteLeader { + if (forward) return squareLeader({ x: target.x, y: target.y }, forward, box, reach); + const from = portToward(box, target); + const to = rimPoint(target, from); + if (target.shape !== 'rect' || target.rx <= 0 || target.ry <= 0) return { from, to }; + const on = (a: number, b: number) => Math.abs(a - b) < 0.5; + const nx = on(to.x, target.x + target.rx) ? 1 : on(to.x, target.x - target.rx) ? -1 : 0; + const ny = on(to.y, target.y + target.ry) ? 1 : on(to.y, target.y - target.ry) ? -1 : 0; + // A corner is left diagonally, which grazes neither side. + if ((nx === 0) === (ny === 0)) return { from, to }; + const length = Math.hypot(from.x - to.x, from.y - to.y) || 1; + if (((from.x - to.x) * nx + (from.y - to.y) * ny) / length >= GRAZING_COS) return { from, to }; + return squareLeader(to, { x: nx, y: ny }, box, reach); +} + +const sameBox = (a: Box, b: Box): boolean => + Math.abs(a.x - b.x) < 0.5 && Math.abs(a.y - b.y) < 0.5 && Math.abs(a.width - b.width) < 0.5 && Math.abs(a.height - b.height) < 0.5; + +export function placeNote(input: PlaceNoteInput): NotePlacement { + const { target, label, plot, canvas } = input; + const obstacles = input.obstacles ?? []; + const segments = input.segments ?? []; + const leaderAllowed = input.connector !== 'none'; + const margin = associationMargin(label.height); + const fontSize = input.fontSize ?? 11; + // Only what stands near the ring can touch a seat: the rest is left out of every test. + const reach = Math.max(label.width, label.height) + Math.max(GAPS[GAPS.length - 1], 8 * fontSize) + Math.max(target.rx, target.ry) + 4; + const near = (box: Box) => Math.abs(box.x + box.width / 2 - target.x) <= reach + box.width / 2 + && Math.abs(box.y + box.height / 2 - target.y) <= reach + box.height / 2; + const nearObstacles = obstacles.filter((obstacle) => near(obstacle.box)); + const nearSegments = segments.filter((segment) => near({ + x: Math.min(segment.a.x, segment.b.x), y: Math.min(segment.a.y, segment.b.y), + width: Math.abs(segment.b.x - segment.a.x), height: Math.abs(segment.b.y - segment.a.y), + })); + // Faint marks — dimmed, or cells under a halo — can still be read as the one named. + const marks = nearObstacles.filter((obstacle) => obstacle.kind !== 'text'); + + // A note on a bar's value: the value face first, the ring round the end only as an escape. + const forward = leaderAllowed ? valueDirection(target, input.body) : undefined; + const seats: Seat[] = forward ? faceSeats(target, label, forward, fontSize, canvas) : []; + for (const room of input.inside ?? []) { + const box = { x: room.point.x - label.width / 2, y: room.point.y - label.height / 2, width: label.width, height: label.height }; + if (room.fits(box)) seats.push({ box, angle: 0, gap: 0, align: 'center', inside: room.own ?? [], ...(room.fill ? { fill: room.fill } : {}) }); + } + for (const angle of input.insideOnly ? [] : DIRECTIONS) { + const ux = Math.cos(angle); + const uy = Math.sin(angle); + for (const gap of GAPS) { + seats.push({ + box: seatBox(target, label.width, label.height, ux, uy, gap), angle, gap, align: textAlign(angle), + ...(forward ? { escape: true } : {}), + }); + } + } + + let best: NotePlacement | undefined; + for (const seat of seats) { + const { box, angle, gap } = seat; + // A direct seat may stand past the plot in the paper the chart keeps, as Blabber's does. + let cost = COST.canvas * overflow(box, canvas, 1) + (seat.direct ? 0 : COST.plot * overflow(box, plot)); + if (seat.escape) cost += COST.escape; + if (seat.inside) cost += COST.inside; + if (best && cost >= best.cost) continue; + let textCover = 0; + for (const obstacle of nearObstacles) { + if (seat.inside?.some((own) => sameBox(own, obstacle.box))) continue; + const area = overlapArea(box, obstacle.box); + if (obstacle.kind === 'text') textCover += area; + cost += COST.area[obstacle.kind] * area; + } + if (input.body && !seat.inside) cost += COST.area.mark * overlapArea(box, input.body); + for (const segment of nearSegments) if (segmentCrossesBox(segment.a, segment.b, box)) cost += COST.cut; + if (best && cost >= best.cost) continue; + let drawn: NotePlacement['leader']; + let ambiguous = false; + if (seat.direct) drawn = seat.direct; + else if (seat.inside) { /* on the mark: no leader, nothing to be ambiguous with */ } + else { + // Another mark about as near as its own makes the caption ambiguous without a leader. + const own = targetGap(target, box); + ambiguous = marks.some((mark) => boxDistance(box, mark.box) < own + margin); + if (leaderAllowed && (gap > MAX_UNLED_GAP || ambiguous)) { + drawn = leaderTo(target, box, forward, Math.max(6, ELBOW_REACH * fontSize)); + } + cost += COST.gapLinear * gap + COST.gapSquare * gap * gap; + } + if (drawn) { + const runs = leaderSegments(drawn); + const length = runs.reduce((sum, run) => sum + Math.hypot(run.a.x - run.b.x, run.a.y - run.b.y), 0); + cost += COST.leaderFixed + COST.elbow * (drawn.elbows?.length ?? 0) + COST.leaderLength * length + + COST.leaderReach * Math.max(0, length - COMFORTABLE_REACH) ** 2; + if (length < MIN_LEADER && !seat.direct) cost += COST.stub; + for (const run of runs) { + for (const obstacle of nearObstacles) if (segmentCrossesBox(run.a, run.b, obstacle.box)) cost += COST.leaderCross; + for (const segment of nearSegments) if (segmentsCross(run.a, run.b, segment.a, segment.b)) cost += COST.leaderCross; + } + } else if (ambiguous) { + // Without a leader to say which, a caption between two marks names neither. + cost += COST.stub * 2; + } + if (!seat.direct && !seat.inside) { + if (input.preferredAngle !== undefined) cost += COST.preferred * angularDistance(angle, input.preferredAngle); + cost += COST.reading * angularDistance(angle, -Math.PI / 4); + } + if (!best || cost < best.cost) { + best = { + box, align: seat.align, ...(drawn ? { leader: drawn } : {}), angle, gap, cost, + covers: { text: textCover, offCanvas: overflow(box, canvas, 1) > 0 }, + ...(seat.inside ? { inside: true } : {}), + ...(seat.fill ? { insideFill: seat.fill } : {}), + }; + } + } + // An anchor that offers only seats on its mark, none of which fit, places nothing. + return best ?? { box: { x: target.x, y: target.y, width: 0, height: 0 }, align: 'center', angle: 0, gap: 0, cost: Infinity }; +} diff --git a/packages/flint-js/src/core/annotation/region.ts b/packages/flint-js/src/core/annotation/region.ts new file mode 100644 index 00000000..654db509 --- /dev/null +++ b/packages/flint-js/src/core/annotation/region.ts @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BoxIndex, overflow, overlapArea, segmentBox, segmentCrossesBox, type Box, type Point } from './geometry'; +import type { CaptionLayout, CaptionPlacement } from './enclose'; +import type { NoteObstacle, NoteSegment } from './place'; + +/** + * A shaded stretch of the plot and its caption, after Blabber's `region`. The stretch is cut to the + * plot; its caption is seated by Blabber's rules, priced against the chart's ink as boxes and lines + * rather than rendered pixels, and the cheapest kept: + * - a period (an x stretch): centred on the stretch and slid back inside the plot; above or below the + * series it crosses, on the side with more room, then anywhere up the column; with no series under + * it, in the middle of the stretch, then at its top or foot; past the plot's top as a last resort. + * - a band of values (a y stretch): across it and just above or below it. + * - a box (both axes, or a `placement` within it): anywhere inside, nearest the asked-for spot, and + * only where nothing inside is clear, outside it with a straight leader. + */ + +export type RegionPlacement = 'top' | 'bottom' | 'left' | 'right' | 'center' | 'above' | 'below'; + +export interface RegionCaptionInput { + region: Box; + /** Which axes the stretch is bounded on. */ + axes: { x: boolean; y: boolean }; + /** Each layout the caption may take, the first preferred. */ + layouts: readonly CaptionLayout[]; + plot: Box; + canvas: Box; + obstacles?: readonly NoteObstacle[]; + segments?: readonly NoteSegment[]; + /** The series' vertices, for the envelope a period's caption keeps clear of. */ + vertices?: readonly Point[]; + placement?: RegionPlacement; +} + +/** Per px² hidden; tiled cells are data too, so a caption over them costs as over any mark. */ +const AREA_COST = { mark: 8, text: 25, faint: 8 }; +const CUT_COST = 250; +const CANVAS_COST = 10_000; +/** A caption inside its own region, clear of the data, is preferred to one standing outside on a leader. */ +const OUTSIDE_COST = 400; +const INSET = 4; +const LEADER_GAP = 18; + +interface Seat { + box: Box; + layout: number; + rank: number; + leader?: { from: Point; to: Point }; +} + +function nearestOnBox(box: Box, point: Point): Point { + return { + x: Math.max(box.x, Math.min(box.x + box.width, point.x)), + y: Math.max(box.y, Math.min(box.y + box.height, point.y)), + }; +} + +/** Seats for a period's caption: centred on the stretch, free to move up and down the plot. */ +function periodSeats(input: RegionCaptionInput, layout: CaptionLayout, index: number): Seat[] { + const { region, plot, vertices = [] } = input; + const { width: w, height: h } = layout; + const x = Math.max(plot.x + 2, Math.min(plot.x + plot.width - w - 2, region.x + (region.width - w) / 2)); + const seats: Seat[] = []; + let envTop = Infinity; + let envBottom = -Infinity; + for (const point of vertices) { + if (point.x < region.x - 0.5 || point.x > region.x + region.width + 0.5) continue; + envTop = Math.min(envTop, point.y); + envBottom = Math.max(envBottom, point.y); + } + const top = plot.y; + const bottom = plot.y + plot.height; + const at = (y: number, rank: number) => seats.push({ box: { x, y, width: w, height: h }, layout: index, rank }); + if (Number.isFinite(envTop)) { + const above = envTop - top; + const below = bottom - envBottom; + const margin = 10; + const room = h + 6; + const reach = 0.62; + const belowFirst = below >= above; + const underCentre = Math.min(bottom - room / 2 - 4, Math.max(envBottom + margin + room / 2, envBottom + below * reach)); + const overCentre = Math.max(top + room / 2 + 4, Math.min(envTop - margin - room / 2, envTop - above * reach)); + at((belowFirst ? underCentre : overCentre) - h / 2, 0); + at((belowFirst ? overCentre : underCentre) - h / 2, 1); + } else { + at(region.y + (region.height - h) / 2, 0); + at(region.y + INSET, 1); + at(region.y + region.height - h - INSET, 1.25); + } + // The whole column, at every height a caption could sit: ranked behind the seats above, nearer the + // top first, where a period caption reads as a heading for the stretch. + const sweep = 14; + const column = { top: Math.max(top, region.y), bottom: Math.min(bottom, region.y + region.height) }; + for (let step = 0; step <= sweep; step++) { + const t = step / sweep; + at(column.top + 4 + t * Math.max(0, column.bottom - column.top - 8 - h), 2 + t * 0.5); + } + // Past the plot, over its stretch: only where the plot has no clear place. + seats.push({ box: { x, y: plot.y - h - 8, width: w, height: h }, layout: index, rank: 20 }); + return seats; +} + +/** Seats for a band of values: across it, inside it, or just above or below it. */ +function bandSeats(input: RegionCaptionInput, layout: CaptionLayout, index: number): Seat[] { + const { region } = input; + const { width: w, height: h } = layout; + const seats: Seat[] = []; + const xs = [0.5, 0.25, 0.75, 0, 1].map((t) => region.x + INSET + t * Math.max(0, region.width - w - 2 * INSET)); + const ys = [ + region.y + (region.height - h) / 2, region.y + INSET, region.y + region.height - h - INSET, + region.y - h - INSET, region.y + region.height + INSET, + ]; + for (const x of xs) { + for (const y of ys) { + const outside = Math.max(region.y - y - h, 0, y - region.y - region.height); + const off = Math.abs(x + w / 2 - region.x - region.width / 2); + seats.push({ box: { x, y, width: w, height: h }, layout: index, rank: outside * 4 + off * 0.05 }); + } + } + return seats; +} + +/** + * Seats for a caption asked to stand `above` or `below` a region: just past its edge where the region + * has a top or a foot of its own, past the plot for a stretch that spans the plot's height. Where that + * seat is taken (the plot's header over a full-height stretch), the region's edge inside the plot. + */ +function besideSeats(input: RegionCaptionInput, layout: CaptionLayout, index: number, side: 'above' | 'below'): Seat[] { + const { region, plot, canvas } = input; + const { width: w, height: h } = layout; + const x = Math.max(canvas.x, Math.min(canvas.x + canvas.width - w, region.x + (region.width - w) / 2)); + const spansPlot = region.y <= plot.y + 0.5 && region.y + region.height >= plot.y + plot.height - 0.5; + const outside = spansPlot + ? (side === 'above' ? plot.y - h - 8 : plot.y + plot.height + 8) + : (side === 'above' ? region.y - h - INSET : region.y + region.height + INSET); + const inside = side === 'above' ? region.y + INSET : region.y + region.height - h - INSET; + return [ + { box: { x, y: outside, width: w, height: h }, layout: index, rank: 0 }, + { box: { x, y: inside, width: w, height: h }, layout: index, rank: 60 }, + ]; +} + +/** + * Seats for a box: a 9 × 9 grid inside it, drawn toward the centre (or the asked-for spot); and, for a + * box with no clear place inside, the four sides outside it, each on a straight leader to the box. + */ +function boxSeats(input: RegionCaptionInput, layout: CaptionLayout, index: number, outside = !input.placement): Seat[] { + const { region, placement } = input; + const { width: w, height: h } = layout; + const seats: Seat[] = []; + const tx = placement === 'left' ? 0 : placement === 'right' ? 1 : 0.5; + const ty = placement === 'top' ? 0 : placement === 'bottom' ? 1 : 0.5; + const pull = placement ? 1_000 : 20; + if (w <= region.width - 6 && h <= region.height - 6) { + for (let i = 0; i <= 8; i++) { + for (let j = 0; j <= 8; j++) { + const box = { + x: region.x + 6 + (region.width - w - 12) * i / 8, + y: region.y + 3 + (region.height - h - 6) * j / 8, + width: w, height: h, + }; + if (box.x < region.x + 3 || box.x + w > region.x + region.width - 3) continue; + seats.push({ box, layout: index, rank: Math.hypot(i / 8 - tx, j / 8 - ty) * pull }); + } + } + } + if (outside) { + const centre = { x: region.x + region.width / 2, y: region.y + region.height / 2 }; + for (const side of ['above', 'below', 'left', 'right'] as const) { + const box = { + x: side === 'left' ? region.x - w - LEADER_GAP : side === 'right' ? region.x + region.width + LEADER_GAP : region.x + (region.width - w) / 2, + y: side === 'above' ? region.y - h - LEADER_GAP : side === 'below' ? region.y + region.height + LEADER_GAP : region.y + (region.height - h) / 2, + width: w, height: h, + }; + const middle = { x: box.x + w / 2, y: box.y + h / 2 }; + const to = nearestOnBox(region, middle); + const from = nearestOnBox(box, to); + seats.push({ + box, layout: index, leader: { from, to }, + rank: OUTSIDE_COST + Math.hypot(middle.x - centre.x, middle.y - centre.y) * 0.5, + }); + } + } + return seats; +} + +/** Where a region's caption stands, and the leader that joins it to the region where it stands outside. */ +export function placeRegionCaption(input: RegionCaptionInput): CaptionPlacement | undefined { + const { region, layouts, plot, canvas, placement } = input; + if (layouts.length === 0) return undefined; + const seats: Seat[] = []; + layouts.forEach((layout, index) => { + const lineCost = index * 30; + let own: Seat[]; + if (placement === 'above' || placement === 'below') own = besideSeats(input, layout, index, placement); + else if (placement || (input.axes.x && input.axes.y)) own = boxSeats(input, layout, index); + else if (input.axes.x) own = periodSeats(input, layout, index); + else own = bandSeats(input, layout, index); + // A placement the region is too small to hold falls back to the region's own seats, rather + // than leave the region uncaptioned. + if (own.length === 0) { + const fallback = input.axes.x && !input.axes.y ? periodSeats(input, layout, index) + : input.axes.y && !input.axes.x ? bandSeats(input, layout, index) + : boxSeats(input, layout, index, true); + // The side asked for still leads: a caption asked for the top stands as high as it fits. + const lean = (box: Box): number => placement === 'top' ? box.y - region.y + : placement === 'bottom' ? region.y + region.height - box.y - box.height + : placement === 'left' ? box.x - region.x + : placement === 'right' ? region.x + region.width - box.x - box.width : 0; + own = fallback.map((seat) => ({ ...seat, rank: seat.rank + 40 + Math.max(0, lean(seat.box)) * 0.5 })); + } + for (const seat of own) seats.push({ ...seat, rank: seat.rank + lineCost }); + }); + const obstacles = new BoxIndex(input.obstacles ?? []); + const segments = new BoxIndex((input.segments ?? []).map((segment) => ({ ...segment, box: segmentBox(segment.a, segment.b) }))); + let best: CaptionPlacement | undefined; + for (const seat of seats) { + const { box } = seat; + let cost = CANVAS_COST * overflow(box, canvas, 1) + seat.rank; + if (best && cost >= best.cost) continue; + for (const obstacle of obstacles.near(box)) cost += AREA_COST[obstacle.kind] * overlapArea(box, obstacle.box); + for (const segment of segments.near(box)) if (segmentCrossesBox(segment.a, segment.b, box)) cost += CUT_COST; + if (seat.leader) { + const { from, to } = seat.leader; + cost += Math.hypot(to.x - from.x, to.y - from.y); + for (const obstacle of obstacles.near(segmentBox(from, to))) if (obstacle.kind !== 'faint' && segmentCrossesBox(from, to, obstacle.box)) cost += 150; + } + if (!best || cost < best.cost) { + best = { box, layout: seat.layout, align: 'center', leaders: seat.leader ? [seat.leader] : [], cost }; + } + } + return best; +} + +/** + * The pixel span of one axis's stretch, from the axis's own reading of its values: + * - banded (`step` given): the categories' positions, their whole bands covered; they must stand + * next to each other in the axis's order, or the span is refused (shading the ones between would + * say what the author did not). + * - continuous: two bounds, either `null` for the axis's end on that side. + * The span is then cut to the axis's range. Undefined where a value is not on the axis. + */ +export function regionSpan( + bounds: readonly unknown[], + axis: { + /** The pixel a value stands at: a band's centre on a banded axis. Undefined off the axis. */ + position: (value: unknown) => number | undefined; + /** The axis's range, in px, in either order. */ + range: readonly [number, number]; + /** The domain's two ends, low then high, on a continuous axis. */ + ends?: readonly [unknown, unknown]; + /** On a banded axis: each category's index in the axis's order, and the band's step in px. */ + index?: (value: unknown) => number; + step?: number; + }, +): { span?: [number, number]; problem?: string } { + const lo = Math.min(axis.range[0], axis.range[1]); + const hi = Math.max(axis.range[0], axis.range[1]); + const clip = (a: number, b: number): [number, number] => [Math.max(lo, Math.min(a, b)), Math.min(hi, Math.max(a, b))]; + if (axis.step !== undefined && axis.index) { + const indices = bounds.map(axis.index); + if (indices.some((index) => index < 0)) return { problem: `${String(bounds[indices.findIndex((index) => index < 0)])} is not a category on this axis.` }; + const sorted = [...new Set(indices)].sort((a, b) => a - b); + if (sorted.some((index, at) => at > 0 && index !== sorted[at - 1] + 1)) { + return { problem: 'the categories are not next to each other: list every category the region covers, or shade each run with its own region, so the ones between are not shaded.' }; + } + const centres = bounds.map(axis.position).filter((value): value is number => value !== undefined && Number.isFinite(value)); + if (centres.length === 0) return { problem: 'none of the categories is on this axis.' }; + return { span: clip(Math.min(...centres) - axis.step / 2, Math.max(...centres) + axis.step / 2) }; + } + if (bounds.length !== 2) return { problem: 'a continuous axis takes exactly two bounds, [low, high].' }; + const [low, high] = bounds; + const lowPixel = low === null || low === undefined ? axis.position(axis.ends?.[0]) : axis.position(low); + const highPixel = high === null || high === undefined ? axis.position(axis.ends?.[1]) : axis.position(high); + if (lowPixel === undefined || highPixel === undefined || !Number.isFinite(lowPixel) || !Number.isFinite(highPixel)) { + return { problem: `${String(low)} to ${String(high)} is not on this axis.` }; + } + const span = clip(lowPixel, highPixel); + if (span[1] - span[0] <= 0) return { problem: `${String(low)} to ${String(high)} lies outside the plot.` }; + return { span }; +} diff --git a/packages/flint-js/src/core/annotation/room.ts b/packages/flint-js/src/core/annotation/room.ts new file mode 100644 index 00000000..f799ee58 --- /dev/null +++ b/packages/flint-js/src/core/annotation/room.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { NOTE_WRAP_WIDTHS, SHORT_NOTE, balanceNote, noteSize, noteStyle, type ChartTextStyle } from './style'; + +/** The placer's nearest direct seat over a bar's value, in font sizes, and the leader's gap at the caption, in px. */ +const NEAREST_REACH = 0.9; +const PORT_GAP = 2.5; + +/** + * Room a chart makes for the notes it is drawn with. A caption at a mark on the edge of the plot — + * the tallest bar, the highest point — has nowhere to stand at the mark's end, so it stands off + * with a leader or over a neighbour. The chart can make that room instead: its measure axis runs on + * past the noted value, to a round tick, far enough for the caption. Bars keep their proportions, + * since every bar is read from the same baseline; the plot only gives a share of its length to the + * caption, and never more than `maxShare` (a third) of it. + */ + +/** + * The px a note needs past the top of its mark: its caption's height at the widest house wrap, as the + * overlay prefers it, and the nearest of the placer's direct seats over a bar's value: + * 0.9 of a font size past the face, plus the leader's gap at the caption. No more: room past what + * the caption stands in is empty plot. + */ +export function noteRoomNeed(text: string, chart: ChartTextStyle, measureAt: (fontSize: number) => (text: string) => number): number { + return captionHeight(text, chart, measureAt) + noteStyle(chart).fontSize * NEAREST_REACH + PORT_GAP; +} + +/** The caption's height at the widest house wrap, which the overlays prefer. */ +function captionHeight(text: string, chart: ChartTextStyle, measureAt: (fontSize: number) => (text: string) => number): number { + const style = noteStyle(chart); + const measure = measureAt(style.fontSize); + const short = text.length <= SHORT_NOTE && !text.includes('\n'); + // The overlay prefers the fewest lines that fit, so the room is for the widest house wrap. + const lines = balanceNote(text, short ? Infinity : NOTE_WRAP_WIDTHS[0], measure); + return noteSize(lines, style, measure).height; +} + +/** The caption's inset from the plot's top at the region placer's highest seat, and its air over the marks beneath. */ +const REGION_INSET = 4; +const REGION_AIR = 8; + +/** + * The px a period's caption needs over the marks in its stretch: its height, as the overlay lays it, + * at the placer's highest seat in the stretch (just inside the plot's top) with air beneath it, so + * it reads over the stretch rather than over the marks. + */ +export function regionRoomNeed(text: string, chart: ChartTextStyle, measureAt: (fontSize: number) => (text: string) => number): number { + return REGION_INSET + captionHeight(text, chart, measureAt) + REGION_AIR; +} + +/** + * The domain end that leaves `need` px between `value` and that end of an axis `length` px long, or + * undefined where the room is already there or would take more than `maxShare` of the axis. With the + * other end held at `fixed`, a share `s = need / length` of the axis past `value` puts the end at + * `(value − s·fixed) / (1 − s)`. + */ +export function roomPast( + value: number, + domain: readonly [number, number], + length: number, + need: number, + end: 'max' | 'min', + maxShare = 1 / 3, +): number | undefined { + const [lo, hi] = domain; + const span = hi - lo; + if (!(span > 0) || !(length > 0) || !(need > 0)) return undefined; + const room = end === 'max' ? ((hi - value) / span) * length : ((value - lo) / span) * length; + if (room >= need) return undefined; + const share = need / length; + if (share > maxShare) return undefined; + return end === 'max' ? (value - share * lo) / (1 - share) : (value - share * hi) / (1 - share); +} diff --git a/packages/flint-js/src/core/annotation/style.ts b/packages/flint-js/src/core/annotation/style.ts new file mode 100644 index 00000000..9b78d1ff --- /dev/null +++ b/packages/flint-js/src/core/annotation/style.ts @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { neutralInk } from './color'; + +/** + * How a note that names a mark is set: as words beside the mark, not a card over the chart. The + * words take the chart's own label face and weight (its axis labels', not its title's) a size up, + * in the primary text ink, with a halo of the background behind the glyphs so they read over + * gridlines and marks; a leader, where one is drawn, is a thin line of the neutral grey. + */ +export interface NoteStyle { + font: string; + fontSize: number; + fontWeight: number | string; + color: string; + /** Distance between baselines, in px. */ + lineHeight: number; + /** Clear room the halo takes round the glyphs, in px; the caption's box includes it. */ + padding: number; + halo: { color: string; width: number }; + leader: { color: string; width: number }; +} + +/** What the chart says about its own text, read from its axis labels and background. */ +export interface ChartTextStyle { + font?: string; + fontSize?: number; + fontWeight?: number | string; + color?: string; + background?: string; +} + +/** A note this short, on one line, is set on one line; a longer one wraps at one of these widths, in px. */ +export const SHORT_NOTE = 18; +export const NOTE_WRAP_WIDTHS = [180, 140] as const; +/** What each line past the first costs a placement: one line reads best where it fits as well. */ +export const NOTE_LINE_COST = 15; + +/** + * The widths a note may be wrapped to, in px at the measure's size: one line for a short note; + * else the house widths and, where the note runs to several words, about half its one-line width, + * so a caption too wide for the gap beside its mark can stand there in two even lines. + */ +export function noteWrapWidths(text: string, measure: (text: string) => number): number[] { + if (text.length <= SHORT_NOTE && !text.includes('\n')) return [Infinity]; + const words = text.split(/\s+/).filter(Boolean); + const widths: number[] = [...NOTE_WRAP_WIDTHS]; + if (words.length > 1 && !text.includes('\n')) { + const half = Math.max(Math.ceil(measure(text) * 0.55), ...words.map((word) => Math.ceil(measure(word)))); + if (widths.every((width) => Math.abs(width - half) > 8)) widths.push(half); + } + return widths; +} + +/** What the house says of its notes: its `type.annotation` role, and the primary text ink. */ +export interface NoteDesign { + text?: { font?: string; fontSize?: number; fontWeight?: number | string; color?: string }; + ink?: string; +} + +const WEIGHT_NAMES: Record = { normal: 400, bold: 700 }; + +/** + * How a note is set. A note is read beside the chart's own labels, so it keeps their face and + * weight and is set apart by size (one up) and ink (the page's primary text ink, darker than the + * labels' secondary grey), with a halo of the page under it. Hue is left to the data. A house's + * `type.annotation` role, and then a note's own `style`, say otherwise where they say anything. + */ +export function noteStyle(chart: ChartTextStyle = {}, design: NoteDesign = {}): NoteStyle { + const stated = design.text ?? {}; + const fontSize = stated.fontSize ?? Math.min(13, Math.max(10, Math.round((chart.fontSize ?? 10) + 1))); + const labelWeight = typeof chart.fontWeight === 'number' ? chart.fontWeight : WEIGHT_NAMES[String(chart.fontWeight ?? 'normal')] ?? 400; + const fontWeight = stated.fontWeight ?? labelWeight; + const fallback = chart.color && chart.color !== '#000' && chart.color !== '#000000' ? chart.color : '#333333'; + const color = stated.color ?? design.ink ?? fallback; + const background = chart.background && chart.background !== 'transparent' ? chart.background : '#ffffff'; + return { + font: stated.font ?? chart.font ?? 'sans-serif', + fontSize, + fontWeight, + color, + lineHeight: Math.round(fontSize * 1.25), + padding: 2, + halo: { color: background, width: 3 }, + leader: { color: neutralInk(background), width: 1 }, + }; +} + +/** + * The caption's lines at the most `maxWidth` px each, broken between words; a hard line break in the + * text is kept. A word wider than the line stands alone on its own. + */ +export function wrapNote(text: string, maxWidth: number, measure: (text: string) => number): string[] { + const lines: string[] = []; + for (const paragraph of text.split('\n')) { + let line = ''; + for (const word of paragraph.split(/\s+/).filter(Boolean)) { + const next = line ? `${line} ${word}` : word; + if (line && measure(next) > maxWidth) { + lines.push(line); + line = word; + } else line = next; + } + lines.push(line); + } + return lines; +} + +/** A line that ends a phrase — at a colon, a comma, a dash, a middle dot — breaks there at no cost. */ +const PHRASE_END = /[:;,.!?—–·|-]$/; + +/** + * The caption's lines as {@link wrapNote} counts them, broken evenly instead of greedily: no line + * wider than `maxWidth`, the lines as near one width as the words allow, and a break after a + * phrase's end preferred to one inside it — `ford galaxie 500:` over `most power`, not `ford + * galaxie 500: most` over a lone `power`. Each paragraph is broken on its own, into as many lines + * as greedy wrapping gives it, by a small dynamic programme over its words. + */ +export function balanceNote(text: string, maxWidth: number, measure: (text: string) => number): string[] { + if (!Number.isFinite(maxWidth)) return wrapNote(text, maxWidth, measure); + return text.split('\n').flatMap((paragraph) => { + const words = paragraph.split(/\s+/).filter(Boolean); + const count = wrapNote(paragraph, maxWidth, measure).length; + if (count < 2 || words.length <= count) return wrapNote(paragraph, maxWidth, measure); + const widths = new Map(); + const width = (from: number, to: number): number => { + const key = `${from}:${to}`; + let measured = widths.get(key); + if (measured === undefined) widths.set(key, measured = measure(words.slice(from, to).join(' '))); + return measured; + }; + const target = width(0, words.length) / count; + // A break inside a phrase costs as much as a line two fifths off the even width. + const inside = (0.4 * target) ** 2; + // cost[k][j]: the least cost of the first j words in k lines; from[k][j] where the last of them starts. + const cost = Array.from({ length: count + 1 }, () => new Array(words.length + 1).fill(Infinity)); + const from = Array.from({ length: count + 1 }, () => new Array(words.length + 1).fill(0)); + cost[0][0] = 0; + for (let k = 1; k <= count; k++) { + for (let j = k; j <= words.length; j++) { + for (let i = k - 1; i < j; i++) { + if (cost[k - 1][i] === Infinity) continue; + const w = width(i, j); + if (w > maxWidth && j - i > 1) continue; + const breakCost = j < words.length && !PHRASE_END.test(words[j - 1]) ? inside : 0; + const total = cost[k - 1][i] + (w - target) ** 2 + breakCost; + if (total < cost[k][j]) { + cost[k][j] = total; + from[k][j] = i; + } + } + } + } + if (cost[count][words.length] === Infinity) return wrapNote(paragraph, maxWidth, measure); + const lines: string[] = []; + for (let k = count, j = words.length; k > 0; k--) { + const i = from[k][j]; + lines.unshift(words.slice(i, j).join(' ')); + j = i; + } + return lines; + }); +} + +/** The caption's box size for its lines, the halo's room included. */ +export function noteSize(lines: readonly string[], style: NoteStyle, measure: (text: string) => number): { width: number; height: number } { + const width = Math.max(0, ...lines.map(measure)); + return { + width: Math.ceil(width) + style.padding * 2, + height: Math.ceil(style.fontSize + (lines.length - 1) * style.lineHeight + style.fontSize * 0.25) + style.padding * 2, + }; +} diff --git a/packages/flint-js/src/core/backend-frame.ts b/packages/flint-js/src/core/backend-frame.ts new file mode 100644 index 00000000..1440e299 --- /dev/null +++ b/packages/flint-js/src/core/backend-frame.ts @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * What the layout decides around the plot for a backend that draws its own furniture — ECharts, + * Chart.js, Plotly. Vega-Lite runs the full plan ({@link planLayout}); these backends keep their own + * renderer's look (title placement, legend idiom, axis defaults) and take from the plan only the + * decisions that do not depend on how Vega draws: where a title breaks, how long names wrap, what a + * chart's furniture costs its box. Each backend measures its furniture in its own fonts and asks the + * same questions here, so a decision is made once. + */ + +import { fitDeckText, fitHeadlineText, type TitleMeasure } from './title-fit'; +import { tableTextMeasurer } from './text-width'; +import type { KeyGeometry } from './backend-profile'; +import { judgeCanvas, plotFitScale, PLOT_SCALE_FLOOR, type CanvasFitEstimate } from './canvas-fit'; +import { niceTicks } from './ruler'; +import { DEFAULT_MAX_STRETCH, resolveBaseSize } from './compute-layout'; +import type { TextMeasurer } from './legend-layout'; +import type { ReservePart } from './furniture-reserve'; +import type { CanvasTreatment } from './types'; + +/** + * The least size band labels shrink to on a backend whose labels stand at 12 px (ECharts, Chart.js, + * Plotly): names shrink a size or two, then wrap or turn, rather than run at three-quarters size. + */ +export const BACKEND_MIN_LABEL_SIZE = 10; + +/** How a backend sets one kind of text: its size, weight and family, and its line height in em. */ +export interface BackendTextStyle { + fontSize: number; + fontWeight?: string | number; + font?: string; + /** Line height as a multiple of the size; 1.2 where unset. */ + lineHeight?: number; +} + +/** A measure of text in px, as a backend's renderer sets it, in one style. */ +export function measureIn(style: BackendTextStyle, measure: TextMeasurer = tableTextMeasurer): (text: string) => number { + return measure(style.fontSize, style.font ?? 'sans-serif', style.fontWeight ?? 'normal', 'normal'); +} + +/** The height of one line in a style, in px. */ +export function lineHeightOf(style: BackendTextStyle): number { + return Math.ceil(style.fontSize * (style.lineHeight ?? 1.2)); +} + +export interface TitleBlockLines { + text: string; + lines: string[]; + fontSize: number; + lineHeight: number; + /** The widest line, in px. */ + width: number; +} + +/** A headline and deck broken to the block they sit over. */ +export interface TitleBlock { + headline?: TitleBlockLines; + deck?: TitleBlockLines; + /** The height the lines take, with the gap between headline and deck; no outer padding. */ + height: number; + /** The height the block takes past one line of each: the lines that broke. */ + broken: number; + /** The widest line of either, in px. */ + width: number; +} + +/** + * Break a chart's headline and deck to a block `width` px wide, in the backend's type: the headline + * set a size down where that brings it onto one line, else broken to full lines with no widow + * ({@link fitHeadlineText}); the deck broken, never set smaller ({@link fitDeckText}). The same rule + * Vega-Lite's plan applies, measured in the backend's fonts. Undefined where there is no text. + */ +export function planTitleBlock( + text: { title?: string; subtitle?: string }, + width: number, + style: { headline: BackendTextStyle; deck: BackendTextStyle; gap: number }, + measure: TextMeasurer = tableTextMeasurer, +): TitleBlock | undefined { + const headlineText = text.title?.trim(); + const deckText = text.subtitle?.trim(); + if (!headlineText && !deckText) return undefined; + const titleMeasure = (s: BackendTextStyle): TitleMeasure => + (value, fontSize) => measure(fontSize, s.font ?? 'sans-serif', s.fontWeight ?? 'normal', 'normal')(value); + const block = Math.max(40, width); + let headline: TitleBlockLines | undefined; + if (headlineText) { + const m = titleMeasure(style.headline); + const fit = fitHeadlineText(headlineText, block, style.headline.fontSize, style.deck.fontSize, m); + const fontSize = fit?.fontSize ?? style.headline.fontSize; + const lines = fit?.lines ?? [headlineText]; + headline = { + text: headlineText, lines, fontSize, + lineHeight: lineHeightOf({ ...style.headline, fontSize }), + width: Math.max(...lines.map((line) => m(line, fontSize))), + }; + } + let deck: TitleBlockLines | undefined; + if (deckText) { + const m = titleMeasure(style.deck); + const fit = fitDeckText(deckText, block, style.deck.fontSize, m); + const lines = fit?.lines ?? [deckText]; + deck = { + text: deckText, lines, fontSize: style.deck.fontSize, + lineHeight: lineHeightOf(style.deck), + width: Math.max(...lines.map((line) => m(line, style.deck.fontSize))), + }; + } + const linesHeight = (part: TitleBlockLines | undefined) => part ? part.lines.length * part.lineHeight : 0; + const height = linesHeight(headline) + linesHeight(deck) + (headline && deck ? style.gap : 0); + const broken = (headline ? (headline.lines.length - 1) * headline.lineHeight : 0) + + (deck ? (deck.lines.length - 1) * deck.lineHeight : 0); + return { headline, deck, height, broken, width: Math.max(headline?.width ?? 0, deck?.width ?? 0) }; +} + +/** The widest line of a set of labels, each one or more lines, in px. */ +export function widestLine(labels: ReadonlyArray, widthOf: (text: string) => number): number { + let widest = 0; + for (const label of labels) { + for (const line of typeof label === 'string' ? [label] : label) widest = Math.max(widest, widthOf(line)); + } + return widest; +} + +/** + * How many rows items of these widths take when a renderer flows them across `room` px, `gap` px + * apart, as ECharts, Chart.js and Plotly set a legend in rows. + */ +export function flowRows(widths: readonly number[], room: number, gap: number): number { + if (!widths.length) return 0; + let rows = 1; + let run = 0; + for (const width of widths) { + if (run > 0 && run + gap + width > room) { rows += 1; run = width; } else run += (run > 0 ? gap : 0) + width; + } + return rows; +} + +/** Cut a line to `limit` px with an ellipsis, measured; whole where it fits or no limit is set. */ +export function cutToWidth(text: string, limit: number | undefined, widthOf: (text: string) => number): string { + if (!(limit && limit > 0) || widthOf(text) <= limit) return text; + let end = text.length; + while (end > 1 && widthOf(`${text.slice(0, end).trimEnd()}…`) > limit) end--; + return `${text.slice(0, end).trimEnd()}…`; +} + +/** Whether a value stands on one of the renderer's round ticks over a domain, as an axis end must to be labelled. */ +export function onNiceTick(value: number, domain: [number, number], count = 5): boolean { + const [lo, hi] = domain; + if (!Number.isFinite(value) || !(hi > lo)) return true; + return niceTicks(lo, hi, count).some((tick) => Math.abs(tick - value) <= (hi - lo) * 1e-9); +} + +/** The tick labels a value axis over `domain` is likely to print, as the renderer's own nice ticks would. */ +export function valueTickLabels(domain: [number, number], count = 5, format: (value: number) => string = (v) => v.toLocaleString('en-US')): string[] { + const [lo, hi] = domain; + if (!Number.isFinite(lo) || !Number.isFinite(hi)) return []; + if (lo === hi) return [format(lo)]; + return niceTicks(Math.min(lo, hi), Math.max(lo, hi), count).map(format); +} + +/** The box a chart is fitted to: the canvas the host states, else the ceiling the base may stretch to. */ +export function fitBox( + baseSize: { width: number; height: number }, canvasSize: { width: number; height: number } | undefined, maxStretch?: number, +): { width: number; height: number } { + const stretch = maxStretch ?? DEFAULT_MAX_STRETCH; + return canvasSize ?? { width: baseSize.width * stretch, height: baseSize.height * stretch }; +} + +/** What a backend measured around one plot, in px. */ +export interface BackendChrome { + plot: { width: number; height: number }; + /** The plot as designed, before a broken title took height from it. */ + designed?: { width: number; height: number }; + /** Facet grid, where the chart draws panels; one panel where unset. */ + grid?: { columns: number; rows: number; gapX: number; gapY: number }; + /** Each part's room: y labels and title beside the plot, x labels and title below, the title block, keys. */ + parts: Partial>; + /** Chrome above and below the chart area the parts do not name. */ + chrome?: { top: number; bottom: number }; + keyRowWidth?: number; + padding?: number; + box: { width: number; height: number }; + base: { width: number; height: number }; +} + +/** + * Judge a backend's drawing against its box, as the plan judges Vega-Lite's ({@link judgeCanvas}), + * and the share of its base the plot should be laid out at where the host would otherwise shrink + * the drawing past legibility ({@link plotFitScale}). + */ +export function judgeBackendCanvas(chrome: BackendChrome): { estimate: CanvasFitEstimate; plotScale?: number; stackedKeys: boolean; box: { width: number; height: number } } { + const parts = chrome.parts; + const width = Object.entries(parts).filter(([k]) => ['yLabels', 'yTitle', 'sideKeys', 'seriesEnd'].includes(k)).reduce((s, [, v]) => s + (v ?? 0), 0); + const height = Object.entries(parts).filter(([k]) => !['yLabels', 'yTitle', 'sideKeys', 'seriesEnd'].includes(k)).reduce((s, [, v]) => s + (v ?? 0), 0); + const estimate = judgeCanvas({ + panel: chrome.plot, + ...(chrome.designed ? { designed: chrome.designed } : {}), + grid: chrome.grid ?? { columns: 1, rows: 1, gapX: 0, gapY: 0 }, + reserve: { width, height, parts }, + chrome: chrome.chrome ?? { top: 0, bottom: 0 }, + ...(chrome.keyRowWidth !== undefined ? { keyRowWidth: chrome.keyRowWidth } : {}), + ...(chrome.padding !== undefined ? { padding: chrome.padding } : {}), + box: chrome.box, + base: chrome.base, + }); + return { estimate, plotScale: plotFitScale(estimate, chrome.box), stackedKeys: (parts.stackedKeys ?? 0) > 0, box: chrome.box }; +} + +/** What a backend's canvas fit found and did, carried on the spec as `_canvasFit` for tools that inspect it. */ +export interface BackendCanvasFit { + box: { width: number; height: number }; + drawing: { width: number; height: number }; + /** What the host shrinks the drawing by to show it in its box. */ + scale: number; + flags: string[]; + /** How far past the limits the drawing is, summed: 0 where it reads well. */ + excess: number; + /** The share of its base the plot was laid out at, where the fit shrank it. */ + plotScale?: number; + /** The plan's treatment the fit took, where it took one. */ + treatment?: CanvasTreatment; +} + +export function canvasFitSummary(estimate: CanvasFitEstimate, box: { width: number; height: number }, treatment?: CanvasTreatment): BackendCanvasFit { + return { + box, + drawing: { width: Math.round(estimate.drawing.width), height: Math.round(estimate.drawing.height) }, + scale: Math.round(estimate.scale * 100) / 100, + flags: estimate.flags, + excess: Math.round(estimate.excess * 1000) / 1000, + ...(treatment?.plotScale !== undefined ? { plotScale: treatment.plotScale } : {}), + ...(treatment ? { treatment } : {}), + }; +} + +/** How much less past the limits a treatment must leave the drawing to be taken. */ +const REFIT_MARGIN = 0.01; + +/** How short the canvas fit keeps long key names beside the plot: 120 px, wrapped before cut, as the plan does. */ +export const SHORT_KEY_NAMES = { keyWidth: 120 }; +/** Narrower still, with the key's text a size smaller, where the drawing is held well inside its box. */ +export const SHORTER_KEY_NAMES = { keyWidth: 90 }; + +/** + * The least a backend's drawing should be shrunk by its host before the canvas fit lays it out + * again. Vega-Lite's plan fits its box as it plans, so its fit acts only past legibility + * (`CANVAS_FIT_LIMITS.scale`); a backend keeps the planned plot and grows its canvas around the + * library's own furniture, so it is held to a closer fit. + */ +export const HOST_SCALE_TARGET = 0.9; + +/** + * The share of its base the plot is laid out at for a backend's drawing to enter its box, the + * furniture kept as it stands; undefined where the host shrinks it no further than + * {@link HOST_SCALE_TARGET} or the plot would have to go below {@link PLOT_SCALE_FLOOR}'s share. + */ +export function hostFitScale(estimate: CanvasFitEstimate, box: { width: number; height: number }): number | undefined { + if (estimate.scale >= HOST_SCALE_TARGET) return undefined; + const furniture = { width: estimate.drawing.width - estimate.area.width, height: estimate.drawing.height - estimate.area.height }; + const scale = Math.min((box.width - furniture.width) / estimate.area.width, (box.height - furniture.height) / estimate.area.height) * 0.97; + if (!(scale < 0.97)) return undefined; + return Math.max(PLOT_SCALE_FLOOR, Math.round(scale * 100) / 100); +} + +/** How a backend's drawing reads in its box: past the canvas fit's limits, and shrunk by its host past the target. */ +function fitScore(fit: { excess: number; scale: number }): number { + return fit.excess + Math.max(0, HOST_SCALE_TARGET - fit.scale); +} + +/** + * Assemble the chart again under each treatment that may help and keep the one that reads best: + * keys in rows stood beside the plot, key names held short, keys at the foot, key text a size + * smaller, and — past legibility only — the plot laid out smaller. A treatment is kept only where it + * reads clearly better than the chart as planned, by its flags and how far its host would shrink it + * ({@link fitScore}); so the key gives way to a drawing its host would shrink below + * {@link HOST_SCALE_TARGET}, the plot only to one past legibility. + */ +export function refitCanvas( + judged: { estimate: CanvasFitEstimate; plotScale?: number; stackedKeys?: boolean; box?: { width: number; height: number } }, + options: { canvasFit?: string; canvasTreatment?: CanvasTreatment } | undefined, + reassemble: (treatment: CanvasTreatment) => S, +): S | undefined { + if (options?.canvasFit === 'off' || options?.canvasTreatment) return undefined; + const kinds = judged.estimate.kinds; + const held = judged.estimate.scale < HOST_SCALE_TARGET; + const keysWide = held || kinds.includes('width') || kinds.includes('wider') || kinds.includes('shrunk'); + // Keys in rows above or below the plot that make the drawing tall may stand beside it instead. + const keysTall = judged.stackedKeys === true && (held || kinds.includes('height') || kinds.includes('taller') || kinds.includes('shrunk')); + // The plot gives way only past legibility: a smaller plot beside an unchanged key leaves the key + // taller than the plot (Plotly scrolls it) and the marks small, which reads worse than a drawing + // its host shrinks a little. + const plotScale = judged.plotScale; + // Key text a size or two smaller, after the names are wrapped and the key moved: the library's own + // size gives way before the plot does. + const smaller = { keyScale: KEY_SCALE }; + // All the type a size down: the library's own sizes give way, to a legible floor, before the plot. + const smallType = { keyScale: KEY_SCALE, labelScale: LABEL_SCALE, titleScale: TITLE_SCALE }; + const short = { names: SHORT_KEY_NAMES }; + const tries: CanvasTreatment[] = [ + ...(keysTall ? [{ keys: 'side' as const }, { keys: 'side' as const, ...short }, { keys: 'side' as const, ...short, ...smaller }] : []), + ...(keysTall && held ? [{ keys: 'side' as const, names: SHORTER_KEY_NAMES, ...smaller }] : []), + ...(keysWide ? [short, { keys: 'bottom' as const }, { ...short, ...smaller }] : []), + ...(keysWide && held ? [{ names: SHORTER_KEY_NAMES, ...smaller }, { ...short, ...smallType }] : []), + ...(keysTall && held ? [{ keys: 'side' as const, ...short, ...smallType }] : []), + ...(held && !keysWide && !keysTall ? [smallType] : []), + ...(plotScale ? [{ plotScale }] : []), + ...(keysWide && plotScale ? [{ ...short, plotScale }, { keys: 'bottom' as const, plotScale }] : []), + ]; + let best: S | undefined; + // A treatment must read clearly better: the reported excess is rounded, and a change too small to see is no change. + let bestScore = fitScore(judged.estimate) - REFIT_MARGIN; + for (const treatment of tries) { + const refit = reassemble(treatment); + const fit = refit?._canvasFit; + if (!fit) continue; + // Smaller type pays only where the host then shrinks the drawing less, by enough that the + // labels read at least as large on screen: 10 px drawn at 84% is smaller than 12 px at 83%. + if (treatment.labelScale && fit.scale * treatment.labelScale < judged.estimate.scale - 0.005) continue; + const score = fitScore(fit) + treatmentPenalty(treatment); + if (score < bestScore) { best = refit; bestScore = score - REFIT_MARGIN; } + } + return best; +} + +/** The share of its size key text steps down to under the canvas fit (12 px → 10 px). */ +export const KEY_SCALE = 0.84; +/** The share axis labels and titles step down to under the canvas fit (12 px → 10 px, 14 px → 12 px). */ +export const LABEL_SCALE = 0.84; +/** The share the headline and deck step down to under the canvas fit (17 px → 14 px). */ +export const TITLE_SCALE = 0.85; +/** The least a backend's headline and deck are set at by the canvas fit, as the plan's floor. */ +export const BACKEND_TITLE_FLOOR = { headline: 13, deck: 11 }; + +/** A text size at a canvas-fit share, never below `floor`, and never larger than it was. */ +export function scaledTypeSize(size: number, scale: number | undefined, floor: number): number { + if (!scale) return size; + return Math.max(Math.min(size, floor), Math.min(size, Math.round(size * scale * 2) / 2)); +} + +/** + * How much a treatment costs in reading, beside the room it wins: smaller text and shorter names are + * fixes a reader notices, so one is taken only where it wins clearly more than it costs. + */ +function treatmentPenalty(t: CanvasTreatment): number { + return (t.keyScale ? 0.01 : 0) + (t.labelScale ? 0.03 : 0) + (t.titleScale ? 0.02 : 0) + + (t.names ? (t.names.keyWidth < 120 ? 0.02 : 0.005) : 0) + (t.plotScale ? 0.02 : 0); +} + +/** A key's text size under a canvas-fit treatment: the library's size at the treated share, never below the floor. */ +export function treatedKeyFontSize(size: number, options: { canvasTreatment?: CanvasTreatment } | undefined): number { + const scale = options?.canvasTreatment?.keyScale; + return scale ? Math.max(BACKEND_MIN_LABEL_SIZE, Math.min(size, Math.round(size * scale * 2) / 2)) : size; +} + +/** + * Re-run a backend's assembler under a canvas-fit treatment, once: the plot laid out at `plotScale` of + * its base (the box kept), key names held short. The pass is marked by `options.canvasTreatment`, so a + * second pass never runs. + */ +export function withTreatment(input: T, treatment: CanvasTreatment, box: { width: number; height: number }): T { + const base = resolveBaseSize(input.chart_spec.baseSize, input.chart_spec.canvasSize); + const scale = treatment.plotScale; + return { + ...input, + chart_spec: { + ...input.chart_spec, + ...(scale ? { baseSize: { width: Math.round(base.width * scale), height: Math.round(base.height * scale) }, canvasSize: box } : {}), + }, + options: { ...(input.options ?? {}), canvasTreatment: { ...(input.options?.canvasTreatment ?? {}), ...treatment } }, + }; +} + +/** The edge a canvas-fit treatment holds the keys to, off the side; undefined leaves every edge open. */ +export function treatedKeyEdge(options: { canvasTreatment?: CanvasTreatment } | undefined): 'top' | 'bottom' | undefined { + const keys = options?.canvasTreatment?.keys; + return keys === 'top' || keys === 'bottom' ? keys : undefined; +} + +/** + * The widest a key beside the plot may run under a canvas-fit treatment, for {@link planKeyLayout}'s + * `sideWidth`: the names' width the treatment gives, and the room the library sets before and around + * them ({@link KeyGeometry}), so names are held to the same width whatever the library's symbol. + */ +export function treatedKeySide(options: { canvasTreatment?: CanvasTreatment } | undefined, key: KeyGeometry): number | undefined { + const names = options?.canvasTreatment?.names?.keyWidth; + return names === undefined ? undefined : names + key.lead + 2 * key.pad.x; +} + +/** The widest a key beside the plot may run under a canvas-fit treatment, for {@link planKeyLayout}'s `sideWidth`. */ +export function treatedKeyWidth(options: { canvasTreatment?: CanvasTreatment } | undefined): number | undefined { + return options?.canvasTreatment?.names?.keyWidth; +} diff --git a/packages/flint-js/src/core/backend-profile.ts b/packages/flint-js/src/core/backend-profile.ts new file mode 100644 index 00000000..9c9fdef1 --- /dev/null +++ b/packages/flint-js/src/core/backend-profile.ts @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * What a charting library does on its own with the furniture the layout plans: how it sets a key's + * entries, how far its text stands from the axis, how tall its lines run. The layout's rules are the + * same on every backend; a profile is how each library draws what they decide, so the room the + * layout keeps is the room the library will take, not an estimate tuned by eye. + * + * Each backend states its own profile beside its renderer (`plotly/profile.ts`, …), read off the + * library's defaults and source; the estimators here take a profile and know no library. + */ + +import type { KeyStyle } from './legend-layout'; + +/** How a library sets a key's entries. */ +export interface KeyGeometry { + /** Px from an entry's start to its text: the symbol and the gaps either side of it. */ + lead: number; + /** The symbol's own size, for the planner's estimate of an entry. */ + symbol: number; + /** Px between entries set in a row. */ + gap: number; + /** Px between rows of entries. */ + rowGap: number; + /** Px inside the key's box: at its left and right edges, and at its top and bottom. */ + pad: { x: number; y: number }; + /** How tall an entry stands with this many lines of text at this size. */ + entryHeight: (fontSize: number, lines: number) => number; + /** A line of key text, in ems. */ + lineHeight: number; + /** + * How a row of entries too long for its room wraps: `flow` keeps each entry its own width and + * breaks where the next will not fit; `grid` sets every entry at the widest one's width. + */ + wrap: 'flow' | 'grid'; + /** + * A row breaks once the next entry would run past its room (`over`), reach it (`reach`), or run + * past it with the gap after it counted too (`overWithGap`, Plotly's grouped rows). + */ + breakAt: 'over' | 'reach' | 'overWithGap'; + /** Where a key set in rows puts its title: at the start of the rows, or above them. */ + rowTitle: 'start' | 'top'; + /** Px between a title at the start of the rows and the first entry. */ + titleGap: number; + /** Px between a title above the entries and the first row. */ + titleRowGap: number; + /** A key beside the plot stands in one column (scrolling past its height), or in as many as it needs. */ + sideColumns: 'one' | 'many'; +} + +/** What a library does with a chart's text and frame, as far as the layout needs to know it. */ +export interface BackendProfile { + id: string; + /** The family the library's text is measured in where the chart sets none. */ + font: string; + key: KeyGeometry; + /** Px the drawing keeps clear of the canvas's edges. */ + edge: number; + /** Px between an axis line and its tick labels (tick length included). */ + tickLabelGap: number; + /** Px between tick labels and the axis title. */ + axisTitleGap: number; + /** A line of axis text, in ems. */ + labelLineHeight: number; + /** The height of a single line of axis text, in ems (its box, which runs shorter than a line). */ + labelBoxHeight: number; + /** Px the library keeps past an axis's labels (or title) when it fits its margins to them. */ + axisPad: number; +} + +export type WidthOf = (text: string) => number; + +export interface KeyBlockInput { + /** Each entry's text, as lines (already cut where they will be cut). */ + entries: readonly (readonly string[])[]; + fontSize: number; + /** Width of a line of entry text. */ + widthOf: WidthOf; + /** The key's title, as lines, and its width and size. */ + title?: { lines: readonly string[]; fontSize: number; widthOf: WidthOf }; + /** `horizontal`: entries in rows across `room`; `vertical`: a column. */ + orientation: 'horizontal' | 'vertical'; + /** The width a row may run to before it wraps. */ + room?: number; +} + +export interface KeyBlock { + width: number; + height: number; + rows: number; + /** Px from the box's top edge to the top of its first line of text. */ + inset: number; +} + +/** + * The box a library draws for a key, from its profile: entries in rows that wrap as the library wraps + * them, or a column; the title at the start of the rows or on top; the box's own padding around all. + */ +export function keyBlock(g: KeyGeometry, input: KeyBlockInput): KeyBlock { + const { entries, fontSize, widthOf } = input; + const titleLines = input.title?.lines ?? []; + const titleWidth = titleLines.length ? Math.max(...titleLines.map(input.title!.widthOf)) : 0; + const titleHeight = titleLines.length ? titleLines.length * input.title!.fontSize * g.lineHeight : 0; + const heights = entries.map((lines) => g.entryHeight(fontSize, Math.max(1, lines.length))); + const widths = entries.map((lines) => g.lead + Math.max(0, ...lines.map(widthOf))); + // An entry's text stands centred in its own height, so a one-line entry sets the first row's top. + const inset = g.pad.y + Math.max(0, (g.entryHeight(fontSize, 1) - fontSize * g.lineHeight) / 2); + if (!entries.length) return { width: 0, height: 0, rows: 0, inset: 0 }; + + if (input.orientation === 'vertical') { + const body = heights.reduce((sum, h) => sum + h, 0) + g.rowGap * (entries.length - 1); + const top = titleHeight ? titleHeight + g.titleRowGap : 0; + return { + width: Math.ceil(Math.max(Math.max(...widths), titleWidth) + 2 * g.pad.x), + height: Math.ceil(top + body + 2 * g.pad.y), + rows: entries.length, + inset: titleHeight ? g.pad.y : inset, + }; + } + + const inlineTitle = titleHeight > 0 && g.rowTitle === 'start' ? titleWidth + g.titleGap : 0; + const room = Math.max(1, (input.room ?? Infinity) - 2 * g.pad.x); + const oneRow = widths.reduce((sum, w) => sum + w, 0) + g.gap * (widths.length - 1) < room; + const widest = Math.max(...widths); + const cell = (w: number) => (g.wrap === 'grid' && !oneRow ? widest : w); + let rows = 1; + let run = 0; + let rowHeight = 0; + let height = 0; + let rowWidth = 0; + entries.forEach((_, i) => { + const w = cell(widths[i]); + const end = run + (run > 0 ? g.gap : 0) + w; + const past = g.breakAt === 'reach' ? end >= room : g.breakAt === 'overWithGap' ? end + g.gap > room : end > room; + if (run > 0 && past) { + rows += 1; + height += rowHeight + g.rowGap; + rowWidth = Math.max(rowWidth, run); + run = w; + rowHeight = heights[i]; + } else { + run = end; + rowHeight = Math.max(rowHeight, heights[i]); + } + }); + height += rowHeight; + rowWidth = Math.max(rowWidth, run); + const top = titleHeight && g.rowTitle === 'top' ? titleHeight + g.titleRowGap : 0; + return { + width: Math.ceil(inlineTitle + rowWidth + 2 * g.pad.x), + height: Math.ceil(Math.max(height, g.rowTitle === 'start' ? titleHeight : 0) + top + 2 * g.pad.y), + rows, + inset: top ? g.pad.y : inset, + }; +} + +/** The style the layout's key planner ({@link planKeyLayout}) measures a library's key with. */ +export function keyPlanStyle(g: KeyGeometry): Pick { + return { + symbolSize: g.symbol * g.symbol, + labelOffset: Math.max(0, g.lead - g.symbol), + padding: Math.max(g.pad.x, g.pad.y), + rowPadding: g.rowGap, + columnPadding: g.gap, + ...(g.sideColumns === 'one' ? { columns: 1 } : {}), + }; +} diff --git a/packages/flint-js/src/core/canvas-fit.ts b/packages/flint-js/src/core/canvas-fit.ts index 6b9e7c28..cb328854 100644 --- a/packages/flint-js/src/core/canvas-fit.ts +++ b/packages/flint-js/src/core/canvas-fit.ts @@ -96,7 +96,8 @@ export const HEADER_ALLOWANCE = 0.25; export const SIDE_ALLOWANCE = 0.33; /** The padding the backend sets around a drawing, each side, in px, where the house names none. */ -const DRAWING_PADDING = 5; +/** The padding Vega-Lite draws an unthemed chart with, counted as part of the drawing. */ +export const DRAWING_PADDING = 5; /** * How far above the legibility limit a treatment must leave the drawing's scale, where the chart as @@ -197,8 +198,9 @@ export function judgeCanvas(parts: CanvasParts): CanvasFitEstimate { /** * What a treatment costs the reader, on the planner's one scale ({@link LAYOUT_COSTS}): keys kept on - * their house's edge in one row, least; long names wrapped, on keys or down the y axis; the title a - * size down; one key moved to another edge; every key moved; the title two sizes down; a smaller plot, more the smaller it gets. `edge` is where + * their house's edge in one row, least; long names wrapped, on keys or down the y axis; the axis labels + * a size down; the title a size down; one key moved to another edge; every key moved; the title two + * sizes down; a smaller plot, more the smaller it gets. `edge` is where * the keys stood as planned: a row on that edge is the gentler edit. */ /** The share of its designed height a plot may give a breaking title before the title counts as squeezing it. */ @@ -213,7 +215,8 @@ export function treatmentCost(treatment: CanvasTreatment, edge?: string): number const plot = treatment.plotScale ? C.plot + (1 - treatment.plotScale) * C.plotPerShare : 0; const oneKey = treatment.oneKey ? C.keyMoved : 0; const rowNames = treatment.rowNames ? C.rowNames : 0; - return keys + oneKey + names + rowNames + title + plot; + const labels = treatment.labelScale ? C.labels + (1 - treatment.labelScale) * C.labelsPerShare : 0; + return keys + oneKey + names + rowNames + labels + title + plot; } /** @@ -240,8 +243,11 @@ export function describeTreatment(treatment: CanvasTreatment | undefined): strin if (treatment.rowNames) parts.push('row names wrapped'); if (treatment.plotSpace) parts.push('plot laid out again in the room left'); if (treatment.titleScale) parts.push(`title at ${Math.round(treatment.titleScale * 100)}%`); + if (treatment.labelScale) parts.push(`axis labels at ${Math.round(treatment.labelScale * 100)}%`); if (treatment.names) parts.push('narrower key names'); + if (treatment.keyScale) parts.push(`key text at ${Math.round(treatment.keyScale * 100)}%`); if (treatment.plotScale) parts.push(`plot at ${Math.round(treatment.plotScale * 100)}%`); + if (treatment.contain) parts.push(`laid out for ${Math.round(treatment.contain.width)} × ${Math.round(treatment.contain.height)} to stay within the canvas`); return parts.join(', ') || 'as planned'; } diff --git a/packages/flint-js/src/core/chart-table.ts b/packages/flint-js/src/core/chart-table.ts index b5a36218..02225267 100644 --- a/packages/flint-js/src/core/chart-table.ts +++ b/packages/flint-js/src/core/chart-table.ts @@ -10,7 +10,10 @@ import { format as formatNumber } from 'd3-format'; import { utcFormat } from 'd3-time-format'; import type { ChartAnalysis } from './analyze'; import { fullValueFormat } from './field-semantics'; +import type { HeaderPlan } from './header-plan'; import type { LayoutPlan } from './plan'; +import type { ClosingRule } from './rule-plan'; +import type { SourcePlan } from './source-plan'; import { chartDisplayNames, encodingTitle, titleText, type ChartStructure } from './structure'; import { applyTextCase } from './text-case'; import { selectorRowTest, type RowComparison } from './target-selector'; @@ -77,6 +80,18 @@ export interface ChartTable { /** How the chart compares the cells' values, so a selection on the chart names the same rows. */ comparison: RowComparison; style: ChartTableStyle; + /** The theme's furniture as the chart draws it; absent when the theme draws none. */ + furniture?: ChartTableFurniture; +} + +/** What the chart's theme draws around its title and at its foot, planned at the chart's width. */ +export interface ChartTableFurniture { + /** The pieces on the top edge, above and beside the title. */ + header?: HeaderPlan; + /** The rules below the heading (`edge: 'top'`) and at the foot (`edge: 'bottom'`). */ + rules: ClosingRule[]; + /** The source line at the foot. */ + source?: SourcePlan; } /** The smallest text a table sets, whatever size the theme fitted its axis labels to. */ @@ -235,8 +250,13 @@ export function chartTable(input: ChartAssemblyInput, analysis: ChartAnalysis, p subtitle: tableText(plan.design.title.deck, plan.design.font, plan.design.text.secondary), }, } : undefined; + const rules = plan.rules?.rules ?? []; + const furniture = plan.header || rules.length > 0 || plan.source + ? { ...(plan.header ? { header: plan.header } : {}), rules, ...(plan.source ? { source: plan.source } : {}) } + : undefined; return { ...(heading ? { heading } : {}), + ...(furniture ? { furniture } : {}), columns: columns.map((column) => ({ ...column, title: applyTextCase(column.title, headerCase) })), rows, total: analysis.data.length, diff --git a/packages/flint-js/src/core/color-controls.ts b/packages/flint-js/src/core/color-controls.ts index 981d52ce..6e7370e7 100644 --- a/packages/flint-js/src/core/color-controls.ts +++ b/packages/flint-js/src/core/color-controls.ts @@ -9,7 +9,7 @@ * win over every default and theme ramp: each backend applies {@link authoredColorScale} last. */ -import type { ChartEncoding } from './types'; +import type { ChannelSemantics, ChartEncoding } from './types'; import { normalizeAnnotation, type SemanticAnnotation } from './field-semantics'; import { mixHex } from './theme/presence'; @@ -94,3 +94,260 @@ export function resampleStops(stops: string[], count: number): string[] { export function schemeName(scheme: unknown): string | undefined { return typeof scheme === 'string' ? scheme : undefined; } + +/** The round steps a bin edge takes, of a power of ten. */ +const ROUND_STEPS = [1, 2, 2.5, 5]; + +/** + * The inner edges that quantize `[min, max]` into `count` bins at round values: `count − 1` edges a + * round step apart (1, 2, 2.5 or 5 of a power of ten), placed over the data's middle, the outer two + * bins open-ended. Of the steps that keep every edge inside the data, the one whose outer bins come + * nearest a step wide. Undefined where none does (too few distinct values, or fewer than two bins). + */ +export function roundBinEdges(min: number, max: number, count: number): number[] | undefined { + if (!(count >= 2) || !Number.isFinite(min) || !Number.isFinite(max) || !(max > min)) return undefined; + const raw = (max - min) / count; + let best: { edges: number[]; cost: number } | undefined; + for (let exp = Math.floor(Math.log10(raw)) - 1; exp <= Math.floor(Math.log10(raw)) + 1; exp++) { + for (const unit of ROUND_STEPS) { + const step = unit * 10 ** exp; + const first = Math.round(((min + max) / 2 - (step * (count - 2)) / 2) / step) * step; + const edges = Array.from({ length: count - 1 }, (_, i) => Number((first + i * step).toPrecision(12))); + if (edges[0] <= min || edges[edges.length - 1] >= max) continue; + const cost = Math.abs(edges[0] - min - step) / step + Math.abs(max - edges[edges.length - 1] - step) / step; + if (!best || cost < best.cost) best = { edges, cost }; + } + } + return best?.edges; +} + +/** Stepped colour classes at round values: the breaks between them, where they close, and how they sit about a pivot. */ +export interface ColorClasses { + /** The boundaries between classes, ascending: one fewer than the classes. */ + breaks: number[]; + /** Where the outer classes close: the round value at or past each end of the data; unset where they are open. */ + lo?: number; + hi?: number; + /** For a field that crosses its pivot: how many classes lie wholly below it and wholly above it. */ + below?: number; + above?: number; + /** Whether one class straddles the pivot, reading as neither side. */ + neutral?: boolean; +} + +/** + * How a diverging field's pivot sits among its classes: `'auto'` gives it a neutral class a step + * wide, centred on it; a number, a neutral class that far either side of it; unset, the pivot is + * a break and every class is one side or the other. + */ +export type NeutralBand = number | 'auto' | undefined; + +/** Talbot, Lin & Hanrahan's (2010) order of round steps by simplicity, simplest first. */ +const SIMPLEST_STEPS = [1, 5, 2, 2.5]; +/** The most classes either side of a pivot: past it, neighbouring colours on the longer side blur together. */ +export const MAX_CLASSES_PER_SIDE = 4; + +/** + * Classes a round step wide for a stepped colour scale, about as many as asked. The step is the + * one Talbot, Lin & Hanrahan's (2010) extended labeling scores best — weighing how round it is, + * how closely the classes cover the data and how near their count comes to the target — from 3 to + * the target and two more. Every break is a multiple of the step from the pivot, so each side of a + * field that crosses its pivot takes only the classes its data reaches: a field from −6.7 to 33.5 + * reads 0, 10, 20, 30 rather than a domain made symmetric at ±33.5 and cut at ±6.7 and ±20.1, its + * darkest cold classes empty. Neither side takes more than {@link MAX_CLASSES_PER_SIDE} where a + * coarser step can hold it. The pivot is a break, or with a `neutral` band the centre of a class + * that reads as neither side: ±0.1 and ±0.3 about a correlation's 0. Without a pivot the steps count + * from zero. `exact` asks for the target count — an author's `bins`: closed classes where a round + * step gives that many, else that many classes with the outer two open ({@link roundBinEdges} on + * the pivot's steps). Undefined where the values do not span a range. + */ +export function roundColorClasses( + values: readonly number[], target: number, pivot?: number, options: { exact?: boolean; neutral?: NeutralBand } = {}, +): ColorClasses | undefined { + let min = Infinity; + let max = -Infinity; + for (const value of values) { + if (!Number.isFinite(value)) continue; + if (value < min) min = value; + if (value > max) max = value; + } + if (!(target >= 2) || !(max > min)) return undefined; + const crosses = pivot !== undefined && Number.isFinite(pivot) && min < pivot && max > pivot; + const anchor = crosses ? pivot! : 0; + const band = crosses ? options.neutral : undefined; + const span = max - min; + const most = Math.max(3, target + 2); + const round = (value: number) => Number(value.toPrecision(12)); + let best: { classes: ColorClasses; score: number; capped: boolean } | undefined; + for (let exp = Math.floor(Math.log10(span / (most + 1))) - 1; exp <= Math.ceil(Math.log10(span)); exp++) { + for (const unit of ROUND_STEPS) { + const step = unit * 10 ** exp; + // A neutral class half a step either side prints round only where half the step is round. + if (band === 'auto' && unit === 2.5) continue; + const half = band === undefined ? 0 : band === 'auto' ? step / 2 : band; + if (!(half >= 0)) continue; + // Classes past the band on each side, a step each, closing at the round value past the data. + const reach = (extent: number) => Math.max(0, Math.ceil((extent - half) / step - 1e-9)); + const up = crosses ? reach(max - anchor) : 0; + const down = crosses ? reach(anchor - min) : 0; + const lo = crosses ? round(anchor - half - down * step) : round(Math.floor(min / step + 1e-9) * step); + const hi = crosses ? round(anchor + half + up * step) : round(Math.ceil(max / step - 1e-9) * step); + // Without a band the two sides meet at the pivot, one break between them. + const breaks = crosses + ? [ + ...Array.from({ length: down }, (_, i) => round(anchor - half - (down - 1 - i) * step)), + ...Array.from({ length: up }, (_, i) => round(anchor + half + i * step)), + ].filter((edge, i, all) => i === 0 || edge !== all[i - 1]) + : Array.from({ length: Math.round((hi - lo) / step) - 1 }, (_, i) => round(lo + (i + 1) * step)); + const count = breaks.length + 1; + if (count < 3 || count > most) continue; + if (options.exact && count !== target) continue; + const simplicity = 1 - SIMPLEST_STEPS.indexOf(unit) / (SIMPLEST_STEPS.length - 1); + const coverage = 1 - 0.5 * ((max - hi) ** 2 + (min - lo) ** 2) / (0.1 * span) ** 2; + const density = 2 - Math.max(count / target, target / count); + const score = 0.25 * simplicity + 0.2 * coverage + 0.5 * density; + const capped = Math.max(down, up) > MAX_CLASSES_PER_SIDE; + // Within the cap outranks past it; among equals, the extended-labeling score decides. + if (best && (capped && !best.capped || capped === best.capped && score <= best.score)) continue; + best = { + score, capped, + classes: { + breaks, lo, hi, + ...(crosses ? { below: down, above: up, ...(half > 0 ? { neutral: true } : {}) } : {}), + }, + }; + } + } + if (best || !options.exact) return best?.classes; + // No round step closes exactly that many: the outer two open, the inner edges on the pivot's steps. + const edges = roundBinEdges(min - anchor, max - anchor, target)?.map((edge) => round(edge + anchor)); + if (!edges) return undefined; + const at = crosses ? edges.findIndex((edge) => Math.abs(edge - anchor) < 1e-9 * span) : -1; + return { breaks: edges, ...(at >= 0 ? { below: at + 1, above: target - at - 1 } : {}) }; +} + +/** The colour a ramp's stops reach at `t`, from 0 at the first stop to 1 at the last. */ +function rampAt(stops: string[], t: number): string { + if (stops.length < 2) return stops[0]; + const x = Math.min(1, Math.max(0, t)) * (stops.length - 1); + const k = Math.min(stops.length - 2, Math.floor(x)); + return mixHex(stops[k], stops[k + 1], x - k, stops[k]); +} + +/** + * A class break printed short: two significant figures, as a map key reads it (12,000 not + * 11,873.4). Zero and the data's own ends stay as they are. + */ +function shortBreak(value: number): number { + return value === 0 ? 0 : Number(value.toPrecision(2)); +} + +/** + * Breaks above the data's least value and no higher than its greatest, ascending, in print form; + * fewer where rounding merges two. A break at the greatest value is a class of the greatest alone. + */ +function tidyBreaks(raw: readonly number[], min: number, max: number): number[] { + const breaks: number[] = []; + for (const value of raw.map(shortBreak)) { + if (value <= min || value > max) continue; + if (breaks.length && value <= breaks[breaks.length - 1]) continue; + breaks.push(value); + } + return breaks; +} + +/** + * Classes holding about equal numbers of values: the breaks at the quantiles, printed short. The + * choropleth's default, after Data Formulator's maps: a skewed measure (GDP, population) spread + * evenly by value leaves most regions in the first class, where quantiles give each class its + * share of regions. Undefined where the values do not spread into two classes. + */ +export function quantileColorClasses(values: readonly number[], count: number): ColorClasses | undefined { + const sorted = values.filter(Number.isFinite).sort((a, b) => a - b); + if (sorted.length < 2 || !(count >= 2)) return undefined; + const [min, max] = [sorted[0], sorted[sorted.length - 1]]; + const at = (q: number) => { + const position = q * (sorted.length - 1); + const lower = Math.floor(position); + return sorted[lower] + (sorted[Math.min(lower + 1, sorted.length - 1)] - sorted[lower]) * (position - lower); + }; + const breaks = tidyBreaks(Array.from({ length: count - 1 }, (_, i) => at((i + 1) / count)), min, max); + return breaks.length ? { breaks, lo: min, hi: max } : undefined; +} + +/** The most values natural breaks weigh; more are sampled evenly, as Data Formulator samples them. */ +const JENKS_SAMPLE = 2000; + +/** + * Natural breaks (Jenks): classes that keep each one's values close together and the classes + * apart, by least squared deviation within classes. Printed short. Undefined where the values do + * not spread into two classes. + */ +export function jenksColorClasses(values: readonly number[], count: number): ColorClasses | undefined { + let sorted = values.filter(Number.isFinite).sort((a, b) => a - b); + if (sorted.length < 2 || !(count >= 2)) return undefined; + const [min, max] = [sorted[0], sorted[sorted.length - 1]]; + if (sorted.length > JENKS_SAMPLE) { + const stride = (sorted.length - 1) / (JENKS_SAMPLE - 1); + sorted = Array.from({ length: JENKS_SAMPLE }, (_, i) => sorted[Math.round(i * stride)]); + } + const n = sorted.length; + const k = Math.min(count, n); + // cost[j][i]: least within-class deviation for the first i values in j classes; from[j][i]: where the last class starts. + const prefix = [0]; + const prefixSq = [0]; + for (const value of sorted) { + prefix.push(prefix[prefix.length - 1] + value); + prefixSq.push(prefixSq[prefixSq.length - 1] + value * value); + } + const deviation = (start: number, end: number) => { + const size = end - start; + const sum = prefix[end] - prefix[start]; + return prefixSq[end] - prefixSq[start] - (sum * sum) / size; + }; + const cost = Array.from({ length: k + 1 }, () => new Float64Array(n + 1).fill(Infinity)); + const from = Array.from({ length: k + 1 }, () => new Int32Array(n + 1)); + cost[0][0] = 0; + for (let j = 1; j <= k; j++) { + for (let i = j; i <= n; i++) { + for (let start = j - 1; start < i; start++) { + const candidate = cost[j - 1][start] + deviation(start, i); + if (candidate < cost[j][i]) { cost[j][i] = candidate; from[j][i] = start; } + } + } + } + const raw: number[] = []; + for (let j = k, i = n; j > 1; j--) { + const start = from[j][i]; + raw.unshift(sorted[start]); + i = start; + } + const breaks = tidyBreaks(raw, min, max); + return breaks.length ? { breaks, lo: min, hi: max } : undefined; +} + +/** + * One colour per class from a ramp's stops. Classes about a pivot step the ramp out from its centre + * at one rate on both sides, set by the longer side, so equal distances from the pivot read as equal + * colours and the shorter side keeps to its pale end. Each class takes the colour at its far edge, + * so the classes either side of the pivot already show its sign; a neutral class takes the centre. + */ +export function classColors(stops: string[], classes: ColorClasses): string[] { + const { below, above } = classes; + if (below === undefined || above === undefined) return resampleStops(stops, classes.breaks.length + 1); + const side = Math.max(1, below, above); + return [ + ...Array.from({ length: below }, (_, i) => rampAt(stops, 0.5 - 0.5 * (below - i) / side)), + ...(classes.neutral ? [rampAt(stops, 0.5)] : []), + ...Array.from({ length: above }, (_, i) => rampAt(stops, 0.5 + 0.5 * (i + 1) / side)), + ]; +} + +/** The neutral band of the diverging colour field a chart steps, from its semantics. */ +export function colorNeutralBand(channelSemantics: Partial> | undefined, field?: string): NeutralBand { + for (const channel of ['color', 'fill', 'stroke', ...COLOR_CONTROL_CHANNELS]) { + const cs = channelSemantics?.[channel]; + if (cs?.colorScheme?.type === 'diverging' && (!field || cs.field === field)) return cs.colorScheme.neutral; + } + return undefined; +} diff --git a/packages/flint-js/src/core/compute-layout.ts b/packages/flint-js/src/core/compute-layout.ts index db08a561..04dfccae 100644 --- a/packages/flint-js/src/core/compute-layout.ts +++ b/packages/flint-js/src/core/compute-layout.ts @@ -93,6 +93,13 @@ const APPROX_CHAR_WIDTH_RATIO = 0.62; */ const SPARSE_FIT_BAND_CEILING = 100; +/** The share of the room the canvas leaves its plot that a sparse x axis fills, under `sparseFill`. */ +const SPARSE_FILL_SHARE = 0.85; +/** The widest a band of bars grows under `sparseFill`, in px of step. */ +const SPARSE_FILL_BAR_CAP = 200; +/** The widest a band of points (a strip, a jitter) grows under `sparseFill`, in px of step. */ +const SPARSE_FILL_POINT_CAP = 360; + /** Smallest readable default step for a discrete item before overflow activates. */ export const DEFAULT_MIN_STEP = 8; @@ -1311,6 +1318,29 @@ export function computeLayout( : decision.fitted ? 'sparse bands grow toward the room the canvas leaves' : 'the house band fits the span and keeps its size'); if (step !== decision.step) stage(key, 'clamped', step, axis === 'y' ? { min: yMinStep, max: yMaxStep } : { min: minStepVal, max: maxStepSize }, 'held between the smallest readable step and the widest a band may be'); } + // --- Sparse fill --- + // Few x bands, held at the sparse-fit ceiling, leave the plot a strip under a title and a source + // set to the canvas. The bands thicken until the plot spans a share of the room the canvas leaves + // it, each no wider than a bar, or a column of points, reads as one mark. + const fill = options.sparseFill; + if (fill && !pinnedPlot && facetCols === 1 && xTotalNominalCount > 0 && yTotalNominalCount === 0 && yContinuousAsDiscrete === 0) { + const tuning = typeof fill === 'object' ? fill : {}; + const share = Math.max(0, Math.min(1, tuning.share ?? SPARSE_FILL_SHARE)); + const room = options.bandStepFitCapacityX ?? defaultChartWidth; + // The drawing, not the plot, fills the share: the value labels beside it come out of the room. + const tick = computeFontSizing(Math.min(subplotWidth, subplotHeight), { baseLabelFontSize: options.baseLabelFontSize, baseTitleFontSize: options.baseTitleFontSize }).tickBase; + const gutter = VALUE_LABEL_CHARS[1] * tick * APPROX_CHAR_WIDTH_RATIO + TICK_ROOM; + const grouped = xIsDiscrete && xHasGrouping; + const bands = grouped ? nominalCount.x : xTotalNominalCount; + const lanes = grouped ? nominalCount.group : 1; + const cap = (options.sparseFillBars === false ? tuning.pointCap ?? SPARSE_FILL_POINT_CAP : tuning.barCap ?? SPARSE_FILL_BAR_CAP) * lanes; + const want = Math.floor(Math.min(cap, Math.max(0, share * room - gutter) / bands)); + if (want > xStepSize) { + const from = xStepSize; + xStepSize = want; + stage('xStep', 'sparse fill', xStepSize, { from, bands, room: r1(room), gutter: r1(gutter), share, cap }, 'few bands thicken until the drawing spans a share of the room the canvas leaves it, each band no wider than one mark reads'); + } + } // The step value labels need, which the plan has checked the canvas holds. for (const axis of ['x', 'y'] as const) { const need = options.labelStep?.[axis]; diff --git a/packages/flint-js/src/core/decisions.ts b/packages/flint-js/src/core/decisions.ts index bdb61b72..1aaaced3 100644 --- a/packages/flint-js/src/core/decisions.ts +++ b/packages/flint-js/src/core/decisions.ts @@ -118,6 +118,95 @@ export function chronologicalOrder(values: readonly unknown[]): string[] | undef return [...seen.entries()].sort((a, b) => a[1] - b[1]).map(([key]) => key); } +/** The mean length of a month in days, and how far a date may sit off it and still step by months. */ +const MONTH_DAYS = 365.2425 / 12; +const MONTH_SLACK_DAYS = 4; +/** Gaps within this share of the usual one keep about one step (13 or 14 days; the 1st and the 15th). */ +const CADENCE_SLACK = 0.25; + +/** + * The period each date stands for, read from the dates themselves (a field may hold timestamps + * whatever its type says): + * + * - `months`: one date per calendar period, each a whole number of months after the last whatever + * its day or time (quarter ends, the 5th of each month, years); a date stands for its month, + * quarter or year. + * - `ms`, `exact`: every gap a whole number of the step (days, weeks, hours); a date stands for + * the step from it. + * - `ms`, not `exact`: the gaps keep about one step (13 or 14 days); a date stands until the next. + * + * With the dates counted and the periods spanned at that step. Undefined for fewer than two dates, + * or times of day that keep no step. + */ +export interface DateCadence { months?: number; ms?: number; exact: boolean; count: number; periods: number } + +export function dateCadence(times: readonly number[]): DateCadence | undefined { + if (times.length < 2) return undefined; + const count = times.length; + const span = times[count - 1] - times[0]; + const gaps = times.slice(1).map((time, i) => time - times[i]); + const month = times.map((time) => { const d = new Date(time); return d.getUTCFullYear() * 12 + d.getUTCMonth(); }); + const monthGaps = month.slice(1).map((value, i) => value - month[i]); + if (monthGaps.every((g, i) => g > 0 && Math.abs(gaps[i] / DAY_MS - g * MONTH_DAYS) <= MONTH_SLACK_DAYS)) { + const step = monthGaps.reduce((g, value) => gcd(g, value), 0); + return { months: step, exact: true, count, periods: (month[count - 1] - month[0]) / step + 1 }; + } + const least = Math.min(...gaps); + const common = gaps.reduce((g, value) => gcd(g, value), 0); + if (!(least > 0) || !(common > 0)) return undefined; + if (common === least) return { ms: least, exact: true, count, periods: Math.round(span / least) + 1 }; + const usual = [...gaps].sort((a, b) => a - b)[Math.floor(gaps.length / 2)]; + const keeps = gaps.every((g) => Math.abs(g - Math.max(1, Math.round(g / usual)) * usual) <= CADENCE_SLACK * usual); + if (keeps) return { ms: usual, exact: false, count, periods: Math.round(span / usual) + 1 }; + // No step: whole days where the dates are days, at their finest common step; times of day keep none. + const midnight = times.every((time) => time % DAY_MS === 0); + return midnight ? { ms: common, exact: true, count, periods: span / common + 1 } : undefined; +} + +/** + * Where each date's cell runs along a time axis, from {@link dateCadence}: the start and end of the + * period it stands for, by date. Undefined where the dates keep no step. + */ +export function dateCells(values: readonly unknown[]): { cadence: DateCadence; cells: Map } | undefined { + const times = distinctTimes(values); + const cadence = dateCadence(times); + if (!cadence) return undefined; + const cells = new Map(); + times.forEach((time, i) => { + if (cadence.months) { + const d = new Date(time); + const step = cadence.months; + // Quarters, halves and years keep to the calendar's; other steps start at each date's month. + const from = 12 % step === 0 ? Math.floor(d.getUTCMonth() / step) * step : d.getUTCMonth(); + cells.set(time, [Date.UTC(d.getUTCFullYear(), from, 1), Date.UTC(d.getUTCFullYear(), from + step, 1)]); + } else if (cadence.exact || i === times.length - 1) { + cells.set(time, [time, time + cadence.ms!]); + } else { + // About one step: a date stands until the next, unless a date is missing between them. + const next = times[i + 1]; + cells.set(time, [time, next - time <= (1 + CADENCE_SLACK) * cadence.ms! ? next : time + cadence.ms!]); + } + }); + return { cadence, cells }; +} + +/** + * How fully dates fill the periods between the first and the last at their step + * ({@link dateCadence}): the dates counted and the periods spanned, and whether the step is in + * months. Undefined where the dates keep no step. + */ +function calendarCoverage(times: readonly number[]): { count: number; periods: number; monthly: boolean; step: number } | undefined { + const cadence = dateCadence(times); + if (!cadence) return undefined; + return { + count: cadence.count, periods: cadence.periods, monthly: cadence.months !== undefined, + step: cadence.months ?? Math.round(cadence.ms! / DAY_MS), + }; +} + +const distinctTimes = (values: readonly unknown[]): number[] => + [...new Set(values.map(snapshotTime).filter((time): time is number => time !== undefined))].sort((a, b) => a - b); + /** * Whether dates on a banded axis read as a few snapshots rather than a run of time: few of them * ({@link SNAPSHOT_MAX_DATES}), or calendar dates that fill under half the periods between the @@ -125,22 +214,24 @@ export function chronologicalOrder(values: readonly unknown[]): string[] | undef * weekly dates fill every week). Dates off the calendar grid (times of day) count by number only. */ export function readsAsSnapshots(values: readonly unknown[]): boolean { - const times = [...new Set(values.map(snapshotTime).filter((time): time is number => time !== undefined))] - .sort((a, b) => a - b); + const times = distinctTimes(values); if (times.length < 2) return false; if (times.length <= SNAPSHOT_MAX_DATES) return true; if (times.length > SNAPSHOT_MAX_BANDS) return false; - const dates = times.map((time) => new Date(time)); - const midnight = dates.every((d) => d.getUTCHours() === 0 && d.getUTCMinutes() === 0 && d.getUTCSeconds() === 0 && d.getUTCMilliseconds() === 0); - if (!midnight) return false; - const monthly = dates.every((d) => d.getUTCDate() === 1); - const index = monthly - ? dates.map((d) => d.getUTCFullYear() * 12 + d.getUTCMonth()) - : times.map((time) => Math.round(time / DAY_MS)); - const step = index.slice(1).reduce((g, value, i) => gcd(g, value - index[i]), 0); - if (!(step > 0)) return false; - const periods = (index[index.length - 1] - index[0]) / step + 1; - return index.length / periods < SNAPSHOT_MAX_COVERAGE; + const coverage = calendarCoverage(times); + return !!coverage && coverage.count / coverage.periods < SNAPSHOT_MAX_COVERAGE; +} + +/** + * The regular step dates keep on the calendar: whole months (one date per month, quarter or year, + * whatever its day) or whole days, at their finest common step (3 months for quarters, 7 days for + * weeks). Undefined for dates that keep no exact step in whole days (times of day, 13 or 14 days). + */ +export function calendarStep(values: readonly unknown[]): { unit: 'month' | 'day'; step: number } | undefined { + const cadence = dateCadence(distinctTimes(values)); + if (cadence?.months) return { unit: 'month', step: cadence.months }; + if (!cadence?.exact || cadence.ms! % DAY_MS !== 0) return undefined; + return { unit: 'day', step: cadence.ms! / DAY_MS }; } // --------------------------------------------------------------------------- diff --git a/packages/flint-js/src/core/diverging-schemes.ts b/packages/flint-js/src/core/diverging-schemes.ts new file mode 100644 index 00000000..45f0225e --- /dev/null +++ b/packages/flint-js/src/core/diverging-schemes.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The diverging colour schemes Vega names, as stops from the scheme's low end to its high end, so a + * stepped scale can take a colour at any point along one (Vega's own `scheme: { count, extent }` + * samples only evenly). Copied from vega-scale's `palettes.js` (BSD-3-Clause, University of + * Washington Interactive Data Lab), which draws on ColorBrewer (Apache-2.0, Cynthia Brewer). + */ +export const DIVERGING_SCHEME_STOPS: Record = { + blueorange: ['#134b85', '#2f78b3', '#5da2cb', '#9dcae1', '#d2e5ef', '#f2f0eb', '#fce0ba', '#fbbf74', '#e8932f', '#c5690d', '#994a07'], + brownbluegreen: ['#704108', '#a0651a', '#c79548', '#e3c78a', '#f3e6c6', '#eef1ea', '#c9e9e4', '#8ed1c7', '#4da79e', '#187a72', '#025147'], + purplegreen: ['#5b1667', '#834792', '#a67fb6', '#c9aed3', '#e6d6e8', '#eff0ef', '#d9efd5', '#aedda9', '#71bb75', '#368e49', '#0e5e29'], + purpleorange: ['#411469', '#664796', '#8f83b7', '#b9b4d6', '#dadbeb', '#f3eeea', '#fce0ba', '#fbbf74', '#e8932f', '#c5690d', '#994a07'], + redblue: ['#8c0d25', '#bf363a', '#df745e', '#f4ae91', '#fbdbc9', '#f2efee', '#d2e5ef', '#9dcae1', '#5da2cb', '#2f78b3', '#134b85'], + redgrey: ['#8c0d25', '#bf363a', '#df745e', '#f4ae91', '#fcdccb', '#faf4f1', '#e2e2e2', '#c0c0c0', '#969696', '#646464', '#343434'], + redyellowblue: ['#a50026', '#d4322c', '#f16e43', '#fcac64', '#fedd90', '#faf8c1', '#dcf1ec', '#abd6e8', '#75abd0', '#4a74b4', '#313695'], + redyellowgreen: ['#a50026', '#d4322c', '#f16e43', '#fcac63', '#fedd8d', '#f9f7ae', '#d7ee8e', '#a4d86e', '#64bc61', '#22964f', '#006837'], + pinkyellowgreen: ['#8e0152', '#c0267e', '#dd72ad', '#f0b3d6', '#fadded', '#f5f3ef', '#e1f2ca', '#b6de87', '#80bb47', '#4f9125', '#276419'], + spectral: ['#9e0142', '#d13c4b', '#f0704a', '#fcac63', '#fedd8d', '#fbf8b0', '#e0f3a1', '#a9dda2', '#69bda9', '#4288b5', '#5e4fa2'], +}; diff --git a/packages/flint-js/src/core/field-semantics.ts b/packages/flint-js/src/core/field-semantics.ts index edb1c082..b4611eaf 100644 --- a/packages/flint-js/src/core/field-semantics.ts +++ b/packages/flint-js/src/core/field-semantics.ts @@ -33,6 +33,7 @@ import { getZeroClass, inferOrdinalSortOrder, inferVisCategory, + isMeasureType, type ZeroClass, } from './semantic-types'; @@ -81,6 +82,16 @@ export interface SemanticAnnotation { */ divergingMidpoint?: number; + /** + * How far either side of the diverging midpoint still reads as neither side, for a stepped + * colour scale: `0.1` makes correlations within ±0.1 one neutral class; `false` makes the + * midpoint a break, so every class is one side or the other and a small gain never looks like + * a small loss. Unset ⇒ the semantic type decides: a type that always diverges (Correlation, + * Sentiment) or a stated midpoint gets a neutral class a step wide; one that diverges where its + * values cross a sign (Profit, PercentageChange, Temperature) breaks at it. + */ + divergingNeutral?: number | false; + /** Explicit ordinal ordering. E.g., ["Low", "Medium", "High"] */ sortOrder?: string[]; @@ -98,6 +109,14 @@ export interface SemanticAnnotation { * higher-is-better, temperatures run warm-high). */ polarity?: 'higher-is-better' | 'lower-is-better'; + + /** + * How a percentage field's numbers are stored: `fraction` (0.45 is 45%) or `percent` (45 is + * 45%). Unset ⇒ a decisive `intrinsicDomain` says (within ±1 is fractions; reaching 100 is + * percent points), else the values do. State it where the values cannot tell: a growth rate + * stored as fractions mostly past 1 (2.4 is 240%). + */ + percentScale?: 'fraction' | 'percent'; } /** d3-compatible format specification */ @@ -297,7 +316,9 @@ export function resolveDisplayUnit(annotation?: SemanticAnnotation): DisplayUnit const currency = CURRENCY_MAP[declared.toUpperCase()] ?? CURRENCY_MAP[declared]; if (currency) return { text: currency, placement: 'value', position: 'prefix' }; - const compact = UNIT_SUFFIX_MAP[declared] ?? UNIT_SUFFIX_MAP[declared.toLowerCase()]; + // A one-letter unit keeps its case: `M` is millions, not metres. + const compact = UNIT_SUFFIX_MAP[declared] + ?? (declared.length > 1 ? UNIT_SUFFIX_MAP[declared.toLowerCase()] : undefined); if (compact) return { text: compact.trim(), placement: 'value', position: 'suffix' }; // Field-level units are labels, not prose. Reject control characters, @@ -330,6 +351,27 @@ function detectPercentageRepresentation(values: number[]): '0-1' | '0-100' { return '0-100'; } +/** + * How a percentage field's numbers are stored, from what the annotation states before what the + * values suggest: `percentScale` first, then an `intrinsicDomain` that settles it (within ±1 is + * fractions; reaching 100 is percent points), then the values ({@link detectPercentageRepresentation}). + * A stated scale keeps one column formatted one way whichever rows a query returns. + */ +export function percentRepresentation( + annotation: Pick | undefined, + values: number[], +): '0-1' | '0-100' { + if (annotation?.percentScale === 'fraction') return '0-1'; + if (annotation?.percentScale === 'percent') return '0-100'; + const domain = annotation?.intrinsicDomain; + if (Array.isArray(domain) && domain.length === 2 && domain.every(Number.isFinite)) { + const reach = Math.max(Math.abs(domain[0]), Math.abs(domain[1])); + if (reach > 0 && reach <= 1) return '0-1'; + if (reach >= 100) return '0-100'; + } + return detectPercentageRepresentation(values); +} + /** * Detect the maximum number of meaningful decimal places in a set of values. * @@ -417,12 +459,13 @@ export function resolveFormat( } case 'percent': { - // Without intrinsicDomain we can't reliably distinguish 0–1 - // from 0–100, so defer to VL. - if (!annotation.intrinsicDomain) { + // Unstated, the values say how they are stored — as the measure's domain and a KPI + // read them — so 0.164 prints "16.4%" on the axis its [0, 1] domain draws. Values + // read as percent points are left to VL, as they were. + const rep = percentRepresentation(annotation, nums); + if (!annotation.intrinsicDomain && !annotation.percentScale && rep !== '0-1') { return { tooltipFormat: { pattern: precisionFormat(nums) } }; } - const rep = detectPercentageRepresentation(nums); if (rep === '0-1') { // 0–1 fractional → axis must transform (0.45 → "45%") const p = detectPrecision(nums); @@ -545,6 +588,7 @@ export function resolveDefaultVisType( * - Additive measures → sum (parts sum to a meaningful total) * - Intensive measures → average (rates/averages shouldn't be summed) * - Signed-additive → sum (preserves sign semantics) + * - Generic measures → undefined (additivity unknown: `Number`) * - Dimensions/IDs → undefined (aggregation not meaningful) */ export function resolveAggregationDefault( @@ -555,12 +599,52 @@ export function resolveAggregationDefault( case 'additive': return 'sum'; case 'signed-additive': return 'sum'; case 'intensive': return 'average'; + case 'measure': return undefined; case 'dimension': return undefined; case 'identifier': return undefined; default: return undefined; } } +/** The operation an encoding's `aggregate` names, folding the `mean` synonym into `average`. */ +function declaredAggregate(aggregate: string | undefined): 'sum' | 'average' | 'count' | undefined { + if (aggregate === 'sum' || aggregate === 'count') return aggregate; + if (aggregate === 'average' || aggregate === 'mean') return 'average'; + return undefined; +} + +/** + * How a chart combines a measure's rows into the one value it shows per category (a bar's + * label, its share of the total). Types with a default keep it. A measure with none (`Number`, + * whose additivity is unknown) takes the encoding's own `aggregate`, else the mean: summing it + * is the riskier choice, and one row's mean is that row. `undefined` for non-measures. + * + * The rows have already been reduced by any declared `aggregate` (see `applyAggregation`), so a + * declared `count` combines by sum. + */ +export function resolveDisplayAggregate( + cs: { aggregationDefault?: 'sum' | 'average'; semanticAnnotation?: { semanticType: string } } | undefined, + aggregate?: string, +): 'sum' | 'average' | undefined { + if (!cs || cs.aggregationDefault) return cs?.aggregationDefault; + if (!cs.semanticAnnotation || !isMeasureType(cs.semanticAnnotation.semanticType)) return undefined; + const declared = declaredAggregate(aggregate); + return declared === 'sum' || declared === 'count' ? 'sum' : 'average'; +} + +/** + * How an exporter that pivots raw rows reduces several rows on one cell: the encoding's own + * `aggregate` when it sets one, else `sum` for an additive default, `average` for an intensive + * one, and `average` when there is no default (summing values of unknown additivity is the + * riskier choice). + */ +export function resolvePivotAggregate( + aggregate: string | undefined, + aggregationDefault: 'sum' | 'average' | undefined, +): 'sum' | 'average' | 'count' { + return declaredAggregate(aggregate) ?? aggregationDefault ?? 'average'; +} + // ============================================================================= // §7 ZERO-BASELINE CLASSIFICATION // ============================================================================= @@ -798,7 +882,7 @@ export function resolveDomainConstraint( if (semanticType === 'Percentage') { const nums = values.filter((v: any) => typeof v === 'number' && !isNaN(v)); if (nums.length > 0) { - const rep = detectPercentageRepresentation(nums); + const rep = percentRepresentation(annotation, nums); const M = rep === '0-1' ? 1 : 100; return snapToBoundHeuristic([0, M], values); } @@ -1085,7 +1169,7 @@ export function resolveBinningSuggested( * * - 'sum': Additive measures (parts sum to whole) * - 'normalize': Proportions (show 100% breakdown) - * - false: Stacking is meaningless (rates, scores, identifiers) + * - false: Stacking is meaningless (rates, scores, generic measures, identifiers) */ export function resolveStackable( semanticType: string, @@ -1099,6 +1183,7 @@ export function resolveStackable( // Percentage is the exception — normalizable if (semanticType === 'Percentage') return 'normalize'; return false; + case 'measure': return false; case 'dimension': return false; case 'identifier': return false; default: return false; @@ -1167,9 +1252,10 @@ export function resolveFieldSemantics( // 4. For unregistered types, provide data-driven fallbacks. // The registry treats unknown types as categorical, but if the data - // is actually numeric, we should behave like a generic measure. + // is actually numeric, we should behave like a generic measure. An + // untyped number keeps summing (unlike `Number`, which was chosen and + // so says its additivity is unknown). if (!isRegistered(semanticType) && defaultVisType === 'quantitative') { - // Data looks numeric → treat like Number (GenericMeasure) if (!aggregationDefault) aggregationDefault = 'sum'; if (zeroClass === 'unknown') zeroClass = 'meaningful'; binningSuggested = true; diff --git a/packages/flint-js/src/core/filter-overflow.ts b/packages/flint-js/src/core/filter-overflow.ts index ae092fe1..9c0c0357 100644 --- a/packages/flint-js/src/core/filter-overflow.ts +++ b/packages/flint-js/src/core/filter-overflow.ts @@ -208,11 +208,12 @@ export function applyCategoryViewports( viewports: OverflowResult['viewports'], starts: Partial> = {}, ): any[] { + // The compile reads a category as text (a Year of 1880 becomes "1880"); the rows keep theirs. const windows = viewports.map((viewport) => ({ field: viewport.field, - values: new Set(resolveCategoryViewport(viewport, starts[viewport.channel]).values), + values: new Set(resolveCategoryViewport(viewport, starts[viewport.channel]).values.map(String)), })); - return data.filter((row) => windows.every((window) => window.values.has(row[window.field]))); + return data.filter((row) => windows.every((window) => window.values.has(String(row[window.field])))); } // --------------------------------------------------------------------------- @@ -263,7 +264,8 @@ function defaultOverflowOrder( } if (explicitSort?.kind === 'values') { const ordered = sortOrder === 'descending' ? [...explicitSort.values].reverse() : explicitSort.values; - return ordered.filter(value => uniqueValues.includes(value)); + const present = new Set(uniqueValues); + return ordered.filter(value => present.has(value)); } // Infer sort field and direction diff --git a/packages/flint-js/src/core/furniture-reserve.ts b/packages/flint-js/src/core/furniture-reserve.ts index 1a1ba8fb..32f43f19 100644 --- a/packages/flint-js/src/core/furniture-reserve.ts +++ b/packages/flint-js/src/core/furniture-reserve.ts @@ -14,7 +14,7 @@ import type { ChannelSemantics, LayoutResult } from './types'; /** What a chart draws around its plot that takes room from it. */ export type ReservePart = | 'yLabels' | 'yTitle' | 'sideKeys' | 'seriesEnd' - | 'xLabels' | 'xTitle' | 'title' | 'flatYTitle' | 'stackedKeys' | 'facetHeaders'; + | 'xLabels' | 'xTitle' | 'title' | 'flatYTitle' | 'stackedKeys' | 'facetHeaders' | 'footer'; /** The room a chart's furniture takes beside and above or below its plot, in px. */ export interface FurnitureReserve { @@ -41,6 +41,8 @@ export const NO_RESERVE: FurnitureReserve = { width: 0, height: 0, parts: {} }; export interface ReserveInputs { /** The dimensions to measure: the ones a fitted axis runs along. */ along: { width: boolean; height: boolean }; + /** The source line's and credit's room at the foot, where the plot is sized round it rather than giving it up after. */ + footer?: number; structure: ChartStructure; design: DesignDecisions; themed: boolean; @@ -57,6 +59,11 @@ export interface ReserveInputs { /** The headline and deck the chart prints, and how they were fitted where the plan fitted them. */ title?: { text: string; subtitle?: string[] }; titlePlan?: TitlePlan; + /** + * Whether a deck printed with no headline — axis titles a theme moves above the plot — counts its + * line. The plot is sized without it; what the drawing measures against a stated canvas counts it. + */ + deckAlone?: boolean; rows: any[]; spacing: FurnitureSpacing; measure: TextMeasurer; @@ -164,11 +171,11 @@ function seriesEndWidth(inputs: ReserveInputs): number { */ function titleHeight(inputs: ReserveInputs): number { const { title, titlePlan, design, themed, layout, spacing } = inputs; - if (!title?.text) return 0; - const headline = titlePlan?.headline?.fontSize ?? (themed ? design.title.headline.fontSize : undefined) ?? layout.titleFontSize; - const deck = titlePlan?.deck ?? title.subtitle?.join(' '); + const deck = titlePlan?.deck ?? title?.subtitle?.join(' '); + if (!title?.text && !(inputs.deckAlone && deck)) return 0; + const headline = !title?.text ? 0 : titlePlan?.headline?.fontSize ?? (themed ? design.title.headline.fontSize : undefined) ?? layout.titleFontSize; const deckSize = (themed ? design.title.deck.fontSize : undefined) ?? Math.round(layout.titleFontSize * 0.85); - const deckRoom = deck ? (themed ? design.title.deckPadding : spacing.deckPadding) + deckSize : 0; + const deckRoom = deck ? (headline ? (themed ? design.title.deckPadding : spacing.deckPadding) : 0) + deckSize : 0; // Over keys above the plot the title stands at the header's inner gap; its own gap is the keys'. return headline + deckRoom + (inputs.legend.layout?.headerGap ?? (themed ? design.title.offset : spacing.titleOffset)); } @@ -221,6 +228,7 @@ export function measureReserve(inputs: ReserveInputs): FurnitureReserve { if (furniture.yTitle?.top) parts.flatYTitle = furniture.yTitle.top; const keys = keyRoom(inputs, ROWS, 'height'); if (keys) parts.stackedKeys = keys; + if (inputs.footer) parts.footer = inputs.footer; if (layout.facet && inputs.channelSemantics.column?.field && design.facets.header.show !== false) { parts.facetHeaders = Math.round((design.facets.header.fontSize ?? 11) * 1.7); } @@ -233,7 +241,7 @@ export function measureReserve(inputs: ReserveInputs): FurnitureReserve { const sum = (names: ReservePart[]) => names.reduce((total, name) => total + (parts[name] ?? 0), 0); return { width: Math.ceil(sum(['yLabels', 'yTitle', 'sideKeys', 'seriesEnd'])), - height: Math.ceil(sum(['xLabels', 'xTitle', 'title', 'flatYTitle', 'stackedKeys', 'facetHeaders'])), + height: Math.ceil(sum(['xLabels', 'xTitle', 'title', 'flatYTitle', 'stackedKeys', 'facetHeaders', 'footer'])), parts, ...(unmeasured.length ? { unmeasured } : {}), }; diff --git a/packages/flint-js/src/core/index.ts b/packages/flint-js/src/core/index.ts index 21c40fe6..4e5288b9 100644 --- a/packages/flint-js/src/core/index.ts +++ b/packages/flint-js/src/core/index.ts @@ -22,6 +22,10 @@ export { type RawEncodingValue, type StaticSeriesMetadata, type AssembleOptions, + type Boundaries, + type BoundaryFile, + type BoundaryIds, + type ChartCredit, type ChartTemplateDef, type ChartWarning, type ChannelSemantics, @@ -188,6 +192,8 @@ export { fullValueFormat, resolveDefaultVisType, resolveAggregationDefault, + resolveDisplayAggregate, + resolvePivotAggregate, resolveZeroClassFromAnnotation, resolveScaleType, resolveDomainConstraint, @@ -221,9 +227,12 @@ export { type TargetDetailsOptions, type TargetFeedbackOptions, } from './interaction-spec'; -export { CHART_UPDATE_OPS, type ChartUpdate, type ChartUpdateOp } from './interaction-contracts'; +export { + CHART_UPDATE_OPS, DEPRECATED_UPDATE_OPS, EMPHASIS_OPACITY, canonicalUpdateOp, isDeprecatedUpdateOp, isTextAnnotationOp, + type ChartUpdate, type ChartUpdateOp, type EnclosureAnnotationSpec, type RegionAnnotationSpec, +} from './interaction-contracts'; export { comparableValue, selectorConditions, selectorPredicate, selectorRowTest, selectorText, type RowComparison } from './target-selector'; -export { chartTable, chartTableRowTest, chartTableStyle, type ChartTable, type ChartTableCell, type ChartTableHeading, type ChartTableColumn, type ChartTableStyle, type ChartTableText } from './chart-table'; +export { chartTable, chartTableRowTest, chartTableStyle, type ChartTable, type ChartTableCell, type ChartTableHeading, type ChartTableFurniture, type ChartTableColumn, type ChartTableStyle, type ChartTableText } from './chart-table'; // ThemeSpec: public visual-system vocabulary and chart-specific grounding export { diff --git a/packages/flint-js/src/core/interaction-contracts.ts b/packages/flint-js/src/core/interaction-contracts.ts index 196087ee..ae05e111 100644 --- a/packages/flint-js/src/core/interaction-contracts.ts +++ b/packages/flint-js/src/core/interaction-contracts.ts @@ -91,6 +91,11 @@ export type SemanticTargetSelector = export type UpdateTarget = SemanticTargetRef | SemanticTargetSelector; +/** + * Where on its mark a template's note may name it: the centre, a side, a bar's value end or side, the + * middle of a stretch of a line or area, a slice's middle or rim. A template offers these through + * {@link AnnotationCandidate}s; the caption is placed from the first one. + */ export type AnnotationConnection = | 'center' | 'top' @@ -103,26 +108,40 @@ export type AnnotationConnection = | 'radial-midpoint' | 'outer-radial'; +/** @deprecated Ignored: a note names one mark, and its caption draws one leader. */ export interface AnnotationConnectorAnchor { role: string; connection: AnnotationConnection; valueAxis?: 'x' | 'y'; } +/** How a template's notes connect to its marks, set by its presenter rather than by an update. */ export interface AnnotationCandidate { connection: AnnotationConnection; valueAxis?: 'x' | 'y'; crossSide?: 'start' | 'end'; valueInset?: number; - anglePreference?: 'normal' | 'oblique'; - textAlign?: 'left' | 'center' | 'right'; + /** `'none'` never draws a leader. */ connector?: 'line' | 'none'; + /** The width the caption wraps to, in px. */ maxWidth?: number; + /** @deprecated Ignored since notes are set as captions: the placer weighs every side. */ + anglePreference?: 'normal' | 'oblique'; + /** @deprecated Ignored: a caption's lines align toward its mark. */ + textAlign?: 'left' | 'center' | 'right'; + /** @deprecated Ignored: the placer weighs how far a caption stands from its mark. */ maxDistance?: number; + /** @deprecated Ignored: the caption is placed from the first candidate. */ priority?: number; + /** @deprecated Ignored: a note names one mark, and its caption draws one leader. */ connectorAnchors?: readonly AnnotationConnectorAnchor[]; } +/** + * A caption on one mark, after Blabber's `text`: words beside the mark, haloed in the page, with a + * leader only where the caption is not plainly beside it. A card, a callout box or any other + * styled note is a `set-overlay` or `set-freeform-overlay`. + */ export interface AnnotationSpec { text?: string; /** @@ -131,10 +150,98 @@ export interface AnnotationSpec { * starts no segment and is always marked at its point. */ anchor?: 'segment' | 'point'; + /** + * How a note marks what it names: `'none'` leaves it as drawn; `'light'` (the default) lifts a + * dot above its neighbours with a halo, draws a stretch of a line or area again in its ink, and + * faintly outlines a bar, a cell or a slice; `'strong'` adds a ring round a dot and a full + * outline; `'exclusive'` is strong and recedes every other mark, as `set-style` `emphasized` does. + */ + highlight?: 'none' | 'light' | 'strong' | 'exclusive'; + /** + * The caption's type, over the theme's: size in px, weight, ink. Omitted, a note takes the + * theme's `type.annotation` role, else the axis labels' face and weight a size up in the primary ink. + */ + style?: NoteTextStyle; + /** The ring or outline's paint for this note, over the theme's `interaction.highlight`. */ + highlightStyle?: HighlightStyle; +} + +/** A ring's or an outline's paint where one update sets its own. */ +export interface HighlightStyle { + color?: string; + /** Stroke width in px of the strong ring or outline; the light one is drawn a little thinner. */ + width?: number; +} + +/** A caption's type where one note sets its own. */ +export interface NoteTextStyle { + fontSize?: number; + fontWeight?: number | 'normal' | 'bold'; + color?: string; +} + +/** + * A note as a template's presenter hands it to the renderer: the update's {@link AnnotationSpec}, + * with where on the mark it may connect and what kind of mark it names. Not part of an update. + */ +export interface PresentedAnnotationSpec extends AnnotationSpec { candidates?: readonly AnnotationCandidate[]; subject?: Partial; } +/** + * A shaded stretch of the plot, after Blabber's `region`. One axis shades a band across the plot, + * both a box. On a continuous axis a stretch is two bounds, either of which may be `null` (open: the + * plot's end on that side); on a banded axis it is the categories it covers, which must be next to + * each other. The caption is set on the stretch it names, inside where it fits clear of the data, + * else outside it with a leader. + */ +export interface RegionAnnotationSpec { + x?: readonly unknown[]; + y?: readonly unknown[]; + /** + * On a map, the region's box in degrees, `[west, east]` and `[south, north]`, in place of `x` + * and `y`: its edges follow the meridians and parallels as the map's projection draws them. + * Both are needed; a west edge east of the east edge runs across the antimeridian. + */ + longitude?: readonly [number, number]; + latitude?: readonly [number, number]; + text?: string; + /** The wash's colour; by default a muted one distinct from the marks and the other regions. */ + color?: string; + /** The wash's opacity; 0.16 by default, 0.18 over an area chart. */ + opacity?: number; + /** `under` (the default) reads beneath the marks; `over` washes over them, as on an area chart. */ + layer?: 'under' | 'over'; + /** + * Where the caption stands: `top`, `bottom`, `left`, `right`, `center` within the region, `above` + * or `below` it, just past its edge (past the plot for a stretch of x, which spans the plot's + * height). A region too small for its caption where asked has it placed where it fits. Left out, + * the clearest place is chosen. + */ + placement?: 'top' | 'bottom' | 'left' | 'right' | 'center' | 'above' | 'below'; +} + +/** + * An outline round sets of marks, after Blabber's `enclose`. Each target is one group, outlined on + * its own; all of them share the caption. Bars, cells and stacks default to a `rect`, other marks to + * a `hull`. + */ +export interface EnclosureAnnotationSpec { + targets: readonly UpdateTarget[]; + text?: string; + shape?: 'hull' | 'rect' | 'ellipse' | 'circle'; + /** + * Leaders from the shared caption to the outlines: `auto` (the default) draws one to each of two + * or three outlines and none for one or more than three; `all` and `none` say so outright. + */ + connect?: 'auto' | 'all' | 'none'; + /** The outline's, its caption's and its leaders' colour; by default the theme's `interaction.highlight`, else one that reads on the marks and the page. */ + color?: string; + /** The outline's stroke width in px; by default the theme's, else 1.5. */ + width?: number; +} + export interface StyleSpec { visible?: boolean; opacity?: number; @@ -142,24 +249,36 @@ export interface StyleSpec { stroke?: string; strokeWidth?: number; /** - * `emphasized` and `focused` recede everything else to `mutedOpacity`. `highlighted` gives the - * targets their mark's hover cue and leaves the rest as drawn. + * `emphasized` and `focused` recede everything else; `emphasis` says how far. `highlighted` gives + * the targets their mark's hover cue and leaves the rest as drawn. */ state?: 'normal' | 'focused' | 'emphasized' | 'highlighted' | 'muted'; + /** + * How far the rest recede when the targets are emphasized, as a note's `highlight`: `'light'` + * (the default; the rest keep 0.6 of their opacity and stay readable), `'strong'` (0.35) or + * `'exclusive'` (0.2, only the targets read). Their value labels stay legible: they recede less + * and take the page's ink. `mutedOpacity` states the receded opacity outright. + */ + emphasis?: 'light' | 'strong' | 'exclusive'; mutedOpacity?: number; } +/** The opacity each emphasis level recedes the other marks to. */ +export const EMPHASIS_OPACITY = { light: 0.6, strong: 0.35, exclusive: 0.2 } as const; + export interface OverlayStyleSpec { fill?: string; fillOpacity?: number; /** On text, the halo behind the glyphs: the chart's background by default, `'none'` for no halo. */ stroke?: string; strokeWidth?: number; - strokeDash?: readonly number[]; + /** Dash and gap lengths in px, or a word: `'dash'` (`'dashed'`) or `'dot'` (`'dotted'`). */ + strokeDash?: readonly number[] | 'dash' | 'dashed' | 'dot' | 'dotted'; opacity?: number; pointRadius?: number; fontSize?: number; fontWeight?: number | 'normal' | 'bold'; + fontStyle?: 'normal' | 'italic'; textAlign?: 'start' | 'middle' | 'end'; dx?: number; dy?: number; @@ -175,6 +294,12 @@ export interface OverlayFieldEncoding { * A retained visual projected through an existing plot's scales. A rule with * only `x` or only `y`, and a rect with only `x`/`x2` or only `y`/`y2`, span * the plot along the other axis. + * + * On a map, `longitude` and `latitude` place it through the map's projection + * instead, as it is panned, zoomed or turned: a point or a text at a place, a + * line through places in order along great circles, a rule from one place + * (`longitude`, `latitude`) to another (`longitude2`, `latitude2`), a rect over + * the box between them, its edges along meridians and parallels. */ export interface ChartOverlaySpec { mark: OverlayMark; @@ -184,6 +309,10 @@ export interface ChartOverlaySpec { y?: OverlayFieldEncoding; x2?: OverlayFieldEncoding; y2?: OverlayFieldEncoding; + longitude?: OverlayFieldEncoding; + latitude?: OverlayFieldEncoding; + longitude2?: OverlayFieldEncoding; + latitude2?: OverlayFieldEncoding; order?: OverlayFieldEncoding; color?: OverlayFieldEncoding; text?: OverlayFieldEncoding; @@ -192,6 +321,13 @@ export interface ChartOverlaySpec { interactive?: boolean; projectable?: boolean; style?: OverlayStyleSpec; + /** + * `over` (the default) draws the overlay above the chart's marks; `under` reads beneath them: a map + * line or rule is cut away wherever the chart draws a mark (a route, its heads, a stop) on it, so a + * reference — the direct way home beside the route taken — stays in the background. Under needs the + * SVG renderer; on canvas it is drawn over. + */ + layer?: 'under' | 'over'; } export interface FreeformOverlayTransform { @@ -231,10 +367,32 @@ export type ChartUpdateOp = value: StyleSpec; } | { + /** A caption on one mark, after Blabber's `text`. */ + op: 'annotate-text'; + target: UpdateTarget; + value: AnnotationSpec | null; + } + | { + /** + * @deprecated Use `annotate-text`, which this older name means. Still read in 1.x, with a + * validation warning; removed in 2.0. + */ op: 'set-annotation'; target: UpdateTarget; value: AnnotationSpec | null; } + | { + op: 'annotate-region'; + /** Names the region, so several stand together and each clears on its own (`value: null`). */ + name: string; + value: RegionAnnotationSpec | null; + } + | { + op: 'annotate-enclosure'; + /** Names the enclosure, so several stand together and each clears on its own (`value: null`). */ + name: string; + value: EnclosureAnnotationSpec | null; + } | { op: 'set-viewport'; axes: 'x' | 'y' | 'xy'; @@ -263,9 +421,12 @@ export type ChartUpdateOp = value: { rows: readonly Record[] }; }; +/** The ops a chart update may name. */ export const CHART_UPDATE_OPS = [ 'set-style', - 'set-annotation', + 'annotate-text', + 'annotate-region', + 'annotate-enclosure', 'set-viewport', 'set-order', 'set-overlay', @@ -278,6 +439,41 @@ export interface ChartUpdate { ops: readonly ChartUpdateOp[]; } +/** + * Older op names still read, each with the op it means. Each is accepted with a warning and will be + * removed in the next major version. + */ +export const DEPRECATED_UPDATE_OPS = { + 'set-annotation': 'annotate-text', +} as const satisfies Partial>; + +/** Whether an op name is one of {@link DEPRECATED_UPDATE_OPS}. */ +export function isDeprecatedUpdateOp(name: string): name is keyof typeof DEPRECATED_UPDATE_OPS { + return Object.prototype.hasOwnProperty.call(DEPRECATED_UPDATE_OPS, name); +} + +export type TextAnnotationOp = Extract; + +let warnedDeprecatedOp = false; + +/** + * An op as the runtime reads it: `set-annotation` is `annotate-text` by its deprecated name. The + * first deprecated op a page reads is reported once on the console. + */ +export function canonicalUpdateOp(op: ChartUpdateOp): ChartUpdateOp { + if (op.op !== 'set-annotation') return op; + if (!warnedDeprecatedOp && typeof console !== 'undefined') { + warnedDeprecatedOp = true; + console.warn('[flint] The ChartUpdate op "set-annotation" is deprecated and will be removed in 2.0; write "annotate-text", which it means.'); + } + return { ...op, op: 'annotate-text' }; +} + +/** Whether an op is a caption on one mark, by either name. */ +export function isTextAnnotationOp(op: ChartUpdateOp): op is Extract { + return op.op === 'annotate-text' || op.op === 'set-annotation'; +} + export interface NavigationDomainGuard { minVisibleFraction: number; maxVisibleFraction: number; diff --git a/packages/flint-js/src/core/interaction-spec.ts b/packages/flint-js/src/core/interaction-spec.ts index 0f93252e..de4f163e 100644 --- a/packages/flint-js/src/core/interaction-spec.ts +++ b/packages/flint-js/src/core/interaction-spec.ts @@ -202,4 +202,20 @@ export interface InteractionSpec { /** Presets assist by default; false requires direct hits, maxDistance overrides eligible presets. */ assistedTargeting?: boolean | AssistedTargetingOptions; keyboardTargeting?: boolean; + /** + * The behaviour every mounted chart has without an entry: a tooltip that reads the nearest mark, + * a legend click that dims a group, and on a dense chart a Ctrl/⌘-wheel zoom and drag pan. + * `false` turns all three off; an object turns each off by name. Defaults to on. + */ + defaults?: InteractionDefaults; +} + +/** The baseline behaviours, all on unless turned off (`false`, or `{ tooltip: false }` and so on). */ +export type InteractionDefaults = boolean | { tooltip?: boolean; legend?: boolean }; + +/** Whether one baseline behaviour is on. */ +export function baselineOn(defaults: InteractionDefaults | undefined, behaviour: 'tooltip' | 'legend'): boolean { + if (defaults === undefined || defaults === true) return true; + if (defaults === false) return false; + return defaults[behaviour] !== false; } diff --git a/packages/flint-js/src/core/kpi-format.ts b/packages/flint-js/src/core/kpi-format.ts index ae7a06fa..94fd450d 100644 --- a/packages/flint-js/src/core/kpi-format.ts +++ b/packages/flint-js/src/core/kpi-format.ts @@ -11,8 +11,8 @@ */ import { format as formatNumber } from 'd3-format'; import type { ChannelSemantics } from './types'; -import { resolveDisplayUnit, type DisplayUnit } from './field-semantics'; -import { COMPACT_SUFFIXES, DEFAULT_COMPACT_TYPES, compactApplies } from './number-compact'; +import { percentRepresentation, resolveDisplayUnit, type DisplayUnit } from './field-semantics'; +import { COMPACT_SUFFIXES, DEFAULT_COMPACT_TYPES, compactApplies, compactPower } from './number-compact'; import { getRegistryEntry, isRegistered } from './type-registry'; /** The least magnitude a tile prints compacted. */ @@ -46,7 +46,7 @@ export function kpiNumberFormat(cs: ChannelSemantics | undefined, values: readon const unit = resolveDisplayUnit(annotation); const statedPercent = /%/.test(cs?.format?.pattern ?? ''); const percent = statedPercent || entry?.formatClass === 'percent'; - const fractional = percent && (statedPercent || (nums.length > 0 && nums.filter((v) => Math.abs(v) <= 1).length / nums.length >= 0.8)); + const fractional = percent && (statedPercent || ((nums.length > 0 || !!annotation?.percentScale) && percentRepresentation(annotation, nums) === '0-1')); const prefix = unit?.placement === 'value' && unit.position === 'prefix' ? unit.text : ''; const unitSuffix = unit?.placement === 'value' && unit.position === 'suffix' @@ -70,9 +70,8 @@ export function kpiNumberFormat(cs: ChannelSemantics | undefined, values: readon said, }, DEFAULT_COMPACT_TYPES); if (compact) { - let power = Math.min(4, Math.floor(Math.log10(a) / 3)); // 999,960 rounds to 1000k; it prints as 1M. - if (power < 4 && Number((a / 10 ** (3 * power)).toPrecision(3)) >= 1000) power += 1; + const power = compactPower(a); return { divisor: 10 ** (3 * power), pattern: '.3~r', prefix, suffix: COMPACT_SUFFIXES.short[power - 1] + suffix }; } return { divisor: 1, pattern: cents && !Number.isInteger(value) ? ',.2f' : ',.2~f', prefix, suffix }; diff --git a/packages/flint-js/src/core/label-sequence.ts b/packages/flint-js/src/core/label-sequence.ts index 584142a6..839f8ef5 100644 --- a/packages/flint-js/src/core/label-sequence.ts +++ b/packages/flint-js/src/core/label-sequence.ts @@ -78,6 +78,23 @@ function valueOf(kind: SequenceKind, name: string): number { } } +/** + * Of `names`, those on the round interval `shown` was thinned to. A thinning chosen over a window + * of the names (a category rail's first window) carries to all of them; undefined where `shown` + * holds fewer than two values to read the interval from. + */ +export function onRoundInterval(kind: SequenceKind, shown: readonly string[], names: readonly string[]): string[] | undefined { + const marks = [...new Set(shown.map((name) => valueOf(kind, name)))].sort((a, b) => a - b); + if (marks.length < 2 || marks.some((value) => !Number.isFinite(value))) return undefined; + let interval = Infinity; + for (let i = 1; i < marks.length; i++) interval = Math.min(interval, marks[i] - marks[i - 1]); + if (!(interval > 0)) return undefined; + return names.filter((name) => { + const value = valueOf(kind, name); + return Number.isFinite(value) && (((value - marks[0]) % interval) + interval) % interval === 0; + }); +} + /** * The names a sequence axis prints when every name cannot: those on the finest round interval * whose labels stand `needed` px apart across bands `band` px wide, where at least two land, and diff --git a/packages/flint-js/src/core/layout-costs.ts b/packages/flint-js/src/core/layout-costs.ts index 05c22ccc..686c7975 100644 --- a/packages/flint-js/src/core/layout-costs.ts +++ b/packages/flint-js/src/core/layout-costs.ts @@ -22,6 +22,9 @@ export const LAYOUT_COSTS = { names: 0.4, /** Long names down the y axis wrap onto a second line. */ rowNames: 0.4, + /** The axis labels a size down, and more the smaller they get, per share of their size given up. */ + labels: 0.3, + labelsPerShare: 0.6, /** Key names held narrower still. */ namesNarrow: 0.05, /** The headline and deck one size down. */ diff --git a/packages/flint-js/src/core/legend-plan.ts b/packages/flint-js/src/core/legend-plan.ts index 83f8f678..3194285c 100644 --- a/packages/flint-js/src/core/legend-plan.ts +++ b/packages/flint-js/src/core/legend-plan.ts @@ -6,6 +6,7 @@ import type { DesignDecisions } from './theme/types'; import type { ChannelSemantics, LayoutResult } from './types'; import { format as formatNumber } from 'd3-format'; import { niceTicks } from './ruler'; +import { exactFormat, printFormatted } from './sample-format'; /** A key the chart may draw, and what the plan decides about it. */ export interface PlannedKey { @@ -23,6 +24,8 @@ export interface PlannedKey { untitled: boolean; /** The values a key to values is sampled at. */ samples?: number[]; + /** The samples as the key prints them: in the field's format, precise enough for each. */ + sampleLabels?: string[]; /** The categories a colour key keeps by name, largest share first, and the entry the rest share. */ fold?: { kept: unknown[]; others: string }; /** The labels a key that names categories lists, in order. */ @@ -76,7 +79,7 @@ const CONNECTED_MARKS = new Set(['line', 'area', 'trail']); const NAMING_CHANNELS = new Set(['color', 'fill', 'stroke', 'shape', 'size', 'opacity']); /** A few round numbers spanning what a field holds, spaced quadratically, largest last; none past zero or below. */ -export function roundSample(rows: any[], field: string, count: number): number[] | undefined { +export function roundSample(rows: any[], field: string, count: number, integersOnly = false): number[] | undefined { let max = -Infinity; let min = Infinity; for (const row of rows ?? []) { @@ -90,7 +93,11 @@ export function roundSample(rows: any[], field: string, count: number): number[] const ladder: number[] = []; for (let exp = Math.floor(Math.log10(max)); exp >= Math.floor(Math.log10(max)) - 3; exp--) { for (const step of [...NICE_STEPS].reverse()) { - const v = step * 10 ** exp; + // Rounded off the float the power leaves (0.1 × 3 is not 0.3), so 25 is an integer. + const v = Number((step * 10 ** exp).toPrecision(12)); + // A field that counts (its semantic type whole numbers: a count, a rank) is keyed in whole + // numbers: no 2.5 people, no half a ship. + if (integersOnly && (v < 1 || !Number.isInteger(v))) continue; if (v <= max * 1.0001 && !ladder.includes(v)) ladder.push(v); } } @@ -108,9 +115,28 @@ export function roundSample(rows: any[], field: string, count: number): number[] out.push(options.reduce((best, v) => (Math.abs(Math.log(v / target)) < Math.abs(Math.log(best / target)) ? v : best))); } out.reverse(); + // The smallest value keyed just off the data's least, where that least is itself round, is the + // least: what the reader meets in the data (a crew that dwindles to one man keys 1, not 2). + if (out.length > 0 && min > 0 && min < out[0] && out[0] / min <= LEAST_SNAP && isRound(min, integersOnly)) out[0] = min; return out.length > 1 ? out : undefined; } +/** How far above the data's least a key's smallest value may stand and still be moved onto it. */ +const LEAST_SNAP = 3; + +/** Whether a value is one of the round values a key lists: 1, 2, 2.5 or 5 of a power of ten. */ +function isRound(value: number, integersOnly: boolean): boolean { + if (integersOnly && !Number.isInteger(value)) return false; + const exp = Math.floor(Math.log10(value)); + return NICE_STEPS.some((step) => Number((step * 10 ** exp).toPrecision(12)) === Number(value.toPrecision(12))); +} + +/** Each sampled value as its key prints it: the field's format, raised to the precision the samples need. */ +function sampleLabels(samples: number[], fmt: ChannelSemantics['format']): string[] { + const exact = exactFormat(samples, fmt); + return samples.map((value) => printFormatted(value, exact)); +} + /** The ticks a key to a field's values lists where none are sampled: a scale's five or so, from zero for a size. */ function valueKeyTicks(rows: any[], field: string, fromZero: boolean): string[] | undefined { let min = Infinity; @@ -226,8 +252,9 @@ export function planLegend(inputs: LegendInputs): LegendPlan { const { placement, structure, design, rows, layout, plot, composite, flatYTitle } = inputs; const named = !design || (design.legend.show && placement.placement !== 'seriesEnd' && placement.placement !== 'inline'); const drafted: PlannedKey[] = (structure.keys ?? []).map((key) => { - // A size, an opacity or a colour ramp lists numbers, and a number names nothing until the key says what it counts. - const valueKey = (key.channel === 'size' || INK_CHANNELS.has(key.channel)) && key.type === 'quantitative'; + // A size, a line width, an opacity or a colour ramp lists numbers, and a number names nothing until the key says what it counts. + const sized = key.channel === 'size' || key.channel === 'strokeWidth'; + const valueKey = (sized || INK_CHANNELS.has(key.channel)) && key.type === 'quantitative'; const governed = Boolean(design) && NAMING_CHANNELS.has(key.channel); const show = !governed || named || valueKey; // A key the template makes itself — a waterfall's total, increase and decrease — is explained @@ -238,9 +265,11 @@ export function planLegend(inputs: LegendInputs): LegendPlan { structure[axis]?.fields.includes(key.field!) && typeof inputs.axisTitles?.[axis] === 'string' && design?.axes[axis]?.title.show !== false); const untitled = Boolean(design) && named && (!design!.legend.title || madeByChart || printedOnAxis) && governed && !valueKey; const cap = !named || !key.field || key.type !== 'quantitative' ? undefined - : key.channel === 'size' ? Math.min(design?.legend.maxSwatches ?? Infinity, sizeKeySwatches(placement.orient, plot)) + : sized ? Math.min(design?.legend.maxSwatches ?? Infinity, sizeKeySwatches(placement.orient, plot)) : key.channel === 'opacity' ? design?.legend.maxSwatches : undefined; - const samples = cap ? roundSample(rows, key.field!, cap) : undefined; + const samples = cap + ? roundSample(rows, key.field!, cap, inputs.channelSemantics[key.channel]?.tickConstraint?.integersOnly === true) + : undefined; const fold = design && key.channel === 'color' && key.field && !key.via ? foldedColour(inputs, key.field, design) : undefined; const planned: PlannedKey = { channel: key.channel, @@ -248,7 +277,7 @@ export function planLegend(inputs: LegendInputs): LegendPlan { ...(key.via ? { via: key.via } : {}), ...(key.type ? { type: key.type } : {}), valueKey, show, untitled, - ...(samples ? { samples } : {}), + ...(samples ? { samples, sampleLabels: sampleLabels(samples, inputs.channelSemantics[key.channel]?.format) } : {}), ...(fold ? { fold } : {}), }; const entries = show ? keyEntries(planned, key.entries, inputs) : undefined; @@ -374,7 +403,7 @@ export function keysToLayout(plan: LegendPlan, inputs: KeyLayoutInputs): Array String(row?.[key.field!])))] } : {}), + ? { valueLabels: key.sampleLabels ?? key.samples?.map(String) ?? drawnTicks ?? [...new Set(inputs.rows.map((row) => String(row?.[key.field!])))] } : {}), count: key.samples?.length ?? key.entries?.length ?? drawnTicks?.length ?? 5, title, style, diff --git a/packages/flint-js/src/core/line-density.ts b/packages/flint-js/src/core/line-density.ts new file mode 100644 index 00000000..4acc1015 --- /dev/null +++ b/packages/flint-js/src/core/line-density.ts @@ -0,0 +1,38 @@ +import type { ChannelSemantics } from './types'; + +/** The stroke below which a line stops reading as a line on screen, in px. */ +export const MIN_DENSE_STROKE = 0.75; +/** The share of a panel's height a chart's lines may ink between them. */ +export const LINE_INK_SHARE = 0.15; + +/** The panels a faceted chart draws, and so the panels its rows are shared among. */ +export function panelCount(rows: any[], channelSemantics: Record): number { + let panels = 1; + for (const field of [channelSemantics.column?.field, channelSemantics.row?.field]) { + if (field) panels *= Math.max(1, new Set(rows.map((row) => row?.[field]).filter((value) => value != null)).size); + } + return panels; +} + +/** How many lines one panel draws: one per series (colour, detail, dash), shared among the panels; 0 where no field splits them. */ +export function linesPerPanel(rows: any[], channelSemantics: Record): number { + const seriesFields = (['color', 'detail', 'strokeDash'] as const) + .map((channel) => channelSemantics[channel]?.field) + .filter((field): field is string => !!field); + if (seriesFields.length === 0 || rows.length === 0) return 0; + const facetFields = [channelSemantics.column?.field, channelSemantics.row?.field].filter((field): field is string => !!field); + const keys = new Set(rows.map((row) => [...facetFields, ...seriesFields].map((field) => String(row?.[field])).join('\u0000'))); + return keys.size / panelCount(rows, channelSemantics); +} + +/** + * The width lines are drawn at once `lines` of them share a panel `plotHeight` px tall: the backend's + * (or house's) `base` weight, thinned where the series would ink more than 15% of the panel between + * them, to no less than 0.75 px. A line runs the panel's width, so its ink is its width against the + * panel's height. Undefined where the base stands. + */ +export function denseLineWidth(base: number, lines: number, plotHeight: number): number | undefined { + if (!(plotHeight > 0) || !(lines > 0)) return undefined; + const width = Math.max(MIN_DENSE_STROKE, Math.min(base, Math.round(((plotHeight * LINE_INK_SHARE) / lines) * 100) / 100)); + return width < base ? width : undefined; +} diff --git a/packages/flint-js/src/core/measure-domain.ts b/packages/flint-js/src/core/measure-domain.ts index ba483fea..a8a6a668 100644 --- a/packages/flint-js/src/core/measure-domain.ts +++ b/packages/flint-js/src/core/measure-domain.ts @@ -1,4 +1,4 @@ -import { snapToBoundHeuristic, type DomainConstraint } from './field-semantics'; +import { percentRepresentation, snapToBoundHeuristic, type DomainConstraint } from './field-semantics'; import type { AxisDescription } from './structure'; import type { ChannelSemantics } from './types'; @@ -168,8 +168,7 @@ function intrinsicDomain(cs: ChannelSemantics, rows: any[], field: string): [num if (semanticType === 'Percentage') { const nums = rows.map((r) => r[field]).filter((v: any) => typeof v === 'number' && !isNaN(v)); if (nums.length > 0) { - const fractional = nums.filter((v) => Math.abs(v) <= 1).length / nums.length >= 0.8; - return fractional ? [0, 1] : [0, 100]; + return percentRepresentation(cs.semanticAnnotation, nums) === '0-1' ? [0, 1] : [0, 100]; } } return undefined; diff --git a/packages/flint-js/src/core/normalize-properties.ts b/packages/flint-js/src/core/normalize-properties.ts index 19417b29..2185a8a1 100644 --- a/packages/flint-js/src/core/normalize-properties.ts +++ b/packages/flint-js/src/core/normalize-properties.ts @@ -61,6 +61,8 @@ export function normalizeChartProperties( // Already a valid accepted value — nothing to do. An array value (a map's centre) arrives // as a fresh array from JSON, so it is matched by its contents. if (def.options.some((o) => sameOptionValue(o.value, value))) continue; + // A value the property takes beside its options (a map's own boundary file). + if (def.accepts?.(value)) continue; // Known label (case-insensitive) → coerce to the canonical value. const byLabel = @@ -86,12 +88,13 @@ export function normalizeChartProperties( const accepted = def.options .map((o) => (o.value == null ? '(default)' : `'${o.value}'`)) .join(', '); + const shown = typeof value === 'object' ? JSON.stringify(value).slice(0, 80) : `'${value}'`; const copy = ensureCopy(); delete copy[def.key]; warnings.push({ severity: 'warning', code: 'invalid-option-value', - message: `chartProperties.${def.key}: '${value}' is not a valid option (accepted: ${accepted}). Falling back to the default.`, + message: `chartProperties.${def.key}: ${shown} is not a valid option (accepted: ${accepted}${def.acceptsLabel ? `, or ${def.acceptsLabel}` : ''}). Falling back to the default.`, }); } diff --git a/packages/flint-js/src/core/number-compact.ts b/packages/flint-js/src/core/number-compact.ts index 52e1ad74..c0c61b06 100644 --- a/packages/flint-js/src/core/number-compact.ts +++ b/packages/flint-js/src/core/number-compact.ts @@ -85,11 +85,29 @@ export function compactApplies( return types.includes(entry.t1); } +/** + * The least magnitude that prints in a power of a thousand: the power itself, or for the powers + * above the first, the point where the unit below rounds to 1000 (999,500 prints as 1M, not + * 1000k). Three significant figures round at 999.5; `decimals` fixed decimals at 1000 − ½·10⁻ᵈ. + */ +export function compactFloor(power: number, decimals?: number): number { + if (power <= 1) return 10 ** (3 * power); + const rollsAt = decimals === undefined ? 999.5 : 1000 - 0.5 * 10 ** -decimals; + return rollsAt * 10 ** (3 * (power - 1)); +} + +/** The power of a thousand a magnitude prints in, at three significant figures or `decimals` fixed decimals. */ +export function compactPower(a: number, decimals?: number): number { + let power = 0; + while (power < 4 && a >= compactFloor(power + 1, decimals)) power++; + return power; +} + /** The unit a set of values is compacted to: the largest power of a thousand its largest value reaches. */ -export function compactUnit(maxAbs: number, rule: CompactRule): { divisor: number; suffix: string } | undefined { +export function compactUnit(maxAbs: number, rule: CompactRule): { divisor: number; suffix: string; power: number } | undefined { if (!(maxAbs >= rule.threshold) || maxAbs < 1000) return undefined; const power = Math.min(4, Math.floor(Math.log10(maxAbs) / 3)); - return { divisor: 10 ** (3 * power), suffix: rule.suffixes[power - 1] }; + return { divisor: 10 ** (3 * power), suffix: rule.suffixes[power - 1], power }; } /** @@ -127,12 +145,19 @@ export function compactPrint(values: number[], rule: CompactRule, mode: 'exact' const decimals = mode === 'significant' ? rule.decimals : undefined; return { per: 'value', suffixes: rule.suffixes, threshold: Math.max(1000, rule.threshold), ...(below ? { below } : {}), ...(decimals !== undefined ? { decimals } : {}) }; } - const unit = compactUnit(maxAbs, rule); - if (!unit) return undefined; - const needed = compactDecimals(values, unit.divisor, mode); + const found = compactUnit(maxAbs, rule); + if (!found) return undefined; // A stated precision is for labels; a ruler's ticks keep only the digits that tell them apart. - if (rule.decimals !== undefined && mode === 'significant') return { per: 'scale', ...unit, decimals: rule.decimals, trim: false }; - return { per: 'scale', ...unit, decimals: needed, trim: mode === 'significant' }; + const stated = rule.decimals !== undefined && mode === 'significant'; + const decimalsIn = (divisor: number) => stated ? rule.decimals! : compactDecimals(values, divisor, mode); + let { power } = found; + let decimals = decimalsIn(found.divisor); + // 999,600 rounds to 1000k; the set prints in M. + if (power < 4 && Number((maxAbs / found.divisor).toFixed(decimals)) >= 1000) { + power += 1; + decimals = decimalsIn(10 ** (3 * power)); + } + return { per: 'scale', divisor: 10 ** (3 * power), suffix: rule.suffixes[power - 1], decimals, trim: !stated && mode === 'significant' }; } /** A value as it prints, compacted. */ @@ -144,7 +169,7 @@ export function formatCompact(value: number, print: CompactPrint, format: (patte const a = Math.abs(value); const sign = print.signed ? '+' : ''; if (a < print.threshold) return format(print.below ?? `${sign},.3~r`)(value); - const power = Math.min(4, Math.floor(Math.log10(a) / 3)); + const power = Math.max(1, compactPower(a, print.decimals)); return format(print.decimals !== undefined ? `${sign},.${print.decimals}f` : `${sign}.3~r`)(value / 10 ** (3 * power)) + print.suffixes[power - 1]; } @@ -158,7 +183,7 @@ export function compactExpr(value: string, print: CompactPrint): string { let expr = `format(${value}, ${q(print.below ?? `${sign},.3~r`)})`; for (let power = 1; power <= 4; power++) { const at = 10 ** (3 * power); - const floor = Math.max(at, print.threshold); + const floor = Math.max(compactFloor(power, print.decimals), print.threshold); const pattern = print.decimals !== undefined ? `${sign},.${print.decimals}f` : `${sign}.3~r`; expr = `(abs(${value}) >= ${floor} ? format(${value} / ${at}, ${q(pattern)}) + ${q(print.suffixes[power - 1])} : ${expr})`; } diff --git a/packages/flint-js/src/core/plan.ts b/packages/flint-js/src/core/plan.ts index d4c4cc3f..ebd04d77 100644 --- a/packages/flint-js/src/core/plan.ts +++ b/packages/flint-js/src/core/plan.ts @@ -32,9 +32,10 @@ import { plotHeightAfter } from './title-fit'; import { planAxisLabels, resolveLabelOverflow, type AxisLabelPlan } from './axis-labels'; import { sequenceKindOf } from './label-sequence'; import { LAYOUT_COSTS } from './layout-costs'; -import { CANVAS_FIT_LIMITS, LEGIBILITY_MARGIN, describeTreatment, plotFitScale, judgeCanvas, readingCost, treatmentCost, type CanvasFitEstimate, type CanvasFitResult, type CanvasParts } from './canvas-fit'; +import { CANVAS_FIT_LIMITS, DRAWING_PADDING, LEGIBILITY_MARGIN, describeTreatment, plotFitScale, judgeCanvas, readingCost, treatmentCost, type CanvasFitEstimate, type CanvasFitResult, type CanvasParts } from './canvas-fit'; import { measureReserve, NO_RESERVE, type FurnitureReserve, type FurnitureSpacing } from './furniture-reserve'; import { facetViews, gapOf, shortenViews, viewsExtent, type ViewNode } from './views'; +import { denseLineWidth, linesPerPanel, panelCount } from './line-density'; /** The layout options a backend lays out with when neither the caller, the theme, nor the template sets them. */ export interface BackendLayoutProfile { @@ -232,14 +233,6 @@ const OVERLAP_SAMPLE = 2000; /** Vega-Lite's own dot area, which a chart without a house's size draws. */ const VEGA_DOT_SIZE = 30; -/** The panels a faceted chart draws, and so the panels its rows are shared among. */ -function panelCount(rows: any[], channelSemantics: Record): number { - let panels = 1; - for (const field of [channelSemantics.column?.field, channelSemantics.row?.field]) { - if (field) panels *= Math.max(1, new Set(rows.map((row) => row?.[field]).filter((value) => value != null)).size); - } - return panels; -} /** A field's values as numbers along a continuous axis: dates as epoch ms, a log axis by its logarithm. */ function axisPositions(rows: any[], field: string, temporal: boolean, log: boolean): (number | undefined)[] { @@ -352,10 +345,6 @@ function planCrowding( return { share: Math.round(touch.share * 100) / 100, points: touch.points, size }; } -/** The stroke below which a line stops reading as a line on screen, in px. */ -const MIN_DENSE_STROKE = 0.75; -/** The share of a panel's height a chart's lines may ink between them. */ -const LINE_INK_SHARE = 0.15; /** Vega-Lite's own line width, which an unthemed chart draws. */ const DEFAULT_STROKE = 2; @@ -371,15 +360,9 @@ function planLineWidth( ): number | undefined { if (!structure.marks.includes('line') || rows.length === 0 || plot.height <= 0) return undefined; const base = design?.marks.strokeWidth ?? DEFAULT_STROKE; - const seriesFields = (['color', 'detail', 'strokeDash'] as const) - .map((channel) => channelSemantics[channel]?.field) - .filter((field): field is string => !!field); - if (seriesFields.length === 0) return undefined; - const facetFields = [channelSemantics.column?.field, channelSemantics.row?.field].filter((field): field is string => !!field); - const keys = new Set(rows.map((row) => [...facetFields, ...seriesFields].map((field) => String(row?.[field])).join('\u0000'))); - const perPanel = keys.size / panelCount(rows, channelSemantics); - const width = Math.max(MIN_DENSE_STROKE, Math.min(base, Math.round(((plot.height * LINE_INK_SHARE) / perPanel) * 100) / 100)); - if (width >= base) return undefined; + const perPanel = linesPerPanel(rows, channelSemantics); + const width = denseLineWidth(base, perPanel, plot.height); + if (width === undefined) return undefined; report.push({ stage: 'ground', path: 'marks.strokeWeight', @@ -399,6 +382,25 @@ export const MIN_OUTLINE_WIDTH = 0.6; export const MIN_HALO_DOT = 28; /** A ring for a dot of `size` px²: `share` of the radius, at least `floor`, never more than the house's width. */ + +/** One row per bar, its measure summed over the segments a bar split by `detail` draws. */ +function barTotals(structure: ChartStructure, channelSemantics: Record, rows: any[]): any[] { + const axis = stackedAxis(structure); + const measure = axis ? structure[axis]?.fields[0] : undefined; + const detail = channelSemantics.detail?.field; + if (!measure || !detail) return rows; + const keys = [...new Set(Object.values(channelSemantics).map((c) => c?.field) + .filter((field): field is string => typeof field === 'string' && field !== measure && field !== detail))]; + const totals = new Map(); + for (const row of rows) { + const key = JSON.stringify(keys.map((k) => row?.[k])); + const total = totals.get(key) ?? totals.set(key, { ...Object.fromEntries(keys.map((k) => [k, row?.[k]])), [measure]: 0 }).get(key); + const v = Number(row?.[measure]); + if (Number.isFinite(v)) total[measure] += v; + } + return [...totals.values()]; +} + export function ringWidth(size: number, share: number, houseWidth: number, floor = 0): number { const radius = Math.sqrt(size / Math.PI); return Math.min(houseWidth, Math.max(floor, Number((radius * share).toFixed(2)))); @@ -652,8 +654,8 @@ function pinAxisLabels(planned: AxisLabelPlan, pin: { fontSize?: number; angle?: /** Semantic types whose values are codes: read whole or not at all. */ const IDENTIFIER_TYPES = new Set(['ID', 'ZipCode']); -/** The ways x names may take, whether they run as a sequence, and the theme's thresholds. */ -function xLabelOverflow(theme: ThemeSpec | undefined, chartProperties: Record | undefined, channelSemantics: Record) { +/** The ways x names may take, whether they run as a sequence, and the theme's thresholds; every backend's band labels are planned with these. */ +export function xLabelOverflow(theme: ThemeSpec | undefined, chartProperties: Record | undefined, channelSemantics: Record) { const semanticType = channelSemantics.x?.semanticAnnotation?.semanticType; const sequence = sequenceKindOf(semanticType); // An identifier cut short names nothing: codes are never truncated, whatever the theme allows. @@ -743,7 +745,192 @@ export function planLayout(analysis: PlanAnalysis, context: PlanContext): Layout const held = context.pins?.treatment; if (held) return placeTitle(planLayoutOnce(analysis, withTreatment(context, held, boxOf(context))), analysis, context); const plan = planLayoutOnce(analysis, context); - return placeTitle(fitToCanvas(plan, analysis, context), analysis, context); + return placeTitle(containInCanvas(fitToCanvas(plan, analysis, context), analysis, context), analysis, context); +} + +/** How far past its canvas, in px, a drawing may run and still count as within it. */ +const CONTAIN_TOLERANCE = 0.5; +/** Under `titleWrap`, the least share of the canvas a title spans, however narrow the drawing. */ +const TITLE_WRAP_FLOOR = 0.6; +/** Under `titleWrap`, the least width in px a title spans, however narrow the drawing. */ +const TITLE_WRAP_MIN_WIDTH = 320; +/** Under `titleWrap`, how far a title may run past the drawing before it wraps, as a ratio of the drawing. */ +const TITLE_WRAP_OVERHANG = 1.15; +/** The px a contained drawing keeps clear of its canvas's edge, for what the estimate misses and the renderer's rounding. */ +const CONTAIN_MARGIN = 4; +/** How many times, at most, a chart is laid out again to bring its drawing within the canvas. */ +const CONTAIN_ROUNDS = 6; +/** The least room a chart is laid out for, each way, as a share of its canvas. */ +const CONTAIN_FLOOR = 0.5; +/** How much less a round must have its drawing shrunk than the best before it, to replace it. */ +const CONTAIN_GAIN = 0.01; +/** The least share of each side of its plot a chart gives up to stay within its canvas. */ +const CONTAIN_PLOT_FLOOR = 0.5; + +/** + * The edge the keys are held at, where they all stand at one and setting them there again changes + * nothing: a smaller plot would otherwise move a row of keys too wide for it beside the plot, and a + * drawing laid out smaller to fit its canvas would come out wider. + */ +function keysHeld(plan: LayoutPlan): CanvasTreatment['keys'] { + const layout = plan.legend.layout; + const inputs = plan.legend.keyInputs ?? []; + const laid = (layout?.keys ?? []).map((key, index) => (key && inputs[index] && !inputs[index]!.fixed ? key.orient : undefined)).filter(Boolean); + const edges = new Set(laid); + if (!layout || edges.size !== 1) return undefined; + const edge = [...edges][0]; + if (edge === 'right') return 'side'; + // Keys held above or below stand in a row there: only where they already do. + const row = laid.length === 1 || layout.edges.some((at) => at.orient === edge && at.direction === 'horizontal'); + return (edge === 'top' || edge === 'bottom') && row ? edge : undefined; +} + +type Size = { width: number; height: number }; +const SIDES = ['width', 'height'] as const; + +/** + * Holds the drawing within the canvas the host states. A canvas-fit pass rebalances what stands + * around the plot, but leaves a chart that still reads well drawn somewhat larger than its box, for + * the host to scale the whole drawing down. Where the host states a canvas, the chart is laid out + * again for a smaller room — the edits the pass chose kept, its keys at the edge they stood at — so + * the plot gives up the room and the keys, labels and title stand inside the canvas. The room is + * searched for each way the drawing ran past: smaller by what it ran past, then halfway between the + * largest that fitted and the smallest that did not, a few rounds. The plot never gives up more than + * {@link CONTAIN_PLOT_FLOOR} of a side, no value is cut and no label turned for the room: a chart + * whose keys or labels take nearly all its canvas is brought nearer, not within, and the host scales + * what is left. + */ +function containInCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanContext): LayoutPlan { + const box = context.size.canvasSize; + const holding = Boolean(context.pins?.plot || context.pins?.title || context.pins?.reserve); + if (!box || context.options?.canvasFit === 'off' || holding || plan.composite) return plan; + // A drawing whose furniture the plan cannot measure is left as the host scales it. + if (canvasParts(plan, analysis.channelSemantics, context, box, true).reserve.unmeasured?.length) return plan; + // The padding the backend draws: a house's own, else the renderer's default. A y label on the + // plot's top edge stands half above it, and what is above the plot stands above that. + // Series-end names stand past the plot only at the ends of lines run across it: down the page + // they head the runs, and on areas they stand inside the bands. + const drawn = (planned: LayoutPlan) => { + const parts = canvasParts(planned, analysis.channelSemantics, context, box, true); + const across = !planned.design.bound.measureChannels.includes('x') || planned.design.bound.measureChannels.includes('y'); + const namesPast = across && planned.structure.marks.some((mark) => mark === 'line' || mark === 'trail'); + const { seriesEnd, ...rest } = parts.reserve.parts; + const drawing = judgeCanvas({ + ...parts, + ...(seriesEnd && !namesPast ? { reserve: { ...parts.reserve, width: parts.reserve.width - seriesEnd, parts: rest } } : {}), + padding: context.theme ? planned.design.layout?.padding : undefined, + }).drawing; + const ruler = planned.rulers.y; + const label = planned.design.axes.y?.label; + const topLabel = ruler && label && label.show !== false && !label.flush && ruler.values.at(-1) === ruler.domain[1]; + return topLabel ? { width: drawing.width, height: drawing.height + Math.ceil((label.fontSize ?? 10) / 2) } : drawing; + }; + const before = drawn(plan); + const runsPast = (drawing: Size, side: 'width' | 'height', within: number) => drawing[side] - box[side] > within + CONTAIN_TOLERANCE; + if (!SIDES.some((side) => runsPast(before, side, 0))) return plan; + // What the host shrinks a drawing by to show it within the canvas — less a margin, for what the + // estimate misses and the renderer's rounding. + const shrink = (drawing: Size) => Math.min(1, ...SIDES.map((side) => (box[side] - CONTAIN_MARGIN) / (drawing[side] || 1))); + const within = (drawing: Size) => shrink(drawing) >= 1; + const fitted: CanvasTreatment = { ...plan.canvasFit?.treatment }; + const held = fitted.keys ? undefined : keysHeld(plan); + // A round keeps the plot past its floor, every value the chart showed, and its labels as they + // stood: a smaller room must not cut more values from a banded axis or the keys, nor turn labels + // the chart kept flat — the host scaling the drawing reads better than names set on end. + const omitted = (planned: LayoutPlan) => (planned.layout.truncations ?? []).reduce((sum, cut) => sum + cut.omittedCount, 0); + const turned = (planned: LayoutPlan) => (['x', 'y'] as const).map((channel) => Math.abs(planned.axisLabels[channel]?.angle ?? 0)); + const keeps = (planned: LayoutPlan) => SIDES.every((side) => planned.plot[side] >= plan.plot[side] * CONTAIN_PLOT_FLOOR - 0.5) + && omitted(planned) <= omitted(plan) + && turned(planned).every((angle, index) => angle <= turned(plan)[index]!); + type Round = { plan: LayoutPlan; drawing: Size; treatment: CanvasTreatment }; + // A drawing the host shrinks less is better; as little, the larger — more of the canvas used. + // An estimate a few px either way is no gain: a round must be shrunk a hundredth less to count. + const better = (a: Round, b: Round) => shrink(a.drawing) > shrink(b.drawing) + CONTAIN_GAIN + || (within(a.drawing) && within(b.drawing) && a.drawing.width * a.drawing.height > b.drawing.width * b.drawing.height); + const layOut = (room: Size): Round => { + // A plot the pass laid out in the room the box left gives up as much. + const space = fitted.plotSpace; + const plotSpace = space && { + ...(space.width !== undefined ? { width: Math.max(1, Math.floor(space.width - (box.width - room.width))) } : {}), + ...(space.height !== undefined ? { height: Math.max(1, Math.floor(space.height - (box.height - room.height))) } : {}), + }; + const treatment: CanvasTreatment = { ...fitted, ...(plotSpace ? { plotSpace } : {}), contain: { ...room, ...(held ? { keys: held } : {}) } }; + const planned = planLayoutOnce(analysis, withTreatment(context, treatment, box)); + return { plan: planned, drawing: drawn(planned), treatment }; + }; + const original: Round = { plan, drawing: before, treatment: fitted }; + // The best round a search of the room, the sides given, finds. + const search = (sides: readonly ('width' | 'height')[]): Round => { + let best = original; + // The room searched each way: the largest known to fit, the smallest known not to. + const fits: Size = { width: box.width * CONTAIN_FLOOR, height: box.height * CONTAIN_FLOOR }; + const fails: Size = { ...box }; + const fitOnce = { width: false, height: false }; + const searched = { width: false, height: false }; + for (const side of sides) searched[side] = runsPast(before, side, -CONTAIN_MARGIN); + let room: Size = { ...box }; + let last = best; + for (let round = 0; round < CONTAIN_ROUNDS; round++) { + const next: Size = { ...room }; + for (const side of SIDES) { + if (!searched[side]) continue; + const over = last.drawing[side] - (box[side] - CONTAIN_MARGIN); + // Smaller by what it ran past, not past the smallest known to fit; larger, halfway back. + next[side] = Math.floor(over > CONTAIN_TOLERANCE ? Math.max(fits[side], room[side] - over) : (fits[side] + fails[side]) / 2); + } + if (SIDES.every((side) => Math.abs(next[side] - room[side]) < 1) && round) break; + room = next; + last = layOut(room); + // A room that costs what the chart keeps is too small: the search goes back up. + const kept = keeps(last.plan); + for (const side of SIDES) { + // A side that ran within its canvas may run past it laid out for less room the other way. + if (!searched[side] && sides.includes(side) && runsPast(last.drawing, side, -CONTAIN_MARGIN)) searched[side] = true; + if (!searched[side]) continue; + if (runsPast(last.drawing, side, -CONTAIN_MARGIN)) fails[side] = Math.min(fails[side], room[side]); + else { + fits[side] = Math.max(fits[side], room[side]); + if (kept) fitOnce[side] = true; + } + } + if (kept && better(last, best)) best = last; + // Bounds that meet leave nothing more to search. + if (SIDES.every((side) => !searched[side] || fails[side] - fits[side] < 2)) break; + } + // Each side fitted in some round, but not both in one: the room each fitted in, together. + const closing = { width: searched.width ? fits.width : room.width, height: searched.height ? fits.height : room.height }; + if (!within(best.drawing) && SIDES.every((side) => !searched[side] || fitOnce[side]) && SIDES.some((side) => closing[side] !== room[side])) { + const round = layOut(closing); + if (keeps(round.plan) && better(round, best)) best = round; + } + return best; + }; + let best = search(SIDES); + // Room given up one way may cost what the chart keeps where the other way it would not: a + // drawing that ran past both ways, and that the search left past, is searched for each way alone. + if (!within(best.drawing) && SIDES.every((side) => runsPast(before, side, -CONTAIN_MARGIN))) { + for (const side of SIDES) { + const alone = search([side]); + if (better(alone, best)) best = alone; + } + } + // A drawing brought nearer its canvas, not within, is kept only as much nearer as a gentle edit + // must bring it, or half the way, where it ran past by less. + const nearer = shrink(best.drawing) - shrink(before); + if (best.plan === plan || (!within(best.drawing) && nearer < Math.min(SOFT_FIT_GAIN, (1 - shrink(before)) / 2))) return plan; + const judged = judgeCanvas(canvasParts(best.plan, analysis.channelSemantics, context, box)); + const result: CanvasFitResult = { + ...(plan.canvasFit ?? { strategy: context.options?.canvasFit ?? 'auto', before: judgeCanvas(canvasParts(plan, analysis.channelSemantics, context, box)), tried: [] }), + treatment: best.treatment, + after: judged, + }; + const still = SIDES.some((side) => runsPast(best.drawing, side, 0)); + const report: ThemeReport = { + stage: 'realize', path: 'layout.canvasFit', code: 'canvas-contain', + message: `the drawing ran past its ${Math.round(box.width)} × ${Math.round(box.height)} canvas (${Math.round(before.width)} × ${Math.round(before.height)}) — laid out for ${Math.round(best.treatment.contain!.width)} × ${Math.round(best.treatment.contain!.height)}, so the plot gives up the room${still ? `; that brings it nearer, not within (${Math.round(best.drawing.width)} × ${Math.round(best.drawing.height)}), for the host to scale` : ''}`, + }; + const fitReport = plan.report.filter((entry) => entry.code === 'canvas-fit'); + return { ...best.plan, canvasFit: result, report: [...best.plan.report, ...fitReport, report] }; } /** @@ -785,13 +972,20 @@ function boxOf(context: PlanContext): { width: number; height: number } { /** The context a treatment lays the chart out under; a smaller plot keeps the box it is fitted to. */ function withTreatment(context: PlanContext, treatment: CanvasTreatment, box: { width: number; height: number }): PlanContext { - const options = { ...context.options, canvasTreatment: treatment }; + const room = treatment.contain; + // Keys a contained layout holds at their edge are laid out as a fit that sets them there. + const laid = room?.keys && !treatment.keys ? { ...treatment, keys: room.keys } : treatment; + const options = { ...context.options, canvasTreatment: laid }; const scale = treatment.plotScale ?? 1; - if (scale === 1) return { ...context, options }; + if (scale === 1 && !room) return { ...context, options }; const base = context.size.baseSize; + const canvas = room ? { width: room.width, height: room.height } : box; return { ...context, options, size: { - baseSize: { width: Math.round(base.width * scale), height: Math.round(base.height * scale) }, - canvasSize: box, + baseSize: { + width: Math.min(canvas.width, Math.round(base.width * scale)), + height: Math.min(canvas.height, Math.round(base.height * scale)), + }, + canvasSize: canvas, } }; } @@ -806,12 +1000,29 @@ const CHART_SHAPE_TOLERANCE = 1.15; /** The headline and deck shares a canvas-fit pass sets them at: one size down, then a second where one is not enough. */ const TITLE_SCALE = 0.85; const TITLE_SCALE_DEEP = 0.72; + +/** The smallest the axis labels are set: the house's least size, and never under three-quarters of its own. */ +function axisLabelFloor(size: number, minSize: number | undefined): number { + return Math.max(minSize ?? 8, size * 0.75); +} + +/** The axis labels at a share of the house's size, to the half px, never past the floor. */ +function scaledAxisLabelSize(size: number, scale: number, floor: number): number { + return Math.max(floor, Math.round(size * scale * 2) / 2); +} + +/** The most sizes down a canvas fit tries for axis labels, one px each. */ +const LABEL_STEPS = 3; /** * How short a canvas-fit pass keeps long key names: 120 px a column, wrapped onto lines before they * are cut. Names down a y axis keep their readable gutter: a cut row name names nothing. */ const SHORT_NAMES = { keyWidth: 120 }; +/** How much larger a map must be shown for its keys to move to the side it leaves empty: with no theme, and where a theme set their edge. */ +const MAP_KEYS_GAIN = 1.1; +const MAP_KEYS_THEMED_GAIN = 1.2; + /** * The canvas-fit pass, for charts that will not read well in their box. Three goals, judged on the * plan before anything is drawn ({@link judgeCanvas}): the drawing fits its box, legibly; the parts @@ -822,7 +1033,8 @@ const SHORT_NAMES = { keyWidth: 120 }; * A chart that meets them as planned is returned as it is. One that does not is mended with the * least edit to it a reader would notice ({@link culpritEdits}): each problem is put down to the * parts that cause it, and only their edits are tried — keys in a row on their edge, names wrapped, - * the title a size down, keys to another edge, the title two sizes down — one at a time before any + * the title a size down, keys to another edge, the title two sizes down, names wrapped down the y + * axis set a size or two smaller — one at a time before any * two together. Of those that clear, the one that costs least wins: its edit, priced on the * planner's one scale ({@link LAYOUT_COSTS}), and what its result still costs in reading, which * tells edits alike apart. Where the box cannot hold the chart legibly, the plot comes down, @@ -843,7 +1055,9 @@ function fitToCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanCont // A chart that reads well but is drawn a little larger than its box — the host shrinks it, not // past legibility — is mended only by the gentlest edits, and only where they bring it inside. const overflowing = !before.flags.length && before.scale < SOFT_FIT_SCALE; - if (!before.flags.length && !overflowing) return { ...plan, canvasFit: result }; + // A map keeps its shape and grows until one side meets the room: its keys may stand on the side it leaves empty. + const mapKeys = analysis.template.fillsCanvas === true && !plan.layout.facet && Boolean(plan.legend.layout?.keys.some(Boolean)); + if (!before.flags.length && !overflowing && !mapKeys) return { ...plan, canvasFit: result }; const keyed = Boolean(plan.legend.layout?.keys.some(Boolean)); const named = keyed; @@ -868,8 +1082,9 @@ function fitToCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanCont const strayed = Boolean(treatment.oneKey) && others(planned) !== others(plan); const cuts = (cutsKeyNames(planned) && !cutsKeyNames(plan)) || (rowOverruns(planned) && !rowOverruns(plan)) || moved || strayed; // Nor change the chart's own shape: the fit rebalances what is around the chart, not the chart. + // Labels set smaller shorten the rows they wrapped in, and that is the edit's whole point. const shapeOf = (e: CanvasFitEstimate) => e.designed.width / (e.designed.height || 1); - const reshaped = Math.abs(Math.log(shapeOf(estimate) / shapeOf(before))) > Math.log(CHART_SHAPE_TOLERANCE); + const reshaped = !treatment.labelScale && Math.abs(Math.log(shapeOf(estimate) / shapeOf(before))) > Math.log(CHART_SHAPE_TOLERANCE); // Nor, where the text is already too small, make it smaller still: a flag cleared for smaller text is no mend. const smaller = !legible && estimate.scale < before.scale - 0.005; if (!cuts && !reshaped && !smaller && ((!legible && !treatment.plotScale) || readable)) tries.push(tried); @@ -881,6 +1096,29 @@ function fitToCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanCont // Clear: nothing around the chart squeezes it, and the plot's own shape is no worse for it. const clears = (tried: Tried) => !tried.estimate.flags.length && tried.estimate.plotExcess <= before.plotExcess + 0.01 && tries.includes(tried); + /** + * A map's keys on the side its shape leaves empty: a map grows until one side meets the room, so + * keys beside a wide map take width it needs while height goes spare, and keys above a tall one + * the reverse. Each other edge is tried, and the one that shows the map largest — its plot at the + * scale the drawing is shown — kept where that is clearly larger: a tenth, or a fifth where a + * theme set the keys' edge as its house style. Keys the author placed stay. + */ + function roomierMapKeys(): Tried | undefined { + const shown = (planned: LayoutPlan, estimate: CanvasFitEstimate) => planned.plot.width * planned.plot.height * Math.min(1, estimate.scale) ** 2; + const now = shown(plan, before); + const at = edge === 'left' || edge === 'right' ? 'side' : edge; + let pick: Tried | undefined; + let largest = now * (context.theme ? MAP_KEYS_THEMED_GAIN : MAP_KEYS_GAIN); + for (const to of ['top', 'bottom', 'side'] as const) { + if (to === at) continue; + const tried = attempt({ keys: to }); + if (!tries.includes(tried) || tried.estimate.flags.length || cutsKeyNames(tried.plan)) continue; + const size = shown(tried.plan, tried.estimate); + if (size > largest) { largest = size; pick = tried; } + } + return pick; + } + /** * The plot laid out again in the room the box leaves it, at the scale the drawing is shown at, * once what is around the chart is settled: a continuous side grows into that room (never @@ -946,6 +1184,20 @@ function fitToCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanCont return noSmaller && nothingNew && better ? tried : undefined; }; + if (!before.flags.length) { + const roomier = mapKeys ? roomierMapKeys() : undefined; + if (roomier) { + result.treatment = roomier.treatment; + result.after = roomier.estimate; + const report: ThemeReport = { + stage: 'realize', path: 'layout.canvasFit', code: 'canvas-fit', + message: `the map is drawn larger with its keys on the side it leaves empty in its ${Math.round(box.width)} × ${Math.round(box.height)} canvas — laid out with ${describeTreatment(roomier.treatment)}`, + }; + return { ...roomier.plan, canvasFit: result, report: [...roomier.plan.report, report] }; + } + if (!overflowing) return { ...plan, canvasFit: result }; + } + let chosen: Tried | undefined; // The edits that answer what is wrong, nearest to the chart as planned first: each problem is // put down to the parts that cause it, and only their edits are tried — one at a time before any @@ -964,8 +1216,15 @@ function fitToCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanCont keys: (layout?.footprint ?? []).filter((edge) => edge.orient === 'top' || edge.orient === 'bottom') .reduce((sum, edge) => sum + (layout?.offsets?.[edge.orient as 'top' | 'bottom'] ?? 0), 0), }; + // Names down y wrapped onto two lines take rows tall enough for both: smaller, the rows come down with them. + const houseLabels = plan.axisLabelFontSize; + const rowsWrapped = rowNamed && houseLabels !== undefined + && Boolean(plan.layout.yLabel.labelLines?.some((lines) => lines.length > 1)); + const labelSizes = rowsWrapped + ? { size: houseLabels!, floor: axisLabelFloor(houseLabels!, (context.theme as ThemeSpec | undefined)?.type?.minSize) } + : undefined; const edits = culpritEdits(before, canvasParts(plan, analysis.channelSemantics, context, box), box, { - keyed, titled, named, edge, keys: keyList, rowNamed, headerAir, + keyed, titled, named, edge, keys: keyList, rowNamed, headerAir, labelSizes, }); // Of the edits that clear, the one that costs least: its edit, and what its result still costs // in reading — weighed so the result tells apart edits alike, and never makes a larger edit win @@ -1025,13 +1284,36 @@ function fitToCanvas(plan: LayoutPlan, analysis: PlanAnalysis, context: PlanCont result.after = chosen.estimate; const report: ThemeReport = { stage: 'realize', path: 'layout.canvasFit', code: 'canvas-fit', - message: `the chart did not read well in its ${Math.round(box.width)} × ${Math.round(box.height)} canvas (${before.flags.join('; ')}) — laid out with ${describeTreatment(chosen.treatment)}${chosen.estimate.flags.length ? `, which helps but does not clear it (${chosen.estimate.flags.join('; ')})` : ''}`, + message: `the chart did not read well in its ${Math.round(box.width)} × ${Math.round(box.height)} canvas (${before.flags.length ? before.flags.join('; ') : `drawn larger than it, to be shown at ${Math.round(before.scale * 100)}%`}) — laid out with ${describeTreatment(chosen.treatment)}${chosen.estimate.flags.length ? `, which helps but does not clear it (${chosen.estimate.flags.join('; ')})` : ''}`, }; return { ...chosen.plan, canvasFit: result, report: [...chosen.plan.report, report] }; } -/** What a plan draws, for the canvas-fit judge: its panels, the furniture measured both ways, its chrome. */ -function canvasParts(plan: LayoutPlan, channelSemantics: Record, context: PlanContext, box: { width: number; height: number }): CanvasParts { +/** + * How wide the drawing runs with its rows of keys above or below the plot, from its left edge past + * the y labels: a row stands at its anchor along the plot, so one wider than the plot at its start + * runs past the plot's right edge rather than back over the labels. + */ +function keyRowSpan(plan: LayoutPlan, reserve: FurnitureReserve): number { + const layout = plan.legend.layout; + const rows = (layout?.footprint ?? []).filter((edge) => edge.orient === 'top' || edge.orient === 'bottom'); + if (!rows.length) return 0; + const before = (reserve.parts.yLabels ?? 0) + (reserve.parts.yTitle ?? 0); + const columns = plan.layout.facet?.columns ?? 1; + const plot = plan.plot.width * columns + (plan.layout.effectiveFacetGap ?? 10) * Math.max(0, columns - 1); + return Math.max(...rows.map((row) => { + const anchor = layout?.edges.find((edge) => edge.orient === row.orient)?.anchor ?? 'start'; + const start = anchor === 'start' ? 0 : anchor === 'end' ? plot - row.width : (plot - row.width) / 2; + return Math.max(plot, start + row.width) - Math.min(-before, start); + })); +} + +/** + * What a plan draws, for the canvas-fit judge: its panels, the furniture measured both ways, its + * chrome. Measured `whole` — to hold the drawing within a stated canvas — it counts a deck printed + * without a headline, and a row of keys from where it stands along the plot. + */ +function canvasParts(plan: LayoutPlan, channelSemantics: Record, context: PlanContext, box: { width: number; height: number }, whole = false): CanvasParts { const reserve = measureReserve({ along: { width: true, height: true }, structure: plan.structure, @@ -1047,6 +1329,7 @@ function canvasParts(plan: LayoutPlan, channelSemantics: Record 0); const facet = plan.layout.facet; @@ -1063,13 +1348,13 @@ function canvasParts(plan: LayoutPlan, channelSemantics: Record edge.orient === 'top' || edge.orient === 'bottom').map((edge) => edge.width)), + keyRowWidth: whole ? keyRowSpan(plan, reserve) : Math.max(0, ...(plan.legend.layout?.footprint ?? []).filter((edge) => edge.orient === 'top' || edge.orient === 'bottom').map((edge) => edge.width)), padding: plan.design.layout?.padding, box, base: context.size.baseSize, @@ -1286,7 +1571,11 @@ function planLayoutOnce(analysis: PlanAnalysis, context: PlanContext): LayoutPla message: 'widening the bands into the canvas\'s spare room was not enough for the labels — the bands are kept, and the labels withheld' }); } const reserveReason = (chain: PlanStage[], decision: string): PlanReason => ({ part: 'reserve', decision, chain }); - const along = { width: first.layout.xStepFitted === true, height: first.layout.yStepFitted === true }; + // A plot that fills the canvas (a map) has the room round it measured on both sides, as a fitted step does. + const fills = prepared.analysis.template.fillsCanvas === true && !first.layout.facet && !first.composite; + const along = fills + ? { width: true, height: true } + : { width: first.layout.xStepFitted === true, height: first.layout.yStepFitted === true }; if (pinned) { return { ...first, reserve: pinned, reasons: [...first.reasons, reserveReason([{ rule: 'pinned', value: `${Math.round(pinned.width)} × ${Math.round(pinned.height)}`, note: 'the room kept for the furniture is held from the plan the chart was opened with' }], 'held')] }; } @@ -1295,6 +1584,8 @@ function planLayoutOnce(analysis: PlanAnalysis, context: PlanContext): LayoutPla } const reserve = measureReserve({ along, + // A plot that fills the canvas holds its shape: the foot's room is kept before it is sized, not taken from it after. + ...(fills && first.source ? { footer: first.source.room } : {}), structure: first.structure, design: first.design, themed: Boolean(theme), @@ -1312,12 +1603,16 @@ function planLayoutOnce(analysis: PlanAnalysis, context: PlanContext): LayoutPla spacing: profile.spacing, measure: profile.measureText ?? tableTextMeasurer, }); - const second = planAroundPlot(prepared, reserve); + // A plot that fills the canvas also leaves the drawing its padding on every side, as the drawing is padded. + const pad = fills ? (theme ? first.design.layout?.padding ?? 0 : DRAWING_PADDING) : 0; + const second = planAroundPlot(prepared, pad ? { ...reserve, width: reserve.width + 2 * pad, height: reserve.height + 2 * pad } : reserve); return { ...second, reserve, reasons: [...second.reasons, reserveReason([ - { rule: 'fitted step', value: along.width && along.height ? 'both axes' : along.width ? 'x' : 'y', note: 'a banded axis fitted its step to the room, so the room is measured' }, + fills + ? { rule: 'fills the canvas', value: 'both sides', note: 'the plot grows to the canvas less its furniture, so the furniture is measured' } + : { rule: 'fitted step', value: along.width && along.height ? 'both axes' : along.width ? 'x' : 'y', note: 'a banded axis fitted its step to the room, so the room is measured' }, { rule: 'measured', value: `${Math.round(reserve.width)} wide, ${Math.round(reserve.height)} tall`, read: Object.fromEntries(Object.entries(reserve.parts).map(([part, px]) => [part, Math.round(px)])), note: `the furniture beside and above or below the plot, as the text measures${reserve.unmeasured?.length ? `; not measured: ${reserve.unmeasured.join(', ')}` : ''}` }, { rule: 'laid out again', value: `${Math.round(second.plot.width)} × ${Math.round(second.plot.height)}`, note: 'the plot is planned once more into the canvas less that room, capped at 40% of it; one pass' }, ], `${Math.round(reserve.width)} × ${Math.round(reserve.height)} kept`)], @@ -1405,6 +1700,15 @@ function rowNamesAboveTrial(first: LayoutPlan, prepared: PreparedPlan, pinned: F const note = say('row-names-beside', `the names stand beside their bars: above them, each band needs twice its room, which the canvas's stretch cannot give ${layout.yNominalCount} of them`); return { prepared: noted(prepared, note), first: { ...first, report: [...first.report, note] } }; } + // The bands hold within the stretch, but the title, keys and axis stand in the same box: names + // above are kept where the whole drawing fits it, or is shrunk no more than with the names beside. + const box = boxOf(prepared.context); + const scaleOf = (plan: LayoutPlan) => judgeCanvas(canvasParts(plan, prepared.analysis.channelSemantics, prepared.context, box)).scale; + const aboveScale = scaleOf(laid); + if (aboveScale < SOFT_FIT_SCALE && aboveScale < scaleOf(first) - 0.005) { + const note = say('row-names-beside', `the names stand beside their bars: above them, the chart would be drawn larger than its ${Math.round(box.width)} × ${Math.round(box.height)} canvas, to be shown at ${Math.round(aboveScale * 100)}%`); + return { prepared: noted(prepared, note), first: { ...first, report: [...first.report, note] } }; + } return { prepared: trial, first: laid }; } @@ -1491,6 +1795,9 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo ...prepared.options, bandStepFitCapacityX: Math.max(ceiling.width * 0.6, ceiling.width - reserve.width), bandStepFitCapacityY: Math.max(ceiling.height * 0.6, ceiling.height - reserve.height), + ...(prepared.options.sparseFill + ? { sparseFillBars: [...templateMarks(template)].some((mark) => mark === 'bar' || mark === 'rect' || mark === 'boxplot') } + : {}), // Small multiples shrink their tick labels no further than the theme lets type go. ...(theme && prepared.options.minLabelFontSize === undefined ? { minLabelFontSize: (theme as ThemeSpec).type?.minSize ?? 8 } @@ -1537,9 +1844,14 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo : profile.nestedBandPadding.inner; return step * (bands - inner + 2 * profile.nestedBandPadding.outer); }; - const axisLabelFontSize = theme + const houseLabelFontSize = theme ? resolveThemeFontSize(theme as ThemeSpec, theme.type?.axisLabel?.size, 10, layoutResult.subplotWidth || size.baseSize.width) : undefined; + const labelFloor = theme ? axisLabelFloor(houseLabelFontSize ?? 10, (theme as ThemeSpec).type?.minSize) : undefined; + // A canvas fit may set the labels on both axes a size or two down, never past the floor. + const axisLabelFontSize = houseLabelFontSize !== undefined && treatment?.labelScale + ? scaledAxisLabelSize(houseLabelFontSize, treatment.labelScale, labelFloor!) + : houseLabelFontSize; if (context.bandLabels) { planBandLabels( { layout: layoutResult, canvasSize: size.baseSize, channelSemantics, assembleOptions: effectiveOptions, table: values }, @@ -1547,7 +1859,7 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo fontSize: axisLabelFontSize, textCase: (theme as ThemeSpec | undefined)?.type?.axisLabel?.case, // A themed chart's names are measured in the face they are drawn in, as its value labels are. - ...(theme ? { minFontSize: Math.max((theme as ThemeSpec).type?.minSize ?? 8, (axisLabelFontSize ?? 10) * 0.75) } : {}), + ...(theme ? { minFontSize: labelFloor } : {}), ...(theme ? { measure: bandLabelMeasure(theme as ThemeSpec) } : {}), // How x names that do not stand flat may be set, weighed by cost: the chart's ways, else the theme's, else the rule. ...xLabelOverflow(theme as ThemeSpec | undefined, chartProperties, channelSemantics), @@ -1558,10 +1870,12 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo } const plotContext: PlotPlanContext = { + ...(reserve.width > 0 || reserve.height > 0 ? { reserve: { width: reserve.width, height: reserve.height } } : {}), layout: layoutResult, canvasSize: size.baseSize, assembleOptions: effectiveOptions, channelSemantics, + encodings, table: values, fullTable: convertedData, semanticTypes: context.semanticTypes, @@ -1626,6 +1940,13 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo }); const segmented = segmentedBands(structure, values, [channelSemantics.column?.field, channelSemantics.row?.field]); + // A bar split only by `detail` stacks its segments (the axis spans their sum) but reads, and is + // labelled, as one bar: its segments are there for selection and links. + const detailOnly = structure.marks.includes('bar') && Boolean(channelSemantics.detail?.field) + && !channelSemantics.color?.field && !channelSemantics.x2?.field && !channelSemantics.y2?.field; + const stackedSegments = segmented && !detailOnly; + // What it shows, and its labels print, is each bar's total: the design is grounded on those. + const barRows = detailOnly && segmented ? barTotals(structure, channelSemantics, values) : values; const title = printedTitle(context, structure); // Grounding runs whether or not a theme was named, with the neutral one when it was not: some // design questions are Flint's own, such as whether this chart can carry its values at this density. @@ -1644,12 +1965,12 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo ...(structure.y ? { y: { type: structure.y.type, field: structure.y.derived ? undefined : structure.y.fields[0] } } : {}), ...(structure.series?.field ? { color: { field: structure.series.field, type: structure.series.type } } : structure.series?.derived ? { color: { field: structure.series.derived, type: structure.series.type, derived: true } } : {}), - ...(segmented ? { stacked: true } : {}), + ...(stackedSegments ? { stacked: true } : {}), }, layout: layoutResult, - table: values, + table: barRows, canvasSize: size.baseSize, - stacked: structure.stacking === 'normalized' ? 'normalize' : segmented, + stacked: structure.stacking === 'normalized' ? 'normalize' : stackedSegments, partToWhole: structure.marks.includes('arc'), titled: Boolean(title), headline: headlineText(title), @@ -1674,6 +1995,12 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo }; layoutResult.titleFontSize = scaled(layoutResult.titleFontSize, TITLE_FLOOR.headline)!; } + if (treatment?.labelScale && axisLabelFontSize !== undefined) { + for (const channel of ['x', 'y'] as const) { + const axis = design.axes[channel]; + if (axis && (axis.label.fontSize ?? 0) > axisLabelFontSize) design.axes[channel] = { ...axis, label: { ...axis.label, fontSize: axisLabelFontSize } }; + } + } const axisLabels = planAxisLabels(layoutResult, declaration, axisLabelFontSize === undefined ? undefined : { fontSize: axisLabelFontSize, @@ -1743,9 +2070,15 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo if (fit) axisTitleFit[channel] = fit; } } + const wrapAsked = context.options?.titleWrap; const titleInputs = { structure, design, layout: layoutResult, axisLabels, axisTitles: titles, plot, rows: values, title: context.title, rowFacet: channelSemantics.row?.field, themed: Boolean(theme), + ...(wrapAsked ? { wrap: { + floor: (typeof wrapAsked === 'object' ? wrapAsked.floor : undefined) ?? TITLE_WRAP_FLOOR, + minWidth: (typeof wrapAsked === 'object' ? wrapAsked.minWidth : undefined) ?? TITLE_WRAP_MIN_WIDTH, + overhang: (typeof wrapAsked === 'object' ? wrapAsked.overhang : undefined) ?? TITLE_WRAP_OVERHANG, + } } : {}), }; // The header is planned before the title: its edge band and the line above push the title down, // and what sits beside the headline is taken from the width the title is fitted to. @@ -1758,13 +2091,13 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo let titlePlan = composite ? undefined : context.pins?.title ?? planTitle(titleInputs); const labelLengths = drawnLengths(plot, titlePlan, undefined); - let valueLabels = planValueLabels({ design, structure, segmented, channelSemantics, rows: values, lengths: labelLengths }); + let valueLabels = planValueLabels({ design, structure, segmented: stackedSegments, channelSemantics, rows: barRows, lengths: labelLengths }); // A house that would rather every label read alike prints them all past the bar's end once one // bar is too short for its own (L4). if (valueLabels && !('refused' in valueLabels) && design.dataLabels.fallback === 'allOutside' && (valueLabels.channel === 'x' || valueLabels.channel === 'y') - && someLabelsOverrun(valueLabels, design, values, labelLengths[valueLabels.channel])) { - valueLabels = planValueLabels({ design, structure, segmented, channelSemantics, rows: values, lengths: labelLengths, outside: true }); + && someLabelsOverrun(valueLabels, design, barRows, labelLengths[valueLabels.channel])) { + valueLabels = planValueLabels({ design, structure, segmented: stackedSegments, channelSemantics, rows: barRows, lengths: labelLengths, outside: true }); report.push({ stage: 'realize', path: 'dataLabels.fallback', code: 'value-labels-all-outside', message: 'some bars are too short to hold their own label, so every label is printed past its bar’s end, as the house asks' }); } @@ -1844,7 +2177,7 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo // Inside labels are checked one by one against the axis as it will be drawn. if (valueLabels && !('refused' in valueLabels) && valueLabels.inside && (valueLabels.channel === 'x' || valueLabels.channel === 'y')) { const along = valueLabels.channel; - valueLabels = fitInsideLabels(valueLabels, design, values, { length: drawnLengths(plot, titlePlan, valueLabels)[along], domain: rulers[along]?.domain }); + valueLabels = fitInsideLabels(valueLabels, design, barRows, { length: drawnLengths(plot, titlePlan, valueLabels)[along], domain: rulers[along]?.domain }); } const displayNames = chartDisplayNames(context.fieldDisplayNames, analysis.staticSeries ?? undefined); const channelTitles: Partial> = {}; @@ -1880,8 +2213,10 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo const sourcePlan = planSource({ design, source: context.source, block: chartBlock({ ...titleInputs, ...(extent ? { viewsWidth: extent.width } : {}) }) ?? size.baseSize.width, measure: tableTextMeasurer, + credit: template.credit?.(plotContext), }); - const headerRoom = (header ? header.edge + header.line : 0) + (sourcePlan?.room ?? 0); + if (sourcePlan && reserve.parts.footer) sourcePlan.reserved = true; + const headerRoom = (header ? header.edge + header.line : 0) + (sourcePlan && !sourcePlan.reserved ? sourcePlan.room : 0); const drawViews = (title: TitlePlan | undefined) => { const drawn = views && (ruled || title || headerRoom) && plotGives ? shortenViews(views, (height) => { @@ -2065,6 +2400,24 @@ function planAroundPlot(prepared: PreparedPlan, reserve: FurnitureReserve): Layo * as its value labels are. A face the width table does not know is measured as the fallback it * knows, with room for running up to a tenth wider. */ +/** + * The options a themed chart's band labels are planned with (`planBandLabels`): the house's size at + * this plot width, its floor, its case, its face, and the overflow path. Shared by every backend + * that draws a house, so a chart's names are wrapped, shrunk or turned the same way in each. + */ +export function themedBandLabelOptions( + theme: ThemeSpec, chartProperties: Record | undefined, channelSemantics: Record, plotWidth: number, +) { + const fontSize = resolveThemeFontSize(theme, theme.type?.axisLabel?.size, 10, plotWidth); + return { + fontSize, + textCase: theme.type?.axisLabel?.case, + minFontSize: axisLabelFloor(fontSize, theme.type?.minSize), + measure: bandLabelMeasure(theme), + ...xLabelOverflow(theme, chartProperties, channelSemantics), + }; +} + function bandLabelMeasure(theme: ThemeSpec): (fontSize: number) => (text: string) => number { const family = themeBodyFamily(theme) ?? 'sans-serif'; const weight = theme.type?.axisLabel?.weight !== undefined ? fontWeightOf(theme.type.axisLabel.weight) ?? 'normal' : 'normal'; @@ -2114,6 +2467,8 @@ function culpritEdits( rowNamed?: boolean; /** The gaps under the title and beside keys above or below the plot, which no part is to blame for. */ headerAir?: { title: number; keys: number }; + /** The axis labels' house size and floor, where names down y wrap onto two lines and so set the rows' height. */ + labelSizes?: { size: number; floor: number }; }, ): { single: CanvasTreatment[]; paired: CanvasTreatment[] } { const p = parts.reserve.parts; @@ -2151,6 +2506,11 @@ function culpritEdits( if (keysToBlame && stackedKeys.length > 1) for (const key of [...stackedKeys].sort((a, b) => b.height - a.height)) oneKey(key, 'side'); if (keysToBlame) add({ keys: 'side' }); if (titleToBlame) add({ titleScale: TITLE_SCALE_DEEP }); + // Rows of wrapped names: the labels a px down at a time, never past their floor, whole on their lines. + const labels = has.labelSizes; + for (let step = 1; labels && step <= LABEL_STEPS && labels.size - step >= labels.floor - 1e-9; step++) { + add({ labelScale: Math.round(((labels.size - step) / labels.size) * 1000) / 1000 }); + } } // The chart area itself too wide for its box, or its names taking the plot's room: the names down // the y axis wrap, so the chart takes the width the box leaves it. Its plot is not touched. @@ -2166,7 +2526,9 @@ function culpritEdits( const titleEdit = single.find((treatment) => treatment.titleScale); const oneKeyEdit = single.find((treatment) => treatment.oneKey); const rowEdit = single.find((treatment) => treatment.rowNames); + const labelEdit = single.find((treatment) => treatment.labelScale); if (keyEdit && titleEdit) paired.push({ ...keyEdit, ...titleEdit }); + if (labelEdit && titleEdit) paired.push({ ...labelEdit, ...titleEdit }); if (keyEdit?.keys === 'side' && has.named) paired.push({ keys: 'side', names: SHORT_NAMES }); if (nameEdit && titleEdit) paired.push({ ...nameEdit, ...titleEdit }); if (oneKeyEdit && titleEdit) paired.push({ ...oneKeyEdit, ...titleEdit }); diff --git a/packages/flint-js/src/core/resolve-semantics.ts b/packages/flint-js/src/core/resolve-semantics.ts index 537966b3..da34f334 100644 --- a/packages/flint-js/src/core/resolve-semantics.ts +++ b/packages/flint-js/src/core/resolve-semantics.ts @@ -40,7 +40,7 @@ import { isDateField, type EncodingTypeContext, } from './decisions'; -import { hasTemporalParsers, parseTemporalByType } from './temporal-parse'; +import { hasTemporalParsers, parseTemporalByType, readIsoTimestamp } from './temporal-parse'; import { resolveFieldSemantics, toTypeString, @@ -189,10 +189,22 @@ export function repairEncodingSorts( ): { encodings: Record; warnings: ChartWarning[] } { const warnings: ChartWarning[] = []; if (!encodings || typeof encodings !== 'object') return { encodings, warnings }; - const dataFields = new Set(data.flatMap(row => row && typeof row === 'object' ? Object.keys(row) : [])); + const dataFields = new Set(); + let fieldsCollected = false; const repair = (channel: string, entry: unknown): unknown => { if (!entry || typeof entry !== 'object' || Array.isArray(entry)) return entry; const encoding = entry as Record; + const sortByValue = encoding.sortBy; + if (!fieldsCollected && typeof sortByValue === 'string' && sortByValue.trim() + && sortByValue !== 'x' && sortByValue !== 'y' && sortByValue !== 'color') { + for (const row of data) { + if (row && typeof row === 'object') { + const fields = Object.keys(row); + for (let index = 0; index < fields.length; index++) dataFields.add(fields[index]); + } + } + fieldsCollected = true; + } const { sortBy, sortOrder, issues } = inspectEncodingSort(encoding, channel, encodings, dataFields, options); if (issues.length === 0) return entry; for (const issue of issues) { @@ -451,8 +463,10 @@ export function convertTemporalData( for (const temporalKey of temporalKeys) { const val = r[temporalKey]; const st = effectiveSemanticTypes[temporalKey]; + const calendar = (SEMANTIC_LEVEL[st] ?? -1) >= SEMANTIC_LEVEL.Date; // An untyped full date in a spelling only some engines parse is read here, once. - const parsed = parseTemporalByType(val, st) + const parsed = readIsoTimestamp(val, calendar) + ?? parseTemporalByType(val, st) ?? (!st && typeof val === 'string' && !ISO_PREFIX.test(val.trim()) ? parseTemporalByType(val, 'Date') : null); if (parsed !== null) { @@ -466,7 +480,11 @@ export function convertTemporalData( r[temporalKey] = String(val); } } else if (val instanceof Date) { - r[temporalKey] = val.toISOString(); + // A Date at local midnight under a calendar grain names that day, as temporalFieldValue reads it. + const localMidnight = !val.getHours() && !val.getMinutes() && !val.getSeconds() && !val.getMilliseconds(); + r[temporalKey] = calendar && localMidnight && Number.isFinite(val.getTime()) + ? `${val.getFullYear()}-${String(val.getMonth() + 1).padStart(2, '0')}-${String(val.getDate()).padStart(2, '0')}` + : val.toISOString(); } else { // For Year/Decade strings, normalise to 4-digit years so // Vega-Lite parses them unambiguously and doesn't auto-tick @@ -715,6 +733,11 @@ export function resolveChannelSemantics( const divInfo = resolveDivergingInfo(semanticType, annotation, nums); if (divInfo) { cs.colorScheme.domainMid = divInfo.midpoint; + // A pivot the field always has reads as a neutral zone; one its values cross is a break. + const neutral = typeof annotation.divergingNeutral === 'number' && annotation.divergingNeutral >= 0 + ? annotation.divergingNeutral + : annotation.divergingNeutral === undefined && divInfo.inherent ? 'auto' : undefined; + if (neutral !== undefined) cs.colorScheme.neutral = neutral; } // A declared polarity says which end is the bad one: warm (red) goes there. // Themes turn their own ramps to match the scheme named here. diff --git a/packages/flint-js/src/core/sample-format.ts b/packages/flint-js/src/core/sample-format.ts new file mode 100644 index 00000000..493ae5be --- /dev/null +++ b/packages/flint-js/src/core/sample-format.ts @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Formats precise enough for the values a key lists. A key that lists values Flint chose (a size + * key's 0.5, 1, 2.5) must print each as it is: a scale's tick format, or a field's format chosen + * for its ticks, would round 0.5 and 2.5 to "1" and "3". + */ +import { format as formatNumber } from 'd3-format'; +import type { FormatSpec } from './field-semantics'; + +/** d3-format's specifier grammar: [[fill]align][sign][symbol][0][width][,][.precision][~][type]. */ +const SPECIFIER = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; + +/** A value with the float noise of arithmetic removed: 0.025 * 100 is 2.5, not 2.5000000000000004. */ +const clean = (value: number): number => Number(Math.abs(value).toPrecision(12)); + +/** The decimal places a value is written with: 2.5 → 1, 0.025 → 3, 1e-7 → 7, 2500 → 0. */ +export function decimalsOf(value: number): number { + if (!Number.isFinite(value)) return 0; + const match = /^\d+(?:\.(\d+))?(?:e([+-]\d+))?$/.exec(String(clean(value))); + if (!match) return 0; + return Math.max(0, (match[1]?.length ?? 0) - Number(match[2] ?? 0)); +} + +/** The significant digits a value is written with: 2500 → 2, 0.025 → 2, 1 → 1. */ +function significantOf(value: number): number { + if (!Number.isFinite(value) || value === 0) return 1; + return clean(value).toExponential().split('e')[0].replace('.', '').length; +} + +/** + * A d3 pattern that prints each value exactly. Without a pattern: grouped, as many decimals as the + * values need, trailing zeros trimmed (`,.1~f` for 0.5, 1, 2.5). With one: its grouping, sign, + * symbol and kind kept, its precision raised (and trimmed) only where it would round a value away — + * `.0~%` becomes `.1~%` for 0.025, `,d` becomes `,.1~f` for 2.5, `,.2f` stays for 0.5. + */ +export function exactPattern(values: number[], pattern?: string): string { + const finite = values.filter(Number.isFinite); + const decimals = (scale = 1) => Math.max(0, ...finite.map((value) => decimalsOf(value * scale))); + if (pattern === undefined) return `,.${decimals()}~f`; + const match = SPECIFIER.exec(pattern); + if (!match) return pattern; + const [, fill = '', align = '', sign = '', symbol = '', zero = '', width = '', comma = ''] = match; + const stated = match[8] ? Number(match[8].slice(1)) : undefined; + let type = match[10] ?? ''; + let need: number; + let fallback: number; + switch (type) { + case 'f': need = decimals(); fallback = 6; break; + case '%': need = decimals(100); fallback = 6; break; + case 'd': + if (finite.every(Number.isInteger)) return pattern; + type = 'f'; need = decimals(); fallback = 0; break; + case 'e': need = Math.max(0, ...finite.map(significantOf)) - 1; fallback = 6; break; + case 'g': case 'r': case 's': case 'p': need = Math.max(...finite.map(significantOf)); fallback = 6; break; + case '': case 'n': need = Math.max(...finite.map(significantOf)); fallback = 12; break; + default: return pattern; + } + if ((stated ?? fallback) >= need && type === match[10]) return pattern; + return `${fill}${align}${sign}${symbol}${zero}${width}${comma}.${Math.max(stated ?? 0, need)}~${type}`; +} + +/** A field's format made exact for the values a key lists; an abbreviated format already prints them in full. */ +export function exactFormat(values: number[], fmt?: FormatSpec): FormatSpec { + if (fmt?.abbreviate) return fmt; + return { ...fmt, pattern: exactPattern(values, fmt?.pattern) }; +} + +/** A value as a FormatSpec prints it, as `formatSpecToVegaExpr` writes it for Vega. */ +export function printFormatted(value: number, fmt: FormatSpec | undefined): string { + const prefix = fmt?.prefix ?? ''; + const suffix = fmt?.suffix ?? ''; + if (fmt?.abbreviate) { + const abs = Math.abs(value); + const [divisor, unit] = abs >= 1e12 ? [1e12, 'T'] : abs >= 1e9 ? [1e9, 'B'] : abs >= 1e6 ? [1e6, 'M'] : abs >= 1e3 ? [1e3, 'K'] : [1, '']; + return `${prefix}${unit ? formatNumber('~g')(value / divisor) + unit : formatNumber(',')(value)}${suffix}`; + } + let shown: string; + try { shown = fmt?.pattern ? formatNumber(fmt.pattern)(value) : String(value); } catch { shown = String(value); } + return `${prefix}${shown}${suffix}`; +} diff --git a/packages/flint-js/src/core/semantic-types.ts b/packages/flint-js/src/core/semantic-types.ts index 8fdcc5e8..d4df1207 100644 --- a/packages/flint-js/src/core/semantic-types.ts +++ b/packages/flint-js/src/core/semantic-types.ts @@ -145,7 +145,7 @@ export const SemanticTypes = { // FALLBACK TYPES // ========================================================================= - Number: 'Number', // Generic number (measure fallback) + Number: 'Number', // Measure not to be added up (or additivity unknown); totals are Count, Amount, Quantity or Profit Unknown: 'Unknown', // Cannot determine type } as const; @@ -165,7 +165,7 @@ export type SemanticType = typeof SemanticTypes[keyof typeof SemanticTypes]; /** * Types suitable for quantitative encoding (true continuous measures). * - * Derived from the registry: aggRole ∈ {additive, intensive, signed-additive}, + * Derived from the registry: aggRole ∈ {additive, intensive, signed-additive, measure}, * excluding Score/Rating (t1='Score') which behave as bounded ordinal scales * for vis purposes (e.g., 1–5 star rating). This is an intentional vis-level * distinction, not a mathematical one. @@ -173,7 +173,7 @@ export type SemanticType = typeof SemanticTypes[keyof typeof SemanticTypes]; export const measureTypes = new Set( getRegisteredTypes().filter(t => { const e = getRegistryEntry(t); - return ['additive', 'intensive', 'signed-additive'].includes(e.aggRole) && e.t1 !== 'Score'; + return ['additive', 'intensive', 'signed-additive', 'measure'].includes(e.aggRole) && e.t1 !== 'Score'; }) ); @@ -466,6 +466,18 @@ function dataFarFromZero(values?: number[]): boolean { return dataMin / dataMax >= ZERO_BASELINE_GAP_THRESHOLD; } +/** + * Charts that draw a distribution: where values fall and how they spread is the read, so their value + * axis is a position, not a length. (A density's own height is computed, never a data channel.) + */ +const DISTRIBUTION_CHARTS = new Set(['Boxplot', 'Violin Plot', 'Density Plot', 'Ridgeline Plot', 'ECDF Plot']); + +/** The mark the zero baseline is decided for: a distribution chart's value axis reads as positions. */ +export function zeroMarkType(chartType: string | undefined, templateMarkType: string | undefined): string { + if (chartType && DISTRIBUTION_CHARTS.has(chartType)) return 'boxplot'; + return templateMarkType || 'point'; +} + export function computeZeroDecision( semanticType: string, channel: string, @@ -473,13 +485,19 @@ export function computeZeroDecision( values?: number[], ): ZeroDecision { const isBarLike = ['bar', 'area', 'rect'].includes(markType); - const isScatterMark = markType === 'circle' || markType === 'point'; + // A distribution's values are positions too: the box and its spread are the read, not a length. + const isScatterMark = markType === 'circle' || markType === 'point' || markType === 'boxplot'; // A line runs along x, so x is its index, not a measured length. const isLineIndex = (markType === 'line' || markType === 'trail') && channel === 'x'; const isPositional = ['x', 'y'].includes(channel); const entry = getRegistryEntry(semanticType); const zeroClass = getZeroClass(semanticType); + // A distribution whose values reach or cross zero keeps it in view: the data already spans it. + if (markType === 'boxplot' && isPositional && values && values.length > 0 && Math.min(...values) <= 0) { + return { zero: true, domainPadFraction: 0, zeroClass, forced: true, uncertain: false }; + } + // --- Zero-meaningful types: zero is the conventional baseline --- if (zeroClass === 'meaningful') { // Length marks (bar/area/rect): the baseline is structurally required — @@ -612,6 +630,11 @@ export interface ColorSchemeRecommendation { reason: string; /** For diverging schemes, the recommended midpoint value */ domainMid?: number; + /** + * For diverging schemes stepped into classes, how the midpoint sits among them: a neutral class + * `'auto'` (a step wide) or this far either side of it; unset, the midpoint is a break. + */ + neutral?: number | 'auto'; } // getDivergingMidpoint: REMOVED — superseded by resolveDivergingInfo() in field-semantics.ts diff --git a/packages/flint-js/src/core/source-plan.ts b/packages/flint-js/src/core/source-plan.ts index 80106d22..9f487544 100644 --- a/packages/flint-js/src/core/source-plan.ts +++ b/packages/flint-js/src/core/source-plan.ts @@ -8,6 +8,7 @@ */ import type { TextMeasurer } from './legend-layout'; import type { DesignDecisions } from './theme/types'; +import type { ChartCredit } from './types'; import { applyTextCase } from './text-case'; /** A run of text on a source line, in one weight and slope. */ @@ -26,11 +27,18 @@ export interface SourceLine { /** px from the foot of the footer to the top of the line. */ bottom: number; href?: string; + /** Shown on hover: a disclaimer the line stands for. */ + title?: string; + /** A line set smaller than the source (a map's credit): its own size and line height, in px. */ + fontSize?: number; + lineHeight?: number; } export interface SourcePlan { /** px the footer takes: the gap, the rule and the lines. */ room: number; + /** The plot was sized with the footer's room already kept, so it gives none up. */ + reserved?: boolean; lines: SourceLine[]; /** The credit's logo at the other end, level with the first line: px from the foot to its bottom. */ creditImage?: { src: string; alt: string; width: number; height: number; bottom: number; align: 'start' | 'end' }; @@ -48,35 +56,59 @@ export interface SourceInputs { /** The width the line may run: the title block's. */ block: number; measure: TextMeasurer; + /** + * The credit the chart's own drawing owes, as a map owes the boundaries it draws: a line of its + * own closing the foot, at its start, drawn whether or not the chart gives a source or the house draws it. + */ + credit?: ChartCredit; } +/** A credit the chart's drawing owes is set at this share of the source's size, and never under the floor (px). */ +const CREDIT_SCALE = 0.8; +const CREDIT_MIN_SIZE = 9; + /** The space between words (and between runs of different weight), in em. */ const WORD_SPACE = 0.25; +/** + * The source's words without a lead-in the author already wrote: "Source: Gapminder" under a house that + * leads with "Source:" reads "Gapminder", so the line does not say it twice. + */ +export function withoutLeadIn(words: string | undefined, leadIn: string | undefined): string | undefined { + const lead = leadIn?.trim().replace(/[\s::]+$/, ''); + if (!words || !lead) return words; + const escaped = lead.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const rest = words.replace(new RegExp(`^${escaped}s?\\s*[::]\\s*`, 'i'), ''); + return rest || words; +} + /** The source line a chart draws, or undefined when it gives no source or the house draws none. */ export function planSource(inputs: SourceInputs): SourcePlan | undefined { const { design, block, measure } = inputs; const s = design.source; const given = typeof inputs.source === 'string' ? { text: inputs.source } : inputs.source; - const words = given?.text?.trim(); - if (!s.show || !words) return undefined; + const words = s.show ? withoutLeadIn(given?.text?.trim(), s.leadIn) : undefined; + const owed = inputs.credit?.text.trim() ? inputs.credit : undefined; + if (!words && !owed) return undefined; const t = s.text; const fontSize = t.fontSize ?? 10; const font = t.font ?? design.font ?? 'sans-serif'; - const widthOf = (text: string, weight?: SourceRun['fontWeight'], style?: SourceRun['fontStyle']) => - measure(fontSize, font, weight ?? t.fontWeight ?? 'normal', style ?? t.fontStyle ?? 'normal')(text); + const widthAt = (size: number) => (text: string, weight?: SourceRun['fontWeight'], style?: SourceRun['fontStyle']) => + measure(size, font, weight ?? t.fontWeight ?? 'normal', style ?? t.fontStyle ?? 'normal')(text); + const widthOf = widthAt(fontSize); const space = fontSize * WORD_SPACE; const cased = (text: string) => (t.textCase ? applyTextCase(text, t.textCase) : text); // The tokens of the line in order: the lead-in, the source's words, an inline credit. type Token = { text: string; fontWeight?: SourceRun['fontWeight']; fontStyle?: SourceRun['fontStyle'] }; const tokens: Token[] = []; - if (s.leadIn) { + if (words && s.leadIn) { const lead = s.leadInCase ? applyTextCase(s.leadIn, s.leadInCase) : s.leadIn; tokens.push({ text: lead, ...(s.leadInWeight !== undefined ? { fontWeight: s.leadInWeight } : {}), ...(s.leadInStyle ? { fontStyle: s.leadInStyle } : {}) }); } - for (const word of cased(words).split(/\s+/)) tokens.push({ text: word }); - const credit = s.credit; + if (words) for (const word of cased(words).split(/\s+/)) tokens.push({ text: word }); + // The house credits itself beside the chart's source only. + const credit = words ? s.credit : undefined; if (credit?.placement === 'inline') { const sep = credit.separator.trim(); if (sep) tokens.push({ text: sep }); @@ -90,36 +122,40 @@ export function planSource(inputs: SourceInputs): SourcePlan | undefined { const room = (line: number) => Math.max(fontSize * 6, block - (line === 0 && endCredit ? endCredit.width + fontSize * 1.5 : 0)); // Words, greedily, into lines no wider than the block; runs merge words of one weight and slope. - const lines: Token[][] = [[]]; - let used = 0; - for (const token of tokens) { - const w = widthOf(token.text, token.fontWeight, token.fontStyle); - const line = lines[lines.length - 1]; - if (line.length && used + space + w > room(lines.length - 1)) { - lines.push([token]); - used = w; - } else { - used += (line.length ? space : 0) + w; - line.push(token); + const wrap = (words: readonly Token[], width: (line: number) => number, measureWord = widthOf, gap = space): Token[][] => { + const wrapped: Token[][] = [[]]; + let used = 0; + for (const token of words) { + const w = measureWord(token.text, token.fontWeight, token.fontStyle); + const line = wrapped[wrapped.length - 1]; + if (line.length && used + gap + w > width(wrapped.length - 1)) { + wrapped.push([token]); + used = w; + } else { + used += (line.length ? gap : 0) + w; + line.push(token); + } } - } - const toRuns = (line: Token[]): Array> => { + return wrapped; + }; + const lines = wrap(tokens, room); + const toRuns = (line: Token[], measureRun = widthOf): Array> => { const runs: Array> = []; for (const token of line) { const last = runs[runs.length - 1]; if (last && last.fontWeight === token.fontWeight && last.fontStyle === token.fontStyle) last.text += ` ${token.text}`; else runs.push({ text: token.text, fontWeight: token.fontWeight, fontStyle: token.fontStyle, width: 0 }); } - for (const run of runs) run.width = widthOf(run.text, run.fontWeight, run.fontStyle); + for (const run of runs) run.width = measureRun(run.text, run.fontWeight, run.fontStyle); return runs; }; - const place = (runs: Array>, align: 'start' | 'end'): SourceRun[] => { + const place = (runs: Array>, align: 'start' | 'end', gap = space): SourceRun[] => { // Offsets run from the aligned edge inward: left to right for `start`, right to left for `end`. const ordered = align === 'start' ? runs : [...runs].reverse(); let at = 0; const placed = ordered.map((run) => { const out = { ...run, offset: at } as SourceRun; - at += run.width + space; + at += run.width + gap; return out; }); return align === 'start' ? placed : placed.reverse(); @@ -133,8 +169,26 @@ export function planSource(inputs: SourceInputs): SourcePlan | undefined { if (credit?.placement === 'nextLine') { built.push({ align: s.align, runs: place([{ text: credit.text, fontWeight: credit.weight, width: widthOf(credit.text, credit.weight) }], s.align), bottom: 0 }); } - // Bottom-up: the last line sits on the foot of the footer. - built.forEach((line, i) => { line.bottom = (built.length - 1 - i) * lineHeight; }); + // The owed credit closes the foot, at its start, as a map's attribution sits in its corner: set a + // step below the source, as map attributions are, and never under 9 px. + if (owed) { + const size = Math.min(fontSize, Math.max(CREDIT_MIN_SIZE, Math.round(fontSize * CREDIT_SCALE))); + const measureCredit = widthAt(size); + const gap = size * WORD_SPACE; + for (const line of wrap(owed.text.split(/\s+/).map((text) => ({ text })), () => Math.max(size * 6, block), measureCredit, gap)) { + built.push({ + align: 'start', runs: place(toRuns(line, measureCredit), 'start', gap), bottom: 0, + ...(owed.href ? { href: owed.href } : {}), ...(owed.title ? { title: owed.title } : {}), + ...(size !== fontSize ? { fontSize: size, lineHeight: Math.round(size * 1.3) } : {}), + }); + } + } + // Bottom-up: the last line sits on the foot of the footer, each line as tall as its own type. + let stacked = 0; + for (let i = built.length - 1; i >= 0; i--) { + built[i].bottom = stacked; + stacked += built[i].lineHeight ?? lineHeight; + } const other = s.align === 'start' ? 'end' : 'start'; let creditImage: SourcePlan['creditImage']; if (endCredit && credit?.image) { @@ -144,7 +198,7 @@ export function planSource(inputs: SourceInputs): SourcePlan | undefined { } else if (endCredit) { built.push({ align: other, runs: [{ text: endCredit.text, fontWeight: endCredit.fontWeight, offset: 0, width: endCredit.width }], bottom: built[0].bottom }); } - const textHeight = Math.max((built.length - (endCredit && !creditImage ? 1 : 0)) * lineHeight, creditImage ? creditImage.bottom + creditImage.height : 0); + const textHeight = Math.max(stacked, creditImage ? creditImage.bottom + creditImage.height : 0); const rule = s.rule ? { bottom: textHeight + 6, width: s.rule.width, color: s.rule.color, ...(s.rule.dash ? { dash: s.rule.dash } : {}) } : undefined; const total = Math.ceil(s.gap + textHeight + (rule ? rule.width + 6 : 0)); return { diff --git a/packages/flint-js/src/core/spec-updates.ts b/packages/flint-js/src/core/spec-updates.ts new file mode 100644 index 00000000..c779c9e4 --- /dev/null +++ b/packages/flint-js/src/core/spec-updates.ts @@ -0,0 +1,20 @@ +import type { ChartAssemblyInput, ChartWarning } from './types'; + +/** + * Say, on a static output, that the spec's `updates` are not in it: a spec's updates (notes, + * overlays, emphasis, a viewport) are applied by the interactive runtime once the chart is drawn, + * and a compiled spec, an SVG or another backend's figure draws the chart without them. + */ +export function noteSpecUpdates(output: T, input: Pick): T { + const count = input.updates?.length ?? 0; + if (!count || !output || typeof output !== 'object') return output; + const warning: ChartWarning = { + severity: 'info', + code: 'updates-not-compiled', + message: `The spec's ${count} update${count === 1 ? '' : 's'} (${input.updates!.map((update) => `"${update.id}"`).join(', ')}) ` + + 'are applied by the interactive runtime (mountChart, ) once the chart is drawn; this output draws the chart without them.', + }; + const notes = output as { _warnings?: ChartWarning[] }; + notes._warnings = [...(notes._warnings ?? []), warning]; + return output; +} diff --git a/packages/flint-js/src/core/target-selector.ts b/packages/flint-js/src/core/target-selector.ts index ea4c869d..e0c9e89f 100644 --- a/packages/flint-js/src/core/target-selector.ts +++ b/packages/flint-js/src/core/target-selector.ts @@ -40,6 +40,17 @@ export function conditionNumber(value: unknown): number { * temporal fields hold time; a set member must then equal the mark's value exactly, as a key's * value does, and a range holds its ends. */ +/** + * A number and the same number written as text are one member: a field drawn as categories (a year + * on a banded axis) carries its values as text, while the author's key names them as numbers. + */ +function sameMember(value: unknown, member: unknown): boolean { + if (Object.is(value, member)) return true; + if (typeof value === 'number' && typeof member === 'string') return member.trim() !== '' && Number(member) === value; + if (typeof value === 'string' && typeof member === 'number') return value.trim() !== '' && Number(value) === member; + return false; +} + export function selectorPredicate( selector: SemanticTargetSelector, declaredFields: readonly string[], @@ -50,7 +61,7 @@ export function selectorPredicate( const tests = conditions.map(([field, condition]): ((value: Readonly>) => boolean) => { if ('in' in condition) { const members = condition.in.map((member) => normalize(field, member)); - return (value) => members.some((member) => Object.is(value[field], member)); + return (value) => members.some((member) => sameMember(value[field], member)); } const low = conditionNumber(normalize(field, condition.range[0])); const high = conditionNumber(normalize(field, condition.range[1])); diff --git a/packages/flint-js/src/core/temporal-parse.ts b/packages/flint-js/src/core/temporal-parse.ts index 755ef590..b4c009b8 100644 --- a/packages/flint-js/src/core/temporal-parse.ts +++ b/packages/flint-js/src/core/temporal-parse.ts @@ -84,6 +84,27 @@ export function hasTemporalParsers(semanticType: string): boolean { return semanticType in PARSERS_BY_TYPE; } +const ISO_TIMESTAMP = /^(\d{4}-\d{2}-\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?(Z|[+-]\d{2}(?::?\d{2})?)?$/i; + +/** + * An ISO timestamp as Flint reads it, or null for any other value. Under a calendar grain (a year, + * quarter, month or date), a timestamp at midnight is that date, as a database `DATE` column + * serialised to JSON writes it (`2005-05-01T00:00:00.000`), whatever its zone. A timestamp with a + * time of day and no zone is a wall-clock time: it is written in ISO form (a space becomes `T`) + * and stays zoneless, so it is read, and its axis labelled, in the viewer's time. Reading it as UTC + * would label it in local time hours away from what the data says. One with a zone is kept as written. + */ +export function readIsoTimestamp(value: unknown, calendarGrain: boolean): string | null { + if (typeof value !== 'string') return null; + const match = value.trim().match(ISO_TIMESTAMP); + if (!match) return null; + const [, day, hours, minutes, seconds = '00', fraction = '', zone] = match; + const midnight = Number(hours) === 0 && Number(minutes) === 0 && Number(seconds) === 0 && !/[1-9]/.test(fraction); + if (calendarGrain && midnight) return day; + if (zone) return null; + return `${day}T${hours}:${minutes}:${seconds}${fraction}`; +} + /** * The canonical string for a value of the given temporal semantic type, or null when * the type has no parsers or the value is not one of its spellings (the caller keeps diff --git a/packages/flint-js/src/core/text-widths.generated.ts b/packages/flint-js/src/core/text-widths.generated.ts index 723a0ec4..c42f17c8 100644 --- a/packages/flint-js/src/core/text-widths.generated.ts +++ b/packages/flint-js/src/core/text-widths.generated.ts @@ -14,6 +14,10 @@ export const TEXT_WIDTHS: Record> = normal: [0.278, 0.278, 0.355, 0.556, 0.556, 0.889, 0.667, 0.191, 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.278, 0.278, 0.584, 0.584, 0.584, 0.556, 1.015, 0.667, 0.667, 0.722, 0.722, 0.667, 0.611, 0.778, 0.722, 0.278, 0.5, 0.667, 0.556, 0.833, 0.722, 0.778, 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944, 0.667, 0.667, 0.611, 0.278, 0.278, 0.278, 0.469, 0.556, 0.333, 0.556, 0.556, 0.5, 0.556, 0.556, 0.278, 0.556, 0.556, 0.222, 0.222, 0.5, 0.222, 0.833, 0.556, 0.556, 0.556, 0.556, 0.333, 0.5, 0.278, 0.556, 0.5, 0.722, 0.5, 0.5, 0.5, 0.334, 0.26, 0.334, 0.584], bold: [0.278, 0.333, 0.474, 0.556, 0.556, 0.889, 0.722, 0.238, 0.333, 0.333, 0.389, 0.584, 0.278, 0.333, 0.278, 0.278, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.556, 0.333, 0.333, 0.584, 0.584, 0.584, 0.611, 0.975, 0.722, 0.722, 0.722, 0.722, 0.667, 0.611, 0.778, 0.722, 0.278, 0.556, 0.722, 0.611, 0.833, 0.722, 0.778, 0.667, 0.778, 0.722, 0.667, 0.611, 0.722, 0.667, 0.944, 0.667, 0.667, 0.611, 0.333, 0.278, 0.333, 0.584, 0.556, 0.333, 0.556, 0.611, 0.556, 0.611, 0.556, 0.333, 0.611, 0.611, 0.278, 0.278, 0.556, 0.278, 0.889, 0.611, 0.611, 0.611, 0.611, 0.389, 0.556, 0.333, 0.611, 0.556, 0.778, 0.556, 0.556, 0.5, 0.389, 0.28, 0.389, 0.584], }, + "Verdana": { + normal: [0.352, 0.394, 0.459, 0.818, 0.636, 1.076, 0.727, 0.269, 0.454, 0.454, 0.636, 0.818, 0.364, 0.454, 0.364, 0.454, 0.636, 0.636, 0.636, 0.636, 0.636, 0.636, 0.636, 0.636, 0.636, 0.636, 0.454, 0.454, 0.818, 0.818, 0.818, 0.545, 1, 0.684, 0.686, 0.698, 0.771, 0.632, 0.575, 0.775, 0.751, 0.421, 0.455, 0.693, 0.557, 0.843, 0.748, 0.787, 0.603, 0.787, 0.695, 0.684, 0.616, 0.732, 0.684, 0.989, 0.685, 0.615, 0.685, 0.454, 0.454, 0.454, 0.818, 0.636, 0.636, 0.601, 0.623, 0.521, 0.623, 0.596, 0.352, 0.623, 0.633, 0.274, 0.344, 0.592, 0.274, 0.973, 0.633, 0.607, 0.623, 0.623, 0.427, 0.521, 0.394, 0.633, 0.592, 0.818, 0.592, 0.592, 0.525, 0.635, 0.454, 0.635, 0.818], + bold: [0.342, 0.402, 0.587, 0.867, 0.711, 1.272, 0.862, 0.332, 0.543, 0.543, 0.711, 0.867, 0.361, 0.48, 0.361, 0.689, 0.711, 0.711, 0.711, 0.711, 0.711, 0.711, 0.711, 0.711, 0.711, 0.711, 0.402, 0.402, 0.867, 0.867, 0.867, 0.617, 0.964, 0.776, 0.762, 0.724, 0.83, 0.683, 0.65, 0.811, 0.837, 0.546, 0.555, 0.771, 0.637, 0.948, 0.847, 0.85, 0.733, 0.85, 0.782, 0.71, 0.682, 0.812, 0.764, 1.128, 0.764, 0.737, 0.692, 0.543, 0.689, 0.543, 0.867, 0.711, 0.711, 0.668, 0.699, 0.588, 0.699, 0.664, 0.422, 0.699, 0.712, 0.342, 0.403, 0.671, 0.342, 1.058, 0.712, 0.687, 0.699, 0.699, 0.497, 0.593, 0.456, 0.712, 0.65, 0.979, 0.669, 0.651, 0.597, 0.711, 0.543, 0.711, 0.867], + }, "Arial Black": { normal: [0.333, 0.333, 0.5, 0.66, 0.667, 1, 0.889, 0.278, 0.389, 0.389, 0.556, 0.66, 0.333, 0.333, 0.333, 0.278, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.333, 0.333, 0.66, 0.66, 0.66, 0.611, 0.74, 0.778, 0.778, 0.778, 0.778, 0.722, 0.667, 0.833, 0.833, 0.389, 0.667, 0.833, 0.667, 0.944, 0.833, 0.833, 0.722, 0.833, 0.778, 0.722, 0.722, 0.833, 0.778, 1, 0.778, 0.778, 0.722, 0.389, 0.278, 0.389, 0.66, 0.5, 0.333, 0.667, 0.667, 0.667, 0.667, 0.667, 0.389, 0.667, 0.667, 0.333, 0.333, 0.667, 0.333, 1, 0.667, 0.667, 0.667, 0.667, 0.444, 0.611, 0.444, 0.667, 0.611, 0.944, 0.667, 0.611, 0.556, 0.389, 0.278, 0.389, 0.66], bold: [0.333, 0.333, 0.5, 0.66, 0.667, 1, 0.889, 0.278, 0.389, 0.389, 0.556, 0.66, 0.333, 0.333, 0.333, 0.278, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.667, 0.333, 0.333, 0.66, 0.66, 0.66, 0.611, 0.74, 0.778, 0.778, 0.778, 0.778, 0.722, 0.667, 0.833, 0.833, 0.389, 0.667, 0.833, 0.667, 0.944, 0.833, 0.833, 0.722, 0.833, 0.778, 0.722, 0.722, 0.833, 0.778, 1, 0.778, 0.778, 0.722, 0.389, 0.278, 0.389, 0.66, 0.5, 0.333, 0.667, 0.667, 0.667, 0.667, 0.667, 0.389, 0.667, 0.667, 0.333, 0.333, 0.667, 0.333, 1, 0.667, 0.667, 0.667, 0.667, 0.444, 0.611, 0.444, 0.667, 0.611, 0.944, 0.667, 0.611, 0.556, 0.389, 0.278, 0.389, 0.66], diff --git a/packages/flint-js/src/core/theme/chrome.ts b/packages/flint-js/src/core/theme/chrome.ts index 407388ce..c92fe1bf 100644 --- a/packages/flint-js/src/core/theme/chrome.ts +++ b/packages/flint-js/src/core/theme/chrome.ts @@ -3,10 +3,23 @@ import type { ThemeSpec } from './types'; /** * What a chart keeps of its house's chrome: the header (rules, tabs, wordmarks and logos above or * beside the title), the footer (the closing rule and the house's credit beside the source) and, - * across both, the logos. Unset follows the theme. `false` turns all of it off. + * across both, the logos. Unset follows the theme ({@link chartChrome}: none on a map). `false` turns all of it off. */ export type ChartChrome = false | { header?: boolean; footer?: boolean; logos?: boolean }; +/** Chart types drawn as maps: they stand without a house's chrome unless they ask for it. */ +const MAP_CHART_TYPES = new Set(['Map', 'Choropleth']); + +/** + * The chrome a chart keeps: what it states, else none for a map — a house's header bar, tab, rules, + * logos and footer credit frame an article's figure, and read as clutter round a map, which is set + * into dashboards and apps — else the theme's. + */ +export function chartChrome(chartType: string | undefined, chrome: ChartChrome | undefined): ChartChrome | undefined { + if (chrome !== undefined) return chrome; + return chartType && MAP_CHART_TYPES.has(chartType) ? false : undefined; +} + /** The theme with the chrome a chart turned off taken out; unchanged where the chart said nothing. */ export function withChrome(theme: ThemeSpec | undefined, chrome: ChartChrome | undefined): ThemeSpec | undefined { if (!theme || chrome === undefined) return theme; diff --git a/packages/flint-js/src/core/theme/ground.ts b/packages/flint-js/src/core/theme/ground.ts index 58eb9d26..3d488481 100644 --- a/packages/flint-js/src/core/theme/ground.ts +++ b/packages/flint-js/src/core/theme/ground.ts @@ -46,6 +46,7 @@ import { readableTextInk, isDarkSurface, isPaintedSurface, + lightness, mixHex, parseColor, presenceWidth, @@ -828,7 +829,10 @@ function bindRoles(ctx: GroundingContext): Bindings { }); const { measureChannels, categoricalChannel } = axisRoles({ x: fieldFacts('x'), y: fieldFacts('y') }); - const seriesChannel = SERIES_CHANNELS.find((c) => ctx.channelSemantics?.[c]?.field) + // On a bar, `detail` splits each bar into segments that read as one (`sealDetailSegments`); it is + // a series only where marks are drawn apart (a line, a ranged bar). + const segmentsOnly = ctx.markTypes.includes('bar') && !ctx.channelSemantics?.x2?.field && !ctx.channelSemantics?.y2?.field; + const seriesChannel = SERIES_CHANNELS.find((c) => ctx.channelSemantics?.[c]?.field && !(c === 'detail' && segmentsOnly)) ?? (ctx.positional?.color?.field ? 'color' : undefined); const facetChannel = FACET_CHANNELS.find((c) => ctx.channelSemantics?.[c]?.field); return { measureChannels, categoricalChannel, seriesChannel, facetChannel }; @@ -2143,6 +2147,14 @@ export function groundTheme(themeIn: ThemeSpec, ctx: GroundingContext): DesignDe haloWidth: Math.max(0, selectionBoundary?.haloWidth ?? 2.5), haloOpacity: clamp(selectionBoundary?.haloOpacity ?? 0.35, 0, 1), }, + annotation: { + ...(theme.ink?.accent ? { accent: theme.ink.accent } : {}), + ...(theme.ink?.series?.categorical?.length ? { palette: [...theme.ink.series.categorical] } : {}), + ...(theme.type?.annotation ? { text: resolveType(theme.type.annotation, (axisLabelText.fontSize ?? 10) + 1, text.primary) } : {}), + ink: text.primary, + background: plot, + ...(theme.interaction?.highlight ? { highlight: { ...theme.interaction.highlight } } : {}), + }, }, facets, layout: { @@ -2368,6 +2380,7 @@ function groundSeriesInkChoice( const signedSequential = seriesSigned && selection.signed === 'sequential'; const diverging = seriesSigned && !signedSequential && Boolean(s.diverging); const ramp: Ramp | undefined = offSurface(diverging ? s.diverging : s.sequential, surfaceColour); + if (diverging && ramp?.stops?.length) reportUnbalancedRamp(ramp.stops, say); if (ramp?.stops?.length) { const consumption = ramp.consumption ?? 'interpolate'; const quantize = consumption === 'quantize' ? (ramp.quantizeCount ?? 5) : undefined; @@ -2548,6 +2561,36 @@ function forMarkFamily(s: NonNullable, family: SeriesMarkFam * regions that each net a gain or a loss). Months on a ridgeline of temperatures do not, however * cold the winter. */ +/** How far apart in L* the two arms of a diverging ramp may stand at mirrored points before they read as unequal. */ +const RAMP_ARM_TOLERANCE = 3; + +/** + * A diverging ramp reads equal distances from its midpoint as equal only where its two arms are + * equally light at mirrored points (ColorBrewer's diverging schemes; Moreland, "Diverging Color + * Maps for Scientific Visualization", 2009). Reports the widest gap, from the ends to near the + * middle, where it passes {@link RAMP_ARM_TOLERANCE}. + */ +function reportUnbalancedRamp(stops: string[], say: ReportDeparture): void { + if (stops.length < 3) return; + const at = (t: number): number | undefined => { + const x = t * (stops.length - 1); + const k = Math.min(stops.length - 2, Math.floor(x)); + const c = parseColor(mixHex(stops[k], stops[k + 1], x - k, stops[k])); + return c ? lightness(c) : undefined; + }; + let widest = { gap: 0, t: 0, low: 0, high: 0 }; + for (const t of [0, 0.1, 0.2, 0.3, 0.4]) { + const low = at(t); + const high = at(1 - t); + if (low === undefined || high === undefined) return; + if (Math.abs(low - high) > widest.gap) widest = { gap: Math.abs(low - high), t, low, high }; + } + if (widest.gap <= RAMP_ARM_TOLERANCE) return; + say('ink.series.diverging', 'diverging-ramp-unbalanced', + `the diverging ramp's arms differ by ${widest.gap.toFixed(1)} L* ${widest.t === 0 ? 'at its ends' : `${Math.round(widest.t * 100)}% in from its ends`} ` + + `(${widest.low.toFixed(1)} against ${widest.high.toFixed(1)}), so equal distances from the midpoint do not read as equal`); +} + function seriesCarriesSign(ctx: GroundingContext, field: string | undefined, type: string | undefined): boolean { if (!field) return false; // A field this stage cannot see (a template derives it) keeps the chart's sign. diff --git a/packages/flint-js/src/core/theme/presence.ts b/packages/flint-js/src/core/theme/presence.ts index 64db2a17..af31be74 100644 --- a/packages/flint-js/src/core/theme/presence.ts +++ b/packages/flint-js/src/core/theme/presence.ts @@ -90,6 +90,12 @@ export function luminance(c: RGB): number { return 0.2126 * f(c.r) + 0.7152 * f(c.g) + 0.0722 * f(c.b); } +/** CIE L* lightness, 0 (black) to 100 (white): where equal steps look equally lighter. */ +export function lightness(c: RGB): number { + const y = luminance(c); + return y > 216 / 24389 ? 116 * Math.cbrt(y) - 16 : (24389 / 27) * y; +} + export function isDarkSurface(surface: string): boolean { const c = parseColor(surface); return c ? luminance(c) < 0.45 : false; diff --git a/packages/flint-js/src/core/theme/presets.ts b/packages/flint-js/src/core/theme/presets.ts index cd590ffa..4f74648f 100644 --- a/packages/flint-js/src/core/theme/presets.ts +++ b/packages/flint-js/src/core/theme/presets.ts @@ -10,6 +10,7 @@ */ import type { ThemePreset, ThemeSpec } from './types'; +import { contrastRatio, readableTextInk } from './presence'; import { FLINT_ICON } from './presets/icons'; import { nyt } from './presets/nyt'; import { economist } from './presets/economist'; @@ -78,7 +79,41 @@ export function resolveThemeSpec(theme: ThemeSpec | string | undefined): ThemeSp if (theme.extends === undefined) return theme; const { extends: presetId, ...overrides } = theme; - return deepMerge(resolveThemeSpec(presetSpec(presetId))!, overrides); + const base = resolveThemeSpec(presetSpec(presetId))!; + return followInk(base, overrides, deepMerge(base, overrides)); +} + +/** Type roles set on the page; a value label is set on its mark, whose fill the page does not decide. */ +const PAGE_ROLES = ['headline', 'deck', 'axisLabel', 'axisTitle', 'keyLabel', 'keyTitle', 'annotation', 'footnote', 'kicker', 'display'] as const; + +const sameColor = (a: unknown, b: unknown) => typeof a === 'string' && typeof b === 'string' && a.trim().toLowerCase() === b.trim().toLowerCase(); + +/** + * A house that recolours the one it extends takes its type with it. A role the base states in one of + * its text inks (the NYT sets its headline in its primary ink) follows that ink as recoloured; on a + * page recoloured, a role whose own colour no longer reads on it is moved until it does. A role + * whose colour the extension states itself is left as stated. + */ +function followInk(base: ThemeSpec, overrides: Partial, merged: ThemeSpec): ThemeSpec { + const text = overrides.ink?.text; + const surface = overrides.ink?.surface; + if (!text && !surface || !merged.type) return merged; + const baseText = (base.ink?.text ?? {}) as Record; + const newText = (merged.ink?.text ?? {}) as Record; + const page = surface?.canvas ?? surface?.plot; + const type: Record = { ...merged.type }; + for (const role of PAGE_ROLES) { + const stated = type[role]; + if (!stated || typeof stated.color !== 'string' || (overrides.type as any)?.[role]?.color !== undefined) continue; + const echoed = Object.keys(baseText).find((key) => sameColor(baseText[key], stated.color)); + let color: string = echoed && text?.[echoed as keyof typeof text] ? newText[echoed]! : stated.color; + if (page && contrastRatio(color, page) < 3) { + const fallback = newText[echoed ?? 'primary']; + color = fallback && contrastRatio(fallback, page) >= 3 ? fallback : readableTextInk(color, page); + } + if (color !== stated.color) type[role] = { ...stated, color }; + } + return { ...merged, type }; } function presetSpec(id: string): ThemeSpec { diff --git a/packages/flint-js/src/core/theme/presets/cartoon.ts b/packages/flint-js/src/core/theme/presets/cartoon.ts index 3426c0ab..c7ce4df2 100644 --- a/packages/flint-js/src/core/theme/presets/cartoon.ts +++ b/packages/flint-js/src/core/theme/presets/cartoon.ts @@ -8,8 +8,8 @@ import { CARTOON_ICON } from './icons'; * Cartoon — a playful, friendly house in the spirit of xkcd and modern * flat-cartoon illustration. * - * Modelled on the hand-authored mockups in the Cartoon lab (see - * `site/src/playground/cartoon-lab-data.ts`). Flint cannot draw the + * Modelled on the hand-authored mockups of the former Cartoon lab + * (`site/src/playground/cartoon-lab-data.ts`, removed after commit 8682029d). Flint cannot draw the * hand-wobbled "last mile" of a true xkcd plot — that is a per-pixel filter on * the rendered SVG, not a chart decision — so the character is carried by the * parts a theme owns and by three levers that read as *fun*: @@ -173,6 +173,9 @@ export const cartoon: ThemePreset = { point: { presence: 'full', fill: 'solid', + // Stickers stack: a dot laid over another hides it, its dark edge keeping the one + // beneath readable, rather than fading so piles darken. + opacity: 1, size: 170, // The dark sticker edge is the identity here; a pale halo would // replace it because Vega-Lite gives a point only one stroke. diff --git a/packages/flint-js/src/core/theme/presets/pop.ts b/packages/flint-js/src/core/theme/presets/pop.ts index 2acf4563..a0452f58 100644 --- a/packages/flint-js/src/core/theme/presets/pop.ts +++ b/packages/flint-js/src/core/theme/presets/pop.ts @@ -56,7 +56,7 @@ export const pop: ThemePreset = { case: 'upper', }, deck: { size: 'text.200', weight: 'bold', color: '#5f0047' }, - axisLabel: { family: "'Arial Black', Arial, sans-serif", size: 'text.100' }, + axisLabel: { family: "'Arial Black', Arial, sans-serif", size: 'text.100', color: '#5f0047' }, axisTitle: { family: "'Arial Black', Arial, sans-serif", size: 'text.100', weight: 'bold' }, valueLabel: { family: "'Arial Black', Arial, sans-serif", weight: 'bold' }, }, @@ -74,12 +74,15 @@ export const pop: ThemePreset = { strokeCap: 'square', strokeJoin: 'miter', fillOpacity: 1, + // Pop keeps solid areas held apart by its black separator, not Swiss's edged wash. + areaEdge: { presence: 'omit' }, outline: { presence: 'emphasised', weight: 3, source: 'ink' }, tile: { gap: 1, source: 'structure' }, point: { presence: 'full', size: 180, fill: 'solid', halo: { presence: 'omit' } }, separator: { presence: 'emphasised', width: 3, source: 'structure' }, }, dataLabels: { show: 'whenTheyFit', placement: 'atMark', inkMode: 'contrastWithMark' }, + legend: { swatch: 'auto' }, layout: { density: 'normal', bandStepFit: 0.85, titleBlock: { anchor: 'start', gap: 'tight' } }, }, }; \ No newline at end of file diff --git a/packages/flint-js/src/core/theme/presets/swiss.ts b/packages/flint-js/src/core/theme/presets/swiss.ts index 7b6088f0..e70ef101 100644 --- a/packages/flint-js/src/core/theme/presets/swiss.ts +++ b/packages/flint-js/src/core/theme/presets/swiss.ts @@ -7,8 +7,8 @@ import { SWISS_ICON } from './icons'; /** * Swiss / International Typographic Style. * - * Modelled on the hand-authored mockups in the Swiss lab (see - * `site/src/playground/swiss-lab-data.ts`), which were in turn measured against + * Modelled on the hand-authored mockups of the former Swiss lab + * (`site/src/playground/swiss-lab-data.ts`, removed after commit 8682029d), which were in turn measured against * the poster/diagram canon — swissted.com, Poster House "The Swiss Grid", * Müller-Brockmann's Tonhalle posters, Vignelli's 1972 NYC subway diagram, and * Otl Aicher's 1972 Munich colour system. @@ -112,8 +112,10 @@ export const swiss: ThemePreset = { size: 'text.200', color: '#555555', }, + // Labels in the structural ink, as the axes they sit on: high contrast, not a grey aside. axisLabel: { size: 'text.100', + color: '#1a1a1a', }, axisTitle: { size: 'text.100', @@ -125,12 +127,14 @@ export const swiss: ThemePreset = { axis: { categorical: { line: 'full', + lineWeight: 1.5, ticks: 'omit', }, measure: { line: 'full', + lineWeight: 1.5, ticks: 'full', - tickLength: 'short', + tickLength: 'long', tickDirection: 'outward', }, }, @@ -149,6 +153,10 @@ export const swiss: ThemePreset = { strokeCap: 'butt', strokeJoin: 'miter', interpolation: 'linear', + // An area is a flat fill under its own edge: the grid reads through + // the fill, and the edge, not a paper gap, parts stacked bands. + fillOpacity: 0.75, + areaEdge: { presence: 'full', width: 1.5 }, point: { presence: 'omit', fill: 'solid', @@ -175,6 +183,7 @@ export const swiss: ThemePreset = { show: 'always', placement: ['top'], direction: 'horizontal', + swatch: 'square', title: 'whenAmbiguous', suppressWhenAxisNames: true, }, diff --git a/packages/flint-js/src/core/theme/types.ts b/packages/flint-js/src/core/theme/types.ts index 00c84926..1f423347 100644 --- a/packages/flint-js/src/core/theme/types.ts +++ b/packages/flint-js/src/core/theme/types.ts @@ -612,7 +612,8 @@ export interface ThemeLegend { /** * The symbol beside each name in a key to categories: `auto` (default) takes it from the mark — * a square for bars, a stroke for lines, the dot's own shape for points; `square`, `circle` or - * `line` (a short stroke) draw that symbol for every mark. A key whose entries are shapes (a + * `line` (a short stroke) draw that symbol for every mark, except that a square or circle is + * a filled chip and a line series keeps its stroke. A key whose entries are shapes (a * shape channel) or sizes keeps its own symbols. Vega-Lite only. */ swatch?: 'auto' | 'square' | 'circle' | 'line'; @@ -1080,6 +1081,17 @@ export interface ThemeInteraction { haloWidth?: number; haloOpacity?: number; }; + /** + * Paint for the marks an agent or the reader points at with an update: the ring round a dot, the + * outline round a bar, cell, slice or region a note names, and an enclosure's outline. Unset, they + * take the neutral annotation grey (an enclosure round one colour's cluster takes that colour). + */ + highlight?: { + color?: string; + width?: number; + haloColor?: string; + haloWidth?: number; + }; } /** @@ -1198,6 +1210,23 @@ export interface ResolvedSource { gap: number; } +/** + * The house's say in an annotation's colours and words: its `ink.accent` and categorical hues for a + * region's wash, its `type.annotation` role for a note's words, and the primary text ink a note is + * set in otherwise. + */ +export interface AnnotationDesign { + accent?: string; + /** The house's categorical hues, the first a region's wash is chosen from. */ + palette?: readonly string[]; + text?: ResolvedText; + ink: string; + /** The page an annotation is read on: the plot's own surface, else the canvas. */ + background: string; + /** The house's paint for rings, outlines and enclosures, where it states one. */ + highlight?: { color?: string; width?: number; haloColor?: string; haloWidth?: number }; +} + export interface ResolvedText { font?: string; fontSize?: number; @@ -1550,6 +1579,8 @@ export interface DesignDecisions { haloWidth: number; haloOpacity: number; }; + /** How the house sets the notes, regions and enclosures an update draws. */ + annotation: AnnotationDesign; }; facets: { header: { show: boolean; fieldTitle: boolean } & ResolvedText; diff --git a/packages/flint-js/src/core/theme/value-label-format.ts b/packages/flint-js/src/core/theme/value-label-format.ts index bcdb7e51..9306a590 100644 --- a/packages/flint-js/src/core/theme/value-label-format.ts +++ b/packages/flint-js/src/core/theme/value-label-format.ts @@ -228,7 +228,9 @@ export function formatValueApprox(value: number, pattern: string | undefined): s if (type === 's') { // SI: bring the mantissa into 1–999 and name the exponent. - const exponent = abs === 0 ? 0 : Math.floor(Math.log10(abs) / 3) * 3; + let exponent = abs === 0 ? 0 : Math.floor(Math.log10(abs) / 3) * 3; + // 999,600 rounds to 1000k; d3 prints it as 1M. + if (abs !== 0 && Number((abs / 10 ** exponent).toPrecision(precision ?? 6)) >= 1000) exponent += 3; const clamped = Math.max(-24, Math.min(24, exponent)); const mantissa = abs / 10 ** clamped; body = mantissa.toPrecision(precision ?? 6); diff --git a/packages/flint-js/src/core/title-fit.ts b/packages/flint-js/src/core/title-fit.ts index 300b8668..99808964 100644 --- a/packages/flint-js/src/core/title-fit.ts +++ b/packages/flint-js/src/core/title-fit.ts @@ -1,4 +1,4 @@ -// A title fitted to the block it sits over: set down a size, or broken over even lines with the +// A title fitted to the block it sits over: set down a size, or broken over full lines with the // height taken out of the plot. Shared by the plan and by theme realization. /** Roughly how wide a glyph runs, as a fraction of the font size. */ @@ -20,38 +20,51 @@ export function textPx(s: string, fontSize: number): number { } /** - * Break the headline into `count` lines of even length. - * - * Filling each line to the brim and letting the remainder fall through is what - * leaves a headline ending in a single orphaned word. Aiming at the average - * line instead spreads the text over the lines it needs. + * Break a title into `count` lines as full as the words allow: none wider than `block`, and the last + * no shorter than `shortest`. Every line but the last is charged its squared room left on the block, + * so the room a short last line needs is taken across the lines above it, not from one of them. + * Undefined where no such breaks exist. */ -export function balancedLines(text: string, count: number, fontSize: number, measure: TitleMeasure): string[] { +export function fullestLines( + text: string, count: number, block: number, shortest: number, fontSize: number, measure: TitleMeasure, +): string[] | undefined { const words = text.split(/\s+/).filter(Boolean); - if (words.length <= 1) return [text]; - const target = measure(text, fontSize) / count; - const lines: string[] = []; - let line = ''; - for (const word of words) { - const candidate = line ? `${line} ${word}` : word; - // Break once the line is closer to the target with this word left off. - if (line && lines.length < count - 1 - && measure(candidate, fontSize) - target > target - measure(line, fontSize)) { - lines.push(line); - line = word; - } else { - line = candidate; + const n = words.length; + if (count < 1 || count > n) return undefined; + const widths = new Map(); + const widthOf = (from: number, to: number): number => { + const key = `${from}:${to}`; + let width = widths.get(key); + if (width === undefined) widths.set(key, width = measure(words.slice(from, to).join(' '), fontSize)); + return width; + }; + // cost[k][j]: the least room left by the first j words over k lines; from[k][j]: where the k-th line starts. + const cost = Array.from({ length: count + 1 }, () => new Array(n + 1).fill(Infinity)); + const from = Array.from({ length: count + 1 }, () => new Array(n + 1).fill(-1)); + cost[0][0] = 0; + for (let k = 1; k <= count; k++) { + const last = k === count; + for (let j = last ? n : k; j <= n - (count - k); j++) { + for (let i = k - 1; i < j; i++) { + if (cost[k - 1][i] === Infinity) continue; + const width = widthOf(i, j); + if (width > block || (last && width < shortest)) continue; + const c = cost[k - 1][i] + (last ? 0 : (block - width) ** 2); + if (c < cost[k][j]) { cost[k][j] = c; from[k][j] = i; } + } } } - if (line) lines.push(line); - return lines; + if (cost[count][n] === Infinity) return undefined; + const out: string[] = []; + for (let k = count, j = n; k > 0; j = from[k][j], k--) out.unshift(words.slice(from[k][j], j).join(' ')); + return out; } /** * Break a title to its block: each line filled to the block, as a headline is set, the words that - * do not fit falling to the next. Only where that leaves a widow — a last line under a third of the - * block — are the last two lines evened out, so no line stands alone. Even lines everywhere leave a - * headline narrower than its block, with a ragged edge where none was needed. + * do not fit falling to the next. Where that leaves a widow — a last line under a third of the + * block — the same number of lines is broken again as full as they can be with no widow, so the + * block keeps its full measure and only the lines near the end give up room. */ export function filledLines(text: string, block: number, fontSize: number, measure: TitleMeasure): string[] { const words = text.split(/\s+/).filter(Boolean); @@ -68,14 +81,14 @@ export function filledLines(text: string, block: number, fontSize: number, measu } } if (line) lines.push(line); - if (lines.length >= 2 && measure(lines[lines.length - 1], fontSize) < block * WIDOW_SHARE) { - const tail = balancedLines(`${lines[lines.length - 2]} ${lines[lines.length - 1]}`, 2, fontSize, measure); - lines.splice(lines.length - 2, 2, ...tail); + const shortest = block * WIDOW_SHARE; + if (lines.length >= 2 && measure(lines[lines.length - 1], fontSize) < shortest) { + return fullestLines(text, lines.length, block, shortest, fontSize, measure) ?? lines; } return lines; } -/** A last line shorter than this share of the block is a widow, and the last two lines are evened out. */ +/** A last line shorter than this share of the block is a widow. */ const WIDOW_SHARE = 1 / 3; /** The width inside the canvas the caller asked for, once the theme's padding is kept on both sides. */ @@ -93,7 +106,7 @@ export function plotHeightAfter(height: number, px: number): number { /** * Fit a headline that runs wider than its block: set down a size where that brings it onto one line; - * else broken, each line filled to the block (a widow evened out), at its own size — shrinking it and + * else broken, each line filled to the block (no widow), at its own size — shrinking it and * breaking it too pays twice — unless a size down saves a line. The extra lines' height comes out of * the plot. Undefined leaves it. */ @@ -113,7 +126,7 @@ export function fitHeadlineText( } /** - * Break a deck that runs wider than its block, each line filled to the block (a widow evened out); + * Break a deck that runs wider than its block, each line filled to the block (no widow); * it is never set smaller. The extra lines' height comes out of the plot. Undefined leaves it. */ export function fitDeckText( diff --git a/packages/flint-js/src/core/title-plan.ts b/packages/flint-js/src/core/title-plan.ts index 0d85ae66..fed170d1 100644 --- a/packages/flint-js/src/core/title-plan.ts +++ b/packages/flint-js/src/core/title-plan.ts @@ -48,6 +48,12 @@ export interface TitlePlanInputs { * it may run over them. Rules and the source close only the chart block, and do not. */ keysBeside?: number; + /** + * Where set, the title spans the drawing rather than the canvas, overhanging it by at most + * `overhang` (a ratio): never narrower than `floor` of the canvas nor `minWidth` px, never wider + * than the canvas unless the drawing is. + */ + wrap?: { floor: number; minWidth: number; overhang: number }; } /** @@ -148,7 +154,12 @@ export function chartBlock(inputs: TitlePlanInputs, toCanvas = true): number | u const field = structure.x?.derived ? undefined : structure.x?.fields[0]; const bands = layout.xNominalCount > 0 && field ? new Set(rows.map((row) => row?.[field]).filter((v) => v != null)).size : 0; const plotWidth = Math.round((inputs.viewsWidth ?? (bands ? layout.xStep * bands : plot.width)) * 1.07); - const block = Math.max(plotWidth + labelGutter(inputs) + (inputs.keysBeside ?? 0), toCanvas ? canvasContentWidth(design.layout) : 0); + const canvas = canvasContentWidth(design.layout); + const drawn = plotWidth + labelGutter(inputs) + (inputs.keysBeside ?? 0); + const wrap = toCanvas && canvas ? inputs.wrap : undefined; + const floor = !toCanvas ? 0 + : wrap ? Math.min(canvas, Math.max(wrap.minWidth, wrap.floor * canvas, drawn * Math.max(1, wrap.overhang))) : canvas; + const block = Math.max(drawn, floor); return block && Number.isFinite(block) ? block : undefined; } diff --git a/packages/flint-js/src/core/type-registry.ts b/packages/flint-js/src/core/type-registry.ts index 56d71e21..6a69f1b2 100644 --- a/packages/flint-js/src/core/type-registry.ts +++ b/packages/flint-js/src/core/type-registry.ts @@ -39,7 +39,15 @@ export type T1Category = | 'ID'; export type DomainShape = 'open' | 'bounded' | 'fixed' | 'cyclic'; -export type AggRole = 'additive' | 'intensive' | 'signed-additive' | 'dimension' | 'identifier'; +/** + * How a type's values combine across rows. + * + * - `additive` / `signed-additive`: parts add up to a total (sum). + * - `intensive`: a rate or level; combined by averaging. + * - `measure`: a measure whose additivity is unknown, so it carries no default aggregation. + * - `dimension` / `identifier`: not aggregated. + */ +export type AggRole = 'additive' | 'intensive' | 'signed-additive' | 'measure' | 'dimension' | 'identifier'; export type DivergingClass = 'none' | 'inherent' | 'conditional'; export type FormatClass = 'currency' | 'percent' | 'unit-suffix' | 'integer' | 'decimal' | 'plain'; @@ -119,7 +127,8 @@ const TYPE_REGISTRY: Record = { // --- Measure: GenericMeasure --- Count: { t0: 'Measure', t1: 'GenericMeasure', visEncodings: ['quantitative'], aggRole: 'additive', domainShape: 'open', diverging: 'none', formatClass: 'integer', zeroBaseline: 'meaningful', zeroPad: 0 }, - Number: { t0: 'Measure', t1: 'GenericMeasure', visEncodings: ['quantitative'], aggRole: 'additive', domainShape: 'open', diverging: 'none', formatClass: 'decimal', zeroBaseline: 'meaningful', zeroPad: 0 }, + // A measure whose values should not be added up (or whose additivity is unknown); use Count, Amount, Quantity or Profit for totals. + Number: { t0: 'Measure', t1: 'GenericMeasure', visEncodings: ['quantitative'], aggRole: 'measure', domainShape: 'open', diverging: 'none', formatClass: 'decimal', zeroBaseline: 'meaningful', zeroPad: 0 }, // --- Discrete --- Rank: { t0: 'Discrete', t1: 'Rank', visEncodings: ['ordinal'], aggRole: 'dimension', domainShape: 'open', diverging: 'none', formatClass: 'integer', zeroBaseline: 'arbitrary', zeroPad: 0.08 }, diff --git a/packages/flint-js/src/core/types.ts b/packages/flint-js/src/core/types.ts index 0af5ee6d..385ab87a 100644 --- a/packages/flint-js/src/core/types.ts +++ b/packages/flint-js/src/core/types.ts @@ -8,7 +8,7 @@ import type { SemanticAnnotation, FormatSpec, DomainConstraint, TickConstraint } import type { ColorDecisionResult } from './color-decisions'; import type { GeometryKind, ThemeGeometry, ThemeSpec } from './theme/types'; import type { ChartInteractionSupport, InteractionSpec } from './interaction-spec'; -import type { ChartUpdateOp, UpdateTarget } from './interaction-contracts'; +import type { ChartUpdate, ChartUpdateOp, UpdateTarget } from './interaction-contracts'; import type { ChartStructure, StructureContext } from './structure'; import type { ViewNode } from './views'; import type { FamilyMeasure } from './text-width'; @@ -560,7 +560,12 @@ export interface LayoutTrace { * inputs. */ /** What a template reads to size its plot in the plan. */ -export type PlotPlanContext = Pick; +export type PlotPlanContext = Pick & { + /** Original user-level encodings, where the plan has them. */ + encodings?: Record; + /** The room the title, keys and axes take round the plot, where the plan measured it (a template that `fillsCanvas`). */ + reserve?: { width: number; height: number }; +}; /** What a template reads to plan its views: the plot the plan sized and the gap it keeps between facet panels. */ export type ViewPlanContext = PlotPlanContext & { @@ -732,6 +737,14 @@ export type ChartPropertyDef = ChartProperty & { * only in the data-aware quick-config bar — without needing a separate flag. */ check?: (ctx: OptionEvalContext) => { applicable: boolean; recommendedValue?: any }; + /** + * Values a discrete property takes beside its options — a map's boundaries, as a file of its + * own — kept as given where this test accepts them. Any other value not among the options is + * dropped for the default, with a warning that quotes `acceptsLabel`. + */ + accepts?: (value: unknown) => boolean; + /** What `accepts` takes, for the warning when a value is neither an option nor that. */ + acceptsLabel?: string; }; /** @@ -1145,6 +1158,16 @@ export interface ChartTemplateDef { */ planPlot?: (context: PlotPlanContext) => { width: number; height: number } | undefined; + /** + * The plot grows to the canvas less its furniture, as a map does, rather than holding its base + * size where nothing presses on it. The plan measures the title, keys and axes on both sides + * and hands `planPlot` that room as `context.reserve`. + */ + fillsCanvas?: boolean; + + /** What the chart's drawing owes a credit for — a map, the boundaries it draws — set at its foot. */ + credit?: (context: PlotPlanContext) => ChartCredit | undefined; + /** * How far this chart type draws past its plot on each side, in px — a radar's spoke labels stand * outside its outer ring — and whether it fills the plot, so a key beside the plot stands clear @@ -1340,7 +1363,8 @@ export interface ChartAssemblyInput { */ source?: string | { text: string; href?: string }; /** - * The house chrome this chart keeps. Unset follows the theme. `false` drops it all; an object + * The house chrome this chart keeps. Unset follows the theme, except on a map (`Map`, + * `Choropleth`), which keeps none unless it asks. `false` drops it all; an object * turns off parts: `header` (rules, tabs, wordmarks and logos above or beside the title), * `footer` (the closing rule and the house's credit beside the source) and `logos` (every * logo, header or footer — a footer credit then shows its words). The source line itself is @@ -1360,14 +1384,22 @@ export interface ChartAssemblyInput { */ baseSize?: { width: number; height: number }; /** - * Hard ceiling on the rendered size in pixels (optional). + * The box the host shows the chart in, in pixels (optional). * - * The final image — a single plot OR an entire facet grid — never exceeds - * this box. The per-dimension growth allowance is derived from the ratio + * The plot — a single plot OR an entire facet grid — never stretches past + * it. The per-dimension growth allowance is derived from the ratio * to `baseSize`: `βx = canvasSize.width / baseSize.width`, * `βy = canvasSize.height / baseSize.height` (each clamped to ≥ 1). + * The title, keys and axes stand in the same box: the canvas fit + * (`options.canvasFit`) lays the chart out to read well in it, then, + * where the drawing still runs past the box, lays it out again for a + * smaller room so the plot gives up the room and the keys, labels and + * title stand inside it (Vega-Lite; a single view, not a composite). + * What it cannot bring within — the plot kept at least half each side, + * no value cut, no label turned — is the host's to scale down into + * the box, never past 70%, where the fit brings the plot down instead. * - * When omitted, the ceiling defaults to `baseSize × options.maxStretch` + * When omitted, the box defaults to `baseSize × options.maxStretch` * (default 1.5×) in each dimension. */ canvasSize?: { width: number; height: number }; @@ -1411,6 +1443,18 @@ export interface ChartAssemblyInput { */ interaction_spec?: InteractionSpec; + /** + * Updates the chart applies once it is drawn — notes, overlays, emphasis, a viewport — the + * same updates a host passes to `mountChart` (`options.updates`) or ``, + * kept with the spec so a copied spec keeps them. A host's own update with the same `id` + * replaces the spec's. + * + * Applied by the interactive runtime only (Vega-Lite). A static output — `assembleVegaLite`'s + * spec, `renderSvg`, the other backends — draws the chart without them, with an `info` + * warning (`updates-not-compiled`). + */ + updates?: readonly ChartUpdate[]; + /** * Options for the assembler — layout tuning, tooltips, etc. * All fields are optional and have sensible defaults. @@ -1456,19 +1500,128 @@ export interface CanvasTreatment { plotSpace?: { width?: number; height?: number }; /** The headline and deck set at this share of their size, never below a legible floor. */ titleScale?: number; + /** + * The axis labels on both axes set at this share of the house's size, never below its floor: names + * wrapped onto two lines then take shorter rows, and the chart enters its box with every name whole. + */ + labelScale?: number; /** Long key names kept to this many px a column, wrapped onto lines before they are cut. */ names?: { keyWidth: number }; + /** + * The keys' text set at this share of the library's size, never below the legible floor: a key + * of long names takes less room beside or above the plot. Read by the non-Vega-Lite backends. + */ + keyScale?: number; /** * The plot laid out at this share of its base size, both ways, so it keeps its shape: what the * box cannot hold comes out of the plot rather than out of every glyph, as a host shrinking the * whole drawing would take it. */ plotScale?: number; + /** + * The canvas the chart is laid out for, in px, smaller than the one the host states by what the + * drawing ran past it: the chart is planned again for this room so its keys, labels and title + * stand inside the stated canvas (see `canvasSize`). `keys` holds the keys at the edge they stood + * at, where the fit set no edge of its own, so a smaller plot does not send them to another. + */ + contain?: { width: number; height: number; keys?: 'side' | 'top' | 'bottom' }; +} + +/** A credit a chart's drawing owes, drawn at the foot of the chart: words, a link, and a note shown on hover. */ +export interface ChartCredit { + text: string; + href?: string; + title?: string; +} + +/** + * What a boundary file's feature ids are, so the rows' keys are matched to them: ISO 3166-1 + * numeric (840), alpha-3 (`USA`) or alpha-2 (`US`) country codes, US FIPS codes (6, 06037), or the + * file's own keys, matched exactly as the rows give them (`as-is`). + */ +export type BoundaryIds = 'iso-numeric' | 'iso3' | 'iso2' | 'fips' | 'as-is'; + +/** + * Boundaries a map draws from a file of its own — by `url`, or inline as `values` — rather than a + * set Flint ships (`chartProperties.boundaries` as an object). + * + * Files whose ids are country codes draw as the world map does: framed on the countries the rows + * name, a globe where the projection asks, the rows read as names or codes. Files keyed by FIPS or + * by their own keys are fitted to their shapes. + */ +export interface BoundaryFile { + /** The file: TopoJSON (give `feature`) or a GeoJSON FeatureCollection. One URL, or one per detail: `coarse` for the world, `medium` for a region. */ + url?: string | { coarse?: string; medium?: string }; + /** The shapes inline, so the compiled spec needs no network: a TopoJSON topology (give `feature`) or a GeoJSON FeatureCollection. */ + values?: Record; + /** The TopoJSON object holding the regions. Unset, the file is GeoJSON. */ + feature?: string; + /** What the features' ids are. Default: `fips` on a US map, else `iso-numeric`. */ + ids?: BoundaryIds; + /** Where each feature keeps its id, as a dotted path (`properties.code`). Default: `id`. */ + key?: string; + /** A TopoJSON object of lines drawn dotted over the regions: borders in dispute. */ + disputed?: string; + /** Who drew the boundaries, credited at the map's foot (`Boundaries: …`); or the credit itself, with a link and a note on hover. */ + attribution?: string | ChartCredit; } +/** + * The boundaries a map draws (`chartProperties.boundaries`): a set Flint ships, by name, or a file + * of the chart's own. Unset, a world map draws `world-bank` and a US map the US Census Bureau's. + * + * - `'world-bank'`: World Bank Official Boundaries (CC BY 4.0), areas of non-determined legal + * status as regions of their own, the borders they share dotted, credited at the map's foot. + * - `'natural-earth'`: Natural Earth's de facto boundaries at 1:110m (public domain). + * + * A named set compiles to its URL on Flint's site (`https://microsoft.github.io/flint-chart/geo/v1/…`, + * a version that never changes once published). Flint's renderers (`mountChart`, ``, + * `renderSvg`) serve those URLs from copies bundled in the package; `inlineBoundaries` from + * `flint-chart/geo` writes them into a compiled spec for a renderer with no network. Flint takes no + * position on disputed boundaries: a chart whose audience needs others gives its own file. + */ +export type Boundaries = 'world-bank' | 'natural-earth' | BoundaryFile; + export interface AssembleOptions { /** Whether to add tooltips to the chart (default: false) */ addTooltips?: boolean; + /** + * Notes the chart is drawn with from the start: each names its mark by the fields of the row the + * mark stands for (`key`) and gives the caption's text. A noted mark at the top of a vertical + * measure axis — the tallest bar, the highest point — gets room over it for its caption: the + * axis runs on just far enough for the caption at its nearest seat, ending at a fine round step, + * using at most a third of the axis. Bars keep their proportions; an axis with a + * stated domain is left as it is. Set by the interactive Vega-Lite renderer from the first + * `annotate-text` updates; a note added later is placed in the room the chart has. + */ + notes?: readonly { key: Record; text: string }[]; + /** + * Regions the chart is drawn with from the start, as `annotate-region` sets them. A captioned + * stretch of x whose marks rise too near the plot's top for its caption to stand clear over them + * gets room as a note does: the measure axis runs on past the stretch's tallest mark, to a fine + * round step, within a third of the axis. A stretch with room above or below its marks, or a + * caption placed elsewhere, takes none. Set by the interactive Vega-Lite renderer from the first + * updates. + */ + regions?: readonly { x?: readonly unknown[]; y?: readonly unknown[]; text?: string; placement?: string }[]; + /** + * Measure values the chart's updates mark across the plot (a `set-overlay` reference rule on y, a + * band of y): the measure axis reaches them, so a line the reader asked for is drawn in the plot + * rather than cut off past its end. Set by the interactive Vega-Lite renderer from the first updates. + */ + references?: readonly number[]; + /** + * Enclosures the chart is drawn with from the start, as `annotate-enclosure` sets them: where a + * dot they enclose sits at the edge of a continuous axis, the axis is padded by the px the outline + * needs, so it is drawn whole. Set by the interactive Vega-Lite renderer from the first updates. + */ + enclosures?: readonly { targets: readonly unknown[] }[]; + /** + * The host page's background, as a CSS colour. A chart with no theme draws on it, and so does a + * theme whose surface defers to the host (`ink.surface.source: 'host'`); a theme with its own + * canvas keeps it. + */ + background?: string; /** * Set by the interactive renderer when a viewport will change the rows in view: * value labels are built for any window that could print them, and this signal @@ -1793,6 +1946,25 @@ export interface AssembleOptions { */ bandBalance?: boolean; + /** + * Whether an x axis of few bands fills at least a share of the room the canvas leaves its plot + * (default false): the bands thicken past the sparse-fit ceiling until the plot spans `share` of + * that room (0.85), a band growing to at most `barCap` px where it holds bars (200) or + * `pointCap` px where it holds points (360). One view, y not banded. + */ + sparseFill?: boolean | { share?: number; barCap?: number; pointCap?: number }; + + /** + * Whether a themed title wraps to the drawing rather than to the canvas (default false): its block + * is the plot with what stands beside it, which the title may overhang by `overhang` (1.15×), + * never narrower than `floor` of the canvas (0.6) nor `minWidth` px (320), never wider than the + * canvas unless the drawing is. + */ + titleWrap?: boolean | { floor?: number; minWidth?: number; overhang?: number }; + + /** @internal Whether the plot's marks are filled bands (bars, boxes) rather than points, for the sparse fill's cap. */ + sparseFillBars?: boolean; + /** The centre of that range, as width over height: unset, the base's. */ targetAspect?: number; diff --git a/packages/flint-js/src/docs/design-semantics.md b/packages/flint-js/src/docs/design-semantics.md index d6b80637..0c9d9777 100644 --- a/packages/flint-js/src/docs/design-semantics.md +++ b/packages/flint-js/src/docs/design-semantics.md @@ -347,7 +347,7 @@ interface TypeRegistryEntry { // Orthogonal dimensions (these drive viz properties directly) visEncodings: VisCategory[]; // preference-ordered, e.g., ['quantitative', 'ordinal'] - aggRole: AggRole; // 'additive' | 'intensive' | 'signed-additive' | 'dimension' | 'identifier' + aggRole: AggRole; // 'additive' | 'intensive' | 'signed-additive' | 'measure' | 'dimension' | 'identifier' domainShape: DomainShape; // 'open' | 'bounded' | 'fixed' | 'cyclic' diverging: DivergingClass; // 'none' | 'conditional' | 'inherent' formatClass: FormatClass; // 'currency' | 'percent' | 'signed-percent' | 'unit-suffix' | 'date' | 'time' | 'integer' | 'plain' @@ -1195,6 +1195,7 @@ The compiler may provide built-in parsing utilities internally, but that's an im | **Additive measures** | Count, Amount, Revenue, Cost, Quantity, Duration | `sum` | These represent totals — summing is natural | | **Intensive measures** | Percentage, PercentageChange, Temperature, Score, Rating, Price, Correlation, Sentiment | `average` | These represent rates/conditions — averaging is natural | | **Signed additive** | Profit | `sum` | Additive but can be negative; summing preserves sign semantics | +| **Generic measure** | Number | — (none) | A measure whose values should not be added up (or whose additivity is unknown); totals are Count, Amount, Quantity or Profit. A chart that must combine its rows uses the encoding's `aggregate`, else the mean | | **Discrete numeric** | Rank, Index, ID | — (none) | Aggregation is meaningless | | **Temporal** | DateTime, Date, Year, etc. | — (none) | Not aggregable | | **Categorical** | Name, Status, Category, etc. | — (none) | Not aggregable | @@ -1278,6 +1279,7 @@ Tick constraints combine type-intrinsic rules with annotation-provided domain: | Count, Amount, Revenue, Cost, Quantity | `'sum'` | Additive | Parts sum to whole | | Percentage | `'normalize'` | Normalize | Show proportion breakdown | | Temperature, Score, Rating, PercentageChange, Correlation, Sentiment | `false` | — | Stacking rates/conditions is meaningless | +| Number | `false` | — | Additivity unknown | | Rank, Index | `false` | — | Not aggregable | | Duration, Profit | `'sum'` | Additive | Duration is additive; Profit sums to net | diff --git a/packages/flint-js/src/echarts/assemble.ts b/packages/flint-js/src/echarts/assemble.ts index 74d1ed21..de8b5ecd 100644 --- a/packages/flint-js/src/echarts/assemble.ts +++ b/packages/flint-js/src/echarts/assemble.ts @@ -50,6 +50,7 @@ * This module has NO React, Redux, or UI framework dependencies. */ +import { noteSpecUpdates } from '../core/spec-updates'; import { authoredColorScale, withEncodingColorAnnotations } from '../core/color-controls'; import { applyAuthoredColorScaleEC } from './color-controls'; import { @@ -68,11 +69,15 @@ import { ecGetTemplateDef } from './templates'; import { resolveChannelSemantics, convertTemporalData, repairEncodingSorts } from '../core/resolve-semantics'; import { toTypeString, type SemanticAnnotation } from '../core/field-semantics'; import { filterOverflow } from '../core/filter-overflow'; -import { computeLayout, computeChannelBudgets, deriveStretchCaps, resolveBaseSize, resolveFacetColumnsOption } from '../core/compute-layout'; +import { computeLayout, computeChannelBudgets, deriveStretchCaps, planBandLabels, resolveBaseSize, resolveFacetColumnsOption } from '../core/compute-layout'; +import { xLabelOverflow } from '../core/plan'; +import { tableTextMeasurer } from '../core/text-width'; +import { BACKEND_MIN_LABEL_SIZE, canvasFitSummary, fitBox, judgeBackendCanvas, refitCanvas, withTreatment } from '../core/backend-frame'; +import { ecFitFrame } from './frame'; import { ecApplyLayoutToSpec, ecApplyTooltips } from './instantiate-spec'; import { ecCombineFacetPanels } from './facet'; import { DEFAULT_COLORS } from './templates/utils'; -import { inferVisCategory, computeZeroDecision } from '../core/semantic-types'; +import { inferVisCategory, computeZeroDecision, zeroMarkType } from '../core/semantic-types'; import { decideColorMaps } from '../core/color-decisions'; import { getPaletteForScheme } from './colormap'; import { normalizeStaticSeries } from '../core/static-series'; @@ -205,7 +210,7 @@ export function assembleECharts(input: ChartAssemblyInput): any { ); // Finalize zero-baseline (requires template mark knowledge) - const effectiveMarkType = templateMarkType || 'point'; + const effectiveMarkType = zeroMarkType(chartTemplate.chart, templateMarkType); for (const [channel, cs] of Object.entries(channelSemantics)) { if ((channel === 'x' || channel === 'y') && cs.type === 'quantitative') { const numericValues = data @@ -346,6 +351,19 @@ export function assembleECharts(input: ChartAssemblyInput): any { colorDecisions, }; + // Names along a banded axis are wrapped, turned, thinned or cut as the layout decides them for + // every backend, measured in ECharts' type, before the template sizes its bands. + const labelsBefore = { x: JSON.stringify(layoutResult.xLabel), y: JSON.stringify(layoutResult.yLabel) }; + planBandLabels(instantiateContext, { + measure: (fontSize) => tableTextMeasurer(fontSize, 'sans-serif', 'normal', 'normal'), + minFontSize: BACKEND_MIN_LABEL_SIZE, + ...xLabelOverflow(undefined, chartProperties, channelSemantics), + }); + const plannedLabels = { + x: JSON.stringify(layoutResult.xLabel) !== labelsBefore.x, + y: JSON.stringify(layoutResult.yLabel) !== labelsBefore.y, + }; + // --- Detect faceting (column / row channels) --- const colField = channelSemantics.column?.field; @@ -545,7 +563,26 @@ export function assembleECharts(input: ChartAssemblyInput): any { // The author's colour controls win over every default. const authoredColor = authoredColorScale(input.chart_spec.encodings as Record); - if (authoredColor) applyAuthoredColorScaleEC(ecOption, authoredColor); + if (authoredColor) { + // A diverging field's stepped classes break at its pivot, as the heatmap centres its ramp there. + const colorSemantics = Object.values(channelSemantics).find((cs) => cs?.field === authoredColor.field && cs.colorScheme); + const pivot = colorSemantics?.colorScheme?.type === 'diverging' ? colorSemantics.colorScheme.domainMid ?? 0 : undefined; + applyAuthoredColorScaleEC(ecOption, authoredColor, values, pivot, colorSemantics?.colorScheme?.neutral); + } + + // Names are printed as the reader sees them before the frame measures them. + applyFieldDisplayNames(ecOption, input.field_display_names); + + // The frame: title broken over its block, axis gutters and names measured, the key placed. + const frame = ecFitFrame(ecOption, instantiateContext, { title: input.chart_spec.title, subtitle: input.chart_spec.subtitle }, plannedLabels, + fitBox(baseSize, sizeCeiling, options.maxStretch).width); + // The canvas fit: where the host would shrink the drawing past legibility to enter its box, the + // plot is laid out smaller once instead, as the plan does for Vega-Lite. + const box = fitBox(baseSize, sizeCeiling, options.maxStretch); + const judged = judgeBackendCanvas({ plot: frame.plot, designed: frame.designed, parts: frame.parts, padding: 0, box, base: baseSize }); + const refit = refitCanvas(judged, options, (treatment) => assembleECharts(withTreatment(input, treatment, box))); + if (refit) return refit; + ecOption._canvasFit = canvasFitSummary(judged.estimate, box, options.canvasTreatment); // Attach metadata if (warnings.length > 0) { @@ -572,9 +609,7 @@ export function assembleECharts(input: ChartAssemblyInput): any { // Clean internal-only props delete ecOption._legendWidth; - applyFieldDisplayNames(ecOption, input.field_display_names); - - return ecOption; + return noteSpecUpdates(ecOption, input); } /** Inspect the ECharts legacy (composed) view transformation surface for an input. */ diff --git a/packages/flint-js/src/echarts/color-controls.ts b/packages/flint-js/src/echarts/color-controls.ts index cb942a92..90b97320 100644 --- a/packages/flint-js/src/echarts/color-controls.ts +++ b/packages/flint-js/src/echarts/color-controls.ts @@ -1,12 +1,18 @@ -import { resampleStops, type AuthoredColorScale } from '../core/color-controls'; +import { classColors, resampleStops, roundBinEdges, roundColorClasses, type AuthoredColorScale, type NeutralBand } from '../core/color-controls'; +import { exactFormat, printFormatted } from '../core/sample-format'; import { getPaletteForScheme } from './colormap'; /** * The author's colour controls, laid over the visual maps the template and defaults chose: they win. - * A scheme name ECharts has no palette for leaves the palette as chosen; stops always apply. + * A scheme name ECharts has no palette for leaves the palette as chosen; stops always apply. Bins + * over the data step at round values ({@link roundColorClasses}), breaking at a diverging field's + * `pivot`, or centring a `neutral` class on it; over a domain the author stated, at round edges inside it. */ -export function applyAuthoredColorScaleEC(option: any, ctl: AuthoredColorScale): void { +export function applyAuthoredColorScaleEC( + option: any, ctl: AuthoredColorScale, rows: readonly any[] = [], pivot?: number, neutral?: NeutralBand, +): void { const maps = Array.isArray(option?.visualMap) ? option.visualMap : option?.visualMap ? [option.visualMap] : []; + const values = rows.map((row) => row?.[ctl.field]).filter((value): value is number => typeof value === 'number' && Number.isFinite(value)); for (const vm of maps) { const current = vm.inRange?.color; if (!Array.isArray(current)) continue; @@ -15,9 +21,33 @@ export function applyAuthoredColorScaleEC(option: any, ctl: AuthoredColorScale): ?? current; if (ctl.bins !== undefined && ctl.bins > 0) { vm.type = 'piecewise'; - vm.splitNumber = ctl.bins; delete vm.calculable; + const classes = ctl.domain ? undefined : roundColorClasses(values, ctl.bins, pivot, { exact: true, neutral }); + if (classes) { + const ramp = ctl.reverse ? [...colors].reverse() : colors; + const inks = classColors(ramp, classes); + delete vm.splitNumber; + if (classes.lo !== undefined && classes.hi !== undefined) { + vm.pieces = classPieces(classes.breaks, classes.lo, classes.hi, inks); + vm.min = classes.lo; + vm.max = classes.hi; + } else vm.pieces = binPieces(classes.breaks, inks); + vm.inRange = { ...vm.inRange, color: inks }; + continue; + } colors = resampleStops(colors, ctl.bins); + // Bins edged at round values, the outer two open, rather than the extent cut into equal parts. + const lo = Number(ctl.domain?.[0] ?? vm.min); + const hi = Number(ctl.domain?.[1] ?? vm.max); + const edges = roundBinEdges(lo, hi, ctl.bins); + if (edges) { + delete vm.splitNumber; + vm.pieces = binPieces(edges, ctl.reverse ? [...colors].reverse() : colors); + vm.inRange = { ...vm.inRange, color: ctl.reverse ? [...colors].reverse() : colors }; + if (ctl.domain) { vm.min = ctl.domain[0]; vm.max = ctl.domain[1]; } + continue; + } + vm.splitNumber = ctl.bins; } else if (ctl.bins === 0 && vm.type === 'piecewise') { vm.type = 'continuous'; delete vm.splitNumber; @@ -30,3 +60,28 @@ export function applyAuthoredColorScaleEC(option: any, ctl: AuthoredColorScale): } } } + +const fmt = (value: number): string => value.toLocaleString('en-US').replace('-', '\u2212'); + +/** ECharts pieces for bins edged at `edges`, the outer two open, each with its colour and a label in round numbers. */ +function binPieces(edges: number[], colors: string[]): any[] { + const pieces: any[] = [{ lt: edges[0], label: `< ${fmt(edges[0])}`, color: colors[0] }]; + for (let i = 1; i < edges.length; i++) { + pieces.push({ gte: edges[i - 1], lt: edges[i], label: `${fmt(edges[i - 1])} \u2013 ${fmt(edges[i])}`, color: colors[i] }); + } + pieces.push({ gte: edges[edges.length - 1], label: `\u2265 ${fmt(edges[edges.length - 1])}`, color: colors[edges.length] }); + return pieces; +} + +/** ECharts pieces for classes closed at `lo` and `hi` with `breaks` between, each labelled with its bounds as they are. */ +function classPieces(breaks: number[], lo: number, hi: number, colors: string[]): any[] { + const edges = [lo, ...breaks, hi]; + const exact = exactFormat(edges); + const print = (value: number) => printFormatted(value, exact).replace('-', '\u2212'); + return colors.map((color, i) => ({ + gte: edges[i], + ...(i === colors.length - 1 ? { lte: edges[i + 1] } : { lt: edges[i + 1] }), + label: `${print(edges[i])} \u2013 ${print(edges[i + 1])}`, + color, + })); +} diff --git a/packages/flint-js/src/echarts/frame.ts b/packages/flint-js/src/echarts/frame.ts new file mode 100644 index 00000000..3827e951 --- /dev/null +++ b/packages/flint-js/src/echarts/frame.ts @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The frame around an ECharts chart: its title block, the room its axes' labels and names take, and + * where its key stands, measured the way the layout measures Vega-Lite's — but drawn in ECharts' own + * idiom: the title centred over the canvas in ECharts' type, names wrapped with `\n`, a key that will + * not fit beside the plot moved to the foot, where ECharts sets its legend by default. + * + * Runs after the template and `ecApplyLayoutToSpec`, on a finished option. The plot keeps the size the + * layout gave it; what is around it is measured, and the canvas (`_width`, `_height`) is the plot plus + * that. A headline or deck that breaks takes its extra lines out of a continuous plot's height, as the + * plan takes them in Vega-Lite. + */ + +import type { InstantiateContext } from '../core/types'; +import type { LabelSizingDecision } from '../core/decisions'; +import type { ReservePart } from '../core/furniture-reserve'; +import { tableTextMeasurer } from '../core/text-width'; +import { fitAxisTitle } from '../core/axis-title-fit'; +import { planKeyLayout, type KeyToLayout } from '../core/legend-layout'; +import { plotHeightAfter } from '../core/title-fit'; +import { denseLineWidth, linesPerPanel } from '../core/line-density'; +import { EC_LEGEND_TITLE_ID, EC_SIZE_KEY_ID } from './graphic-ids'; +import { keyBlock, keyPlanStyle } from '../core/backend-profile'; +import { ECHARTS_FONT, ecKeyGeometry } from './profile'; +import { + cutToWidth, onNiceTick, planTitleBlock, treatedKeyEdge, treatedKeyFontSize, treatedKeySide, valueTickLabels, widestLine, type BackendTextStyle, type TitleBlock, +} from '../core/backend-frame'; + +const FONT = ECHARTS_FONT; + +/** ECharts' own title: centred 15 px from the top, 5 px padding, an 18 px bold headline over a 12 px deck 10 px below it. */ +export const EC_TITLE = { + top: 15, + padding: 5, + gap: 10, + headline: { fontSize: 18, fontWeight: 'bold', font: FONT, lineHeight: 1.25 } as BackendTextStyle, + deck: { fontSize: 12, fontWeight: 'normal', font: FONT, lineHeight: 1.4 } as BackendTextStyle, +}; + +/** Room kept at the canvas edge, as the layout pass keeps it (see `ecApplyLayoutToSpec`). */ +const CANVAS_BUFFER = 16; +/** ECharts' gap between the axis line and its labels (`axisLabel.margin`). */ +const LABEL_MARGIN = 8; +/** The gap between an axis's labels and its name. */ +const NAME_GAP = 10; +/** The gap between the plot and a key beside it. */ +const KEY_GAP = 12; +/** The gap between the title block and what stands below it. */ +const TITLE_GAP = 8; +/** The room a legend in one row at the canvas's foot takes, as the layout pass reserves it. */ +const FOOT_LEGEND = 30; +/** The gap between what stands at the canvas's foot (keys, a ramp) and the x name above it. */ +const FOOT_GAP = 8; +/** The room over the plot's top edge for the top tick label's overhang. */ +const TOP_OVERHANG = 12; +/** ECharts' line width, which a chart draws where it sets none. */ +const EC_LINE_WIDTH = 2; + +/** What the frame measured, for the canvas fit. */ +export { EC_LEGEND_TITLE_ID }; + +export interface ECFrame { + plot: { width: number; height: number }; + designed: { width: number; height: number }; + parts: Partial>; + title?: TitleBlock; +} + +const measure = (fontSize: number, weight: string | number = 'normal') => tableTextMeasurer(fontSize, FONT, weight, 'normal'); + +const one = (value: any) => (Array.isArray(value) ? (value.length === 1 ? value[0] : undefined) : value); + +/** The option's one grid with one x and one y axis, where it has exactly that. */ +function singleGrid(option: any): { grid: any; xAxis: any; yAxis: any } | undefined { + const grid = one(option.grid); + const xAxis = one(option.xAxis); + const yAxis = one(option.yAxis); + if (!grid || !xAxis || !yAxis || typeof grid.left !== 'number' || typeof grid.top !== 'number') return undefined; + if (!(Number(option._width) > 0) || !(Number(option._height) > 0)) return undefined; + return { grid, xAxis, yAxis }; +} + +/** Each category's text as the axis prints it, from the layout's decision: its lines, cut at the limit. */ +function bandTexts(axis: any, sizing: LabelSizingDecision): Map | undefined { + if (axis?.type !== 'category' || !Array.isArray(axis.data)) return undefined; + const values: string[] = axis.data.map((d: any) => String(d?.value ?? d)); + const fontSize = axis.axisLabel?.fontSize ?? sizing.fontSize ?? 12; + const widthOf = measure(fontSize); + const lines = new Map((sizing.labelValues ?? []).map((value, index) => [value, sizing.labelLines?.[index]])); + const limit = sizing.labelLimit > 0 && sizing.labelForm !== 'calendar' ? sizing.labelLimit : undefined; + return new Map(values.map((value) => [value, (lines.get(value) ?? [value]).map((line) => cutToWidth(line, limit, widthOf))])); +} + +/** + * Write the layout's band-label decision onto a category axis in ECharts' terms: the names on their + * lines (`\n`), turned (`rotate`), cut, every one shown (`interval: 0`) or only those the layout keeps. + */ +function realizeBandLabels(axis: any, channel: 'x' | 'y', sizing: LabelSizingDecision): void { + const texts = bandTexts(axis, sizing); + if (!texts) return; + const label = (axis.axisLabel ??= {}); + if (sizing.fontSize) label.fontSize = sizing.fontSize; + const fontSize = label.fontSize ?? 12; + const byValue = new Map([...texts].map(([value, lines]) => [value, lines.join('\n')])); + if ([...byValue].some(([value, text]) => text !== value)) label.formatter = (value: unknown) => byValue.get(String(value)) ?? String(value); + // The layout pass's own guesses (calendar names where crowded, a cut by characters) give way to the plan. + else if (label.formatter?._flintCalendar) delete label.formatter; + if ([...texts.values()].some((lines) => lines.length > 1)) label.lineHeight = sizing.labelLineHeight ?? Math.ceil(fontSize * 1.2); + if (channel === 'x') { + label.rotate = sizing.labelAngle ? -sizing.labelAngle : 0; + const shown = sizing.overflow?.step === 'skip' && sizing.overflow.shown ? new Set(sizing.overflow.shown) : undefined; + label.interval = shown ? (_index: number, value: unknown) => shown.has(String(value)) : 0; + } else { + label.interval = 0; + } +} + +/** The numbers a value axis spans, from what its series draw: stacked series summed. */ +function seriesExtent(option: any, valueChannel: 'x' | 'y'): [number, number] | undefined { + const index = valueChannel === 'y' ? 1 : 0; + const stacks = new Map(); + let lo = Infinity; + let hi = -Infinity; + const read = (item: any): number | undefined => { + const raw = item && typeof item === 'object' && !Array.isArray(item) ? item.value : item; + const value = Array.isArray(raw) ? raw[index] : raw; + return typeof value === 'number' && Number.isFinite(value) ? value : undefined; + }; + for (const series of option.series ?? []) { + if (!Array.isArray(series?.data)) continue; + const stack = series.stack != null ? String(series.stack) : undefined; + series.data.forEach((item: any, i: number) => { + const value = read(item); + if (value === undefined) return; + if (stack) { + const sums = stacks.get(stack) ?? []; + sums[i] = (sums[i] ?? 0) + value; + stacks.set(stack, sums); + } + lo = Math.min(lo, value); + hi = Math.max(hi, value); + }); + } + for (const sums of stacks.values()) for (const sum of sums) if (sum !== undefined) { lo = Math.min(lo, sum); hi = Math.max(hi, sum); } + return Number.isFinite(lo) && Number.isFinite(hi) ? [lo, hi] : undefined; +} + +/** The labels an axis prints, as lines, for measuring: names as the axis sets them, numbers as its ticks will. */ +function printedLabels(option: any, axis: any, channel: 'x' | 'y'): string[][] { + if (axis?.axisLabel?.show === false) return []; + const formatter = axis.axisLabel?.formatter; + const format = (value: unknown): string => { + if (typeof formatter === 'function') { + try { return String(formatter(value, 0)); } catch { return String(value); } + } + if (typeof formatter === 'string') return formatter.replace('{value}', String(value)); + return typeof value === 'number' ? value.toLocaleString('en-US') : String(value); + }; + if (axis.type === 'category' && Array.isArray(axis.data)) { + return axis.data.map((d: any) => format(d?.value ?? d).split('\n')); + } + if (axis.type === 'value' || axis.type === 'log' || axis.type == null) { + const extent = seriesExtent(option, channel); + if (!extent) return []; + const min = typeof axis.min === 'number' ? axis.min : axis.scale ? extent[0] : Math.min(0, extent[0]); + const max = typeof axis.max === 'number' ? axis.max : axis.scale ? extent[1] : Math.max(0, extent[1]); + return valueTickLabels([min, max], 5, (value) => format(value)).map((text) => text.split('\n')); + } + // A time axis prints a date or a year; measured as a short date. + return [['Sep 2024']]; +} + +/** How deep or wide an axis's labels run away from the axis line, in px. */ +function labelRun(option: any, axis: any, channel: 'x' | 'y'): number { + const labels = printedLabels(option, axis, channel); + if (!labels.length) return 0; + const fontSize = axis.axisLabel?.fontSize ?? 12; + const widest = widestLine(labels, measure(fontSize)); + const lineHeight = axis.axisLabel?.lineHeight ?? Math.ceil(fontSize * 1.2); + const lines = Math.max(1, ...labels.map((l) => l.length)); + const angle = Math.abs(Number(axis.axisLabel?.rotate) || 0) * Math.PI / 180; + if (channel === 'y') return angle ? Math.ceil(Math.cos(angle) * widest + Math.sin(angle) * fontSize) : Math.ceil(widest); + return angle ? Math.ceil(Math.sin(angle) * widest + Math.cos(angle) * lines * lineHeight) : lines * lineHeight; +} + +/** + * A value axis whose ends the layout padded off the round ticks (a scatter's domain) prints its ends + * as they fall — `11.25`, `41.4` — crowding the round ticks beside them; those ends go unlabelled, + * as Vega-Lite leaves them. + */ +function hidePaddedEnds(axis: any): void { + if (axis?.type !== 'value' || typeof axis.min !== 'number' || typeof axis.max !== 'number') return; + const domain: [number, number] = [axis.min, axis.max]; + const label = (axis.axisLabel ??= {}); + if (!onNiceTick(axis.min, domain) && label.showMinLabel == null) label.showMinLabel = false; + if (!onNiceTick(axis.max, domain) && label.showMaxLabel == null) label.showMaxLabel = false; +} + +/** + * A time axis the template stood on end stands flat where its labels fit across the plot, as + * Vega-Lite sets them: a label that fits a sixth of the plot reads flat, and ECharts leaves out any + * tick label that would collide with its neighbour (`hideOverlap`). + */ +function flattenTimeLabels(axis: any, plotWidth: number): void { + if (axis?.type !== 'time' || Math.abs(Number(axis.axisLabel?.rotate) || 0) !== 90) return; + const formatter = axis.axisLabel?.formatter; + const sampleAt = Date.UTC(2024, 8, 28, 12, 0, 0); + let sample = 'Sep 2024'; + if (typeof formatter === 'function') { + try { sample = String(formatter(sampleAt, 0)); } catch { /* measured as a month */ } + } else if (typeof formatter === 'string') { + const parts: Record = { yyyy: '2024', yy: '24', MMMM: 'September', MMM: 'Sep', MM: '09', M: '9', dd: '28', d: '28', HH: '12', H: '12', hh: '12', mm: '00', ss: '00' }; + sample = formatter.replace(/\{(\w+)\}/g, (_m: string, key: string) => parts[key] ?? key); + } + const fontSize = axis.axisLabel?.fontSize ?? 12; + const widest = Math.max(...sample.split('\n').map(measure(fontSize))); + if (6 * (widest + 12) > plotWidth) return; + // ECharts may set more ticks than that: those that would collide it leaves out, as it does by its own rule. + axis.axisLabel.rotate = 0; + axis.axisLabel.hideOverlap = true; +} + +/** Fit an axis's name to the axis's length, wrapped onto two lines where longer; the height it takes across. */ +function fitAxisName(axis: any, length: number): number { + const name = axis?.name; + if (typeof name !== 'string' || !name.trim()) return 0; + const fontSize = axis.nameTextStyle?.fontSize ?? 12; + const widthOf = measure(fontSize); + const fit = fitAxisTitle(name.replace(/\n/g, ' '), length, widthOf, fontSize); + const lineHeight = Math.ceil(fontSize * 1.2); + if (fit) { + axis.name = fit.lines.map((line) => cutToWidth(line, fit.limit, widthOf)).join('\n'); + axis.nameTextStyle = { ...(axis.nameTextStyle ?? {}), lineHeight }; + } + return (fit?.lines.length ?? name.split('\n').length) * lineHeight; +} + +/** The legend's title, drawn as a graphic beside or above it. */ +function legendTitleGraphic(option: any): any | undefined { + const graphics = Array.isArray(option.graphic) ? option.graphic : option.graphic ? [option.graphic] : []; + return graphics.find((g: any) => g?.id === EC_LEGEND_TITLE_ID); +} + +/** + * Lay the one categorical legend out as the layout lays Vega-Lite's keys ({@link planKeyLayout}): + * beside the plot, its long names wrapped onto lines, or — where it will not stand there — below + * the plot in rows, where ECharts sets its legend by default. Returns the room it takes at each edge. + */ +function placeLegend(option: any, plot: { width: number; height: number }, canvasWidth: number, sideWidth?: number, moveTo?: 'top' | 'bottom'): { right?: number; bottom?: number } | undefined { + const legend = one(option.legend); + if (!legend || option.visualMap || legend.orient !== 'vertical' || legend.right !== CANVAS_BUFFER) return undefined; + const names: string[] = (Array.isArray(legend.data) ? legend.data : (option.series ?? []).map((s: any) => s?.name)) + .map((d: any) => (typeof d === 'string' ? d : d?.name)) + .filter((name: unknown): name is string => typeof name === 'string' && name.length > 0); + if (!names.length) return undefined; + const fontSize = legend.textStyle?.fontSize ?? 12; + const titleGraphic = legendTitleGraphic(option); + const title: string | null = titleGraphic?.style?.text ? String(titleGraphic.style.text) : null; + const geometry = ecKeyGeometry(legend); + const itemWidth = legend.itemWidth ?? 25; + const key: KeyToLayout = { + gradient: false, + labels: names, + count: names.length, + title, + style: { + labelFont: FONT, labelFontSize: fontSize, labelFontWeight: 'normal', labelFontStyle: 'normal', + titleFont: FONT, titleFontSize: titleGraphic?.style?.fontSize ?? fontSize, titleFontWeight: 'bold', titleFontStyle: 'normal', + // ECharts sets a key beside the plot in one column, scrolling past its height. + ...keyPlanStyle(geometry), + titlePadding: 6, + }, + orient: 'right', + edges: ['right', 'bottom'], + fixed: false, + fixedTitle: false, + ...(moveTo ? { moveTo: 'bottom' } : {}), + }; + const laid = planKeyLayout([key], plot, tableTextMeasurer, sideWidth !== undefined ? { sideWidth } : {}).keys[0]; + if (!laid) return undefined; + // Each line held to the width the planner gave it; the last takes what did not fit, cut there. + const cutAt = laid.labelLimit > 0 ? laid.labelLimit : undefined; + const lineWidthOf = measure(fontSize); + const lines = new Map(names.map((name, index) => [name, (laid.labelLines?.[index] ?? [name]).map((line) => cutToWidth(line, cutAt, lineWidthOf))])); + const multiline = [...lines.values()].some((l) => l.length > 1); + const lineHeight = Math.ceil(fontSize * 1.2); + const titleLines = laid.titleLines ?? (title ? [title] : []); + const titleFontSize = key.style.titleFontSize; + const titleHeight = titleLines.length ? titleLines.length * Math.ceil(titleFontSize * 1.2) + 6 : 0; + const formatter = (name: string) => (lines.get(name) ?? [name]).join('\n'); + const textStyle = { ...(legend.textStyle ?? {}), ...(multiline ? { lineHeight } : {}) }; + if (laid.orient === 'bottom' || laid.orient === 'top') { + // At the foot, as ECharts sets its legend by default: names on one line, flowing in rows across + // the canvas; a name wider than the canvas is cut. + const { right: _r, top: _t, formatter: _f, ...rest } = legend; + void _r; void _t; void _f; + const widthOf = measure(fontSize); + const room = canvasWidth - 2 * CANVAS_BUFFER - itemWidth - 5; + const cut = new Map(names.map((name) => [name, cutToWidth(name, room, widthOf)])); + option.legend = { + ...rest, orient: 'horizontal', left: 'center', bottom: CANVAS_BUFFER, textStyle: legend.textStyle ?? {}, + ...([...cut].some(([name, text]) => text !== name) ? { formatter: (name: string) => cut.get(name) ?? name } : {}), + }; + if (titleGraphic) { + const { right: _gr, top: _gt, ...g } = titleGraphic; + void _gr; void _gt; + Object.assign(titleGraphic, { ...g, left: 'center', style: { ...g.style, text: title, textAlign: 'center', width: undefined } }); + delete titleGraphic.right; + delete titleGraphic.top; + } + return { bottom: footRows(option, option.legend, canvasWidth) }; + } + const top = typeof legend.top === 'number' ? legend.top : 0; + option.legend = { + ...legend, + top: titleHeight ? Math.max(top, 4 + titleHeight) : top, + formatter, + textStyle, + ...(laid.height > plot.height + 24 ? { type: 'scroll' } : {}), + }; + // The box ECharts draws: each entry its icon, 5 px, and its widest line; the padding around them. + // The planner's width is a budget, not what is drawn; the plot stands a gap from the box itself. + const widthOf = measure(fontSize); + const padding = geometry.pad.x; + const titleWidthOf = measure(titleFontSize, 'bold'); + const titleWidth = titleLines.length ? Math.max(...titleLines.map(titleWidthOf)) : 0; + const box = keyBlock(geometry, { + entries: names.map((name) => lines.get(name) ?? [name]), fontSize, widthOf, orientation: 'vertical', + ...(titleLines.length ? { title: { lines: titleLines, fontSize: titleFontSize, widthOf: titleWidthOf } } : {}), + }).width; + if (titleGraphic) { + // Pinned by its right edge, as the legend is, so the title starts where the entries do. + const { width: _w, ...style } = titleGraphic.style ?? {}; + void _w; + titleGraphic.style = { ...style, text: titleLines.join('\n'), textAlign: 'left', ...(titleLines.length > 1 ? { lineHeight: Math.ceil(titleFontSize * 1.2) } : {}) }; + titleGraphic.right = CANVAS_BUFFER + Math.max(0, box - padding - Math.ceil(titleWidth)); + } + return { right: box + KEY_GAP }; +} + +/** + * The room a legend set in rows at the canvas's foot takes, measured as ECharts wraps it across the + * canvas, with its title (a graphic) set just above the rows. Returns the height from the canvas's + * foot to the top of the title. + */ +function footRows(option: any, legend: any, canvasWidth: number): number { + const names: string[] = (Array.isArray(legend.data) ? legend.data : (option.series ?? []).map((s: any) => s?.name)) + .map((d: any) => (typeof d === 'string' ? d : d?.name)) + .filter((name: unknown): name is string => typeof name === 'string' && name.length > 0); + if (!names.length) return FOOT_LEGEND; + const fontSize = legend.textStyle?.fontSize ?? 12; + // ECharts flows a horizontal legend in rows across the canvas, each entry its own width. + const rowsHeight = keyBlock(ecKeyGeometry(legend), { + entries: names.map((name) => [String(legend.formatter?.(name) ?? name)]), + fontSize, widthOf: measure(fontSize), orientation: 'horizontal', room: canvasWidth, + }).height; + const bottom = typeof legend.bottom === 'number' ? legend.bottom : 0; + const title = legendTitleGraphic(option); + if (title) { + title.bottom = bottom + rowsHeight + 2; + return bottom + rowsHeight + 2 + Math.ceil((title.style?.fontSize ?? fontSize) * 1.2) + 4; + } + return bottom + rowsHeight + 4; +} + +/** + * Stand the ramps a template sets beside the plot (vertical continuous visual maps, each with its title + * as a graphic) from the plot's top: the title centred over its bar, the bar and its end values under + * it. Titles that would run into one another push the ramp further from the edge. Returns the right + * margin they need so no title reaches into the plot. + */ +function placeSideRamps(option: any, graphics: any[], plotTop: number): number { + const maps = (Array.isArray(option.visualMap) ? option.visualMap : option.visualMap ? [option.visualMap] : []) + .filter((m: any) => m && m.show !== false && m.type !== 'piecewise' && m.orient === 'vertical' + && typeof m.id === 'string' && m.id.startsWith('flint-ramp:') && typeof m.right === 'number') + .sort((a: any, b: any) => a.right - b.right); + let needed = 0; + let leftmost = -Infinity; + for (const map of maps) { + const itemWidth = map.itemWidth ?? 20; + const title = graphics.find((g: any) => g?.id === map.id.replace('flint-ramp:', 'flint-ramp-title:')); + const fontSize = title?.style?.fontSize ?? 11; + const titleWidth = title?.style?.text ? measure(fontSize, 'bold')(String(title.style.text)) : 0; + // The bar's centre stands where the title, centred on it, clears the ramp to its right. + let centre = map.right + itemWidth / 2; + if (titleWidth && centre - titleWidth / 2 < leftmost + 8) { + centre = leftmost + 8 + titleWidth / 2; + map.right = Math.round(centre - itemWidth / 2); + } + const titleRight = Math.max(4, Math.round(centre - titleWidth / 2)); + const titleHeight = titleWidth ? Math.ceil(fontSize * 1.2) + 4 : 0; + if (title) { + title.right = titleRight; + title.top = plotTop; + title.style = { ...title.style, textAlign: 'left' }; + } + map.top = plotTop + titleHeight; + delete map.bottom; + leftmost = Math.max(titleRight + titleWidth, map.right + itemWidth + 6); + needed = Math.max(needed, Math.ceil(leftmost) + KEY_GAP); + } + return needed; +} + +/** + * The room ramps set across the canvas's foot take (a horizontal `visualMap` anchored at the bottom): + * the bar or the row of pieces, the values a calculable bar shows over its handles, and the padding. + * Returns the height from the canvas's foot to the ramp's top; 0 where there is none. + */ +function footRamps(option: any, canvasWidth: number): number { + const maps = Array.isArray(option.visualMap) ? option.visualMap : option.visualMap ? [option.visualMap] : []; + let foot = 0; + for (const map of maps) { + if (!map || map.show === false || map.orient !== 'horizontal' || map.top != null) continue; + const bottom = typeof map.bottom === 'number' ? map.bottom : 0; + const fontSize = map.textStyle?.fontSize ?? 12; + const padding = typeof map.padding === 'number' ? map.padding : 5; + let block: number; + if (map.type === 'piecewise') { + const count = Array.isArray(map.pieces) ? map.pieces.length : Array.isArray(map.categories) ? map.categories.length : map.splitNumber ?? 5; + const labels: string[] = Array.isArray(map.pieces) && map.pieces.every((p: any) => p?.label) + ? map.pieces.map((p: any) => String(p.label)) + : new Array(count).fill(`${Math.round(Number(map.min) || 0)} - ${Math.round(Number(map.max) || 0)}`); + // The pieces flow in rows as a legend's entries do; the map's padding is added below. + block = keyBlock(ecKeyGeometry(map, { itemWidth: 20 }), { + entries: labels.map((label) => [label]), fontSize, widthOf: measure(fontSize), orientation: 'horizontal', room: canvasWidth, + }).height - 2 * padding; + } else { + block = (map.itemWidth ?? 20) + (map.calculable ? Math.ceil(fontSize * 1.2) + 8 : 0); + } + foot = Math.max(foot, bottom + block + 2 * padding); + } + return foot; +} + +/** + * How far below the canvas's top an axis-less chart's content starts, where it is only pies or + * sunbursts placed by centre and radius (their outside labels counted), and keys pinned from the top. + * Undefined where something else stands there, which is moved down by the whole title. + */ +function contentTop(option: any, width: number, height: number): number | undefined { + const px = (value: unknown, of: number): number | undefined => typeof value === 'number' ? value + : typeof value === 'string' && value.endsWith('%') ? (parseFloat(value) / 100) * of + : typeof value === 'string' && value.endsWith('px') ? parseFloat(value) : undefined; + let top = Infinity; + for (const series of option.series ?? []) { + if (series?.type !== 'pie' && series?.type !== 'sunburst') return undefined; + const [, cy] = Array.isArray(series.center) ? series.center : ['50%', '50%']; + const radius = Array.isArray(series.radius) ? series.radius[series.radius.length - 1] : series.radius ?? '75%'; + const y = px(cy, height); + const r = px(radius, Math.min(width, height) / 2); + if (y === undefined || r === undefined) return undefined; + const outside = series.type === 'pie' && series.label?.show !== false && series.label?.position !== 'inside' && series.label?.position !== 'center'; + const labels = outside ? (series.labelLine?.length ?? 15) + 2 * Math.ceil((series.label?.fontSize ?? 12) * 1.2) : 0; + top = Math.min(top, y - r - labels); + } + for (const key of ['legend', 'visualMap', 'graphic', 'polar', 'radar', 'singleAxis', 'calendar', 'parallel', 'geo']) { + const value = option[key]; + for (const component of Array.isArray(value) ? value : value ? [value] : []) { + if (key === 'graphic' || key === 'legend' || key === 'visualMap') { + if (component?.show === false) continue; + if (typeof component?.top === 'number') { top = Math.min(top, component.top); continue; } + if (component?.top == null && component?.bottom != null) continue; + } + return undefined; + } + } + return Number.isFinite(top) ? Math.max(0, Math.floor(top)) : undefined; +} + +/** Move every positioned component down by `by` px, for a title block above them. */ +function shiftDown(option: any, by: number, oldHeight: number, oldWidth: number): void { + if (!(by > 0)) return; + const shift = (component: any) => { + if (!component || typeof component !== 'object') return; + // Percentages are of the canvas, which the title makes taller: held in px of the canvas as it was. + const pct = (value: unknown) => (typeof value === 'string' && value.endsWith('%') ? (parseFloat(value) / 100) * oldHeight : undefined); + if (typeof component.top === 'number') component.top += by; + else if (pct(component.top) !== undefined) component.top = pct(component.top)! + by; + if (pct(component.bottom) !== undefined) component.bottom = pct(component.bottom); + if (Array.isArray(component.center) && component.center.length === 2) { + const [cx, cy] = component.center; + const y = typeof cy === 'string' && cy.endsWith('%') ? (parseFloat(cy) / 100) * oldHeight + : typeof cy === 'string' && cy.endsWith('px') ? parseFloat(cy) + : typeof cy === 'number' ? cy : undefined; + if (y !== undefined) component.center = [cx, y + by]; + // A radius in percent is of the canvas's smaller side, which the title would change. + const r = component.radius; + const toPx = (v: unknown) => (typeof v === 'string' && v.endsWith('%') ? (parseFloat(v) / 100) * Math.min(oldWidth, oldHeight) / 2 : v); + if (Array.isArray(r)) component.radius = r.map(toPx); + else if (r !== undefined) component.radius = toPx(r); + } + }; + for (const key of ['grid', 'legend', 'visualMap', 'graphic', 'polar', 'radar', 'singleAxis', 'calendar', 'parallel', 'series', 'geo', 'matrix']) { + const value = option[key]; + for (const component of Array.isArray(value) ? value : [value]) { + // A series on a grid has no position of its own; a pie, funnel or tree has. + if (key === 'series' && component?.coordinateSystem && component.coordinateSystem !== 'none' && component.type !== 'pie') continue; + shift(component); + } + } +} + +/** Write the title block in ECharts' own title component. */ +function writeTitle(option: any, block: TitleBlock): void { + const existing = typeof option.title === 'object' && !Array.isArray(option.title) ? option.title : {}; + option.title = { + ...existing, + left: 'center', + top: EC_TITLE.top, + itemGap: EC_TITLE.gap, + ...(block.headline ? { + text: block.headline.lines.join('\n'), + textStyle: { ...(existing.textStyle ?? {}), fontSize: block.headline.fontSize, lineHeight: block.headline.lineHeight }, + } : { text: '' }), + ...(block.deck ? { + subtext: block.deck.lines.join('\n'), + subtextStyle: { ...(existing.subtextStyle ?? {}), fontSize: block.deck.fontSize, lineHeight: block.deck.lineHeight }, + } : {}), + }; +} + +/** Thin a chart's lines where many share the plot, from ECharts' 2 px. */ +function thinLines(option: any, context: InstantiateContext, plotHeight: number): void { + const lines = (option.series ?? []).filter((s: any) => s?.type === 'line' && !s._companion); + if (lines.length < 2) return; + const width = denseLineWidth(EC_LINE_WIDTH, Math.max(lines.length, linesPerPanel(context.table, context.channelSemantics)), plotHeight); + if (width === undefined) return; + for (const series of lines) { + if (series.lineStyle?.width != null && series.lineStyle.width !== EC_LINE_WIDTH) continue; + series.lineStyle = { ...(series.lineStyle ?? {}), width }; + } +} + +/** + * Measure and set the frame of a finished option: band labels as the layout decided them, axis + * gutters measured, names fitted, the key placed, the title broken over its block. Returns what it + * measured for the canvas fit. + */ +export function ecFitFrame( + option: any, context: InstantiateContext, text: { title?: string; subtitle?: string }, planned: { x: boolean; y: boolean }, + titleRoom = 0, +): ECFrame { + const { layout } = context; + const single = singleGrid(option); + const parts: Partial> = {}; + if (!single) { + const width = Number(option._width) || context.canvasSize.width; + const height = Number(option._height) || context.canvasSize.height; + const block = planTitleBlock(text, width - 2 * (EC_TITLE.padding + CANVAS_BUFFER), EC_TITLE); + let titleRoom = 0; + if (block) { + titleRoom = EC_TITLE.top + 2 * EC_TITLE.padding + block.height + TITLE_GAP; + // Where the content already stands clear of the top (a pie in its own margin), it moves down + // only by what the title needs past that, so the title sits over it rather than above a gap. + const top = contentTop(option, width, height); + const by = top === undefined ? titleRoom : Math.max(0, titleRoom - top); + shiftDown(option, by, height, width); + writeTitle(option, block); + option._width = width; + option._height = height + by; + parts.title = titleRoom; + } + const plot = { width, height }; + return { plot, designed: plot, parts, ...(block ? { title: block } : {}) }; + } + + const { grid, xAxis, yAxis } = single; + const plot = { + width: Math.max(1, option._width - grid.left - grid.right), + height: Math.max(1, option._height - grid.top - grid.bottom), + }; + const designed = { ...plot }; + if (planned.x) realizeBandLabels(xAxis, 'x', layout.xLabel); + if (planned.y) realizeBandLabels(yAxis, 'y', layout.yLabel); + hidePaddedEnds(xAxis); + hidePaddedEnds(yAxis); + flattenTimeLabels(xAxis, plot.width); + + // Beside the plot: the y labels, then the y name across from them. + const yLeft = yAxis.position !== 'right'; + const yRun = labelRun(option, yAxis, 'y'); + const yName = fitAxisName(yAxis, plot.height); + if (yName) yAxis.nameGap = LABEL_MARGIN + yRun + NAME_GAP; + const yRoom = CANVAS_BUFFER + LABEL_MARGIN + yRun; + const yNameRoom = yName ? NAME_GAP + yName : 0; + if (yLeft) grid.left = Math.max(CANVAS_BUFFER + 24, yRoom + yNameRoom); + + // Below the plot: the x labels, then the x name under them. + const xRun = labelRun(option, xAxis, 'x'); + const xName = fitAxisName(xAxis, plot.width); + if (xName) xAxis.nameGap = LABEL_MARGIN + xRun + NAME_GAP; + const xRoom = CANVAS_BUFFER + LABEL_MARGIN + xRun; + const xNameRoom = xName ? NAME_GAP + xName : 0; + + // The key, beside the plot or at its foot. + // A canvas fit that sets the key's text smaller does so before the key is measured. + const shown = one(option.legend); + if (shown && context.assembleOptions?.canvasTreatment?.keyScale) { + shown.textStyle = { ...(shown.textStyle ?? {}), fontSize: treatedKeyFontSize(shown.textStyle?.fontSize ?? 12, context.assembleOptions) }; + } + const legend = placeLegend(option, plot, plot.width + grid.left + CANVAS_BUFFER + 22, treatedKeySide(context.assembleOptions, ecKeyGeometry(shown ?? {})), treatedKeyEdge(context.assembleOptions)); + if (legend?.right !== undefined) grid.right = CANVAS_BUFFER + legend.right; + else if (legend?.bottom !== undefined) grid.right = Math.min(grid.right, CANVAS_BUFFER + 22); + const footKeys = legend?.bottom ?? 0; + // A key already set at the foot (a colour legend under a ramp, or one a template placed) keeps the room the layout pass gave it. + const footLegend = one(option.legend); + const keptFoot = !legend && footLegend && footLegend.orient === 'horizontal' && footLegend.bottom != null + ? footRows(option, footLegend, plot.width + grid.left + grid.right) : 0; + // A colour ramp at the foot, as ECharts sets a heatmap's, takes its own room under the x name. + const rampFoot = footRamps(option, plot.width + grid.left + grid.right); + const foot = Math.max(footKeys, keptFoot, rampFoot); + grid.bottom = xRoom + xNameRoom + (foot ? Math.max(0, foot + FOOT_GAP - CANVAS_BUFFER) : 0); + + // The title block, over the drawing's width; its broken lines come out of a continuous plot. + // A narrow chart's title may run as wide as its box allows rather than stack into many lines; the + // plot takes the width the title needs, so the drawing grows wider rather than taller. + const width = plot.width + grid.left + grid.right; + const pad = 2 * (EC_TITLE.padding + CANVAS_BUFFER); + const block = planTitleBlock(text, Math.max(width, titleRoom) - pad, EC_TITLE); + if (block && block.width + pad > width) plot.width += Math.ceil(block.width + pad - width); + if (block) { + const room = EC_TITLE.top + 2 * EC_TITLE.padding + block.height + TITLE_GAP; + const continuousY = yAxis.type !== 'category'; + if (continuousY && block.broken > 0) plot.height = plotHeightAfter(plot.height, block.broken); + const by = Math.max(0, room + TOP_OVERHANG - grid.top); + shiftDown(option, by, option._height, option._width); + // A key beside the plot starts under the title, which spans the canvas. + const sideLegend = one(option.legend); + if (legend?.right !== undefined && sideLegend && typeof sideLegend.top === 'number') { + const titleGraphic = legendTitleGraphic(option); + const topmost = typeof titleGraphic?.top === 'number' ? titleGraphic.top : sideLegend.top; + const under = Math.max(0, room - topmost); + sideLegend.top += under; + if (titleGraphic && typeof titleGraphic.top === 'number') titleGraphic.top += under; + } + writeTitle(option, block); + } + + thinLines(option, context, plot.height); + + // A size key the template drew as circles stands beside the plot, from its top. + const graphics = Array.isArray(option.graphic) ? option.graphic : option.graphic ? [option.graphic] : []; + const sizeKey = graphics.find((g: any) => g?.id === EC_SIZE_KEY_ID); + if (sizeKey) sizeKey.top = grid.top; + grid.right = Math.max(grid.right, placeSideRamps(option, graphics, grid.top)); + + option._width = Math.round(plot.width + grid.left + grid.right); + option._height = Math.round(plot.height + grid.top + grid.bottom); + // The plot the frame planned, for tools that compare it with what ECharts draws. + option._planned = { plot: { width: Math.round(plot.width), height: Math.round(plot.height) }, left: grid.left, right: grid.right, top: grid.top, bottom: grid.bottom }; + Object.assign(parts, { + yLabels: yRoom, ...(yNameRoom ? { yTitle: yNameRoom } : {}), + xLabels: xRoom, ...(xNameRoom ? { xTitle: xNameRoom } : {}), + title: grid.top, sideKeys: grid.right, + ...(footKeys || keptFoot ? { stackedKeys: Math.max(footKeys, keptFoot) } : {}), + }); + return { plot, designed, parts, ...(block ? { title: block } : {}) }; +} diff --git a/packages/flint-js/src/echarts/graphic-ids.ts b/packages/flint-js/src/echarts/graphic-ids.ts new file mode 100644 index 00000000..fc536b74 --- /dev/null +++ b/packages/flint-js/src/echarts/graphic-ids.ts @@ -0,0 +1,8 @@ +/** The id the layout pass gives a legend's title, drawn as a graphic: ECharts' legend has no title of its own. */ +export const EC_LEGEND_TITLE_ID = 'flint-legend-title'; +/** The id the size key's graphic group carries, so the frame can stand it beside the plot. */ +export const EC_SIZE_KEY_ID = 'flint-size-key'; +/** The id of a continuous visual map a template draws as a ramp beside the plot (`size`, `color`). */ +export const rampId = (channel: string) => `flint-ramp:${channel}`; +/** The id of that ramp's title, drawn as a graphic: a visual map has no title of its own. */ +export const rampTitleId = (channel: string) => `flint-ramp-title:${channel}`; diff --git a/packages/flint-js/src/echarts/instantiate-spec.ts b/packages/flint-js/src/echarts/instantiate-spec.ts index 99245f49..859f3bd2 100644 --- a/packages/flint-js/src/echarts/instantiate-spec.ts +++ b/packages/flint-js/src/echarts/instantiate-spec.ts @@ -28,6 +28,7 @@ import type { } from '../core/types'; import { computePaddedDomain } from '../core/semantic-types'; import { toTypeString } from '../core/field-semantics'; +import { EC_LEGEND_TITLE_ID } from './graphic-ids'; import { isDateField } from '../core/decisions'; import { crowdedCalendarLabels } from '../core/calendar-labels'; import { ColorDecisionResult } from '../core/color-decisions'; @@ -472,6 +473,7 @@ export function ecApplyLayoutToSpec( }; if (legendTitle != null) { const titleGraphic = { + id: EC_LEGEND_TITLE_ID, type: 'text' as const, bottom: 22, left: 'center', @@ -517,6 +519,7 @@ export function ecApplyLayoutToSpec( }; if (legendTitle != null) { const titleGraphic = { + id: EC_LEGEND_TITLE_ID, type: 'text' as const, right: CANVAS_BUFFER, top: 4, @@ -729,12 +732,14 @@ export function ecApplyLayoutToSpec( if (layout.xLabel.labelLimit && layout.xLabel.labelLimit < 100) { const maxLen = layout.xLabel.labelLimit; - option.xAxis.axisLabel.formatter = (value: string) => { + const formatter = (value: string) => { if (typeof value === 'string' && value.length > maxLen) { return value.substring(0, maxLen) + '…'; } return value; }; + (formatter as any)._flintCalendar = true; + option.xAxis.axisLabel.formatter = formatter; } } @@ -752,12 +757,11 @@ export function ecApplyLayoutToSpec( if (named) { const byValue = new Map(values.map((value, index) => [value, named[index].join('\n')])); const existing = xAxis.axisLabel?.formatter; - xAxis.axisLabel = { - ...xAxis.axisLabel, - formatter: (value: string) => byValue.get(String(value)) - ?? (typeof existing === 'function' ? existing(value) : value), - rotate: 0, - }; + const formatter = (value: string) => byValue.get(String(value)) + ?? (typeof existing === 'function' ? existing(value) : value); + // Marked so a planned band-label decision can set it aside (see `ecFitFrame`). + (formatter as any)._flintCalendar = true; + xAxis.axisLabel = { ...xAxis.axisLabel, formatter, rotate: 0 }; } } } diff --git a/packages/flint-js/src/echarts/profile.ts b/packages/flint-js/src/echarts/profile.ts new file mode 100644 index 00000000..2eff779e --- /dev/null +++ b/packages/flint-js/src/echarts/profile.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** How ECharts (6) sets the furniture the layout plans, from its component defaults. */ + +import type { BackendProfile, KeyGeometry } from '../core/backend-profile'; + +/** The family ECharts' text is measured in where the chart sets none. */ +export const ECHARTS_FONT = 'sans-serif'; + +const lineHeight = 1.2; + +/** ECharts' legend defaults: a 25 × 14 icon, 5 px to its text, 10 px between entries, 5 px padding. */ +export const ECHARTS_PROFILE: BackendProfile = { + id: 'echarts', + font: ECHARTS_FONT, + key: { + lead: 25 + 5, + symbol: 14, + gap: 10, + rowGap: 10, + pad: { x: 5, y: 5 }, + entryHeight: (fontSize, lines) => Math.max(14, lines * Math.ceil(fontSize * lineHeight)), + lineHeight, + wrap: 'flow', + breakAt: 'over', + rowTitle: 'top', + titleGap: 0, + titleRowGap: 6, + sideColumns: 'one', + }, + edge: 16, + tickLabelGap: 8, + axisTitleGap: 10, + labelLineHeight: lineHeight, + labelBoxHeight: lineHeight, + axisPad: 0, +}; + +/** The key geometry a legend (or piecewise visual map) draws with, its own settings over the defaults. */ +export function ecKeyGeometry(component: any, defaults: { itemWidth?: number; itemHeight?: number } = {}): KeyGeometry { + const base = ECHARTS_PROFILE.key; + const itemWidth = component?.itemWidth ?? defaults.itemWidth ?? 25; + const itemHeight = component?.itemHeight ?? defaults.itemHeight ?? 14; + const gap = component?.itemGap ?? base.gap; + const pad = typeof component?.padding === 'number' ? component.padding : base.pad.x; + return { + ...base, + lead: itemWidth + 5, + symbol: itemHeight, + gap, + rowGap: gap, + pad: { x: pad, y: pad }, + entryHeight: (fontSize, lines) => Math.max(itemHeight, lines * Math.ceil(fontSize * lineHeight)), + }; +} diff --git a/packages/flint-js/src/echarts/templates/scatter.ts b/packages/flint-js/src/echarts/templates/scatter.ts index a4b95f20..15568f39 100644 --- a/packages/flint-js/src/echarts/templates/scatter.ts +++ b/packages/flint-js/src/echarts/templates/scatter.ts @@ -14,6 +14,7 @@ import { ChartTemplateDef, ChartPropertyDef } from '../../core/types'; import { formatTimestamp } from '../instantiate-spec'; import { DEFAULT_COLORS, groupBy, getCategoryOrder, extractCategories } from './utils'; import { getPaletteForScheme } from '../colormap'; +import { EC_SIZE_KEY_ID, rampId, rampTitleId } from '../graphic-ids'; import { makeCartesianPivot } from '../../core/pivot'; /** Compute a reasonable scatter symbolSize based on canvas area and point count. */ @@ -28,6 +29,43 @@ function computeSymbolSize(width: number, height: number, pointCount: number): n return Math.max(3, Math.min(12, Math.round(idealDiameter))); } + +/** The size key's inset from the canvas's right edge, in px. */ +const SIZE_KEY_RIGHT = 28; + +/** The fill the size key's circles take: neutral grey beside a colour key, else the dots' own colour. */ +function sizeKeyFill(ctx: any, hasColorEncoding: boolean): string { + if (hasColorEncoding) return '#cccccc'; + const fallback = (getPaletteForScheme('cat10') ?? DEFAULT_COLORS)[0]; + return (ctx.resolvedEncodings as any)?.color?.colorPalette?.[0] ?? fallback; +} + +/** + * A size key as Vega-Lite draws one: its title, then a circle for each value, as large as the dots + * drawn for it, its label to the right. One graphic group, pinned from the right and the top; the + * frame stands it at the plot's top. Returns the group and its width. + */ +function sizeKeyGraphic(entries: Array<{ label: string; diameter: number }>, title: string, fill: string): { graphic: any; width: number } { + const gap = 8; + const rowGap = 6; + const fontSize = 10; + const titleHeight = 20; + const maxR = Math.max(...entries.map((e) => e.diameter / 2)); + const labelWidth = Math.max(...entries.map((e) => e.label.length * fontSize * 0.6), 20); + const titleWidth = title.length * 11 * 0.62; + const width = Math.ceil(Math.max(2 * maxR + gap + labelWidth, titleWidth)); + const children: any[] = [{ type: 'text', left: 0, top: 0, style: { text: title, fontSize: 11, fontWeight: 'bold', fill: '#333', textAlign: 'left' } }]; + let rowTop = titleHeight; + for (const entry of entries) { + const r = entry.diameter / 2; + const rowH = Math.max(entry.diameter, 16) + rowGap; + children.push({ type: 'circle', left: maxR - r, top: rowTop + (rowH - entry.diameter) / 2, shape: { cx: r, cy: r, r }, style: { fill } }); + children.push({ type: 'text', left: 2 * maxR + gap, top: rowTop + (rowH - fontSize) / 2, style: { text: entry.label, fontSize, fill: '#333', textAlign: 'left' } }); + rowTop += rowH; + } + return { graphic: { id: EC_SIZE_KEY_ID, type: 'group', right: SIZE_KEY_RIGHT, top: titleHeight, width, z: 100, children }, width }; +} + export const ecScatterPlotDef: ChartTemplateDef = { chart: 'Scatter Plot', template: { mark: 'circle', encoding: {} }, // skeleton for compatibility @@ -133,6 +171,10 @@ export const ecScatterPlotDef: ChartTemplateDef = { const yType = channelSemantics.y?.type; const xIsCategorical = xType === 'nominal' || xType === 'ordinal'; const yIsCategorical = yType === 'nominal' || yType === 'ordinal'; + // Dates on either axis run on ECharts' time axis, as epoch ms: a value axis cannot place a date string. + const xIsTemporal = xType === 'temporal'; + const yIsTemporal = yType === 'temporal'; + const toTime = (v: unknown) => (typeof v === 'number' ? v : new Date(String(v)).getTime()); const xCategories = xIsCategorical ? extractCategories(table, xField, getCategoryOrder(ctx, 'x')) : []; const yCategories = yIsCategorical ? extractCategories(table, yField, getCategoryOrder(ctx, 'y')) : []; const xCategoryToIndex = new Map(xCategories.map((c, i) => [String(c), i])); @@ -152,7 +194,7 @@ export const ecScatterPlotDef: ChartTemplateDef = { axisTick: { show: true, alignWithLabel: true }, axisLine: { show: true }, } - : { type: 'value', name: xField, nameLocation: 'middle', nameGap: 30 }, + : { type: xIsTemporal ? 'time' : 'value', name: xField, nameLocation: 'middle', nameGap: 30 }, yAxis: yIsCategorical ? { type: 'category', @@ -164,7 +206,7 @@ export const ecScatterPlotDef: ChartTemplateDef = { axisTick: { show: true, alignWithLabel: true }, axisLine: { show: true }, } - : { type: 'value', name: yField, nameLocation: 'middle', nameGap: 40 }, + : { type: yIsTemporal ? 'time' : 'value', name: yField, nameLocation: 'middle', nameGap: 40 }, series: [], }; @@ -188,93 +230,23 @@ export const ecScatterPlotDef: ChartTemplateDef = { title: sizeField, }, ]; - option._visualMapWidth = 88; - // One group for the whole legend; all coordinates use left/top so text aligns left - const ordLegendRight = 28; - const ordGap = 8; - const ordRowGap = 6; - const ordFontSize = 10; - const ordTitleHeight = 20; - const ordLabelWidth = 44; - const canvasH = ctx.canvasSize?.height ?? 300; - const maxCircleR = Math.max(...sizeOrderForLegend!.map((name) => scaleSize(name) / 2)); - const legendWidth = ordLabelWidth + ordGap + 2 * maxCircleR; - // 当存在颜色编码(分类 color 图例)时: - // - Size 图例表示“通用大小规则”,不应看起来像属于某个具体类别 - // - 按业界惯例使用中性灰色 - // 否则(无 color 编码,全图单色)则跟随主色: - // 散点默认颜色来自 cat10[0](在 ecApplyLayoutToSpec 中的统一逻辑), - // 因此这里也用 cat10[0],保证 size 图例与图元颜色一致。 const hasColorEncoding = !!channelSemantics.color?.field; - const fallbackPalette = getPaletteForScheme('cat10') ?? DEFAULT_COLORS; - const fallbackColor = fallbackPalette[0]; - const scatterColor = hasColorEncoding - ? '#cccccc' - : ((ctx.resolvedEncodings as any)?.color?.colorPalette?.[0] ?? fallbackColor); - const rowHeights = sizeOrderForLegend!.map((name) => Math.max(scaleSize(name), 16) + ordRowGap); - const totalLegendHeight = ordTitleHeight + rowHeights.reduce((a, b) => a + b, 0); - const ordLegendTop = Math.max(10, (canvasH - totalLegendHeight) / 2); - const legendChildren: any[] = [ - { - type: 'text' as const, - left: 0, - top: 0, - style: { - text: sizeField, - fontSize: 11, - fontWeight: 'bold', - fill: '#333', - textAlign: 'left', - }, - }, - ]; - let rowTop = ordTitleHeight; - for (let i = 0; i < sizeOrderForLegend!.length; i++) { - const name = sizeOrderForLegend![i]; - const r = scaleSize(name) / 2; - const rowH = rowHeights[i]; - const circleTop = rowTop + (rowH - scaleSize(name)) / 2; - const textTop = rowTop + (rowH - ordFontSize) / 2; - legendChildren.push({ - type: 'circle' as const, - left: maxCircleR - r, - top: circleTop - r, - shape: { cx: r, cy: r, r }, - style: { fill: scatterColor }, - }); - legendChildren.push({ - type: 'text' as const, - left: 2 * maxCircleR + ordGap, - top: textTop, - style: { - text: name, - fontSize: ordFontSize, - fill: '#333', - textAlign: 'left', - }, - }); - rowTop += rowH; - } - const ordLegendGraphic = { - type: 'group' as const, - right: ordLegendRight, - top: ordLegendTop, - width: legendWidth, - z: 100, - children: legendChildren, - }; - const existingGraphic = option.graphic; - option.graphic = Array.isArray(existingGraphic) - ? [...existingGraphic, ordLegendGraphic] - : existingGraphic - ? [existingGraphic, ordLegendGraphic] - : [ordLegendGraphic]; + const key = sizeKeyGraphic( + sizeOrderForLegend!.map((name) => ({ label: name, diameter: scaleSize(name) })), + sizeField!, + sizeKeyFill(ctx, hasColorEncoding), + ); + option._visualMapWidth = key.width + SIZE_KEY_RIGHT - 10; + option.graphic = [...(Array.isArray(option.graphic) ? option.graphic : option.graphic ? [option.graphic] : []), key.graphic]; } else if (useContinuousSizeVisualMap) { // Quantity size: continuous visualMap (scatter-aqi-color style), inRange.symbolSize maps dimension to size. // Enforce a minimum spread so circles are visibly different (ECharts maps data linearly to [min, max]). const SIZE_SPREAD_MIN = 20; const sizeMaxForMap = Math.max(rangeMaxClamped, rangeMin + SIZE_SPREAD_MIN); - const fmtSize = (v: number) => (Number.isInteger(v) ? String(v) : v.toFixed(1)); + // One decimal from 1 up; below it two significant digits, so 0.0374 reads "0.037", not "0". + const fmtSize = (v: number) => v.toLocaleString('en-US', { + maximumFractionDigits: v === 0 ? 1 : Math.min(20, Math.max(1, 1 - Math.floor(Math.log10(Math.abs(v))))), + }); const sizeVisualMap: any = { type: 'continuous' as const, show: true, @@ -292,6 +264,7 @@ export const ecScatterPlotDef: ChartTemplateDef = { textStyle: { fontSize: 10 }, seriesIndex: 0, name: sizeField, + id: rampId('size'), }; // controller 只影响图例 UI,不改变散点本身的颜色。 // - 有 color 编码时:size 图例表示“通用大小”,使用中性灰色。 @@ -326,6 +299,7 @@ export const ecScatterPlotDef: ChartTemplateDef = { option.graphic = [ ...existingGraphic, { + id: rampTitleId('size'), type: 'text' as const, right: 50, top: 10, @@ -355,8 +329,8 @@ export const ecScatterPlotDef: ChartTemplateDef = { // Opacity from chart properties const opacity = chartProperties?.opacity ?? 1; - const xVal = (row: any) => xIsCategorical ? (xCategoryToIndex.get(String(row[xField] ?? '')) ?? 0) : row[xField]; - const yVal = (row: any) => yIsCategorical ? (yCategoryToIndex.get(String(row[yField] ?? '')) ?? 0) : row[yField]; + const xVal = (row: any) => xIsCategorical ? (xCategoryToIndex.get(String(row[xField] ?? '')) ?? 0) : xIsTemporal ? toTime(row[xField]) : row[xField]; + const yVal = (row: any) => yIsCategorical ? (yCategoryToIndex.get(String(row[yField] ?? '')) ?? 0) : yIsTemporal ? toTime(row[yField]) : row[yField]; const pointData = (row: any) => sizeField != null ? [xVal(row), yVal(row), row[sizeField]] @@ -441,6 +415,7 @@ export const ecScatterPlotDef: ChartTemplateDef = { show: true, seriesIndex: 0, name: colorField, + id: rampId('color'), }; if (option.visualMap) { (option.visualMap as any[]).push(colorVisualMap); @@ -451,6 +426,7 @@ export const ecScatterPlotDef: ChartTemplateDef = { // Only the title is custom graphic; max/min come from visualMap.text above. const vmGraphics: any[] = [ { + id: rampTitleId('color'), type: 'text' as const, right: colorBarRight, top: VM_TITLE_TOP, diff --git a/packages/flint-js/src/excel/assemble.ts b/packages/flint-js/src/excel/assemble.ts index 24aca5ed..51801e3f 100644 --- a/packages/flint-js/src/excel/assemble.ts +++ b/packages/flint-js/src/excel/assemble.ts @@ -26,6 +26,7 @@ import type { SemanticResult, } from '../core/types'; import { resolveChannelSemantics, convertTemporalData } from '../core/resolve-semantics'; +import { resolvePivotAggregate } from '../core/field-semantics'; import { detectBandedAxisFromSemantics } from '../core/axis-detection'; import { computeChannelBudgets, deriveStretchCaps, resolveBaseSize } from '../core/compute-layout'; import { filterOverflow } from '../core/filter-overflow'; @@ -447,8 +448,8 @@ export function assembleExcel(input: ChartAssemblyInput): ExcelChartSpec { })); } - // aggregate duplicates per (category × series) using the measure's default - const agg = sem[measCh!]?.aggregationDefault ?? 'sum'; + // aggregate duplicates per (category × series): the encoding's own aggregate, else the measure's default + const agg = resolvePivotAggregate(encodings[measCh!]?.aggregate, sem[measCh!]?.aggregationDefault); const acc = new Map(); for (const r of convertedData) { const cv = r[catField]; @@ -466,7 +467,7 @@ export function assembleExcel(input: ChartAssemblyInput): ExcelChartSpec { const valueAt = (cv: Cell, sv: Cell): Cell => { const e = acc.get(`${String(cv)}\u0000${String(sv)}`); if (!e) return null; - return agg === 'average' ? e.sum / e.count : e.sum; + return agg === 'average' ? e.sum / e.count : agg === 'count' ? e.count : e.sum; }; let seriesValues = seriesDescriptors.map((descriptor) => categories.map((category) => valueAt(category, descriptor.key))); diff --git a/packages/flint-js/src/geo/NOTICE.md b/packages/flint-js/src/geo/NOTICE.md new file mode 100644 index 00000000..d2afbcba --- /dev/null +++ b/packages/flint-js/src/geo/NOTICE.md @@ -0,0 +1,52 @@ +# Bundled boundaries + +The files in this folder let Flint's maps draw without a network. They are also published, unchanged, +on Flint's site at `https://microsoft.github.io/flint-chart/geo/v1/`, the URLs compiled specs name; +a published version never changes (`scripts/publish-site-geo.mjs`). + +| File | Source | Licence | +|---|---|---| +| `world-bank-coarse.json`, `world-bank-medium.json` | [World Bank Official Boundaries](https://datacatalog.worldbank.org/search/dataset/0038272/world-bank-official-boundaries) (Admin 0 and Non-Determined Legal Status Areas), simplified to two levels of detail by Data Formulator's `src/maps/data/world-bank/build.sh`, then given ISO 3166-1 numeric ids and a `disputed` mesh by `scripts/build-world-bank.mjs` | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), © The World Bank Group, under the [World Bank's terms of use for datasets](https://www.worldbank.org/en/about/legal/terms-of-use-for-datasets) | +| `world-110m.json` | [world-atlas](https://github.com/topojson/world-atlas) 1:110m countries, as distributed in [vega-datasets](https://github.com/vega/vega-datasets) `data/world-110m.json`, built from [Natural Earth](https://www.naturalearthdata.com/), unchanged | world-atlas: ISC (below); Natural Earth: public domain | +| `states-10m.json` | [us-atlas](https://github.com/topojson/us-atlas) 3.0.1, built from the US Census Bureau's cartographic boundary files, unchanged | us-atlas: ISC (below); Census data: public domain | +| `counties-albers-10m.json` | [us-atlas](https://github.com/topojson/us-atlas) 3.0.1, projected with `geoAlbersUsa().scale(1300).translate([487.5, 305])`, unchanged | us-atlas: ISC (below); Census data: public domain | + +## World Bank Official Boundaries + +Changes to the World Bank data: territories sharing an ISO 3166-1 alpha-3 code were merged; France's +overseas departments take France's id; geometry was simplified. Use of these files is subject to +CC BY 4.0 and the World Bank's terms of use for datasets linked above, which pass to anyone they are +shared with. Maps drawn from them credit the World Bank at their foot, with its disclaimer: + +> The boundaries, colors, denominations, and any other information shown on maps made with these +> files do not imply any judgment on the part of The World Bank concerning the legal status of any +> territory or the endorsement or acceptance of such boundaries. + +The World Bank does not endorse Flint or any map made with these files. + +## world-atlas and us-atlas + +`world-110m.json`, `states-10m.json` and `counties-albers-10m.json` are distributed under this notice: + +``` +Copyright 2013-2019 Michael Bostock + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +``` + +## Disputed boundaries + +Flint takes no position on any boundary or territorial claim. Natural Earth's borders are de facto +boundaries; the World Bank's mark areas of non-determined legal status. Neither may meet the mapping +law of every country. A chart that needs other boundaries gives its own file as `chartProperties.boundaries` +(see `Boundaries` in `src/core/types.ts`). diff --git a/packages/flint-js/src/geo/counties-albers-10m.json b/packages/flint-js/src/geo/counties-albers-10m.json new file mode 100644 index 00000000..c99dabd4 --- /dev/null +++ b/packages/flint-js/src/geo/counties-albers-10m.json @@ -0,0 +1 @@ +{"type":"Topology","bbox":[-57.66491068874468,12.97635452036684,957.5235629133763,606.5694262668667],"transform":{"scale":[0.010151986255883769,0.005935990077365771],"translate":[-57.66491068874468,12.97635452036684]},"objects":{"counties":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0,1,2,3,4,5,6,7]],"id":"04015","properties":{"name":"Mohave"}},{"type":"Polygon","arcs":[[8,9,10,11,12,13,14]],"id":"22105","properties":{"name":"Tangipahoa"}},{"type":"Polygon","arcs":[[15,16,17,18,19]],"id":"16063","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[20,21,22,23,24,25,26,27,28]],"id":"27119","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[29,30,31,32,33,34,35]],"id":"38017","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[36,37,38,39,40]],"id":"46081","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[41,42,43,44,45,46]],"id":"36095","properties":{"name":"Schoharie"}},{"type":"MultiPolygon","arcs":[[[47,48,49,50]],[[51]],[[52]]],"id":"02275","properties":{"name":"Wrangell"}},{"type":"Polygon","arcs":[[53,54,55,56]],"id":"13143","properties":{"name":"Haralson"}},{"type":"Polygon","arcs":[[57,58,59,60,61]],"id":"13023","properties":{"name":"Bleckley"}},{"type":"Polygon","arcs":[[62,63,64,65,66,67]],"id":"18093","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[68,69,70,71,72,73]],"id":"18079","properties":{"name":"Jennings"}},{"type":"Polygon","arcs":[[74,75,76,77,78,79]],"id":"26087","properties":{"name":"Lapeer"}},{"type":"Polygon","arcs":[[80,81,82,83,84,85]],"id":"28017","properties":{"name":"Chickasaw"}},{"type":"Polygon","arcs":[[86,87,88,89,90,91]],"id":"39033","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[92,93,94,95,96,97,98]],"id":"46099","properties":{"name":"Minnehaha"}},{"type":"Polygon","arcs":[[99,-98,100,101,102,103]],"id":"46125","properties":{"name":"Turner"}},{"type":"Polygon","arcs":[[104,105,106,107,108,109]],"id":"48471","properties":{"name":"Walker"}},{"type":"Polygon","arcs":[[110,111,112,113,114,115]],"id":"46003","properties":{"name":"Aurora"}},{"type":"Polygon","arcs":[[116,117,118,119,120,121,122]],"id":"48047","properties":{"name":"Brooks"}},{"type":"Polygon","arcs":[[123,124,125,126,127]],"id":"31029","properties":{"name":"Chase"}},{"type":"Polygon","arcs":[[128,129,130,131,132,133]],"id":"08021","properties":{"name":"Conejos"}},{"type":"Polygon","arcs":[[134,135,136,137,138,139,140,141]],"id":"24043","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[142,143,144,145,146,147]],"id":"20137","properties":{"name":"Norton"}},{"type":"Polygon","arcs":[[148,149,150,151,152,153]],"id":"17053","properties":{"name":"Ford"}},{"type":"Polygon","arcs":[[154,155,156,157,158,159]],"id":"48117","properties":{"name":"Deaf Smith"}},{"type":"Polygon","arcs":[[160,161,162,163,164,165,166,167]],"id":"13261","properties":{"name":"Sumter"}},{"type":"Polygon","arcs":[[168,169,170,171,172,173]],"id":"55075","properties":{"name":"Marinette"}},{"type":"Polygon","arcs":[[174,175,176,177,178]],"id":"06069","properties":{"name":"San Benito"}},{"type":"Polygon","arcs":[[179,180,181,182,183,184,185]],"id":"13199","properties":{"name":"Meriwether"}},{"type":"Polygon","arcs":[[186,187,188,189,190,191]],"id":"19013","properties":{"name":"Black Hawk"}},{"type":"Polygon","arcs":[[192,193,194,195]],"id":"19081","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[196,-23]],"id":"27125","properties":{"name":"Red Lake"}},{"type":"Polygon","arcs":[[197,198,199,200,201]],"id":"31125","properties":{"name":"Nance"}},{"type":"Polygon","arcs":[[202,203,204,205]],"id":"42075","properties":{"name":"Lebanon"}},{"type":"Polygon","arcs":[[206,207,208,209]],"id":"48219","properties":{"name":"Hockley"}},{"type":"Polygon","arcs":[[210,211,212,213,214,215]],"id":"48417","properties":{"name":"Shackelford"}},{"type":"Polygon","arcs":[[216,217,218,219,220,221,222]],"id":"48451","properties":{"name":"Tom Green"}},{"type":"Polygon","arcs":[[223,224,225,226,227,228]],"id":"48497","properties":{"name":"Wise"}},{"type":"Polygon","arcs":[[229,230,231,-93,232,233]],"id":"46079","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[234,235,236,237,238,239,240]],"id":"46069","properties":{"name":"Hyde"}},{"type":"Polygon","arcs":[[241,242,243,244,245,246]],"id":"48101","properties":{"name":"Cottle"}},{"type":"Polygon","arcs":[[247,248,249]],"id":"04023","properties":{"name":"Santa Cruz"}},{"type":"Polygon","arcs":[[250,251,252,253,254]],"id":"19179","properties":{"name":"Wapello"}},{"type":"Polygon","arcs":[[255,256,257,258,259,260]],"id":"19031","properties":{"name":"Cedar"}},{"type":"Polygon","arcs":[[261,262,263,264,265,266,267]],"id":"30033","properties":{"name":"Garfield"}},{"type":"Polygon","arcs":[[268,269,270,271,272,273,274]],"id":"29185","properties":{"name":"St. Clair"}},{"type":"Polygon","arcs":[[275,276,277,278,279]],"id":"12091","properties":{"name":"Okaloosa"}},{"type":"Polygon","arcs":[[280,281,282,283,284]],"id":"21219","properties":{"name":"Todd"}},{"type":"Polygon","arcs":[[285,286,287,288,289]],"id":"23003","properties":{"name":"Aroostook"}},{"type":"Polygon","arcs":[[290,291,292,-142,293,294,295,296]],"id":"24001","properties":{"name":"Allegany"}},{"type":"Polygon","arcs":[[297,298,299,300,301]],"id":"28075","properties":{"name":"Lauderdale"}},{"type":"Polygon","arcs":[[302,303,304,305,306,307]],"id":"38021","properties":{"name":"Dickey"}},{"type":"Polygon","arcs":[[308,309,310,311,312]],"id":"27093","properties":{"name":"Meeker"}},{"type":"Polygon","arcs":[[313,314,315,316]],"id":"46007","properties":{"name":"Bennett"}},{"type":"Polygon","arcs":[[317,318,319,320,321,322,323,324]],"id":"49043","properties":{"name":"Summit"}},{"type":"Polygon","arcs":[[325,326,327,328,329,330]],"id":"36099","properties":{"name":"Seneca"}},{"type":"Polygon","arcs":[[331,332,333,334,335,336,337]],"id":"20073","properties":{"name":"Greenwood"}},{"type":"Polygon","arcs":[[338,339,340,341]],"id":"20101","properties":{"name":"Lane"}},{"type":"Polygon","arcs":[[342,343,344,345,346,347]],"id":"26123","properties":{"name":"Newaygo"}},{"type":"Polygon","arcs":[[348,349,350,351,352,353]],"id":"31035","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[354,355,356,357]],"id":"36073","properties":{"name":"Orleans"}},{"type":"Polygon","arcs":[[358,359,360,361,362,363,364]],"id":"38063","properties":{"name":"Nelson"}},{"type":"Polygon","arcs":[[365,366,367,368,369,370]],"id":"40011","properties":{"name":"Blaine"}},{"type":"Polygon","arcs":[[371,372,373,374,375]],"id":"48441","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[376,377,378,379,380]],"id":"48011","properties":{"name":"Armstrong"}},{"type":"Polygon","arcs":[[381,382,383,384]],"id":"48233","properties":{"name":"Hutchinson"}},{"type":"Polygon","arcs":[[-222,385,386,387]],"id":"48235","properties":{"name":"Irion"}},{"type":"Polygon","arcs":[[388,389,390,391,392,393]],"id":"55137","properties":{"name":"Waushara"}},{"type":"Polygon","arcs":[[394,395,396,397,398,399,400]],"id":"47151","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[401,402,403,404,405]],"id":"55113","properties":{"name":"Sawyer"}},{"type":"Polygon","arcs":[[406,407,408,409,410]],"id":"26073","properties":{"name":"Isabella"}},{"type":"Polygon","arcs":[[411,412,413,414,415,416]],"id":"28131","properties":{"name":"Stone"}},{"type":"Polygon","arcs":[[417,418,-86,419,420,421]],"id":"28013","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[422,423,424,425,426]],"id":"31171","properties":{"name":"Thomas"}},{"type":"Polygon","arcs":[[427,428,429,430,431,432]],"id":"48335","properties":{"name":"Mitchell"}},{"type":"Polygon","arcs":[[433,434,435,436,437]],"id":"08057","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[438,439,440,441,442]],"id":"19089","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[443,444,445,446,-75]],"id":"26151","properties":{"name":"Sanilac"}},{"type":"Polygon","arcs":[[447,448,449,450,451,452,453]],"id":"18075","properties":{"name":"Jay"}},{"type":"Polygon","arcs":[[454,455,456,457,458]],"id":"38075","properties":{"name":"Renville"}},{"type":"Polygon","arcs":[[459,460,461,462,463]],"id":"41021","properties":{"name":"Gilliam"}},{"type":"Polygon","arcs":[[464,465,466,467,468]],"id":"29119","properties":{"name":"McDonald"}},{"type":"Polygon","arcs":[[469,470,471,472]],"id":"48501","properties":{"name":"Yoakum"}},{"type":"Polygon","arcs":[[473,474,475,-243,476]],"id":"48075","properties":{"name":"Childress"}},{"type":"Polygon","arcs":[[477,478,479,480]],"id":"13097","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[481,482,483,484]],"id":"02158","properties":{"name":"Kusilvak"}},{"type":"Polygon","arcs":[[485,486,487,488,489]],"id":"19181","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[490,491,492,493,494,495]],"id":"40031","properties":{"name":"Comanche"}},{"type":"Polygon","arcs":[[496,497,498,499,500,501,502,503]],"id":"40009","properties":{"name":"Beckham"}},{"type":"Polygon","arcs":[[-238,504,505,506,507]],"id":"46017","properties":{"name":"Buffalo"}},{"type":"Polygon","arcs":[[508,509,510,511,512,513]],"id":"48171","properties":{"name":"Gillespie"}},{"type":"Polygon","arcs":[[514,515,516,517]],"id":"48125","properties":{"name":"Dickens"}},{"type":"Polygon","arcs":[[518,519,520,521,522]],"id":"48283","properties":{"name":"La Salle"}},{"type":"Polygon","arcs":[[523,524,525,526]],"id":"54093","properties":{"name":"Tucker"}},{"type":"Polygon","arcs":[[527,528,529,530,531,532]],"id":"06089","properties":{"name":"Shasta"}},{"type":"Polygon","arcs":[[533,534,535,536,537,538]],"id":"17165","properties":{"name":"Saline"}},{"type":"Polygon","arcs":[[539,540,541,542,543]],"id":"26101","properties":{"name":"Manistee"}},{"type":"Polygon","arcs":[[544,545,546,547,548]],"id":"31071","properties":{"name":"Garfield"}},{"type":"Polygon","arcs":[[549,550,-548,551,552,553,554,555,556]],"id":"31041","properties":{"name":"Custer"}},{"type":"Polygon","arcs":[[557,-234,558,559,560]],"id":"46097","properties":{"name":"Miner"}},{"type":"Polygon","arcs":[[561,562,563,564,565,566]],"id":"46025","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[567,568,569,570,571]],"id":"05037","properties":{"name":"Cross"}},{"type":"Polygon","arcs":[[572,573,574,-134,575,576,577]],"id":"08007","properties":{"name":"Archuleta"}},{"type":"Polygon","arcs":[[578,579,580,581]],"id":"12043","properties":{"name":"Glades"}},{"type":"Polygon","arcs":[[582,583,584,585,586]],"id":"46053","properties":{"name":"Gregory"}},{"type":"Polygon","arcs":[[587,588,589,-382,590]],"id":"48195","properties":{"name":"Hansford"}},{"type":"MultiPolygon","arcs":[[[591,592,593,594,595]],[[596,597,598]]],"id":"53053","properties":{"name":"Pierce"}},{"type":"Polygon","arcs":[[599,600,601,-180,602,603,604]],"id":"13077","properties":{"name":"Coweta"}},{"type":"Polygon","arcs":[[605,606,607,608]],"id":"13059","properties":{"name":"Clarke"}},{"type":"Polygon","arcs":[[609,610,611,612,613]],"id":"18081","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[614,615,616,617,618,619]],"id":"20115","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[620,621,622,623,624]],"id":"27059","properties":{"name":"Isanti"}},{"type":"Polygon","arcs":[[625,626,627,628,629,630]],"id":"31003","properties":{"name":"Antelope"}},{"type":"Polygon","arcs":[[631,632,633,634,635]],"id":"39103","properties":{"name":"Medina"}},{"type":"Polygon","arcs":[[636,637,638,639,640,641]],"id":"47153","properties":{"name":"Sequatchie"}},{"type":"Polygon","arcs":[[642,643,644,645]],"id":"48375","properties":{"name":"Potter"}},{"type":"Polygon","arcs":[[646,647,648,649,650]],"id":"48145","properties":{"name":"Falls"}},{"type":"Polygon","arcs":[[-362,651,652,653,654,655]],"id":"38039","properties":{"name":"Griggs"}},{"type":"Polygon","arcs":[[-114,656,657,658]],"id":"46043","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[659,660,661,662,663,664]],"id":"48193","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[665,666,667,668,669]],"id":"19185","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[670,671,672,673,674,675,676]],"id":"38087","properties":{"name":"Slope"}},{"type":"Polygon","arcs":[[677,-375,678,679,-219,680]],"id":"48399","properties":{"name":"Runnels"}},{"type":"Polygon","arcs":[[681,682,683,684,685,-4]],"id":"04005","properties":{"name":"Coconino"}},{"type":"Polygon","arcs":[[686,687,688,689,690]],"id":"16009","properties":{"name":"Benewah"}},{"type":"Polygon","arcs":[[691,692,693,694,695,696,697]],"id":"20007","properties":{"name":"Barber"}},{"type":"Polygon","arcs":[[698,699,700,701,-95]],"id":"27133","properties":{"name":"Rock"}},{"type":"Polygon","arcs":[[702,-286,703,704]],"id":"23029","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[705,706,707,708,709]],"id":"30051","properties":{"name":"Liberty"}},{"type":"Polygon","arcs":[[710,711,712,713]],"id":"46091","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[714,715,-326,716,717]],"id":"36117","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[718,719]],"id":"02060","properties":{"name":"Bristol Bay"}},{"type":"Polygon","arcs":[[720,721,722,723,724]],"id":"12027","properties":{"name":"DeSoto"}},{"type":"Polygon","arcs":[[725,726,727,728,729,730]],"id":"13015","properties":{"name":"Bartow"}},{"type":"Polygon","arcs":[[731,732,733,734,735]],"id":"19127","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[736,737,738,739,740,741]],"id":"20047","properties":{"name":"Edwards"}},{"type":"Polygon","arcs":[[742,743,744,745,746]],"id":"26129","properties":{"name":"Ogemaw"}},{"type":"Polygon","arcs":[[747,-201,748,749,750,751]],"id":"31093","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[752,753,754,755,756,757]],"id":"39063","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[758,759,760,761,762,763,764]],"id":"21209","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[765,766,767,768,-639]],"id":"47007","properties":{"name":"Bledsoe"}},{"type":"Polygon","arcs":[[769,770,771,772,773,774]],"id":"37157","properties":{"name":"Rockingham"}},{"type":"Polygon","arcs":[[775,776,777,778,779]],"id":"48189","properties":{"name":"Hale"}},{"type":"Polygon","arcs":[[780]],"id":"51820","properties":{"name":"Waynesboro"}},{"type":"Polygon","arcs":[[781,782,783,784,785]],"id":"56025","properties":{"name":"Natrona"}},{"type":"Polygon","arcs":[[-107,786,787,788,789]],"id":"48407","properties":{"name":"San Jacinto"}},{"type":"Polygon","arcs":[[790,791,792,-390,793]],"id":"55135","properties":{"name":"Waupaca"}},{"type":"Polygon","arcs":[[794,795,796,797,798]],"id":"39067","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[799,800,801,802,803,804,805]],"id":"13087","properties":{"name":"Decatur"}},{"type":"Polygon","arcs":[[806,807,808,809,810]],"id":"22001","properties":{"name":"Acadia"}},{"type":"Polygon","arcs":[[811,812,813,814,815]],"id":"27019","properties":{"name":"Carver"}},{"type":"Polygon","arcs":[[816,817,818,819,-535,820]],"id":"17065","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[821,822,-313,823,824,825]],"id":"27067","properties":{"name":"Kandiyohi"}},{"type":"Polygon","arcs":[[826,827,828,829,830]],"id":"55071","properties":{"name":"Manitowoc"}},{"type":"Polygon","arcs":[[831,832,833,834,835,836]],"id":"01013","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[837,838,839,840,841,842,843]],"id":"13169","properties":{"name":"Jones"}},{"type":"Polygon","arcs":[[844,845,846,847]],"id":"19069","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[848,849,850,851,852,853]],"id":"18113","properties":{"name":"Noble"}},{"type":"Polygon","arcs":[[854,855,856,857,858,859]],"id":"20193","properties":{"name":"Thomas"}},{"type":"Polygon","arcs":[[860,861,862,-407,863]],"id":"26035","properties":{"name":"Clare"}},{"type":"Polygon","arcs":[[864,865,866,867]],"id":"26039","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[868,869,870,871,872,873]],"id":"29225","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[874,875,876,877,878]],"id":"31005","properties":{"name":"Arthur"}},{"type":"Polygon","arcs":[[879,880,881,882,883]],"id":"31143","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[884,885,886,887,-563]],"id":"46029","properties":{"name":"Codington"}},{"type":"Polygon","arcs":[[888,889,890,-117,891,892]],"id":"48131","properties":{"name":"Duval"}},{"type":"Polygon","arcs":[[893,-385,894,-643,895,896]],"id":"48341","properties":{"name":"Moore"}},{"type":"Polygon","arcs":[[897,898,899,900,901,902]],"id":"48317","properties":{"name":"Martin"}},{"type":"Polygon","arcs":[[903,904,905,906,907,908,909]],"id":"39083","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[910,911,912,913,914,-648,915]],"id":"48293","properties":{"name":"Limestone"}},{"type":"Polygon","arcs":[[916,917,918,919,920]],"id":"19055","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[921,922,923,924]],"id":"31159","properties":{"name":"Seward"}},{"type":"Polygon","arcs":[[925,926,927,928]],"id":"48507","properties":{"name":"Zavala"}},{"type":"Polygon","arcs":[[929,930,931,932,933]],"id":"06091","properties":{"name":"Sierra"}},{"type":"Polygon","arcs":[[934,935,936,937,938]],"id":"17201","properties":{"name":"Winnebago"}},{"type":"Polygon","arcs":[[939,940,941,942,943,944]],"id":"23031","properties":{"name":"York"}},{"type":"Polygon","arcs":[[945,946,947,948,949]],"id":"24011","properties":{"name":"Caroline"}},{"type":"Polygon","arcs":[[950,951,952,953,954]],"id":"26119","properties":{"name":"Montmorency"}},{"type":"Polygon","arcs":[[-34,955,956,957,958,959,960]],"id":"38077","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[961,962,963,964,965,966]],"id":"42007","properties":{"name":"Beaver"}},{"type":"Polygon","arcs":[[967,968,969,-210,-470]],"id":"48079","properties":{"name":"Cochran"}},{"type":"Polygon","arcs":[[970,-746,971,972,973,-863]],"id":"26051","properties":{"name":"Gladwin"}},{"type":"Polygon","arcs":[[974,975,976,977,978,979,980]],"id":"08121","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[981,-921,982,983,-188]],"id":"19019","properties":{"name":"Buchanan"}},{"type":"Polygon","arcs":[[984,985,986,987,988,989,990]],"id":"19187","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[991,-742,992,993,994,995]],"id":"20057","properties":{"name":"Ford"}},{"type":"Polygon","arcs":[[-954,996,997,-743,-866]],"id":"26135","properties":{"name":"Oscoda"}},{"type":"Polygon","arcs":[[998,999,1000,1001]],"id":"28099","properties":{"name":"Neshoba"}},{"type":"Polygon","arcs":[[1002,1003,1004,1005,1006,1007]],"id":"31137","properties":{"name":"Phelps"}},{"type":"Polygon","arcs":[[1008,1009,1010,1011,1012,1013]],"id":"31039","properties":{"name":"Cuming"}},{"type":"Polygon","arcs":[[1014,1015,1016,1017,1018,1019,1020]],"id":"45045","properties":{"name":"Greenville"}},{"type":"Polygon","arcs":[[1021,1022,1023,1024,1025]],"id":"48151","properties":{"name":"Fisher"}},{"type":"Polygon","arcs":[[1026,1027,1028,1029,1030]],"id":"37069","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[1031,1032,1033,1034,1035,1036]],"id":"39039","properties":{"name":"Defiance"}},{"type":"Polygon","arcs":[[1037,1038,1039,1040,1041,1042]],"id":"47055","properties":{"name":"Giles"}},{"type":"Polygon","arcs":[[1043,1044,1045,1046,1047]],"id":"48023","properties":{"name":"Baylor"}},{"type":"Polygon","arcs":[[1048,1049,1050,1051,1052]],"id":"48365","properties":{"name":"Panola"}},{"type":"Polygon","arcs":[[1053,1054,1055,1056]],"id":"53001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[-988,1057,1058,1059,1060,1061]],"id":"19015","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[1062,1063,1064,-229,1065,1066,1067]],"id":"48237","properties":{"name":"Jack"}},{"type":"Polygon","arcs":[[1068,1069,-332,1070,-617]],"id":"20017","properties":{"name":"Chase"}},{"type":"Polygon","arcs":[[-663,1071,1072,1073,1074]],"id":"48099","properties":{"name":"Coryell"}},{"type":"Polygon","arcs":[[1075,1076,1077,1078,1079]],"id":"26037","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[1080,1081,1082,-335]],"id":"20207","properties":{"name":"Woodson"}},{"type":"Polygon","arcs":[[1083,1084,1085,1086,1087,1088,1089]],"id":"17037","properties":{"name":"DeKalb"}},{"type":"Polygon","arcs":[[1090,1091,1092,1093,1094]],"id":"19159","properties":{"name":"Ringgold"}},{"type":"Polygon","arcs":[[1095,1096,1097,1098,1099]],"id":"19165","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[1100,1101,1102,1103,1104,1105,-178,1106]],"id":"06019","properties":{"name":"Fresno"}},{"type":"Polygon","arcs":[[1107,1108,1109,-1091,1110]],"id":"19175","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[1111,1112,1113,1114,1115,1116]],"id":"17123","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[1117,1118,1119,1120,1121,1122]],"id":"17147","properties":{"name":"Piatt"}},{"type":"Polygon","arcs":[[1123,1124,-1111,1125,1126]],"id":"19003","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[1127,1128,1129,1130,1131,1132,1133]],"id":"17159","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[1134,1135,1136,1137,1138]],"id":"47023","properties":{"name":"Chester"}},{"type":"Polygon","arcs":[[1139,1140,1141,1142,1143]],"id":"26023","properties":{"name":"Branch"}},{"type":"Polygon","arcs":[[1144,1145,1146,1147,1148,1149]],"id":"37151","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[1150,1151,1152,1153,1154,1155]],"id":"20199","properties":{"name":"Wallace"}},{"type":"Polygon","arcs":[[1156,1157,1158,1159,1160,1161]],"id":"18177","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[1162]],"id":"51595","properties":{"name":"Emporia"}},{"type":"Polygon","arcs":[[1163,1164,1165,1166,1167]],"id":"48295","properties":{"name":"Lipscomb"}},{"type":"Polygon","arcs":[[1168,1169,1170,1171]],"id":"47169","properties":{"name":"Trousdale"}},{"type":"Polygon","arcs":[[1172,1173,1174,1175,1176,1177,1178,1179,1180,-683,1181]],"id":"49037","properties":{"name":"San Juan"}},{"type":"Polygon","arcs":[[1182,1183,1184,-251,1185,1186]],"id":"19123","properties":{"name":"Mahaska"}},{"type":"Polygon","arcs":[[1187,1188,1189,1190]],"id":"16021","properties":{"name":"Boundary"}},{"type":"Polygon","arcs":[[1191,1192,1193,1194,1195,1196,1197]],"id":"17107","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[1198,1199,1200,1201,1202]],"id":"20059","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[1203,1204,1205,1206,1207,1208,1209,1210]],"id":"22013","properties":{"name":"Bienville"}},{"type":"Polygon","arcs":[[1211,1212,1213,1214,1215]],"id":"06005","properties":{"name":"Amador"}},{"type":"Polygon","arcs":[[1216,1217,-1212,1218,1219]],"id":"06017","properties":{"name":"El Dorado"}},{"type":"Polygon","arcs":[[1220,1221,1222,1223,1224]],"id":"05065","properties":{"name":"Izard"}},{"type":"Polygon","arcs":[[1225]],"id":"51530","properties":{"name":"Buena Vista"}},{"type":"Polygon","arcs":[[1226,1227]],"id":"51590","properties":{"name":"Danville"}},{"type":"Polygon","arcs":[[1228,1229]],"id":"51640","properties":{"name":"Galax"}},{"type":"Polygon","arcs":[[1230]],"id":"51660","properties":{"name":"Harrisonburg"}},{"type":"Polygon","arcs":[[1231]],"id":"51690","properties":{"name":"Martinsville"}},{"type":"Polygon","arcs":[[1232,1233,1234,1235,1236,1237]],"id":"18049","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[1238,1239,-1108,-1125,1240]],"id":"19001","properties":{"name":"Adair"}},{"type":"Polygon","arcs":[[1241,-179,-1106,1242,1243,1244]],"id":"06053","properties":{"name":"Monterey"}},{"type":"Polygon","arcs":[[1245,1246,1247,1248,1249]],"id":"29219","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[1250,1251,1252,1253,1254]],"id":"37197","properties":{"name":"Yadkin"}},{"type":"Polygon","arcs":[[-409,1255,1256,1257,-1076,1258]],"id":"26057","properties":{"name":"Gratiot"}},{"type":"Polygon","arcs":[[1259,1260,1261,1262,1263,1264]],"id":"21129","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[1265,1266,1267,1268,1269,1270]],"id":"20133","properties":{"name":"Neosho"}},{"type":"Polygon","arcs":[[1271,-1080,1272,1273,1274]],"id":"26067","properties":{"name":"Ionia"}},{"type":"Polygon","arcs":[[1275,1276,1277,1278,1279]],"id":"26077","properties":{"name":"Kalamazoo"}},{"type":"Polygon","arcs":[[1280,1281,1282,1283,1284,1285]],"id":"21149","properties":{"name":"McLean"}},{"type":"Polygon","arcs":[[1286,1287,1288,1289,1290,1291]],"id":"27033","properties":{"name":"Cottonwood"}},{"type":"Polygon","arcs":[[-542,1292,1293,-344,1294]],"id":"26085","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-543,-1295,1295,1296]],"id":"26105","properties":{"name":"Mason"}},{"type":"Polygon","arcs":[[1297,-411,1298,-345]],"id":"26107","properties":{"name":"Mecosta"}},{"type":"Polygon","arcs":[[1299,-348,1300,1301,1302]],"id":"26121","properties":{"name":"Muskegon"}},{"type":"Polygon","arcs":[[1303,1304,1305,1306,1307,1308]],"id":"27047","properties":{"name":"Freeborn"}},{"type":"Polygon","arcs":[[1309,1310,1311,1312,1313,1314,1315]],"id":"17051","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[1316,1317,1318,1319,-1312]],"id":"17049","properties":{"name":"Effingham"}},{"type":"Polygon","arcs":[[1320,1321,1322,1323]],"id":"27009","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[1324,1325,1326,1327,-378]],"id":"48129","properties":{"name":"Donley"}},{"type":"Polygon","arcs":[[1328,1329,1330,1331,1332]],"id":"27041","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[1333,1334,1335,1336,-367]],"id":"40073","properties":{"name":"Kingfisher"}},{"type":"Polygon","arcs":[[1337,1338,1339,1340,1341,1342]],"id":"47053","properties":{"name":"Gibson"}},{"type":"Polygon","arcs":[[1343,1344,1345,1346,1347,1348,1349]],"id":"47005","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[1350,1351,1352,1353]],"id":"45009","properties":{"name":"Bamberg"}},{"type":"Polygon","arcs":[[1354,1355,1356,1357,1358,-520,1359,1360]],"id":"48013","properties":{"name":"Atascosa"}},{"type":"Polygon","arcs":[[1361,1362,1363,-104,1364,1365,1366,-658]],"id":"46067","properties":{"name":"Hutchinson"}},{"type":"Polygon","arcs":[[1367,1368,1369,1370,-37,1371]],"id":"46019","properties":{"name":"Butte"}},{"type":"MultiPolygon","arcs":[[[1372,1373,1374,1375]],[[1376,1377]],[[1378,1379]],[[1380]],[[1381,1382]],[[1383,1384,1385,1386]]],"id":"02105","properties":{"name":"Hoonah-Angoon"}},{"type":"Polygon","arcs":[[1387,1388,1389,1390,-505,-237]],"id":"46059","properties":{"name":"Hand"}},{"type":"Polygon","arcs":[[-565,1391,1392,-230,-558,1393,1394]],"id":"46077","properties":{"name":"Kingsbury"}},{"type":"Polygon","arcs":[[1395,1396,1397,1398,1399]],"id":"47101","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[1400,1401,1402,1403,1404]],"id":"55069","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[1405,-1341,1406,1407,-1135,1408,1409]],"id":"47113","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[1410]],"id":"51540","properties":{"name":"Charlottesville"}},{"type":"Polygon","arcs":[[1411,1412,1413,1414,1415,1416]],"id":"30037","properties":{"name":"Golden Valley"}},{"type":"Polygon","arcs":[[1417,1418,1419,1420,1421,1422,1423,-784]],"id":"56009","properties":{"name":"Converse"}},{"type":"Polygon","arcs":[[1424,1425,1426,1427,1428]],"id":"47179","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[1429,1430,-1405,1431,1432,1433]],"id":"55119","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[1434,1435,1436,1437,1438,1439,1440,1441]],"id":"56029","properties":{"name":"Park"}},{"type":"Polygon","arcs":[[1442,1443,-1292,1444,-700,1445]],"id":"27101","properties":{"name":"Murray"}},{"type":"Polygon","arcs":[[1446,1447,1448,1449,1450,1451]],"id":"55133","properties":{"name":"Waukesha"}},{"type":"Polygon","arcs":[[1452,1453,-1446,-699,1454]],"id":"27117","properties":{"name":"Pipestone"}},{"type":"Polygon","arcs":[[1455,1456,1457,1458,1459]],"id":"51099","properties":{"name":"King George"}},{"type":"Polygon","arcs":[[1460,1461,1462,1463,1464,1465,1466]],"id":"30001","properties":{"name":"Beaverhead"}},{"type":"Polygon","arcs":[[1467,1468,-1412,1469,1470]],"id":"30107","properties":{"name":"Wheatland"}},{"type":"Polygon","arcs":[[1471,-873,1472,1473,1474,1475]],"id":"29043","properties":{"name":"Christian"}},{"type":"Polygon","arcs":[[1476,1477,1478,1479,1480,1481]],"id":"29053","properties":{"name":"Cooper"}},{"type":"Polygon","arcs":[[1482,1483,1484,1485,1486,1487]],"id":"20029","properties":{"name":"Cloud"}},{"type":"Polygon","arcs":[[1488,1489,1490,1491,1492]],"id":"51159","properties":{"name":"Richmond"}},{"type":"Polygon","arcs":[[1493,-1342,-1406,1494,1495]],"id":"47033","properties":{"name":"Crockett"}},{"type":"Polygon","arcs":[[1496,1497,1498,1499,1500]],"id":"18063","properties":{"name":"Hendricks"}},{"type":"Polygon","arcs":[[1501,1502,1503,1504,1505,1506,1507,-340]],"id":"20135","properties":{"name":"Ness"}},{"type":"Polygon","arcs":[[1508,1509,1510,1511,1512,-1087]],"id":"17093","properties":{"name":"Kendall"}},{"type":"Polygon","arcs":[[1513,1514,1515,1516,1517]],"id":"18149","properties":{"name":"Starke"}},{"type":"Polygon","arcs":[[1518,1519,1520,1521,1522,-611]],"id":"18145","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[1523,1524,1525,1526,-870,1527]],"id":"29105","properties":{"name":"Laclede"}},{"type":"Polygon","arcs":[[1528,1529,1530,1531,1532,1533]],"id":"29117","properties":{"name":"Livingston"}},{"type":"Polygon","arcs":[[1534,1535,-955,-865,1536]],"id":"26137","properties":{"name":"Otsego"}},{"type":"Polygon","arcs":[[1537,1538,1539,1540,1541,1542,-1543]],"id":"31087","properties":{"name":"Hitchcock"}},{"type":"Polygon","arcs":[[-867,-747,-971,-862,1543]],"id":"26143","properties":{"name":"Roscommon"}},{"type":"Polygon","arcs":[[1544,1545,1546,1547,1548]],"id":"29011","properties":{"name":"Barton"}},{"type":"Polygon","arcs":[[-379,-1328,1549,1550,1551,1552]],"id":"48045","properties":{"name":"Briscoe"}},{"type":"Polygon","arcs":[[1553,1554,1555,1556,1557,1558]],"id":"26161","properties":{"name":"Washtenaw"}},{"type":"Polygon","arcs":[[1559,-1274,1560,1561,-1277,1562]],"id":"26015","properties":{"name":"Barry"}},{"type":"Polygon","arcs":[[1563,1564,1565,1566,1567]],"id":"35029","properties":{"name":"Luna"}},{"type":"Polygon","arcs":[[1568,1569,1570,1571,1572,1573,1574]],"id":"51169","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[1575,1576,1577,1578,1579]],"id":"33007","properties":{"name":"Coos"}},{"type":"Polygon","arcs":[[1580,1581,1582,1583,1584,1585]],"id":"38095","properties":{"name":"Towner"}},{"type":"Polygon","arcs":[[1586,1587,1588,1589,-465,1590]],"id":"29145","properties":{"name":"Newton"}},{"type":"MultiPolygon","arcs":[[[1591,1592]],[[-1375,1593,-48,1594]]],"id":"02195","properties":{"name":"Petersburg"}},{"type":"Polygon","arcs":[[1595,-1014,1596,1597,1598]],"id":"31167","properties":{"name":"Stanton"}},{"type":"Polygon","arcs":[[1599,1600,1601,-1009,-1596,1602]],"id":"31179","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[1603,1604,1605,1606,-171]],"id":"26109","properties":{"name":"Menominee"}},{"type":"Polygon","arcs":[[1607,1608,1609,1610,1611]],"id":"48175","properties":{"name":"Goliad"}},{"type":"Polygon","arcs":[[1612,-35,-961,1613,-305,1614]],"id":"38073","properties":{"name":"Ransom"}},{"type":"Polygon","arcs":[[1615,1616,-1325,1617]],"id":"48179","properties":{"name":"Gray"}},{"type":"Polygon","arcs":[[1618,1619,1620,1621,1622,1623]],"id":"42121","properties":{"name":"Venango"}},{"type":"Polygon","arcs":[[-1327,1624,-477,-242,1625,-1550]],"id":"48191","properties":{"name":"Hall"}},{"type":"Polygon","arcs":[[1626,-1475,1627,1628,1629]],"id":"29209","properties":{"name":"Stone"}},{"type":"Polygon","arcs":[[1630,1631,1632,1633,1634,1635]],"id":"39057","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[1636,1637,-1534,1638,1639,1640]],"id":"29061","properties":{"name":"Daviess"}},{"type":"Polygon","arcs":[[1641,1642,1643,1644,1645,1646]],"id":"29199","properties":{"name":"Scotland"}},{"type":"Polygon","arcs":[[1647,1648,1649,1650,1651,1652,1653]],"id":"48049","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[-472,1654,1655,-898,1656,1657]],"id":"48165","properties":{"name":"Gaines"}},{"type":"Polygon","arcs":[[-1074,1658,-651,1659,1660,1661,1662]],"id":"48027","properties":{"name":"Bell"}},{"type":"Polygon","arcs":[[1663,-1191,1664,1665,1666]],"id":"53051","properties":{"name":"Pend Oreille"}},{"type":"Polygon","arcs":[[1667,1668,1669,1670,1671,1672]],"id":"13277","properties":{"name":"Tift"}},{"type":"Polygon","arcs":[[1673,1674,1675,1676,1677]],"id":"48435","properties":{"name":"Sutton"}},{"type":"Polygon","arcs":[[1678,1679,1680,1681,1682]],"id":"51023","properties":{"name":"Botetourt"}},{"type":"Polygon","arcs":[[1683,1684,1685,1686,1687]],"id":"48405","properties":{"name":"San Augustine"}},{"type":"Polygon","arcs":[[1688,1689,1690,1691]],"id":"27017","properties":{"name":"Carlton"}},{"type":"Polygon","arcs":[[1692,1693,1694,1695,1696]],"id":"12029","properties":{"name":"Dixie"}},{"type":"Polygon","arcs":[[1697,1698,1699,1700,1701,1702]],"id":"13211","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[1703,1704,1705,1706]],"id":"02188","properties":{"name":"Northwest Arctic"}},{"type":"Polygon","arcs":[[1707,1708,1709,-672,1710]],"id":"38007","properties":{"name":"Billings"}},{"type":"Polygon","arcs":[[1711,1712,1713,-1692,1714,1715,1716,1717]],"id":"27001","properties":{"name":"Aitkin"}},{"type":"Polygon","arcs":[[1718,1719,1720,1721,1722,1723,1724]],"id":"08045","properties":{"name":"Garfield"}},{"type":"Polygon","arcs":[[-1201,1725,1726,1727]],"id":"20003","properties":{"name":"Anderson"}},{"type":"Polygon","arcs":[[-246,1728,1729,1730,-516]],"id":"48269","properties":{"name":"King"}},{"type":"Polygon","arcs":[[1731,-370,1732,1733,-498,1734]],"id":"40039","properties":{"name":"Custer"}},{"type":"Polygon","arcs":[[1735,-91,1736,1737,1738,1739]],"id":"39101","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[1740,1741,1742,1743,1744,1745]],"id":"17095","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[1746,1747,1748,1749]],"id":"13013","properties":{"name":"Barrow"}},{"type":"Polygon","arcs":[[-1088,-1513,1750,1751,1752,-1114,1753,1754,1755]],"id":"17099","properties":{"name":"LaSalle"}},{"type":"Polygon","arcs":[[1756,1757,1758,1759,1760]],"id":"01031","properties":{"name":"Coffee"}},{"type":"Polygon","arcs":[[1761,1762,1763,1764]],"id":"12085","properties":{"name":"Martin"}},{"type":"Polygon","arcs":[[1765,1766,1767,-1058,-987]],"id":"19079","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[-847,1768,-732,1769,-1767]],"id":"19083","properties":{"name":"Hardin"}},{"type":"Polygon","arcs":[[1770,1771,1772,1773,1774,1775]],"id":"16037","properties":{"name":"Custer"}},{"type":"Polygon","arcs":[[1776,1777,1778,1779,1780,1781]],"id":"13037","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[1782,1783,1784,1785]],"id":"19093","properties":{"name":"Ida"}},{"type":"Polygon","arcs":[[1786,1787,-129,-575,1788]],"id":"08105","properties":{"name":"Rio Grande"}},{"type":"Polygon","arcs":[[1789,-1187,1790,1791,-487,1792]],"id":"19125","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[1793,-976,1794,1795]],"id":"08087","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[1796,1797,1798,-1184,1799]],"id":"19157","properties":{"name":"Poweshiek"}},{"type":"Polygon","arcs":[[1800,1801,1802,-1192,1803,1804]],"id":"17179","properties":{"name":"Tazewell"}},{"type":"Polygon","arcs":[[1805,1806,1807,1808]],"id":"08039","properties":{"name":"Elbert"}},{"type":"Polygon","arcs":[[-1060,1809,1810,-1793,-486,1811]],"id":"19153","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[1812,1813,1814,1815,1816,1817]],"id":"39149","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[1818,-490,1819,-1109,-1240]],"id":"19121","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[1820,1821,1822,1823,-634]],"id":"39153","properties":{"name":"Summit"}},{"type":"Polygon","arcs":[[1824,1825,-722,1826]],"id":"12049","properties":{"name":"Hardee"}},{"type":"Polygon","arcs":[[1827,1828,1829,1830,1831,1832,1833]],"id":"39161","properties":{"name":"Van Wert"}},{"type":"Polygon","arcs":[[1834,-1635,1835,1836,1837,1838]],"id":"39165","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[1839,1840,1841,1842,-926,1843]],"id":"48463","properties":{"name":"Uvalde"}},{"type":"Polygon","arcs":[[1844,1845,1846,1847,1848,-607,1849]],"id":"13195","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[1850,1851,-799,1852,1853,1854]],"id":"39059","properties":{"name":"Guernsey"}},{"type":"Polygon","arcs":[[1855,1856,1857,1858,-1356]],"id":"48493","properties":{"name":"Wilson"}},{"type":"Polygon","arcs":[[-1738,1859,-910,1860,1861,1862]],"id":"39041","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[1863,1864,1865,1866,1867]],"id":"39055","properties":{"name":"Geauga"}},{"type":"Polygon","arcs":[[-501,1868,1869,1870]],"id":"40055","properties":{"name":"Greer"}},{"type":"Polygon","arcs":[[1871,1872,1873,1874,1875,1876,1877]],"id":"27131","properties":{"name":"Rice"}},{"type":"Polygon","arcs":[[1878,1879,1880,1881,1882,1883,1884]],"id":"05025","properties":{"name":"Cleveland"}},{"type":"Polygon","arcs":[[1885,1886,1887,1888,1889,-164]],"id":"13093","properties":{"name":"Dooly"}},{"type":"Polygon","arcs":[[-386,-221,1890,-1674,1891]],"id":"48413","properties":{"name":"Schleicher"}},{"type":"Polygon","arcs":[[1892,1893,1894,1895,-1289]],"id":"27165","properties":{"name":"Watonwan"}},{"type":"Polygon","arcs":[[1896,1897,1898,-354,1899,1900]],"id":"31001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[1901,1902,1903,1904]],"id":"37003","properties":{"name":"Alexander"}},{"type":"Polygon","arcs":[[1905,-274,1906,1907,-1546]],"id":"29039","properties":{"name":"Cedar"}},{"type":"Polygon","arcs":[[1908,-380,-1553,1909,-777,1910]],"id":"48437","properties":{"name":"Swisher"}},{"type":"Polygon","arcs":[[1911,1912,1913,1914,1915,1916,1917]],"id":"30049","properties":{"name":"Lewis and Clark"}},{"type":"Polygon","arcs":[[1918,1919,1920,-1482,1921,1922,1923]],"id":"29159","properties":{"name":"Pettis"}},{"type":"Polygon","arcs":[[-1551,-1626,-247,-515,1924]],"id":"48345","properties":{"name":"Motley"}},{"type":"Polygon","arcs":[[1925,1926,1927,-1461,1928,1929]],"id":"30081","properties":{"name":"Ravalli"}},{"type":"Polygon","arcs":[[1930,1931,1932,-7,1933,1934,1935,1936]],"id":"06071","properties":{"name":"San Bernardino"}},{"type":"Polygon","arcs":[[1937,1938,1939,1940,1941,1942]],"id":"13189","properties":{"name":"McDuffie"}},{"type":"MultiPolygon","arcs":[[[1943,1944,1945,1946,-1386,1947],[-1381]]],"id":"02100","properties":{"name":"Haines"}},{"type":"Polygon","arcs":[[-1432,-1404,1948,1949,1950,1951,1952]],"id":"55073","properties":{"name":"Marathon"}},{"type":"MultiPolygon","arcs":[[[1953]],[[1954]],[[1955]],[[1956]],[[1957]],[[1958]],[[1959]],[[1960,1961]],[[1962]],[[1963]],[[1964]]],"id":"02013","properties":{"name":"Aleutians East"}},{"type":"MultiPolygon","arcs":[[[1965]],[[1966]],[[1967]],[[1968]],[[1969]],[[1970,1971,1972]]],"id":"02150","properties":{"name":"Kodiak Island"}},{"type":"MultiPolygon","arcs":[[[1973,-719,1974,1975,1976,1977,-1973,1978,-1961]]],"id":"02164","properties":{"name":"Lake and Peninsula"}},{"type":"MultiPolygon","arcs":[[[1979]],[[1980]],[[1981,1982,1983,1984,1985,1986,1987]]],"id":"02261","properties":{"name":"Valdez-Cordova"}},{"type":"Polygon","arcs":[[1988,1989,-1362,-657,-113]],"id":"46035","properties":{"name":"Davison"}},{"type":"Polygon","arcs":[[1990,1991,1992,1993,1994,1995,1996,1997]],"id":"41023","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[1998,1999,2000,2001,2002,2003]],"id":"39129","properties":{"name":"Pickaway"}},{"type":"Polygon","arcs":[[-1867,2004,2005,2006,-1822]],"id":"39133","properties":{"name":"Portage"}},{"type":"Polygon","arcs":[[2007,2008,2009,2010,-804]],"id":"13131","properties":{"name":"Grady"}},{"type":"Polygon","arcs":[[2011,2012,2013,2014,2015,2016]],"id":"54075","properties":{"name":"Pocahontas"}},{"type":"Polygon","arcs":[[2017,2018,2019,2020,-1329,2021,2022]],"id":"27111","properties":{"name":"Otter Tail"}},{"type":"Polygon","arcs":[[2023,2024,2025,2026,2027,2028,2029]],"id":"13111","properties":{"name":"Fannin"}},{"type":"Polygon","arcs":[[2030,2031,2032,-24,-197,-22]],"id":"27113","properties":{"name":"Pennington"}},{"type":"Polygon","arcs":[[2033,2034,2035,2036]],"id":"17021","properties":{"name":"Christian"}},{"type":"Polygon","arcs":[[2037,2038,2039,2040,2041,-1235]],"id":"18169","properties":{"name":"Wabash"}},{"type":"Polygon","arcs":[[2042,2043,2044,2045,2046,-1176]],"id":"08085","properties":{"name":"Montrose"}},{"type":"Polygon","arcs":[[2047,2048,2049,-10,2050]],"id":"28113","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[-458,2051,2052,2053,2054,2055]],"id":"38049","properties":{"name":"McHenry"}},{"type":"Polygon","arcs":[[2056,2057,2058,2059,-1643,2060]],"id":"19177","properties":{"name":"Van Buren"}},{"type":"Polygon","arcs":[[2061,2062,2063]],"id":"17171","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[2064,-843,2065,2066,2067]],"id":"13021","properties":{"name":"Bibb"}},{"type":"Polygon","arcs":[[-974,2068,2069,-1256,-408]],"id":"26111","properties":{"name":"Midland"}},{"type":"Polygon","arcs":[[2070,2071,2072,2073,-1504,2074]],"id":"20051","properties":{"name":"Ellis"}},{"type":"Polygon","arcs":[[2075,2076,2077,-2052,-457]],"id":"38009","properties":{"name":"Bottineau"}},{"type":"Polygon","arcs":[[-851,2078,-1036,2079,-1834,2080,2081,2082,2083]],"id":"18003","properties":{"name":"Allen"}},{"type":"Polygon","arcs":[[2084,2085,2086,2087,2088,2089]],"id":"20085","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[2090,2091,2092,2093,2094,-2058]],"id":"19087","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[2095,2096,2097,-1497,2098]],"id":"18011","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[2099,2100,2101,2102,2103,-532]],"id":"06103","properties":{"name":"Tehama"}},{"type":"Polygon","arcs":[[-1236,-2042,2104,2105,2106]],"id":"18103","properties":{"name":"Miami"}},{"type":"Polygon","arcs":[[2107,2108,2109,2110,2111]],"id":"38047","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[2112,2113,2114,2115,2116,2117]],"id":"40021","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[2118,-239,-508,2119,2120,-583,2121,2122,2123,2124]],"id":"46085","properties":{"name":"Lyman"}},{"type":"Polygon","arcs":[[-26,2125,2126,2127]],"id":"27087","properties":{"name":"Mahnomen"}},{"type":"Polygon","arcs":[[-1433,-1953,2128,2129,2130,2131]],"id":"55019","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[2132,2133,-342,2134,2135,2136]],"id":"20171","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[2137,2138,2139,2140,2141]],"id":"27135","properties":{"name":"Roseau"}},{"type":"Polygon","arcs":[[2142,2143,2144,2145,2146,2147,2148]],"id":"05115","properties":{"name":"Pope"}},{"type":"Polygon","arcs":[[2149,2150,2151,2152,2153]],"id":"26095","properties":{"name":"Luce"}},{"type":"Polygon","arcs":[[-1923,2154,2155,2156,-271,2157]],"id":"29015","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[2158,2159,2160,2161,2162,-2145]],"id":"05141","properties":{"name":"Van Buren"}},{"type":"Polygon","arcs":[[2163,2164,2165,2166,2167,2168,2169,2170]],"id":"51199","properties":{"name":"York"}},{"type":"Polygon","arcs":[[-872,2171,2172,2173,2174,2175,-1473]],"id":"29067","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[2176,2177,2178,2179,-1918,2180,2181,2182,2183,2184]],"id":"30029","properties":{"name":"Flathead"}},{"type":"Polygon","arcs":[[2185,2186,2187,2188,2189]],"id":"48305","properties":{"name":"Lynn"}},{"type":"Polygon","arcs":[[2190,2191,2192,2193,2194,2195]],"id":"29065","properties":{"name":"Dent"}},{"type":"Polygon","arcs":[[2196,2197,2198,2199,-1891]],"id":"48327","properties":{"name":"Menard"}},{"type":"Polygon","arcs":[[-1025,-376,-678,2200,-430]],"id":"48353","properties":{"name":"Nolan"}},{"type":"Polygon","arcs":[[2201,-2194,2202,2203,2204,2205]],"id":"29203","properties":{"name":"Shannon"}},{"type":"Polygon","arcs":[[2206,2207,-432,2208,-217,2209]],"id":"48431","properties":{"name":"Sterling"}},{"type":"Polygon","arcs":[[2210,2211,2212,2213,2214]],"id":"08089","properties":{"name":"Otero"}},{"type":"Polygon","arcs":[[2215,2216,2217,2218,-2187]],"id":"48169","properties":{"name":"Garza"}},{"type":"Polygon","arcs":[[2219,2220,2221,2222,2223]],"id":"08119","properties":{"name":"Teller"}},{"type":"Polygon","arcs":[[2224,-2184,2225,2226,2227,2228,2229]],"id":"30089","properties":{"name":"Sanders"}},{"type":"Polygon","arcs":[[2230,-215,2231,-1648,2232,-373]],"id":"48059","properties":{"name":"Callahan"}},{"type":"Polygon","arcs":[[-1731,2233,2234,-1023,2235]],"id":"48433","properties":{"name":"Stonewall"}},{"type":"Polygon","arcs":[[2236,2237,2238,2239,-492,2240]],"id":"40051","properties":{"name":"Grady"}},{"type":"Polygon","arcs":[[2241,2242,2243,2244,2245,2246]],"id":"48159","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[2247,2248,2249,2250,2251,2252]],"id":"48467","properties":{"name":"Van Zandt"}},{"type":"Polygon","arcs":[[2253,-1008,2254,2255]],"id":"31073","properties":{"name":"Gosper"}},{"type":"Polygon","arcs":[[2256,2257,2258,2259,-351]],"id":"31059","properties":{"name":"Fillmore"}},{"type":"Polygon","arcs":[[2260,2261,2262,2263,2264,-2248,2265,2266]],"id":"48231","properties":{"name":"Hunt"}},{"type":"Polygon","arcs":[[2267,2268,-110,2269,2270]],"id":"48313","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[2271,2272,2273,2274,2275,2276,2277]],"id":"40019","properties":{"name":"Carter"}},{"type":"Polygon","arcs":[[2278,2279,2280,2281,2282]],"id":"51157","properties":{"name":"Rappahannock"}},{"type":"Polygon","arcs":[[2283,2284,2285,2286,2287]],"id":"01103","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[2288,2289,2290,2291,2292]],"id":"51079","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[2293,-1705,2294,2295,2296,2297,2298,2299,2300,-483]],"id":"02290","properties":{"name":"Yukon-Koyukuk"}},{"type":"Polygon","arcs":[[2301,2302,2303,2304,2305]],"id":"42059","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[-1882,2306,2307,2308,2309,2310]],"id":"05043","properties":{"name":"Drew"}},{"type":"Polygon","arcs":[[2311,2312,-421,2313,2314,2315,2316]],"id":"28043","properties":{"name":"Grenada"}},{"type":"Polygon","arcs":[[2317,2318],[2319]],"id":"51750","properties":{"name":"Radford"}},{"type":"Polygon","arcs":[[2320,2321,2322,2323,2324]],"id":"29211","properties":{"name":"Sullivan"}},{"type":"Polygon","arcs":[[2325,2326,2327,2328,2329]],"id":"54047","properties":{"name":"McDowell"}},{"type":"Polygon","arcs":[[2330,2331,2332,2333,2334]],"id":"37133","properties":{"name":"Onslow"}},{"type":"Polygon","arcs":[[2335,2336,2337,2338,2339,2340]],"id":"29049","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[2341,2342,2343,2344,2345,2346]],"id":"12005","properties":{"name":"Bay"}},{"type":"MultiPolygon","arcs":[[[2347,2348,2349,2350,-593,2351]],[[2352]]],"id":"53033","properties":{"name":"King"}},{"type":"Polygon","arcs":[[2353,2354,2355,2356,-2349,2357]],"id":"53007","properties":{"name":"Chelan"}},{"type":"Polygon","arcs":[[2358,2359,2360,2361]],"id":"12035","properties":{"name":"Flagler"}},{"type":"Polygon","arcs":[[-2357,2362,2363,2364,-2350]],"id":"53037","properties":{"name":"Kittitas"}},{"type":"Polygon","arcs":[[2365,2366,2367,2368]],"id":"12095","properties":{"name":"Orange"}},{"type":"Polygon","arcs":[[2369,-61,2370,2371,-1888]],"id":"13235","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[2372,2373,-2051,-9,2374,2375,2376]],"id":"28005","properties":{"name":"Amite"}},{"type":"Polygon","arcs":[[2377,2378,2379,2380,2381]],"id":"46045","properties":{"name":"Edmunds"}},{"type":"Polygon","arcs":[[-1512,2382,2383,2384,-1751]],"id":"17063","properties":{"name":"Grundy"}},{"type":"Polygon","arcs":[[2385,2386,2387,-692,2388,-740]],"id":"20151","properties":{"name":"Pratt"}},{"type":"Polygon","arcs":[[2389,2390,2391,-845,-194]],"id":"19033","properties":{"name":"Cerro Gordo"}},{"type":"Polygon","arcs":[[2392,2393,2394,2395,2396,2397]],"id":"31155","properties":{"name":"Saunders"}},{"type":"Polygon","arcs":[[2398,2399,2400,2401,2402]],"id":"05125","properties":{"name":"Saline"}},{"type":"Polygon","arcs":[[-1951,-794,-389,2403,2404]],"id":"55097","properties":{"name":"Portage"}},{"type":"Polygon","arcs":[[2405,2406,-1549,2407,2408,2409,-1268]],"id":"20037","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[2410,2411,2412,2413,2414]],"id":"48221","properties":{"name":"Hood"}},{"type":"Polygon","arcs":[[2415,2416,2417,2418,-333,-1070]],"id":"20111","properties":{"name":"Lyon"}},{"type":"Polygon","arcs":[[2419,2420,2421,2422,2423]],"id":"46047","properties":{"name":"Fall River"}},{"type":"Polygon","arcs":[[2424,-268,2425,2426,2427]],"id":"30069","properties":{"name":"Petroleum"}},{"type":"Polygon","arcs":[[2428,2429,2430,2431,2432,-2096,2433]],"id":"18023","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[-653,2434,-36,-1613,2435,2436]],"id":"38003","properties":{"name":"Barnes"}},{"type":"Polygon","arcs":[[2437,2438,2439,2440,2441]],"id":"50015","properties":{"name":"Lamoille"}},{"type":"Polygon","arcs":[[2442,2443,2444,2445,2446,2447]],"id":"13035","properties":{"name":"Butts"}},{"type":"Polygon","arcs":[[-2129,-1952,-2405,2448,2449,2450]],"id":"55141","properties":{"name":"Wood"}},{"type":"Polygon","arcs":[[2451,-195,-848,-1766,-986]],"id":"19197","properties":{"name":"Wright"}},{"type":"Polygon","arcs":[[2452,2453,2454,-509,2455,-2199]],"id":"48319","properties":{"name":"Mason"}},{"type":"Polygon","arcs":[[2456,2457,2458,2459]],"id":"48183","properties":{"name":"Gregg"}},{"type":"Polygon","arcs":[[2460,2461,2462,2463,2464,2465]],"id":"28105","properties":{"name":"Oktibbeha"}},{"type":"Polygon","arcs":[[-933,2466,2467,2468]],"id":"06057","properties":{"name":"Nevada"}},{"type":"Polygon","arcs":[[-2422,2469,2470,2471,2472]],"id":"31045","properties":{"name":"Dawes"}},{"type":"Polygon","arcs":[[2473,2474,2475,2476,2477]],"id":"41033","properties":{"name":"Josephine"}},{"type":"Polygon","arcs":[[-924,2478,2479,2480,-2258]],"id":"31151","properties":{"name":"Saline"}},{"type":"Polygon","arcs":[[-1166,2481,2482,2483,2484]],"id":"48211","properties":{"name":"Hemphill"}},{"type":"Polygon","arcs":[[2485,-2447,2486,2487,2488]],"id":"13171","properties":{"name":"Lamar"}},{"type":"Polygon","arcs":[[2489,2490,2491,2492,2493]],"id":"28065","properties":{"name":"Jefferson Davis"}},{"type":"Polygon","arcs":[[-1861,-909,2494,2495,2496,2497,2498]],"id":"39089","properties":{"name":"Licking"}},{"type":"Polygon","arcs":[[-157,2499,-1911,-776,2500,2501]],"id":"48069","properties":{"name":"Castro"}},{"type":"Polygon","arcs":[[2502,-1537,2503,2504,2505]],"id":"26009","properties":{"name":"Antrim"}},{"type":"Polygon","arcs":[[2506,2507,2508,2509,2510,-145]],"id":"20147","properties":{"name":"Phillips"}},{"type":"Polygon","arcs":[[2511,2512,2513,2514]],"id":"20067","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[-1915,2515,2516,2517]],"id":"30007","properties":{"name":"Broadwater"}},{"type":"Polygon","arcs":[[-554,2518,-751,2519,-1897,2520,-1004,2521]],"id":"31019","properties":{"name":"Buffalo"}},{"type":"Polygon","arcs":[[2522,2523,2524,2525]],"id":"32009","properties":{"name":"Esmeralda"}},{"type":"Polygon","arcs":[[2526,2527,2528,2529,2530]],"id":"37135","properties":{"name":"Orange"}},{"type":"Polygon","arcs":[[2531,2532,2533,2534,2535,2536]],"id":"16051","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[2537,-1143,2538,-849,2539]],"id":"18087","properties":{"name":"LaGrange"}},{"type":"Polygon","arcs":[[-919,2540,2541,2542,-257,2543]],"id":"19105","properties":{"name":"Jones"}},{"type":"Polygon","arcs":[[2544,2545,2546,2547,2548,2549]],"id":"19027","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[2550,2551,-654,-2437,2552,-2109,2553]],"id":"38093","properties":{"name":"Stutsman"}},{"type":"Polygon","arcs":[[2554,-989,-1062,2555,2556,-2547]],"id":"19073","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[2557,2558,2559,2560,2561,2562,2563]],"id":"01003","properties":{"name":"Baldwin"}},{"type":"Polygon","arcs":[[2564,2565,2566,-1559,2567,2568,2569]],"id":"26075","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[2570,-1574,2571,2572,2573]],"id":"47067","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[-146,-2511,2574,2575,2576,2577]],"id":"20065","properties":{"name":"Graham"}},{"type":"Polygon","arcs":[[-1727,2578,-1266,-1082]],"id":"20001","properties":{"name":"Allen"}},{"type":"Polygon","arcs":[[2579,2580,2581,2582,2583,2584]],"id":"40127","properties":{"name":"Pushmataha"}},{"type":"Polygon","arcs":[[2585,2586,2587,2588,2589]],"id":"48461","properties":{"name":"Upton"}},{"type":"Polygon","arcs":[[2590,-2381,2591,-235,2592,2593]],"id":"46107","properties":{"name":"Potter"}},{"type":"Polygon","arcs":[[-1006,2594,-2507,-144,2595]],"id":"31083","properties":{"name":"Harlan"}},{"type":"Polygon","arcs":[[2596,2597,2598,2599,2600]],"id":"19063","properties":{"name":"Emmet"}},{"type":"Polygon","arcs":[[2601,2602,2603,2604,-1582]],"id":"38019","properties":{"name":"Cavalier"}},{"type":"Polygon","arcs":[[2605,2606,2607,2608,2609,2610]],"id":"06109","properties":{"name":"Tuolumne"}},{"type":"Polygon","arcs":[[-2576,2611,-2075,-1503,2612]],"id":"20195","properties":{"name":"Trego"}},{"type":"Polygon","arcs":[[2613,-892,-123,2614,2615]],"id":"48247","properties":{"name":"Jim Hogg"}},{"type":"Polygon","arcs":[[2616,2617,2618]],"id":"55078","properties":{"name":"Menominee"}},{"type":"Polygon","arcs":[[-1895,2619,2620,2621,-2598,2622]],"id":"27091","properties":{"name":"Martin"}},{"type":"Polygon","arcs":[[2623,2624,2625,-832,2626,2627]],"id":"01085","properties":{"name":"Lowndes"}},{"type":"Polygon","arcs":[[2628,2629,-765,2630,2631,2632]],"id":"21073","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[2633,2634,2635,2636,2637]],"id":"29205","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[2638,2639,2640,2641,2642,2643]],"id":"40037","properties":{"name":"Creek"}},{"type":"Polygon","arcs":[[2644,2645,2646,2647,2648,2649]],"id":"48285","properties":{"name":"Lavaca"}},{"type":"Polygon","arcs":[[-392,2650,2651,2652,2653,2654]],"id":"55047","properties":{"name":"Green Lake"}},{"type":"Polygon","arcs":[[-555,-2522,-1003,-2254,2655,2656]],"id":"31047","properties":{"name":"Dawson"}},{"type":"Polygon","arcs":[[-1279,-1144,-2538,2657,2658]],"id":"26149","properties":{"name":"St. Joseph"}},{"type":"Polygon","arcs":[[2659,2660,2661,-817,2662,2663]],"id":"17081","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[2664,-443,2665,-2391,2666]],"id":"19131","properties":{"name":"Mitchell"}},{"type":"Polygon","arcs":[[2667,-2297,2668,-1983,2669,2670]],"id":"02240","properties":{"name":"Southeast Fairbanks"}},{"type":"Polygon","arcs":[[-1754,-1113,2671]],"id":"17155","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[2672,2673,-1127,2674,2675]],"id":"19137","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[2676,2677,-187,2678]],"id":"19017","properties":{"name":"Bremer"}},{"type":"Polygon","arcs":[[2679,-1314,2680,2681,-2661,2682]],"id":"17121","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[2683,2684,2685,2686,2687]],"id":"37025","properties":{"name":"Cabarrus"}},{"type":"Polygon","arcs":[[2688,-902,2689,-2587,2690]],"id":"48329","properties":{"name":"Midland"}},{"type":"Polygon","arcs":[[-2200,-2456,-514,2691,2692,-1675]],"id":"48267","properties":{"name":"Kimble"}},{"type":"Polygon","arcs":[[2693,2694,2695,2696,2697]],"id":"55103","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[-895,-384,2698,-1618,-377,-644]],"id":"48065","properties":{"name":"Carson"}},{"type":"Polygon","arcs":[[2699,2700,2701,2702,2703]],"id":"21061","properties":{"name":"Edmonson"}},{"type":"Polygon","arcs":[[2704,2705,2706,2707,2708,2709,2710]],"id":"18047","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[2711,2712,2713,-1776,2714,2715]],"id":"16085","properties":{"name":"Valley"}},{"type":"Polygon","arcs":[[2716,2717,2718,2719,2720,2721]],"id":"51109","properties":{"name":"Louisa"}},{"type":"Polygon","arcs":[[2722,-1067,2723,-2415,2724,2725,2726]],"id":"48363","properties":{"name":"Palo Pinto"}},{"type":"Polygon","arcs":[[2727,-2501,-780,-207,2728]],"id":"48279","properties":{"name":"Lamb"}},{"type":"Polygon","arcs":[[2729,2730,2731,2732,-2347,2733,-278]],"id":"12131","properties":{"name":"Walton"}},{"type":"Polygon","arcs":[[-45,2734,2735,2736,2737]],"id":"36039","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[-1158,2738,-452,2739,-1817,2740,2741,2742]],"id":"39037","properties":{"name":"Darke"}},{"type":"Polygon","arcs":[[-2140,2743,2744,2745,2746,2747,2748,-2032,2749]],"id":"27007","properties":{"name":"Beltrami"}},{"type":"Polygon","arcs":[[2750,2751,-864,-1298,-1294]],"id":"26133","properties":{"name":"Osceola"}},{"type":"Polygon","arcs":[[-337,2752,2753,2754,2755,2756]],"id":"20049","properties":{"name":"Elk"}},{"type":"Polygon","arcs":[[2757,2758,2759,2760,2761]],"id":"20075","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[2762,2763,2764,2765,-1689,-1714,2766,2767]],"id":"27137","properties":{"name":"St. Louis"}},{"type":"Polygon","arcs":[[2768,2769,2770,-2092,2771,2772]],"id":"19183","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-214,2773,-2726,2774,2775,-1649,-2232]],"id":"48133","properties":{"name":"Eastland"}},{"type":"Polygon","arcs":[[-2692,-513,2776,2777,2778,2779]],"id":"48265","properties":{"name":"Kerr"}},{"type":"Polygon","arcs":[[2780,2781,2782,2783,2784,2785]],"id":"36003","properties":{"name":"Allegany"}},{"type":"Polygon","arcs":[[-779,2786,-2186,-208]],"id":"48303","properties":{"name":"Lubbock"}},{"type":"Polygon","arcs":[[2787,2788]],"id":"51775","properties":{"name":"Salem"}},{"type":"Polygon","arcs":[[2789,2790]],"id":"51670","properties":{"name":"Hopewell"}},{"type":"Polygon","arcs":[[2791,2792,2793,2794,-1742,2795]],"id":"17073","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[2796,2797,-1002,2798,2799]],"id":"28079","properties":{"name":"Leake"}},{"type":"Polygon","arcs":[[2800,2801,2802,2803,2804,2805,2806]],"id":"35057","properties":{"name":"Torrance"}},{"type":"Polygon","arcs":[[2807,2808,-124,2809,2810]],"id":"08095","properties":{"name":"Phillips"}},{"type":"Polygon","arcs":[[2811,-2810,-128,2812,2813,2814,-978]],"id":"08125","properties":{"name":"Yuma"}},{"type":"Polygon","arcs":[[2815,2816,2817,2818]],"id":"19141","properties":{"name":"O'Brien"}},{"type":"Polygon","arcs":[[-2800,2819,2820,2821,2822]],"id":"28123","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[-547,2823,2824,2825,-552]],"id":"31175","properties":{"name":"Valley"}},{"type":"Polygon","arcs":[[2826,-1254,2827,2828,-2684,2829,2830,2831,-1903]],"id":"37097","properties":{"name":"Iredell"}},{"type":"Polygon","arcs":[[2832,2833,2834,2835,2836]],"id":"01057","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[2837,2838,-148,2839,-856,2840]],"id":"20039","properties":{"name":"Decatur"}},{"type":"Polygon","arcs":[[2841,2842,2843,2844,2845,-1994]],"id":"41001","properties":{"name":"Baker"}},{"type":"Polygon","arcs":[[2846,2847,2848,2849,2850]],"id":"01133","properties":{"name":"Winston"}},{"type":"Polygon","arcs":[[2851,2852,2853,2854,2855]],"id":"29221","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[2856,2857,2858,2859,2860,2861,2862]],"id":"18007","properties":{"name":"Benton"}},{"type":"MultiPolygon","arcs":[[[2863]],[[2864]],[[2865]],[[2866,2867,2868,2869]]],"id":"06083","properties":{"name":"Santa Barbara"}},{"type":"Polygon","arcs":[[2870,-533,-2104,2871,2872]],"id":"06105","properties":{"name":"Trinity"}},{"type":"Polygon","arcs":[[2873,2874,2875,2876,2877,2878]],"id":"17117","properties":{"name":"Macoupin"}},{"type":"Polygon","arcs":[[2879,2880,2881,2882,-1257,-2070]],"id":"26145","properties":{"name":"Saginaw"}},{"type":"Polygon","arcs":[[-2725,-2414,2883,2884,-661,2885,-2775]],"id":"48143","properties":{"name":"Erath"}},{"type":"MultiPolygon","arcs":[[[2886,2887,2888,2889,2890,2891]],[[2892,2893]]],"id":"12101","properties":{"name":"Pasco"}},{"type":"Polygon","arcs":[[2894,2895,-775,2896,2897]],"id":"37169","properties":{"name":"Stokes"}},{"type":"Polygon","arcs":[[2898,2899,-2716,2900,2901,2902,2903]],"id":"16045","properties":{"name":"Gem"}},{"type":"Polygon","arcs":[[2904,2905,2906,2907,2908]],"id":"54021","properties":{"name":"Gilmer"}},{"type":"Polygon","arcs":[[-695,2909,2910,2911,2912,2913]],"id":"40003","properties":{"name":"Alfalfa"}},{"type":"Polygon","arcs":[[2914,2915,2916,2917,2918,-1484,2919]],"id":"20201","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[2920,2921,2922,2923,2924]],"id":"13109","properties":{"name":"Evans"}},{"type":"Polygon","arcs":[[2925,2926,2927,-1162,2928,2929,2930]],"id":"18065","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[2931,2932,2933,2934]],"id":"45023","properties":{"name":"Chester"}},{"type":"Polygon","arcs":[[2935,-1934,-6,2936,2937,2938,2939]],"id":"04012","properties":{"name":"La Paz"}},{"type":"Polygon","arcs":[[2940,2941,2942,-550,2943,-424]],"id":"31009","properties":{"name":"Blaine"}},{"type":"Polygon","arcs":[[-2714,2944,-1929,-1467,2945,2946,-1771]],"id":"16059","properties":{"name":"Lemhi"}},{"type":"Polygon","arcs":[[2947,-996,2948,2949,2950]],"id":"20069","properties":{"name":"Gray"}},{"type":"Polygon","arcs":[[-2315,2951,2952,2953,2954]],"id":"28097","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[2955,2956,2957,2958,-2457,2959,2960]],"id":"48459","properties":{"name":"Upshur"}},{"type":"Polygon","arcs":[[2961,2962,2963,2964,2965,2966,-511]],"id":"48031","properties":{"name":"Blanco"}},{"type":"Polygon","arcs":[[2967,2968,2969,2970,2971]],"id":"20061","properties":{"name":"Geary"}},{"type":"Polygon","arcs":[[2972,2973,2974,2975,2976,2977]],"id":"21041","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[2978,2979,-1233,-1516,2980]],"id":"18099","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[2981,-774,2982,-1145,2983]],"id":"37081","properties":{"name":"Guilford"}},{"type":"Polygon","arcs":[[2984,2985]],"id":"51610","properties":{"name":"Falls Church"}},{"type":"Polygon","arcs":[[2986]],"id":"51678","properties":{"name":"Lexington"}},{"type":"Polygon","arcs":[[2987,-2569,2988,2989,2990,2991,-1141]],"id":"26059","properties":{"name":"Hillsdale"}},{"type":"Polygon","arcs":[[-1153,2992,-2137,2993,-2759,2994]],"id":"20203","properties":{"name":"Wichita"}},{"type":"Polygon","arcs":[[-1875,2995,2996,2997,2998]],"id":"27039","properties":{"name":"Dodge"}},{"type":"Polygon","arcs":[[2999,-1118,3000,-1194]],"id":"17039","properties":{"name":"De Witt"}},{"type":"Polygon","arcs":[[-1657,-903,-2689,3001,3002,3003]],"id":"48003","properties":{"name":"Andrews"}},{"type":"Polygon","arcs":[[3004,-1394,-561,3005,-1989,-112,3006]],"id":"46111","properties":{"name":"Sanborn"}},{"type":"Polygon","arcs":[[3007,3008,-1878,3009,3010,3011]],"id":"27079","properties":{"name":"Le Sueur"}},{"type":"Polygon","arcs":[[3012,3013,3014,3015,-936,3016]],"id":"55105","properties":{"name":"Rock"}},{"type":"Polygon","arcs":[[-1876,-2999,3017,-1305,3018]],"id":"27147","properties":{"name":"Steele"}},{"type":"Polygon","arcs":[[3019,3020,3021,3022,3023,3024]],"id":"42065","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[3025,3026,-991,3027,3028]],"id":"19151","properties":{"name":"Pocahontas"}},{"type":"Polygon","arcs":[[-1445,-1291,3029,3030,3031,-701]],"id":"27105","properties":{"name":"Nobles"}},{"type":"MultiPolygon","arcs":[[[3032,3033]],[[3034]],[[3035]],[[3036]],[[3037]],[[-1593,3038]],[[3039,3040]]],"id":"02198","properties":{"name":"Prince of Wales-Hyder"}},{"type":"Polygon","arcs":[[3041,3042,3043,-315]],"id":"46121","properties":{"name":"Todd"}},{"type":"Polygon","arcs":[[3044,3045,3046,3047,3048]],"id":"13003","properties":{"name":"Atkinson"}},{"type":"MultiPolygon","arcs":[[[-3041,3049]],[[3050]],[[-1382,3051]]],"id":"02220","properties":{"name":"Sitka"}},{"type":"Polygon","arcs":[[-2316,-2955,3052,3053,3054]],"id":"28015","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[3055,3056,-1762,3057]],"id":"12111","properties":{"name":"St. Lucie"}},{"type":"Polygon","arcs":[[-254,-2061,-1642,3058,3059]],"id":"19051","properties":{"name":"Davis"}},{"type":"Polygon","arcs":[[3060,3061,3062,3063,3064]],"id":"17109","properties":{"name":"McDonough"}},{"type":"Polygon","arcs":[[3065,3066,3067,3068,3069]],"id":"39143","properties":{"name":"Sandusky"}},{"type":"Polygon","arcs":[[-2682,3070,-1133,3071,3072,-818,-2662]],"id":"17191","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[3073,3074,3075,3076,3077,3078]],"id":"48243","properties":{"name":"Jeff Davis"}},{"type":"Polygon","arcs":[[3079,-815,3080,-3008,3081,3082]],"id":"27143","properties":{"name":"Sibley"}},{"type":"Polygon","arcs":[[3083,-1047,3084,-1730]],"id":"48275","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[3085,3086,3087,3088,3089,3090,3091]],"id":"17163","properties":{"name":"St. Clair"}},{"type":"Polygon","arcs":[[-745,3092,3093,3094,-972]],"id":"26011","properties":{"name":"Arenac"}},{"type":"Polygon","arcs":[[-1319,3095,3096,3097,-1128,3098]],"id":"17079","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[-1485,-2919,3099,-2968,3100,3101]],"id":"20027","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[3102,3103,3104,3105,-1930,-2945,-2713,3106,3107]],"id":"16049","properties":{"name":"Idaho"}},{"type":"Polygon","arcs":[[3108,-1586,3109,-2077]],"id":"38079","properties":{"name":"Rolette"}},{"type":"Polygon","arcs":[[-2840,-147,-2578,3110,-857]],"id":"20179","properties":{"name":"Sheridan"}},{"type":"Polygon","arcs":[[3111,3112,-2962,-510,-2455]],"id":"48299","properties":{"name":"Llano"}},{"type":"Polygon","arcs":[[3113,3114,3115,-2215,3116,3117,3118]],"id":"08101","properties":{"name":"Pueblo"}},{"type":"Polygon","arcs":[[3119,3120,-2478,3121,3122]],"id":"41015","properties":{"name":"Curry"}},{"type":"Polygon","arcs":[[3123,-2465,3124,3125,-999,3126]],"id":"28159","properties":{"name":"Winston"}},{"type":"Polygon","arcs":[[-2521,-1901,3127,3128,-1005]],"id":"31099","properties":{"name":"Kearney"}},{"type":"Polygon","arcs":[[3129,-2305,3130,3131,3132,3133,3134,3135]],"id":"54103","properties":{"name":"Wetzel"}},{"type":"Polygon","arcs":[[3136,-801,3137,3138]],"id":"13201","properties":{"name":"Miller"}},{"type":"Polygon","arcs":[[-1788,3139,3140,3141,-130]],"id":"08003","properties":{"name":"Alamosa"}},{"type":"Polygon","arcs":[[-741,-2389,-698,3142,3143,-993]],"id":"20097","properties":{"name":"Kiowa"}},{"type":"Polygon","arcs":[[3144,3145,3146,-674]],"id":"38041","properties":{"name":"Hettinger"}},{"type":"Polygon","arcs":[[-2997,3147,3148,3149,3150,3151]],"id":"27109","properties":{"name":"Olmsted"}},{"type":"Polygon","arcs":[[-1785,3152,-2550,-1096,3153,3154]],"id":"19047","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[3155,3156,3157,-1203,3158,-2418]],"id":"20139","properties":{"name":"Osage"}},{"type":"Polygon","arcs":[[3159,-191,3160,-733,-1769]],"id":"19075","properties":{"name":"Grundy"}},{"type":"Polygon","arcs":[[3161,3162,-860,3163,-1151,3164]],"id":"20181","properties":{"name":"Sherman"}},{"type":"Polygon","arcs":[[-2549,3165,3166,-1097]],"id":"19009","properties":{"name":"Audubon"}},{"type":"MultiPolygon","arcs":[[[3167]],[[3168]],[[3169]],[[3170]],[[3171,-705,3172,3173,3174,3175]]],"id":"23009","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[3176,3177,3178,3179,3180,3181]],"id":"05081","properties":{"name":"Little River"}},{"type":"Polygon","arcs":[[3182,3183,3184,3185]],"id":"05143","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[3186,3187,3188,3189,-2399,3190]],"id":"05119","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[3191,3192,3193,3194,-3188,3195]],"id":"05085","properties":{"name":"Lonoke"}},{"type":"Polygon","arcs":[[3196,3197,3198,3199,3200,3201,3202]],"id":"08009","properties":{"name":"Baca"}},{"type":"Polygon","arcs":[[3203,3204,3205,3206,3207,3208,3209,3210]],"id":"16031","properties":{"name":"Cassia"}},{"type":"Polygon","arcs":[[3211,3212,3213,3214,3215,3216,3217]],"id":"01021","properties":{"name":"Chilton"}},{"type":"Polygon","arcs":[[-1890,3218,3219,3220,3221,-165]],"id":"13081","properties":{"name":"Crisp"}},{"type":"Polygon","arcs":[[3222,3223,-1443,-1454,3224]],"id":"27083","properties":{"name":"Lyon"}},{"type":"Polygon","arcs":[[3225,3226,3227,3228,3229,3230]],"id":"51049","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[3231,3232,3233,3234,3235,3236]],"id":"31133","properties":{"name":"Pawnee"}},{"type":"Polygon","arcs":[[-2484,3237,-504,3238,-1617]],"id":"48483","properties":{"name":"Wheeler"}},{"type":"Polygon","arcs":[[-361,3239,3240,-30,-2435,-652]],"id":"38091","properties":{"name":"Steele"}},{"type":"Polygon","arcs":[[-883,-925,-2257,-350,3241]],"id":"31185","properties":{"name":"York"}},{"type":"Polygon","arcs":[[-2504,-868,3242,3243]],"id":"26079","properties":{"name":"Kalkaska"}},{"type":"Polygon","arcs":[[-2510,3244,3245,-2071,-2612,-2575]],"id":"20163","properties":{"name":"Rooks"}},{"type":"Polygon","arcs":[[3246,3247,3248,-3096,-1318]],"id":"17035","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[3249,3250,3251,3252,-2012,3253,3254]],"id":"54101","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[3255,3256,3257,3258,3259]],"id":"28139","properties":{"name":"Tippah"}},{"type":"Polygon","arcs":[[3260,3261,3262,3263,3264,3265,-3045,3266]],"id":"13069","properties":{"name":"Coffee"}},{"type":"Polygon","arcs":[[3267,3268,3269,3270,3271]],"id":"20169","properties":{"name":"Saline"}},{"type":"Polygon","arcs":[[3272,3273,3274,3275]],"id":"28119","properties":{"name":"Quitman"}},{"type":"Polygon","arcs":[[-2553,-2436,-1615,-304,3276,-2110]],"id":"38045","properties":{"name":"LaMoure"}},{"type":"Polygon","arcs":[[3277,-3272,3278,3279,3280,3281]],"id":"20053","properties":{"name":"Ellsworth"}},{"type":"Polygon","arcs":[[3282,3283,3284,-63,3285,3286,3287,3288]],"id":"18055","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[3289,3290,-1646,3291,3292,3293,-2322]],"id":"29001","properties":{"name":"Adair"}},{"type":"Polygon","arcs":[[3294,3295,3296,3297,-907,3298]],"id":"39075","properties":{"name":"Holmes"}},{"type":"Polygon","arcs":[[-2146,-2163,3299,3300,3301]],"id":"05029","properties":{"name":"Conway"}},{"type":"Polygon","arcs":[[-1517,-1238,3302,3303,3304]],"id":"18131","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[3305,3306,-202,-748,3307,-2825]],"id":"31077","properties":{"name":"Greeley"}},{"type":"Polygon","arcs":[[3308,-518,-2216,-2787]],"id":"48107","properties":{"name":"Crosby"}},{"type":"Polygon","arcs":[[3309,3310,3311,3312,3313,3314,3315]],"id":"21083","properties":{"name":"Graves"}},{"type":"Polygon","arcs":[[3316,3317,3318,3319,3320,3321]],"id":"21171","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[3322,-1316,3323,3324]],"id":"17005","properties":{"name":"Bond"}},{"type":"Polygon","arcs":[[3325,3326,3327,3328,3329,3330,3331]],"id":"05097","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[3332,3333,3334,3335,3336,-1171]],"id":"47159","properties":{"name":"Smith"}},{"type":"Polygon","arcs":[[3337,3338,3339,3340,3341,3342]],"id":"17045","properties":{"name":"Edgar"}},{"type":"Polygon","arcs":[[3343,3344,3345,3346,3347,3348]],"id":"42021","properties":{"name":"Cambria"}},{"type":"Polygon","arcs":[[3349,3350,3351,3352,3353,3354]],"id":"41043","properties":{"name":"Linn"}},{"type":"Polygon","arcs":[[-824,-312,3355,-3083,3356,3357,3358,3359,3360]],"id":"27129","properties":{"name":"Renville"}},{"type":"Polygon","arcs":[[3361,3362,3363,3364,-1330,-2021]],"id":"27153","properties":{"name":"Todd"}},{"type":"Polygon","arcs":[[3365,3366,3367,3368,-3351,3369]],"id":"41047","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[3370,-205,3371,3372,3373,3374,3375]],"id":"42071","properties":{"name":"Lancaster"}},{"type":"Polygon","arcs":[[3376,3377,3378,3379,-2161]],"id":"05023","properties":{"name":"Cleburne"}},{"type":"Polygon","arcs":[[3380,3381,-3262,3382,3383]],"id":"13017","properties":{"name":"Ben Hill"}},{"type":"MultiPolygon","arcs":[[[3384]],[[3385]],[[3386]],[[3387,3388]]],"id":"15009","properties":{"name":"Maui"}},{"type":"Polygon","arcs":[[3389,3390,3391,3392,3393,-1525]],"id":"29169","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[-1359,3394,-889,-521]],"id":"48311","properties":{"name":"McMullen"}},{"type":"Polygon","arcs":[[-983,-920,-2544,-256,3395,3396]],"id":"19113","properties":{"name":"Linn"}},{"type":"Polygon","arcs":[[-383,-590,3397,-1167,-2485,-1616,-2699]],"id":"48393","properties":{"name":"Roberts"}},{"type":"Polygon","arcs":[[-1799,3398,-2773,3399,-252,-1185]],"id":"19107","properties":{"name":"Keokuk"}},{"type":"Polygon","arcs":[[-2002,3400,3401,3402,3403,3404]],"id":"39073","properties":{"name":"Hocking"}},{"type":"Polygon","arcs":[[3405,3406,3407,3408,3409]],"id":"13053","properties":{"name":"Chattahoochee"}},{"type":"Polygon","arcs":[[3410,-2427,3411,3412,-1414]],"id":"30065","properties":{"name":"Musselshell"}},{"type":"Polygon","arcs":[[3413,-604,3414,3415]],"id":"13149","properties":{"name":"Heard"}},{"type":"Polygon","arcs":[[3416,3417]],"id":"27031","properties":{"name":"Cook"}},{"type":"Polygon","arcs":[[3418,3419,-2545,-3153,-1784]],"id":"19161","properties":{"name":"Sac"}},{"type":"Polygon","arcs":[[3420,3421,3422,-2528,3423]],"id":"37145","properties":{"name":"Person"}},{"type":"Polygon","arcs":[[-2295,-1704,3424]],"id":"02185","properties":{"name":"North Slope"}},{"type":"Polygon","arcs":[[3425,-2083,3426,3427,-2040]],"id":"18069","properties":{"name":"Huntington"}},{"type":"Polygon","arcs":[[3428,-2855,3429,3430,3431,3432,-2192]],"id":"29093","properties":{"name":"Iron"}},{"type":"Polygon","arcs":[[-517,-2236,-1022,3433,-2217]],"id":"48263","properties":{"name":"Kent"}},{"type":"Polygon","arcs":[[3434,3435,-2319,3436,3437,3438,3439,3440]],"id":"51155","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[3441,-1639,-1533,3442,3443,-2337]],"id":"29025","properties":{"name":"Caldwell"}},{"type":"Polygon","arcs":[[3444,3445,3446,3447,3448,3449]],"id":"01073","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[3450]],"id":"15001","properties":{"name":"Hawaii"}},{"type":"Polygon","arcs":[[3451,3452,3453,3454]],"id":"53023","properties":{"name":"Garfield"}},{"type":"Polygon","arcs":[[3455,3456,3457,3458,3459]],"id":"01027","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[3460,3461,-1786,3462,3463,3464,3465]],"id":"19193","properties":{"name":"Woodbury"}},{"type":"Polygon","arcs":[[3466,-1099,3467,-2673,3468,3469,3470,3471]],"id":"19155","properties":{"name":"Pottawattamie"}},{"type":"Polygon","arcs":[[-1773,3472,3473,3474,-3206,3475,-17,3476,3477]],"id":"16013","properties":{"name":"Blaine"}},{"type":"MultiPolygon","arcs":[[[3478]],[[3479,3480,-3176,3481,3482,3483,3484]]],"id":"23027","properties":{"name":"Waldo"}},{"type":"Polygon","arcs":[[3485,3486,3487,3488,3489,3490]],"id":"25025","properties":{"name":"Suffolk"}},{"type":"Polygon","arcs":[[3491,3492,3493,3494,3495,3496]],"id":"25011","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-973,-3095,3497,3498,-2880,-2069]],"id":"26017","properties":{"name":"Bay"}},{"type":"Polygon","arcs":[[3499,3500,-3225,-1453,3501]],"id":"27081","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[3502,3503,3504,3505,3506,3507]],"id":"28011","properties":{"name":"Bolivar"}},{"type":"Polygon","arcs":[[3508,3509,3510,-997,-953]],"id":"26007","properties":{"name":"Alpena"}},{"type":"Polygon","arcs":[[3511,3512,3513,3514,3515]],"id":"26053","properties":{"name":"Gogebic"}},{"type":"Polygon","arcs":[[3516,-289,3517,3518,-3480,3519,3520]],"id":"23025","properties":{"name":"Somerset"}},{"type":"Polygon","arcs":[[3521,3522,3523,3524,3525,3526,3527,3528,3529]],"id":"28149","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[3530,3531,3532,3533,3534,3535,3536]],"id":"36075","properties":{"name":"Oswego"}},{"type":"Polygon","arcs":[[3537,-3359,3538,-1287,-1444,-3224]],"id":"27127","properties":{"name":"Redwood"}},{"type":"Polygon","arcs":[[3539,3540,3541,3542,3543,3544,3545]],"id":"39095","properties":{"name":"Lucas"}},{"type":"Polygon","arcs":[[3546,-260,3547,3548,3549]],"id":"19139","properties":{"name":"Muscatine"}},{"type":"Polygon","arcs":[[-494,3550,3551,3552,3553,3554]],"id":"40033","properties":{"name":"Cotton"}},{"type":"Polygon","arcs":[[-3469,-2676,3555,3556,3557]],"id":"19129","properties":{"name":"Mills"}},{"type":"Polygon","arcs":[[3558,3559,3560,3561]],"id":"36059","properties":{"name":"Nassau"}},{"type":"Polygon","arcs":[[3562,3563,3564,3565,3566,3567]],"id":"30109","properties":{"name":"Wibaux"}},{"type":"Polygon","arcs":[[3568,3569,3570,3571,3572]],"id":"29155","properties":{"name":"Pemiscot"}},{"type":"Polygon","arcs":[[3573,3574,3575,3576,3577,-2636]],"id":"29127","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[3578,3579,-1568,3580,3581]],"id":"35017","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[3582,-138,3583,3584,3585,3586,3587,3588]],"id":"51107","properties":{"name":"Loudoun"}},{"type":"Polygon","arcs":[[3589,3590,3591,3592,3593,-1370]],"id":"46105","properties":{"name":"Perkins"}},{"type":"Polygon","arcs":[[3594,-2966,3595,3596,3597]],"id":"48091","properties":{"name":"Comal"}},{"type":"Polygon","arcs":[[3598,-2616,3599,3600]],"id":"48505","properties":{"name":"Zapata"}},{"type":"MultiPolygon","arcs":[[[3601,3602,3603,3604]],[[3605,3606,3607,3608]],[[3609,3610,3611]]],"id":"48007","properties":{"name":"Aransas"}},{"type":"Polygon","arcs":[[3612,3613,3614,3615,3616,3617]],"id":"48361","properties":{"name":"Orange"}},{"type":"Polygon","arcs":[[3618,-3003,3619,3620,3621]],"id":"48495","properties":{"name":"Winkler"}},{"type":"Polygon","arcs":[[3622,3623,3624,3625,3626,3627]],"id":"51011","properties":{"name":"Appomattox"}},{"type":"Polygon","arcs":[[3628,3629,3630,-1057,3631,3632,3633,-2364]],"id":"53025","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[3634,-3134,3635,3636,-2906,3637]],"id":"54017","properties":{"name":"Doddridge"}},{"type":"Polygon","arcs":[[3638,-526,3639,3640,-2013,-3253,3641]],"id":"54083","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[-3031,3642,3643,-2816,3644]],"id":"19143","properties":{"name":"Osceola"}},{"type":"Polygon","arcs":[[-1264,3645,3646,3647,3648]],"id":"21189","properties":{"name":"Owsley"}},{"type":"Polygon","arcs":[[3649,3650,-1027,3651]],"id":"37181","properties":{"name":"Vance"}},{"type":"Polygon","arcs":[[-685,3652,3653,3654,3655,3656]],"id":"04007","properties":{"name":"Gila"}},{"type":"Polygon","arcs":[[3657,3658,3659,3660,-2159,-2144,3661]],"id":"05129","properties":{"name":"Searcy"}},{"type":"Polygon","arcs":[[3662,3663,3664,3665,3666,3667]],"id":"05095","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[3668,3669,-2342,-2733]],"id":"12133","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[3670,3671,-1703,3672,-2444,3673]],"id":"13217","properties":{"name":"Newton"}},{"type":"Polygon","arcs":[[3674,3675,3676,-2888,3677,3678]],"id":"12119","properties":{"name":"Sumter"}},{"type":"Polygon","arcs":[[-1522,3679,-2710,3680,-69,3681]],"id":"18031","properties":{"name":"Decatur"}},{"type":"Polygon","arcs":[[3682,3683,3684,-982,-2678]],"id":"19065","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[3685,-735,-1800,-1183,-1790,-1811]],"id":"19099","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[3686,3687,-1265,-3649,3688,3689,3690]],"id":"21109","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[3691,3692,3693,-3523,3694,3695]],"id":"22035","properties":{"name":"East Carroll"}},{"type":"Polygon","arcs":[[-810,3696,3697,3698,3699,3700]],"id":"22113","properties":{"name":"Vermilion"}},{"type":"Polygon","arcs":[[3701,3702,3703,3704,-807,3705]],"id":"22039","properties":{"name":"Evangeline"}},{"type":"Polygon","arcs":[[3706,-1640,-3442,-2336,3707,3708]],"id":"29063","properties":{"name":"DeKalb"}},{"type":"Polygon","arcs":[[-1248,3709,3710,3711,-2852,3712,3713]],"id":"29071","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[3714,3715,-3232,3716]],"id":"31097","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[3717,-630,3718,-3306,-2824,-546]],"id":"31183","properties":{"name":"Wheeler"}},{"type":"Polygon","arcs":[[3719,3720,3721,3722,-1564,-3580,3723]],"id":"35051","properties":{"name":"Sierra"}},{"type":"Polygon","arcs":[[3724,3725,3726,3727,3728,3729]],"id":"37107","properties":{"name":"Lenoir"}},{"type":"Polygon","arcs":[[3730,3731,3732,3733,3734,3735]],"id":"37045","properties":{"name":"Cleveland"}},{"type":"Polygon","arcs":[[3736,3737,3738,3739,3740]],"id":"31105","properties":{"name":"Kimball"}},{"type":"Polygon","arcs":[[3741,3742,-2118,3743,3744,3745]],"id":"40145","properties":{"name":"Wagoner"}},{"type":"Polygon","arcs":[[3746,3747,3748,3749]],"id":"40027","properties":{"name":"Cleveland"}},{"type":"Polygon","arcs":[[3750,3751,3752,-2274]],"id":"40099","properties":{"name":"Murray"}},{"type":"Polygon","arcs":[[3753,3754,3755,3756,-965]],"id":"42003","properties":{"name":"Allegheny"}},{"type":"Polygon","arcs":[[3757,3758,3759,-2935,3760,3761,3762]],"id":"45087","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[3763,-240,-2119,3764]],"id":"46065","properties":{"name":"Hughes"}},{"type":"Polygon","arcs":[[3765,3766,3767,3768,3769,3770]],"id":"21235","properties":{"name":"Whitley"}},{"type":"Polygon","arcs":[[3771,3772,-1021,3773,3774,3775]],"id":"37175","properties":{"name":"Transylvania"}},{"type":"Polygon","arcs":[[3776,3777,3778,3779,3780,3781,-3727]],"id":"37049","properties":{"name":"Craven"}},{"type":"Polygon","arcs":[[-2235,3782,-216,-2231,-372,-1024]],"id":"48253","properties":{"name":"Jones"}},{"type":"Polygon","arcs":[[3783]],"id":"51720","properties":{"name":"Norton"}},{"type":"Polygon","arcs":[[3784,3785,3786,3787,3788,3789]],"id":"39105","properties":{"name":"Meigs"}},{"type":"Polygon","arcs":[[3790,3791,-3790,3792,3793,3794]],"id":"39053","properties":{"name":"Gallia"}},{"type":"Polygon","arcs":[[3795,-3254,-2017,3796,3797,3798,3799,3800]],"id":"54025","properties":{"name":"Greenbrier"}},{"type":"Polygon","arcs":[[3801,3802,3803,-569,3804]],"id":"05111","properties":{"name":"Poinsett"}},{"type":"Polygon","arcs":[[3805,3806,3807,-2610,3808,3809,3810]],"id":"06099","properties":{"name":"Stanislaus"}},{"type":"Polygon","arcs":[[3811,3812,3813,3814,3815]],"id":"06011","properties":{"name":"Colusa"}},{"type":"Polygon","arcs":[[3816,3817,3818,3819,3820]],"id":"13089","properties":{"name":"DeKalb"}},{"type":"Polygon","arcs":[[3821,3822,3823,3824,3825]],"id":"13311","properties":{"name":"White"}},{"type":"Polygon","arcs":[[3826,3827,3828,-726,3829,3830]],"id":"13115","properties":{"name":"Floyd"}},{"type":"Polygon","arcs":[[3831,-20,3832,3833,3834]],"id":"16047","properties":{"name":"Gooding"}},{"type":"Polygon","arcs":[[3835,-938,-1090,3836,3837,3838]],"id":"17141","properties":{"name":"Ogle"}},{"type":"Polygon","arcs":[[3839,3840,3841,-3564,3842]],"id":"30083","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[3843,3844,3845,3846,3847]],"id":"37065","properties":{"name":"Edgecombe"}},{"type":"Polygon","arcs":[[3848,3849,-591,-894,3850]],"id":"48421","properties":{"name":"Sherman"}},{"type":"Polygon","arcs":[[3851,3852,3853,3854,3855]],"id":"01017","properties":{"name":"Chambers"}},{"type":"Polygon","arcs":[[-1213,-1218,3856,3857,-2606,3858]],"id":"06003","properties":{"name":"Alpine"}},{"type":"Polygon","arcs":[[-2476,3859,3860,3861,-528,-2871,3862,3863]],"id":"06093","properties":{"name":"Siskiyou"}},{"type":"Polygon","arcs":[[3864,3865,3866,-1179]],"id":"08083","properties":{"name":"Montezuma"}},{"type":"Polygon","arcs":[[3867,3868,-2030,3869,3870,3871]],"id":"13213","properties":{"name":"Murray"}},{"type":"Polygon","arcs":[[3872,3873,3874,3875,3876,-3208]],"id":"16071","properties":{"name":"Oneida"}},{"type":"Polygon","arcs":[[3877,3878,3879,3880,3881,3882]],"id":"18129","properties":{"name":"Posey"}},{"type":"Polygon","arcs":[[3883,3884,3885,3886,3887,3888,3889,3890,3891]],"id":"21093","properties":{"name":"Hardin"}},{"type":"Polygon","arcs":[[-3616,3892,3893,-3700,3894,3895]],"id":"22023","properties":{"name":"Cameron"}},{"type":"Polygon","arcs":[[3896,3897,3898,3899,-1200]],"id":"20121","properties":{"name":"Miami"}},{"type":"Polygon","arcs":[[-2715,-1775,3900,3901,-2901]],"id":"16015","properties":{"name":"Boise"}},{"type":"Polygon","arcs":[[-2535,3902,3903,3904,3905,3906,3907]],"id":"16019","properties":{"name":"Bonneville"}},{"type":"Polygon","arcs":[[3908,3909,3910,3911,3912,3913,3914]],"id":"25023","properties":{"name":"Plymouth"}},{"type":"Polygon","arcs":[[3915,3916,3917,3918,3919,3920,3921,3922]],"id":"22077","properties":{"name":"Pointe Coupee"}},{"type":"Polygon","arcs":[[3923,3924,-1604,-170,3925]],"id":"26043","properties":{"name":"Dickinson"}},{"type":"Polygon","arcs":[[-2408,-1548,3926,3927,-1588,3928]],"id":"29097","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[3929,-2514,3930,3931,3932,3933]],"id":"20189","properties":{"name":"Stevens"}},{"type":"Polygon","arcs":[[3934,3935,3936,3937,3938,3939]],"id":"17085","properties":{"name":"Jo Daviess"}},{"type":"Polygon","arcs":[[-3063,3940,-1745,3941,-1805,3942,3943]],"id":"17057","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[3944,-718,3945,3946,3947,-356]],"id":"36055","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[3948,-3418,3949,-2764]],"id":"27075","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[3950,3951,3952,3953,3954]],"id":"41037","properties":{"name":"Lake"}},{"type":"MultiPolygon","arcs":[[[3955,3956]],[[3957]]],"id":"44005","properties":{"name":"Newport"}},{"type":"Polygon","arcs":[[3958,3959,3960,3961,3962,3963,3964]],"id":"36043","properties":{"name":"Herkimer"}},{"type":"Polygon","arcs":[[3965,-3202,3966,3967,3968,3969,3970,3971]],"id":"35059","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[3972,3973,3974,3975,3976,3977]],"id":"48071","properties":{"name":"Chambers"}},{"type":"Polygon","arcs":[[3978,3979,3980,-3630,3981,-2355,3982,3983]],"id":"53047","properties":{"name":"Okanogan"}},{"type":"Polygon","arcs":[[3984,3985,3986,3987,-3447,3988]],"id":"01115","properties":{"name":"St. Clair"}},{"type":"Polygon","arcs":[[3989,3990,3991,3992,3993]],"id":"55059","properties":{"name":"Kenosha"}},{"type":"Polygon","arcs":[[-393,-2655,3994,3995]],"id":"55077","properties":{"name":"Marquette"}},{"type":"Polygon","arcs":[[-404,3996,3997,3998,3999,-1401,-1431,4000]],"id":"55099","properties":{"name":"Price"}},{"type":"Polygon","arcs":[[-2229,4001,4002,4003,-688,4004,4005]],"id":"16079","properties":{"name":"Shoshone"}},{"type":"Polygon","arcs":[[4006,4007,-1905,4008,4009,4010]],"id":"37027","properties":{"name":"Caldwell"}},{"type":"Polygon","arcs":[[4011,4012,4013,4014]],"id":"38065","properties":{"name":"Oliver"}},{"type":"Polygon","arcs":[[-3234,4015,4016,4017,4018,4019]],"id":"31147","properties":{"name":"Richardson"}},{"type":"Polygon","arcs":[[4020,4021,-2838,4022,-1541]],"id":"31145","properties":{"name":"Red Willow"}},{"type":"Polygon","arcs":[[4023,4024,4025,-3618,4026,4027]],"id":"48199","properties":{"name":"Hardin"}},{"type":"Polygon","arcs":[[4028,4029,-1042,4030,4031,4032,4033,4034]],"id":"01077","properties":{"name":"Lauderdale"}},{"type":"Polygon","arcs":[[-467,4035,4036,4037,-3183,4038,4039]],"id":"05007","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[4040,4041,-1755,-2672,-1112,4042,-2794]],"id":"17011","properties":{"name":"Bureau"}},{"type":"Polygon","arcs":[[-2041,-3428,4043,4044,4045,4046,4047,4048,-2105]],"id":"18053","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[-3243,-1544,-861,-2752,4049]],"id":"26113","properties":{"name":"Missaukee"}},{"type":"Polygon","arcs":[[-1299,-410,-1259,-1272,4050,-346]],"id":"26117","properties":{"name":"Montcalm"}},{"type":"Polygon","arcs":[[-1527,4051,-2172,-871]],"id":"29229","properties":{"name":"Wright"}},{"type":"Polygon","arcs":[[-1526,-3394,4052,-2195,-2202,4053,-2173,-4052]],"id":"29215","properties":{"name":"Texas"}},{"type":"Polygon","arcs":[[4054,4055,4056,4057,-3431]],"id":"29123","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[4058,4059,4060,-2048,-2374,4061,4062]],"id":"28085","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[4063,4064,4065,4066,4067]],"id":"35011","properties":{"name":"De Baca"}},{"type":"Polygon","arcs":[[4068,-3846,4069,4070,-3777,-3726,4071]],"id":"37147","properties":{"name":"Pitt"}},{"type":"Polygon","arcs":[[4072,-4014,4073,4074,4075,4076,4077]],"id":"38059","properties":{"name":"Morton"}},{"type":"Polygon","arcs":[[4078,4079,4080,4081,-88,4082,-3068]],"id":"39077","properties":{"name":"Huron"}},{"type":"Polygon","arcs":[[-2641,4083,-3745,4084,4085,4086]],"id":"40111","properties":{"name":"Okmulgee"}},{"type":"Polygon","arcs":[[4087,4088,4089,4090,4091,4092,4093,4094]],"id":"45041","properties":{"name":"Florence"}},{"type":"Polygon","arcs":[[4095,4096,4097,4098,4099]],"id":"45081","properties":{"name":"Saluda"}},{"type":"Polygon","arcs":[[4100,4101,-3884,4102,4103,4104]],"id":"21027","properties":{"name":"Breckinridge"}},{"type":"Polygon","arcs":[[-3881,4105,4106,4107,4108,4109]],"id":"21225","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[4110,4111,4112,-395,4113,4114]],"id":"21231","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[4115,-2633,4116,4117,4118,4119]],"id":"21211","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[-3728,-3782,4120,-2331,4121]],"id":"37103","properties":{"name":"Jones"}},{"type":"Polygon","arcs":[[4122,4123,4124,4125,4126]],"id":"47105","properties":{"name":"Loudon"}},{"type":"Polygon","arcs":[[4127,4128,4129,-911,4130,4131]],"id":"48217","properties":{"name":"Hill"}},{"type":"Polygon","arcs":[[4132,4133,4134,4135,4136,4137,4138]],"id":"51087","properties":{"name":"Henrico"}},{"type":"Polygon","arcs":[[4139,4140,4141,-796,4142]],"id":"39019","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[-2604,4143,4144,4145,-359,4146]],"id":"38099","properties":{"name":"Walsh"}},{"type":"Polygon","arcs":[[4147,4148,4149,-2619,4150,-1949,-1403]],"id":"55067","properties":{"name":"Langlade"}},{"type":"Polygon","arcs":[[4151,4152,-1434,-2132,4153,4154]],"id":"55017","properties":{"name":"Chippewa"}},{"type":"Polygon","arcs":[[4155,4156,4157,4158,4159]],"id":"22101","properties":{"name":"St. Mary"}},{"type":"Polygon","arcs":[[4160,4161,4162,4163,4164,4165]],"id":"41009","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[4166,4167,-1996,4168,4169,4170,-3952]],"id":"41025","properties":{"name":"Harney"}},{"type":"Polygon","arcs":[[4171,-1661,4172,4173,4174,4175]],"id":"48491","properties":{"name":"Williamson"}},{"type":"Polygon","arcs":[[4176,4177,4178,4179,-322]],"id":"49009","properties":{"name":"Daggett"}},{"type":"Polygon","arcs":[[4180,4181,-1844,4182,4183]],"id":"48271","properties":{"name":"Kinney"}},{"type":"Polygon","arcs":[[4184,-318,4185,4186,4187]],"id":"49029","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[4188,4189]],"id":"51620","properties":{"name":"Franklin"}},{"type":"MultiPolygon","arcs":[[[4190]],[[4191,4192,4193,4194,-981,4195,-1806,4196,4197]]],"id":"08005","properties":{"name":"Arapahoe"}},{"type":"Polygon","arcs":[[4198,4199,4200,4201,4202,-3828,4203,4204]],"id":"13295","properties":{"name":"Walker"}},{"type":"Polygon","arcs":[[4205,4206,4207,4208,4209,4210]],"id":"18121","properties":{"name":"Parke"}},{"type":"Polygon","arcs":[[4211,-72,4212,4213,4214]],"id":"18143","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[-2703,4215,4216,4217,4218,4219]],"id":"21227","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[4220,4221,-1210,4222,4223]],"id":"22081","properties":{"name":"Red River"}},{"type":"Polygon","arcs":[[-3358,4224,4225,-1893,-1288,-3539]],"id":"27015","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[4226,4227,4228,4229,-1250,4230,4231]],"id":"29139","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[4232,-3572,4233,4234,4235,4236,4237,4238,-3803,4239]],"id":"05093","properties":{"name":"Mississippi"}},{"type":"Polygon","arcs":[[4240,4241,4242,4243,-1221,4244]],"id":"05049","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[4245,4246,-4205,4247,4248,4249,4250]],"id":"01049","properties":{"name":"DeKalb"}},{"type":"Polygon","arcs":[[4251,4252,4253,-3326,4254,4255]],"id":"05127","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[-3122,-2477,-3864,4256,4257]],"id":"06015","properties":{"name":"Del Norte"}},{"type":"Polygon","arcs":[[4258,-939,-3836,4259,-3937,4260]],"id":"17177","properties":{"name":"Stephenson"}},{"type":"Polygon","arcs":[[4261,4262,4263,4264,4265,4266]],"id":"18025","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[4267,4268,4269,4270]],"id":"18043","properties":{"name":"Floyd"}},{"type":"Polygon","arcs":[[-2923,4271,4272,4273,4274,4275]],"id":"13179","properties":{"name":"Liberty"}},{"type":"Polygon","arcs":[[-19,4276,-3204,4277,-3833]],"id":"16053","properties":{"name":"Jerome"}},{"type":"Polygon","arcs":[[4278,4279,4280,4281,4282]],"id":"24045","properties":{"name":"Wicomico"}},{"type":"Polygon","arcs":[[4283,4284,4285,4286]],"id":"26013","properties":{"name":"Baraga"}},{"type":"Polygon","arcs":[[4287,4288,4289,4290,4291,-1,4292,4293]],"id":"32017","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[4294,4295,4296,4297,4298]],"id":"34011","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[4299,4300,4301,4302]],"id":"18115","properties":{"name":"Ohio"}},{"type":"Polygon","arcs":[[4303,4304,4305,4306,4307,4308]],"id":"36061","properties":{"name":"New York"}},{"type":"Polygon","arcs":[[4309,4310,-3960,4311,4312,4313]],"id":"36089","properties":{"name":"St. Lawrence"}},{"type":"Polygon","arcs":[[4314,4315,-4063,4316,4317,4318]],"id":"28063","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[4319,-2584,4320,4321,4322,4323]],"id":"40023","properties":{"name":"Choctaw"}},{"type":"Polygon","arcs":[[4324,4325,4326,-2064,4327,4328,4329,4330,-3576]],"id":"17149","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[4331,4332,4333,4334,-2094]],"id":"19057","properties":{"name":"Des Moines"}},{"type":"Polygon","arcs":[[4335,4336,4337,-3841,4338,4339]],"id":"30085","properties":{"name":"Roosevelt"}},{"type":"Polygon","arcs":[[4340,4341,4342,4343,-1019,4344,4345,4346]],"id":"45007","properties":{"name":"Anderson"}},{"type":"Polygon","arcs":[[4347,4348,-2420,4349,4350]],"id":"46033","properties":{"name":"Custer"}},{"type":"Polygon","arcs":[[4351,-4237,4352,4353,4354,4355,4356]],"id":"47157","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[4357,4358,4359,4360,4361]],"id":"34019","properties":{"name":"Hunterdon"}},{"type":"Polygon","arcs":[[4362,4363,-770,-2896,4364],[-1232]],"id":"51089","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[-2167,4365,4366,4367]],"id":"51650","properties":{"name":"Hampton"}},{"type":"Polygon","arcs":[[4368,4369,-262,-2425,4370,4371]],"id":"30071","properties":{"name":"Phillips"}},{"type":"Polygon","arcs":[[4372,4373,4374,4375,4376,4377,-3264]],"id":"13161","properties":{"name":"Jeff Davis"}},{"type":"Polygon","arcs":[[4378,-3906,4379,4380,4381,4382,4383,4384]],"id":"56023","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[4385,4386,4387,4388,4389]],"id":"01063","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[4390,4391,-3178,4392,4393]],"id":"05061","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[4394,4395,4396,-2015]],"id":"51091","properties":{"name":"Highland"}},{"type":"Polygon","arcs":[[4397,4398,4399,4400]],"id":"51101","properties":{"name":"King William"}},{"type":"MultiPolygon","arcs":[[[4401]],[[4402,4403,-402,4404]]],"id":"55007","properties":{"name":"Bayfield"}},{"type":"Polygon","arcs":[[4405,4406,4407,4408,-2698,4409,4410,4411]],"id":"55123","properties":{"name":"Vernon"}},{"type":"Polygon","arcs":[[-629,4412,4413,-198,-3307,-3719]],"id":"31011","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[-4018,4414,4415,4416,4417,4418]],"id":"20043","properties":{"name":"Doniphan"}},{"type":"Polygon","arcs":[[-2826,-3308,-752,-2519,-553]],"id":"31163","properties":{"name":"Sherman"}},{"type":"Polygon","arcs":[[4419,4420,4421,-2526,4422]],"id":"32021","properties":{"name":"Mineral"}},{"type":"Polygon","arcs":[[4423,4424,4425,4426,-1346]],"id":"47083","properties":{"name":"Houston"}},{"type":"MultiPolygon","arcs":[[[-3607,4427]],[[4428,4429,4430,-3603,4431,4432,4433]]],"id":"48057","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[4434,-3831,4435,4436,4437,4438,-4249]],"id":"01019","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[-1415,-3413,4439,4440,4441,4442,4443]],"id":"30111","properties":{"name":"Yellowstone"}},{"type":"Polygon","arcs":[[-750,4444,4445,-1898,-2520]],"id":"31079","properties":{"name":"Hall"}},{"type":"Polygon","arcs":[[4446,4447,4448,-2942,4449]],"id":"31017","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[4450,-2807,4451,4452]],"id":"35061","properties":{"name":"Valencia"}},{"type":"Polygon","arcs":[[4453,4454,4455,4456,-2803,4457]],"id":"35047","properties":{"name":"San Miguel"}},{"type":"Polygon","arcs":[[4458,-2897,-2982,4459,4460,-1252]],"id":"37067","properties":{"name":"Forsyth"}},{"type":"Polygon","arcs":[[4461,4462,-3730,4463,4464,4465]],"id":"37191","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[4466,4467,4468,4469,4470]],"id":"37017","properties":{"name":"Bladen"}},{"type":"Polygon","arcs":[[4471,4472,-1471,4473,4474,4475,-2516,-1914]],"id":"30059","properties":{"name":"Meagher"}},{"type":"Polygon","arcs":[[4476,4477,-3691,4478,4479,4480]],"id":"21203","properties":{"name":"Rockcastle"}},{"type":"Polygon","arcs":[[4481,4482,-4100,4483,4484,4485]],"id":"45047","properties":{"name":"Greenwood"}},{"type":"Polygon","arcs":[[4486,4487,-4105,4488,4489]],"id":"21091","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[4490,4491,4492,4493,4494,4495,4496]],"id":"21045","properties":{"name":"Casey"}},{"type":"Polygon","arcs":[[4497,4498,4499,4500,4501]],"id":"21113","properties":{"name":"Jessamine"}},{"type":"Polygon","arcs":[[4502,4503,-1016,4504]],"id":"37149","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[4505,4506,4507,4508,4509]],"id":"37121","properties":{"name":"Mitchell"}},{"type":"Polygon","arcs":[[4510,4511,4512,4513,4514,4515]],"id":"37053","properties":{"name":"Currituck"}},{"type":"MultiPolygon","arcs":[[[-2320]],[[4516,4517,4518,4519,-3437,-2318,-3436]]],"id":"51121","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-4138,4520]],"id":"51760","properties":{"name":"Richmond"}},{"type":"Polygon","arcs":[[-3632,-1056,4521,4522,4523,4524]],"id":"53021","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[4525,-2278,4526,4527,4528,-3552]],"id":"40067","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[4529,4530,4531,4532,4533,4534,4535]],"id":"47091","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[4536,4537,4538,4539,4540]],"id":"47121","properties":{"name":"Meigs"}},{"type":"Polygon","arcs":[[-507,4541,-116,4542,-2120]],"id":"46015","properties":{"name":"Brule"}},{"type":"Polygon","arcs":[[4543,4544,4545,4546,4547,-4129,4548]],"id":"48139","properties":{"name":"Ellis"}},{"type":"Polygon","arcs":[[-3553,-4529,4549,-1064,4550,4551]],"id":"48077","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[4552,4553,-3628,4554,4555,4556]],"id":"51009","properties":{"name":"Amherst"}},{"type":"Polygon","arcs":[[4557,-1789,-574,4558]],"id":"08079","properties":{"name":"Mineral"}},{"type":"Polygon","arcs":[[4559,4560,4561,4562,4563,4564,4565,4566]],"id":"13107","properties":{"name":"Emanuel"}},{"type":"Polygon","arcs":[[-3943,-1804,-1198,4567,4568,4569]],"id":"17125","properties":{"name":"Mason"}},{"type":"Polygon","arcs":[[-1768,-1770,-736,-3686,-1810,-1059]],"id":"19169","properties":{"name":"Story"}},{"type":"Polygon","arcs":[[4570,4571,-3461,4572]],"id":"19149","properties":{"name":"Plymouth"}},{"type":"Polygon","arcs":[[4573,4574,4575,4576,4577]],"id":"20173","properties":{"name":"Sedgwick"}},{"type":"Polygon","arcs":[[4578,-2976,4579,-2629,-4116,4580]],"id":"21103","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[4581,4582,4583]],"id":"22089","properties":{"name":"St. Charles"}},{"type":"Polygon","arcs":[[-4033,4584,4585,4586]],"id":"01033","properties":{"name":"Colbert"}},{"type":"Polygon","arcs":[[4587,4588,4589,4590,-250,4591,4592]],"id":"04019","properties":{"name":"Pima"}},{"type":"Polygon","arcs":[[4593,4594,-3582,4595,4596,4597]],"id":"04011","properties":{"name":"Greenlee"}},{"type":"Polygon","arcs":[[4598,4599,-572,4600,-3663,4601]],"id":"05147","properties":{"name":"Woodruff"}},{"type":"Polygon","arcs":[[-1764,4602,4603,4604]],"id":"12099","properties":{"name":"Palm Beach"}},{"type":"Polygon","arcs":[[4605,4606,4607,4608,4609]],"id":"13127","properties":{"name":"Glynn"}},{"type":"Polygon","arcs":[[4610,-3060,4611,4612,-667]],"id":"19007","properties":{"name":"Appanoose"}},{"type":"Polygon","arcs":[[4613,4614,-3940,4615,-2541,-918]],"id":"19061","properties":{"name":"Dubuque"}},{"type":"Polygon","arcs":[[4616,4617,4618,4619,-3319,4620]],"id":"21057","properties":{"name":"Cumberland"}},{"type":"MultiPolygon","arcs":[[[4621,4622,4623,4624,4625,-4156,4626,-3698]],[[4627]]],"id":"22045","properties":{"name":"Iberia"}},{"type":"Polygon","arcs":[[4628,4629,4630,-1130]],"id":"17101","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[4631,4632,4633]],"id":"24037","properties":{"name":"St. Mary's"}},{"type":"Polygon","arcs":[[4634,4635,4636,4637,4638,4639]],"id":"22033","properties":{"name":"East Baton Rouge"}},{"type":"Polygon","arcs":[[4640,4641,4642,4643]],"id":"22043","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[-1296,-343,-1300,4644]],"id":"26127","properties":{"name":"Oceana"}},{"type":"Polygon","arcs":[[4645,4646,4647,4648,-3715,4649]],"id":"31131","properties":{"name":"Otoe"}},{"type":"Polygon","arcs":[[4650,-3993,4651,4652,4653,-1085,4654]],"id":"17111","properties":{"name":"McHenry"}},{"type":"Polygon","arcs":[[4655,4656,4657,4658,-3245,-2509]],"id":"20183","properties":{"name":"Smith"}},{"type":"Polygon","arcs":[[-4654,4659,4660,-1509,-1086]],"id":"17089","properties":{"name":"Kane"}},{"type":"Polygon","arcs":[[-3722,4661,4662,4663,4664,4665,4666,4667]],"id":"35035","properties":{"name":"Otero"}},{"type":"Polygon","arcs":[[4668,4669,-4266,4670,-4101,-4488]],"id":"18123","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-4630,4671,4672,-3288,4673,4674,4675,4676]],"id":"18083","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[4677,4678,4679,4680,4681]],"id":"42049","properties":{"name":"Erie"}},{"type":"Polygon","arcs":[[4682,4683,4684,4685,4686]],"id":"45019","properties":{"name":"Charleston"}},{"type":"Polygon","arcs":[[-3734,4687,4688,4689,-2932,-3760,4690]],"id":"45091","properties":{"name":"York"}},{"type":"Polygon","arcs":[[4691,4692,4693,4694,4695]],"id":"45053","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[4696,4697,4698,4699,4700,4701,4702,4703]],"id":"36071","properties":{"name":"Orange"}},{"type":"Polygon","arcs":[[4704,4705,4706,-3493,4707]],"id":"50025","properties":{"name":"Windham"}},{"type":"Polygon","arcs":[[-4596,-3581,-1567,4708,4709]],"id":"35023","properties":{"name":"Hidalgo"}},{"type":"Polygon","arcs":[[4710,4711,4712,-4453,4713,4714,4715]],"id":"35006","properties":{"name":"Cibola"}},{"type":"Polygon","arcs":[[-2328,4716,4717,4718,4719,4720,4721]],"id":"54055","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[4722,4723,4724,-2306,-3130,4725]],"id":"54051","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[4726,4727,4728,4729,4730,-2625,4731]],"id":"01101","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[4732,-4250,-4439,4733,-3985,4734]],"id":"01055","properties":{"name":"Etowah"}},{"type":"Polygon","arcs":[[4735,-4586,4736,-2847,4737,4738]],"id":"01059","properties":{"name":"Franklin"}},{"type":"MultiPolygon","arcs":[[[-484,-2301,4739,4740,-1977,4741,4742,4743,4744]],[[4745]],[[4746]]],"id":"02050","properties":{"name":"Bethel"}},{"type":"Polygon","arcs":[[4747,-39,4748,4749,4750,4751,-4348]],"id":"46103","properties":{"name":"Pennington"}},{"type":"Polygon","arcs":[[4752,4753,-567,4754,-1389,4755]],"id":"46115","properties":{"name":"Spink"}},{"type":"Polygon","arcs":[[4756,4757,-4573,-3466,4758,4759,4760]],"id":"46127","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[4761,4762,4763,-4693]],"id":"45013","properties":{"name":"Beaufort"}},{"type":"Polygon","arcs":[[4764,4765,4766,4767,4768,4769]],"id":"47029","properties":{"name":"Cocke"}},{"type":"Polygon","arcs":[[4770,4771,4772,-4362,4773,4774,4775,4776]],"id":"42017","properties":{"name":"Bucks"}},{"type":"Polygon","arcs":[[-1366,4777,4778,4779]],"id":"46009","properties":{"name":"Bon Homme"}},{"type":"Polygon","arcs":[[-4426,4780,4781,4782,4783,4784]],"id":"47043","properties":{"name":"Dickson"}},{"type":"Polygon","arcs":[[4785,4786,4787,4788,4789]],"id":"40105","properties":{"name":"Nowata"}},{"type":"Polygon","arcs":[[4790,-2266,-2253,4791,-4546,4792]],"id":"48257","properties":{"name":"Kaufman"}},{"type":"Polygon","arcs":[[4793,4794,-1048,-3084,-1729,-245]],"id":"48155","properties":{"name":"Foard"}},{"type":"Polygon","arcs":[[4795,4796,4797,4798,4799]],"id":"23023","properties":{"name":"Sagadahoc"}},{"type":"Polygon","arcs":[[4800,4801,-2261,4802,4803,4804]],"id":"48085","properties":{"name":"Collin"}},{"type":"Polygon","arcs":[[-2776,-2886,-660,4805,-1650]],"id":"48093","properties":{"name":"Comanche"}},{"type":"Polygon","arcs":[[-680,4806,4807,-2197,-220]],"id":"48095","properties":{"name":"Concho"}},{"type":"Polygon","arcs":[[4808,-2590,4809,4810,4811]],"id":"48103","properties":{"name":"Crane"}},{"type":"Polygon","arcs":[[4812,4813,4814,4815,4816,-4664]],"id":"35015","properties":{"name":"Eddy"}},{"type":"Polygon","arcs":[[4817,4818,4819,-2196,-4053,-3393]],"id":"29161","properties":{"name":"Phelps"}},{"type":"Polygon","arcs":[[4820,4821,4822,-2148,4823,-4253]],"id":"05083","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[-2338,-3444,4824,4825,4826,4827]],"id":"29177","properties":{"name":"Ray"}},{"type":"Polygon","arcs":[[4828,-2524,4829,4830,-1932,4831,4832,-1103]],"id":"06027","properties":{"name":"Inyo"}},{"type":"Polygon","arcs":[[4833,4834,-3025,4835,4836,-3755]],"id":"42005","properties":{"name":"Armstrong"}},{"type":"Polygon","arcs":[[4837,-2831,4838,4839,-3732,4840]],"id":"37109","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-4769,4841,4842,-3772,4843,4844,4845]],"id":"37087","properties":{"name":"Haywood"}},{"type":"Polygon","arcs":[[4846,4847,-2573,4848,4849,4850,4851]],"id":"47057","properties":{"name":"Grainger"}},{"type":"Polygon","arcs":[[4852,4853,4854,4855,4856]],"id":"42023","properties":{"name":"Cameron"}},{"type":"Polygon","arcs":[[-102,4857,-4761,4858,4859,4860]],"id":"46027","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[4861,4862,4863,4864,4865]],"id":"42025","properties":{"name":"Carbon"}},{"type":"Polygon","arcs":[[4866,4867,4868,4869,4870,4871]],"id":"45025","properties":{"name":"Chesterfield"}},{"type":"Polygon","arcs":[[4872,4873,-4683,4874]],"id":"45035","properties":{"name":"Dorchester"}},{"type":"Polygon","arcs":[[4875,4876,4877,4878,4879,4880,-1531]],"id":"29041","properties":{"name":"Chariton"}},{"type":"Polygon","arcs":[[4881,4882,-2442,4883,4884]],"id":"50011","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[4885,4886,-4857,4887,-3022,4888]],"id":"42047","properties":{"name":"Elk"}},{"type":"Polygon","arcs":[[4889,4890,4891]],"id":"51115","properties":{"name":"Mathews"}},{"type":"Polygon","arcs":[[4892,4893,4894,4895,-3391,4896,4897]],"id":"29131","properties":{"name":"Miller"}},{"type":"Polygon","arcs":[[-266,4898,4899,4900,4901,4902]],"id":"30017","properties":{"name":"Custer"}},{"type":"Polygon","arcs":[[-4902,4903,4904,4905,4906,4907,4908]],"id":"30075","properties":{"name":"Powder River"}},{"type":"Polygon","arcs":[[4909,-1285,4910,4911,4912]],"id":"21107","properties":{"name":"Hopkins"}},{"type":"Polygon","arcs":[[4913,-2150,4914,4915,4916]],"id":"26003","properties":{"name":"Alger"}},{"type":"Polygon","arcs":[[4917,4918,4919,4920,4921]],"id":"21115","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-1121,4922,-3343,4923,4924]],"id":"17041","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[4925,4926,4927,4928,4929,4930]],"id":"21119","properties":{"name":"Knott"}},{"type":"Polygon","arcs":[[4931,-619,4932,-4575,4933]],"id":"20079","properties":{"name":"Harvey"}},{"type":"Polygon","arcs":[[4934,-3086,4935]],"id":"29510","properties":{"name":"St. Louis"}},{"type":"Polygon","arcs":[[-3347,4936,4937,4938,-292,4939]],"id":"42009","properties":{"name":"Bedford"}},{"type":"Polygon","arcs":[[-4019,-4419,4940,-2086,4941]],"id":"20013","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[4942,4943,4944,4945,4946,4947]],"id":"05099","properties":{"name":"Nevada"}},{"type":"Polygon","arcs":[[-3331,4948,-4944,4949,-4391]],"id":"05109","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[4950,4951,4952,4953,4954]],"id":"51730","properties":{"name":"Petersburg"}},{"type":"Polygon","arcs":[[-4330,4955,4956,-4229,4957,4958]],"id":"29163","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[-2878,4959,4960,4961,4962]],"id":"17083","properties":{"name":"Jersey"}},{"type":"Polygon","arcs":[[4963,-4093,4964,4965,4966,4967]],"id":"45027","properties":{"name":"Clarendon"}},{"type":"Polygon","arcs":[[-2572,-1573,4968,-1429,4969,4970,-4849]],"id":"47073","properties":{"name":"Hawkins"}},{"type":"Polygon","arcs":[[4971,4972,4973,-1136,-1408]],"id":"47077","properties":{"name":"Henderson"}},{"type":"Polygon","arcs":[[-4869,4974,-4088,4975,4976]],"id":"45031","properties":{"name":"Darlington"}},{"type":"Polygon","arcs":[[-3373,4977,4978,4979,4980,4981]],"id":"42029","properties":{"name":"Chester"}},{"type":"Polygon","arcs":[[4982,4983,4984,4985,-4090]],"id":"45033","properties":{"name":"Dillon"}},{"type":"Polygon","arcs":[[4986,-3020,-4835,4987,-1622]],"id":"42031","properties":{"name":"Clarion"}},{"type":"Polygon","arcs":[[4988,-3926,-169,4989]],"id":"55037","properties":{"name":"Florence"}},{"type":"Polygon","arcs":[[4990,-4889,-3021,-4987,-1621]],"id":"42053","properties":{"name":"Forest"}},{"type":"Polygon","arcs":[[4991,4992,4993,4994,4995]],"id":"13049","properties":{"name":"Charlton"}},{"type":"Polygon","arcs":[[-576,-133,4996,4997,4998,4999,5000,5001]],"id":"35039","properties":{"name":"Rio Arriba"}},{"type":"Polygon","arcs":[[5002,-4224,5003,5004,5005,-1051]],"id":"22031","properties":{"name":"De Soto"}},{"type":"Polygon","arcs":[[-3423,5006,5007,5008,-2529]],"id":"37063","properties":{"name":"Durham"}},{"type":"Polygon","arcs":[[5009,5010,-4711,5011]],"id":"35031","properties":{"name":"McKinley"}},{"type":"Polygon","arcs":[[5012,5013,5014,5015,5016]],"id":"24013","properties":{"name":"Carroll"}},{"type":"MultiPolygon","arcs":[[[5017,5018]],[[-4981,5019,5020,5021,5022,5023,5024,5025]]],"id":"10003","properties":{"name":"New Castle"}},{"type":"Polygon","arcs":[[5026,5027,-3162,5028,-2814]],"id":"20023","properties":{"name":"Cheyenne"}},{"type":"Polygon","arcs":[[5029,5030,5031,5032,5033,-4377]],"id":"13001","properties":{"name":"Appling"}},{"type":"Polygon","arcs":[[5034,5035,5036,-4727,5037,-3215]],"id":"01051","properties":{"name":"Elmore"}},{"type":"Polygon","arcs":[[5038,5039,-3865,-1178]],"id":"08033","properties":{"name":"Dolores"}},{"type":"Polygon","arcs":[[5040,-2142,5041,5042]],"id":"27069","properties":{"name":"Kittson"}},{"type":"Polygon","arcs":[[5043,-1686,5044,5045,-3613,-4026,5046]],"id":"48241","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[5047,5048,5049,-4685,5050,5051]],"id":"45043","properties":{"name":"Georgetown"}},{"type":"Polygon","arcs":[[5052,-3556,5053,5054,-4647]],"id":"19071","properties":{"name":"Fremont"}},{"type":"Polygon","arcs":[[5055,-4569,5056,5057,5058,5059]],"id":"17017","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[5060,5061,5062,-4705,5063,5064,5065]],"id":"50027","properties":{"name":"Windsor"}},{"type":"Polygon","arcs":[[5066,-2055,5067,5068,-4012,5069,5070,5071]],"id":"38055","properties":{"name":"McLean"}},{"type":"Polygon","arcs":[[5072,-4072,-3725,-4463]],"id":"37079","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[5073,5074,5075,5076,5077]],"id":"17127","properties":{"name":"Massac"}},{"type":"MultiPolygon","arcs":[[[5078,5079]],[[5080,-949,5081,-4279,5082]]],"id":"24019","properties":{"name":"Dorchester"}},{"type":"Polygon","arcs":[[5083,-4005,-687,5084]],"id":"16055","properties":{"name":"Kootenai"}},{"type":"Polygon","arcs":[[5085,5086,5087,5088]],"id":"09007","properties":{"name":"Middlesex"}},{"type":"Polygon","arcs":[[5089,-2658,-2540,-854,5090,-2979,5091]],"id":"18039","properties":{"name":"Elkhart"}},{"type":"Polygon","arcs":[[5092,-1154,-2995,-2758,5093,5094]],"id":"20071","properties":{"name":"Greeley"}},{"type":"Polygon","arcs":[[5095,-5059,5096,-2874,5097,-2062,-4327]],"id":"17137","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[5098,5099,5100,-3767]],"id":"21121","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[5101,-670,5102,5103,-1092]],"id":"19053","properties":{"name":"Decatur"}},{"type":"Polygon","arcs":[[5104,5105,5106,5107,5108,-4918,5109]],"id":"21127","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[5110,5111,-527,-3639,5112,5113]],"id":"54001","properties":{"name":"Barbour"}},{"type":"Polygon","arcs":[[5114,5115,-3497,5116,5117,5118,5119,5120]],"id":"25003","properties":{"name":"Berkshire"}},{"type":"Polygon","arcs":[[5121,-4227,5122,5123,5124]],"id":"29027","properties":{"name":"Callaway"}},{"type":"Polygon","arcs":[[5125,5126,5127,5128,5129,5130]],"id":"27073","properties":{"name":"Lac qui Parle"}},{"type":"Polygon","arcs":[[-2721,5131,-4133,5132,-3228,5133]],"id":"51075","properties":{"name":"Goochland"}},{"type":"Polygon","arcs":[[5134,5135,5136,-4381]],"id":"56035","properties":{"name":"Sublette"}},{"type":"Polygon","arcs":[[5137,5138,5139,5140,-3876]],"id":"49005","properties":{"name":"Cache"}},{"type":"Polygon","arcs":[[-1189,5141,-2185,-2225,5142]],"id":"30053","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[5143,5144,5145,5146,5147,5148,5149]],"id":"12001","properties":{"name":"Alachua"}},{"type":"Polygon","arcs":[[-4500,5150,5151,5152,-3687,-4478,5153]],"id":"21151","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[5154,5155,5156,-2650,5157,5158,-1858]],"id":"48177","properties":{"name":"Gonzales"}},{"type":"Polygon","arcs":[[5159,5160,-631,-3718,-545,5161,5162]],"id":"31089","properties":{"name":"Holt"}},{"type":"Polygon","arcs":[[5163,5164,-4466,5165,5166,5167]],"id":"37101","properties":{"name":"Johnston"}},{"type":"Polygon","arcs":[[5168,-2796,-1741,5169,5170,-4333,5171]],"id":"17131","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[-441,5172,5173,5174,-3684,5175]],"id":"19191","properties":{"name":"Winneshiek"}},{"type":"Polygon","arcs":[[-1495,-1410,5176,5177,5178,5179]],"id":"47075","properties":{"name":"Haywood"}},{"type":"Polygon","arcs":[[5180,5181,-297,5182,5183,5184]],"id":"24023","properties":{"name":"Garrett"}},{"type":"Polygon","arcs":[[5185,-5185,5186,-524,-5112,5187,5188]],"id":"54077","properties":{"name":"Preston"}},{"type":"Polygon","arcs":[[5189,5190,5191,-4287,5192,5193]],"id":"26061","properties":{"name":"Houghton"}},{"type":"MultiPolygon","arcs":[[[5194,-5179,5195,-4353,-4236]],[[-4238,-4352,5196]]],"id":"47167","properties":{"name":"Tipton"}},{"type":"Polygon","arcs":[[-1078,5197,5198,-2566,5199]],"id":"26065","properties":{"name":"Ingham"}},{"type":"Polygon","arcs":[[-4577,5200,5201,5202,5203,5204]],"id":"20191","properties":{"name":"Sumner"}},{"type":"Polygon","arcs":[[5205,5206,5207,5208,5209,5210,5211]],"id":"21135","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[-4027,-3617,-3896,5212,-3974,5213]],"id":"48245","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[5214,5215,-3472,5216,5217]],"id":"31177","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[5218,5219,5220,-460,5221,5222,5223,5224]],"id":"53039","properties":{"name":"Klickitat"}},{"type":"Polygon","arcs":[[5225,-3577,-4331,-4959,5226]],"id":"29173","properties":{"name":"Ralls"}},{"type":"Polygon","arcs":[[-1423,5227,5228,5229,-435,5230]],"id":"56001","properties":{"name":"Albany"}},{"type":"Polygon","arcs":[[5231,5232,-2292,5233,-2717,5234,5235,5236],[-1411]],"id":"51003","properties":{"name":"Albemarle"}},{"type":"Polygon","arcs":[[-4826,5237,5238,-1920,5239,5240]],"id":"29107","properties":{"name":"Lafayette"}},{"type":"Polygon","arcs":[[5241,5242,-4818,-3392,-4896]],"id":"29125","properties":{"name":"Maries"}},{"type":"Polygon","arcs":[[5243,-5123,-4232,5244,-5242,-4895]],"id":"29151","properties":{"name":"Osage"}},{"type":"Polygon","arcs":[[-3010,-1877,-3019,-1304,5245,5246]],"id":"27161","properties":{"name":"Waseca"}},{"type":"Polygon","arcs":[[5247,5248,5249,5250,-4338,5251]],"id":"38105","properties":{"name":"Williams"}},{"type":"Polygon","arcs":[[-3625,5252,-3231,5253,5254,5255,5256]],"id":"51147","properties":{"name":"Prince Edward"}},{"type":"Polygon","arcs":[[5257,-5025,5258,5259,5260]],"id":"24029","properties":{"name":"Kent"}},{"type":"Polygon","arcs":[[5261,-3064,-3944,-4570,-5056,5262,5263]],"id":"17169","properties":{"name":"Schuyler"}},{"type":"Polygon","arcs":[[5264,5265,5266,5267,5268,-3585]],"id":"24031","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-1138,5269,5270,5271]],"id":"47109","properties":{"name":"McNairy"}},{"type":"Polygon","arcs":[[5272,5273,5274,-1204,5275]],"id":"22119","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[5276,5277,5278]],"id":"37129","properties":{"name":"New Hanover"}},{"type":"Polygon","arcs":[[-5193,-4286,5279,-3924,-4989,5280,5281,-3514,5282]],"id":"26071","properties":{"name":"Iron"}},{"type":"Polygon","arcs":[[-5076,5283,5284,5285,5286,5287,5288]],"id":"21139","properties":{"name":"Livingston"}},{"type":"Polygon","arcs":[[5289,-1215,5290,-3807,5291,5292]],"id":"06077","properties":{"name":"San Joaquin"}},{"type":"Polygon","arcs":[[5293,-5077,-5289,5294,-3311,5295,5296]],"id":"21145","properties":{"name":"McCracken"}},{"type":"Polygon","arcs":[[5297,5298,-4762,-4692,5299,5300]],"id":"45049","properties":{"name":"Hampton"}},{"type":"Polygon","arcs":[[-1597,-1013,5301,5302,5303]],"id":"31037","properties":{"name":"Colfax"}},{"type":"Polygon","arcs":[[5304,-2517,-4476,5305,-1442,5306,5307,5308]],"id":"30031","properties":{"name":"Gallatin"}},{"type":"Polygon","arcs":[[-1348,5309,5310,-1400,5311,5312]],"id":"47135","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[5313,-3901,-1774,-3478,5314,-3835,5315,5316]],"id":"16039","properties":{"name":"Elmore"}},{"type":"Polygon","arcs":[[-2472,5317,5318,5319,5320]],"id":"31013","properties":{"name":"Box Butte"}},{"type":"MultiPolygon","arcs":[[[5321,-3915,5322,-3956,5323,5324,5325]]],"id":"25005","properties":{"name":"Bristol"}},{"type":"Polygon","arcs":[[-1131,-4631,-4677,5326,5327,5328]],"id":"17185","properties":{"name":"Wabash"}},{"type":"Polygon","arcs":[[5329,5330,5331,5332,5333,5334]],"id":"21095","properties":{"name":"Harlan"}},{"type":"Polygon","arcs":[[5335,5336,5337,-1038,5338,-1397]],"id":"47119","properties":{"name":"Maury"}},{"type":"Polygon","arcs":[[5339,5340,-3893,-3615,5341]],"id":"22019","properties":{"name":"Calcasieu"}},{"type":"Polygon","arcs":[[5342,-2530,-5009,5343,5344,5345,5346,-1147]],"id":"37037","properties":{"name":"Chatham"}},{"type":"Polygon","arcs":[[-928,5347,-523,5348,5349]],"id":"48127","properties":{"name":"Dimmit"}},{"type":"Polygon","arcs":[[-4921,5350,-4926,5351,5352,5353]],"id":"21153","properties":{"name":"Magoffin"}},{"type":"Polygon","arcs":[[-4187,5354,5355,5356]],"id":"49011","properties":{"name":"Davis"}},{"type":"Polygon","arcs":[[5357,5358,5359,5360]],"id":"49031","properties":{"name":"Piute"}},{"type":"Polygon","arcs":[[-5109,5361,5362,5363,5364,-4919]],"id":"21159","properties":{"name":"Martin"}},{"type":"Polygon","arcs":[[5365,5366,-4412,5367,-5174,5368]],"id":"27055","properties":{"name":"Houston"}},{"type":"Polygon","arcs":[[5369,5370,5371,-4163]],"id":"53011","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[5372,5373,5374,5375]],"id":"55089","properties":{"name":"Ozaukee"}},{"type":"Polygon","arcs":[[5376,-1916,-2518,-5305,5377,5378,5379]],"id":"30043","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[5380,-4770,-4846,5381,5382,5383]],"id":"47155","properties":{"name":"Sevier"}},{"type":"Polygon","arcs":[[5384,5385,5386,5387]],"id":"32011","properties":{"name":"Eureka"}},{"type":"Polygon","arcs":[[5388,5389,5390,-1206,5391]],"id":"22061","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[5392,5393,5394,-5389,5395]],"id":"22111","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[5396,5397,5398,5399]],"id":"33001","properties":{"name":"Belknap"}},{"type":"Polygon","arcs":[[-1883,-2311,5400,5401,5402]],"id":"05011","properties":{"name":"Bradley"}},{"type":"Polygon","arcs":[[5403,5404,5405,-1539,5406,-126]],"id":"31085","properties":{"name":"Hayes"}},{"type":"Polygon","arcs":[[5407,5408,5409,5410,5411,5412,5413,5414]],"id":"42097","properties":{"name":"Northumberland"}},{"type":"MultiPolygon","arcs":[[[5415,-950,-5081,5416]]],"id":"24041","properties":{"name":"Talbot"}},{"type":"Polygon","arcs":[[5417,5418,5419,-2817]],"id":"19041","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[5420,5421,5422,-2024,-3869,5423]],"id":"47139","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[5424,5425,-2090,5426,5427,5428]],"id":"20149","properties":{"name":"Pottawatomie"}},{"type":"Polygon","arcs":[[5429,5430,5431]],"id":"24510","properties":{"name":"Baltimore"}},{"type":"Polygon","arcs":[[5432,5433,-4800,5434,5435]],"id":"23001","properties":{"name":"Androscoggin"}},{"type":"Polygon","arcs":[[5436,5437,5438,-3289,-4673,5439]],"id":"18153","properties":{"name":"Sullivan"}},{"type":"Polygon","arcs":[[5440,5441,-3259,5442,5443,5444,5445]],"id":"28145","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-1290,-1896,-2623,-2597,5446,-3643,-3030]],"id":"27063","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[5447,5448,5449,5450,5451,5452,5453]],"id":"49049","properties":{"name":"Utah"}},{"type":"Polygon","arcs":[[5454,-3800,5455,5456,-4719,5457]],"id":"54089","properties":{"name":"Summers"}},{"type":"Polygon","arcs":[[-5452,5458,5459,5460,5461,5462]],"id":"49039","properties":{"name":"Sanpete"}},{"type":"Polygon","arcs":[[-2653,5463,5464,-1447,5465,5466,5467]],"id":"55027","properties":{"name":"Dodge"}},{"type":"Polygon","arcs":[[5468,5469,-5131,5470,-886,5471]],"id":"46051","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[-4939,5472,5473,-135,-293]],"id":"42057","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[5474,5475,5476,5477,5478,5479]],"id":"55093","properties":{"name":"Pierce"}},{"type":"Polygon","arcs":[[5480,5481,-1468,-4473,5482]],"id":"30045","properties":{"name":"Judith Basin"}},{"type":"Polygon","arcs":[[5483,5484,-4871,5485,5486,-2933,-4690]],"id":"45057","properties":{"name":"Lancaster"}},{"type":"Polygon","arcs":[[5487,5488,-1459,5489,5490,-4398,5491]],"id":"51033","properties":{"name":"Caroline"}},{"type":"Polygon","arcs":[[5492,5493,5494,-5228,-1422]],"id":"56031","properties":{"name":"Platte"}},{"type":"Polygon","arcs":[[5495,5496,5497,5498,5499,-5480,5500]],"id":"27163","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[5501,5502,5503,5504,5505,5506,5507]],"id":"29133","properties":{"name":"Mississippi"}},{"type":"Polygon","arcs":[[-4864,5508,5509,-4772,5510]],"id":"42095","properties":{"name":"Northampton"}},{"type":"Polygon","arcs":[[-5005,5511,5512,5513,5514,5515]],"id":"22085","properties":{"name":"Sabine"}},{"type":"Polygon","arcs":[[5516,5517,5518,-4621,-3318,5519]],"id":"21169","properties":{"name":"Metcalfe"}},{"type":"Polygon","arcs":[[-3655,5520,-4589,5521]],"id":"04021","properties":{"name":"Pinal"}},{"type":"Polygon","arcs":[[-1181,5522,5523,-3653,-684]],"id":"04017","properties":{"name":"Navajo"}},{"type":"Polygon","arcs":[[5524,-2939,5525,-4593,5526]],"id":"04027","properties":{"name":"Yuma"}},{"type":"Polygon","arcs":[[5527,5528,5529,-5498,5530,-622]],"id":"27025","properties":{"name":"Chisago"}},{"type":"Polygon","arcs":[[-3571,5531,5532,-1343,-1494,5533,-4234]],"id":"47045","properties":{"name":"Dyer"}},{"type":"Polygon","arcs":[[5534,5535,5536,5537,5538]],"id":"21181","properties":{"name":"Nicholas"}},{"type":"Polygon","arcs":[[5539,-5246,-1309,5540,5541,-2621]],"id":"27043","properties":{"name":"Faribault"}},{"type":"Polygon","arcs":[[5542,-4930,5543,-5331,5544,5545,-3647]],"id":"21193","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[5546,-3181,5547,5548,5549,5550]],"id":"48037","properties":{"name":"Bowie"}},{"type":"Polygon","arcs":[[-4905,5551,-1372,-41,5552,5553]],"id":"56011","properties":{"name":"Crook"}},{"type":"Polygon","arcs":[[5554,-4976,-4095,5555]],"id":"45061","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[5556,5557,5558,5559,5560,-5494]],"id":"56015","properties":{"name":"Goshen"}},{"type":"MultiPolygon","arcs":[[[5561,-3911]],[[-3487,5562]],[[5563,-3491,5564,-3909,-5322,5565,5566]]],"id":"25021","properties":{"name":"Norfolk"}},{"type":"Polygon","arcs":[[5567,5568,5569,5570,5571,-3890]],"id":"21123","properties":{"name":"Larue"}},{"type":"Polygon","arcs":[[5572,-1465,5573,-5308,5574,5575,5576,-2533]],"id":"16043","properties":{"name":"Fremont"}},{"type":"Polygon","arcs":[[-3830,-731,5577,-54,5578,-4436]],"id":"13233","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[5579,-316,-3044,5580,-4450,-2941,-423,5581,5582,5583]],"id":"31031","properties":{"name":"Cherry"}},{"type":"Polygon","arcs":[[-3818,5584,5585,-3671,5586]],"id":"13247","properties":{"name":"Rockdale"}},{"type":"Polygon","arcs":[[5587,-2940,-5525,5588,5589]],"id":"06025","properties":{"name":"Imperial"}},{"type":"Polygon","arcs":[[-1665,-1190,-5143,-2230,-4006,-5084,5590]],"id":"16017","properties":{"name":"Bonner"}},{"type":"Polygon","arcs":[[5591,5592,5593,-4206,5594]],"id":"18045","properties":{"name":"Fountain"}},{"type":"Polygon","arcs":[[5595,5596,5597,5598,5599,5600,5601]],"id":"47031","properties":{"name":"Coffee"}},{"type":"Polygon","arcs":[[5602,5603,5604,-637,5605,-5599,5606]],"id":"47177","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[5607,-5364,5608,5609,5610,5611,5612,-4928]],"id":"21195","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[5613,5614,5615,-1261,5616,5617]],"id":"21197","properties":{"name":"Powell"}},{"type":"Polygon","arcs":[[-1302,5618,5619,5620]],"id":"26139","properties":{"name":"Ottawa"}},{"type":"Polygon","arcs":[[5621,5622,5623,-1169,5624,5625,5626]],"id":"47165","properties":{"name":"Sumner"}},{"type":"Polygon","arcs":[[5627,5628,5629,5630,5631]],"id":"37153","properties":{"name":"Richmond"}},{"type":"Polygon","arcs":[[-3077,5632,5633,5634,5635]],"id":"48043","properties":{"name":"Brewster"}},{"type":"Polygon","arcs":[[5636,5637,-1418,-783,5638,5639]],"id":"56019","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[5640,5641,5642,-5499,-5530]],"id":"55095","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[-5643,5643,-5475,-5500]],"id":"55109","properties":{"name":"St. Croix"}},{"type":"Polygon","arcs":[[5644,-3851,5645,-3968]],"id":"48111","properties":{"name":"Dallam"}},{"type":"Polygon","arcs":[[5646,-5415,5647,5648,5649,5650]],"id":"42067","properties":{"name":"Juniata"}},{"type":"Polygon","arcs":[[5651,5652,5653,5654,5655,5656,5657]],"id":"18089","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[5658,5659,5660,5661,5662]],"id":"42131","properties":{"name":"Wyoming"}},{"type":"Polygon","arcs":[[5663,5664,-4827,-5241,5665,5666,5667]],"id":"29095","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[5668,5669,-963,5670,5671]],"id":"42073","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[5672,-1624,5673,-5669,5674,5675]],"id":"42085","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[5676,-5663,5677,5678,-4862,5679,5680]],"id":"42079","properties":{"name":"Luzerne"}},{"type":"Polygon","arcs":[[-3477,-16,-3832,-5315]],"id":"16025","properties":{"name":"Camas"}},{"type":"Polygon","arcs":[[-3396,-261,-3547,5681,-2770,5682]],"id":"19103","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-488,-1792,5683,-666,5684]],"id":"19117","properties":{"name":"Lucas"}},{"type":"Polygon","arcs":[[5685,-696,-2914,5686,5687,5688]],"id":"40151","properties":{"name":"Woods"}},{"type":"Polygon","arcs":[[5689,-5688,5690,5691,5692]],"id":"40153","properties":{"name":"Woodward"}},{"type":"Polygon","arcs":[[-2805,5693,-4068,5694,-4662,-3721,5695]],"id":"35027","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-5070,-4015,-4073,5696,5697]],"id":"38057","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[-4714,-4452,-2806,-5696,-3720,5698]],"id":"35053","properties":{"name":"Socorro"}},{"type":"Polygon","arcs":[[5699,5700,-2429,5701,-5593,5702,-2861]],"id":"18157","properties":{"name":"Tippecanoe"}},{"type":"Polygon","arcs":[[5703,5704,5705,5706,5707,5708]],"id":"21221","properties":{"name":"Trigg"}},{"type":"Polygon","arcs":[[-5630,5709,5710,5711]],"id":"37165","properties":{"name":"Scotland"}},{"type":"Polygon","arcs":[[-2663,-821,-534,5712,5713,5714]],"id":"17055","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-820,5715,-3882,-4110,5716,-536]],"id":"17059","properties":{"name":"Gallatin"}},{"type":"Polygon","arcs":[[-4328,-2063,-5098,-2879,-4963,5717]],"id":"17061","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[-3859,-2611,-3808,-5291,-1214]],"id":"06009","properties":{"name":"Calaveras"}},{"type":"Polygon","arcs":[[5718,-4485,5719,5720,5721,5722]],"id":"45065","properties":{"name":"McCormick"}},{"type":"MultiPolygon","arcs":[[[-4342,5723]],[[-3774,-1020,-4344,5724]]],"id":"45077","properties":{"name":"Pickens"}},{"type":"Polygon","arcs":[[-5235,-2722,-5134,-3227,5725]],"id":"51065","properties":{"name":"Fluvanna"}},{"type":"Polygon","arcs":[[5726,-5556,-4094,-4964,5727,5728]],"id":"45085","properties":{"name":"Sumter"}},{"type":"Polygon","arcs":[[5729,5730,-1490,5731]],"id":"51133","properties":{"name":"Northumberland"}},{"type":"Polygon","arcs":[[5732,-5210,5733,5734,-5537,5735]],"id":"21069","properties":{"name":"Fleming"}},{"type":"Polygon","arcs":[[-398,5736,5737,5738,5739,5740]],"id":"47001","properties":{"name":"Anderson"}},{"type":"Polygon","arcs":[[5741,5742,5743,-1912,-2180]],"id":"30099","properties":{"name":"Teton"}},{"type":"Polygon","arcs":[[-132,5744,5745,5746,-4997]],"id":"35055","properties":{"name":"Taos"}},{"type":"Polygon","arcs":[[-2980,-5091,-853,5747,-2038,-1234]],"id":"18085","properties":{"name":"Kosciusko"}},{"type":"Polygon","arcs":[[5748,-4076,5749,5750,5751]],"id":"38085","properties":{"name":"Sioux"}},{"type":"Polygon","arcs":[[-3320,-4620,5752,5753,5754,5755,5756]],"id":"47027","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-5549,5757,5758,5759,5760]],"id":"48067","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[5761,-5436,5762,-940,5763,-1577,5764]],"id":"23017","properties":{"name":"Oxford"}},{"type":"Polygon","arcs":[[-5538,-5735,5765,5766,5767]],"id":"21011","properties":{"name":"Bath"}},{"type":"Polygon","arcs":[[-4460,-2984,-1150,5768,5769,5770]],"id":"37057","properties":{"name":"Davidson"}},{"type":"Polygon","arcs":[[-5435,-4799,5771,-941,-5763]],"id":"23005","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[5772,-3011,-5247,-5540,-2620,-1894,-4226]],"id":"27013","properties":{"name":"Blue Earth"}},{"type":"Polygon","arcs":[[5773,5774,5775,5776,5777,-4189]],"id":"51093","properties":{"name":"Isle of Wight"}},{"type":"Polygon","arcs":[[-5137,5778,5779,5780,-4177,-321,5781,-4382]],"id":"56037","properties":{"name":"Sweetwater"}},{"type":"Polygon","arcs":[[-2228,5782,5783,-4002]],"id":"30061","properties":{"name":"Mineral"}},{"type":"Polygon","arcs":[[5784,5785]],"id":"51685","properties":{"name":"Manassas Park"}},{"type":"Polygon","arcs":[[5786,-3995,-2654,-5468,5787,5788,5789]],"id":"55021","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[5790,5791,-2594,5792,5793,5794]],"id":"46041","properties":{"name":"Dewey"}},{"type":"Polygon","arcs":[[5795,-1353,-5298,5796,5797]],"id":"45005","properties":{"name":"Allendale"}},{"type":"Polygon","arcs":[[5798,-4970,-1428,5799,5800,-4767]],"id":"47059","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[-3689,-3648,-5546,5801,5802,-5100,5803]],"id":"21051","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[5804,-4108,5805,5806,5807,-5286]],"id":"21055","properties":{"name":"Crittenden"}},{"type":"Polygon","arcs":[[5808,5809,-5632,5810,-4867]],"id":"37007","properties":{"name":"Anson"}},{"type":"Polygon","arcs":[[5811,-400,5812,5813,5814,5815]],"id":"47049","properties":{"name":"Fentress"}},{"type":"MultiPolygon","arcs":[[[-5506,5816,5817,5818,5819]],[[5820,5821]]],"id":"21075","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[5822,5823,-5107,5824,5825]],"id":"21019","properties":{"name":"Boyd"}},{"type":"Polygon","arcs":[[-4345,5826,-4486,-5719,5827]],"id":"45001","properties":{"name":"Abbeville"}},{"type":"Polygon","arcs":[[5828,5829,5830,5831,5832,-2645,-5157,5833]],"id":"48149","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[-5221,5834,5835,-1991,5836,-461]],"id":"41049","properties":{"name":"Morrow"}},{"type":"Polygon","arcs":[[5837,5838,5839,-4937,-3346]],"id":"42013","properties":{"name":"Blair"}},{"type":"Polygon","arcs":[[5840]],"id":"25019","properties":{"name":"Nantucket"}},{"type":"Polygon","arcs":[[-4965,-4092,5841,-5052,5842]],"id":"45089","properties":{"name":"Williamsburg"}},{"type":"Polygon","arcs":[[-3357,-3082,-3012,-5773,-4225]],"id":"27103","properties":{"name":"Nicollet"}},{"type":"Polygon","arcs":[[5843,5844,-1174,5845,-5359]],"id":"49055","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[5846,-1662,-4172,5847,-2963,-3113,5848]],"id":"48053","properties":{"name":"Burnet"}},{"type":"Polygon","arcs":[[5849,5850,-5380,5851,-1462,-1928]],"id":"30023","properties":{"name":"Deer Lodge"}},{"type":"Polygon","arcs":[[-5379,5852,-1463,-5852]],"id":"30093","properties":{"name":"Silver Bow"}},{"type":"Polygon","arcs":[[-1365,-103,-4861,5853,5854,-4778]],"id":"46135","properties":{"name":"Yankton"}},{"type":"Polygon","arcs":[[-4751,5855,5856,5857,-314,5858]],"id":"46071","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-5755,5859,-5816,5860,5861]],"id":"47133","properties":{"name":"Overton"}},{"type":"Polygon","arcs":[[-5460,5862,5863,-5845,5864]],"id":"49015","properties":{"name":"Emery"}},{"type":"Polygon","arcs":[[5865,-1611,5866,-4433,5867,-3609,5868,-3612,5869]],"id":"48391","properties":{"name":"Refugio"}},{"type":"Polygon","arcs":[[5870,5871,-1168,-3398,-589]],"id":"48357","properties":{"name":"Ochiltree"}},{"type":"Polygon","arcs":[[-3867,5872,-577,-5002,5873,-5010,5874]],"id":"35045","properties":{"name":"San Juan"}},{"type":"Polygon","arcs":[[-1223,5875,5876,5877,5878,-3378,5879]],"id":"05063","properties":{"name":"Independence"}},{"type":"Polygon","arcs":[[5880,-4897,-3390,-1524,5881,5882,-2156]],"id":"29029","properties":{"name":"Camden"}},{"type":"Polygon","arcs":[[5883,-5043,5884,-4144,-2603]],"id":"38067","properties":{"name":"Pembina"}},{"type":"Polygon","arcs":[[-5878,5885,5886,-3805,-568,-4600,5887]],"id":"05067","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-97,5888,5889,-4757,-4858,-101]],"id":"46083","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-5818,5890,5891,-1338,-5533,5892]],"id":"47131","properties":{"name":"Obion"}},{"type":"Polygon","arcs":[[5893,-4098,5894,5895,5896,5897,5898]],"id":"45003","properties":{"name":"Aiken"}},{"type":"Polygon","arcs":[[5899,-3355,5900,5901]],"id":"41003","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[5902,-5901,-3354,5903,5904,5905,5906]],"id":"41039","properties":{"name":"Lane"}},{"type":"Polygon","arcs":[[5907,5908,5909,5910,5911,-4399,-5491]],"id":"51097","properties":{"name":"King and Queen"}},{"type":"Polygon","arcs":[[5912,5913,-5508,5914,5915]],"id":"29201","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[-4430,5916,5917,5918,5919]],"id":"48321","properties":{"name":"Matagorda"}},{"type":"Polygon","arcs":[[-1046,5920,5921,-212,5922]],"id":"48447","properties":{"name":"Throckmorton"}},{"type":"Polygon","arcs":[[5923,-406,5924,5925]],"id":"55129","properties":{"name":"Washburn"}},{"type":"Polygon","arcs":[[5926,-5360,-5846,-1173,5927,5928]],"id":"49017","properties":{"name":"Garfield"}},{"type":"Polygon","arcs":[[5929,-5217,-3471,5930,-2394]],"id":"31055","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[5931,5932]],"id":"51520","properties":{"name":"Bristol"}},{"type":"Polygon","arcs":[[5933,-28,5934,-31,-3241]],"id":"38097","properties":{"name":"Traill"}},{"type":"Polygon","arcs":[[-3189,-3195,5935,5936,-1880,5937]],"id":"05069","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[5938,5939,5940,-5886,-5877,5941]],"id":"05075","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[-4952,5942]],"id":"51570","properties":{"name":"Colonial Heights"}},{"type":"Polygon","arcs":[[5943,5944,5945,5946,5947]],"id":"48001","properties":{"name":"Anderson"}},{"type":"Polygon","arcs":[[5948,-5296,-3310,5949,-5504]],"id":"21039","properties":{"name":"Carlisle"}},{"type":"Polygon","arcs":[[-4125,5950,-5383,5951,5952,5953]],"id":"47009","properties":{"name":"Blount"}},{"type":"Polygon","arcs":[[5954,5955,-1350,5956,-4972,-1407,-1340]],"id":"47017","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[-3314,5957,5958,-1344,-5956,5959]],"id":"47079","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[5960,5961,5962,5963,5964,-5118]],"id":"25013","properties":{"name":"Hampden"}},{"type":"Polygon","arcs":[[-3443,-1532,-4881,5965,-5238,-4825]],"id":"29033","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[5966,5967,-5834,-5156,5968,5969]],"id":"48055","properties":{"name":"Caldwell"}},{"type":"Polygon","arcs":[[5970,-5065,5971,5972]],"id":"50021","properties":{"name":"Rutland"}},{"type":"Polygon","arcs":[[-3369,5973,5974,5975,5976,-3352]],"id":"41031","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[5977,-2329,-4722,5978,5979,5980]],"id":"51185","properties":{"name":"Tazewell"}},{"type":"Polygon","arcs":[[5981,-3589,5982,5983,5984]],"id":"51043","properties":{"name":"Clarke"}},{"type":"Polygon","arcs":[[5985,5986,5987,-1694,5988]],"id":"12067","properties":{"name":"Lafayette"}},{"type":"Polygon","arcs":[[-336,-1083,-1271,5989,-2753]],"id":"20205","properties":{"name":"Wilson"}},{"type":"Polygon","arcs":[[-1132,-5329,5990,-3072]],"id":"17047","properties":{"name":"Edwards"}},{"type":"Polygon","arcs":[[-1583,-2605,-4147,-365,5991]],"id":"38071","properties":{"name":"Ramsey"}},{"type":"Polygon","arcs":[[-5853,-5378,-5309,-5574,-1464]],"id":"30057","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-5055,5992,5993,5994,5995,-4648]],"id":"29005","properties":{"name":"Atchison"}},{"type":"Polygon","arcs":[[5996,5997,5998,5999,6000,-3421,6001]],"id":"51083","properties":{"name":"Halifax"}},{"type":"Polygon","arcs":[[6002,6003,6004,-2985,6005]],"id":"51013","properties":{"name":"Arlington"}},{"type":"MultiPolygon","arcs":[[[6006]],[[6007,-3983,-2354,6008,6009]],[[6010]]],"id":"53057","properties":{"name":"Skagit"}},{"type":"Polygon","arcs":[[6011,-3567,6012,-677,6013,6014,6015,-4900]],"id":"30025","properties":{"name":"Fallon"}},{"type":"Polygon","arcs":[[6016,6017,6018,-5775,6019,6020]],"id":"51181","properties":{"name":"Surry"}},{"type":"Polygon","arcs":[[6021,6022,6023,-4524]],"id":"53071","properties":{"name":"Walla Walla"}},{"type":"Polygon","arcs":[[6024,6025,6026,6027,6028,-728]],"id":"13057","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[6029,6030,6031,6032,6033]],"id":"27149","properties":{"name":"Stevens"}},{"type":"Polygon","arcs":[[-2755,6034,6035,6036,6037]],"id":"20019","properties":{"name":"Chautauqua"}},{"type":"Polygon","arcs":[[6038,6039,6040,-1641,-3707,6041]],"id":"29075","properties":{"name":"Gentry"}},{"type":"Polygon","arcs":[[6042,6043,-5984,6044,-2279,6045]],"id":"51187","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[-1791,-1186,-255,-4611,-5684]],"id":"19135","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[6046,6047,-1361,6048,-1843]],"id":"48325","properties":{"name":"Medina"}},{"type":"Polygon","arcs":[[-4417,6049,-3708,-2341,6050,6051]],"id":"29021","properties":{"name":"Buchanan"}},{"type":"Polygon","arcs":[[-4901,-6016,6052,-1368,-5552,-4904]],"id":"30011","properties":{"name":"Carter"}},{"type":"Polygon","arcs":[[6053,6054,-2505,-3244,6055,6056]],"id":"26055","properties":{"name":"Grand Traverse"}},{"type":"Polygon","arcs":[[6057,-4034,-4587,-4736,6058,6059,6060]],"id":"28141","properties":{"name":"Tishomingo"}},{"type":"Polygon","arcs":[[6061,-4715,-5699,-3724,-3579,-4595]],"id":"35003","properties":{"name":"Catron"}},{"type":"Polygon","arcs":[[6062,-3348,-4940,-291,-5182,6063]],"id":"42111","properties":{"name":"Somerset"}},{"type":"Polygon","arcs":[[-328,6064,6065,6066,6067,6068]],"id":"36109","properties":{"name":"Tompkins"}},{"type":"Polygon","arcs":[[-3535,6069,6070,6071]],"id":"36067","properties":{"name":"Onondaga"}},{"type":"Polygon","arcs":[[-4985,6072,6073,6074,-5049,6075]],"id":"45051","properties":{"name":"Horry"}},{"type":"Polygon","arcs":[[6076,6077,6078,-708]],"id":"30041","properties":{"name":"Hill"}},{"type":"Polygon","arcs":[[6079,6080,6081,-2735,-44]],"id":"36001","properties":{"name":"Albany"}},{"type":"Polygon","arcs":[[-480,6082,-6028,6083,6084,-3821,6085,6086,-600,6087]],"id":"13121","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[-5477,6088,6089,6090,6091,6092]],"id":"55091","properties":{"name":"Pepin"}},{"type":"Polygon","arcs":[[6093,-3218,6094,6095,6096]],"id":"01105","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-2668,6097,-2298]],"id":"02090","properties":{"name":"Fairbanks North Star"}},{"type":"Polygon","arcs":[[6098,6099,6100,6101]],"id":"13125","properties":{"name":"Glascock"}},{"type":"Polygon","arcs":[[-901,6102,-2207,6103,-2690]],"id":"48173","properties":{"name":"Glasscock"}},{"type":"Polygon","arcs":[[-1441,6104,-5135,-4380,-3905,6105,-5575,-5307]],"id":"56039","properties":{"name":"Teton"}},{"type":"MultiPolygon","arcs":[[[-4193,6106]],[[6107,6108,6109,6110,6111,6112,-4198,6113,-2224,6114]]],"id":"08059","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[6115,-2044,6116]],"id":"08029","properties":{"name":"Delta"}},{"type":"Polygon","arcs":[[-3820,6117,6118,6119,-6086]],"id":"13063","properties":{"name":"Clayton"}},{"type":"Polygon","arcs":[[-67,6120,-4262,6121,6122]],"id":"18117","properties":{"name":"Orange"}},{"type":"MultiPolygon","arcs":[[[6123]],[[6124]],[[-3559,6125]]],"id":"36103","properties":{"name":"Suffolk"}},{"type":"MultiPolygon","arcs":[[[6126]],[[-4313,6127,-3531,6128]],[[6129]]],"id":"36045","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-3900,6130,6131,6132,-1726]],"id":"20107","properties":{"name":"Linn"}},{"type":"Polygon","arcs":[[6133,6134,6135,-3736,6136,6137,-4503,6138]],"id":"37161","properties":{"name":"Rutherford"}},{"type":"Polygon","arcs":[[6139,6140,6141,-4358,-4773,-5510]],"id":"34041","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[6142,6143,-5361,-5927,6144,-4290]],"id":"49001","properties":{"name":"Beaver"}},{"type":"Polygon","arcs":[[6145,6146,-4531,6147,-5932,6148,-1571,6149]],"id":"51191","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-4734,-4438,6150,6151,-3986]],"id":"01015","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[6152,6153,6154,6155,6156,-1700]],"id":"13133","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[6157,6158,6159,6160]],"id":"54009","properties":{"name":"Brooke"}},{"type":"MultiPolygon","arcs":[[[-1976,6161,-4742]],[[6162]],[[6163,-4744]]],"id":"02070","properties":{"name":"Dillingham"}},{"type":"Polygon","arcs":[[-2938,6164,-3656,-5522,-4588,-5526]],"id":"04013","properties":{"name":"Maricopa"}},{"type":"Polygon","arcs":[[-4675,6165,6166,6167,6168]],"id":"18125","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[-3681,-2709,6169,-4300,6170,6171,-70]],"id":"18137","properties":{"name":"Ripley"}},{"type":"Polygon","arcs":[[-2388,6172,-4578,-5205,6173,-693]],"id":"20095","properties":{"name":"Kingman"}},{"type":"Polygon","arcs":[[6174,-1487,6175,6176,6177]],"id":"20123","properties":{"name":"Mitchell"}},{"type":"Polygon","arcs":[[-1507,6178,-737,-992,-2948,6179]],"id":"20083","properties":{"name":"Hodgeman"}},{"type":"Polygon","arcs":[[-2971,6180,-2416,-1069,-616,6181]],"id":"20127","properties":{"name":"Morris"}},{"type":"Polygon","arcs":[[-1717,6182,-625,6183,-1321,6184,6185]],"id":"27095","properties":{"name":"Mille Lacs"}},{"type":"Polygon","arcs":[[-5444,6186,6187,6188,-82,6189]],"id":"28081","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[6190,6191,-5446,6192,-418,6193,6194]],"id":"28071","properties":{"name":"Lafayette"}},{"type":"Polygon","arcs":[[6195,6196,6197,6198,-4059,-4316]],"id":"28029","properties":{"name":"Copiah"}},{"type":"Polygon","arcs":[[6199,6200,6201,6202,-413,6203]],"id":"28111","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-4146,6204,-29,-5934,-3240,-360]],"id":"38035","properties":{"name":"Grand Forks"}},{"type":"Polygon","arcs":[[6205,6206,6207,-5020,-4980]],"id":"42045","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[6208,6209,6210,6211,6212]],"id":"44003","properties":{"name":"Kent"}},{"type":"Polygon","arcs":[[6213,-5683,-2769,-3399,-1798]],"id":"19095","properties":{"name":"Iowa"}},{"type":"Polygon","arcs":[[-1012,6214,-5218,-5930,-2393,6215,-5302]],"id":"31053","properties":{"name":"Dodge"}},{"type":"Polygon","arcs":[[-296,6216,6217,-5183]],"id":"54057","properties":{"name":"Mineral"}},{"type":"Polygon","arcs":[[6218,-4602,-3668,6219,-3193]],"id":"05117","properties":{"name":"Prairie"}},{"type":"Polygon","arcs":[[-5524,6220,-4598,6221,-4590,-5521,-3654]],"id":"04009","properties":{"name":"Graham"}},{"type":"Polygon","arcs":[[-437,6222,6223,6224,6225,6226,6227,6228]],"id":"08049","properties":{"name":"Grand"}},{"type":"Polygon","arcs":[[6229,6230,6231,6232,6233,-3140,-1787,-4558,6234]],"id":"08109","properties":{"name":"Saguache"}},{"type":"Polygon","arcs":[[6235,6236,-3058,-1765,-580,6237]],"id":"12093","properties":{"name":"Okeechobee"}},{"type":"Polygon","arcs":[[-2029,6238,6239,6240,-3870]],"id":"13123","properties":{"name":"Gilmer"}},{"type":"Polygon","arcs":[[-3266,6241,6242,6243,-4996,6244,6245,-3046]],"id":"13299","properties":{"name":"Ware"}},{"type":"Polygon","arcs":[[6246,-5227,-4958,-4228,-5122,6247,6248]],"id":"29007","properties":{"name":"Audrain"}},{"type":"Polygon","arcs":[[-5000,6249,6250,6251,6252]],"id":"35028","properties":{"name":"Los Alamos"}},{"type":"Polygon","arcs":[[6253,6254,-4371,-2428,-3411,-1413,-1469,-5482]],"id":"30027","properties":{"name":"Fergus"}},{"type":"Polygon","arcs":[[6255,-5163,6256,-4448]],"id":"31149","properties":{"name":"Rock"}},{"type":"Polygon","arcs":[[6257,6258,-5072,6259,6260,-5250]],"id":"38061","properties":{"name":"Mountrail"}},{"type":"Polygon","arcs":[[6261,6262,6263,-1281,6264,-4106,-3880]],"id":"21101","properties":{"name":"Henderson"}},{"type":"Polygon","arcs":[[6265,-5566,-5326,6266,6267,-6209,6268]],"id":"44007","properties":{"name":"Providence"}},{"type":"Polygon","arcs":[[6269,-3770,6270,6271,-5737,-397]],"id":"47013","properties":{"name":"Campbell"}},{"type":"MultiPolygon","arcs":[[[6272,6273,6274,6275]],[[6276,6277,6278,6279,-120]]],"id":"48261","properties":{"name":"Kenedy"}},{"type":"Polygon","arcs":[[6280,-3947,6281,6282,-2782,6283]],"id":"36051","properties":{"name":"Livingston"}},{"type":"Polygon","arcs":[[6284,-3794,6285,6286,6287,6288]],"id":"54011","properties":{"name":"Cabell"}},{"type":"Polygon","arcs":[[6289,6290,6291,-3813,6292,-2101]],"id":"06007","properties":{"name":"Butte"}},{"type":"Polygon","arcs":[[-6227,6293,6294,6295,6296]],"id":"08117","properties":{"name":"Summit"}},{"type":"Polygon","arcs":[[6297,6298,-4347,6299,-1847]],"id":"13147","properties":{"name":"Hart"}},{"type":"Polygon","arcs":[[-5170,-1746,-3941,-3062,6300]],"id":"17187","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[6301,6302,6303,-3284,6304]],"id":"18119","properties":{"name":"Owen"}},{"type":"Polygon","arcs":[[6305,6306,-6122,-4267,-4670,6307,6308,-6167]],"id":"18037","properties":{"name":"Dubois"}},{"type":"Polygon","arcs":[[-2074,6309,6310,6311,-1505]],"id":"20165","properties":{"name":"Rush"}},{"type":"Polygon","arcs":[[-189,-984,-3397,-6214,6312]],"id":"19011","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[6313,-4479,-3690,-5804,-5099,-3766,6314]],"id":"21125","properties":{"name":"Laurel"}},{"type":"Polygon","arcs":[[6315,6316,6317,6318,-2386,-739]],"id":"20185","properties":{"name":"Stafford"}},{"type":"Polygon","arcs":[[-5513,6319,6320,6321,6322,6323]],"id":"22115","properties":{"name":"Vernon"}},{"type":"Polygon","arcs":[[6324,6325,6326,-1554,-2567,-5199]],"id":"26093","properties":{"name":"Livingston"}},{"type":"Polygon","arcs":[[-3018,-2998,-3152,6327,-439,-2665,6328,-1306]],"id":"27099","properties":{"name":"Mower"}},{"type":"Polygon","arcs":[[-2492,6329,6330,6331,6332]],"id":"28073","properties":{"name":"Lamar"}},{"type":"Polygon","arcs":[[6333,6334,6335,6336,6337,6338]],"id":"28053","properties":{"name":"Humphreys"}},{"type":"Polygon","arcs":[[6339,6340,-1603,6341,-627]],"id":"31139","properties":{"name":"Pierce"}},{"type":"Polygon","arcs":[[6342,6343,-5353,6344,-1262,-5616]],"id":"21237","properties":{"name":"Wolfe"}},{"type":"Polygon","arcs":[[6345,-4913,6346,-5705,6347,-5807]],"id":"21033","properties":{"name":"Caldwell"}},{"type":"Polygon","arcs":[[-1371,-3594,6348,6349,-4749,-38]],"id":"46093","properties":{"name":"Meade"}},{"type":"Polygon","arcs":[[6350,6351,6352,6353,-4492,6354]],"id":"21021","properties":{"name":"Boyle"}},{"type":"Polygon","arcs":[[-4509,6355,6356,6357,6358]],"id":"37199","properties":{"name":"Yancey"}},{"type":"Polygon","arcs":[[-6095,-3217,6359,-2628,6360,6361]],"id":"01047","properties":{"name":"Dallas"}},{"type":"Polygon","arcs":[[6362,-2489,6363,-182]],"id":"13231","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[-835,6364,6365,6366]],"id":"01035","properties":{"name":"Conecuh"}},{"type":"Polygon","arcs":[[-3301,6367,-3191,-2403,6368,6369]],"id":"05105","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-6240,6370,-6025,6371]],"id":"13227","properties":{"name":"Pickens"}},{"type":"Polygon","arcs":[[6372,-6156,6373,6374,-6102,6375,6376]],"id":"13141","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[6377,-168,6378,6379,6380]],"id":"13307","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[6381,-4047,6382,-2926,6383,6384]],"id":"18095","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-3286,-68,-6123,-6307,6385]],"id":"18101","properties":{"name":"Martin"}},{"type":"Polygon","arcs":[[-2135,-341,-1508,-6180,-2951,6386,6387]],"id":"20055","properties":{"name":"Finney"}},{"type":"Polygon","arcs":[[-2088,6388,6389,6390,6391]],"id":"20087","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-3304,6392,6393,-5700,-2860,6394]],"id":"18181","properties":{"name":"White"}},{"type":"Polygon","arcs":[[-4494,6395,-4480,-6314,6396,-4112,6397]],"id":"21199","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[-5263,-5060,-5096,-4326,6398]],"id":"17009","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[6399,6400,6401,6402,6403,6404,6405]],"id":"22021","properties":{"name":"Caldwell"}},{"type":"Polygon","arcs":[[-5666,-5240,-1919,6406,6407]],"id":"29101","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-4057,6408,6409,6410,6411]],"id":"29017","properties":{"name":"Bollinger"}},{"type":"Polygon","arcs":[[-2204,6412,6413,6414,6415,6416]],"id":"29035","properties":{"name":"Carter"}},{"type":"Polygon","arcs":[[-923,6417,-2397,6418,-4650,6419,-2479]],"id":"31109","properties":{"name":"Lancaster"}},{"type":"Polygon","arcs":[[6420,6421,6422,6423,-4360]],"id":"34035","properties":{"name":"Somerset"}},{"type":"Polygon","arcs":[[6424,-6284,-2781,6425,6426]],"id":"36121","properties":{"name":"Wyoming"}},{"type":"Polygon","arcs":[[6427,-329,-6069,6428,6429]],"id":"36097","properties":{"name":"Schuyler"}},{"type":"Polygon","arcs":[[6430,6431,6432,6433,-1814]],"id":"39091","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[6434,-1739,-1863,6435,6436,6437,-6433]],"id":"39159","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-4836,-3024,6438,-3344,6439]],"id":"42063","properties":{"name":"Indiana"}},{"type":"Polygon","arcs":[[-3891,-5572,6440,-5517,6441,-2701,6442]],"id":"21099","properties":{"name":"Hart"}},{"type":"Polygon","arcs":[[-1283,6443,-4489,-4104,6444,6445,6446]],"id":"21183","properties":{"name":"Ohio"}},{"type":"Polygon","arcs":[[6447,6448,-2382,-2591,-5792,6449]],"id":"46129","properties":{"name":"Walworth"}},{"type":"Polygon","arcs":[[-4851,6450,-4765,-5381,6451]],"id":"47089","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[6452,6453,6454,6455,-5535,6456,-761]],"id":"21097","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[-5382,-4845,6457,6458,6459,-5952]],"id":"37173","properties":{"name":"Swain"}},{"type":"Polygon","arcs":[[6460,-2246,6461,-2961,6462,-2250,6463]],"id":"48499","properties":{"name":"Wood"}},{"type":"Polygon","arcs":[[6464,6465,6466,6467,6468,6469]],"id":"37091","properties":{"name":"Hertford"}},{"type":"Polygon","arcs":[[-789,6470,-4028,-5214,-3973,6471,6472]],"id":"48291","properties":{"name":"Liberty"}},{"type":"Polygon","arcs":[[6473,6474,-73,-4212,6475,-65,6476]],"id":"18071","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-6312,6477,-6316,-738,-6179,-1506]],"id":"20145","properties":{"name":"Pawnee"}},{"type":"Polygon","arcs":[[-2419,-3159,-1202,-1728,-1081,-334]],"id":"20031","properties":{"name":"Coffey"}},{"type":"Polygon","arcs":[[-809,6478,6479,-4622,-3697]],"id":"22055","properties":{"name":"Lafayette"}},{"type":"Polygon","arcs":[[6480,-2022,-1333,-6030,6481]],"id":"27051","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[6482,-2822,6483,6484,6485]],"id":"28121","properties":{"name":"Rankin"}},{"type":"Polygon","arcs":[[6486,6487,-6486,-6197,6488,-3526]],"id":"28049","properties":{"name":"Hinds"}},{"type":"Polygon","arcs":[[6489,6490,6491,-4467,6492,6493]],"id":"37051","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[6494,6495,6496,6497,-1255,-2827,-1902,-4008]],"id":"37193","properties":{"name":"Wilkes"}},{"type":"Polygon","arcs":[[-1831,6498,6499,-6431,-1813,6500]],"id":"39011","properties":{"name":"Auglaize"}},{"type":"Polygon","arcs":[[6501,6502,6503,6504,6505,6506,-3748]],"id":"40125","properties":{"name":"Pottawatomie"}},{"type":"Polygon","arcs":[[6507,-4086,6508,6509,6510,6511]],"id":"40091","properties":{"name":"McIntosh"}},{"type":"Polygon","arcs":[[6512,6513,-3366,6514,6515]],"id":"41071","properties":{"name":"Yamhill"}},{"type":"Polygon","arcs":[[-4865,-5511,-4771,6516,6517,6518]],"id":"42077","properties":{"name":"Lehigh"}},{"type":"Polygon","arcs":[[-5570,6519,-4497,6520,6521]],"id":"21217","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[-4216,-2702,-6442,-5520,-3317,6522]],"id":"21009","properties":{"name":"Barren"}},{"type":"Polygon","arcs":[[-5848,-4176,6523,-5967,6524,-2964]],"id":"48453","properties":{"name":"Travis"}},{"type":"Polygon","arcs":[[-108,-790,-6473,6525,6526,6527]],"id":"48339","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[6528,-433,-2208,-6103,-900]],"id":"48227","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[6529,-5612,6530,6531,-1569,6532,-5333],[-3784]],"id":"51195","properties":{"name":"Wise"}},{"type":"Polygon","arcs":[[6533]],"id":"51840","properties":{"name":"Winchester"}},{"type":"Polygon","arcs":[[-4082,6534,-905,6535,-89]],"id":"39139","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[-6485,6536,6537,-2490,6538,-6198]],"id":"28127","properties":{"name":"Simpson"}},{"type":"Polygon","arcs":[[6539,-6248,-5125,6540,6541,-1479,6542]],"id":"29019","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[-709,-6079,6543,-6254,-5481,6544,-5743,6545]],"id":"30015","properties":{"name":"Chouteau"}},{"type":"Polygon","arcs":[[6546,-884,-3242,-349,-1899,-4446]],"id":"31081","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[-6252,6547,-6250,-4999,6548,-4458,-2802,6549,6550]],"id":"35049","properties":{"name":"Santa Fe"}},{"type":"Polygon","arcs":[[6551,-5166,-4465,6552,6553,-4468,-6492]],"id":"37163","properties":{"name":"Sampson"}},{"type":"Polygon","arcs":[[6554,-2642,-4087,-6508,6555,6556,-6504]],"id":"40107","properties":{"name":"Okfuskee"}},{"type":"Polygon","arcs":[[6557,6558,6559,6560,-1335,6561,-2912]],"id":"40047","properties":{"name":"Garfield"}},{"type":"Polygon","arcs":[[-5767,6562,6563,-6343,-5615,6564]],"id":"21165","properties":{"name":"Menifee"}},{"type":"Polygon","arcs":[[-4998,-5747,6565,6566,-4454,-6549]],"id":"35033","properties":{"name":"Mora"}},{"type":"Polygon","arcs":[[-6342,-1599,6567,-4413,-628]],"id":"31119","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-200,6568,-880,-6547,-4445,-749]],"id":"31121","properties":{"name":"Merrick"}},{"type":"Polygon","arcs":[[-3353,-5977,6569,-4167,-3951,6570,-5904]],"id":"41017","properties":{"name":"Deschutes"}},{"type":"Polygon","arcs":[[-4170,6571,6572,6573,6574,6575,6576]],"id":"32013","properties":{"name":"Humboldt"}},{"type":"Polygon","arcs":[[6577,6578,6579,6580,6581]],"id":"42117","properties":{"name":"Tioga"}},{"type":"Polygon","arcs":[[-6446,6582,-2704,-4220,6583,6584]],"id":"21031","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[-4265,6585,-3885,-4102,-4671]],"id":"21163","properties":{"name":"Meade"}},{"type":"Polygon","arcs":[[-6354,6586,-4481,-6396,-4493]],"id":"21137","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-5101,-5803,6587,-5335,6588,6589,-3768]],"id":"21013","properties":{"name":"Bell"}},{"type":"Polygon","arcs":[[-2975,6590,6591,-759,-2630,-4580]],"id":"21187","properties":{"name":"Owen"}},{"type":"Polygon","arcs":[[6592,6593,-3779]],"id":"37137","properties":{"name":"Pamlico"}},{"type":"Polygon","arcs":[[6594,6595,6596,6597,6598,6599]],"id":"37187","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[6600,6601,6602,6603,6604]],"id":"54015","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[6605,-4907,6606,-5637,6607]],"id":"56033","properties":{"name":"Sheridan"}},{"type":"Polygon","arcs":[[6608,-4703,6609,6610,6611]],"id":"42103","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[6612,6613,-6591,-2974,6614]],"id":"21077","properties":{"name":"Gallatin"}},{"type":"Polygon","arcs":[[-1148,-5347,6615,6616,-6490,6617,-5629,6618]],"id":"37125","properties":{"name":"Moore"}},{"type":"Polygon","arcs":[[-5711,6619,-6493,-4471,6620,-4984,6621]],"id":"37155","properties":{"name":"Robeson"}},{"type":"Polygon","arcs":[[-4175,6622,-5829,-5968,-6524]],"id":"48021","properties":{"name":"Bastrop"}},{"type":"Polygon","arcs":[[6623,6624,6625,-787,-106]],"id":"48455","properties":{"name":"Trinity"}},{"type":"Polygon","arcs":[[6626,6627,6628,-2898,-4459,-1251,-6498,6629]],"id":"37171","properties":{"name":"Surry"}},{"type":"Polygon","arcs":[[6630,6631,-5248,6632]],"id":"38023","properties":{"name":"Divide"}},{"type":"Polygon","arcs":[[-1352,6633,-4875,-4687,6634,-4763,-5299]],"id":"45029","properties":{"name":"Colleton"}},{"type":"Polygon","arcs":[[-3336,6635,6636,-5603,6637,6638]],"id":"47041","properties":{"name":"DeKalb"}},{"type":"Polygon","arcs":[[-4131,-916,-647,-1659,-1073,6639]],"id":"48309","properties":{"name":"McLennan"}},{"type":"Polygon","arcs":[[-3781,6640,-2332,-4121]],"id":"37031","properties":{"name":"Carteret"}},{"type":"Polygon","arcs":[[-4808,6641,-1653,6642,-2453,-2198]],"id":"48307","properties":{"name":"McCulloch"}},{"type":"Polygon","arcs":[[-2991,6643,6644,-1032,6645,6646]],"id":"39171","properties":{"name":"Williams"}},{"type":"Polygon","arcs":[[6647,6648,6649,6650,6651,6652,6653,-5919]],"id":"48039","properties":{"name":"Brazoria"}},{"type":"Polygon","arcs":[[-1853,-798,6654,6655,-4723,6656,6657]],"id":"39013","properties":{"name":"Belmont"}},{"type":"Polygon","arcs":[[6658,6659,6660,6661,6662,6663]],"id":"39071","properties":{"name":"Highland"}},{"type":"Polygon","arcs":[[-3545,6664,-3070,6665,-753,6666]],"id":"39173","properties":{"name":"Wood"}},{"type":"Polygon","arcs":[[6667,6668,-831,6669,6670,6671]],"id":"55015","properties":{"name":"Calumet"}},{"type":"Polygon","arcs":[[6672,6673,6674,-5651,6675]],"id":"42087","properties":{"name":"Mifflin"}},{"type":"Polygon","arcs":[[6676,-5693,6677,6678,-2482,-1165,6679]],"id":"40045","properties":{"name":"Ellis"}},{"type":"Polygon","arcs":[[6680,6681,-2124,6682,-5857]],"id":"46075","properties":{"name":"Jones"}},{"type":"Polygon","arcs":[[-5707,6683,6684,-4424,-1345,-5959,6685]],"id":"47161","properties":{"name":"Stewart"}},{"type":"Polygon","arcs":[[6686,6687,6688,-2729,-970]],"id":"48017","properties":{"name":"Bailey"}},{"type":"Polygon","arcs":[[6689,-1870,6690,6691,6692,6693]],"id":"40065","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-1018,6694,-3763,6695,-4482,-5827]],"id":"45059","properties":{"name":"Laurens"}},{"type":"Polygon","arcs":[[6696,6697,-3590,-1369,-6053,-6015]],"id":"46063","properties":{"name":"Harding"}},{"type":"Polygon","arcs":[[6698,6699,6700,6701,6702]],"id":"54105","properties":{"name":"Wirt"}},{"type":"Polygon","arcs":[[6703,6704,-6668,6705,-792]],"id":"55087","properties":{"name":"Outagamie"}},{"type":"Polygon","arcs":[[-4077,-5749,6706,-3146,6707]],"id":"38037","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[6708,-4166,6709,6710]],"id":"41007","properties":{"name":"Clatsop"}},{"type":"Polygon","arcs":[[6711,-5680,-4866,-6519,6712,-203,6713,-5413]],"id":"42107","properties":{"name":"Schuylkill"}},{"type":"Polygon","arcs":[[-6581,6714,6715,6716,6717,-5410,6718,6719,6720]],"id":"42081","properties":{"name":"Lycoming"}},{"type":"MultiPolygon","arcs":[[[6721,6722]],[[-6637,6723,6724,6725,-5604]]],"id":"47185","properties":{"name":"White"}},{"type":"Polygon","arcs":[[6726,6727,6728,6729,-6091]],"id":"55011","properties":{"name":"Buffalo"}},{"type":"Polygon","arcs":[[6730,-3933,6731,6732,-5871,-588,-3850,6733]],"id":"40139","properties":{"name":"Texas"}},{"type":"Polygon","arcs":[[-6717,6734,-5681,-6712,-5412,6735]],"id":"42037","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[6736,-5751,6737,6738,-6450,-5791,6739,-3592]],"id":"46031","properties":{"name":"Corson"}},{"type":"Polygon","arcs":[[-5946,6740,6741,-6624,-105,-2269,6742]],"id":"48225","properties":{"name":"Houston"}},{"type":"Polygon","arcs":[[-6643,-1652,6743,6744,-5849,-3112,-2454]],"id":"48411","properties":{"name":"San Saba"}},{"type":"Polygon","arcs":[[-4136,6745,6746,6747,-6018,6748,6749]],"id":"51036","properties":{"name":"Charles City"}},{"type":"Polygon","arcs":[[6750,-6046,-2283,6751,-2289,6752]],"id":"51139","properties":{"name":"Page"}},{"type":"Polygon","arcs":[[-2122,-587,6753,-3043,6754]],"id":"46123","properties":{"name":"Tripp"}},{"type":"Polygon","arcs":[[-3078,-5636,6755]],"id":"48377","properties":{"name":"Presidio"}},{"type":"Polygon","arcs":[[-6145,-5929,6756,6757,-4291]],"id":"49021","properties":{"name":"Iron"}},{"type":"Polygon","arcs":[[6758,6759,-1688,6760,6761]],"id":"48347","properties":{"name":"Nacogdoches"}},{"type":"Polygon","arcs":[[6762,6763,6764,6765,6766,6767,-5831]],"id":"48477","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-3209,-3877,-5141,6768,6769,6770]],"id":"49003","properties":{"name":"Box Elder"}},{"type":"Polygon","arcs":[[6771,6772,6773,-225,6774]],"id":"48097","properties":{"name":"Cooke"}},{"type":"Polygon","arcs":[[6775,-6693,6776,6777,-1044,-4795]],"id":"48487","properties":{"name":"Wilbarger"}},{"type":"Polygon","arcs":[[-914,6778,-5947,-6743,-2268,6779]],"id":"48289","properties":{"name":"Leon"}},{"type":"Polygon","arcs":[[-1859,-5159,6780,-1608,6781,6782,-1357]],"id":"48255","properties":{"name":"Karnes"}},{"type":"Polygon","arcs":[[-4721,6783,-3441,6784,6785,-5979]],"id":"51021","properties":{"name":"Bland"}},{"type":"Polygon","arcs":[[6786,6787,-6021,6788,6789]],"id":"51183","properties":{"name":"Sussex"}},{"type":"Polygon","arcs":[[6790,-5256,6791,6792,6793]],"id":"51111","properties":{"name":"Lunenburg"}},{"type":"Polygon","arcs":[[6794,-2909,6795,-6602,6796,-6700]],"id":"54013","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[6797,-2330,-5978,6798,6799,-5610]],"id":"51027","properties":{"name":"Buchanan"}},{"type":"Polygon","arcs":[[6800,-6794,6801,6802,-3650,6803,-6000]],"id":"51117","properties":{"name":"Mecklenburg"}},{"type":"Polygon","arcs":[[-6457,-5539,6804,6805,6806,-762]],"id":"21017","properties":{"name":"Bourbon"}},{"type":"Polygon","arcs":[[-18,-3476,-3205,-4277]],"id":"16067","properties":{"name":"Minidoka"}},{"type":"Polygon","arcs":[[6807,-6630,-6497,6808]],"id":"37005","properties":{"name":"Alleghany"}},{"type":"Polygon","arcs":[[-3230,6809,6810,6811,6812,-5254]],"id":"51007","properties":{"name":"Amelia"}},{"type":"Polygon","arcs":[[6813,-4892,6814,-2164,6815,-5910]],"id":"51073","properties":{"name":"Gloucester"}},{"type":"Polygon","arcs":[[6816,-6043,-6751,6817,6818]],"id":"51171","properties":{"name":"Shenandoah"}},{"type":"Polygon","arcs":[[-5611,-6800,6819,-6531]],"id":"51051","properties":{"name":"Dickenson"}},{"type":"Polygon","arcs":[[6820,-5925,6821,-4152,6822,-5642]],"id":"55005","properties":{"name":"Barron"}},{"type":"Polygon","arcs":[[6823,6824,6825,6826]],"id":"53049","properties":{"name":"Pacific"}},{"type":"Polygon","arcs":[[6827,6828,6829,6830]],"id":"54045","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[6831,6832,-2608,6833,-1101]],"id":"06039","properties":{"name":"Madera"}},{"type":"Polygon","arcs":[[6834,6835,6836,-828,6837]],"id":"55061","properties":{"name":"Kewaunee"}},{"type":"Polygon","arcs":[[6838,-2036,6839,-1310,-3323,6840,-2876]],"id":"17135","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-2045,-6116,6841,6842,6843,-6230,6844,6845]],"id":"08051","properties":{"name":"Gunnison"}},{"type":"Polygon","arcs":[[6846,-613,6847,-6474,6848]],"id":"18013","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[6849,6850,6851,6852,6853]],"id":"13101","properties":{"name":"Echols"}},{"type":"Polygon","arcs":[[6854,-5345,6855,-5167,-6552,-6491,-6617]],"id":"37085","properties":{"name":"Harnett"}},{"type":"Polygon","arcs":[[-6067,6856,6857,6858,6859,6860]],"id":"36107","properties":{"name":"Tioga"}},{"type":"Polygon","arcs":[[-6618,-6494,-6620,-5710]],"id":"37093","properties":{"name":"Hoke"}},{"type":"Polygon","arcs":[[6861,6862,6863,6864]],"id":"37143","properties":{"name":"Perquimans"}},{"type":"Polygon","arcs":[[-4427,-4785,6865,-5310,-1347]],"id":"47085","properties":{"name":"Humphreys"}},{"type":"Polygon","arcs":[[-645,-381,-1909,-2500,-156]],"id":"48381","properties":{"name":"Randall"}},{"type":"Polygon","arcs":[[-3142,6866,6867,6868,-5745,-131]],"id":"08023","properties":{"name":"Costilla"}},{"type":"MultiPolygon","arcs":[[[6869]],[[6870,-3740,6871,-1796,6872,6873,6874,6875]]],"id":"08123","properties":{"name":"Weld"}},{"type":"Polygon","arcs":[[6876,6877,6878,-3872,6879,-4202]],"id":"13313","properties":{"name":"Whitfield"}},{"type":"Polygon","arcs":[[6880,6881,6882,6883,-6455,6884]],"id":"21023","properties":{"name":"Bracken"}},{"type":"Polygon","arcs":[[-4048,-6382,6885,-2432,6886]],"id":"18159","properties":{"name":"Tipton"}},{"type":"Polygon","arcs":[[6887,-4495,-6398,-4111,6888,-4618]],"id":"21207","properties":{"name":"Russell"}},{"type":"Polygon","arcs":[[-5808,-6348,-5704,6889,-5287]],"id":"21143","properties":{"name":"Lyon"}},{"type":"Polygon","arcs":[[-994,-3144,6890,6891,6892,6893]],"id":"20025","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[-3422,-6001,-6804,-3652,-1031,6894,-5007]],"id":"37077","properties":{"name":"Granville"}},{"type":"MultiPolygon","arcs":[[[6895,6896]],[[-6599,6897,6898,6899,6900,6901]]],"id":"37095","properties":{"name":"Hyde"}},{"type":"Polygon","arcs":[[6902,-6338,6903,6904]],"id":"28125","properties":{"name":"Sharkey"}},{"type":"Polygon","arcs":[[-6377,6905,6906,-840,6907]],"id":"13009","properties":{"name":"Baldwin"}},{"type":"Polygon","arcs":[[-4103,-3892,-6443,-2700,-6583,-6445]],"id":"21085","properties":{"name":"Grayson"}},{"type":"Polygon","arcs":[[-5445,-6190,-81,-419,-6193]],"id":"28115","properties":{"name":"Pontotoc"}},{"type":"Polygon","arcs":[[-585,6908,6909,-5160,6910]],"id":"31015","properties":{"name":"Boyd"}},{"type":"Polygon","arcs":[[6911]],"id":"51790","properties":{"name":"Staunton"}},{"type":"Polygon","arcs":[[-2396,6912,-3557,-5053,-4646,-6419]],"id":"31025","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[-1391,6913,-3007,-111,-4542,-506]],"id":"46073","properties":{"name":"Jerauld"}},{"type":"Polygon","arcs":[[-4591,-6222,-4597,-4710,6914,-248]],"id":"04003","properties":{"name":"Cochise"}},{"type":"Polygon","arcs":[[6915,-4255,-3332,-4394,6916,6917]],"id":"05113","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[-2934,-5487,6918,6919,6920,-3761]],"id":"45039","properties":{"name":"Fairfield"}},{"type":"MultiPolygon","arcs":[[[6921]],[[-2869,6922,6923,6924]],[[6925]]],"id":"06111","properties":{"name":"Ventura"}},{"type":"Polygon","arcs":[[6926,-1936,6927,6928,6929]],"id":"06059","properties":{"name":"Orange"}},{"type":"Polygon","arcs":[[6930,-3678,-2887,6931]],"id":"12053","properties":{"name":"Hernando"}},{"type":"Polygon","arcs":[[6932,6933,6934,6935,-4272,-2922]],"id":"13029","properties":{"name":"Bryan"}},{"type":"Polygon","arcs":[[-2622,-5542,6936,-196,6937,6938,-2599]],"id":"19109","properties":{"name":"Kossuth"}},{"type":"Polygon","arcs":[[6939,-2761,-2515,-3930,6940,-3199]],"id":"20187","properties":{"name":"Stanton"}},{"type":"Polygon","arcs":[[6941,-3117,-2214,6942,-3203,-3966,6943,-6868]],"id":"08071","properties":{"name":"Las Animas"}},{"type":"Polygon","arcs":[[-2877,-6841,-3325,6944,-3087,-4935,6945,6946,-4960]],"id":"17119","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[6947,-724,-582,6948,6949,6950,6951]],"id":"12015","properties":{"name":"Charlotte"}},{"type":"Polygon","arcs":[[-5327,-4676,-6169,6952,6953,-3878,6954]],"id":"18051","properties":{"name":"Gibson"}},{"type":"Polygon","arcs":[[6955,6956,-3548,-259]],"id":"19163","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[6957,-5905,-6571,-3955,6958,-3861,6959]],"id":"41035","properties":{"name":"Klamath"}},{"type":"Polygon","arcs":[[-5158,-2649,6960,-1609,-6781]],"id":"48123","properties":{"name":"DeWitt"}},{"type":"Polygon","arcs":[[6961,-300,6962,6963,6964,6965,6966]],"id":"01023","properties":{"name":"Choctaw"}},{"type":"Polygon","arcs":[[6967,6968,6969,-4390,6970,-6963,-299]],"id":"01119","properties":{"name":"Sumter"}},{"type":"Polygon","arcs":[[6971,-1629,6972,6973,6974,6975,-4037]],"id":"05015","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[6976,6977,-4832,-1931,6978,-6923,-2868,6979]],"id":"06029","properties":{"name":"Kern"}},{"type":"MultiPolygon","arcs":[[[-6949,6980,6981,6982]],[[6983]],[[-6951,6984]]],"id":"12071","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[6985,-438,-6229,6986,-1721,6987,6988]],"id":"08107","properties":{"name":"Routt"}},{"type":"Polygon","arcs":[[6989,6990,6991,6992,6993,6994,6995]],"id":"17181","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-3143,-697,-5686,6996,-6891]],"id":"20033","properties":{"name":"Comanche"}},{"type":"Polygon","arcs":[[6997,6998,-4490,-6444,-1282,-6264]],"id":"21059","properties":{"name":"Daviess"}},{"type":"MultiPolygon","arcs":[[[6999]],[[7000]],[[7001,7002,7003]]],"id":"22087","properties":{"name":"St. Bernard"}},{"type":"Polygon","arcs":[[7004,7005,-3874,7006,7007]],"id":"16005","properties":{"name":"Bannock"}},{"type":"Polygon","arcs":[[7008,-1543,-1542,-4023,-2841,-855,-3163,-5028]],"id":"20153","properties":{"name":"Rawlins"}},{"type":"Polygon","arcs":[[7009,7010,7011,7012,7013,-2009]],"id":"13275","properties":{"name":"Thomas"}},{"type":"Polygon","arcs":[[7014,7015,-1782,7016,-3139,7017,7018]],"id":"13099","properties":{"name":"Early"}},{"type":"Polygon","arcs":[[-5576,-6106,-3904,7019]],"id":"16081","properties":{"name":"Teton"}},{"type":"Polygon","arcs":[[-3374,-4982,-5026,-5258,7020,7021]],"id":"24015","properties":{"name":"Cecil"}},{"type":"Polygon","arcs":[[-447,7022,7023,-76]],"id":"26147","properties":{"name":"St. Clair"}},{"type":"Polygon","arcs":[[-3666,7024,7025,7026,-3504,7027,7028]],"id":"05107","properties":{"name":"Phillips"}},{"type":"Polygon","arcs":[[7029,7030,-5293,7031,7032]],"id":"06013","properties":{"name":"Contra Costa"}},{"type":"Polygon","arcs":[[7033,-5088,7034,7035,7036]],"id":"09009","properties":{"name":"New Haven"}},{"type":"Polygon","arcs":[[-6953,-6168,-6309,7037,-6998,-6263,7038]],"id":"18173","properties":{"name":"Warrick"}},{"type":"Polygon","arcs":[[7039,-4214,7040,7041,7042,7043,-4269]],"id":"18019","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[7044,7045,7046,-2369,7047,-3676]],"id":"12069","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[7048,7049,7050,7051]],"id":"21037","properties":{"name":"Campbell"}},{"type":"Polygon","arcs":[[7052,-2376,7053,-4635,7054,7055]],"id":"22037","properties":{"name":"East Feliciana"}},{"type":"Polygon","arcs":[[7056,7057,7058,7059,-5987]],"id":"12121","properties":{"name":"Suwannee"}},{"type":"MultiPolygon","arcs":[[[7060,-7056,7061,-3918,7062]],[[7063,-3916,7064]]],"id":"22125","properties":{"name":"West Feliciana"}},{"type":"MultiPolygon","arcs":[[[-3174,7065]],[[7066]],[[7067]],[[-3483,7068,7069]]],"id":"23013","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[7070,7071,7072,7073,-1556]],"id":"26163","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[-4356,7074,7075,7076,7077]],"id":"28033","properties":{"name":"DeSoto"}},{"type":"Polygon","arcs":[[7078,-5016,7079,7080,7081,-5266]],"id":"24027","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[7082,7083,7084,7085,-6990,7086,-6409,-4056]],"id":"29157","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-4957,7087,7088,-1246,-4230]],"id":"29113","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-2748,7089,7090,7091,7092]],"id":"27057","properties":{"name":"Hubbard"}},{"type":"Polygon","arcs":[[-2409,-3929,-1587,7093,7094,7095]],"id":"20021","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[7096,-6033,7097,-5126,-5470,7098]],"id":"27011","properties":{"name":"Big Stone"}},{"type":"Polygon","arcs":[[-5024,7099,7100,-947,7101,-5259]],"id":"10001","properties":{"name":"Kent"}},{"type":"Polygon","arcs":[[7102,-2904,7103,7104]],"id":"16075","properties":{"name":"Payette"}},{"type":"Polygon","arcs":[[-1142,-2992,-6647,7105,-2539]],"id":"18151","properties":{"name":"Steuben"}},{"type":"Polygon","arcs":[[-1696,7106,-5149,7107,7108,7109]],"id":"12075","properties":{"name":"Levy"}},{"type":"Polygon","arcs":[[-3047,-6246,7110,7111,-6851,7112]],"id":"13065","properties":{"name":"Clinch"}},{"type":"Polygon","arcs":[[7113,7114,-2659,-5090,7115]],"id":"26027","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[-4355,7116,7117,-5441,-6192,7118,-7075]],"id":"28093","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[-347,-4051,-1275,-1560,7119,-5619,-1301]],"id":"26081","properties":{"name":"Kent"}},{"type":"Polygon","arcs":[[7120,7121,-5404,-125,-2809,7122,7123]],"id":"31135","properties":{"name":"Perkins"}},{"type":"Polygon","arcs":[[7124,7125,7126,7127]],"id":"34029","properties":{"name":"Ocean"}},{"type":"Polygon","arcs":[[-3340,7128,-4210,7129,-5438,7130]],"id":"18167","properties":{"name":"Vigo"}},{"type":"Polygon","arcs":[[7131,-6429,-6068,-6861,7132,-6579]],"id":"36015","properties":{"name":"Chemung"}},{"type":"Polygon","arcs":[[-4303,7133,-6615,-2973,7134,-6171]],"id":"18155","properties":{"name":"Switzerland"}},{"type":"Polygon","arcs":[[7135,-7091,7136,-3362,-2020]],"id":"27159","properties":{"name":"Wadena"}},{"type":"Polygon","arcs":[[7137,-4350,-2424,7138,-5557,-5493,-1421]],"id":"56027","properties":{"name":"Niobrara"}},{"type":"Polygon","arcs":[[-3899,7139,7140,-269,7141,-6131]],"id":"29013","properties":{"name":"Bates"}},{"type":"Polygon","arcs":[[7142,-352,-2260,7143,7144,7145]],"id":"31129","properties":{"name":"Nuckolls"}},{"type":"Polygon","arcs":[[-71,-6172,-7135,-2978,7146,-7041,-4213]],"id":"18077","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[7147,7148,7149,-4305,7150,7151,7152]],"id":"34003","properties":{"name":"Bergen"}},{"type":"Polygon","arcs":[[7153,7154,7155,7156,-7149,7157]],"id":"36119","properties":{"name":"Westchester"}},{"type":"Polygon","arcs":[[-358,7158,7159,7160]],"id":"36063","properties":{"name":"Niagara"}},{"type":"Polygon","arcs":[[7161,-6495,-4007,7162,-4534]],"id":"37189","properties":{"name":"Watauga"}},{"type":"Polygon","arcs":[[7163,-825,-3361,7164,-5128]],"id":"27023","properties":{"name":"Chippewa"}},{"type":"Polygon","arcs":[[-5202,7165,7166,7167,-6559,7168]],"id":"40071","properties":{"name":"Kay"}},{"type":"Polygon","arcs":[[-538,7169,-5284,-5075,7170]],"id":"17151","properties":{"name":"Pope"}},{"type":"Polygon","arcs":[[-5679,7171,7172,-6611,7173,-6140,-5509,-4863]],"id":"42089","properties":{"name":"Monroe"}},{"type":"MultiPolygon","arcs":[[[-6548,-6251]],[[-5001,-6253,-6551,7174,-4712,-5011,-5874]]],"id":"35043","properties":{"name":"Sandoval"}},{"type":"Polygon","arcs":[[-2946,-1466,-5573,-2532,7175]],"id":"16033","properties":{"name":"Clark"}},{"type":"MultiPolygon","arcs":[[[7176,7177,-1535,-2503,7178]],[[7179]],[[7180]],[[7181]]],"id":"26029","properties":{"name":"Charlevoix"}},{"type":"Polygon","arcs":[[-2568,-1558,7182,-3541,7183,-2989]],"id":"26091","properties":{"name":"Lenawee"}},{"type":"Polygon","arcs":[[-6092,-6730,7184,-3149,7185]],"id":"27157","properties":{"name":"Wabasha"}},{"type":"Polygon","arcs":[[7186,-2339,-4828,-5665,7187]],"id":"29047","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[7188,7189,-2643,-6555,-6503,7190]],"id":"40081","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-5177,-1409,-1139,-5272,7191,-3256,7192,7193]],"id":"47069","properties":{"name":"Hardeman"}},{"type":"Polygon","arcs":[[7194,-2768,7195,-2745,7196]],"id":"27071","properties":{"name":"Koochiching"}},{"type":"Polygon","arcs":[[-27,-2128,7197,7198,-32,-5935]],"id":"27107","properties":{"name":"Norman"}},{"type":"Polygon","arcs":[[-3341,-7131,-5437,7199,-3097,-3249,7200]],"id":"17023","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[-7198,-2127,7201,-7092,-7136,-2019,7202]],"id":"27005","properties":{"name":"Becker"}},{"type":"Polygon","arcs":[[7203,-3154,-1100,-3467,-5216,7204]],"id":"19085","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[7205,-3276,7206,7207,-3505,-7027]],"id":"28027","properties":{"name":"Coahoma"}},{"type":"Polygon","arcs":[[-4456,7208,-3970,7209,7210,-160,7211,7212,-4065,7213]],"id":"35037","properties":{"name":"Quay"}},{"type":"Polygon","arcs":[[-6423,7214,7215,7216,7217,7218]],"id":"34023","properties":{"name":"Middlesex"}},{"type":"Polygon","arcs":[[-3641,7219,7220,7221,7222,-4395,-2014]],"id":"54071","properties":{"name":"Pendleton"}},{"type":"Polygon","arcs":[[-2310,7223,7224,7225,-5401]],"id":"05003","properties":{"name":"Ashley"}},{"type":"Polygon","arcs":[[-3506,-7208,7226,7227,-6334,7228]],"id":"28133","properties":{"name":"Sunflower"}},{"type":"Polygon","arcs":[[7229,-7077,7230,7231,-3273,-7206,-7026,7232]],"id":"28143","properties":{"name":"Tunica"}},{"type":"Polygon","arcs":[[-668,-4613,7233,-3290,-2321,7234]],"id":"29171","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[-4612,-3059,-1647,-3291,-7234]],"id":"29197","properties":{"name":"Schuyler"}},{"type":"Polygon","arcs":[[7235,7236,7237,-3638,-2905,-6795,-6699]],"id":"54085","properties":{"name":"Ritchie"}},{"type":"Polygon","arcs":[[7238,-3135,-3635,-7238,7239,7240]],"id":"54095","properties":{"name":"Tyler"}},{"type":"Polygon","arcs":[[-4520,7241,7242,7243,7244,-3438]],"id":"51063","properties":{"name":"Floyd"}},{"type":"Polygon","arcs":[[-4339,-3840,7245,7246,-264,7247]],"id":"30055","properties":{"name":"McCone"}},{"type":"Polygon","arcs":[[-2089,-6392,7248,-3157,7249,-5427]],"id":"20177","properties":{"name":"Shawnee"}},{"type":"Polygon","arcs":[[-7106,-6646,-1037,-2079,-850]],"id":"18033","properties":{"name":"DeKalb"}},{"type":"Polygon","arcs":[[7250,-1455,-94,-232]],"id":"46101","properties":{"name":"Moody"}},{"type":"Polygon","arcs":[[-7054,-2375,-15,7251,-4636]],"id":"22091","properties":{"name":"St. Helena"}},{"type":"Polygon","arcs":[[7252,-3516,7253,-3998,7254]],"id":"55051","properties":{"name":"Iron"}},{"type":"Polygon","arcs":[[7255,-3621,7256,-4812,7257,7258]],"id":"48475","properties":{"name":"Ward"}},{"type":"Polygon","arcs":[[7259,-3554,-4552,7260,-6778]],"id":"48485","properties":{"name":"Wichita"}},{"type":"MultiPolygon","arcs":[[[-6275,7261,7262,7263]],[[-6279,7264,7265,7266]]],"id":"48489","properties":{"name":"Willacy"}},{"type":"Polygon","arcs":[[7267,7268,-3696,7269,7270,-6402,7271]],"id":"22083","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[-1644,-2060,7272,7273,7274,7275]],"id":"29045","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[7276,7277,7278,-3132]],"id":"54049","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[7279,7280,7281,-7236,-6703,7282,-3787]],"id":"54107","properties":{"name":"Wood"}},{"type":"Polygon","arcs":[[-3133,-7279,7283,-5114,7284,7285,-3636]],"id":"54033","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[7286,7287,-4340,-7248,-263,-4370]],"id":"30105","properties":{"name":"Valley"}},{"type":"Polygon","arcs":[[7288,7289,7290,-3489,7291]],"id":"25009","properties":{"name":"Essex"}},{"type":"Polygon","arcs":[[7292,-4536,7293,-4506,7294,-1426]],"id":"47019","properties":{"name":"Carter"}},{"type":"Polygon","arcs":[[-284,7295,7296,-5627,7297,7298,7299]],"id":"47147","properties":{"name":"Robertson"}},{"type":"Polygon","arcs":[[-2309,7300,-3508,7301,7302,-3693,7303,7304,-7224]],"id":"05017","properties":{"name":"Chicot"}},{"type":"Polygon","arcs":[[-6886,-6385,7305,7306,-2097,-2433]],"id":"18057","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[7307,-2106,-4049,-6887,-2431,7308]],"id":"18067","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[-2098,-7307,7309,-1519,-610,7310,-1498]],"id":"18097","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-5702,-2434,-2099,-1501,7311,-4207,-5594]],"id":"18107","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[7312,7313,-2797,-2823,-6483,-6488]],"id":"28089","properties":{"name":"Madison"}},{"type":"MultiPolygon","arcs":[[[7314,7315,-2152]]],"id":"26033","properties":{"name":"Chippewa"}},{"type":"MultiPolygon","arcs":[[[7316]],[[-2153,-7316,7317,7318]]],"id":"26097","properties":{"name":"Mackinac"}},{"type":"Polygon","arcs":[[7319,7320,7321,7322,-4994]],"id":"12089","properties":{"name":"Nassau"}},{"type":"Polygon","arcs":[[-7278,7323,-5188,-5111,-7284]],"id":"54091","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[-4540,7324,-5424,-3868,-6879,7325]],"id":"47011","properties":{"name":"Bradley"}},{"type":"Polygon","arcs":[[7326,7327,7328,-7057,-5986,7329,7330]],"id":"12079","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[7331,-3054,7332,7333,-6336]],"id":"28051","properties":{"name":"Holmes"}},{"type":"Polygon","arcs":[[7334,-3315,-5960,-5955,-1339,-5892]],"id":"47183","properties":{"name":"Weakley"}},{"type":"Polygon","arcs":[[7335,-5478,-6093,-7186,-3148,-2996,-1874]],"id":"27049","properties":{"name":"Goodhue"}},{"type":"Polygon","arcs":[[7336,7337,-874,-1472,7338,7339]],"id":"29077","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[7340,7341,-3416,7342,-3852,7343,-3457]],"id":"01111","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[-3723,-4668,7344,7345,-1565]],"id":"35013","properties":{"name":"Doña Ana"}},{"type":"Polygon","arcs":[[7346,7347,-6719,-5409,7348,-6674]],"id":"42119","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-2593,-241,-3764,7349,-5793]],"id":"46119","properties":{"name":"Sully"}},{"type":"Polygon","arcs":[[-1578,-5764,-945,7350,-5397,7351]],"id":"33003","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[-2788,7352]],"id":"51770","properties":{"name":"Roanoke"}},{"type":"Polygon","arcs":[[-5682,-3550,7353,-5172,-4332,-2093,-2771]],"id":"19115","properties":{"name":"Louisa"}},{"type":"Polygon","arcs":[[-2675,7354,7355,-5993,-5054]],"id":"19145","properties":{"name":"Page"}},{"type":"Polygon","arcs":[[-5486,-4870,-4977,-5555,-5727,7356,-6919]],"id":"45055","properties":{"name":"Kershaw"}},{"type":"Polygon","arcs":[[7357,-7007,-3873,-3207,-3475]],"id":"16077","properties":{"name":"Power"}},{"type":"Polygon","arcs":[[7358,-3120,7359]],"id":"41011","properties":{"name":"Coos"}},{"type":"Polygon","arcs":[[-5906,-6958,7360,-2474,-3121,-7359,7361]],"id":"41019","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[-4410,-2697,7362,7363,7364]],"id":"55023","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[7365,7366,-1680,7367,7368,-3798],[7369]],"id":"51005","properties":{"name":"Alleghany"}},{"type":"Polygon","arcs":[[-4720,-5457,7370,7371,-4517,-3435,-6784]],"id":"51071","properties":{"name":"Giles"}},{"type":"Polygon","arcs":[[-7059,7372,-6852,-7112,7373,7374,-5144,7375]],"id":"12023","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[-5496,7376,7377,7378]],"id":"27123","properties":{"name":"Ramsey"}},{"type":"Polygon","arcs":[[7379,-4179,7380,7381,-1719,7382,7383]],"id":"49047","properties":{"name":"Uintah"}},{"type":"Polygon","arcs":[[7384,7385,7386,-4363,7387,-7243]],"id":"51067","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[7388,-3388]],"id":"15005","properties":{"name":"Kalawao"}},{"type":"Polygon","arcs":[[-4941,-4418,-6052,7389,7390,-6389,-2087]],"id":"20005","properties":{"name":"Atchison"}},{"type":"Polygon","arcs":[[7391,-6269,-6213,7392,7393]],"id":"09015","properties":{"name":"Windham"}},{"type":"Polygon","arcs":[[7394,7395,-7393,-6212,7396,7397,-5086]],"id":"09011","properties":{"name":"New London"}},{"type":"Polygon","arcs":[[7398,7399,7400,7401,-3367,-6514]],"id":"41005","properties":{"name":"Clackamas"}},{"type":"Polygon","arcs":[[-1052,-5006,-5516,7402,-1684,-6760,7403]],"id":"48419","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[7404,-5671,-962,7405,7406,-4141,7407]],"id":"39029","properties":{"name":"Columbiana"}},{"type":"Polygon","arcs":[[-1105,7408,-6977,7409,-1243]],"id":"06031","properties":{"name":"Kings"}},{"type":"Polygon","arcs":[[7410,-2872,-2103,7411,7412,7413,7414]],"id":"06045","properties":{"name":"Mendocino"}},{"type":"Polygon","arcs":[[-4197,-1809,7415,-2220,-6114]],"id":"08035","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[-512,-2967,-3595,7416,7417,-2777]],"id":"48259","properties":{"name":"Kendall"}},{"type":"Polygon","arcs":[[7418,7419,-3658,7420,-6974]],"id":"05009","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[-6561,7421,7422,-7189,7423,-1336]],"id":"40083","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[7424,-3965,7425,7426,-3533]],"id":"36065","properties":{"name":"Oneida"}},{"type":"Polygon","arcs":[[7427,-6459,7428,7429,7430,7431]],"id":"37113","properties":{"name":"Macon"}},{"type":"Polygon","arcs":[[7432,7433,7434,7435,7436,7437,7438]],"id":"36031","properties":{"name":"Essex"}},{"type":"Polygon","arcs":[[-2016,-4397,7439,7440,-7366,-3797]],"id":"51017","properties":{"name":"Bath"}},{"type":"Polygon","arcs":[[7441,7442,7443,7444,-6829]],"id":"54005","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[7445,7446,-3801,-5455,7447]],"id":"54019","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[7448,7449,-6605,7450,-7446,7451,-7443,7452,7453]],"id":"54039","properties":{"name":"Kanawha"}},{"type":"Polygon","arcs":[[7454,-6988,-1720,-7382]],"id":"08103","properties":{"name":"Rio Blanco"}},{"type":"Polygon","arcs":[[-1499,-7311,-614,-6847,7455,-6303,7456]],"id":"18109","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[7457,-6405,7458,7459,7460,-4642]],"id":"22059","properties":{"name":"LaSalle"}},{"type":"Polygon","arcs":[[-1480,-6542,7461,-4893,7462]],"id":"29135","properties":{"name":"Moniteau"}},{"type":"Polygon","arcs":[[-4681,7463,-1619,-5673,7464,7465]],"id":"42039","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[-5734,-5209,7466,7467,7468,-6563,-5766]],"id":"21205","properties":{"name":"Rowan"}},{"type":"Polygon","arcs":[[-4783,7469,7470,7471,7472,-5337,7473]],"id":"47187","properties":{"name":"Williamson"}},{"type":"Polygon","arcs":[[-1614,-960,-711,7474,-306]],"id":"38081","properties":{"name":"Sargent"}},{"type":"Polygon","arcs":[[7475,-3104,7476]],"id":"16061","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[7477,7478,7479,-7477,-3103,7480,7481]],"id":"16069","properties":{"name":"Nez Perce"}},{"type":"Polygon","arcs":[[7482,-7146,7483,-1488,-6175,7484,-4658]],"id":"20089","properties":{"name":"Jewell"}},{"type":"Polygon","arcs":[[7485,-3236,7486,-5425,7487,-2917]],"id":"20117","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[-3235,-4020,-4942,-2085,-5426,-7487]],"id":"20131","properties":{"name":"Nemaha"}},{"type":"Polygon","arcs":[[7488,-4039,-3186,7489,7490,-2115]],"id":"40001","properties":{"name":"Adair"}},{"type":"Polygon","arcs":[[-7431,7491,7492,7493,7494]],"id":"37043","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[7495,-3775,-5725,-4343,-5724,-4341,-6299,7496,7497,7498,7499]],"id":"45073","properties":{"name":"Oconee"}},{"type":"Polygon","arcs":[[-3185,7500,7501,7502,7503,-7490]],"id":"05033","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[-2994,-2136,-6388,-2512,-2760]],"id":"20093","properties":{"name":"Kearny"}},{"type":"Polygon","arcs":[[-2493,-6333,7504,7505,7506,7507]],"id":"28091","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[7508,-6194,-422,-2313,7509]],"id":"28161","properties":{"name":"Yalobusha"}},{"type":"Polygon","arcs":[[7510,-2255,-1007,-2596,-143,-2839,-4022]],"id":"31065","properties":{"name":"Furnas"}},{"type":"Polygon","arcs":[[7511,7512,-5370,-4162,7513]],"id":"53015","properties":{"name":"Cowlitz"}},{"type":"Polygon","arcs":[[-1041,7514,7515,-2284,7516,-4031]],"id":"01083","properties":{"name":"Limestone"}},{"type":"Polygon","arcs":[[7517,7518,7519,-2344]],"id":"12013","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[7520,-3679,-6931,7521,-7109]],"id":"12017","properties":{"name":"Citrus"}},{"type":"Polygon","arcs":[[-7303,7522,-6905,7523,-3524,-3694]],"id":"28055","properties":{"name":"Issaquena"}},{"type":"Polygon","arcs":[[7524,-4271,7525,-3886,-6586,-4264]],"id":"18061","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[-6941,-3934,-6731,7526,-3200]],"id":"20129","properties":{"name":"Morton"}},{"type":"Polygon","arcs":[[-4504,-6138,7527,-3758,-6695,-1017]],"id":"45083","properties":{"name":"Spartanburg"}},{"type":"Polygon","arcs":[[-1486,-3102,7528,-3269,7529,-6176]],"id":"20143","properties":{"name":"Ottawa"}},{"type":"Polygon","arcs":[[7530,7531,-4441]],"id":"30103","properties":{"name":"Treasure"}},{"type":"Polygon","arcs":[[7532,-4859,-4760,7533,7534,-1601]],"id":"31051","properties":{"name":"Dixon"}},{"type":"Polygon","arcs":[[7535,7536,-5926,-6821,-5641,-5529]],"id":"55013","properties":{"name":"Burnett"}},{"type":"Polygon","arcs":[[7537,-5788,-5467,7538,-3013,7539,7540]],"id":"55025","properties":{"name":"Dane"}},{"type":"Polygon","arcs":[[7541,7542,7543,7544,7545,-4158,7546,-4625]],"id":"22007","properties":{"name":"Assumption"}},{"type":"Polygon","arcs":[[7547,7548,7549,7550,-6612,-7173,7551]],"id":"42127","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[7552,-7426,-3964,7553,-47,7554,7555]],"id":"36077","properties":{"name":"Otsego"}},{"type":"Polygon","arcs":[[7556,7557,-3751,-2273,7558,-2239]],"id":"40049","properties":{"name":"Garvin"}},{"type":"Polygon","arcs":[[-4311,7559,-7439,7560,7561,7562,-3961]],"id":"36041","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[-4038,-6976,7563,7564,7565,-7501,-3184]],"id":"05087","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[7566,-7548,7567,-5661,7568,-6859]],"id":"42115","properties":{"name":"Susquehanna"}},{"type":"MultiPolygon","arcs":[[[7569]],[[7570,7571,7572,7573]]],"id":"12037","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-805,-2011,7574,7575,7576]],"id":"12039","properties":{"name":"Gadsden"}},{"type":"Polygon","arcs":[[-2345,-7520,7577,-7574,7578]],"id":"12045","properties":{"name":"Gulf"}},{"type":"Polygon","arcs":[[7579,-7013,7580,-7331,7581,7582,7583]],"id":"12065","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[7584,-2891,7585,7586,-2893]],"id":"12103","properties":{"name":"Pinellas"}},{"type":"Polygon","arcs":[[7587,7588,-496,7589,-6691,-1869,-500]],"id":"40075","properties":{"name":"Kiowa"}},{"type":"Polygon","arcs":[[-7502,-7566,7590,-4822,7591]],"id":"05047","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[7592,7593,-2639,7594,7595]],"id":"40117","properties":{"name":"Pawnee"}},{"type":"Polygon","arcs":[[-3753,7596,7597,7598,7599,7600,-2275]],"id":"40069","properties":{"name":"Johnston"}},{"type":"Polygon","arcs":[[-1093,-5104,7601,7602,-1637,-6041,7603]],"id":"29081","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[-6538,7604,7605,7606,-6330,-2491]],"id":"28031","properties":{"name":"Covington"}},{"type":"Polygon","arcs":[[7607,-7514,-4161,-6709,7608,-6826]],"id":"53069","properties":{"name":"Wahkiakum"}},{"type":"Polygon","arcs":[[7609,7610,7611,7612,7613]],"id":"12019","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-2154,-7319,7614,7615,-4915]],"id":"26153","properties":{"name":"Schoolcraft"}},{"type":"Polygon","arcs":[[-1690,-2766,7616,-4405,-5924,-7537,7617]],"id":"55031","properties":{"name":"Douglas"}},{"type":"MultiPolygon","arcs":[[[7618,7619,7620]],[[7621,7622,7623,7624,-1886,-163,7625]]],"id":"13193","properties":{"name":"Macon"}},{"type":"Polygon","arcs":[[7626,7627,-5396,-5392,-1205,-5275]],"id":"22027","properties":{"name":"Claiborne"}},{"type":"Polygon","arcs":[[-7414,7628,7629,7630,7631,7632,7633]],"id":"06097","properties":{"name":"Sonoma"}},{"type":"Polygon","arcs":[[-3749,-6507,7634,-7557,-2238,7635]],"id":"40087","properties":{"name":"McClain"}},{"type":"Polygon","arcs":[[7636,-2480,-6420,-3717,-3237,-7486,-2916]],"id":"31067","properties":{"name":"Gage"}},{"type":"Polygon","arcs":[[7637,-5550,-5761,7638,-2957,7639,7640]],"id":"48343","properties":{"name":"Morris"}},{"type":"Polygon","arcs":[[-7424,-7191,-6502,-3747,7641]],"id":"40109","properties":{"name":"Oklahoma"}},{"type":"Polygon","arcs":[[7642,-2247,-6461,7643,-2264]],"id":"48223","properties":{"name":"Hopkins"}},{"type":"Polygon","arcs":[[-3963,7644,7645,7646,-42,-7554]],"id":"36057","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[7647,-6037,7648,7649,-7593,7650,-7167]],"id":"40113","properties":{"name":"Osage"}},{"type":"Polygon","arcs":[[7651,-280,7652,7653]],"id":"12113","properties":{"name":"Santa Rosa"}},{"type":"Polygon","arcs":[[-7047,7654,-2366]],"id":"12117","properties":{"name":"Seminole"}},{"type":"Polygon","arcs":[[-1781,7655,7656,-802,-3137,-7017]],"id":"13007","properties":{"name":"Baker"}},{"type":"Polygon","arcs":[[7657,7658,-4199,-4247,7659]],"id":"13083","properties":{"name":"Dade"}},{"type":"Polygon","arcs":[[7660,7661,7662,7663,-7656,-1780]],"id":"13095","properties":{"name":"Dougherty"}},{"type":"Polygon","arcs":[[-7664,7664,7665,-7010,-2008,-803,-7657]],"id":"13205","properties":{"name":"Mitchell"}},{"type":"Polygon","arcs":[[-7018,-3138,-800,7666,7667]],"id":"13253","properties":{"name":"Seminole"}},{"type":"Polygon","arcs":[[7668,-7595,-2644,-7190,-7423]],"id":"40119","properties":{"name":"Payne"}},{"type":"Polygon","arcs":[[-5754,7669,-4114,-401,-5812,-5860]],"id":"47137","properties":{"name":"Pickett"}},{"type":"Polygon","arcs":[[-5571,-6522,7670,-5518,-6441]],"id":"21087","properties":{"name":"Green"}},{"type":"Polygon","arcs":[[-4803,-2267,-4791,7671]],"id":"48397","properties":{"name":"Rockwall"}},{"type":"Polygon","arcs":[[-4666,7672,-3079,7673,7674]],"id":"48229","properties":{"name":"Hudspeth"}},{"type":"Polygon","arcs":[[-6701,-6797,-6601,-7450,7675]],"id":"54087","properties":{"name":"Roane"}},{"type":"Polygon","arcs":[[-6397,-6315,-3771,-6270,-396,-4113]],"id":"21147","properties":{"name":"McCreary"}},{"type":"Polygon","arcs":[[7676,7677,-6967,7678,7679,-6201,7680]],"id":"28153","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[-7363,-2696,7681,7682,-3935,-4615,7683]],"id":"55043","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[7684,7685,7686,-7063,-3917,-7064,7687,7688]],"id":"22029","properties":{"name":"Concordia"}},{"type":"Polygon","arcs":[[-6463,-2960,-2460,7689,7690,7691,-2251]],"id":"48423","properties":{"name":"Smith"}},{"type":"Polygon","arcs":[[7692,-7433,-7560,-4310,7693]],"id":"36033","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[7694,7695,-3530,7696,-3528,7697,-4319,7698,-7685,7699]],"id":"22107","properties":{"name":"Tensas"}},{"type":"Polygon","arcs":[[7700,7701,-2377,-7053,-7061,-7687]],"id":"28157","properties":{"name":"Wilkinson"}},{"type":"Polygon","arcs":[[-3527,-6489,-6196,-4315,-7698]],"id":"28021","properties":{"name":"Claiborne"}},{"type":"Polygon","arcs":[[-301,-6962,-7678,7702]],"id":"28023","properties":{"name":"Clarke"}},{"type":"Polygon","arcs":[[-2380,7703,-4756,-1388,-236,-2592]],"id":"46049","properties":{"name":"Faulk"}},{"type":"Polygon","arcs":[[-1398,-5339,-1043,-4030,7704]],"id":"47099","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[-7607,7705,-6204,-412,7706,-6331]],"id":"28035","properties":{"name":"Forrest"}},{"type":"Polygon","arcs":[[7707,7708,-595,7709,7710,-7512,-7608,-6825]],"id":"53041","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[-7387,7711,7712,-5997,7713,-1228,7714,-771,-4364]],"id":"51143","properties":{"name":"Pittsylvania"}},{"type":"Polygon","arcs":[[-295,7715,7716,7717,-6217]],"id":"54027","properties":{"name":"Hampshire"}},{"type":"Polygon","arcs":[[-6291,7718,-934,-2469,7719,7720]],"id":"06115","properties":{"name":"Yuba"}},{"type":"Polygon","arcs":[[-6337,-7334,-7313,-6487,-3525,-7524,-6904]],"id":"28163","properties":{"name":"Yazoo"}},{"type":"Polygon","arcs":[[-2784,7721,-6582,-6721,7722,-4854,7723]],"id":"42105","properties":{"name":"Potter"}},{"type":"Polygon","arcs":[[-121,-6280,-7267,7724,7725,7726]],"id":"48215","properties":{"name":"Hidalgo"}},{"type":"Polygon","arcs":[[7727,7728]],"id":"51131","properties":{"name":"Northampton"}},{"type":"Polygon","arcs":[[-4312,-3959,-7425,-3532,-6128]],"id":"36049","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[7729,-7626,-162,7730]],"id":"13249","properties":{"name":"Schley"}},{"type":"Polygon","arcs":[[7731,-7364,-7684,-4614,-917,-3685]],"id":"19043","properties":{"name":"Clayton"}},{"type":"Polygon","arcs":[[-6468,7732,-6865,7733]],"id":"37041","properties":{"name":"Chowan"}},{"type":"Polygon","arcs":[[7734,7735,-4251,-4733,7736,7737,-2286]],"id":"01095","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[7738,7739,7740,-7549,-7567,-6858]],"id":"36007","properties":{"name":"Broome"}},{"type":"Polygon","arcs":[[-7647,7741,-6080,-43]],"id":"36093","properties":{"name":"Schenectady"}},{"type":"Polygon","arcs":[[7742,-2271,7743,-6765,7744]],"id":"48041","properties":{"name":"Brazos"}},{"type":"Polygon","arcs":[[7745,7746,7747,7748,7749,-2281]],"id":"51047","properties":{"name":"Culpeper"}},{"type":"Polygon","arcs":[[7750,7751,-7745,-6764,7752]],"id":"48051","properties":{"name":"Burleson"}},{"type":"MultiPolygon","arcs":[[[7753]],[[7754]],[[-416,7755,7756,7757]]],"id":"28047","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[7758,7759,7760,-2242,-7643,-2263]],"id":"48119","properties":{"name":"Delta"}},{"type":"Polygon","arcs":[[-6758,7761,-2,-4292]],"id":"49053","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-6718,-6736,-5411]],"id":"42093","properties":{"name":"Montour"}},{"type":"Polygon","arcs":[[-4810,-2589,7762,-387,-1892,-1678,7763,7764,7765]],"id":"48105","properties":{"name":"Crockett"}},{"type":"Polygon","arcs":[[7766,-2361,7767,7768,-7655,-7046,7769]],"id":"12127","properties":{"name":"Volusia"}},{"type":"Polygon","arcs":[[-6283,7770,7771,-6430,-7132,-6578,-7722,-2783]],"id":"36101","properties":{"name":"Steuben"}},{"type":"Polygon","arcs":[[-1450,7772,7773,-3990,7774]],"id":"55101","properties":{"name":"Racine"}},{"type":"Polygon","arcs":[[7775,-2401,7776,7777,7778,-3329]],"id":"05059","properties":{"name":"Hot Spring"}},{"type":"Polygon","arcs":[[-6938,-2452,-985,-3027]],"id":"19091","properties":{"name":"Humboldt"}},{"type":"Polygon","arcs":[[-3713,-2856,-3429,-2191,-4820,7779]],"id":"29055","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[-5129,-7165,-3360,-3538,-3223,-3501,7780]],"id":"27173","properties":{"name":"Yellow Medicine"}},{"type":"Polygon","arcs":[[-3819,-5587,-3674,-2443,7781,-6118]],"id":"13151","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[7782,7783,7784,7785,-4729]],"id":"01011","properties":{"name":"Bullock"}},{"type":"Polygon","arcs":[[-3810,7786,-6832,-1107,-177,7787]],"id":"06047","properties":{"name":"Merced"}},{"type":"Polygon","arcs":[[7788,-5911,-6816,-2171,7789,-2169,7790,7791,-6747]],"id":"51095","properties":{"name":"James City"}},{"type":"Polygon","arcs":[[-5391,7792,-6400,7793,-1207]],"id":"22049","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[7794,7795,7796,7797,-6862,-7733,-6467]],"id":"37073","properties":{"name":"Gates"}},{"type":"Polygon","arcs":[[7798,7799,7800,-4406,-5367,7801]],"id":"55063","properties":{"name":"La Crosse"}},{"type":"MultiPolygon","arcs":[[[-7620,7802,-7623]],[[7803,7804,7805,-7621,-7622,-7730,7806]]],"id":"13269","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[7807,7808,-6863,-7798]],"id":"37139","properties":{"name":"Pasquotank"}},{"type":"Polygon","arcs":[[-5983,-3588,7809,7810,-7746,-2280,-6045]],"id":"51061","properties":{"name":"Fauquier"}},{"type":"Polygon","arcs":[[-2291,7811,-7749,7812,-2718,-5234]],"id":"51137","properties":{"name":"Orange"}},{"type":"Polygon","arcs":[[7813,-7556,7814,-7740,7815]],"id":"36017","properties":{"name":"Chenango"}},{"type":"Polygon","arcs":[[-4556,7816,7817]],"id":"51680","properties":{"name":"Lynchburg"}},{"type":"Polygon","arcs":[[7818,7819,7820,7821,-7598]],"id":"40029","properties":{"name":"Coal"}},{"type":"Polygon","arcs":[[-6556,-6512,7822,-7820,7823,7824]],"id":"40063","properties":{"name":"Hughes"}},{"type":"Polygon","arcs":[[-4174,7825,-7753,-6763,-5830,-6623]],"id":"48287","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[7826,-7817,-4555,-3627,7827,-5998,-7713]],"id":"51031","properties":{"name":"Campbell"}},{"type":"Polygon","arcs":[[-7635,-6506,7828,-7824,-7819,-7597,-3752,-7558]],"id":"40123","properties":{"name":"Pontotoc"}},{"type":"Polygon","arcs":[[-2467,-932,7829,7830,-3953,-4171,-6577,7831,7832,7833,7834,7835,7836]],"id":"32031","properties":{"name":"Washoe"}},{"type":"Polygon","arcs":[[7837,7838,-4704,-6609,-7551]],"id":"36105","properties":{"name":"Sullivan"}},{"type":"Polygon","arcs":[[7839,7840,7841,7842,7843]],"id":"42041","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[-3637,-7286,7844,-3251,7845,-2907]],"id":"54041","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[7846,-3706,-811,-3701,-3894,-5341,7847]],"id":"22053","properties":{"name":"Jefferson Davis"}},{"type":"Polygon","arcs":[[-425,-2944,-557,7848,7849]],"id":"31113","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[7850,7851,-3410,7852,7853,-7784,7854]],"id":"01113","properties":{"name":"Russell"}},{"type":"Polygon","arcs":[[-4244,7855,7856,-5942,-5876,-1222]],"id":"05135","properties":{"name":"Sharp"}},{"type":"Polygon","arcs":[[-4833,-6978,-7409,-1104]],"id":"06107","properties":{"name":"Tulare"}},{"type":"Polygon","arcs":[[-4217,-6523,-3322,7857,-5623,7858]],"id":"21003","properties":{"name":"Allen"}},{"type":"Polygon","arcs":[[7859,7860,7861,7862,7863,7864,-4582]],"id":"22051","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-4699,7865,7866,-7154,7867]],"id":"36079","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[-4700,-7868,-7158,-7148,7868]],"id":"36087","properties":{"name":"Rockland"}},{"type":"Polygon","arcs":[[-7867,7869,7870,-7036,7871,-7155]],"id":"09001","properties":{"name":"Fairfield"}},{"type":"Polygon","arcs":[[7872,-2174,-4054,-2206,7873,-4242]],"id":"29091","properties":{"name":"Howell"}},{"type":"Polygon","arcs":[[-649,-915,-6780,-7743,-7752,7874]],"id":"48395","properties":{"name":"Robertson"}},{"type":"Polygon","arcs":[[7875,7876,7877,-1219,-1216,-5290,-7031,7878]],"id":"06067","properties":{"name":"Sacramento"}},{"type":"Polygon","arcs":[[-6510,7879,7880,7881,7882,7883]],"id":"40061","properties":{"name":"Haskell"}},{"type":"Polygon","arcs":[[-7883,7884,-2581,7885]],"id":"40077","properties":{"name":"Latimer"}},{"type":"Polygon","arcs":[[-7406,-967,7886,-6158,7887]],"id":"54029","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[7888,-4948,7889,-5273,7890,7891]],"id":"05073","properties":{"name":"Lafayette"}},{"type":"Polygon","arcs":[[7892,7893,-7126,7894,7895,-4296,7896]],"id":"34001","properties":{"name":"Atlantic"}},{"type":"Polygon","arcs":[[-5316,-3834,-4278,-3211,7897,7898]],"id":"16083","properties":{"name":"Twin Falls"}},{"type":"Polygon","arcs":[[-1651,-4806,-665,7899,-6744]],"id":"48333","properties":{"name":"Mills"}},{"type":"Polygon","arcs":[[-4619,-6889,-4115,-7670,-5753]],"id":"21053","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[7900,-1823,-2007,7901,-7408,-4140,7902,-3296]],"id":"39151","properties":{"name":"Stark"}},{"type":"Polygon","arcs":[[-3448,-3988,7903,7904,-3213,7905]],"id":"01117","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[7906,-6515,-3370,-3350,-5900,7907]],"id":"41053","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[7908,7909,-3282,7910,-6310,-2073]],"id":"20167","properties":{"name":"Russell"}},{"type":"Polygon","arcs":[[-6391,7911,7912,-1199,-3158,-7249]],"id":"20045","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[-7145,7913,-2920,-1483,-7484]],"id":"20157","properties":{"name":"Republic"}},{"type":"Polygon","arcs":[[7914,7915,-7879,-7030,7916,-7631]],"id":"06095","properties":{"name":"Solano"}},{"type":"Polygon","arcs":[[7917,-4245,-1225,7918,-3660,7919]],"id":"05005","properties":{"name":"Baxter"}},{"type":"Polygon","arcs":[[7920,7921,7922,7923]],"id":"51710","properties":{"name":"Norfolk"}},{"type":"Polygon","arcs":[[7924,7925,-968,-473,-1658,-3004,-3619,7926,-4814]],"id":"35025","properties":{"name":"Lea"}},{"type":"MultiPolygon","arcs":[[[-7697,-3529]],[[-7270,-3695,-3522,-7696,7927]]],"id":"22065","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-4815,-7927,-3622,-7256,7928]],"id":"48301","properties":{"name":"Loving"}},{"type":"MultiPolygon","arcs":[[[7929]],[[7930,-6874,7931,-6111],[7932],[-6870]]],"id":"08014","properties":{"name":"Broomfield"}},{"type":"Polygon","arcs":[[-2583,7933,-6918,7934,-3182,-5547,7935,-4321]],"id":"40089","properties":{"name":"McCurtain"}},{"type":"Polygon","arcs":[[7936,-6160,7937,-4724,-6656]],"id":"54069","properties":{"name":"Ohio"}},{"type":"Polygon","arcs":[[-5953,-6460,-7428,7938,7939]],"id":"37075","properties":{"name":"Graham"}},{"type":"Polygon","arcs":[[7940,-7939,-7432,-7495,7941,-2025,-5423]],"id":"37039","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[-4759,-3465,7942,-7534]],"id":"31043","properties":{"name":"Dakota"}},{"type":"Polygon","arcs":[[7943,7944,7945,-5567,-6266,-7392,7946,-5962,7947,-3495]],"id":"25027","properties":{"name":"Worcester"}},{"type":"Polygon","arcs":[[7948,7949,7950,-1839,7951,-2707]],"id":"39017","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[7952,-7891,-5276,-1211,-4222,7953]],"id":"22015","properties":{"name":"Bossier"}},{"type":"Polygon","arcs":[[-3837,-1089,-1756,-4042,7954]],"id":"17103","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[-4164,-5372,7955,7956,-7400,7957]],"id":"41051","properties":{"name":"Multnomah"}},{"type":"Polygon","arcs":[[7958,-5279,7959,-6074,7960]],"id":"37019","properties":{"name":"Brunswick"}},{"type":"Polygon","arcs":[[7961,-5861,-5815,7962,-6724,-6636,-3335]],"id":"47141","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[7963,7964,7965,7966,-3844,7967]],"id":"37083","properties":{"name":"Halifax"}},{"type":"Polygon","arcs":[[-2947,-7176,-2537,7968,-3473,-1772]],"id":"16023","properties":{"name":"Butte"}},{"type":"Polygon","arcs":[[7969,-4194,-6107,-4192,-6113],[-4191]],"id":"08031","properties":{"name":"Denver"}},{"type":"Polygon","arcs":[[-7225,-7305,7970,-7268,7971,-5394]],"id":"22067","properties":{"name":"Morehouse"}},{"type":"Polygon","arcs":[[7972,-4366,-2166]],"id":"51735","properties":{"name":"Poquoson"}},{"type":"Polygon","arcs":[[7973,-7924,7974,7975]],"id":"51740","properties":{"name":"Portsmouth"}},{"type":"MultiPolygon","arcs":[[[-7933]],[[7976,-6875,-7931,-6110,7977,-6224],[-7930]]],"id":"08013","properties":{"name":"Boulder"}},{"type":"Polygon","arcs":[[7978,7979,-7004,7980,-7862]],"id":"22071","properties":{"name":"Orleans"}},{"type":"Polygon","arcs":[[-4844,-3776,-7496,-7429,-6458]],"id":"37099","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[7981,7982,7983,-2560,7984,-6965]],"id":"01025","properties":{"name":"Clarke"}},{"type":"Polygon","arcs":[[-6971,-4389,7985,-6096,-6362,7986,-7982,-6964]],"id":"01091","properties":{"name":"Marengo"}},{"type":"Polygon","arcs":[[7987,7988,-6097,-7986,-4388]],"id":"01065","properties":{"name":"Hale"}},{"type":"Polygon","arcs":[[7989,7990,-2837,7991,7992]],"id":"01075","properties":{"name":"Lamar"}},{"type":"Polygon","arcs":[[7993,-7992,-2836,7994,-4386,-6970,7995]],"id":"01107","properties":{"name":"Pickens"}},{"type":"Polygon","arcs":[[-4649,-5996,7996,-4016,-3233,-3716]],"id":"31127","properties":{"name":"Nemaha"}},{"type":"Polygon","arcs":[[7997,-4139,-4521,-4137,-6750,7998,-2790,7999,-4953,-5943,-4951,8000,-6811]],"id":"51041","properties":{"name":"Chesterfield"}},{"type":"Polygon","arcs":[[-7403,-5515,8001,-5045,-1685]],"id":"48403","properties":{"name":"Sabine"}},{"type":"Polygon","arcs":[[8002,-6057,-540,8003]],"id":"26019","properties":{"name":"Benzie"}},{"type":"Polygon","arcs":[[8004,-5667,-6408,8005,-7140,-3898]],"id":"29037","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[-7905,8006,-3459,8007,-5035,-3214]],"id":"01037","properties":{"name":"Coosa"}},{"type":"Polygon","arcs":[[-5230,8008,-6876,-7977,-6223,-436]],"id":"08069","properties":{"name":"Larimer"}},{"type":"Polygon","arcs":[[-7298,-5626,8009,8010,-7471,8011]],"id":"47037","properties":{"name":"Davidson"}},{"type":"Polygon","arcs":[[8012,-7347,-6673,8013,-5839,8014]],"id":"42027","properties":{"name":"Centre"}},{"type":"Polygon","arcs":[[8015,8016,8017,8018,-5832,-6768]],"id":"48015","properties":{"name":"Austin"}},{"type":"Polygon","arcs":[[8019,-4885,8020,8021]],"id":"50013","properties":{"name":"Grand Isle"}},{"type":"Polygon","arcs":[[-5777,8022,-7976,8023,8024,-7796,8025]],"id":"51800","properties":{"name":"Suffolk"}},{"type":"Polygon","arcs":[[8026,8027,-2211,-3116]],"id":"08025","properties":{"name":"Crowley"}},{"type":"Polygon","arcs":[[8028,-3119,8029,-6233]],"id":"08027","properties":{"name":"Custer"}},{"type":"Polygon","arcs":[[-5390,-5395,-7972,-7272,-6401,-7793]],"id":"22073","properties":{"name":"Ouachita"}},{"type":"Polygon","arcs":[[-6104,-2210,-223,-388,-7763,-2588]],"id":"48383","properties":{"name":"Reagan"}},{"type":"Polygon","arcs":[[-2240,-7559,-2272,-4526,-3551,-493]],"id":"40137","properties":{"name":"Stephens"}},{"type":"Polygon","arcs":[[-3433,8030,-6413,-2203,-2193]],"id":"29179","properties":{"name":"Reynolds"}},{"type":"Polygon","arcs":[[-4816,-7929,-7259,8031,-3075,8032]],"id":"48389","properties":{"name":"Reeves"}},{"type":"Polygon","arcs":[[-7416,-1808,8033,-3115,8034,-2221]],"id":"08041","properties":{"name":"El Paso"}},{"type":"Polygon","arcs":[[8035,8036,8037,-7241,8038,-7281,8039]],"id":"39167","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-7368,-1679,8040,-4518,-7372,8041]],"id":"51045","properties":{"name":"Craig"}},{"type":"Polygon","arcs":[[-2850,8042,8043,-3445,8044,-2834,8045]],"id":"01127","properties":{"name":"Walker"}},{"type":"Polygon","arcs":[[-7717,8046,8047,-5985,-6044,-6817,8048],[-6534]],"id":"51069","properties":{"name":"Frederick"}},{"type":"Polygon","arcs":[[-1416,-4444,8049,8050,8051]],"id":"30095","properties":{"name":"Stillwater"}},{"type":"Polygon","arcs":[[-2050,8052,-7506,8053,8054,-11]],"id":"22117","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-5625,-1172,-3337,-6639,8055,8056,-8010]],"id":"47189","properties":{"name":"Wilson"}},{"type":"Polygon","arcs":[[8057,-4003,-5784,8058,-3105,-7476,-7480]],"id":"16035","properties":{"name":"Clearwater"}},{"type":"MultiPolygon","arcs":[[[8059]],[[8060,8061]],[[8062,8063,-4583,-7865,8064,8065,-7545]]],"id":"22057","properties":{"name":"Lafourche"}},{"type":"Polygon","arcs":[[8066,-7177,8067]],"id":"26047","properties":{"name":"Emmet"}},{"type":"Polygon","arcs":[[-6803,8068,8069,-7964,-1028,-3651]],"id":"37185","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[-1557,-7074,8070,-3542,-7183]],"id":"26115","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-2183,8071,-2226]],"id":"30047","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-2227,-8072,-2182,8072,8073,-1926,-3106,-8059,-5783]],"id":"30063","properties":{"name":"Missoula"}},{"type":"Polygon","arcs":[[-7978,-6109,8074,-6225]],"id":"08047","properties":{"name":"Gilpin"}},{"type":"Polygon","arcs":[[-6234,-8030,-3118,-6942,-6867,-3141]],"id":"08055","properties":{"name":"Huerfano"}},{"type":"Polygon","arcs":[[8075,8076,-6831,8077,-2326,-6798,-5609,-5363]],"id":"54059","properties":{"name":"Mingo"}},{"type":"Polygon","arcs":[[-141,8078,-8047,-7716,-294]],"id":"54065","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[-6966,-7985,-2559,8079,8080,-7679]],"id":"01129","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-2035,8081,8082,8083,-3247,-1317,-1311,-6840]],"id":"17173","properties":{"name":"Shelby"}},{"type":"Polygon","arcs":[[8084,-5595,-4211,-7129,-3339,8085]],"id":"18165","properties":{"name":"Vermillion"}},{"type":"Polygon","arcs":[[-4775,8086,8087,-7127,-7894,8088,8089]],"id":"34005","properties":{"name":"Burlington"}},{"type":"Polygon","arcs":[[-3151,8090,-5369,-5173,-440,-6328]],"id":"27045","properties":{"name":"Fillmore"}},{"type":"Polygon","arcs":[[-227,8091,8092,-4544,8093,8094]],"id":"48439","properties":{"name":"Tarrant"}},{"type":"Polygon","arcs":[[-4653,8095,8096,-5653,8097,8098,-4660]],"id":"17031","properties":{"name":"Cook"}},{"type":"Polygon","arcs":[[-7975,-7923,8099,-4511,8100,-8024]],"id":"51550","properties":{"name":"Chesapeake"}},{"type":"Polygon","arcs":[[-2883,8101,-6325,-5198,-1077,-1258]],"id":"26155","properties":{"name":"Shiawassee"}},{"type":"Polygon","arcs":[[8102,8103,-444,-80,8104,-2881,-3499]],"id":"26157","properties":{"name":"Tuscola"}},{"type":"Polygon","arcs":[[-676,8105,-6697,-6014]],"id":"38011","properties":{"name":"Bowman"}},{"type":"Polygon","arcs":[[8106,-1711,-671,-6013,-3566]],"id":"38033","properties":{"name":"Golden Valley"}},{"type":"Polygon","arcs":[[-4154,-2131,8107,8108,-6727,-6090,8109]],"id":"55035","properties":{"name":"Eau Claire"}},{"type":"Polygon","arcs":[[8110,8111,8112,-3857,-1217,8113]],"id":"32005","properties":{"name":"Douglas"}},{"type":"Polygon","arcs":[[8114,-448,8115,-4045]],"id":"18009","properties":{"name":"Blackford"}},{"type":"Polygon","arcs":[[-3427,-2082,8116,-449,-8115,-4044]],"id":"18179","properties":{"name":"Wells"}},{"type":"Polygon","arcs":[[8117,-1884,-5403,8118,8119]],"id":"05013","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[-2384,8120,-5658,8121,8122,-150,8123]],"id":"17091","properties":{"name":"Kankakee"}},{"type":"Polygon","arcs":[[-6954,-7039,-6262,-3879]],"id":"18163","properties":{"name":"Vanderburgh"}},{"type":"Polygon","arcs":[[8124,-3107,-2712,-2900,8125,-2844]],"id":"16003","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[-5963,-7947,-7394,-7396,8126]],"id":"09013","properties":{"name":"Tolland"}},{"type":"Polygon","arcs":[[-4270,-7044,8127,-4119,8128,8129,-3887,-7526]],"id":"21111","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-8054,-7505,-6332,-7707,-417,8130,8131]],"id":"28109","properties":{"name":"Pearl River"}},{"type":"Polygon","arcs":[[8132,8133,-8063,-7544]],"id":"22093","properties":{"name":"St. James"}},{"type":"Polygon","arcs":[[-323,-4180,-7380,8134,-5450,8135]],"id":"49013","properties":{"name":"Duchesne"}},{"type":"Polygon","arcs":[[-6525,-5970,8136,-3596,-2965]],"id":"48209","properties":{"name":"Hays"}},{"type":"Polygon","arcs":[[8137,-5453,-5463,8138,8139]],"id":"49023","properties":{"name":"Juab"}},{"type":"Polygon","arcs":[[8140,8141,8142,-6465,8143,-7965,-8070]],"id":"37131","properties":{"name":"Northampton"}},{"type":"Polygon","arcs":[[-2626,-4731,8144,-1757,8145,-833]],"id":"01041","properties":{"name":"Crenshaw"}},{"type":"Polygon","arcs":[[-4385,8146,8147,8148]],"id":"16007","properties":{"name":"Bear Lake"}},{"type":"Polygon","arcs":[[-2742,8149,8150,-1636,-1835,-7951,8151]],"id":"39113","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[8152,8153,8154,8155,8156,-1759]],"id":"01045","properties":{"name":"Dale"}},{"type":"MultiPolygon","arcs":[[[8157,8158]],[[8159,8160]]],"id":"06075","properties":{"name":"San Francisco"}},{"type":"Polygon","arcs":[[-6846,8161,8162,8163,-2046]],"id":"08091","properties":{"name":"Ouray"}},{"type":"Polygon","arcs":[[-6994,8164,-5078,-5294,8165,8166]],"id":"17153","properties":{"name":"Pulaski"}},{"type":"Polygon","arcs":[[8167,8168,8169,-5939,-7857,8170]],"id":"05121","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[-3379,-5879,-5888,-4599,-6219,-3192,8171]],"id":"05145","properties":{"name":"White"}},{"type":"Polygon","arcs":[[8172,-636,8173,-3299,-906,-6535,-4081]],"id":"39005","properties":{"name":"Ashland"}},{"type":"Polygon","arcs":[[-3744,-2117,8174,-7880,-6509,-4085]],"id":"40101","properties":{"name":"Muskogee"}},{"type":"MultiPolygon","arcs":[[[8175]],[[8176]],[[-4159,-7546,-8066,8177,-8061,8178]]],"id":"22109","properties":{"name":"Terrebonne"}},{"type":"Polygon","arcs":[[8179,-7908,-5902,-5903,8180]],"id":"41041","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-445,-8104,8181]],"id":"26063","properties":{"name":"Huron"}},{"type":"Polygon","arcs":[[8182,-1094,-7604,-6040,8183]],"id":"29227","properties":{"name":"Worth"}},{"type":"Polygon","arcs":[[8184,8185,-6249,-6540,8186,-4878]],"id":"29175","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[8187]],"id":"15003","properties":{"name":"Honolulu"}},{"type":"Polygon","arcs":[[8188,-8139,-5462,8189,-6143,-4289]],"id":"49027","properties":{"name":"Millard"}},{"type":"Polygon","arcs":[[-8190,-5461,-5865,-5844,-5358,-6144]],"id":"49041","properties":{"name":"Sevier"}},{"type":"Polygon","arcs":[[8190,-6770,-5356,8191,-5454,-8138,8192]],"id":"49045","properties":{"name":"Tooele"}},{"type":"MultiPolygon","arcs":[[[8193,8194,8195,8196]],[[8197]],[[8198]],[[8199]],[[8200,8201,8202]],[[8203]],[[8204]],[[8205]],[[8206]]],"id":"12087","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[8207,8208,-5898,8209,-5798,8210,8211,-4561]],"id":"13033","properties":{"name":"Burke"}},{"type":"Polygon","arcs":[[-3855,8212,8213,-7851,8214,8215]],"id":"01081","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[8216,-5870,-3611,8217,8218,8219,8220]],"id":"48409","properties":{"name":"San Patricio"}},{"type":"Polygon","arcs":[[-6833,-7787,-3809,-2609]],"id":"06043","properties":{"name":"Mariposa"}},{"type":"Polygon","arcs":[[-7356,8221,-8184,-6039,8222,8223,-5994]],"id":"29147","properties":{"name":"Nodaway"}},{"type":"Polygon","arcs":[[-1313,-1320,-3099,-1134,-3071,-2681]],"id":"17025","properties":{"name":"Clay"}},{"type":"MultiPolygon","arcs":[[[8224]],[[8225]],[[-50,8226,-3034,8227]]],"id":"02130","properties":{"name":"Ketchikan Gateway"}},{"type":"Polygon","arcs":[[8228,-1384,8229,-1985]],"id":"02282","properties":{"name":"Yakutat"}},{"type":"Polygon","arcs":[[-2081,-1833,8230,-450,-8117]],"id":"18001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[8231,-1155,-5093,8232,8233]],"id":"08017","properties":{"name":"Cheyenne"}},{"type":"Polygon","arcs":[[-6272,8234,-4847,8235,-5738]],"id":"47173","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-152,8236,-2863,8237,-8086,-3338,8238]],"id":"17183","properties":{"name":"Vermilion"}},{"type":"Polygon","arcs":[[8239,8240]],"id":"53009","properties":{"name":"Clallam"}},{"type":"Polygon","arcs":[[8241,8242,8243,-7708,-6824,8244]],"id":"53027","properties":{"name":"Grays Harbor"}},{"type":"Polygon","arcs":[[8245,8246,-2359,8247,-7611]],"id":"12109","properties":{"name":"St. Johns"}},{"type":"Polygon","arcs":[[-8240,8248,8249,-8242,8250]],"id":"53031","properties":{"name":"Jefferson"}},{"type":"MultiPolygon","arcs":[[[-7633,8251]]],"id":"06041","properties":{"name":"Marin"}},{"type":"Polygon","arcs":[[-6812,-8001,-4955,8252,-6787,8253,8254,8255]],"id":"51053","properties":{"name":"Dinwiddie"}},{"type":"Polygon","arcs":[[-4568,-1197,8256,-5057]],"id":"17129","properties":{"name":"Menard"}},{"type":"Polygon","arcs":[[-4178,-5781,8257,-6989,-7455,-7381]],"id":"08081","properties":{"name":"Moffat"}},{"type":"Polygon","arcs":[[-7006,8258,-8148,-5138,-3875]],"id":"16041","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-6292,-7721,8259,-7877,8260,-3814]],"id":"06101","properties":{"name":"Sutter"}},{"type":"Polygon","arcs":[[-7407,-7888,-6161,-7937,-6655,-797,-4142]],"id":"39081","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-7212,-159,8261,-6688,8262]],"id":"35009","properties":{"name":"Curry"}},{"type":"Polygon","arcs":[[-2736,8263,-5121,8264,8265]],"id":"36021","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[-7228,8266,-2317,-3055,-7332,-6335]],"id":"28083","properties":{"name":"Leflore"}},{"type":"Polygon","arcs":[[-7942,-7494,8267,-3822,8268,-2026]],"id":"13291","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[8269,-6663,8270,8271,-5212,8272]],"id":"39001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[-4297,-7896,8273]],"id":"34009","properties":{"name":"Cape May"}},{"type":"Polygon","arcs":[[-4293,-8,-1933,-4831,8274]],"id":"32003","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[-7391,8275,8276,8277,-7912,-6390]],"id":"20103","properties":{"name":"Leavenworth"}},{"type":"Polygon","arcs":[[-3229,-5133,-7998,-6810]],"id":"51145","properties":{"name":"Powhatan"}},{"type":"Polygon","arcs":[[-3981,8278,8279,8280,8281,-1054,-3631]],"id":"53043","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[8282,8283,-597,8284,8285,-8243,-8250]],"id":"53045","properties":{"name":"Mason"}},{"type":"MultiPolygon","arcs":[[[8286]],[[8287]],[[8288]],[[8289]]],"id":"53055","properties":{"name":"San Juan"}},{"type":"Polygon","arcs":[[8290,-3091,8291,8292,8293]],"id":"17133","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-1723,8294,8295,8296,-6843,8297]],"id":"08097","properties":{"name":"Pitkin"}},{"type":"Polygon","arcs":[[8298,-7830,-931,8299,-530]],"id":"06035","properties":{"name":"Lassen"}},{"type":"Polygon","arcs":[[-3400,-2772,-2091,-2057,-253]],"id":"19101","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[8300,-5094,-2762,-6940,-3198,8301]],"id":"08099","properties":{"name":"Prowers"}},{"type":"Polygon","arcs":[[-689,-4004,-8058,-7479,8302]],"id":"16057","properties":{"name":"Latah"}},{"type":"Polygon","arcs":[[-2368,8303,8304,-6236,8305]],"id":"12097","properties":{"name":"Osceola"}},{"type":"Polygon","arcs":[[8306,8307,8308,-812,8309,-310]],"id":"27171","properties":{"name":"Wright"}},{"type":"Polygon","arcs":[[-6364,-2488,8310,8311,-7805,8312,-183]],"id":"13293","properties":{"name":"Upson"}},{"type":"Polygon","arcs":[[8313,8314,-7124,8315,8316]],"id":"31049","properties":{"name":"Deuel"}},{"type":"Polygon","arcs":[[8317,-896,-646,-155,-7211]],"id":"48359","properties":{"name":"Oldham"}},{"type":"Polygon","arcs":[[8318,-1749,8319,-1698,-3672,-5586]],"id":"13297","properties":{"name":"Walton"}},{"type":"Polygon","arcs":[[-6376,-6101,8320,8321,8322,-6906]],"id":"13303","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[8323,-7152,8324,8325,8326]],"id":"34013","properties":{"name":"Essex"}},{"type":"Polygon","arcs":[[8327,8328,8329,-4606,8330,8331,-5032]],"id":"13305","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[8332,-6946,-4936,-3092,-8291,8333,-3711]],"id":"29189","properties":{"name":"St. Louis"}},{"type":"Polygon","arcs":[[-7252,-14,8334,8335,-4637]],"id":"22063","properties":{"name":"Livingston"}},{"type":"Polygon","arcs":[[-3216,-5038,-4732,-2624,-6360]],"id":"01001","properties":{"name":"Autauga"}},{"type":"Polygon","arcs":[[-7785,-7854,8336,8337,8338,8339,-8154,8340]],"id":"01005","properties":{"name":"Barbour"}},{"type":"MultiPolygon","arcs":[[[8341]],[[-8080,-2558,8342,8343,8344,8345]]],"id":"01097","properties":{"name":"Mobile"}},{"type":"Polygon","arcs":[[8346,-1667,8347,-8280,8348]],"id":"53065","properties":{"name":"Stevens"}},{"type":"MultiPolygon","arcs":[[[8349]],[[-3984,-6008,8350]],[[8351]]],"id":"53073","properties":{"name":"Whatcom"}},{"type":"Polygon","arcs":[[-1670,8352,-3267,-3049,8353,8354,8355]],"id":"13019","properties":{"name":"Berrien"}},{"type":"Polygon","arcs":[[8356,-4383,-5782,-320]],"id":"56041","properties":{"name":"Uinta"}},{"type":"Polygon","arcs":[[8357,-8254,-6790,8358,-8142],[-1163]],"id":"51081","properties":{"name":"Greensville"}},{"type":"Polygon","arcs":[[-8032,-7258,-4811,-7766,8359,-5633,-3076]],"id":"48371","properties":{"name":"Pecos"}},{"type":"Polygon","arcs":[[-3549,-6957,8360,8361,-2792,-5169,-7354]],"id":"17161","properties":{"name":"Rock Island"}},{"type":"Polygon","arcs":[[-1159,-2743,-8152,-7950,8362]],"id":"39135","properties":{"name":"Preble"}},{"type":"Polygon","arcs":[[8363,-1034,8364,-758,8365,-1829]],"id":"39137","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[8366,-8163,8367,8368,-5040]],"id":"08111","properties":{"name":"San Juan"}},{"type":"Polygon","arcs":[[-2779,8369,-1841,8370]],"id":"48385","properties":{"name":"Real"}},{"type":"Polygon","arcs":[[-2181,-1917,-5377,-5851,8371,-8073]],"id":"30077","properties":{"name":"Powell"}},{"type":"Polygon","arcs":[[8372,8373,8374,8375,-4374,8376]],"id":"13309","properties":{"name":"Wheeler"}},{"type":"Polygon","arcs":[[-2936,-5588,8377,-6928,-1935]],"id":"06065","properties":{"name":"Riverside"}},{"type":"Polygon","arcs":[[-7094,-1591,-469,8378,8379]],"id":"40115","properties":{"name":"Ottawa"}},{"type":"Polygon","arcs":[[-3511,8380,8381,-998]],"id":"26001","properties":{"name":"Alcona"}},{"type":"Polygon","arcs":[[8382,-5639,-782,8383,8384,-1438]],"id":"56043","properties":{"name":"Washakie"}},{"type":"Polygon","arcs":[[8385,-4804,-7672,-4793,-4545,-8093]],"id":"48113","properties":{"name":"Dallas"}},{"type":"Polygon","arcs":[[-852,-2084,-3426,-2039,-5748]],"id":"18183","properties":{"name":"Whitley"}},{"type":"Polygon","arcs":[[-5196,-5178,-7194,8386,-7117,-4354]],"id":"47047","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[-4659,-7485,-6178,8387,-7909,-2072,-3246]],"id":"20141","properties":{"name":"Osborne"}},{"type":"Polygon","arcs":[[8388,-5972,-5064,-4708,-3492,-5116,8389]],"id":"50003","properties":{"name":"Bennington"}},{"type":"Polygon","arcs":[[-3982,-3629,-2363,-2356]],"id":"53017","properties":{"name":"Douglas"}},{"type":"MultiPolygon","arcs":[[[-3605,8390,8391,8392]],[[-8219,8393,8394,8395]]],"id":"48355","properties":{"name":"Nueces"}},{"type":"Polygon","arcs":[[8396,8397,8398,-2438,-4883]],"id":"50019","properties":{"name":"Orleans"}},{"type":"Polygon","arcs":[[-5184,-6218,8399,-7220,-3640,-525,-5187]],"id":"54023","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[8400,-5721,8401,8402,-1939]],"id":"13073","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[-2720,8403,-5492,-4401,8404,-4134,-5132]],"id":"51085","properties":{"name":"Hanover"}},{"type":"Polygon","arcs":[[-4322,-7936,-5551,-7638,8405,-2243,-7761,8406]],"id":"48387","properties":{"name":"Red River"}},{"type":"Polygon","arcs":[[8407,-2003,-3405,8408,8409,8410,-6661]],"id":"39141","properties":{"name":"Ross"}},{"type":"Polygon","arcs":[[-60,8411,-8373,8412,8413,-2371]],"id":"13091","properties":{"name":"Dodge"}},{"type":"Polygon","arcs":[[-6085,8414,8415,-1750,-8319,-5585,-3817]],"id":"13135","properties":{"name":"Gwinnett"}},{"type":"Polygon","arcs":[[-6239,-2028,8416,8417,8418,-6026,-6371]],"id":"13085","properties":{"name":"Dawson"}},{"type":"Polygon","arcs":[[8419,-3454,8420,-7481,-3108,-8125,-2843,8421,8422]],"id":"41063","properties":{"name":"Wallowa"}},{"type":"Polygon","arcs":[[-8322,8423,-4567,8424,8425]],"id":"13167","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-6100,8426,-1941,8427,-8208,-4560,-8424,-8321]],"id":"13163","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[8428,8429,8430,-1631,-8151]],"id":"39023","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[8431,8432,8433,8434,8435,-3573,-4233,8436]],"id":"29069","properties":{"name":"Dunklin"}},{"type":"Polygon","arcs":[[8437,-8022,8438,-7434,-7693]],"id":"36019","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[-7367,-7441,8439,8440,-4553,8441,-1681],[-2987],[-1226]],"id":"51163","properties":{"name":"Rockbridge"}},{"type":"Polygon","arcs":[[-5648,8442,-7840,8443]],"id":"42099","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[8444,8445,-8433,8446,-8169]],"id":"05021","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-139,-3583,-5982,8447]],"id":"54037","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[8448,8449,8450,-2178]],"id":"30035","properties":{"name":"Glacier"}},{"type":"Polygon","arcs":[[-8021,-4884,-2441,8451,8452,-7435,-8439]],"id":"50007","properties":{"name":"Chittenden"}},{"type":"Polygon","arcs":[[8453,-2819,-4571,-4758,-5890]],"id":"19167","properties":{"name":"Sioux"}},{"type":"Polygon","arcs":[[-679,-374,-2233,-1654,-6642,-4807]],"id":"48083","properties":{"name":"Coleman"}},{"type":"Polygon","arcs":[[-2459,8454,-1053,-7404,-6759,8455,-7690]],"id":"48401","properties":{"name":"Rusk"}},{"type":"Polygon","arcs":[[8456,8457,8458,8459,-5206,-8272]],"id":"39145","properties":{"name":"Scioto"}},{"type":"MultiPolygon","arcs":[[[8460,-1379]],[[8461,-1373,8462,-1377,8463,-1946]]],"id":"02110","properties":{"name":"Juneau"}},{"type":"Polygon","arcs":[[8464,8465,-7233,-7025,-3665]],"id":"05077","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[-4601,-571,8466,-8465,-3664]],"id":"05123","properties":{"name":"St. Francis"}},{"type":"Polygon","arcs":[[-5375,8467,-7773,-1449]],"id":"55079","properties":{"name":"Milwaukee"}},{"type":"Polygon","arcs":[[-8108,-2130,-2451,8468,8469,-7800,8470]],"id":"55053","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-4361,-6424,-7219,8471,-8087,-4774]],"id":"34021","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[8472,-6809,-6496,-7162,-4533]],"id":"37009","properties":{"name":"Ashe"}},{"type":"Polygon","arcs":[[8473,-2023,-6481,8474,-957]],"id":"27167","properties":{"name":"Wilkin"}},{"type":"Polygon","arcs":[[-2111,-3277,-303,8475,8476,8477]],"id":"38051","properties":{"name":"McIntosh"}},{"type":"Polygon","arcs":[[-8452,-2440,8478,8479,8480]],"id":"50023","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-7535,-7943,-3464,8481,8482,-1010,-1602]],"id":"31173","properties":{"name":"Thurston"}},{"type":"Polygon","arcs":[[-6576,8483,8484,-7832]],"id":"32027","properties":{"name":"Pershing"}},{"type":"Polygon","arcs":[[8485,-8480,8486,8487,-5061]],"id":"50017","properties":{"name":"Orange"}},{"type":"MultiPolygon","arcs":[[[8488]],[[8489]],[[-6836,8490]]],"id":"55029","properties":{"name":"Door"}},{"type":"Polygon","arcs":[[-531,-8300,-930,-7719,-6290,-2100]],"id":"06063","properties":{"name":"Plumas"}},{"type":"Polygon","arcs":[[-6666,-3069,-4083,-87,8491,-754]],"id":"39147","properties":{"name":"Seneca"}},{"type":"Polygon","arcs":[[-5300,-4696,8492,-6934,8493,8494]],"id":"13103","properties":{"name":"Effingham"}},{"type":"Polygon","arcs":[[8495,-5584,8496,8497,8498,-5318,-2471]],"id":"31161","properties":{"name":"Sheridan"}},{"type":"Polygon","arcs":[[-559,-233,-99,-100,-1364,8499]],"id":"46087","properties":{"name":"McCook"}},{"type":"Polygon","arcs":[[8500,-173,8501,8502,8503,-2617,-4150]],"id":"55083","properties":{"name":"Oconto"}},{"type":"Polygon","arcs":[[-2299,-6098,-2671,8504]],"id":"02068","properties":{"name":"Denali"}},{"type":"Polygon","arcs":[[-7151,-4304,8505,8506,8507,-8325]],"id":"34017","properties":{"name":"Hudson"}},{"type":"Polygon","arcs":[[-1440,8508,-8384,-786,8509,-5779,-5136,-6105]],"id":"56013","properties":{"name":"Fremont"}},{"type":"Polygon","arcs":[[8510,-2637,-3578,-5226,-6247,-8186]],"id":"29137","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[8511,-2498,8512,-3401,-2001]],"id":"39045","properties":{"name":"Fairfield"}},{"type":"Polygon","arcs":[[-7890,-4947,8513,8514,-7627,-5274]],"id":"05027","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[8515,8516,-4261,-3936,-7683]],"id":"55065","properties":{"name":"Lafayette"}},{"type":"Polygon","arcs":[[-4308,8517,8518]],"id":"36047","properties":{"name":"Kings"}},{"type":"Polygon","arcs":[[-1922,-1481,-7463,-4898,-5881,-2155]],"id":"29141","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[-6032,8519,-826,-7164,-5127,-7098]],"id":"27151","properties":{"name":"Swift"}},{"type":"Polygon","arcs":[[8520,-5915,-5507,-5820,8521,-5822,8522,-3569,-8436]],"id":"29143","properties":{"name":"New Madrid"}},{"type":"Polygon","arcs":[[-7540,-3017,-935,-4259,-8517,8523]],"id":"55045","properties":{"name":"Green"}},{"type":"Polygon","arcs":[[-8484,-6575,8524,-5388,8525,8526]],"id":"32015","properties":{"name":"Lander"}},{"type":"Polygon","arcs":[[8527,-7835]],"id":"32029","properties":{"name":"Storey"}},{"type":"Polygon","arcs":[[-7175,-6550,-2801,-4451,-4713]],"id":"35001","properties":{"name":"Bernalillo"}},{"type":"Polygon","arcs":[[-3048,-7113,-6850,8528,-8354]],"id":"13173","properties":{"name":"Lanier"}},{"type":"Polygon","arcs":[[-5553,-40,-4748,-4351,-7138,-1420,8529]],"id":"56045","properties":{"name":"Weston"}},{"type":"Polygon","arcs":[[8530,-6426,-2786,8531,8532,8533]],"id":"36009","properties":{"name":"Cattaraugus"}},{"type":"Polygon","arcs":[[-2556,-1061,-1812,-1819,8534]],"id":"19049","properties":{"name":"Dallas"}},{"type":"Polygon","arcs":[[-7765,8535,8536,-5634,-8360]],"id":"48443","properties":{"name":"Terrell"}},{"type":"Polygon","arcs":[[8537,-7497,-6298,-1846,8538]],"id":"13119","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-5713,-539,8539,-6992,8540]],"id":"17199","properties":{"name":"Williamson"}},{"type":"Polygon","arcs":[[-1866,8541,-7465,-5676,8542,-2005]],"id":"39155","properties":{"name":"Trumbull"}},{"type":"Polygon","arcs":[[-1115,-1753,8543,8544,-1802,8545]],"id":"17203","properties":{"name":"Woodford"}},{"type":"Polygon","arcs":[[-8369,8546,-578,-5873,-3866]],"id":"08067","properties":{"name":"La Plata"}},{"type":"Polygon","arcs":[[-3297,-7903,-4143,-795,-1852,8547]],"id":"39157","properties":{"name":"Tuscarawas"}},{"type":"Polygon","arcs":[[-5042,-2141,-2750,-2031,-21,-6205,-4145,-5885]],"id":"27089","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[-1715,-1691,-7618,-7536,-5528,8548]],"id":"27115","properties":{"name":"Pine"}},{"type":"Polygon","arcs":[[-4946,8549,8550,-8120,8551,-8514]],"id":"05103","properties":{"name":"Ouachita"}},{"type":"Polygon","arcs":[[8552,8553,-632,-8173,-4080,8554]],"id":"39093","properties":{"name":"Lorain"}},{"type":"Polygon","arcs":[[8555,-6357,8556,-6134,8557,-4843]],"id":"37021","properties":{"name":"Buncombe"}},{"type":"Polygon","arcs":[[-5941,8558,-8437,-4240,-3802,-5887]],"id":"05031","properties":{"name":"Craighead"}},{"type":"Polygon","arcs":[[-5695,-4067,8559,-7925,-4813,-4663]],"id":"35005","properties":{"name":"Chaves"}},{"type":"Polygon","arcs":[[-2423,-2473,-5321,8560,-5558,-7139]],"id":"31165","properties":{"name":"Sioux"}},{"type":"Polygon","arcs":[[-7778,8561,-1885,-8118,-8551,8562]],"id":"05039","properties":{"name":"Dallas"}},{"type":"Polygon","arcs":[[8563,-4010,8564,-4841,-3731,-6136,8565]],"id":"37023","properties":{"name":"Burke"}},{"type":"Polygon","arcs":[[-6356,-4508,8566,-8566,-6135,-8557]],"id":"37111","properties":{"name":"McDowell"}},{"type":"Polygon","arcs":[[-7349,-5408,-5647,-6675]],"id":"42109","properties":{"name":"Snyder"}},{"type":"Polygon","arcs":[[-8413,-8377,-4373,-3263,-3382,8567]],"id":"13271","properties":{"name":"Telfair"}},{"type":"Polygon","arcs":[[8568,-725,-6948,8569]],"id":"12115","properties":{"name":"Sarasota"}},{"type":"Polygon","arcs":[[-6300,-4346,-5828,-5723,8570,8571,8572,-1848]],"id":"13105","properties":{"name":"Elbert"}},{"type":"Polygon","arcs":[[8573,-8355,-8529,-6854,8574,-7328,8575]],"id":"13185","properties":{"name":"Lowndes"}},{"type":"Polygon","arcs":[[-184,-8313,-7804,8576,-3407,8577,8578]],"id":"13263","properties":{"name":"Talbot"}},{"type":"Polygon","arcs":[[-6621,-4470,8579,-7961,-6073]],"id":"37047","properties":{"name":"Columbus"}},{"type":"Polygon","arcs":[[-537,-5717,-4109,-5805,-5285,-7170]],"id":"17069","properties":{"name":"Hardin"}},{"type":"Polygon","arcs":[[-8418,8580,-3825,8581,8582,8583,-8416,8584]],"id":"13139","properties":{"name":"Hall"}},{"type":"Polygon","arcs":[[8585,-5264,-6399,-4325,-3575,8586]],"id":"17001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[8587,8588,-2067,8589,-62,-2370,-1887,-7625]],"id":"13153","properties":{"name":"Houston"}},{"type":"Polygon","arcs":[[8590,-5047,-4025,8591]],"id":"48457","properties":{"name":"Tyler"}},{"type":"Polygon","arcs":[[-5988,-7060,-7376,-5150,-7107,-1695]],"id":"12041","properties":{"name":"Gilchrist"}},{"type":"Polygon","arcs":[[-814,8592,8593,-1872,-3009,-3081]],"id":"27139","properties":{"name":"Scott"}},{"type":"Polygon","arcs":[[-3053,-2954,8594,-3127,-2798,-7314,-7333]],"id":"28007","properties":{"name":"Attala"}},{"type":"Polygon","arcs":[[-8411,8595,-8457,-8271,-6662]],"id":"39131","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[-6683,-2123,-6755,-3042,-5858]],"id":"46095","properties":{"name":"Mellette"}},{"type":"Polygon","arcs":[[8596,8597,-8534,8598,-4679]],"id":"36013","properties":{"name":"Chautauqua"}},{"type":"Polygon","arcs":[[-7813,-7748,8599,8600,8601,-5488,-8404,-2719]],"id":"51177","properties":{"name":"Spotsylvania"}},{"type":"Polygon","arcs":[[-2205,-6417,8602,-8171,-7856,-4243,-7874]],"id":"29149","properties":{"name":"Oregon"}},{"type":"Polygon","arcs":[[-7218,8603,-7128,-8088,-8472]],"id":"34025","properties":{"name":"Monmouth"}},{"type":"Polygon","arcs":[[-8459,8604,-3795,-6285,8605,-5823,8606]],"id":"39087","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[-4285,8607,-4917,8608,-1605,-3925,-5280]],"id":"26103","properties":{"name":"Marquette"}},{"type":"Polygon","arcs":[[8609,-5033,-8332,8610,-6243]],"id":"13229","properties":{"name":"Pierce"}},{"type":"MultiPolygon","arcs":[[[8611]],[[8612]]],"id":"15007","properties":{"name":"Kauai"}},{"type":"Polygon","arcs":[[-3023,-4888,-4856,8613,-8015,-5838,-3345,-6439]],"id":"42033","properties":{"name":"Clearfield"}},{"type":"Polygon","arcs":[[-2749,-7093,-7202,-2126,-25,-2033]],"id":"27029","properties":{"name":"Clearwater"}},{"type":"Polygon","arcs":[[8614,-3383,-3261,-8353,-1669]],"id":"13155","properties":{"name":"Irwin"}},{"type":"Polygon","arcs":[[8615,-1718,-6186,8616]],"id":"27035","properties":{"name":"Crow Wing"}},{"type":"Polygon","arcs":[[-267,-4903,-4909,8617,-7531,-4440,-3412,-2426]],"id":"30087","properties":{"name":"Rosebud"}},{"type":"Polygon","arcs":[[-635,-1824,-7901,-3295,-8174]],"id":"39169","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[-581,-4605,8618,8619,-6981]],"id":"12051","properties":{"name":"Hendry"}},{"type":"Polygon","arcs":[[-8571,-5722,-8401,-1938,8620]],"id":"13181","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-4275,8621,-8329,8622]],"id":"13183","properties":{"name":"Long"}},{"type":"Polygon","arcs":[[-6961,-2648,8623,-4434,-5867,-1610]],"id":"48469","properties":{"name":"Victoria"}},{"type":"Polygon","arcs":[[-1837,8624,8625,-6881,8626,-7049,8627]],"id":"39025","properties":{"name":"Clermont"}},{"type":"Polygon","arcs":[[-959,8628,-7099,-5469,8629,-712]],"id":"46109","properties":{"name":"Roberts"}},{"type":"Polygon","arcs":[[-4752,-5859,-317,-5580,-8496,-2470,-2421,-4349]],"id":"46102","properties":{"name":"Oglala Lakota"}},{"type":"Polygon","arcs":[[-6604,8630,-3255,-3796,-7447,-7451]],"id":"54067","properties":{"name":"Nicholas"}},{"type":"Polygon","arcs":[[-5398,-7351,-944,8631,8632]],"id":"33017","properties":{"name":"Strafford"}},{"type":"Polygon","arcs":[[-3300,-2162,-3380,-8172,-3196,-3187,-6368]],"id":"05045","properties":{"name":"Faulkner"}},{"type":"Polygon","arcs":[[8633,-8293,8634,-7084,8635]],"id":"29186","properties":{"name":"Ste. Genevieve"}},{"type":"Polygon","arcs":[[-5931,-3470,-3558,-6913,-2395]],"id":"31153","properties":{"name":"Sarpy"}},{"type":"Polygon","arcs":[[-7811,8636,8637,-1460,-5489,-8602,8638,-8600,-7747]],"id":"51179","properties":{"name":"Stafford"}},{"type":"Polygon","arcs":[[8639,-5697,-4078,-6708,-3145,-673,-1710]],"id":"38089","properties":{"name":"Stark"}},{"type":"Polygon","arcs":[[-5601,8640,8641,8642,8643,8644,8645]],"id":"47051","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-459,-2056,-5067,-6259,8646]],"id":"38101","properties":{"name":"Ward"}},{"type":"Polygon","arcs":[[8647,-641,8648,-7658,8649,-8642]],"id":"47115","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[8650,-7377,-5501,-5479,-7336,-1873,-8594]],"id":"27037","properties":{"name":"Dakota"}},{"type":"Polygon","arcs":[[-4046,-8116,-454,8651,-2927,-6383]],"id":"18035","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[-7196,-2767,-1713,8652,-2746]],"id":"27061","properties":{"name":"Itasca"}},{"type":"Polygon","arcs":[[-8382,8653,-3093,-744]],"id":"26069","properties":{"name":"Iosco"}},{"type":"Polygon","arcs":[[-3280,8654,8655,-6318,8656]],"id":"20159","properties":{"name":"Rice"}},{"type":"Polygon","arcs":[[8657,-7188,-5664,8658,-8277]],"id":"20209","properties":{"name":"Wyandotte"}},{"type":"Polygon","arcs":[[8659,-5349,-522,-893,-2614,-3599,8660]],"id":"48479","properties":{"name":"Webb"}},{"type":"Polygon","arcs":[[-8018,8661,-6648,-5918,8662,8663]],"id":"48481","properties":{"name":"Wharton"}},{"type":"Polygon","arcs":[[-2487,-2446,8664,-844,-2065,8665,-8311]],"id":"13207","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-1748,-609,8666,-6153,-1699,-8320]],"id":"13219","properties":{"name":"Oconee"}},{"type":"Polygon","arcs":[[-7619,8667,-8588,-7624,-7803]],"id":"13225","properties":{"name":"Peach"}},{"type":"Polygon","arcs":[[8668,8669,8670,-8338]],"id":"13239","properties":{"name":"Quitman"}},{"type":"Polygon","arcs":[[-3298,-8548,-1851,8671,-2495,-908]],"id":"39031","properties":{"name":"Coshocton"}},{"type":"Polygon","arcs":[[-8670,8672,-6380,8673,-1778,8674]],"id":"13243","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[8675,-7454,8676,-6287,8677]],"id":"54079","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[-6830,-7445,8678,-4717,-2327,-8078]],"id":"54109","properties":{"name":"Wyoming"}},{"type":"Polygon","arcs":[[-6610,-4702,8679,8680,-6141,-7174]],"id":"34037","properties":{"name":"Sussex"}},{"type":"Polygon","arcs":[[8681,-3449,-7906,-3212,-6094,-7989]],"id":"01007","properties":{"name":"Bibb"}},{"type":"Polygon","arcs":[[8682,-6059,-4739,8683,8684,-6188]],"id":"28057","properties":{"name":"Itawamba"}},{"type":"Polygon","arcs":[[-7275,8685,-8587,-3574,-2635,8686]],"id":"29111","properties":{"name":"Lewis"}},{"type":"Polygon","arcs":[[-5063,8687,8688,8689,8690,-4706]],"id":"33019","properties":{"name":"Sullivan"}},{"type":"Polygon","arcs":[[-2078,-3110,-1585,8691,8692,8693,-2053]],"id":"38069","properties":{"name":"Pierce"}},{"type":"Polygon","arcs":[[8694,8695,-3561,8696,-8518,-4307]],"id":"36081","properties":{"name":"Queens"}},{"type":"Polygon","arcs":[[-7715,-1227,-7714,-6002,-3424,-2527,8697,-772]],"id":"37033","properties":{"name":"Caswell"}},{"type":"Polygon","arcs":[[8698,-5194,-5283,-3513]],"id":"26131","properties":{"name":"Ontonagon"}},{"type":"Polygon","arcs":[[-4638,-8336,8699,-8133,-7543,8700]],"id":"22005","properties":{"name":"Ascension"}},{"type":"Polygon","arcs":[[8701,-6238,-579,-723,-1826]],"id":"12055","properties":{"name":"Highlands"}},{"type":"Polygon","arcs":[[-6139,-4505,-1015,-3773,-8558]],"id":"37089","properties":{"name":"Henderson"}},{"type":"Polygon","arcs":[[-1098,-3167,-1241,-1124,-2674,-3468]],"id":"19029","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[-8431,8702,-6437,8703,-1999,8704,-1632]],"id":"39097","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[8705,8706,-3056,-6237,-8305]],"id":"12061","properties":{"name":"Indian River"}},{"type":"Polygon","arcs":[[8707,-7503,-7592,-4821,-4252,8708]],"id":"05131","properties":{"name":"Sebastian"}},{"type":"Polygon","arcs":[[-8123,8709,-2857,-8237,-151]],"id":"17075","properties":{"name":"Iroquois"}},{"type":"Polygon","arcs":[[-7853,-3409,8710,-6381,-8673,-8669,-8337]],"id":"13259","properties":{"name":"Stewart"}},{"type":"Polygon","arcs":[[8711,8712,-1868,-1821,-633,-8554]],"id":"39035","properties":{"name":"Cuyahoga"}},{"type":"Polygon","arcs":[[-3673,-1702,8713,-838,-8665,-2445]],"id":"13159","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[-6027,-8419,-8585,-8415,-6084]],"id":"13117","properties":{"name":"Forsyth"}},{"type":"Polygon","arcs":[[8714,8715,-5317,-7899,8716,-6573,8717]],"id":"16073","properties":{"name":"Owyhee"}},{"type":"Polygon","arcs":[[8718,8719,-3811,-7788,-176,8720,8721]],"id":"06085","properties":{"name":"Santa Clara"}},{"type":"Polygon","arcs":[[8722,-4643,-7461,8723,-3703,8724,-6321]],"id":"22079","properties":{"name":"Rapides"}},{"type":"Polygon","arcs":[[-83,-6189,-8685,8725,-7990,8726,8727]],"id":"28095","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[8728,-4776,-8090,8729,8730,-6207]],"id":"42101","properties":{"name":"Philadelphia"}},{"type":"Polygon","arcs":[[8731,-8632,-943,8732,-7290,8733]],"id":"33015","properties":{"name":"Rockingham"}},{"type":"Polygon","arcs":[[8734,8735,-8390,-5115,-8264,-6082]],"id":"36083","properties":{"name":"Rensselaer"}},{"type":"Polygon","arcs":[[-4840,8736,-4688,-3733]],"id":"37071","properties":{"name":"Gaston"}},{"type":"Polygon","arcs":[[8737,-6411,8738,-5916,-8521,-8435,8739]],"id":"29207","properties":{"name":"Stoddard"}},{"type":"Polygon","arcs":[[-8498,8740,-879,8741,-8314,8742,8743]],"id":"31069","properties":{"name":"Garden"}},{"type":"Polygon","arcs":[[-4730,-7786,-8341,-8153,-1758,-8145]],"id":"01109","properties":{"name":"Pike"}},{"type":"Polygon","arcs":[[-4680,-8599,-8533,8744,-4886,-4991,-1620,-7464]],"id":"42123","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[-1269,-2410,-7096,8745,-4787,8746]],"id":"20099","properties":{"name":"Labette"}},{"type":"Polygon","arcs":[[-1820,-489,-5685,-5102,-1110]],"id":"19039","properties":{"name":"Clarke"}},{"type":"Polygon","arcs":[[8747,-8379,-468,-4040,-7489,-2114,8748]],"id":"40041","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[8749,-7116,-5092,-2981,-1515,8750]],"id":"18141","properties":{"name":"St. Joseph"}},{"type":"Polygon","arcs":[[8751,-6898,-6598]],"id":"37177","properties":{"name":"Tyrrell"}},{"type":"Polygon","arcs":[[-6845,-6235,-4559,-573,-8547,-8368,-8162]],"id":"08053","properties":{"name":"Hinsdale"}},{"type":"MultiPolygon","arcs":[[[-8392,8752,-6273,8753]],[[-8395,8754,-6277,-119,8755]]],"id":"48273","properties":{"name":"Kleberg"}},{"type":"Polygon","arcs":[[-3439,-7245,8756,-6628,8757,-1229,8758,8759]],"id":"51035","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[-2846,8760,-7105,8761,-8718,-6572,-4169,-1995]],"id":"41045","properties":{"name":"Malheur"}},{"type":"Polygon","arcs":[[8762,8763,-4632,8764,8765]],"id":"24009","properties":{"name":"Calvert"}},{"type":"Polygon","arcs":[[-4920,-5365,-5608,-4927,-5351]],"id":"21071","properties":{"name":"Floyd"}},{"type":"Polygon","arcs":[[-6526,-6472,-3978,8766,8767,-6650,8768,8769]],"id":"48201","properties":{"name":"Harris"}},{"type":"Polygon","arcs":[[-7791,-2168,-4368,8770]],"id":"51700","properties":{"name":"Newport News"}},{"type":"Polygon","arcs":[[-8505,-2670,-1982,8771,8772,8773,-4740,-2300]],"id":"02170","properties":{"name":"Matanuska-Susitna"}},{"type":"Polygon","arcs":[[-4392,-4950,-4943,-7889,8774,-3179]],"id":"05057","properties":{"name":"Hempstead"}},{"type":"Polygon","arcs":[[-7076,-7119,-6191,8775,-7231]],"id":"28137","properties":{"name":"Tate"}},{"type":"Polygon","arcs":[[8776,-8507,8777,-7216]],"id":"36085","properties":{"name":"Richmond"}},{"type":"Polygon","arcs":[[-2054,-8694,8778,8779,8780,-5068]],"id":"38083","properties":{"name":"Sheridan"}},{"type":"Polygon","arcs":[[8781,-2737,-8266,8782,-4697,-7839]],"id":"36111","properties":{"name":"Ulster"}},{"type":"Polygon","arcs":[[-2828,-1253,-4461,-5771,8783]],"id":"37059","properties":{"name":"Davie"}},{"type":"Polygon","arcs":[[-476,8784,-6694,-6776,-4794,-244]],"id":"48197","properties":{"name":"Hardeman"}},{"type":"Polygon","arcs":[[-5794,-7350,-3765,-2125,-6682,8785]],"id":"46117","properties":{"name":"Stanley"}},{"type":"Polygon","arcs":[[8786,-2324,8787,-1529,-1638,-7603]],"id":"29079","properties":{"name":"Grundy"}},{"type":"Polygon","arcs":[[-6436,-1862,-2499,-8512,-2000,-8704]],"id":"39049","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-7720,-2468,-7837,8788,-8114,-1220,-7878,-8260]],"id":"06061","properties":{"name":"Placer"}},{"type":"Polygon","arcs":[[-8278,-8659,-5668,-8005,-3897,-7913]],"id":"20091","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-5119,-5965,8789,-7037,-7871,8790]],"id":"09005","properties":{"name":"Litchfield"}},{"type":"Polygon","arcs":[[-1760,-8157,8791,8792,8793,-2731,8794]],"id":"01061","properties":{"name":"Geneva"}},{"type":"Polygon","arcs":[[8795,-7019,-7668,8796,-8792,-8156]],"id":"01069","properties":{"name":"Houston"}},{"type":"Polygon","arcs":[[-6147,8797,8798,-8759,-1230,-8758,-6627,-6808,-8473,-4532]],"id":"51077","properties":{"name":"Grayson"}},{"type":"Polygon","arcs":[[-979,-2815,-5029,-3165,-1156,-8232,8799]],"id":"08063","properties":{"name":"Kit Carson"}},{"type":"Polygon","arcs":[[-3463,-3155,-7204,8800,-8482]],"id":"19133","properties":{"name":"Monona"}},{"type":"Polygon","arcs":[[-8002,-5514,-6324,8801,-5342,-3614,-5046]],"id":"48351","properties":{"name":"Newton"}},{"type":"Polygon","arcs":[[8802,8803,8804,-6374,-6155]],"id":"13265","properties":{"name":"Taliaferro"}},{"type":"Polygon","arcs":[[-502,-1871,-6690,-8785,-475,8805]],"id":"40057","properties":{"name":"Harmon"}},{"type":"Polygon","arcs":[[-4548,8806,8807,-912,-4130]],"id":"48349","properties":{"name":"Navarro"}},{"type":"Polygon","arcs":[[8808,-4565,8809,-5030,-4376]],"id":"13279","properties":{"name":"Toombs"}},{"type":"Polygon","arcs":[[-2854,8810,-8636,-7083,-4055,-3430]],"id":"29187","properties":{"name":"St. Francois"}},{"type":"Polygon","arcs":[[8811,-3971,-7209,-4455,-6567]],"id":"35021","properties":{"name":"Harding"}},{"type":"Polygon","arcs":[[-4474,-1470,-1417,-8052,8812]],"id":"30097","properties":{"name":"Sweet Grass"}},{"type":"Polygon","arcs":[[8813,8814,-6355,-4491,-6520,-5569]],"id":"21155","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-8011,-8057,8815,-5597,8816,8817,-7472]],"id":"47149","properties":{"name":"Rutherford"}},{"type":"MultiPolygon","arcs":[[[8818,-6009,-2358,-2348,8819,8820]]],"id":"53061","properties":{"name":"Snohomish"}},{"type":"Polygon","arcs":[[-6051,-2340,-7187,-8658,-8276,-7390]],"id":"29165","properties":{"name":"Platte"}},{"type":"Polygon","arcs":[[-7952,-1838,-8628,-7052,8821,8822,8823]],"id":"39061","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[-6866,-4784,-7474,-5336,-1396,-5311]],"id":"47081","properties":{"name":"Hickman"}},{"type":"Polygon","arcs":[[-4550,-4528,8824,-6775,-224,-1065]],"id":"48337","properties":{"name":"Montague"}},{"type":"Polygon","arcs":[[-5451,-8135,-7384,8825,-5863,-5459]],"id":"49007","properties":{"name":"Carbon"}},{"type":"Polygon","arcs":[[-7529,-3101,-2972,-6182,-615,-3270]],"id":"20041","properties":{"name":"Dickinson"}},{"type":"Polygon","arcs":[[-2385,-8124,-149,8826,-8544,-1752]],"id":"17105","properties":{"name":"Livingston"}},{"type":"Polygon","arcs":[[-4824,-2147,-3302,-6370,8827,-3327,-4254]],"id":"05149","properties":{"name":"Yell"}},{"type":"Polygon","arcs":[[-5577,-7020,-3903,-2534]],"id":"16065","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-3415,-603,-186,8828,-3853,-7343]],"id":"13285","properties":{"name":"Troup"}},{"type":"Polygon","arcs":[[8829,-1827,-721,-8569,8830]],"id":"12081","properties":{"name":"Manatee"}},{"type":"MultiPolygon","arcs":[[[8831,8832,8833,-7728,8834]],[[8835,8836]]],"id":"51001","properties":{"name":"Accomack"}},{"type":"Polygon","arcs":[[-842,8837,-58,-8590,-2066]],"id":"13289","properties":{"name":"Twiggs"}},{"type":"Polygon","arcs":[[-5260,-7102,-946,-5416,8838]],"id":"24035","properties":{"name":"Queen Anne's"}},{"type":"Polygon","arcs":[[-3496,-7948,-5961,-5117]],"id":"25015","properties":{"name":"Hampshire"}},{"type":"Polygon","arcs":[[-4334,-5171,-6301,-3061,8839,8840]],"id":"17071","properties":{"name":"Henderson"}},{"type":"Polygon","arcs":[[8841,-8749,-2113,-3743,8842]],"id":"40097","properties":{"name":"Mayes"}},{"type":"Polygon","arcs":[[-4954,-8000,-2791,-7999,-6749,-6017,-6788,-8253]],"id":"51149","properties":{"name":"Prince George"}},{"type":"Polygon","arcs":[[-7150,-7157,8843,-8695,-4306]],"id":"36005","properties":{"name":"Bronx"}},{"type":"Polygon","arcs":[[-3330,-7779,-8563,-8550,-4945,-4949]],"id":"05019","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[-756,8844,-1740,-6435,-6432,-6500,8845]],"id":"39065","properties":{"name":"Hardin"}},{"type":"Polygon","arcs":[[-6049,-1360,-519,-5348,-927]],"id":"48163","properties":{"name":"Frio"}},{"type":"Polygon","arcs":[[-8828,-6369,-2402,-7776,-3328]],"id":"05051","properties":{"name":"Garland"}},{"type":"Polygon","arcs":[[-127,-5407,-1538,1542,-7009,-5027,-2813]],"id":"31057","properties":{"name":"Dundy"}},{"type":"Polygon","arcs":[[8846,-5303,-6216,-2398,-6418,-922,-882]],"id":"31023","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[-8826,-7383,-1725,8847,-1175,-5864]],"id":"49019","properties":{"name":"Grand"}},{"type":"Polygon","arcs":[[-8405,-4400,-5912,-7789,-6746,-4135]],"id":"51127","properties":{"name":"New Kent"}},{"type":"Polygon","arcs":[[-8684,-4738,-2851,-8046,-2833,-7991,-8726]],"id":"01093","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-8451,8848,-710,-6546,-5742,-2179]],"id":"30073","properties":{"name":"Pondera"}},{"type":"Polygon","arcs":[[-7836,8849,-8111,-8789]],"id":"32510","properties":{"name":"Carson City"}},{"type":"Polygon","arcs":[[8850,8851,-5145,-7375]],"id":"12125","properties":{"name":"Union"}},{"type":"MultiPolygon","arcs":[[[-8772,-1988,8852,8853]]],"id":"02020","properties":{"name":"Anchorage"}},{"type":"Polygon","arcs":[[-7254,-3515,-5282,8854,8855,-3999]],"id":"55125","properties":{"name":"Vilas"}},{"type":"Polygon","arcs":[[8856,-2466,-3124,-8595,-2953]],"id":"28019","properties":{"name":"Choctaw"}},{"type":"Polygon","arcs":[[-2259,8857,-7914,-7144]],"id":"31169","properties":{"name":"Thayer"}},{"type":"Polygon","arcs":[[-730,8858,-478,8859,-55,-5578]],"id":"13223","properties":{"name":"Paulding"}},{"type":"Polygon","arcs":[[8860,-8193,-8140,-8189,-4288,8861,-5386]],"id":"32033","properties":{"name":"White Pine"}},{"type":"Polygon","arcs":[[8862,8863,-1049,-8455,-2458,-2959]],"id":"48203","properties":{"name":"Harrison"}},{"type":"Polygon","arcs":[[-6087,-6120,8864,-601]],"id":"13113","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[-7306,-6384,-2931,8865,-1520,-7310]],"id":"18059","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[-7459,-6404,8866,-7700,-7689,8867]],"id":"22025","properties":{"name":"Catahoula"}},{"type":"Polygon","arcs":[[8868,-7050,-8627,-6885,-6454,8869]],"id":"21191","properties":{"name":"Pendleton"}},{"type":"Polygon","arcs":[[-3440,-8760,-8799,8870,-6785]],"id":"51197","properties":{"name":"Wythe"}},{"type":"Polygon","arcs":[[8871,8872,-6608,-5640,-8383,-1437]],"id":"56003","properties":{"name":"Big Horn"}},{"type":"Polygon","arcs":[[-3593,-6740,-5795,8873,-6349]],"id":"46137","properties":{"name":"Ziebach"}},{"type":"MultiPolygon","arcs":[[[8874]],[[8875,8876]]],"id":"25007","properties":{"name":"Dukes"}},{"type":"Polygon","arcs":[[-8584,8877,-1850,-606,-1747]],"id":"13157","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-5657,8878,-2858,-8710,-8122]],"id":"18111","properties":{"name":"Newton"}},{"type":"Polygon","arcs":[[8879,-4323,-8407,-7760,8880]],"id":"48277","properties":{"name":"Lamar"}},{"type":"Polygon","arcs":[[-7090,-2747,-8653,-1712,-8616,8881,-3363,-7137]],"id":"27021","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[-1910,-1552,-1925,-3309,-778]],"id":"48153","properties":{"name":"Floyd"}},{"type":"Polygon","arcs":[[-2930,8882,-2711,-3680,-1521,-8866]],"id":"18139","properties":{"name":"Rush"}},{"type":"Polygon","arcs":[[-1244,-7410,-6980,-2867,8883]],"id":"06079","properties":{"name":"San Luis Obispo"}},{"type":"Polygon","arcs":[[-8656,8884,-4934,-4574,-6173,-2387,-6319]],"id":"20155","properties":{"name":"Reno"}},{"type":"Polygon","arcs":[[-3028,-990,-2555,-2546,-3420]],"id":"19025","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[-1716,-8549,-621,-6183]],"id":"27065","properties":{"name":"Kanabec"}},{"type":"Polygon","arcs":[[-4855,-7723,-6720,-7348,-8013,-8614]],"id":"42035","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[-3164,-859,8885,-2133,-2993,-1152]],"id":"20109","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[-1836,-1634,8886,-6659,8887,-8625]],"id":"39027","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[-8366,-757,-8846,-6499,-1830]],"id":"39003","properties":{"name":"Allen"}},{"type":"Polygon","arcs":[[-4151,-2618,-8504,8888,-6704,-791,-1950]],"id":"55115","properties":{"name":"Shawano"}},{"type":"Polygon","arcs":[[-2116,-7491,-7504,-8708,8889,-7881,-8175]],"id":"40135","properties":{"name":"Sequoyah"}},{"type":"Polygon","arcs":[[-6725,-7963,-5814,8890,8891,8892,-767,8893,-6722,8894]],"id":"47035","properties":{"name":"Cumberland"}},{"type":"Polygon","arcs":[[8895,-6151,-4437,-5579,-57,8896,-7341,-3456]],"id":"01029","properties":{"name":"Cleburne"}},{"type":"Polygon","arcs":[[-77,-7024,8897,-7072,8898]],"id":"26099","properties":{"name":"Macomb"}},{"type":"Polygon","arcs":[[-8105,-79,8899,-6326,-8102,-2882]],"id":"26049","properties":{"name":"Genesee"}},{"type":"Polygon","arcs":[[-3016,8900,-4655,-1084,-937]],"id":"17007","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[-3842,-5251,-6261,8901,-1708,-8107,-3565]],"id":"38053","properties":{"name":"McKenzie"}},{"type":"Polygon","arcs":[[-7244,-7388,-4365,-2895,-6629,-8757]],"id":"51141","properties":{"name":"Patrick"}},{"type":"Polygon","arcs":[[-6995,-8167,8902,-5502,-5914,8903]],"id":"17003","properties":{"name":"Alexander"}},{"type":"Polygon","arcs":[[-6917,-4393,-3177,-7935]],"id":"05133","properties":{"name":"Sevier"}},{"type":"Polygon","arcs":[[-6203,8904,-8345,8905,-414]],"id":"28039","properties":{"name":"George"}},{"type":"Polygon","arcs":[[-6422,8906,-8326,-8508,-8777,-7215]],"id":"34039","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-3938,-4260,-3839,8907,8908,8909]],"id":"17015","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[-3220,8910,-3384,-8615,-1668,8911]],"id":"13287","properties":{"name":"Turner"}},{"type":"Polygon","arcs":[[-8160,8912,-8722,8913,8914]],"id":"06081","properties":{"name":"San Mateo"}},{"type":"Polygon","arcs":[[8915,8916,-8494,-6933,-2921,8917,-4563]],"id":"13031","properties":{"name":"Bulloch"}},{"type":"Polygon","arcs":[[-4616,-3939,-8910,8918,-2542]],"id":"19097","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-2047,-8164,-8367,-5039,-1177]],"id":"08113","properties":{"name":"San Miguel"}},{"type":"Polygon","arcs":[[-3600,-2615,-122,-7727,8919]],"id":"48427","properties":{"name":"Starr"}},{"type":"Polygon","arcs":[[-2027,-8269,-3826,-8581,-8417]],"id":"13187","properties":{"name":"Lumpkin"}},{"type":"Polygon","arcs":[[-8681,8920,-8327,-8907,-6421,-4359,-6142]],"id":"34027","properties":{"name":"Morris"}},{"type":"Polygon","arcs":[[8921,-2656,-2256,-7511,-4021,-1540,-5406]],"id":"31063","properties":{"name":"Frontier"}},{"type":"Polygon","arcs":[[-6823,-4155,-8110,-6089,-5476,-5644]],"id":"55033","properties":{"name":"Dunn"}},{"type":"Polygon","arcs":[[-5922,8922,-2727,-2774,-213]],"id":"48429","properties":{"name":"Stephens"}},{"type":"Polygon","arcs":[[-8865,-6119,-7782,-2448,-2486,-6363,-181,-602]],"id":"13255","properties":{"name":"Spalding"}},{"type":"Polygon","arcs":[[-2990,-7184,-3540,8923,-6644]],"id":"39051","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[-442,-5176,-3683,-2677,8924]],"id":"19037","properties":{"name":"Chickasaw"}},{"type":"Polygon","arcs":[[-8262,-158,-2502,-2728,-6689]],"id":"48369","properties":{"name":"Parmer"}},{"type":"Polygon","arcs":[[-5674,-1623,-4988,-4834,-3754,-964,-5670]],"id":"42019","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[8925,-1580,8926,8927,-8398]],"id":"50009","properties":{"name":"Essex"}},{"type":"Polygon","arcs":[[-2548,-2557,-8535,-1239,-3166]],"id":"19077","properties":{"name":"Guthrie"}},{"type":"Polygon","arcs":[[-8717,-7898,-3210,-6771,-8191,-8861,-5385,-8525,-6574]],"id":"32007","properties":{"name":"Elko"}},{"type":"Polygon","arcs":[[8928,-8644,8929,-7735,-2285,-7516]],"id":"01089","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-3858,-8113,8930,-4423,-2525,-4829,-1102,-6834,-2607]],"id":"06051","properties":{"name":"Mono"}},{"type":"Polygon","arcs":[[-6929,-8378,-5590,8931]],"id":"06073","properties":{"name":"San Diego"}},{"type":"Polygon","arcs":[[-4449,-6257,-5162,-549,-551,-2943]],"id":"31115","properties":{"name":"Loup"}},{"type":"Polygon","arcs":[[-8561,-5320,8932,8933,-5559]],"id":"31157","properties":{"name":"Scotts Bluff"}},{"type":"Polygon","arcs":[[-675,-3147,-6707,-5752,-6737,-3591,-6698,-8106]],"id":"38001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[-1137,-4974,8934,8935,-4035,-6058,8936,-5270]],"id":"47071","properties":{"name":"Hardin"}},{"type":"Polygon","arcs":[[-7639,-5760,8937,-8863,-2958]],"id":"48315","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-7493,8938,8939,-3823,-8268]],"id":"13281","properties":{"name":"Towns"}},{"type":"Polygon","arcs":[[-8823,8940,8941,-6613,-7134,-4302,8942]],"id":"21015","properties":{"name":"Boone"}},{"type":"Polygon","arcs":[[8943,-1280,-7115,8944,8945]],"id":"26159","properties":{"name":"Van Buren"}},{"type":"Polygon","arcs":[[-7764,-1677,8946,-4181,8947,-8536]],"id":"48465","properties":{"name":"Val Verde"}},{"type":"Polygon","arcs":[[-6907,-8323,-8426,8948,-8838,-841]],"id":"13319","properties":{"name":"Wilkinson"}},{"type":"Polygon","arcs":[[-3222,8949,-7662,8950,-166]],"id":"13177","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[8951,-2924,-4276,-8623,-8328,-5031,-8810]],"id":"13267","properties":{"name":"Tattnall"}},{"type":"Polygon","arcs":[[8952,-3520,-3485,8953,-4796,-5434]],"id":"23011","properties":{"name":"Kennebec"}},{"type":"Polygon","arcs":[[-5541,-1308,8954,-193,-6937]],"id":"19189","properties":{"name":"Winnebago"}},{"type":"Polygon","arcs":[[-5447,-2601,-5418,-3644]],"id":"19059","properties":{"name":"Dickinson"}},{"type":"Polygon","arcs":[[-5004,-4223,-1209,8955,-4644,-8723,-6320,-5512]],"id":"22069","properties":{"name":"Natchitoches"}},{"type":"Polygon","arcs":[[-8497,-5583,8956,-875,-8741]],"id":"31075","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[-7271,-7928,-7695,-8867,-6403]],"id":"22041","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-8577,-7807,-7731,-161,-6378,-8711,-3408]],"id":"13197","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-6789,-6020,-5774,-4190,-5778,-8026,-7795,-6466,-8143,-8359]],"id":"51175","properties":{"name":"Southampton"}},{"type":"Polygon","arcs":[[-8109,-8471,-7799,8957,-6728]],"id":"55121","properties":{"name":"Trempealeau"}},{"type":"Polygon","arcs":[[8958,8959,-7915,-7630]],"id":"06055","properties":{"name":"Napa"}},{"type":"Polygon","arcs":[[-3661,-7919,-1224,-5880,-3377,-2160]],"id":"05137","properties":{"name":"Stone"}},{"type":"Polygon","arcs":[[-1322,-6184,-624,8960,8961,-8308,8962]],"id":"27141","properties":{"name":"Sherburne"}},{"type":"Polygon","arcs":[[-4667,-7675,8963,-7345]],"id":"48141","properties":{"name":"El Paso"}},{"type":"Polygon","arcs":[[-140,-8448,-8048,-8079]],"id":"54003","properties":{"name":"Berkeley"}},{"type":"Polygon","arcs":[[8964,-6584,-4219,8965,-7296,-283]],"id":"21141","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[-431,-2201,-681,-218,-2209]],"id":"48081","properties":{"name":"Coke"}},{"type":"Polygon","arcs":[[-8410,8966,-3791,-8605,-8458,-8596]],"id":"39079","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-4609,8967,-7320,-4993,8968]],"id":"13039","properties":{"name":"Camden"}},{"type":"Polygon","arcs":[[-4535,-7163,-4011,-8564,-8567,-4507,-7294]],"id":"37011","properties":{"name":"Avery"}},{"type":"MultiPolygon","arcs":[[[8969]],[[8970]],[[8971]],[[8972]],[[8973]],[[8974]],[[8975]],[[8976]],[[8977]],[[8978]],[[8979]],[[8980]],[[8981]],[[8982]],[[8983]],[[8984]],[[8985]],[[8986]],[[8987]]],"id":"02016","properties":{"name":"Aleutians West"}},{"type":"MultiPolygon","arcs":[[[-8853,-1987,8988]],[[8989]],[[-4741,-8774,8990,-1971,-1978]]],"id":"02122","properties":{"name":"Kenai Peninsula"}},{"type":"Polygon","arcs":[[-7322,8991,-8246,-7610,8992]],"id":"12031","properties":{"name":"Duval"}},{"type":"MultiPolygon","arcs":[[[8993]],[[-7397,-6211,8994]]],"id":"44009","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-6226,-8075,-6108,8995,-6294]],"id":"08019","properties":{"name":"Clear Creek"}},{"type":"Polygon","arcs":[[8996,-2175,-7873,-4241,-7918,8997]],"id":"29153","properties":{"name":"Ozark"}},{"type":"Polygon","arcs":[[8998,-8233,-5095,-8301,8999,-2212,-8028]],"id":"08061","properties":{"name":"Kiowa"}},{"type":"MultiPolygon","arcs":[[[9000,-7263]],[[-7266,9001,-7725]]],"id":"48061","properties":{"name":"Cameron"}},{"type":"Polygon","arcs":[[-1474,-2176,-8997,9002,-7419,-6973,-1628]],"id":"29213","properties":{"name":"Taney"}},{"type":"Polygon","arcs":[[-1337,-7642,-3750,-7636,-2237,9003,-368]],"id":"40017","properties":{"name":"Canadian"}},{"type":"Polygon","arcs":[[-7565,9004,-2149,-4823,-7591]],"id":"05071","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-8523,-5821,-8522,-5819,-5893,-5532,-3570]],"id":"47095","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-3626,-5257,-6791,-6801,-5999,-7828]],"id":"51037","properties":{"name":"Charlotte"}},{"type":"Polygon","arcs":[[-8170,-8447,-8432,-8559,-5940]],"id":"05055","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[9005,-7584,9006,-7572,9007]],"id":"12129","properties":{"name":"Wakulla"}},{"type":"Polygon","arcs":[[9008,-3509,-952,9009]],"id":"26141","properties":{"name":"Presque Isle"}},{"type":"Polygon","arcs":[[9010,-8098,-5652,-8121,-2383,-1511]],"id":"17197","properties":{"name":"Will"}},{"type":"Polygon","arcs":[[-7452,-7448,-5458,-4718,-8679,-7444]],"id":"54081","properties":{"name":"Raleigh"}},{"type":"Polygon","arcs":[[-56,-8860,-481,-6088,-605,-3414,-7342,-8897]],"id":"13045","properties":{"name":"Carroll"}},{"type":"Polygon","arcs":[[9011,-8526,-5387,-8862,-4294,-8275,-4830,-2523,-4422]],"id":"32023","properties":{"name":"Nye"}},{"type":"Polygon","arcs":[[9012,-6671,9013,9014,-5464,-2652]],"id":"55039","properties":{"name":"Fond du Lac"}},{"type":"Polygon","arcs":[[-2095,-4335,-8841,9015,-7273,-2059]],"id":"19111","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[9016,9017,-8735,-6081,-7742,-7646,9018,-7562]],"id":"36091","properties":{"name":"Saratoga"}},{"type":"Polygon","arcs":[[9019,-3922,9020,-6479,-808,-3705]],"id":"22097","properties":{"name":"St. Landry"}},{"type":"Polygon","arcs":[[-7822,9021,-2585,-4320,9022,-7599]],"id":"40005","properties":{"name":"Atoka"}},{"type":"Polygon","arcs":[[-7563,-9019,-7645,-3962]],"id":"36035","properties":{"name":"Fulton"}},{"type":"Polygon","arcs":[[-7823,-6511,-7884,-7886,-2580,-9022,-7821]],"id":"40121","properties":{"name":"Pittsburg"}},{"type":"Polygon","arcs":[[-3403,9023,9024,-8040,-7280,-3786,9025]],"id":"39009","properties":{"name":"Athens"}},{"type":"Polygon","arcs":[[-7987,-6361,-2627,-837,9026,-7983]],"id":"01131","properties":{"name":"Wilcox"}},{"type":"Polygon","arcs":[[9027,9028,-6064,-5181,-5186,9029,-2303]],"id":"42051","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[9030,-7737,-4735,-3989,-3446,-8044]],"id":"01009","properties":{"name":"Blount"}},{"type":"Polygon","arcs":[[-4203,-6880,-3871,-6241,-6372,-727,-3829]],"id":"13129","properties":{"name":"Gordon"}},{"type":"Polygon","arcs":[[-8700,-8335,-13,9031,-7860,-4584,-8064,-8134]],"id":"22095","properties":{"name":"St. John the Baptist"}},{"type":"Polygon","arcs":[[-5662,-7568,-7552,-7172,-5678]],"id":"42069","properties":{"name":"Lackawanna"}},{"type":"Polygon","arcs":[[-8892,9032,-5740,9033,-4123,9034,-4538,9035]],"id":"47145","properties":{"name":"Roane"}},{"type":"Polygon","arcs":[[9036,-8477,9037,-6448,-6739]],"id":"46021","properties":{"name":"Campbell"}},{"type":"Polygon","arcs":[[-7062,-7055,-4640,9038,-3919]],"id":"22121","properties":{"name":"West Baton Rouge"}},{"type":"Polygon","arcs":[[-4208,-7312,-1500,-7457,-6302,9039]],"id":"18133","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[-1126,-1095,-8183,-8222,-7355]],"id":"19173","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[-3474,-7969,-2536,-3908,9040,-7008,-7358]],"id":"16011","properties":{"name":"Bingham"}},{"type":"MultiPolygon","arcs":[[[9041]],[[9042]],[[9043]],[[9044]],[[9045]],[[9046]],[[9047]],[[9048,-7255,-3997,-403,-4404]]],"id":"55003","properties":{"name":"Ashland"}},{"type":"Polygon","arcs":[[-6729,-8958,-7802,-5366,-8091,-3150,-7185]],"id":"27169","properties":{"name":"Winona"}},{"type":"Polygon","arcs":[[9049,-6818,-6753,-2293,-5233,9050,-7222],[-1231]],"id":"51165","properties":{"name":"Rockingham"}},{"type":"Polygon","arcs":[[9051,9052,-4336,-7288]],"id":"30019","properties":{"name":"Daniels"}},{"type":"Polygon","arcs":[[-7285,-5113,-3642,-3252,-7845]],"id":"54097","properties":{"name":"Upshur"}},{"type":"Polygon","arcs":[[9053,-6527,-8770,9054,-8016,-6767]],"id":"48473","properties":{"name":"Waller"}},{"type":"Polygon","arcs":[[-6308,-4669,-4487,-6999,-7038]],"id":"18147","properties":{"name":"Spencer"}},{"type":"Polygon","arcs":[[-8067,9055,-9010,-951,-1536,-7178]],"id":"26031","properties":{"name":"Cheboygan"}},{"type":"Polygon","arcs":[[-8783,-8265,-5120,-8791,-7870,-7866,-4698]],"id":"36027","properties":{"name":"Dutchess"}},{"type":"Polygon","arcs":[[-5306,-4475,-8813,-8051,9056,-1435]],"id":"30067","properties":{"name":"Park"}},{"type":"Polygon","arcs":[[-6322,-8725,-3702,-7847,9057]],"id":"22003","properties":{"name":"Allen"}},{"type":"Polygon","arcs":[[-2799,-1001,-302,9058,-2820]],"id":"28101","properties":{"name":"Newton"}},{"type":"Polygon","arcs":[[-3920,-9039,-4639,-8701,-7542,-4624,9059]],"id":"22047","properties":{"name":"Iberville"}},{"type":"Polygon","arcs":[[-3432,-4058,-6412,-8738,9060,-6414,-8031]],"id":"29223","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[-7590,-495,-3555,-7260,-6777,-6692]],"id":"40141","properties":{"name":"Tillman"}},{"type":"Polygon","arcs":[[-716,9061,-3536,-6072,9062,-6065,-327]],"id":"36011","properties":{"name":"Cayuga"}},{"type":"Polygon","arcs":[[-7492,-7430,-7500,9063,-8939]],"id":"13241","properties":{"name":"Rabun"}},{"type":"Polygon","arcs":[[-3804,-4239,-5197,-4357,-7078,-7230,-8466,-8467,-570]],"id":"05035","properties":{"name":"Crittenden"}},{"type":"Polygon","arcs":[[-8793,-8797,-7667,-806,-7577,-7518,-2343,-3670,9064]],"id":"12063","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-4585,-4032,-7517,-2288,9065,-2848,-4737]],"id":"01079","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[-8129,-4118,9066,9067,9068]],"id":"21215","properties":{"name":"Spencer"}},{"type":"Polygon","arcs":[[-8286,9069,-596,-7709,-8244]],"id":"53067","properties":{"name":"Thurston"}},{"type":"Polygon","arcs":[[9070,9071,-3502,-7251,-231,-1393]],"id":"46011","properties":{"name":"Brookings"}},{"type":"Polygon","arcs":[[-5600,-5606,-642,-8648,-8641]],"id":"47061","properties":{"name":"Grundy"}},{"type":"Polygon","arcs":[[-6782,-1612,-5866,-8217,9072]],"id":"48025","properties":{"name":"Bee"}},{"type":"Polygon","arcs":[[9073,9074,-8765,-4634,9075]],"id":"24017","properties":{"name":"Charles"}},{"type":"Polygon","arcs":[[-5659,-5677,-6735,-6716,9076]],"id":"42113","properties":{"name":"Sullivan"}},{"type":"Polygon","arcs":[[-2170,-7790]],"id":"51830","properties":{"name":"Williamsburg"}},{"type":"Polygon","arcs":[[-8406,-7641,9077,-2244]],"id":"48449","properties":{"name":"Titus"}},{"type":"Polygon","arcs":[[-2245,-9078,-7640,-2956,-6462]],"id":"48063","properties":{"name":"Camp"}},{"type":"Polygon","arcs":[[9078,-5602,-8646,9079]],"id":"47127","properties":{"name":"Moore"}},{"type":"Polygon","arcs":[[9080,-7600,-9023,-4324,-8880,9081,9082]],"id":"40013","properties":{"name":"Bryan"}},{"type":"Polygon","arcs":[[-2270,-109,-6528,-9054,-6766,-7744]],"id":"48185","properties":{"name":"Grimes"}},{"type":"Polygon","arcs":[[-7575,-2010,-7014,-7580,-9006,9083]],"id":"12073","properties":{"name":"Leon"}},{"type":"Polygon","arcs":[[-84,-8728,9084,-2462,9085]],"id":"28025","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-5995,-8224,9086,-4415,-4017,-7997]],"id":"29087","properties":{"name":"Holt"}},{"type":"Polygon","arcs":[[-7160,9087,-6427,-8531,-8598,9088]],"id":"36029","properties":{"name":"Erie"}},{"type":"Polygon","arcs":[[-8126,-2899,-7103,-8761,-2845]],"id":"16087","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-6350,-8874,-8786,-6681,-5856,-4750]],"id":"46055","properties":{"name":"Haakon"}},{"type":"Polygon","arcs":[[-7882,-8890,-8709,-4256,-6916,-7934,-2582,-7885]],"id":"40079","properties":{"name":"Le Flore"}},{"type":"Polygon","arcs":[[-5824,-8606,-6289,9089,-8076,-5362,-5108]],"id":"54099","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[-7247,9090,-3568,-6012,-4899,-265]],"id":"30079","properties":{"name":"Prairie"}},{"type":"Polygon","arcs":[[9091,-7654,9092,-2563]],"id":"12033","properties":{"name":"Escambia"}},{"type":"Polygon","arcs":[[-8949,-8425,9093,-8374,-8412,-59]],"id":"13175","properties":{"name":"Laurens"}},{"type":"Polygon","arcs":[[9094,-2679,-192,-3160,-846]],"id":"19023","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[9095,-5223,9096,-463,9097,-5974,-3368,-7402]],"id":"41065","properties":{"name":"Wasco"}},{"type":"Polygon","arcs":[[-5854,-4860,-7533,-1600,-6341,9098]],"id":"31027","properties":{"name":"Cedar"}},{"type":"Polygon","arcs":[[-8690,9099,-8734,-7289,9100,-7945,9101]],"id":"33011","properties":{"name":"Hillsborough"}},{"type":"Polygon","arcs":[[-8211,-5797,-5301,-8495,-8917,9102]],"id":"13251","properties":{"name":"Screven"}},{"type":"Polygon","arcs":[[-8483,-8801,-7205,-5215,-6215,-1011]],"id":"31021","properties":{"name":"Burt"}},{"type":"MultiPolygon","arcs":[[[-4282,9103,-8832,9104]],[[-8837,9105]],[[-5079,9106]]],"id":"24039","properties":{"name":"Somerset"}},{"type":"Polygon","arcs":[[-4281,9107,9108,-8833,-9104]],"id":"24047","properties":{"name":"Worcester"}},{"type":"Polygon","arcs":[[9109,-455,-8647,-6258,-5249,-6632]],"id":"38013","properties":{"name":"Burke"}},{"type":"Polygon","arcs":[[9110,9111,9112,-5655]],"id":"18127","properties":{"name":"Porter"}},{"type":"Polygon","arcs":[[-8006,-6407,-1924,-2158,-270,-7141]],"id":"29083","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[-6071,9113,-7816,-7739,-6857,-6066,-9063]],"id":"36023","properties":{"name":"Cortland"}},{"type":"Polygon","arcs":[[-2902,-3902,-5314,-8716,9114]],"id":"16001","properties":{"name":"Ada"}},{"type":"Polygon","arcs":[[-2795,-4043,-1117,9115,-1743]],"id":"17175","properties":{"name":"Stark"}},{"type":"Polygon","arcs":[[-8780,9116,-2554,-2108,9117,9118]],"id":"38043","properties":{"name":"Kidder"}},{"type":"Polygon","arcs":[[-5980,-6786,-8871,-8798,-6146,9119]],"id":"51173","properties":{"name":"Smyth"}},{"type":"Polygon","arcs":[[9120,-1942,-8427,-6099,-6375,-8805]],"id":"13301","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[-6884,9121,-5736,-5536,-6456]],"id":"21201","properties":{"name":"Robertson"}},{"type":"MultiPolygon","arcs":[[[9122]],[[-1706,-2294,-482,9123]],[[9124]]],"id":"02180","properties":{"name":"Nome"}},{"type":"Polygon","arcs":[[-2218,-3434,-1026,-429,9125]],"id":"48415","properties":{"name":"Scurry"}},{"type":"Polygon","arcs":[[9126,-8220,-8396,-8756,-118,-891]],"id":"48249","properties":{"name":"Jim Wells"}},{"type":"Polygon","arcs":[[-8858,-2481,-7637,-2915]],"id":"31095","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-8056,-6638,-5607,-5598,-8816]],"id":"47015","properties":{"name":"Cannon"}},{"type":"Polygon","arcs":[[-3303,-1237,-2107,-7308,9127,-6393]],"id":"18017","properties":{"name":"Cass"}},{"type":"Polygon","arcs":[[-9090,-6288,-8677,-7453,-7442,-6828,-8077]],"id":"54043","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[9128,-7849,-556,-2657,-8922,-5405,-7122,9129]],"id":"31111","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-8292,-3090,9130,9131,9132,-7085,-8635]],"id":"17157","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[-9015,9133,-5376,-1448,-5465]],"id":"55131","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-5268,9134,9135,-6003]],"id":"11001","properties":{"name":"District of Columbia"}},{"type":"Polygon","arcs":[[9136,9137,-4890,-6814,-5909]],"id":"51119","properties":{"name":"Middlesex"}},{"type":"Polygon","arcs":[[-3129,9138,-4656,-2508,-2595]],"id":"31061","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-7032,-5292,-3806,-8720,9139,-8158,9140]],"id":"06001","properties":{"name":"Alameda"}},{"type":"Polygon","arcs":[[-6004,-9136,9141,9142]],"id":"51510","properties":{"name":"Alexandria"}},{"type":"Polygon","arcs":[[-5937,9143,9144,-2307,-1881]],"id":"05079","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-6554,9145,-2334,9146,-5277,-7959,-8580,-4469]],"id":"37141","properties":{"name":"Pender"}},{"type":"Polygon","arcs":[[-5964,-8127,-7395,-5089,-7034,-8790]],"id":"09003","properties":{"name":"Hartford"}},{"type":"Polygon","arcs":[[-3992,9147,-8096,-4652]],"id":"17097","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-6568,-1598,-5304,-8847,-881,-6569,-199,-4414]],"id":"31141","properties":{"name":"Platte"}},{"type":"Polygon","arcs":[[-6387,-2950,9148,9149,-3931,-2513]],"id":"20081","properties":{"name":"Haskell"}},{"type":"Polygon","arcs":[[-3002,-2691,-2586,-4809,-7257,-3620]],"id":"48135","properties":{"name":"Ector"}},{"type":"Polygon","arcs":[[-272,-2157,-5883,9150,9151]],"id":"29085","properties":{"name":"Hickory"}},{"type":"Polygon","arcs":[[-6802,-6793,9152,-8255,-8358,-8141,-8069]],"id":"51025","properties":{"name":"Brunswick"}},{"type":"Polygon","arcs":[[-2666,-8925,-9095,-2392]],"id":"19067","properties":{"name":"Floyd"}},{"type":"Polygon","arcs":[[9153]],"id":"51600","properties":{"name":"Fairfax"}},{"type":"Polygon","arcs":[[-5319,-8499,-8744,9154,9155,-8933]],"id":"31123","properties":{"name":"Morrill"}},{"type":"Polygon","arcs":[[9156,-1451,-7775,-3994,-4651,-8901,-3015]],"id":"55127","properties":{"name":"Walworth"}},{"type":"Polygon","arcs":[[-8918,-2925,-8952,-4564]],"id":"13043","properties":{"name":"Candler"}},{"type":"Polygon","arcs":[[-1195,-3001,-1123,9157,-8082,-2034,9158]],"id":"17115","properties":{"name":"Macon"}},{"type":"Polygon","arcs":[[-858,-3111,-2577,-2613,-1502,-339,-2134,-8886]],"id":"20063","properties":{"name":"Gove"}},{"type":"Polygon","arcs":[[-7680,-8081,-8346,-8905,-6202]],"id":"28041","properties":{"name":"Greene"}},{"type":"Polygon","arcs":[[9159,-2683,-2660,9160,-9131,-3089]],"id":"17189","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[9161,-287,-703,-3172,-3481,-3519]],"id":"23019","properties":{"name":"Penobscot"}},{"type":"Polygon","arcs":[[-2449,-2404,-394,-3996,-5787,9162]],"id":"55001","properties":{"name":"Adams"}},{"type":"MultiPolygon","arcs":[[[9163]],[[9164]],[[-8906,-8344,9165,-7756,-415]]],"id":"28059","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[9166,-1672,9167,9168,-7011,-7666]],"id":"13071","properties":{"name":"Colquitt"}},{"type":"Polygon","arcs":[[-7938,-6159,-7887,-966,-3757,9169,-9028,-2302,-4725]],"id":"42125","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-7101,9170,-9108,-4280,-5082,-948]],"id":"10005","properties":{"name":"Sussex"}},{"type":"Polygon","arcs":[[-2970,9171,-5428,-7250,-3156,-2417,-6181]],"id":"20197","properties":{"name":"Wabaunsee"}},{"type":"Polygon","arcs":[[-5295,-5288,-6890,-5709,9172,-3312]],"id":"21157","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[-7469,9173,-5110,-4922,-5354,-6344,-6564]],"id":"21175","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[-1284,-6447,-6585,-8965,-282,9174,-4911]],"id":"21177","properties":{"name":"Muhlenberg"}},{"type":"Polygon","arcs":[[-8966,-4218,-7859,-5622,-7297]],"id":"21213","properties":{"name":"Simpson"}},{"type":"Polygon","arcs":[[-4009,-1904,-2832,-4838,-8565]],"id":"37035","properties":{"name":"Catawba"}},{"type":"Polygon","arcs":[[-7168,-7651,-7596,-7669,-7422,-6560]],"id":"40103","properties":{"name":"Noble"}},{"type":"Polygon","arcs":[[-4523,9175,-3455,-8420,9176,-6022]],"id":"53013","properties":{"name":"Columbia"}},{"type":"Polygon","arcs":[[-9059,-7703,-7677,9177,9178]],"id":"28061","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[-7200,-5440,-4672,-4629,-1129,-3098]],"id":"17033","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[-4755,-566,-1395,-3005,-6914,-1390]],"id":"46005","properties":{"name":"Beadle"}},{"type":"Polygon","arcs":[[-8924,-3546,-6667,-8365,-1033,-6645]],"id":"39069","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[-8705,-2004,-8408,-6660,-8887,-1633]],"id":"39047","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[-2929,-1161,9179,-2705,-8883]],"id":"18041","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[-7644,-6464,-2249,-2265]],"id":"48379","properties":{"name":"Rains"}},{"type":"Polygon","arcs":[[-5103,-669,-7235,-2325,-8787,-7602]],"id":"29129","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[9180,-363,-656,9181,9182]],"id":"38027","properties":{"name":"Eddy"}},{"type":"Polygon","arcs":[[-3006,-560,-8500,-1363,-1990]],"id":"46061","properties":{"name":"Hanson"}},{"type":"Polygon","arcs":[[-1816,9183,-8429,-8150,-2741]],"id":"39109","properties":{"name":"Miami"}},{"type":"Polygon","arcs":[[-1066,-228,-8095,9184,-2411,-2724]],"id":"48367","properties":{"name":"Parker"}},{"type":"Polygon","arcs":[[9185,-1068,-2723,-8923,-5921]],"id":"48503","properties":{"name":"Young"}},{"type":"Polygon","arcs":[[-6626,9186,-8592,-4024,-6471,-788]],"id":"48373","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[-6323,-9058,-7848,-5340,-8802]],"id":"22011","properties":{"name":"Beauregard"}},{"type":"Polygon","arcs":[[-8147,-4384,-8357,-319,-4185,9187,-5139]],"id":"49033","properties":{"name":"Rich"}},{"type":"Polygon","arcs":[[-2351,-2365,-3634,9188,-5219,9189,-7710,-594]],"id":"53077","properties":{"name":"Yakima"}},{"type":"MultiPolygon","arcs":[[[9190]],[[-3544,9191,9192,-3066,-6665]]],"id":"39123","properties":{"name":"Ottawa"}},{"type":"Polygon","arcs":[[-4329,-5718,-4962,9193,-7088,-4956]],"id":"17013","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[-6869,-6944,-3972,-8812,-6566,-5746]],"id":"35007","properties":{"name":"Colfax"}},{"type":"Polygon","arcs":[[-6754,-586,-6911,-6256,-4447,-5581]],"id":"31103","properties":{"name":"Keya Paha"}},{"type":"Polygon","arcs":[[-1439,-8385,-8509]],"id":"56017","properties":{"name":"Hot Springs"}},{"type":"Polygon","arcs":[[-8166,-5297,-5949,-5503,-8903]],"id":"21007","properties":{"name":"Ballard"}},{"type":"Polygon","arcs":[[9194,-6761,-1687,-5044,-8591,-9187,-6625,-6742]],"id":"48005","properties":{"name":"Angelina"}},{"type":"Polygon","arcs":[[-4966,-5843,-5051,-4684,-4874,9195]],"id":"45015","properties":{"name":"Berkeley"}},{"type":"Polygon","arcs":[[-888,9196,-9071,-1392,-564]],"id":"46057","properties":{"name":"Hamlin"}},{"type":"Polygon","arcs":[[-4484,-4099,-5894,9197,-8402,-5720]],"id":"45037","properties":{"name":"Edgefield"}},{"type":"Polygon","arcs":[[-1358,-6783,-9073,-8221,-9127,-890,-3395]],"id":"48297","properties":{"name":"Live Oak"}},{"type":"Polygon","arcs":[[-1332,9198,-822,-8520,-6031]],"id":"27121","properties":{"name":"Pope"}},{"type":"Polygon","arcs":[[9199,9200,-8036,-9025,9201]],"id":"39115","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[9202,-5224,-9096,-7401,-7957]],"id":"41027","properties":{"name":"Hood River"}},{"type":"Polygon","arcs":[[-273,-9152,9203,-7337,9204,-1907]],"id":"29167","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[9205,-2189,9206,-899,-1656]],"id":"48115","properties":{"name":"Dawson"}},{"type":"Polygon","arcs":[[-2304,-9030,-5189,-7324,-7277,-3131]],"id":"54061","properties":{"name":"Monongalia"}},{"type":"Polygon","arcs":[[-3085,-5923,-211,-3783,-2234]],"id":"48207","properties":{"name":"Haskell"}},{"type":"Polygon","arcs":[[-209,-2190,-9206,-1655,-471]],"id":"48445","properties":{"name":"Terry"}},{"type":"Polygon","arcs":[[-7261,-4551,-1063,-9186,-1045]],"id":"48009","properties":{"name":"Archer"}},{"type":"Polygon","arcs":[[-1307,-6329,-2667,-2390,-8955]],"id":"19195","properties":{"name":"Worth"}},{"type":"Polygon","arcs":[[-7671,-6521,-4496,-6888,-4617,-5519]],"id":"21001","properties":{"name":"Adair"}},{"type":"Polygon","arcs":[[-6295,-8996,-6115,-2223,9207,9208,9209]],"id":"08093","properties":{"name":"Park"}},{"type":"Polygon","arcs":[[-5896,9210,9211,-4967,-9196,-4873,-6634,-1351,9212]],"id":"45075","properties":{"name":"Orangeburg"}},{"type":"Polygon","arcs":[[9213,-6296,-9210,9214,-8296]],"id":"08065","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-8460,-8607,-5826,9215,-5207]],"id":"21089","properties":{"name":"Greenup"}},{"type":"Polygon","arcs":[[-9064,-7499,9216,9217,-8582,-3824,-8940]],"id":"13137","properties":{"name":"Habersham"}},{"type":"Polygon","arcs":[[-3404,-9026,-3785,-3792,-8967,-8409]],"id":"39163","properties":{"name":"Vinton"}},{"type":"Polygon","arcs":[[-8492,-92,-1736,-8845,-755]],"id":"39175","properties":{"name":"Wyandot"}},{"type":"Polygon","arcs":[[-4442,-7532,-8618,-4908,-6606,-8873,9218]],"id":"30003","properties":{"name":"Big Horn"}},{"type":"Polygon","arcs":[[-4317,-4062,-2373,-7702,9219]],"id":"28037","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-5785,9220],[9221]],"id":"51683","properties":{"name":"Manassas"}},{"type":"Polygon","arcs":[[-4539,-9035,-4127,9222,-5421,-7325]],"id":"47107","properties":{"name":"McMinn"}},{"type":"Polygon","arcs":[[9223,-426,-7850,-9129,9224,-877]],"id":"31117","properties":{"name":"McPherson"}},{"type":"Polygon","arcs":[[-6557,-7825,-7829,-6505]],"id":"40133","properties":{"name":"Seminole"}},{"type":"Polygon","arcs":[[-4792,-2252,-7692,9225,-5944,9226,-8807,-4547]],"id":"48213","properties":{"name":"Henderson"}},{"type":"Polygon","arcs":[[-8453,-8481,-8486,-5066,-5971,9227,-7436]],"id":"50001","properties":{"name":"Addison"}},{"type":"Polygon","arcs":[[9228,-9155,-8743,-8317,9229,9230,-3738]],"id":"31033","properties":{"name":"Cheyenne"}},{"type":"Polygon","arcs":[[9231,-285,-7300,9232,-4781,-4425,-6685]],"id":"47125","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[9233,9234,-4132,-6640,-1072,-662,-2885]],"id":"48035","properties":{"name":"Bosque"}},{"type":"Polygon","arcs":[[9235,-5312,-1399,-7705,-4029,-8936]],"id":"47181","properties":{"name":"Wayne"}},{"type":"Polygon","arcs":[[-6696,-3762,-6921,9236,9237,-4096,-4483]],"id":"45071","properties":{"name":"Newberry"}},{"type":"Polygon","arcs":[[-5646,-897,-8318,-7210,-3969]],"id":"48205","properties":{"name":"Hartley"}},{"type":"Polygon","arcs":[[-405,-4001,-1430,-4153,-6822]],"id":"55107","properties":{"name":"Rusk"}},{"type":"Polygon","arcs":[[-3258,9238,-6060,-8683,-6187,-5443]],"id":"28117","properties":{"name":"Prentiss"}},{"type":"Polygon","arcs":[[-2818,9239,-1783,-3462,-4572]],"id":"19035","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[-2949,-995,-6894,9240,9241,-9149]],"id":"20119","properties":{"name":"Meade"}},{"type":"Polygon","arcs":[[-3239,-503,-8806,-474,-1625,-1326]],"id":"48087","properties":{"name":"Collingsworth"}},{"type":"Polygon","arcs":[[-6813,-8256,-9153,-6792,-5255]],"id":"51135","properties":{"name":"Nottoway"}},{"type":"Polygon","arcs":[[-2497,9242,-9202,-9024,-3402,-8513]],"id":"39127","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-3534,-7427,-7553,-7814,-9114,-6070]],"id":"36053","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-2862,-5703,-5592,-8085,-8238]],"id":"18171","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[-8310,-816,-3080,-3356,-311]],"id":"27085","properties":{"name":"McLeod"}},{"type":"Polygon","arcs":[[-2413,9243,-9234,-2884]],"id":"48425","properties":{"name":"Somervell"}},{"type":"Polygon","arcs":[[-1815,-6434,-6438,-8703,-8430,-9184]],"id":"39021","properties":{"name":"Champaign"}},{"type":"MultiPolygon","arcs":[[[9244,-8196]],[[9245,9246,9247,-8194,9248,-8202]]],"id":"12086","properties":{"name":"Miami-Dade"}},{"type":"Polygon","arcs":[[-9103,-8916,-4562,-8212]],"id":"13165","properties":{"name":"Jenkins"}},{"type":"Polygon","arcs":[[-5692,9249,-371,-1732,9250,-6678]],"id":"40043","properties":{"name":"Dewey"}},{"type":"Polygon","arcs":[[-2277,9251,9252,-6772,-8825,-4527]],"id":"40085","properties":{"name":"Love"}},{"type":"Polygon","arcs":[[-4378,-5034,-8610,-6242,-3265]],"id":"13005","properties":{"name":"Bacon"}},{"type":"Polygon","arcs":[[-288,-9162,-3518]],"id":"23021","properties":{"name":"Piscataquis"}},{"type":"Polygon","arcs":[[9253,9254,-1864,-8713]],"id":"39085","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-5833,-8019,-8664,9255,-2646]],"id":"48089","properties":{"name":"Colorado"}},{"type":"Polygon","arcs":[[-5545,-5330,-6588,-5802]],"id":"21131","properties":{"name":"Leslie"}},{"type":"Polygon","arcs":[[-3815,-8261,-7876,-7916,-8960,9256]],"id":"06113","properties":{"name":"Yolo"}},{"type":"Polygon","arcs":[[-8852,9257,-7613,9258,-5146]],"id":"12007","properties":{"name":"Bradford"}},{"type":"Polygon","arcs":[[-8737,-4839,-2830,-2688,9259,-5484,-4689]],"id":"37119","properties":{"name":"Mecklenburg"}},{"type":"Polygon","arcs":[[-8545,-8827,-154,9260,-1119,-3000,-1193,-1803]],"id":"17113","properties":{"name":"McLean"}},{"type":"Polygon","arcs":[[-4165,-7958,-7399,-6513,9261]],"id":"41067","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-7130,-4209,-9040,-6305,-3283,-5439]],"id":"18021","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-8808,-9227,-5948,-6779,-913]],"id":"48161","properties":{"name":"Freestone"}},{"type":"Polygon","arcs":[[-7081,9262,-5431,9263,-8763,9264]],"id":"24003","properties":{"name":"Anne Arundel"}},{"type":"Polygon","arcs":[[-8532,-2785,-7724,-4853,-4887,-8745]],"id":"42083","properties":{"name":"McKean"}},{"type":"Polygon","arcs":[[-1645,-7276,-8687,-2634,9265,-3292]],"id":"29103","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[-2600,-6939,-3026,-5419]],"id":"19147","properties":{"name":"Palo Alto"}},{"type":"Polygon","arcs":[[-3293,-9266,-2638,-8511,-8185,-4877,9266]],"id":"29121","properties":{"name":"Macon"}},{"type":"Polygon","arcs":[[-2464,9267,-7996,-6969,9268,-3125]],"id":"28103","properties":{"name":"Noxubee"}},{"type":"Polygon","arcs":[[-6199,-6539,-2494,-7508,9269,-4060]],"id":"28077","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[-1807,-4196,-980,-8800,-8234,-8999,-8027,-8034]],"id":"08073","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-6174,-5204,9270,-2910,-694]],"id":"20077","properties":{"name":"Harper"}},{"type":"Polygon","arcs":[[-190,-6313,-1797,-734,-3161]],"id":"19171","properties":{"name":"Tama"}},{"type":"Polygon","arcs":[[-9085,-8727,-7993,-7994,-9268,-2463]],"id":"28087","properties":{"name":"Lowndes"}},{"type":"Polygon","arcs":[[-1547,-1908,-9205,-7340,9271,-3927]],"id":"29057","properties":{"name":"Dade"}},{"type":"Polygon","arcs":[[-2188,-2219,-9126,-428,-6529,-9207]],"id":"48033","properties":{"name":"Borden"}},{"type":"Polygon","arcs":[[-5420,-3029,-3419,-9240]],"id":"19021","properties":{"name":"Buena Vista"}},{"type":"Polygon","arcs":[[-5957,-1349,-5313,-9236,-8935,-4973]],"id":"47039","properties":{"name":"Decatur"}},{"type":"Polygon","arcs":[[-7104,-2903,-9115,-8715,-8762]],"id":"16027","properties":{"name":"Canyon"}},{"type":"Polygon","arcs":[[-4061,-9270,-7507,-8053,-2049]],"id":"28147","properties":{"name":"Walthall"}},{"type":"Polygon","arcs":[[-8691,-9102,-7944,-3494,-4707]],"id":"33005","properties":{"name":"Cheshire"}},{"type":"Polygon","arcs":[[-8788,-2323,-3294,-9267,-4876,-1530]],"id":"29115","properties":{"name":"Linn"}},{"type":"Polygon","arcs":[[-6679,-9251,-1735,-497,-3238,-2483]],"id":"40129","properties":{"name":"Roger Mills"}},{"type":"Polygon","arcs":[[9272,-5789,-7538,9273,-2694,-4409]],"id":"55111","properties":{"name":"Sauk"}},{"type":"Polygon","arcs":[[-8724,-7460,-8868,-7688,-7065,-3923,-9020,-3704]],"id":"22009","properties":{"name":"Avoyelles"}},{"type":"Polygon","arcs":[[-3928,-9272,-7339,-1476,-1627,9274,-1589]],"id":"29109","properties":{"name":"Lawrence"}},{"type":"Polygon","arcs":[[-1029,-7968,-3848,9275,-5164]],"id":"37127","properties":{"name":"Nash"}},{"type":"Polygon","arcs":[[-462,-5837,-1998,9276,-5975,-9098]],"id":"41069","properties":{"name":"Wheeler"}},{"type":"Polygon","arcs":[[-5208,-9216,-5825,-5106,9277,-7467]],"id":"21043","properties":{"name":"Carter"}},{"type":"Polygon","arcs":[[-5801,9278,-6358,-8556,-4842,-4768]],"id":"37115","properties":{"name":"Madison"}},{"type":"MultiPolygon","arcs":[[[-9222]],[[-3587,9279,9280,-8637,-7810],[-5786,-9221]]],"id":"51153","properties":{"name":"Prince William"}},{"type":"Polygon","arcs":[[-8089,-7893,9281,-8730]],"id":"34007","properties":{"name":"Camden"}},{"type":"Polygon","arcs":[[-9182,-655,-2552,9282]],"id":"38031","properties":{"name":"Foster"}},{"type":"Polygon","arcs":[[-6820,-6799,-5981,-9120,-6150,-1570,-6532]],"id":"51167","properties":{"name":"Russell"}},{"type":"MultiPolygon","arcs":[[[9283]],[[-8609,-4916,-7616,9284,-1606]]],"id":"26041","properties":{"name":"Delta"}},{"type":"Polygon","arcs":[[-6476,-4215,-7040,-4268,-7525,-4263,-6121,-66]],"id":"18175","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-4457,-7214,-4064,-5694,-2804]],"id":"35019","properties":{"name":"Guadalupe"}},{"type":"Polygon","arcs":[[-6170,-2708,-8824,-8943,-4301]],"id":"18029","properties":{"name":"Dearborn"}},{"type":"Polygon","arcs":[[-8822,-7051,-8869,9285,-8941]],"id":"21117","properties":{"name":"Kenton"}},{"type":"MultiPolygon","arcs":[[[-8954,-3484,-7070,9286,-4797]]],"id":"23015","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-8387,-7193,-3260,-5442,-7118]],"id":"28009","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[-96,-702,-3032,-3645,-8454,-5889]],"id":"19119","properties":{"name":"Lyon"}},{"type":"Polygon","arcs":[[-6806,9287,-5618,9288,-5152,9289]],"id":"21049","properties":{"name":"Clark"}},{"type":"Polygon","arcs":[[9290,9291,-5810,9292,-2686]],"id":"37167","properties":{"name":"Stanly"}},{"type":"Polygon","arcs":[[-8817,-5596,-9079,9293,9294]],"id":"47003","properties":{"name":"Bedford"}},{"type":"Polygon","arcs":[[-5236,-5726,-3226,-5253,-3624,9295]],"id":"51029","properties":{"name":"Buckingham"}},{"type":"Polygon","arcs":[[-9003,-8998,-7920,-3659,-7420]],"id":"05089","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-8223,-6042,-3709,-6050,-4416,-9087]],"id":"29003","properties":{"name":"Andrew"}},{"type":"Polygon","arcs":[[-2835,-8045,-3450,-8682,-7988,-4387,-7995]],"id":"01125","properties":{"name":"Tuscaloosa"}},{"type":"Polygon","arcs":[[-4971,-5799,-4766,-6451,-4850]],"id":"47063","properties":{"name":"Hamblen"}},{"type":"Polygon","arcs":[[-3633,-4525,-6024,9296,-5835,-5220,-9189]],"id":"53005","properties":{"name":"Benton"}},{"type":"Polygon","arcs":[[-8622,-4274,9297,-4607,-8330]],"id":"13191","properties":{"name":"McIntosh"}},{"type":"Polygon","arcs":[[-4665,-4817,-8033,-3074,-7673]],"id":"48109","properties":{"name":"Culberson"}},{"type":"Polygon","arcs":[[-1940,-8403,-9198,-5899,-8209,-8428]],"id":"13245","properties":{"name":"Richmond"}},{"type":"Polygon","arcs":[[-9173,-5708,-6686,-5958,-3313]],"id":"21035","properties":{"name":"Calloway"}},{"type":"Polygon","arcs":[[9298,-5399,-8633,-8732,-9100,-8689]],"id":"33013","properties":{"name":"Merrimack"}},{"type":"MultiPolygon","arcs":[[[-3976,9299]],[[9300,-6653]],[[-8768,9301,-6651]]],"id":"48167","properties":{"name":"Galveston"}},{"type":"Polygon","arcs":[[-8934,-9156,-9229,-3737,9302,-5560]],"id":"31007","properties":{"name":"Banner"}},{"type":"Polygon","arcs":[[-2400,-3190,-5938,-1879,-8562,-7777]],"id":"05053","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[9303,-5022,9304,-4299,9305,-5018]],"id":"34033","properties":{"name":"Salem"}},{"type":"Polygon","arcs":[[-6710,-9262,-6516,-7907,-8180,9306]],"id":"41057","properties":{"name":"Tillamook"}},{"type":"Polygon","arcs":[[-7437,-9228,-5973,-8389,-8736,-9018,9307]],"id":"36115","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[9308,-7197,-2744,-2139]],"id":"27077","properties":{"name":"Lake of the Woods"}},{"type":"Polygon","arcs":[[-7932,-6873,-1795,-975,-4195,-7970,-6112]],"id":"08001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[9309,-3816,-9257,-8959,-7629,-7413]],"id":"06033","properties":{"name":"Lake"}},{"type":"Polygon","arcs":[[-8572,-8621,-1943,-9121,-8804,9310]],"id":"13317","properties":{"name":"Wilkes"}},{"type":"Polygon","arcs":[[-4879,-8187,-6543,-1478,9311]],"id":"29089","properties":{"name":"Howard"}},{"type":"Polygon","arcs":[[-6518,9312,-4978,-3372,-204,-6713]],"id":"42011","properties":{"name":"Berks"}},{"type":"Polygon","arcs":[[9313,-5756,-5862,-7962,-3334]],"id":"47087","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-2908,-7846,-3250,-8631,-6603,-6796]],"id":"54007","properties":{"name":"Braxton"}},{"type":"Polygon","arcs":[[-6883,9314,-8273,-5211,-5733,-9122]],"id":"21161","properties":{"name":"Mason"}},{"type":"Polygon","arcs":[[9315,-8945,-7114,-8750,9316]],"id":"26021","properties":{"name":"Berrien"}},{"type":"Polygon","arcs":[[-9261,-153,-8239,-4923,-1120]],"id":"17019","properties":{"name":"Champaign"}},{"type":"Polygon","arcs":[[-4396,-7223,-9051,-5232,9317,-8440,-7440],[-6912],[-781]],"id":"51015","properties":{"name":"Augusta"}},{"type":"Polygon","arcs":[[-3194,-6220,-3667,-7029,9318,-9144,-5936]],"id":"05001","properties":{"name":"Arkansas"}},{"type":"Polygon","arcs":[[-8312,-8666,-2068,-8589,-8668,-7806]],"id":"13079","properties":{"name":"Crawford"}},{"type":"Polygon","arcs":[[-3287,-6386,-6306,-6166,-4674]],"id":"18027","properties":{"name":"Daviess"}},{"type":"MultiPolygon","arcs":[[[9319]],[[9320,-6896]],[[-4514,9321]],[[-6900,9322]]],"id":"37055","properties":{"name":"Dare"}},{"type":"Polygon","arcs":[[-3843,-3563,-9091,-7246]],"id":"30021","properties":{"name":"Dawson"}},{"type":"Polygon","arcs":[[-7900,-664,-1075,-1663,-5847,-6745]],"id":"48281","properties":{"name":"Lampasas"}},{"type":"Polygon","arcs":[[-7330,-5989,-1693,9323,-7582]],"id":"12123","properties":{"name":"Taylor"}},{"type":"Polygon","arcs":[[9324,-6877,-4201]],"id":"13047","properties":{"name":"Catoosa"}},{"type":"Polygon","arcs":[[-729,-6029,-6083,-479,-8859]],"id":"13067","properties":{"name":"Cobb"}},{"type":"MultiPolygon","arcs":[[[-4626,-7547,-4157]],[[-3921,-9060,-4623,-6480,-9021]]],"id":"22099","properties":{"name":"St. Martin"}},{"type":"Polygon","arcs":[[-7207,-3275,9325,-7510,-2312,-8267,-7227]],"id":"28135","properties":{"name":"Tallahatchie"}},{"type":"Polygon","arcs":[[-9151,-5882,-1528,-869,-7338,-9204]],"id":"29059","properties":{"name":"Dallas"}},{"type":"Polygon","arcs":[[-3847,-4069,-5073,-4462,-5165,-9276]],"id":"37195","properties":{"name":"Wilson"}},{"type":"Polygon","arcs":[[-1584,-5992,-364,-9181,9326,-8692]],"id":"38005","properties":{"name":"Benson"}},{"type":"Polygon","arcs":[[-9238,9327,9328,-9211,-5895,-4097]],"id":"45063","properties":{"name":"Lexington"}},{"type":"Polygon","arcs":[[-1676,-2693,-2780,-8371,-1840,-4182,-8947]],"id":"48137","properties":{"name":"Edwards"}},{"type":"Polygon","arcs":[[-4204,-3827,-4435,-4248]],"id":"13055","properties":{"name":"Chattooga"}},{"type":"Polygon","arcs":[[9329,-3375,-7022,9330,9331]],"id":"24025","properties":{"name":"Harford"}},{"type":"Polygon","arcs":[[-5811,-5631,-5712,-6622,-4983,-4089,-4975,-4868]],"id":"45069","properties":{"name":"Marlboro"}},{"type":"Polygon","arcs":[[-2918,-7488,-5429,-9172,-2969,-3100]],"id":"20161","properties":{"name":"Riley"}},{"type":"Polygon","arcs":[[-5620,-7120,-1563,-1276,-8944,9332]],"id":"26005","properties":{"name":"Allegan"}},{"type":"Polygon","arcs":[[-6541,-5124,-5244,-4894,-7462]],"id":"29051","properties":{"name":"Cole"}},{"type":"Polygon","arcs":[[-7594,-7650,9333,9334,-3746,-4084,-2640]],"id":"40143","properties":{"name":"Tulsa"}},{"type":"Polygon","arcs":[[-3597,-8137,-5969,-5155,-1857,9335]],"id":"48187","properties":{"name":"Guadalupe"}},{"type":"Polygon","arcs":[[-8399,-8928,9336,-8487,-8479,-2439]],"id":"50005","properties":{"name":"Caledonia"}},{"type":"Polygon","arcs":[[-5466,-1452,-9157,-3014,-7539]],"id":"55055","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-7843,9337,-5013,9338,9339]],"id":"42001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[-6177,-7530,-3268,-3278,-7910,-8388]],"id":"20105","properties":{"name":"Lincoln"}},{"type":"MultiPolygon","arcs":[[[-8821,9340]],[[9341]]],"id":"53029","properties":{"name":"Island"}},{"type":"Polygon","arcs":[[9342,-4779,-5855,-9099,-6340,-626,-5161,-6910]],"id":"31107","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[-8528,-7834,9343,-4420,-8931,-8112,-8850]],"id":"32019","properties":{"name":"Lyon"}},{"type":"Polygon","arcs":[[-7468,-9278,-5105,-9174]],"id":"21063","properties":{"name":"Elliott"}},{"type":"Polygon","arcs":[[-4501,-5154,-4477,-6587,-6353,9344]],"id":"21079","properties":{"name":"Garrard"}},{"type":"Polygon","arcs":[[-5544,-4929,-5613,-6530,-5332]],"id":"21133","properties":{"name":"Letcher"}},{"type":"Polygon","arcs":[[-2977,-4579,9345,-7042,-7147]],"id":"21223","properties":{"name":"Trimble"}},{"type":"Polygon","arcs":[[-4126,-5954,-7940,-7941,-5422,-9223]],"id":"47123","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-2282,-7750,-7812,-2290,-6752]],"id":"51113","properties":{"name":"Madison"}},{"type":"Polygon","arcs":[[-6945,-3324,-1315,-2680,-9160,-3088]],"id":"17027","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[-4604,9346,-9247,9347,-8619]],"id":"12011","properties":{"name":"Broward"}},{"type":"Polygon","arcs":[[-9150,-9242,9348,-6732,-3932]],"id":"20175","properties":{"name":"Seward"}},{"type":"Polygon","arcs":[[-7691,-8456,-6762,-9195,-6741,-5945,-9226]],"id":"48073","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[-9319,-7028,-3503,-7301,-2308,-9145]],"id":"05041","properties":{"name":"Desha"}},{"type":"Polygon","arcs":[[-9041,-3907,-4379,-8149,-8259,-7005]],"id":"16029","properties":{"name":"Caribou"}},{"type":"Polygon","arcs":[[-4464,-3729,-4122,-2335,-9146,-6553]],"id":"37061","properties":{"name":"Duplin"}},{"type":"Polygon","arcs":[[-7911,-3281,-8657,-6317,-6478,-6311]],"id":"20009","properties":{"name":"Barton"}},{"type":"Polygon","arcs":[[-1734,9349,-7588,-499]],"id":"40149","properties":{"name":"Washita"}},{"type":"Polygon","arcs":[[-6987,-6228,-6297,-9214,-8295,-1722]],"id":"08037","properties":{"name":"Eagle"}},{"type":"Polygon","arcs":[[-2006,-8543,-5675,-5672,-7405,-7902]],"id":"39099","properties":{"name":"Mahoning"}},{"type":"Polygon","arcs":[[-5037,9350,-8215,-7855,-7783,-4728]],"id":"01087","properties":{"name":"Macon"}},{"type":"Polygon","arcs":[[-8231,-1832,-6501,-1818,-2740,-451]],"id":"39107","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[-3586,-5269,-6006,-2986,-6005,-9143,9351,-9074,9352,-9280],[-9154]],"id":"51059","properties":{"name":"Fairfax"}},{"type":"Polygon","arcs":[[-8856,9353,-4148,-1402,-4000]],"id":"55085","properties":{"name":"Oneida"}},{"type":"Polygon","arcs":[[-8422,-2842,-1993,9354]],"id":"41061","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-5897,-9213,-1354,-5796,-8210]],"id":"45011","properties":{"name":"Barnwell"}},{"type":"Polygon","arcs":[[9355,-324,-8136,-5449]],"id":"49051","properties":{"name":"Wasatch"}},{"type":"MultiPolygon","arcs":[[[9356]],[[9357]],[[-6054,-8003,9358]],[[9359]]],"id":"26089","properties":{"name":"Leelanau"}},{"type":"Polygon","arcs":[[-7274,-9016,-8840,-3065,-5262,-8586,-8686]],"id":"17067","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[9360,-5732,-1489,9361,-1457]],"id":"51193","properties":{"name":"Westmoreland"}},{"type":"Polygon","arcs":[[-3458,-7344,-3856,-8216,-9351,-5036,-8008]],"id":"01123","properties":{"name":"Tallapoosa"}},{"type":"Polygon","arcs":[[-1671,-8356,-8574,9362,-9168]],"id":"13075","properties":{"name":"Cook"}},{"type":"MultiPolygon","arcs":[[[-5191,9363]],[[9364]]],"id":"26083","properties":{"name":"Keweenaw"}},{"type":"Polygon","arcs":[[-3126,-9269,-6968,-298,-1000]],"id":"28069","properties":{"name":"Kemper"}},{"type":"Polygon","arcs":[[-1035,-8364,-1828,-2080]],"id":"39125","properties":{"name":"Paulding"}},{"type":"Polygon","arcs":[[-5800,-1427,-7295,-4510,-6359,-9279]],"id":"47171","properties":{"name":"Unicoi"}},{"type":"Polygon","arcs":[[-8809,-4375,-8376,9365]],"id":"13209","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-9169,-9363,-8576,-7327,-7581,-7012]],"id":"13027","properties":{"name":"Brooks"}},{"type":"Polygon","arcs":[[-3739,-9231,9366,-2811,-2812,-977,-1794,-6872]],"id":"08075","properties":{"name":"Logan"}},{"type":"Polygon","arcs":[[-1737,-90,-6536,-904,-1860]],"id":"39117","properties":{"name":"Morrow"}},{"type":"Polygon","arcs":[[-8672,-1855,9367,-9200,-9243,-2496]],"id":"39119","properties":{"name":"Muskingum"}},{"type":"Polygon","arcs":[[-8493,-4695,9368,-6935]],"id":"13051","properties":{"name":"Chatham"}},{"type":"Polygon","arcs":[[-8671,-8675,-1777,-7016,9369,-8339]],"id":"13061","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-9230,-8316,-7123,-2808,-9367]],"id":"08115","properties":{"name":"Sedgwick"}},{"type":"Polygon","arcs":[[-3677,-7048,-8306,-8702,-1825,9370,-2889]],"id":"12105","properties":{"name":"Polk"}},{"type":"Polygon","arcs":[[9371,-9082,-8881,-7759,-2262,-4802]],"id":"48147","properties":{"name":"Fannin"}},{"type":"Polygon","arcs":[[-5950,-3316,-7335,-5891,-5817,-5505]],"id":"21105","properties":{"name":"Hickman"}},{"type":"Polygon","arcs":[[-8643,-8650,-7660,-4246,-7736,-8930]],"id":"01071","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-8578,-3406,-7852,-8214,9372]],"id":"13215","properties":{"name":"Muscogee"}},{"type":"Polygon","arcs":[[9373,-8908,-3838,-7955,-4041,-2793,-8362]],"id":"17195","properties":{"name":"Whiteside"}},{"type":"Polygon","arcs":[[9374,-8706,-8304,-2367,-7769]],"id":"12009","properties":{"name":"Brevard"}},{"type":"Polygon","arcs":[[-3221,-8912,-1673,-9167,-7665,-7663,-8950]],"id":"13321","properties":{"name":"Worth"}},{"type":"Polygon","arcs":[[-8611,-8331,-4610,-8969,-4992,-6244]],"id":"13025","properties":{"name":"Brantley"}},{"type":"Polygon","arcs":[[-1733,-369,-9004,-2241,-491,-7589,-9350]],"id":"40015","properties":{"name":"Caddo"}},{"type":"Polygon","arcs":[[9375,-9294,-9080,-8645,-8929,-7515,-1040]],"id":"47103","properties":{"name":"Lincoln"}},{"type":"Polygon","arcs":[[-6657,-4726,-3136,-7239,-8038,9376]],"id":"39111","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[9377,-4407,-7801,-8470]],"id":"55081","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-6137,-3735,-4691,-3759,-7528]],"id":"45021","properties":{"name":"Cherokee"}},{"type":"Polygon","arcs":[[-5281,-4990,-174,-8501,-4149,-9354,-8855]],"id":"55041","properties":{"name":"Forest"}},{"type":"Polygon","arcs":[[-763,-6807,-9290,-5151,-4499,9378]],"id":"21067","properties":{"name":"Fayette"}},{"type":"Polygon","arcs":[[-357,-3948,-6281,-6425,-9088,-7159]],"id":"36037","properties":{"name":"Genesee"}},{"type":"Polygon","arcs":[[9379,9380,9381,-6351,-8815]],"id":"21229","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-7967,9382,-6595,9383,-4070,-3845]],"id":"37117","properties":{"name":"Martin"}},{"type":"Polygon","arcs":[[-3201,-7527,-6734,-3849,-5645,-3967]],"id":"40025","properties":{"name":"Cimarron"}},{"type":"Polygon","arcs":[[-4986,-6076,-5048,-5842,-4091]],"id":"45067","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-834,-8146,-1761,-8795,-2730,-277,9384,-6365]],"id":"01039","properties":{"name":"Covington"}},{"type":"MultiPolygon","arcs":[[[9385]],[[9386]],[[-6979,-1937,-6927,9387,-6924]]],"id":"06037","properties":{"name":"Los Angeles"}},{"type":"Polygon","arcs":[[-8575,-6853,-7373,-7058,-7329]],"id":"12047","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[-6982,-8620,-9348,-9246,-8201,9388]],"id":"12021","properties":{"name":"Collier"}},{"type":"Polygon","arcs":[[-2754,-5990,-1270,-8747,-4786,9389,-6035]],"id":"20125","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-3073,-5991,-5328,-6955,-3883,-5716,-819]],"id":"17193","properties":{"name":"White"}},{"type":"Polygon","arcs":[[-466,-1590,-9275,-1630,-6972,-4036]],"id":"29009","properties":{"name":"Barry"}},{"type":"Polygon","arcs":[[-78,-8899,-7071,-1555,-6327,-8900]],"id":"26125","properties":{"name":"Oakland"}},{"type":"Polygon","arcs":[[-5368,-4411,-7365,-7732,-5175]],"id":"19005","properties":{"name":"Allamakee"}},{"type":"Polygon","arcs":[[-6036,-9390,-4790,9390,-9334,-7649]],"id":"40147","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[9391,-4372,-6255,-6544,-6078]],"id":"30005","properties":{"name":"Blaine"}},{"type":"Polygon","arcs":[[-5731,9392,-1491]],"id":"51103","properties":{"name":"Lancaster"}},{"type":"Polygon","arcs":[[-7111,-6245,-4995,-7323,-8993,-7614,-9258,-8851,-7374]],"id":"12003","properties":{"name":"Baker"}},{"type":"Polygon","arcs":[[-1208,-7794,-6406,-7458,-4641,-8956]],"id":"22127","properties":{"name":"Winn"}},{"type":"Polygon","arcs":[[-7473,-8818,-9295,-9376,-1039,-5338]],"id":"47117","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[-1458,-9362,-1493,9393,-9137,-5908,-5490]],"id":"51057","properties":{"name":"Essex"}},{"type":"Polygon","arcs":[[-453,-2739,-1157,-2928,-8652]],"id":"18135","properties":{"name":"Randolph"}},{"type":"Polygon","arcs":[[9394,-706,-8849,-8450]],"id":"30101","properties":{"name":"Toole"}},{"type":"Polygon","arcs":[[-3521,-8953,-5433,-5762,9395]],"id":"23007","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-1273,-1079,-5200,-2565,9396,-1561]],"id":"26045","properties":{"name":"Eaton"}},{"type":"Polygon","arcs":[[-8257,-1196,-9159,-2037,-6839,-2875,-5097,-5058]],"id":"17167","properties":{"name":"Sangamon"}},{"type":"Polygon","arcs":[[9397,-3913,9398,-8876]],"id":"25001","properties":{"name":"Barnstable"}},{"type":"Polygon","arcs":[[9399,-6633,-5252,-4337,-9053]],"id":"30091","properties":{"name":"Sheridan"}},{"type":"Polygon","arcs":[[-7213,-8263,-6687,-969,-7926,-8560,-4066]],"id":"35041","properties":{"name":"Roosevelt"}},{"type":"Polygon","arcs":[[-9271,-5203,-7169,-6558,-2911]],"id":"40053","properties":{"name":"Grant"}},{"type":"Polygon","arcs":[[-7842,9400,-3376,-9330,9401,-5014,-9338]],"id":"42133","properties":{"name":"York"}},{"type":"Polygon","arcs":[[-1701,-6157,-6373,-6908,-839,-8714]],"id":"13237","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[-9217,-7498,-8538,9402]],"id":"13257","properties":{"name":"Stephens"}},{"type":"Polygon","arcs":[[-9218,-9403,-8539,-1845,-8878,-8583]],"id":"13011","properties":{"name":"Banks"}},{"type":"Polygon","arcs":[[-5656,-9113,-1518,-3305,-6395,-2859,-8879]],"id":"18073","properties":{"name":"Jasper"}},{"type":"Polygon","arcs":[[-3271,-620,-4932,-8885,-8655,-3279]],"id":"20113","properties":{"name":"McPherson"}},{"type":"Polygon","arcs":[[-8882,-8617,-6185,-1324,9403,-3364]],"id":"27097","properties":{"name":"Morrison"}},{"type":"Polygon","arcs":[[-5008,-6895,-1030,-5168,-6856,-5344]],"id":"37183","properties":{"name":"Wake"}},{"type":"Polygon","arcs":[[-3507,-7229,-6339,-6903,-7523,-7302]],"id":"28151","properties":{"name":"Washington"}},{"type":"Polygon","arcs":[[-8919,-8909,-9374,-8361,-6956,-258,-2543]],"id":"19045","properties":{"name":"Clinton"}},{"type":"Polygon","arcs":[[-7438,-9308,-9017,-7561]],"id":"36113","properties":{"name":"Warren"}},{"type":"Polygon","arcs":[[-9027,-836,-6367,9404,-2561,-7984]],"id":"01099","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-5346,-6855,-6616]],"id":"37105","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[-9402,-9332,9405,-5432,-9263,-7080,-5015]],"id":"24005","properties":{"name":"Baltimore"}},{"type":"Polygon","arcs":[[-8649,-640,-769,9406,-4541,-7326,-6878,-9325,-4200,-7659]],"id":"47065","properties":{"name":"Hamilton"}},{"type":"Polygon","arcs":[[-137,9407,-9339,-5017,-7079,-5265,-3584]],"id":"24021","properties":{"name":"Frederick"}},{"type":"Polygon","arcs":[[-5534,-1496,-5180,-5195,-4235]],"id":"47097","properties":{"name":"Lauderdale"}},{"type":"Polygon","arcs":[[-7815,-7555,-46,-2738,-8782,-7838,-7550,-7741]],"id":"36025","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[-3987,-6152,-8896,-3460,-8007,-7904]],"id":"01121","properties":{"name":"Talladega"}},{"type":"Polygon","arcs":[[-1562,-9397,-2570,-2988,-1140,-1278]],"id":"26025","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[-8297,-9215,-9209,9408,-6231,-6844]],"id":"08015","properties":{"name":"Chaffee"}},{"type":"Polygon","arcs":[[-1122,-4925,9409,-8083,-9158]],"id":"17139","properties":{"name":"Moultrie"}},{"type":"Polygon","arcs":[[-8776,-6195,-7509,-9326,-3274,-7232]],"id":"28107","properties":{"name":"Panola"}},{"type":"Polygon","arcs":[[-8074,-8372,-5850,-1927]],"id":"30039","properties":{"name":"Granite"}},{"type":"Polygon","arcs":[[-9313,-6517,-4777,-8729,-6206,-4979]],"id":"42091","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-8014,-6676,-5650,9410,-5473,-4938,-5840]],"id":"42061","properties":{"name":"Huntingdon"}},{"type":"Polygon","arcs":[[-8017,-9055,-8769,-6649,-8662]],"id":"48157","properties":{"name":"Fort Bend"}},{"type":"Polygon","arcs":[[-5976,-9277,-1997,-4168,-6570]],"id":"41013","properties":{"name":"Crook"}},{"type":"Polygon","arcs":[[-7966,-8144,-6470,9411,-6596,-9383]],"id":"37015","properties":{"name":"Bertie"}},{"type":"Polygon","arcs":[[-8469,-2450,-9163,-5790,-9273,-4408,-9378]],"id":"55057","properties":{"name":"Juneau"}},{"type":"Polygon","arcs":[[-2276,-7601,-9081,9412,-9252]],"id":"40095","properties":{"name":"Marshall"}},{"type":"Polygon","arcs":[[-1660,-650,-7875,-7751,-7826,-4173]],"id":"48331","properties":{"name":"Milam"}},{"type":"Polygon","arcs":[[-6056,-4050,-2751,-1293,-541]],"id":"26165","properties":{"name":"Wexford"}},{"type":"Polygon","arcs":[[-8784,-5770,-9291,-2685,-2829]],"id":"37159","properties":{"name":"Rowan"}},{"type":"Polygon","arcs":[[-764,-9379,-4498,9413,9414,-2631]],"id":"21239","properties":{"name":"Woodford"}},{"type":"Polygon","arcs":[[-6892,-6997,-5689,-5690,-6677,9415]],"id":"40059","properties":{"name":"Harper"}},{"type":"Polygon","arcs":[[-793,-6706,-6672,-9013,-2651,-391]],"id":"55139","properties":{"name":"Winnebago"}},{"type":"Polygon","arcs":[[-4912,-9175,-281,-9232,-6684,-5706,-6347]],"id":"21047","properties":{"name":"Christian"}},{"type":"Polygon","arcs":[[-2983,-773,-8698,-2531,-5343,-1146]],"id":"37001","properties":{"name":"Alamance"}},{"type":"Polygon","arcs":[[-9289,-5617,-1260,-3688,-5153]],"id":"21065","properties":{"name":"Estill"}},{"type":"Polygon","arcs":[[-3756,-4837,-6440,-3349,-6063,-9029,-9170]],"id":"42129","properties":{"name":"Westmoreland"}},{"type":"Polygon","arcs":[[-5966,-4880,-9312,-1477,-1921,-5239]],"id":"29195","properties":{"name":"Saline"}},{"type":"Polygon","arcs":[[9416,-713,-8630,-5472,-885,-562,-4754]],"id":"46037","properties":{"name":"Day"}},{"type":"Polygon","arcs":[[9417,-7417,-3598,-9336,-1856,-1355,-6048]],"id":"48029","properties":{"name":"Bexar"}},{"type":"Polygon","arcs":[[-1682,-8442,-4557,-7818,-7827,-7712,-7386,9418]],"id":"51019","properties":{"name":"Bedford"}},{"type":"Polygon","arcs":[[-8626,-8888,-6664,-8270,-9315,-6882]],"id":"39015","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[-9297,-6023,-9177,-8423,-9355,-1992,-5836]],"id":"41059","properties":{"name":"Umatilla"}},{"type":"Polygon","arcs":[[-399,-5741,-9033,-8891,-5813]],"id":"47129","properties":{"name":"Morgan"}},{"type":"Polygon","arcs":[[-8041,-1683,-9419,-7385,-7242,-4519],[-7353,-2789]],"id":"51161","properties":{"name":"Roanoke"}},{"type":"Polygon","arcs":[[-8601,-8639]],"id":"51630","properties":{"name":"Fredericksburg"}},{"type":"Polygon","arcs":[[-8348,-1666,-5591,-5085,-691,9419,-8281]],"id":"53063","properties":{"name":"Spokane"}},{"type":"Polygon","arcs":[[-8039,-7240,-7237,-7282]],"id":"54073","properties":{"name":"Pleasants"}},{"type":"Polygon","arcs":[[-9349,-9241,-6893,-9416,-6680,-1164,-5872,-6733]],"id":"40007","properties":{"name":"Beaver"}},{"type":"Polygon","arcs":[[-3769,-6590,9420,-2574,-4848,-8235,-6271]],"id":"47025","properties":{"name":"Claiborne"}},{"type":"Polygon","arcs":[[-1180,-5875,-5012,-4716,-6062,-4594,-6221,-5523]],"id":"04001","properties":{"name":"Apache"}},{"type":"Polygon","arcs":[[-8829,-185,-8579,-9373,-8213,-3854]],"id":"13145","properties":{"name":"Harris"}},{"type":"Polygon","arcs":[[-7519,-7576,-9084,-9008,-7571,-7578]],"id":"12077","properties":{"name":"Liberty"}},{"type":"Polygon","arcs":[[-8131,-7758,9421,9422]],"id":"28045","properties":{"name":"Hancock"}},{"type":"Polygon","arcs":[[9423,-4682,-7466,-8542,-1865,-9255]],"id":"39007","properties":{"name":"Ashtabula"}},{"type":"Polygon","arcs":[[-2102,-6293,-3812,-9310,-7412]],"id":"06021","properties":{"name":"Glenn"}},{"type":"Polygon","arcs":[[-8746,-7095,-8380,-8748,-8842,9424,-4788]],"id":"40035","properties":{"name":"Craig"}},{"type":"Polygon","arcs":[[-6993,-8540,-7171,-5074,-8165]],"id":"17087","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-7089,-9194,-4961,-6947,-8333,-3710,-1247]],"id":"29183","properties":{"name":"St. Charles"}},{"type":"Polygon","arcs":[[9425,-2756,-6038,-7648,-7166,-5201]],"id":"20035","properties":{"name":"Cowley"}},{"type":"Polygon","arcs":[[-7304,-3692,-7269,-7971]],"id":"22123","properties":{"name":"West Carroll"}},{"type":"Polygon","arcs":[[9426,-9118,-2112,-8478,-9037,-6738,-5750,-4075]],"id":"38029","properties":{"name":"Emmons"}},{"type":"Polygon","arcs":[[-6416,9427,-8445,-8168,-8603]],"id":"29181","properties":{"name":"Ripley"}},{"type":"Polygon","arcs":[[-8721,-175,-1242,9428,-8914]],"id":"06087","properties":{"name":"Santa Cruz"}},{"type":"Polygon","arcs":[[-4257,-3863,-2873,-7411,9429]],"id":"06023","properties":{"name":"Humboldt"}},{"type":"Polygon","arcs":[[-8476,-308,9430,-2378,-6449,-9038]],"id":"46089","properties":{"name":"McPherson"}},{"type":"Polygon","arcs":[[-1055,-8282,-9420,-690,-8303,-7478,9431,-3452,-9176,-4522]],"id":"53075","properties":{"name":"Whitman"}},{"type":"Polygon","arcs":[[9432,-8349,-8279,-3980]],"id":"53019","properties":{"name":"Ferry"}},{"type":"Polygon","arcs":[[-6379,-167,-8951,-7661,-1779,-8674]],"id":"13273","properties":{"name":"Terrell"}},{"type":"Polygon","arcs":[[-608,-1849,-8573,-9311,-8803,-6154,-8667]],"id":"13221","properties":{"name":"Oglethorpe"}},{"type":"Polygon","arcs":[[-8050,-4443,-9219,-8872,-1436,-9057]],"id":"30009","properties":{"name":"Carbon"}},{"type":"Polygon","arcs":[[-5495,-5561,-9303,-3741,-6871,-8009,-5229]],"id":"56021","properties":{"name":"Laramie"}},{"type":"Polygon","arcs":[[-612,-1523,-3682,-74,-6475,-6848]],"id":"18005","properties":{"name":"Bartholomew"}},{"type":"Polygon","arcs":[[-8942,-9286,-8870,-6453,-760,-6592,-6614]],"id":"21081","properties":{"name":"Grant"}},{"type":"MultiPolygon","arcs":[[[9433]],[[-9193,9434,-8555,-4079,-3067]]],"id":"39043","properties":{"name":"Erie"}},{"type":"Polygon","arcs":[[9435,-9414,-4502,-9345,-6352,-9382]],"id":"21167","properties":{"name":"Mercer"}},{"type":"Polygon","arcs":[[-7199,-7203,-2018,-8474,-956,-33]],"id":"27027","properties":{"name":"Clay"}},{"type":"Polygon","arcs":[[-5768,-6565,-5614,-9288,-6805]],"id":"21173","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-5769,-1149,-6619,-5628,-9292]],"id":"37123","properties":{"name":"Montgomery"}},{"type":"Polygon","arcs":[[-8962,9436,-7378,-8651,-8593,-813,-8309]],"id":"27053","properties":{"name":"Hennepin"}},{"type":"Polygon","arcs":[[-4107,-6265,-1286,-4910,-6346,-5806]],"id":"21233","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[9437,-9317,-8751,-1514,-9112]],"id":"18091","properties":{"name":"LaPorte"}},{"type":"Polygon","arcs":[[-2579,-6133,9438,-2406,-1267]],"id":"20011","properties":{"name":"Bourbon"}},{"type":"Polygon","arcs":[[-9260,-2687,-9293,-5809,-4872,-5485]],"id":"37179","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-7922,9439,-4512,-8100]],"id":"51810","properties":{"name":"Virginia Beach"}},{"type":"Polygon","arcs":[[-8503,9440,-6838,-827,-6669,-6705,-8889]],"id":"55009","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[-9409,-9208,-2222,-8035,-3114,-8029,-6232]],"id":"08043","properties":{"name":"Fremont"}},{"type":"Polygon","arcs":[[9441,-9178,-7681,-6200,-7706,-7606]],"id":"28067","properties":{"name":"Jones"}},{"type":"Polygon","arcs":[[-3128,-1900,-353,-7143,-7483,-4657,-9139]],"id":"31181","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[-8101,-4516,9442,-7808,-7797,-8025]],"id":"37029","properties":{"name":"Camden"}},{"type":"Polygon","arcs":[[-9185,-8094,-4549,-4128,-9235,-9244,-2412]],"id":"48251","properties":{"name":"Johnson"}},{"type":"Polygon","arcs":[[-1724,-8298,-6842,-6117,-2043,-8848]],"id":"08077","properties":{"name":"Mesa"}},{"type":"Polygon","arcs":[[-5744,-6545,-5483,-4472,-1913]],"id":"30013","properties":{"name":"Cascade"}},{"type":"Polygon","arcs":[[-4933,-618,-1071,-338,-2757,-9426,-4576]],"id":"20015","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[-6260,-5071,-5698,-8640,-1709,-8902]],"id":"38025","properties":{"name":"Dunn"}},{"type":"Polygon","arcs":[[-5355,-4186,-325,-9356,-5448,-8192]],"id":"49035","properties":{"name":"Salt Lake"}},{"type":"Polygon","arcs":[[-6774,9443,-4805,-8386,-8092,-226]],"id":"48121","properties":{"name":"Denton"}},{"type":"Polygon","arcs":[[-2121,-4543,-115,-659,-1367,-4780,-9343,-6909,-584]],"id":"46023","properties":{"name":"Charles Mix"}},{"type":"Polygon","arcs":[[-9318,-5237,-9296,-3623,-4554,-8441]],"id":"51125","properties":{"name":"Nelson"}},{"type":"Polygon","arcs":[[-8693,-9327,-9183,-9283,-2551,-9117,-8779]],"id":"38103","properties":{"name":"Wells"}},{"type":"Polygon","arcs":[[-1744,-9116,-1116,-8546,-1801,-3942]],"id":"17143","properties":{"name":"Peoria"}},{"type":"Polygon","arcs":[[-6208,-8731,-9282,-7897,-4295,-9305,-5021]],"id":"34015","properties":{"name":"Gloucester"}},{"type":"Polygon","arcs":[[-623,-5531,-5497,-7379,-9437,-8961]],"id":"27003","properties":{"name":"Anoka"}},{"type":"Polygon","arcs":[[-307,-7475,-714,-9417,-4753,-7704,-2379,-9431]],"id":"46013","properties":{"name":"Brown"}},{"type":"Polygon","arcs":[[-5687,-2913,-6562,-1334,-366,-9250,-5691]],"id":"40093","properties":{"name":"Major"}},{"type":"Polygon","arcs":[[-887,-5471,-5130,-7781,-3500,-9072,-9197]],"id":"46039","properties":{"name":"Deuel"}},{"type":"Polygon","arcs":[[-1944,9444]],"id":"02230","properties":{"name":"Skagway"}},{"type":"Polygon","arcs":[[-1572,-6149,-5933,-6148,-4530,-7293,-1425,-4969]],"id":"47163","properties":{"name":"Sullivan"}},{"type":"Polygon","arcs":[[-6267,-5325,9445]],"id":"44001","properties":{"name":"Bristol"}},{"type":"Polygon","arcs":[[-8236,-4852,-6452,-5384,-5951,-4124,-9034,-5739]],"id":"47093","properties":{"name":"Knox"}},{"type":"Polygon","arcs":[[-8510,-785,-1424,-5231,-434,-6986,-8258,-5780]],"id":"56007","properties":{"name":"Carbon"}},{"type":"Polygon","arcs":[[-5414,-6714,-206,-3371,-9401,-7841,-8443]],"id":"42043","properties":{"name":"Dauphin"}},{"type":"Polygon","arcs":[[-7370]],"id":"51580","properties":{"name":"Covington"}},{"type":"Polygon","arcs":[[-2695,-9274,-7541,-8524,-8516,-7682]],"id":"55049","properties":{"name":"Iowa"}},{"type":"Polygon","arcs":[[-6726,-8895,-6723,-8894,-766,-638,-5605]],"id":"47175","properties":{"name":"Van Buren"}},{"type":"Polygon","arcs":[[-2778,-7418,-9418,-6047,-1842,-8370]],"id":"48019","properties":{"name":"Bandera"}},{"type":"Polygon","arcs":[[-8794,-9065,-3669,-2732]],"id":"12059","properties":{"name":"Holmes"}},{"type":"Polygon","arcs":[[-5222,-464,-9097]],"id":"41055","properties":{"name":"Sherman"}},{"type":"Polygon","arcs":[[-8340,-9370,-7015,-8796,-8155]],"id":"01067","properties":{"name":"Henry"}},{"type":"Polygon","arcs":[[-8552,-8119,-5402,-7226,-5393,-7628,-8515]],"id":"05139","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-7718,-8049,-6819,-9050,-7221,-8400]],"id":"54031","properties":{"name":"Hardy"}},{"type":"Polygon","arcs":[[-8938,-5759,9446,-7954,-4221,-5003,-1050,-8864]],"id":"22017","properties":{"name":"Caddo"}},{"type":"Polygon","arcs":[[-2475,-7361,-6960,-3860]],"id":"41029","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-6959,-3954,-7831,-8299,-529,-3862]],"id":"06049","properties":{"name":"Modoc"}},{"type":"Polygon","arcs":[[-7192,-5271,-8937,-6061,-9239,-3257]],"id":"28003","properties":{"name":"Alcorn"}},{"type":"Polygon","arcs":[[-9000,-8302,-3197,-6943,-2213]],"id":"08011","properties":{"name":"Bent"}},{"type":"Polygon","arcs":[[-7456,-6849,-6477,-64,-3285,-6304]],"id":"18105","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-8130,-9069,9447,-3888]],"id":"21029","properties":{"name":"Bullitt"}},{"type":"Polygon","arcs":[[-1854,-6658,-9377,-8037,-9201,-9368]],"id":"39121","properties":{"name":"Noble"}},{"type":"Polygon","arcs":[[-4117,-2632,-9415,-9436,-9381,9448,-9067]],"id":"21005","properties":{"name":"Anderson"}},{"type":"Polygon","arcs":[[-9448,-9068,-9449,-9380,-8814,-5568,-3889]],"id":"21179","properties":{"name":"Nelson"}},{"type":"Polygon","arcs":[[-6769,-5140,-9188,-4188,-5357]],"id":"49057","properties":{"name":"Weber"}},{"type":"Polygon","arcs":[[-6757,-5928,-1182,-682,-3,-7762]],"id":"49025","properties":{"name":"Kane"}},{"type":"Polygon","arcs":[[-3180,-8775,-7892,-7953,-9447,-5758,-5548]],"id":"05091","properties":{"name":"Miller"}},{"type":"Polygon","arcs":[[-6920,-7357,-5729,9449,-9328,-9237]],"id":"45079","properties":{"name":"Richland"}},{"type":"Polygon","arcs":[[-9259,-7612,-8248,-2362,-7767,9450,-5147]],"id":"12107","properties":{"name":"Putnam"}},{"type":"Polygon","arcs":[[9451,-5714,-8541,-6991,-7086,-9133]],"id":"17077","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-9384,-6600,-6902,9452,-6593,-3778,-4071]],"id":"37013","properties":{"name":"Beaufort"}},{"type":"Polygon","arcs":[[-330,-6428,-7772,9453]],"id":"36123","properties":{"name":"Yates"}},{"type":"Polygon","arcs":[[-7858,-3321,-5757,-9314,-3333,-1170,-5624]],"id":"47111","properties":{"name":"Macon"}},{"type":"Polygon","arcs":[[-4183,-929,-5350,-8660,9454]],"id":"48323","properties":{"name":"Maverick"}},{"type":"Polygon","arcs":[[-958,-8475,-6482,-6034,-7097,-8629]],"id":"27155","properties":{"name":"Traverse"}},{"type":"Polygon","arcs":[[-8485,-8527,-9012,-4421,-9344,-7833]],"id":"32001","properties":{"name":"Churchill"}},{"type":"Polygon","arcs":[[-4906,-5554,-8530,-1419,-5638,-6607]],"id":"56005","properties":{"name":"Campbell"}},{"type":"Polygon","arcs":[[-7513,-7711,-9190,-5225,-9203,-7956,-5371]],"id":"53059","properties":{"name":"Skamania"}},{"type":"Polygon","arcs":[[-1889,-2372,-8414,-8568,-3381,-8911,-3219]],"id":"13315","properties":{"name":"Wilcox"}},{"type":"Polygon","arcs":[[-8893,-9036,-4537,-9407,-768]],"id":"47143","properties":{"name":"Rhea"}},{"type":"Polygon","arcs":[[-1263,-6345,-5352,-4931,-5543,-3646]],"id":"21025","properties":{"name":"Breathitt"}},{"type":"Polygon","arcs":[[-6132,-7142,-275,-1906,-1545,-2407,-9439]],"id":"29217","properties":{"name":"Vernon"}},{"type":"Polygon","arcs":[[-9405,-6366,-9385,-276,-7652,-9092,-2562]],"id":"01053","properties":{"name":"Escambia"}},{"type":"Polygon","arcs":[[-5148,-9451,-7770,-7045,-3675,-7521,-7108]],"id":"12083","properties":{"name":"Marion"}},{"type":"Polygon","arcs":[[-9432,-7482,-8421,-3453]],"id":"53003","properties":{"name":"Asotin"}},{"type":"Polygon","arcs":[[-9061,-8740,-8434,-8446,-9428,-6415]],"id":"29023","properties":{"name":"Butler"}},{"type":"Polygon","arcs":[[-7087,-6996,-8904,-5913,-8739,-6410]],"id":"29031","properties":{"name":"Cape Girardeau"}},{"type":"Polygon","arcs":[[-5334,-6533,-1575,-2571,-9421,-6589]],"id":"51105","properties":{"name":"Lee"}},{"type":"Polygon","arcs":[[-2849,-9066,-2287,-7738,-9031,-8043]],"id":"01043","properties":{"name":"Cullman"}},{"type":"Polygon","arcs":[[-4924,-3342,-7201,-3248,-8084,-9410]],"id":"17029","properties":{"name":"Coles"}},{"type":"Polygon","arcs":[[-9128,-7309,-2430,-5701,-6394]],"id":"18015","properties":{"name":"Carroll"}},{"type":"MultiPolygon","arcs":[[[9455]],[[-7981,-7003,9456,-7863]]],"id":"22075","properties":{"name":"Plaquemines"}},{"type":"Polygon","arcs":[[-5582,-427,-9224,-876,-8957]],"id":"31091","properties":{"name":"Hooker"}},{"type":"Polygon","arcs":[[-5069,-8781,-9119,-9427,-4074,-4013]],"id":"38015","properties":{"name":"Burleigh"}},{"type":"Polygon","arcs":[[-5456,-3799,-7369,-8042,-7371]],"id":"54063","properties":{"name":"Monroe"}},{"type":"Polygon","arcs":[[-7299,-8012,-7470,-4782,-9233]],"id":"47021","properties":{"name":"Cheatham"}},{"type":"Polygon","arcs":[[-6860,-7569,-5660,-9077,-6715,-6580,-7133]],"id":"42015","properties":{"name":"Bradford"}},{"type":"Polygon","arcs":[[-9346,-4581,-4120,-8128,-7043]],"id":"21185","properties":{"name":"Oldham"}},{"type":"Polygon","arcs":[[-6975,-7421,-3662,-2143,-9005,-7564]],"id":"05101","properties":{"name":"Newton"}},{"type":"Polygon","arcs":[[-8488,-9337,-8927,-1579,-7352,-5400,-9299,-8688,-5062]],"id":"33009","properties":{"name":"Grafton"}},{"type":"Polygon","arcs":[[-6670,-830,9457,-5373,-9134,-9014]],"id":"55117","properties":{"name":"Sheboygan"}},{"type":"Polygon","arcs":[[-2821,-9179,-9442,-7605,-6537,-6484]],"id":"28129","properties":{"name":"Smith"}},{"type":"Polygon","arcs":[[-8055,-8132,-9423,9458,-7979,-7861,-9032,-12]],"id":"22103","properties":{"name":"St. Tammany"}},{"type":"Polygon","arcs":[[-9142,-9135,-5267,-7082,-9265,-8766,-9075,-9352]],"id":"24033","properties":{"name":"Prince George's"}},{"type":"Polygon","arcs":[[-1331,-3365,-9404,-1323,-8963,-8307,-309,-823,-9199]],"id":"27145","properties":{"name":"Stearns"}},{"type":"Polygon","arcs":[[-9101,-7292,-3488,-5563,-3486,-5564,-7946]],"id":"25017","properties":{"name":"Middlesex"}},{"type":"Polygon","arcs":[[-5474,-9411,-5649,-8444,-7844,-9340,-9408,-136]],"id":"42055","properties":{"name":"Franklin"}},{"type":"Polygon","arcs":[[-9161,-2664,-5715,-9452,-9132]],"id":"17145","properties":{"name":"Perry"}},{"type":"Polygon","arcs":[[-5245,-4231,-1249,-3714,-7780,-4819,-5243]],"id":"29073","properties":{"name":"Gasconade"}},{"type":"Polygon","arcs":[[-1160,-8363,-7949,-2706,-9180]],"id":"18161","properties":{"name":"Union"}},{"type":"Polygon","arcs":[[-8334,-8294,-8634,-8811,-2853,-3712]],"id":"29099","properties":{"name":"Jefferson"}},{"type":"Polygon","arcs":[[-9391,-4789,-9425,-8843,-3742,-9335]],"id":"40131","properties":{"name":"Rogers"}},{"type":"Polygon","arcs":[[-9450,-5728,-4968,-9212,-9329]],"id":"45017","properties":{"name":"Calhoun"}},{"type":"Polygon","arcs":[[-3788,-7283,-6702,-7676,-7449,-8676,9459]],"id":"54035","properties":{"name":"Jackson"}},{"type":"Polygon","arcs":[[-2647,-9256,-8663,-5917,-4429,-8624]],"id":"48239","properties":{"name":"Jackson"}},{"type":"MultiPolygon","arcs":[[[-598,-8284,9460]]],"id":"53035","properties":{"name":"Kitsap"}},{"type":"Polygon","arcs":[[-2890,-9371,-8830,9461,-7586]],"id":"12057","properties":{"name":"Hillsborough"}},{"type":"Polygon","arcs":[[-8099,-9011,-1510,-4661]],"id":"17043","properties":{"name":"DuPage"}},{"type":"Polygon","arcs":[[-8680,-4701,-7869,-7153,-8324,-8921]],"id":"34031","properties":{"name":"Passaic"}},{"type":"Polygon","arcs":[[-9253,-9413,-9083,-9372,-4801,-9444,-6773]],"id":"48181","properties":{"name":"Grayson"}},{"type":"Polygon","arcs":[[-4566,-9366,-8375,-9094]],"id":"13283","properties":{"name":"Treutlen"}},{"type":"Polygon","arcs":[[-420,-85,-9086,-2461,-8857,-2952,-2314]],"id":"28155","properties":{"name":"Webster"}},{"type":"Polygon","arcs":[[-8742,-878,-9225,-9130,-7121,-8315]],"id":"31101","properties":{"name":"Keith"}},{"type":"Polygon","arcs":[[-7699,-4318,-9220,-7701,-7686]],"id":"28001","properties":{"name":"Adams"}},{"type":"Polygon","arcs":[[-3946,-717,-331,-9454,-7771,-6282]],"id":"36069","properties":{"name":"Ontario"}},{"type":"Polygon","arcs":[[-3789,-9460,-8678,-6286,-3793]],"id":"54053","properties":{"name":"Mason"}},{"type":"Polygon","arcs":[[-686,-3657,-6165,-2937,-5]],"id":"04025","properties":{"name":"Yavapai"}}]},"states":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","arcs":[[[-1181,-1180,-5875,-5012,-4716,-6062,4594,-3582,4595,-4710,6914,248,4591,5526,5524,2939,2935,-1934,6,7,0,1,2,681,682]]],"id":"04","properties":{"name":"Arizona"}},{"type":"MultiPolygon","arcs":[[[-8132,-9423,9458,7979,7001,9456,7863,8064,8177,8061,8178,4159,4626,3698,3894,3895,-3616,-3615,5341,-8802,6323,5513,5514,5515,5005,-1051,-1050,-8864,-8938,-5759,9446,7952,-7891,5272,5273,7626,7627,5392,-7225,-7305,-7304,3692,3693,-3523,-3522,-3530,-3529,-3528,7697,-4319,7698,7685,7686,7060,7052,-2376,-2375,8,9,-2050,8052,-7506,8053]],[[4627]],[[6999]],[[7000]],[[8059]],[[8175]],[[8176]],[[9455]]],"id":"22","properties":{"name":"Louisiana"}},{"type":"MultiPolygon","arcs":[[[8716,-6573,8717,-8762,7104,-8761,-2845,-2844,8124,3107,7480,7481,7477,8302,689,690,5084,5590,-1665,1190,1187,1188,-5143,-2230,-2229,4001,-5784,8058,3105,-1930,-1929,-1467,-1466,-1465,5573,-5308,5574,-6106,3904,3905,-4379,-4385,8146,-5138,3875,3876,3208,3209,7897]]],"id":"16","properties":{"name":"Idaho"}},{"type":"MultiPolygon","arcs":[[[5042,5040,2137,9308,7194,2762,3948,3416,3949,2764,2765,1689,-7618,-7536,5528,5529,5498,5499,-5480,-5479,-5478,-6093,-6092,-6730,-6729,-8958,-7802,5366,-4412,5367,-5174,-5173,-440,-439,-2665,6328,1306,1307,5540,5541,2621,-2598,-2597,5446,-3643,3030,3031,701,-95,1454,3501,3499,7780,5129,5130,-5470,7098,-8629,-958,-957,-956,-33,-32,-5935,27,28,-6205,-4145,-5885]]],"id":"27","properties":{"name":"Minnesota"}},{"type":"MultiPolygon","arcs":[[[31,32,955,956,957,958,-711,7474,306,307,8475,8476,-9037,-6738,5750,-6737,-3591,-6698,-6697,-6014,676,-6013,-3566,-3565,-3842,-4338,5251,6632,6630,9109,455,2075,3108,1580,2601,5883,-5043,5884,4144,6204,-29,-28,5934]]],"id":"38","properties":{"name":"North Dakota"}},{"type":"MultiPolygon","arcs":[[[1367,-6053,-6015,6696,6697,3590,6736,-5751,6737,9036,-8477,-8476,-308,-307,-7475,710,-959,8628,-7099,5469,-5131,-5130,-7781,-3500,-3502,-1455,94,95,5888,5889,4757,-4573,-3466,4758,4759,4858,4859,5853,5854,4778,-9343,-6909,584,585,6753,3043,315,-5580,-8496,-2470,2421,2422,2423,4349,4350,4747,39,40,1371]]],"id":"46","properties":{"name":"South Dakota"}},{"type":"MultiPolygon","arcs":[[[-7549,-7567,6858,6859,7132,-6579,-6578,-7722,2783,2784,8531,8532,8598,-4679,8596,9088,7160,354,3944,714,9061,3536,6128,4313,7693,8437,-8022,8438,7434,7435,-9228,-5973,-8389,-8390,-5115,-5121,-5120,-8791,-7870,7866,7154,7155,8843,8695,3561,6125,3559,8696,8518,4308,4303,4304,-7150,-7149,-7148,7868,4700,4701,4702,-6609,-7551,-7550]],[[6123]],[[6124]],[[6126]],[[6129]],[[8776,-8507,8777,-7216]]],"id":"36","properties":{"name":"New York"}},{"type":"MultiPolygon","arcs":[[[8463,1946,1386,8229,1985,8988,8853,8772,8990,1971,1978,1961,1973,719,1974,6161,4742,6163,4744,484,9123,1706,3424,2295,2668,1983,8228,1384,1947,9444,1944,8461,1373,1593,48,8226,3032,8227,50,1594,1375,8462,1377]],[[51]],[[52]],[[1379,8460]],[[1382,3051]],[[1591,3038]],[[1953]],[[1954]],[[1955]],[[1956]],[[1957]],[[1958]],[[1959]],[[1962]],[[1963]],[[1964]],[[1965]],[[1966]],[[1967]],[[1968]],[[1969]],[[1979]],[[1980]],[[3034]],[[3035]],[[3036]],[[3037]],[[3039,3049]],[[3050]],[[4745]],[[4746]],[[6162]],[[8224]],[[8225]],[[8969]],[[8970]],[[8971]],[[8972]],[[8973]],[[8974]],[[8975]],[[8976]],[[8977]],[[8978]],[[8979]],[[8980]],[[8981]],[[8982]],[[8983]],[[8984]],[[8985]],[[8986]],[[8987]],[[8989]],[[9122]],[[9124]]],"id":"02","properties":{"name":"Alaska"}},{"type":"MultiPolygon","arcs":[[[3830,-4435,-4248,4204,-4247,7659,7657,7658,4199,9324,6877,6878,3867,3868,2023,2024,-7942,-7494,-7493,-7492,-7430,-7500,-7499,-7498,-7497,6298,-4347,-4346,-5828,-5723,-5722,-5721,8401,-9198,-5899,-5898,8209,-5798,-5797,-5301,-5300,-4696,-4695,9368,6935,4272,9297,4607,8967,-7320,4993,4994,6244,7110,7111,6851,6852,8574,-7328,-7327,-7581,7012,7013,2009,2010,804,805,7666,7667,7018,7014,9369,-8339,-8338,-8337,-7853,3409,-7852,-8214,-8213,-3854,-3853,-7343,3415,-7342,-8897,56,5578,-4436]]],"id":"13","properties":{"name":"Georgia"}},{"type":"MultiPolygon","arcs":[[[5436,7130,-3340,-3339,8085,-8238,2862,2856,-8710,-8122,5657,5651,5652,5653,9110,9437,-9317,8749,-7116,5089,-2658,2537,-1143,-1142,-2992,-6647,-6646,-1037,-1036,2079,-1834,-1833,8230,450,451,-2739,1157,1158,-8363,-7949,2706,-8824,-8943,4301,7133,-6615,-2973,-2978,7146,7041,7042,7043,4269,7525,-3886,-6586,4264,4670,-4101,-4488,-4487,-6999,-6998,-6263,-6262,3879,3880,3881,3882,6954,-5327,4676,-4630,4671,5439]]],"id":"18","properties":{"name":"Indiana"}},{"type":"MultiPolygon","arcs":[[[7022,8897,7072,8070,-3542,-3541,7183,2989,2990,2991,1141,1142,-2538,2657,-5090,7115,-8750,9316,9315,8945,9332,5620,1302,4644,1296,543,8003,9358,6054,2505,7178,8067,9055,9008,3509,8380,8653,3093,3497,8102,8181,445]],[[-4989,5280,5281,3514,3515,3511,8698,5189,9363,5191,4283,8607,4913,2150,7314,7317,7614,9284,1606,-171,-170,3925]],[[7179]],[[7180]],[[7181]],[[7316]],[[9283]],[[9356]],[[9357]],[[9359]],[[9364]]],"id":"26","properties":{"name":"Michigan"}},{"type":"MultiPolygon","arcs":[[[-7993,-7994,-7996,-6969,-6968,298,299,-6962,-6967,7678,-8081,-8346,-8345,-8344,9165,7756,9421,9422,8131,-8054,7505,-8053,2049,-10,-9,2374,2375,-7053,-7061,-7687,-7686,-7699,4318,-7698,3527,3528,3529,3521,3522,-3694,-7303,-7302,3507,3502,3503,-7027,-7026,7232,7229,7077,-4356,-4355,7116,-8387,-7193,3255,-7192,-5271,-8937,6057,-4034,-4587,-4736,-4739,8683,8725,-7990]],[[7753]],[[7754]],[[9163]],[[9164]]],"id":"28","properties":{"name":"Mississippi"}},{"type":"MultiPolygon","arcs":[[[1035,1036,6645,6646,-2991,-2990,-7184,3540,3541,3542,9191,9434,8552,8711,9253,9423,-4682,-7466,-7465,-5676,-5675,-5672,-5671,-962,7405,-7888,-6161,-7937,6655,-4723,-4726,-3136,-7239,-7241,8038,-7281,-7280,3786,3787,3788,3792,3793,-6285,8605,-5823,8606,8459,-5206,-5212,8272,-9315,-6882,-6881,8626,-7049,-7052,8821,8822,8823,-2707,7948,8362,-1159,-1158,2738,-452,-451,-8231,1832,1833,-2080]],[[9190]],[[9433]]],"id":"39","properties":{"name":"Ohio"}},{"type":"MultiPolygon","arcs":[[[8536,5634,6755,7673,8963,-7345,-4667,-4666,-4665,-4817,-4816,-4815,-7927,3618,3003,1657,472,967,968,6686,6687,-8262,158,159,-7211,-7210,-3969,-3968,5644,3848,3849,587,5870,5871,1163,1164,2481,2482,3237,-504,-503,-8806,474,8784,-6694,-6693,6776,7259,-3554,-3553,-4529,-4528,8824,6771,-9253,-9413,-9083,-9082,8879,-4323,-4322,-7936,5546,-3181,5547,5757,5758,8937,8863,1049,1050,-5006,-5516,-5515,-5514,-6324,8801,-5342,3614,3615,-3896,5212,3974,9299,3976,8766,9301,6651,9300,6653,5919,4430,3603,8390,8752,6273,7261,9000,7263,6275,8753,8392,3601,4431,5867,3605,4427,3607,5868,3609,8217,8393,8754,6277,7264,9001,7725,8919,3600,8660,9454,4183,8947]]],"id":"48","properties":{"name":"Texas"}},{"type":"MultiPolygon","arcs":[[[-7009,-5027,-2813,127,123,-2809,7122,8315,9229,9230,3738,3739,3740,9302,-5560,-5559,-5558,-7139,-2423,-2422,2469,8495,5579,-316,-3044,-6754,-586,-585,6908,9342,-4779,-5855,-5854,-4860,-4859,-4760,-4759,-3465,-3464,8481,-8801,-7205,5215,-3472,-3471,-3470,-3558,-3557,-5053,4646,4647,-5996,7996,4016,4017,4018,4019,3234,3235,-7486,-2916,-2915,-7914,7144,7145,-7483,-4657,-4656,-2508,-2507,-144,-143,-2839,-2838,4022,1541]]],"id":"31","properties":{"name":"Nebraska"}},{"type":"MultiPolygon","arcs":[[[131,132,575,576,-5873,3866,-1179,-1178,-1177,-1176,-8848,1724,1718,-7382,-7381,-4178,-5781,8257,6985,433,434,-5230,8008,6870,-3740,-3739,-9231,-9230,-8316,-7123,2808,-124,-128,2812,2813,-5029,-3165,-1156,-1155,-5093,-5095,-5094,-2762,-6940,3198,3199,3200,3201,-3966,6943,6868,-5745]]],"id":"08","properties":{"name":"Colorado"}},{"type":"MultiPolygon","arcs":[[[-9402,9329,-3375,-3374,-4982,-5026,-5025,5258,-7102,946,947,5081,4279,9107,9108,-8833,-8832,9104,4282,5082,5416,8838,5260,7020,9330,9405,5429,9263,8763,4632,9075,9073,-9352,-9142,-9135,5267,5268,-3585,-3584,137,138,139,140,293,294,295,5182,5183,5184,5180,5181,290,291,292,134,135,9407,-9339,5012,5013]],[[5079,9106]],[[-8837,9105]]],"id":"24","properties":{"name":"Maryland"}},{"type":"MultiPolygon","arcs":[[[4655,4656,7482,-7146,-7145,7913,2914,2915,7485,-3236,-3235,-4020,-4019,-4018,4414,4415,4416,-6052,7389,8275,8657,-7188,-5664,-5668,-8005,3897,3898,6130,6131,9438,2406,-1549,2407,-3929,-1587,7093,7094,8745,-4787,-4786,9389,6035,6036,-7648,-7166,5201,5202,9270,-2910,694,695,-5686,6996,6891,6892,9240,9348,-6732,3932,-6731,7526,-3200,-3199,6939,2761,5093,5094,5092,1154,1155,3164,5028,-2814,5026,7008,-1543,-1542,-4023,2837,2838,142,143,2506,2507]]],"id":"20","properties":{"name":"Kansas"}},{"type":"MultiPolygon","arcs":[[[8709,-2857,-2863,8237,-8086,3338,3339,-7131,-5437,-5440,-4672,4629,-4677,5326,-6955,-3883,-3882,-4110,-4109,-5805,-5285,-5284,5075,5076,-5294,8165,8902,-5502,-5914,8903,6995,6989,-7086,-7085,-8635,8292,8293,8290,3091,3085,-4935,6945,6946,4960,9193,-7088,-4956,4329,4330,-3576,-3575,8586,-8686,-7274,-9016,8840,-4334,-4333,5171,-7354,-3549,-6957,8360,9373,8908,8909,3938,3939,3934,3935,4260,4258,934,935,-3016,8900,4650,-3993,-3992,9147,8096,-5653,-5652,-5658,8121]]],"id":"17","properties":{"name":"Illinois"}},{"type":"MultiPolygon","arcs":[[[169,170,171,8501,9440,6834,8490,6836,828,9457,5373,8467,7773,3990,3991,3992,-4651,-8901,3015,-936,-935,-4259,-4261,-3936,-3935,-4615,7683,7363,7364,4410,4411,-5367,7801,8957,6728,6729,6091,6092,5477,5478,5479,-5500,-5499,-5530,-5529,7535,7617,-1690,-2766,7616,4402,9048,7252,-3516,-3515,-5282,-5281,4988,-3926]],[[4401]],[[8488]],[[8489]],[[9041]],[[9042]],[[9043]],[[9044]],[[9045]],[[9046]],[[9047]]],"id":"55","properties":{"name":"Wisconsin"}},{"type":"MultiPolygon","arcs":[[[8914,8160,8912,8718,9139,8158,9140,7032,7916,7631,8251,7633,7414,9429,4257,-3122,-2477,-2476,3859,3860,-6959,-3954,-7831,-7830,931,2466,-7837,8788,-8114,1216,3856,-8113,8930,-4423,-2525,-2524,4829,4830,1932,-7,1933,-2936,-2940,-5525,5588,8931,6929,9387,6924,2869,8883,1244,9428]],[[2863]],[[2864]],[[2865]],[[6921]],[[6925]],[[9385]],[[9386]]],"id":"06","properties":{"name":"California"}},{"type":"MultiPolygon","arcs":[[[4572,-4758,-5890,-5889,-96,-702,-3032,-3031,3642,-5447,2596,2597,-2622,-5542,-5541,-1308,-1307,-6329,2664,438,439,5172,5173,-5368,-4411,-7365,-7364,-7684,4614,-3940,-3939,-8910,-8909,-9374,-8361,6956,3548,7353,-5172,4332,4333,-8841,9015,-7273,2059,-1643,-1642,3058,4611,4612,667,668,5102,5103,1092,1093,-8183,-8222,7355,-5993,5054,-4647,5052,3556,3557,3469,3470,3471,-5216,7204,8800,-8482,3463,3464,3465]]],"id":"19","properties":{"name":"Iowa"}},{"type":"MultiPolygon","arcs":[[[-9330,9401,-5014,-5013,9338,-9408,-136,-135,-293,-292,-291,-5182,-5181,-5186,9029,2303,2304,2305,-4725,-7938,-6159,-7887,966,961,5670,5671,5674,5675,7464,7465,4681,4677,4678,-8599,-8533,-8532,-2785,-2784,7721,6577,6578,-7133,-6860,-6859,7566,7548,7549,7550,6608,-4703,6609,7173,-6140,5509,4772,-4362,4773,4774,-8090,8729,8730,6207,-5020,4980,4981,3373,3374]]],"id":"42","properties":{"name":"Pennsylvania"}},{"type":"MultiPolygon","arcs":[[[7286,9051,9399,-6633,-5252,4337,3841,3564,3565,6012,-677,6013,6014,6052,-1368,-5552,4904,4905,4906,-6606,-8873,-8872,-1436,-1435,-1442,5306,5307,-5574,1464,1465,1466,1928,1929,-3106,-8059,5783,-4002,2228,2229,5142,-1189,5141,2176,8448,9394,706,6076,9391,4368]]],"id":"30","properties":{"name":"Montana"}},{"type":"MultiPolygon","arcs":[[[-3899,-3898,8004,5667,5663,7187,-8658,-8276,-7390,6051,-4417,-4416,-4415,-4017,-7997,5995,-4648,-5055,5992,-7356,8221,8182,-1094,-1093,-5104,-5103,-669,-668,-4613,-4612,-3059,1641,1642,-2060,7272,7273,8685,-8587,3574,3575,-4331,-4330,4955,7087,-9194,-4961,-6947,-6946,4934,-3086,-3092,-8291,-8294,-8293,8634,7084,7085,-6990,-6996,-8904,5913,5501,5502,5503,5504,5505,-5820,8521,-5822,8522,3569,3570,3571,-4233,8436,8431,8432,-8446,-8445,-8168,-8171,-7856,-4243,-4242,-4241,-7918,8997,9002,-7419,-6973,1628,-6972,-4036,466,467,468,1590,1586,3928,-2408,1548,-2407,-9439,-6132,-6131]]],"id":"29","properties":{"name":"Missouri"}},{"type":"MultiPolygon","arcs":[[[-8793,-8797,-7667,-806,-805,-2011,-2010,-7014,-7013,7580,7326,7327,-8575,-6853,-6852,-7112,-7111,-6245,-4995,-4994,7319,7320,8991,8246,2359,7767,9374,8706,3056,1762,4602,9346,9247,8194,9244,8196,9248,8202,9388,6982,6949,6984,6951,8569,8830,9461,7586,2893,7584,2891,6931,7521,7109,1696,9323,7582,9006,7572,7578,2345,2733,278,7652,9092,-2563,9091,7651,275,276,2729,2730,-8794]],[[6983]],[[7569]],[[8197]],[[8198]],[[8199]],[[8203]],[[8204]],[[8205]],[[8206]]],"id":"12","properties":{"name":"Florida"}},{"type":"MultiPolygon","arcs":[[[5706,-6686,-5958,3313,3314,-7335,-5891,5817,5818,5819,-5506,-5505,-5504,-5503,-8903,-8166,5293,-5077,-5076,5283,5284,5804,4108,4109,-3881,-3880,6261,6262,6997,6998,4486,4487,4100,-4671,-4265,6585,3885,-7526,-4270,-7044,-7043,-7042,-7147,2977,2972,6614,-7134,-4302,8942,-8823,-8822,7051,7048,-8627,6880,6881,9314,-8273,5211,5205,-8460,-8607,5822,5823,5107,5361,5362,5608,5609,5610,5611,-6530,5332,5333,6588,6589,3768,3769,-6270,-396,-395,4113,-7670,-5753,4619,3319,3320,7857,-5623,-5622,-7297,-7296,283,284,-9232,-6684]],[[5820,5821]]],"id":"21","properties":{"name":"Kentucky"}},{"type":"MultiPolygon","arcs":[[[3172,7065,3174,3481,7068,9286,4797,5771,941,942,943,944,5763,-1577,5764,9395,3516,289,703]],[[3167]],[[3168]],[[3169]],[[3170]],[[3478]],[[7066]],[[7067]]],"id":"23","properties":{"name":"Maine"}},{"type":"MultiPolygon","arcs":[[[319,320,4176,4177,7380,7381,-1719,-1725,8847,1175,1176,1177,1178,1179,1180,-683,-682,-3,-2,-4292,-4291,-4290,-4289,8188,8139,8192,8190,6770,-3209,-3877,-3876,5137,-8147,-4384,-8357]]],"id":"49","properties":{"name":"Utah"}},{"type":"MultiPolygon","arcs":[[[-2482,-1165,-1164,-5872,-5871,-588,-3850,-3849,-5645,-3967,-3201,-7527,6730,-3933,6731,-9349,-9241,-6893,-6892,-6997,5685,-696,-695,2909,-9271,-5203,-5202,7165,7647,-6037,-6036,-9390,4785,4786,-8746,-7095,-7094,-1591,-469,-468,-4040,-4039,-3186,7489,-7504,-8708,-8709,-4256,-6916,-6918,7934,-3182,-5547,7935,4321,4322,-8880,9081,9082,9412,9252,-6772,-8825,4527,4528,3552,3553,-7260,-6777,6692,6693,-8785,-475,8805,502,503,-3238,-2483]]],"id":"40","properties":{"name":"Oklahoma"}},{"type":"MultiPolygon","arcs":[[[-3769,-6590,9420,2570,-1574,-1573,-1572,-6149,-5933,-6148,4530,4531,4532,4533,4534,7293,-4506,-4510,-6359,-9279,5800,4767,4768,-4846,5381,5951,5952,-7940,-7941,5422,-2024,-3869,-3868,-6879,-6878,-9325,-4200,-7659,-7658,8649,8642,8643,-8929,-7515,1040,1041,-4030,-4029,-4035,-6058,8936,5270,7191,-3256,7192,8386,-7117,4354,4355,4356,5196,-4238,-4237,-4236,-4235,-4234,-3571,-3570,-8523,-5821,-8522,-5819,-5818,5890,7334,-3315,-3314,5957,6685,-5707,6683,9231,-285,-284,7295,7296,5621,5622,-7858,-3321,-3320,-4620,5752,7669,-4114,394,395,6269,-3770]]],"id":"47","properties":{"name":"Tennessee"}},{"type":"MultiPolygon","arcs":[[[-9297,-6023,-9177,8419,-3454,8420,-7481,-3108,-8125,2843,2844,8760,-7105,8761,-8718,-6572,4169,4170,3952,3953,6958,-3861,-3860,2475,2476,3121,3122,7359,7361,5906,8180,9306,6710,6708,4160,4161,4162,-5372,7955,9202,-5224,-5223,-5222,459,-5221,5834]]],"id":"41","properties":{"name":"Oregon"}},{"type":"MultiPolygon","arcs":[[[-5184,-5183,-296,-295,-294,-141,-140,-139,-3583,-5982,-8048,-8047,7716,-8049,-6819,-9050,7221,7222,-4395,2014,2015,3796,3797,-7369,-8042,-7371,5456,4719,4720,4721,2328,2329,-6798,-5609,-5363,-5362,-5108,-5824,-8606,6284,-3794,-3793,-3789,-3788,-3787,7279,7280,-8039,7240,7238,3135,4725,4722,-6656,7936,6160,7887,-7406,-967,7886,6158,7937,4724,-2306,-2305,-2304,-9030,5185,-5185]]],"id":"54","properties":{"name":"West Virginia"}},{"type":"MultiPolygon","arcs":[[[-7233,7025,7026,-3504,-3503,-3508,7301,7302,-3693,7303,7304,7224,-5393,-7628,-7627,-5274,-5273,7890,-7953,-9447,-5758,-5548,3180,3181,-7935,6917,6915,4255,8708,8707,7503,-7490,3185,4038,4039,-467,4035,6971,-1629,6972,7418,-9003,-8998,7917,4240,4241,4242,7855,8170,8167,8444,8445,-8433,-8432,-8437,4232,-3572,4233,4234,4235,4236,4237,-5197,-4357,-7078,-7230]]],"id":"05","properties":{"name":"Arkansas"}},{"type":"MultiPolygon","arcs":[[[8819,9340,8818,6009,8350,3978,9432,8346,1663,-1191,1664,-5591,-5085,-691,-690,-8303,-7478,-7482,-8421,3453,-8420,9176,6022,9296,-5835,5220,-460,5221,5222,5223,-9203,-7956,5371,-4163,-4162,-4161,-6709,7608,6826,8244,8250,8240,8248,8282,9460,598,8284,9069,591,2351]],[[2352]],[[6006]],[[6010]],[[8286]],[[8287]],[[8288]],[[8289]],[[8349]],[[8351]],[[9341]]],"id":"53","properties":{"name":"Washington"}},{"type":"MultiPolygon","arcs":[[[3420,-6001,-6804,3649,-6803,8068,8140,8141,8142,6465,7794,7795,-8025,-8101,4510,4511,4512,9321,4514,9442,7808,6863,7733,6468,9411,6596,8751,6898,9322,6900,9452,6593,3779,6640,2332,9146,5277,7959,-6074,-6073,-4984,6621,5711,5630,5810,-4867,-4872,-5485,-5484,-4689,-4688,3733,3734,6136,6137,4503,-1016,-1015,-1021,3773,3774,-7496,7429,7491,7492,7493,7941,-2025,-5423,7940,7939,-5953,-5952,-5382,4845,-4769,-4768,-5801,9278,6358,4509,4505,-7294,-4535,-4534,-4533,8472,6807,6626,6627,6628,2894,2895,769,770,-7715,-1227,-7714,-6002]],[[6896,9320]],[[9319]]],"id":"37","properties":{"name":"North Carolina"}},{"type":"MultiPolygon","arcs":[[[4394,-7223,-7222,9049,6818,8048,-7717,8046,8047,5981,3582,-138,3583,3584,-5269,6002,-9136,9141,9351,-9074,9352,9280,8637,1455,9360,5729,9392,1491,9393,9137,4890,6814,2164,7972,4366,8770,7791,6747,6018,5775,8022,7973,7920,9439,-4512,-4511,8100,8024,-7796,-7795,-6466,-8143,-8142,-8141,-8069,6802,-3650,6803,6000,-3421,6001,7713,1226,7714,-771,-770,-2896,-2895,-6629,-6628,-6627,-6808,-8473,-4532,-4531,6147,5932,6148,1571,1572,1573,-2571,-9421,-6589,-5334,-5333,6529,-5612,-5611,-5610,6797,-2330,-2329,-4722,-4721,-4720,-5457,7370,8041,7368,-3798,-3797,-2016,-2015]],[[8831,8832,8833,7728,8834]],[[8835,8836]]],"id":"51","properties":{"name":"Virginia"}},{"type":"MultiPolygon","arcs":[[[5780,-4177,-321,-320,8356,4383,4384,4378,-3906,-3905,6105,-5575,-5307,1441,1434,1435,8871,8872,6605,-4907,-4906,-4905,5551,-1372,-41,-40,-4748,-4351,-4350,-2424,7138,5557,5558,5559,-9303,-3741,-6871,-8009,5229,-435,-434,-6986,-8258]]],"id":"56","properties":{"name":"Wyoming"}},{"type":"MultiPolygon","arcs":[[[-276,-7652,-9092,2562,2563,8342,8343,8344,8345,8080,-7679,6966,6961,-300,-299,6967,6968,7995,7993,7992,7989,-8726,-8684,4738,4735,4586,4033,4034,4028,4029,-1042,-1041,7514,8928,-8644,-8643,-8650,-7660,4246,-4205,4247,4434,-3831,4435,-5579,-57,8896,7341,-3416,7342,3852,3853,8212,8213,7851,-3410,7852,8336,8337,8338,-9370,-7015,-7019,-7668,8796,8792,8793,-2731,-2730,-277]],[[8341]]],"id":"01","properties":{"name":"Alabama"}},{"type":"MultiPolygon","arcs":[[[-6137,-3735,-3734,4687,4688,5483,5484,4871,4866,-5811,-5631,-5712,-6622,4983,6072,6073,6074,5049,4685,6634,4763,4693,4694,4695,5299,5300,5796,5797,-8210,5897,5898,9197,-8402,5720,5721,5722,5827,4345,4346,-6299,7496,7497,7498,7499,7495,-3775,-3774,1020,1014,1015,-4504,-6138]]],"id":"45","properties":{"name":"South Carolina"}},{"type":"MultiPolygon","arcs":[[[1565,4708,4709,-4596,3581,-4595,6061,4715,5011,5874,-3867,5872,-577,-576,-133,-132,5744,-6869,-6944,3965,-3202,3966,3967,3968,7209,7210,-160,-159,8261,-6688,-6687,-969,-968,-473,-1658,-3004,-3619,7926,4814,4815,4816,4664,4665,4666,7344,7345]]],"id":"35","properties":{"name":"New Mexico"}},{"type":"MultiPolygon","arcs":[[[-944,-943,8732,-7290,-7289,9100,-7945,-7944,-3494,-4707,-4706,-5063,-5062,-8488,-9337,-8927,1579,1575,1576,-5764,-945]]],"id":"33","properties":{"name":"New Hampshire"}},{"type":"MultiPolygon","arcs":[[[8925,-1580,8926,9336,8487,5061,5062,4705,4706,-3493,-3492,-5116,8389,8388,5972,9227,-7436,-7435,-8439,8021,8019,4881,8396]]],"id":"50","properties":{"name":"Vermont"}},{"type":"MultiPolygon","arcs":[[[2523,2524,4422,-8931,8112,-3857,-1217,8113,-8789,7836,-2467,-932,7829,7830,-3953,-4171,-4170,6571,6572,-8717,-7898,-3210,-6771,-8191,-8193,-8140,-8189,4288,4289,4290,4291,-1,-8,-1933,-4831,-4830]]],"id":"32","properties":{"name":"Nevada"}},{"type":"MultiPolygon","arcs":[[[3384]],[[3385]],[[3386]],[[3388,7388]],[[3450]],[[8187]],[[8611]],[[8612]]],"id":"15","properties":{"name":"Hawaii"}},{"type":"MultiPolygon","arcs":[[[7288,7289,7290,3489,5564,3909,5561,3911,9398,8876,9397,3913,5322,-3956,5323,5324,5325,5565,-6266,-7392,7946,5962,5963,5964,5118,5119,5120,5114,5115,3491,3492,3493,7943,7944,-9101]],[[5840]],[[8874]]],"id":"25","properties":{"name":"Massachusetts"}},{"type":"MultiPolygon","arcs":[[[3955,3956]],[[3957]],[[6267,6209,8994,-7397,6211,6212,6268,6265,-5566,-5326,-5325,9445]],[[8993]]],"id":"44","properties":{"name":"Rhode Island"}},{"type":"MultiPolygon","arcs":[[[-6208,-8731,-8730,8089,-4775,-4774,4361,-4773,-5510,6139,-7174,-6610,-4702,-4701,-7869,7147,7148,7149,-4305,-4304,8505,8506,-8777,7215,7216,8603,7124,7894,8273,4297,9305,-5018,9303,-5022,-5021]]],"id":"34","properties":{"name":"New Jersey"}},{"type":"MultiPolygon","arcs":[[[5017,5018]],[[-947,7101,-5259,5024,5025,-4981,5019,5020,5021,5022,7099,9170,-9108,-4280,-5082,-948]]],"id":"10","properties":{"name":"Delaware"}},{"type":"MultiPolygon","arcs":[[[5086,7034,7871,-7155,-7867,7869,8790,-5119,-5965,-5964,-5963,-7947,7391,-6269,-6213,-6212,7396,7397]]],"id":"09","properties":{"name":"Connecticut"}},{"type":"MultiPolygon","arcs":[[[-5268,9134,9135,-6003]]],"id":"11","properties":{"name":"District of Columbia"}}]},"nation":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","arcs":[[[1565,4708,6914,248,4591,5526,5588,8931,6929,9387,6924,2869,8883,1244,9428,8914,8160,8912,8718,9139,8158,9140,7032,7916,7631,8251,7633,7414,9429,4257,3122,7359,7361,5906,8180,9306,6710,7608,6826,8244,8250,8240,8248,8282,9460,598,8284,9069,591,2351,8819,9340,8818,6009,8350,3978,9432,8346,1663,1187,5141,2176,8448,9394,706,6076,9391,4368,7286,9051,9399,6630,9109,455,2075,3108,1580,2601,5883,5040,2137,9308,7194,2762,3948,3416,3949,2764,7616,4402,9048,7252,3511,8698,5189,9363,5191,4283,8607,4913,2150,7314,7317,7614,9284,1606,171,8501,9440,6834,8490,6836,828,9457,5373,8467,7773,3990,9147,8096,5653,9110,9437,9315,8945,9332,5620,1302,4644,1296,543,8003,9358,6054,2505,7178,8067,9055,9008,3509,8380,8653,3093,3497,8102,8181,445,7022,8897,7072,8070,3542,9191,9434,8552,8711,9253,9423,4677,8596,9088,7160,354,3944,714,9061,3536,6128,4313,7693,8437,8019,4881,8396,8925,1575,5764,9395,3516,289,703,3172,7065,3174,3481,7068,9286,4797,5771,941,8732,7290,3489,5564,3909,5561,3911,9398,8876,9397,3913,5322,3956,5323,9445,6267,6209,8994,7397,5086,7034,7871,7155,8843,8695,3561,6125,3559,8696,8518,4308,8505,8777,7216,8603,7124,7894,8273,4297,9305,5018,9303,5022,7099,9170,9108,8833,7728,8834,9104,4282,5082,5416,8838,5260,7020,9330,9405,5429,9263,8763,4632,9075,9352,9280,8637,1455,9360,5729,9392,1491,9393,9137,4890,6814,2164,7972,4366,8770,7791,6747,6018,5775,8022,7973,7920,9439,4512,9321,4514,9442,7808,6863,7733,6468,9411,6596,8751,6898,9322,6900,9452,6593,3779,6640,2332,9146,5277,7959,6074,5049,4685,6634,4763,4693,9368,6935,4272,9297,4607,8967,7320,8991,8246,2359,7767,9374,8706,3056,1762,4602,9346,9247,8194,9244,8196,9248,8202,9388,6982,6949,6984,6951,8569,8830,9461,7586,2893,7584,2891,6931,7521,7109,1696,9323,7582,9006,7572,7578,2345,2733,278,7652,9092,2563,8342,9165,7756,9421,9458,7979,7001,9456,7863,8064,8177,8061,8178,4159,4626,3698,3894,5212,3974,9299,3976,8766,9301,6651,9300,6653,5919,4430,3603,8390,8752,6273,7261,9000,7263,6275,8753,8392,3601,4431,5867,3605,4427,3607,5868,3609,8217,8393,8754,6277,7264,9001,7725,8919,3600,8660,9454,4183,8947,8536,5634,6755,7673,8963,7345],[-1543]],[[4627]],[[6999]],[[7000]],[[8059]],[[8175]],[[8176]],[[9455]],[[6123]],[[6124]],[[6126]],[[6129]],[[8463,1946,1386,8229,1985,8988,8853,8772,8990,1971,1978,1961,1973,719,1974,6161,4742,6163,4744,484,9123,1706,3424,2295,2668,1983,8228,1384,1947,9444,1944,8461,1373,1593,48,8226,3032,8227,50,1594,1375,8462,1377]],[[51]],[[52]],[[1379,8460]],[[1382,3051]],[[1591,3038]],[[1953]],[[1954]],[[1955]],[[1956]],[[1957]],[[1958]],[[1959]],[[1962]],[[1963]],[[1964]],[[1965]],[[1966]],[[1967]],[[1968]],[[1969]],[[1979]],[[1980]],[[3034]],[[3035]],[[3036]],[[3037]],[[3039,3049]],[[3050]],[[4745]],[[4746]],[[6162]],[[8224]],[[8225]],[[8969]],[[8970]],[[8971]],[[8972]],[[8973]],[[8974]],[[8975]],[[8976]],[[8977]],[[8978]],[[8979]],[[8980]],[[8981]],[[8982]],[[8983]],[[8984]],[[8985]],[[8986]],[[8987]],[[8989]],[[9122]],[[9124]],[[7179]],[[7180]],[[7181]],[[7316]],[[9283]],[[9356]],[[9357]],[[9359]],[[9364]],[[7753]],[[7754]],[[9163]],[[9164]],[[9190]],[[9433]],[[5079,9106]],[[9105,8835]],[[4401]],[[8488]],[[8489]],[[9041]],[[9042]],[[9043]],[[9044]],[[9045]],[[9046]],[[9047]],[[2863]],[[2864]],[[2865]],[[6921]],[[6925]],[[9385]],[[9386]],[[6983]],[[7569]],[[8197]],[[8198]],[[8199]],[[8203]],[[8204]],[[8205]],[[8206]],[[3167]],[[3168]],[[3169]],[[3170]],[[3478]],[[7066]],[[7067]],[[2352]],[[6006]],[[6010]],[[8286]],[[8287]],[[8288]],[[8289]],[[8349]],[[8351]],[[9341]],[[6896,9320]],[[9319]],[[8341]],[[3384]],[[3385]],[[3386]],[[3388,7388]],[[3450]],[[8187]],[[8611]],[[8612]],[[5840]],[[8874]],[[3957]],[[8993]]]}]}},"arcs":[[[22952,51190],[67,-596]],[[23019,50594],[855,279],[1146,358]],[[25020,51231],[628,190]],[[25648,51421],[-3,188],[-223,595],[-6,178],[-60,187],[-1,288],[-102,290],[15,459],[-91,215],[-101,-16],[-161,203],[-124,-33],[-65,86],[-197,6],[-261,201],[-117,27],[-63,205],[-149,-72],[-93,163],[22,356],[-50,174],[31,126],[-75,292],[-113,1043]],[[23661,56582],[-493,4588]],[[23168,61170],[-62,73],[-314,-148],[-151,254],[-184,16],[-55,-136],[-183,3],[-12,-107],[-322,-140],[-85,-182],[-87,-46]],[[21713,60757],[-50,-197],[-81,-92],[-160,-384],[-89,-60],[42,-268],[-61,-264],[18,-68],[-40,-416],[-121,-252],[-31,-281],[-69,-170],[59,-487]],[[21130,57818],[83,-258],[-59,-105],[129,-83],[31,-125],[24,-629],[-18,-338],[-54,-333],[96,-444],[-46,-175],[-1,-237],[36,-162],[-7,-200],[47,-176],[63,-57],[-82,-300],[39,-317],[-19,-239],[42,-54],[221,-26],[87,-54],[106,38],[3,84],[238,28],[87,297],[-21,59],[113,209],[153,14],[218,-544],[43,-39],[86,-746],[184,-1716]],[[65107,78355],[37,-4]],[[65144,78351],[382,-40]],[[65526,78311],[14,363],[59,50],[56,318],[64,152],[21,202]],[[65740,79396],[32,247],[38,1082],[107,192],[71,286]],[[65988,81203],[-279,-202],[-353,103]],[[65356,81104],[-15,-299],[-120,-275],[-48,-214],[-21,-623]],[[65152,79693],[-45,-1338]],[[24791,26842],[350,113]],[[25141,26955],[1051,345]],[[26192,27300],[-145,1322],[-80,-26],[-35,322],[-269,-89]],[[25663,28829],[-190,-62],[19,-164],[-473,-159],[-14,-168],[-366,-124]],[[24639,28152],[152,-1310]],[[53014,12853],[970,11]],[[53984,12864],[-2,578],[27,220]],[[54009,13662],[-1,441],[196,1],[0,331],[779,-1],[0,-332],[193,-2],[-1,-331]],[[55175,13769],[192,6]],[[55367,13775],[8,988],[39,0],[0,659]],[[55414,15422],[-780,6]],[[54634,15428],[-1192,-9]],[[53442,15419],[3,-343],[-59,-316]],[[53386,14760],[-71,-366],[-61,-143],[-54,-434],[-65,-167],[-16,-333],[-44,-78],[-61,-386]],[[52134,16372],[388,15]],[[52522,16387],[943,23]],[[53465,16410],[2,333]],[[53467,16743],[18,165],[-4,532],[65,274],[-38,289],[31,351],[-20,359]],[[53519,18713],[-753,0]],[[52766,18713],[-619,-18]],[[52147,18695],[14,-1327],[-37,-1],[10,-995]],[[41956,25674],[195,-4],[184,-71],[400,58]],[[42735,25657],[-73,1328],[194,24],[-20,443]],[[42836,27452],[-959,-135]],[[41877,27317],[7,-151]],[[41884,27166],[72,-1492]],[[89237,26630],[145,9],[191,82],[258,-144],[35,-65]],[[89866,26512],[27,145],[-69,66],[69,103],[141,-49],[-3,-68]],[[90031,26709],[49,227],[-55,483],[50,203],[3,339]],[[90078,27961],[31,111],[-151,144],[-62,-47],[-93,112]],[[89803,28281],[-316,-150],[-194,-293]],[[89293,27838],[74,-459],[-121,-442],[-9,-307]],[[24234,93116],[130,-327]],[[24364,92789],[122,51],[67,249],[100,-76],[255,138]],[[24908,93151],[71,146],[-144,286],[56,137],[-113,-36],[-83,97],[-19,303],[48,187],[-74,132]],[[24650,94403],[-4,-279],[-48,-275],[15,-216],[-61,230],[44,113],[-91,164],[-86,-215],[-101,-7],[-30,-132],[44,-187],[80,-60],[-58,-170],[83,-8],[-191,-138],[-12,-107]],[[24158,93842],[17,-68],[85,176],[-102,-108]],[[24110,93691],[33,-161],[142,12],[12,158],[-80,94],[-107,-103]],[[74239,65845],[318,-52],[296,-78]],[[74853,65715],[25,-4],[22,353]],[[74900,66064],[1,377],[-158,88],[-264,237],[-89,13]],[[74390,66779],[-151,-934]],[[78118,70652],[465,-618]],[[78583,70034],[211,576]],[[78794,70610],[-73,-97],[-211,477],[44,59],[-101,224]],[[78453,71273],[-320,-428]],[[78133,70845],[-15,-193]],[[70760,47067],[-18,-337]],[[70742,46730],[625,-102]],[[71367,46628],[63,-11],[61,871]],[[71491,47488],[-52,128],[12,172]],[[71451,47788],[-643,117]],[[70808,47905],[-48,-838]],[[72412,45897],[205,-46],[200,-282]],[[72817,45569],[62,1085]],[[72879,46654],[-159,34],[-103,360],[-123,58]],[[72494,47106],[-89,-47],[-100,113]],[[72305,47172],[-69,-1001]],[[72236,46171],[-17,-231],[193,-43]],[[75509,28963],[15,164],[190,-49],[47,497]],[[75761,29575],[100,986]],[[75861,30561],[-191,65]],[[75670,30626],[-563,161]],[[75107,30787],[-113,-1303]],[[74994,29484],[171,-86],[-30,-330],[374,-105]],[[67331,66268],[576,-76]],[[67907,66192],[193,-24]],[[68100,66168],[44,1011]],[[68144,67179],[-389,46],[9,223],[-189,25],[2,56]],[[67577,67529],[-289,39]],[[67288,67568],[-8,-281],[95,-13],[-44,-1006]],[[76231,37858],[468,-123]],[[76699,37735],[174,-37]],[[76873,37698],[85,1086]],[[76958,38784],[-216,76]],[[76742,38860],[-420,107]],[[76322,38967],[-91,-1109]],[[52924,29355],[386,6]],[[53310,29361],[699,4]],[[54009,29365],[-4,1340]],[[54005,30705],[-235,-3]],[[53770,30702],[-526,-5]],[[53244,30697],[-330,-5]],[[52914,30692],[10,-1337]],[[52475,30682],[439,10]],[[53244,30697],[-8,1599]],[[53236,32296],[-383,-5]],[[52853,32291],[2,-334],[-387,-6]],[[52468,31951],[7,-1269]],[[55467,79125],[348,-492]],[[55815,78633],[3,463],[104,218],[-31,86],[132,-8]],[[56023,79392],[-55,1361]],[[55968,80753],[-461,-13],[-445,-462]],[[55062,80278],[-63,-896]],[[54999,79382],[150,-59],[130,-124],[118,69],[70,-143]],[[50236,28925],[763,26]],[[50999,28951],[5,333]],[[51004,29284],[-12,1352]],[[50992,30636],[-621,-30]],[[50371,30606],[-143,-7]],[[50228,30599],[19,-1341],[-11,-333]],[[49697,93009],[580,35]],[[50277,93044],[349,19]],[[50626,93063],[143,7],[-2,195]],[[50767,93265],[-19,1626]],[[50748,94891],[-673,-34]],[[50075,94857],[-204,-10]],[[49871,94847],[24,-1032],[-97,-2],[4,-331],[-52,-3],[6,-353],[-59,-117]],[[44540,41933],[37,-991]],[[44577,40942],[1184,119]],[[45761,41061],[-39,1339]],[[45722,42400],[-1195,-118]],[[44527,42282],[13,-349]],[[36002,52403],[331,80],[785,140]],[[37118,52623],[-10,168],[517,93]],[[37625,52884],[26,263],[-62,269],[19,149],[-37,293],[-67,227],[82,193]],[[37586,54278],[-507,-89]],[[37079,54189],[-826,-147]],[[36253,54042],[-162,-599],[0,-213],[-134,-156],[45,-671]],[[84637,40491],[408,-131]],[[85045,40360],[1054,-341]],[[86099,40019],[-68,373],[-57,63],[-40,455],[28,142],[-40,584]],[[85922,41636],[-70,34]],[[85852,41670],[-66,-28],[-34,-340],[-55,-10],[-41,-188],[-56,-30]],[[85600,41074],[-73,-58],[-45,-175],[72,-54],[-10,-114],[-196,3],[-46,82],[-86,-50]],[[85216,40708],[-113,-157],[-177,-49],[-116,339],[-122,-28]],[[84688,40813],[-33,-143],[44,-80],[-62,-99]],[[47651,43912],[932,65]],[[48583,43977],[5,0]],[[48588,43977],[-42,1675]],[[48546,45652],[-910,-64]],[[47636,45588],[-32,-1]],[[47604,45587],[47,-1675]],[[67406,40944],[376,-55],[-90,-1443]],[[67692,39446],[192,-40]],[[67884,39406],[119,1955],[307,-36]],[[68310,41325],[20,332]],[[68330,41657],[-886,127]],[[67444,41784],[-38,-840]],[[41995,61964],[1581,188]],[[43576,62152],[-66,1676]],[[43510,63828],[-648,-72]],[[42862,63756],[-940,-117]],[[41922,63639],[35,-795]],[[41957,62844],[38,-880]],[[76468,72244],[-7,-123]],[[76461,72121],[463,-68],[-16,-272]],[[76908,71781],[89,-13],[11,163],[92,-43],[112,54]],[[77212,71942],[164,509]],[[77376,72451],[107,445]],[[77483,72896],[-781,142],[12,162]],[[76714,73200],[-224,-316]],[[76490,72884],[-22,-640]],[[66550,21390],[572,-44],[-11,-257]],[[67111,21089],[94,-70],[57,134],[131,-6],[58,117]],[[67451,21264],[110,171],[-61,109],[80,134],[-22,184],[-51,-18],[69,234],[-23,160],[-71,124],[-11,214],[69,98],[127,-12],[86,-169],[82,182],[-54,167],[-50,493],[129,224],[114,32]],[[67974,23591],[-46,200],[6,261],[-206,74]],[[67728,24126],[-1,-95],[-290,33],[-3,-105],[-281,28],[-12,-330],[-111,9],[-11,-329],[-194,13],[-26,-660],[-191,17]],[[66608,22707],[-58,-1317]],[[9888,45761],[110,31]],[[9998,45792],[35,25],[173,-263],[66,8],[41,133],[347,158]],[[10660,45853],[-54,113],[55,76],[51,334],[325,535]],[[11037,46911],[394,1186],[-80,602],[-114,-3],[-62,167]],[[11175,48863],[-93,-214],[8,429],[-77,-15],[-146,-441],[-85,-113],[-76,109],[-44,-87],[-90,86],[-34,-390],[-188,-569],[-4,-127],[-118,-69],[-2,-183],[48,-202],[-51,-206],[-156,-189],[48,-147],[-218,-579],[-9,-195]],[[75384,68373],[10,-128],[646,-122]],[[76040,68123],[21,140]],[[76061,68263],[-23,244],[-4,438],[29,144]],[[76063,69089],[61,331]],[[76124,69420],[-108,165],[-241,51]],[[75775,69636],[-100,-75],[-206,29]],[[75469,69590],[-85,-1217]],[[60365,33831],[772,-50]],[[61137,33781],[17,668],[28,-2],[15,657]],[[61197,35104],[-384,26]],[[60813,35130],[-385,26]],[[60428,35156],[-15,-663],[-33,2],[-7,-332]],[[60373,34163],[-8,-332]],[[58023,31589],[766,-32]],[[58789,31557],[19,1333]],[[58808,32890],[-769,35]],[[58039,32925],[-16,-1336]],[[54009,13662],[1166,-1],[0,108]],[[50930,38398],[319,13],[98,-111],[259,5],[93,-53]],[[51699,38252],[209,4],[-5,508]],[[51903,38764],[-7,330],[-321,-7],[0,57],[-258,-8],[-82,109],[-290,-12],[10,-499],[-22,-1]],[[50933,38733],[-8,0]],[[50925,38733],[5,-335]],[[87275,36326],[184,167]],[[87459,36493],[560,508]],[[88019,37001],[-230,323],[-204,139],[-197,234]],[[87388,37697],[-312,-984],[199,-387]],[[42554,67279],[974,113]],[[43528,67392],[-45,1674]],[[43483,69066],[-960,-106]],[[42523,68960],[31,-1681]],[[48007,71127],[262,16]],[[48269,71143],[699,41]],[[48968,71184],[-33,1700]],[[48935,72884],[-34,-2]],[[48901,72882],[-932,-56]],[[47969,72826],[38,-1699]],[[44750,76253],[763,47],[25,-548],[66,42]],[[45604,75794],[1115,103]],[[46719,75897],[-7,425],[232,25]],[[46944,76347],[-56,1886]],[[46888,78233],[-1093,-81]],[[45795,78152],[40,-1677],[-1089,-116]],[[44746,76359],[4,-106]],[[51184,69449],[798,25]],[[51982,69474],[193,18]],[[52175,69492],[-43,1690]],[[52132,71182],[-272,-20]],[[51860,71162],[-702,-49]],[[51158,71113],[26,-1664]],[[52548,28015],[384,5]],[[52932,28020],[385,8]],[[53317,28028],[-7,1333]],[[52924,29355],[-386,-11]],[[52538,29344],[10,-1329]],[[48932,25159],[159,11]],[[49091,25170],[412,26]],[[49503,25196],[-28,1338],[19,2],[-27,1350]],[[49467,27886],[-442,-18]],[[49025,27868],[-136,-105]],[[48889,27763],[28,-1266],[-20,-1]],[[48897,26496],[35,-1337]],[[46466,65785],[182,17]],[[46648,65802],[769,64]],[[47417,65866],[-8,337]],[[47409,66203],[-90,-27],[-41,1515]],[[47278,67691],[-865,-66]],[[46413,67625],[53,-1840]],[[27490,72506],[-56,440],[-95,1067]],[[27339,74013],[-1155,-307],[-514,-507]],[[25670,73199],[34,-360],[380,103],[72,-774],[577,155],[2,-19],[755,202]],[[60343,39538],[384,-27]],[[60727,39511],[384,-28]],[[61111,39483],[25,1013]],[[61136,40496],[-770,53]],[[60366,40549],[-23,-1011]],[[62391,36697],[-9,-336]],[[62382,36361],[770,-63]],[[63152,36298],[22,672]],[[63174,36970],[18,670]],[[63192,37640],[-773,63]],[[62419,37703],[-28,-1006]],[[36673,13674],[70,-6],[14,-218],[81,-107],[84,11],[123,-286],[131,-40],[252,136],[55,-242]],[[37483,12922],[194,83],[48,82],[558,49],[44,-218],[191,49],[43,-136],[167,-16],[162,-329],[-24,-98],[57,-198],[113,-47],[11,73]],[[39047,12216],[91,18],[-21,335],[145,27],[-81,1281],[-56,-11],[-42,660],[193,35],[-41,657],[127,22]],[[39362,15240],[-75,1213]],[[39287,16453],[-3,55]],[[39284,16508],[-967,-179],[4,-55],[-1140,-227],[-2,31],[-647,-137]],[[36532,15941],[-65,-116],[69,-335],[49,-109],[-49,-183],[-30,-319],[58,-143],[-35,-319],[37,-128],[-1,-261],[93,-182],[15,-172]],[[58121,51702],[7,-685]],[[58128,51017],[857,16],[58,-26]],[[59043,51007],[46,29],[-4,487]],[[59085,51523],[-5,616],[-99,-1],[-2,336]],[[58979,52474],[-97,-1]],[[58882,52473],[-320,-7],[1,-224],[-448,-16]],[[58115,52226],[6,-524]],[[72308,77415],[186,-22]],[[72494,77393],[569,-96]],[[73063,77297],[123,2350]],[[73186,79647],[-455,10],[-315,90]],[[72416,79747],[-108,-2332]],[[70105,55947],[46,-1677]],[[70151,54270],[23,120],[232,-53],[110,-81]],[[70516,54256],[76,1607]],[[70592,55863],[-96,19]],[[70496,55882],[-391,65]],[[98141,11265],[-336,336]],[[97805,11601],[-501,524],[-38,-12],[-224,-1334],[-77,-353],[-216,-1240],[-383,193],[-8,-48],[-185,92]],[[96173,9423],[-114,-644],[-1333,652]],[[94726,9431],[-448,219]],[[94278,9650],[-34,-466],[670,-3350],[232,26],[52,-40],[67,478],[52,185],[245,141],[229,-362],[85,-25],[85,-134],[4,-114],[84,-76],[211,-78],[-38,-198],[51,-92],[287,-11],[45,94],[334,223],[169,285],[151,59],[307,1702],[219,1163],[221,1226],[62,68],[-57,166],[111,182],[-56,110],[75,453]],[[83656,40800],[201,-63]],[[83857,40737],[716,-226]],[[84573,40511],[64,-20]],[[84688,40813],[-83,219],[-82,12],[41,112],[-53,183]],[[84511,41339],[-164,42],[-160,-10]],[[84187,41371],[-230,-188],[69,-78],[-113,-49],[9,124],[-199,699],[-203,-63]],[[83520,41816],[136,-1016]],[[67993,71961],[981,-134]],[[68974,71827],[-12,1040]],[[68962,72867],[-4,313]],[[68958,73180],[-905,133]],[[68053,73313],[-60,-1352]],[[50060,21239],[28,-1308]],[[50088,19931],[1499,68]],[[51587,19999],[43,3]],[[51630,20002],[-18,1321]],[[51612,21323],[-1114,-57]],[[50498,21266],[-438,-27]],[[56679,23689],[596,-18],[2,168],[193,-10]],[[57470,23829],[20,1165]],[[57490,24994],[-388,10],[2,335]],[[57104,25339],[-404,10]],[[56700,25349],[-21,-1660]],[[44867,30589],[1424,149]],[[46291,30738],[-48,1501]],[[46243,32239],[-645,-57],[-741,-90]],[[44857,32092],[20,-498],[-45,-5],[35,-1000]],[[28616,37420],[54,-32],[82,145],[62,-29],[91,-234],[-60,-255],[20,-130],[-86,-42],[-12,-139],[166,-227],[219,-32],[38,-157],[173,-7]],[[29363,36281],[52,20],[240,-188],[106,-142]],[[29761,35971],[-91,965],[902,254],[749,183]],[[31321,37373],[79,21]],[[31400,37394],[-61,701]],[[31339,38095],[-174,-24],[-260,-165],[-133,11],[-60,114],[-189,-15],[-69,53],[-228,23],[-155,-69],[-101,110],[-136,-95],[-37,181]],[[29797,38219],[-52,-23],[-101,314],[-87,37],[-155,-93],[-65,146],[-332,-406],[-25,-250],[-143,145],[-43,161],[-103,-68]],[[28691,38182],[-64,-241],[32,-119],[-66,-309],[23,-93]],[[85467,27299],[393,-180]],[[85860,27119],[-9,276],[88,423],[-14,199],[52,282],[140,302]],[[86117,28601],[163,231],[-176,74]],[[86104,28906],[-317,132]],[[85787,29038],[-57,-459],[-164,-338]],[[85566,28241],[-58,-391],[23,-23],[-64,-528]],[[53826,51565],[287,5],[2,-336]],[[54115,51234],[693,9]],[[54808,51243],[0,505]],[[54808,51748],[-3,1180]],[[54805,52928],[0,504]],[[54805,53432],[-989,-17]],[[53816,53415],[10,-1850]],[[46642,48859],[760,69]],[[47402,48928],[-39,1681]],[[47363,50609],[-764,-69]],[[46599,50540],[43,-1681]],[[70788,29395],[-79,-1330]],[[70709,28065],[759,-140]],[[71468,27925],[85,1326]],[[71553,29251],[43,664]],[[71596,29915],[-366,73]],[[71230,29988],[-400,71],[-42,-664]],[[50910,41414],[760,27]],[[51670,41441],[1,0]],[[51671,41441],[-14,1341]],[[51657,42782],[-758,-27]],[[50899,42755],[-8,0]],[[50891,42755],[19,-1341]],[[82924,26744],[149,-68],[220,-42],[203,-91],[177,-18]],[[83673,26525],[96,878]],[[83769,27403],[-745,258]],[[83024,27661],[-100,-917]],[[51291,12717],[584,23]],[[51875,12740],[-8,659],[33,1],[-16,1322]],[[51884,14722],[-155,-5]],[[51729,14717],[-781,-32]],[[50948,14685],[-38,-2],[10,-660]],[[50920,14023],[4,-260]],[[50924,13763],[6,-402],[155,7],[11,-658],[195,7]],[[50024,58873],[762,34]],[[50786,58907],[-17,1696]],[[50769,60603],[-191,-8],[-10,669]],[[50568,61264],[-558,-25]],[[50010,61239],[-16,-1],[16,-1005]],[[50010,60233],[14,-1360]],[[46969,72725],[968,76],[-1,23]],[[47936,72824],[-40,1664]],[[47896,74488],[-156,-14]],[[47740,74474],[-824,-60]],[[46916,74414],[53,-1689]],[[44560,62257],[970,97]],[[45530,62354],[-60,1670]],[[45470,64024],[-693,-63]],[[44777,63961],[-286,-30]],[[44491,63931],[69,-1674]],[[44675,58898],[962,94]],[[45637,58992],[-53,1656]],[[45584,60648],[-965,-89]],[[44619,60559],[56,-1661]],[[45795,78152],[-521,-30]],[[45274,78122],[-596,-43]],[[44678,78079],[68,-1720]],[[64947,27259],[594,-61]],[[65541,27198],[539,-65]],[[66080,27133],[44,992]],[[66124,28125],[-451,59]],[[65673,28184],[-686,84]],[[64987,28268],[-40,-1009]],[[74621,55285],[12,-2]],[[74633,55283],[916,-147]],[[75549,55136],[34,218],[-54,129],[-79,-5],[-23,173],[49,294],[37,392],[-75,113],[18,165]],[[75456,56615],[-44,172],[-63,57]],[[75349,56844],[-64,-143],[-182,-92],[-84,-112],[-186,-352]],[[74833,56145],[67,-108],[-70,-142],[-93,-328]],[[74737,55567],[-116,-282]],[[61635,20261],[971,-74]],[[62606,20187],[19,661],[386,-38]],[[63011,20810],[40,1309]],[[63051,22119],[-1345,121]],[[61706,22240],[-39,-1316],[-15,-1],[-17,-662]],[[72224,27787],[770,-162]],[[72994,27625],[91,1332]],[[73085,28957],[-382,77]],[[72703,29034],[-383,77]],[[72320,29111],[-96,-1324]],[[67459,78444],[387,-47]],[[67846,78397],[482,-64]],[[68328,78333],[30,669]],[[68358,79002],[10,223]],[[68368,79225],[-680,85],[-9,116],[-180,20]],[[67499,79446],[-40,-1002]],[[66638,66011],[484,-54]],[[67122,65957],[16,335],[193,-24]],[[67288,67568],[3,64],[-581,70]],[[66710,67702],[-23,-559]],[[66687,67143],[-49,-1132]],[[46758,35790],[952,86]],[[47710,35876],[-31,1332]],[[47679,37208],[-738,-60]],[[46941,37148],[-216,-21]],[[46725,37127],[33,-1337]],[[45045,72558],[0,-13]],[[45045,72545],[962,94]],[[46007,72639],[-57,1688]],[[45950,74327],[-294,-30]],[[45656,74297],[-682,-64]],[[44974,74233],[71,-1675]],[[36614,38546],[891,185]],[[37505,38731],[217,46]],[[37722,38777],[-10,230],[85,280],[116,273],[128,654],[45,300],[-7,197],[66,-9],[16,137]],[[38161,40839],[-74,52],[-35,261],[-99,180],[-104,-106],[-208,124],[-36,-58],[-114,51],[-39,-133],[-96,87],[-70,-121],[-157,-4],[-56,-230],[-78,147],[-126,-71],[-54,-270]],[[36815,40748],[9,-202],[-56,-313],[0,-159],[84,-295],[17,-237],[60,-130],[-64,-367],[-76,42],[-70,-148],[-110,-89],[-28,-184],[33,-120]],[[60298,30536],[168,-11]],[[60466,30525],[595,-41]],[[61061,30484],[24,1104]],[[61085,31588],[-766,51]],[[60319,31639],[-21,-1103]],[[75509,28963],[26,-8],[-128,-1319]],[[75407,27636],[811,-251]],[[76218,27385],[79,549],[108,387],[93,800],[50,207]],[[76548,29328],[-787,247]],[[72890,40960],[22,-4],[-39,-723]],[[72873,40233],[222,-47]],[[73095,40186],[444,-104]],[[73539,40082],[55,841]],[[73594,40923],[11,163]],[[73605,41086],[-695,151]],[[72910,41237],[-20,-277]],[[45776,9987],[27,-723]],[[45803,9264],[777,78]],[[46580,9342],[-35,1054],[67,7],[-22,657],[585,58]],[[47175,11118],[-11,328]],[[47164,11446],[-1169,-119],[36,-983],[-267,-29],[12,-328]],[[16684,13651],[100,9],[102,229],[154,73],[307,31],[81,-106],[286,-72]],[[17714,13815],[-320,2048],[188,86],[-51,325],[189,82],[-50,326],[-53,30]],[[17617,16712],[-245,-100],[-830,-380]],[[16542,16232],[-4,-62]],[[16538,16170],[85,-94],[4,-315],[-61,-61],[-8,-190],[82,-251],[43,-286],[78,-34],[14,-183],[126,-69],[79,52],[32,-144],[-57,-119],[16,-133],[-75,-138],[-12,-142],[-80,-94],[-120,-318]],[[57187,56633],[975,43]],[[58162,56676],[-3,962]],[[58159,57638],[-963,26]],[[57196,57664],[-5,-650]],[[57191,57014],[-4,-381]],[[41670,68855],[853,105]],[[42523,68960],[-67,1649]],[[42456,70609],[-873,-108]],[[41583,70501],[87,-1646]],[[46697,64131],[756,62]],[[47453,64193],[-12,717]],[[47441,64910],[-24,956]],[[46648,65802],[49,-1671]],[[75157,66134],[128,-7],[195,-89],[-4,-67]],[[75476,65971],[185,-33],[99,218]],[[75760,66156],[-121,257],[2,80],[-171,161],[-88,236]],[[75382,66890],[-178,38],[-47,-794]],[[12195,86496],[73,17],[108,374],[403,77]],[[12779,86964],[-58,142],[-29,463],[-18,-4],[-29,463],[48,9],[-22,347],[139,24]],[[12810,88408],[97,134],[-201,128],[-141,162],[-296,104],[-216,-149],[-256,86],[-67,-50],[-124,157],[-121,-79],[-11,171],[-91,276],[-150,71],[-27,-59],[-198,22]],[[11008,89382],[60,-108],[-86,-254],[-43,121],[-68,-32],[0,-240],[-86,-117],[-3,-116],[72,-86],[-50,-94],[-93,29],[21,-165],[125,-7],[-79,-221],[165,10],[-22,-218],[51,-173],[369,-634],[-1,-135],[124,-392],[88,-131],[104,-36],[136,97],[126,269],[99,-9],[92,-173],[86,-71]],[[58406,38284],[628,-3],[27,72],[113,-22]],[[59174,38331],[22,1272]],[[59196,39603],[-383,15]],[[58813,39618],[-387,13]],[[58426,39631],[-20,-1347]],[[49973,63925],[958,40]],[[50931,63965],[-2,670]],[[50929,64635],[-96,-4],[-9,671]],[[50824,65302],[-187,-7],[-2,167],[-95,52],[-383,-17],[-1,111],[-191,-9],[-97,52]],[[49868,65651],[6,-391],[-299,-15],[5,-335]],[[49580,64910],[18,-1006],[375,21]],[[47517,61589],[766,55],[8,-336],[381,24]],[[48672,61332],[-4,168]],[[48668,61500],[-20,1344]],[[48648,62844],[-89,3]],[[48559,62847],[-56,17],[-621,-70],[-8,334],[-191,-14]],[[47683,63114],[-203,-15]],[[47480,63099],[15,-586]],[[47495,62513],[22,-924]],[[49467,27886],[597,27]],[[50064,27913],[-20,1002]],[[50044,28915],[-687,-35]],[[49357,28880],[8,-234],[-133,-206],[-114,-38],[-78,-184],[39,-184],[-54,-166]],[[48389,80589],[652,42]],[[49041,80631],[716,30]],[[49757,80661],[-15,1382]],[[49742,82043],[-641,-29]],[[49101,82014],[-735,-26],[11,-583]],[[48377,81405],[12,-816]],[[45451,67550],[962,75]],[[46413,67625],[-45,1684]],[[46368,69309],[-965,-81]],[[45403,69228],[48,-1678]],[[48064,87681],[1169,39]],[[49233,87720],[0,1]],[[49233,87721],[-28,1696],[-15,551]],[[49190,89968],[-1161,39],[4,-664]],[[48033,89343],[31,-1662]],[[82366,43119],[197,-214],[319,117],[43,71]],[[82925,43093],[39,51],[259,-200],[38,67],[-55,181],[-16,245],[102,22],[-31,415],[-27,28]],[[83234,43902],[-260,37],[-493,-97],[2,-155],[-99,-124]],[[82384,43563],[-28,-51],[10,-393]],[[11095,29152],[1690,808]],[[12785,29960],[185,84]],[[12970,30044],[-166,1035],[20,8],[-286,1707]],[[12538,32794],[-276,-130]],[[12262,32664],[-248,-75],[-52,-97],[-92,26],[-184,-116],[-164,30],[-104,-93],[-222,8],[-357,-66],[-185,-108],[-92,-113],[-250,133],[-128,-211],[-214,-38],[-101,118],[-88,-77],[-162,31]],[[9619,32016],[28,-180],[93,-85],[77,-163],[163,-27],[131,-174],[83,10],[76,-133],[134,-25],[-18,-467],[79,-160],[122,-117],[18,-156],[151,-233],[43,-254],[149,-123],[38,-214],[115,-18],[61,-217],[-67,-128]],[[67468,51595],[-8,-168]],[[67460,51427],[578,-81]],[[68038,51346],[55,1186]],[[68093,52532],[-65,7]],[[68028,52539],[-518,72]],[[67510,52611],[-42,-1016]],[[70234,25440],[659,-98]],[[70893,25342],[78,1330]],[[70971,26672],[-354,53]],[[70617,26725],[-548,53]],[[70069,26778],[149,-669],[16,-669]],[[49430,35985],[760,38]],[[50190,36023],[-20,1340]],[[50170,37363],[-749,-41]],[[49421,37322],[-16,-1]],[[49405,37321],[25,-1336]],[[47702,37210],[934,64]],[[48636,37274],[769,47]],[[49421,37322],[-27,1333],[15,2]],[[49409,38657],[-33,1336]],[[49376,39993],[-365,-20]],[[49011,39973],[-1334,-92]],[[47677,39881],[-23,-1],[38,-1335],[-25,-2]],[[47667,38543],[35,-1333]],[[51783,27992],[765,23]],[[52538,29344],[-383,-12]],[[52155,29332],[-390,-15]],[[51765,29317],[18,-1325]],[[51616,24316],[768,30]],[[52384,24346],[-8,1331]],[[52376,25677],[-10,996]],[[52366,26673],[-574,-19]],[[51792,26654],[-1,-333],[-193,-8]],[[51598,26313],[18,-1997]],[[63695,61712],[-10,-348]],[[63685,61364],[195,-7],[577,-81],[196,8]],[[64653,61284],[38,1145]],[[64691,62429],[-977,77]],[[63714,62506],[-19,-794]],[[34603,52049],[617,125]],[[35220,52174],[-8,117],[731,129],[2,-30]],[[35945,52390],[57,13]],[[36253,54042],[-692,-128],[-11,-32],[-954,-192]],[[34596,53690],[-107,-22]],[[34489,53668],[114,-1619]],[[83545,90253],[585,-150],[-32,-332],[196,-55],[-32,-329],[446,-125]],[[84708,89262],[162,170],[40,743]],[[84910,90175],[-52,744],[-1232,328]],[[83626,91247],[-81,-994]],[[49035,30529],[381,24]],[[49416,30553],[-22,120],[85,124],[143,15],[150,449],[138,245],[136,53],[63,358],[130,40],[130,273],[117,15],[149,141],[41,159]],[[50676,32545],[-1228,-62]],[[49448,32483],[-455,-28]],[[48993,32455],[42,-1926]],[[44734,57188],[957,93]],[[45691,57281],[-54,1702]],[[45637,58983],[0,9]],[[44675,58898],[59,-1710]],[[14460,7194],[196,-198],[163,-369],[7,-96],[100,246],[71,-178]],[[14997,6599],[84,290],[280,137],[36,258],[197,323],[140,47],[89,-74],[144,161],[95,40],[27,127],[150,93],[48,144],[97,38]],[[16384,8183],[-91,306],[-70,41],[-49,202],[-128,139],[32,54],[16,320]],[[16094,9245],[-450,-212],[-140,144],[-170,-179],[-106,-1],[-253,-204]],[[14975,8793],[-141,-172],[32,-138],[-253,-281],[18,-139],[-80,-151],[13,-124],[-100,-96],[-36,-442],[32,-56]],[[14454,6202],[33,-182]],[[14487,6020],[373,185]],[[14860,6205],[-3,107],[-89,183],[18,140],[-123,208],[-98,-311],[89,-284],[-102,94],[-68,180],[11,166],[103,173],[-61,24],[-78,228],[-75,-208],[-49,-382],[85,-84],[34,-237]],[[75321,67145],[423,-83],[23,27]],[[75767,67089],[-23,104],[42,278],[63,161],[101,66],[89,284]],[[76039,67982],[1,141]],[[75384,68373],[-8,-125],[-142,25]],[[75234,68273],[-193,-739]],[[75041,67534],[48,-132],[93,60],[139,-317]],[[77599,64895],[301,-358]],[[77900,64537],[198,115]],[[78098,64652],[-14,225],[75,129],[-47,230]],[[78112,65236],[-93,-6],[-198,-234],[-159,20],[-63,-121]],[[71334,44141],[504,-108]],[[71838,44033],[69,1116]],[[71907,45149],[-226,53]],[[71681,45202],[-283,60]],[[71398,45262],[-64,-1121]],[[52364,49522],[764,15]],[[53128,49537],[-2,336],[191,3]],[[53317,49876],[-3,671],[-31,-1],[-11,1015]],[[53272,51561],[-544,-17]],[[52728,51544],[3,-336],[-381,-5]],[[52350,51203],[14,-1681]],[[58617,22064],[581,-14]],[[59198,22050],[11,659],[188,-6],[14,555]],[[59411,23258],[-769,26]],[[58642,23284],[-10,-550]],[[58632,22734],[-15,-670]],[[50968,34718],[763,25]],[[51731,34743],[-16,1339]],[[51715,36082],[-5,667]],[[51710,36749],[-763,-23]],[[50947,36726],[1,-669]],[[50948,36057],[20,-1339]],[[77767,37214],[-21,-281],[158,-38],[-18,-242],[163,-41],[-23,-287],[156,-40]],[[78182,36285],[317,-90]],[[78499,36195],[92,1101]],[[78591,37296],[-731,174]],[[77860,37470],[-73,17],[-20,-273]],[[73434,59678],[88,-22]],[[73522,59656],[172,-86],[59,-92]],[[73753,59478],[-15,104],[71,177],[353,468]],[[74162,60227],[-27,142],[-210,707]],[[73925,61076],[-48,-285],[-84,-138],[-214,-136],[-5,-42]],[[73574,60475],[84,-165],[25,-193],[-96,-79],[-16,-213],[-137,-147]],[[43648,60472],[971,102]],[[44619,60574],[-59,1683]],[[44560,62257],[-984,-105]],[[43576,62152],[72,-1680]],[[52304,77760],[913,-913]],[[53217,76847],[383,1161]],[[53600,78008],[-445,435]],[[53155,78443],[-1,-18],[-461,469]],[[52693,78894],[-389,-1134]],[[51729,14717],[-19,1314],[40,2],[-5,325]],[[51745,16358],[-772,-31]],[[50973,16327],[5,-327],[-49,-2]],[[50929,15998],[14,-990]],[[50943,15008],[5,-323]],[[50992,30636],[332,15]],[[51324,30651],[-6,1158]],[[51318,31809],[-914,-717],[-43,10],[10,-496]],[[50072,76134],[589,-582],[-94,-294]],[[50567,75258],[388,-371]],[[50955,74887],[436,1341]],[[51391,76228],[-794,773]],[[50597,77001],[-175,175]],[[50422,77176],[-350,-1042]],[[58830,40631],[768,-38]],[[59598,40593],[22,1212]],[[59620,41805],[-465,37]],[[59155,41842],[-307,15]],[[58848,41857],[-18,-1226]],[[42346,18176],[375,54],[16,-337],[294,40]],[[43031,17933],[580,77]],[[43611,18010],[466,59]],[[44077,18069],[-51,1325]],[[44026,19394],[-110,-10]],[[43916,19384],[-563,-70],[-1057,-148]],[[42296,19166],[50,-990]],[[46759,74403],[157,11]],[[47740,74474],[-59,1938]],[[47681,76412],[-737,-65]],[[46719,75897],[40,-1494]],[[25648,51421],[2071,598]],[[27719,52019],[1047,278]],[[28766,52297],[-955,10439]],[[27811,62736],[-51,-192],[-123,136],[-77,-164],[-107,-76],[-94,-215],[-126,-165],[-99,56],[-101,-157],[-57,-191],[-119,65],[-157,-44],[-56,183],[-5,-270],[-150,77],[-67,-33],[156,-105],[-145,-97]],[[26433,61544],[126,-1257],[-405,-118],[66,-675],[-57,1],[-942,-262],[65,-666],[-189,-61],[45,-421],[-65,67],[-185,-75],[-182,-322],[-109,-13],[-68,-86],[-265,-211],[-26,-152],[-271,-420],[-35,-120],[-147,-137],[-128,-34]],[[22959,9893],[614,213],[83,-137],[382,146]],[[24038,10115],[-185,1456]],[[23853,11571],[-192,-72],[7,-54],[-566,-197],[-69,-204],[-77,12],[-11,-191],[-102,-86]],[[22843,10779],[64,-490]],[[22907,10289],[52,-396]],[[49446,53804],[962,45]],[[50408,53849],[-6,335],[203,9]],[[50605,54193],[-17,1490]],[[50588,55683],[-349,-20]],[[50239,55663],[-805,-42]],[[49434,55621],[25,-1484],[-18,-1]],[[49441,54136],[5,-332]],[[54009,29365],[624,4]],[[54633,29369],[20,0]],[[54653,29369],[-2,1340]],[[54651,30709],[-646,-4]],[[98045,13024],[163,-146],[-82,-298],[-321,-979]],[[98141,11265],[139,-2],[3,-69],[140,190],[236,-19],[64,-97],[116,336],[-121,120],[87,211],[87,84],[27,197],[-44,253],[112,164],[97,217],[120,74],[49,-111],[-16,-155],[117,33],[100,-43],[163,283],[162,408],[103,76],[71,368],[-202,774],[-115,150],[-106,-280],[-129,172],[96,148],[-39,172],[-65,-11],[-41,220],[-129,50],[30,103],[112,77],[-86,245],[-98,-108],[-66,-161],[-106,210],[-70,-167],[-5,217],[-40,69],[-4,256],[-58,-25],[-95,120]],[[98737,16014],[-204,-589],[34,-30],[-89,-292],[-27,24],[-278,-916],[175,-158],[-303,-1029]],[[31681,9492],[198,55],[249,-2592],[34,-308]],[[32162,6647],[773,205]],[[32935,6852],[-28,315],[-257,2590]],[[32650,9757],[-106,-28],[-29,323],[-865,-234]],[[31650,9818],[31,-326]],[[51657,21326],[1168,36]],[[52825,21362],[-9,1440]],[[52816,22802],[-215,-7],[-13,-111],[-948,-32]],[[51640,22652],[17,-1326]],[[84695,26527],[414,-182],[132,21],[129,-43],[67,-106],[166,-128],[99,-168]],[[85702,25921],[151,980],[7,218]],[[85467,27299],[-270,96],[-13,-103],[-376,149]],[[84808,27441],[-113,-914]],[[13998,92672],[273,18],[-8,361],[-383,-27]],[[13880,93024],[77,-117],[41,-235]],[[82509,89851],[-40,-491]],[[82469,89360],[970,-259]],[[83439,89101],[106,1152]],[[83545,90253],[-834,210],[-146,49]],[[82565,90512],[-56,-661]],[[74809,64979],[-26,-449],[38,-7],[-33,-512],[19,-179]],[[74807,63832],[96,-45],[397,-70],[-4,-63],[147,-29]],[[75443,63625],[78,1281]],[[75521,64906],[-143,25]],[[75378,64931],[-338,56]],[[75040,64987],[-227,44],[-4,-52]],[[59288,35560],[378,-21]],[[59666,35539],[385,-25]],[[60051,35514],[29,1337]],[[60080,36851],[-770,41]],[[59310,36892],[-22,-1332]],[[48505,52038],[15,-672]],[[48520,51366],[382,23],[-7,335],[572,35]],[[49467,51759],[-13,674],[16,1]],[[49470,52434],[-7,357]],[[49463,52791],[-955,-64]],[[48508,52727],[-3,-689]],[[73180,24913],[763,-170]],[[73943,24743],[103,1319]],[[74046,26062],[-447,97]],[[73599,26159],[-320,73]],[[73279,26232],[-99,-1319]],[[50172,38697],[753,36]],[[50933,38733],[-19,1339]],[[50914,40072],[-727,-34]],[[50187,40038],[-44,-2]],[[50143,40036],[29,-1339]],[[74907,37480],[761,-166]],[[75668,37314],[53,668]],[[75721,37982],[-62,15],[-5,338],[-63,14],[23,333]],[[75614,38682],[-606,128]],[[75008,38810],[-29,-384]],[[74979,38426],[-72,-946]],[[74234,48565],[180,-343],[63,-176]],[[74477,48046],[34,-84]],[[74511,47962],[67,218],[114,132],[74,412]],[[74766,48724],[91,274]],[[74857,48998],[-356,379],[-5,52]],[[74496,49429],[-67,-199],[-127,-69]],[[74302,49161],[-68,-596]],[[73753,59478],[245,-644],[9,-174]],[[74007,58660],[379,-98],[28,93],[197,-100]],[[74611,58555],[-197,596],[-96,203],[26,141],[-74,179],[28,121]],[[74298,59795],[-58,23],[-78,409]],[[83013,53455],[548,-159]],[[83561,53296],[353,-100]],[[83914,53196],[81,1116]],[[83995,54312],[2,32]],[[83997,54344],[-890,200]],[[83107,54544],[-94,-1089]],[[43590,65514],[168,19]],[[43758,65533],[792,84]],[[44550,65617],[-61,1854]],[[44489,67471],[-961,-79]],[[43528,67392],[62,-1878]],[[84285,47090],[67,-140],[69,-6],[11,214],[-83,61],[-64,-129]],[[36169,28775],[680,143]],[[36849,28918],[-3,30],[1065,206],[592,103]],[[38503,29257],[2,85],[-163,2653],[-87,1319]],[[38255,33314],[-896,-157],[-1460,-307]],[[35899,32850],[-31,-6],[92,-1326],[68,14],[92,-1323],[-23,-4],[93,-1315],[-21,-115]],[[56023,79392],[28,-148],[115,-35],[42,251],[60,63]],[[56268,79523],[133,162],[-7,337],[60,136],[95,-87],[91,283],[-41,104],[123,7],[237,112],[-11,202]],[[56948,80779],[13,23],[-618,557]],[[56343,81359],[-276,-229],[-99,-377]],[[65473,25523],[979,-113],[14,336]],[[66466,25746],[-207,27],[55,1327]],[[66314,27100],[-234,33]],[[65541,27198],[-68,-1675]],[[79439,40093],[-26,-344],[100,-23],[-37,-498]],[[79476,39228],[550,-114]],[[80026,39114],[128,-29],[65,1012]],[[80219,40097],[-577,115]],[[79642,40212],[-191,43],[-12,-162]],[[76006,77774],[37,-180],[112,-134],[35,-369],[-34,-558],[35,-115]],[[76191,76418],[354,-111]],[[76545,76307],[65,-11]],[[76610,76296],[249,-54]],[[76859,76242],[99,1482]],[[76958,77724],[-927,107]],[[76031,77831],[-25,-57]],[[61209,80653],[267,-14]],[[61476,80639],[477,-30],[5,167],[130,-10],[9,334],[69,190]],[[62166,81290],[-60,225],[-140,155],[-61,217]],[[61905,81887],[-169,321],[-89,72],[-163,-104],[-101,-134],[-130,98]],[[61253,82140],[6,-319],[51,-103],[-71,-106],[5,-420],[-22,-148],[64,-162],[-77,-229]],[[57875,24984],[386,-12]],[[58261,24972],[5,333],[385,-18],[10,333]],[[58661,25620],[-124,89],[-48,172],[23,115],[-234,268]],[[58278,26264],[-2,-127],[-191,8],[-2,-167],[-193,6]],[[57890,25984],[-15,-1000]],[[67426,50586],[-19,-506]],[[67407,50080],[575,-73]],[[67982,50007],[56,1336]],[[68038,51343],[0,3]],[[67460,51427],[-34,-841]],[[55905,23372],[194,-2]],[[56099,23370],[578,-13],[2,332]],[[56700,25349],[-775,17]],[[55925,25366],[-2,-999]],[[55923,24367],[-15,-330],[-3,-665]],[[67422,26957],[247,-33],[-16,-333],[193,-27]],[[67846,26564],[355,-55]],[[68201,26509],[74,365],[-8,193],[-187,318],[-94,833]],[[67986,28218],[-496,74]],[[67490,28292],[-68,-1335]],[[71963,73751],[769,-139]],[[72732,73612],[69,1180],[-96,18],[29,496]],[[72734,75306],[-381,70]],[[72353,75376],[-261,39],[-55,-73],[-95,-317],[-24,-460]],[[71918,74565],[-19,-296]],[[71899,74269],[-32,-500],[96,-18]],[[77331,68193],[486,-264]],[[77817,67929],[211,-100]],[[78028,67829],[54,298],[155,660]],[[78237,68787],[-82,127]],[[78155,68914],[-182,248]],[[77973,69162],[-171,-128],[-110,25],[-115,-226]],[[77577,68833],[-99,-407],[-147,-233]],[[58808,32890],[770,-34]],[[59578,32856],[22,1348]],[[59600,34204],[-773,35]],[[58827,34239],[-19,-1349]],[[71880,36715],[760,-157]],[[72640,36558],[70,1003]],[[72710,37561],[-191,38]],[[72519,37599],[-381,65],[-6,-112],[-191,38]],[[71941,37590],[-37,-544]],[[71904,37046],[-24,-331]],[[45544,45404],[1104,102]],[[46648,45506],[36,3]],[[46684,45509],[-51,1675]],[[46633,47184],[-155,-13]],[[46478,47171],[-994,-98]],[[45484,47073],[60,-1669]],[[72136,26450],[375,-64]],[[72511,26386],[387,-75]],[[72898,26311],[96,1314]],[[72224,27787],[-88,-1337]],[[72336,23734],[747,-143]],[[73083,23591],[97,1322]],[[73180,24913],[-759,142]],[[72421,25055],[-85,-1321]],[[59881,54025],[-2,-279],[383,-8]],[[60262,53738],[293,-7]],[[60555,53731],[7,841],[24,0],[3,757]],[[60589,55329],[-384,9]],[[60205,55338],[-1,-57],[-286,2]],[[59918,55283],[-6,-699],[-27,1],[-4,-560]],[[44836,36936],[925,92]],[[45761,37028],[32,3]],[[45793,37031],[-46,1337]],[[45747,38368],[-959,-96]],[[44788,38272],[48,-1336]],[[51686,39610],[107,-233],[283,-370]],[[52076,39007],[127,-107],[121,-23],[137,-103]],[[52461,38774],[-11,1346]],[[52450,40120],[-766,-21]],[[51684,40099],[2,-489]],[[52384,24346],[422,10]],[[52806,24356],[539,16],[-1,664]],[[53344,25036],[-7,660]],[[53337,25696],[-961,-19]],[[49190,89968],[927,42]],[[50117,90010],[196,7]],[[50313,90017],[-36,3027]],[[49697,93009],[6,-297],[-133,-65],[-417,-2]],[[49153,92645],[37,-2677]],[[43711,58797],[964,101]],[[44619,60559],[0,15]],[[43648,60472],[1,-29]],[[43649,60443],[62,-1646]],[[43106,72363],[16,2]],[[43122,72365],[961,95]],[[44083,72460],[-70,1678]],[[44013,74138],[-153,-14]],[[43860,74124],[-818,-88]],[[43042,74036],[64,-1673]],[[77042,40172],[166,-22],[-58,-784],[32,-7]],[[77182,39359],[476,-137]],[[77658,39222],[190,-99]],[[77848,39123],[67,-36],[29,448]],[[77944,39535],[52,834]],[[77996,40369],[-473,91],[-4,-73],[-464,65]],[[77055,40452],[-13,-280]],[[52972,76127],[405,-401]],[[53377,75726],[420,76]],[[53797,75802],[490,1473]],[[54287,77275],[-164,150],[7,65]],[[54130,77490],[-530,518]],[[53217,76847],[-245,-720]],[[61912,33716],[774,-72]],[[62686,33644],[44,1344]],[[62730,34988],[-382,31]],[[62348,35019],[-384,31]],[[61964,35050],[-18,-664],[-18,1],[-16,-671]],[[52450,40120],[764,19]],[[53214,40139],[-12,1342]],[[53202,41481],[-764,-19]],[[52438,41462],[12,-1342]],[[46702,85887],[1363,73]],[[48065,85960],[-27,1720]],[[48038,87680],[-1384,-123]],[[46654,87557],[48,-1670]],[[12583,36035],[115,-74],[74,-244],[120,-85],[98,308],[62,-9],[94,208],[90,-73],[807,358]],[[14043,36424],[218,92],[31,-41]],[[14292,36475],[-159,1035]],[[14133,37510],[-823,-371],[-79,-340],[-129,-76],[-209,200],[-476,26]],[[12417,36949],[52,-467],[-26,-102],[69,-56],[71,-289]],[[65532,33910],[58,-6]],[[65590,33904],[696,-66]],[[66286,33838],[58,1315]],[[66344,35153],[-382,56],[-9,-207],[-366,53]],[[65587,35055],[-55,-1145]],[[94461,20597],[307,-230]],[[94768,20367],[39,69],[102,-99],[75,35],[45,322],[132,-5],[33,-119],[180,197],[-32,157],[258,163]],[[95600,21087],[-26,169],[70,194],[-72,232],[34,96],[-171,178],[-39,367],[44,88],[-21,358],[-41,275],[-42,61]],[[95336,23105],[-219,-148]],[[95117,22957],[-36,-80],[-13,-268],[-289,-340],[-94,-273],[26,-108],[-62,-380]],[[94649,21508],[-33,-100],[-155,-811]],[[89013,42152],[-13,-224],[64,-189],[51,-375],[130,-185]],[[89245,41179],[192,1166]],[[89437,42345],[118,724]],[[89555,43069],[-118,-157],[-135,-20],[-167,179]],[[89135,43071],[-143,-163],[58,-223],[102,-166],[-65,-81],[-74,-286]],[[72997,22284],[188,-39]],[[73185,22245],[569,-136]],[[73754,22109],[51,650],[-16,4],[52,659]],[[73841,23422],[-758,169]],[[73083,23591],[-86,-1307]],[[53519,18713],[9,14]],[[53528,18727],[61,243],[13,332],[103,396],[104,173],[5,421],[62,519],[-35,237]],[[53841,21048],[19,331]],[[53860,21379],[-1035,-17]],[[52825,21362],[1,-218],[-48,-19],[9,-1088],[-33,-1]],[[52754,20036],[12,-1323]],[[80652,38104],[-78,-809]],[[80574,37295],[594,-184]],[[81168,37111],[85,683]],[[81253,37794],[29,230],[-57,32],[-252,587]],[[80973,38643],[-262,75]],[[80711,38718],[-59,-614]],[[41670,68855],[38,-698]],[[41708,68157],[52,-974]],[[41760,67183],[794,96]],[[72898,26311],[381,-79]],[[73599,26159],[45,627]],[[73644,26786],[46,652]],[[73690,27438],[-318,58],[4,56],[-382,73]],[[41629,44279],[49,-1005]],[[41678,43274],[395,53],[64,-1338],[25,-332]],[[42162,41657],[1152,140]],[[43314,41797],[-37,332],[-55,1342],[-18,-2],[-69,1673]],[[43135,45142],[-598,-67]],[[42537,45075],[-941,-129]],[[41596,44946],[33,-667]],[[61137,33781],[775,-65]],[[61964,35050],[-384,19]],[[61580,35069],[-383,35]],[[57280,33959],[770,-23]],[[58050,33936],[5,333]],[[58055,34269],[4,331],[65,-2],[13,1008]],[[58137,35606],[-383,13]],[[57754,35619],[-383,15]],[[57371,35634],[-10,-1016],[-74,2],[-3,-329]],[[57284,34291],[-4,-332]],[[47358,51954],[1147,84]],[[48508,52727],[-17,1031]],[[48491,53758],[-383,-25],[-583,-70]],[[47525,53663],[-192,-15]],[[47333,53648],[38,-1356],[-13,-338]],[[73841,23422],[0,1]],[[73841,23423],[102,1320]],[[67181,70694],[561,-67],[193,-7]],[[67935,70620],[58,1341]],[[67993,71961],[-753,96]],[[67240,72057],[-59,-1363]],[[48616,41343],[379,78]],[[48995,41421],[399,64]],[[49394,41485],[-24,1194]],[[49370,42679],[-761,-49]],[[48609,42630],[-20,-1]],[[48589,42629],[27,-1286]],[[53058,36113],[322,6]],[[53380,36119],[442,7],[0,285]],[[53822,36411],[-4,1055]],[[53818,37466],[-581,-11]],[[53237,37455],[-188,-4]],[[53049,37451],[9,-1338]],[[78981,59990],[147,-148],[94,-4],[61,-201],[78,71]],[[79361,59708],[245,-76]],[[79606,59632],[94,1323],[165,212]],[[79865,61167],[-100,798],[20,194],[-124,233]],[[79661,62392],[-209,-219],[-89,-257],[-56,-451],[11,-127],[-76,-149]],[[79242,61189],[-37,-286],[-59,-109],[-59,-331],[-99,53],[-13,-199],[-153,19],[-125,96],[-33,-71]],[[78664,60361],[59,-115],[258,-256]],[[46064,70957],[254,23]],[[46318,70980],[698,66]],[[47016,71046],[-47,1679]],[[46969,72725],[-962,-86]],[[46007,72639],[57,-1682]],[[85845,54033],[136,-1],[47,-293],[71,-20],[41,-138]],[[86140,53581],[314,-24],[68,124],[172,-31]],[[86694,53650],[-277,1600]],[[86417,55250],[-73,-197],[-220,-174],[-73,-126],[-230,-111]],[[85821,54642],[-22,-225],[46,-384]],[[73310,36814],[762,-163]],[[74072,36651],[187,-41],[73,1002]],[[74332,37612],[-187,41]],[[74145,37653],[-12,-167],[-191,39],[-13,-168],[-573,121]],[[73356,37478],[-5,-72]],[[73351,37406],[-41,-592]],[[70586,60553],[134,-110],[311,101]],[[71031,60544],[66,45],[54,334],[152,170]],[[71303,61093],[44,1046]],[[71347,62139],[-678,82]],[[70669,62221],[-24,2]],[[70645,62223],[-8,-478],[-55,-991],[4,-201]],[[48333,67770],[962,56]],[[49295,67826],[-32,1679]],[[49263,69505],[-960,-61]],[[48303,69444],[24,-1289]],[[48327,68155],[6,-385]],[[57567,73471],[98,120],[106,-20],[64,152],[575,-271]],[[58410,73452],[10,754]],[[58420,74206],[8,755],[58,66]],[[58486,75027],[-941,59]],[[57545,75086],[-167,7],[-6,-410],[36,-472],[91,-268],[67,-327],[1,-145]],[[20029,9119],[1510,626]],[[21539,9745],[-215,1451],[-60,50],[-49,228],[-123,-26],[-192,79]],[[20900,11527],[-350,-136],[-1382,-584]],[[19168,10807],[96,-645],[574,249],[191,-1292]],[[58137,35606],[384,-13]],[[58521,35593],[19,1331]],[[58540,36924],[-194,8]],[[58346,36932],[-576,21]],[[57770,36953],[-16,-1334]],[[50251,69558],[3,-272]],[[50254,69286],[819,31]],[[51073,69317],[-2,129],[113,3]],[[51158,71113],[-251,-17]],[[50907,71096],[-689,-45]],[[50218,71051],[33,-1493]],[[53317,49876],[807,11]],[[54124,49887],[-9,1347]],[[53826,51565],[-554,-4]],[[51391,76228],[147,-143],[155,477]],[[51693,76562],[345,1037]],[[52038,77599],[-940,934]],[[51098,78533],[-501,-1532]],[[72809,30356],[756,-152]],[[73565,30204],[101,1304]],[[73666,31508],[1,22],[-387,81]],[[73280,31611],[-380,75]],[[72900,31686],[-91,-1330]],[[54808,51748],[767,4]],[[55575,51752],[2,841],[-10,338]],[[55567,52931],[-762,-3]],[[66344,35153],[384,-54]],[[66728,35099],[192,-26]],[[66920,35073],[-7,337],[61,1332]],[[66974,36742],[15,339]],[[66989,37081],[-556,84]],[[66433,37165],[-48,-1011]],[[66385,36154],[-41,-1001]],[[57298,40681],[764,-14]],[[58062,40667],[14,1245]],[[58076,41912],[-364,20]],[[57712,41932],[-402,16]],[[57310,41948],[-12,-1267]],[[55468,37000],[768,-9]],[[56236,36991],[6,1006],[86,-2],[2,376]],[[56330,38371],[-189,1]],[[56141,38372],[-570,3]],[[55571,38375],[-1,-370],[-100,0],[-2,-1005]],[[11859,46070],[79,568],[-38,176],[119,263],[-16,94],[233,165],[289,-94],[82,80],[90,-65],[66,56],[114,-48],[116,85],[194,-394],[223,-117],[69,-158],[60,55],[71,-135],[-47,-71],[116,-73],[43,174],[108,-167],[55,81],[134,-166],[52,-405],[115,-196],[566,-599]],[[14752,45179],[62,141],[98,67],[74,327],[98,-10],[24,112]],[[15108,45816],[-78,473],[130,195],[19,180],[-42,91],[20,366],[86,44],[225,423],[-2,248],[40,400],[-28,207],[-47,8],[7,354]],[[15438,48805],[-1074,-434],[-50,314],[-549,-247],[-48,325],[-278,-125],[-232,244]],[[13207,48882],[-199,192],[-161,-3],[-355,-151],[-123,820],[-772,750]],[[11597,50490],[-46,-247],[-124,-75],[-55,-190],[-161,-319],[2,-117],[-79,-62],[-8,-228],[101,-110],[-52,-279]],[[11037,46911],[573,-587],[112,51],[13,-178],[124,-127]],[[57289,39687],[382,-10]],[[57671,39677],[380,-11]],[[58051,39666],[11,1001]],[[57298,40681],[-9,-994]],[[65348,39149],[287,-33]],[[65635,39116],[228,-25],[-42,176],[327,-41]],[[66148,39226],[191,-27],[30,688]],[[66369,39887],[-709,104]],[[65660,39991],[33,-205],[-319,35]],[[65374,39821],[-26,-672]],[[67024,43170],[-8,-168],[96,-12],[-7,-168],[167,-561]],[[67272,42261],[192,-27]],[[67464,42234],[69,1549]],[[67533,43783],[-3,338]],[[67530,44121],[-462,60]],[[67068,44181],[-44,-1011]],[[56527,39701],[379,-7]],[[56906,39694],[383,-7]],[[57298,40681],[-766,14]],[[56532,40695],[-5,-994]],[[68067,47703],[537,-87]],[[68604,47616],[65,-9]],[[68669,47607],[47,1078]],[[68716,48685],[-72,10]],[[68644,48695],[-334,52]],[[68310,48747],[-6,-111],[-183,20]],[[68121,48656],[-81,-123],[38,-115],[-32,-264],[44,-4],[-23,-447]],[[67646,60996],[47,-4],[241,-270],[94,-396]],[[68028,60326],[87,-7],[121,274],[169,92],[89,-53],[19,283]],[[68513,60915],[4,146]],[[68517,61061],[-368,45],[-130,100],[-78,207],[-44,248],[-112,14]],[[67785,61675],[-34,-311],[-98,-201],[-7,-167]],[[72338,34504],[764,-154]],[[73102,34350],[85,1194]],[[73187,35544],[-611,122]],[[72576,35666],[-157,30]],[[72419,35696],[-81,-1192]],[[83213,55830],[901,-183]],[[84114,55647],[21,215]],[[84135,55862],[103,1254]],[[84238,57116],[-375,126]],[[83863,57242],[-529,177]],[[83334,57419],[-121,-1589]],[[44360,46965],[975,95]],[[45335,47060],[-67,1673]],[[45268,48733],[-142,-12]],[[45126,48721],[-825,-78]],[[44301,48643],[48,-1347]],[[44349,47296],[11,-331]],[[73016,42390],[658,-133]],[[73674,42257],[21,338]],[[73695,42595],[48,729]],[[73743,43324],[-373,65],[3,56]],[[73373,43445],[-255,47],[-16,-280],[-63,12]],[[73039,43224],[-22,-326],[34,-8],[-35,-500]],[[87261,51454],[96,88],[-79,58],[-17,-146]],[[46649,57364],[965,73]],[[47614,57437],[6,0],[-43,1712]],[[47577,59149],[-965,-78]],[[46612,59071],[-12,-1]],[[46600,59070],[49,-1706]],[[72034,56767],[2,-409],[63,-145]],[[72099,56213],[69,6],[48,141],[339,9]],[[72555,56369],[1,117],[-165,187],[-85,246]],[[72306,56919],[-135,-157],[-67,154],[-70,-149]],[[29135,50294],[175,-318],[124,-61],[39,-170],[117,-229],[-71,-135],[75,-33],[79,-240],[324,38],[37,-172],[147,-224],[97,44],[32,-149],[105,-225],[88,-3],[80,-133]],[[30583,48284],[85,-118],[-46,-156],[-2,-233],[-70,-303],[-69,-125],[60,-107],[23,-243],[-33,-86]],[[30531,46913],[1655,406]],[[32186,47319],[-70,858],[-6,476]],[[32110,48653],[-84,1040]],[[32026,49693],[-125,1514]],[[31901,51207],[-153,1857]],[[31748,53064],[-1673,-406]],[[30075,52658],[-820,-212],[-51,-38],[-438,-111]],[[27719,52019],[128,-108],[77,75],[125,-261],[225,64],[173,-54],[114,-165],[59,-282],[99,-238],[181,-50],[38,-76],[-37,-151],[102,-76],[-73,-120],[154,-131],[51,-152]],[[59932,38223],[190,-12]],[[60122,38211],[572,-38]],[[60694,38173],[33,1338]],[[60343,39538],[-383,23]],[[59960,39561],[-28,-1338]],[[23764,3862],[1427,529]],[[25191,4391],[-231,1844]],[[24960,6235],[-1076,-396],[166,-1280],[-360,-135]],[[23690,4424],[74,-562]],[[65533,42329],[571,-88]],[[66104,42241],[9,171],[191,-28]],[[66304,42384],[45,896]],[[66349,43280],[24,503],[-126,19]],[[66247,43802],[-318,34],[-135,-42],[-7,-167],[-160,21]],[[65627,43648],[-19,-448],[-43,-111]],[[65565,43089],[-32,-760]],[[55599,49047],[767,-9]],[[56366,49038],[-15,169],[6,1177]],[[56357,50384],[-767,9]],[[55590,50393],[-1,-169]],[[55589,50224],[-2,-1008],[12,-169]],[[59666,73331],[256,-12],[-3,-169],[167,-13],[-67,-495]],[[60019,72642],[557,-31]],[[60576,72611],[13,503],[191,-8]],[[60780,73106],[24,835],[-50,100],[-21,246]],[[60733,74287],[-234,10]],[[60499,74297],[-467,22]],[[60032,74319],[-55,-332],[-404,18]],[[59573,74005],[37,-188],[-39,-93],[41,-231],[-40,-110],[94,-52]],[[11889,40237],[158,-9],[84,55],[130,-81],[155,121],[141,238],[193,57],[423,-4],[150,-210],[136,3],[49,-174],[91,0]],[[13599,40233],[-110,720]],[[13489,40953],[-222,-59],[-141,34],[-187,-28],[-46,-67],[-88,64],[-292,97],[-56,152],[-330,81],[-185,180],[-165,-91]],[[11777,41316],[-9,-304]],[[11768,41012],[121,-775]],[[13921,38921],[-36,255],[124,319]],[[14009,39495],[10,256],[-200,287],[-220,195]],[[11889,40237],[-29,-848],[-40,1]],[[11820,39390],[128,-354],[84,-82],[75,-245],[67,22],[127,-120],[129,100],[106,-143],[139,48],[111,288],[99,165],[110,-17],[88,-97],[96,-208],[175,102],[244,75],[88,-106],[235,103]],[[61596,58376],[831,-30]],[[62427,58346],[30,340],[12,633],[-48,2],[4,228]],[[62425,59549],[-77,2],[-165,304]],[[62183,59855],[-85,-53],[-107,-181],[-91,54],[-79,-87],[-116,34],[46,-116],[-29,-152],[73,-116],[-103,-109],[-51,-181],[-88,33],[-14,-105]],[[61539,58876],[-37,-161],[97,-1],[-3,-338]],[[83674,48560],[95,-33],[-60,205],[-35,-172]],[[84212,53105],[-222,67]],[[83990,53172],[10,-143],[-119,-69],[25,-65],[145,25],[25,-177],[192,230],[-56,132]],[[81379,53411],[87,-106],[-48,178]],[[81418,53483],[-39,-72]],[[84196,45674],[59,-185],[99,202],[-137,162],[-21,-179]],[[83175,52853],[30,-116],[79,6],[33,217],[-142,-107]],[[70618,38305],[647,-119]],[[71265,38186],[23,337],[95,-22],[10,169],[122,-25]],[[71515,38645],[9,167]],[[71524,38812],[-369,79],[19,330]],[[71174,39221],[-499,87]],[[70675,39308],[-57,-1003]],[[56895,38361],[762,-19]],[[57657,38342],[14,1335]],[[56906,39694],[-11,-1333]],[[9578,45787],[147,-165],[146,50],[17,89]],[[11597,50490],[67,35],[39,177],[-45,63],[47,243]],[[11705,51008],[-1561,-725],[-401,-194]],[[9743,50089],[-147,-430],[-2,-460],[-102,-133],[-48,-394],[-102,-372],[-143,-224],[-88,-377],[26,-244],[-5,-418],[61,-269],[-51,-116],[111,-154],[40,150],[143,-153],[152,-516],[-10,-192]],[[62881,47724],[130,-9],[6,232],[136,-11],[5,228],[263,-16]],[[63421,48148],[28,1247]],[[63449,49395],[-202,-221],[-94,51],[-165,-76],[-4,-82],[-155,-233],[-96,36]],[[62733,48870],[-86,-33]],[[62647,48837],[-10,-523],[260,-16],[-16,-574]],[[81638,55041],[318,-215],[64,45],[38,-144],[61,49],[74,-82],[31,93],[122,-35],[32,63]],[[82378,54815],[61,384],[-118,211],[51,168]],[[82372,55578],[-350,80]],[[82022,55658],[-334,75]],[[81688,55733],[-50,-692]],[[73085,28957],[381,-80]],[[73466,28877],[96,1287]],[[73562,30164],[3,40]],[[72809,30356],[-43,-662],[-17,4],[-46,-664]],[[75904,51361],[110,-502],[112,-218],[47,-15]],[[76173,50626],[24,-5]],[[76197,50621],[173,154],[173,72]],[[76543,50847],[-60,528]],[[76483,51375],[-109,-107],[-69,125],[-92,-16],[-12,108],[-148,61],[-107,-96]],[[75946,51450],[-42,-89]],[[55567,52931],[766,-9]],[[56333,52922],[1,224]],[[56334,53146],[6,1122]],[[56340,54268],[-761,9]],[[55579,54277],[-8,0]],[[55571,54277],[-4,-1346]],[[72042,30508],[767,-152]],[[72900,31686],[-384,76]],[[72516,31762],[-381,78]],[[72135,31840],[-93,-1332]],[[71482,33314],[361,-70]],[[71843,33244],[398,-70]],[[72241,33174],[97,1330]],[[72338,34504],[-768,154]],[[71570,34658],[-88,-1344]],[[69620,52124],[145,-162]],[[69765,51962],[269,196],[301,166],[102,7]],[[70437,52331],[-97,326],[20,248]],[[70360,52905],[-125,29],[-63,137],[-151,-18]],[[70021,53053],[-103,-113],[-16,-360],[-56,-191]],[[69846,52389],[-164,-68],[-62,-197]],[[55595,28035],[565,-4]],[[56160,28031],[16,333],[384,-7]],[[56560,28357],[8,997]],[[56568,29354],[-952,15]],[[55616,29369],[-16,1]],[[55600,29370],[-5,-1335]],[[70971,26672],[408,-78]],[[71379,26594],[89,1331]],[[70709,28065],[-92,-1340]],[[70709,28065],[-629,96]],[[70080,28161],[-86,-570],[-101,-318],[121,-259],[55,-236]],[[71468,27925],[756,-138]],[[72320,29111],[-767,140]],[[70108,29495],[680,-100]],[[71230,29988],[20,336]],[[71250,30324],[-189,31],[22,333],[-588,107]],[[70495,30795],[-245,-721],[-142,-579]],[[58512,29293],[388,-17]],[[58900,29276],[573,-30]],[[59473,29246],[25,1339]],[[59498,30585],[-723,36]],[[58775,30621],[-244,10]],[[58531,30631],[-19,-1338]],[[66334,47230],[-31,-729],[189,-25]],[[66492,46476],[573,-66]],[[67065,46410],[49,1173],[194,-37]],[[67308,47546],[13,340]],[[67321,47886],[-761,105],[13,339]],[[66573,48330],[-200,2]],[[66373,48332],[-47,-989],[8,-113]],[[67065,46410],[572,-71]],[[67637,46339],[8,168],[188,-25]],[[67833,46482],[46,1002]],[[67879,47484],[-571,62]],[[58222,21745],[21,1002]],[[58243,22747],[-610,25]],[[57633,22772],[-87,-228],[6,-188],[-119,-404]],[[57433,21952],[-129,-175],[918,-32]],[[45530,62354],[990,82]],[[46520,62436],[-50,1676]],[[46470,64112],[-735,-65]],[[45735,64047],[-265,-23]],[[55094,20725],[969,-7]],[[56063,20718],[16,1273]],[[56079,21991],[0,55]],[[56079,22046],[-965,6]],[[55114,22052],[-2,-664],[-17,0],[-1,-663]],[[50786,58907],[190,7]],[[50976,58914],[766,27]],[[51742,58941],[-15,1692]],[[51727,60633],[-958,-30]],[[66957,58079],[345,-32],[-1,-82]],[[67301,57965],[228,355],[134,26],[141,174]],[[67804,58520],[22,1048]],[[67826,59568],[-376,25]],[[67450,59593],[-95,-103],[-263,-104],[-64,-400],[-99,-111]],[[66929,58875],[40,-107],[-12,-689]],[[68650,58182],[59,-115],[60,-283],[86,-172],[-45,-191],[4,-187],[186,-31]],[[69000,57203],[19,24]],[[69019,57227],[52,152],[25,264]],[[69096,57643],[76,308],[0,118],[-127,414],[-6,316],[156,20],[-11,271],[-35,102]],[[69149,59192],[-10,99]],[[69139,59291],[-102,33],[-7,-110],[-267,14]],[[68763,59228],[-71,7],[-42,-1053]],[[81997,65855],[71,92],[209,84],[286,203],[195,200],[28,128],[83,81]],[[82869,66643],[-161,245],[4,253],[-72,-145],[-240,361]],[[82400,67357],[-236,-295]],[[82164,67062],[-78,-143],[-57,-908],[-32,-156]],[[49265,85418],[768,557]],[[50033,85975],[410,903]],[[50443,86878],[177,371]],[[50620,87249],[-474,646]],[[50146,87895],[2,-135],[-915,-39]],[[49233,87720],[21,-1690]],[[49254,86030],[11,-612]],[[51324,30651],[242,6]],[[51566,30657],[578,16]],[[52144,30673],[331,9]],[[52468,31951],[-386,-8]],[[52082,31943],[-713,-23]],[[51369,31920],[-51,-111]],[[42034,24047],[29,-8],[40,-810]],[[42103,23229],[1698,230]],[[43801,23459],[-29,661]],[[43772,24120],[-82,1661],[-955,-124]],[[41956,25674],[78,-1627]],[[23535,91888],[96,-462]],[[23631,91426],[76,171],[265,402]],[[23972,91999],[-52,77],[-116,-133],[-217,-29],[-13,76]],[[23574,91990],[-39,-102]],[[23513,91993],[14,-65]],[[23527,91928],[-14,65]],[[23011,91654],[1,178],[49,65],[176,-268]],[[23237,91629],[16,105],[173,287],[60,227],[-112,-215],[-88,-62],[55,162],[118,142],[86,314],[-178,553],[-43,18],[-62,-238],[37,-251],[-86,-125],[-96,-243],[-14,-143],[-169,-454],[-60,-244],[137,192]],[[22285,90354],[0,0]],[[22956,92319],[-68,27],[-299,-173],[-14,233],[-138,74]],[[22437,92480],[-100,-85],[-24,-198],[61,-128],[-39,-153],[85,100],[98,-88],[58,-146],[164,133],[210,16],[45,154],[-74,88],[86,54],[-51,92]],[[21622,91487],[144,-199]],[[21766,91288],[222,-445],[94,-51],[16,-139]],[[22098,90653],[246,0],[89,59],[114,251],[-50,73],[0,166],[84,7],[130,199],[-67,44],[40,119]],[[22684,91571],[-78,-1],[-99,114],[-52,-307],[-111,-222],[-48,110],[-114,-66],[-46,-158],[-33,119],[-95,-53],[-7,89],[133,14],[132,153],[58,1],[130,346],[-120,172],[-65,3],[-42,154],[-132,-181],[-66,30],[-218,-176],[-189,-225]],[[49503,25196],[940,52]],[[50443,25248],[18,1],[-17,1006]],[[50444,26255],[-20,1676]],[[50424,27931],[-360,-18]],[[52366,26673],[578,17]],[[52944,26690],[-12,1330]],[[51783,27992],[-7,0]],[[51776,27992],[16,-1338]],[[69739,60001],[120,-187],[72,78],[163,33],[207,-202]],[[70301,59723],[-8,289],[128,145],[32,222],[-27,155]],[[70426,60534],[-59,-37],[-221,29],[7,143],[-118,105],[-105,15]],[[69930,60789],[-65,-136],[-72,-12],[-5,-118],[-130,-22]],[[69658,60501],[44,-257],[58,-89],[-21,-154]],[[64080,22996],[-26,-660]],[[64054,22336],[961,-110],[19,336]],[[65034,22562],[52,1328]],[[65086,23890],[-972,106]],[[64114,23996],[-34,-1000]],[[67192,60030],[90,72],[212,-463],[-44,-46]],[[67826,59568],[179,-17]],[[68005,59551],[23,775]],[[67646,60996],[-428,41]],[[67218,61037],[-26,-1007]],[[85035,47024],[47,-183],[66,19],[6,144],[-119,20]],[[33651,17704],[385,93],[84,-1023],[23,6],[63,-766]],[[34206,16014],[18,-218],[578,141]],[[34802,15937],[-40,489],[18,171],[129,33],[-27,329],[56,160],[-28,328],[101,359],[-44,548]],[[34967,18354],[-223,-52]],[[34744,18302],[-755,-180],[-29,331]],[[33960,18453],[-289,-72],[29,-330],[-76,-19],[27,-328]],[[38503,29257],[98,16]],[[38601,29273],[1506,246]],[[40107,29519],[289,43]],[[40396,29562],[-147,2724],[-28,686]],[[40221,32972],[-642,-94],[-34,669]],[[39545,33547],[-79,-12],[-60,201],[-41,327],[-247,-38],[-140,-84],[16,-280],[63,12],[44,-198],[-842,-160]],[[38259,33315],[-4,-1]],[[78384,55117],[143,-1],[259,-145],[83,9],[74,113],[124,-6]],[[79067,55087],[-25,567]],[[79042,55654],[-139,417],[-158,61],[-103,230]],[[78642,56362],[-109,-169],[-52,-1021],[-128,36]],[[78353,55208],[31,-91]],[[62707,23477],[-10,-333],[386,-31]],[[63083,23113],[347,-30],[650,-87]],[[64114,23996],[-242,24],[12,332],[-185,18]],[[63699,24370],[-186,30],[-771,73]],[[62742,24473],[-35,-996]],[[31091,21746],[406,103],[121,74],[790,192],[142,7],[486,129]],[[33036,22251],[1087,251],[30,31],[723,165]],[[34876,22698],[-37,490],[44,10],[-104,1330],[30,8],[-105,1338],[37,9]],[[34741,25883],[-27,338]],[[34714,26221],[-383,-88],[-26,337],[-197,-46],[-21,329],[-286,-66],[-28,329],[-350,-67]],[[33423,26949],[-76,-132],[-93,-362],[-179,-138],[-166,160],[-36,195],[-215,126],[-88,-100],[63,-228],[-55,-170],[25,-102],[-220,-37],[-73,-242]],[[32310,25919],[34,-388],[-104,-155],[41,-248],[-27,-307],[-81,-100],[-20,-271],[-86,-235],[52,-246],[-4,-173],[-135,-114],[7,-76],[-452,-118],[29,-316],[-607,-164]],[[30957,23008],[118,-1267],[16,5]],[[54635,28037],[751,1]],[[55386,28038],[209,-3]],[[55600,29370],[-947,-1]],[[54633,29369],[2,-1332]],[[66822,31065],[191,-21]],[[67013,31044],[574,-70]],[[67587,30974],[54,1337]],[[67641,32311],[-383,59]],[[67258,32370],[-383,49]],[[66875,32419],[-53,-1354]],[[54014,28033],[597,3]],[[54611,28036],[24,1]],[[54009,29365],[5,-1332]],[[87008,45106],[88,37],[248,-229],[56,-147],[65,80],[-4,249],[71,108]],[[87532,45204],[-72,94],[15,384]],[[87475,45682],[-87,76]],[[87388,45758],[-189,-120],[-63,53],[26,-218],[-175,48]],[[86987,45521],[-39,-51],[3,-332],[57,-32]],[[26874,17822],[54,-31],[12,-180],[85,-110],[49,136],[241,-283],[165,27],[110,-85],[42,-210]],[[27632,17086],[31,20],[85,686],[109,-147],[95,11],[91,-159],[85,-47],[118,51],[14,86]],[[28260,17587],[128,242],[121,147],[174,117],[44,315],[51,52],[1,201]],[[28779,18661],[-63,337],[1,193],[81,191],[75,65],[115,-17],[45,205],[-106,1153],[191,58],[-34,331],[222,66],[-32,331],[37,12],[-33,323],[158,50],[-16,160],[443,138],[-27,272],[468,134]],[[30304,22663],[-2,167],[-104,206],[69,225],[-54,31],[-124,-124],[-55,37]],[[30034,23205],[-132,-80],[-24,58],[-179,82],[-56,-229],[-183,54],[-78,-62],[-126,64],[-116,-82],[-79,-159],[-67,-22],[-129,116],[-76,292],[-122,-161],[-49,51],[-71,-106],[-172,-55],[-84,-98],[-105,44],[-110,208],[16,183]],[[28092,23303],[-55,56],[-50,-162],[-162,-264],[-17,-185],[41,-100],[-89,-324],[55,-57],[1,-227],[-40,-82],[-22,-300],[-160,-245],[-163,97],[-8,-139],[-135,-221],[-28,-332],[84,-18],[28,-377],[-92,-161],[19,-80],[-89,-80],[-13,-248],[-106,-278],[-49,-294],[30,-252],[-51,-260],[56,-237],[-106,-35],[77,-292],[-124,-203],[-50,-181]],[[32866,15613],[249,-45],[131,44],[96,-40],[208,281],[113,26]],[[33663,15879],[543,135]],[[33651,17704],[-962,-248]],[[32689,17456],[91,-1015],[12,3],[74,-831]],[[58958,55293],[960,-10]],[[60205,55338],[8,1009]],[[60213,56347],[-700,7]],[[59513,56354],[-67,1],[-3,-676],[-482,9]],[[58961,55688],[-3,-395]],[[59815,48185],[0,-170],[190,-366]],[[60005,47649],[37,165],[109,145],[106,33],[130,-54],[272,35]],[[60659,47973],[107,181]],[[60766,48154],[-186,890],[1,56],[-385,8]],[[60196,49108],[-381,-15]],[[59815,49093],[0,-908]],[[51444,45463],[960,28]],[[52404,45491],[-3,335]],[[52401,45826],[-11,1007]],[[52390,46833],[-958,-30]],[[51432,46803],[8,-1005]],[[51440,45798],[4,-335]],[[87726,45928],[81,-214],[119,191],[124,87],[2,120],[197,7],[44,46]],[[88293,46165],[150,85],[42,232],[83,89]],[[88568,46571],[-97,40],[-112,217]],[[88359,46828],[-115,-79],[-213,-329],[-69,-11],[-43,-139],[-105,-64]],[[87814,46206],[-88,-278]],[[66672,59365],[111,-34],[122,-312],[24,-144]],[[67192,60030],[-86,-15],[-164,-165],[-121,-15],[-162,-223]],[[66659,59612],[13,-247]],[[70515,43161],[623,-112]],[[71138,43049],[67,1120]],[[71205,44169],[-237,50],[7,112],[-324,53]],[[70651,44384],[19,-115],[-78,12],[-50,-900],[-14,2]],[[70528,43383],[-13,-222]],[[47402,48928],[161,15]],[[47563,48943],[959,70]],[[48522,49013],[23,2]],[[48545,49015],[-29,1339]],[[48516,50354],[-6,336]],[[48510,50690],[-1117,-79]],[[47393,50611],[-30,-2]],[[66974,36742],[560,-96]],[[67534,36646],[1,0]],[[67535,36646],[63,1002]],[[67598,37648],[-568,101]],[[67030,37749],[-41,-668]],[[69835,38183],[233,-226],[64,-151],[48,-319],[89,-134],[195,-34]],[[70464,37319],[96,-17]],[[70560,37302],[58,1003]],[[70618,38305],[-769,126]],[[69849,38431],[-14,-248]],[[71838,44033],[-13,-226]],[[71825,43807],[539,-105]],[[72364,43702],[67,942]],[[72431,44644],[23,393],[-92,18]],[[72362,45055],[-455,94]],[[60228,52150],[411,-12],[39,199],[92,148],[81,-110],[86,8],[73,-139]],[[61010,52244],[4,560],[294,234],[3,169]],[[61311,53207],[7,508]],[[61318,53715],[-763,16]],[[60262,53738],[-5,-915],[-24,1],[-5,-674]],[[58535,44264],[679,-60]],[[59214,44204],[11,1017],[167,-7]],[[59392,45214],[-33,85],[20,255]],[[59379,45554],[-819,53]],[[58560,45607],[-10,-668]],[[58550,44939],[-15,-675]],[[72252,22754],[192,-32],[-22,-331]],[[72422,22391],[575,-107]],[[72336,23734],[-84,-980]],[[45709,43742],[45,-1339]],[[45754,42403],[921,87]],[[46675,42490],[32,3]],[[46707,42493],[-40,1337]],[[46667,43830],[-958,-88]],[[45709,43742],[-2,0]],[[72511,26386],[-78,-1046],[-12,-285]],[[57159,53210],[954,25]],[[58113,53235],[-1,225]],[[58112,53460],[-1,896]],[[58111,54356],[-942,-29]],[[57169,54327],[-10,-1117]],[[45735,64047],[-53,1676]],[[45682,65723],[-175,-14]],[[45507,65709],[-786,-74]],[[44721,65635],[56,-1674]],[[74140,32768],[304,-64],[453,-127]],[[74897,32577],[182,-56]],[[75079,32521],[123,1329]],[[75202,33850],[-382,98]],[[74820,33948],[-582,169]],[[74238,34117],[-98,-1349]],[[71753,31920],[382,-80]],[[72516,31762],[95,1334]],[[72611,33096],[-370,78]],[[71843,33244],[-90,-1324]],[[33060,70430],[574,119]],[[33634,70549],[-214,3136]],[[33420,73685],[-1711,-363]],[[31709,73322],[7,-311]],[[31716,73011],[63,-821],[-25,-6],[127,-1664],[569,121],[24,-331],[586,120]],[[78109,53748],[31,-134],[92,39],[92,-262],[405,-123],[-4,33]],[[78725,53301],[185,607]],[[78910,53908],[103,416]],[[79013,54324],[-554,142]],[[78459,54466],[-389,95]],[[78070,54561],[-273,65]],[[77797,54626],[41,-330],[201,-272],[70,-276]],[[92968,16433],[-28,-214],[75,-267],[2,-294],[-87,-84],[88,-34],[115,-325],[115,156],[149,-51],[38,-256]],[[93435,15064],[390,2000],[316,1723]],[[94141,18787],[-52,28],[30,170],[-327,123],[-5,607],[-49,21],[-62,-264],[-119,-130]],[[93557,19342],[-63,-118],[-107,-7],[-101,79],[-46,-179],[-185,-25],[-148,-228]],[[92907,18864],[86,-61],[60,-277],[88,-145],[-60,-185],[55,-65],[-32,-250],[-65,-79],[-122,-316],[62,-158],[1,-303],[58,-218],[-109,-241],[39,-133]],[[49503,9581],[781,43]],[[50284,9624],[-20,1064],[44,3],[-12,657]],[[50296,11348],[-13,657],[-344,-20]],[[49939,11985],[-438,-27]],[[49501,11958],[14,-658]],[[49515,11300],[14,-656],[-49,-3],[23,-1060]],[[57180,55736],[-2,-223]],[[57178,55513],[987,4]],[[58165,55517],[-1,449]],[[58164,55966],[-2,710]],[[57187,56633],[-7,-897]],[[23847,92913],[91,-42],[130,212],[202,195],[-91,178],[-141,25],[-6,124],[-97,-12]],[[23935,93593],[-86,-226],[-42,-244],[83,-111],[-43,-99]],[[23972,91999],[256,410],[-17,181],[140,-19],[13,218]],[[24234,93116],[-120,-107],[-138,-197],[-246,-69],[-17,-242],[-74,-272],[-79,-23],[-12,-118],[219,58],[-193,-156]],[[52483,36099],[575,14]],[[53049,37451],[-385,-8]],[[52664,37443],[-192,-5]],[[52472,37438],[11,-1339]],[[52493,35095],[574,15]],[[53067,35110],[-2,334],[321,6]],[[53386,35450],[-6,669]],[[52483,36099],[10,-1004]],[[67451,21264],[232,-38],[-34,-669],[124,-19],[-17,-331]],[[67756,20207],[386,-57]],[[68142,20150],[18,328],[66,-9],[67,1322],[99,-12]],[[68392,21779],[-87,410],[15,63],[-92,249],[-94,382],[-198,572],[38,136]],[[51243,87725],[405,-542]],[[51648,87183],[313,-419],[150,116],[66,123]],[[52177,87003],[5,72],[140,-74],[89,126],[52,217],[-51,631],[41,219]],[[52453,88194],[-428,618]],[[52025,88812],[-205,-177],[-139,-67],[-12,-243],[-171,-31],[-99,-82],[-67,-335],[-89,-152]],[[51605,18674],[542,21]],[[52754,20036],[-1124,-34]],[[51587,19999],[18,-1325]],[[45584,60672],[981,84]],[[46565,60756],[-45,1680]],[[45530,62354],[54,-1682]],[[81191,34624],[107,-217],[123,-366],[355,-86],[-3,-26]],[[81773,33929],[164,-51]],[[81937,33878],[62,604],[66,79],[21,203]],[[82086,34764],[19,193],[-201,116],[16,168],[-66,111],[15,136],[-57,193]],[[81812,35681],[-501,151]],[[81311,35832],[-120,-1208]],[[46470,64112],[227,19]],[[46466,65785],[-784,-62]],[[58964,55970],[-3,-282]],[[59513,56354],[1,1229]],[[59514,57583],[-479,20]],[[59035,57603],[1,-1240],[-70,1],[-2,-394]],[[74993,42582],[195,-17],[1,58],[194,-18],[4,96],[314,26]],[[75701,42727],[6,217]],[[75707,42944],[21,644]],[[75728,43588],[-525,42]],[[75203,43630],[-235,17]],[[74968,43647],[-38,-1005],[63,-60]],[[57756,43609],[767,-13]],[[58523,43596],[12,668]],[[58550,44939],[-761,11]],[[57789,44950],[-6,-948],[-26,0]],[[57757,44002],[-1,-393]],[[60875,41680],[287,-32]],[[61162,41648],[397,-49]],[[61559,41599],[18,1176]],[[61577,42775],[-672,39]],[[60905,42814],[-7,-168]],[[60898,42646],[-23,-966]],[[48716,74546],[145,7]],[[48861,74553],[366,26]],[[49227,74579],[458,1473]],[[49685,76052],[-174,40],[-43,294],[-410,465]],[[49058,76851],[-94,-30],[-95,109]],[[48869,76930],[-213,-36]],[[48656,76894],[60,-2348]],[[42456,70609],[719,83]],[[43175,70692],[-53,1673]],[[43106,72363],[-1596,-187]],[[41510,72176],[73,-1675]],[[52038,77599],[141,295],[125,-134]],[[52693,78894],[-364,363],[-112,523]],[[52217,79780],[-588,-467],[-388,-150]],[[51241,79163],[-154,-499]],[[51087,78664],[11,-131]],[[23189,3634],[575,228]],[[23690,4424],[-234,1754],[-168,1199]],[[23288,7377],[-580,-233]],[[22708,7144],[42,-323],[-95,-37],[263,-1922],[-189,-73],[43,-320],[96,36],[46,-345],[95,37],[42,-318],[100,39],[38,-284]],[[78094,74083],[-8,-108],[279,-54]],[[78365,73921],[7,91],[156,29],[104,252],[73,8]],[[78705,74301],[-55,55],[17,243],[-105,221]],[[78562,74820],[-42,103],[-99,18]],[[78421,74941],[-267,47]],[[78154,74988],[-60,-905]],[[45233,79563],[1617,116]],[[46850,79679],[-42,1608]],[[46808,81287],[-1124,-82]],[[45684,81205],[-500,-42]],[[45184,81163],[49,-1600]],[[82600,50130],[78,-368],[57,-149],[-131,-274],[3,-92]],[[82607,49247],[158,-259],[136,-428],[260,72]],[[83161,48632],[38,257],[-15,133],[216,195],[-2,59],[155,141]],[[83553,49417],[-123,363],[-135,-98],[-238,388],[70,66],[-5,121],[-86,189]],[[83036,50446],[-40,-64],[-371,-204],[-25,-48]],[[57769,76310],[586,108],[204,189]],[[58559,76607],[7,397],[-113,219],[43,176],[-43,262],[35,213],[-13,406]],[[58475,78280],[-7,61],[-164,79]],[[58304,78420],[-122,-137],[-51,-141],[-207,-191]],[[57924,77951],[-27,-147],[44,-159],[-30,-212],[46,-239],[-31,-88],[35,-314],[-22,-239],[-170,-243]],[[59252,18094],[1167,-60],[23,382]],[[60442,18416],[21,938]],[[60463,19354],[-1177,62]],[[59286,19416],[-24,-662],[-10,-660]],[[79102,81202],[88,-16],[17,-304],[40,-143],[-12,-168]],[[79235,80571],[764,-184]],[[79999,80387],[-34,277],[21,441],[53,172]],[[80039,81277],[-60,206],[6,270],[-127,409],[17,86],[-186,277]],[[79689,82525],[-35,-207],[-105,-268],[-153,-32],[-44,-136],[-183,-118],[-27,-363],[-40,-199]],[[77445,66363],[255,-915]],[[77700,65448],[53,48],[86,290],[79,76]],[[77918,65862],[138,349],[162,223],[-4,195]],[[78214,66629],[-452,293]],[[77762,66922],[-299,-289]],[[77463,66633],[-18,-270]],[[11860,79978],[258,74],[21,-227],[516,128],[8,-114],[203,44],[-8,114],[135,28],[8,-114],[135,25],[-7,114],[272,47],[6,-115],[135,21],[-5,115],[742,84],[-4,115],[270,19],[-2,114],[270,13],[0,46]],[[14813,80509],[-19,298],[68,2],[65,232],[68,1],[-20,461],[135,1],[48,116],[-1,461],[-20,115],[-201,-2],[-2,230],[-203,-6],[-19,346],[-134,-6],[-63,-235],[-134,-8],[-6,231],[-134,-10],[6,-231],[-267,-24],[-16,462],[-338,-39],[-10,231],[-201,-28],[-25,577]],[[13390,83684],[-73,105],[-537,-91],[-741,-166],[20,-229],[-67,-17],[21,-228],[-90,-24],[42,-457],[-24,-6],[42,-457],[-11,-144]],[[11972,81970],[178,32],[3,186],[-78,336],[32,183],[188,49],[135,-11],[107,107],[84,-50],[90,95],[111,-270],[174,40],[-34,-143],[-119,-104],[-125,45],[27,-218],[-102,-299],[-65,-31],[-31,-168],[101,-102],[79,236],[-30,174],[135,305],[80,-38],[-150,-350],[42,-213],[90,-120],[-80,-103],[-217,52],[-362,-286],[11,-172],[-42,-387],[-344,-767]],[[43068,15267],[862,118]],[[43930,15385],[102,13],[-58,1320]],[[43974,16718],[-303,-38],[-60,1330]],[[43031,17933],[62,-1329],[-88,-12],[63,-1325]],[[58152,18007],[-10,-866]],[[58142,17141],[1100,-36]],[[59242,17105],[10,989]],[[59286,19416],[20,995]],[[59306,20411],[-586,45]],[[58720,20456],[-4,-352],[-566,36]],[[58150,20140],[-22,-28],[-19,-1270],[52,-23],[-9,-812]],[[32509,43508],[51,-622]],[[32560,42886],[262,62],[-3,39],[576,133],[13,-166],[1041,228],[37,-500],[414,68],[442,100],[25,-342],[189,49],[51,-672],[470,92]],[[36077,41977],[-39,662]],[[36038,42639],[-135,-27],[-145,2119]],[[35758,44731],[-539,-111]],[[35219,44620],[-1662,-357],[-1088,-254]],[[32469,44009],[40,-501]],[[56357,50384],[4,507],[-18,0],[1,853]],[[56344,51744],[-769,8]],[[55575,51752],[2,-854],[13,-505]],[[47278,67691],[96,7]],[[47374,67698],[-31,1687]],[[47343,69385],[-975,-76]],[[48675,60162],[1335,71]],[[50010,61239],[-6,337]],[[50004,61576],[-1336,-76]],[[48672,61332],[-20,-167],[23,-1003]],[[75813,39147],[191,-44],[-4,-58],[322,-78]],[[76742,38860],[16,224],[-160,80],[44,554],[-96,47],[9,195]],[[76555,39960],[-384,50]],[[76171,40010],[-18,-241],[-284,72]],[[75869,39841],[-56,-694]],[[64025,39618],[-9,-336]],[[64016,39282],[756,-72]],[[64772,39210],[23,673]],[[64795,39883],[36,1009]],[[64831,40892],[-768,71]],[[64063,40963],[-38,-1345]],[[77041,64392],[115,217],[279,7],[98,38],[66,241]],[[77599,64895],[-182,273]],[[77417,65168],[-56,-32],[-150,121],[-79,-118]],[[77132,65139],[-149,-256],[58,-491]],[[67030,37749],[77,1337]],[[67107,39086],[-573,84],[29,685]],[[66563,39855],[-194,32]],[[66148,39226],[-35,-792]],[[66113,38434],[-50,-1057]],[[66063,37377],[-8,-166],[378,-46]],[[73330,75531],[-22,-343],[94,-46],[-22,-305]],[[73380,74837],[672,-123]],[[74052,74714],[97,1609]],[[74149,76323],[-761,154]],[[73388,76477],[-58,-946]],[[85233,89135],[774,-218],[-18,-218],[167,-45]],[[86156,88654],[298,856],[46,172]],[[86500,89682],[-118,88],[-1472,405]],[[84910,90175],[354,-724],[-31,-316]],[[58055,34269],[772,-30]],[[58827,34239],[6,333],[59,-2],[15,1006]],[[58907,35576],[-386,17]],[[59600,34204],[6,331],[39,-1],[21,1005]],[[59288,35560],[-381,16]],[[25155,20669],[-39,224],[127,421],[129,36],[63,322],[91,-79],[56,57],[91,-192],[85,-56],[37,-131],[-36,-129],[88,-45],[28,-128],[152,-168],[106,-15],[-79,426],[119,104],[90,-71],[74,498],[203,500],[29,120],[189,167],[40,81],[235,186],[97,-84],[39,282],[75,282],[-4,322]],[[27240,23599],[-151,-48],[-70,656],[-66,-21],[-12,292],[-61,397],[66,86],[31,207],[-103,-28],[-22,123],[-149,172],[-407,245],[-83,182]],[[26213,25862],[-88,-346],[-132,-268],[-26,-234],[-114,84],[-72,-46],[-25,-140],[-186,-285],[-3,-219],[-111,13],[-70,-107],[-153,-65],[-55,190],[-205,-390],[-208,-72],[28,-245],[-93,-32],[-178,152]],[[24522,23852],[-26,-53]],[[24496,23799],[40,-227],[-74,-58],[0,-154],[89,-123],[-67,-109],[56,-64],[-208,-313],[24,-358],[-157,-166],[-4,-59]],[[24195,22168],[143,-288],[13,-360],[-54,-23],[-7,-241],[47,-91],[195,-86],[63,-297],[111,-116],[188,254],[261,-251]],[[75908,74806],[-27,-452]],[[75881,74354],[303,-63],[8,-93],[199,46]],[[76391,74244],[181,-40]],[[76572,74204],[-3,137],[119,476],[-27,84]],[[76661,74901],[-39,-62],[-74,120],[-278,34]],[[76270,74993],[-286,49],[-32,-245],[-44,9]],[[55159,34316],[579,-6]],[[55738,34310],[2,334],[107,-1],[2,1015]],[[55849,35658],[-571,4]],[[55278,35662],[0,-1013],[-118,0],[-1,-333]],[[36084,50742],[185,39],[-20,333],[953,175]],[[37202,51289],[-84,1334]],[[35945,52390],[65,-998],[27,5],[47,-655]],[[59173,38266],[759,-43]],[[59960,39561],[-383,22]],[[59577,39583],[-381,20]],[[59174,38331],[-1,-65]],[[41981,41296],[193,26],[-12,335]],[[41678,43274],[-752,-106]],[[40926,43168],[106,-2011],[949,139]],[[60080,36851],[772,-49]],[[60852,36802],[32,1358]],[[60884,38160],[-190,13]],[[60122,38211],[-24,-355],[-18,-1005]],[[65051,41637],[96,-119],[256,-130],[-6,-131],[63,-251],[91,-150],[-3,-181]],[[65548,40675],[377,-47],[26,509],[100,70]],[[66051,41207],[53,1034]],[[65533,42329],[-189,25],[-21,-448],[-349,38]],[[64974,41944],[77,-307]],[[39975,44708],[1609,236]],[[41584,44944],[-92,1683],[-45,1007],[-577,-90]],[[40870,47544],[57,-996],[-1046,-163]],[[39881,46385],[94,-1677]],[[58540,36924],[578,-24]],[[59118,36900],[16,1009],[33,-3],[6,360]],[[58406,38284],[-5,-341],[-39,1],[-16,-1012]],[[74213,40788],[-6,-91],[160,-35],[-29,-391],[562,-129]],[[74900,40142],[46,652],[-7,155]],[[74939,40949],[12,345]],[[74951,41294],[-333,9],[-359,88]],[[74259,41391],[-46,-602]],[[74213,40789],[0,-1]],[[57657,38342],[573,-18],[176,-40]],[[58426,39631],[-375,35]],[[78499,36195],[197,-54],[-79,-265],[341,-79]],[[78958,35797],[121,1371]],[[79079,37168],[-38,10],[22,314],[-379,70]],[[78684,37562],[-26,-284],[-67,18]],[[82371,88200],[966,-250]],[[83337,87950],[102,1151]],[[82469,89360],[-98,-1160]],[[73426,38485],[671,-142]],[[74097,38343],[26,333],[95,-22],[13,171]],[[74231,38825],[13,164],[-96,21],[37,501]],[[74185,39511],[-99,21]],[[74086,39532],[-12,-167],[-576,120]],[[73498,39485],[-53,-744]],[[73445,38741],[-19,-256]],[[74540,43693],[428,-46]],[[75203,43630],[38,1213]],[[75241,44843],[-434,32]],[[74807,44875],[-10,-66],[-155,18]],[[74642,44827],[-35,-989],[-54,30],[-13,-175]],[[46752,83837],[190,13]],[[46942,83850],[798,41]],[[47740,83891],[372,22]],[[48112,83913],[-47,2047]],[[46702,85887],[50,-2050]],[[77776,63955],[78,-120]],[[77854,63835],[93,-180],[49,50],[186,-3],[97,-158]],[[78279,63544],[79,175]],[[78358,63719],[-29,204],[69,54],[74,199],[127,188]],[[78599,64364],[-124,136],[-147,-89],[-162,220],[-68,21]],[[77900,64537],[-51,-26],[34,-264],[-26,-180],[-81,-112]],[[78827,40496],[77,-15],[-19,-274],[75,-15]],[[78960,40192],[479,-99]],[[79642,40212],[62,837]],[[79704,41049],[-254,70],[8,113],[-128,25],[8,111],[-193,38],[17,225],[-193,36]],[[78969,41667],[-25,-337],[-63,12],[-54,-846]],[[50033,85975],[550,-1229]],[[50583,84746],[37,293],[56,-51],[476,27]],[[51152,85015],[-37,90],[248,509]],[[51363,85614],[-920,1264]],[[76555,39960],[3,57],[163,-23],[10,219],[311,-41]],[[77055,40452],[29,581]],[[77084,41033],[-690,96]],[[76394,41129],[-35,-386],[-127,29],[-61,-762]],[[78883,34954],[155,-42],[-22,-271],[316,-87],[-27,-277],[161,-47]],[[79466,34230],[76,812]],[[79542,35042],[55,585]],[[79597,35627],[-639,170]],[[78958,35797],[-75,-843]],[[48559,62847],[142,289],[-14,373],[58,84],[-20,255],[106,143]],[[48831,63991],[-8,36],[-282,-18],[-4,169],[-57,-4],[22,171],[-444,-26]],[[48058,64319],[-29,-171],[-64,-4],[-4,-678],[-286,-19],[8,-333]],[[58670,26618],[386,-19]],[[59056,26599],[4,276],[385,-20]],[[59445,26855],[17,1055]],[[59462,27910],[-8,0]],[[59454,27910],[-575,30]],[[58879,27940],[-190,10]],[[58689,27950],[-19,-1332]],[[61466,66879],[190,-23]],[[61656,66856],[513,-43]],[[62169,66813],[10,335],[-43,2],[18,714]],[[62154,67864],[9,336]],[[62163,68200],[-655,33]],[[61508,68233],[-14,-336]],[[61494,67897],[-40,-221],[-199,-447],[-36,2],[0,-326],[247,-26]],[[77212,71942],[95,-318],[205,-212]],[[77512,71412],[435,-87]],[[77947,71325],[17,-3],[46,648]],[[78010,71970],[24,345]],[[78034,72315],[-658,136]],[[46888,78233],[-38,1446]],[[45233,79563],[41,-1441]],[[56560,28357],[785,-22]],[[57345,28335],[10,1000]],[[57355,29335],[-779,19]],[[56576,29354],[-8,0]],[[50160,41413],[5,-35]],[[50165,41378],[737,35]],[[50902,41413],[8,1]],[[50891,42755],[-752,-34]],[[50139,42721],[21,-1308]],[[80918,56172],[105,-142],[125,-79],[237,-41],[46,-68]],[[81431,55842],[72,322],[-28,400],[-92,342]],[[81383,56906],[-78,-179],[-328,211]],[[80977,56938],[-59,-481],[0,-285]],[[58113,53235],[2,-1009]],[[58882,52473],[-2,336],[40,1],[-2,653]],[[58918,53463],[-806,-3]],[[43819,63859],[672,72]],[[44721,65635],[-171,-18]],[[43758,65533],[61,-1674]],[[29243,9796],[54,513],[-43,234],[-3,263],[103,357],[375,11],[201,171],[23,214],[125,80],[42,146],[352,67]],[[30472,11852],[-115,1212],[97,63],[38,166],[225,122],[-81,806],[200,59]],[[30836,14280],[67,100],[-74,168],[58,154],[150,110],[-13,103]],[[31024,14915],[-153,-104],[-70,135],[-51,635],[-237,-66]],[[30513,15515],[-352,-99],[-117,168],[-77,-43],[-115,52],[28,176],[-156,114],[-61,-42]],[[29663,15841],[48,-578],[48,-105],[-23,-203],[-136,-41],[16,-163],[-189,-57],[52,-505],[-394,-110],[135,-1293],[-395,-132],[122,-1154],[-81,-34],[-3,-406]],[[28863,11060],[50,-238],[-32,-236],[138,-73],[32,-92],[49,-406],[-23,-133],[166,-86]],[[59044,49660],[10,-1283],[-8,-155]],[[59046,48222],[1,-55]],[[59047,48167],[768,18]],[[59815,49093],[-1,630]],[[59814,49723],[-387,-1],[0,112],[-383,-6]],[[59044,49828],[0,-168]],[[45451,67550],[56,-1841]],[[26693,13977],[763,250]],[[27456,14227],[-6,277],[-136,289],[18,247],[68,327],[-34,286],[47,77],[-127,170],[9,253],[46,162],[-102,215],[169,108],[17,222],[116,197],[90,23]],[[27631,17080],[1,6]],[[26874,17822],[-115,-63],[-17,167],[-84,54],[-134,229],[-97,49],[-81,-63],[-42,181],[-126,100],[-105,-232],[-47,-216],[-149,-68]],[[25877,17960],[50,-143],[-21,-136],[107,-77],[15,-202],[-72,-226],[136,-253],[137,43],[46,-104],[-43,-222],[50,-62],[-84,-184],[-11,-203],[71,-171],[-81,-136],[28,-156],[107,12],[3,-362],[58,-17],[58,-211],[9,-196],[93,-185],[-16,-222],[82,-9],[106,-504],[-12,-57]],[[15655,56510],[62,26],[323,-2361],[171,-1303]],[[16211,52872],[1720,673],[1606,600],[8,-59],[154,54]],[[19699,54140],[1431,3678]],[[21713,60757],[-58,158],[-206,263],[-135,93],[-185,59],[-47,94]],[[21082,61424],[-1587,-539],[-20,165],[-2151,-777],[-749,-289],[-14,110],[-508,-193],[-16,-63],[-261,-105],[0,-57],[-328,-127],[-23,169],[-101,26],[-25,174],[-80,-29],[-60,188]],[[15159,60077],[-158,-362]],[[15001,59715],[-20,-123],[90,-153],[63,33],[164,-491],[122,-454],[101,-1024],[134,-993]],[[79632,65685],[95,-66]],[[79727,65619],[40,196],[-29,194],[122,290],[105,159],[98,229]],[[80063,66687],[-96,188]],[[79967,66875],[-55,15]],[[79912,66890],[-131,-79],[-163,-26],[-51,-214],[-67,-115],[-170,-578]],[[79330,65878],[51,-103],[132,-57],[61,-98],[58,65]],[[22294,89903],[212,429],[133,-60]],[[22639,90272],[146,63],[112,110],[97,181]],[[22994,90626],[-283,140],[56,183]],[[22767,90949],[-65,-10],[-127,-421],[-122,-123],[-27,93],[136,181],[38,204],[156,360],[128,533],[-132,-48],[-68,-147]],[[22098,90653],[-36,-268],[66,-31],[-47,-166],[213,-285]],[[65086,23890],[317,-36],[15,341]],[[65418,24195],[55,1328]],[[65473,25523],[-422,34],[-561,67]],[[64490,25624],[-746,79]],[[63744,25703],[-45,-1333]],[[12752,97824],[9,-151],[50,124],[-59,27]],[[12678,97489],[67,-76],[-9,284],[-62,-20],[4,-188]],[[12397,97795],[79,-153],[-37,-93],[62,-101],[107,47],[-29,107],[-182,193]],[[12157,97232],[72,-101],[166,95],[-15,134],[-78,-137],[-13,286],[-67,-120],[-52,93],[-13,-250]],[[11676,97411],[39,-75],[105,122],[-77,52],[-67,-99]],[[11421,97611],[92,-25],[-51,170],[-41,-145]],[[11193,98205],[7,-58],[201,186],[-53,52],[-155,-180]],[[13113,95377],[-75,176],[-97,-13],[-5,116],[-134,-19],[-5,116],[-135,-20],[-12,232],[41,6],[-24,463],[-33,111],[134,20],[-14,332]],[[12754,96897],[-83,80],[72,-316],[-108,-54],[-96,146],[-155,135],[-73,160],[-141,-94],[-175,196],[-122,-30],[86,-328],[-111,-5],[-67,296],[-97,212],[-62,-41],[27,166],[-91,-84],[-45,172],[-96,-64],[2,-270],[-45,-80],[-49,103],[52,124],[-12,221],[-127,31],[-84,-269],[-73,76],[74,152],[-166,152],[82,55],[43,164],[-116,-146],[-125,154],[-223,-68],[-121,89],[-18,84],[-138,62],[-89,-60],[-27,-222],[119,-83],[89,-232],[319,-170],[161,27],[77,247],[29,-326],[197,-30],[156,-328],[167,-282],[214,-226],[286,-107],[156,5],[-66,263],[52,123],[18,-196],[128,51],[88,147],[29,-84],[-149,-228],[110,-343],[266,-358],[125,-86],[260,-267],[25,64]],[[10074,98386],[132,-10],[-14,76],[-118,-66]],[[9884,98128],[28,-56],[93,143],[-78,113],[-43,-200]],[[9682,98209],[113,-63],[74,186],[-177,16],[-10,-139]],[[15442,93819],[42,-103],[61,69],[-2,-172],[161,-206],[65,-149],[-24,-118],[125,-104],[-52,383],[56,-94],[91,167],[61,-77],[-34,266],[-96,-86],[21,114],[-138,-53],[-22,160],[-134,106],[-181,-103]],[[15046,95861],[118,-96],[59,144],[-121,21],[-56,-69]],[[14874,94754],[65,-192],[169,-201],[102,16],[39,195],[12,-197],[-32,-217],[89,-105],[62,78],[103,-23],[-54,-154],[151,129],[-76,-123],[164,31],[-6,121],[73,-20],[100,-147],[76,287],[-61,-38],[-7,239],[131,-34],[-74,268],[-171,-105],[62,163],[-90,160],[-146,117],[126,37],[-146,104],[-35,115],[-45,-119],[22,-151],[-141,441],[-92,126],[-105,34],[128,-263],[-55,-17],[72,-272],[-209,417],[-96,-196],[-2,-257],[-109,-143],[6,-104]],[[14854,96003],[119,-221],[61,63],[-150,199],[-30,-41]],[[14435,96805],[71,-113],[-3,201],[-68,-88]],[[15078,93031],[199,0],[-1,-117],[72,0],[0,-155],[153,-2]],[[15501,92757],[-168,329],[-89,7],[-65,157],[24,152],[-87,322],[-105,104],[-104,2],[-167,132],[7,119],[-95,44],[7,143],[-126,-77],[-56,304],[-130,-26],[7,168],[-79,-51],[-148,237],[92,-55],[-13,236]],[[14206,95004],[-167,-15],[61,-227],[110,-244],[99,22],[27,-98],[106,-15],[56,-264],[153,-99],[4,-426],[134,-127],[223,-90],[67,-132],[-1,-258]],[[13113,95377],[93,23],[8,-256],[135,-318],[136,-147],[168,-260],[74,-747],[79,-59],[-57,-145],[48,-302],[83,-142]],[[13998,92672],[28,-116],[-113,163]],[[13913,92719],[10,-322],[-25,-236],[70,-110],[134,10],[43,-230],[70,-112],[134,8],[67,-113],[29,-1628]],[[14445,89986],[969,18]],[[15414,90004],[20,581],[-50,1],[1,465],[-49,1],[1,465],[-116,117],[0,233],[-67,117],[-115,-1],[-1,233],[-134,-2],[20,233],[-3,465],[21,117],[136,2]],[[14206,95004],[-90,231],[-140,18],[-143,251],[-72,-133],[-137,326],[-23,-91],[-80,128],[12,136],[-101,-74],[-95,40],[-76,182],[155,167],[-162,174],[-21,142],[-59,-166],[-5,187],[-85,-70],[-28,88],[-262,72],[-40,285]],[[17580,91326],[38,-191],[142,-287],[94,-372],[66,151],[-184,481],[47,59],[-203,159]],[[17539,90713],[44,-321],[78,-154],[-4,287],[-41,296],[-77,-108]],[[17264,89160],[466,-75],[95,-76],[-79,-1039],[201,-38],[-59,-807],[-48,-412]],[[17840,86713],[130,-92],[333,-72],[9,115],[203,-29],[504,-133],[62,148],[-51,241],[78,63],[-44,170],[88,50],[100,-149],[112,-34],[143,192],[48,458],[59,45],[31,281],[299,-98]],[[19944,87869],[231,1992]],[[20175,89861],[-87,-30],[-218,71],[-12,-115],[-530,159],[-206,733],[5,49]],[[19127,90728],[-118,16],[-130,306],[42,-206],[75,-155],[63,-18],[-114,-134],[-235,-23],[60,-74],[-91,-38],[36,-191],[-147,213],[-200,-177],[-79,43],[77,-189],[-140,182],[18,139],[-225,153],[14,-275],[61,16],[238,-222],[-52,-153],[-98,142],[43,-170],[-167,120],[-82,-68],[187,-179],[-137,77],[-85,-183],[36,-225],[-119,271],[-49,-239],[-30,256],[-69,86],[-49,-100],[-80,202],[-155,53],[54,-382],[-81,19],[-55,417],[100,20],[-67,366],[85,-174],[66,194],[-57,288],[133,221],[-78,173],[-83,21],[-49,-271],[-26,268],[-54,15]],[[17314,91159],[-22,-641],[-39,6],[-17,-426],[-34,4]],[[17202,90102],[-4,-155],[100,-14],[-34,-773]],[[51004,29284],[575,23]],[[51579,29307],[-13,1350]],[[17758,17060],[780,331]],[[18538,17391],[988,416]],[[19526,17807],[119,92],[-10,84],[125,-60],[84,151],[83,45]],[[19927,18119],[19,98],[-64,260],[-82,-36],[-59,435],[-112,-48],[-180,93],[-74,-31],[0,153],[230,235],[32,188],[-121,152],[-17,206],[-110,73],[-42,156],[19,144],[-112,110],[-77,215],[16,67],[388,155]],[[19581,20744],[-105,809]],[[19476,21553],[-559,-231],[-354,-177],[-46,324],[-1308,-550]],[[17209,20919],[195,-1293]],[[17404,19626],[290,-1915],[-30,-13],[94,-638]],[[76391,42872],[-21,-450]],[[76370,42422],[712,-100]],[[77082,42322],[42,900],[190,-18]],[[77314,43204],[12,333]],[[77326,43537],[-440,59],[2,-103],[-467,70]],[[76421,43563],[-30,-691]],[[79597,35627],[77,813]],[[79674,36440],[53,557],[-140,37]],[[79587,37034],[-508,134]],[[76859,76242],[493,-101]],[[77352,76141],[26,413],[98,225],[51,878]],[[77527,77657],[-381,45]],[[77146,77702],[-188,22]],[[81807,47213],[-31,-458],[41,25],[126,-242]],[[81943,46538],[191,-388],[152,13],[248,-435],[41,-562],[31,-192],[92,83],[4,124],[100,27],[22,-107],[70,80]],[[82894,45181],[30,161],[-40,127]],[[82884,45469],[-41,472],[34,157],[-63,322],[-95,220],[39,139]],[[82758,46779],[-147,331],[-56,257],[41,84],[-41,182]],[[82555,47633],[-250,103],[-100,106],[-168,7],[-194,-209],[-36,-427]],[[54304,18730],[167,1],[-3,-332]],[[54468,18399],[1137,3],[418,-12]],[[56023,18390],[14,334],[5,995]],[[56042,19719],[17,330],[4,669]],[[55094,20725],[-769,-4]],[[54325,20721],[2,-663],[-24,0],[1,-1328]],[[75345,61410],[540,-112]],[[75885,61298],[347,-71]],[[76232,61227],[-79,155],[147,221],[-60,178],[24,141],[86,3],[2,285],[-76,326]],[[76276,62536],[-43,186]],[[76233,62722],[-19,-55]],[[76214,62667],[0,-81],[-113,-76],[-15,-205],[-138,-317],[-208,-151],[-354,81]],[[75386,61918],[-41,-508]],[[53984,12864],[590,12],[774,-6]],[[55348,12870],[3,577],[15,0]],[[55366,13447],[1,328]],[[66264,44202],[130,31],[29,561],[193,-21]],[[66616,44773],[51,1186],[-196,13]],[[66471,45972],[-668,81],[-31,-676]],[[65772,45377],[-21,-449],[97,-10],[-8,-166],[92,-9],[-12,-302],[50,71],[69,-124],[86,-25],[88,-205],[51,44]],[[71515,38645],[433,-95]],[[71948,38550],[13,171],[65,-13]],[[72026,38708],[94,1336]],[[72120,40044],[-377,75]],[[71743,40119],[-125,26],[-94,-1333]],[[32186,47319],[1169,269],[50,-643]],[[33405,46945],[1505,323]],[[34910,47268],[-99,1405],[-232,-48]],[[34579,48625],[7,-116],[-856,-182],[43,79],[14,231],[130,28],[117,166],[-35,251],[-33,-6]],[[33966,49076],[-1623,-376],[-233,-47]],[[65098,77012],[547,-58]],[[65645,76954],[49,1338]],[[65694,78292],[-168,19]],[[65144,78351],[-46,-1339]],[[47175,11118],[10,-329],[974,85],[-9,330],[194,14]],[[48344,11218],[-17,656],[59,5],[-34,1322],[59,4],[-17,660]],[[48394,13865],[-585,-45]],[[47809,13820],[-583,-55]],[[47226,13765],[22,-659],[-67,-6],[42,-1319],[-69,-6],[10,-329]],[[61136,40496],[771,-62]],[[61907,40434],[8,337]],[[61915,40771],[25,828]],[[61940,41599],[-22,-57],[-359,57]],[[61162,41648],[-26,-1152]],[[63922,44548],[197,-16],[4,138],[191,-19],[8,338],[127,100],[14,448]],[[64463,45537],[-476,42]],[[63987,45579],[2,-147],[-136,-542],[69,-342]],[[77272,69305],[305,-472]],[[77973,69162],[33,163],[-122,272],[-45,-3],[31,292]],[[77870,69886],[-200,-64]],[[77670,69822],[-65,9],[-148,-108],[-185,-418]],[[73690,27438],[71,979]],[[73761,28417],[20,332],[-319,69],[4,59]],[[48571,47333],[933,53]],[[49504,47386],[18,1]],[[49522,47387],[-40,1682]],[[49482,49069],[-937,-54]],[[48522,49013],[49,-1680]],[[46580,9342],[551,55],[1398,116]],[[48529,9513],[-28,1058],[56,5],[-17,656]],[[48540,11232],[-196,-14]],[[72710,37561],[641,-155]],[[73356,37478],[70,1007]],[[73445,38741],[-450,108]],[[72995,38849],[-436,88]],[[72559,38937],[-21,-338]],[[72538,38599],[-49,-665],[48,-10],[-18,-325]],[[54675,45859],[422,0],[0,-336]],[[55097,45523],[383,-2]],[[55480,45521],[-8,902]],[[55472,46423],[-33,0],[2,784]],[[55441,47207],[-765,1]],[[54676,47208],[-1,-1349]],[[61907,40434],[-23,-1008]],[[61884,39426],[384,-29]],[[62268,39397],[193,-11],[9,335]],[[62470,39721],[26,1007],[-63,4]],[[62433,40732],[-518,39]],[[70457,42179],[763,-140]],[[71220,42039],[64,977]],[[71284,43016],[-146,33]],[[70515,43161],[-58,-982]],[[12262,32664],[25,99],[-40,269],[141,111],[46,144],[-82,299],[-144,54],[-22,162]],[[12186,33802],[-44,99],[-107,36],[-124,-59],[-41,152],[-85,88],[-43,153],[-92,-51],[-124,251],[-101,42],[-395,-186],[-66,141],[11,177]],[[10975,34645],[-1457,-715]],[[9518,33930],[49,-416],[54,-11],[16,-236]],[[9637,33267],[-16,-89],[49,-385],[-18,-191],[58,-136],[22,-209],[-113,-241]],[[71743,40119],[22,330]],[[71765,40449],[-504,102]],[[71261,40551],[-87,-1330]],[[48709,18510],[717,53]],[[49426,18563],[635,42]],[[50061,18605],[-26,1322]],[[50035,19927],[-1301,-79]],[[48734,19848],[-59,-6],[34,-1332]],[[56154,59323],[161,-2],[-2,-336],[191,-4]],[[56504,58981],[383,-6]],[[56887,58975],[7,1005],[-18,0],[8,1012]],[[56884,60992],[-577,10]],[[56307,61002],[-3,-671],[-248,2]],[[56056,60333],[60,-147],[-91,-203],[5,-232],[94,-175],[30,-253]],[[48448,27819],[80,257],[186,-11],[179,143],[68,-3],[7,-173],[-135,-99],[56,-170]],[[49357,28880],[3,161],[68,127],[-99,255],[-72,64],[0,266],[-81,66],[-7,119],[135,4],[51,295],[87,196],[-26,119]],[[49416,30552],[0,1]],[[49035,30529],[-143,-68],[19,-870],[-107,-79],[-63,155],[-115,27],[-109,127],[-220,-82],[-11,-60],[-168,74],[-185,-124]],[[47933,29629],[-80,60],[-93,-85]],[[47760,29604],[12,-499],[-42,-3],[31,-1233]],[[47761,27869],[3,-99],[684,49]],[[55414,15422],[8,1324]],[[55422,16746],[-788,2]],[[54634,16748],[0,-1320]],[[63744,25703],[35,997]],[[63779,26700],[-772,83],[-10,-333],[-192,17],[-10,-331]],[[62795,26136],[-31,-998]],[[62764,25138],[-22,-665]],[[45882,48790],[534,51]],[[46416,48841],[226,18]],[[46599,50540],[-726,-65]],[[45873,50475],[-39,-4]],[[45834,50471],[48,-1681]],[[54135,9742],[1612,1]],[[55747,9743],[-4,238],[33,118],[98,85],[144,-53],[69,-98],[7,784],[-377,5],[3,654]],[[55720,11476],[-389,9]],[[55331,11485],[-1174,-21]],[[54157,11464],[2,-653],[-26,0],[2,-1069]],[[59834,60537],[384,-4]],[[60218,60533],[254,-6]],[[60472,60527],[7,669],[-65,3],[4,333]],[[60418,61532],[14,1118],[-74,13]],[[60358,62663],[-228,41],[-40,175],[-71,-31],[8,-199],[-94,-1],[-50,-209],[-84,-137],[-83,-16],[-60,-152]],[[59656,62134],[-38,-37]],[[59618,62097],[-3,-550],[130,-1],[-4,-503],[96,0],[-3,-506]],[[70345,17786],[-44,-702]],[[70301,17084],[109,15],[319,-35],[160,-52],[354,-357]],[[71243,16655],[129,1932]],[[71372,18587],[-966,185]],[[70406,18772],[-61,-986]],[[59814,49723],[0,1031]],[[59814,50754],[-2,296],[40,1],[-2,476]],[[59850,51527],[-765,-4]],[[59043,51007],[1,-1179]],[[60472,60527],[321,-3],[-3,-279],[383,-16]],[[61173,60229],[3,280],[320,-6]],[[61496,60503],[9,1344]],[[61505,61847],[-413,9]],[[61092,61856],[-4,-335],[-670,11]],[[88519,48396],[130,215],[209,214]],[[88858,48825],[58,77],[130,-82],[22,232]],[[89068,49052],[30,215]],[[89098,49267],[-63,71]],[[89035,49338],[-42,-8],[-136,-258],[-104,-129],[-42,41]],[[88711,48984],[-28,-86],[-112,-13]],[[88571,48885],[-52,-144],[-85,-22]],[[88434,48719],[-54,-234],[139,-89]],[[60589,55329],[768,-20]],[[61357,55309],[287,-7]],[[61644,55302],[11,1013],[-29,1]],[[61626,56316],[-1156,28]],[[60470,56344],[-257,3]],[[27113,5073],[959,328]],[[28072,5401],[43,355],[-69,48],[121,321],[75,-88],[170,65],[14,273],[64,245],[-113,356],[188,197],[106,15],[95,174],[-55,329],[84,168],[80,13],[22,159],[-93,139],[41,129]],[[28845,8299],[141,287],[-22,289],[62,1],[67,164],[110,-12],[65,93]],[[29268,9121],[26,228],[93,198],[21,216],[-60,93],[-105,-60]],[[28863,11060],[-479,-168]],[[28384,10892],[-250,-80]],[[28134,10812],[68,-222],[27,-217],[-55,-12],[-27,-337],[57,-282],[-90,-290],[-134,-150],[-32,-295],[-214,-69],[-85,82],[34,245],[-672,-221],[-52,647],[-189,-63]],[[26770,9628],[37,-319],[-571,-185],[57,-485],[-25,-64]],[[26268,8575],[78,-779],[253,87],[149,-1290],[-57,-19],[38,-316],[365,124],[-69,-100],[39,-163],[95,-37],[-52,-237],[-84,-68],[73,-100],[2,-371],[65,-111],[-50,-122]],[[43483,69066],[961,80]],[[44444,69146],[-58,1666]],[[44386,70812],[-249,-28]],[[44137,70784],[-716,-68]],[[43421,70716],[62,-1650]],[[62554,52403],[386,-25],[5,336],[276,-13]],[[63221,52701],[9,421]],[[63230,53122],[-276,6],[7,338],[181,-3],[8,334]],[[63150,53797],[-764,34]],[[62386,53831],[-190,10],[-17,-674],[-96,7]],[[62083,53174],[-14,-742],[485,-29]],[[46888,78233],[976,70]],[[47864,78303],[-13,562],[227,15]],[[48078,78880],[-17,880]],[[48061,79760],[-1211,-81]],[[46759,74403],[-809,-76]],[[62409,55274],[-23,-1443]],[[63150,53797],[64,-3],[11,394],[36,219],[64,-4],[1,213],[66,-20],[35,153],[64,-31],[38,281]],[[63529,54999],[-351,68],[13,780]],[[63191,55847],[-770,45]],[[62421,55892],[-12,-618]],[[44763,75891],[60,-1672]],[[44823,74219],[151,14]],[[45656,74297],[-52,1497]],[[44750,76253],[13,-362]],[[40728,50321],[363,142],[17,41],[375,52],[11,-223],[191,22],[29,-354]],[[41714,50001],[177,22]],[[41891,50023],[-78,1703],[-39,689]],[[41774,52415],[-1142,-161],[12,-350]],[[40644,51904],[84,-1583]],[[44444,69146],[959,82]],[[45403,69228],[-51,1641]],[[45352,70869],[-251,2]],[[45101,70871],[-715,-59]],[[38742,46199],[506,83]],[[39248,46282],[-10,386],[-38,618],[-65,-13],[-24,268],[228,47],[-37,564]],[[39302,48152],[-513,-76],[15,-188],[-157,-28]],[[38647,47860],[93,-1661]],[[38740,46199],[2,0]],[[24827,7293],[25,189],[81,109],[45,-119],[219,-71],[111,-116],[68,240],[-43,95],[49,199],[-13,216],[102,334],[-44,197],[43,151],[201,88],[101,-23],[46,123],[143,-53],[104,-348],[203,71]],[[26770,9628],[11,172],[-61,539],[348,115],[12,177],[-57,44],[-55,206],[132,-6],[-127,369],[82,159],[128,43],[-74,649],[6,171]],[[27115,12266],[-159,-5],[-86,-153],[23,-64],[-149,-172],[-144,-230],[-176,-136],[-41,62],[-126,-98]],[[26257,11470],[-55,-131],[-182,-120],[21,-314],[-411,-498],[-42,45],[-137,-100],[-71,49],[-109,-154],[-20,70],[-140,-66]],[[25111,10251],[-84,-53],[3,-163],[-60,-128],[104,-119],[-43,-245],[38,-149],[-124,-260],[-2,-244],[-69,-134],[-132,-553],[-25,-25]],[[24717,8178],[110,-885]],[[47936,72824],[33,2]],[[48901,72882],[-40,1671]],[[48716,74546],[-820,-58]],[[47343,69385],[-38,1682]],[[47305,71067],[-289,-21]],[[46318,70980],[50,-1671]],[[50951,61950],[142,5],[111,126],[62,-26],[331,125],[119,-43]],[[51716,62137],[-13,1854]],[[51703,63991],[-7,669]],[[51696,64660],[-767,-25]],[[50931,63965],[20,-1344],[0,-671]],[[56018,69721],[4,-4]],[[56022,69717],[94,39],[242,-87]],[[56358,69669],[6,1365]],[[56364,71034],[-48,82]],[[56316,71116],[-38,199],[-253,1]],[[56025,71316],[-7,-1595]],[[54593,71801],[266,5]],[[54859,71806],[132,231],[127,6],[160,114],[95,131],[46,-35]],[[55419,72253],[76,128]],[[55495,72381],[2,796],[175,270],[99,207]],[[55771,73654],[-1177,-4]],[[54594,73650],[-1,-1849]],[[48050,41246],[474,33],[92,64]],[[48589,42629],[-763,-53]],[[47826,42576],[8,-337],[192,15],[24,-1008]],[[51671,41441],[767,21]],[[52438,41462],[-12,1343]],[[52426,42805],[-763,-22]],[[51663,42783],[-6,-1]],[[54183,71249],[6,-1425]],[[54189,69824],[810,-220]],[[54999,69604],[-6,732]],[[54993,70336],[0,922]],[[54993,71258],[-154,-1],[-78,398],[98,151]],[[54593,71801],[-411,-14]],[[54182,71787],[1,-538]],[[54276,78961],[134,-79],[233,-282],[141,-92],[402,-9]],[[55186,78499],[206,56],[42,161],[-88,193],[81,231],[40,-15]],[[54999,79382],[-585,157]],[[54414,79539],[-85,-339],[29,-78],[-82,-161]],[[51874,66177],[9,-839]],[[51883,65338],[384,11]],[[52267,65349],[-5,503],[555,14],[36,166],[175,3]],[[53028,66035],[-4,617]],[[53024,66652],[-64,-1],[-5,391]],[[52955,67042],[-1086,-25]],[[51869,67017],[5,-840]],[[85137,44113],[135,-112],[82,-373]],[[85354,43628],[66,113],[140,91],[49,254],[147,74]],[[85756,44160],[-219,459],[-116,338],[-99,-13]],[[85322,44944],[-221,-301]],[[85101,44643],[28,-105],[-48,-185],[56,-240]],[[70926,63391],[382,350],[219,76]],[[71527,63817],[151,-173],[76,130],[114,-136],[96,124]],[[71964,63762],[-18,680],[14,255]],[[71960,64697],[-965,124]],[[70995,64821],[-69,-1430]],[[84935,45503],[34,-222]],[[84969,45281],[41,87],[43,312],[175,296],[105,-15]],[[85333,45961],[-99,380]],[[85234,46341],[-542,-196]],[[84692,46145],[164,-276],[79,-366]],[[12779,86964],[21,-346],[66,11],[13,-348],[73,-104],[133,22],[74,-222],[67,10],[18,-347],[-71,-11],[43,-925],[62,10],[12,-231],[67,10],[19,-462],[67,9],[14,-347],[-67,-9]],[[14813,80509],[565,5],[510,-19],[495,-40],[435,-53],[742,-129],[-47,-659],[385,-86],[694,-190],[350,-111]],[[18942,79227],[402,3471]],[[19344,82698],[-87,212],[-10,137],[-118,259],[-82,-7],[-192,262],[-2,227],[-78,75],[-115,244],[42,178],[-57,217],[-135,13]],[[18510,84515],[-29,-153],[35,-373],[-31,-57],[-150,101],[-180,-32],[-201,174],[-25,-197],[-108,-33],[-51,-112],[42,-109],[-68,-59],[-113,48],[-1,109],[-233,131],[-83,107],[-362,54],[44,832],[30,-47],[188,340]],[[17214,85239],[-906,89],[-175,497],[-177,-86],[-85,102],[1,232],[-60,3],[4,232],[-223,8],[26,406],[134,53],[3,163],[-195,618]],[[15561,87556],[4,583]],[[15565,88139],[-25,117],[-118,2],[1,117],[-134,1],[0,116],[-769,-16],[-437,-27],[3,-117],[-534,-52],[-5,116],[-267,-34],[-6,116],[-464,-70]],[[80899,40679],[335,-266],[222,-72],[85,52],[108,-113],[32,112],[82,-43]],[[81763,40349],[-9,99],[89,-5],[64,93],[13,218],[65,273],[-39,59],[54,221]],[[82000,41307],[-849,243]],[[81151,41550],[-165,45]],[[80986,41595],[-87,-916]],[[62154,67864],[575,-45],[197,19]],[[62926,67838],[198,-5],[17,834]],[[63141,68667],[12,672]],[[63153,69339],[-987,41]],[[62166,69380],[-46,-502],[59,-6],[-16,-672]],[[65551,67832],[-12,-337],[291,-33],[94,-64],[-11,-285]],[[65913,67113],[289,-29],[5,115],[480,-56]],[[66710,67702],[8,170]],[[66718,67872],[-516,63]],[[66202,67935],[-628,67]],[[65574,68002],[-23,-170]],[[81915,51455],[-72,193]],[[81843,51648],[-36,-140],[108,-53]],[[81934,51457],[0,0]],[[59179,42602],[863,-56],[3,167]],[[60045,42713],[22,1177]],[[60067,43890],[-857,61]],[[59210,43951],[-24,-899]],[[59186,43052],[-7,-450]],[[79352,50663],[112,-172]],[[79464,50491],[81,145],[195,-6],[136,-125],[48,85],[135,33],[114,-60],[62,119],[53,-75],[165,112]],[[80453,50719],[-59,355]],[[80394,51074],[-72,271],[-55,24],[-173,295],[-203,74],[-119,-115]],[[79772,51623],[-103,-152],[-113,16],[-176,-318],[-16,-213],[-120,-127],[108,-166]],[[87807,58109],[59,-61],[249,-26],[269,149],[50,-137],[120,12],[109,176],[69,214],[65,80]],[[88797,58516],[85,82],[88,301],[-5,127]],[[88965,59026],[-214,282],[-124,246],[-308,478]],[[88319,60032],[-120,-100],[-292,-862]],[[87907,59070],[-26,-242],[-10,-542],[-64,-177]],[[57116,45130],[675,-14]],[[57791,45116],[5,844]],[[57796,45960],[-1,279]],[[57795,46239],[-666,14]],[[57129,46253],[-4,-286]],[[57125,45967],[-9,-837]],[[73958,79469],[48,-91],[155,-27],[51,-126],[700,-115],[-29,-499],[98,-19]],[[74981,78592],[97,-16]],[[75078,78576],[81,1395]],[[75159,79971],[70,1051]],[[75229,81022],[-78,-83],[-121,-21],[-111,-112],[-131,-208],[-193,-120],[-165,-198],[-211,-190],[-239,-162]],[[73980,79928],[-22,-459]],[[15307,4945],[588,294],[1275,583]],[[17170,5822],[40,279],[-98,66],[-39,328]],[[17073,6495],[-168,31],[-175,248],[-220,154],[-78,482],[122,88],[-68,191],[63,79],[-8,247],[-181,35],[24,132]],[[16384,8182],[0,1]],[[14997,6599],[154,-35],[27,-512],[-30,-388],[132,-67],[-94,-242],[125,-216],[-4,-194]],[[14862,6382],[74,-321],[94,-198],[34,192],[-43,213],[83,114],[-146,108],[-101,-10],[5,-98]],[[17639,4013],[-88,-127],[67,-150],[-16,-116],[63,-128],[-20,-120],[59,-111],[126,41],[18,-109],[145,-4],[110,202],[105,-41]],[[18208,3350],[77,30],[-64,288],[5,216],[73,107],[-35,217],[101,110],[171,450],[-43,148],[183,424],[81,87],[80,440],[260,115]],[[19097,5982],[-98,189],[-28,140],[-69,35],[-86,214],[-300,-47],[-67,112],[12,166],[-98,289],[-120,179],[-83,282],[11,256],[216,201],[49,129],[-55,277]],[[18381,8404],[-418,-181],[-144,-282],[-110,-27],[0,-100],[-124,-87],[-156,-380],[-66,11],[-107,-133],[-58,-363],[-96,-172],[-29,-195]],[[17170,5822],[90,-127],[-93,-165],[-2,-247],[134,-261],[-26,-161],[224,-56],[112,-103],[4,-111],[82,-130],[-76,-353],[20,-95]],[[82746,80480],[382,-113],[94,-170],[104,-57]],[[83326,80140],[298,862]],[[83624,81002],[-99,89],[62,544],[-513,156],[-54,-521],[-25,11]],[[82995,81281],[-82,29],[-120,-370],[-47,-460]],[[18381,8404],[7,146],[99,66]],[[18487,8616],[-45,349],[-91,175],[43,521],[-46,314],[33,178],[-112,265]],[[18269,10418],[-799,-359],[52,-319],[-186,-88],[48,-318],[-581,-263],[-47,-336],[-225,-489],[-126,12],[-21,-76]],[[83242,83586],[-1,184],[-62,108],[30,275],[249,-62],[11,109],[661,-188]],[[84130,84012],[62,26],[67,219],[116,110],[31,115],[-46,162],[105,302]],[[84465,84946],[-1548,415]],[[82917,85361],[-143,-1582],[17,-78],[451,-115]],[[77947,71325],[138,-472],[48,-8]],[[78453,71273],[-44,98],[175,235],[-64,297]],[[78520,71903],[-156,-69],[-31,68],[-323,68]],[[64063,77218],[210,-125],[664,-64]],[[64937,77029],[161,-17]],[[65107,78355],[-493,49]],[[64614,78404],[-447,42]],[[64167,78446],[-32,-1084],[-72,-144]],[[48938,22495],[1536,98]],[[50474,22593],[-18,1328]],[[50456,23921],[-1337,-82]],[[49119,23839],[-213,-16]],[[48906,23823],[32,-1328]],[[67598,37648],[62,1002]],[[67660,38650],[3,337]],[[67663,38987],[-556,99]],[[49470,52434],[945,50]],[[50415,52484],[8,355]],[[50423,52839],[-15,1010]],[[49446,53804],[17,-1013]],[[58789,31557],[766,-38]],[[59555,31519],[3,164]],[[59558,31683],[20,1173]],[[53231,38570],[144,53],[121,-35],[91,94],[204,-26],[163,154]],[[53954,38810],[81,113],[23,191],[94,191],[-25,120],[64,170]],[[54191,39595],[26,288],[-48,126],[34,145]],[[54203,40154],[-51,115],[-191,-5]],[[53961,40264],[0,-112],[-743,-13]],[[53218,40139],[13,-1569]],[[60665,63869],[161,-3],[1,336],[186,-1],[7,279],[199,54],[1,174],[173,-6],[6,167],[191,-7],[5,336]],[[61595,65198],[-288,10],[1,169],[-338,7],[-61,168],[-80,1]],[[60829,65553],[-35,-225],[-98,3],[-1,-114],[-100,5]],[[60595,65222],[-34,-333],[-126,5],[0,-170],[-191,2],[10,-521],[-193,12]],[[60061,64217],[-4,-332],[444,-14],[164,95],[0,-97]],[[64947,27259],[-202,16]],[[64745,27275],[-42,-1007],[-187,19],[-26,-663]],[[56334,53146],[824,-11]],[[57158,53135],[1,75]],[[57169,54327],[0,99]],[[57169,54426],[-805,11]],[[56364,54437],[-24,-169]],[[50866,72804],[842,41]],[[51708,72845],[-6,910]],[[51702,73755],[-314,-1],[-310,309]],[[51078,74063],[-218,-1077]],[[50860,72986],[6,-182]],[[54124,49887],[4,-838]],[[54128,49049],[702,1]],[[54830,49050],[-7,1177]],[[54823,50227],[1,673],[-16,343]],[[41750,29853],[1696,234]],[[43446,30087],[-78,1825]],[[43368,31912],[-818,-108]],[[42550,31804],[-888,-124]],[[41662,31680],[88,-1827]],[[36102,13039],[201,59],[176,-31],[197,160],[30,226],[-33,221]],[[36532,15941],[64,204],[8,177]],[[36604,16322],[-1227,-246]],[[35377,16076],[27,-330],[30,7],[80,-985],[-194,-45],[52,-315],[26,-327],[194,45],[11,-137],[384,81],[34,-20],[81,-1011]],[[70450,42042],[-47,-837]],[[70403,41205],[535,-90]],[[70938,41115],[112,-19],[10,167],[115,36]],[[71175,41299],[37,606]],[[71212,41905],[8,134]],[[70457,42179],[-7,-137]],[[51745,16358],[389,14]],[[51605,18674],[-624,-27]],[[50981,18647],[19,-1327],[-43,-1],[16,-992]],[[91449,18019],[279,111],[-51,374],[193,113]],[[91870,18617],[-49,329]],[[91821,18946],[-44,348],[-192,-140],[-44,340],[-262,-100]],[[91279,19394],[-56,-6],[29,-197],[-64,-155],[-191,-238]],[[90997,18798],[71,-338],[96,34],[27,-384],[195,-143],[63,52]],[[76756,67673],[72,-60],[40,-211],[120,-78],[-25,-120],[80,-160]],[[77043,67044],[133,265]],[[77176,67309],[127,462],[3,239]],[[77306,68010],[-74,-62],[-337,65]],[[76895,68013],[-152,32]],[[76743,68045],[13,-372]],[[64745,27275],[-284,25]],[[64461,27300],[-653,72]],[[63808,27372],[-29,-672]],[[58050,33936],[-11,-1011]],[[48078,78880],[750,43]],[[48828,78923],[-2,73],[244,15]],[[49070,79011],[-29,1620]],[[48389,80589],[-347,-20],[19,-809]],[[56635,72942],[311,-211],[136,-299],[83,57]],[[57165,72489],[7,886],[113,87],[118,10]],[[57403,73472],[-39,135],[-71,-38],[-651,13]],[[56642,73582],[-7,-640]],[[67512,68333],[-4,-110],[128,-17]],[[67636,68206],[640,-94],[10,226]],[[68286,68338],[42,841]],[[68328,69179],[-266,37]],[[68062,69216],[-509,66]],[[67553,69282],[-41,-949]],[[14133,37510],[-76,479]],[[14057,37989],[-1062,-470],[-152,39],[-369,303],[-151,169],[-160,312],[-105,-41],[-40,-122],[-96,55],[-142,-153]],[[11780,38081],[116,-729],[48,-147],[80,-2],[44,-115],[168,-177],[181,38]],[[43368,31912],[338,44]],[[43706,31956],[-36,824],[32,3],[-55,1325]],[[43647,34108],[-1098,-131]],[[42549,33977],[-58,-7],[61,-1333],[-37,-5],[35,-828]],[[10181,22270],[-29,164],[211,107],[42,142],[114,100],[172,-74],[148,105],[51,144]],[[10890,22958],[-364,2119],[-83,458]],[[10443,25535],[-455,-218]],[[9988,25317],[-484,-227]],[[9504,25090],[-12,-185],[71,-169],[-20,-202],[86,-73],[70,-190],[-71,-554],[-210,-136],[152,-492],[156,84],[155,-301],[52,-182],[248,-420]],[[53202,41481],[-2,672]],[[53200,42153],[-10,670]],[[53190,42823],[-764,-18]],[[47577,59149],[-16,673]],[[47561,59822],[-25,1009]],[[47536,60831],[-971,-75]],[[46565,60756],[47,-1685]],[[76518,68147],[232,-9],[-7,-93]],[[76895,68013],[67,973],[-142,92]],[[76820,69078],[-14,-219],[-274,52]],[[76532,68911],[26,-193],[-40,-571]],[[66129,75321],[412,-96]],[[66541,75225],[23,632],[228,168],[106,165],[12,305]],[[66910,76495],[-127,14]],[[66783,76509],[-323,35],[8,169],[-257,26]],[[66211,76739],[-19,-505],[-32,4],[-31,-917]],[[77996,40369],[38,272]],[[78034,40641],[51,832],[-47,155]],[[78038,41628],[-390,30]],[[77648,41658],[-16,25],[-524,70]],[[77108,41753],[-24,-720]],[[43510,63828],[309,31]],[[43590,65514],[-796,-90]],[[42794,65424],[68,-1668]],[[71400,22571],[258,-42],[20,334],[574,-109]],[[72336,23734],[-699,132],[-53,192]],[[71584,24058],[-89,-165],[-95,17]],[[71400,23910],[56,-284],[-2,-716],[-54,-339]],[[48588,43977],[756,46]],[[49344,44023],[190,10]],[[49534,44033],[-30,1674]],[[49504,45707],[-914,-52]],[[48590,45655],[-44,-3]],[[45068,52440],[765,73]],[[45833,52513],[-42,1343]],[[45791,53856],[-766,-75]],[[45025,53781],[43,-1341]],[[31024,14915],[56,82],[-12,240],[44,177],[120,62],[-47,347],[110,192],[-6,219],[127,4],[145,192],[-30,209],[-90,129],[-23,133],[61,118],[6,224]],[[31485,17243],[-375,-84],[-96,230],[-69,31],[-62,167],[-9,226],[-62,-6],[-35,159],[-137,135],[-65,-2],[-137,241]],[[30438,18340],[79,-812],[-190,-57],[186,-1956]],[[49376,39993],[767,43]],[[50187,40038],[-22,1340]],[[50160,41413],[-308,127],[-458,-55]],[[48995,41421],[-13,-112],[29,-1336]],[[17476,42771],[652,2125],[-514,3879]],[[17614,48775],[-895,-2308]],[[16719,46467],[-790,-2031]],[[15929,44436],[128,63],[255,-318],[1164,-1410]],[[84479,54190],[184,-50]],[[84663,54140],[358,-100]],[[85021,54040],[36,1464]],[[85057,55504],[-116,45],[-302,29]],[[84639,55578],[-40,-134],[-120,-1254]],[[28120,24889],[35,-326],[849,256]],[[29004,24819],[-34,327],[284,84],[-17,165]],[[29237,25395],[-75,653],[90,-25],[207,414],[88,106],[145,41],[-10,108]],[[29682,26692],[-1419,-414]],[[28263,26278],[-283,-71]],[[27980,26207],[140,-1318]],[[71814,35814],[605,-118]],[[72576,35666],[64,892]],[[71880,36715],[-66,-901]],[[62730,34988],[381,-32]],[[63111,34956],[31,1006]],[[63142,35962],[10,336]],[[62382,36361],[-34,-1342]],[[56232,35655],[382,-4]],[[56614,35651],[377,-8]],[[56991,35643],[12,1334]],[[57003,36977],[-192,6]],[[56811,36983],[-575,8]],[[56236,36991],[-4,-1336]],[[49435,15915],[326,20]],[[49761,15935],[1168,63]],[[50981,18647],[-920,-42]],[[49426,18563],[33,-1329],[-53,-2],[29,-1317]],[[56991,35643],[380,-9]],[[57770,36953],[-192,8]],[[57578,36961],[-575,16]],[[70041,78968],[-47,-257],[64,-232],[78,-72],[-76,-123],[43,-248],[51,-48],[-84,-113],[31,-313],[-75,-149],[58,-230],[-65,-50]],[[70019,77133],[44,-123]],[[70063,77010],[63,12],[127,-232],[18,-128],[116,-102]],[[70387,76560],[89,-35],[86,145],[118,50]],[[70680,76720],[50,944],[32,-5]],[[70762,77659],[24,123],[-67,390],[174,280],[45,157],[254,224],[34,165],[-79,476],[74,193],[89,89],[-101,97],[-35,248],[-81,121],[59,51],[-94,99]],[[71058,80372],[-260,157],[-344,138],[-239,26],[45,-129],[86,72],[239,-124],[16,-113],[-189,-303],[-123,-105],[-67,-290],[44,-199],[-29,-297],[-54,-152],[-142,-85]],[[73185,32980],[193,-41]],[[73378,32939],[747,-167]],[[74125,32772],[15,-4]],[[74238,34117],[-379,73]],[[73859,34190],[-565,129]],[[73294,34319],[-109,-1339]],[[76939,54811],[858,-185]],[[78070,54561],[-196,244],[-112,-54],[-179,236],[-130,312],[28,61],[-144,148]],[[77337,55508],[-134,-67],[-59,40]],[[77144,55481],[17,-183],[-74,-278],[-148,-209]],[[48590,45655],[-42,1676]],[[48548,47331],[-932,-64]],[[47616,47267],[-28,-1]],[[47588,47266],[48,-1678]],[[56344,51744],[2,841],[-13,337]],[[55335,65041],[288,-3],[-1,-335]],[[55622,64703],[829,-9]],[[56451,64694],[222,-5],[5,671]],[[56678,65360],[-200,2],[7,1015],[-192,3],[-8,335]],[[56285,66715],[-1143,12]],[[55142,66727],[-2,-1348],[197,-2],[-2,-336]],[[42776,75682],[58,7]],[[42834,75689],[967,105]],[[43801,75794],[-78,2189]],[[43723,77983],[-999,-134]],[[42724,77849],[5,-429],[47,-1738]],[[48040,23757],[866,66]],[[49119,23839],[-28,1331]],[[48932,25159],[-1155,-85]],[[47777,25074],[-21,-355],[57,-138],[174,42],[-64,-310],[79,-222],[38,-334]],[[49370,42679],[-26,1344]],[[48583,43977],[26,-1347]],[[56488,30691],[97,-3]],[[56585,30688],[664,-16]],[[57249,30672],[9,943]],[[57258,31615],[-762,18]],[[56496,31633],[-8,-942]],[[50284,9624],[1558,67]],[[51842,9691],[-12,1069],[33,1],[-8,660]],[[51855,11421],[-584,-25]],[[51271,11396],[-975,-48]],[[13534,41278],[184,389],[254,-130],[89,66],[-27,166],[81,188]],[[14115,41957],[-39,158],[46,202],[-64,132],[69,169],[108,138],[75,201],[44,-43],[108,157],[43,165],[-45,362],[148,314],[-51,356],[-141,158]],[[14416,44426],[-46,-174]],[[14370,44252],[-82,-281],[-74,-137],[-107,-35],[-122,-181],[-256,281],[-223,62],[-87,-99],[-125,-18],[-119,-245],[-87,-105],[-102,139],[-88,-90],[-25,93],[-288,41],[28,225],[-44,71],[-83,-172],[-27,188]],[[12459,43989],[-335,-942]],[[12124,43047],[182,-180],[126,-196],[-13,-130],[128,-29],[243,-446],[447,-677],[297,-111]],[[48548,47331],[23,2]],[[47563,48943],[53,-1676]],[[48836,92950],[312,22],[5,-327]],[[49871,94847],[-1068,-60]],[[48803,94787],[33,-1837]],[[66319,23742],[247,-31],[38,998]],[[66604,24709],[-390,49],[-13,-332],[-387,52],[-15,-329]],[[65799,24149],[-16,-340],[536,-67]],[[57355,29335],[196,-6]],[[57551,29329],[13,1335]],[[57564,30664],[-315,8]],[[56585,30688],[-9,-1334]],[[71962,72290],[38,118],[40,-131],[-22,-204],[111,-51],[75,179],[47,-178],[77,76],[227,77]],[[72555,72176],[45,42],[-9,183],[151,129],[49,739]],[[72791,73269],[22,332],[-81,11]],[[71963,73751],[-16,-330],[-95,17]],[[71852,73438],[-40,-677],[183,-29],[-111,-163],[78,-279]],[[73795,48719],[147,-182],[67,57]],[[74009,48594],[137,42],[88,-71]],[[74302,49161],[-226,256],[5,94]],[[74081,49511],[-58,103],[-219,-94]],[[73804,49520],[5,-568],[57,-234],[-71,1]],[[61037,44158],[569,-28]],[[61606,44130],[191,-10]],[[61797,44120],[17,1118]],[[61814,45238],[-576,24],[-8,227],[-182,8]],[[61048,45497],[-11,-1339]],[[53626,58998],[578,-4]],[[54204,58994],[0,333],[480,3],[-7,844]],[[54677,60174],[-286,-2],[-1,841]],[[54390,61013],[-770,-6]],[[53620,61007],[3,-1166]],[[53623,59841],[3,-843]],[[52518,84091],[521,-8]],[[53039,84083],[79,215],[77,-1],[449,930],[-192,271]],[[53452,85498],[-551,759]],[[52901,86257],[-73,-157]],[[52828,86100],[-507,-1082]],[[52321,85018],[77,-469],[-1,-279],[121,-179]],[[66124,28125],[16,337]],[[66140,28462],[43,1002]],[[66183,29464],[-194,26]],[[65989,29490],[-193,29],[-1,-45],[-191,25]],[[65604,29499],[-18,-447],[124,-37],[-8,-170],[-49,-2],[-11,-247],[49,-5],[-18,-407]],[[48050,41246],[-406,-31]],[[47644,41215],[33,-1334]],[[71814,35814],[-216,41]],[[71598,35855],[42,-162],[-70,-1035]],[[66643,50347],[-37,-1006]],[[66606,49341],[769,-102]],[[67375,49239],[32,841]],[[67426,50586],[-738,96]],[[66688,50682],[-35,4],[-10,-339]],[[59538,30582],[760,-46]],[[60319,31639],[-761,44]],[[59555,31519],[-17,-937]],[[17573,85295],[221,-75],[32,-120],[160,-152],[66,35],[183,-257],[124,-61],[151,-150]],[[19344,82698],[600,5171]],[[17840,86713],[-26,-419],[-176,38]],[[17638,86332],[-65,-1037]],[[65635,39116],[-14,-328],[183,-20],[26,-264],[108,-95],[175,25]],[[55764,39707],[382,-2]],[[56146,39705],[381,-4]],[[56532,40695],[-765,8]],[[55767,40703],[-3,-996]],[[60344,32814],[769,-51]],[[61113,32763],[24,1018]],[[60365,33831],[-21,-1017]],[[66602,49229],[-29,-899]],[[67321,47886],[32,847]],[[67353,48733],[22,506]],[[66606,49341],[-4,-112]],[[82057,57778],[84,-22]],[[82141,57756],[787,-210]],[[82928,57546],[-256,1315]],[[82672,58861],[-90,-66]],[[82582,58795],[-229,-168],[-76,-286],[-150,-173],[21,-55],[-91,-335]],[[42899,74020],[143,16]],[[43860,74124],[-59,1670]],[[42834,75689],[65,-1669]],[[48377,81405],[-871,-71]],[[47506,81334],[-698,-47]],[[63904,30033],[192,-24],[50,1498]],[[64146,31507],[-113,-117],[-147,-31],[-127,47]],[[63759,31406],[-188,-22],[-191,171]],[[63380,31555],[-35,-963]],[[63345,30592],[-21,-497],[580,-62]],[[45584,60648],[0,24]],[[71484,53086],[543,-151]],[[72027,52935],[218,428],[-2,187]],[[72243,53550],[-4,443],[-71,-18]],[[72168,53975],[-142,-35],[-53,-97],[-105,109],[-227,-307]],[[71641,53645],[-157,-559]],[[72975,44258],[444,-90]],[[73419,44168],[376,-59]],[[73795,44109],[50,832]],[[73845,44941],[-419,76]],[[73426,45017],[-259,46],[-124,180]],[[73043,45243],[-49,-709]],[[72994,44534],[-19,-276]],[[22925,21086],[-1,-336],[94,-451],[-42,-292],[59,-304],[103,-273],[78,-108],[-20,-102],[96,-204],[-60,-201]],[[23232,18815],[59,-178],[59,44],[192,-189],[-10,90],[1977,690]],[[25509,19272],[-80,152],[-49,553],[-34,117],[-17,311],[-174,264]],[[24195,22168],[-86,-63],[-20,160],[-97,136],[-168,48],[-930,-345],[-75,320],[-146,-68]],[[22673,22356],[83,-648],[94,35],[75,-657]],[[85414,46980],[114,-526]],[[85528,46454],[175,-141],[268,46]],[[85971,46359],[63,-20],[241,86],[199,202]],[[86474,46627],[-69,1118]],[[86405,47745],[-170,-67],[-139,-294],[-79,-15],[-59,-118],[-83,-21]],[[85875,47230],[-461,-250]],[[49937,71244],[277,21],[4,-214]],[[50907,71096],[-41,1708]],[[50860,72986],[-762,-37]],[[50098,72949],[-189,-17]],[[49909,72932],[28,-1688]],[[42631,65405],[163,19]],[[42554,67279],[77,-1874]],[[73063,77297],[383,-66]],[[73446,77231],[289,-49]],[[73735,77182],[63,1101],[369,-61]],[[74167,78222],[-34,160],[-85,117],[8,153],[78,142],[-4,141],[58,104],[-68,190],[-118,37],[-44,203]],[[73980,79928],[-188,-99],[-414,-156],[-192,-26]],[[90078,27961],[722,-512]],[[90800,27449],[29,341],[63,317],[-73,259],[8,151],[-55,276]],[[90772,28793],[-173,-127],[-60,51],[-14,297],[-383,83],[-259,-115]],[[89883,28982],[-153,-66],[100,-623],[-27,-12]],[[73674,42257],[-69,-1171]],[[73594,40923],[619,-134]],[[74259,41391],[87,1059]],[[74346,42450],[-100,26]],[[74246,42476],[-551,119]],[[55720,11476],[195,-2],[5,659],[1173,-31]],[[57093,12102],[34,1976]],[[57127,14078],[18,1522]],[[57145,15600],[1,125],[-386,16]],[[56760,15741],[-780,6]],[[55980,15747],[-22,-990],[-3,-755],[-80,-40],[-47,-228],[71,-290],[-533,3]],[[55348,12870],[-1,-729],[-13,0],[-3,-656]],[[71379,26594],[364,-71]],[[71743,26523],[393,-73]],[[54805,53432],[-1,838]],[[54804,54270],[-5,338]],[[54799,54608],[-986,-18]],[[53813,54590],[0,-670]],[[53813,53920],[3,-505]],[[44240,50319],[827,84]],[[45067,50403],[44,4]],[[45111,50407],[-58,1678],[27,3],[-12,352]],[[45068,52440],[-899,-103]],[[44169,52337],[71,-2018]],[[59084,11037],[206,-21],[33,87],[306,238],[138,-22],[1,165],[-92,22],[-18,122],[86,95],[222,-56],[80,172],[-16,187],[162,488],[147,-115],[-61,-255],[63,-150],[84,30],[226,-67],[86,137],[-5,212],[76,118],[97,-25],[46,112],[100,9]],[[61051,12520],[80,2484],[50,2307]],[[61181,17311],[-133,139],[-312,472],[128,301]],[[60864,18223],[-118,-155],[-150,131],[-15,240],[-139,-23]],[[59242,17105],[-21,-314],[-24,-1081],[-10,-1239],[-32,1],[-10,-651]],[[59145,13821],[-35,-665],[-26,-2119]],[[61467,38116],[194,-18]],[[61661,38098],[513,-38],[69,331]],[[62243,38391],[25,1006]],[[61884,39426],[-383,26]],[[61501,39452],[-34,-1336]],[[48935,72884],[974,48]],[[50098,72949],[-11,822],[-146,138]],[[49941,73909],[-714,670]],[[49101,82014],[-20,1365]],[[49081,83379],[-493,-462],[-196,-46],[-627,-52]],[[47765,82819],[-171,-15],[17,-632],[-131,-10]],[[47480,82162],[26,-828]],[[83527,29876],[435,-143]],[[83962,29733],[319,-90],[19,163],[190,-50]],[[84490,29756],[59,724],[100,1075]],[[84649,31555],[-740,240]],[[83909,31795],[-164,54]],[[83745,31849],[-218,-1973]],[[44489,67471],[-45,1675]],[[82733,50539],[-3,178]],[[82730,50717],[-69,43],[-91,-91],[137,-185],[26,55]],[[87384,49056],[87,-31]],[[87471,49025],[62,55],[-109,160],[-40,-184]],[[64000,38605],[-14,-500],[157,-236],[228,-137],[6,-160]],[[64377,37572],[535,-55]],[[64912,37517],[18,252],[40,1091]],[[64970,38860],[-5,331],[-193,19]],[[64016,39282],[-16,-677]],[[66461,71925],[-37,-963]],[[66424,70962],[-7,-172],[764,-96]],[[67240,72057],[-9,1]],[[67231,72058],[-762,85],[-8,-218]],[[35843,62206],[473,89],[19,-306],[-168,-45],[20,-332]],[[36187,61612],[956,166]],[[37143,61778],[765,130]],[[37908,61908],[-95,1670],[-41,-8],[-58,996]],[[37714,64566],[-19,334],[-1117,-194]],[[36578,64706],[-893,-163],[42,-689]],[[35727,63854],[21,-314],[-97,-17],[31,-332],[67,-1002],[94,17]],[[43580,40627],[1005,114]],[[44585,40741],[-8,201]],[[44540,41933],[-1032,-113]],[[43508,41820],[42,-1026],[30,-167]],[[43314,41797],[194,23]],[[44527,42282],[-50,1332]],[[44477,43614],[-58,1652]],[[44419,45266],[-1284,-124]],[[54960,31640],[768,4]],[[55728,31644],[5,1327]],[[55733,32971],[-767,8]],[[54966,32979],[-6,-1339]],[[67231,72058],[55,1353]],[[67286,73411],[-765,95]],[[66521,73506],[-18,-502],[-136,-886]],[[66367,72118],[94,-193]],[[50170,37363],[12,1]],[[50182,37364],[-22,1333]],[[50160,38697],[-751,-40]],[[81431,55842],[89,-76],[168,-33]],[[82022,55658],[46,762]],[[82068,56420],[-48,720],[121,616]],[[82057,57778],[-222,27],[-64,110]],[[81771,57915],[-41,-207]],[[81730,57708],[36,-293],[-175,-306],[-99,25],[-109,-228]],[[69535,66567],[580,-68]],[[70115,66499],[8,166],[193,-12],[41,672],[193,-18],[17,334]],[[70567,67641],[-384,29],[-58,124],[11,223],[-321,36]],[[69815,68053],[-195,31]],[[69620,68084],[-85,-1517]],[[46701,43834],[924,76]],[[47625,43910],[26,2]],[[47604,45587],[-920,-78]],[[46648,45506],[53,-1672]],[[19927,18119],[107,-189],[113,-63],[79,143],[143,141],[183,-201],[110,332],[329,128],[44,-322],[457,174]],[[21492,18262],[741,294]],[[22233,18556],[-126,171],[-37,157],[18,187],[-151,301]],[[21937,19372],[-80,195],[-225,137],[-208,542],[-28,134],[-135,136],[-14,217],[-58,98],[52,262],[-64,107]],[[21177,21200],[-416,-158],[44,-324],[-114,-157],[-18,-121],[-591,-233],[-223,249],[-23,105],[-108,71],[-16,107],[-131,5]],[[70039,64996],[192,-20]],[[70231,64976],[767,-100]],[[70998,64876],[61,1178],[-72,8]],[[70987,66062],[-639,87],[-251,17]],[[70097,66166],[-58,-1170]],[[63262,50739],[548,-50]],[[63810,50689],[185,374],[75,94]],[[64070,51157],[35,1318]],[[64105,52475],[-401,40],[-395,13]],[[63309,52528],[-16,-840],[-31,-949]],[[68995,41203],[-49,-944]],[[68946,40259],[433,-66]],[[69379,40193],[282,-45]],[[69661,40148],[42,666]],[[69703,40814],[21,334]],[[69724,41148],[-726,110]],[[68998,41258],[-3,-55]],[[11257,57627],[165,169],[115,35],[102,191],[118,65],[65,-104],[121,113],[-93,114],[-188,-43],[-118,53],[-260,-196],[24,-195],[-51,-202]],[[10630,57649],[146,40],[237,-5],[-20,155],[105,92],[-14,156],[-290,57],[-71,-124],[-93,-371]],[[10292,57356],[175,-64],[78,233],[-104,-13],[-149,-156]],[[10478,53706],[27,60],[243,-9],[108,66],[198,408],[27,-96],[-9,-330],[199,71],[109,-166],[140,-90],[184,297],[89,39],[138,268],[130,185],[139,74],[192,376],[113,35]],[[12505,54894],[54,23]],[[12559,54917],[-240,1635],[-40,220],[-72,76]],[[12207,56848],[-124,-197],[-198,-97],[-77,49],[-140,-150],[-145,-28],[-209,-297],[-228,-153],[-288,-103],[-310,-63],[-28,-312],[-204,-323],[142,-379],[-26,-266],[99,-302],[-32,-247],[-40,-30],[79,-244]],[[9635,28436],[152,232],[48,279],[189,100],[89,164],[3,155],[113,42],[78,105],[45,-99],[-10,-165],[-62,-114],[68,-225],[128,-143],[155,55],[44,-60],[371,-237],[74,-78],[81,189],[-70,155],[-50,265],[14,96]],[[9637,33267],[-994,-497],[16,-92]],[[8659,32678],[474,-2705],[28,-479],[-21,-310],[97,-22],[88,177],[93,-62],[113,-248],[-41,-220],[145,-373]],[[64715,45510],[388,-48]],[[65103,45462],[383,-48]],[[65486,45414],[25,734],[58,1285]],[[65569,47433],[-768,80]],[[64801,47513],[-40,-1009]],[[64761,46504],[-46,-994]],[[73761,28417],[189,-35],[11,165],[374,-75],[12,165],[190,-41]],[[74537,28596],[80,979]],[[74617,29575],[-380,88],[30,333]],[[74267,29996],[-705,168]],[[51078,74063],[145,566]],[[51223,74629],[-268,258]],[[50567,75258],[-77,-244],[-146,143],[-403,-1248]],[[80897,85535],[829,-209],[-11,-167],[384,-94]],[[82099,85065],[52,625]],[[82151,85690],[18,203],[-99,23],[29,330]],[[82099,86246],[-1067,258]],[[81032,86504],[-301,76]],[[80731,86580],[69,-196],[97,-849]],[[80683,86593],[-58,13]],[[80625,86606],[-17,-169],[61,-19],[14,175]],[[82286,53631],[256,-46],[425,-117]],[[82967,53468],[46,-13]],[[83107,54544],[-735,194]],[[82372,54738],[-86,-1107]],[[22301,22218],[146,55],[86,-462],[12,-172],[132,-431]],[[22677,21208],[109,-39],[57,-159],[82,76]],[[22673,22356],[-93,-34],[-177,1285]],[[22403,23607],[-362,-135]],[[22041,23472],[-314,-118]],[[21727,23354],[85,-652],[219,86],[76,-83],[27,-214],[125,49],[42,-322]],[[80374,44547],[194,-196],[117,-174],[28,-113]],[[80713,44064],[148,13]],[[80861,44077],[51,327],[226,344]],[[81138,44748],[-104,74],[-474,814]],[[80560,45636],[-149,-254],[73,-226],[-42,-438],[-68,-171]],[[50588,55683],[415,16]],[[51003,55699],[-15,1557],[9,4]],[[50997,57260],[-7,504]],[[50990,57764],[-764,-33]],[[50226,57731],[17,-1848],[-4,-220]],[[52414,44148],[768,18]],[[53182,44166],[188,4]],[[53370,44170],[-10,1678]],[[53360,45848],[-260,-5]],[[53100,45843],[-699,-17]],[[52404,45491],[10,-1343]],[[81018,70667],[140,-59],[155,106],[94,304]],[[81407,71018],[62,172],[75,39]],[[81544,71229],[-66,179]],[[81478,71408],[-239,51],[-179,-75],[-150,-729]],[[80910,70655],[108,12]],[[72399,42736],[-32,-504]],[[72367,42232],[609,-116]],[[72976,42116],[40,274]],[[73039,43224],[-136,30]],[[72903,43254],[-499,99]],[[72404,43353],[-21,-331],[33,-6],[-17,-280]],[[81056,60720],[1043,-277]],[[82099,60443],[51,114],[62,343],[-42,261],[65,328]],[[82235,61489],[-993,155]],[[81242,61644],[-9,-238],[-83,-140],[-28,-327],[-66,-219]],[[20453,63748],[167,-329],[71,-56],[45,-484],[69,-46],[6,-591],[57,-59],[-30,-272],[220,-292],[24,-195]],[[23168,61170],[-131,1206]],[[23037,62376],[-254,2355]],[[22783,64731],[-1137,-366],[37,-329],[-564,-182],[-188,1637],[-454,-143]],[[20477,65348],[-155,-44],[-122,-91],[-42,-247],[80,-216],[53,-417],[-85,-155],[84,-202],[-29,-178],[192,-50]],[[47710,35876],[164,13]],[[47874,35889],[792,55]],[[48666,35944],[-30,1330]],[[47702,37210],[-23,-2]],[[25509,19272],[45,-127],[137,-196],[-132,-437],[-98,-189],[30,-270],[184,208],[70,-164],[132,-137]],[[28092,23303],[-57,554],[-283,-102]],[[27752,23755],[-512,-156]],[[47368,51619],[-10,335]],[[47333,53648],[-765,-60]],[[46568,53588],[29,-1008]],[[46597,52580],[-12,-359],[21,-669],[762,67]],[[66718,67872],[34,837],[231,-30]],[[66983,68679],[-130,120],[23,566]],[[66876,69365],[-354,42]],[[66522,69407],[-20,-449],[-259,-23],[-41,-1000]],[[56318,71542],[806,-22]],[[57124,71520],[27,96]],[[57151,71616],[9,331]],[[57160,71947],[5,542]],[[56635,72942],[-287,-45],[-26,-76]],[[56322,72821],[-4,-1279]],[[49757,80661],[346,8],[116,66]],[[50219,80735],[430,247]],[[50649,80982],[-95,264]],[[50554,81246],[-257,1208]],[[50297,82454],[-231,375]],[[50066,82829],[-324,-786]],[[53083,47518],[4,-338]],[[53087,47180],[192,7],[-5,505],[249,-8],[0,69],[353,6],[-1,112]],[[53875,47871],[-3,671]],[[53872,48542],[-669,-10]],[[53203,48532],[-63,-2],[3,-419],[-64,53],[4,-646]],[[73352,47426],[51,1],[236,-334]],[[73639,47093],[126,295],[53,57]],[[73818,47445],[-223,298]],[[73595,47743],[-158,76]],[[73437,47819],[-73,34],[-42,-173],[-207,-384]],[[73115,47296],[150,-12],[87,142]],[[71223,37007],[10,166]],[[71233,37173],[71,1005],[-39,8]],[[70560,37302],[-11,-166],[674,-129]],[[83185,55486],[-78,-942]],[[83997,54344],[117,1303]],[[83213,55830],[-28,-344]],[[86962,42978],[46,54]],[[87008,43032],[-46,-54]],[[83518,48434],[0,0]],[[73102,34350],[192,-31]],[[73859,34190],[106,1401]],[[73965,35591],[-64,16]],[[73901,35607],[-666,175]],[[73235,35782],[-48,-238]],[[45268,48733],[614,57]],[[45834,50471],[-723,-64]],[[45067,50403],[59,-1682]],[[59462,27910],[579,-28]],[[60041,27882],[27,1330],[-17,1]],[[60051,29213],[-573,33]],[[59478,29246],[-24,-1336]],[[66304,42384],[968,-123]],[[67024,43170],[-675,110]],[[42899,74020],[-962,-109]],[[41937,73911],[-499,-67]],[[41438,73844],[72,-1668]],[[51012,27958],[764,34]],[[51765,29317],[-186,-10]],[[50999,28951],[13,-993]],[[58031,26978],[67,-239],[-41,-94]],[[58057,26645],[613,-27]],[[58689,27950],[-388,17]],[[58301,27967],[-2,-166],[-389,14]],[[57910,27815],[-22,-69],[143,-336],[-48,-79],[48,-353]],[[65531,32582],[577,-81]],[[66108,32501],[385,-30]],[[66493,32471],[61,1344]],[[66554,33815],[-268,23]],[[65590,33904],[-59,-1322]],[[59478,29246],[-5,0]],[[58900,29276],[-21,-1336]],[[82649,35908],[-101,-1070]],[[82548,34838],[170,-30],[13,-61]],[[82731,34747],[188,-198],[26,48],[407,262],[66,218]],[[83418,35077],[-92,26],[-34,287],[90,858]],[[83382,36248],[-678,188]],[[82704,36436],[-55,-528]],[[56504,32960],[767,-12]],[[57271,32948],[9,1011]],[[57284,34291],[-772,13]],[[56512,34304],[-8,-1344]],[[55616,29369],[1,1334]],[[55617,30703],[-656,6]],[[54961,30709],[-310,0]],[[25333,93326],[54,-62],[87,232],[-10,219]],[[25464,93715],[-147,-158],[16,-231]],[[25034,95023],[14,-161],[-46,-173],[92,49],[55,249],[-115,36]],[[24024,95001],[0,-142],[132,-88],[66,85],[-25,152],[-95,166],[-7,-170],[-71,-3]],[[23894,94360],[61,-318],[-63,-29],[7,-201],[181,-50],[182,317],[134,63],[103,138],[166,313],[-134,-41],[-16,137],[77,-81],[139,130],[20,194],[78,-104],[28,94],[-17,286],[53,-91],[72,293],[-8,132],[-123,47],[-102,-29],[52,-130],[-141,-80],[-37,-261],[-58,78],[28,178],[-83,-21],[-48,-206],[-88,-9],[184,397],[57,-93],[90,178],[-71,-22],[68,159],[-88,20],[-187,-257],[-92,-329],[-95,67],[-24,-129],[137,-203],[-117,-158],[-235,-176],[49,-97],[-18,-246],[-64,209],[-57,-69]],[[23676,94551],[100,-32],[-46,118],[-54,-86]],[[23935,93593],[-92,115],[-45,-119],[6,641],[-54,147],[-77,-120],[-68,-291],[-1,-247],[-56,-4],[-106,-356],[39,-143],[94,-32],[70,128],[-28,-204],[-68,-59],[50,-123],[248,-13]],[[23480,94130],[12,152]],[[23492,94282],[-12,-152]],[[46291,30738],[1637,134]],[[47928,30872],[-26,1006],[25,1],[-13,499]],[[47914,32378],[-1671,-139]],[[79095,74426],[343,-68],[6,54],[223,-48],[53,131],[355,-83]],[[80075,74412],[27,339],[-132,19],[14,209],[67,137]],[[80051,75116],[-565,134]],[[79486,75250],[-143,35]],[[79343,75285],[-2,-354],[-66,-196],[-109,-123],[-71,-186]],[[23492,94282],[-73,-54],[-251,-492],[-203,-158],[60,-14],[-4,-233],[-73,-67],[18,-224],[-72,57],[-84,-147],[66,-306],[174,116],[89,-32],[39,206],[202,624],[100,572]],[[22770,93146],[15,-154],[118,129],[4,281],[-86,61],[14,-185],[-65,-132]],[[22956,92319],[68,-28],[105,316],[-103,94],[-235,-169],[43,242],[-34,181],[-81,-17],[-131,-193],[-45,15],[-106,-280]],[[66522,69407],[-105,13],[-78,282]],[[66339,69702],[-804,-371]],[[65535,69331],[-12,-321],[68,-5],[-5,-164],[67,-6],[-32,-775],[-47,-58]],[[85104,87813],[704,-194]],[[85808,87619],[76,198],[122,430],[150,407]],[[85233,89135],[-129,-1322]],[[60875,41680],[-483,55]],[[60392,41735],[-26,-1186]],[[63301,41327],[192,-4]],[[63493,41323],[579,-26]],[[64072,41297],[39,1354]],[[64111,42651],[-777,43]],[[63334,42694],[-33,-1367]],[[75580,36038],[124,-32],[14,166],[636,-150]],[[76354,36022],[7,107],[173,-42],[54,533]],[[76588,36620],[13,132]],[[76601,36752],[-957,228]],[[75644,36980],[-64,-942]],[[67353,48733],[768,-77]],[[68310,48747],[53,1205]],[[68363,49952],[-381,55]],[[37660,78779],[1641,-1447]],[[39301,77332],[923,1433]],[[40224,78765],[259,422]],[[40483,79187],[-736,873]],[[39747,80060],[-192,-26],[-2026,-1141]],[[37529,78893],[131,-114]],[[57117,26009],[4,334],[385,-13],[-2,-335],[386,-11]],[[58278,26264],[-141,80],[-70,130],[-10,171]],[[58031,26978],[-1105,37]],[[56926,27015],[-17,-999],[208,-7]],[[47374,67698],[297,21],[5,73],[142,-5],[98,87],[13,-104],[171,164],[44,-55],[152,146],[31,130]],[[48303,69444],[-960,-59]],[[64673,49336],[105,-270],[9,-238]],[[64787,48828],[819,-70]],[[65606,48758],[40,922]],[[65646,49680],[32,756]],[[65678,50436],[-340,33]],[[65338,50469],[-53,-198],[16,-135],[-213,19],[-3,-56],[-202,-322],[-1,-54],[-218,-343]],[[64664,49380],[9,-44]],[[74046,26062],[505,-119]],[[74551,25943],[1,413],[-146,111],[12,161],[-235,72],[-69,130],[-35,197]],[[74079,27027],[-217,44],[-25,-326],[-193,41]],[[67833,46482],[604,-96]],[[68437,46386],[97,-18]],[[68534,46368],[70,1248]],[[68067,47703],[-178,7],[-10,-226]],[[53100,45843],[-13,1337]],[[53083,47518],[-701,-13]],[[52382,47505],[8,-672]],[[22594,15647],[116,-104],[-17,-194],[109,-170]],[[22802,15179],[82,33],[16,-131],[103,54],[66,122],[81,-465],[47,47],[81,-260],[37,-12],[177,203],[146,110],[107,-187],[140,54],[71,-43],[-131,-302],[-39,-321]],[[23786,14081],[138,88],[90,249],[218,173],[43,81],[97,-39],[89,-314],[166,-190],[22,-130],[1636,-54]],[[26285,13945],[77,-17],[116,89],[76,-87],[139,47]],[[23232,18815],[-247,-96],[39,-64],[-22,-552],[-529,-198]],[[22473,17905],[47,-193],[189,-404],[61,-55],[32,-174],[181,-345],[-68,-282],[6,-270],[-58,-129],[-108,-55],[-30,-160],[-128,-69],[-3,-122]],[[48529,9513],[974,68]],[[49515,11300],[-975,-68]],[[47588,47266],[-955,-82]],[[49070,79011],[992,48]],[[50062,79059],[-25,162],[151,176],[-108,165],[13,154],[94,19],[-127,276],[70,290],[-22,90],[113,67],[-2,277]],[[39034,49628],[188,29],[54,-1004]],[[39276,48653],[645,100],[886,124]],[[40807,48877],[-79,1444]],[[40644,51904],[-489,-393]],[[40155,51511],[-497,-398],[-643,-28],[-56,-142]],[[38959,50943],[75,-1315]],[[9103,21025],[345,178],[46,110],[67,369],[-44,67],[-57,325],[33,17],[-39,275],[79,-34],[147,75],[145,-142],[23,-128],[187,39]],[[10035,22176],[146,94]],[[9504,25090],[-613,-330]],[[8891,24760],[-103,-269],[-48,-279],[36,-246],[-32,-298],[25,-314],[63,-403],[160,-458],[19,-325],[-47,-96],[1,-228],[-61,-49],[11,-412],[188,-358]],[[67156,70014],[192,-25],[-13,-339],[194,-25],[-15,-338],[39,-5]],[[68062,69216],[62,1383]],[[68124,70599],[-189,21]],[[67181,70694],[-25,-680]],[[50139,42721],[-5,-1]],[[50134,42720],[-764,-41]],[[80459,41745],[527,-150]],[[81151,41550],[74,307]],[[81225,41857],[-63,10],[-15,175],[-67,145],[73,281],[-32,74]],[[81121,42542],[-70,178]],[[81051,42720],[-133,-46]],[[80918,42674],[-210,-103],[-238,-365],[-50,98],[-106,-75]],[[80314,42229],[107,-108],[-5,-231],[43,-145]],[[76309,75661],[198,-29],[38,675]],[[76191,76418],[-364,60]],[[75827,76478],[-39,-700],[521,-117]],[[37202,51289],[1012,166]],[[38214,51455],[-112,578],[24,80]],[[38126,52113],[-22,51],[-479,720]],[[49441,54136],[-934,-43]],[[48507,54093],[-16,-335]],[[44077,18069],[1278,146]],[[45355,18215],[70,8],[-43,1322],[75,8],[-10,297]],[[45447,19850],[-773,-89],[12,-293],[-660,-74]],[[60041,27882],[204,-10]],[[60245,27872],[370,-21],[7,331],[383,-23]],[[61005,28159],[24,996]],[[61029,29155],[-592,35],[1,55]],[[60438,29245],[-386,24],[-1,-56]],[[55849,35658],[383,-3]],[[55468,37000],[-191,2]],[[55277,37002],[1,-1340]],[[54830,49050],[-1,-505]],[[54829,48545],[768,-3]],[[55597,48542],[2,505]],[[55589,50224],[-766,3]],[[59600,34204],[773,-41]],[[60428,35156],[-385,25],[8,333]],[[44418,45289],[1083,111]],[[45501,45400],[43,4]],[[45484,47073],[-149,-13]],[[44360,46965],[58,-1676]],[[56811,36983],[9,1002],[72,-1],[3,377]],[[56895,38361],[-565,10]],[[98249,17157],[80,-70],[-28,138],[-52,-68]],[[98072,17379],[-8,-281],[189,209],[-58,185],[-123,-113]],[[97911,16723],[18,-160],[74,213],[-92,-53]],[[97504,17360],[72,-41],[41,118],[-113,-77]],[[97258,15698],[124,30],[42,-265],[78,32],[22,-160],[247,-214],[-224,-755],[178,-158],[-86,-299],[180,-159],[-128,-419],[354,-307]],[[98737,16014],[-71,61],[-14,323],[-100,-58],[-28,-136],[-110,98],[50,203],[-46,269],[74,74],[-182,149],[-145,-34],[-144,-295],[16,-110],[104,-144],[-56,-122],[-37,147],[-46,-141],[-180,271],[57,128],[-9,155],[109,174],[10,148],[-84,309],[56,9],[-44,155]],[[97917,17647],[-61,2]],[[97856,17649],[-121,-121],[-59,-192],[57,-203],[-130,-74],[-39,-101],[-89,115],[-52,-360],[34,-170],[-78,-272]],[[97379,16271],[-129,-314],[8,-259]],[[57539,67520],[180,25],[-15,147],[282,350],[88,46],[275,19],[0,110],[153,4]],[[58502,68221],[3,0]],[[58505,68221],[-14,303],[95,160],[80,-19],[89,90]],[[58755,68755],[-58,-4],[-73,155],[-61,-40],[-38,131],[-31,-122],[-139,116]],[[58355,68991],[-111,-66],[-38,72],[-111,-151],[-78,154],[-134,-86],[-111,131],[-36,-120],[-149,-87],[-4,-180],[-49,29]],[[57534,68687],[5,-1167]],[[57327,59193],[281,3],[8,-167],[95,-1],[3,-280],[644,21],[0,-95],[151,-31]],[[58509,58643],[-94,559],[-1,995],[-16,279]],[[58398,60476],[-291,-4],[0,55],[-662,-13]],[[57445,60514],[-118,-1321]],[[61012,63463],[111,2],[64,187],[54,-120],[344,-7],[-3,-335],[192,-5]],[[61774,63185],[92,-5],[12,1087],[-53,416],[153,-4],[11,508]],[[61989,65187],[-325,9]],[[61664,65196],[-69,2]],[[60665,63869],[-30,-221],[189,-7],[1,-113],[188,0],[-1,-65]],[[61772,62976],[193,-52],[248,182],[138,-33]],[[62351,63073],[8,419],[200,-7],[13,954],[118,168],[-44,181],[62,100],[-75,279]],[[62633,65167],[-50,1]],[[62583,65168],[-594,19]],[[61774,63185],[-2,-209]],[[42348,52490],[574,71]],[[42922,52561],[1234,140]],[[44156,52701],[-36,982]],[[44120,53683],[-58,1526]],[[44062,55209],[-1157,-141],[-535,-85]],[[42370,54983],[-148,-19]],[[42222,54964],[70,-1468],[14,2],[42,-1008]],[[25452,29695],[114,2]],[[25566,29697],[95,-25],[70,78],[88,-56],[51,150],[143,-6],[205,-406],[142,-4]],[[26360,29428],[167,-19],[86,258],[107,47]],[[26720,29714],[100,24],[-16,143],[278,92],[-100,987]],[[26982,30960],[-132,1247]],[[26850,32207],[-1453,-421],[-238,-100]],[[25159,31686],[-388,-131]],[[24771,31555],[176,-1600],[348,116],[45,-367],[112,-9]],[[71474,70453],[266,-40],[-55,-817]],[[71685,69596],[-6,-84],[504,-76],[115,177],[68,-17]],[[72366,69596],[23,348],[78,199],[56,32],[1,192],[166,205]],[[72690,70572],[-71,23],[11,166]],[[72630,70761],[-560,101],[11,168],[-381,54]],[[71700,71084],[-186,34],[-14,-254]],[[71500,70864],[-26,-411]],[[78034,72315],[46,664]],[[78080,72979],[14,190],[-356,81]],[[77738,73250],[-89,-89],[-181,-23]],[[77468,73138],[15,-242]],[[54589,26373],[776,0],[16,336]],[[55381,26709],[5,1329]],[[54611,28036],[-2,-1328],[-20,-335]],[[85418,49597],[250,-1242],[-7,-213]],[[85661,48142],[114,-265]],[[85775,47877],[115,89],[-1,141],[74,66]],[[85963,48173],[-14,120],[-3,683]],[[85946,48976],[-63,68],[-79,318]],[[85804,49362],[-125,271],[-125,56],[-136,-92]],[[53953,43170],[671,4]],[[54624,43174],[96,2]],[[54720,43176],[-1,1006]],[[54719,44182],[-388,-1]],[[54331,44181],[-381,-3]],[[53950,44178],[3,-1008]],[[47536,60831],[-19,758]],[[47495,62513],[-975,-77]],[[51884,14722],[621,20]],[[52505,14742],[-15,1318],[35,2],[-3,325]],[[51670,41441],[14,-1342]],[[72421,25055],[-763,145]],[[71658,25200],[-74,-1142]],[[49504,45707],[37,2]],[[49541,45709],[-37,1677]],[[67637,46339],[-28,-613]],[[67609,45726],[781,-127]],[[68390,45599],[47,787]],[[81199,46208],[199,-521],[53,-381]],[[81451,45306],[114,13]],[[81565,45319],[67,-31],[77,159],[61,-58]],[[81770,45389],[227,598],[-54,551]],[[81807,47213],[-146,-121]],[[81661,47092],[-330,-264],[-109,-180],[31,-55],[-93,-284],[39,-101]],[[67402,62701],[351,-45]],[[67753,62656],[23,524],[127,-17],[18,392],[62,-8]],[[67983,63547],[29,616],[-32,4]],[[67980,64167],[-642,75]],[[67338,64242],[-35,-834],[95,-12],[26,-171],[-22,-524]],[[79070,74231],[62,-37],[70,-354],[-11,-175],[76,-113],[18,-150]],[[79285,73402],[-28,-411]],[[79257,72991],[29,-54],[210,-8],[49,-142]],[[79545,72787],[44,550],[392,-99]],[[79981,73238],[34,435],[61,-13],[25,337]],[[80101,73997],[-57,14],[31,401]],[[79095,74426],[-25,-195]],[[51413,48483],[4,-337]],[[51417,48146],[959,31]],[[52376,48177],[-12,1345]],[[52364,49522],[-956,-31]],[[51408,49491],[5,-1008]],[[64974,65182],[178,-21],[-16,-326],[193,-26]],[[65329,64809],[36,806],[113,124],[14,408]],[[65492,66147],[12,335],[-578,59]],[[64926,66541],[-24,-728],[94,-7],[-22,-624]],[[50088,19931],[-53,-4]],[[50455,48446],[958,37]],[[51408,49491],[-3,336]],[[51405,49827],[-963,-34]],[[50442,49793],[1,-676]],[[50443,49117],[12,-671]],[[69748,46196],[319,-36]],[[70067,46160],[635,-96]],[[70702,46064],[40,666]],[[70760,47067],[-379,65]],[[70381,47132],[-334,55]],[[70047,47187],[-244,24]],[[69803,47211],[-55,-1015]],[[60045,42713],[289,-20]],[[60334,42693],[564,-47]],[[60905,42814],[28,1024]],[[60933,43838],[-852,51]],[[60081,43889],[-14,1]],[[77972,38702],[791,-202]],[[78763,38500],[13,126]],[[78776,38626],[-32,17],[63,721],[-67,13]],[[78740,39377],[-796,158]],[[77848,39123],[-33,-379],[157,-42]],[[61092,61856],[2,338],[-73,356],[53,58],[-34,230],[-60,9]],[[60980,62847],[-160,153],[35,-129],[-164,154],[-588,13]],[[60103,63038],[-3,-123],[110,-41],[97,-199],[51,-12]],[[70675,39308],[-189,29]],[[70486,39337],[-582,91]],[[69904,39428],[-55,-997]],[[50182,37364],[755,31]],[[50937,37395],[-7,1003]],[[50172,38697],[-12,0]],[[44489,67471],[962,79]],[[67468,55815],[-29,-669]],[[67439,55146],[581,-59]],[[68020,55087],[31,739]],[[68051,55826],[38,959]],[[68089,56785],[-48,5]],[[68041,56790],[-533,66]],[[67508,56856],[-40,-1041]],[[72488,55230],[276,-434],[115,-98]],[[72879,54698],[224,-8],[34,51]],[[73137,54741],[23,153],[82,-5],[55,158],[81,-23],[-35,172],[125,257]],[[73468,55453],[-91,31],[-532,73]],[[72845,55557],[-332,34]],[[72513,55591],[38,-135],[-63,-226]],[[65671,47421],[91,-12],[-4,-111],[576,-68]],[[66373,48332],[-591,66]],[[65782,48398],[-24,-505],[-64,8],[-23,-480]],[[58510,64696],[95,-2],[12,-183],[161,-28],[129,-109]],[[58907,64374],[575,-18]],[[59482,64356],[-11,224],[9,1112]],[[59480,65692],[2,220]],[[59482,65912],[-130,1]],[[59352,65913],[-836,-1]],[[58516,65912],[-6,-1216]],[[72555,56369],[271,6]],[[72826,56375],[-3,481],[41,120],[89,50]],[[72953,57026],[-23,418]],[[72930,57444],[-91,163],[-174,-34],[-42,99],[-131,28]],[[72492,57700],[-186,-781]],[[68422,43655],[684,-114]],[[69106,43541],[57,1059]],[[69163,44600],[27,500]],[[69190,45100],[-268,42],[0,-41],[-463,92]],[[68459,45193],[-50,-785]],[[68409,44408],[-24,-409],[54,-8],[-17,-336]],[[83308,38269],[49,-348],[105,-987]],[[83462,36934],[745,-237]],[[84207,36697],[-63,335],[-54,29],[12,192],[-43,212],[-75,160],[16,527],[-76,195]],[[83924,38347],[-29,339]],[[83895,38686],[-377,111],[-96,-128],[-205,63]],[[83217,38732],[91,-463]],[[12292,15591],[26,-102]],[[12318,15489],[148,119],[32,219],[368,-234],[133,115],[145,33],[128,204],[302,124],[55,60],[52,239],[156,-29],[131,209],[358,184]],[[14326,16732],[-45,334],[-70,276],[-73,66],[-53,366]],[[14085,17774],[-62,396],[20,102]],[[14043,18272],[-786,-340],[-110,89],[-289,-184],[-83,-196],[-163,-176],[-159,-66],[-77,75],[-39,213],[-398,-196],[39,-86],[-9,-234]],[[11969,17171],[-70,-228],[58,-82],[32,-271],[42,-24],[28,-233],[-40,-221],[135,-61],[51,-161],[158,15],[-71,-314]],[[57104,25339],[13,670]],[[56926,27015],[-249,3]],[[56677,27018],[-137,-156]],[[56540,26862],[-196,-180],[-42,14],[-274,-309],[-92,-162],[-73,23],[-112,-141]],[[55751,26107],[-195,-205]],[[55556,25902],[-2,-529],[371,-7]],[[56042,19719],[656,-12]],[[56698,19707],[121,74]],[[56819,19781],[11,252],[22,1940]],[[56852,21973],[-773,18]],[[12637,14349],[136,-101],[-33,-112],[57,-68],[-26,-234],[65,19],[86,-200],[84,154],[78,28]],[[13084,13835],[107,-3],[56,86],[-77,306],[-74,133],[82,324],[142,226],[39,348],[192,299],[996,479]],[[14547,16033],[-62,192]],[[14485,16225],[-91,20],[-28,117],[68,108],[-88,90],[-20,172]],[[12318,15489],[119,-190],[-116,-139],[161,-313],[110,0],[34,-158],[-37,-124],[48,-216]],[[87165,38078],[159,-332],[64,-49]],[[88019,37001],[544,507]],[[88563,37508],[-95,137],[39,276],[-58,358],[45,313],[-75,457],[-96,184]],[[88323,39233],[-163,60]],[[88160,39293],[-10,4]],[[88150,39297],[-86,-182],[-125,-138],[-131,-311],[-160,-89],[-142,-349],[-219,31],[-122,-181]],[[61496,60503],[725,-24]],[[62221,60479],[85,-33],[10,685]],[[62316,61131],[4,303],[-96,81],[5,302],[-469,16]],[[61760,61833],[-255,14]],[[78329,72949],[567,-133]],[[78896,72816],[83,111],[101,-12],[117,101],[60,-25]],[[79285,73402],[-336,59],[7,102],[-168,29],[-7,-98],[-112,23],[-22,-289],[-241,50]],[[78406,73278],[-77,-329]],[[34406,91804],[72,-328],[154,-99],[97,106],[150,419],[187,-96],[128,-117],[199,69],[0,53],[205,214],[36,129],[236,119],[35,277],[-139,261],[-187,118],[-106,-31],[-230,175],[-158,30],[-137,-134],[-46,-638],[-88,-67],[-67,80],[-197,-162],[-99,-188],[-45,-190]],[[34402,93280],[264,-283],[71,101],[-14,227],[-114,-15],[-166,67],[-41,-97]],[[33645,91867],[153,-106],[194,64],[126,196],[58,207],[-60,170],[-149,95],[-123,17],[-91,-454],[-108,-189]],[[33746,90799],[152,96],[50,-31]],[[33948,90864],[105,14],[203,-59],[130,81],[-63,180],[-132,168],[-157,68],[-458,-206],[-330,60],[-122,-53],[114,-264],[-14,-189],[522,135]],[[61010,52244],[-9,-625]],[[61001,51619],[385,-7]],[[61386,51612],[287,1]],[[61673,51613],[24,1575]],[[61697,53188],[-386,19]],[[50146,87895],[-29,2115]],[[62391,36697],[-768,54]],[[61623,36751],[-24,-673],[-19,-1009]],[[45637,58983],[963,87]],[[60884,38160],[583,-44]],[[61501,39452],[-390,31]],[[77314,43204],[-2,-56],[188,-26],[-10,-171],[207,-28],[-9,-227],[197,-23]],[[77885,42673],[10,225],[201,-26],[7,109],[178,-23]],[[78281,42958],[15,349],[-193,22],[13,343]],[[78116,43672],[-384,49],[3,102],[-200,23],[2,56],[-193,21]],[[77344,43923],[-18,-386]],[[75372,71525],[72,-8],[109,-155],[209,-81],[59,-350],[52,-53]],[[75873,70878],[103,-83]],[[75976,70795],[-27,160],[67,1000]],[[76016,71955],[-487,107]],[[75529,72062],[44,-135],[-87,-117],[-134,-66],[20,-219]],[[34802,15937],[575,139]],[[36604,16322],[-7,201],[39,97],[-91,301],[64,13],[-29,381],[23,5]],[[36603,17320],[-29,381],[-224,-49],[-144,194],[-48,269],[-447,-98],[-138,77],[-29,389],[-577,-129]],[[74528,67625],[513,-91]],[[75234,68273],[-261,257],[-264,215]],[[74709,68745],[-181,-1120]],[[62203,12479],[213,-236],[70,17],[14,191],[90,93],[-28,88],[58,151],[180,-37],[86,-85],[42,101],[636,-124],[167,84],[93,257],[150,92],[73,-119],[105,-43],[75,57],[183,18],[135,-87],[-142,201],[-161,113],[-137,205],[-192,132],[-72,128],[-407,263],[-123,113],[-157,72],[-146,123],[-291,327],[-193,275],[-224,370]],[[62300,15219],[-45,-1604],[-11,-54],[-41,-1082]],[[55738,34310],[774,-6]],[[56512,34304],[3,331],[94,-1],[5,1017]],[[84571,52993],[599,-185]],[[85170,52808],[113,1164]],[[85283,53972],[-262,68]],[[84663,54140],[-92,-1147]],[[11860,79978],[-156,-190],[-32,-147],[-145,-222],[101,-35],[57,-159],[54,-421],[247,104],[311,-10],[225,-224],[99,-195],[58,-394],[60,-252],[230,-468],[124,-140],[155,74],[134,-81],[172,-212],[165,-284],[130,-88],[129,133],[238,-92],[95,-123],[169,-392],[73,-5],[239,172],[18,100],[-124,170],[9,164],[76,21],[36,-151],[89,-111],[39,-154],[107,159],[10,262],[103,77],[76,-154],[171,-50],[267,120],[-63,180],[15,104],[188,61],[-39,166],[196,58],[50,-112],[143,-13],[16,65],[234,-168],[186,129],[46,-33],[77,145],[36,-63],[150,172],[144,34],[71,-53],[278,-28],[134,149],[130,66],[89,-35],[179,-246],[166,-87],[551,444],[124,25],[172,1487]],[[72026,38708],[512,-109]],[[72559,38937],[69,1006],[-191,39]],[[72437,39982],[-317,62]],[[63221,52701],[7,-169],[81,-4]],[[64105,52475],[6,355],[198,-22]],[[64309,52808],[-16,176],[32,1083]],[[64325,54067],[5,173],[-325,37]],[[64005,54277],[-32,7],[-6,-396],[-41,0],[-21,-884],[-382,32],[-293,86]],[[46064,70957],[-622,-60],[-90,-28]],[[81344,51560],[81,-148],[315,-342]],[[81740,51070],[56,225],[119,160]],[[81843,51648],[102,382]],[[81945,52030],[-138,245]],[[81807,52275],[-72,163],[-95,90]],[[81640,52528],[-320,-492],[-50,-166]],[[81270,51870],[-46,-150],[120,-160]],[[57791,45116],[-2,-166]],[[58560,45607],[3,335]],[[58563,45942],[-767,18]],[[70874,67937],[141,-188],[-39,-82],[39,-142],[156,-79],[59,-120],[38,-456],[93,-68],[26,-116]],[[71387,66686],[122,-128],[229,-28],[221,252],[129,-19]],[[72088,66763],[64,-11],[56,413],[-39,146],[12,226],[68,47]],[[72249,67584],[-144,329],[-116,22],[-82,208],[-64,12],[-37,196],[-94,39],[5,111],[-95,13],[-69,222],[-98,140],[-82,12]],[[71373,68888],[-72,10]],[[71301,68898],[-6,-112],[-184,-89],[-77,-187],[-65,-19],[-51,-193],[-116,-74],[-40,-188],[85,11],[27,-110]],[[35766,96281],[15,-144],[179,-286],[82,-15],[69,-280],[121,-168],[14,-226],[-82,-164],[-69,-255],[-15,-226],[32,-191],[79,-62],[224,147],[30,102],[167,144],[112,154],[88,-20],[192,102],[418,337],[295,407],[100,216],[-17,427],[183,-8],[55,184],[-5,187],[171,268],[188,152],[-17,187],[-331,507],[-322,284],[-152,60],[-192,-19],[-135,221],[-119,81],[-76,138],[-110,55],[-110,214],[6,107],[-98,315],[-148,208],[-115,-197],[-170,-169],[-160,-85],[-85,-322],[70,-824],[-76,-539],[-64,-38],[-54,-455],[-183,-466],[15,-45]],[[21378,12167],[78,27],[124,-220],[142,35],[62,132],[123,31],[90,-53],[80,363],[159,334],[-2,323]],[[22234,13139],[-26,189],[-191,-78],[-110,71],[-130,971],[-92,-36],[-62,461]],[[21623,14717],[-186,-77]],[[21437,14640],[47,-461],[111,-807],[-96,-34],[25,-169],[-57,-79],[6,-286],[-190,-73],[95,-564]],[[73483,67548],[-28,90],[163,-1],[25,-118],[225,-31]],[[73868,67488],[76,1492]],[[73944,68980],[-593,114],[-61,69]],[[73290,69163],[-3,-55],[-306,56]],[[72981,69164],[-18,-350],[97,-13],[-19,-390],[255,-38],[-14,-336],[94,-73],[10,-398],[97,-18]],[[53920,34315],[1046,4]],[[54966,34319],[193,-3]],[[55278,35662],[-1128,-15]],[[54150,35647],[55,-56],[-54,-180]],[[54151,35411],[-100,-289],[4,-188],[58,-177],[-25,-145],[-81,-26]],[[54007,34586],[-74,-115],[-13,-156]],[[54743,38376],[828,-1]],[[56141,38372],[5,1333]],[[55764,39707],[-829,4]],[[54935,39711],[62,-78],[-132,-40]],[[54865,39593],[19,-181],[-30,-182],[66,26],[20,-131],[-115,-83],[17,-220]],[[54842,38822],[24,-249],[-137,-64],[14,-133]],[[26213,25862],[160,-8],[10,333],[60,30],[-55,490],[434,140],[-34,311],[565,177]],[[27353,27335],[-70,657]],[[27283,27992],[-376,-118],[-107,994],[-24,328],[93,29],[-35,329],[-93,-29],[-21,189]],[[26360,29428],[74,-680],[95,30],[142,-1325],[-479,-153]],[[25141,26955],[-7,-229],[30,-260],[-219,-100],[41,-241],[-15,-151],[82,-138],[-118,-249],[26,-99],[-138,-170],[63,-254],[-30,-109],[58,-184],[-43,-315],[-82,62],[-148,-51],[21,-89],[-204,-236]],[[24458,24142],[13,-214],[51,-76]],[[97299,17401],[37,-249],[-19,-265],[74,19],[-9,490],[-83,5]],[[96253,16160],[79,-71],[15,-217],[66,-17],[47,118],[88,-73]],[[96548,15900],[89,-75],[86,299],[490,-477],[45,51]],[[97379,16271],[-1,251],[-57,165],[-81,-73],[-98,173],[121,218],[10,161],[-57,107],[-9,186]],[[97207,17459],[-147,47],[-293,-290],[-84,267],[-109,-25]],[[96574,17458],[-158,17]],[[96416,17475],[19,-491],[80,-12],[-18,-340],[-72,9],[-19,-346],[-107,26],[-46,-161]],[[95022,26344],[30,-96]],[[95052,26248],[-3,-105]],[[95049,26143],[16,-180],[94,17],[31,-357]],[[95190,25623],[104,-44]],[[95294,25579],[-26,158],[93,186],[-84,49],[44,115]],[[95321,26087],[-73,72],[-98,346],[-128,-161]],[[91862,25913],[148,-55]],[[92010,25858],[753,-273]],[[92763,25585],[281,-101]],[[93044,25484],[43,168],[74,14],[29,174],[-54,83],[34,253],[50,57],[-55,159],[38,523]],[[93203,26915],[-53,59],[-85,-306],[-166,125],[-24,-94],[-326,252],[-20,-179],[-287,-1],[-40,-209],[-165,10]],[[92037,26572],[-26,-421],[-69,-3],[57,-147],[-118,56],[-19,-144]],[[74079,27027],[4,515],[-32,109],[94,281],[99,86],[47,-122],[37,117],[173,116]],[[74501,28129],[36,467]],[[54019,26703],[1,-336]],[[54020,26367],[569,6]],[[54014,28033],[5,-1330]],[[63553,68641],[175,-142],[-13,-119],[-172,-186],[122,-124],[129,177],[108,-67],[-67,-161],[-90,51],[-52,-78],[-1,-182],[282,-66],[-103,-100],[-58,-202],[103,-236],[-128,-99],[-19,-80],[123,-119],[39,139],[69,-59],[-53,-146],[181,-58],[27,-206],[-159,-126]],[[63996,66452],[-2,-4]],[[63994,66448],[544,-46],[21,504]],[[64559,66906],[43,1428],[-193,19],[11,334]],[[64420,68687],[-836,75]],[[63584,68762],[-31,-121]],[[73754,22109],[769,-192]],[[74523,21917],[131,272],[105,383],[-214,-132],[-74,166],[43,82],[-4,216],[93,169],[122,59],[5,84]],[[74730,23216],[-889,207]],[[63336,18545],[380,-342],[205,-132],[200,-370]],[[64121,17701],[39,-3],[24,656],[192,-20],[11,330],[578,-69],[27,658],[578,-68]],[[65570,19185],[38,894]],[[65608,20079],[-162,-137],[-1320,-463]],[[64126,19479],[-300,-109],[-86,-384],[-109,-256],[-135,-31],[-25,-119],[-92,89],[-43,-124]],[[94026,13355],[215,-367],[-86,-199],[78,-262],[102,-201],[-3,-209],[-127,-19],[30,-139],[-64,-64],[37,-148],[-54,-24],[60,-356],[-109,-124],[22,-308],[44,-151],[-22,-115],[72,-143],[47,-222],[55,-55],[-45,-599]],[[94726,9431],[112,659],[-19,9],[259,1529],[64,-58],[128,416],[-47,71],[-43,-117],[32,475],[-88,13],[42,285],[79,16],[86,161],[-7,246],[-58,124],[459,1537],[106,303],[151,-130],[6,-117],[207,-180]],[[96195,14673],[276,915],[77,312]],[[96253,16160],[-34,-92],[-208,177],[16,109],[105,150],[-12,182],[-279,12],[-7,127],[-119,-119],[-111,96]],[[95604,16802],[-88,-237],[-53,40],[-170,-663],[-139,122],[-88,-320],[60,-51],[-184,-632],[-193,166],[-61,-189],[-148,152],[-370,-1285],[18,-16],[-162,-534]],[[63906,73810],[189,-113],[54,81],[42,-153],[-18,-167],[80,16],[72,-151],[-178,-75],[-20,-199],[50,-71],[-55,-109],[-65,72],[-168,-176],[23,-165],[196,148],[-26,-129],[-124,-105],[9,-62]],[[63967,72452],[47,-57]],[[64014,72395],[149,-10],[21,631],[19,-130],[168,-9],[-14,-508],[248,11],[9,-204]],[[64614,72176],[124,100],[7,168],[125,-12],[69,141]],[[64939,72573],[-91,119],[39,126],[-85,281],[19,133],[-126,-40],[3,183],[-51,314]],[[64647,73689],[-109,204],[31,77],[-198,170],[-49,-62],[-13,198],[-88,-87],[-128,-23]],[[64093,74166],[-1,-24]],[[64092,74142],[42,-144],[-86,-75],[1,209]],[[64049,74132],[-207,-14],[-10,-247],[74,-61]],[[86372,24361],[287,-56],[-23,-144],[402,-77]],[[87038,24084],[133,809]],[[87171,24893],[-99,-15],[-39,637],[41,8],[43,627]],[[87117,26150],[-186,-41]],[[86931,26109],[-288,-130],[-85,-81],[39,200],[-42,63],[-70,-103],[-18,150],[-54,-96],[-273,109]],[[86140,26221],[-16,-108],[-197,65],[-93,-600]],[[85834,25578],[279,-507],[184,-26],[89,-96],[30,-191],[-44,-397]],[[55381,26709],[372,-2],[-2,-600]],[[56540,26862],[5,827],[-385,9],[0,333]],[[74812,36259],[-62,-889]],[[74750,35370],[191,-56]],[[74941,35314],[505,-149]],[[75446,35165],[21,96],[121,51],[76,-76],[173,183],[115,55]],[[75952,35474],[-410,111]],[[75542,35585],[-252,64],[-57,193],[-137,193],[-5,142],[-101,191],[-158,170]],[[74832,36538],[-20,-279]],[[62435,38378],[-16,-675]],[[63192,37640],[192,-15],[14,553]],[[63398,38178],[-100,0],[-135,143],[-76,-42],[-118,100],[-31,301]],[[62938,38680],[-495,33],[-8,-335]],[[50824,65302],[-6,837]],[[50818,66139],[-7,570]],[[50811,66709],[-57,104],[-239,-88],[-116,-91],[-113,278]],[[50286,66912],[-117,76],[-162,-340],[-60,-35]],[[49947,66613],[12,-680],[-96,-3],[5,-279]],[[55767,40703],[-718,4]],[[55049,40707],[-45,-147],[20,-125],[-69,-142],[-17,-170]],[[54938,40123],[28,-135],[-31,-277]],[[92070,33032],[87,187],[145,611],[54,326]],[[92356,34156],[-207,195],[-317,100]],[[91832,34451],[-47,-127],[55,-129],[-44,-254],[31,-133],[-136,-134]],[[91691,33674],[54,-299],[98,-15],[18,-144],[209,-184]],[[41552,16833],[164,26],[210,-300],[116,-343],[11,-527],[-87,-426],[-90,-131],[53,-126]],[[41929,15006],[438,68],[9,-165],[131,21]],[[42507,14930],[-13,253]],[[42494,15183],[-130,2611]],[[42364,17794],[-475,-70],[6,-110],[-94,-70],[-289,-44]],[[41512,17500],[40,-667]],[[65492,57537],[373,-32],[29,-163],[102,91],[116,-52],[125,183],[4,89]],[[66241,57653],[-118,0],[3,121],[142,133],[-88,130],[-194,-29],[-16,64],[143,182]],[[66113,58254],[72,216],[-147,190],[-35,319],[-47,7]],[[65956,58986],[-404,51]],[[65552,59037],[-60,-1500]],[[61797,44120],[687,-42]],[[62484,44078],[28,115],[-42,146],[35,152],[91,95],[27,201]],[[62623,44787],[-1,114],[109,162]],[[62731,45063],[-696,50],[3,111]],[[62038,45224],[-224,14]],[[30575,67536],[738,169],[359,114],[828,183]],[[32500,68002],[250,58],[16,517],[-56,240],[39,158],[99,73],[-25,370],[80,370],[-75,500],[232,142]],[[31716,73011],[-576,-127],[64,-823],[-25,-5],[131,-1664],[-204,-46],[26,-332],[-383,-87],[50,-663],[-356,-86]],[[30443,69178],[132,-1642]],[[85750,42446],[64,-638],[38,-138]],[[85922,41636],[113,46],[81,-41],[73,148],[145,116]],[[86334,41905],[-61,171],[2,240],[116,137],[235,-7]],[[86626,42446],[-259,915]],[[86367,43361],[-44,-139],[-199,-154]],[[86124,43068],[-549,-98]],[[85575,42970],[139,-310],[36,-214]],[[43801,23459],[108,-1979],[35,-809]],[[43944,20671],[1462,173]],[[45406,20844],[-66,1800]],[[45340,22644],[-61,1657]],[[45279,24301],[-1507,-181]],[[49605,83544],[461,-715]],[[50297,82454],[507,745],[56,370]],[[50860,83569],[-179,257],[-434,323]],[[50247,84149],[-66,-99],[6,-132],[-75,-81],[63,-225],[-123,-53],[-23,105],[-237,-171],[-63,72],[-124,-21]],[[47839,92911],[170,-197],[70,179],[757,57]],[[48803,94787],[-122,414],[-326,374]],[[48355,95575],[-56,-325],[-12,-260],[-61,-84],[-50,-373],[-118,-146],[17,-102],[-113,-111],[7,-150],[-73,-169],[-62,-26],[40,-256],[-17,-229],[30,-94],[-48,-339]],[[52600,90628],[121,-113],[276,-692],[109,-40]],[[53106,89783],[-55,303]],[[53051,90086],[-303,572],[-82,272]],[[52666,90930],[-66,-302]],[[53176,89100],[-17,177]],[[53159,89277],[-22,211]],[[53137,89488],[-249,352],[-182,-97],[0,-138]],[[52706,89605],[-146,-162],[-43,-173],[659,-170]],[[52332,90009],[154,78],[222,-206],[-2,268],[-219,526]],[[52487,90675],[-245,-665]],[[52242,90010],[90,-1]],[[58365,81705],[417,-19]],[[58782,81686],[377,-21]],[[59159,81665],[-27,133],[66,260],[-82,204],[20,143]],[[59136,82405],[-120,237],[-124,486]],[[58892,83128],[24,-303],[-41,-127],[-335,-181],[0,-125],[-121,-84],[25,-167],[-72,-125]],[[58372,82016],[46,-171],[-53,-140]],[[40931,74112],[493,63],[14,-331]],[[41937,73911],[-70,1662]],[[41867,75573],[-999,-126]],[[40868,75447],[63,-1335]],[[84637,49049],[72,-63]],[[84709,48986],[248,301],[214,160]],[[85171,49447],[21,202],[-111,412]],[[85081,50061],[-81,138],[-77,-11],[-72,116]],[[84851,50304],[-81,-113],[-101,12],[-24,-116],[-226,-527]],[[84419,49560],[218,-511]],[[18487,8616],[58,-366],[152,-108],[104,-241],[507,207],[47,-319],[234,-231],[133,1],[86,-360],[166,-212],[47,-320],[103,-15],[95,-191],[178,75]],[[20397,6536],[3,74]],[[20400,6610],[-371,2509]],[[19168,10807],[-32,220],[-124,-58]],[[19012,10969],[-61,-216],[-203,226],[-392,-95]],[[18356,10884],[-82,-223],[-5,-243]],[[80518,43395],[83,-214],[143,-242],[22,-144],[152,-121]],[[81051,42720],[47,257],[-96,316],[116,168],[45,140],[-104,141]],[[81059,43742],[-93,128],[-57,214],[-48,-7]],[[80713,44064],[-230,-576],[35,-93]],[[82007,44333],[311,-193],[18,-394],[48,-183]],[[83234,43902],[16,23]],[[83250,43925],[-28,152],[-140,7],[31,113],[-103,120],[-35,146],[73,216],[-62,267],[-92,235]],[[81770,45389],[55,-208],[188,-62],[12,-374],[-40,-209],[22,-203]],[[55617,30703],[108,0]],[[55725,30703],[3,941]],[[54960,31640],[1,-931]],[[76483,51375],[104,322],[1,323]],[[76588,52020],[7,182],[52,100]],[[76647,52302],[-74,-18],[-175,-312],[-39,89],[-189,-3]],[[76170,52058],[-142,-355],[-68,-99],[-14,-154]],[[85763,52617],[232,-79]],[[85995,52538],[181,874],[-36,169]],[[85845,54033],[-24,-23],[-117,-1030],[-1,-234],[60,-129]],[[27811,62736],[-91,1002],[1363,355],[-139,1612]],[[28944,65705],[-30,337],[-109,59],[-160,-39],[-138,73],[-237,-19],[-61,95],[-82,-21],[-81,115],[-34,257],[58,410],[-77,-24]],[[27993,66948],[-105,5],[-181,156],[-68,-53],[-197,232],[-21,160],[-114,135],[-208,-1089],[-19,-364],[-75,-504]],[[27005,65626],[-132,-861],[-118,140],[-34,112],[-65,-97],[-103,-285],[-2,-119],[-77,-144],[53,-273],[-51,-252],[26,-128],[-83,-25],[40,-306],[-90,-20]],[[26369,63368],[81,-261],[-30,-248],[35,-57],[-425,-121],[43,-105],[13,-227],[78,-154],[48,-380],[209,-148],[12,-123]],[[60201,59027],[97,-2]],[[60298,59025],[96,-4],[4,169],[761,-18]],[[61159,59172],[2,335]],[[61161,59507],[12,722]],[[60218,60533],[-3,-1339],[-14,-167]],[[63150,63463],[134,-10],[-5,-280],[99,-82],[159,-7]],[[63537,63084],[6,349],[65,-5],[35,169]],[[63643,63597],[11,510],[96,-6],[6,341]],[[63756,64442],[16,673],[99,-3],[12,512],[-99,8]],[[63784,65632],[-68,-22],[-161,-397],[-240,-302],[14,-108],[-157,6]],[[63172,64809],[-2,-113],[-131,-52],[-5,-225],[132,-5],[-10,-610],[43,-193],[-49,-148]],[[74167,78222],[22,-342],[133,-21],[41,160],[223,-32],[16,-337]],[[74602,77650],[224,-38],[10,166],[96,-17],[49,831]],[[76798,66781],[172,-523],[4,-363]],[[76974,65895],[471,468]],[[77463,66633],[25,146],[-112,49],[-149,203],[1,169],[-52,109]],[[77043,67044],[-52,-134],[-161,-28],[-32,-101]],[[81444,83370],[693,-173]],[[82137,83197],[128,1468],[67,854]],[[82332,85519],[12,137],[-127,-25],[-66,59]],[[82099,85065],[-13,-163],[-84,6],[-93,-131],[-147,4],[-148,-280],[19,-49]],[[81633,84452],[11,-196],[102,-184],[-7,-241],[-200,-241],[-95,-220]],[[72431,44644],[563,-110]],[[73043,45243],[-226,326]],[[72412,45897],[-50,-842]],[[61113,32763],[-16,-675]],[[61097,32088],[772,-54]],[[61869,32034],[43,1682]],[[59118,36900],[192,-8]],[[75398,51548],[38,-143],[140,-64]],[[75576,51341],[213,-105],[115,125]],[[76170,52058],[-249,437]],[[75921,52495],[-109,12],[-250,-204]],[[75562,52303],[5,-149],[-78,-91],[8,-127],[-96,-246],[-3,-142]],[[63262,72438],[88,-113],[-12,-321],[93,-252],[-2,-406],[34,-10],[15,-279],[52,-62],[22,-210]],[[63552,70785],[184,-12]],[[63736,70773],[-81,291],[120,99],[35,-100],[-14,-201],[91,5],[40,333],[-131,181],[-30,127],[14,265],[192,51],[-41,137],[-128,205],[70,208],[126,-96],[40,-155],[46,88],[-71,184]],[[63967,72452],[-117,106],[-606,51]],[[63244,72609],[18,-171]],[[61905,81887],[159,7],[146,93],[76,-52],[48,205],[199,127]],[[62533,82267],[-51,205],[56,574]],[[62538,83046],[-9,129],[-261,250],[-42,-104],[-122,62],[65,199],[128,18],[-62,103],[60,201],[141,-78],[-57,110],[47,62],[-226,36],[-178,173],[-138,40],[-576,-173]],[[61308,84074],[-8,-718],[-24,-1010],[-238,18]],[[61038,82364],[215,-224]],[[61212,80627],[85,-310],[-30,-61],[-25,-1196]],[[61242,79060],[169,-9],[50,-220],[187,-197],[98,136],[95,-13]],[[61841,78757],[3,112],[138,325]],[[61982,79194],[7,213],[77,91],[8,361],[-69,237],[4,172],[-97,7],[1,112],[-293,20],[-82,46],[-62,186]],[[61209,80653],[3,-26]],[[57101,44004],[656,-2]],[[57116,45130],[-3,-279]],[[57113,44851],[-12,-847]],[[63449,49395],[121,14],[203,-226],[66,-179]],[[63839,49004],[15,666]],[[63854,49670],[4,197],[-48,822]],[[63262,50739],[-472,41],[0,-22]],[[62790,50758],[-57,-1888]],[[53956,42165],[668,2]],[[54624,42167],[0,1007]],[[53953,43170],[3,-1005]],[[50190,36023],[758,34]],[[50947,36726],[-10,669]],[[33107,67063],[2277,461],[188,19]],[[35572,67543],[-20,342],[48,9]],[[35600,67894],[-73,1294]],[[35527,69188],[-1072,685],[-10,166],[-764,-156],[-47,666]],[[32500,68002],[79,-1057],[528,118]],[[87403,56692],[190,-95],[48,101],[145,-153],[178,-268]],[[87964,56277],[122,262],[66,17]],[[88152,56556],[-86,177],[58,136],[-70,155]],[[88054,57024],[-101,-21],[65,254],[-122,439],[-204,317]],[[87692,58013],[-33,-45],[-43,-324],[-51,-129],[-130,-84]],[[87435,57431],[-53,-634],[21,-105]],[[80415,57929],[83,51],[198,-62]],[[80696,57918],[195,512]],[[80891,58430],[124,227],[84,66],[24,201],[62,50],[23,372]],[[81208,59346],[-70,13]],[[81138,59359],[-724,129]],[[80414,59488],[1,-165],[56,-539],[-56,-855]],[[41358,37844],[1119,150]],[[42477,37994],[-58,1333],[-19,174]],[[42400,39501],[-319,-41]],[[42081,39460],[-800,-112]],[[41281,39348],[77,-1504]],[[55163,58992],[255,0],[92,127],[-6,209],[235,-2]],[[55739,59326],[415,-3]],[[56056,60333],[-174,-34],[-104,90],[-103,-17],[-153,64],[-49,87],[-86,-85],[-23,-266],[-208,2]],[[55156,60174],[-96,3]],[[55060,60177],[1,-175],[103,1],[-1,-1011]],[[51718,61978],[956,26]],[[52674,62004],[-13,1729]],[[52661,63733],[-360,-146],[-20,-435],[-86,-39],[-8,-200],[-240,-300],[-44,-129],[14,-167],[-201,-186]],[[51716,62131],[2,-153]],[[52267,65349],[380,9],[-99,-450],[105,-53],[383,8]],[[53036,64863],[-1,168],[192,3],[-2,336]],[[53225,65370],[-97,-1],[-4,667],[-96,-1]],[[81253,37794],[756,-203]],[[82009,37591],[1,0]],[[82010,37591],[-24,248],[-65,78],[14,165],[115,61],[31,349],[-80,185],[-13,627],[-93,169]],[[81895,39473],[-156,-28],[62,-160],[-478,-175],[-350,-467]],[[80456,61761],[25,-339],[21,-618],[103,-321]],[[80605,60483],[429,68],[54,92]],[[81088,60643],[-32,77]],[[81242,61644],[26,296]],[[81268,61940],[-110,46],[-86,198],[-33,-116],[-183,-173]],[[80856,61895],[-400,-134]],[[47547,26399],[1350,97]],[[48448,27819],[78,-174],[-47,-97],[-98,-15],[-157,-165],[-232,-83],[-209,-131],[-25,-326],[-138,-90],[-99,53],[-68,-72],[94,-320]],[[75387,53794],[127,-82],[76,65],[95,-141],[60,43]],[[75745,53679],[75,380],[159,173],[65,272],[154,122]],[[76198,54626],[-126,190],[61,211]],[[76133,55027],[-101,15]],[[76032,55042],[-423,81]],[[75609,55123],[-165,-294],[-49,-308],[-74,-188],[60,-97],[-22,-221],[28,-221]],[[78313,59573],[151,-138],[123,-437]],[[78587,58998],[263,401],[94,518],[37,73]],[[78664,60361],[-40,-58],[-196,161]],[[78428,60464],[-191,156]],[[78237,60620],[-94,-80],[108,-329],[-34,-115],[90,-260],[6,-263]],[[88152,56556],[77,18],[77,-226],[71,83],[98,-295]],[[88475,56136],[460,303],[133,139]],[[89068,56578],[-94,253],[-24,180],[117,105],[-17,280]],[[89050,57396],[-50,-34],[35,207],[171,127],[249,59],[121,-210]],[[89576,57545],[67,76],[-40,284],[-106,127],[-222,83],[-111,180],[-222,68]],[[88942,58363],[44,-113],[-107,58],[-73,-708],[-43,-203],[-112,107],[-24,-94],[-282,-174],[-291,-212]],[[47305,71067],[702,60]],[[78260,53240],[104,-169],[-13,210],[-91,-41]],[[78175,45047],[-30,-686],[65,-9]],[[78210,44352],[878,-132]],[[79088,44220],[44,321]],[[79132,44541],[-104,74],[105,272],[-16,167],[46,147],[-95,-61],[-57,233],[-81,66]],[[78930,45439],[-39,-79],[33,-150],[-72,-177],[-71,0],[-69,-128],[-133,312]],[[78579,45217],[-9,-171],[-392,57],[-3,-56]],[[77803,45853],[206,-51],[-27,-736]],[[77982,45066],[193,-19]],[[78579,45217],[-55,249],[16,220],[-109,202],[88,330],[47,325],[-72,125]],[[78494,46668],[-113,64]],[[78381,46732],[-129,22],[-17,-350],[-204,25],[-48,-339],[-171,16],[-9,-253]],[[80955,47930],[301,12],[405,-850]],[[82555,47633],[-47,291],[-77,181]],[[82431,48105],[-226,623],[-47,224],[19,97],[-62,166]],[[82115,49215],[-155,41],[-25,-88],[-84,153],[-385,-79]],[[81466,49242],[-20,-117],[-170,-237],[-107,-100]],[[81169,48788],[101,-13],[-137,-291],[57,-157],[-117,-149],[38,-133],[-113,49],[-43,-164]],[[63658,60348],[777,-58],[187,-29],[385,-10]],[[65007,60251],[35,1006]],[[65042,61257],[-389,27]],[[63685,61364],[-27,-1016]],[[10532,43710],[1,2]],[[10533,43712],[555,-566],[307,-108],[108,11],[114,141],[189,-1269]],[[11806,41921],[318,1126]],[[12459,43989],[0,1]],[[12459,43990],[-1147,412],[3,215],[-572,581]],[[10743,45198],[-64,-225],[-91,28],[-33,-87],[-88,102],[-31,-553],[107,-63],[36,-297],[-72,-58],[25,-335]],[[9582,35629],[994,476],[17,-108],[210,105],[-20,109],[197,95]],[[10980,36306],[-78,283]],[[10902,36589],[-105,204],[-32,227],[28,444],[67,39],[-2,328],[-66,225]],[[10792,38056],[-837,-402]],[[9955,37654],[-90,-198],[28,-217],[-109,-189],[27,-256],[72,-177],[-41,-161],[-99,-29],[-155,-215],[-110,-347],[104,-236]],[[76252,65222],[43,141],[204,212],[171,257],[102,73]],[[76772,65905],[-53,113],[-77,451],[-134,-93]],[[76508,66376],[-108,83],[-70,-50]],[[76330,66409],[-127,25]],[[76203,66434],[-81,-1198],[130,-14]],[[76800,62135],[45,-41],[-5,-189],[77,-71]],[[76917,61834],[176,-69]],[[77093,61765],[107,121],[18,117],[-50,293],[117,389],[-78,209]],[[77207,62894],[-321,64]],[[76886,62958],[-51,-164],[-54,-471],[19,-188]],[[74004,64399],[137,-25],[74,-338],[264,-310],[93,-604]],[[74572,63122],[70,-13]],[[74642,63109],[22,169],[-48,12],[32,447],[-23,85],[182,10]],[[74809,64979],[-385,59],[4,83],[-299,51]],[[74129,65172],[-125,-773]],[[24010,26575],[781,267]],[[24639,28152],[-36,-12],[-87,761]],[[24516,28901],[-197,-162],[-110,-2],[-33,-368],[-116,-86],[16,-176],[76,-154],[-69,-242],[-124,-31]],[[23959,27680],[-78,-38],[129,-1067]],[[65108,35122],[479,-67]],[[66385,36154],[-690,99],[-2,-56],[-443,56]],[[65250,36253],[-4,-109],[-93,9]],[[65153,36153],[-45,-1031]],[[40788,13162],[17,-293],[59,10],[43,-749]],[[40907,12130],[36,-52],[173,44],[15,94],[100,-164],[53,34],[110,-192],[82,129],[95,-13],[113,105],[147,7],[64,-62],[125,45],[20,97],[284,286],[172,-68],[43,218],[81,27]],[[42620,12665],[-21,506],[-92,1759]],[[41929,15006],[-141,-22],[35,-661],[-122,-19],[18,-328],[-582,-92],[19,-329],[-387,-65],[19,-328]],[[87257,53659],[135,102],[166,21],[45,209],[95,-27],[142,81]],[[87840,54045],[150,342],[23,330]],[[88013,54717],[-76,-29],[-130,170],[-61,177],[-225,415]],[[87521,55450],[-117,-172],[-101,-356],[-153,-104]],[[87150,54818],[41,-573],[66,-438],[0,-148]],[[43777,57083],[232,24]],[[44009,57107],[725,81]],[[43711,58797],[66,-1714]],[[74056,68956],[666,-130]],[[74722,68826],[147,892]],[[74869,69718],[67,93],[-19,125],[95,129],[-9,85]],[[75003,70150],[-286,82],[-12,58],[-556,114]],[[74149,70404],[-93,-1448]],[[14009,39495],[410,1055]],[[14419,40550],[-75,156],[-42,227],[70,447],[-81,319],[-110,19],[9,114],[-75,125]],[[13534,41278],[-80,-90],[35,-235]],[[10443,25535],[294,151],[1200,573]],[[11937,26259],[1331,677]],[[13268,26936],[-43,169],[-103,644],[13,6],[-350,2205]],[[9635,28436],[-38,-248],[28,-37],[25,-456],[-33,-83],[-256,-128]],[[9361,27484],[124,-234],[-5,-325],[-63,-260],[166,-451],[0,-398],[135,-184],[138,3],[132,-318]],[[31901,51207],[265,-511],[1314,286],[333,56]],[[33813,51038],[-89,129],[-94,593],[-104,83],[-22,117],[-168,80],[-44,211],[-164,279],[-19,276],[-99,330],[-95,195]],[[32915,53331],[-1167,-267]],[[75005,61483],[62,-14]],[[75067,61469],[278,-59]],[[75386,61918],[74,102],[-109,396],[44,557]],[[75395,62973],[-122,-129],[-153,87],[-194,11],[-14,-69]],[[74912,62873],[-40,-154],[74,-24],[-90,-93],[124,-27],[-24,-409],[63,-257],[-54,-149],[40,-277]],[[26982,30960],[559,166],[35,-331],[252,77],[33,-330],[126,38]],[[27987,30580],[57,17],[46,229],[76,-1],[-20,256],[-78,222],[81,45],[39,-114],[111,32],[35,231],[44,49]],[[28378,31546],[72,204],[-25,261],[-63,-20],[-66,654]],[[28296,32645],[-90,-23]],[[28206,32622],[-44,-31],[-1312,-384]],[[68654,50011],[323,-42],[4,103],[194,-25],[6,125]],[[69181,50172],[-6,170],[38,875]],[[69213,51217],[-222,114],[-118,-182],[-55,110]],[[68818,51259],[-13,122],[66,235],[-59,134],[-150,-72]],[[68662,51678],[-129,-337]],[[68533,51341],[136,-34],[-95,-83],[81,-233],[-62,-228],[124,-130],[2,-128],[-71,72],[56,-194],[67,-46],[-117,-326]],[[71761,51981],[168,-827]],[[71929,51154],[246,-120],[41,-230],[-69,-468]],[[72147,50336],[90,-49]],[[72237,50287],[15,34]],[[72252,50321],[55,17],[16,188],[87,-27],[45,248],[190,227]],[[72645,50974],[26,141],[93,146]],[[72764,51261],[-77,316],[-108,141],[-20,155],[-89,173],[-5,404]],[[72465,52450],[-273,12]],[[72192,52462],[-22,-175],[-122,-255],[-105,67],[-182,-118]],[[59136,82405],[1148,-58],[1,54],[255,-14]],[[60540,82387],[498,-23]],[[61308,84074],[-243,-123],[-406,-308],[-165,-97],[-285,-116],[-230,-6],[-98,53],[-250,-14],[-515,148],[-184,182]],[[58932,83793],[-170,-484],[130,-181]],[[56366,49038],[771,-14]],[[57137,49024],[3,1005]],[[57140,50029],[2,343]],[[57142,50372],[-785,12]],[[24496,23799],[-124,-7],[-89,-201],[-24,-426],[-234,524],[-130,-3],[-250,81],[-95,314],[-69,-46],[-83,245],[-143,195],[-169,44],[-146,133],[-157,-58]],[[22783,24594],[-10,18],[-370,-1005]],[[29682,26692],[358,120]],[[30040,26812],[248,69],[29,312],[103,17],[141,216]],[[30561,27426],[-65,703]],[[30496,28129],[-104,1125]],[[30392,29254],[-875,-246]],[[29517,29008],[99,-992],[-374,-108],[31,-318],[-353,-104],[17,-165],[-90,-84],[-663,-197],[79,-762]],[[95307,26961],[211,-345],[-59,-495],[-61,44]],[[95398,26165],[98,-142],[118,117]],[[95614,26140],[-30,119],[64,125],[44,-224]],[[95692,26160],[118,120],[36,139],[165,243],[2,304],[-68,51],[107,137],[193,33],[86,243],[9,187]],[[96340,27617],[-123,249],[10,173]],[[96227,28039],[-132,-8],[29,189],[-63,-8],[15,204],[-78,-23],[-38,129]],[[95960,28522],[-147,-457],[-75,-90],[-159,123],[-39,-132],[75,-211],[-82,-237],[-99,-88],[-127,-469]],[[62849,78479],[120,-7],[58,87]],[[63027,78559],[-6,92]],[[63021,78651],[38,156],[-24,278],[74,58],[127,-42],[-17,-131],[-101,-124],[125,-4],[67,243],[-35,234],[-102,165],[82,68],[196,-36],[142,-91],[95,368]],[[63688,79793],[42,30],[-160,324],[-27,223],[-133,66]],[[63410,80436],[-188,71],[-1,-56],[-225,16]],[[62996,80467],[-107,7]],[[62889,80474],[45,-50],[-53,-197],[30,-543],[-74,-309],[-77,-92],[-18,-141]],[[62742,79142],[19,-61],[-14,-417],[102,-185]],[[66994,20565],[-61,-1235]],[[66933,19330],[774,-114],[49,991]],[[67111,21089],[-128,-129],[86,-188],[-75,-207]],[[58111,54356],[0,226],[55,1]],[[58166,54583],[-1,934]],[[57178,55513],[-9,-1087]],[[44971,53775],[54,6]],[[45791,53856],[38,4]],[[45829,53860],[-45,1502]],[[45784,55362],[-863,-72]],[[44921,55290],[50,-1515]],[[63502,34098],[354,-30]],[[63856,34068],[816,-80]],[[64672,33988],[57,1185]],[[64729,35173],[-653,80]],[[64076,35253],[-125,-109],[-72,-196],[19,-173],[-103,-217]],[[63795,34558],[-126,-109],[-40,-106],[-128,-104],[1,-141]],[[64072,41297],[-9,-334]],[[64831,40892],[8,333],[194,-16],[18,428]],[[64974,41944],[-93,177],[-89,78],[-43,321],[-74,231],[-129,212]],[[64546,42963],[-426,25],[-9,-337]],[[83673,26525],[391,-19],[189,163],[209,106],[233,-248]],[[84808,27441],[-181,62],[44,343],[-157,49]],[[84514,27895],[-243,76],[-16,-163],[-285,97]],[[83970,27905],[-12,-189],[-76,15],[32,-378],[-145,50]],[[61051,12520],[125,4],[-11,109],[134,269],[120,-52],[-5,245],[116,-102],[91,67],[86,-86],[180,-71],[162,-261],[154,-163]],[[62300,15219],[-212,394],[-25,102],[-243,528],[-174,323],[-143,148],[-134,298],[-57,39],[-131,260]],[[14409,21015],[1487,701],[747,333]],[[16643,22049],[-242,1607],[-56,-24],[-145,976],[-19,-9],[-96,636],[916,387],[-332,2284],[-73,536]],[[16596,28442],[-685,-310],[-336,-135]],[[15575,27997],[-459,-198],[-946,-431]],[[14170,27368],[431,-2791],[-733,-349],[364,-2261],[25,12],[152,-964]],[[95368,28609],[111,14],[113,592]],[[95592,29215],[-93,200],[-84,-312],[-51,-295],[-35,41],[85,503],[-94,39],[2,118],[-97,21],[57,-491],[-9,-165],[95,-265]],[[95164,29555],[-30,-368],[40,-17],[41,273],[-51,112]],[[88119,23967],[-330,-1768]],[[87789,22199],[191,110],[316,-199]],[[88296,22110],[412,2136],[-72,607],[271,106]],[[88907,24959],[83,409],[-73,243],[35,271]],[[88952,25882],[56,179],[30,514]],[[89038,26575],[-201,-61],[-8,293],[-350,-195],[-38,206],[-111,55],[-13,-87]],[[88317,26786],[16,-9],[-112,-634],[152,-746],[-162,-61],[0,-184],[100,-138],[-192,-1047]],[[40597,54758],[1625,206]],[[42370,54983],[-84,1923]],[[42286,56906],[-70,-9],[-72,1713]],[[42144,58610],[-54,1215]],[[42090,59825],[-598,-78]],[[41492,59747],[46,-997],[33,-334],[-767,-103],[17,-339],[-382,-57],[8,-167]],[[40447,57750],[150,-2992]],[[56709,83116],[1044,-44]],[[57753,83072],[163,3],[20,1244]],[[57936,84319],[-32,26]],[[57904,84345],[-4,-159],[-98,121],[-171,94]],[[57631,84401],[-69,-110],[-376,186],[-79,-18],[138,-363],[28,-266],[-8,-241],[-118,-88],[-114,97],[-108,329],[-114,-8]],[[56811,83919],[-28,-162],[60,-192],[6,-210],[-140,-239]],[[18259,1540],[1221,552],[1677,718]],[[21157,2810],[-182,1271],[-48,-19],[-90,632],[37,15],[-276,1906],[-12,16]],[[20586,6631],[-186,-21]],[[20397,6536],[77,-190],[-64,-122],[-29,-378],[-132,-92],[-179,96],[-53,-75],[-102,215],[-87,-44],[-33,-115],[-127,1],[-231,143],[-43,-143],[48,-218],[-241,-42],[-91,66],[20,131],[-33,213]],[[18208,3350],[44,-153],[-99,-73],[-16,-173],[70,-92]],[[18207,2859],[151,-237],[-53,-225],[44,-285],[-39,-64],[12,-320],[-74,45],[-52,-164],[63,-69]],[[72510,66013],[77,-204],[53,83],[91,-106],[62,80],[62,244],[54,-27],[101,221]],[[73010,66304],[57,296],[-170,239],[4,116]],[[72901,66955],[-112,-21],[67,103],[-7,257],[-66,34],[67,160],[-71,203],[-88,-49],[-41,234],[-112,257]],[[72538,68133],[-24,-426],[-191,32],[-9,-167],[-65,12]],[[72088,66763],[-8,-141],[307,-184],[104,-214],[19,-211]],[[67300,33257],[192,-30],[-11,-223],[623,-83]],[[68104,32921],[-13,203],[56,470]],[[68147,33594],[-652,78]],[[67495,33672],[-172,29]],[[67323,33701],[-23,-444]],[[65604,29499],[-568,69]],[[65036,29568],[-49,-1300]],[[63011,20810],[582,-57]],[[63593,20753],[400,-44]],[[63993,20709],[14,322]],[[64007,21031],[47,1305]],[[63083,23113],[-32,-994]],[[25111,10251],[-25,64],[-170,13],[252,447],[15,186],[155,207],[122,75],[77,437],[72,101],[115,372],[26,304],[71,15],[39,165]],[[25860,12637],[-1295,-463],[-753,-278]],[[23812,11896],[41,-325]],[[24038,10115],[225,-1768]],[[24263,8347],[59,-471],[167,-137],[82,214],[67,-22],[79,247]],[[80026,55957],[235,-104],[231,-41]],[[80492,55812],[229,95],[161,170],[36,95]],[[80977,56938],[-42,122]],[[80935,57060],[-60,52],[-89,-77],[-196,78],[-96,-160],[-210,-140],[-202,-287]],[[80082,56526],[91,-436],[-147,-133]],[[46723,15939],[92,70],[21,-114],[190,-36],[121,175],[-28,173],[36,184]],[[47155,16391],[35,243],[76,183],[-22,168],[-64,70]],[[47180,17055],[-1267,-117]],[[45913,16938],[35,-987],[771,77],[4,-89]],[[54720,43176],[773,-4]],[[55493,43172],[113,53],[12,240],[137,227],[-38,260],[25,100],[103,17],[65,109]],[[55910,44178],[-53,0]],[[55857,44178],[-761,4]],[[55096,44182],[-377,0]],[[46707,42493],[945,74]],[[47652,42567],[-27,1343]],[[46701,43834],[-34,-4]],[[57172,80787],[375,-13],[-17,-137]],[[57530,80637],[911,-24]],[[58441,80613],[-87,385],[73,320],[-69,229],[7,158]],[[58372,82016],[-118,-102],[-112,88],[-78,-13],[-31,201],[-205,84],[-89,-57]],[[57739,82217],[-292,11],[-275,-1441]],[[69268,62407],[685,-93]],[[69953,62314],[692,-91]],[[70669,62221],[30,703],[-106,181],[35,53]],[[70628,63158],[-66,40],[-93,-162],[-150,10]],[[70319,63046],[-184,-97],[-320,278],[-40,112],[-186,45],[-166,-221],[-70,-234],[-168,-127],[-100,71]],[[69085,62873],[-109,-102],[-96,-270]],[[68880,62501],[-7,-46],[395,-48]],[[58159,57638],[374,-14]],[[58533,57624],[17,615],[84,123]],[[58634,58362],[-96,0],[3,280],[-32,1]],[[57327,59193],[-21,-230]],[[57306,58963],[-110,-1299]],[[64912,37517],[382,-47]],[[65294,37470],[769,-93]],[[65348,39149],[-13,-328],[-365,39]],[[72437,39982],[25,332]],[[72462,40314],[51,719]],[[72513,41033],[-225,41]],[[72288,41074],[-476,93]],[[71812,41167],[-6,-110]],[[71806,41057],[-41,-608]],[[71743,26523],[-71,-990],[-14,-333]],[[72042,30508],[-44,-670],[-402,77]],[[61318,53715],[39,1594]],[[61697,53188],[386,-14]],[[62409,55274],[-765,28]],[[64309,52808],[679,-62]],[[64988,52746],[6,170]],[[64994,52916],[23,215],[19,884],[-127,3]],[[64909,54018],[-584,49]],[[64697,75710],[902,-111],[25,-55]],[[65624,75544],[52,1407]],[[65676,76951],[-31,3]],[[64937,77029],[-33,-1004],[-197,19]],[[64707,76044],[-10,-334]],[[38482,64693],[54,-988],[813,125],[17,-332],[191,26],[17,-333],[382,56]],[[39956,63247],[-33,668],[327,48]],[[40250,63963],[-93,2007]],[[40157,65970],[-384,-58],[-18,337],[-1152,-195],[17,-336],[-195,-34]],[[38425,65684],[57,-991]],[[87468,55557],[53,-107]],[[88013,54717],[183,67],[166,154]],[[88362,54938],[99,478],[139,148],[-76,22],[-71,161],[22,389]],[[87964,56277],[-95,-248],[6,-81],[-211,-124],[-196,-267]],[[45405,16885],[508,53]],[[47180,17055],[39,332],[120,348],[-36,165],[85,303],[74,123],[135,-75],[-36,165]],[[47561,18416],[140,166],[-31,75],[61,157],[-56,103],[-26,294]],[[47649,19211],[-151,57],[-55,110],[-74,-76],[-72,44],[-159,-53],[-40,168],[-138,239]],[[46960,19700],[-35,-5],[10,-330],[-386,-36],[31,-986],[-644,-66],[12,-331],[-580,-60]],[[45368,17886],[37,-1001]],[[76588,36620],[826,-175]],[[77414,36445],[80,828]],[[77494,37273],[-166,43],[30,274]],[[77358,37590],[-485,108]],[[76699,37735],[-98,-983]],[[54677,60174],[383,3]],[[55156,60174],[1,504],[96,0],[1,671]],[[55254,61349],[-197,1],[-2,338],[-94,2],[0,335],[-190,0]],[[54771,62025],[-192,0],[0,-676],[-190,0],[1,-336]],[[83857,62817],[427,-785],[90,-9],[24,-182],[85,16],[41,-92]],[[84524,61765],[47,14]],[[84571,61779],[61,11],[119,198]],[[84751,61988],[-26,185],[137,304],[37,393],[61,155],[267,337],[104,34],[-7,108]],[[85324,63504],[-57,-46],[-246,230],[-264,-50],[-95,42],[-113,-85],[-100,27],[-84,-159],[-75,12]],[[84290,63475],[-128,35],[-75,-215]],[[84087,63295],[132,-200],[-217,-171]],[[84002,62924],[-145,-107]],[[80580,63518],[3,-172],[140,15],[91,-107],[186,114],[200,198],[123,-12]],[[81323,63554],[-113,806]],[[81210,64360],[-125,277]],[[81085,64637],[-352,-108],[-72,-84],[-72,-306],[-202,105]],[[80387,64244],[108,-480],[85,-246]],[[71043,51139],[85,-76],[13,-246],[141,-61],[-54,-368],[55,-78]],[[71283,50310],[469,573],[177,271]],[[71761,51981],[-118,16],[1,124],[-111,5],[-191,-186],[-33,133],[-72,-25],[-23,141]],[[71214,52189],[-96,-196],[-7,-165]],[[71111,51828],[31,21],[-127,-513],[28,-197]],[[68818,51259],[222,507],[111,115],[54,341]],[[69205,52222],[-316,660]],[[68889,52882],[-117,-85],[-41,-152],[-72,172]],[[68659,52817],[-139,-247]],[[68520,52570],[-62,-330],[56,-194],[97,-126],[51,-242]],[[74063,54404],[167,-257],[8,-153],[77,23],[113,-225]],[[74428,53792],[126,129],[163,-98],[117,279],[81,97]],[[74915,54199],[11,243],[-69,54],[-76,227],[-148,560]],[[74621,55285],[-338,20]],[[74283,55305],[-45,-24],[-61,-353],[18,-152],[-132,-372]],[[73297,48729],[498,-10]],[[73804,49520],[-27,225],[-84,153]],[[73693,49898],[-240,-155],[-346,-159]],[[73107,49584],[4,-452],[-115,-62]],[[72996,49070],[136,-115],[106,-28],[59,-198]],[[88942,58363],[-145,153]],[[87807,58109],[-115,-96]],[[75235,58885],[88,-119],[53,-190],[123,-259],[52,21],[2,-192],[53,-69],[15,-238],[91,48],[26,-89]],[[75738,57798],[199,315]],[[75937,58113],[39,176],[-25,180],[85,185],[-84,212]],[[75952,58866],[-121,-13],[-74,-118],[-123,-14],[-65,111],[-54,-111],[-171,114],[1,106]],[[75345,58941],[-110,-56]],[[51959,74320],[0,-31],[736,-305]],[[52695,73984],[269,825],[84,-83]],[[53048,74726],[329,1000]],[[52972,76127],[-195,-596],[-457,442]],[[52320,75973],[-92,-167],[86,-208],[-85,4],[-105,-115],[43,-75],[-148,-154],[114,-162],[-80,-137],[-118,-41],[31,-264],[-46,-161],[39,-173]],[[86721,48290],[61,-73],[-93,-218],[13,-260]],[[86702,47739],[135,48],[100,-110],[87,38],[112,274],[310,158]],[[87446,48147],[130,142]],[[87576,48289],[-76,454]],[[87500,48743],[-39,131],[-200,-70],[-85,-207]],[[87176,48597],[-23,-268],[22,-136],[-94,-160],[-52,96],[-123,32],[33,75],[-111,51]],[[86828,48287],[-107,3]],[[79321,38418],[127,-30],[-18,-280],[247,-83]],[[79677,38025],[282,-73],[28,318],[96,-23],[13,165]],[[80096,38412],[13,168],[-95,23],[25,338],[-13,173]],[[79476,39228],[-37,-504],[-95,19],[-23,-325]],[[51855,11421],[1145,34]],[[53000,11455],[39,308],[-23,383],[44,305],[-39,325]],[[53021,12776],[-1146,-36]],[[51291,12717],[9,-661],[-39,-2],[10,-658]],[[65034,22562],[592,-62]],[[65626,22500],[192,-27],[10,331],[388,-51]],[[66216,22753],[27,663],[66,-8],[10,334]],[[65799,24149],[-381,46]],[[61554,23897],[194,-10],[-7,-328]],[[61741,23559],[966,-82]],[[62764,25138],[-1150,103]],[[61614,25241],[-29,-1013],[-31,-331]],[[62767,83402],[275,-442],[157,-392],[294,-65]],[[63493,82503],[118,186],[85,263],[-19,196],[69,61],[266,35],[229,178]],[[64241,83422],[-4,216],[46,60]],[[64283,83698],[-153,142],[-30,-62],[-171,294],[0,219],[73,153]],[[64002,84444],[-181,193],[5,-135],[-66,28],[78,-227],[-76,-126],[-196,181],[-76,-258],[-67,34],[-54,-383],[-185,11],[39,-112],[4,-281],[-226,-36],[-222,177],[-12,-108]],[[12871,10199],[123,68],[118,-51]],[[13112,10216],[152,26],[252,529],[6,212],[52,305],[-26,426]],[[13548,11714],[-40,141],[-1,324]],[[13507,12179],[-254,-98]],[[13253,12081],[-136,-187],[19,-101],[-494,-250]],[[12642,11543],[156,-956],[73,-388]],[[16643,22049],[47,-324]],[[16690,21725],[187,82],[149,-969],[183,81]],[[19476,21553],[-147,1002],[-206,1479],[-7,99],[-227,1623],[19,8],[-330,2391],[31,13],[-148,1043]],[[18461,29211],[-803,-310],[-1004,-434]],[[16654,28467],[-58,-25]],[[50804,80229],[174,-613],[263,-453]],[[52217,79780],[84,66],[215,1071]],[[52516,80917],[-347,201]],[[52169,81118],[-67,-65]],[[52102,81053],[-272,-259],[-66,38],[-94,-105],[-344,261],[-142,-165],[-34,-284],[-167,-319],[-67,68],[-112,-59]],[[31400,37394],[1575,373]],[[32975,37767],[-102,1292]],[[32873,39059],[-125,-29],[-56,-97],[28,-391],[-64,-14],[21,-278],[-318,-76],[-21,257],[-165,156],[-45,-53],[4,-291],[-92,-19],[-170,77],[-123,-62],[-27,73],[-181,27],[-161,-219]],[[31378,38120],[-39,-25]],[[45384,85187],[98,-42],[9,-279],[65,-32],[35,-310],[21,-780]],[[45612,83744],[1140,93]],[[46702,85887],[-1088,-77]],[[45614,85810],[-200,-359],[-30,-264]],[[29185,35384],[144,55],[94,263],[-58,264],[94,65],[-96,250]],[[28616,37420],[-19,-206],[-120,-76]],[[28477,37138],[-45,-58],[-44,-354],[65,21],[-80,-272],[14,-450]],[[28387,36025],[19,-223],[185,-13],[105,160],[119,-77],[36,-103],[159,91],[117,-212],[58,-264]],[[88363,51100],[53,216]],[[88416,51316],[-100,-41],[-24,-130],[71,-45]],[[39530,44075],[0,0]],[[39319,44389],[2,-32]],[[39321,44357],[0,-8]],[[39321,44349],[144,-116],[140,192],[71,-116],[-93,-57],[70,-101],[-22,-172]],[[39631,43979],[701,117],[1297,183]],[[41596,44946],[-12,-2]],[[39975,44708],[-660,-106]],[[39315,44602],[4,-213]],[[73790,63132],[67,-190],[-7,-114],[58,-244],[-19,-277],[119,-611]],[[74008,61696],[178,-41]],[[74186,61655],[33,501],[113,-23],[21,304],[105,8]],[[74458,62445],[-31,190],[214,-41],[26,373]],[[74667,62967],[-25,142]],[[74572,63122],[-761,142]],[[73811,63264],[-21,-132]],[[69283,43245],[556,-90]],[[69839,43155],[17,329],[139,-20]],[[69995,43464],[50,1007]],[[70045,44471],[-316,41]],[[69729,44512],[-312,46]],[[69417,44558],[-32,-169],[8,-542],[-27,-154],[47,-119],[-148,-245],[18,-84]],[[72163,47481],[78,-40],[64,-269]],[[72494,47106],[20,302],[207,187],[20,277]],[[72741,47872],[-384,77],[-83,184]],[[72274,48133],[-69,-42],[-42,-610]],[[72168,53975],[-64,504]],[[72104,54479],[-169,193],[13,71],[-229,416]],[[71719,55159],[3,-121],[-328,-33],[-62,-194]],[[71332,54811],[-136,-430]],[[71196,54381],[69,-581],[-19,-128],[219,-76],[62,136],[114,-87]],[[59222,74015],[270,-11]],[[59492,74004],[81,1]],[[60032,74319],[100,349],[-36,182],[72,138],[-221,11],[-9,238],[-69,93],[-129,-37],[-11,-128]],[[59729,75165],[-100,-209],[-67,-3],[-194,-439],[58,-103],[-35,-191],[-126,-84],[-43,-121]],[[56677,27018],[137,106],[47,130],[229,104],[99,123],[82,225],[64,32]],[[57335,27738],[10,597]],[[62253,48894],[-14,-1373]],[[62239,47521],[-2,-343],[379,-10]],[[62616,47168],[255,-11]],[[62871,47157],[10,567]],[[62647,48837],[-135,12],[-84,135],[-163,-93]],[[62265,48891],[-12,3]],[[64963,59109],[589,-72]],[[65956,58986],[30,122],[142,231]],[[66128,59339],[-55,78],[-71,-71],[-88,67],[7,127],[110,143],[-133,66],[-52,180],[-110,84],[-54,-63],[-77,88],[-3,186],[65,129],[112,-66],[9,133],[-175,209],[95,172]],[[65708,60801],[-15,96],[-133,-164],[-88,56],[-15,128],[64,188],[-52,225]],[[65469,61330],[-8,17]],[[65461,61347],[-28,-238],[-92,0],[-35,128]],[[65306,61237],[-264,20]],[[65007,60251],[-44,-1142]],[[61586,57460],[53,-4]],[[61639,57456],[797,-62]],[[62436,57394],[395,-24]],[[62831,57370],[10,626],[-199,8],[9,337],[-224,5]],[[61596,58376],[-10,-916]],[[72875,63873],[97,-33],[362,-626],[138,-490],[57,-52],[41,-306],[72,-124]],[[73642,62242],[148,890]],[[73811,63264],[40,242]],[[73851,63506],[-104,178],[5,169],[-85,299],[-224,458],[-124,79],[11,171]],[[73330,64860],[-479,84]],[[72851,64944],[-61,-869],[85,-202]],[[57557,63693],[144,-113],[36,54],[213,-86],[0,-340],[-41,-33],[198,-138]],[[58107,63037],[0,170],[124,2],[0,106],[670,1]],[[58901,63316],[6,1058]],[[58510,64696],[0,-55],[-162,-42],[-545,-2],[0,-111],[-251,-3]],[[57552,64483],[5,-790]],[[9361,27484],[-174,-85],[54,-308],[-469,-244]],[[8772,26847],[34,-537],[-11,-560],[-44,-7],[-72,-226],[145,-348],[67,-409]],[[64819,33972],[713,-62]],[[65108,35122],[-379,51]],[[64672,33988],[147,-16]],[[70875,49025],[644,-108],[-7,-110]],[[71512,48807],[93,-16]],[[71605,48791],[30,279],[-59,6],[62,217],[-26,256],[-81,192]],[[71531,49741],[-79,-33],[11,111],[81,24],[-126,210],[-100,-42]],[[71318,50011],[-19,-329],[-192,30],[-11,-226],[-188,44]],[[70908,49530],[-33,-505]],[[71989,48741],[66,-13]],[[72055,48728],[51,48],[275,-54],[94,193],[-59,80],[21,167]],[[72437,49162],[-63,57],[-9,145],[-89,247]],[[72276,49611],[-102,-3],[-13,-287],[-68,-45],[-83,-200],[-21,-335]],[[81544,71229],[49,-8],[193,260],[32,136],[136,12],[81,-81],[31,86],[107,-6],[88,349],[86,9],[60,180],[61,-34],[47,146],[124,74]],[[82639,72352],[31,87],[106,-6],[21,276],[-51,276],[-44,-36]],[[82702,72949],[-3,-116],[-152,-161],[-102,-9],[-218,129],[-127,-194]],[[82100,72598],[-303,-176],[-268,-354],[3,-369],[-91,-10],[-69,-126]],[[81372,71563],[106,-155]],[[25663,28829],[-97,868]],[[25452,29695],[-67,-32],[-155,82],[-157,-304],[-136,-98],[-56,-119],[-145,-54],[-103,-167],[-117,-102]],[[89428,44235],[8,-522],[94,-153],[71,-213]],[[89601,43347],[62,375],[600,-193]],[[90263,43529],[106,344],[-80,288],[-402,194]],[[89887,44355],[-96,-44],[-81,157],[-91,-39],[-43,135],[-98,102]],[[89478,44666],[-101,-61],[51,-370]],[[66295,16772],[-31,414],[57,268],[93,-299],[199,-391],[147,-162],[-6,88],[-131,242],[-52,210],[152,-298],[198,-58]],[[66921,16786],[27,558],[82,-11],[16,326],[-191,30],[47,982]],[[66902,18671],[-867,118]],[[66035,18789],[-73,-1640],[194,-26],[-15,-329],[154,-22]],[[22123,43694],[1612,545]],[[23735,44239],[-45,395]],[[23690,44634],[-181,1608]],[[23509,46242],[-142,1286],[-94,775]],[[23273,48303],[-254,2291]],[[22952,51190],[-1237,-417],[4,-37],[-1698,-595],[-5,43],[-270,-99]],[[19746,50085],[572,-4560],[1524,540],[281,-2371]],[[90185,39143],[155,154]],[[90340,39297],[260,259],[41,381]],[[90641,39937],[-27,71],[13,285],[-37,55],[34,174]],[[90624,40522],[-194,11],[-10,-74],[-141,57],[-28,132],[-98,-203],[-210,-106],[-117,-189],[-126,-84]],[[89700,40066],[-46,-264],[75,-42],[167,-468],[308,285],[-19,-434]],[[73404,46488],[1,-72]],[[73405,46416],[126,-28],[91,-203],[76,-9],[120,-163]],[[73818,46013],[92,264],[-45,231]],[[73865,46508],[-462,83],[1,-103]],[[91294,34269],[48,-448]],[[91342,33821],[39,-345]],[[91381,33476],[79,308]],[[91460,33784],[-51,256]],[[91409,34040],[-69,250]],[[91340,34290],[-46,-21]],[[88035,18578],[30,152],[121,-45],[572,2850],[21,272]],[[88779,21807],[-483,303]],[[87789,22199],[-489,-289]],[[87300,21910],[-733,-456]],[[86567,21454],[47,-131],[45,-344],[314,-859],[331,-759],[240,-340],[118,-254],[99,-38],[110,-170],[164,19]],[[63711,75140],[443,-8],[329,105],[-16,160],[220,-24]],[[64687,75373],[10,337]],[[64707,76044],[-788,76]],[[63919,76120],[-3,-78],[-149,18],[-132,-154],[-39,-278]],[[63596,75628],[98,-92],[-192,4],[41,-315],[84,-41],[51,192],[33,-236]],[[54752,66727],[390,0]],[[56285,66715],[5,847]],[[56290,67562],[-137,-90],[-41,214],[-103,98]],[[56009,67784],[-181,56],[-254,-51],[-29,-198],[-370,228]],[[55175,67819],[-144,-4],[-71,-160],[-109,-124],[-1,-682],[-98,-122]],[[62623,44787],[764,-61],[-11,-339]],[[63376,44387],[39,13],[547,-46]],[[63962,44354],[-40,194]],[[63987,45579],[-42,252],[2,238]],[[63947,46069],[-552,38]],[[63395,46107],[-179,-173],[-117,-338],[-82,-20],[-57,-198]],[[62960,45378],[-111,-113],[-118,-202]],[[62470,39721],[703,-56]],[[63173,39665],[1,10]],[[63174,39675],[15,121],[-21,440],[-58,70],[-153,386],[-13,447]],[[62944,41139],[-288,-195],[-24,-73],[-199,-139]],[[40107,10102],[1236,211]],[[41343,10313],[321,51],[-18,326],[194,31],[-17,328],[867,131]],[[42690,11180],[-70,1485]],[[40907,12130],[-46,-94],[-409,-102],[-48,105],[-53,-68],[-120,3],[-166,169],[-143,32]],[[39922,12175],[48,-787],[58,11],[79,-1297]],[[78436,62707],[207,-555]],[[78643,62152],[16,-41]],[[78659,62111],[7,-19]],[[78666,62092],[80,-211],[496,-692]],[[79661,62392],[-686,1239]],[[78975,63631],[-28,-218],[-56,-73]],[[78891,63340],[-53,-186],[-80,-76],[-78,-344],[-46,-73],[-198,46]],[[41821,28416],[2189,283],[-21,218],[-74,100],[-127,301]],[[43788,29318],[-41,113],[-110,-83],[-58,209],[-112,36],[-21,494]],[[41750,29853],[5,-98]],[[41755,29755],[66,-1339]],[[65431,61426],[30,-79]],[[65469,61330],[21,42],[475,-18],[1,-67],[133,-29],[2,76],[128,36]],[[66229,61370],[37,1466]],[[66266,62836],[-145,17]],[[66121,62853],[-1060,113]],[[65061,62966],[25,-181],[152,43],[52,-359],[60,-68],[72,60],[62,-100],[-102,-171],[75,-99],[-51,-149],[-96,-8],[-27,-152],[98,-44],[50,-312]],[[89470,35374],[234,-496],[71,-90],[91,-341]],[[89866,34447],[131,129],[174,23]],[[90171,34599],[86,503],[-63,342],[-41,-31],[127,311]],[[90280,35724],[-96,67],[27,115],[-108,70],[38,109],[-141,74]],[[90000,36159],[-64,-195],[-159,-14],[-43,-138],[-40,-328],[-64,-77],[-101,54],[-59,-87]],[[82893,52504],[48,38],[12,-197],[432,39],[184,-321]],[[83569,52063],[-8,1233]],[[82967,53468],[-52,-432],[-88,-240],[-21,-209],[87,-83]],[[89098,49267],[93,7],[90,-113]],[[89281,49161],[43,114],[-19,335],[-139,96]],[[89166,49706],[-128,-143],[-3,-225]],[[36620,7749],[1557,328]],[[38177,8077],[-23,327],[-39,-8],[-90,1293],[5,225],[-86,-46],[-18,133],[-65,-13],[-22,327],[61,12],[-24,335],[-162,-34],[-24,326],[-51,-11],[-93,1309],[-15,-3],[-48,673]],[[36102,13039],[-61,49],[-249,-260],[-73,26],[-146,-72],[-77,-133],[-66,1],[-7,-142],[-145,-234]],[[35278,12274],[60,-707],[393,100],[47,-259],[256,113],[70,-913],[34,8],[65,-847],[90,105],[42,-546],[40,9],[49,-652],[89,20],[49,-642],[33,8],[25,-322]],[[79545,72787],[200,-318],[56,-149],[68,-10]],[[79869,72310],[178,-198]],[[80047,72112],[101,15],[9,-81]],[[80157,72046],[98,-13]],[[80255,72033],[41,487],[-164,39],[36,486]],[[80168,73045],[12,145],[-199,48]],[[30209,31172],[183,-1918]],[[30496,28129],[368,107],[-28,299],[377,100]],[[31213,28635],[-52,410],[-119,1318],[-58,-15],[-23,262],[53,15],[-90,994],[76,20],[-56,651],[544,146],[246,85]],[[31734,32521],[-80,916],[5,91],[-145,1633]],[[31514,35161],[-1635,-438]],[[29879,34723],[148,-1604]],[[30027,33119],[182,-1947]],[[69302,70169],[37,-169],[194,-6],[25,-123],[105,-69],[50,-150],[179,-177]],[[69892,69475],[36,521],[225,-35],[-7,43]],[[70146,70004],[-58,120],[43,105],[-79,96],[-95,260],[47,200],[-98,198],[118,22],[-34,157],[64,-20],[-17,318],[152,152],[-94,39],[-35,228]],[[70060,71879],[-78,-18]],[[69982,71861],[-95,-218],[69,-120],[-133,-25],[-226,184],[-53,-95],[31,-302],[-41,55],[-75,-325],[63,-23],[-162,-279],[-111,-262],[58,-36],[-5,-246]],[[58516,65912],[26,629],[192,4],[5,673]],[[58739,67218],[-2,1006],[-232,-3]],[[58502,68221],[-26,-214],[-154,-300],[-34,-202],[22,-114],[-58,-253],[9,-352],[-48,-251],[-255,4]],[[57958,66539],[-26,-296],[-1,-332],[585,1]],[[82884,45469],[205,94],[142,328],[298,88]],[[83529,45979],[-112,559],[-26,250],[-74,21],[-39,153]],[[83278,46962],[-93,-44],[-255,-12],[-172,-127]],[[87156,47258],[128,-386],[-4,-130],[111,32]],[[87391,46774],[59,18],[122,336],[149,205],[147,78],[67,-44],[300,442],[-8,149]],[[88227,47958],[-60,-109],[-94,108],[23,-171],[-219,105],[-269,-149]],[[87608,47742],[9,-143],[-131,64],[-4,-99],[-100,24],[4,-112],[-107,35],[-37,-149],[-86,-104]],[[62419,17032],[80,-64],[-1,145],[-79,-81]],[[61572,17981],[62,-11],[453,-451],[64,74],[191,-186],[95,-207],[81,31],[125,-111],[141,251],[-65,254],[-124,266],[56,211],[-91,165],[-48,239],[39,42]],[[62551,18548],[55,1639]],[[61635,20261],[-63,-2280]],[[62361,29518],[557,-49]],[[62918,29469],[767,-75],[193,-41]],[[63878,29353],[12,346]],[[63890,29699],[14,334]],[[63345,30592],[-866,79]],[[62479,30671],[-49,-130],[20,-166]],[[62450,30375],[-47,-182],[14,-134],[-62,-117],[6,-424]],[[51710,36749],[-3,671]],[[51707,37420],[-8,832]],[[55910,44178],[176,351],[108,38],[24,92],[154,30],[75,-125]],[[56447,44564],[109,32],[-22,108],[114,154]],[[56648,44858],[-83,120],[23,117],[73,-54],[-24,179],[-122,-71],[-25,229],[-96,83],[-43,194]],[[56351,45655],[-76,-20],[-30,-122],[-383,4]],[[55862,45517],[-5,-1339]],[[14974,41976],[421,179],[189,-1314],[55,-323],[-189,-76],[50,-345],[211,-425],[295,116]],[[16006,39788],[1485,611]],[[17491,40399],[-592,54],[-42,303],[619,2015]],[[15929,44436],[-955,-2460]],[[69019,57227],[287,53],[181,-180],[219,-30]],[[69706,57070],[15,98],[132,7]],[[69853,57175],[-1,333],[-62,284]],[[69790,57792],[-38,-71],[-137,7],[-67,-73],[-184,-58],[-62,57],[-206,-11]],[[53159,89277],[-22,211]],[[53473,87605],[112,-49],[17,72],[293,14],[57,-102],[-10,213],[159,-3]],[[54101,87750],[1,124],[-111,962]],[[53991,88836],[-128,277],[-375,358],[-174,220],[-263,395]],[[53106,89783],[69,-187],[110,-5],[270,-388],[313,-186],[-24,-289],[-254,247],[-78,129],[-125,17],[-50,-353],[-112,-17]],[[53225,88751],[-43,-139],[-48,64],[-151,-296]],[[52983,88380],[-7,-161],[-69,-144],[152,-182],[258,-128],[156,-160]],[[73851,63506],[153,893]],[[74129,65172],[71,439]],[[74200,65611],[-174,61],[-60,71]],[[73966,65743],[-2,-56],[-387,24]],[[73577,65711],[-1,-80],[-137,-404],[-83,-26],[-26,-341]],[[36603,17320],[62,67]],[[36665,17387],[45,288],[113,246],[-12,164],[113,246],[16,226],[61,69],[-30,263],[-76,231]],[[36895,19120],[-252,-53],[-15,219],[-192,-41],[-153,300],[-255,-55],[-33,438],[-34,-7],[-76,1004],[-191,-42],[-9,110],[-191,-42],[-8,110],[-510,-129]],[[34976,20932],[-82,-19],[15,-223],[-94,-22],[-56,-125],[57,-321],[-103,82]],[[34713,20304],[-74,-294],[88,-1045],[-32,-8],[49,-655]],[[50914,40072],[-2,685]],[[50912,40757],[-10,656]],[[47899,32964],[101,155],[266,155],[174,26],[133,139],[164,27]],[[48737,33466],[-23,1140],[20,1],[-28,1340]],[[48706,35947],[-40,-3]],[[47874,35889],[35,-1335],[-26,-3],[35,-1335],[-19,-252]],[[34682,61644],[54,349],[546,107],[74,-125],[463,98],[24,133]],[[35727,63854],[-155,-97],[-460,-376],[-195,-225],[-579,-113]],[[34338,63043],[99,-1450],[245,51]],[[37316,58593],[672,117],[411,312],[140,231],[38,-60],[460,28],[680,120]],[[39717,59341],[624,84],[84,-67],[384,1521],[156,24],[-6,125]],[[40959,61028],[-27,572],[-397,-61],[4,-84],[-506,400]],[[40033,61855],[14,-283],[-1381,-215],[-720,-119],[-38,670]],[[37143,61778],[132,-2324],[41,-861]],[[82378,54815],[-6,-77]],[[83185,55486],[-307,26],[11,114],[-205,60],[-105,122]],[[82579,55808],[-155,-307],[-52,77]],[[86853,56023],[429,-141]],[[87282,55882],[61,613],[60,197]],[[87435,57431],[-89,154],[-79,-81],[-212,-5],[-51,85],[-159,-6]],[[86845,57578],[-147,-84],[-149,-204]],[[86549,57290],[19,-114],[227,-213],[-31,-254],[89,-686]],[[85673,59341],[177,-116],[476,-152],[67,-41]],[[86393,59032],[98,136],[138,285],[150,203],[59,229],[111,155]],[[86949,60040],[17,171],[160,118],[-115,296]],[[87011,60625],[-128,166],[-203,27],[-438,-223],[-280,119],[-88,-63]],[[85874,60651],[34,-71],[-53,-232],[26,-66],[23,-442],[-106,-152],[-125,-347]],[[30836,14280],[180,51],[31,-327],[384,105],[196,13],[27,-288],[117,34],[-16,312],[115,34],[117,126],[66,246],[146,159],[-14,173],[142,118]],[[32327,15036],[31,207],[87,26],[-12,122],[128,266],[144,-18],[64,93],[97,-119]],[[32689,17456],[-12,136]],[[32677,17592],[-193,-79],[-573,-155]],[[31911,17358],[-426,-115]],[[74977,51781],[130,24],[28,-264]],[[75135,51541],[145,61],[118,-54]],[[75562,52303],[-126,181],[8,145],[-63,26],[-36,348]],[[75345,53003],[-423,-600]],[[74922,52403],[55,-622]],[[79808,62645],[140,166],[26,102],[164,79],[284,303]],[[80422,63295],[158,223]],[[80387,64244],[-68,50]],[[80319,64294],[-7,-116],[-280,89],[-80,-114],[-111,189],[-68,-343]],[[79773,63999],[95,-196],[26,-282],[-66,-240],[-88,-105],[-70,-236],[138,-295]],[[70461,50895],[130,-83],[141,-227]],[[70732,50585],[129,311],[61,67],[121,-81],[0,257]],[[71111,51828],[-338,-238]],[[70773,51590],[0,-209],[-75,-178],[-102,29],[-49,-272],[-93,64],[7,-129]],[[73902,52280],[51,-4],[-25,-512]],[[73928,51764],[250,1],[84,-81]],[[74262,51684],[-1,316],[27,151],[241,211],[46,225],[-9,241]],[[74566,52828],[-284,532]],[[74282,53360],[-90,72],[-177,-290]],[[74015,53142],[-43,-267],[-203,-168]],[[73769,52707],[41,-295],[92,-132]],[[74418,50434],[48,-561]],[[74466,49873],[330,179],[101,340]],[[74897,50392],[-83,45],[50,133],[-101,153]],[[74763,50723],[-68,173],[-144,-203],[44,-70],[-109,-64],[-68,56]],[[74418,50615],[0,-181]],[[79461,58900],[235,-73],[333,458],[22,269]],[[80051,59554],[-445,78]],[[79361,59708],[-16,-337],[116,-471]],[[79283,55968],[133,-5],[45,157],[88,-20]],[[79549,56100],[106,356],[-28,87],[59,161],[103,94]],[[79789,56798],[-98,251],[-91,29],[-51,124]],[[79549,57202],[-69,-392],[-70,-110],[-38,-202],[-130,80],[-64,-149],[-60,74],[-43,-202],[-110,73]],[[78965,56374],[96,-190],[185,-106],[37,-110]],[[89499,51318],[332,-121]],[[89831,51197],[444,-162]],[[90275,51035],[176,697],[139,447]],[[90590,52179],[-35,29]],[[90555,52208],[-62,-206],[-64,-56],[8,-135],[-71,-277],[-116,-219],[-162,12],[-8,-122],[-91,93],[63,182],[120,119],[64,-57],[30,241],[333,861],[20,151],[-144,-162],[-9,-123],[-142,-283],[-70,-20]],[[90254,52207],[5,-119],[-214,-216],[-110,49],[-108,-228],[-328,-375]],[[81740,51070],[208,-217],[72,-142]],[[82020,50711],[165,-252],[119,73]],[[82304,50532],[18,123],[148,252],[65,452]],[[82535,51359],[-171,184],[-90,250],[-149,61],[-57,107],[-83,-46],[-40,115]],[[87176,48597],[-122,8],[-101,-266],[-119,29],[-6,-81]],[[20900,11527],[-60,-7],[17,438],[-42,121]],[[20815,12079],[-17,-25]],[[20798,12054],[-134,-107],[-115,56],[-114,-112],[-264,254],[-75,324],[-135,157],[-62,-25],[-64,215],[-170,111],[-171,-22],[-128,127]],[[19366,13032],[-81,-136],[-140,-125],[-72,-180],[45,-145],[1,-216],[51,-236],[30,-315],[-149,-433],[-39,-277]],[[50818,66139],[1056,38]],[[51869,67017],[-7,668]],[[51862,67685],[-64,-64],[14,-153],[-80,-109],[-100,-24],[-54,149],[-220,339],[-59,30],[-204,-163]],[[51095,67690],[63,-377],[-47,-67],[-103,43],[-111,-51],[-53,-307],[56,-174],[-89,-48]],[[79588,54521],[78,-253],[163,-222]],[[79829,54046],[316,-73]],[[80145,53973],[-45,105]],[[80100,54078],[-32,250],[41,195],[-36,333]],[[80073,54856],[50,207],[-153,-53],[-102,116],[-91,209]],[[79777,55335],[-19,92]],[[79758,55427],[-95,-66],[-50,-165],[-111,-104],[157,-450],[-71,-121]],[[74524,59942],[70,-237],[108,72],[79,-227],[-39,-199],[141,-37],[-9,-470],[21,-106],[80,25],[-18,-242]],[[74957,58521],[105,172],[94,-38],[16,242]],[[75172,58897],[-155,510],[-138,357],[-59,349]],[[74820,60113],[-139,270]],[[74681,60383],[-79,-276],[-97,-45],[19,-120]],[[50044,28915],[192,10]],[[50228,30599],[-812,-47]],[[52701,72893],[91,4]],[[52792,72897],[952,27]],[[53744,72924],[49,71],[-13,173],[62,184],[79,88],[-33,202]],[[53888,73642],[129,116]],[[54017,73758],[-969,968]],[[52695,73984],[6,-1091]],[[51095,67690],[-22,1627]],[[50254,69286],[17,-1421]],[[50271,67865],[15,-953]],[[83627,49065],[141,-214],[86,-551],[50,-88],[106,7]],[[84010,48219],[55,-60],[129,101],[30,219],[150,50],[213,529],[50,-9]],[[84419,49560],[-96,164]],[[84323,49724],[-62,6],[-140,-222]],[[84121,49508],[-82,-134],[-54,63],[-167,-62],[-83,-239],[-108,-71]],[[35583,50175],[212,22],[44,172],[120,154],[135,73],[-10,146]],[[35220,52174],[75,-965],[-37,-9],[82,-1007],[128,-62],[115,44]],[[79995,69006],[62,-74],[-50,-118],[182,-141]],[[80189,68673],[200,74],[124,-66]],[[80513,68681],[164,540],[170,176]],[[80847,69397],[-31,273]],[[80816,69670],[-99,-58],[-114,183],[-46,348],[-97,343],[51,115]],[[80511,70601],[-79,115],[-138,42],[-122,-209]],[[80172,70549],[23,-343],[-216,-147],[-300,-6]],[[79679,70053],[148,-113],[-70,-164],[220,-319],[-76,-126],[74,-153],[20,-172]],[[65565,43089],[-60,-113],[-84,4],[-106,120],[-252,25],[-123,-43],[-37,135]],[[64903,43217],[-116,41],[-114,163],[-257,53],[-55,-229],[-70,-25]],[[64291,43220],[143,-132],[89,7],[23,-132]],[[53862,32977],[1104,2]],[[54966,32979],[0,1340]],[[53920,34315],[22,-48],[-84,-316],[-151,-196],[-3,-240],[146,-317],[12,-221]],[[51573,52879],[191,1],[1,-680]],[[51765,52200],[959,19]],[[52724,52219],[-13,1687]],[[52711,53906],[-1149,-25]],[[51562,53881],[11,-1002]],[[73210,48224],[58,-26],[169,-379]],[[73595,47743],[135,147],[-36,168],[90,-26],[44,285],[148,52],[-23,109],[56,116]],[[73297,48729],[-84,-161],[-50,-207],[47,-137]],[[65806,81494],[-22,441],[41,548],[60,158],[147,152],[-101,495]],[[65931,83288],[-229,19],[-58,-247],[-115,-54],[-93,-131],[-13,-131],[-101,-134]],[[65322,82610],[-33,-489],[168,-92],[76,-199],[146,-272],[127,-64]],[[70319,63046],[19,346],[-21,191],[-90,150],[-48,236]],[[70179,63969],[-1113,107]],[[69066,64076],[19,-1203]],[[22427,68031],[2086,629]],[[24513,68660],[1173,338],[759,232],[4,-37],[1309,341]],[[27758,69534],[-30,329]],[[27728,69863],[-54,675],[-184,1968]],[[25670,73199],[-2624,-2596],[-809,-811]],[[22237,69792],[190,-1761]],[[29892,65646],[40,-140],[129,-35],[97,-94],[43,-141],[550,129]],[[30751,65365],[-176,2171]],[[30443,69178],[-109,1338]],[[30334,70516],[-124,-28]],[[30210,70488],[-176,-442],[70,-397],[-39,-422],[-103,-416],[-28,-9],[-225,-968],[183,-2188]],[[62956,62797],[60,-186],[-13,-117],[75,-331],[-104,-448],[143,-161],[14,-121]],[[63131,61433],[169,-40],[13,340],[382,-21]],[[63714,62506],[12,567],[-189,11]],[[63150,63463],[-6,-536],[-177,15],[-11,-145]],[[86500,89682],[160,625],[70,853],[20,950]],[[86750,92110],[-260,48],[-195,-50],[7,79],[-1163,328]],[[85139,92515],[-154,-1533],[-75,-807]],[[81775,74118],[51,-287],[51,-10],[58,-222]],[[81935,73599],[165,257],[224,110],[331,58]],[[82655,74024],[-14,346],[-39,4],[-78,298],[-58,25],[1,455],[-43,12]],[[82424,75164],[-271,-241],[19,-96],[-134,83],[-108,-27],[-167,-140]],[[81763,74743],[-12,-121],[24,-504]],[[59598,40593],[768,-44]],[[60392,41735],[-128,13]],[[60264,41748],[-644,57]],[[62686,33644],[384,-34],[-3,-114]],[[63067,33496],[292,106],[105,270],[38,226]],[[63795,34558],[-313,28],[10,337],[-381,33]],[[73361,54232],[390,-24]],[[73751,54208],[-69,119],[116,146]],[[73798,54473],[-27,433],[-57,471]],[[73714,55377],[-246,76]],[[73137,54741],[144,-219],[80,-290]],[[62533,82267],[23,-141]],[[62556,82126],[145,11],[112,82],[171,-313],[127,38],[126,284],[179,-15],[37,-98],[228,-22]],[[63681,82093],[192,-18],[90,123]],[[63963,82198],[-53,211]],[[63910,82409],[-417,94]],[[62767,83402],[-42,-76],[50,-138],[46,49],[-9,-195],[-114,-18],[-92,81],[-68,-59]],[[62472,83979],[171,-172],[155,9],[269,254],[-98,125],[-2,132],[-151,54],[-366,-331],[22,-71]],[[68669,47607],[641,-105]],[[69310,47502],[80,274],[-23,319],[-121,134],[-80,396]],[[69166,48625],[-450,60]],[[87982,44174],[146,245],[139,56],[141,240]],[[88408,44715],[45,106],[76,-100],[55,40],[-25,155],[44,149],[147,260],[-22,81],[67,277],[-202,-174],[-56,-197],[-49,47],[12,188],[-105,-78],[-64,-187],[-76,-80],[-151,-26],[-212,65],[-28,-163],[-111,-255]],[[87753,44823],[-56,-81],[66,-233],[44,-311],[175,-24]],[[63753,79823],[76,-221],[775,-122]],[[64604,79480],[-110,278]],[[64494,79758],[-40,143],[-96,118],[44,304],[-41,167],[116,354],[90,74]],[[64567,80918],[-184,16],[-62,97]],[[64321,81031],[-233,14]],[[64088,81045],[-64,-74],[-118,9],[66,-371],[-36,-317],[-100,77],[28,-120],[-44,-137],[-95,-75],[28,-214]],[[60465,75985],[669,-41],[-5,-336],[485,-29]],[[61614,75579],[37,143],[-48,224],[47,15],[-63,298],[150,108],[-23,70],[88,131],[1,156],[154,57]],[[61957,76781],[-820,388],[-51,13],[-95,-235],[-29,-255]],[[60962,76692],[-163,-296],[-200,-91],[4,-138],[-117,-71],[-21,-111]],[[70108,29495],[-117,-382],[-48,-254],[11,-130],[93,-282],[33,-286]],[[53959,41159],[1056,3]],[[55015,41162],[-92,200],[78,210],[90,69],[64,194],[-24,92]],[[55131,41927],[5,219],[89,18]],[[55225,42164],[-601,3]],[[53956,42165],[3,-1006]],[[66666,33795],[657,-94]],[[67495,33672],[63,1311]],[[67558,34983],[-64,9]],[[67494,34992],[-574,81]],[[66728,35099],[-62,-1304]],[[49534,44033],[578,30]],[[50112,44063],[376,17]],[[50488,44080],[-27,1677]],[[50461,45757],[-920,-48]],[[67494,34992],[17,335],[-42,7],[16,308]],[[67485,35642],[49,1004]],[[35600,67894],[1140,207],[-17,328],[754,126],[-37,665]],[[37440,69220],[-36,652],[-68,-11],[-100,1695],[937,147]],[[38173,71703],[-101,1991]],[[38072,73694],[-133,-21]],[[37939,73673],[-959,-159],[-1067,-194]],[[35913,73320],[-711,-127]],[[35202,73193],[235,-3655],[67,11],[23,-361]],[[70732,50585],[73,-10],[-29,-190],[17,-181],[-78,-176],[12,-243]],[[70727,49785],[-11,-168],[196,-29],[-4,-58]],[[71318,50011],[54,124],[-23,145],[-66,30]],[[69310,47502],[1,-214]],[[69311,47288],[9,19],[484,-72],[-1,-24]],[[70047,47187],[-73,266],[-103,134],[-48,-36],[-9,390],[-31,112],[56,223],[37,330]],[[69876,48606],[-95,149],[-99,-113],[-94,80],[-90,-13]],[[69498,48709],[-47,154],[-136,38],[-36,162],[-243,177]],[[69036,49240],[-4,-234],[136,-145],[-2,-236]],[[80162,33015],[286,-310],[257,-381],[40,-212],[100,55],[187,-296],[250,-320]],[[81282,31551],[105,1028],[244,-74]],[[81631,32505],[56,566]],[[81687,33071],[-1478,430]],[[80209,33501],[-47,-486]],[[83713,67648],[186,-27],[277,52],[-29,-211],[115,-81],[18,-165],[-191,-237],[27,-82]],[[84116,66897],[106,100],[75,-66],[117,355],[109,-72],[-14,130],[87,185],[102,-209],[31,-203],[112,-120],[-2,-182],[148,-442],[16,-121],[141,-183],[54,33],[84,-285],[49,-26]],[[85331,65791],[198,174],[159,26],[-32,105]],[[85656,66096],[-63,98],[-23,332],[-119,4],[-105,85],[-85,-108],[-96,142],[-44,253],[87,17],[5,107],[-198,277],[-40,185],[-206,258],[-81,-103],[-66,150],[119,41],[-12,201],[-149,218],[-35,141],[-140,51],[-122,132],[-50,165],[-46,-48],[-117,184]],[[84070,68878],[-21,-46],[-115,150],[-135,-142],[42,-121],[-30,-297],[-64,-47],[-21,-170],[-66,-79],[59,-295],[-6,-183]],[[81208,59346],[515,-83]],[[81723,59263],[39,398],[169,-291],[62,104]],[[81993,59474],[16,229],[107,312],[29,312],[-46,116]],[[81088,60643],[-100,-393],[-20,-307],[134,-121],[-16,-339],[52,-124]],[[82197,69242],[424,-880],[150,215],[-8,177],[111,51],[47,-166]],[[82921,68639],[92,226],[15,290],[45,105],[-29,248],[41,57],[-67,274],[-83,-3],[-7,204],[-134,15],[41,137],[-28,131],[48,142],[95,87],[24,111],[138,185]],[[83112,70848],[2,176]],[[83114,71024],[-79,-6],[-170,-185],[-108,71],[-103,-78],[-27,-271],[-66,-129]],[[82561,70426],[29,-244],[-217,-519],[15,-117],[-191,-304]],[[90313,31098],[145,-223],[34,95],[214,4],[-30,-119],[149,79],[157,-100]],[[90982,30834],[-35,294],[67,291]],[[91014,31419],[79,143],[-19,285]],[[91074,31847],[-317,847]],[[90757,32694],[-248,-143]],[[90509,32551],[-609,-368]],[[89900,32183],[-131,-216]],[[89769,31967],[-31,-260],[443,-214],[73,-310],[59,-85]],[[91905,23858],[228,33],[206,-141],[184,-68]],[[92523,23682],[11,279]],[[92534,23961],[53,142],[-17,265],[59,150],[-25,163],[-83,104],[6,275],[58,278],[178,247]],[[92010,25858],[-88,-706],[-138,46],[-84,-705],[205,-71],[-49,-571],[49,7]],[[31709,73322],[-129,1713],[-1587,-359]],[[29993,74676],[341,-4160]],[[31117,60856],[1038,242],[103,-1328],[1317,295],[12,-165],[190,39],[-13,168],[574,114]],[[34338,60221],[126,27],[52,344]],[[34516,60592],[166,1052]],[[34338,63043],[-948,-194]],[[33390,62849],[-2391,-540]],[[30999,62309],[118,-1453]],[[80453,50719],[-6,-135],[130,-234]],[[80577,50350],[18,-259],[102,-115],[74,16]],[[80771,49992],[464,495]],[[81235,50487],[-25,186],[72,125],[-77,146],[-131,122]],[[81074,51066],[-2,-36],[-223,153],[-181,219]],[[80668,51402],[-274,-328]],[[80433,41247],[42,-66],[-41,-143],[85,-65],[-5,-465]],[[80514,40508],[365,-36]],[[80879,40472],[20,207]],[[80459,41745],[-66,-109],[50,-191],[-10,-198]],[[72700,71898],[120,-109],[60,-143],[126,-130],[97,210],[125,-14],[154,80],[41,-61]],[[73423,71731],[79,310],[149,211]],[[73651,72252],[-125,31],[-19,88],[52,761]],[[73559,73132],[22,318],[-368,70]],[[73213,73520],[-207,42],[-22,-325],[-193,32]],[[72555,72176],[62,-248],[83,-30]],[[72514,65397],[188,-358],[154,-40],[-5,-55]],[[73577,65711],[5,128],[-198,-49],[-95,73],[9,140],[-129,-8],[-36,199],[-123,110]],[[72510,66013],[-81,16],[58,-190],[-12,-208],[39,-234]],[[69059,64535],[7,-459]],[[70179,63969],[52,1007]],[[70039,64996],[-986,90]],[[69053,65086],[6,-551]],[[15565,88139],[10,1163]],[[15575,89302],[-181,4],[20,698]],[[14445,89986],[-442,-30],[3,-116],[-134,-12],[-4,117],[-536,-59],[-38,229],[-139,98],[-43,344],[-67,-9],[-11,232],[-67,-10],[-43,344],[-66,-10],[-13,231],[-90,-14],[-13,232],[-66,-11],[-43,344],[-140,93],[-42,343],[-66,-12],[-15,215]],[[12370,92525],[-16,14]],[[12354,92539],[-117,-22],[2,117]],[[12239,92634],[-19,96],[-164,122],[-65,-154],[79,-145],[12,-260],[-80,-424],[52,-138],[108,-127],[-113,-637],[-84,-319],[-48,23],[-19,190],[-80,-6],[-160,138],[-230,33],[-171,-99],[-7,-258],[-68,-89],[-93,-324],[-95,-85],[-51,-143],[78,-106],[-157,-17],[179,-244],[5,-205],[-40,-74]],[[10033,90043],[198,78],[97,-139],[133,6],[96,-81],[10,159],[78,-4],[46,160],[9,450],[-177,9],[-80,127],[-69,-160],[-79,-22],[-242,-381],[-20,-202]],[[7988,88764],[78,-103],[-11,129],[204,374],[-177,-152],[-94,-248]],[[41821,28416],[56,-1099]],[[42836,27452],[1697,214],[1,-241],[61,-97],[-11,-127],[54,-325],[70,-92],[-1,-228],[136,-54],[89,105],[83,-23],[129,-246],[59,-22]],[[45203,26316],[-34,639],[-49,1336]],[[45120,28291],[-19,-2],[-40,1095],[-27,72],[-168,-64]],[[44866,29392],[-60,45],[-1018,-119]],[[50464,23921],[1157,62]],[[51621,23983],[-5,333]],[[51598,26313],[-1154,-58]],[[50443,25248],[21,-1327]],[[53429,32299],[570,8]],[[53999,32307],[-91,128],[15,348],[-61,194]],[[54007,34586],[-91,30],[-49,-126],[-118,40],[-46,-76]],[[53703,34454],[-10,-107],[-119,-217],[39,-146],[-65,-81],[-121,-22],[-6,-123]],[[53421,33758],[8,-1459]],[[82921,68639],[64,-187]],[[82985,68452],[127,78],[179,-19],[35,204],[83,99],[134,23],[41,131],[126,135]],[[83710,69103],[-5,97],[128,241],[-42,287],[-178,228],[-119,103],[-24,-133],[-142,-94],[-84,152],[99,72],[108,165],[-76,241],[-263,386]],[[77434,57428],[21,-27],[5,-414],[52,-314]],[[77512,56673],[-32,-145],[43,-111],[81,70],[0,-208]],[[77604,56279],[-4,94],[135,109],[416,587]],[[78151,57069],[18,278],[-85,335]],[[78084,57682],[-46,80],[-159,-23],[-136,127],[-37,145],[-120,85]],[[77586,58096],[-37,15],[-44,-309],[36,-104],[-107,-270]],[[89071,36209],[89,-308],[102,-232]],[[89262,35669],[189,-355]],[[89451,35314],[19,60]],[[90000,36159],[146,127],[65,152],[135,86],[113,213]],[[90459,36737],[-84,150],[-69,4],[-46,194],[-167,195]],[[90093,37280],[-19,-268],[-92,-41]],[[89982,36971],[-911,-762]],[[52082,31943],[-9,1219]],[[52073,33162],[-227,0],[-87,-76],[-77,36],[-23,159],[-103,179],[-138,16],[-189,-295]],[[51229,33181],[60,-114],[-8,-158],[53,-243],[-32,-106],[10,-331],[57,-309]],[[69853,57175],[378,28],[28,-42]],[[70259,57161],[240,27],[-59,228],[17,141],[75,123],[-24,90],[-8,408]],[[70500,58178],[-19,354]],[[70481,58532],[-597,-38]],[[69884,58494],[-37,-85],[-1,-302],[-56,-315]],[[55114,55765],[467,-3]],[[55581,55762],[203,-2]],[[55784,55760],[0,218],[-42,0],[5,1333]],[[55747,57311],[-672,4]],[[55075,57315],[-2,-1329],[41,0],[0,-221]],[[53768,71892],[414,1],[0,-106]],[[54594,73650],[-706,-8]],[[53744,72924],[13,0],[11,-1032]],[[47409,66203],[401,534],[219,-8],[188,179],[137,-106]],[[48354,66802],[-21,968]],[[95783,18652],[176,-17],[30,-254],[166,33]],[[96155,18414],[10,382],[-26,78],[186,-13],[38,298],[-35,153],[112,218]],[[96440,19530],[-37,341],[-132,220],[-94,-243]],[[96177,19848],[2,-150],[-70,-173],[12,-319],[-94,177],[-74,23],[-124,-182]],[[95829,19224],[-36,-44],[-10,-528]],[[53191,69608],[833,39]],[[54024,69647],[0,218],[165,-41]],[[54183,71249],[-409,-6]],[[53774,71243],[-609,-27]],[[53165,71216],[26,-1608]],[[50072,76134],[-53,-155],[-334,73]],[[47681,76412],[127,198],[-48,113],[95,121],[46,-92]],[[47901,76752],[-37,1551]],[[41927,75581],[849,101]],[[42724,77849],[-167,-23]],[[42557,77826],[-72,-169],[11,-247],[-129,-243],[-143,-88],[-175,-246],[-155,177],[-24,-59]],[[41870,76951],[57,-1370]],[[38173,71703],[18,3],[93,-1694],[1907,279]],[[40191,70291],[-81,1697],[170,24],[-95,1999]],[[40185,74011],[-483,-68]],[[39702,73943],[-84,-12]],[[39618,73931],[-1546,-237]],[[61673,51613],[96,-3],[119,-169],[458,-34],[-7,-396]],[[62339,51011],[167,-9]],[[62506,51002],[16,-1],[32,1402]],[[58107,63037],[1,-168],[196,3],[1,-282]],[[58305,62590],[0,-67],[196,0],[1,-346],[193,16],[0,-451],[108,248],[70,-44]],[[58873,61946],[71,-120],[137,78],[120,-100],[60,41],[104,-124],[33,384],[158,-59],[62,51]],[[59656,62134],[4,404],[-321,3],[-127,277],[-242,-1],[-78,55],[9,444]],[[58563,45942],[18,1225]],[[58581,47167],[-140,-27],[-252,251],[45,-153],[-115,6],[9,143],[-138,47]],[[57990,47434],[-187,-239]],[[57803,47195],[-8,-956]],[[15108,45816],[1611,651]],[[17614,48775],[1809,4656]],[[19423,53431],[276,709]],[[16211,52872],[-509,-206],[-151,-25]],[[15551,52641],[43,-275],[45,0],[18,-478],[-37,-91],[-2,-514],[35,-66],[-48,-218],[-6,-294],[75,-172],[-69,-223],[22,-177],[-96,-50],[-33,-202],[31,-141],[-69,-190],[43,-150],[-103,-400],[62,-30],[-24,-165]],[[82009,37591],[-189,-1904]],[[81820,35687],[88,450],[117,31],[-17,174],[543,-242],[98,-192]],[[82704,36436],[54,514],[-292,1051]],[[82466,38001],[-76,42],[-122,-116],[-75,-232],[-147,-155],[-36,51]],[[80698,57902],[1032,-194]],[[81771,57915],[20,350]],[[81791,58265],[-900,165]],[[80696,57918],[2,-16]],[[78084,57682],[43,195],[52,-35],[81,240]],[[78260,58082],[87,228],[53,-65],[105,210],[-30,382],[112,161]],[[78313,59573],[-85,-70],[-62,-189],[-300,-402],[-96,-77]],[[77770,58835],[43,-159],[-112,-354],[30,-89],[-139,-64]],[[77592,58169],[-6,-73]],[[76605,56569],[45,-177],[-23,-250],[41,-286]],[[76668,55856],[123,-118],[113,30],[55,-112],[86,-2],[7,-151],[92,-22]],[[77337,55508],[77,394]],[[77414,55902],[-54,115],[-78,-115],[-191,350],[-18,173]],[[77073,56425],[-133,2],[-160,182],[27,149],[-87,-60],[25,167]],[[76745,56865],[-140,-296]],[[83730,33410],[-7,-56],[352,-118]],[[84075,33236],[309,459],[100,-30]],[[84484,33665],[47,406],[-108,625]],[[84423,34696],[-241,25]],[[84182,34721],[-35,-353],[-32,10],[-34,-307],[-271,86],[-80,-747]],[[53236,32296],[193,3]],[[53421,33758],[-164,-116],[-93,49],[-29,-154],[-55,-5]],[[53080,33532],[-188,-44],[-47,-108]],[[52845,33380],[8,-1089]],[[87992,34657],[214,-309],[176,-209],[-83,-135],[-16,-163],[104,-190],[74,8]],[[88461,33659],[316,415],[-111,183],[230,453]],[[88896,34710],[-208,186]],[[88688,34896],[-132,117],[-87,169]],[[88469,35182],[-249,-227],[-228,-298]],[[83138,60179],[708,-175]],[[83846,60004],[20,155],[121,238],[156,140],[-17,459]],[[84126,60996],[-83,184],[-291,80],[-390,605]],[[83362,61865],[-81,-212],[-38,-268],[-99,-164],[-90,-240]],[[83054,60981],[-58,-159],[-292,-534]],[[82704,60288],[434,-109]],[[82881,66625],[471,-731],[54,198],[113,54],[120,-32]],[[83639,66114],[78,208],[67,45],[-47,144],[104,84],[275,302]],[[83713,67648],[19,-113],[-94,-324],[36,-231],[-172,-75],[-211,85],[-162,-133],[-92,-181],[-156,-51]],[[59392,45214],[314,-28],[383,5]],[[60089,45191],[287,-9],[2,338]],[[60378,45520],[-3,1115]],[[60375,46635],[-144,-76],[-92,458]],[[60139,47017],[-80,21],[-112,-230],[-4,-113],[-109,3],[-86,-82],[-57,-182]],[[59691,46434],[-24,-123],[-163,-91],[-31,-121],[-61,49],[-35,-223],[27,-118],[-25,-253]],[[90382,17556],[529,-235],[451,-160]],[[91362,17161],[129,635],[-42,223]],[[90997,18798],[-185,7],[-332,-144]],[[90480,18661],[-72,-163],[49,-224],[-20,-327],[-96,-121],[41,-270]],[[82845,33605],[0,-2]],[[82845,33603],[229,-66],[539,-199],[13,104],[104,-32]],[[84182,34721],[-681,127],[13,138],[-96,91]],[[82731,34747],[-30,-314],[37,-128],[177,8],[-70,-708]],[[88838,47754],[48,-100],[88,0]],[[88974,47654],[14,84],[122,-56],[77,211],[41,224],[-17,309],[-131,-166],[-133,-95]],[[88947,48165],[-83,-48],[-26,-363]],[[60587,50062],[225,-2]],[[60812,50060],[159,-1],[-1,325],[215,0],[61,54],[96,-56]],[[61342,50382],[1,167]],[[61343,50549],[9,504],[28,-1],[6,560]],[[61001,51619],[-191,7],[-148,-332],[-19,-231],[-64,1],[-1,-160],[-97,-29]],[[60481,50875],[0,-488],[98,-5],[8,-320]],[[39287,16453],[388,68],[-7,109],[328,57],[-20,331],[64,10],[-19,330],[129,22],[-13,220],[59,121],[322,57],[-6,111],[390,67],[6,-110],[194,32],[9,-165],[192,30]],[[41303,17743],[-26,496],[-266,-43],[-34,641],[30,5],[-36,671]],[[40971,19513],[-83,-13],[-74,1329],[-66,-11]],[[40748,20818],[-1877,-331]],[[38871,20487],[83,-1323],[59,10],[80,-1313],[53,9],[82,-1317],[56,-45]],[[40748,20818],[-100,1653],[-80,-13],[-74,1340]],[[40494,23798],[-61,-10]],[[40433,23788],[-1314,-228],[-176,-3]],[[38943,23557],[-375,-70]],[[38568,23487],[45,-707],[-25,-5]],[[38588,22775],[41,-654],[69,13],[107,-1659],[66,12]],[[69123,53349],[363,-486],[164,-125],[196,-349]],[[70021,53053],[-71,330],[-58,-1],[-7,197],[126,232],[-8,154]],[[70003,53965],[-62,106],[-201,56],[-54,87],[-291,-125]],[[69395,54089],[-155,-154],[-81,-167],[-14,-201],[-82,-97],[60,-121]],[[68425,18153],[145,-171],[63,17],[57,199],[104,100],[105,-3],[35,-159],[80,-4],[66,130],[9,-230],[-49,-167],[83,-78],[45,96],[-19,186],[98,70],[160,-365],[177,-133],[302,-416],[64,59],[351,-200]],[[70345,17786],[-768,133],[39,660],[-385,61],[38,662]],[[69269,19302],[-773,127]],[[68496,19429],[-71,-1276]],[[77369,49388],[52,-154],[218,75],[181,158],[226,90]],[[78046,49557],[-92,129],[54,99],[40,391]],[[78048,50176],[-224,-86],[-222,259],[-73,-33]],[[77529,50316],[-42,-296],[-75,-74],[-38,-151]],[[77374,49795],[58,-222],[-63,-185]],[[67533,43783],[889,-128]],[[68409,44408],[-163,41],[5,111],[-694,100]],[[67557,44660],[-27,-539]],[[77581,51134],[45,54]],[[77626,51188],[170,36],[9,202],[89,-79],[50,49],[39,402],[80,70]],[[78063,51868],[-34,62]],[[78029,51930],[-150,47],[-249,434],[-44,-80]],[[77586,52331],[-101,-55],[-30,-104],[-85,34],[-19,-351],[-46,-274]],[[77305,51581],[-34,-195],[105,-294],[60,64],[145,-22]],[[51776,51187],[574,16]],[[52728,51544],[-4,675]],[[51765,52200],[11,-1013]],[[64797,48393],[-70,202],[60,233]],[[64673,49336],[-114,-251],[21,-218],[77,-249],[140,-225]],[[83924,38347],[207,90],[114,132],[-2,-227],[267,151],[29,-228]],[[84539,38265],[66,266],[193,171]],[[84798,38702],[-87,337],[54,91],[-78,635],[-20,313],[-94,433]],[[83857,40737],[45,-408],[-105,-882],[33,-61],[65,-700]],[[55862,45517],[-382,4]],[[55097,45523],[-1,-1341]],[[59396,69243],[1,-1345],[19,0],[0,-508]],[[59416,67390],[153,-8]],[[59569,67382],[97,185],[63,240],[132,55],[75,107],[72,-63],[68,145]],[[60076,68051],[0,1248]],[[60076,69299],[-194,1],[1,57],[-268,-3]],[[59615,69354],[-219,0],[0,-111]],[[59352,65913],[3,337],[-38,153],[109,17],[-21,301],[47,310],[105,239],[12,112]],[[59416,67390],[-131,59],[-165,-57],[-58,-87],[-187,-84],[-136,-3]],[[87228,49461],[49,-57]],[[87277,49404],[20,-23]],[[87297,49381],[44,-44]],[[87341,49337],[100,156],[-107,137]],[[87334,49630],[-103,-30],[-3,-139]],[[63395,46107],[256,324],[121,214],[12,104]],[[63784,46749],[-790,59],[6,341],[-129,8]],[[62616,47168],[-69,-675]],[[62547,46493],[-52,-506],[422,-606],[43,-3]],[[64801,47513],[-219,25],[6,293]],[[64588,47831],[-306,-140]],[[64282,47691],[-143,50],[-66,-128],[-73,-473]],[[64000,47140],[42,-240],[63,-62],[87,60],[298,-27],[-8,-195],[192,-22],[-7,-126],[94,-24]],[[83182,64735],[76,-296],[157,-49],[-29,-196],[218,-132],[26,-77],[457,-690]],[[84290,63475],[-47,274],[-126,235],[56,165],[-148,920]],[[84025,65069],[-85,96],[14,114],[-129,55]],[[83825,65334],[-237,119],[-166,-134],[-38,-175],[-102,-104]],[[83282,65040],[-100,-305]],[[78459,54466],[22,286],[-142,283],[45,82]],[[78353,55208],[-184,225],[-46,-14],[-121,191],[-40,-14],[-129,284],[-99,130]],[[77734,56010],[-174,-361],[-78,220],[-68,33]],[[68005,59551],[61,-144],[700,-67]],[[68766,59340],[18,802],[-79,321],[22,406]],[[68727,60869],[-214,46]],[[84126,60996],[55,163],[69,-147],[88,93],[-32,210],[80,142],[55,-35],[0,166],[83,177]],[[83857,62817],[-183,-241],[69,-160],[-74,-320],[-87,-138],[-19,-151],[-104,195],[-96,-129]],[[83363,61873],[-1,-8]],[[88563,37508],[242,-503]],[[88805,37005],[248,45],[77,198],[120,53],[27,135],[55,-57],[113,82]],[[89445,37461],[-118,330],[33,21],[-125,208],[-90,309],[23,137]],[[89168,38466],[-105,103],[-90,179],[-72,272]],[[88901,39020],[-578,213]],[[84571,61779],[204,-1325]],[[84775,60454],[809,1013]],[[85584,61467],[-84,205]],[[85500,61672],[-96,-104],[-61,144],[-169,-2],[-137,-74],[-187,98],[-99,254]],[[82086,34764],[127,-39],[-19,-188],[318,-76],[36,377]],[[81820,35687],[-8,-6]],[[66099,20334],[108,87],[14,-111],[150,-29],[151,144],[51,-69],[138,136],[74,-56],[209,129]],[[66550,21390],[-390,51],[-42,-988],[-19,-119]],[[81937,33878],[908,-273]],[[81126,75521],[96,-25],[17,-255],[245,45]],[[81484,75286],[59,17],[5,246],[48,48],[-28,194],[44,-2],[10,343]],[[81622,76132],[-92,-3],[-29,197],[-98,-7],[-5,510],[114,328],[6,326],[-25,457]],[[81493,77940],[-228,71],[-97,-230],[-3,-234],[-85,-210],[32,-99]],[[81112,77238],[54,-849],[-56,-12],[-461,98],[-60,-831],[537,-123]],[[37079,54189],[35,430],[-40,281],[-17,633],[17,711],[-64,418],[-146,87],[-43,104],[342,319],[185,538],[346,399]],[[37694,58109],[-76,138],[-112,-42],[-55,73],[-100,-99]],[[37351,58179],[9,-87],[-632,-110],[13,277],[-341,-63]],[[36400,58196],[4,-137]],[[36404,58059],[11,-134],[-1137,-208],[56,-834],[-744,-141],[-566,-138]],[[34024,56604],[86,-1225],[84,-986],[40,-114],[274,-223],[22,-217],[66,-149]],[[58420,74206],[172,-5],[168,-229],[21,-150],[104,-188],[146,87],[89,-9],[101,180],[1,123]],[[59729,75165],[-160,79],[3,263]],[[59572,75507],[-828,39]],[[58744,75546],[-59,-186],[-130,-123],[-69,-210]],[[85283,53972],[54,547],[103,51]],[[85440,54570],[39,173],[77,24],[-11,200],[-59,186],[-82,-10],[-20,244],[-135,38]],[[85249,55425],[-192,79]],[[31439,56872],[909,210],[1612,362]],[[33960,57444],[564,124],[-150,2220],[-36,433]],[[31117,60856],[322,-3984]],[[86520,39875],[363,-124]],[[86883,39751],[354,-127]],[[87237,39624],[-33,878],[-25,180],[67,399]],[[87246,41081],[-153,-1],[-88,83],[-136,-27],[-105,97]],[[86764,41233],[34,-576],[-182,-245],[-163,-58],[79,-399],[-12,-80]],[[89327,39227],[17,88]],[[89344,39315],[-17,-88]],[[89168,38466],[161,-44],[155,66]],[[89484,38488],[9,27]],[[89493,38515],[-65,137],[-46,332]],[[89382,38984],[-112,180],[-15,218],[98,102],[-10,332],[190,377]],[[89533,40193],[-93,260],[-128,119],[-161,35]],[[89151,40607],[-50,-301]],[[89101,40306],[-170,-1045],[-30,-241]],[[44477,43614],[1085,115]],[[45562,43729],[-61,1671]],[[44418,45289],[1,-23]],[[80255,72033],[230,81],[39,-55],[133,80]],[[80657,72139],[158,14],[200,230]],[[81015,72383],[-140,244],[99,1147]],[[80974,73774],[-42,11],[-154,-192]],[[80778,73593],[-32,-86],[-225,-199],[-205,-108],[-100,-165],[-48,10]],[[72690,70572],[683,-127]],[[73373,70445],[237,-41],[-41,304],[52,107],[40,591]],[[73661,71406],[-5,176],[-149,5],[-84,144]],[[72700,71898],[-70,-1137]],[[32026,49693],[383,90],[11,-54],[970,224],[60,300],[392,-54],[200,359]],[[34042,50558],[-36,199],[-174,63],[-19,218]],[[52912,9721],[1223,21]],[[54157,11464],[-1159,-15]],[[52998,11449],[84,-333],[16,-208],[-55,-153],[-56,-475],[-91,-438],[16,-121]],[[57681,78692],[623,-272]],[[58475,78280],[243,-100]],[[58718,78180],[97,805],[-33,2701]],[[58441,80613],[-43,-188],[70,-296],[-74,-137],[-65,9],[-44,-384],[-60,-25],[-53,-507],[-78,-135],[-5,-186],[-79,-105],[-246,59],[-83,-26]],[[85345,63572],[66,179],[96,103],[98,-71]],[[85605,63783],[112,129],[104,329],[179,-57]],[[86000,64184],[-115,382],[-73,434],[-10,489],[18,309],[-88,217],[-76,81]],[[85331,65791],[-57,-47],[-400,-174]],[[84874,65570],[-13,-121],[65,-157],[53,-295],[234,-590],[-24,-69],[24,-370],[132,-396]],[[55015,41162],[-22,-316],[56,-139]],[[55767,40703],[2,667],[25,1],[-4,569]],[[55790,41940],[-659,-13]],[[64041,43772],[128,-139],[6,-154],[116,-259]],[[64903,43217],[30,795]],[[64933,44012],[4,112]],[[64937,44124],[-1000,88]],[[63937,44212],[73,-186],[31,-254]],[[91566,21208],[30,117],[553,121],[434,78]],[[92583,21524],[-115,320],[15,400]],[[92483,22244],[-63,131],[5,248],[44,119],[15,443],[55,173],[-16,324]],[[91905,23858],[-24,-163],[-77,27]],[[91804,23722],[-22,-174],[45,-151],[118,53],[-11,-448],[-115,-56],[-23,-372],[25,6],[37,-393],[-204,-48],[10,-350],[-22,-68],[-138,-4],[-12,-68],[-114,173]],[[91378,21822],[-17,-183],[104,-155],[40,146],[61,-422]],[[45867,13636],[1359,129]],[[47809,13820],[-19,658],[-132,-12],[-39,1315]],[[47619,15781],[-116,-11],[-19,647],[-329,-26]],[[46723,15939],[-131,-116],[-16,-291],[-57,-136],[-48,-290],[110,-180],[-80,-139],[-329,95],[-98,-48],[-167,142],[-117,-46],[-103,-135],[-102,-20],[-5,-124],[-190,7],[-66,-42]],[[45324,14616],[-83,-199],[18,-389],[-38,-102],[48,-106],[-108,-85],[-82,155]],[[45079,13890],[13,-340],[775,86]],[[87282,55882],[29,-2],[157,-323]],[[67174,53803],[31,-132],[347,-50]],[[67552,53621],[418,632],[16,352]],[[67986,54605],[-131,-24]],[[67855,54581],[-125,-147],[-183,-65],[-137,-155],[-221,-119]],[[67189,54095],[-15,-292]],[[89237,45112],[-16,112]],[[89221,45224],[-69,50],[-33,-297],[63,-66],[55,201]],[[89042,43507],[54,-99],[39,-337]],[[89555,43069],[46,278]],[[89428,44235],[-82,81],[-48,386],[-93,-197],[63,-102],[-88,-166],[-48,296],[50,76],[-10,156],[-58,-21],[-93,113],[-56,-22],[-146,-251],[-261,-586],[118,-87],[-75,-232],[-1,-159],[64,-98],[51,68],[61,-111],[22,113],[244,15]],[[23254,7628],[602,230],[7,-52],[190,71],[-50,375],[260,95]],[[22959,9893],[295,-2265]],[[93381,29855],[79,172],[179,-87],[83,354],[-200,135],[100,111],[129,362]],[[93751,30902],[-63,100],[-115,-18],[-126,147]],[[93447,31131],[-165,-225],[-27,-211],[-95,-166],[-141,120],[-95,-578]],[[92924,30071],[35,-209],[325,-216],[97,209]],[[71151,35930],[447,-75]],[[71904,37046],[-671,127]],[[71223,37007],[-72,-1077]],[[44289,48960],[12,-317]],[[44240,50319],[0,-24]],[[44240,50295],[49,-1335]],[[63962,44354],[-25,-142]],[[64937,44124],[38,594],[127,603],[1,141]],[[64715,45510],[-252,27]],[[75745,53679],[95,-148],[132,16],[48,-241],[84,-90]],[[76104,53216],[106,86],[68,-56],[257,246],[91,-6]],[[76626,53486],[30,192],[-164,232],[-46,142],[-120,104],[-25,210],[-103,260]],[[58062,40667],[768,-36]],[[58848,41857],[-366,25]],[[58482,41882],[-406,30]],[[77298,49237],[58,-181],[140,-278],[-82,-223]],[[77414,48555],[118,-87],[86,-229]],[[77618,48239],[101,0],[56,-109],[145,-51],[23,68]],[[77943,48147],[13,292],[-56,37],[58,161],[133,162],[81,252],[95,40],[-43,164]],[[78224,49255],[-147,2],[-31,300]],[[77369,49388],[-71,-151]],[[81759,43250],[239,-91],[197,-260]],[[82195,42899],[96,179],[75,41]],[[82007,44333],[45,-122],[-29,-235],[-123,33],[-86,-170],[-110,-67]],[[81704,43772],[-17,-222],[72,-300]],[[91462,26996],[14,-940]],[[91476,26056],[386,-143]],[[92037,26572],[19,56],[18,627],[-91,2],[37,222],[109,19]],[[92129,27498],[26,237],[9,418],[-60,7],[87,393]],[[92191,28553],[-700,253]],[[91491,28806],[-16,7]],[[91475,28813],[-37,-130],[24,-1687]],[[61420,47562],[819,-41]],[[62253,48894],[-137,-3],[-56,89],[-200,120],[-109,242],[-110,109]],[[61641,49451],[-96,61],[-182,-83],[-94,-231]],[[61269,49198],[1,-275],[131,-395],[-51,-193],[34,-772],[36,-1]],[[54025,23926],[266,86],[283,270]],[[54574,24282],[105,94]],[[54679,24376],[89,209],[246,423],[32,144],[107,50]],[[55153,25202],[-1,171],[-174,-1],[-2,331],[-954,-3]],[[54022,25700],[1,-659]],[[54023,25041],[2,-1115]],[[86405,47745],[157,39],[140,-45]],[[86721,48290],[-201,-118],[-102,44],[-30,-89],[-139,-109],[-80,7],[7,207],[-213,-59]],[[85775,47877],[100,-647]],[[31213,28635],[20,-214],[375,100],[29,-330],[458,119],[38,-328]],[[32133,27982],[474,125],[-31,370],[95,23],[18,222],[-47,163],[35,389],[119,354],[-10,273],[80,28],[146,312],[46,-14],[50,330],[105,251],[164,304],[-17,164],[100,26],[-75,992],[42,9],[-53,648]],[[33374,32951],[-812,-197],[-828,-233]],[[28296,32645],[979,274]],[[29275,32919],[38,213],[-60,115],[-31,230],[64,157],[5,548],[33,79],[-60,142],[-54,324],[-67,88],[-83,292]],[[29060,35107],[-307,-63],[-65,143],[-224,-153],[-18,-114]],[[28446,34920],[-38,-144],[68,-35],[-81,-331],[-65,55],[-12,-505],[-41,-159],[107,-338],[-45,-288],[-89,-273],[-44,-280]],[[25191,4391],[1222,445],[700,237]],[[24827,7293],[133,-1058]],[[80500,80244],[127,-172],[-1,-188],[86,-120]],[[80712,79764],[219,15]],[[80931,79779],[49,126],[123,3],[133,105],[156,-58],[114,18],[63,189],[60,12],[64,207]],[[81693,80381],[80,935]],[[81773,81316],[9,118],[-258,138],[-54,-230],[-377,90]],[[81093,81432],[-287,89],[-20,-217],[-189,54],[-9,-111]],[[80588,81247],[-88,-1003]],[[74897,50392],[37,-101],[82,32],[-35,-160],[75,22]],[[75056,50185],[109,-121],[23,152],[132,-37],[192,60]],[[75512,50239],[-60,169],[86,28],[-21,261],[32,254],[-58,112],[85,278]],[[75135,51541],[-226,-544],[-146,-274]],[[51152,85015],[414,-1031]],[[51566,83984],[68,75],[548,-574]],[[52182,83485],[360,548],[-24,58]],[[52321,85018],[-737,1031]],[[51584,86049],[-221,-435]],[[49429,33227],[171,-135],[327,-182],[105,200],[79,-4],[209,172],[87,-17],[117,118],[196,61],[77,-33],[180,63]],[[50977,33470],[-18,1247],[9,1]],[[49430,35985],[-20,-2]],[[49410,35983],[28,-1332],[-18,-2],[25,-1337],[-16,-85]],[[86417,55250],[32,160],[118,136]],[[86567,55546],[69,112],[104,333],[113,32]],[[86549,57290],[-173,185],[-146,12],[-104,-174]],[[86126,57313],[7,-75],[-298,-539],[-94,-60]],[[85741,56639],[341,-825],[335,-564]],[[62938,38681],[1062,-76]],[[64025,39618],[-578,37]],[[63447,39655],[-273,20]],[[63173,39665],[-77,-313],[-88,-32],[-129,-279],[59,-360]],[[61061,30484],[563,-42]],[[61624,30442],[193,-14]],[[61817,30428],[52,1606]],[[61097,32088],[-12,-500]],[[67218,61037],[-186,17],[3,138]],[[67035,61192],[-524,40]],[[66511,61232],[-14,-553],[-64,-124]],[[66433,60555],[56,-63],[-7,-338],[60,-257],[-25,-68],[59,-227],[83,10]],[[82737,41088],[141,-44]],[[82878,41044],[778,-244]],[[83520,41816],[-100,289],[-162,253],[-23,116]],[[83235,42474],[-169,299],[-70,211],[-75,66]],[[82921,43050],[-184,-1962]],[[82256,41232],[481,-144]],[[82921,43050],[4,43]],[[82195,42899],[-51,-518]],[[82144,42381],[-26,-173],[132,-594],[6,-382]],[[65543,16515],[56,-268],[181,-234],[152,-286],[122,-94],[87,-164]],[[66141,15469],[324,-45],[16,327],[108,-16]],[[66589,15735],[-19,247],[-149,276],[-13,192],[-113,322]],[[66035,18789],[-480,64]],[[65555,18853],[-40,-990],[192,-22],[-14,-325],[-105,14],[-45,-1015]],[[65708,60801],[60,-174],[195,-288],[168,54],[73,-89],[78,124],[151,127]],[[66511,61232],[-120,7],[-162,131]],[[65431,61426],[-79,-98],[-29,139],[-80,-25],[63,-205]],[[73666,31508],[332,-74]],[[73998,31434],[71,671],[56,667]],[[73378,32939],[-98,-1328]],[[52711,53906],[-3,1839]],[[52708,55745],[-556,-11]],[[52152,55734],[-601,-18]],[[51551,55716],[8,-1496]],[[51559,54220],[3,-339]],[[76690,46998],[212,-76],[37,-190],[106,-157]],[[77045,46575],[42,77],[-69,215],[16,141],[-136,387]],[[76898,47395],[-98,324],[37,331],[-184,120]],[[76653,48170],[-145,-267],[-66,72]],[[76442,47975],[-28,-60],[-208,-79],[-51,-264],[-80,-73]],[[76075,47499],[5,-336],[-44,-90]],[[76036,47073],[38,-192],[156,-108],[99,85],[179,25],[143,208],[39,-93]],[[58932,83793],[1,44],[-317,3],[-256,140],[-424,339]],[[57753,83072],[-14,-855]],[[54000,37692],[535,5]],[[54535,37697],[44,117],[-35,120],[58,182],[-25,105],[71,147],[43,-124],[52,132]],[[54842,38822],[-653,-9]],[[54189,38813],[1,-168],[-64,-1],[-96,-168],[-30,-169],[0,-615]],[[15557,11917],[679,324],[742,341],[1065,477]],[[18043,13059],[-118,756]],[[17925,13815],[-211,0]],[[16684,13651],[-66,55],[-276,49],[-109,70]],[[16233,13825],[-33,-76],[-218,-66],[-93,108],[-81,-24],[-10,-262],[-164,-210],[-160,-44]],[[15474,13251],[-108,-160]],[[15366,13091],[5,-177],[-100,-96],[151,-965],[135,64]],[[62066,46452],[-16,-1003],[-12,-225]],[[62547,46493],[-480,16],[-1,-57]],[[39545,33547],[-58,1315],[-102,1655]],[[39385,36517],[-76,1247],[-67,1278]],[[39242,39042],[-746,-123],[-774,-142]],[[37505,38731],[94,-1518],[421,78],[30,-578],[124,-2072],[85,-1326]],[[84485,47114],[86,-159],[-31,-168],[33,-325]],[[84573,46462],[139,-256],[-20,-61]],[[85234,46341],[294,113]],[[85414,46980],[-230,897]],[[85184,47877],[0,138],[-194,85],[-42,102]],[[84948,48202],[-75,6],[-12,-170],[-376,-924]],[[58581,47167],[100,-15],[83,-152],[158,107],[116,-23],[21,-269]],[[59059,46815],[-12,1352]],[[59046,48222],[-581,-12],[-2,113],[-479,-16]],[[57984,48307],[6,-873]],[[61343,50549],[298,-8],[659,-48]],[[62300,50493],[14,520],[25,-2]],[[61342,50382],[-1,-137],[132,-129],[-96,-231],[214,-27],[57,-133],[-7,-274]],[[62265,48891],[35,1602]],[[58512,29293],[-192,9]],[[58320,29302],[-19,-1335]],[[42735,10258],[1729,235]],[[44464,10493],[-14,328]],[[44450,10821],[-28,656],[87,9],[-41,941]],[[44468,12427],[-214,-81],[-145,3],[-55,-60],[-144,24],[-83,150],[24,115],[-227,116],[-71,-51],[-115,99],[-113,-213],[56,-106],[-184,-157],[-105,96],[44,112],[-62,85],[-52,-78],[-36,243],[-80,-91],[-27,157],[-79,53],[-66,-122],[-63,60],[-51,-116]],[[42690,11180],[45,-922]],[[85171,49447],[171,214],[76,-64]],[[85804,49362],[37,270]],[[85841,49632],[60,673]],[[85901,50305],[-55,83],[-147,37],[-136,148]],[[85563,50573],[-67,-1],[-142,-211],[-59,57],[-128,-170],[-86,-10],[0,-177]],[[88708,40456],[202,-13],[94,-116],[97,-21]],[[89151,40607],[31,189]],[[89182,40796],[-146,8],[-160,135],[-78,-2],[-103,179],[38,174],[-91,252],[-63,75]],[[88579,41617],[-72,59],[26,289],[-66,-51],[-13,-241],[-101,-179],[45,-474],[49,-295],[82,-187],[151,-15],[28,-67]],[[63341,43046],[-7,-352]],[[64041,43772],[-158,40],[6,-85],[-135,-178],[-36,-193],[-369,32]],[[63349,43388],[-8,-342]],[[86334,41905],[429,-670]],[[86763,41235],[-25,59],[127,241],[108,19],[124,144],[118,245],[119,-29]],[[87334,41914],[-118,692]],[[87216,42606],[-78,-91],[-106,278]],[[87032,42793],[-58,-98],[-184,-22],[-6,-133],[-158,-94]],[[68517,61061],[37,1486]],[[68554,62547],[-735,100]],[[67819,62647],[-34,-972]],[[59353,71005],[56,-2]],[[59409,71003],[469,-20]],[[59878,70983],[22,1160],[95,-7],[24,506]],[[59666,73331],[-128,5],[-15,-336],[-13,-1011],[-55,-82],[34,-150],[-56,-404],[-95,-181],[15,-167]],[[87446,60749],[64,-41],[36,-192],[69,60],[178,-167],[35,111],[157,204],[49,-34]],[[88034,60690],[-155,580],[-48,387],[-47,561]],[[87784,62218],[-44,-495],[-81,-345],[-40,-304],[-134,-185],[-39,-140]],[[66902,18671],[31,659]],[[66099,20334],[-201,-3],[-196,-174]],[[65702,20157],[-94,-78]],[[65570,19185],[-15,-332]],[[67986,54605],[54,-30],[47,-301],[-50,-201],[-134,-294],[51,-405],[101,-156]],[[68055,53218],[102,59]],[[68157,53277],[73,17],[54,234],[142,222],[50,201],[-36,146],[54,130]],[[68494,54227],[-54,262],[54,309],[-52,77]],[[68442,54875],[-131,-240],[-104,-46],[-200,189]],[[68007,54778],[-79,-39],[-73,-158]],[[10718,41346],[8,-99],[100,-81],[37,-150],[118,-183],[213,201],[139,-31],[163,64],[208,-81],[64,26]],[[11777,41316],[29,605]],[[10533,43712],[-29,-190],[-78,-105],[164,-1019]],[[10590,42398],[58,-106],[-70,-77],[81,-248],[-12,-212],[62,-103],[-34,-92],[43,-214]],[[67180,54092],[9,3]],[[68007,54778],[13,309]],[[67439,55146],[-7,-27]],[[67432,55119],[-252,-1027]],[[81893,68590],[124,-125],[118,-307],[-46,-194],[66,-74],[-10,-128],[255,-405]],[[82400,67357],[115,174],[105,257],[183,214],[142,400],[40,50]],[[82197,69242],[-90,5],[-124,-100]],[[81983,69147],[-66,-115],[38,-88],[-79,-183],[17,-171]],[[53237,37455],[-6,1103]],[[53231,38558],[-183,161],[-272,137],[-125,-31]],[[52651,38825],[13,-1382]],[[30202,18409],[154,53],[82,-122]],[[31911,17358],[-84,766],[-65,765],[-76,736],[-97,-26],[-24,248],[-95,-26],[-58,656],[-187,-51],[-134,1320]],[[30957,23008],[-58,730]],[[30899,23738],[-109,-106],[-18,-168],[-112,-206],[17,-160],[-119,-426],[-74,-125]],[[30484,22547],[222,-2261],[36,10],[102,-1100],[-285,-81],[-153,-435],[-96,-27],[11,-109],[-119,-135]],[[69149,59192],[94,-4],[110,118],[54,-136],[182,-34]],[[69589,59136],[-14,679],[164,186]],[[69658,60501],[-155,17],[-327,169],[-29,121]],[[69147,60808],[-66,-72],[109,-285],[-131,-398],[22,-240],[-38,-127],[72,-182],[24,-213]],[[22097,26225],[457,163],[229,-1794]],[[24458,24142],[-64,118],[-70,278],[38,131],[-61,146],[-20,205],[-84,27],[-187,1528]],[[23959,27680],[-64,540]],[[23895,28220],[-666,-232],[95,-607],[-257,-117],[-21,-78],[-244,-21],[-17,-139],[-115,-51],[-100,-142],[-144,152],[-46,-157],[-139,-161],[17,-76],[-89,-91],[15,-168],[-87,-107]],[[43647,34108],[39,5],[-17,317],[-27,1018],[66,7],[-7,338]],[[43701,35793],[-271,-17],[-824,-114]],[[42606,35662],[-63,-11]],[[42543,35651],[16,-334],[-70,-10],[60,-1330]],[[94892,27590],[27,-13],[388,-616]],[[95960,28522],[-107,86],[-3,418],[-129,140],[-129,49]],[[95368,28609],[-67,-111]],[[95301,28498],[-83,-129],[-104,-47]],[[95114,28322],[-74,-154],[-30,-286],[-65,50],[-53,-342]],[[69036,49240],[-97,214],[-67,349],[-51,-102],[-41,142],[-34,-111],[-50,245],[-51,-69]],[[68645,49908],[-5,-10]],[[68640,49898],[62,-129],[-64,-414],[45,-223],[-39,-437]],[[76819,53677],[144,-12],[7,-122],[230,-239],[121,-231]],[[77321,53073],[111,52]],[[77432,53125],[-41,183],[357,-313],[135,128]],[[77883,53123],[34,166],[-24,149]],[[77893,53438],[-151,173],[-178,54],[-82,303],[4,149],[-102,38],[-189,153],[-192,215],[-65,25]],[[76938,54548],[-7,-125],[-83,-121],[11,-198],[-52,-81],[40,-172],[-28,-174]],[[70301,59723],[175,-282],[8,-489]],[[70484,58952],[332,158],[473,269]],[[71289,59379],[-51,48],[-3,444],[-76,354],[-125,185],[-3,134]],[[70586,60553],[-160,-19]],[[59084,81063],[489,-22],[-6,-337],[196,-7],[4,335],[489,-26]],[[60256,81006],[1,88],[193,-8],[9,455],[65,-4],[8,397],[199,-8],[-25,168],[42,110],[-210,15],[2,168]],[[59159,81665],[-4,-141],[-117,-195],[46,-266]],[[84135,55862],[539,-167],[-35,-117]],[[85249,55425],[4,97],[-57,931],[153,56]],[[85349,56509],[-73,265]],[[85276,56774],[-157,-142],[-20,-95],[-130,-86],[-49,53],[-67,256],[-84,-16],[-166,251]],[[84603,56995],[-365,121]],[[48038,87680],[26,1]],[[48033,89343],[-1422,-70]],[[46611,89273],[43,-1716]],[[77529,50316],[3,149],[85,124],[53,501],[-44,98]],[[77581,51134],[-135,-148],[-150,-288],[-71,116],[-74,-120],[-142,-75]],[[77009,50619],[-37,-159]],[[76972,50460],[24,-128],[-56,-85],[94,-216],[150,-210],[-37,-110],[227,84]],[[28477,37138],[-233,86],[-125,-37],[-18,-128],[35,-257],[-82,-21],[-259,217],[-215,238]],[[27580,37236],[-266,-1283]],[[27314,35953],[535,-139],[354,105],[184,106]],[[26272,45692],[671,192],[105,70],[505,145]],[[27553,46099],[-170,254],[-93,1045]],[[27290,47398],[-376,-87],[-655,-211]],[[26259,47100],[106,-188],[151,-452],[-93,-270],[-165,-383],[14,-115]],[[78224,49255],[54,163],[102,46],[5,106]],[[78385,49570],[162,227],[27,170]],[[78574,49967],[-129,143],[28,153],[-89,32],[-120,-70],[-71,54]],[[78193,50279],[-145,-103]],[[61589,29114],[716,-58]],[[62305,29056],[72,272],[-16,190]],[[62450,30375],[-633,53]],[[61624,30442],[-35,-1328]],[[13548,11714],[109,-14],[1,-189],[88,-61],[42,74],[306,-87],[140,176],[62,13],[33,-162],[114,-141],[37,41]],[[14480,11364],[-149,859],[-163,998]],[[14168,13221],[-125,-62],[-56,-138],[-141,-78],[-276,-294],[-109,-209],[46,-261]],[[67558,29628],[395,-60]],[[67953,29568],[12,192],[-97,396],[-48,559],[43,219]],[[67863,30934],[-276,40]],[[67587,30974],[-32,-671],[36,-5],[-33,-670]],[[29225,16311],[-2,-152],[123,-106],[63,69],[98,-193],[82,29],[74,-117]],[[30202,18409],[-153,-167],[-15,-109],[-144,-48],[-134,28],[-73,248],[-92,64]],[[29591,18425],[-103,-177],[-207,-257],[35,-189],[-29,-211],[22,-356],[-40,-33],[30,-199],[-65,-188],[41,-173],[-112,-13]],[[29163,16629],[-9,-227],[71,-91]],[[76747,57028],[30,-24],[254,248],[103,139],[101,-63],[199,100]],[[77592,58169],[-63,164],[-69,-14],[-49,115],[-133,135],[-58,183],[-318,67]],[[76902,58819],[-35,-464],[-81,-64],[-210,-636]],[[76576,57655],[204,-335],[-33,-292]],[[20567,33974],[701,262],[-158,1257],[4,2128],[275,98]],[[21389,37719],[-54,477],[-7,581],[-69,330],[-54,121],[-36,540],[-144,405],[-70,30],[-138,1118]],[[20817,41321],[-1165,-429]],[[19652,40892],[128,-884],[317,-2554],[129,-924],[299,-2359],[42,-197]],[[60853,71924],[289,25],[100,101],[5,192],[194,-10],[7,336]],[[61448,72568],[7,335]],[[61455,72903],[-388,21],[5,167],[-292,15]],[[60576,72611],[32,-140],[-16,-218],[73,-144],[-4,-171],[192,-14]],[[60835,70945],[1221,-55]],[[62056,70890],[-27,167],[23,384],[54,267],[-16,277]],[[62090,71985],[-44,139],[-331,433],[-267,11]],[[60853,71924],[-18,-979]],[[93636,21096],[535,511],[167,52]],[[94338,21659],[-30,109],[142,571],[-79,315]],[[94371,22654],[-586,-400],[-70,101],[-91,-185],[-66,-5],[-114,-198]],[[93444,21967],[-22,-96],[108,-172],[-32,-237],[190,-139],[-52,-227]],[[62166,69380],[57,74],[-47,145],[23,149],[-118,100],[-81,207],[-51,14],[-35,235]],[[61914,70304],[-161,-168],[-10,-170],[-188,-23],[-48,-136]],[[61507,69807],[-54,-57],[3,-246],[58,-142],[47,-340],[-41,-440],[-12,-349]],[[45761,41061],[164,17]],[[45925,41078],[789,62]],[[46714,41140],[-39,1350]],[[45754,42403],[-32,-3]],[[86570,36246],[97,-322],[-25,-377],[48,-302]],[[86690,35245],[-98,-87],[-76,-193],[-6,-404],[-93,-232]],[[86417,34329],[16,-80],[143,-119],[93,-19]],[[86669,34111],[33,303],[-29,583],[206,-156],[184,50],[34,205],[40,-10]],[[87137,35086],[70,202],[146,-87],[76,202]],[[87429,35403],[-476,611],[1,20]],[[86954,36034],[-77,46],[-256,285],[-62,-75]],[[86559,36290],[11,-44]],[[88623,42560],[47,-130],[100,-47],[-11,-242],[254,11]],[[89042,43507],[-120,-163],[-110,-8],[-106,-95],[-124,-214],[-16,97],[-83,-35],[12,194],[-46,-11],[-18,-335],[70,-336],[141,96],[-19,-137]],[[55728,31644],[768,-11]],[[56496,31633],[8,1327]],[[56504,32960],[-771,11]],[[75130,60473],[58,-116],[272,-50],[32,-81]],[[75492,60226],[263,146],[30,108],[93,-29]],[[75878,60451],[7,847]],[[75067,61469],[48,-373],[-23,-13],[63,-348],[-25,-262]],[[53746,45853],[583,4]],[[54329,45857],[346,2]],[[54676,47208],[-6,347]],[[54670,47555],[-77,-259],[-159,19],[-94,-89],[-66,125],[-61,-70],[-43,146],[-101,-53]],[[54069,47374],[-121,-67],[-1,83],[-161,-42],[-13,-241],[-131,-198],[-12,-131],[-136,-300],[35,-223],[67,-53],[40,-168],[110,-181]],[[87887,41284],[-105,-41],[113,174]],[[87895,41417],[-81,28],[-75,-93]],[[87739,41352],[-173,-98],[-44,-355],[305,-108],[60,493]],[[95223,17589],[151,-185]],[[95374,17404],[107,361],[-42,69],[133,227],[54,342],[141,34],[16,215]],[[95829,19224],[-89,312],[-153,-103],[-228,-231],[-45,224],[-207,-84]],[[95107,19342],[-25,-101],[144,-666],[15,2],[-1,-614],[-60,-281],[43,-93]],[[69064,46357],[104,-251],[-58,-150]],[[69110,45956],[621,-95]],[[69731,45861],[17,335]],[[69311,47288],[17,-184],[-120,-115],[-4,-265],[-135,-255],[-5,-112]],[[67067,64672],[-13,-337]],[[67054,64335],[-2,-55],[286,-38]],[[67980,64167],[14,337]],[[67994,64504],[-95,66],[17,389],[-59,120]],[[67857,65079],[-189,23],[-3,-55],[-580,72]],[[67085,65119],[-18,-447]],[[56488,30691],[-763,12]],[[27609,38427],[90,136],[133,-62],[74,219],[186,-171],[80,10],[143,-171],[129,29],[168,-131]],[[28612,38286],[32,126],[-34,227],[-90,119],[79,348],[123,51],[56,174],[-21,118],[218,74],[63,190],[-22,74],[60,230],[-8,165],[-72,251],[70,50],[169,453],[-15,164],[320,89]],[[29540,41189],[57,15],[-30,330]],[[29567,41534],[-655,-178]],[[28912,41356],[-662,-185]],[[28250,41171],[-210,-52],[68,-189],[-115,-360],[-22,84],[-139,77],[-134,303],[-142,78],[-69,-40],[59,-170],[-13,-142],[57,-94],[-70,-159],[6,-175],[-102,-178]],[[27424,40154],[12,-184],[73,-165],[-21,-190],[57,-57],[-37,-242],[8,-363],[39,-29],[-17,-472],[71,-25]],[[80948,49043],[221,-255]],[[81466,49242],[11,64],[-169,800],[-71,386]],[[81237,50492],[-2,-5]],[[80771,49992],[31,-216],[179,-337],[129,93],[-97,-206],[41,-107],[-106,-176]],[[28912,41356],[-39,414]],[[28873,41770],[-86,903],[-90,-25],[-154,1657]],[[28543,44305],[-940,-268],[11,-47],[-279,-80]],[[27335,43910],[99,-1024]],[[27434,42886],[9,-85],[97,28],[77,-152],[296,80],[28,-294],[58,15],[80,-893],[240,-110],[16,-168],[-85,-136]],[[66183,29464],[779,-94],[17,335]],[[66979,29705],[29,664],[-27,3],[32,672]],[[66822,31065],[-764,93]],[[66058,31158],[-15,-334]],[[66043,30824],[-7,-333],[-47,-1001]],[[52810,23798],[344,10],[23,-114],[821,12]],[[53998,23706],[27,220]],[[54023,25041],[-679,-5]],[[52806,24356],[4,-558]],[[84798,38702],[105,88],[269,37],[120,120]],[[85292,38947],[-67,250],[-63,715],[-117,448]],[[59846,25338],[622,-40],[378,-8]],[[60846,25290],[17,664]],[[60863,25954],[14,554],[-288,14]],[[60589,26522],[-51,-59],[-322,-24],[-34,-131],[-267,-406]],[[59915,25902],[-114,-116]],[[59801,25786],[45,-448]],[[32550,12813],[640,167]],[[33190,12980],[-18,218],[128,32],[-28,328],[192,48],[-14,163],[193,48],[-13,164],[174,42],[-91,1091],[-61,41],[-83,285],[105,109],[-11,330]],[[32327,15036],[30,-44],[75,-976],[-190,-54],[54,-516],[-27,-64],[69,-404],[193,51],[19,-216]],[[81993,59474],[145,252]],[[82138,59726],[128,222],[14,449],[424,-109]],[[83054,60981],[-236,280],[62,202],[-153,59],[-73,103],[-69,-124],[-79,160],[-28,-226],[-215,380]],[[82263,61815],[-46,-100],[18,-226]],[[86558,46667],[354,-1126]],[[86912,45541],[75,-20]],[[87388,45758],[-61,298],[168,202],[54,174]],[[87549,46432],[-138,19],[-47,104],[27,219]],[[87156,47258],[-85,75],[-134,-416],[-61,65],[-120,-88],[-71,-142],[-53,32],[-74,-117]],[[40221,32972],[386,59]],[[40607,33031],[-192,3666]],[[40415,36697],[-1030,-180]],[[59447,25250],[56,-18],[-17,-876],[-56,2]],[[59430,24358],[-11,-661]],[[59419,23697],[430,-20]],[[59849,23677],[-12,331]],[[59837,24008],[28,386],[-71,113],[46,193],[29,348],[-23,290]],[[59801,25786],[-83,-3],[-119,-122],[-122,44],[-30,-455]],[[66547,55017],[64,71],[27,-137],[-92,-169],[85,12],[117,188],[17,121],[104,-21]],[[66869,55082],[63,139]],[[66932,55221],[-50,381],[-64,162],[99,73]],[[66917,55837],[1,130],[-73,-21],[-51,174],[80,183],[-25,64]],[[66849,56367],[-81,324],[-79,2],[-108,-222]],[[66581,56471],[-93,-263],[-103,-156],[-182,-455]],[[66203,55597],[86,-266],[155,-131],[-4,-113],[107,-70]],[[88896,34710],[148,-126],[139,-184],[77,-274],[140,-213]],[[89400,33913],[156,314],[-83,427],[-60,4],[-14,349],[53,54],[-1,253]],[[89262,35669],[-137,-121],[25,-146],[-114,-189],[-75,100],[-119,-273],[-99,42],[-55,-186]],[[59572,75507],[7,501],[194,-8],[14,676],[192,-10],[12,666]],[[59991,77332],[-293,16],[-94,340],[-177,9],[-27,350]],[[59400,78047],[-91,40]],[[59309,78087],[-43,-362],[-131,-144],[44,-194],[-75,-295],[-94,-115],[43,-138],[-106,-77],[-106,-230]],[[58841,76532],[14,-287],[39,-97],[-53,-228],[14,-108],[-111,-266]],[[72790,53440],[98,-67]],[[72888,53373],[109,202],[189,25]],[[73186,53600],[66,383],[123,185],[-14,64]],[[72879,54698],[-95,-1024],[-44,-103],[50,-131]],[[27993,66948],[-235,2586]],[[24513,68660],[225,-2198],[83,-849],[3,179],[74,66],[101,222],[918,260],[100,-987],[988,273]],[[30075,52658],[-442,5097],[309,78],[-47,552],[-30,-7],[-229,2652],[-13,-4],[-55,669],[-55,328],[6,279],[-119,1381],[-18,-5],[-114,1328],[-59,-16],[-69,800]],[[29140,65790],[-196,-85]],[[19970,66387],[65,-52],[134,60],[171,-33],[6,-131],[139,-165],[38,-233],[-46,-485]],[[22783,64731],[-356,3300]],[[22237,69792],[-2538,-2618],[58,-202],[4,-258],[96,-94],[113,-233]],[[59198,22050],[469,-23]],[[59667,22027],[-43,50],[-22,282]],[[59602,22359],[10,262],[173,17],[198,424],[8,213],[-142,402]],[[59419,23697],[-8,-439]],[[66113,58254],[252,-38],[5,-98]],[[66370,58118],[587,-39]],[[66672,59365],[-125,-239],[-150,14],[-41,80],[-207,40],[-21,79]],[[75170,48295],[133,-370]],[[75303,47925],[188,104],[28,-73]],[[75519,47956],[58,52],[75,228],[73,-24],[81,165],[-20,75]],[[75786,48452],[-193,450]],[[75593,48902],[-91,-65],[-64,-150],[-114,-51],[-102,-287],[-52,-54]],[[57551,29329],[769,-27]],[[58531,30631],[-520,20]],[[58011,30651],[-447,13]],[[76588,52020],[158,-209],[131,129],[73,-178],[103,-98],[83,-194],[35,105],[134,6]],[[77586,52331],[-81,298],[47,230],[-8,176],[-112,90]],[[77321,53073],[1,-317],[-115,-108],[32,-155],[-229,-145],[-68,-257],[-90,-77],[-101,127],[-64,241]],[[76687,52382],[-40,-80]],[[57067,68437],[145,50],[25,87],[110,-40],[123,237],[64,-84]],[[58355,68991],[13,978]],[[58368,69969],[-180,22],[-50,-65],[-135,150],[18,124],[-276,-47],[-68,-108],[-190,13],[-100,127],[-149,-70]],[[57238,70115],[-74,-166],[-103,-61]],[[57061,69888],[-10,-1440],[16,-11]],[[40494,23798],[1540,249]],[[41884,27166],[-510,-80],[-1121,-156]],[[40253,26930],[64,-1343],[57,-988],[13,5],[46,-816]],[[83089,62713],[67,-246],[-8,-261],[121,-69],[-33,-132],[127,-132]],[[84002,62924],[-33,163],[-78,25],[-179,270],[-34,-196],[-108,79],[-50,-152],[-112,-145],[-152,39],[-149,-80],[-18,-214]],[[40607,33031],[982,139]],[[41589,33170],[-116,2339]],[[41473,35509],[-58,1165]],[[41415,36674],[-25,513]],[[41390,37187],[-993,-152],[18,-338]],[[95614,26140],[78,20]],[[95052,26248],[-3,-105]],[[94639,27021],[188,-260],[-9,-188],[47,-19],[-76,-226],[154,-90],[79,106]],[[95321,26087],[31,168],[46,-90]],[[94892,27590],[-19,-125],[-186,90]],[[94687,27555],[-48,-534]],[[72764,51261],[83,123],[81,-3],[27,372],[-47,182],[110,91],[68,-135]],[[73086,51891],[33,14],[85,309]],[[73204,52214],[-61,-56],[-46,121],[-99,-43]],[[72998,52236],[-89,9],[-28,199]],[[72881,52444],[-416,6]],[[29004,24819],[192,58],[33,-328],[190,54],[16,-164],[88,25],[56,-486],[96,27],[31,-319],[274,79],[54,-560]],[[30304,22663],[107,22],[73,-138]],[[30899,23738],[-171,1859]],[[30728,25597],[-240,133],[-73,-84],[-125,78],[-61,-128],[-79,76]],[[30150,25672],[-46,36],[-114,-105],[-108,148],[-220,-63],[5,-55],[-220,-64],[11,-110],[-221,-64]],[[75040,64987],[-68,522],[-131,21],[12,185]],[[74239,65845],[-39,-234]],[[44856,32092],[1,0]],[[47914,32378],[-15,586]],[[46758,35790],[-954,-104]],[[45804,35686],[-952,-114]],[[44852,35572],[-56,-8],[53,-1330],[-47,-6],[49,-1313],[-29,-3],[34,-820]],[[76772,65905],[67,-143]],[[76839,65762],[135,133]],[[76798,66781],[-158,-104],[-132,-301]],[[17804,62842],[1119,400],[1530,506]],[[19970,66387],[-2585,-523]],[[17385,65864],[221,-1712],[40,14],[158,-1324]],[[23254,7628],[34,-251]],[[69270,42569],[-62,-134],[26,-112],[102,-87],[168,-406],[185,-153],[61,-110]],[[69750,41567],[31,583]],[[69781,42150],[58,1005]],[[69283,43245],[-40,-280],[27,-396]],[[72295,60347],[8,-357],[-36,-489]],[[72267,59501],[-13,-218],[65,-70]],[[72319,59213],[123,142],[194,38],[90,-83]],[[72726,59310],[87,320],[139,166]],[[72952,59796],[16,550],[-25,363]],[[72943,60709],[-234,-169],[-223,-33],[-179,144]],[[72307,60651],[-46,-201],[34,-103]],[[72862,58589],[235,-84],[129,49]],[[73226,58554],[151,113]],[[73377,58667],[58,676],[87,313]],[[73434,59678],[-327,114],[-49,61],[-106,-57]],[[72726,59310],[-34,-195],[123,-451],[47,-75]],[[78063,51868],[60,-99],[102,-568],[-34,-212],[-45,6],[0,-538],[-37,-101],[84,-77]],[[78574,49967],[90,252],[98,11],[64,126],[145,87],[38,123],[264,18]],[[79273,50584],[-522,1073]],[[78751,51657],[-62,136],[-157,122],[-169,202]],[[78363,52117],[-18,30]],[[78345,52147],[-127,-170],[-68,96],[-121,-143]],[[75688,49899],[271,59],[74,-87]],[[76033,49871],[39,79],[227,224]],[[76299,50174],[-102,447]],[[76173,50626],[-108,-133],[-224,39],[-111,-134],[-11,-171],[-67,42]],[[75652,50269],[-5,-311],[41,-59]],[[71250,30324],[119,1667]],[[71369,31991],[-691,127]],[[70678,32118],[-47,-577],[-49,-365],[-87,-381]],[[71472,55755],[95,-90],[171,-22]],[[71738,55643],[366,-22]],[[72104,55621],[-5,592]],[[72034,56767],[-22,140],[-159,36],[-115,-78],[-101,162],[-58,-77],[-74,305]],[[71505,57255],[-82,-24],[-12,-127],[-152,-183],[-74,-233]],[[71185,56688],[108,-25],[60,-254],[16,-251],[103,-403]],[[83455,58802],[97,-6],[61,-100],[151,-57],[76,-109],[430,-48]],[[84270,58482],[89,135],[16,201],[136,-19],[84,56]],[[84595,58855],[-185,256],[-7,148],[59,157],[-93,255],[16,95],[-117,120]],[[84268,59886],[-421,118]],[[83847,60004],[26,-195],[79,-211],[-64,-293],[-66,-65],[28,-132],[-114,-280],[-112,150],[-142,-59],[-27,-117]],[[40483,79187],[1575,2553]],[[42058,81740],[449,719]],[[42507,82459],[-90,118],[-54,295],[-198,-89],[-100,113],[-49,-44],[-243,120],[-18,175],[-90,123],[-12,161],[-56,10],[-13,175],[-77,91],[-93,619],[-71,9],[-68,349],[65,78],[-98,183],[-160,49],[-40,175],[-178,238],[-41,272],[-219,-52],[-105,22],[-91,-164],[-185,-103],[-76,-114],[-58,-199],[-101,-151],[-169,-39],[-148,-144],[-122,-280]],[[39549,84455],[5,-47],[193,-4348]],[[36718,24798],[1292,268],[193,17],[662,114]],[[38865,25197],[-17,163],[-86,1338],[-71,1330],[-13,-2],[-77,1247]],[[36849,28918],[78,-1205],[-22,-4],[90,-1333],[-29,-6]],[[36966,26370],[44,-602],[-63,-106],[48,-68],[-51,-130],[8,-180],[-66,18],[-91,-117],[26,-137],[-103,-250]],[[59602,22359],[559,-26],[-6,-330],[584,-27],[7,328]],[[60746,22304],[36,1643]],[[60782,23947],[-945,61]],[[60782,23947],[7,337],[33,-2],[24,1008]],[[42286,56906],[1491,177]],[[43711,58797],[-1567,-187]],[[85972,36234],[234,-15],[189,-64],[64,112],[111,-21]],[[86559,36290],[-111,132],[-253,175],[35,76],[-183,225],[-362,591],[-29,135],[-142,352]],[[85514,37976],[-41,117]],[[85473,38093],[-130,-408]],[[85343,37685],[182,-503],[-10,-88],[161,-319],[-13,-105],[309,-436]],[[68832,38105],[-32,-661]],[[68800,37444],[-45,-914]],[[68755,36530],[95,123],[115,-36],[-31,139],[168,51],[167,-31]],[[69269,36776],[86,1465]],[[69355,38241],[-90,104]],[[69265,38345],[-74,137],[-145,116],[-187,14]],[[68859,38612],[-27,-507]],[[87309,33079],[26,-658]],[[87335,32421],[-14,-414],[133,-64]],[[87454,31943],[47,11],[598,-210]],[[88099,31744],[-78,496],[56,57],[-62,325]],[[88015,32622],[-257,263],[-449,194]],[[57131,47843],[-2,-268]],[[57129,47575],[147,-141],[103,108],[101,-182],[59,12],[128,-288],[136,111]],[[57984,48307],[-4,325]],[[57980,48632],[-265,2],[-579,-31]],[[57136,48603],[-5,-760]],[[80474,36254],[428,-132],[189,1],[99,143]],[[81190,36266],[-87,296],[65,549]],[[80574,37295],[-19,-186]],[[80555,37109],[-81,-855]],[[80340,34871],[649,-151],[202,-96]],[[81311,35832],[-121,434]],[[80474,36254],[-4,-31]],[[80470,36223],[-130,-1352]],[[87296,33345],[13,-266]],[[88015,32622],[23,121],[166,121],[92,1],[52,276],[43,8],[55,303],[76,30]],[[88522,33482],[-61,177]],[[87992,34657],[-45,60],[-317,-73]],[[87630,34644],[-81,-373],[-41,-326],[-77,54],[-105,-275],[-30,-379]],[[62435,38378],[-192,13]],[[61661,38098],[-38,-1347]],[[59577,39583],[21,1010]],[[58830,40631],[-17,-1013]],[[48628,55575],[806,46]],[[50226,57731],[-4,253],[-164,12],[-130,-97],[-47,-115],[-143,-67],[-61,-178],[-207,-14]],[[49470,57525],[7,-355],[-91,-164],[-81,-295],[-134,-268],[-196,-19],[-76,-138]],[[48899,56286],[-31,-143],[-105,-97],[-135,-471]],[[48330,57126],[551,25],[18,-865]],[[49470,57525],[-20,1003],[3,329]],[[49453,58857],[-761,-54]],[[48692,58803],[-382,-23],[-9,-319],[29,-1335]],[[37714,64566],[768,127]],[[38425,65684],[-52,1021],[-92,1625],[-6,356],[-34,-5],[-39,639],[-377,-34],[-385,-66]],[[35572,67543],[43,-691],[587,147],[41,-671],[235,43],[100,-1665]],[[45405,16885],[-70,-119]],[[45335,16766],[46,-1206],[-93,-10],[36,-934]],[[33107,67063],[91,-1334],[120,-1660],[-17,-3],[89,-1217]],[[69703,40814],[543,-86]],[[70246,40728],[128,-20],[29,497]],[[70450,42042],[-669,108]],[[69750,41567],[-26,-419]],[[68610,55296],[265,-205],[212,-224]],[[69087,54867],[35,31],[159,-116],[51,-114]],[[69332,54668],[136,118],[-4,340],[21,474],[-13,461]],[[69472,56061],[-280,57],[0,-118],[-393,1]],[[68799,56001],[-85,-255]],[[68714,55746],[-104,-450]],[[84595,58855],[228,320],[50,398]],[[84873,59573],[48,266],[-170,586]],[[84751,60425],[-451,-547],[-32,8]],[[67468,51595],[-775,103]],[[66693,51698],[-13,-339],[-47,5]],[[66633,51364],[50,-143],[30,-432],[-25,-107]],[[68038,51343],[415,-55],[80,53]],[[68520,52570],[-85,-84],[-342,46]],[[64000,47140],[-22,-173],[33,-142],[-75,-636],[11,-120]],[[79303,64309],[98,-249],[82,-56],[63,65],[227,-70]],[[80319,64294],[-190,141],[23,194],[86,165],[-86,272],[36,284],[147,183],[-24,151]],[[80311,65684],[-159,-93],[-59,-202]],[[80093,65389],[-90,-263],[-192,-242],[-148,-78],[-187,-239],[-100,-49]],[[79376,64518],[-73,-209]],[[78643,62152],[16,-41]],[[78666,62092],[-59,-381],[-86,-48],[14,-196],[-78,-379],[-35,-294],[-56,-51],[62,-279]],[[85661,48142],[-335,-89],[-142,-176]],[[82867,63045],[66,-19],[156,-313]],[[83182,64735],[-116,-125],[-77,-208]],[[82989,64402],[28,-177],[-92,-232],[-24,-246],[16,-192],[-68,-115],[68,-174],[-81,-147],[31,-74]],[[88458,45837],[208,194],[132,30],[210,154],[1,221],[-86,112],[39,506]],[[88962,47054],[-109,-83],[-7,-222],[-68,-22],[-53,-153],[-157,-3]],[[88293,46165],[15,-144],[150,-184]],[[75589,47735],[133,111],[353,-347]],[[76442,47975],[-69,140],[9,311],[-196,364]],[[76186,48790],[-109,-60],[-45,-220],[-107,-75],[-139,17]],[[75519,47956],[70,-221]],[[75456,56615],[125,-43],[126,138],[-2,-257],[227,31],[57,-36],[46,-287],[58,109]],[[76093,56270],[135,297]],[[76228,56567],[-236,491],[72,129],[-148,224],[-83,-6],[-55,250],[-58,96]],[[75720,57751],[-163,-505]],[[75557,57246],[-79,-164],[-77,-34],[-52,-204]],[[29268,9121],[1240,376],[-16,162],[192,59],[-16,163],[95,28],[-22,218],[858,234]],[[31599,10361],[-104,1082]],[[31495,11443],[-386,-107],[-31,324],[-383,-110],[-40,397],[-183,-95]],[[37586,54278],[875,152]],[[38461,54430],[-34,122],[53,190],[-66,252],[-16,438],[-160,15],[-110,145],[24,175],[-48,102],[34,189],[-52,27],[91,250],[-75,140],[41,188],[-56,547]],[[38087,57210],[-128,76],[13,178],[-54,223],[-145,340],[-79,82]],[[71941,37590],[27,445],[-56,11],[36,504]],[[45424,20429],[234,-51],[6,171],[136,-38],[143,131],[62,-89],[44,109],[167,-54],[161,-180],[137,-84],[1,-109],[175,-42],[-9,-135],[158,-163],[25,-170],[96,-25]],[[47649,19211],[53,381],[-54,178],[31,123],[-121,388],[15,284],[156,414],[-11,87]],[[47718,21066],[-1410,-126],[-899,-96]],[[45409,20844],[15,-415]],[[73714,55377],[35,-9]],[[73749,55368],[29,201],[-20,167]],[[73758,55736],[-93,31],[-185,151],[-63,381]],[[73417,56299],[-159,-236],[-219,-54],[-20,-98],[-189,123]],[[72830,56034],[15,-477]],[[58368,69969],[13,1073]],[[58381,71042],[6,531]],[[58387,71573],[-1139,40]],[[57248,71613],[-10,-1498]],[[93831,15002],[234,909],[-64,48],[178,608],[70,394],[198,-344],[260,547],[-51,89],[437,-42],[38,238],[92,140]],[[95107,19342],[-50,-14],[-33,158],[-65,-20],[-78,-171],[6,-216],[-85,-147],[-249,490],[-67,-41],[43,162],[91,-5],[165,234],[-33,234],[34,68],[-71,122],[53,171]],[[94461,20597],[-320,-1810]],[[93435,15064],[106,-102],[-19,-103],[161,66],[69,236],[95,-17],[-16,-142]],[[76186,48790],[80,53],[-46,88],[175,77],[-8,98],[127,29],[-53,125]],[[76461,49260],[-134,-1],[4,183],[-140,-34],[-165,152]],[[76026,49560],[-130,-292],[-120,-189],[-168,-50],[-15,-127]],[[83334,57419],[-205,65]],[[83129,57484],[-75,-278],[-253,-311],[-23,-157],[-67,34],[-162,-57]],[[82549,56715],[-48,-167],[13,-150],[106,-87],[-35,-187],[69,3],[-75,-319]],[[96177,19848],[-64,18],[-72,313],[-76,-2],[-48,213],[-92,7],[-55,218],[55,246],[-32,123],[-84,-58],[-109,161]],[[57335,27738],[253,234],[271,170],[68,-58],[-17,-269]],[[88363,51100],[64,-338],[-3,-251],[37,-227],[-96,-163],[-2,-157]],[[88363,49964],[234,-330],[8,-330]],[[88605,49304],[39,293],[54,92],[106,-9],[207,228],[16,87]],[[89027,49995],[-72,74],[-516,1255]],[[88439,51324],[-23,-8]],[[33374,32951],[983,228],[1495,330]],[[35852,33509],[-47,665],[31,6],[-127,1643],[-692,-134],[-72,977],[21,5],[-114,1515]],[[34852,38186],[-1010,-214],[-867,-205]],[[31321,37373],[193,-2212]],[[26257,11470],[13,173],[95,32],[-19,162],[87,88],[-13,107],[89,87],[7,221],[124,41],[-19,165],[96,33],[-61,96],[-104,-98],[-81,151],[-56,484],[26,9],[-38,322],[-194,-26]],[[26209,13517],[-156,103],[1,-318],[-135,-162],[-67,-220],[53,-216],[-45,-67]],[[86531,43601],[-33,-24]],[[86498,43577],[33,24]],[[64738,29608],[298,-40]],[[66043,30824],[-571,84],[-2,-49],[-577,71]],[[64893,30930],[59,-269],[121,-89],[-24,-680],[-216,-28],[20,-99],[-94,-49],[-23,-108]],[[64736,29608],[2,0]],[[46169,22729],[1766,155]],[[47935,22884],[97,356],[-73,239],[81,278]],[[47777,25074],[-28,206],[-206,299],[-103,-41],[-100,-214],[-62,2],[-9,192]],[[47269,25518],[-130,16],[-46,-78],[-140,40],[-172,159],[-178,-105]],[[46603,25550],[31,-944],[-574,-53],[27,-169],[45,-1326],[37,-329]],[[81398,67358],[111,-276],[343,105],[312,-125]],[[81893,68590],[-46,-137],[-6,-201],[-115,-135],[15,-76],[-102,-211],[14,-202],[-106,-116]],[[81547,67512],[-149,-154]],[[77604,56279],[130,-269]],[[78642,56362],[4,219]],[[78646,56581],[-60,-86],[-235,312],[-5,188],[-52,130],[-63,-91],[-80,35]],[[76687,52382],[14,120],[-70,158],[23,339],[96,273],[23,248]],[[76773,53520],[-147,-34]],[[76104,53216],[-44,-239],[-70,38],[-91,-198],[40,-157],[-18,-165]],[[68157,53277],[126,-202],[336,-119],[40,-139]],[[68889,52882],[18,272],[142,-66],[15,176],[75,-29]],[[69139,53235],[-414,610],[-62,69],[-3,164]],[[68660,54078],[-105,196],[-61,-47]],[[83138,60179],[-63,-1474]],[[83075,58705],[35,-71],[73,195],[96,5],[90,-206],[86,174]],[[83847,60004],[-1,0]],[[74080,56155],[31,-17],[2,-350],[63,-241],[172,-122],[146,15],[150,145],[93,-18]],[[74833,56145],[-139,203],[-14,115],[-135,74],[-47,307],[25,197]],[[74523,57041],[-172,46],[-48,-57],[-118,147]],[[74185,57177],[-36,-16]],[[74149,57161],[53,-211],[-99,-401],[-23,-394]],[[66849,56367],[49,0],[223,192],[152,-17],[68,48],[135,269]],[[67476,56859],[-827,87],[-81,25]],[[66568,56971],[-126,31]],[[66442,57002],[56,-458],[83,-73]],[[66322,57023],[-96,9]],[[66226,57032],[-66,-204],[41,-110],[118,25],[32,126],[-29,154]],[[77757,47185],[105,108],[45,182]],[[77907,47475],[17,296],[54,100],[11,200],[-46,76]],[[77618,48239],[1,-463],[-82,-25]],[[77537,47751],[65,-248],[155,-318]],[[79661,62392],[147,253]],[[79303,64309],[-188,-412],[-79,-54],[-61,-212]],[[52186,83478],[571,-1002]],[[52757,82476],[10,75],[337,-316],[100,-169]],[[53204,82066],[52,84],[232,-22],[47,387]],[[53535,82515],[99,318]],[[53634,82833],[-287,642],[-308,608]],[[52182,83485],[4,-7]],[[17925,13815],[311,54],[97,-150],[89,-40],[116,126],[91,-8]],[[18629,13797],[-176,1166],[282,125],[-46,319],[157,67],[-236,1606],[-25,-11],[-47,322]],[[17758,17060],[-182,-78],[41,-270]],[[84207,36697],[-19,-25]],[[84188,36672],[399,-154]],[[84587,36518],[-147,301],[115,184],[-25,242],[85,40],[54,249],[-130,731]],[[97059,29277],[86,40],[166,-94],[91,-102],[34,-256],[148,288],[-63,194],[-169,63],[-249,-65],[-44,-68]],[[85324,63504],[21,68]],[[84874,65570],[-154,-51],[-62,-133],[-146,-91],[-92,-172],[-158,-138],[-237,84]],[[27553,46099],[20,-25],[770,217]],[[28343,46291],[-4,39],[1300,352],[892,231]],[[30583,48284],[-1307,-337],[-1248,-351],[-738,-198]],[[50079,78646],[1008,18]],[[50804,80229],[-148,529],[48,67],[-55,157]],[[50062,79059],[-21,-332],[38,-81]],[[27631,17080],[57,20],[187,-247],[60,71],[105,-122],[61,-670],[378,116],[17,-163]],[[28496,16085],[729,226]],[[29163,16629],[-98,-12],[-77,127],[-147,-45],[-35,328],[-115,-35],[-67,174],[-87,-8],[1,228],[-179,190],[-99,11]],[[29591,18425],[-420,-102],[-49,-82],[-109,261],[-234,159]],[[52845,33380],[-81,-38],[-13,-141],[-142,-87],[-180,2],[-111,57]],[[52318,33173],[-245,-11]],[[45120,28291],[1508,149]],[[46628,28440],[-19,590]],[[46609,29030],[-96,-22],[-173,197],[-49,1533]],[[44867,30589],[12,-333],[-45,-4],[32,-860]],[[73758,55736],[25,-40],[161,162],[136,297]],[[74149,57161],[-152,-1],[-223,-140],[-11,-68],[-169,-39],[-66,-85],[-21,-162],[-64,19]],[[73443,56685],[-26,-386]],[[28873,41770],[39,59],[33,292],[90,47],[4,243],[41,130],[-5,201],[1779,471]],[[30854,43213],[6,208],[-160,508],[23,191],[-88,129],[-19,203],[-83,164],[-48,207],[86,203],[96,-4],[49,183],[-101,-140],[-127,20],[-58,289],[81,499],[-61,191],[22,170],[91,84],[-43,182],[94,-22],[0,199],[-83,236]],[[28343,46291],[56,-618],[14,4],[130,-1372]],[[51691,89658],[334,-846]],[[52453,88194],[109,-3],[28,78],[90,-57],[123,194],[131,55],[49,-81]],[[53225,88751],[-46,102],[-3,247]],[[52706,89605],[-250,191],[-124,213]],[[52242,90010],[-109,-236],[-124,-4],[-95,73],[-107,-197],[-116,12]],[[45691,57281],[233,20]],[[45924,57301],[725,63]],[[32915,53331],[1574,337]],[[34024,56604],[-64,840]],[[31439,56872],[309,-3808]],[[62425,59549],[443,-16],[2,171],[193,-9]],[[63063,59695],[285,-22]],[[63348,59673],[-52,304],[-135,191],[-73,279],[61,220],[-79,-4],[11,437],[-383,16]],[[62698,61116],[-382,15]],[[62221,60479],[-2,-169],[-69,-233],[33,-222]],[[59814,50754],[36,-35],[168,278],[346,10],[13,-89],[104,-43]],[[60228,52150],[-380,-6]],[[59848,52144],[2,-617]],[[51842,9691],[1070,30]],[[52998,11449],[2,6]],[[63348,59673],[298,-7]],[[63646,59666],[12,682]],[[63131,61433],[-429,23],[-4,-340]],[[53770,30702],[7,255],[117,188],[-8,290],[-88,45],[40,147]],[[53838,31627],[-9,137],[122,1],[29,285],[48,113],[-29,144]],[[67476,56859],[13,-1]],[[67489,56858],[35,352],[-121,85],[-111,-60],[9,730]],[[66370,58118],[89,-191],[30,-362],[69,-229],[10,-365]],[[80521,65882],[564,-1245]],[[81210,64360],[130,216],[100,36],[104,226],[265,69],[179,121]],[[81988,65028],[-283,709]],[[81705,65737],[-605,1296]],[[81100,67033],[-190,-143]],[[80910,66890],[-12,-228],[-119,-37],[-79,-135],[32,-309],[-148,-138],[-63,-161]],[[11603,15238],[689,353]],[[11969,17171],[-911,-462]],[[11058,16709],[-23,-256],[165,21],[40,-271],[186,96],[177,-1061]],[[10534,16467],[524,242]],[[14043,18272],[33,132],[-52,499],[-218,439],[-51,188],[-93,-33],[-104,158],[-36,355],[-42,60],[-57,298],[12,144],[-65,15]],[[13370,20527],[-235,119],[-73,432]],[[13062,21078],[-556,-275],[-393,-177],[67,-395],[-570,-265],[43,-243],[-47,-23],[106,-642],[-321,-164],[19,-107],[-188,-98],[-78,-120],[25,-141],[-78,-39],[-26,-225],[-116,-152],[-188,-100],[-237,208],[-325,-174]],[[10199,17946],[213,-854],[122,-625]],[[87549,46432],[80,128],[61,295],[134,20],[24,169],[232,-128],[122,219]],[[88202,47135],[168,379],[55,36]],[[88425,47550],[8,288],[60,169],[-90,228]],[[88403,48235],[-67,-117]],[[88336,48118],[-109,-160]],[[65732,54659],[104,-124],[24,-171],[111,-146],[228,-98]],[[66199,54120],[50,-2],[6,197],[170,440],[2,158],[120,104]],[[66203,55597],[-302,74]],[[65901,55671],[3,-247],[-204,-611],[32,-154]],[[54101,87750],[30,-1098]],[[54131,86652],[674,-699],[178,-317]],[[54983,85636],[66,210],[-10,252],[156,186],[-37,82],[39,271],[128,-9],[100,106],[30,169],[123,251],[125,21]],[[55703,87175],[-298,287],[-300,330],[-521,413],[-230,207],[-363,424]],[[49263,69505],[-25,1695]],[[49238,71200],[-270,-16]],[[48269,71143],[34,-1699]],[[60862,20317],[773,-56]],[[61706,22240],[-767,50]],[[60939,22290],[-35,-1313],[-27,2],[-15,-662]],[[26199,47092],[60,8]],[[29135,50294],[-634,-167],[-1390,-388],[-51,1],[-557,-165],[-337,-125],[-557,-169]],[[25609,49281],[94,-999],[190,62],[17,-332],[207,62],[15,-337],[67,-645]],[[53954,38810],[235,3]],[[54865,39593],[-674,2]],[[79103,54302],[101,-147],[111,-73],[-40,181]],[[79275,54263],[-172,39]],[[52505,14742],[881,18]],[[53442,15419],[-17,321],[38,298],[2,372]],[[62583,65168],[13,959],[219,2],[119,43],[33,279],[116,23],[17,206]],[[63100,66680],[-109,33],[-89,-117],[-90,76],[-4,-114],[-172,-191],[-62,-8],[12,419],[-37,-108],[-382,31],[2,112]],[[61656,66856],[-14,-648],[37,-1],[-15,-1011]],[[63198,58265],[34,122],[143,64],[43,149],[174,42],[420,-31]],[[64012,58611],[111,-9],[-122,281],[-57,347],[15,87]],[[63959,59317],[-27,340],[-286,9]],[[63063,59695],[-24,-1312],[160,-62],[-1,-56]],[[87277,49404],[-18,-122],[73,-153],[-35,252]],[[54637,75001],[1177,-307]],[[55814,74694],[9,251],[-55,228],[59,134],[-45,312],[63,30],[23,282],[115,102],[126,298],[6,247]],[[56115,76578],[-718,203],[9,56],[-174,89]],[[55232,76926],[-23,-183],[62,-7],[15,-238],[-49,-146],[-59,216],[-38,-80]],[[55140,76488],[9,-231],[-177,-65],[3,-225],[-205,-125],[15,-347],[-95,14],[42,-151],[-42,-171],[-71,-81],[18,-105]],[[66932,55221],[201,70],[125,-105],[174,-67]],[[67468,55815],[-449,58],[-102,-36]],[[75937,58113],[141,-210],[127,2],[-42,-116],[147,-33],[76,98],[100,-1],[90,-198]],[[76902,58819],[-192,70],[-85,168],[-100,48],[-40,169],[-70,75]],[[76415,59349],[-15,-9]],[[76400,59340],[33,-101],[-137,-80],[16,-147],[-150,78],[-68,-165],[-30,50],[-112,-109]],[[67804,58520],[69,-15],[-12,-204],[220,-22],[-3,-141]],[[68078,58138],[569,-55],[3,99]],[[68763,59228],[3,112]],[[68089,56785],[774,-92]],[[68863,56693],[-4,206],[141,304]],[[68078,58138],[-37,-1348]],[[92129,27498],[57,-148],[115,-4],[44,248],[-36,119],[191,-72],[39,131],[160,-4],[33,-373],[60,-3],[-21,146],[61,61],[291,-206],[39,166],[140,-245],[105,-97]],[[93407,27217],[-34,258],[113,40],[105,-47],[72,491]],[[93663,27959],[-599,244]],[[93064,28203],[-395,162],[0,132],[-77,54],[-16,-148],[-313,124]],[[92263,28527],[-72,26]],[[59691,46434],[-166,-62],[17,139],[-62,149],[-194,128],[22,181],[-107,96],[-13,-129],[-129,-121]],[[51431,82547],[120,-163]],[[51551,82384],[635,1094]],[[51566,83984],[-171,-128],[-229,-456],[-61,-227]],[[51105,83173],[-35,-99],[199,-228],[162,-299]],[[90787,22360],[237,-152],[-57,-255],[289,-159],[43,147],[79,-119]],[[91804,23722],[-615,204]],[[91189,23926],[-100,-793],[-111,-197],[-29,-140],[-108,57],[-11,221],[-53,-37],[-29,-192],[39,-485]],[[14485,16225],[40,37],[969,463],[1097,505]],[[16591,17230],[-66,77],[10,138],[-114,730]],[[16421,18175],[-678,-303],[-48,320],[-249,-114],[-50,320],[-183,-86]],[[15213,18312],[-1128,-538]],[[79522,52063],[65,-142],[158,-147],[27,-151]],[[80668,51402],[-97,101],[51,153],[-112,123],[119,52],[10,133],[-141,173],[-174,136],[53,84]],[[80377,52357],[-68,111],[-1,-125],[-168,156],[-166,265],[-61,-156],[-119,103]],[[79794,52711],[-114,-343],[-131,-197],[-27,-108]],[[85349,42059],[401,387]],[[85575,42970],[-56,154]],[[85519,43124],[-109,-121],[-62,45],[-102,-60]],[[85246,42988],[103,-929]],[[79012,78931],[230,-53]],[[79242,78878],[19,292],[67,258],[125,-16],[182,67],[11,59],[220,228],[125,311],[67,53]],[[80058,80130],[-7,234],[-52,23]],[[79235,80571],[-65,16],[-20,-249],[-34,8],[-104,-1415]],[[55571,54277],[-767,-7]],[[68640,49898],[-277,54]],[[50924,13763],[-151,-12],[-65,-322],[-96,69],[-71,-82],[-28,-222],[-287,249],[-10,-240],[-107,113],[6,-325],[-191,-191],[15,-815]],[[55790,41940],[289,4]],[[56079,41944],[2,383],[41,1],[0,837]],[[56122,43165],[-633,-3]],[[55489,43162],[3,-103],[-102,-88],[-136,-598],[-12,-138],[65,-47],[-18,-175],[-64,151]],[[84431,53037],[13,-2043]],[[84444,50994],[170,68],[44,-89],[128,69]],[[84786,51042],[25,159],[142,-61],[51,94],[76,-202],[48,236],[-31,78],[161,193],[-13,136],[61,216],[-35,100],[93,143]],[[85364,52134],[-87,250],[1,389]],[[85278,52773],[-108,35]],[[84571,52993],[-140,44]],[[87032,42793],[105,102],[65,212]],[[87202,43107],[-114,24]],[[87088,43131],[-80,-99]],[[86962,42978],[70,-185]],[[15406,1954],[23,-124],[84,180],[-102,38],[-5,-94]],[[15701,1720],[1328,650],[943,444],[10,-58],[225,103]],[[17639,4013],[-1990,-950]],[[15649,3063],[-26,-126],[-119,-209],[-43,-184],[25,-119],[-166,30],[-38,-202],[55,-176],[107,5],[60,81],[19,172],[96,32],[11,-365],[89,23],[46,-94],[-64,-211]],[[15303,1766],[52,-72],[38,176],[-91,66],[1,-170]],[[41303,17743],[10,-165],[193,32],[6,-110]],[[42364,17794],[-18,382]],[[42296,19166],[-63,1273]],[[42233,20439],[-10,241]],[[42223,20680],[-141,-20],[17,-331],[-397,-65],[17,-321],[-194,-29],[16,-309],[-570,-92]],[[87782,49709],[110,-322],[78,-93],[68,-210]],[[88038,49084],[56,36]],[[88094,49120],[75,98],[185,-47],[116,147],[57,-10],[28,-210],[50,206]],[[88363,49964],[-156,258]],[[88207,50222],[-70,-408],[-197,19],[-158,-124]],[[20798,12054],[-38,115],[-136,983],[189,76],[-46,324],[189,78],[-114,765]],[[20842,14395],[-1497,-614]],[[19345,13781],[84,-73],[9,-437],[-72,-239]],[[75443,63625],[128,-25],[8,118],[591,-122]],[[76170,63596],[12,176]],[[76182,63772],[40,570]],[[76222,64342],[-168,72],[-4,207],[-98,77],[9,136]],[[75961,64834],[-440,72]],[[54340,22052],[774,0]],[[55114,22052],[1,666],[16,0],[2,662]],[[55133,23380],[-580,2]],[[54553,23382],[-195,-3],[1,-661],[-18,0]],[[54341,22718],[-1,-666]],[[54799,54608],[1,1158]],[[54800,55766],[-65,1]],[[54735,55767],[-927,-4]],[[53808,55763],[5,-1173]],[[57098,43669],[4,-1005]],[[57102,42664],[648,-10]],[[57750,42654],[6,955]],[[57101,44004],[-3,-335]],[[84924,43932],[78,-255],[31,-255],[-61,-3],[11,-233]],[[84983,43186],[250,-120],[13,-78]],[[85519,43124],[-92,292],[31,71],[-104,141]],[[85137,44113],[-19,-77],[-194,-104]],[[48112,83913],[798,62],[46,41],[-21,187],[113,13],[243,-479]],[[49291,83737],[-26,1681]],[[49254,86030],[-1189,-70]],[[56648,44858],[465,-7]],[[57125,45967],[-856,6]],[[56269,45973],[-9,-156],[73,-14],[18,-148]],[[42223,20680],[-120,2549]],[[70834,24345],[276,-53]],[[71110,24292],[75,10],[69,-479],[-55,-11],[51,-313],[66,-78],[-17,555],[-72,159],[-13,195],[80,30],[30,-219],[76,-231]],[[71658,25200],[-765,142]],[[70893,25342],[-59,-997]],[[68585,62543],[295,-42]],[[69059,64535],[-316,43]],[[68743,64578],[-53,-1064],[-65,-49]],[[68625,63465],[-40,-922]],[[30751,65365],[248,-3056]],[[82918,39782],[108,-340],[46,21],[145,-731]],[[82878,41044],[-25,-126],[31,-264],[-100,-100],[14,-188],[120,-584]],[[86117,28601],[331,-133],[5,33],[306,-130]],[[86759,28371],[120,806]],[[86879,29177],[-64,112],[102,47],[18,257],[-172,-23],[-103,37],[24,209],[-205,-1]],[[86479,29815],[-131,42]],[[86348,29857],[-116,36],[-33,-346],[-95,-641]],[[86931,26109],[49,95],[23,242],[94,-16],[174,1097]],[[87271,27527],[-595,294]],[[86676,27821],[-168,-247],[-147,67],[-94,-597],[-45,22],[-54,-365],[39,-31],[-67,-449]],[[85584,61467],[904,1108]],[[86488,62575],[236,291]],[[86724,62866],[-293,292],[-156,271],[-186,463],[-89,292]],[[85605,63783],[-171,-374],[-37,-294],[-61,-12],[-105,-241],[43,-243],[92,-180],[-22,-78],[63,-189],[9,-172],[91,-204],[-7,-124]],[[32935,6852],[774,201],[1068,262]],[[34777,7315],[-51,319],[-108,1294],[47,175],[-22,272],[-48,-12],[-51,209],[-32,379],[-49,-12],[4,277],[-28,325]],[[34439,10541],[-287,-64],[28,-332],[-178,-35],[28,-326],[-1157,-300],[-29,324],[-194,-51]],[[90031,26709],[563,-404],[1,-16]],[[90595,26289],[94,-199],[114,96]],[[90803,26186],[0,353],[-43,335],[37,172],[3,403]],[[75760,66156],[178,-363],[16,-323],[111,-321],[-104,-315]],[[76222,64342],[21,292],[225,163],[85,-1]],[[76553,64796],[-124,114],[-13,117],[-147,79],[-17,116]],[[76203,66434],[-197,39],[25,373]],[[76031,66846],[-198,142],[-66,101]],[[75321,67145],[61,-255]],[[60863,25954],[769,-54]],[[61632,25900],[9,333]],[[61641,26233],[-556,41],[-44,43],[-70,692]],[[60971,27009],[-256,-163]],[[60715,26846],[-67,-85],[-59,-239]],[[70720,70428],[188,-32],[10,167],[556,-110]],[[71500,70864],[-33,426],[-52,202],[-41,323],[-579,113],[38,669],[-96,16]],[[70737,72613],[-95,16],[-36,-668]],[[70606,71961],[-36,-665],[96,-15],[-31,-670],[93,-16],[-8,-167]],[[17573,85295],[-256,44],[-103,-100]],[[79247,67280],[134,-112],[53,-120],[150,-137],[251,142]],[[79835,67053],[-248,464],[27,193],[-155,12]],[[79459,67722],[-158,-150],[-36,-238]],[[79265,67334],[-18,-54]],[[44013,74138],[810,81]],[[44763,75891],[-962,-97]],[[32310,25919],[-177,2063]],[[30561,27426],[167,-1829]],[[39321,44357],[0,-8]],[[38720,44503],[42,-694]],[[38762,43809],[37,-637]],[[38799,43172],[424,67]],[[39223,43239],[83,69],[77,-44]],[[39383,43264],[-27,473]],[[39356,43737],[-31,537],[-101,77],[95,38]],[[39315,44602],[-79,263],[-88,79],[12,143],[-87,90],[-2,177],[-193,555],[-136,290]],[[38740,46199],[-115,-19],[95,-1677]],[[35060,45164],[-150,2104]],[[33405,46945],[46,-616],[429,-206],[101,-263],[215,-265],[128,24],[88,-55],[148,174],[142,-141],[103,-191],[255,-242]],[[76330,66409],[84,204],[-62,173],[12,437],[-108,21],[21,320]],[[76277,67564],[-62,13]],[[76215,67577],[-49,-315],[31,-110],[-166,-306]],[[71451,47788],[61,1019]],[[70875,49025],[-30,-505]],[[70845,48520],[-37,-615]],[[94259,30777],[16,-81],[139,-125],[-101,193],[-54,13]],[[94010,31176],[83,-93],[-47,166],[-36,-73]],[[92070,33032],[7,-96],[143,45],[-10,-130],[93,70],[213,-3],[118,-144],[-7,-145],[160,-52],[436,-197],[216,-158],[218,-373],[151,-415],[179,-143],[-91,309],[118,134],[118,-14],[37,-101],[117,187],[200,-302],[-1,-93],[150,-89],[-1,98],[-344,472],[-398,593],[-259,324],[-289,329],[-416,554],[-232,238],[-154,105],[-39,-33],[-147,154]],[[86010,23729],[65,-193],[-5,156],[-60,37]],[[87300,21910],[-101,488],[110,72],[4,252],[-75,34],[31,147],[-97,22],[-198,437],[-132,28],[28,351],[102,-23],[66,366]],[[86372,24361],[-103,-449],[-125,-89],[40,-185],[77,-62],[23,101],[102,-175],[-32,-132],[-130,-112],[-113,90],[4,-152],[-95,-84],[-85,29],[-24,-261],[45,-403],[103,-55],[110,-181],[-15,-156],[219,-341],[51,0],[143,-290]],[[85877,23714],[49,-155],[56,-2],[-105,157]],[[57142,50372],[10,1269]],[[57152,51641],[1,89]],[[57153,51730],[-809,14]],[[79429,58617],[42,-211],[111,-61]],[[79582,58345],[36,30],[193,-106],[60,-90],[71,83],[217,-120],[22,-133]],[[80181,58009],[113,-179],[121,99]],[[80414,59488],[-192,35]],[[80222,59523],[-171,31]],[[79461,58900],[-50,-182],[18,-101]],[[89400,33913],[-28,-79],[147,-249],[69,-242]],[[89588,33343],[414,565]],[[90002,33908],[-79,453],[-57,86]],[[23690,44634],[1706,546],[906,276]],[[26302,45456],[-30,236]],[[26199,47092],[-1332,-413],[-1358,-437]],[[79705,52849],[288,471],[194,556],[21,-22]],[[80208,53854],[-63,119]],[[79829,54046],[-170,35],[-13,89],[-371,93]],[[79103,54302],[-90,22]],[[78910,53908],[171,-253],[200,-189],[-19,-139],[206,-225],[68,42],[169,-295]],[[73966,65743],[9,201],[-128,22],[-54,178],[96,-16],[9,168],[-88,128],[29,478],[-26,87],[-152,134],[7,169],[-96,17]],[[73572,67309],[-4,-113],[-369,64],[-52,-48],[-69,-267],[-177,10]],[[77918,65862],[199,-185],[12,-110]],[[78129,65567],[315,172],[122,-94],[105,61]],[[78671,65706],[92,105],[-91,335],[80,333],[-44,90]],[[78708,66569],[-243,501]],[[78465,67070],[-158,-210],[-93,-231]],[[80556,39083],[185,-70]],[[80741,39013],[86,914]],[[80827,39927],[-282,-23]],[[80545,39904],[28,-239],[44,-78],[17,-223],[-78,-281]],[[13913,92719],[-390,273],[-153,-250],[32,-281],[-120,168],[-47,221],[52,293],[-84,115],[-66,-54],[-111,-471],[-127,-245],[-81,191],[-51,-152],[-103,-107],[11,-156],[-305,261]],[[12330,92853],[20,-148],[159,-124],[-98,298],[-81,-26]],[[12354,92539],[-115,95]],[[23037,62376],[1067,329],[803,700],[86,-204],[95,-103],[84,-263],[778,414],[419,119]],[[69876,48606],[115,-15],[50,102],[71,-95],[63,77]],[[70175,48675],[59,1085]],[[70234,49760],[-390,65],[-35,-50]],[[69809,49775],[-27,-521],[-157,48],[-12,-234],[-101,-98],[-14,-261]],[[73426,45017],[-21,1399]],[[73404,46488],[-111,83]],[[73293,46571],[-414,83]],[[50423,52839],[1150,40]],[[51559,54220],[-954,-27]],[[50492,45758],[948,40]],[[51432,46803],[-5,337]],[[51427,47140],[-961,-41]],[[50466,47099],[26,-1341]],[[48510,50690],[23,1],[-13,675]],[[47368,51619],[25,-1008]],[[53872,48542],[0,168],[192,3],[0,335],[64,1]],[[53128,49537],[10,-782],[63,1],[2,-224]],[[58720,20456],[9,659],[-133,4],[21,945]],[[58632,22734],[-389,13]],[[58222,21745],[-16,-612],[-64,0],[-9,-661]],[[58133,20472],[17,-332]],[[67994,64504],[354,-48],[7,168]],[[68355,64624],[64,1446]],[[68419,66070],[-321,41],[2,57]],[[67907,66192],[-50,-1113]],[[66192,64548],[96,-11]],[[66288,64537],[334,-38],[98,120],[196,-35],[151,88]],[[67085,65119],[37,838]],[[66638,66011],[-4,-111],[-388,39]],[[66246,65939],[-54,-1391]],[[64687,75373],[30,-227],[-29,-781]],[[64688,74365],[918,-97]],[[65606,74268],[-30,73],[241,647],[-48,58],[22,164],[76,33],[-17,142]],[[65850,75385],[-226,159]],[[67745,76394],[384,-46]],[[68129,76348],[193,-26]],[[68322,76322],[75,1665],[13,0]],[[68410,77987],[14,335],[-96,11]],[[67846,78397],[-31,-345],[-70,-1658]],[[53021,12776],[-7,77]],[[89445,37461],[184,281]],[[89629,37742],[87,121],[-15,248],[91,9]],[[89792,38120],[-191,138],[-117,230]],[[94388,28851],[524,-263],[17,-109],[89,-40]],[[95018,28439],[57,135],[-24,143],[-96,31],[85,95]],[[95040,28843],[-84,116],[-8,129],[-486,241]],[[94462,29329],[-22,-162]],[[94440,29167],[-52,-316]],[[60852,36802],[771,-51]],[[53818,37466],[183,2],[-1,224]],[[53231,38570],[0,-12]],[[84187,41371],[-93,311],[-84,177],[-67,392],[-52,24],[-126,394]],[[83765,42669],[-291,-204],[-239,9]],[[62351,63073],[180,-140],[113,129],[101,0],[-5,-255],[216,-10]],[[63172,64809],[-396,15],[7,337],[-150,6]],[[29140,65790],[96,152],[101,257],[81,-157],[222,-187],[43,-105],[140,-5],[69,-99]],[[30210,70488],[-212,-44],[-1749,-442],[-521,-139]],[[38161,40839],[77,59],[-26,201],[66,251],[102,155],[67,259]],[[38447,41764],[-54,219],[56,224],[-24,385],[-96,103],[-22,282],[27,39]],[[38334,43016],[-50,150],[7,155]],[[38291,43321],[-89,167],[-151,48],[-106,-63],[-8,231],[-78,134]],[[37859,43838],[-125,35],[-96,-175],[-23,-319],[-72,-162],[-66,-16],[-120,-292],[-243,-42],[-63,-55]],[[37051,42812],[-324,-61]],[[36727,42751],[2,-299],[93,-1300],[-34,-7],[27,-397]],[[35632,49442],[73,-1068],[1298,261]],[[37003,48635],[294,50],[39,-122],[80,55]],[[37416,48618],[185,443],[16,100],[125,220]],[[37742,49381],[182,493],[93,549],[63,232],[48,-5],[91,245]],[[38219,50895],[67,183],[-72,377]],[[35583,50175],[49,-733]],[[84165,87743],[529,-140]],[[84694,87603],[187,-55],[31,317],[192,-52]],[[84708,89262],[-113,-126],[-24,-162],[-56,-11],[-39,-210],[-133,-41],[-98,-100],[-21,-130],[-129,-128],[-31,-142],[117,-298],[-16,-171]],[[76214,62667],[-99,100],[7,112],[-148,-15],[-14,71]],[[75960,62935],[-43,64],[-513,105]],[[75404,63104],[-9,-131]],[[80101,73997],[194,-44],[41,188],[121,-28]],[[80457,74113],[69,185],[16,206],[168,287],[58,-9]],[[80768,74782],[11,123],[150,45],[29,327],[168,244]],[[81112,77238],[-392,46]],[[80720,77284],[-32,-113],[-76,-783],[-113,29],[-36,-547],[-56,14],[-153,-177],[-203,-591]],[[61053,46491],[379,2],[634,-41]],[[61420,47562],[-6,-678],[-360,-1]],[[61054,46883],[-1,-392]],[[36400,58196],[-23,288]],[[36377,58484],[-4,63]],[[36373,58547],[133,68],[-77,180],[-80,71]],[[36349,58866],[-48,-149],[-201,-179],[33,-505],[147,57],[124,-31]],[[33190,12980],[81,26],[215,-191],[41,25],[252,-185],[61,-401],[13,-239],[168,78],[78,-104],[209,36]],[[34308,12025],[164,112],[181,-103],[68,-117],[208,96],[107,-51],[181,78],[61,234]],[[48737,33466],[227,66],[204,-197],[261,-108]],[[49410,35983],[-704,-36]],[[44450,10821],[972,115]],[[45422,10936],[389,40],[-24,661],[76,7],[-48,1320],[77,8],[-25,664]],[[45079,13890],[-263,-115],[-115,-179]],[[44701,13596],[4,-296],[134,-240],[24,-110],[-76,-190],[-89,-28],[11,-97],[-140,-87],[0,-132],[-101,11]],[[69213,51217],[60,-2],[3,257],[103,-33],[26,-211],[-69,-169],[49,-172],[155,246],[98,-150]],[[69638,50983],[124,2],[143,122]],[[69905,51107],[-20,310],[99,129],[-82,168],[-120,86],[-17,162]],[[69620,52124],[-415,98]],[[94213,27804],[474,-249]],[[95114,28322],[-59,106]],[[95055,28428],[-37,11]],[[94388,28851],[-175,-1047]],[[75549,55136],[60,-13]],[[76032,55042],[14,110],[147,484],[32,23]],[[76225,55659],[-74,90],[-12,403],[-46,118]],[[51986,93040],[61,2]],[[52047,93042],[-54,474],[-17,352],[18,664],[83,700],[63,386]],[[52140,95618],[-50,-1]],[[52090,95617],[-143,-763],[-21,-347],[10,-849],[50,-618]],[[50767,93265],[69,-89],[222,-33],[114,-148],[114,71],[182,-54]],[[51468,93012],[14,148],[171,57],[187,-122],[55,20],[-52,1027],[-51,673],[-25,10],[20,367],[48,420]],[[51835,95612],[-846,-18],[-192,-59]],[[50797,95535],[-56,-17],[7,-627]],[[83951,28401],[-19,-163],[53,-171],[-15,-162]],[[84514,27895],[89,277],[-62,67],[39,343],[-37,12],[60,337],[180,-54],[34,354]],[[84817,29231],[-273,79],[18,172],[-96,32],[24,242]],[[83962,29733],[-41,-213],[78,-165],[32,-216],[-80,-738]],[[78058,47482],[167,-153],[136,-72],[20,-525]],[[78494,46668],[319,377]],[[78813,47045],[47,379]],[[78860,47424],[-111,146],[-100,43],[-115,459]],[[78534,48072],[-64,-27],[-55,-342],[-47,109],[-310,-330]],[[12186,33802],[75,299],[-128,221],[-86,421],[86,220],[-1,119],[171,479],[-12,96],[94,217],[-18,107],[81,161]],[[12448,36142],[-146,100],[-17,108],[-259,-94],[-90,192],[-15,137],[-171,262],[-278,8],[-72,-90],[-34,78]],[[11366,36843],[-4,-43],[-460,-211]],[[10980,36306],[72,-229],[25,-228],[51,-86],[-228,-97],[84,-511],[102,-57],[-111,-453]],[[37859,43838],[-9,99],[217,181],[23,102],[-101,161]],[[37989,44381],[14,106],[-179,284],[-98,55],[-112,276],[-189,-104]],[[37425,44998],[-121,-22]],[[37304,44976],[-55,-351],[19,-275],[65,37],[67,-456],[-72,-47],[-43,-154],[-187,-292],[-59,-393],[12,-233]],[[78279,63544],[11,-289],[-20,-264],[57,-320]],[[78327,62671],[109,36]],[[78891,63340],[-245,218],[-106,171],[-77,-75],[-105,65]],[[63493,41323],[-46,-1668]],[[70197,44955],[434,-59]],[[70631,44896],[91,-16],[29,473]],[[70751,45353],[-91,58],[42,653]],[[70067,46160],[-35,-671],[189,-29],[-24,-505]],[[70175,48675],[257,-5]],[[70432,48670],[83,24],[62,-130],[268,-44]],[[70727,49785],[-391,70]],[[70336,49855],[-97,15],[-5,-110]],[[49482,49069],[16,2]],[[49498,49071],[-24,1344]],[[49474,50415],[-958,-61]],[[60852,36802],[-39,-1672]],[[75277,53765],[61,-168],[-32,-238],[68,-169],[-29,-187]],[[75387,53794],[-110,-29]],[[49467,51759],[190,9],[19,-1006]],[[49676,50762],[752,38]],[[50428,50800],[7,340]],[[50435,51140],[-20,1344]],[[59991,77332],[464,-8],[21,52]],[[60476,77376],[196,101],[2,110],[98,134],[38,1388]],[[60810,79109],[2,55],[-297,7]],[[60515,79171],[-338,0],[-536,30],[-81,90],[-86,-74],[-67,44]],[[59407,79261],[-19,-74],[76,-199],[-83,-234],[96,-90],[-60,-224],[-17,-393]],[[73998,31434],[380,-98]],[[74378,31336],[381,-94]],[[74759,31242],[138,1335]],[[60438,29245],[28,1280]],[[59538,30582],[-40,3]],[[66910,76495],[256,-31]],[[67166,76464],[15,335],[196,-24],[50,1287]],[[67427,78062],[-144,18],[3,106],[-96,9],[-54,-113],[-94,58],[-195,20]],[[66847,78160],[-64,-1651]],[[64540,69675],[298,-31],[-8,-225],[189,-20]],[[65019,69399],[7,239],[80,115],[87,-26],[-3,-138],[58,-110]],[[65248,69479],[24,643],[-47,164],[-22,-119],[-113,126],[8,133],[95,63],[34,118]],[[65227,70607],[-158,22],[10,329],[-385,41]],[[64694,70999],[-25,-668],[-81,9]],[[64588,70340],[27,-410],[-102,-110],[27,-145]],[[51731,34743],[572,14]],[[52303,34757],[193,4],[-3,334]],[[52483,36099],[-768,-17]],[[76299,50174],[184,-65],[41,-128]],[[76524,49981],[120,139],[82,3],[123,208],[123,129]],[[77009,50619],[-144,14],[-112,-73],[-46,46],[-52,246],[-112,-5]],[[69139,53235],[-16,114]],[[69395,54089],[-28,498],[-35,81]],[[69087,54867],[-194,-388],[-138,-395],[-95,-6]],[[45279,24301],[-75,2013]],[[45204,26314],[-1,2]],[[73922,51430],[-4,-184]],[[73918,51246],[479,-229]],[[74397,51017],[74,45],[97,226]],[[74568,51288],[5,64],[-311,332]],[[73928,51764],[-6,-334]],[[79549,57202],[-78,362],[-136,155]],[[79335,57719],[-121,-146],[-71,-262],[-81,32]],[[79062,57343],[-107,-292],[-76,-19],[14,-154],[-55,-102]],[[78838,56776],[70,-134],[57,-268]],[[71700,71084],[57,363],[-9,121],[105,315],[73,89],[-31,99],[67,219]],[[71852,73438],[-508,84],[-31,-144],[-86,-47],[-190,-345],[-76,19],[-59,-156],[-154,-72]],[[70748,72777],[-11,-164]],[[76061,68263],[77,-113],[148,43],[232,-46]],[[76532,68911],[-407,76],[-62,102]],[[72353,75376],[19,334],[50,-8],[29,254],[-61,102],[38,585]],[[72428,76643],[-139,-16],[-4,-227],[-1250,205]],[[71035,76605],[116,-238],[102,-339],[160,-248],[62,-243],[33,-476],[143,-161],[0,-158],[116,-18],[151,-159]],[[60980,62847],[22,223],[-90,235],[100,158]],[[60061,64217],[-387,15]],[[59674,64232],[-7,-339],[-32,-54],[125,-170],[61,-174],[72,-56],[95,-229],[115,-172]],[[75960,62935],[73,353],[115,-16],[22,324]],[[75443,63625],[-39,-521]],[[78313,67756],[17,-283],[182,-240],[-47,-163]],[[78708,66569],[60,70],[243,-42]],[[79011,66597],[56,49],[120,588],[60,46]],[[79265,67334],[-54,13],[-129,193],[-44,236],[-203,272],[-80,19]],[[78755,68067],[-82,138],[-42,-118],[18,-269],[-336,-62]],[[76034,71951],[54,-11],[49,153],[67,-10],[85,196],[179,-35]],[[76490,72884],[-5,188],[-274,53]],[[76211,73125],[-105,21]],[[76106,73146],[-8,-418],[-64,-777]],[[71851,41778],[-39,-611]],[[72288,41074],[79,1158]],[[72399,42736],[-482,98]],[[71917,42834],[-66,-1056]],[[70432,48670],[-64,-1199],[32,-6],[-19,-333]],[[46597,52580],[-764,-67]],[[45833,52513],[10,-358],[-24,-2],[54,-1678]],[[55472,46423],[666,-8]],[[56138,46415],[7,1120],[-11,328]],[[56134,47863],[-167,-8],[-97,59],[-164,-145],[-110,52]],[[55596,47821],[-166,-30],[11,-584]],[[70486,39337],[39,672]],[[70525,40009],[-281,46],[-25,283],[27,390]],[[69661,40148],[-23,-387],[189,-32],[-18,-285],[95,-16]],[[74566,52828],[255,-509],[101,84]],[[75277,53765],[-100,70],[-262,364]],[[74428,53792],[-136,-166],[-10,-266]],[[63376,44387],[-27,-999]],[[61678,74232],[-10,-504]],[[61668,73728],[521,-35]],[[62189,73693],[77,-4],[-18,185],[53,45],[1,193],[161,44]],[[62463,74156],[56,227],[-99,104],[47,97],[23,262]],[[62490,74846],[-23,171],[-191,15]],[[62276,75032],[-579,40]],[[61697,75072],[-19,-840]],[[59044,49660],[-958,-5]],[[58086,49655],[-95,-2],[-21,-336],[10,-685]],[[64994,52916],[500,-61]],[[65494,52855],[52,1465],[7,358]],[[65553,54678],[-164,14],[12,281],[-63,62],[-204,18]],[[65134,55053],[-4,-173],[-199,19],[-22,-881]],[[63529,54999],[95,-15],[4,169],[326,-18]],[[63954,55135],[88,-5],[4,190],[102,276]],[[64148,55596],[36,165],[7,275]],[[64191,56036],[-413,34],[-391,-7]],[[63387,56063],[-193,9],[-3,-225]],[[53214,40139],[4,0]],[[53961,40264],[-2,895]],[[53956,42165],[-756,-12]],[[90171,34599],[256,-254],[100,201],[9,188],[90,-131]],[[90626,34603],[97,-12],[-10,191],[-54,101]],[[90659,34883],[-83,191],[143,194],[-168,374],[-35,190]],[[90516,35832],[-65,-43],[-104,103],[-67,-168]],[[83134,28647],[623,-212],[194,-34]],[[83527,29876],[-250,88],[-6,-66]],[[83271,29898],[-100,-923],[-40,12],[-33,-330],[36,-10]],[[85474,29373],[189,-69],[11,81],[158,-54],[-45,-293]],[[86348,29857],[-14,198],[-152,-2],[-23,-172],[-369,154],[4,33]],[[85794,30068],[-214,99],[-106,-794]],[[74900,40142],[0,-202],[189,-55]],[[75089,39885],[2,26],[608,-47],[1,20]],[[75700,39884],[29,1062]],[[75729,40946],[-397,27],[-3,-58],[-390,34]],[[75700,39884],[169,-43]],[[76394,41129],[11,138],[-61,11]],[[76344,41278],[-501,100]],[[75843,41378],[-18,-439],[-96,7]],[[83382,36248],[80,686]],[[83308,38269],[-80,-70],[-53,171],[-101,71],[-73,-139],[-298,-69],[-118,18],[-103,-68],[-16,-182]],[[72881,52444],[-41,474],[57,121],[-9,334]],[[72790,53440],[-279,134],[-268,-24]],[[72027,52935],[130,-85],[8,-116],[90,-69],[-63,-203]],[[70437,52331],[141,-293],[36,22],[183,-225],[-93,-121],[69,-124]],[[71214,52189],[-121,91],[125,564]],[[71218,52844],[-238,393],[-105,-78],[-11,184],[-110,288]],[[70754,53631],[-158,-197],[-16,-179],[-88,-167],[-73,-15],[-48,172],[-60,-20],[65,-167],[-16,-153]],[[47809,22407],[1114,87]],[[48923,22494],[15,1]],[[47935,22884],[-74,-156],[-82,2],[-64,-107],[94,-216]],[[77073,56425],[20,71],[153,-29],[181,48],[85,158]],[[76747,57028],[-80,-195],[78,32]],[[74511,47962],[120,-86],[6,-134]],[[74637,47742],[51,41],[75,-137],[329,-152]],[[75092,47494],[-10,107],[92,-16]],[[75174,47585],[-22,222],[151,118]],[[75170,48295],[-132,249],[-160,178],[-112,2]],[[77770,58835],[-92,-18],[-189,263],[-9,163],[49,103],[22,253]],[[77551,59599],[-164,60],[-105,123],[-326,152]],[[76956,59934],[-21,-169],[108,-106],[41,-133],[-4,-224],[-43,40],[-222,-29],[-133,39],[-198,-35],[-69,32]],[[55360,71330],[665,-14]],[[56316,71116],[2,426]],[[56322,72821],[-21,98],[-74,-103],[-63,44],[-203,-184],[-230,16],[-236,-311]],[[55419,72253],[-59,-923]],[[88074,53015],[50,-901],[87,-64],[-56,-132],[-137,-63]],[[88018,51855],[434,-140]],[[88452,51715],[31,77],[-58,220],[60,250],[213,74],[74,-19],[175,200]],[[88947,52517],[17,68]],[[88964,52585],[-34,144]],[[88930,52729],[-437,175],[-419,111]],[[56948,80779],[224,8]],[[56709,83116],[-34,-135],[24,-201],[-88,-81],[-131,-662]],[[56480,82037],[-137,-678]],[[71352,46406],[407,-77]],[[71759,46329],[4,55],[374,-88],[99,-125]],[[72163,47481],[-173,-99],[-68,59],[-122,-85],[-67,94],[-90,-66],[-152,104]],[[71367,46628],[-15,-222]],[[49474,50415],[-6,336],[208,11]],[[62166,81290],[99,-127],[72,-201],[118,40]],[[62455,81002],[68,29],[-20,131],[37,186],[-52,65],[68,87],[-65,215],[112,-32],[33,126],[-80,317]],[[54323,21053],[2,-332]],[[54340,22052],[2,-667],[-19,-332]],[[65867,72894],[-10,-149],[96,-170],[98,-54],[211,-416],[105,13]],[[66521,73506],[27,670]],[[66548,74176],[-942,92]],[[65606,74268],[-48,-395],[96,-141],[-33,-182],[51,-215],[195,-441]],[[64939,72573],[161,-170],[24,-103]],[[65124,72300],[12,328],[378,-36],[20,335],[333,-33]],[[64688,74365],[-41,-676]],[[85188,58163],[-4,-69]],[[85184,58094],[368,-264],[87,-142],[174,-83],[202,21]],[[86015,57626],[8,289],[-21,372],[63,316],[155,165],[173,264]],[[85673,59341],[-126,-267],[-166,-103]],[[85381,58971],[-127,-310],[-74,-305],[8,-193]],[[80492,55812],[72,-116],[58,-242],[-52,-142]],[[80570,55312],[100,-187],[81,-33],[-26,-285],[74,-74],[122,-7]],[[80921,54726],[102,-155],[35,-139],[51,64],[66,-128],[99,89],[45,136],[94,-138]],[[81413,54455],[201,240],[24,346]],[[74185,39511],[290,-66],[8,111],[192,-44],[4,56],[379,-88]],[[75058,39480],[31,405]],[[74213,40788],[-36,-8],[-91,-1248]],[[52674,62004],[3,-336]],[[52677,61668],[932,19]],[[53609,61687],[2,239]],[[53611,61926],[-55,33],[-128,-128],[-94,74],[-7,1949]],[[53327,63854],[-68,-174],[-131,69],[-81,-148]],[[53047,63601],[-157,217],[-115,-85],[-114,0]],[[54770,62360],[1,-335]],[[55254,61349],[663,-6],[5,998]],[[55922,62341],[-83,-132],[-110,123]],[[55729,62332],[-89,-18],[-22,134],[-439,346],[-68,-78],[-140,44],[-67,164],[-138,-31]],[[54766,62893],[4,-533]],[[12267,12732],[488,247],[20,126],[125,60],[57,259],[136,186]],[[13093,13610],[-9,225]],[[12637,14349],[-990,-508]],[[11647,13841],[-90,-48],[90,-511],[484,247],[136,-797]],[[89071,36209],[-89,-80]],[[88982,36129],[-705,-647]],[[88277,35482],[192,-300]],[[73204,52214],[218,-57],[177,157],[120,-198],[183,164]],[[73769,52707],[-38,156],[-203,140],[-57,220]],[[73471,53223],[-110,-102],[24,-107],[-176,-405],[-203,-228],[-8,-145]],[[72488,55230],[-53,-130],[-130,-159],[-34,-331],[-51,104],[-116,-235]],[[52102,81053],[-250,807],[-301,524]],[[51431,82547],[-877,-1301]],[[56480,82037],[-320,520],[-89,-49],[-223,-264],[-123,29],[-25,-136],[-98,-102],[-76,133],[-157,133],[-252,45]],[[55117,82346],[-3,-595]],[[55114,81751],[-1,-353],[-51,-1120]],[[44083,72460],[962,98]],[[77883,53123],[62,-137],[80,-29],[93,-166],[-23,-287],[250,-357]],[[78363,52117],[38,293],[150,361],[281,134]],[[78832,52905],[73,237],[-180,159]],[[78109,53748],[-216,-310]],[[85124,42484],[-10,-114],[94,50],[-55,227],[-29,-163]],[[77358,37590],[24,-6],[50,648],[81,121],[20,229],[66,-14],[59,654]],[[77182,39359],[-58,-608],[-166,33]],[[66548,74176],[128,-15],[19,127],[38,893]],[[66733,75181],[-192,44]],[[66129,75321],[-279,64]],[[60855,46887],[199,-4]],[[61269,49198],[-246,-133],[28,-91],[-92,-126]],[[60959,48848],[-27,-95],[45,-175],[-62,-35],[-110,-206],[-39,-183]],[[60659,47973],[-14,-106],[210,-980]],[[34439,10541],[-131,1484]],[[32550,12813],[8,-112],[-193,-51],[28,-298],[-143,-36],[-253,-351],[145,-346],[-647,-176]],[[31599,10361],[51,-543]],[[50912,40757],[234,-437],[97,-94],[151,-258],[194,-134],[98,-224]],[[36373,58547],[4,-63]],[[37351,58179],[-35,414]],[[36187,61612],[42,-673]],[[36229,60939],[13,-342],[107,-1731]],[[86015,57626],[38,-214],[73,-99]],[[86845,57578],[25,370],[28,45],[97,664],[-25,639],[127,82],[33,-56]],[[87130,59322],[-181,718]],[[53609,61687],[11,-680]],[[54770,62360],[-831,-4]],[[53939,62356],[2,-685],[-101,149],[-102,-99],[-27,62],[59,182],[-159,-39]],[[50997,57260],[1140,37]],[[52137,57297],[2,0]],[[52139,57297],[-13,1655]],[[52126,58952],[-384,-11]],[[50976,58914],[14,-1150]],[[76461,49260],[117,39]],[[76578,49299],[10,354],[-74,219],[10,109]],[[76033,49871],[-7,-311]],[[38087,57210],[845,141],[-9,167],[764,117]],[[39687,57635],[44,251],[-25,119],[67,231],[10,327],[47,94],[-39,180],[-94,189],[20,315]],[[52472,37438],[-765,-18]],[[51903,38764],[175,4],[-2,239]],[[15213,18312],[-140,938],[176,97],[-100,642],[367,182],[-49,319],[573,255],[-49,324],[187,83],[-49,322],[561,251]],[[14409,21015],[-1039,-488]],[[18461,29211],[918,364],[965,370]],[[20344,29945],[12,6]],[[20356,29951],[-493,3755]],[[19863,33706],[-178,1343],[-374,-142],[-146,403]],[[19165,35310],[76,-564],[-560,-252],[88,-652],[-1296,-515],[-568,-236],[57,-393],[-850,-358]],[[16112,32340],[-33,-14],[148,-1027],[41,19],[100,-672],[-31,-13],[91,-660],[226,-1506]],[[84876,31477],[1041,-362]],[[85917,31115],[62,-24]],[[85979,31091],[267,1498]],[[86246,32589],[-119,220],[-1036,390]],[[85091,33199],[-215,-1722]],[[71218,52844],[226,88],[40,154]],[[71196,54381],[-313,-167],[-172,-21]],[[70711,54193],[79,-88],[-21,-173],[-67,-1],[52,-300]],[[71531,49741],[111,149],[13,271],[177,186],[122,-30],[127,193],[66,-174]],[[74568,51288],[15,60],[346,410],[48,23]],[[76773,53520],[46,157]],[[76938,54548],[-125,27],[-192,208],[-42,95]],[[76579,54878],[-21,75],[-425,74]],[[73818,47445],[100,-161],[140,-114]],[[74058,47170],[47,387],[176,193],[113,266],[83,30]],[[89068,56578],[106,112],[369,-206],[-1,-400]],[[89542,56084],[196,-10],[85,209],[-84,402],[8,169],[-70,242],[-311,517],[-316,-217]],[[88944,54787],[40,-128],[1,-220],[46,-253]],[[89031,54186],[84,-344]],[[89115,53842],[36,25],[251,-124],[210,-234],[77,129]],[[89689,53638],[-12,123],[71,185],[-57,315],[40,336]],[[89731,54597],[-411,116]],[[89320,54713],[-365,126],[-11,-52]],[[80270,46458],[159,-372]],[[80429,46086],[69,-237]],[[80498,45849],[110,137],[21,118],[80,33],[103,254]],[[80812,46391],[119,79],[-138,287],[-495,725]],[[80298,47482],[-160,-776],[132,-248]],[[35987,22941],[1217,258],[76,29],[1288,259]],[[38943,23557],[-16,520],[-62,1120]],[[36718,24798],[-14,-132],[-133,-107],[-67,-197],[-144,-168],[-88,38],[-102,-151],[1,-191],[-117,-144],[28,-53],[-56,-260],[27,-135],[-66,-357]],[[89171,31500],[88,117],[115,286],[114,-27],[44,124],[135,-64],[102,31]],[[89900,32183],[-89,79],[-86,240],[-41,463],[-135,401]],[[89549,33366],[-53,70],[-110,-200],[-134,15],[-6,-399],[-368,190]],[[88878,33042],[34,-377],[-82,-112],[136,-70],[3,-159],[91,-155],[111,-669]],[[74007,46650],[251,259]],[[74258,46909],[-203,88],[3,173]],[[73639,47093],[224,-172],[129,14],[-30,-207],[45,-78]],[[84603,56995],[1,189],[152,225],[65,196],[161,100]],[[84982,57705],[-55,170],[148,165],[109,54]],[[85188,58163],[-46,44],[-235,-110],[-138,243],[-174,515]],[[84270,58482],[-82,-78],[-141,-394],[-184,-768]],[[84873,59573],[283,-67],[225,-535]],[[85874,60651],[-161,275],[17,113],[-71,85],[-33,286],[-42,57]],[[84775,60454],[-24,-29]],[[52169,81118],[258,255],[225,305],[105,798]],[[55815,78633],[902,-1275]],[[56717,77358],[-5,147],[99,43],[24,303],[72,87],[36,338]],[[56943,78276],[-181,404],[-494,843]],[[81472,53814],[112,-20]],[[81584,53794],[397,-105]],[[81981,53689],[305,-58]],[[81413,54455],[-29,-193],[65,-205],[23,-243]],[[42801,8880],[996,142],[647,81]],[[44444,9103],[-47,1051],[81,10],[-14,329]],[[42735,10258],[66,-1378]],[[82869,66643],[12,-18]],[[84070,68878],[-90,177],[-65,-52],[-82,123],[-29,-99],[-94,76]],[[72930,57444],[69,194],[162,22],[87,177]],[[73248,57837],[-22,173],[68,335],[-68,209]],[[72862,58589],[-12,-68],[-248,-356]],[[72602,58165],[-110,-465]],[[51693,76562],[627,-589]],[[89576,57545],[75,-130],[227,-151],[21,-256],[75,22],[44,206],[65,81],[115,-25],[-87,-220],[149,61],[49,241],[-93,301],[-106,80],[-109,506],[-13,244],[-117,-25],[-25,-262],[-76,-39],[40,263],[-99,60],[293,114],[138,-548],[123,-368],[129,-301],[221,-670],[68,41],[-147,333],[-349,927],[-135,531],[-41,304],[-50,-207],[-249,-99],[-169,44],[-236,139],[-342,284]],[[47901,76752],[122,40],[44,230],[209,-70],[163,149],[151,-272],[66,65]],[[48869,76930],[-41,1993]],[[73901,35607],[26,339],[28,-5],[29,393],[72,95]],[[74056,36429],[16,222]],[[73310,36814],[-29,-398]],[[73281,36416],[-46,-634]],[[54983,85636],[51,-126]],[[55034,85510],[97,-173],[88,-64],[192,127],[145,-189],[56,-375],[171,-5],[73,-540]],[[55856,84291],[180,-74],[135,21],[16,150],[73,-10]],[[56260,84378],[-31,347],[345,997]],[[56574,85722],[-78,115],[-116,-58],[-12,289],[40,86],[76,-124]],[[56484,86030],[-25,173]],[[56459,86203],[-233,344],[-279,470],[-112,29],[-132,129]],[[80219,40097],[301,-75]],[[80520,40022],[9,223],[-39,104],[24,159]],[[80433,41247],[-705,122]],[[79728,41369],[-24,-320]],[[75484,44821],[57,80],[76,-170],[295,-517]],[[75912,44214],[371,-79]],[[76283,44135],[-3,430],[88,45],[1,206]],[[76369,44816],[-12,557]],[[76357,45373],[-374,226],[-106,17]],[[75877,45616],[-340,72],[-53,-867]],[[75542,35585],[38,453]],[[75644,36980],[24,334]],[[74907,37480],[-75,-942]],[[66848,27026],[336,-39]],[[67184,26987],[238,-30]],[[67490,28292],[-193,28]],[[67297,28320],[-7,-176],[-388,51]],[[66902,28195],[-54,-1169]],[[85308,36316],[359,-491],[112,-128]],[[85779,35697],[30,146]],[[85809,35843],[51,398],[112,-7]],[[85343,37685],[-168,108],[-109,-96],[105,-404],[-51,-208],[63,-265],[143,-325],[-18,-179]],[[47624,57076],[706,50]],[[48692,58803],[-10,584]],[[48682,59387],[-129,22],[-79,97],[-122,428],[-112,85],[-173,-80],[-147,-206],[-6,-346],[-142,37],[-73,282],[-138,116]],[[47614,57437],[10,-361]],[[46628,28440],[28,2],[20,-664]],[[46676,27778],[1085,91]],[[47760,29604],[-28,-64],[-182,28],[-193,-191],[-147,202],[-157,-60],[-240,-434],[-34,78],[-59,-155],[-111,22]],[[69472,56061],[94,-17]],[[69566,56044],[140,1026]],[[68863,56693],[29,-173],[-93,-519]],[[41760,67183],[86,-1835]],[[41846,65348],[1,-39]],[[41847,65309],[784,96]],[[47715,65136],[325,20],[18,-837]],[[48831,63991],[120,-138],[67,43],[-58,360],[39,206],[176,13],[14,96],[-94,26],[-17,118]],[[49078,64715],[34,184],[-147,2],[-112,355],[-22,412],[62,128],[-34,70]],[[48859,65866],[-302,-483],[-36,302],[-141,-80]],[[48380,65605],[-190,-90],[-40,159],[-176,-36],[-102,-162],[-157,-340]],[[79865,61167],[127,127],[35,149],[199,133],[124,177],[106,8]],[[80856,61895],[-80,337],[-34,20],[-80,350],[-179,288],[-61,405]],[[42233,20439],[1628,221]],[[43861,20660],[83,11]],[[79863,43997],[-41,146],[127,137],[48,269],[150,-23]],[[80147,44526],[-154,410],[-2,84]],[[79991,45020],[-102,100],[-196,-125],[-85,115]],[[79608,45110],[-97,-168],[17,-153],[-91,-57]],[[79437,44732],[228,-488],[198,-247]],[[66466,25746],[572,-56]],[[67038,25690],[86,-20],[60,1317]],[[66848,27026],[-534,74]],[[45424,20429],[23,-579]],[[45355,18215],[13,-329]],[[12669,9647],[108,15],[52,185],[-35,171],[77,181]],[[12642,11543],[-540,-250],[6,-37],[-372,-192]],[[11736,11064],[83,-454],[-14,-161],[104,-70],[35,-110],[40,-404],[-24,-441],[26,-34],[96,314],[66,81],[7,-125],[173,-4],[43,118],[95,-68],[69,47],[134,-106]],[[87429,35403],[107,-142],[-1,-322],[95,-295]],[[88277,35482],[-149,203],[-2,245],[-89,25],[-154,232],[-130,118],[-137,55],[-157,133]],[[87275,36326],[-321,-292]],[[86246,32589],[102,-9]],[[86348,32580],[188,660],[302,291],[250,25]],[[87088,33556],[-183,529],[-78,35]],[[86827,34120],[-158,-9]],[[86417,34329],[-109,0],[-2,240],[-264,166]],[[86042,34735],[-33,12],[-322,-480],[-48,12],[-349,-426],[-169,-414]],[[85121,33439],[-30,-240]],[[73968,58582],[40,73]],[[74008,58655],[-40,-73]],[[73248,57837],[136,-252],[91,-51],[366,126],[6,149],[88,36]],[[73935,57845],[55,246],[53,0],[-25,397],[-45,71]],[[73973,58559],[0,-111],[-167,130],[-206,-61],[-74,133],[-149,17]],[[61641,26233],[192,-14]],[[61833,26219],[36,1338],[-110,146],[-15,150],[78,85],[55,196],[-32,275]],[[61845,28409],[-161,-164],[-91,-182],[-243,-260]],[[61350,27803],[-108,-350],[-13,-180],[-56,-95],[-202,-169]],[[44086,55211],[835,79]],[[45784,55362],[214,19]],[[45998,55381],[-32,576],[-42,1344]],[[44009,57107],[50,-1342],[27,-554]],[[87088,33556],[49,-147],[159,-64]],[[87137,35086],[-14,-296],[-101,-125],[-33,-201],[-84,-9],[-78,-335]],[[45406,20844],[3,0]],[[47718,21066],[20,2]],[[47738,21068],[167,298],[12,204],[93,421],[-17,130],[-141,79],[-43,207]],[[46169,22729],[-829,-85]],[[56115,76578],[124,84],[74,-52],[49,168],[83,79],[0,194],[68,-13],[117,173]],[[56630,77211],[87,147]],[[55186,78499],[-21,-161],[89,-107],[-37,-170],[43,-241],[129,-181],[-66,-218],[-38,-303],[-67,-15],[14,-177]],[[49058,76851],[120,196],[109,-26],[29,117],[152,13],[39,88],[31,-157],[78,152],[-5,199],[76,-109],[18,212],[112,-29],[-27,263],[67,94]],[[49857,77864],[-14,123],[109,169],[-74,120],[45,135],[81,-113],[44,161],[-52,42],[83,145]],[[87576,48289],[163,143],[139,47],[137,-25],[82,100]],[[88097,48554],[57,28],[46,396]],[[88200,48978],[-106,142]],[[88038,49084],[-91,-193],[-86,170],[-48,-146],[-63,53],[-260,19]],[[87490,48987],[10,-244]],[[84594,44893],[103,-558],[73,28],[154,-431]],[[85101,44643],[-45,273],[-78,179],[-9,186]],[[84935,45503],[-108,16],[-144,-111],[-32,-113],[-103,-21],[46,-381]],[[48993,32455],[-1079,-77]],[[47928,30872],[8,-334],[-27,-4],[24,-905]],[[39549,84455],[-83,-82],[-263,-105],[-310,-380],[-209,-532],[-142,-44],[-109,-218],[-122,-160],[-128,-276],[-31,-368],[-76,-198],[-113,-423],[10,-193],[-37,-296],[50,-126],[14,-359],[-117,-486],[-170,-370],[20,-106],[-57,-593],[-43,-139],[-104,-108]],[[25609,49281],[-376,-114],[-17,165]],[[25216,49332],[-235,-72],[-10,96],[-371,-145],[19,-178],[-380,-121],[36,-339],[-196,-62],[-5,52],[-801,-260]],[[56745,75597],[916,-16]],[[57661,75581],[56,172],[17,357],[35,200]],[[57924,77951],[-135,-294],[-103,-69],[-41,-240],[-138,-77],[-81,-148],[-275,-43],[-262,-262]],[[56889,76818],[-52,-195],[-60,-5],[-82,-452],[-4,-215],[71,-50],[-81,-60],[64,-244]],[[53204,82066],[103,-140],[14,-167],[95,-56],[86,-155]],[[53502,81548],[421,-174],[238,-136]],[[54161,81238],[59,79],[133,-92],[95,54],[-9,148]],[[54439,81427],[116,80],[2,322]],[[54557,81829],[-127,71],[8,250],[-71,11],[88,261]],[[54455,82422],[-26,63],[-248,-165],[-447,117],[-129,1],[-70,77]],[[28446,34920],[-125,-41],[-25,235],[-118,79],[-344,-101],[-520,861]],[[27314,35953],[-534,140],[-662,-205],[-1382,-443]],[[24736,35445],[380,-3347],[43,-412]],[[52005,67619],[60,95],[-24,191],[67,88],[98,2],[69,-204],[147,40],[86,-201],[57,93],[22,200],[-73,148],[60,248],[138,40],[19,-311],[191,-296],[-15,-242],[92,2]],[[52999,67512],[-11,2051]],[[52988,69563],[-813,-71]],[[51982,69474],[23,-1855]],[[48354,66802],[26,-1197]],[[48859,65866],[30,472],[94,-14],[172,91],[168,-47]],[[49323,66368],[-28,1458]],[[54287,77275],[853,-787]],[[54276,78961],[-36,-125],[33,-210],[-72,-135],[-31,-326],[-64,-274],[24,-401]],[[51584,86049],[-281,383],[345,751]],[[51243,87725],[-92,-12],[-174,-194],[-179,106]],[[50798,87625],[-178,-376]],[[81074,51066],[-53,81],[323,413]],[[81270,51870],[-334,289],[-201,-44],[-98,139],[-140,297]],[[80497,52551],[-120,-194]],[[87081,50868],[333,-565]],[[87414,50303],[368,-594]],[[88207,50222],[-250,424],[-473,756]],[[87484,51402],[-110,-15],[-8,-556],[-82,98],[-118,14],[-85,-75]],[[85555,51314],[8,-741]],[[85901,50305],[26,82],[297,243],[127,-89]],[[86351,50541],[63,941]],[[86414,51482],[-157,-29],[-229,37],[-152,-113],[-143,-12],[-37,59],[-141,-110]],[[80147,44526],[227,21]],[[80560,45636],[-62,213]],[[80429,46086],[-41,-95],[-98,7],[-57,-359],[-113,-178],[-6,-195],[-123,-246]],[[79273,50584],[79,79]],[[79522,52063],[-179,134],[0,199],[-92,142],[-130,20]],[[79121,52558],[-37,-260],[-171,-354],[-44,-226],[-118,-61]],[[85364,52134],[191,-820]],[[86414,51482],[66,897]],[[86480,52379],[-485,159]],[[85763,52617],[-485,156]],[[75593,48902],[-155,334]],[[75438,49236],[-343,260]],[[75095,49496],[-176,-144],[27,-258],[-89,-96]],[[80674,53979],[798,-165]],[[80921,54726],[-60,-297],[-177,-341],[-10,-109]],[[85946,48976],[114,-27],[73,-181],[205,-2],[101,191]],[[86439,48957],[-16,210],[152,77],[-3,116],[93,106],[92,-134],[102,88]],[[86859,49420],[-137,330],[-84,28]],[[86638,49778],[-797,-146]],[[88425,47550],[107,22],[306,182]],[[88947,48165],[-54,153],[148,267],[60,23],[-243,217]],[[88519,48396],[-116,-161]],[[84574,43126],[164,60],[-2,-110],[77,-205],[83,-2],[10,138],[77,179]],[[84594,44893],[-451,-480]],[[84143,44413],[88,-506],[93,-211],[21,98],[130,-347],[40,58],[64,-230],[-5,-149]],[[79121,52558],[-78,61],[-101,187],[-110,99]],[[60746,22304],[193,-14]],[[61706,22240],[35,1319]],[[61554,23897],[-772,50]],[[12200,7276],[1069,557]],[[13269,7833],[-240,1500]],[[13029,9333],[-544,-281],[-64,347]],[[12421,9399],[-119,-38],[-132,107],[-46,-46],[-71,-291],[-48,-51],[-121,130],[111,-417],[71,-389],[70,-510],[37,210],[-68,308],[-52,442],[91,47],[-8,-268],[34,-190],[53,107],[111,-181],[-33,-413],[78,-104],[162,-98],[-67,-161],[-51,67],[-143,23],[-108,-231],[28,-176]],[[78744,49012],[239,-216],[190,-89]],[[79173,48707],[-69,169],[218,93],[142,17],[55,176],[-34,82],[122,193],[121,-114],[86,142]],[[79814,49465],[-259,212],[125,163],[-161,202]],[[79519,50042],[-114,-43],[-194,92],[-16,111],[-103,-212],[-71,19],[-58,-177],[-15,-194],[-82,-128],[52,-91],[-36,-147],[-71,-33],[-67,-227]],[[11859,46070],[140,-143],[207,0],[258,-60],[208,78],[102,-19]],[[12774,45926],[626,-657],[189,80],[24,-163],[133,-76],[37,-245],[587,-613]],[[14416,44426],[76,132],[43,-72],[124,64],[74,228],[19,401]],[[67791,25351],[35,-130]],[[67826,25221],[573,-82]],[[68399,25139],[-125,495],[-73,875]],[[67846,26564],[-55,-1213]],[[65486,45414],[286,-37]],[[66471,45972],[21,504]],[[65671,47421],[-102,12]],[[35060,45164],[191,-110]],[[35251,45054],[16,230],[125,198],[13,138],[369,75],[105,213],[-15,102],[150,224],[81,-51],[94,139],[106,-228],[161,23],[84,197]],[[36540,46314],[67,12],[133,356],[92,-23],[154,108],[-56,174],[-101,85],[-49,397],[-61,98],[94,235],[47,221],[-14,183],[157,475]],[[35632,49442],[-981,-201]],[[34651,49241],[-7,-399],[-65,-217]],[[71178,45308],[220,-46]],[[71681,45202],[78,1127]],[[71352,46406],[-88,17],[-51,-776],[-35,-339]],[[79497,76542],[85,-97]],[[79582,76445],[248,74],[46,197],[137,156],[314,-3],[49,56],[27,397]],[[80403,77322],[-202,26]],[[80201,77348],[-858,102]],[[79343,77450],[-43,-631],[67,-244],[130,-33]],[[84982,57705],[294,-931]],[[85349,56509],[392,130]],[[86879,29177],[196,-81]],[[87075,29096],[163,648],[-36,189],[104,697]],[[87306,30630],[-64,23]],[[87242,30653],[-665,234]],[[86577,30887],[2,-203],[-82,-381],[43,-13],[-61,-475]],[[89161,52225],[173,-168]],[[89334,52057],[193,402],[109,33],[100,166]],[[89736,52658],[143,317],[-460,-182],[170,188],[144,24],[-36,78],[-150,91]],[[89547,53174],[-294,-24],[-94,-483],[22,-79],[-20,-363]],[[69884,58494],[9,90],[-299,291],[-5,261]],[[38126,52113],[83,-117],[263,-135],[99,161],[84,19],[-61,134],[62,150],[-15,347],[52,224],[-51,38],[1,371]],[[38643,53305],[-66,1143]],[[38577,54448],[-116,-18]],[[39532,42828],[0,0]],[[39798,39133],[1483,215]],[[42081,39460],[-55,1151],[-45,685]],[[40926,43168],[-1370,-209]],[[39556,42959],[-155,-25]],[[39401,42934],[53,-1005]],[[39454,41929],[16,-336],[187,31],[141,-2491]],[[74458,62445],[11,-204],[126,-24],[-11,-169],[67,-42],[48,-462]],[[74699,61544],[6,-1]],[[74705,61543],[300,-60]],[[74912,62873],[-19,75],[-226,19]],[[74980,46563],[36,77],[284,72]],[[75300,46712],[122,-87],[134,44]],[[75556,46669],[-101,701]],[[75455,47370],[-159,19],[-122,196]],[[75092,47494],[-120,-910],[8,-21]],[[71851,41778],[-639,127]],[[71175,41299],[-7,-112],[638,-130]],[[73751,54208],[27,-285],[61,-153],[176,-628]],[[74063,54404],[-87,139],[-221,-183],[43,113]],[[68610,55296],[-69,-255],[-99,-166]],[[48507,54093],[-29,1472]],[[48478,55565],[-815,-64]],[[47663,55501],[-153,-12]],[[47510,55489],[34,-1484],[-28,-3],[9,-339]],[[85821,54642],[-263,-123],[-118,51]],[[91116,56056],[15,52]],[[91131,56108],[-308,429],[-101,207],[24,-238],[370,-450]],[[89731,54597],[244,-61],[-12,327],[149,-11],[77,-439],[107,90],[87,-13]],[[90383,54490],[52,-34]],[[90435,54456],[198,-73],[96,305]],[[90729,54688],[-111,231],[-60,255],[-21,271],[-66,38],[6,132],[-110,207],[-173,-22],[-185,80],[-268,-2],[-115,-114],[-126,-342],[192,-79],[-4,-172]],[[89688,55171],[-138,-58],[-148,-199],[-82,-201]],[[64204,70717],[-11,-345],[395,-32]],[[64694,70999],[-181,352],[3,83],[121,-15],[15,187],[-94,151],[151,140],[-106,114]],[[64603,72011],[-452,39],[-18,-674],[79,-415],[-8,-244]],[[78755,68067],[-13,210],[47,151],[-33,160]],[[78756,68588],[-155,-205],[-364,404]],[[78028,67829],[186,26],[99,-99]],[[50676,32545],[48,198],[252,261]],[[50976,33004],[1,466]],[[49429,33227],[19,-744]],[[83970,46853],[22,-131],[143,-26],[-40,246],[-125,-89]],[[54203,40154],[186,191],[254,-268],[115,49],[180,-3]],[[50424,27931],[588,27]],[[29993,74676],[-1790,-441],[-864,-222]],[[57548,65337],[4,-854]],[[57958,66539],[-415,22]],[[57543,66561],[5,-1224]],[[82263,61815],[113,148],[57,-22],[56,126],[-63,440]],[[82426,62507],[-428,260],[-41,83],[-157,17],[22,172],[-98,-95],[-176,-84]],[[81548,62860],[-120,-305],[-143,-461],[-17,-154]],[[12100,58185],[117,62],[-12,96],[-110,-35],[5,-123]],[[12559,54917],[106,47],[-12,79],[186,80],[46,108],[-23,162],[470,207],[-11,81],[168,71]],[[13489,55752],[167,2048],[-19,190],[-65,-6],[-37,256],[-215,-90],[-321,235],[-24,108]],[[12975,58493],[-144,-211],[-156,-133],[-129,-238],[-38,-440],[-141,-325],[-160,-298]],[[11421,60871],[95,16],[146,289],[-91,11],[-115,-121],[-35,-195]],[[14300,60238],[156,-345],[178,-167],[20,-148],[347,137]],[[15159,60077],[115,446],[74,76],[-20,179],[104,67],[88,211],[-238,401],[-14,109]],[[15268,61566],[-16,133],[-134,9],[-65,238]],[[15053,61946],[-62,-236],[-116,-124],[-84,-354],[-140,-256],[-83,-86],[-268,-652]],[[80835,84545],[487,-121],[10,109],[301,-81]],[[80897,85535],[-1,-606],[-58,-205],[-3,-179]],[[81407,71018],[612,-503]],[[82019,70515],[132,530]],[[82151,71045],[62,170],[134,154],[103,317],[111,-76],[145,219],[-58,171],[73,330]],[[82721,72330],[-82,22]],[[58011,30651],[12,938]],[[58039,32925],[-768,23]],[[57271,32948],[-13,-1333]],[[44156,52701],[13,-364]],[[44971,53775],[-851,-92]],[[38643,53305],[100,-24],[185,-225],[127,-82],[86,48],[233,-40],[103,-126],[9,-155],[61,-33],[199,-258],[33,-178],[176,-444],[200,-277]],[[41774,52415],[574,75]],[[40597,54758],[-584,-76],[-1165,-181],[-271,-53]],[[65782,48398],[17,335],[-193,25]],[[64797,48393],[80,-137]],[[64877,48256],[1,-168],[-290,-257]],[[81961,90993],[239,-56],[-28,-330],[393,-95]],[[83626,91247],[-986,250]],[[82640,91497],[-28,-400],[-67,-30],[6,-268],[-80,35],[-103,170],[97,463],[-138,114]],[[82327,91581],[-109,-51]],[[82218,91530],[-47,-135],[-210,-402]],[[69809,49775],[9,170],[-260,42],[7,138]],[[69565,50125],[-384,47]],[[68654,50011],[-9,-103]],[[63174,36970],[185,-17],[124,130],[59,-108],[161,-8],[175,-73],[111,160],[152,-14]],[[64141,37040],[-34,319],[8,228],[-112,98],[-75,169],[-214,62],[-101,205],[-215,57]],[[12555,22605],[69,-251],[269,130],[180,-469],[119,-156],[-29,-143],[21,-255],[-38,-208],[-84,-175]],[[14170,27368],[-902,-432]],[[11937,26259],[295,-1724],[323,-1930]],[[52828,86100],[-651,903]],[[68938,74469],[20,-1289]],[[68962,72867],[918,-137]],[[69880,72730],[-161,121],[42,380],[-96,490],[-88,44],[8,140],[88,90]],[[69673,73995],[11,120],[-94,46],[68,100],[-75,76],[-78,333],[82,254],[69,-42],[43,230]],[[69699,75112],[-709,105]],[[68990,75217],[-52,-748]],[[68974,71827],[13,-1356]],[[68987,70471],[3,-240]],[[68990,70231],[312,-62]],[[69982,71861],[-87,47],[-126,272],[-101,107],[-17,220],[147,105],[82,118]],[[58533,57624],[502,-21]],[[59514,57583],[39,-2]],[[59553,57581],[11,1454]],[[59564,59035],[-320,2]],[[59244,59037],[-128,1],[-64,-227],[-63,-57],[0,-223],[-81,-58],[8,-109],[-282,-2]],[[11739,51024],[1142,499]],[[12881,51523],[1798,760],[872,358]],[[15655,56510],[-1632,-644],[-471,-196],[-63,82]],[[12505,54894],[97,-656],[-149,-108],[64,-339],[-202,-67],[49,-328],[-249,-113],[49,-326],[-124,-56],[49,-328],[-204,-91],[16,-109],[-123,-285],[51,-328],[-189,-83],[99,-653]],[[83626,91247],[91,960]],[[83717,92207],[33,339],[-191,56],[35,388],[-321,88],[-58,-39]],[[83215,93039],[-163,-330],[-224,-187],[-16,-142],[-106,19],[34,134],[-94,61],[-113,-560],[-102,-144],[106,-95],[76,111],[27,-409]],[[82261,91868],[41,48],[195,645],[193,133],[47,-69],[103,43],[-160,144],[-215,-201],[-193,-580],[-11,-163]],[[82327,91581],[-58,38],[-21,169],[-30,-258]],[[35850,38392],[764,154]],[[36727,42751],[-46,10],[-643,-122]],[[36077,41977],[34,-513],[-674,-130]],[[35437,41334],[104,-1216],[96,19],[15,-222],[96,20],[102,-1543]],[[66093,52915],[0,-18]],[[66093,52897],[86,25],[33,-152],[520,-64]],[[66732,52706],[197,-10]],[[66929,52696],[38,1028]],[[66967,53724],[-359,24]],[[66608,53748],[-417,51]],[[66191,53799],[87,-48],[19,-169],[-40,-187],[-150,-363],[-14,-117]],[[48628,55575],[-150,-10]],[[69905,51107],[63,67]],[[69968,51174],[89,100],[100,15],[76,206],[96,-81],[42,-413],[90,-106]],[[68478,81607],[101,196],[44,242],[-12,424],[-71,256],[53,-491],[-17,-291],[-98,-336]],[[67590,81695],[275,-427],[-59,263],[111,185],[-101,177],[-25,-152],[-188,26],[-13,-72]],[[66608,82046],[41,192],[123,19],[89,-92],[-21,196],[103,140],[180,-70],[33,-303],[-18,-133],[162,-196],[17,-149],[218,138],[-112,123],[4,112],[106,44],[30,197],[99,-57],[71,-279],[109,68],[-17,183],[-95,14],[-75,153],[156,-28],[-22,99],[-245,128],[134,176],[76,-81],[-46,200],[-161,-103],[-74,190],[2,326],[-61,25],[-53,-278],[-73,6],[-9,217]],[[67279,83223],[-184,-19],[-113,-123],[-47,-135],[-167,-12],[-55,-149],[-83,41],[-109,-275]],[[66521,82551],[-39,-198],[-168,-79],[37,-171],[72,24],[185,-81]],[[28759,28781],[5,124],[-62,140],[-75,1],[-55,175],[23,258],[-55,142],[28,365],[86,-49],[141,41],[6,324],[41,83],[-34,353],[31,10],[-6,418]],[[28833,31166],[-32,-8],[-62,606],[-141,-42],[11,-110],[-231,-66]],[[27987,30580],[32,-245],[49,0],[39,-278],[-105,-229],[13,-138],[-63,-19],[-9,-228],[41,-464],[-86,-263],[-100,93],[-96,-3],[-68,96],[-3,-181]],[[27631,28721],[29,-137],[114,-94],[985,291]],[[45562,43729],[145,13]],[[77352,76141],[214,-44]],[[77566,76097],[9,136],[508,-96]],[[78083,76137],[80,1125],[15,320]],[[78178,77582],[-505,58]],[[77673,77640],[-146,17]],[[75451,75642],[-21,-206],[32,-271],[-20,-139],[37,-195]],[[75479,74831],[39,112],[168,-100],[222,-37]],[[76270,74993],[39,668]],[[75827,76478],[-193,27]],[[75634,76505],[-31,-120],[-156,-271],[-37,-340],[41,-132]],[[30040,26812],[110,-1140]],[[88708,40456],[-60,-17],[69,-268],[-62,2],[21,-420],[-169,119]],[[88507,39872],[-347,-579]],[[76548,29328],[49,246],[157,448],[-51,208],[-6,461],[38,172],[-41,610],[-113,256],[-61,-10],[-62,156],[-9,-215],[-59,-76],[119,-301],[-137,-27]],[[76372,31256],[-42,-78],[-76,-725],[-393,108]],[[63756,64442],[854,-63]],[[64610,64379],[72,276],[-31,169]],[[64651,64824],[-33,158],[51,190],[-24,94],[-138,148],[8,186],[-65,25],[12,-180],[-143,29],[46,221],[-41,104],[-122,61],[-20,238],[-111,-133],[-46,115],[86,119],[131,-16],[-31,177],[-138,-94],[-79,182]],[[63996,66452],[-299,27]],[[63697,66479],[69,-102],[-32,-124],[57,-159],[-38,-125],[31,-337]],[[9545,40922],[135,90],[55,116],[156,-47],[134,44],[83,123],[118,-21]],[[10226,41227],[30,154],[156,92],[115,-84],[54,-112],[137,69]],[[10590,42398],[-730,41],[-79,-148],[34,-48],[-59,-168],[-211,-174],[-40,-269],[-63,-140],[-76,-3]],[[9366,41489],[-119,-110],[-36,-230],[114,-5],[16,-111],[116,44],[88,-155]],[[92519,30002],[70,-48],[34,333],[105,-70],[66,45],[130,-191]],[[93447,31131],[-61,-24],[-163,75],[-24,98],[-109,-41],[-233,173],[-30,-177],[-124,417],[-61,2],[-71,194]],[[92571,31848],[-35,-225],[29,-297],[-94,-84],[-155,-238],[-233,-142]],[[92083,30862],[-35,-123],[260,-155],[-37,-150],[107,-97],[38,-161],[103,-174]],[[70336,49855],[17,328],[-94,16],[-31,243],[-96,28],[-172,526],[8,178]],[[69638,50983],[-17,-362],[-40,7],[-16,-503]],[[72055,48728],[-14,-270],[183,-91],[50,-234]],[[72741,47872],[126,-26],[122,56]],[[72989,47902],[8,240]],[[72997,48142],[-100,236],[-180,146],[-38,237]],[[72679,48761],[-44,315],[-103,143],[-95,-57]],[[82137,83197],[572,-148],[-30,-330],[39,-10],[-83,-863]],[[82635,81846],[76,252],[171,70],[84,283],[69,-14],[31,118],[223,247],[34,331],[-22,74]],[[83301,83207],[-78,231],[19,148]],[[82917,85361],[-585,158]],[[74773,45850],[191,532]],[[74964,46382],[-299,328]],[[74665,46710],[-91,-153],[28,-216],[-52,-145],[8,-190],[-74,-92],[-48,-277]],[[74436,45637],[79,-115],[61,229],[197,99]],[[63946,78465],[221,-19]],[[64614,78404],[-64,226],[40,201],[-21,116],[51,171],[-16,362]],[[63753,79823],[-24,-15]],[[63729,79808],[-26,-172],[151,-380],[60,-650],[32,-141]],[[79242,78878],[55,-211],[-15,-122],[68,-174]],[[79350,78371],[20,-128],[129,-111],[159,-3],[194,143],[230,113]],[[80082,78385],[110,1330],[69,63],[-65,145]],[[80196,79923],[-113,108],[-25,99]],[[63067,78536],[879,-71]],[[63729,79808],[-41,-15]],[[63021,78651],[46,-115]],[[62897,78377],[122,-8],[8,190]],[[62849,78479],[48,-102]],[[97917,17647],[84,122],[10,231],[-79,75],[-76,-426]],[[97633,18829],[27,-143],[42,237],[-69,-94]],[[97421,17896],[20,-151],[117,-211],[42,177],[116,210],[-35,153],[-96,90],[-81,-41],[-26,-244],[-57,17]],[[97207,17459],[9,305],[-32,42],[33,302],[92,-20],[-59,124],[76,128],[-21,170],[-153,63],[-30,263],[-83,44],[18,189],[-55,59],[-9,-300],[-56,-24],[-65,179],[-20,-201]],[[96852,18782],[-13,-197],[60,-3],[41,-206],[-71,-136],[-11,-143],[-100,-257],[-106,47],[-99,-157],[-34,-189],[55,-83]],[[75079,32521],[757,-221]],[[75836,32300],[345,-96]],[[76181,32204],[-57,398],[-217,184],[-80,326],[37,576],[-84,104],[16,140]],[[75796,33932],[-212,-203],[-382,121]],[[66121,62853],[35,857]],[[66156,63710],[-343,38],[-4,55],[-199,214],[-265,-167],[-49,139]],[[65296,63989],[-22,-523],[-186,19]],[[65088,63485],[92,-190],[-5,-169],[-114,-160]],[[86763,41235],[1,-2]],[[87246,41081],[99,118],[64,-33],[22,180],[187,141]],[[87618,41487],[-112,375],[-79,129]],[[87427,41991],[-93,-77]],[[64988,52746],[60,-121]],[[65048,52625],[172,-599],[100,-218]],[[65320,51808],[64,13],[94,-149],[117,183],[74,23],[121,156]],[[65790,52034],[18,166],[90,28],[65,133],[110,52],[20,230],[75,150],[-75,104]],[[66093,52915],[-124,-18],[-23,-107],[-120,88],[-332,-23]],[[63784,46749],[84,516],[-49,138],[98,453]],[[63917,47856],[-236,112],[-1,129],[-218,-8],[-41,59]],[[56760,15741],[32,1647],[3,659],[-195,4]],[[56600,18051],[-578,8]],[[56022,18059],[-16,-1324]],[[56006,16735],[-4,-657],[-22,-331]],[[57180,55736],[-689,13]],[[56491,55749],[-116,2]],[[56375,55751],[-11,-1314]],[[53430,22707],[911,11]],[[54553,23382],[-2,659],[23,241]],[[53998,23706],[-80,-189],[-150,-125],[-104,-15],[-74,-174],[-44,-222],[-116,-274]],[[89533,40193],[148,151],[129,382],[-6,193],[72,361],[101,93],[95,276]],[[90072,41649],[-123,-17],[-14,177],[-133,108],[-85,301],[-280,127]],[[89245,41179],[-63,-383]],[[21607,21951],[694,267]],[[21727,23354],[-228,-29],[-74,-200],[-63,-25],[-18,-179]],[[21344,22921],[140,-501],[-36,-266],[76,-28],[83,-175]],[[73281,36416],[-641,142]],[[80039,81277],[318,-52],[39,77],[192,-55]],[[81093,81432],[93,1017],[-254,66],[52,642]],[[80984,83157],[-138,171],[-157,-57],[-122,186]],[[80567,83457],[-20,-230],[-118,-57],[2,-272],[-47,-34],[-333,3],[-96,205],[-93,-308],[-17,-189],[-156,-50]],[[80720,77284],[-78,9]],[[80642,77293],[-239,29]],[[79582,76445],[-96,-1195]],[[70882,35980],[-67,-1194]],[[70815,34786],[755,-128]],[[71151,35930],[-269,50]],[[66266,62836],[528,-57]],[[66794,62779],[24,576],[97,-12],[43,1005],[96,-13]],[[66288,64537],[-21,-504],[-96,11],[-15,-334]],[[71753,31920],[-384,71]],[[44621,39763],[1338,136]],[[45959,39899],[-34,1179]],[[44585,40741],[35,-972]],[[44620,39769],[1,-6]],[[91624,36472],[9,479],[58,833],[-37,307],[-135,748],[-51,77]],[[91468,38916],[-114,50],[-90,-197]],[[91264,38769],[25,-163],[-89,-667],[-425,-1043]],[[90775,36896],[194,-446],[242,-75],[57,181],[141,-22],[71,-147],[85,155],[59,-70]],[[69163,44600],[254,-42]],[[69729,44512],[16,336],[-66,8],[52,1005]],[[69110,45956],[-5,-207],[111,-152],[-26,-497]],[[85917,31115],[-123,-1047]],[[86577,30887],[-598,204]],[[73865,46508],[146,37],[-4,105]],[[73352,47426],[-59,-855]],[[56023,18390],[-1,-331]],[[56600,18051],[24,1561],[74,95]],[[40396,29562],[1359,193]],[[41662,31680],[-73,1490]],[[57140,50029],[521,10],[97,79],[331,1]],[[58089,50119],[-5,898],[44,0]],[[58121,51702],[-135,-78],[-183,34],[-651,-17]],[[50879,44096],[20,-1341]],[[51663,42783],[-16,1343]],[[51647,44126],[-187,-6]],[[51460,44120],[-581,-24]],[[73115,47296],[-171,59],[-30,162],[75,385]],[[90799,32714],[586,304]],[[91385,33018],[3,314]],[[91388,33332],[-7,144]],[[91342,33821],[-68,-70],[-82,143],[-6,136],[-105,-55]],[[91081,33975],[11,-137]],[[91092,33838],[-5,-150],[-88,-392],[-144,-2],[-95,-119],[39,-461]],[[91073,31859],[686,-456]],[[91759,31403],[27,269],[154,265],[-338,583],[165,285],[10,101]],[[91777,32906],[-23,153],[-101,185],[2,141]],[[91655,33385],[-267,-53]],[[91385,33018],[-58,-498],[-196,-392],[16,-177],[-74,-92]],[[83024,27661],[18,150]],[[83042,27811],[-76,-12],[-140,146],[-203,8],[-151,188],[0,121],[-83,16],[-106,-143],[-118,39]],[[82165,28174],[-93,-17],[26,-264],[-93,-436],[355,-325],[301,-251],[263,-137]],[[80073,54856],[177,113],[153,263],[167,80]],[[80026,55957],[-53,-210],[-156,-146],[5,-219],[-45,-47]],[[54679,24376],[1244,-9]],[[55556,25902],[-25,-131],[-186,-243],[-90,-205],[-102,-121]],[[52708,55745],[703,13]],[[53411,55758],[-8,837],[-125,54],[-21,93],[-98,-32],[-77,250],[-175,-63],[-59,66],[32,315],[-23,35]],[[52857,57313],[-718,-16]],[[52137,57297],[15,-1563]],[[68028,52539],[27,679]],[[67552,53621],[-42,-1010]],[[88522,33482],[63,-267],[58,-58]],[[88643,33157],[235,-115]],[[89549,33366],[39,-23]],[[36229,60939],[-1713,-347]],[[28120,24889],[-472,-146],[104,-988]],[[71815,21877],[7,119],[79,-12],[85,224],[53,-85],[362,-65]],[[72401,22058],[21,333]],[[71400,22571],[9,-245],[231,-376],[175,-73]],[[71033,20248],[123,104],[-12,121],[-115,-102],[4,-123]],[[70925,21159],[19,-326],[43,-121],[-3,-187],[103,3],[51,546],[-100,163],[-113,-78]],[[70780,20656],[76,-41],[-20,182],[-56,-141]],[[74820,33948],[121,1366]],[[74750,35370],[-785,221]],[[61350,27803],[-352,26],[7,330]],[[60245,27872],[-14,-665],[191,-12],[-7,-333],[300,-16]],[[57137,47397],[-8,-1144]],[[57129,47575],[8,-178]],[[52685,60663],[7,-839]],[[52692,59824],[931,17]],[[52677,61668],[8,-1005]],[[67819,62647],[-66,9]],[[67402,62701],[-328,43]],[[67074,62744],[-39,-1552]],[[57078,10841],[61,-44],[186,44],[62,185],[325,13],[244,43],[61,221],[19,205],[223,-14],[264,-119],[2,-175],[161,-82],[11,-58],[208,-70],[45,70],[134,-23]],[[59145,13821],[-1049,22],[2,199],[-971,36]],[[57093,12102],[-15,-1261]],[[54634,16748],[-195,2]],[[54439,16750],[-972,-7]],[[69064,46357],[-181,-57],[-349,68]],[[68390,45599],[-23,-391],[92,-15]],[[55422,16746],[584,-11]],[[54468,18399],[2,-988],[-30,0],[-1,-661]],[[54507,36992],[770,10]],[[54535,37697],[76,-71],[-44,-102],[55,-290],[-115,-242]],[[64651,64824],[323,358]],[[64926,66541],[11,336]],[[64937,66877],[-378,29]],[[40959,61028],[447,61],[18,-26],[68,-1316]],[[42090,59825],[-20,450]],[[42070,60275],[-75,1689]],[[41957,62844],[-438,-56],[-15,342],[-192,-27],[-16,336],[-191,-28],[-15,335],[-382,-56],[-16,336],[-59,-7]],[[40633,64019],[-383,-56]],[[39956,63247],[77,-1392]],[[90659,34883],[258,-139],[29,55],[142,-60]],[[91088,34739],[-50,209],[3,167]],[[91041,35115],[17,143],[67,18]],[[91125,35276],[-14,188],[-180,542],[-132,191]],[[90799,36197],[-6,-79],[-257,-101],[-20,-185]],[[83250,43925],[423,436]],[[83673,44361],[152,157]],[[83825,44518],[-37,243],[17,163],[-50,14],[-89,558],[-13,187]],[[83653,45683],[-124,296]],[[63153,69339],[35,1473]],[[63188,70812],[-1132,78]],[[62056,70890],[-118,-231],[26,-337],[-50,-18]],[[64937,66877],[22,670]],[[64959,67547],[60,1852]],[[64540,69675],[-89,7],[-31,-995]],[[64904,63610],[184,-125]],[[65296,63989],[-53,105],[34,196],[-40,84],[85,268]],[[65322,64642],[7,167]],[[64610,64379],[50,-187],[16,218],[72,-27],[71,-152],[-20,-100],[-129,8],[-43,-117],[87,-273],[9,278],[82,2],[28,-105],[-17,-268],[-49,-227],[75,-12],[62,193]],[[60264,41748],[55,108],[17,235],[-52,210],[73,141],[-23,251]],[[59179,42602],[-24,-760]],[[79863,43997],[37,-329],[34,-13]],[[79934,43655],[17,-160],[291,-160],[54,-101]],[[80296,43234],[80,23],[35,-203],[92,86],[15,255]],[[80177,42528],[137,-299]],[[80296,43234],[-78,-435],[-151,80]],[[80067,42879],[110,-351]],[[82535,51359],[82,-61]],[[82617,51298],[53,160],[9,336],[-25,172],[-51,2],[-78,338]],[[82525,52306],[-172,201],[-65,157],[6,205],[-87,13],[-22,159]],[[82185,53041],[-378,-766]],[[40788,13162],[-193,-32],[-58,985],[-65,-11],[-76,1316]],[[40396,15420],[-648,-111],[-20,333],[-193,-34],[20,-333],[-193,-35]],[[39047,12216],[-2,-232],[54,-156],[117,46],[132,135],[217,9],[100,125],[19,-100],[123,136],[37,-109],[78,105]],[[55596,47821],[1,721]],[[54829,48545],[-1,-883],[-158,-107]],[[53317,28028],[697,5]],[[65152,79693],[-658,65]],[[63132,18497],[66,-28],[138,76]],[[64126,19479],[46,1210],[-179,20]],[[63593,20753],[-25,-661],[-191,23],[-10,-329],[-196,18],[-39,-1307]],[[40333,75374],[535,73]],[[41867,75573],[60,8]],[[41870,76951],[-117,89],[-190,-344],[-143,-99]],[[41420,76597],[-323,-38],[-117,-89],[-26,-150],[-131,43],[-118,-90],[-125,-6],[-70,-306],[7,-464],[-184,-123]],[[49323,66368],[77,140],[186,92],[90,125],[123,-26],[79,-117],[69,31]],[[50271,67865],[-976,-39]],[[52140,95618],[125,719]],[[52265,96337],[-39,-1]],[[52226,96336],[-76,-499],[-168,-56],[125,-85],[-17,-79]],[[51835,95612],[48,177],[5,275],[66,4],[59,263]],[[52013,96331],[-82,-1],[-116,324],[-156,2],[-8,91],[-673,-205]],[[50978,96542],[3,-324],[-286,-68],[102,-615]],[[62395,72798],[41,-148],[95,90],[61,-208],[107,45],[72,-220],[64,3],[59,-221]],[[62894,72139],[76,-6],[10,327],[282,-22]],[[63244,72609],[-47,169],[25,341]],[[63222,73119],[-296,26],[-116,146],[-3,95],[-111,47],[-17,354],[-98,247],[-118,122]],[[62189,73693],[35,-333],[118,-338],[53,-224]],[[61940,41599],[64,171],[96,29],[18,148],[94,162],[59,2],[12,186],[71,98],[110,12]],[[62464,42407],[-68,144],[-50,366]],[[62346,42917],[-766,26]],[[61580,42943],[-3,-168]],[[81225,41857],[90,74],[328,-88],[368,470],[53,26]],[[82064,42339],[-126,236],[-100,89],[-64,-41],[-124,68]],[[81650,42691],[-159,-120],[-370,-29]],[[79088,44220],[40,-148]],[[79128,44072],[54,-61],[19,-193],[173,-12],[-3,-277],[163,-323],[151,227]],[[79685,43433],[95,145],[108,-5],[46,82]],[[79437,44732],[-305,-191]],[[81650,42691],[42,467],[67,92]],[[81704,43772],[-120,70]],[[81584,43842],[-525,-100]],[[38177,8077],[1575,305]],[[39752,8382],[-21,333],[-59,-11],[-20,326],[193,35],[-61,979],[323,58]],[[94658,24704],[12,-29]],[[94670,24675],[103,-27],[-37,-194],[66,-153],[117,7],[21,-220],[147,-172],[139,33],[42,-65]],[[95268,23884],[166,635],[165,84],[48,-167],[96,71],[-47,334],[-46,-28],[-202,266],[-73,54],[62,78],[-48,256],[-95,112]],[[95190,25623],[-62,-96],[-5,-191],[-61,2],[-20,-301],[-115,92],[-224,-128],[21,-59],[-66,-238]],[[79067,55087],[77,-111],[118,47],[237,-393],[89,-109]],[[79758,55427],[-129,596],[-80,77]],[[79283,55968],[-86,-276],[-155,-38]],[[70592,55863],[524,-108]],[[71116,55755],[306,-65],[50,65]],[[71185,56688],[-48,185],[-65,49],[-163,-100]],[[70909,56822],[-130,73],[-36,-84],[-217,-209]],[[70526,56602],[-16,-364],[-29,-45],[15,-311]],[[63141,68667],[192,-16],[3,170],[194,-7],[23,-173]],[[63584,68762],[64,113],[-89,238],[120,-63],[5,-174],[74,89],[-7,165],[-130,63],[72,136],[96,-60],[43,-229],[55,83],[-143,311],[4,200],[84,229],[55,-194],[45,63],[-83,196],[17,290],[-30,55],[-148,-26],[-30,126],[148,162],[-71,210]],[[63735,70745],[1,28]],[[63552,70785],[-318,22]],[[63234,70807],[-46,5]],[[71917,42834],[-123,86]],[[71794,42920],[-510,96]],[[70911,40618],[350,-67]],[[70938,41115],[-27,-497]],[[71794,42920],[-11,278],[42,609]],[[71334,44141],[-129,28]],[[70528,43383],[-533,81]],[[65124,72300],[85,-12],[149,-175],[77,-178],[149,-29],[278,-339],[124,-535]],[[65986,71032],[438,-70]],[[71243,16655],[266,-60],[168,-78],[-98,295],[10,368],[31,216],[-41,72],[75,165],[117,-60],[222,120],[175,-195],[74,-4],[71,253],[198,-140],[49,-241],[254,-53],[34,-134],[150,-18],[34,93],[-29,335],[69,383],[25,306],[-155,41],[-34,223],[193,-58],[47,103],[118,48],[-58,163],[143,199],[71,-11],[127,113],[26,-124],[88,96],[15,-218],[-92,-180],[84,30],[207,-96],[87,36],[97,279],[100,81],[-41,222],[-75,81],[-157,-91],[-168,88],[-183,-98],[-208,80],[-155,-40]],[[73174,19245],[-195,16],[-23,-328],[-191,40],[-25,-327],[-1153,234],[-24,-331],[-191,38]],[[72376,19856],[67,-9],[39,130],[375,129],[-83,211],[-132,-33],[-266,-428]],[[73174,19245],[-211,130],[-116,24],[-65,107],[-181,-178],[-70,86],[-65,-228],[-69,37],[-80,-84],[-49,108],[26,201],[-76,122],[83,339],[-66,81],[-140,-112],[-24,-96],[-125,-99],[-152,-260],[-241,-124],[-69,36],[-225,-139],[-68,53],[-218,7],[-112,254],[-78,258],[-50,36],[-180,-43],[-82,60]],[[70471,19821],[-65,-1049]],[[81622,76132],[73,90],[119,-19],[179,128],[129,-25],[221,56],[93,-74],[91,39]],[[82527,76327],[36,36],[4,375],[31,345]],[[82598,77083],[-155,-182],[-40,179],[-70,-37],[-67,-163],[-112,123],[-107,-16],[-19,149],[-153,300],[-351,841]],[[81524,78277],[-31,-337]],[[82064,42339],[80,42]],[[74820,60113],[149,112],[161,248]],[[74705,61543],[21,-111],[-64,-64],[-86,-376],[105,-609]],[[78432,77553],[487,-57]],[[78919,77496],[164,-17]],[[79083,77479],[102,591],[56,179],[109,122]],[[79012,78931],[-194,45],[-12,-167],[-672,153]],[[78134,78962],[56,-121],[-49,-144],[90,-73],[54,-200],[-50,-272],[53,-130],[123,-84],[55,-125],[-34,-260]],[[65248,69479],[91,-151],[-82,-129],[278,132]],[[66339,69702],[-124,416],[8,177],[-83,252],[-33,267],[-121,218]],[[65986,71032],[-711,-428],[-48,3]],[[67489,56858],[19,-2]],[[59445,26855],[-2,-167],[134,26],[55,-142],[200,-12],[-6,-331],[96,-4],[-7,-323]],[[58917,54023],[772,4]],[[59689,54027],[192,-2]],[[58958,55293],[-4,-708],[-37,0]],[[58917,54585],[0,-562]],[[73868,67488],[536,-89],[90,20]],[[74494,67419],[34,206]],[[74709,68745],[13,81]],[[74056,68956],[-112,24]],[[35202,73193],[-453,-83],[-31,328],[-46,66],[59,270],[133,198]],[[34864,73972],[-1444,-287]],[[85779,35697],[112,-284],[162,-585]],[[86053,34828],[-11,-93]],[[86690,35245],[-235,58],[-646,540]],[[47547,26399],[-176,-154],[55,-469],[-23,-117],[-134,-141]],[[94649,21508],[-62,260],[-49,-164],[-101,139],[-64,-234],[-35,150]],[[93636,21096],[-126,-467],[301,-227],[-95,-380],[31,-197],[-71,-84],[-119,-399]],[[82733,50539],[73,-128],[100,-2],[76,153],[-96,309],[-156,-154]],[[62938,38680],[0,1]],[[56532,40695],[4,667],[26,0],[1,587]],[[56563,41949],[-484,-5]],[[82867,63045],[-176,169],[-310,-374],[45,-333]],[[27283,27992],[-99,937],[306,94],[141,-302]],[[9941,18826],[527,284],[-60,340],[91,45],[-57,312],[82,41],[-111,639],[92,49],[-106,630],[-95,-33],[-56,320],[-93,-48],[-111,634],[-9,137]],[[9103,21025],[145,-394],[215,-687],[-8,-147],[125,-117],[141,-268],[220,-586]],[[12555,22605],[-185,-90],[-127,164],[-157,-74],[-9,54],[-210,71],[-129,167],[-57,-50],[-62,172],[-247,-109],[-106,38],[-221,-126],[-155,136]],[[9941,18826],[258,-880]],[[63380,31555],[-117,197],[-162,192],[-151,74],[-190,284],[-153,31]],[[62607,32333],[-43,-351]],[[62564,31982],[-6,-198],[179,-491],[-87,-216],[-180,-186],[9,-220]],[[82431,48105],[207,-68],[106,209],[240,-41],[114,127],[66,-138]],[[83164,48194],[76,27],[-79,411]],[[82607,49247],[-25,-43],[-171,300],[-143,-82]],[[82268,49422],[-87,-47],[-66,-160]],[[82586,48811],[73,-8],[-57,-205],[-16,213]],[[81237,50492],[174,171],[104,-116],[237,-375],[68,-51],[88,202]],[[81908,50323],[112,388]],[[80082,78385],[98,53],[116,-127],[49,-213],[-52,-213],[-70,-66],[-81,-308],[59,-163]],[[80642,77293],[145,1697]],[[80787,78990],[14,116],[-111,141],[-82,349],[104,168]],[[80500,80244],[-158,-78],[-87,-242],[-59,-1]],[[59447,25250],[-51,-107],[-123,6],[-76,123]],[[59197,25272],[-36,-77],[-21,-484],[-30,2]],[[59110,24713],[-7,-340],[327,-15]],[[31046,41948],[332,-3828]],[[32873,39059],[-140,1679]],[[32733,40738],[-173,2148]],[[32509,43508],[-105,115],[-1549,-409]],[[30855,43214],[8,-378],[120,-501],[124,-152],[96,-195],[-157,-40]],[[82617,51298],[59,-167],[131,-83],[94,111],[167,-394]],[[83068,50765],[230,62],[91,119],[190,386]],[[83579,51332],[-10,731]],[[82893,52504],[-62,-167],[-306,-31]],[[33746,90799],[108,-101],[94,166]],[[56269,45973],[90,137],[17,119],[124,181]],[[56500,46410],[-362,5]],[[93717,27940],[485,-193],[11,57]],[[94440,29167],[-257,136],[-343,20],[-167,-113]],[[93673,29210],[112,-205],[-59,-298],[-85,36],[-68,-459],[188,-85],[-44,-259]],[[93381,29855],[80,-109]],[[93461,29746],[130,-68],[-31,-138],[91,-173],[22,-157]],[[94462,29329],[88,677],[-64,48],[54,245],[-36,112]],[[94504,30411],[-147,-4],[-111,132],[-103,34],[-69,111],[-83,-56],[-39,142],[-201,132]],[[13093,13610],[50,-90],[146,128],[63,-371]],[[13352,13277],[143,72],[28,-100],[1240,600]],[[14763,13849],[30,248],[102,164],[-18,295],[-50,132]],[[14827,14688],[4,117],[-114,40],[31,365],[43,10],[-21,201],[-105,63],[-95,-42],[-55,76],[-12,258],[87,197],[-43,60]],[[58841,76532],[-118,-94],[-164,169]],[[57661,75581],[-55,-221],[-58,-82],[-3,-192]],[[79617,37363],[315,-83],[-10,-112],[123,-32],[10,110],[500,-137]],[[80652,38104],[-184,140],[-43,143]],[[80425,38387],[-137,-18],[-192,43]],[[79677,38025],[-60,-662]],[[13207,48882],[80,34],[-51,326],[93,42],[-73,494],[-94,-44],[-85,488],[-196,1301]],[[11739,51024],[-34,-16]],[[7879,32279],[780,399]],[[9518,33930],[-33,185],[50,182],[-69,483]],[[9466,34780],[-40,186],[-228,-72],[-72,25],[-80,345],[36,363],[-13,339],[-124,189],[-52,-27],[-90,364],[41,51],[19,282],[69,32],[1,390],[179,291]],[[9112,37538],[-428,-223],[-100,2],[-19,113],[-386,-185],[-18,110],[-216,-115],[-63,8]],[[7882,37248],[-139,-381],[-82,-332],[2,-147],[123,-208],[18,-136],[-37,-911],[22,-351],[69,-278],[148,-352],[0,-209],[43,-298],[-35,-175],[35,-421],[-71,-162],[-6,-191],[-93,-417]],[[39881,46385],[-633,-103]],[[49605,83544],[-181,101],[-77,-18]],[[49347,83627],[-266,-248]],[[59553,57581],[782,-40]],[[60335,57541],[-54,32],[17,1452]],[[60201,59027],[-637,8]],[[52126,58952],[190,26]],[[52316,58978],[-4,670],[54,-97],[85,148],[128,112],[113,13]],[[52685,60663],[-958,-30]],[[87171,24893],[375,59],[573,-985]],[[88317,26786],[-53,53]],[[88264,26839],[-297,145],[-64,-250],[-137,56],[-67,-392],[-69,35],[-127,-263],[-135,-140],[-251,120]],[[76925,60061],[31,-127]],[[77551,59599],[63,243],[71,123],[101,-61],[25,311],[169,270],[-1,94],[87,186]],[[78066,60765],[-671,182]],[[77395,60947],[-54,-33],[-162,-299],[-97,-95],[-54,-139],[-140,48]],[[76888,60429],[54,-282],[-17,-86]],[[89163,21572],[284,-181],[-212,-977],[347,-228]],[[89582,20186],[316,-191],[51,-4],[243,-277],[24,-213],[188,-114]],[[90404,19387],[74,152],[55,262],[-29,233],[89,389]],[[90593,20423],[-81,323],[4,574],[51,50],[53,349],[85,197],[27,249]],[[90732,22165],[-90,55]],[[90642,22220],[-936,616]],[[89706,22836],[-11,-200],[-177,-60],[-91,110],[-251,-351],[104,-216],[-117,-547]],[[83278,46962],[136,28],[-71,286],[22,30]],[[83365,47306],[-55,340],[-104,297],[-42,251]],[[79173,48707],[-77,-78],[43,-410],[89,37],[54,-296]],[[79282,47960],[112,-99],[210,-28],[4,138],[84,20],[169,198],[-24,148],[84,12],[85,290]],[[80006,48639],[-87,19],[-90,260],[68,385],[77,110]],[[79974,49413],[-98,135],[-62,-83]],[[80143,48674],[16,-755],[139,-436]],[[80298,47483],[149,105],[29,-43],[114,122],[21,-110],[92,42],[35,-75],[78,192],[139,214]],[[80948,49043],[-200,-10],[-42,-146],[-387,52],[-22,-208],[-99,-102],[-55,45]],[[79377,46308],[133,245],[169,-270]],[[79679,46283],[119,214],[472,-39]],[[80298,47482],[0,1]],[[80143,48674],[-137,-35]],[[79282,47960],[38,-51],[-45,-362],[-172,6]],[[79103,47553],[3,-288],[272,-332],[-88,-425],[87,-200]],[[32733,40738],[713,167],[1991,429]],[[71178,45308],[-425,69],[-2,-24]],[[70631,44896],[-15,-198],[57,-179],[-22,-135]],[[61614,75579],[40,-67],[43,-440]],[[62276,75032],[7,503],[45,1804]],[[62328,77339],[-36,-64],[-114,38]],[[62178,77313],[3,-114],[-128,-145],[-28,-237],[-68,-36]],[[60959,48848],[-147,1212]],[[60587,50062],[-388,-618],[-3,-336]],[[81687,33071],[86,858]],[[80340,34871],[-4,-42]],[[80336,34829],[-127,-1328]],[[76653,48170],[102,404],[103,44]],[[76858,48618],[73,49],[-17,173],[-65,80]],[[76849,48920],[-183,290],[-88,89]],[[70500,58178],[230,-21]],[[70730,58157],[37,213],[185,-276],[249,20],[322,212]],[[71523,58326],[-3,206],[59,286],[-7,189],[-88,13],[-24,317]],[[71460,59337],[-171,42]],[[70484,58952],[-3,-420]],[[51657,21326],[-45,-3]],[[23531,13614],[66,235],[168,62],[21,170]],[[22802,15179],[116,-901],[31,-8],[-5,-324],[338,127],[43,-83],[148,85],[36,-272],[-51,-220],[73,31]],[[22500,13384],[57,-430]],[[22557,12954],[483,179],[56,-153],[133,-114],[248,96]],[[23477,12962],[-50,492],[120,35],[-16,125]],[[22594,15647],[-80,-268],[-37,-321]],[[22477,15058],[-15,-411],[89,-247],[-33,-488],[-82,-238],[64,-290]],[[50488,44080],[391,16]],[[51460,44120],[-16,1343]],[[50492,45758],[-31,-1]],[[53370,44170],[580,8]],[[54331,44181],[-2,1676]],[[53746,45853],[-386,-5]],[[56887,58975],[419,-12]],[[57445,60514],[41,464]],[[57486,60978],[-602,14]],[[77395,60947],[-120,31]],[[77275,60978],[-125,51],[-570,123]],[[76580,61152],[-124,27]],[[76456,61179],[77,-168],[-23,-63],[96,-155],[100,-276],[182,-88]],[[78066,60765],[171,-145]],[[78327,62671],[-111,-136]],[[78216,62535],[-139,-229],[-115,-2],[-217,-243]],[[77745,62061],[-33,-107]],[[77712,61954],[30,-293],[91,-144],[36,-220],[194,-300],[3,-232]],[[58398,60476],[93,1]],[[58491,60477],[0,112],[-94,-1],[-33,276],[-161,-1],[-1,336],[96,1],[-2,438],[-85,62]],[[58211,61700],[-122,-14],[15,196],[-124,155],[-181,32],[-68,-70],[5,-142],[-89,-150],[-90,80]],[[57557,61787],[-71,-809]],[[66847,78160],[-141,17]],[[66706,78177],[-205,23]],[[66501,78200],[-11,-278],[-162,18],[-41,-219],[-129,17],[-55,-161],[-39,-612]],[[66064,76965],[-8,-225],[155,-1]],[[65865,66090],[385,-39],[-4,-112]],[[65913,67113],[-33,-933],[-15,-90]],[[47652,42567],[174,9]],[[13239,9433],[1450,717]],[[14689,10150],[-209,1214]],[[13112,10216],[127,-783]],[[71347,62139],[95,-16]],[[71442,62123],[85,1694]],[[70926,63391],[-70,-136],[-160,-126],[-68,29]],[[75078,78576],[405,-69],[-3,-167],[449,-83]],[[75929,78257],[-88,332],[-17,450],[-49,289],[1,283],[-92,261]],[[75684,79872],[-525,99]],[[80984,83157],[148,-47],[88,112],[158,59],[66,89]],[[80835,84545],[-93,-80],[16,-143],[-91,-337],[63,-229],[-163,-299]],[[63735,70745],[469,-28]],[[64603,72011],[62,93],[-51,72]],[[71605,48791],[384,-50]],[[72276,49611],[11,364],[-50,312]],[[44086,55211],[-24,-2]],[[80222,59523],[194,529],[105,374],[84,57]],[[52382,47505],[-6,672]],[[51417,48146],[10,-1006]],[[36665,17387],[864,176],[29,62],[-19,274],[192,39],[-23,337],[32,9],[-44,650],[106,12],[-69,1011]],[[37733,19957],[-175,-35],[12,-165],[-192,-38],[11,-164],[-384,-79],[23,-328],[-133,-28]],[[53067,35110],[13,-1578]],[[53703,34454],[-148,-4],[-12,949]],[[53543,35399],[1,54],[-158,-3]],[[59667,22027],[86,-136],[24,-242],[86,-264],[102,-153],[137,-80],[42,-125],[78,38],[53,-188],[134,8],[30,-190],[52,-35],[-7,-316]],[[60484,20344],[378,-27]],[[64716,31285],[48,-132],[117,-64],[12,-159]],[[66058,31158],[50,1343]],[[65531,32582],[-2,-44],[-763,84]],[[64766,32622],[-50,-1337]],[[63963,82198],[225,-162]],[[64188,82036],[191,-81],[83,41]],[[64462,81996],[18,338],[65,-7],[5,165],[77,-10],[5,116]],[[64632,82598],[-106,443],[-106,306]],[[64420,83347],[-137,351]],[[64241,83422],[2,-391],[-82,-130],[-106,-34],[-145,-458]],[[88516,31591],[-206,-1333]],[[88310,30258],[130,-49]],[[88440,30209],[228,152],[72,276],[129,-91],[56,65]],[[88925,30611],[117,110],[-12,152],[93,50],[76,510],[-28,67]],[[88643,33157],[91,-143],[-218,-1423]],[[88249,27347],[52,-179],[-37,-329]],[[89038,26575],[199,55]],[[89293,27838],[-92,85],[-117,17],[-178,242],[-62,179],[-113,77],[-136,297],[-107,8],[-51,199],[-170,92]],[[88267,29034],[-18,-256],[34,-152],[-78,-219],[27,-307],[49,-111],[-53,-359],[21,-283]],[[51703,63991],[1338,34]],[[53041,64025],[-5,838]],[[51883,65338],[5,-658],[-192,-20]],[[88779,21807],[384,-235]],[[89706,22836],[-239,158],[268,1301]],[[89735,24295],[92,427]],[[89827,24722],[-130,75],[19,98],[-157,89],[-20,-98],[-322,180],[-310,-107]],[[59244,59037],[2,168],[62,0],[-3,437],[-94,167],[-31,170],[15,455]],[[59195,60434],[-318,-6]],[[58877,60428],[-386,-6],[0,55]],[[87306,30630],[1004,-372]],[[88516,31591],[-417,153]],[[87454,31943],[-212,-1290]],[[76646,81241],[191,-195],[-26,165],[-145,109],[-20,-79]],[[75916,80707],[23,-168],[890,-170]],[[76829,80369],[64,72],[86,-67],[65,82],[189,23]],[[77233,80479],[2,246],[-166,-2],[-40,-79],[-156,105],[-236,362],[-43,8],[-358,482],[17,-196],[-76,-25],[-133,289],[-248,46],[102,141],[17,124],[116,48],[391,-385],[168,-312],[20,39],[-143,302],[-490,503],[-371,-278]],[[75606,81897],[28,-132],[170,-286],[134,-40],[29,-110],[-90,-379],[39,-243]],[[77146,77702],[-78,361],[-63,71],[-22,382],[-39,83],[-187,87],[-224,290]],[[76533,78976],[-137,-84],[-12,-164],[-128,28],[-17,-223],[-196,-16],[-20,-276],[-94,16]],[[75929,78257],[43,-59],[75,-320],[-16,-47]],[[75684,79872],[-46,425],[95,247],[171,106],[12,57]],[[75606,81897],[-128,2],[-113,116],[-107,-290],[-61,-329],[47,-200],[24,341],[58,291],[55,61],[57,-140],[-9,-275],[-200,-452]],[[77655,79182],[-43,-611],[52,-163],[-13,-183],[122,-27],[-83,-319],[-17,-239]],[[78178,77582],[254,-29]],[[78134,78962],[-26,94],[-139,167],[-52,239],[-48,406]],[[77869,79868],[-68,-60],[-97,51]],[[77704,79859],[-49,-677]],[[80683,86593],[68,407],[60,8],[-19,-271],[-61,-157]],[[81032,86504],[53,575]],[[81085,87079],[-84,-7],[28,207],[-70,108],[115,108],[86,-11],[110,334],[-59,156],[0,266],[-154,83],[40,272],[-52,60],[-38,-351],[-129,-295],[-85,-98],[-64,-231],[4,-515],[-56,-204],[-52,-355]],[[48648,62844],[1105,62],[27,57],[153,-78],[53,105]],[[49986,62990],[-13,935]],[[49580,64910],[-319,-17],[3,-167],[-186,-11]],[[58877,60428],[-4,1518]],[[58305,62590],[-98,-5],[4,-885]],[[52940,57649],[7,81],[116,120],[115,-58],[68,-191],[123,-171],[57,60],[54,281],[-9,154],[133,47],[107,200],[62,-100],[31,136],[-90,190],[103,68],[105,-130],[41,179],[167,217],[148,17],[-21,246]],[[54257,58995],[-53,-1]],[[53626,58998],[-353,-1],[1,-337],[-189,-3]],[[53085,58657],[2,-336],[-191,-3],[4,-670],[40,1]],[[53225,65370],[573,10]],[[53798,65380],[-1,330],[195,7]],[[53992,65717],[-3,1005]],[[53989,66722],[-85,0],[-1,165],[-241,-3]],[[53662,66884],[-63,-180],[-92,-44],[-483,-8]],[[58482,41882],[21,405],[14,804]],[[58517,43091],[6,505]],[[57750,42654],[-4,-332],[-29,1],[-5,-391]],[[66733,75181],[472,-118]],[[67205,75063],[61,1389]],[[67266,76452],[-100,12]],[[13029,9333],[210,100]],[[12669,9647],[-176,-120],[-21,-165],[-51,37]],[[81552,78604],[704,-194],[22,262]],[[82278,78672],[30,397],[169,166],[7,179],[78,272]],[[82562,79686],[-442,129],[-83,162],[-88,48],[-43,189],[-201,162]],[[81705,80376],[-3,-109],[-136,-1497]],[[81566,78770],[-14,-166]],[[70471,19821],[-84,92],[10,103],[-211,-120],[-226,37],[-121,102],[-63,149],[-36,452],[-81,0],[-60,147]],[[69599,20783],[-30,-526],[-48,9],[-59,-995],[-193,31]],[[60864,18223],[114,93],[188,-53],[406,-282]],[[60484,20344],[-21,-990]],[[77156,70564],[-7,34]],[[77149,70598],[-84,17]],[[77065,70615],[91,-51]],[[76732,71267],[-5,-91],[103,-41],[111,-431],[124,-89]],[[77065,70615],[70,45]],[[77135,70660],[159,-32],[171,107]],[[77465,70735],[27,107],[20,570]],[[76908,71781],[-72,9],[-16,-244],[-69,11],[-19,-290]],[[59878,70983],[466,-22]],[[60344,70961],[491,-16]],[[9112,37538],[92,230],[36,392],[72,55],[7,159]],[[9319,38374],[-74,240],[18,163],[103,213],[-7,198],[67,101],[-42,93],[55,208],[53,557],[-62,328],[-61,-21]],[[9369,40454],[7,59]],[[9376,40513],[-176,42]],[[9200,40555],[-86,-353],[-134,-41],[-136,-172],[-201,-541],[-107,-54],[-75,49]],[[8461,39443],[-97,-75],[29,-218],[-44,-386],[-162,-325],[-102,-271],[-117,-669],[-86,-251]],[[53047,63601],[-6,424]],[[51716,62137],[0,-6]],[[53182,44166],[8,-1343]],[[56945,69757],[116,131]],[[57248,71613],[-97,3]],[[57124,71520],[-92,-80],[-97,-218]],[[56935,71222],[10,-1465]],[[51718,61978],[9,-1345]],[[54993,70336],[140,-134],[103,-198],[106,12],[165,-221],[154,42],[187,-93],[106,38],[64,-61]],[[55360,71330],[-4,-73],[-363,1]],[[88952,25882],[375,97],[706,-270]],[[90033,25709],[21,99]],[[90054,25808],[43,216],[-228,426],[-3,62]],[[53411,55758],[397,5]],[[54735,55767],[0,2220]],[[54735,57987],[0,1012],[-478,-4]],[[52940,57649],[25,-85],[166,-83],[-16,-184],[-161,60],[-97,-44]],[[71590,77524],[718,-109]],[[72416,79747],[-228,99]],[[72188,79846],[-5,-61],[-291,138],[-194,141],[-107,-40],[2,-135],[171,-182],[3,-291],[-91,-145],[-83,-40],[-105,-198],[-49,-401],[-57,1],[-31,-253],[30,-104],[-46,-128],[47,-164],[-12,-142],[220,-318]],[[83301,83207],[106,144],[183,-42],[109,167],[77,-57],[49,-157],[79,39],[35,234],[106,191],[85,286]],[[76661,74901],[543,-129]],[[77204,74772],[-87,203],[-2,144],[-203,171],[-78,336],[-233,499],[9,171]],[[73572,61773],[237,-38]],[[73809,61735],[199,-39]],[[73642,62242],[-70,-469]],[[76572,74204],[287,-61]],[[76859,74143],[478,-109],[39,-111]],[[77376,73923],[49,86],[48,691]],[[77473,74700],[-269,72]],[[77473,74700],[28,415]],[[77501,75115],[65,982]],[[76006,77774],[-74,-76],[-64,-242],[-20,-257],[-101,-173],[-53,-244]],[[75694,76782],[-60,-277]],[[52316,58978],[382,8],[1,-336],[386,7]],[[73749,55368],[534,-63]],[[73471,53223],[-42,102],[-243,275]],[[53768,71892],[6,-649]],[[37939,73673],[-39,716],[-185,3736],[-17,-3],[-38,657]],[[37529,78893],[-35,-227],[-106,-18],[-80,-233],[-78,-44],[-115,-212],[-82,0],[-246,-262],[2,-129],[-277,-438],[-67,-368],[-78,-142],[-225,-235],[-154,-497],[-113,-115],[-29,-204],[-77,-99]],[[35769,75670],[82,-127],[12,-210],[-64,-11],[114,-2002]],[[79679,46283],[-62,-217],[-9,-593],[-36,-290],[36,-73]],[[68065,74851],[61,-16]],[[68126,74835],[276,-72],[257,-113],[279,-181]],[[68990,75217],[74,999]],[[69064,76216],[-742,106]],[[68129,76348],[-64,-1497]],[[63759,31406],[56,1488]],[[63815,32894],[41,1174]],[[63067,33496],[-135,-70],[-148,-196],[-73,-502],[-75,-81],[-29,-314]],[[63164,75639],[276,-28],[37,75]],[[63477,75686],[-30,85],[3,350],[-54,39],[-132,-120],[-34,125],[64,100],[117,-52],[31,104],[-77,121],[-123,43],[13,332],[84,179],[-10,120],[-71,-15],[-61,-236],[-60,135],[143,320],[-17,145],[-104,63],[-128,-12],[-2,125],[108,158]],[[63137,77795],[-60,225],[115,235],[9,119],[-134,162]],[[62897,78377],[32,-238],[-32,-108],[74,-211],[-61,-76],[-199,-93],[-47,-109]],[[62664,77542],[-56,-133],[25,-285],[129,-45],[-154,-137],[-8,-277],[61,17],[38,196],[131,17],[17,-124],[-136,-27],[30,-224],[-92,-152],[32,-227],[58,-73],[75,127],[56,-114],[9,-343],[115,1],[61,-130],[105,142],[4,-112]],[[56642,73582],[5,894]],[[56647,74476],[-893,22]],[[55754,74498],[-36,-45],[30,-209],[-49,-127],[77,-235],[-5,-228]],[[89110,18149],[211,1048],[30,-18],[100,488],[20,-13],[111,532]],[[88035,18578],[63,-44],[540,-182],[472,-203]],[[63091,75142],[117,-192],[-35,-110],[53,-125],[-25,-112],[30,-268],[-35,-213],[18,-223]],[[63214,73899],[323,-24],[88,-117],[73,74],[33,-91],[152,-76],[23,145]],[[64049,74132],[43,10]],[[64093,74166],[-121,264],[-59,-103],[-60,70],[166,151],[-206,232],[20,164],[-122,196]],[[63596,75628],[-119,58]],[[63164,75639],[-67,-164],[-6,-333]],[[63137,77795],[88,-189],[23,89],[80,-55],[26,-356],[85,10],[219,-194],[283,30]],[[63941,77130],[122,88]],[[68126,74835],[-73,-1522]],[[50456,23921],[8,0]],[[69953,62314],[21,-215],[-15,-643],[-29,-667]],[[67266,76452],[479,-58]],[[67459,78444],[-32,-382]],[[13269,7833],[311,152]],[[13580,7985],[-19,106],[803,408],[611,294]],[[16094,9245],[11,170],[98,164],[-99,66],[-4,244],[-76,212],[-71,64],[-12,224],[35,275],[-29,75],[-186,-88]],[[15761,10651],[-1072,-501]],[[83579,51332],[88,-41],[124,119],[-40,-193],[85,-16]],[[83836,51201],[53,-156],[113,-167],[72,59],[52,-118],[86,25],[59,230],[101,-169],[72,89]],[[84431,53037],[-219,68]],[[83990,53172],[-76,24]],[[84511,41339],[225,127]],[[84736,41466],[58,424],[-93,406],[39,40],[-46,196],[71,97],[-143,356]],[[84622,42985],[-108,-134],[-100,82],[-499,-160],[-150,-104]],[[12448,36142],[135,-107]],[[11780,38081],[-33,-88],[-214,126]],[[11533,38119],[-227,-11],[-67,103],[7,-473],[59,-100],[2,-371],[59,-424]],[[84649,31555],[227,-78]],[[85121,33439],[-637,226]],[[84075,33236],[-166,-1441]],[[50978,96542],[-12,1053],[-14,51]],[[50952,97646],[-201,11],[-123,-60],[-23,95],[-74,-104],[-143,65],[-206,-98],[-171,-252],[-2,-109],[-101,28],[-155,-251],[-64,33],[-181,-168]],[[49508,96836],[406,-1387],[161,-592]],[[89680,47310],[173,-82],[94,66],[-17,223],[182,28],[57,-76]],[[90169,47469],[37,33],[-78,489],[-89,187],[29,184],[-12,216],[-87,298],[-116,68],[-30,120],[-27,-248],[-130,-347],[-15,-289],[29,-155],[-21,-251],[21,-464]],[[76464,71161],[133,35],[6,97],[129,-26]],[[76461,72121],[-16,-252],[35,-6],[-23,-250],[44,-8],[-37,-444]],[[61869,32034],[695,-52]],[[88947,52517],[83,-158],[131,-134]],[[89547,53174],[-60,222],[-88,105],[-117,36],[-75,-94],[-110,16],[-126,-367],[-20,-196],[46,-282],[-33,-29]],[[71964,63762],[45,169],[118,75],[81,-29],[49,-159],[100,15],[48,-278],[-48,-68]],[[72357,63487],[324,-56],[20,299],[90,-19],[32,208],[52,-46]],[[72514,65397],[-309,-567]],[[72205,64830],[-54,-158],[-191,25]],[[87075,29096],[424,-176]],[[87499,28920],[106,574],[45,26],[291,-106],[27,198],[352,-129]],[[88320,29483],[68,577],[52,149]],[[90054,25808],[150,28],[98,103],[74,-84],[44,219],[175,215]],[[53650,80022],[210,-185],[136,-457],[95,-216],[185,-203]],[[54414,79539],[11,205],[-29,229],[26,195],[-47,228],[157,680],[-79,149],[-14,202]],[[54161,81238],[16,-248],[-95,-117],[-34,-258],[-105,8],[-18,-184],[-168,-156],[-175,-51],[68,-210]],[[85756,44160],[43,-20],[117,262],[-14,146],[132,172],[183,399],[68,-77],[104,31]],[[86389,45073],[46,151]],[[86435,45224],[-140,75]],[[86295,45299],[-128,-84],[-9,115],[-85,-41],[-138,48],[-131,169],[-58,167],[-97,34]],[[85649,45707],[-65,-205],[30,-77],[-101,-216],[-191,-265]],[[52886,80542],[660,-656]],[[53546,79886],[104,136]],[[53502,81548],[-103,-91],[-94,1],[-89,-273],[-161,-258],[-83,-315],[-86,-70]],[[68245,81011],[181,-55],[-144,109],[-37,-54]],[[67912,80966],[144,-14],[-40,127],[-104,-113]],[[68368,79225],[46,987],[139,147]],[[68553,80359],[-6,59],[-204,-101],[-305,137],[-389,297],[15,-181],[-121,-74]],[[67543,80496],[-44,-1050]],[[54999,69604],[1,-201]],[[55000,69403],[150,-119],[177,85],[71,-64],[143,36],[72,119],[65,-36],[139,164],[201,119]],[[56018,69707],[4,10]],[[25216,49332],[-196,1899]],[[43723,77983],[955,96]],[[45184,81163],[-1535,-149]],[[43649,81014],[46,-144],[155,-103],[-149,-259],[83,-130],[117,-384],[-4,-230],[-110,-142],[-108,-5]],[[43679,79617],[-68,-186],[-9,-202],[-89,-625],[-216,-319],[-105,-66],[-65,58],[-306,-247],[-81,15],[-183,-219]],[[82544,81685],[434,-329],[17,-75]],[[83624,81002],[359,983],[578,1220]],[[84561,83205],[-456,129],[69,666],[-44,12]],[[82635,81846],[-91,-161]],[[84817,29231],[200,-65]],[[85017,29166],[357,-123],[25,292],[75,38]],[[67641,32311],[395,-53]],[[68036,32258],[109,205],[-41,458]],[[67300,33257],[-42,-887]],[[59480,65692],[840,-14],[-4,-214],[63,-17],[-7,-222],[223,-3]],[[60829,65553],[3,1019]],[[60832,66572],[-382,-1]],[[60450,66571],[-264,-5],[-13,-290],[-303,-30],[0,-113],[-291,3],[-2,-225],[-95,1]],[[62506,51002],[-8,-225],[292,-19]],[[54020,26367],[2,-667]],[[76756,67673],[-99,-124],[-178,36],[-8,-62],[-194,41]],[[73651,72252],[73,-79],[55,220],[789,-158]],[[74568,72235],[34,334],[32,-6]],[[74634,72563],[-30,34],[29,475],[-158,33],[4,55],[-149,49],[-94,458]],[[74236,73667],[-251,46],[-19,-332],[-177,33],[-36,-303],[-194,21]],[[12459,43990],[83,794],[-9,168],[79,471],[-8,115],[132,230],[38,158]],[[10660,45853],[-39,-105],[25,-158],[87,-130],[-49,-108],[59,-154]],[[88097,48554],[-4,-214],[109,-110],[100,27],[34,-139]],[[88434,48719],[26,210],[111,-44]],[[88711,48984],[-12,189]],[[88699,49173],[-92,-180],[-137,76],[-36,100],[-80,-128],[-154,-63]],[[61455,72903],[7,337],[202,321],[4,167]],[[61678,74232],[-945,55]],[[88452,51715],[-3,-32]],[[88449,51683],[653,-222]],[[89102,51461],[105,118]],[[89207,51579],[19,159],[108,319]],[[62064,28549],[165,-15],[-30,-201],[110,-142],[72,67],[34,-135],[75,23]],[[62490,28146],[1,34],[286,-25]],[[62777,28155],[96,-12],[45,1326]],[[62305,29056],[-241,-507]],[[77149,70598],[-14,62]],[[76327,70616],[66,-13],[-12,-185],[49,-93],[51,-355],[89,-123]],[[76570,69847],[96,15],[75,171]],[[76741,70033],[186,25],[69,132],[58,253],[102,121]],[[76464,71161],[-48,-266],[-98,-169],[9,-110]],[[89207,51579],[114,128],[392,239],[70,260],[58,4]],[[89841,52210],[159,253],[69,33],[60,176],[-197,174],[-196,-188]],[[86124,43068],[-39,232],[-2,249],[419,911]],[[86502,44460],[-134,387],[21,226]],[[85333,45961],[78,125],[158,-175],[80,-204]],[[86295,45299],[-10,102],[-314,958]],[[87312,27776],[725,-354],[212,-75]],[[88267,29034],[53,449]],[[87499,28920],[-187,-1144]],[[84323,49724],[-200,306],[-84,-66]],[[84039,49964],[29,-155],[-76,-126],[129,-175]],[[53798,65380],[5,-673],[193,1],[1,-337]],[[53997,64371],[572,3]],[[54569,64374],[0,335]],[[54569,64709],[-1,672],[-97,0],[0,337],[-479,-1]],[[54766,62893],[-54,38],[-136,355],[-7,1088]],[[53997,64371],[-3,-629],[-29,104],[-120,-28]],[[53845,63818],[3,-791],[89,1],[2,-672]],[[52516,80917],[370,-375]],[[83836,51201],[203,-1237]],[[84851,50304],[-65,738]],[[53327,63854],[87,166],[75,-100],[-44,-110],[79,-68],[37,106],[127,-54],[88,182],[69,-158]],[[14292,36475],[138,-871],[309,-2029],[379,-2556]],[[15118,31019],[457,-3022]],[[16112,32340],[-248,1651],[-42,-16],[-286,1942],[189,77]],[[15725,35994],[-56,374],[28,12],[-48,335],[50,108],[-58,404],[-47,97]],[[15594,37324],[-116,-43],[-56,86]],[[15422,37367],[-163,69],[-161,-60],[-212,56],[-84,106],[-120,-72],[-39,258],[68,30],[-83,194],[13,237],[-135,262]],[[14506,38447],[-117,91],[-97,-13],[-113,119],[-206,-91]],[[13973,38553],[84,-564]],[[88925,30611],[507,-848]],[[89432,29763],[597,322],[-130,566],[342,265],[72,182]],[[85648,38290],[21,45],[253,-483],[98,-142],[-75,256],[147,-193],[19,89],[123,-107],[427,-250],[90,-103]],[[86751,37402],[2,152],[136,202]],[[86889,37756],[-103,152],[53,104],[-196,139],[-146,356]],[[86497,38507],[-62,181],[-347,256],[-90,229]],[[85998,39173],[16,-117],[-164,-245],[-81,-250],[-90,-101],[-31,-170]],[[81584,43842],[19,574],[-82,339],[1,417],[43,147]],[[81451,45306],[5,-152],[-75,-68],[8,-131],[-94,-87],[-102,42],[-55,-162]],[[60254,80927],[125,-64],[557,-27],[0,-194],[276,-15]],[[60256,81006],[-2,-79]],[[47667,38543],[-768,-63]],[[46899,38480],[42,-1332]],[[74524,71566],[193,-41],[-21,-219],[510,-117],[-11,-132],[105,-30]],[[75300,71027],[31,214],[67,105],[-26,179]],[[75529,72062],[-157,226],[-78,187],[37,277]],[[75331,72752],[-254,53],[-158,-302],[-285,60]],[[74568,72235],[-44,-669]],[[62831,57370],[77,-4]],[[62908,57366],[91,116],[20,169],[72,-4],[99,337],[8,281]],[[72513,55591],[-409,30]],[[71738,55643],[-19,-484]],[[65806,81494],[196,-121]],[[66002,81373],[96,85]],[[66098,81458],[-6,726],[-18,220],[134,-23],[16,-95],[105,180]],[[66329,82466],[-32,167],[-76,100],[15,344],[178,446],[37,639],[164,574]],[[66615,84736],[-342,538]],[[66273,85274],[103,-414],[55,-117],[-66,-122],[5,-370],[-60,-120],[-174,-42],[-106,-318],[53,-32],[-10,-410],[-142,-41]],[[91014,31419],[52,-216],[632,-413]],[[91698,30790],[61,613]],[[91073,31859],[1,-12]],[[90799,32714],[-42,-20]],[[91698,30790],[-55,-530]],[[91643,30260],[194,491],[23,115],[75,-125],[33,88],[115,33]],[[92571,31848],[-24,98],[-88,-43],[-111,242],[-45,-23],[-126,148],[0,181],[-167,109],[-122,238],[-40,-40],[-71,148]],[[61639,57456],[-13,-1140]],[[62421,55892],[7,390],[-25,1],[9,628],[24,483]],[[53546,79886],[20,-101],[-68,-84],[21,-97],[-112,-232],[20,-159],[-86,23],[-50,-106],[-68,-532],[-68,-155]],[[10827,40522],[148,-119],[93,-394],[-69,-162],[65,-38],[72,-294],[-69,-42],[-84,-371],[81,-161]],[[11064,38941],[197,98]],[[11261,39039],[559,351]],[[10226,41227],[108,72],[156,-25],[90,-255],[139,-78],[108,-419]],[[55922,62341],[59,-38],[90,129],[72,-12],[93,-149],[17,-229],[67,-12],[131,-336]],[[56451,61694],[83,173],[186,57],[1,197],[102,-95],[58,182]],[[56881,62208],[2,467],[-205,3],[3,556]],[[56681,63234],[-764,11]],[[55917,63245],[-2,-392],[-191,1],[5,-522]],[[56681,63234],[4,448],[-128,2],[2,336],[-112,2],[4,672]],[[55622,64703],[8,-1342],[287,-3],[0,-113]],[[80711,38718],[30,295]],[[80556,39083],[31,-307],[-162,-389]],[[58952,69239],[444,4]],[[59615,69354],[-121,602],[-9,121],[-74,-3],[-2,929]],[[59353,71005],[-529,20]],[[58824,71025],[-106,-273],[9,-170],[104,-119],[22,80],[148,-395],[-50,-129],[75,4],[-15,-148],[50,-73],[-75,-70],[67,-109],[-111,-130],[10,-254]],[[90473,38876],[174,-548]],[[90647,38328],[119,107],[59,215],[65,-9],[280,188],[94,-60]],[[91468,38916],[28,101],[-125,488],[-183,311]],[[91188,39816],[-259,146],[-288,-25]],[[90340,39297],[133,-421]],[[24771,31555],[-512,-173],[-373,-158],[-338,-92]],[[23548,31132],[347,-2912]],[[50422,77176],[8,23],[-573,665]],[[78763,38500],[-79,-938]],[[79587,37034],[30,329]],[[79321,38418],[-250,49],[-295,159]],[[72538,68133],[78,133],[-45,75],[28,151],[-137,74],[16,125],[-122,293],[92,193],[-52,95]],[[72396,69272],[-34,62],[4,262]],[[71685,69596],[-101,-38],[-73,-121],[-13,-228],[-105,-13],[-20,-308]],[[11626,13958],[21,-117]],[[11603,15238],[-154,-79],[-20,-82],[197,-1119]],[[49522,47387],[940,48]],[[50462,47435],[10,5],[-17,1006]],[[50443,49117],[-945,-46]],[[56134,47863],[3,307],[38,-67],[155,64],[31,-69]],[[56361,48098],[5,940]],[[51647,44126],[767,22]],[[9369,40454],[354,174],[-18,-108],[101,-320],[-2,-178],[236,113],[13,-174],[-47,-295],[90,-295]],[[10096,39371],[80,23],[54,140],[150,-107],[207,128],[177,36],[21,55],[-126,791],[168,85]],[[9545,40922],[-31,-195],[-138,-214]],[[60912,57505],[674,-45]],[[61539,58876],[3,284],[-193,6],[4,336],[-192,5]],[[61159,59172],[-2,-278],[-130,-219],[3,-244],[-124,-19],[33,-137],[-90,-24],[68,-176],[-106,-25],[103,-113],[-2,-432]],[[89312,50050],[-27,-268],[100,-56],[157,76]],[[89542,49802],[29,395],[-55,-27]],[[89516,50170],[-103,108]],[[89413,50278],[-101,-228]],[[40191,70291],[90,12],[79,-1649],[83,11],[33,-668],[388,51]],[[40864,68048],[844,109]],[[40931,74112],[-746,-101]],[[63214,73899],[-81,5],[7,-374],[100,-69],[-29,-190],[62,-13],[-51,-139]],[[40333,75374],[-18,-208],[-117,-181],[-62,25],[-133,-138],[-16,-296],[-42,-172],[-90,61],[-153,-522]],[[39300,43081],[0,0]],[[39223,43239],[174,-218],[4,-87]],[[39556,42959],[-96,58],[-12,230],[-65,17]],[[39342,43083],[0,0]],[[56678,65360],[870,-23]],[[57543,66561],[-4,959]],[[57067,68437],[-71,-188],[-136,63],[-131,-178],[-93,-285],[-147,-10],[-153,-278],[-46,1]],[[80520,40022],[25,-118]],[[80827,39927],[52,545]],[[76925,60061],[-233,22],[-196,184],[-102,-30],[-67,-214]],[[76327,60023],[-32,-218],[48,-95],[-34,-119],[91,-251]],[[75878,60451],[-1,-73],[129,-185],[29,81],[182,-53],[110,-198]],[[76456,61179],[-224,48]],[[54151,35411],[-608,-12]],[[93044,25484],[565,-211]],[[93609,25273],[48,-18]],[[93657,25255],[85,107],[22,153],[125,-97],[195,43],[23,313],[72,-7],[9,-117],[134,-23],[27,80],[16,422],[-69,276],[85,119],[145,-142],[7,259],[-85,24],[-41,216],[94,100],[80,-71],[58,111]],[[93717,27940],[-54,19]],[[93407,27217],[-21,-254],[-96,79],[-50,-177],[-37,50]],[[73795,44109],[-12,-175]],[[73783,43934],[570,-121],[-7,-85]],[[74346,43728],[194,-35]],[[74642,44827],[-476,22],[-321,92]],[[58806,71025],[18,0]],[[59492,74004],[17,-48],[-148,-149],[-33,-158],[-127,-81],[-15,-175],[-108,-24],[-25,-333],[-113,-161],[29,-208],[-86,-463],[-71,-89],[65,-188],[-77,-28],[69,-253],[-69,-169],[34,-116],[-82,-68],[54,-268]],[[65294,37470],[-44,-1217]],[[14168,13221],[116,-63],[127,39],[310,-112]],[[14721,13085],[-54,482],[96,282]],[[13352,13277],[51,-307],[-139,-368],[-61,-232],[50,-289]],[[87197,60731],[39,-70],[210,88]],[[87784,62218],[-9,299],[-87,8],[-34,-105],[-299,-5],[-368,167],[-263,284]],[[86488,62575],[27,-152],[-37,-101],[100,-144],[24,-438],[39,-81],[178,46],[60,-275],[211,-113],[107,-586]],[[72953,57026],[265,47],[171,-146],[54,-242]],[[74185,57177],[-83,168],[-167,28],[0,472]],[[86694,53650],[72,-400],[17,-335],[-30,-469]],[[86753,52446],[145,-33],[84,46],[227,-70],[37,104],[146,79],[34,162],[-48,110],[89,154],[165,-138],[145,387],[186,114]],[[87963,53361],[135,203],[-138,109],[-17,76]],[[87943,53749],[-103,296]],[[87257,53659],[-186,120],[-141,24],[-71,-124],[-165,-29]],[[27980,26207],[-35,313],[-188,-41],[-35,327],[-191,-59],[-82,617],[-96,-29]],[[39356,43737],[236,66],[210,-22],[9,-167],[100,3],[12,-206],[222,32],[-49,291],[-241,-40],[36,214],[-158,-41],[-102,112]],[[63234,70807],[0,97],[-127,403],[-100,98],[-61,268],[15,147],[-73,184],[6,135]],[[62395,72798],[13,-88],[-78,-220],[53,-288],[-47,12],[-77,-197],[-150,62],[-19,-94]],[[89068,49052],[82,-54],[131,163]],[[89176,50066],[80,-129],[56,113]],[[89413,50278],[7,90],[-139,99],[-37,-189],[-77,-86]],[[89167,50192],[9,-126]],[[38447,41764],[419,83],[588,82]],[[38799,43172],[5,-77],[-470,-79]],[[66098,81458],[132,23],[258,-195],[107,21],[102,101],[214,-80],[123,74]],[[67034,81402],[-99,181],[-6,124],[-83,61],[27,129],[-199,-36],[-66,185]],[[66521,82551],[-51,-90],[-141,5]],[[69673,73995],[762,-116]],[[70435,73879],[24,435],[88,15],[10,165],[224,-42]],[[70781,74452],[-30,61],[28,446],[-96,17],[32,548],[-99,165],[119,125],[-18,178],[-63,103],[-54,-57],[-121,110],[-21,224],[-64,-63],[-50,136],[43,115]],[[70063,77010],[23,-125],[-71,-343],[96,-40],[8,-225],[-86,36],[53,-198],[-3,-258],[-63,-107],[-162,-94],[-23,-120],[-86,-27],[-50,-397]],[[70060,71879],[157,-24],[8,167],[381,-61]],[[70748,72777],[-94,53],[27,467],[-191,30],[27,485],[-82,67]],[[70146,70004],[546,-69]],[[70692,69935],[28,493]],[[69022,67316],[18,-1213]],[[69040,66103],[405,-34],[70,106],[20,392]],[[69620,68084],[-607,48]],[[69013,68132],[9,-816]],[[69003,69082],[10,-950]],[[69815,68053],[77,1422]],[[68990,70231],[13,-1149]],[[55489,43162],[4,10]],[[86439,48957],[76,-57],[6,-130],[200,-480]],[[87490,48987],[-19,38]],[[87384,49056],[-43,281]],[[87228,49461],[-196,56],[-112,-141],[-61,44]],[[59309,78087],[-591,93]],[[70427,24405],[407,-60]],[[70234,25440],[10,-188],[-72,-301],[21,-227],[218,-175],[16,-144]],[[57137,49024],[-1,-421]],[[58086,49655],[3,464]],[[72396,69272],[585,-108]],[[73290,69163],[83,1282]],[[39242,39042],[556,91]],[[71505,57255],[92,411],[50,-30],[30,150]],[[71677,57786],[-77,270],[-75,117],[-2,153]],[[70730,58157],[18,-192],[65,-143],[4,-375],[108,-564],[-16,-61]],[[84540,34906],[61,15],[25,-241],[101,-224],[41,279],[153,-65],[125,250],[204,-4],[241,423],[266,-185],[296,-326]],[[85308,36316],[-139,87],[-103,-61],[-175,262],[-304,-86]],[[84188,36672],[-37,-74],[106,-408],[62,-42],[24,-233],[215,-250],[10,-179],[-133,-391],[105,-189]],[[54455,82422],[118,250],[-91,258],[69,233],[-49,153],[36,103],[103,25],[32,288]],[[54673,83732],[41,31],[-94,168],[86,47],[-18,232],[-124,5]],[[54564,84215],[-40,-80],[-128,-44]],[[54396,84091],[-162,-134],[-21,-183],[-79,-149],[-62,-284],[-135,18],[-237,-318],[-66,-208]],[[90152,17663],[230,-107]],[[90480,18661],[32,275],[-55,305],[-97,98]],[[90360,19339],[-72,-181],[-28,-480],[13,-253],[-86,-96],[21,-322],[-56,-344]],[[89027,49995],[17,123],[132,-52]],[[89167,50192],[-41,217],[62,1019]],[[89188,51428],[-86,33]],[[88449,51683],[-10,-359]],[[40807,48877],[761,106],[186,50]],[[41754,49033],[-40,968]],[[37742,49381],[1292,247]],[[38959,50943],[-51,-163],[-73,5],[-27,-215],[-80,-22],[-180,389],[-48,-161],[-179,158],[-102,-39]],[[64005,54277],[10,404],[-70,117],[9,337]],[[41420,76597],[-1196,2168]],[[39301,77332],[317,-3401]],[[40870,47544],[-63,1333]],[[39276,48653],[26,-501]],[[78847,43230],[22,-177],[198,1],[-46,-389],[213,-69]],[[79234,42596],[195,-37],[-21,-239],[106,32],[41,102],[191,-13],[-4,-53]],[[79742,42388],[71,86],[356,-69],[8,123]],[[80067,42879],[-100,132],[-48,188],[-79,22],[-155,212]],[[79128,44072],[-12,-207],[-165,31],[-75,-159],[-29,-507]],[[82600,50130],[-113,189],[-90,42],[-93,171]],[[81908,50323],[269,-407],[20,-105],[-84,14],[-7,-108],[162,-295]],[[70987,66062],[78,118],[53,260],[155,-20],[87,104]],[[71360,66524],[27,162]],[[70874,67937],[-94,10],[-16,-280],[-197,-26]],[[70115,66499],[-18,-333]],[[84736,41466],[230,220]],[[84966,41686],[383,373]],[[84574,43126],[48,-141]],[[34713,20304],[-143,-2],[-57,-66],[-158,91],[-91,-38],[-20,244],[-98,-23],[-19,221],[-255,-60],[-206,118],[-237,390],[-13,164],[-124,-31],[-30,357],[-173,-43]],[[33089,21626],[-412,-123]],[[32677,21503],[58,-668],[206,52],[58,-657],[189,48],[15,-164],[191,49],[14,-165],[190,47],[53,-660],[27,7],[24,-331],[66,18],[27,-336],[129,28],[36,-318]],[[65694,78292],[807,-92]],[[66706,78177],[-71,413],[-44,405],[-48,101],[-18,393]],[[66525,79489],[-272,32],[-513,-125]],[[72602,58165],[-245,70]],[[72357,58235],[-178,5],[-138,-68],[-364,-386]],[[23477,12962],[190,75],[145,-1141]],[[26209,13517],[69,139],[-44,171],[51,118]],[[65722,85543],[62,-82],[83,194],[-59,51],[-86,-163]],[[65655,84965],[38,16]],[[65693,84981],[-38,-16]],[[64632,82598],[194,-26],[-3,-54],[254,100]],[[65077,82618],[245,-8]],[[66273,85274],[-251,328],[-27,-164],[-86,-45],[23,-147],[-91,-318],[-93,-137],[-49,86]],[[65699,84877],[-27,-313],[-252,-403],[-235,-438],[-75,-29],[-105,-212],[-118,-104],[-47,-195],[-81,-101],[-22,115],[-79,9],[7,111],[-245,30]],[[72270,20166],[131,1892]],[[71815,21877],[100,2],[174,-157],[-17,-107],[-190,-20],[-84,-138],[-72,-340],[54,-242],[87,-103],[94,-315],[-121,-98],[337,-17],[30,-168],[63,-8]],[[86480,52379],[255,-86]],[[86735,52293],[18,153]],[[75796,33932],[-109,377],[-89,75],[-12,177],[-63,50],[-76,335],[46,177],[-47,42]],[[28134,10812],[-442,-138],[-3,325],[-79,122],[59,129],[25,224],[-42,129],[0,259],[64,73],[-34,348],[-169,-55],[-18,163],[-380,-125]],[[28384,10892],[-171,1572],[246,76],[-140,1300]],[[28319,13840],[-172,-54],[-12,110],[-95,-31],[-24,218],[-98,-31],[-21,102],[-177,-56],[-23,217],[-241,-88]],[[38762,43809],[-165,-70],[-211,-368],[-95,-50]],[[78385,49570],[170,-389]],[[78555,49181],[189,-169]],[[79519,50042],[18,172],[-73,277]],[[85216,40708],[-105,181],[-79,-20],[-66,817]],[[70019,77133],[-100,85],[-575,83],[5,113],[-194,26]],[[69155,77440],[-91,-1224]],[[66616,44773],[365,-43]],[[66981,44730],[16,281],[155,-17],[12,223],[128,-16],[110,270],[194,-24]],[[67596,45447],[13,279]],[[69055,42522],[74,69],[141,-22]],[[69106,43541],[-51,-1019]],[[90459,36737],[5,-124],[223,83]],[[90687,36696],[88,200]],[[90647,38328],[-167,-165],[-139,42],[-95,-339],[-99,-170],[-71,-6],[-8,-127],[-88,-13]],[[89980,37550],[113,-270]],[[61029,29155],[560,-41]],[[52132,71182],[682,21]],[[52814,71203],[-22,1694]],[[52701,72893],[-869,-44]],[[51832,72849],[28,-1687]],[[67558,34983],[722,-97]],[[68280,34886],[141,275],[153,686],[31,248],[150,435]],[[68800,37444],[-438,67],[-22,-339],[-192,35],[-21,-334],[-191,37],[-10,-168]],[[67926,36742],[102,-20],[81,-128],[-63,-1062],[-561,110]],[[89516,50170],[71,251],[111,10],[127,130],[39,124],[-86,78],[53,434]],[[89499,51318],[-311,110]],[[74267,29996],[111,1340]],[[74501,28129],[81,-29],[135,-428],[107,-118]],[[74824,27554],[29,240],[554,-158]],[[74994,29484],[-377,91]],[[43916,19384],[-55,1276]],[[42494,15183],[574,84]],[[62795,26136],[-386,32]],[[62409,26168],[-576,51]],[[61632,25900],[-18,-659]],[[13945,38752],[404,172],[-1,115],[335,142]],[[14683,39181],[398,180],[-50,349],[-155,-38],[-48,94],[-58,381],[6,176],[-46,281],[92,57],[-40,303],[31,14],[-61,426]],[[14752,41404],[-333,-854]],[[13921,38921],[24,-169]],[[72462,40314],[411,-81]],[[72890,40960],[-377,73]],[[72995,38849],[100,1337]],[[61035,67899],[459,-2]],[[61507,69807],[-147,122],[-80,-88],[-18,-128],[-78,47],[-20,-150],[-64,-39]],[[61100,69571],[-37,-117],[-128,-130],[-96,16],[-25,-193],[-107,-103],[111,-318],[-30,-233],[130,-44],[119,-297],[-2,-253]],[[67660,38650],[385,-70],[-20,-333],[807,-142]],[[68859,38612],[32,597]],[[68891,39209],[-1007,197]],[[67692,39446],[-29,-459]],[[22233,18556],[111,-199],[129,-452]],[[22677,21208],[-167,-62],[-166,-247],[59,-463],[-115,-43],[-10,-191],[84,-659],[-425,-171]],[[93461,29746],[-99,-232],[-123,-508],[-48,34],[-85,-502],[32,-22],[-74,-313]],[[72679,48761],[317,309]],[[73107,49584],[-1,113]],[[73106,49697],[-201,202],[-283,10],[-284,234],[-86,178]],[[67499,79446],[-388,44],[19,502],[-195,77],[7,168],[-82,8]],[[66860,80245],[-139,-164],[-104,-226],[-29,-251],[-63,-115]],[[64462,81996],[87,-187],[521,-253]],[[65070,81556],[-23,446],[-51,61],[49,207],[32,348]],[[31046,41948],[-911,-237],[2,-19],[-570,-158]],[[29540,41189],[57,-698],[122,-1329],[-11,-3],[89,-940]],[[51105,83173],[-245,396]],[[24263,39584],[1332,434],[1516,464],[19,-150],[115,54],[179,-232]],[[27434,42886],[-89,-85],[-197,-57],[54,-612],[-7,-254],[-1146,-338],[-1549,-490],[-4,32],[-389,-122]],[[24107,40960],[156,-1376]],[[86735,52293],[232,-80]],[[86967,52213],[821,-273]],[[87788,51940],[230,-85]],[[88074,53015],[-23,123],[-117,78],[29,145]],[[73213,73520],[40,132],[7,378],[-21,165],[96,-19],[32,489],[-51,188],[64,-16]],[[73330,75531],[-160,-31],[-23,-278],[-200,335],[-26,-290],[-187,39]],[[30027,33119],[-752,-200]],[[29275,32919],[14,-266],[-126,-154],[36,-158],[-39,-267],[32,-139],[97,-94],[-25,-198],[68,-81],[-52,-264]],[[29280,31298],[36,-47],[-37,-557],[64,-61],[374,106],[130,182],[77,-174],[22,124],[-54,352],[101,48],[216,-99]],[[74346,42450],[452,-108],[11,143],[180,-17]],[[74989,42468],[4,114]],[[74346,43728],[-100,-1252]],[[74052,74714],[77,-14]],[[74129,74700],[625,-123]],[[74754,74577],[74,1161]],[[74828,75738],[5,110],[-127,21],[10,156],[-228,-58],[-113,34],[-72,298]],[[74303,76299],[-154,24]],[[9268,41888],[1,12]],[[9269,41900],[-1,-12]],[[9118,42127],[-187,-91]],[[8931,42036],[25,-280],[199,-25],[17,395],[-54,1]],[[34651,49241],[-8,187],[84,165],[-83,225],[-75,9],[31,112]],[[34600,49939],[-125,-26],[-6,170],[-108,88],[-70,-65]],[[34291,50106],[-6,-187],[-70,-153],[-92,-35],[-79,-148],[40,-340],[-103,-23],[-15,-144]],[[66967,53724],[6,137],[69,-75],[132,17]],[[67180,54092],[-119,28],[-141,245],[-35,185],[-99,209]],[[66786,54759],[-165,-127],[-21,-285],[17,-296],[79,-137],[-12,-122],[-76,-44]],[[63406,57321],[608,-59]],[[64014,57262],[16,234],[58,91],[11,497],[-96,75]],[[64003,58159],[9,452]],[[62908,57366],[498,-45]],[[61772,62976],[-12,-1143]],[[77494,37273],[273,-59]],[[77860,37470],[112,1232]],[[56307,61002],[-6,435],[88,252],[62,5]],[[65368,85634],[275,84],[-133,37],[-142,-121]],[[64997,85816],[172,-79],[21,53],[-186,85],[-7,-59]],[[65699,84877],[-6,104]],[[65655,84965],[7,-145],[-81,-175],[-84,218],[-95,-36],[-51,77],[-86,-61],[22,190],[-79,156],[-22,177],[-57,-15],[-30,190],[-58,-36],[-142,166],[-21,208],[-109,-43],[10,-149],[-208,-310],[-74,50],[-185,-53],[-72,-101],[-138,-9],[-157,-88],[-115,-185],[82,-55],[46,-194],[142,200],[45,-79],[5,224],[100,49],[-32,-340],[-120,-105],[-96,-247]],[[11204,13738],[422,220]],[[10534,16467],[98,-326],[98,-473],[141,-558],[100,-638],[97,-228],[136,-506]],[[74824,27554],[-48,-147],[67,-453],[37,159],[121,-229],[-128,-71],[142,-24],[74,-233],[126,-63],[202,-177],[26,-120],[164,-137],[210,133],[96,108],[129,379],[88,182],[88,524]],[[57039,41954],[271,-6]],[[57102,42664],[-20,-331],[-40,1],[-3,-380]],[[60378,45520],[668,-23]],[[61046,45497],[7,994]],[[60855,46887],[-480,-252]],[[31100,89295],[319,-28],[226,-428],[104,-47],[93,317],[181,378],[-9,267],[131,181],[29,-187],[88,8],[-34,208],[62,194],[121,208],[-123,138],[-116,-64],[-118,69],[-144,-175],[-192,-37],[-275,51],[-57,-273],[-81,-117],[-27,-166],[-85,-151],[-2,-199],[-91,-147]],[[23735,44239],[372,-3279]],[[27335,43910],[-27,187],[-82,5],[-10,111],[-117,-34],[-48,192],[-80,140],[-61,-18],[-43,526],[-175,148],[-233,-89],[-77,121],[-17,167],[-63,90]],[[24353,38786],[383,-3341]],[[27580,37236],[67,229],[-15,334],[25,106],[-48,522]],[[24263,39584],[90,-798]],[[86315,96536],[76,-176],[108,-81],[18,-206]],[[86517,96073],[29,70],[140,-170],[29,-134]],[[86715,95839],[40,25]],[[86755,95864],[-109,487],[-37,280],[-360,866],[-154,258],[-26,-33],[298,-616],[41,-183],[17,-377],[-110,-10]],[[85919,97958],[89,-224],[40,97],[-83,167],[-46,-40]],[[85736,98213],[57,-143],[52,81],[-109,62]],[[85214,98724],[354,-394],[52,85],[-304,347],[-102,-38]],[[84146,94816],[1194,-329]],[[85340,94487],[155,1649],[22,-7],[74,697]],[[85591,96826],[-73,162],[-355,176],[-139,-134],[-83,-202],[10,-425],[52,-37],[-138,-441],[-94,-133],[0,-111],[-97,-223],[-68,-40],[-63,-264],[-122,24],[-96,-307],[-179,-55]],[[83862,99608],[105,-374],[302,-372],[157,-255],[104,-106],[301,142],[41,160],[112,109],[-305,274],[-30,-81],[-193,68],[-12,84],[-321,322],[-255,116],[-6,-87]],[[83457,99810],[252,-176],[-36,182],[-212,75],[-4,-81]],[[83145,99811],[34,-123],[81,-1],[-13,152],[-102,-28]],[[81555,99934],[106,-66],[40,63],[-143,68],[-3,-65]],[[80189,68673],[49,-409],[-76,-467],[16,-356],[38,-312],[-76,-122]],[[80140,67007],[161,-155],[157,215],[71,-61],[154,21],[159,-176],[68,39]],[[81100,67033],[2,150],[122,136],[174,39]],[[81547,67512],[-369,624]],[[81178,68136],[-180,-126],[-173,161],[-228,85],[-68,146],[-16,279]],[[75003,70150],[73,400],[55,132]],[[75131,70682],[169,345]],[[74524,71566],[-30,-332],[-95,19],[-337,-211],[-72,-95]],[[73990,70947],[-26,-388],[185,-155]],[[51145,89595],[490,194],[56,-131]],[[52487,90675],[-106,297],[-76,-8],[-49,-193],[-148,28],[-31,-60],[-225,31],[-76,-41],[-24,150]],[[51752,90879],[-168,-49],[-39,-132],[-58,93],[-102,-200],[-66,2],[-111,-123],[-52,47],[19,-231]],[[51175,90286],[-4,-163],[-161,-76]],[[51010,90047],[-39,-220],[174,-232]],[[56563,41949],[476,5]],[[57098,43669],[-741,0]],[[56357,43669],[-51,-503],[-184,-1]],[[25124,95090],[81,-118],[51,81],[-51,118],[-81,-81]],[[24855,94663],[14,-76],[95,94],[3,250],[-112,-268]],[[24908,93151],[134,-27],[163,80],[44,114],[84,8]],[[25464,93715],[60,227],[143,329],[-50,555],[-96,348],[-67,-105],[-46,75],[-181,-461],[66,-185],[-64,-302],[-87,-260],[-74,-60],[126,281],[34,394],[-31,143],[-124,16],[-143,-77],[-105,-175],[23,-170],[-52,-334],[-1,316],[-43,99],[27,150],[-129,-116]],[[20175,89861],[13,113],[190,47],[10,-122],[203,99],[84,-245],[227,-110],[4,366],[81,102],[140,60],[56,170],[488,525],[91,316],[4,106]],[[21622,91487],[-7,-79],[-174,-184],[-149,-44],[-131,-111],[-217,-96],[-195,-143],[33,-152],[61,18],[-66,-341],[9,-235],[-56,319],[-180,249],[-233,14],[-225,-109],[45,-181],[-124,91],[-378,-50],[-106,16],[-332,185],[-70,74]],[[73498,39485],[41,597]],[[42432,47105],[767,92],[1150,99]],[[44289,48960],[-1755,-207],[-191,-14]],[[42343,48739],[28,-297],[61,-1337]],[[76225,55659],[173,-99],[154,319],[57,-93],[59,70]],[[76605,56569],[-305,50],[-72,-52]],[[68310,41325],[685,-122]],[[68998,41258],[57,1264]],[[68422,43655],[-74,-1327],[22,-4],[-40,-667]],[[14713,3518],[-31,-15],[-123,722],[-807,-407],[9,-52],[-1598,-829]],[[12163,2937],[-33,-350],[67,-497],[-17,-293],[49,-31],[161,-495],[-71,-237],[119,25],[111,150],[210,440],[136,192],[53,-4],[168,268],[-19,57],[159,222],[169,129],[233,70],[141,198],[223,89],[46,130],[212,102],[153,-121],[114,236],[15,163],[181,49],[-30,89]],[[12308,4392],[446,233],[-10,55],[787,408]],[[13531,5088],[-163,944],[20,12],[-108,641],[422,205]],[[13702,6890],[-57,320],[65,37],[-130,738]],[[12200,7276],[14,-436],[63,50],[-16,125],[197,-118],[191,-2],[-40,-114],[-166,-162],[16,-147],[-133,-115],[-56,52],[-11,302],[-93,21],[101,-504],[37,-409],[14,-443],[-76,-311],[66,-673]],[[82278,78672],[103,-75],[173,71],[200,-59],[-57,-554],[109,-31]],[[82806,78024],[233,1036],[123,398],[40,274],[124,408]],[[82746,80480],[-50,-517],[-134,-277]],[[14713,3518],[61,102],[-29,187],[56,5],[45,-155],[-55,-143],[24,-125],[188,-35],[0,104],[-94,69],[24,183],[135,-166],[-12,334],[-83,-5],[38,213],[-2,211],[54,96],[-133,11],[-15,137],[-105,70],[-49,191],[-119,203],[-19,-72],[120,-324],[-89,16],[-138,337],[-163,188]],[[14353,5150],[-767,-378],[-55,316]],[[12308,4392],[28,-830],[-52,-120],[12,-182],[-133,-323]],[[9200,40555],[-68,330],[61,169],[-82,40],[-44,123],[79,230],[-97,-98],[3,247],[-97,6],[-34,-148],[-127,-274],[-84,2],[-99,-280],[-35,-200],[-84,-157],[-92,-72],[-83,117],[-55,-72],[153,-363],[52,-180],[-27,-292],[45,-16],[-24,-224]],[[87334,49630],[80,673]],[[87081,50868],[-75,-40]],[[87006,50828],[-105,-42],[-116,-200],[-140,-37],[-82,55]],[[86563,50604],[-84,-581],[159,-245]],[[65627,43648],[-203,26],[2,226],[-112,68],[-381,44]],[[34852,38186],[998,206]],[[28833,31166],[447,132]],[[11533,38119],[-41,261],[-92,-42],[-104,648],[-35,53]],[[11064,38941],[34,-92],[-155,-75],[-38,-180],[29,-177],[-137,-166],[-5,-195]],[[41922,63639],[-75,1670]],[[41846,65348],[-1272,-171],[59,-1158]],[[90800,27449],[662,-453]],[[91475,28813],[-39,15],[29,273],[-309,18],[-355,-149],[-34,17]],[[90767,28987],[5,-194]],[[64959,67547],[495,-43],[1,169],[-199,77],[-32,100],[86,102],[49,-160],[38,54],[154,-14]],[[76580,61152],[56,223],[120,81],[56,-68],[105,446]],[[76800,62135],[-155,-39],[-71,113],[-77,304],[-166,-52],[-55,75]],[[75933,47086],[-56,-1470]],[[76357,45373],[122,-16],[85,122]],[[76564,45479],[126,1519]],[[76036,47073],[-103,13]],[[91188,39816],[-132,402],[-67,391],[-68,532],[-94,241],[-110,89],[-71,-19],[-2,-240],[50,-462],[-14,-176],[-56,-52]],[[19423,53431],[97,-780],[-86,-37],[312,-2529]],[[56500,46410],[61,128],[77,-28],[-36,158],[19,198],[93,121],[40,225],[83,34]],[[56837,47246],[-214,-4],[-9,816]],[[56614,48058],[-193,-30],[-60,70]],[[20586,6631],[39,163],[138,124],[55,-131],[45,80],[123,31],[13,194],[112,52],[12,149],[129,68],[51,-185]],[[21303,7176],[164,-124],[51,13],[69,265],[12,208],[82,190],[107,-121],[74,74],[92,-58],[78,116]],[[22032,7739],[-289,2089]],[[21743,9828],[-204,-83]],[[14353,5150],[-278,449],[-136,337],[181,110],[197,-53],[78,-97],[-303,66],[-78,-130],[231,-394]],[[14245,5438],[315,156],[-73,426]],[[14454,6202],[-141,260],[-1,244],[-56,134]],[[14256,6840],[-71,4],[-28,-140],[-121,90],[-148,190],[-186,-94]],[[15092,837],[197,290],[-144,-111],[-53,-179]],[[14901,1109],[101,-37],[-11,104],[-90,-67]],[[14646,1390],[52,-76],[102,50],[51,235],[84,71],[-52,-259],[244,-242],[60,35],[160,276],[-122,109],[20,233],[-44,189],[-67,50],[-34,241],[-92,-29],[-49,-193],[-162,-77],[-95,-176],[-56,-437]],[[14656,1030],[70,51],[83,244],[-153,-295]],[[64549,49907],[88,-225],[27,-302]],[[65338,50469],[-239,16],[13,337],[-290,215]],[[64822,51037],[-85,-145]],[[64737,50892],[-188,-313],[-47,-419],[47,-253]],[[35758,44731],[1168,243]],[[36926,44974],[-21,172],[-91,-1],[-77,551],[-92,26],[-53,369]],[[36592,46091],[-52,223]],[[35251,45054],[30,-44],[-134,-204],[72,-186]],[[12970,30044],[733,339],[1415,636]],[[14043,36424],[94,-190],[101,-648],[-74,-149],[-36,-194],[27,-277],[-48,-109],[-151,-97],[-180,-442],[-21,-181],[-99,-104],[-98,-220],[-178,-114],[-74,119],[-145,78],[-24,157],[-97,-15],[-12,-120],[-94,-44],[-74,-176],[112,-707],[-434,-197]],[[43030,50162],[1210,133]],[[42922,52561],[28,-693],[13,0],[67,-1706]],[[22557,12954],[286,-2175]],[[84465,84946],[91,961],[-10,31],[93,985]],[[84639,86923],[-25,7],[80,673]],[[84165,87743],[-30,-251],[-160,-383],[-198,-105],[-34,-221],[-235,-232],[-76,-215],[135,145],[46,-291],[-214,56],[-20,-220],[-133,37],[-19,-219],[-85,-203],[-195,51],[-30,-331]],[[57470,23829],[5,-86],[109,-49],[41,64],[123,-255],[51,-216]],[[57799,23287],[143,166],[61,-26],[82,169],[177,164],[278,-2],[93,170]],[[58633,23928],[-74,111],[-109,40],[4,167],[-96,116],[-93,212],[-4,398]],[[57875,24984],[-385,10]],[[76820,69078],[21,316]],[[76841,69394],[14,185],[-46,9],[-68,445]],[[76570,69847],[-205,-110],[-69,-184],[-38,59],[-134,-192]],[[43722,38820],[924,105]],[[44646,38925],[-25,838]],[[44620,39769],[-950,-109]],[[43670,39660],[25,-174],[27,-666]],[[42070,60275],[1579,168]],[[76839,65762],[293,-623]],[[77417,65168],[122,59],[27,130],[134,91]],[[79459,67722],[148,331],[92,27],[43,267],[62,102],[11,368]],[[79815,68817],[-72,26],[-185,189],[-30,-46],[-153,144],[-76,-140],[-252,256]],[[79047,69246],[-65,-275],[-112,-59],[-114,-324]],[[90821,33639],[271,199]],[[91081,33975],[2,199],[73,-34],[0,248]],[[91156,34388],[-267,-82],[-151,-9]],[[90738,34297],[-20,-205],[38,-95],[-29,-364],[94,6]],[[81015,72383],[162,106]],[[81177,72489],[124,120],[138,285],[70,-6],[248,273],[76,132]],[[81833,73293],[119,238],[-17,68]],[[81775,74118],[-142,-94],[-224,126],[-231,-49]],[[81178,74101],[-48,-301],[-79,-79],[-77,53]],[[63839,49004],[114,-197],[213,-17],[8,-174],[65,-86],[78,-300],[136,-15],[44,-232],[57,-10],[208,248],[72,-51],[43,86]],[[64549,49907],[-2,-256],[-135,2],[10,-172],[-321,30],[-36,120],[-211,39]],[[65356,81104],[-38,184],[-83,140],[-155,-84]],[[65080,81344],[-33,-38],[-79,227],[-114,-243],[-123,-121],[-43,-160],[-121,-91]],[[75331,72752],[-3,281]],[[75328,73033],[-21,197],[-92,408],[42,220]],[[75257,73858],[9,65]],[[75266,73923],[-47,-31],[-100,141],[-9,154],[-377,57],[21,333]],[[74129,74700],[50,-174],[-12,-142],[83,-345],[-46,-275],[32,-97]],[[69506,80772],[380,-157],[7,-84],[101,130],[-57,89],[-74,-43],[-256,100],[-101,-35]],[[70041,78968],[-95,167],[22,122],[-71,405],[12,507],[-45,224],[-105,29],[0,-120],[-145,-111],[-105,62],[-33,-66],[-117,89]],[[69359,80276],[-99,-1393]],[[69260,78883],[-72,-1001]],[[69188,77882],[-33,-442]],[[22080,3191],[1109,443]],[[22708,7144],[-144,-58],[-126,936],[-92,-70],[-69,-185],[10,-140],[-217,183],[-38,-71]],[[21303,7176],[25,-303],[-44,-228],[79,-51],[100,77],[73,-36],[20,-282],[80,-3],[51,-267],[102,-171],[-24,-195],[4,-341],[32,-249],[118,-164],[111,-526],[44,-411],[-71,-259],[11,-362],[66,-214]],[[15419,1242],[35,-30],[74,424],[-70,-175],[-39,-219]],[[15701,1720],[-2,-267],[64,-118],[-50,-123],[-90,-26],[-133,85],[62,-130],[-82,-88],[23,-251],[-70,-161],[83,-139],[-97,-80],[125,-187],[942,460],[493,255],[1290,590]],[[15060,0],[83,139],[-90,-41],[7,-98]],[[78705,74301],[365,-70]],[[79343,75285],[28,136],[-240,54],[22,323],[-47,155]],[[79106,75953],[-185,35]],[[78921,75988],[18,-144],[-88,-110],[9,-273],[-62,-81],[-19,-200],[-98,-32],[-117,-197],[-2,-131]],[[29761,35971],[118,-1248]],[[86967,52213],[121,-701],[-82,-684]],[[87484,51402],[-109,183],[159,11],[123,168],[25,175],[106,1]],[[43679,79617],[-706,-87],[-10,223],[-392,-49],[-47,1203],[-430,-47],[-36,880]],[[64141,37040],[115,-221]],[[64256,36819],[30,408],[123,113],[-32,232]],[[73783,43934],[-40,-610]],[[74097,38343],[95,-21],[-47,-669]],[[74332,37612],[575,-132]],[[74979,38426],[-191,43],[4,57],[-190,42],[13,168],[-384,89]],[[34042,50558],[125,-157],[36,-167],[88,-128]],[[34600,49939],[58,94],[-26,267],[21,189],[79,82],[-35,153],[-35,494]],[[34662,51218],[-849,-180]],[[47765,82819],[-25,1072]],[[46942,83850],[0,-204],[-87,-138],[73,-41],[-13,-216],[34,-394],[42,-50],[37,-491],[47,-213],[405,59]],[[28496,16085],[183,-1759],[-124,47],[-87,-94],[16,-85],[-111,-313],[-54,-41]],[[79275,71613],[90,-205],[-28,-45]],[[79337,71363],[49,-5],[219,-498]],[[79605,70860],[127,15]],[[79732,70875],[30,198],[92,300],[-16,115],[91,439],[118,185]],[[79869,72310],[-104,-122],[-79,-174],[-319,-208],[-92,-193]],[[17804,62842],[-1710,-647],[-372,-163],[1,-67],[-212,-247],[20,-49],[-263,-103]],[[57191,57014],[-678,4]],[[56513,57018],[-6,-1052],[-63,-196],[47,-21]],[[74730,23216],[41,101],[30,317],[47,113],[-31,467],[21,317]],[[74838,24531],[-895,212]],[[34741,25883],[2225,487]],[[36169,28775],[-96,-20]],[[36073,28755],[40,-553],[-194,-38],[25,-334],[-384,-83],[24,-324],[-348,-77],[-8,-115],[-199,-38],[17,-215],[-191,-44],[30,-336],[-99,-22],[24,-334],[-96,-21]],[[52814,71203],[351,13]],[[67074,62744],[-280,35]],[[50466,47099],[-4,336]],[[91356,25324],[-167,-1398]],[[91476,26056],[-71,-192],[-49,-540]],[[52666,90930],[-196,452],[-167,530]],[[52303,91912],[-91,0]],[[52212,91912],[166,-446],[73,-282],[61,-113],[-17,-156],[105,-287]],[[51752,90879],[63,79],[186,-48],[-31,209],[49,158],[226,177],[-146,513]],[[52099,91967],[-1026,-20],[-93,-238],[-106,-63]],[[50874,91646],[27,-949],[274,-411]],[[91362,17161],[376,-145],[628,-293]],[[92366,16723],[9,395],[100,78],[-102,400],[62,42]],[[92435,17638],[-72,310],[-185,-120],[76,227],[-99,-34],[-90,676],[-195,-80]],[[83765,42669],[-106,815],[118,394],[-104,483]],[[79727,65619],[18,-66],[183,-178],[165,14]],[[80311,65684],[177,156]],[[80488,65840],[-425,847]],[[86474,46627],[84,40]],[[87608,47742],[-162,405]],[[56945,69757],[-125,-115],[-61,41],[-342,-46],[-59,32]],[[56018,69707],[-9,-1923]],[[76283,44135],[138,-572]],[[77344,43923],[26,618]],[[77370,44541],[-27,159]],[[77343,44700],[-974,116]],[[78794,70610],[360,986],[183,-233]],[[79275,71613],[-448,1016]],[[78827,72629],[-49,-126],[-137,-157],[-49,-246],[14,-113],[-86,-84]],[[76553,64796],[-41,-50],[72,-411]],[[76584,64335],[374,189],[83,-132]],[[76233,62722],[15,246],[172,245],[242,132]],[[76662,63345],[16,232],[51,81]],[[76729,63658],[-547,114]],[[20871,14407],[566,233]],[[21623,14717],[854,341]],[[21492,18262],[43,-320],[-323,-127],[22,-162],[-68,-26],[27,-216],[-71,-195],[14,-104],[-94,-32],[-15,-366],[43,-323],[-66,-25],[52,-380],[-55,-307],[41,-313],[62,25],[45,-325],[-343,-136]],[[20806,14930],[65,-523]],[[79815,68817],[180,189]],[[79679,70053],[-53,-31],[-17,-339],[-249,-127],[8,-104],[-151,-77],[-173,70]],[[79044,69445],[3,-199]],[[79835,67053],[77,-163]],[[79967,66875],[173,132]],[[74989,42468],[-20,-619]],[[74969,41849],[883,-79]],[[75852,41770],[11,-1],[-61,952],[-101,6]],[[64804,59129],[92,-374],[142,-206],[74,-243]],[[65112,58306],[109,-124],[70,-173],[24,-330],[-36,-166],[-116,-79],[-26,-281],[-121,13]],[[65016,57166],[47,-350],[63,-175]],[[65126,56641],[336,-31]],[[65462,56610],[30,927]],[[64963,59109],[-159,20]],[[89110,18149],[1042,-486]],[[90360,19339],[44,48]],[[83365,47306],[581,497],[55,74]],[[84001,47877],[36,126],[-27,216]],[[83627,49065],[23,168],[-97,184]],[[86559,36290],[-44,253],[35,190],[78,185],[-94,313],[49,112],[117,-37],[51,96]],[[85648,38290],[-134,-314]],[[64014,57262],[370,-35]],[[64384,57227],[632,-61]],[[65112,58306],[-234,23],[-6,-226],[-869,56]],[[85349,42059],[68,-425],[167,-367],[16,-193]],[[28072,5401],[547,183],[998,311],[1194,359]],[[30811,6254],[-156,1612],[-27,333]],[[30628,8199],[-63,-41],[-513,-152],[-65,645],[-1142,-352]],[[91279,19394],[-26,202],[60,26],[-65,126],[-42,348],[27,11],[-25,464]],[[91208,20571],[-104,-478],[-442,318],[-69,12]],[[53838,31627],[1122,13]],[[57403,73472],[164,-1]],[[56745,75597],[-90,0],[-8,-1121]],[[76564,45479],[102,69],[15,120],[695,-116]],[[77376,45552],[92,-12],[16,349],[191,-23]],[[77675,45866],[10,392],[-56,5],[4,282],[-100,14],[67,307],[-122,132]],[[77478,46998],[-79,-148],[-112,-531],[-242,256]],[[23011,91654],[152,26],[74,-51]],[[22994,90626],[53,120],[189,83],[249,287],[-21,71],[167,239]],[[23535,91888],[-8,40]],[[23513,91993],[-203,-268],[-56,-280],[-14,125],[-202,37],[-118,-282],[-118,-203],[-35,-173]],[[63643,63597],[-4,-172],[268,-5],[986,-84]],[[64893,63336],[11,274]],[[64691,62429],[185,-34],[17,941]],[[67863,30934],[-3,212],[67,232],[-40,130],[20,158],[84,206],[2,211],[43,175]],[[63808,27372],[13,358]],[[63821,27730],[-197,-3],[-730,80],[-131,123],[14,225]],[[62490,28146],[-22,-643],[-19,3],[-40,-1338]],[[90799,36197],[-96,289],[-82,62],[66,148]],[[80100,54078],[574,-99]],[[53528,18727],[776,3]],[[54323,21053],[-482,-5]],[[50060,21239],[-1108,-71]],[[48952,21168],[-251,-20]],[[48701,21148],[33,-1300]],[[91821,18946],[370,162],[-24,344],[-77,573]],[[92090,20025],[-89,-29],[14,359],[-244,-20],[-66,611],[-100,-23]],[[91605,20923],[-282,-50],[-88,-322],[-27,20]],[[54150,35647],[23,211],[124,194],[-10,242]],[[54287,36294],[-61,123],[-404,-6]],[[19165,35310],[-662,1818]],[[18503,37128],[-2778,-1134]],[[91566,21208],[39,-285]],[[92090,20025],[109,35],[197,-122],[226,36]],[[92622,19974],[50,242],[-77,417],[49,125],[-82,438],[21,328]],[[68914,22457],[20,-269],[174,29],[-99,338],[-95,-98]],[[68290,23143],[62,-57],[22,205],[-84,-148]],[[67826,25221],[15,-185],[152,-460],[262,-249],[56,117],[-10,-170],[55,-328],[131,-381],[24,-333],[68,5],[113,-126],[3,-254],[73,-149],[116,-28],[12,303],[-74,-12],[3,511],[-108,135],[-19,179],[-69,180],[35,137],[-64,140],[24,82],[-93,125],[-50,170],[-82,509]],[[76231,37858],[-510,124]],[[82561,70426],[-94,-16],[-316,635]],[[82019,70515],[-19,-126],[-240,-491],[20,-131],[-54,-139]],[[81726,69628],[11,-80],[246,-401]],[[43706,31956],[1150,136]],[[44852,35572],[-16,335],[-96,-11]],[[44740,35896],[-1006,-101]],[[43734,35795],[-33,-2]],[[52144,30673],[11,-1341]],[[66216,22753],[392,-46]],[[67728,24126],[-77,56],[-43,143],[32,100],[-104,261],[-50,281],[-59,147],[-2,164]],[[67425,25278],[-381,74],[-19,-25]],[[67025,25327],[-41,-660],[-380,42]],[[17638,86332],[-356,62],[10,193],[-524,70],[-815,788],[2,97],[-394,14]],[[91294,34269],[-22,127]],[[91272,34396],[-141,122]],[[91131,34518],[25,-130]],[[33423,26949],[108,218],[81,270],[-25,302],[379,92],[-4,55],[191,42],[-9,113],[192,44],[-14,165],[190,43],[-9,111],[191,44],[-8,110],[190,43],[-4,55],[291,65],[3,-42],[899,186],[8,-110]],[[35899,32850],[-47,659]],[[61046,45497],[2,0]],[[77082,42322],[28,-115],[-2,-454]],[[77648,41658],[14,360],[129,-16],[15,341],[65,-8],[14,338]],[[60076,69299],[0,279],[261,-2]],[[60337,69576],[7,1385]],[[63815,32894],[957,-104]],[[64772,32790],[47,1182]],[[91409,34040],[136,160],[39,-64],[93,225],[-7,160],[-127,128]],[[91543,34649],[-131,32],[-76,-169],[4,-222]],[[55133,23380],[772,-8]],[[65462,56610],[458,-44],[-42,-892],[23,-3]],[[66442,57002],[-57,153],[-63,-132]],[[66226,57032],[39,83],[-40,161],[71,210],[-55,167]],[[64772,32790],[-6,-168]],[[19863,33706],[704,268]],[[19652,40892],[-1223,-477],[-778,-30]],[[17651,40385],[-25,-216],[180,-198],[26,-117],[-27,-436],[44,-112],[84,32],[105,-119],[4,-163],[135,-142],[189,-37],[78,-274],[21,-203],[-13,-292],[51,-290],[74,-208],[0,-210],[-74,-272]],[[15422,37367],[-480,925],[-319,144],[-117,11]],[[79497,76542],[-74,-361],[-260,49],[-25,-285],[-32,8]],[[40107,29519],[146,-2589]],[[82310,30194],[123,25],[70,171],[140,76],[151,-99],[59,-118],[71,11],[141,-203],[206,-159]],[[83745,31849],[-990,318]],[[82755,32167],[-231,67]],[[82524,32234],[-214,-2040]],[[57657,38342],[-4,-375],[-64,1],[-11,-1007]],[[43649,81014],[-73,1931]],[[43576,82945],[-175,-93],[-151,32],[-84,-89],[-149,80],[-126,-41],[-121,-219],[-88,-1],[-175,-155]],[[77705,62948],[44,-47],[351,-107],[116,-259]],[[77854,63835],[21,-149],[-121,-221],[-10,-402],[-39,-115]],[[67510,52611],[-581,85]],[[66732,52706],[-39,-1008]],[[79542,35042],[794,-213]],[[80470,36223],[-796,217]],[[66563,39855],[32,670]],[[66595,40525],[-96,16],[18,336],[-101,16],[7,141],[-95,21],[-50,115],[-227,37]],[[65548,40675],[-19,-176],[131,-508]],[[34662,51218],[-59,831]],[[78960,40192],[-38,-563],[-162,32],[-20,-284]],[[59198,22050],[-18,-956],[136,-8],[-10,-675]],[[60076,68051],[134,20],[252,-168]],[[60462,67903],[573,-4]],[[61100,69571],[-172,55],[-187,-113],[-81,63],[-323,0]],[[77358,35895],[151,-61],[91,-140],[282,-270],[75,17]],[[77957,35441],[46,592],[155,-37],[24,289]],[[77414,36445],[-56,-550]],[[78260,58082],[54,-103],[80,41],[155,-220],[81,-42],[250,-313],[182,-102]],[[79335,57719],[-28,85],[76,257],[-39,96],[81,102],[157,86]],[[79429,58617],[-130,-94],[-41,164],[-102,-28],[-61,112],[-291,125],[-100,-68],[-117,170]],[[63959,59317],[832,-67],[13,-121]],[[40157,65970],[191,30],[-49,1008],[229,31],[-32,626],[384,49],[-16,334]],[[42543,35651],[-1070,-142]],[[60832,66572],[339,0],[164,101],[131,206]],[[60462,67903],[-6,-357],[-131,-268],[125,-42],[0,-665]],[[79841,56595],[64,-172],[177,103]],[[80935,57060],[-92,376],[-145,466]],[[80181,58009],[-128,-531],[-238,-279],[98,-166],[19,-162],[-91,-276]],[[79789,56798],[52,-203]],[[78896,72816],[-69,-187]],[[81293,89453],[772,-176],[54,661],[390,-87]],[[81961,90993],[-175,-397],[-87,-288],[-232,-547],[-174,-308]],[[79376,64518],[-157,-73]],[[79219,64445],[-240,109]],[[78979,64554],[-158,-11],[-222,-179]],[[78578,76048],[343,-60]],[[79343,77450],[-260,29]],[[78919,77496],[-16,-78],[-155,-81],[-105,-223],[49,-63],[-1,-201],[180,-133],[-47,-152],[-141,-48],[8,-173],[-113,-296]],[[76327,70616],[-251,204],[-100,-25]],[[75873,70878],[39,-183],[-56,-66]],[[75856,70629],[-62,-938],[-19,-55]],[[87011,60625],[115,143],[71,-37]],[[76662,63345],[224,-387]],[[77207,62894],[114,254]],[[77321,63148],[-80,273],[111,250]],[[77352,63671],[-311,721]],[[76584,64335],[125,-135],[79,-364],[-59,-178]],[[62338,43104],[1003,-58]],[[62484,44078],[-111,-343],[-36,-351],[1,-280]],[[77465,70735],[97,62],[0,-255],[74,13],[46,-113],[-27,-394],[16,-223]],[[77671,69825],[-1,-3]],[[77870,69886],[82,27],[57,243],[-20,61],[129,435]],[[57481,78599],[200,93]],[[57530,80637],[-231,-1853],[182,-185]],[[58661,25620],[130,-39],[92,100],[81,-25]],[[58964,25656],[27,614],[65,-4],[0,333]],[[66876,69365],[254,-29],[26,678]],[[77343,44700],[33,852]],[[81282,31551],[171,-230],[306,-532],[101,-266],[315,-412]],[[82175,30111],[135,83]],[[82524,32234],[-893,271]],[[86435,45224],[176,172]],[[86611,45396],[44,100],[109,-55]],[[86764,45441],[148,100]],[[63387,56063],[19,1258]],[[91125,35276],[148,-73],[245,83],[7,-151],[86,556],[13,781]],[[77675,45866],[128,-13]],[[78058,47482],[-151,-7]],[[77757,47185],[-118,-174],[-161,-13]],[[66921,16786],[221,-22],[252,133],[21,127],[154,50],[64,101],[29,196],[100,146],[39,151],[102,155],[92,23],[43,321],[170,47],[217,-61]],[[68496,19429],[-194,30],[34,662],[-194,29]],[[80457,74113],[132,-83],[189,-437]],[[81178,74101],[114,226],[-17,124],[-202,77],[-45,180],[-85,96],[-175,-22]],[[27948,87541],[10,-131],[81,-123],[32,-160],[360,-322],[100,90],[49,-98],[178,-9],[110,69],[116,269],[-7,149],[-77,204],[4,343],[-121,214],[-121,129],[-64,-52],[-267,-43],[-135,-234],[-203,-129],[-45,-166]],[[26988,88208],[30,-141],[198,-232],[52,-175],[85,-29],[-17,406],[-174,115],[-94,321],[-91,-137],[11,-128]],[[84423,34696],[117,210]],[[78365,73921],[-11,-392],[67,-64],[-15,-187]],[[57304,20038],[22,-46],[-19,-1302],[-22,1],[-3,-664],[870,-20]],[[58133,20472],[-875,28],[-26,-309],[72,-153]],[[38588,22775],[-764,-145],[42,-658],[61,17],[81,-1220],[-282,-98],[27,-396],[55,11],[11,-165],[-95,-18],[9,-146]],[[85139,92515],[29,277]],[[85168,92792],[-774,234],[-97,-987],[-580,168]],[[79632,65685],[-273,-670],[-140,-570]],[[82100,72598],[-97,504],[-170,191]],[[81177,72489],[119,-532],[-22,-105],[98,-289]],[[52901,86257],[208,163],[76,393],[101,96],[56,163],[23,278],[108,255]],[[75241,44843],[24,-1]],[[75265,44842],[10,243],[25,1627]],[[74980,46563],[-16,-181]],[[74773,45850],[-7,-591],[31,-121],[-80,-59],[90,-204]],[[53860,21379],[-32,439],[-109,279],[-284,359],[-40,174],[35,77]],[[52810,23798],[6,-996]],[[80812,46391],[146,-238],[70,106],[171,-51]],[[95117,22957],[-68,25],[6,172],[-98,6],[-213,132],[40,-242],[-425,-352]],[[94359,22698],[12,-44]],[[64464,51251],[144,-216],[59,19],[70,-162]],[[64822,51037],[136,85],[80,172],[50,-5],[116,190],[126,-1],[-80,166],[70,164]],[[65048,52625],[-81,-102],[-76,125],[-480,-760],[223,-420],[-170,-217]],[[86502,44460],[59,-159],[70,18],[157,183],[125,23]],[[86913,44525],[-14,224],[43,242],[66,115]],[[86764,45441],[-49,-117],[-104,72]],[[43974,16718],[775,92],[5,-110],[581,66]],[[72943,60709],[88,239]],[[73031,60948],[19,9],[54,889]],[[73104,61846],[-808,134]],[[72296,61980],[-14,2]],[[72282,61982],[-30,-521]],[[72252,61461],[5,-420],[69,-247],[-19,-143]],[[45422,10936],[26,-656],[121,13],[13,-328],[194,22]],[[73031,60948],[87,-89],[155,76],[77,-107],[-40,-187],[264,-166]],[[73925,61076],[60,219],[-35,193],[-141,247]],[[73572,61773],[-468,73]],[[58964,25656],[122,-84],[111,-300]],[[72910,41237],[66,879]],[[58142,17141],[-9,-693],[-56,-82],[33,-247],[-155,-68],[-35,82],[-203,-279],[21,-136],[-82,-224],[-59,-45],[-316,257],[-136,-106]],[[74838,24531],[29,656],[-48,41],[-80,251],[-131,25],[-50,191],[-7,248]],[[51405,49827],[-12,1348]],[[51393,51175],[-958,-35]],[[50428,50800],[14,-1007]],[[56837,47246],[68,120],[84,-58],[44,99],[104,-10]],[[57131,47843],[-337,10],[-119,-57],[-61,262]],[[46417,89262],[194,11]],[[47839,92911],[-85,-32],[7,-121],[-86,-53],[68,-80],[61,-558],[-95,-56],[40,-247],[-83,-195],[-94,-111],[-72,53],[-57,-130],[-71,14],[-125,-302],[-206,-271],[-41,-249],[7,-183],[-71,-113],[15,-153],[-117,-60],[-46,-271],[-68,-81],[-54,-230],[-249,-220]],[[54564,84215],[57,50],[72,331],[-72,109],[167,237],[52,298],[103,70],[39,185],[52,15]],[[54131,86652],[-644,-1092]],[[53487,85560],[570,-600],[81,-414],[258,-455]],[[77306,68010],[25,183]],[[77272,69305],[-431,89]],[[78112,65236],[-46,153],[63,178]],[[77156,70564],[393,-716],[122,-23]],[[75328,73033],[39,48],[166,-30],[-32,102],[132,73]],[[75633,73226],[33,564],[-91,14]],[[75575,73804],[-126,52],[-192,2]],[[78827,40496],[-793,145]],[[75633,73226],[473,-80]],[[76211,73125],[33,566],[65,31],[88,307],[-6,215]],[[75881,74354],[-234,51],[-57,-355],[-15,-246]],[[79228,46134],[43,-21],[106,195]],[[79103,47553],[-122,261],[-96,-68],[-25,-322]],[[78813,47045],[-60,-505],[167,-233],[308,-173]],[[79974,49413],[100,1],[300,649],[33,167],[170,120]],[[90509,32551],[-161,530]],[[90348,33081],[-163,544],[1,169],[-83,121],[-101,-7]],[[70692,69935],[191,-41],[-5,-338],[47,-159],[154,-15],[-14,-252],[80,-152],[91,28],[65,-108]],[[68355,64624],[388,-46]],[[69053,65086],[-11,908]],[[69042,65994],[-623,76]],[[62346,42917],[-8,187]],[[61606,44130],[-26,-1187]],[[92483,22244],[198,-27],[244,57],[214,-35]],[[93139,22239],[-67,395],[-69,13],[41,232],[-32,234],[77,234],[126,211]],[[93215,23558],[-13,240]],[[93202,23798],[-222,86],[7,-202],[-332,241],[21,93],[-96,27],[-46,-82]],[[49501,11958],[-530,-37],[-34,1324],[55,4],[-16,660]],[[48976,13909],[-388,-28]],[[48588,13881],[-194,-16]],[[91460,33784],[203,-103]],[[91663,33681],[28,-7]],[[91832,34451],[-131,103],[-156,199],[-2,-104]],[[84479,54190],[-484,122]],[[64121,17701],[144,-218],[177,-76],[85,45],[158,-106],[151,-26],[245,-256],[185,-369],[200,-37],[77,-143]],[[65080,81344],[-10,212]],[[64188,82036],[133,-1005]],[[83337,87950],[828,-207]],[[75852,41770],[-9,-392]],[[76344,41278],[8,231],[-72,14],[32,298],[52,136],[-40,67],[46,398]],[[76391,42872],[-684,72]],[[84639,86923],[705,-194],[23,-132],[84,-47]],[[85451,86550],[168,418],[189,651]],[[57565,61948],[-8,-161]],[[57557,63693],[13,-1680],[-5,-65]],[[68891,39209],[55,1050]],[[76016,71955],[18,-4]],[[77957,35441],[184,41],[189,-62],[213,-341],[158,-317]],[[78701,34762],[23,233],[159,-41]],[[77762,66922],[55,1007]],[[21172,23639],[85,86],[58,275],[137,151],[32,213],[-25,180],[198,503],[38,265],[98,99]],[[21793,25411],[139,39],[48,264],[-34,135],[101,330],[50,46]],[[23548,31132],[-445,-156],[-1702,-617],[-1045,-408]],[[20344,29945],[828,-6306]],[[9446,43257],[101,75]],[[9547,43332],[173,52],[29,67],[136,-57],[647,316]],[[9998,45792],[13,-74],[-103,-101],[-120,-527],[-142,-285],[-51,-30],[-192,-339],[-21,-193],[-53,-68],[-67,-285]],[[9262,43890],[-49,-151],[9,-165],[65,-255],[159,-62]],[[60476,77376],[129,-90],[75,-199],[109,-92],[173,-303]],[[62178,77313],[-142,132],[-62,-112],[-74,52],[15,729],[65,644],[-139,-1]],[[61242,79060],[-432,49]],[[69042,65994],[-2,109]],[[69022,67316],[-140,17],[-73,241],[-258,173]],[[68551,67747],[26,-119],[-410,54],[-23,-503]],[[89629,37742],[100,-175],[-118,-123],[48,-172],[209,103],[114,-404]],[[89980,37550],[-100,169],[18,270]],[[89898,37989],[-106,131]],[[94285,23789],[-16,-118],[90,-973]],[[95336,23105],[-71,511],[3,268]],[[94670,24675],[-183,-34],[-87,-165],[-64,24],[-98,-377],[107,-113],[-60,-221]],[[90803,26186],[9,-144],[-78,-260],[52,-213]],[[90786,25569],[570,-245]],[[81791,58265],[-49,96],[120,42],[-103,105],[-29,283],[55,434],[-62,38]],[[64891,55539],[56,-171],[125,-178],[-3,-132],[65,-5]],[[65553,54678],[179,-19]],[[65126,56641],[6,-254],[-125,-281],[-31,-270],[-76,-132],[-9,-165]],[[44740,35896],[-40,1026],[136,14]],[[44788,38272],[-117,-14],[-25,667]],[[43722,38820],[29,-667],[-38,-174]],[[43713,37979],[48,-1169],[-47,-6],[-13,-226],[33,-783]],[[82755,32167],[68,594],[-49,56],[71,786]],[[56375,55751],[-591,9]],[[55581,55762],[5,-976],[-7,-509]],[[56506,57638],[7,-620]],[[56504,58981],[8,-338],[-6,-1005]],[[70392,36067],[490,-87]],[[70464,37319],[-20,-332],[52,-206],[-19,-302],[-65,7],[-20,-419]],[[89689,53638],[308,-302],[201,-72],[101,104],[16,138],[-54,285],[45,168],[77,531]],[[52303,91912],[-150,565],[-106,565]],[[51986,93040],[34,-280],[119,-588],[73,-260]],[[52099,91967],[-85,418],[-9,145],[-89,344],[-192,171],[-76,-62],[98,-65],[24,-191],[-55,-11],[-192,284],[-55,12]],[[50626,93063],[14,-1426],[234,9]],[[82185,53041],[11,136],[-94,141],[-128,-32],[-32,178],[39,225]],[[81584,53794],[-166,-311]],[[81379,53411],[-241,-462]],[[81138,52949],[502,-421]],[[21177,21200],[56,189],[116,-33],[62,216],[120,23],[-19,144],[70,49],[25,163]],[[21344,22921],[-75,55],[-97,663]],[[87848,43240],[99,-108],[18,153],[165,-7]],[[88130,43278],[75,359],[32,331],[61,160],[221,296],[-23,264],[-88,27]],[[87982,44174],[-19,-136]],[[87963,44038],[-31,-311],[-93,-335],[9,-152]],[[56811,83919],[-68,-100],[-90,274],[60,105],[-68,180]],[[56645,84378],[-91,-13],[-74,181],[-116,54],[-104,-222]],[[55856,84291],[-385,-354],[-397,-436]],[[55074,83501],[-261,-1436],[224,286],[80,-5]],[[89166,49706],[-62,100],[-88,-196],[-196,-127],[-112,-126],[-9,-184]],[[17264,89160],[-266,35],[-96,-44]],[[16902,89151],[-69,-26],[-93,156],[-33,201],[-181,9],[-69,-64],[-119,151]],[[16338,89578],[-2,-83],[-134,10],[-6,-232],[-621,29]],[[58952,69239],[-59,-130],[-34,70],[-104,-424]],[[66192,64548],[-870,94]],[[91088,34739],[-17,-144],[60,-77]],[[91272,34396],[57,203],[-100,332],[-188,184]],[[48588,13881],[-17,658],[56,4],[-34,1315]],[[48593,15858],[-121,-9]],[[48472,15849],[-853,-68]],[[89432,29763],[451,-781]],[[90767,28987],[32,654],[57,125],[60,439],[66,629]],[[82549,56715],[-32,-90],[-117,-37],[-196,-178],[-136,10]],[[47441,64910],[96,-66],[92,103],[86,189]],[[46676,27778],[-191,-16],[21,-670],[19,1],[43,-1327],[35,-216]],[[58517,43091],[669,-39]],[[59210,43951],[4,253]],[[13973,38553],[-28,199]],[[92263,28527],[5,284],[225,-121],[-4,305],[-40,23],[35,337],[-105,77],[140,570]],[[91643,30260],[-152,-1454]],[[74303,76299],[424,-97],[46,773]],[[74773,76975],[-19,4]],[[74754,76979],[-1019,203]],[[73446,77231],[-58,-754]],[[74828,75738],[623,-96]],[[75694,76782],[-921,193]],[[80208,53854],[97,-97],[-10,-173],[179,-107],[89,-114],[206,-145]],[[80769,53218],[302,-98],[67,-171]],[[42432,47105],[29,-346],[76,-1684]],[[54507,36992],[-38,-152],[54,-254],[-165,-88],[7,-157],[-78,-47]],[[59407,79261],[11,168],[-120,323],[-1,180],[-116,213],[8,157],[-90,102],[-22,133],[51,79],[36,297],[-80,150]],[[78671,65706],[73,-172]],[[78744,65534],[161,400],[111,-163],[141,139],[120,16]],[[79277,65926],[-42,58],[-56,312],[-125,-11],[-77,231],[34,81]],[[47453,64193],[27,-1094]],[[54017,73758],[132,99],[50,182],[98,23],[69,166],[78,-31],[-22,217],[102,-8],[-9,254],[97,34],[21,281]],[[54633,74975],[-836,827]],[[80157,72046],[-1,-966],[-20,-287],[36,-244]],[[80511,70601],[65,331],[80,225],[-14,130],[15,852]],[[64070,51157],[50,22],[5,207],[53,43],[286,-178]],[[39687,57635],[760,115]],[[32677,21503],[-255,-65],[59,-668],[14,3],[143,-1649],[-111,-29],[116,-1316],[34,-187]],[[73086,51891],[90,-528],[74,-188]],[[73250,51175],[63,211],[213,124],[396,-80]],[[72357,58235],[-38,978]],[[72267,59501],[-181,-94],[-119,180],[-25,-111],[-126,2],[-97,-136],[-168,11],[-2,63]],[[71549,59416],[-89,-79]],[[15582,3209],[67,-146]],[[15307,4945],[124,-211],[110,-351],[134,-43],[24,-198],[-59,-108],[-76,-336],[42,-223],[-24,-172]],[[15582,3303],[0,-94]],[[74436,45637],[-84,7],[-111,114]],[[74241,45758],[-112,-79],[-113,-159],[-119,187]],[[73897,45707],[-52,-766]],[[51862,67685],[143,-66]],[[30855,43214],[-1,-1]],[[67406,40944],[-193,29],[-41,-540],[-577,92]],[[59674,64232],[-194,12],[2,112]],[[75469,69590],[1,15],[-601,113]],[[81387,88448],[984,-248]],[[81293,89453],[-112,-183],[-131,-333],[90,137],[96,-120],[57,-252],[94,-254]],[[89947,45628],[57,-193]],[[90004,45435],[635,-369]],[[90639,45066],[-114,645],[-46,106],[-99,-29],[-68,171],[-79,409],[-28,513],[42,151],[-78,437]],[[89680,47310],[13,-293],[117,-595],[-40,-100],[121,-104],[65,-242],[-53,-134],[-83,18],[127,-232]],[[89393,45821],[-48,170],[-42,-137]],[[89303,45854],[90,-33]],[[78155,68914],[428,1120]],[[88623,42560],[-43,-290],[-54,-36],[-85,188],[-74,13],[28,154],[-70,80],[-16,-344],[54,-416],[67,201],[131,-10],[52,-123],[-55,-164],[21,-196]],[[63301,41327],[-472,47]],[[62829,41374],[102,-135],[13,-100]],[[55932,57645],[574,-7]],[[55739,59326],[6,-672],[-4,-1006],[191,-3]],[[91655,33385],[18,119],[-77,24],[67,153]],[[75614,38682],[33,-7],[35,444],[131,28]],[[75058,39480],[-50,-670]],[[52461,38774],[134,-14],[56,65]],[[32469,44009],[-157,1879],[-126,1431]],[[30628,8199],[152,174],[120,56],[-17,165],[288,87],[-16,162],[192,56],[-46,486],[380,107]],[[14506,38447],[75,254],[144,65],[-44,180],[2,235]],[[80787,78990],[601,-175]],[[81388,78815],[2,128],[-125,324],[-64,40],[-67,293],[-203,179]],[[17202,90102],[-111,15],[-5,-149]],[[17086,89968],[-276,-200],[-133,-173],[129,-322],[96,-122]],[[65702,20157],[15,348],[-178,22],[14,332]],[[65553,20859],[-202,10],[10,162],[-196,8],[-5,-155],[-194,35],[-959,112]],[[66983,68679],[213,-250],[145,-73],[171,-23]],[[52426,42805],[-12,1343]],[[75378,64931],[32,505],[30,-5],[36,540]],[[75157,66134],[-257,-70]],[[21389,37719],[554,198],[1608,593],[802,276]],[[22123,43694],[-1306,-2373]],[[57160,71947],[370,373],[235,-12],[268,-197],[10,122],[114,34],[64,-146],[85,62],[-31,79],[121,34]],[[58396,72296],[14,1156]],[[76215,67577],[3,168],[-59,216],[-120,21]],[[72404,43353],[-62,13],[22,336]],[[62490,74846],[87,64],[81,225],[144,30],[107,-173],[38,-176],[95,-5],[9,334],[40,-3]],[[62664,77542],[-145,-106],[-69,101],[15,192],[-92,-98],[-45,-292]],[[74473,46807],[192,-97]],[[74637,47742],[-164,-935]],[[80769,53218],[-162,-491],[-110,-176]],[[34876,22698],[581,135]],[[35457,22833],[530,108]],[[46603,25550],[-145,190],[-203,5],[-29,86],[-128,89],[-134,247],[-214,-82],[-132,56],[-102,141],[-151,-44],[-161,76]],[[96137,29538],[104,-48],[63,-339],[126,-264],[72,19],[57,186],[119,62],[34,-154],[43,270],[-412,219],[-82,201],[-124,-152]],[[96258,28794],[48,27]],[[96306,28821],[-154,339],[-232,256],[20,-97],[184,-204],[134,-321]],[[77352,63671],[119,139],[145,-69],[160,214]],[[69265,38345],[63,1179],[51,669]],[[55021,67944],[154,-125]],[[55000,69403],[4,-1410],[17,-49]],[[57304,20038],[-133,-204],[-167,117],[-185,-170]],[[72903,43254],[72,1004]],[[10478,53706],[105,-461],[-1,-151],[-135,-217],[-49,50],[-148,-251],[-47,-187],[98,-272],[41,-285],[-41,-201],[-160,-120],[-119,-407],[-62,-375],[-183,-239],[-34,-501]],[[51393,51175],[383,12]],[[46478,47171],[-62,1670]],[[75728,43588],[160,-14],[24,640]],[[75484,44821],[-219,21]],[[67025,25327],[13,363]],[[57565,61948],[-69,42],[-36,289],[-183,-98],[-133,130],[-105,-208],[-95,-2],[-63,107]],[[74523,57041],[153,250],[222,302],[94,316]],[[74992,57909],[-158,357]],[[74834,58266],[-223,289]],[[74007,58660],[1,-5]],[[73968,58582],[5,-23]],[[73483,67548],[89,-239]],[[74390,66779],[104,640]],[[76372,31256],[-136,147],[-23,152],[72,187],[-82,3],[-51,184],[29,275]],[[75836,32300],[-166,-1674]],[[75107,30787],[-378,121],[30,334]],[[66554,33815],[112,-20]],[[44701,13596],[-24,567],[-690,-88],[-57,1310]],[[66786,54759],[-14,121],[97,202]],[[66199,54120],[-48,-93],[40,-228]],[[68410,77987],[778,-105]],[[69260,78883],[-902,119]],[[90626,34603],[112,-306]],[[65153,36153],[-768,90]],[[64385,36243],[-18,-400]],[[64367,35843],[-26,-320],[-93,-144],[-172,-126]],[[78080,72979],[249,-30]],[[78094,74083],[-147,-176],[-147,29],[-62,-686]],[[9118,42127],[-35,266],[16,189],[152,153],[117,332],[50,9],[28,181]],[[9262,43890],[-44,262],[-153,-72],[-15,93],[-130,-50],[-7,316]],[[8913,44439],[-68,-74],[-17,-231],[-50,-116],[10,-207],[98,-396],[-25,-321],[14,-172],[-84,-205],[42,-257],[72,-179],[26,-245]],[[80847,69397],[282,-236]],[[81129,69161],[78,9],[62,120],[175,189],[282,149]],[[81018,70667],[45,-581],[-127,-208],[-2,-139],[-118,-69]],[[64367,35843],[-1225,119]],[[49508,96836],[-167,63],[-168,-345],[-69,-28],[-68,-152],[-135,43],[-151,-162],[-144,-64],[-87,58],[-56,-116],[42,-190],[-69,-187],[-86,-62],[5,-119]],[[90348,33081],[25,163],[82,-81],[116,121],[150,-8],[52,81],[48,282]],[[46714,41140],[930,75]],[[49238,71200],[699,44]],[[74812,36259],[-756,170]],[[60344,32814],[-25,-1175]],[[92366,16723],[602,-290]],[[92907,18864],[-78,267]],[[92829,19131],[-200,-282],[88,-256],[-109,-153],[65,-283],[-124,-87],[73,-308],[-187,-124]],[[71442,62123],[840,-141]],[[72296,61980],[104,159],[-119,53],[32,81],[-63,170],[55,155],[-35,379],[21,393],[66,117]],[[14752,41404],[222,572]],[[17385,65864],[-1904,-385],[20,-358],[-74,-273],[-100,39],[40,-513],[-27,-85],[79,-175],[16,-538],[-31,-444],[-215,-922],[-136,-264]],[[42606,35662],[-44,996],[-20,168]],[[42542,36826],[-1127,-152]],[[68727,60869],[89,156],[128,-35],[102,-145],[77,87]],[[69123,60932],[43,154],[-13,201],[66,5],[49,1115]],[[68585,62543],[-31,4]],[[58387,71573],[9,723]],[[77275,60978],[18,175],[-96,53],[-82,251],[25,211]],[[77140,61668],[-47,97]],[[74241,45758],[96,737],[-9,302]],[[74328,46797],[-70,112]],[[73818,46013],[-40,-95],[119,-211]],[[70652,33470],[830,-156]],[[70815,34786],[-40,-658],[-231,42]],[[70544,34170],[55,-271],[53,-429]],[[45684,81205],[-72,2539]],[[45384,85187],[-153,-158],[-18,-110],[-234,-254],[-86,-352],[-176,-86],[-38,-147],[-167,-101],[37,-121],[-41,-237],[-53,218],[-38,-95],[3,-229],[-97,-42],[-82,-362],[-113,-103],[-113,51],[-23,-127],[-59,80],[-255,19],[-102,-86]],[[79044,69445],[-461,589]],[[77468,73138],[-57,185],[-59,19],[52,129],[-73,204],[45,248]],[[76859,74143],[-26,-649],[41,-151],[-73,-127],[-87,-16]],[[80511,70601],[399,54]],[[95374,17404],[134,-56],[-72,-141],[13,-242],[141,-12],[14,-151]],[[96416,17475],[-12,333],[-169,8],[8,204],[76,370],[-164,24]],[[58775,30621],[14,936]],[[60499,74297],[53,168],[88,600],[-62,369],[-105,273],[-8,278]],[[45804,35686],[-43,1342]],[[62064,28549],[-13,-47],[-206,-93]],[[9319,38374],[295,-7],[171,-313],[49,-28],[-7,-193]],[[9827,37833],[57,142],[106,35],[10,344],[98,736],[-2,281]],[[58642,23284],[6,647]],[[58648,23931],[-15,-3]],[[57799,23287],[-152,-264],[-14,-251]],[[35769,75670],[-154,-74],[-221,-300],[-58,-301],[-60,-92],[-29,-230],[-118,-454],[-125,-150],[-75,49],[-65,-146]],[[70516,54256],[195,-63]],[[71332,54811],[-130,172],[-82,468],[-4,304]],[[77370,44541],[193,-25],[2,50],[198,-14],[5,140],[199,-23],[15,397]],[[82424,75164],[-82,173],[134,46],[27,-89],[30,262],[-45,391],[-1,266],[40,114]],[[81484,75286],[22,-189],[141,-45],[28,-158],[88,-151]],[[2703,97629],[93,9],[33,99],[-101,71],[-25,-179]],[[2214,97770],[118,120],[86,361],[-87,-256],[-117,-225]],[[1666,96970],[161,-15],[70,-133],[31,91],[-238,180],[-24,-123]],[[183,94948],[150,-16],[-12,216],[-138,-200]],[[3,93989],[97,-21],[195,194],[72,315],[-72,-107],[-48,47],[-122,-62],[-49,-294],[-73,-72]],[[8760,99025],[201,-102],[44,40],[207,-329],[81,99],[18,-87],[-104,-66],[-43,-110],[68,-138],[186,-32],[-15,119],[68,60],[68,-133],[63,124],[-181,237],[211,-121],[-7,104],[-91,97],[-133,39],[-116,210],[-179,-40],[-91,90],[-160,62],[-95,-123]],[[8131,99405],[170,-218],[19,-146],[90,-89],[116,59],[-30,-111],[66,-167],[169,-61],[90,94],[-45,168],[-220,115],[-117,211],[-337,186],[29,-41]],[[8483,94388],[117,58],[-45,83],[-72,-141]],[[7690,99248],[115,-18],[13,144],[-120,-45],[-8,-81]],[[8324,93559],[119,-32],[-70,110],[-49,-78]],[[7260,99402],[111,-86],[-4,130],[-97,42],[-10,-86]],[[6374,99403],[99,-80],[51,59],[-60,96],[-90,-75]],[[5678,99277],[107,94],[93,-16],[110,136],[185,96],[-217,-19],[-244,-168],[-34,-123]],[[5065,99087],[161,47],[356,-23],[-4,-141],[103,-89],[69,166],[-126,114],[38,114],[-177,44],[-154,-54],[-266,-178]],[[4678,98790],[94,108],[-57,122],[-56,-57],[19,-173]],[[4597,99098],[134,-43],[-3,92],[-110,44],[-21,-93]],[[4199,99135],[142,-179],[46,-182],[107,30],[-49,180],[139,41],[-33,164],[-83,-57],[-186,76],[-83,-73]],[[3893,98832],[254,11],[35,-137],[64,76],[-80,190],[-77,21],[-45,-103],[-151,-58]],[[3705,98464],[133,37],[37,197],[-113,200],[-52,-176],[69,19],[-74,-277]],[[17314,91159],[-211,-29],[-106,186],[31,-165],[-51,-198],[-4,275],[-110,-27],[14,416],[-118,-191],[43,157],[-154,355],[-34,20],[-54,-246],[-11,222],[-55,6],[-96,278],[-121,28],[-42,-91],[-70,163],[-63,8],[-94,-123],[32,-226],[144,-94],[201,-416],[-51,12],[-148,203],[-148,-173],[58,-357],[110,-270],[43,-434],[-59,-226],[143,-114],[236,-345],[75,178],[75,43],[82,-148],[285,132]],[[15941,90739],[47,-223],[44,31],[-91,192]],[[16338,89578],[-67,200],[-117,56],[-117,218],[40,161],[-55,1],[-171,314],[31,150],[-189,301],[66,136],[-91,263],[-158,25],[83,47],[-18,182],[-278,203],[13,145],[-154,94],[-17,467],[38,-73],[125,26],[142,115],[57,148]],[[82598,77083],[71,89],[137,852]],[[81552,78604],[-28,-327]],[[94994,30830],[25,-283],[79,270],[-104,13]],[[95040,28843],[45,236],[-66,66],[75,148],[34,232],[-46,423],[-221,142],[-138,179],[-206,192],[-13,-50]],[[38720,44503],[-731,-122]],[[60480,57534],[-10,-1190]],[[60912,57505],[-432,29]],[[41754,49033],[1,-28],[573,69],[15,-335]],[[43030,50162],[-1139,-139]],[[52265,96337],[54,402],[71,847],[-48,-155],[-34,-479],[-82,-616]],[[52013,96331],[137,537],[-63,151],[37,478],[39,70],[144,39],[7,115],[89,-57],[9,404],[-265,7],[-1,64],[-198,101],[1,255],[-147,-41],[-7,-83],[-147,-59],[-48,-182],[-73,-16],[-132,-321],[-222,-47],[-85,-109],[-136,9]],[[60480,57534],[-145,7]],[[50951,61950],[-379,-13],[-4,-673]],[[59195,60434],[1,112],[638,-9]],[[76428,79337],[878,-194],[32,105],[317,-66]],[[77704,79859],[-149,120],[-222,-49],[5,113],[-166,264],[61,172]],[[76829,80369],[-95,-52],[-178,-343],[-10,-206],[-74,-226],[-82,-64],[38,-141]],[[73132,20605],[135,221],[47,210],[316,6],[178,218],[134,-7],[208,187],[159,-54],[205,295],[-42,98],[51,138]],[[73185,22245],[-127,-1620],[74,-20]],[[67535,36646],[380,-71],[11,167]],[[17491,40399],[160,-14]],[[66140,28462],[772,-94],[-10,-173]],[[67297,28320],[67,1333]],[[67364,29653],[-385,52]],[[62829,41374],[-105,7],[-167,125],[-89,266],[76,159],[-12,427],[-68,49]],[[89735,24295],[422,-274],[73,237],[65,73],[18,214],[115,59],[26,-188],[130,-199],[74,-38]],[[90658,24179],[76,353],[21,287],[61,285],[-30,465]],[[90033,25709],[-206,-987]],[[61982,79194],[760,-52]],[[62889,80474],[159,383],[-257,22],[-111,-80],[-130,95],[-78,-42],[-17,150]],[[54569,64709],[383,0],[0,335],[383,-3]],[[54752,66727],[-763,-5]],[[78281,42958],[190,-25]],[[78471,42933],[16,350],[360,-53]],[[78210,44352],[-14,-344],[-66,8],[-14,-344]],[[71899,74269],[-1118,183]],[[81763,40349],[184,-243],[-15,-118],[56,-129],[-78,-114]],[[81910,39745],[222,-71],[193,120],[236,-308],[240,199],[34,107],[83,-10]],[[82256,41232],[-256,75]],[[71360,66524],[76,-71],[-16,-136],[181,-216],[53,10],[146,-361],[-14,-160],[180,-176],[120,-536],[119,-48]],[[65988,81203],[14,170]],[[74992,57909],[224,-281],[173,-102],[168,-280]],[[75720,57751],[18,47]],[[75235,58885],[-63,12]],[[74957,58521],[-55,5],[2,-155],[-70,-105]],[[47738,21068],[963,80]],[[48952,21168],[-29,1326]],[[64088,81045],[-325,31],[-106,-222],[-247,-418]],[[70197,44955],[-127,20],[-25,-504]],[[29517,29008],[-758,-227]],[[63207,16893],[34,-273],[63,-21],[-19,246],[-78,48]],[[63131,17383],[115,-121],[-23,124],[-92,-3]],[[62931,17215],[183,-183],[-24,205],[-134,46],[-25,-68]],[[62774,17559],[121,-235],[6,63],[-127,172]],[[62791,17080],[85,170],[-74,18],[-11,-188]],[[62728,16857],[189,-134],[70,174],[69,-120],[17,143],[-85,38],[-90,170],[-170,-271]],[[62735,17769],[88,-67],[169,-299],[76,96],[-160,124],[32,111],[-90,22],[-107,133],[-8,-120]],[[62551,18548],[256,-257],[22,-178],[303,384]],[[83825,44518],[71,-370],[247,265]],[[84573,46462],[-288,-303],[-31,22],[-601,-498]],[[39752,8382],[1557,270]],[[41309,8652],[-18,333],[28,5],[-55,980],[97,16],[-18,327]],[[54557,81829],[557,-78]],[[55074,83501],[-281,229],[-120,2]],[[72270,20166],[31,77],[266,192],[159,159],[70,-81],[132,-8],[204,100]],[[33089,21626],[-53,625]],[[60254,80927],[-10,-667],[290,-17],[-19,-1072]],[[68053,73313],[-767,98]],[[63681,82093],[-44,-162],[-144,11],[-36,-483],[-169,-35],[-120,-251],[-50,-505],[-122,-201]],[[64891,55539],[-167,-1],[-576,58]],[[85702,25921],[38,-17],[94,-326]],[[86676,27821],[83,550]],[[77712,61954],[-151,-87],[-79,109],[-134,-69],[-90,-254],[-118,15]],[[74602,77650],[29,-268],[76,-171],[47,-232]],[[70995,64821],[3,55]],[[73693,49898],[-98,274]],[[73595,50172],[-394,200],[-168,-165]],[[73033,50207],[-52,-70],[60,-342],[65,-98]],[[14256,6840],[74,-11],[22,234],[108,131]],[[52944,26690],[386,4]],[[53330,26694],[689,9]],[[51145,89595],[18,-25],[-532,-1847],[167,-98]],[[87148,43931],[-21,-145],[64,-150]],[[87191,43636],[105,318],[32,-130],[87,-89],[175,-50],[212,85],[41,220],[120,48]],[[87753,44823],[-27,102],[82,276],[-151,-94],[-118,-178],[-113,-348],[-287,436],[-83,-61],[-85,-361],[31,-287],[146,-377]],[[86348,32580],[987,-159]],[[56935,71222],[-133,-160],[-85,-185],[-200,19],[-153,138]],[[71828,60652],[63,-38],[90,143],[125,-127],[189,-283]],[[72252,61461],[-92,10],[-66,-402],[-137,-199],[-123,-52],[-6,-166]],[[53653,67730],[22,-267],[-87,-173],[77,9],[66,-221],[-69,-194]],[[55021,67944],[-165,-178],[-11,98],[-102,-11],[-42,92],[-149,-29],[-139,128],[11,172],[-94,87],[-105,-87],[-60,228],[-61,90],[-67,-150]],[[54037,68384],[-80,-194],[-143,13],[-48,-187],[-85,6],[-105,-123],[77,-169]],[[76428,79337],[-12,-124],[117,-237]],[[68551,67747],[85,481],[-86,-98],[-135,185],[-129,23]],[[67636,68206],[-12,-281],[-32,11],[-15,-407]],[[56357,43669],[-28,233],[85,88],[40,400],[-7,174]],[[83042,27811],[92,836]],[[82175,30111],[87,-320],[6,-176],[191,-247],[85,-209],[-33,-214],[-162,-397],[-139,-71],[-45,-303]],[[78534,48072],[-9,331],[193,337],[-163,441]],[[40396,15420],[124,21],[-44,773],[195,33],[-13,220],[194,32],[52,229],[648,105]],[[70762,77659],[828,-135]],[[72188,79846],[-444,236],[-213,81],[-54,-22],[-419,231]],[[79679,70053],[15,166],[-69,49],[-8,169],[-68,359],[56,64]],[[59578,32856],[766,-42]],[[14827,14688],[326,153],[154,-965],[63,31],[104,-656]],[[16233,13825],[-37,311],[100,221],[-129,382],[-189,282],[-34,-61],[-87,104],[-33,244],[45,101],[194,106],[165,325],[-34,173],[344,157]],[[16542,16232],[13,55],[-69,385],[47,246],[-45,92],[103,220]],[[52303,34757],[15,-1584]],[[93215,23558],[140,-138],[141,303],[275,-271],[97,347],[186,-142],[231,132]],[[94658,24704],[-38,176],[-963,375]],[[93609,25273],[-67,-273],[-49,18],[-136,-553],[-89,35],[-66,-702]],[[81129,69161],[-60,-109],[109,-916]],[[89887,44355],[26,107],[136,227],[-36,150],[87,184],[-122,111],[-45,187],[71,114]],[[89947,45628],[-86,-70],[-119,59],[-105,254],[-68,-2],[-24,-186],[16,-243],[91,-130],[-123,-18],[62,-254],[-127,17],[-64,133],[-30,-281],[153,-148],[-45,-93]],[[89303,45854],[-29,-300],[100,4],[19,263]],[[89237,45112],[77,250],[-100,-37],[7,-101]],[[90263,43529],[495,-186]],[[90758,43343],[1,502],[-23,60],[-49,870],[-48,291]],[[44444,9103],[1359,161]],[[69269,36776],[165,-110],[295,-300]],[[69729,36366],[106,1817]],[[69835,38183],[-59,77],[-163,-167],[-122,-45],[-136,193]],[[87271,27527],[41,249]],[[21793,25411],[79,-635],[63,24],[84,-656],[-62,-23],[84,-649]],[[65374,39821],[-579,62]],[[48593,15858],[842,57]],[[48709,18510],[-255,-20]],[[48454,18490],[42,-1323],[-60,-5],[36,-1313]],[[79705,52849],[89,-138]],[[79277,65926],[53,-48]],[[75455,47370],[134,365]],[[12196,86075],[110,-33],[3,101],[-113,-68]],[[12195,86496],[133,-262],[81,71],[153,31],[160,-46],[150,-336],[-38,-433],[4,-196],[-83,-234],[-79,-48],[48,-139],[123,64],[80,-131],[14,-141],[-118,-296],[-74,185],[-95,-39],[-176,110],[-138,172],[-105,254],[-4,-237],[-91,-210],[-51,57],[83,169],[-76,-7],[-105,-152],[-275,-47],[-212,91],[-384,-319],[-59,-223],[43,-158],[-74,-195],[-40,-223],[76,60],[118,-183],[-56,-103],[-284,-198],[-165,-283],[9,-145],[199,-113],[259,-225],[359,-268],[208,-116],[259,-84]],[[9073,85044],[82,-289],[23,154],[214,247],[170,-101],[111,166],[-7,167],[156,236],[273,203],[-86,173],[-177,-76],[-129,242],[-40,-211],[-144,-347],[-144,-241],[-78,-48],[-147,95],[-80,-120],[3,-250]],[[45045,72545],[56,-1674]],[[50313,90017],[697,30]],[[70911,40618],[-28,-503],[-254,44],[-9,-165],[-95,15]],[[45975,38392],[924,88]],[[45959,39899],[-28,-170],[44,-1337]],[[65678,50436],[191,-21]],[[65869,50415],[36,1017]],[[65905,51432],[-92,384],[-23,218]],[[67364,29653],[194,-25]],[[87216,42606],[190,220],[-174,459]],[[87232,43285],[-30,-178]],[[88202,47135],[97,-198]],[[88299,46937],[121,57],[123,343],[96,106],[157,-62],[57,102],[199,8],[-78,163]],[[50134,42720],[-22,1343]],[[9547,43332],[-80,-231],[-11,-329],[22,-309],[-108,-269],[27,-114],[-128,-180]],[[9268,41888],[88,-205],[10,-194]],[[87232,43285],[1,25]],[[87233,43310],[-165,5],[20,-184]],[[63100,66680],[51,249]],[[63151,66929],[-79,43],[2,112],[-152,8],[4,746]],[[87130,59322],[177,-100],[44,50],[556,-202]],[[88319,60032],[-216,460],[-69,198]],[[68147,33594],[13,412],[-32,326],[74,350],[78,204]],[[46568,53588],[-10,336]],[[46558,53924],[-729,-64]],[[59848,52144],[-192,4],[-2,392]],[[59654,52540],[-676,-9],[1,-57]],[[86351,50541],[77,114],[135,-51]],[[86706,43211],[62,-81],[51,103],[-113,-22]],[[43713,37979],[-1215,-148]],[[42498,37831],[44,-1005]],[[66493,32471],[382,-52]],[[67068,44181],[-12,204],[-93,10],[18,335]],[[66264,44202],[-17,-400]],[[65646,49680],[146,-235],[130,-49],[102,36],[86,-126],[107,-11],[24,-82],[94,38],[267,-22]],[[66643,50347],[-774,68]],[[96195,14673],[711,-630],[-88,-283],[148,-136],[-303,-991],[-152,135],[-24,-264],[-61,-290],[183,-182],[-436,-2609]],[[64738,29608],[-150,-531],[-165,-292],[-43,-193],[49,-39],[-25,-208],[-73,-105],[-44,-307],[74,-135],[4,-171],[77,48],[31,-112],[-42,-122],[30,-141]],[[69164,80888],[196,-33],[-82,124],[-114,-91]],[[68657,80846],[107,-58],[252,112],[-163,6],[-196,-60]],[[69359,80276],[-202,212],[-65,-75],[-85,58],[-39,-93],[-124,-4],[-157,76],[-134,-91]],[[77501,75115],[653,-127]],[[78421,74941],[41,460],[-50,116],[-35,398]],[[78377,75915],[15,168],[-309,54]],[[81895,39473],[42,76],[-81,113],[54,83]],[[90072,41649],[10,80],[262,366],[108,57],[67,-85],[108,497],[131,779]],[[53875,47871],[190,3],[4,-500]],[[68714,55746],[-663,80]],[[76849,48920],[1,179],[149,194],[299,-56]],[[70151,54270],[-143,-208],[-5,-97]],[[20815,12079],[58,156],[118,-28],[326,62],[61,-102]],[[20871,14407],[-29,-12]],[[68065,74851],[-701,173]],[[67364,75024],[-22,-331],[-56,-1282]],[[73373,43445],[46,723]],[[49754,13960],[1166,63]],[[50943,15008],[-1161,-62]],[[49782,14946],[6,-324],[-48,-3],[14,-659]],[[74951,41294],[18,555]],[[51832,72849],[-124,-4]],[[49263,69505],[988,53]],[[56943,78276],[200,160],[227,62],[111,101]],[[29185,35384],[-85,-114],[-40,-163]],[[18356,10884],[-229,1528],[-84,647]],[[15557,11917],[204,-1266]],[[76474,35258],[-5,-239],[90,37],[-85,202]],[[75952,35474],[172,69],[127,191],[115,67],[117,-160],[25,-159],[94,160],[111,-32],[53,174]],[[76766,35784],[-68,80],[-134,4],[-210,154]],[[64282,47691],[-148,373],[-142,-39],[-75,-169]],[[56630,77211],[259,-393]],[[83639,66114],[89,-53],[93,-162],[4,-565]],[[53337,25696],[-7,998]],[[80521,65882],[-33,-42]],[[56079,22046],[3,664],[14,0],[3,660]],[[78349,42105],[644,-104]],[[78993,42001],[98,-17],[24,336],[97,-19],[22,295]],[[78471,42933],[-18,-674],[-95,13],[-9,-167]],[[14721,13085],[109,-123],[92,-10],[107,102],[337,37]],[[59654,52540],[-2,281],[32,0],[5,1206]],[[58917,54023],[1,-560]],[[43175,70692],[246,24]],[[44137,70784],[-54,1676]],[[38647,47860],[-1102,-178]],[[37545,47682],[135,-415],[-52,-139],[36,-117],[-160,-303],[-143,-16],[15,-181],[-101,-33],[-23,-256]],[[37252,46222],[44,-110],[-65,-79],[70,-116],[25,-664],[82,-103],[17,-152]],[[81988,65028],[244,-277]],[[82232,64751],[223,323],[96,-64],[147,15],[237,256],[82,175],[87,-22],[-34,-102],[108,-289],[85,81],[19,-84]],[[81997,65855],[-158,-118],[-134,0]],[[36926,44974],[48,-65],[77,121],[114,37],[139,-91]],[[37252,46222],[-660,-131]],[[77537,47751],[-171,-57],[-98,44],[-161,-242],[-209,-101]],[[77745,62061],[-43,54],[-114,780]],[[77588,62895],[-144,-8],[-123,261]],[[35457,22833],[32,-215],[145,-409],[113,-165],[-915,-195],[31,-526],[57,-305],[56,-86]],[[63941,77130],[-22,-1010]],[[86531,43601],[23,137],[-121,50],[65,-211]],[[86504,43692],[0,0]],[[75345,58941],[270,821],[34,257],[-91,63],[-66,144]],[[45793,37031],[932,96]],[[45975,38392],[-228,-24]],[[55754,74498],[60,196]],[[54637,75001],[-4,-26]],[[90787,22360],[-55,-195]],[[42477,37994],[21,-163]],[[43670,39660],[-54,-6]],[[43616,39654],[-1216,-153]],[[69566,56044],[539,-97]],[[70526,56602],[-51,48],[-212,386],[-4,125]],[[51223,74629],[446,-447],[29,15]],[[51698,74197],[87,107],[0,101],[100,67],[74,-152]],[[69123,60932],[79,-22],[-55,-102]],[[81548,62860],[-26,170]],[[81522,63030],[-110,106],[-44,198],[105,166],[-150,54]],[[67983,63547],[642,-82]],[[55733,32971],[5,1339]],[[47510,55489],[-961,-68]],[[46549,55421],[42,-1494],[-33,-3]],[[78038,41628],[122,-15],[16,342],[165,-24],[8,174]],[[51702,73755],[-4,442]],[[86715,95839],[127,-684],[-17,414],[-70,295]],[[85340,94487],[-60,-651]],[[85280,93836],[386,-104],[8,82],[770,-217],[-5,-51],[353,-119]],[[86792,93427],[46,502],[-7,675],[-39,-205],[-75,-65],[-84,129],[-36,318],[-41,102],[16,171],[-41,146],[7,255],[48,245],[43,40],[-112,333]],[[86315,96536],[-97,2],[-239,140],[-155,196],[-143,-108],[-90,60]],[[49453,58857],[571,16]],[[48675,60162],[7,-775]],[[52955,67042],[-1,223],[64,2],[-1,225]],[[53017,67492],[-18,20]],[[78701,34762],[61,-180],[225,-398],[62,-21],[370,-465]],[[79419,33698],[47,532]],[[53487,85560],[-35,-62]],[[9827,37833],[-20,-169],[43,-65],[105,55]],[[81388,78815],[178,-45]],[[81705,80376],[-12,5]],[[82582,58795],[-326,763],[-118,168]],[[67444,41784],[20,450]],[[12267,12732],[42,-210],[126,-169],[191,-132],[-233,-405],[19,-108],[186,95],[44,-260]],[[87618,41487],[121,-135]],[[87895,41417],[27,105],[185,116],[19,304],[95,130],[-117,194],[55,239],[-59,10],[-22,192],[61,75],[-86,311],[77,185]],[[87848,43240],[-61,-95],[16,-513],[-82,-274],[-112,-161],[-163,-89],[-19,-117]],[[61037,44158],[-96,3],[-8,-323]],[[60089,45191],[-8,-1302]],[[68328,69179],[675,-97]],[[68987,70471],[-863,128]],[[66064,76965],[-131,-43],[-257,29]],[[51551,55716],[-548,-17]],[[58917,54585],[-751,-2]],[[63890,29699],[846,-91]],[[64716,31285],[-104,80],[-148,-11],[-137,146],[-181,7]],[[58964,55970],[-800,-4]],[[87150,54818],[-583,728]],[[17404,19626],[-376,-163],[45,-308],[-187,-83],[26,-183],[-563,-240],[72,-474]],[[77414,48555],[-86,32],[-73,-114],[-66,79],[-206,-244],[-93,128],[-32,182]],[[78646,56581],[9,280],[98,29],[85,-114]],[[86367,43361],[92,160],[72,-14],[188,227],[157,57],[114,182]],[[86990,43973],[-77,552]],[[90473,38876],[-155,-296],[-150,-70],[-148,-274],[-5,-102],[-117,-145]],[[49761,15935],[21,-989]],[[69268,21380],[125,190],[-41,80],[-84,-270]],[[69599,20783],[-84,36],[-32,176],[-68,24],[6,146],[-62,38],[29,197],[-151,-138],[-20,-130],[74,-82],[37,-313],[74,2],[68,-298],[-27,-138],[-67,-22],[-83,263],[-217,-64],[24,183],[-66,168],[-16,187],[-158,128],[-65,-28],[-28,-397],[-54,-100],[-54,110],[19,396],[-166,206],[-120,446]],[[74473,46807],[-145,-10]],[[96852,18782],[-77,56],[29,165],[-67,161],[-4,172],[-90,-131],[12,155],[-63,141],[-84,-49],[22,217],[-90,-139]],[[75438,49236],[250,663]],[[75652,50269],[-140,-30]],[[75056,50185],[-24,-87],[45,-210],[-26,-126],[64,-84],[-20,-182]],[[82928,57546],[201,-62]],[[83129,57484],[47,99],[101,33],[48,211],[87,94],[-36,206],[-4,260],[112,291],[-29,124]],[[83075,58705],[-131,158],[-200,50],[-72,-52]],[[71828,60652],[-136,-17]],[[71692,60635],[-34,-1],[-87,-251],[-23,-215],[1,-752]],[[84709,48986],[6,-353],[110,7],[114,-319],[9,-119]],[[19345,13781],[-44,63],[-202,96],[-194,-110],[-276,-33]],[[82702,72949],[-108,76],[-10,94],[119,-52],[49,67],[-139,619],[42,271]],[[93139,22239],[88,-365],[87,227],[130,-134]],[[57904,84345],[-433,347],[-192,204],[-70,179],[-93,32],[23,-123],[181,-323],[151,-62],[53,-154],[67,53],[40,-97]],[[56484,86030],[198,-238],[240,-392],[106,-79],[26,-182],[156,79],[-140,204],[-431,510],[-180,271]],[[56645,84378],[72,165],[141,52],[-40,178],[78,63],[-3,479],[-114,71],[-205,336]],[[41358,37844],[32,-657]],[[89327,39227],[55,-243]],[[89493,38515],[91,234],[101,104],[222,8],[278,282]],[[89700,40066],[-124,-178],[-129,-37],[-35,-304],[18,-154],[-86,-78]],[[11204,13738],[109,-346],[107,-483],[32,-281],[69,-268],[14,-228],[42,-61],[126,-540],[33,-467]],[[90658,24179],[-147,-651],[-1,-262],[124,-456],[7,-341],[-33,-108],[34,-141]],[[55747,9743],[246,-4],[-7,-1454],[141,115],[157,-61],[145,165],[44,112],[82,653],[34,78],[106,812],[-26,198],[18,202],[76,138],[154,141],[161,3]],[[9466,34780],[246,120],[-130,729]],[[78744,65534],[-85,-164],[61,-279],[146,-392],[113,-145]],[[60005,47649],[41,-122],[-63,-41],[156,-469]],[[88982,36129],[-177,876]],[[72826,56375],[4,-341]],[[75556,46669],[80,27],[39,118],[108,87],[30,140],[120,45]],[[69896,36148],[165,-256],[144,-313],[170,-897],[169,-512]],[[70392,36067],[-496,81]],[[84485,47114],[-52,90],[-25,332],[-57,40],[-86,257],[-111,-107],[-153,151]],[[63697,66479],[-135,193],[27,211],[100,228],[-143,13],[-56,-67],[-205,84],[51,-172],[-127,79],[-58,-119]],[[90812,53263],[126,18],[105,211],[24,151],[-98,5],[-5,-151],[-152,-234]],[[91116,56056],[351,-419],[-18,-831],[-39,-437],[-172,-615],[61,90],[147,522],[34,449],[23,962],[-146,80],[-226,251]],[[90590,52179],[152,408],[149,313],[332,797],[-58,-26],[-222,-529],[-74,-129],[-83,-5],[-133,-540],[-98,-260]],[[90435,54456],[1,-392],[-45,-493],[69,-195],[-43,-45],[161,-140],[137,109],[157,433],[-3,160],[82,274],[-39,100],[43,167],[-58,205],[-168,49]],[[79102,81202],[-258,-158],[-111,-213],[-8,-103],[-121,-259],[-104,-122],[-212,-159],[-291,-175],[-128,-145]],[[74186,61655],[513,-111]],[[65492,66147],[373,-57]],[[49754,13960],[-778,-51]],[[81522,63030],[83,103],[-14,98],[81,150],[187,-21],[151,218],[95,59],[94,246],[28,195]],[[82227,64078],[-44,48],[6,481],[70,-152],[170,49],[-197,247]],[[87600,39494],[550,-197]],[[88507,39872],[-48,202],[117,149],[-63,70],[-165,387],[-57,-84],[22,-191],[-56,-74],[-19,330],[62,91],[-24,163],[-98,-318],[-72,24]],[[88106,40621],[-80,-247],[-104,-130],[-178,-102],[-88,-246],[-56,-402]],[[70652,33470],[25,-241],[15,-927],[-14,-184]],[[54735,57987],[335,0]],[[55070,57987],[-3,1006],[96,-1]],[[50583,84746],[24,-137],[-185,-184],[-33,-123],[-119,-24],[-23,-129]],[[92829,19131],[-215,136],[-71,99],[-26,207],[49,107],[-1,193],[57,101]],[[86497,38507],[223,144],[122,267],[-10,168],[64,122],[-61,142],[48,401]],[[86520,39875],[-405,138]],[[86115,40013],[-117,-840]],[[15582,3303],[-84,-43],[-60,131],[17,234],[77,311],[-114,-327],[-62,-44],[-6,-200],[50,-236],[109,-28],[73,108]],[[15041,3040],[217,-393],[42,-164],[85,2],[0,229],[80,259],[-85,20],[-50,-89],[-212,227],[124,29],[36,161],[3,263],[-31,54],[-3,338],[115,-252],[57,222],[73,77],[-12,314],[-73,159],[-67,-75],[-15,-298],[-121,24],[24,-103],[-73,-172],[62,-284],[2,-190],[-92,-29],[-86,-329]],[[50976,33004],[253,177]],[[15594,37324],[46,5],[177,-195],[-131,755],[-45,-20],[-72,488],[146,351],[14,125],[132,286],[101,501],[64,28],[-20,140]],[[74397,51017],[74,-210],[-53,-192]],[[73210,48224],[-213,-82]],[[86750,92110],[17,894],[25,423]],[[85280,93836],[-112,-1044]],[[46549,55421],[-551,-40]],[[50004,61576],[-18,1414]],[[73661,71406],[165,-35],[-23,-332],[159,-32],[28,-60]],[[87233,43310],[27,254],[-69,72]],[[87148,43931],[-114,109],[-44,-67]],[[65553,20859],[73,1641]],[[19526,17807],[44,-316],[-44,-19],[62,-431],[-167,-69],[32,-226],[-62,-26],[45,-327],[134,18],[282,116],[38,-275],[351,151],[23,-160],[124,49],[111,-811],[77,32],[44,-316],[55,-149],[109,45],[22,-163]],[[28612,38286],[79,-104]],[[70569,21819],[78,44],[14,191],[-92,-235]],[[70356,23024],[27,-79],[111,61],[18,289],[-57,6],[-84,-143],[-15,-134]],[[70427,24405],[-19,-488],[136,-26],[61,-252],[104,95],[96,-59],[71,-403],[92,-177],[75,-376],[117,-112],[22,123],[-118,213],[93,246],[-110,348],[66,-78],[20,244],[-61,215],[38,374]],[[70242,23544],[52,-156],[65,57],[-78,144],[-39,-45]],[[87532,45204],[71,60],[18,161],[234,118],[132,-59],[79,87],[27,-81],[152,-25],[40,137],[113,90],[60,145]],[[87726,45928],[-130,-78],[-38,81],[-83,-249]],[[78578,76048],[-150,-52],[-51,-81]],[[66141,15469],[127,-342],[344,-378],[303,-126],[270,-16],[136,107],[15,126],[-155,105],[-215,22],[37,166],[-169,193],[-150,334],[-95,75]],[[64918,13379],[106,-237],[496,-525],[39,0],[216,-347],[159,-157],[35,32],[148,-118],[-35,110],[-179,324],[2,98],[-128,196],[-335,265],[-149,189],[141,48],[-310,277],[-100,1],[-106,-156]],[[79732,70875],[7,-55],[433,-271]],[[43616,39654],[-36,973]],[[78969,41667],[24,334]],[[83114,71024],[83,17],[-17,218],[-81,122],[-74,-32],[-23,167],[66,8],[-91,225],[-142,-37],[-3,188],[70,4],[-34,221],[-101,206],[-46,-1]],[[75479,74831],[-51,-389],[-146,-260],[-16,-259]],[[82371,88200],[-175,-1978],[-97,24]],[[54024,69647],[13,-1263]],[[75131,70682],[322,-63],[6,92],[397,-82]],[[64256,36819],[87,-87],[42,-489]],[[84561,83205],[379,691],[142,446],[-104,217],[-4,385],[84,492],[75,297],[158,439],[160,378]],[[71303,61093],[148,17],[79,-177],[165,-151],[-3,-147]],[[79742,42388],[-31,-387],[-65,16],[-47,-620],[129,-28]],[[63821,27730],[57,1623]],[[74466,49873],[30,-444]],[[73250,51175],[78,-118],[-12,-102],[81,-53],[6,-147],[159,-89],[-4,-201],[82,-14]],[[73640,50451],[214,-18]],[[73854,50433],[61,131],[3,682]],[[87943,53749],[274,248],[15,181],[182,-22],[78,-95],[63,180],[-18,133],[69,-19],[87,-186],[96,95],[11,169],[57,6],[52,-165],[-16,-112],[138,24]],[[88944,54787],[-217,316],[-350,-197],[-15,32]],[[72494,77393],[-24,-19],[-42,-731]],[[13284,60870],[104,59],[154,243],[128,138],[67,310],[-46,127],[-78,-116],[-161,-89],[-26,-132],[34,-236],[-119,-103],[-57,-201]],[[13043,62541],[57,11],[104,480],[186,479],[-142,26],[-102,-244],[-103,-752]],[[14300,60238],[-107,-123],[-25,148],[-145,18],[-254,-256],[-14,-135],[77,-86],[23,-135],[-38,-409],[-92,-383],[-81,-90],[-319,-95],[-124,71],[-71,-161],[-155,-109]],[[84146,94816],[-342,-270],[-118,201],[-157,-372],[-146,-452],[-87,-546],[-81,-338]],[[55114,55765],[-314,1]],[[55075,57315],[-5,672]],[[34777,7315],[727,180],[1116,254]],[[88962,47054],[-22,105],[91,46],[-108,140],[-215,-142],[-54,112],[-185,-433],[-110,-54]],[[87814,46206],[14,99],[203,228],[168,327],[100,77]],[[30811,6254],[1351,393]],[[93831,15002],[-4,-354],[-56,-114],[90,-153],[88,109],[121,-29],[-57,-208],[-129,-118],[-23,-98],[62,-393],[103,-289]],[[73185,32980],[-574,116]],[[96258,28794],[51,-253],[-90,-352],[8,-150]],[[96340,27617],[135,134],[167,12],[137,-47],[63,51],[89,-194],[240,-257],[21,-94],[-116,-427],[-58,136],[-51,-309],[-57,-162],[-102,-68],[-59,119],[-96,-52],[78,-111],[233,56],[170,282],[165,481],[84,430],[-3,287],[-32,216],[-17,-326],[-73,-38],[-266,234],[-77,104],[-152,41],[-140,190],[-58,240],[-216,156],[-43,120]],[[41309,8652],[1492,228]],[[86889,37756],[193,127],[83,195]],[[87600,39494],[-363,130]],[[77705,62948],[-117,-53]],[[57433,21952],[-581,21]],[[71035,76605],[-117,19],[-127,145],[-111,-49]],[[88106,40621],[83,265],[-75,181],[77,46],[-137,293],[-104,-18],[-63,-104]],[[74298,59795],[67,104],[61,-44],[98,87]],[[86099,40019],[16,-6]],[[37545,47682],[72,66],[6,195],[58,119],[-75,361],[-51,-1],[-139,196]],[[67557,44660],[39,787]],[[85473,38093],[-113,418],[-68,436]],[[88930,52729],[-29,132],[17,252],[87,287],[110,256],[0,186]],[[53653,67730],[-160,-57],[-29,228],[-131,97],[-59,-173],[-104,82],[-60,-81],[-29,-253],[-64,-81]],[[74418,50434],[-92,74],[-46,-224],[-79,-18],[38,-216]],[[74239,50050],[-113,-280],[29,-145],[-74,-114]],[[47624,57076],[39,-1575]],[[51621,23983],[19,-1331]],[[49291,83737],[56,-110]],[[83068,50765],[-32,-319]],[[22907,10289],[-1164,-461]],[[76579,54878],[360,-67]],[[67543,80496],[32,265],[-164,206],[-45,270],[-146,35]],[[67220,81272],[-88,12],[-98,-170],[-59,-224],[18,-200],[-113,-243],[-20,-202]],[[79419,33698],[161,-98],[582,-585]],[[55932,57645],[-2,-337],[-183,3]],[[52711,53906],[1102,14]],[[47561,18416],[893,74]],[[64191,56036],[62,-4],[15,507],[65,-6],[9,335],[33,-1],[9,360]],[[9578,45787],[-39,-343],[-88,-228],[-87,54],[-226,-115],[-135,-298],[-90,-418]],[[7879,32279],[-72,-152],[-1,-299],[-107,-164],[-198,-630],[61,-185],[10,-310],[-28,-197],[97,-276],[150,-313],[330,-589],[183,-390],[107,-357],[-50,-128],[51,-334],[140,-276],[150,-507],[70,-325]],[[50498,21266],[-24,1327]],[[22500,13384],[-255,-90],[-11,-155]],[[21157,2810],[923,381]],[[76665,35383],[90,-78],[-29,133],[-61,-55]],[[76766,35784],[149,219],[238,125],[205,-233]],[[73854,50433],[71,-69],[73,-198],[98,31],[143,-147]],[[58648,23931],[143,124],[179,251],[55,152],[-4,260],[89,-5]],[[69729,36366],[167,-218]],[[57153,51730],[5,1405]],[[89542,49802],[168,26],[131,-134],[48,61],[143,538],[163,455],[80,287]],[[67425,25278],[-1,263],[-62,172],[64,97],[122,-6],[31,-179],[140,-232],[72,-42]],[[67205,75063],[159,-39]],[[90254,52207],[33,215],[105,95],[-206,-12],[-249,-309],[-96,14]],[[52988,69563],[203,45]],[[22294,89903],[76,-132],[221,220],[48,281]],[[95301,28498],[6,151],[-60,167],[-48,-240],[-144,-148]],[[58381,71042],[425,-17]],[[73033,50207],[-72,112],[-53,321],[-164,303],[-99,31]],[[73640,50451],[-45,-279]],[[82989,64402],[-265,-47],[-128,19],[-105,-117],[-68,26],[-196,-205]],[[82544,81685],[8,-185],[-140,39],[-21,-222],[-63,19],[-22,-219],[-128,36],[-12,-130],[-304,152],[-89,141]],[[65905,51432],[728,-68]],[[89688,55171],[-20,76],[-206,72],[-48,128],[81,166],[72,265],[-248,-70],[-84,62],[-139,-65],[-208,-29],[-165,-106],[7,94],[130,163],[134,-31],[443,191],[105,-3]],[[85017,29166],[-41,-344],[45,-382],[545,-199]],[[46417,89262],[-153,-346],[14,-123],[-111,-336],[27,-151],[-56,-136],[61,-89],[-98,-61],[-40,-141],[29,-123],[-94,-101],[4,-125],[-103,-84],[-6,-301],[-47,-91],[-21,-240],[-46,-6],[-53,-293],[-58,-9],[-52,-696]],[[67119,83759],[120,-47],[-63,146],[-57,-99]],[[67279,83223],[1,83],[-252,50],[128,111],[3,107],[-165,-144],[90,178],[-81,56],[95,218],[139,21],[85,141],[50,256],[248,-51],[122,97],[11,-98],[151,280],[72,-153],[182,341],[56,230],[123,-108],[49,129],[-164,72],[-11,107],[113,-1],[-46,177],[-80,-69],[-70,237],[18,228],[-153,-99],[-3,-127],[-71,-97],[-202,478],[-103,146],[130,-487],[63,-76],[-12,-177],[63,-85],[-14,-166],[-74,-68],[-51,282],[-115,20],[-156,-315],[-247,-113],[-70,-139],[-399,-64],[-117,105]],[[67986,28218],[24,311],[50,158],[8,338],[-101,404],[-14,139]],[[67220,81272],[-116,129],[-70,1]],[[79228,46134],[-81,-111],[32,-80],[-249,-504]],[[14245,5438],[113,-202],[201,-153],[162,-6],[61,-226],[119,-187],[146,-158],[51,22],[7,-324],[89,181],[-42,619],[-94,-54],[40,165],[-46,205],[-2,245],[-92,84],[-25,117],[67,85],[-77,125],[-63,229]],[[81387,88448],[118,-417],[80,-89],[58,-296],[-60,-231],[-155,-32],[65,358],[-169,-59],[39,-121],[-76,-326],[-202,-156]]]} diff --git a/packages/flint-js/src/geo/index.ts b/packages/flint-js/src/geo/index.ts new file mode 100644 index 00000000..09eb0174 --- /dev/null +++ b/packages/flint-js/src/geo/index.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @module flint-chart/geo + * + * The boundaries Flint's named sets and US maps draw, bundled. `inlineBoundaries` writes them into a + * compiled spec in place of their URLs, so a renderer with no network — vl-convert, a sandboxed + * iframe, an offline app — draws the map. Flint's own renderers do not need it: they load these + * files from the package on a map's first draw. Kept out of the main entry so charts that draw no + * map do not carry them. Sources and licences are in `NOTICE.md` beside this file. + */ + +import { BOUNDARY_URLS } from '../chart-types/boundaries'; +import { usAlbers, usStates, world, worldBankCoarse, worldBankMedium } from './topologies.js'; + +/** World Bank Official Boundaries (CC BY 4.0), `boundaries: 'world-bank'`, at its two details: `coarse` for the world, `medium` for a region. */ +export const worldBankTopology = { coarse: worldBankCoarse, medium: worldBankMedium }; +/** Natural Earth's countries at 1:110m, `boundaries: 'natural-earth'` (via vega-datasets): objects `countries` (ISO 3166-1 numeric ids) and `land`. */ +export const naturalEarthTopology = world; +/** The US states at 1:10m in longitude and latitude (US Census Bureau, via us-atlas): object `states`. */ +export const usStatesTopology = usStates; +/** The US states and counties at 1:10m, projected with albersUsa into 975 × 610 (US Census Bureau, via us-atlas): objects `states` and `counties`. */ +export const usAlbersTopology = usAlbers; + +/** Each URL a compiled map names, and the bundled shapes it stands for (with the identical files earlier releases named). */ +const BY_URL: Record = { + [BOUNDARY_URLS.worldBank.coarse]: worldBankCoarse, + [BOUNDARY_URLS.worldBank.medium]: worldBankMedium, + [BOUNDARY_URLS.naturalEarth]: world, + [BOUNDARY_URLS.usStates]: usStates, + [BOUNDARY_URLS.usAlbers]: usAlbers, + 'https://vega.github.io/vega-lite/data/world-110m.json': world, + 'https://cdn.jsdelivr.net/npm/us-atlas@3/counties-albers-10m.json': usAlbers, +}; + +/** + * A compiled Vega-Lite (or Vega) spec with every named boundary file written in, in place of its + * URL, so it draws with no network. The spec given is left as it was. Files of the chart's own keep + * their URLs. + */ +export function inlineBoundaries(spec: T): T { + const visit = (node: unknown): unknown => { + if (Array.isArray(node)) return node.map(visit); + if (!node || typeof node !== 'object') return node; + const out: Record = {}; + // Rows and shapes already inline hold no URL to replace. + for (const [key, value] of Object.entries(node)) out[key] = key === 'values' || key === 'datasets' ? value : visit(value); + if (typeof out.url === 'string' && Object.prototype.hasOwnProperty.call(BY_URL, out.url)) { + out.values = BY_URL[out.url]; + delete out.url; + } + return out; + }; + return visit(spec) as T; +} diff --git a/packages/flint-js/src/geo/lazy/counties-albers-10m.d.ts b/packages/flint-js/src/geo/lazy/counties-albers-10m.d.ts new file mode 100644 index 00000000..27aa3dd3 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/counties-albers-10m.d.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +declare const topology: Record; +export default topology; diff --git a/packages/flint-js/src/geo/lazy/counties-albers-10m.js b/packages/flint-js/src/geo/lazy/counties-albers-10m.js new file mode 100644 index 00000000..b9f6fa62 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/counties-albers-10m.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// One built-in topology as a module of its own, for Flint's renderers to import on first use. +export { default } from '../counties-albers-10m.json'; diff --git a/packages/flint-js/src/geo/lazy/states-10m.d.ts b/packages/flint-js/src/geo/lazy/states-10m.d.ts new file mode 100644 index 00000000..27aa3dd3 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/states-10m.d.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +declare const topology: Record; +export default topology; diff --git a/packages/flint-js/src/geo/lazy/states-10m.js b/packages/flint-js/src/geo/lazy/states-10m.js new file mode 100644 index 00000000..e0e55c87 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/states-10m.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// One built-in topology as a module of its own, for Flint's renderers to import on first use. +export { default } from '../states-10m.json'; diff --git a/packages/flint-js/src/geo/lazy/world-110m.d.ts b/packages/flint-js/src/geo/lazy/world-110m.d.ts new file mode 100644 index 00000000..27aa3dd3 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/world-110m.d.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +declare const topology: Record; +export default topology; diff --git a/packages/flint-js/src/geo/lazy/world-110m.js b/packages/flint-js/src/geo/lazy/world-110m.js new file mode 100644 index 00000000..58394126 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/world-110m.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// One built-in topology as a module of its own, for Flint's renderers to import on first use. +export { default } from '../world-110m.json'; diff --git a/packages/flint-js/src/geo/lazy/world-bank-coarse.d.ts b/packages/flint-js/src/geo/lazy/world-bank-coarse.d.ts new file mode 100644 index 00000000..27aa3dd3 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/world-bank-coarse.d.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +declare const topology: Record; +export default topology; diff --git a/packages/flint-js/src/geo/lazy/world-bank-coarse.js b/packages/flint-js/src/geo/lazy/world-bank-coarse.js new file mode 100644 index 00000000..73ca678c --- /dev/null +++ b/packages/flint-js/src/geo/lazy/world-bank-coarse.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// One built-in topology as a module of its own, for Flint's renderers to import on first use. +export { default } from '../world-bank-coarse.json'; diff --git a/packages/flint-js/src/geo/lazy/world-bank-medium.d.ts b/packages/flint-js/src/geo/lazy/world-bank-medium.d.ts new file mode 100644 index 00000000..27aa3dd3 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/world-bank-medium.d.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +declare const topology: Record; +export default topology; diff --git a/packages/flint-js/src/geo/lazy/world-bank-medium.js b/packages/flint-js/src/geo/lazy/world-bank-medium.js new file mode 100644 index 00000000..0437d942 --- /dev/null +++ b/packages/flint-js/src/geo/lazy/world-bank-medium.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// One built-in topology as a module of its own, for Flint's renderers to import on first use. +export { default } from '../world-bank-medium.json'; diff --git a/packages/flint-js/src/geo/states-10m.json b/packages/flint-js/src/geo/states-10m.json new file mode 100644 index 00000000..7a18aa4d --- /dev/null +++ b/packages/flint-js/src/geo/states-10m.json @@ -0,0 +1 @@ +{"type":"Topology","bbox":[-179.14733999999999,-14.552548999999999,179.77847,71.352561],"transform":{"scale":[0.003589293992939929,0.0008590596905969058],"translate":[-179.14733999999999,-14.552548999999999]},"objects":{"states":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","arcs":[[[0]],[[1,2,3,4,5]]],"id":"01","properties":{"name":"Alabama"}},{"type":"MultiPolygon","arcs":[[[6]],[[7]],[[8]],[[9]],[[10]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[23]],[[24]],[[25]],[[26]],[[27]],[[28]],[[29]],[[30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41]],[[42]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89]],[[90]],[[91]],[[92]],[[93]],[[94]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105]],[[106]],[[107]],[[108]],[[109]],[[110]],[[111]],[[112]],[[113]],[[114]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134]],[[135]],[[136]],[[137]],[[138]],[[139]],[[140]],[[141]],[[142]]],"id":"02","properties":{"name":"Alaska"}},{"type":"Polygon","arcs":[[143,144,145,146,147]],"id":"04","properties":{"name":"Arizona"}},{"type":"Polygon","arcs":[[148,149,150,151,152,153]],"id":"08","properties":{"name":"Colorado"}},{"type":"MultiPolygon","arcs":[[[154]],[[155]],[[156]],[[157]],[[158]],[[159]],[[160]],[[161]],[[162]],[[163,164,-4]]],"id":"12","properties":{"name":"Florida"}},{"type":"Polygon","arcs":[[165,166,167,168,-164,-3]],"id":"13","properties":{"name":"Georgia"}},{"type":"Polygon","arcs":[[169,170,171,172,173]],"id":"18","properties":{"name":"Indiana"}},{"type":"Polygon","arcs":[[174,175,176,-151]],"id":"20","properties":{"name":"Kansas"}},{"type":"MultiPolygon","arcs":[[[177]],[[178]],[[179]],[[180]],[[181]],[[182]],[[183]],[[184,185]]],"id":"23","properties":{"name":"Maine"}},{"type":"MultiPolygon","arcs":[[[186]],[[187]],[[188,189,190,191,192,193,194,195]]],"id":"25","properties":{"name":"Massachusetts"}},{"type":"Polygon","arcs":[[196,197,198,199,200]],"id":"27","properties":{"name":"Minnesota"}},{"type":"Polygon","arcs":[[201,202,203,204,205,206,207,208]],"id":"34","properties":{"name":"New Jersey"}},{"type":"MultiPolygon","arcs":[[[209]],[[210]],[[211,212,213,-167,214]]],"id":"37","properties":{"name":"North Carolina"}},{"type":"Polygon","arcs":[[215,-201,216,217]],"id":"38","properties":{"name":"North Dakota"}},{"type":"Polygon","arcs":[[-152,-177,218,219,220,221]],"id":"40","properties":{"name":"Oklahoma"}},{"type":"Polygon","arcs":[[222,223,-204,224,225,226,227]],"id":"42","properties":{"name":"Pennsylvania"}},{"type":"Polygon","arcs":[[228,-217,-200,229,230,231]],"id":"46","properties":{"name":"South Dakota"}},{"type":"Polygon","arcs":[[-221,232,233,234,235,236,237]],"id":"48","properties":{"name":"Texas"}},{"type":"Polygon","arcs":[[-232,238,-149,239,240,241]],"id":"56","properties":{"name":"Wyoming"}},{"type":"Polygon","arcs":[[-195,242,243,244]],"id":"09","properties":{"name":"Connecticut"}},{"type":"Polygon","arcs":[[245,246,247,248,249,250,251,-219,-176,252]],"id":"29","properties":{"name":"Missouri"}},{"type":"Polygon","arcs":[[253,-227,254,255,256]],"id":"54","properties":{"name":"West Virginia"}},{"type":"Polygon","arcs":[[257,258,259,-174,260,-247]],"id":"17","properties":{"name":"Illinois"}},{"type":"Polygon","arcs":[[-153,-222,-238,261,-147]],"id":"35","properties":{"name":"New Mexico"}},{"type":"Polygon","arcs":[[-252,262,263,264,-235,233,-233,-220]],"id":"05","properties":{"name":"Arkansas"}},{"type":"MultiPolygon","arcs":[[[265]],[[266]],[[267]],[[268]],[[269]],[[270]],[[271]],[[272]],[[273,274,275,-144,276]]],"id":"06","properties":{"name":"California"}},{"type":"MultiPolygon","arcs":[[[-209,277]],[[-225,-203,278,279]]],"id":"10","properties":{"name":"Delaware"}},{"type":"Polygon","arcs":[[280,281]],"id":"11","properties":{"name":"District of Columbia"}},{"type":"MultiPolygon","arcs":[[[282]],[[283]],[[284]],[[285]],[[286]],[[287]],[[288]],[[289]]],"id":"15","properties":{"name":"Hawaii"}},{"type":"Polygon","arcs":[[-199,290,-258,-246,291,-230]],"id":"19","properties":{"name":"Iowa"}},{"type":"MultiPolygon","arcs":[[[-261,-173,292,-257,293,294,-248]],[[295,-250]]],"id":"21","properties":{"name":"Kentucky"}},{"type":"MultiPolygon","arcs":[[[296,297]],[[298]],[[299]],[[-226,-280,300,301,302,303,-281,304,-255]]],"id":"24","properties":{"name":"Maryland"}},{"type":"MultiPolygon","arcs":[[[305]],[[306]],[[307]],[[308]],[[309]],[[310]],[[311]],[[312]],[[313]],[[314,315,-171]],[[316]],[[317,318,319,320,321,322]]],"id":"26","properties":{"name":"Michigan"}},{"type":"MultiPolygon","arcs":[[[323]],[[324]],[[325]],[[326]],[[-264,327,-6,328,329]]],"id":"28","properties":{"name":"Mississippi"}},{"type":"Polygon","arcs":[[330,-218,-229,-242,331]],"id":"30","properties":{"name":"Montana"}},{"type":"Polygon","arcs":[[332,-185,333,-190,334]],"id":"33","properties":{"name":"New Hampshire"}},{"type":"MultiPolygon","arcs":[[[335]],[[336]],[[337]],[[338,-207]],[[339]],[[340]],[[341,342,-196,-245,343,-205,-224]]],"id":"36","properties":{"name":"New York"}},{"type":"MultiPolygon","arcs":[[[344]],[[345]],[[-316,346,-228,-254,-293,-172]]],"id":"39","properties":{"name":"Ohio"}},{"type":"Polygon","arcs":[[347,348,349,274,-275,-274,350]],"id":"41","properties":{"name":"Oregon"}},{"type":"Polygon","arcs":[[-251,-296,-249,-295,351,-215,-166,-2,-328,-263]],"id":"47","properties":{"name":"Tennessee"}},{"type":"Polygon","arcs":[[352,-240,-154,-146,353]],"id":"49","properties":{"name":"Utah"}},{"type":"MultiPolygon","arcs":[[[354]],[[-302,355]],[[356,-297]],[[-256,-305,-282,-304,357,-212,-352,-294]]],"id":"51","properties":{"name":"Virginia"}},{"type":"MultiPolygon","arcs":[[[358]],[[359]],[[360]],[[361]],[[362]],[[363]],[[364]],[[365]],[[366]],[[367]],[[368,-348,369]]],"id":"53","properties":{"name":"Washington"}},{"type":"MultiPolygon","arcs":[[[370]],[[371]],[[372]],[[373]],[[374]],[[375]],[[376]],[[377]],[[378]],[[379]],[[380,-323,321,-321,319,-319,381,-259,-291,-198]]],"id":"55","properties":{"name":"Wisconsin"}},{"type":"MultiPolygon","arcs":[[[382]],[[383]],[[384]]],"id":"60","properties":{"name":"American Samoa"}},{"type":"MultiPolygon","arcs":[[[385]]],"id":"66","properties":{"name":"Guam"}},{"type":"MultiPolygon","arcs":[[[386]],[[387]],[[388]],[[389]],[[390]],[[391]],[[392]],[[393]]],"id":"69","properties":{"name":"Commonwealth of the Northern Mariana Islands"}},{"type":"Polygon","arcs":[[-231,-292,-253,-175,-150,-239]],"id":"31","properties":{"name":"Nebraska"}},{"type":"Polygon","arcs":[[-214,394,-168]],"id":"45","properties":{"name":"South Carolina"}},{"type":"MultiPolygon","arcs":[[[395]],[[396]],[[397]],[[398]],[[399]]],"id":"72","properties":{"name":"Puerto Rico"}},{"type":"MultiPolygon","arcs":[[[400]],[[401]],[[402]]],"id":"78","properties":{"name":"United States Virgin Islands"}},{"type":"Polygon","arcs":[[-369,403,-332,-241,-353,404,-349]],"id":"16","properties":{"name":"Idaho"}},{"type":"Polygon","arcs":[[-275,-350,-405,-354,-145,-276]],"id":"32","properties":{"name":"Nevada"}},{"type":"Polygon","arcs":[[405,-335,-189,-343]],"id":"50","properties":{"name":"Vermont"}},{"type":"MultiPolygon","arcs":[[[406]],[[407]],[[408]],[[409]],[[410]],[[411]],[[412]],[[-265,-330,413,-236]]],"id":"22","properties":{"name":"Louisiana"}},{"type":"MultiPolygon","arcs":[[[-192,414]],[[415]],[[416]],[[417]],[[-243,-194,418]]],"id":"44","properties":{"name":"Rhode Island"}}]},"nation":{"type":"GeometryCollection","geometries":[{"type":"MultiPolygon","arcs":[[[0]],[[164,4,328,413,236,261,147,276,350,369,403,330,215,196,380,317,381,259,169,314,346,222,341,405,332,185,333,190,414,192,418,243,343,205,338,207,277,201,278,300,355,302,357,212,394,168]],[[6]],[[7]],[[8]],[[9]],[[10]],[[11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[23]],[[24]],[[25]],[[26]],[[27]],[[28]],[[29]],[[30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41]],[[42]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89]],[[90]],[[91]],[[92]],[[93]],[[94]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105]],[[106]],[[107]],[[108]],[[109]],[[110]],[[111]],[[112]],[[113]],[[114]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134]],[[135]],[[136]],[[137]],[[138]],[[139]],[[140]],[[141]],[[142]],[[154]],[[155]],[[156]],[[157]],[[158]],[[159]],[[160]],[[161]],[[162]],[[177]],[[178]],[[179]],[[180]],[[181]],[[182]],[[183]],[[186]],[[187]],[[209]],[[210]],[[265]],[[266]],[[267]],[[268]],[[269]],[[270]],[[271]],[[272]],[[282]],[[283]],[[284]],[[285]],[[286]],[[287]],[[288]],[[289]],[[297,356]],[[298]],[[299]],[[305]],[[306]],[[307]],[[308]],[[309]],[[310]],[[311]],[[312]],[[313]],[[316]],[[323]],[[324]],[[325]],[[326]],[[335]],[[336]],[[337]],[[339]],[[340]],[[344]],[[345]],[[354]],[[358]],[[359]],[[360]],[[361]],[[362]],[[363]],[[364]],[[365]],[[366]],[[367]],[[370]],[[371]],[[372]],[[373]],[[374]],[[375]],[[376]],[[377]],[[378]],[[379]],[[382]],[[383]],[[384]],[[385]],[[386]],[[387]],[[388]],[[389]],[[390]],[[391]],[[392]],[[393]],[[395]],[[396]],[[397]],[[398]],[[399]],[[400]],[[401]],[[402]],[[406]],[[407]],[[408]],[[409]],[[410]],[[411]],[[412]],[[415]],[[416]],[[417]]]}]}},"arcs":[[[25302,52136],[56,31],[1,25],[14,-40],[-9,-28],[-10,16],[-18,-2],[-20,-17],[-14,15]],[[25338,57677],[0,15],[150,-6],[63,0],[160,-13],[93,-2],[37,2],[159,-4],[61,-5]],[[26061,57664],[15,-321],[23,-443],[18,-379],[13,-294],[15,-311],[33,-713],[9,-32],[-4,-36],[13,-45],[5,-149],[10,-72],[17,-69],[3,-82],[9,-36],[-10,-117],[18,-28],[12,-40],[-10,-52],[-11,0],[2,-24],[-14,-21],[-13,-52],[3,-56],[-2,-86],[-7,-86],[-14,-72],[-3,-45],[6,-124],[-2,-44],[19,-87],[3,-120],[-7,-57],[2,-43],[-8,-80],[1,-79],[-7,-21],[5,-51],[-3,-54],[20,-91],[7,-64],[2,-61]],[[26229,53027],[-67,0],[-71,-5],[-110,-4],[-174,0],[-135,7],[-166,-2],[3,-38],[-13,-115],[2,-23],[23,-79],[3,-41],[36,-80],[3,-69],[-15,-102],[3,-55],[20,-51],[-18,-35],[-8,-82],[-9,-15],[7,-24],[-15,-26]],[[25528,52188],[-38,-35],[-40,-24],[-56,-4],[18,41],[12,-26],[35,27],[3,34],[-15,48],[-7,43],[-20,47],[-7,90],[9,74],[-3,76],[-7,48],[-20,32],[-15,-46],[2,-38],[-9,-57],[1,-41],[-6,-32],[-1,-144],[-8,-66],[-15,-4],[1,36],[-20,40],[-15,-16],[-5,23],[-18,-22]],[[25284,52292],[-3,222],[-3,357],[-6,423],[-10,773],[9,283],[21,710],[5,212],[33,1120],[6,160],[19,643],[12,362],[-16,35],[-13,85]],[[8053,88108],[6,38],[18,-11],[-20,-43],[-4,16]],[[7905,86007],[29,90],[15,-17],[-1,-46],[-28,-74],[-15,19],[0,28]],[[7695,85792],[26,-14],[-3,-36],[-23,50]],[[7642,85774],[22,-17],[-7,-33],[-14,14],[-1,36]],[[7602,85813],[20,-2],[-5,-34],[-15,36]],[[7594,84711],[8,45],[20,-13],[-8,-73],[-15,-17],[-5,58]],[[7543,85532],[12,28],[21,-40],[-33,-2],[0,14]],[[7540,87187],[29,79],[8,112],[31,-29],[-28,-64],[-9,-49],[5,-24],[-36,-25]],[[7464,85521],[14,55],[18,-28],[23,-4],[-33,-33],[-22,10]],[[7385,86976],[17,6],[5,-88],[-22,82]],[[7168,84530],[29,89],[15,6],[26,-66],[5,20],[-21,65],[6,54],[9,10],[27,-25],[21,19],[-29,54],[16,56],[29,-31],[15,4],[-14,56],[12,17],[20,-20],[14,45],[-18,6],[-13,33],[20,3],[22,67],[34,18],[-12,35],[-3,68],[27,66],[7,-31],[53,51],[7,-7],[-12,-118],[-13,-18],[-26,-103],[5,-84],[36,11],[2,69],[22,-9],[21,-71],[20,48],[12,-33],[-17,-117],[9,-22],[9,72],[27,47],[7,-25],[-3,-115],[-30,-89],[-32,23],[-11,81],[-21,-26],[13,-99],[-22,-20],[-39,13],[-16,-54],[-8,36],[2,74],[-10,2],[-9,-114],[-8,-24],[-31,-17],[2,-37],[-16,-22],[-45,-13],[-86,76],[-21,-13],[-15,29]],[[7129,86075],[41,28],[18,-43],[-5,-48],[-13,-16],[-29,-3],[-16,59],[4,23]],[[6962,82933],[31,45],[8,-48],[-37,-9],[-2,12]],[[6905,82759],[20,62],[19,20],[11,-11],[25,17],[5,-40],[19,-37],[36,16],[-2,-37],[-19,-31],[-46,-6],[-32,-13],[-32,25],[-4,35]],[[6789,83718],[20,17],[4,76],[18,75],[25,34],[5,44],[15,-8],[34,70],[33,36],[39,-15],[29,1],[0,-112],[26,-57],[4,45],[17,53],[-18,48],[6,25],[53,-14],[-3,35],[-52,44],[-19,-4],[-1,127],[31,61],[29,29],[20,-12],[22,-56],[6,-133],[15,13],[9,77],[-5,55],[35,-38],[7,47],[-37,36],[-21,58],[7,44],[17,-6],[51,-87],[9,4],[30,-41],[11,10],[-31,75],[-20,34],[-7,44],[17,0],[30,-58],[29,12],[41,-29],[7,49],[36,15],[-8,-63],[-39,-106],[-7,-83],[19,-36],[0,95],[16,43],[16,-49],[5,46],[17,32],[5,41],[14,10],[10,-31],[22,72],[17,8],[-4,-45],[28,-16],[-11,-38],[-11,20],[-18,-15],[19,-36],[-5,-49],[19,22],[11,-51],[27,1],[-24,-53],[-16,33],[-24,2],[-15,-48],[16,-9],[-8,-53],[26,-8],[-26,-89],[23,17],[13,47],[5,-35],[47,-4],[-3,-41],[-36,-78],[-13,-110],[-38,13],[-2,39],[-10,-41],[-23,42],[-17,-6],[-23,49],[-15,-13],[-24,19],[-8,-46],[27,1],[15,-17],[45,-87],[-8,-70],[-23,-52],[-11,36],[-19,-50],[-19,30],[-6,38],[-21,18],[-20,-12],[-17,-37],[29,2],[20,-49],[-38,-53],[-34,12],[-4,-20],[25,-34],[14,13],[35,1],[22,-43],[-11,-28],[-24,-8],[-34,-33],[-8,11],[-19,-29],[3,-49],[-27,-50],[-13,20],[7,34],[-23,50],[7,47],[27,62],[-8,24],[-15,-21],[-34,-105],[-3,-24],[-22,32],[-22,-10],[-5,-35],[26,-6],[10,-63],[-16,-61],[-25,-20],[1,-70],[-25,-41],[-12,13],[-23,-82],[-19,-30],[-18,21],[-31,-20],[22,116],[11,11],[26,71],[24,31],[-2,37],[-33,-23],[3,52],[22,102],[29,52],[-7,30],[-15,-45],[-34,-61],[-26,-112],[-24,-59],[-14,-11],[-5,-44],[-19,-30],[-4,84],[-26,58],[-33,27],[3,100],[-4,106],[-13,83],[-11,32],[-23,20],[-27,5],[14,30],[-15,37],[5,23]],[[6782,82633],[27,101],[51,97],[21,-4],[16,-54],[-12,-23],[-55,-73],[-29,-79],[-19,35]],[[6519,81925],[26,41],[5,38],[13,22],[8,-32],[-6,-43],[5,-68],[-7,-33],[-36,13],[-8,62]],[[6240,82171],[5,47],[14,25],[13,-59],[-13,-63],[-19,50]],[[6225,82357],[9,35],[3,-82],[-10,-1],[-2,48]],[[6080,82757],[21,48],[48,-3],[25,-54],[-35,23],[-16,-26],[-43,-6],[0,18]],[[5919,82533],[19,25],[11,-57],[-9,-11],[-21,43]],[[5642,81925],[8,64],[19,12],[27,-58],[-8,-18],[-21,37],[-25,-37]],[[5573,81984],[16,-49],[-27,12],[11,37]],[[5524,80844],[-1,36],[13,24],[20,-25],[-9,-59],[-19,-15],[-4,39]],[[5506,81836],[8,67],[10,10],[11,-62],[-29,-15]],[[5485,80904],[12,85],[-11,46],[31,-2],[4,-99],[-27,-38],[-9,8]],[[5445,80747],[10,13],[16,-42],[-1,-34],[-23,-4],[-2,67]],[[5429,81185],[17,-21],[5,49],[17,46],[5,-22],[-8,-58],[9,-13],[1,-44],[-10,-61],[13,-30],[-7,-19],[-17,22],[-2,-21],[-20,8],[-3,164]],[[5385,80755],[21,25],[11,-30],[-20,-26],[-12,31]],[[5377,81028],[9,39],[23,41],[5,-36],[-23,-38],[-9,-58],[-5,52]],[[5303,81352],[14,11],[5,-42],[-19,31]],[[5265,80882],[33,98],[15,27],[-5,18],[-22,0],[-4,76],[22,50],[27,-44],[-1,38],[-13,52],[30,-13],[18,114],[12,-23],[-2,-43],[-9,-2],[-5,-75],[12,-18],[0,33],[13,1],[-4,-60],[-11,-37],[-22,12],[-1,-45],[-28,-71],[-18,-24],[-31,-141],[-6,77]],[[5246,85264],[5,41],[14,-83],[-7,-25],[-12,67]],[[5238,81460],[22,42],[36,-14],[-1,-78],[-50,12],[-7,38]],[[5213,85252],[8,77],[5,-57],[-13,-20]],[[5096,81334],[16,74],[25,25],[18,-23],[-2,-46],[10,5],[12,47],[15,-32],[26,-26],[26,25],[7,-66],[-9,-60],[-14,40],[-22,3],[-14,23],[-3,40],[-10,-12],[0,-69],[11,-20],[11,-87],[-11,-60],[-36,35],[-10,59],[-18,-18],[-18,-90],[4,58],[-10,43],[0,104],[-4,28]],[[5033,85142],[7,131],[39,52],[21,6],[39,76],[5,-2],[-55,-273],[-22,-32],[-32,-4],[-2,46]],[[4937,81216],[27,3],[-4,-71],[-26,47],[3,21]],[[4863,81217],[10,31],[36,8],[-9,-51],[-37,-10],[0,22]],[[4804,81100],[4,51],[17,20],[25,-19],[12,-29],[35,-42],[6,-41],[-30,44],[-23,-57],[-28,74],[-11,-38],[-7,37]],[[4656,80881],[30,66],[26,-27],[0,-83],[-11,-53],[-13,-21],[-27,58],[-5,60]],[[4587,90956],[19,44],[21,16],[24,-17],[22,6],[9,-37],[-1,-50],[-75,-13],[-18,19],[-1,32]],[[4545,80324],[1,51],[68,-54],[19,-39],[26,0],[18,-28],[-20,-23],[-10,-33],[-22,40],[-17,-9],[-31,37],[-18,-29],[-22,57],[8,30]],[[4451,81463],[14,-1],[-5,-38],[-9,39]],[[3979,80040],[12,22],[16,-18],[-21,-37],[-7,33]],[[3880,79918],[22,34],[33,-11],[24,18],[5,-24],[-9,-45],[-26,-13],[-47,27],[-2,14]],[[3807,79887],[60,24],[9,-35],[-15,-32],[-13,37],[-34,-4],[-7,10]],[[3781,79848],[17,29],[7,-36],[-18,-14],[-6,21]],[[3751,80090],[13,56],[14,-15],[18,18],[12,-21],[-22,-33],[13,-48],[30,0],[1,-41],[-23,3],[-18,-79],[-23,24],[-2,78],[16,35],[-9,20],[-16,-21],[-4,24]],[[3635,79967],[5,36],[28,54],[30,-6],[3,-58],[20,6],[14,-15],[8,-44],[13,13],[-2,-41],[-26,-36],[-12,11],[-18,-45],[-6,28],[-25,1],[-17,-20],[-18,91],[3,25]],[[3608,79782],[7,15],[27,-33],[-32,-11],[-2,29]],[[3261,87028],[35,25],[57,0],[22,-20],[23,10],[9,-24],[21,10],[10,30],[-8,38],[34,68],[37,-11],[0,37],[25,46],[33,-40],[24,32],[23,9],[15,54],[19,-132],[27,-10],[29,34],[29,-20],[27,-40],[-12,-65],[11,-44],[-11,-40],[13,-11],[4,-65],[-13,-38],[21,-54],[2,-58],[21,10],[-11,-34],[2,-48],[-71,-21],[-6,-34],[-20,19],[-26,-18],[-28,-58],[8,-64],[-26,-8],[-23,71],[-38,47],[-57,-4],[-14,35],[-28,18],[-27,58],[-35,42],[-40,19],[-32,72],[-25,10],[-2,70],[-28,97]],[[3147,79003],[17,23],[22,53],[25,5],[37,40],[9,27],[28,-21],[14,19],[8,44],[22,-19],[3,72],[24,-11],[-17,106],[20,32],[8,-16],[15,18],[-18,35],[4,39],[17,23],[29,-1],[9,-68],[15,7],[-7,50],[13,31],[-53,47],[-14,-21],[-32,81],[0,46],[31,92],[42,50],[36,32],[6,-15],[23,13],[16,-63],[-16,-42],[7,-35],[17,-18],[14,53],[6,-33],[15,29],[-1,41],[18,63],[15,-58],[11,26],[20,-62],[-8,-56],[-23,-13],[-24,-70],[-40,-70],[2,-39],[34,54],[58,64],[4,22],[22,22],[7,-19],[-5,-72],[-16,-51],[-26,-34],[-6,-23],[-45,-51],[-30,-20],[12,-46],[-16,-1],[-4,-61],[-16,17],[-7,-70],[-20,25],[-4,-76],[-36,-13],[-22,30],[-10,-31],[-12,23],[-21,-37],[-6,11],[-44,-73],[-3,-31],[-23,4],[-16,-23],[-13,-60],[-28,23],[-9,-45],[-49,40],[-15,36]],[[3070,93368],[7,34],[34,50],[123,108],[63,74],[48,74],[45,56],[42,64],[84,105],[55,56],[146,167],[172,154],[133,90],[87,45],[135,15],[52,-11],[34,-31],[-41,-11],[7,-38],[-10,-71],[-31,-77],[1,-70],[12,-56],[-21,-59],[-49,-33],[-4,-20],[49,7],[42,-151],[40,-3],[36,32],[42,-1],[49,-30],[47,21],[69,15],[32,-58],[50,21],[18,-34],[52,32],[18,26],[84,-65],[18,59],[26,44],[37,150],[18,26],[40,-9],[8,-39],[32,-12],[31,27],[26,0],[-32,110],[-71,55],[-45,24],[-48,-1],[-60,-60],[13,112],[-3,83],[-62,114],[-22,91],[-26,35],[-59,14],[-8,56],[-32,90],[7,50],[27,18],[10,43],[16,-37],[24,28],[27,-89],[36,-91],[24,-10],[-19,-101],[3,-55],[28,-50],[57,-123],[53,-68],[39,18],[30,28],[9,49],[-45,2],[-10,45],[-56,70],[-53,112],[10,52],[0,60],[14,23],[1,57],[33,93],[30,-32],[22,3],[1,28],[-38,55],[-25,-8],[-28,57],[-87,-29],[-32,-37],[-34,0],[-39,-19],[-34,17],[-20,43],[-17,-16],[-21,23],[-4,-51],[-36,39],[-91,42],[-54,31],[-48,15],[-22,30],[1,98],[-22,163],[-52,216],[-20,58],[-36,62],[-91,101],[-145,228],[-21,24],[-51,87],[-50,49],[-54,37],[-51,23],[-29,35],[-19,70],[-54,84],[-45,40],[-81,41],[-42,-6],[37,40],[92,59],[20,46],[3,57],[19,76],[11,236],[-8,117],[179,-31],[68,6],[144,42],[79,28],[77,15],[77,63],[41,65],[29,30],[53,87],[81,192],[21,92],[7,79],[-2,186],[39,233],[84,183],[65,179],[37,77],[129,162],[96,-35],[69,-3],[68,40],[64,53],[93,104],[74,108],[44,86],[114,188],[33,31],[99,63],[7,-47],[55,-44],[82,-12],[68,15],[13,24],[32,-3],[61,17],[73,51],[74,85],[71,121],[36,88],[86,185],[68,76],[12,-68],[47,-38],[39,-2],[39,-20],[16,-82],[27,41],[99,-49],[15,-98],[-54,-71],[-35,-63],[-41,-4],[12,-146],[81,-15],[44,59],[-7,76],[16,8],[31,67],[23,12],[19,-48],[4,63],[-27,43],[35,55],[21,-47],[-3,65],[15,22],[71,-74],[45,-66],[13,-42],[-11,-33],[1,-109],[9,-49],[61,10],[35,-37],[16,-40],[48,62],[30,75],[112,0],[69,42],[53,-11],[40,-34],[84,-2],[61,-32],[45,-35],[9,-34],[-26,-11],[-26,-83],[-26,-30],[14,-93],[25,5],[19,-24],[45,-6],[10,-28],[69,-20],[33,9],[-17,-43],[9,-25],[-53,-26],[-8,-24],[20,-25],[89,6],[72,-41],[14,-33],[28,5],[44,86],[57,15],[24,-18],[10,34],[40,7],[29,-27],[15,-59],[42,27],[38,8],[58,83],[13,-22],[45,20],[21,-15],[34,26],[12,-30],[66,-8],[62,-72],[28,-1],[19,-24],[26,31],[24,-8],[37,-73],[0,-45],[35,-19],[41,51],[1,-63],[26,57],[81,-77],[14,-67],[24,-23],[49,1],[43,-15],[29,36],[23,-73],[48,-10],[29,45],[43,-12],[62,12],[66,-10],[49,-38],[50,-3],[17,28],[65,-95],[28,-8],[32,-54],[45,-16],[20,-30],[45,-12],[17,-26],[27,32],[66,-20],[45,77],[48,6],[9,20],[84,49],[18,24],[86,30],[42,-25],[48,32],[9,-18],[79,-73],[53,-37],[70,-80],[26,-67],[37,-11],[87,-97],[68,-40],[52,-62],[27,-47],[61,-13],[58,-45],[0,-9012],[2,-971],[-1,-889],[130,-95],[17,100],[135,-145],[81,180],[170,20],[1,-39],[-33,-272],[47,-112],[66,-76],[26,-22],[11,-116],[29,-80],[266,-580],[30,-299],[-8,-93],[22,4],[51,108],[111,158],[11,23],[68,8],[32,139],[-2,209],[30,-19],[18,19],[19,71],[-1,39],[-32,47],[45,48],[68,28],[131,158],[62,-115],[28,-88],[11,-2],[24,-70],[0,-104],[-12,-24],[1,-37],[16,-47],[-5,-42],[18,-76],[73,-38],[5,-66],[32,-73],[24,0],[29,-108],[-6,-69],[26,-20],[-6,-46],[22,-71],[114,-152],[32,-119],[46,-120],[50,-110],[-23,-49],[33,-134],[47,-140],[28,-176],[57,-182],[32,-161],[30,-111],[25,-123],[53,-180],[32,-155],[-33,-140],[89,-52],[-21,-205],[71,-81],[-8,-61],[11,-57],[7,-119],[71,14],[33,-77],[82,-115],[23,-48],[85,-47],[44,-115],[44,-33],[11,-116],[23,-15],[27,-36],[40,23],[28,-143],[-3,-90],[-20,-107],[-18,-67],[1,-60],[10,-38],[-5,-118],[12,-104],[11,-46],[6,-133],[12,-63],[-32,-100],[-24,-122],[-1,-33],[-20,-90],[-23,-77],[-37,-97],[-27,-55],[-19,-14],[3,-46],[-19,-23],[-12,40],[-1,56],[-13,24],[-1,-44],[-12,-22],[-18,18],[-13,52],[-4,108],[3,57],[-17,33],[8,103],[-9,6],[-16,56],[-6,64],[30,63],[17,63],[15,-8],[-3,75],[-11,82],[14,122],[-9,190],[-10,67],[-43,164],[-22,55],[-12,48],[-7,-34],[23,-62],[25,-85],[7,-72],[22,-90],[10,-131],[-16,-43],[-2,-79],[7,-92],[11,-62],[-9,-28],[-11,96],[-8,12],[3,-70],[-4,-74],[-36,-102],[-14,-5],[-24,49],[19,73],[11,73],[-3,38],[-25,-10],[10,-72],[-8,-42],[-33,-56],[-7,1],[-23,108],[-11,-45],[-25,54],[-17,18],[-12,50],[-28,68],[0,76],[31,31],[22,51],[-20,47],[7,75],[-9,39],[23,44],[3,24],[-18,1],[-3,74],[7,43],[-41,-17],[6,-45],[11,-16],[-1,-37],[-13,-85],[-1,-60],[-19,-73],[-18,13],[7,-93],[-10,-43],[-24,52],[-25,22],[-9,30],[-12,132],[-16,70],[21,-29],[7,75],[27,37],[12,147],[-8,102],[10,57],[6,-21],[12,42],[7,92],[-21,-11],[-4,-58],[-19,-30],[-21,-61],[13,-113],[-8,-42],[-33,3],[-12,-43],[3,-30],[-17,-14],[-7,34],[4,67],[-19,23],[-12,128],[-32,-17],[0,-48],[-28,118],[-3,123],[8,25],[25,1],[7,66],[13,49],[30,12],[16,-72],[7,63],[-15,168],[9,3],[30,-45],[4,-59],[11,-32],[6,23],[-9,77],[-22,35],[-19,48],[-3,53],[-11,13],[-12,-25],[-10,49],[-23,32],[-5,57],[12,23],[-4,64],[-22,28],[-37,66],[-13,69],[-15,33],[-13,79],[29,43],[-11,58],[-18,-47],[-19,18],[-2,-27],[-23,58],[-31,8],[-11,56],[-27,-28],[-54,76],[-8,75],[15,73],[18,-22],[33,4],[9,48],[-22,3],[-32,36],[2,35],[-18,125],[13,81],[-24,-10],[-15,19],[-16,53],[7,103],[20,2],[16,-36],[33,-24],[63,-89],[5,15],[-25,58],[-20,19],[-66,130],[-3,95],[-17,-15],[-2,-65],[-20,3],[-39,166],[-55,147],[-11,140],[9,65],[-2,52],[27,41],[-13,100],[-8,-2],[-9,-85],[-20,-30],[0,-42],[12,-22],[-13,-57],[-10,10],[-22,-20],[-25,11],[-36,34],[-7,-15],[-35,36],[-40,174],[-4,110],[-42,140],[-13,79],[19,1],[-11,174],[-19,-56],[1,-58],[-35,132],[-8,177],[-8,92],[-21,135],[-32,116],[-36,37],[-5,-16],[28,-38],[4,-41],[17,-39],[20,-131],[-15,11],[-34,140],[-22,36],[-22,10],[41,-92],[13,-85],[17,-29],[-7,-97],[9,-88],[13,-23],[-5,-24],[27,-124],[3,-55],[25,-139],[2,-32],[-14,11],[27,-204],[9,-85],[1,-69],[-12,8],[-1,-61],[12,-64],[-29,23],[-19,32],[-14,-4],[-18,43],[-15,66],[-10,84],[-22,-16],[-33,50],[-27,-37],[-50,-19],[3,81],[-25,16],[-4,19],[30,39],[-10,69],[5,53],[-28,109],[0,36],[-22,84],[13,24],[-2,90],[-19,64],[-12,10],[15,-131],[-12,-125],[-27,-5],[-42,70],[-26,30],[-15,150],[-11,-68],[-13,-22],[-44,54],[-14,-20],[-10,50],[-12,-18],[-3,-54],[45,-35],[7,7],[45,-44],[33,-66],[30,-104],[-11,-44],[-24,-44],[6,-11],[33,44],[7,30],[27,1],[7,-105],[26,-78],[16,-157],[-19,-44],[-43,-32],[-11,10],[9,47],[-18,16],[-12,-17],[7,-39],[-10,-37],[-43,22],[-11,-23],[5,-60],[-8,-35],[-29,5],[-8,78],[-36,35],[3,15],[-28,74],[-17,19],[-29,-19],[-35,70],[-16,15],[-56,107],[-51,75],[-2,50],[-30,70],[-37,64],[-5,28],[4,75],[-15,48],[-55,121],[-30,47],[-96,89],[-36,71],[-43,66],[-98,104],[-42,49],[-91,144],[-30,39],[5,29],[31,89],[24,-14],[-9,-27],[24,3],[0,43],[21,70],[-22,7],[2,77],[-14,116],[7,35],[22,41],[-5,34],[16,30],[-13,56],[-19,-51],[-2,-59],[-25,-21],[-21,-72],[-1,-49],[-107,-100],[-12,-28],[-28,-28],[-95,22],[-67,36],[-26,32],[-123,125],[-17,56],[18,-10],[34,24],[11,71],[-33,131],[3,42],[-20,-17],[-31,44],[6,-50],[45,-120],[-10,-21],[-54,-51],[-39,0],[-49,55],[-61,24],[-32,23],[-81,40],[-45,11],[-59,-4],[-63,-33],[-77,-12],[-80,-28],[-54,-48],[-39,39],[-45,-26],[-64,-120],[-46,-115],[6,65],[36,103],[62,117],[46,2],[-16,66],[-49,48],[-8,25],[-10,-82],[-26,84],[-26,30],[-17,-9],[-16,27],[-71,19],[9,28],[38,23],[-42,33],[-19,-6],[-2,25],[37,156],[-15,15],[-13,-36],[-29,-22],[-1,-57],[-20,-66],[-39,12],[-70,97],[1,31],[-26,36],[-39,26],[-41,-35],[-22,27],[13,29],[31,32],[25,74],[-14,10],[-18,-49],[-79,-93],[-29,-23],[-38,5],[1,-54],[60,27],[11,-24],[2,-53],[-17,2],[-28,-37],[-18,6],[-41,-38],[-41,-77],[-12,2],[-12,48],[47,77],[-37,-12],[-17,11],[-1,54],[23,83],[13,27],[18,2],[20,-31],[24,17],[22,41],[38,13],[57,58],[42,20],[-9,25],[-19,-2],[1,71],[-11,-49],[-19,-20],[1,30],[25,65],[1,21],[-33,-58],[-45,-47],[-19,-3],[-4,30],[63,112],[-6,38],[-29,-60],[-38,-14],[-12,26],[-15,-49],[-20,-14],[-54,13],[-10,58],[27,19],[11,-9],[18,25],[40,16],[29,28],[23,65],[-25,2],[-14,-46],[-23,-19],[-45,-2],[-18,68],[-12,3],[-17,-69],[-21,-8],[-4,59],[16,26],[17,-6],[-11,44],[-3,55],[13,34],[26,114],[96,6],[-7,38],[-91,-5],[-21,-63],[-27,-26],[-21,-77],[-31,-48],[-23,12],[20,36],[-10,113],[-12,53],[18,30],[-22,10],[-14,-23],[-1,-51],[12,-63],[-14,-63],[1,-41],[-13,-15],[-26,48],[-2,-67],[-27,-45],[-21,22],[0,52],[-11,19],[-7,-73],[-9,15],[4,129],[9,62],[-15,11],[-17,-130],[9,-111],[-4,-29],[-19,-9],[1,49],[-27,34],[-7,-46],[16,-65],[-13,-8],[-38,16],[-34,-48],[-28,9],[-5,31],[14,95],[42,151],[1,53],[49,123],[16,81],[-6,18],[-73,-211],[-1,-35],[-18,-58],[-8,8],[-8,69],[-12,-1],[-3,-81],[-11,-54],[-18,-42],[-3,-64],[-16,-68],[-21,27],[-7,-44],[24,-28],[-5,-91],[10,-8],[19,85],[37,6],[11,-22],[4,-91],[-14,-45],[-31,-32],[-22,-76],[1,-63],[21,20],[17,75],[30,44],[30,-89],[0,-44],[10,-43],[-23,-192],[-26,0],[-9,52],[-19,9],[1,-36],[-27,-44],[0,-17],[28,14],[23,-27],[61,-124],[26,-85],[-15,-77],[-13,-26],[-34,-35],[-17,16],[-14,-18],[-29,-6],[9,51],[-26,67],[9,60],[-17,63],[-16,-126],[0,-62],[-12,-41],[-19,69],[-9,-8],[-7,-59],[-18,-33],[-34,50],[-29,-40],[-15,52],[-27,-21],[-22,5],[-9,28],[24,74],[-9,14],[-27,-38],[-29,-175],[-30,-42],[-9,18],[14,55],[13,84],[-15,172],[-16,5],[-5,-28],[1,-81],[13,-53],[-10,-4],[-10,-72],[-17,11],[-8,-20],[-5,-68],[-11,-17],[4,-47],[25,-31],[-6,-74],[-27,32],[-12,127],[8,37],[-11,78],[-17,6],[6,-52],[-8,-49],[5,-196],[-5,-64],[-27,74],[-1,43],[-16,28],[-34,31],[3,-40],[24,-36],[-1,-63],[-69,-158],[-32,-91],[0,-36],[-16,-10],[-9,-86],[-12,2],[-3,70],[34,211],[0,29],[-26,-65],[-19,-111],[-12,11],[-9,142],[-13,-52],[-11,2],[16,-62],[-5,-80],[-39,0],[-8,-61],[-18,-24],[-22,-55],[7,-43],[-15,-41],[-16,-10],[0,54],[-16,36],[-13,-45],[-1,-53],[-22,-17],[-24,31],[-9,-23],[-21,38],[-7,43],[-12,-36],[-21,-27],[6,-35],[-20,0],[-5,-39],[-41,-7],[-6,76],[-22,-14],[-21,22],[3,22],[-21,8],[-3,70],[8,36],[16,18],[5,71],[32,31],[9,-11],[29,51],[33,3],[0,45],[33,21],[34,62],[31,-9],[-11,69],[22,26],[3,32],[37,102],[-13,15],[-24,-22],[-60,-109],[-30,-20],[-18,-39],[-39,16],[-43,67],[-15,40],[-5,46],[18,117],[13,45],[15,133],[27,79],[17,33],[35,99],[11,98],[0,71],[23,32],[5,156],[4,27],[-18,44],[-22,163],[39,35],[5,27],[63,27],[89,164],[92,118],[51,-161],[41,-16],[13,-27],[34,112],[30,8],[36,-45],[19,10],[63,-48],[65,-20],[30,-55],[-1,27],[-22,63],[-29,36],[-38,-14],[-51,63],[-24,-1],[-40,42],[-25,68],[-39,66],[-29,28],[18,55],[24,9],[31,124],[23,18],[8,60],[46,27],[30,45],[-32,50],[-20,4],[-43,-64],[-11,-49],[-19,-14],[-12,-70],[0,-70],[-18,-31],[-25,19],[-36,7],[-74,-17],[-26,43],[-28,16],[-14,-52],[-87,-84],[-39,-154],[-36,-12],[-19,-31],[-33,2],[-39,-63],[-48,-109],[-1,-29],[26,-124],[-2,-23],[-38,25],[-19,-18],[-30,-52],[-21,-92],[-27,-29],[-32,-74],[-6,-73],[8,-34],[19,-24],[-40,-56],[-9,-67],[-13,-4],[-28,-70],[-19,-7],[-9,28],[-25,-11],[4,-68],[16,-13],[-3,-30],[25,-42],[8,-35],[-12,-73],[-19,-47],[-7,-62],[-25,-21],[-4,-22],[-39,-2],[-15,12],[-40,-31],[-18,3],[-19,-60],[23,16],[15,-20],[15,30],[19,1],[7,-50],[-16,-116],[-19,-16],[-26,-51],[-28,37],[5,-34],[-13,-18],[-18,18],[7,35],[2,75],[-22,71],[3,-119],[-9,-55],[-18,-15],[-13,25],[-6,-35],[16,-28],[-9,-53],[-49,-10],[17,-93],[-8,-32],[-27,-21],[-10,8],[-24,-45],[-12,13],[-36,-37],[5,-26],[20,-18],[-23,-32],[-7,-43],[2,-61],[-12,-44],[-24,-35],[24,-26],[-6,-59],[10,-60],[27,63],[59,-23],[16,22],[12,-22],[15,25],[22,-78],[19,-27],[19,13],[23,-34],[18,-53],[8,-53],[15,-22],[-28,-14],[-14,-118],[-12,-39],[-30,-25],[-11,-55],[-24,-33],[-48,0],[-15,-17],[-4,-94],[-12,-33],[-27,1],[-5,-20],[10,-79],[11,-32],[-27,-36],[-20,15],[-2,-45],[20,-46],[-11,-81],[-21,-30],[-6,-33],[9,-24],[-23,0],[-14,-52],[-26,66],[-9,-7],[5,-57],[-4,-40],[-21,-3],[-12,-43],[-17,16],[0,27],[-20,-1],[-4,-39],[-22,-24],[-23,31],[-28,-17],[-35,-69],[15,-52],[-9,-51],[-40,-44],[-28,-2],[1,-53],[14,-25],[-6,-40],[-20,-16],[-36,59],[-10,30],[-20,-20],[-5,-63],[1,-69],[-26,-27],[-3,-97],[-65,-7],[-21,24],[-2,-74],[8,-71],[-20,0],[-12,37],[-21,3],[-4,-39],[-32,-27],[-39,-92],[-15,-12],[-5,-44],[13,-11],[47,64],[4,-50],[-6,-53],[-15,-7],[0,-31],[18,-38],[-10,-38],[-18,-26],[-2,-49],[-26,-44],[-8,-32],[2,-42],[-32,14],[-31,-28],[-4,-70],[-12,-12],[-19,75],[-8,-53],[-27,-42],[-11,-53],[-24,-6],[5,-50],[-17,-27],[-25,43],[-24,67],[-22,-16],[0,-51],[11,-5],[1,-36],[-29,-10],[-13,-67],[6,-32],[18,-6],[5,-52],[-36,-4],[-24,-15],[-17,77],[-51,-38],[-18,-51],[-16,-3],[-9,-49],[19,-1],[27,25],[20,-17],[6,-54],[-16,-47],[-43,44],[-23,11],[-5,-70],[-33,6],[-23,21],[-20,-33],[-27,-88],[2,-44],[47,-20],[32,-36],[-3,-29],[-32,-42],[1,-23],[18,-4],[25,31],[16,-7],[-55,-78],[-23,-63],[1,-52],[-13,50],[-10,-17],[16,-66],[-6,-50],[-7,39],[-10,-2],[-2,-53],[-25,80],[0,95],[-19,-60],[8,-73],[-4,-67],[-24,-6],[3,58],[-35,1],[-16,-80],[-25,-9],[-75,-43],[-29,-22],[-7,-22],[-3,-74],[-17,46],[5,80],[-23,-19],[10,-30],[1,-104],[-16,-71],[6,-46],[-24,-81],[-32,-30],[2,52],[24,4],[-1,40],[-10,4],[2,111],[18,72],[-29,39],[-28,12],[-13,-18],[3,-45],[-12,-21],[-13,22],[-25,-13],[-9,-82],[-35,-74],[-26,-20],[-37,28],[-6,-29],[11,-44],[-20,-81],[1,-31],[-21,-37],[-12,105],[-10,13],[-14,-37],[-11,14],[-18,-31],[31,-13],[-2,-68],[-32,-10],[-16,25],[5,39],[-13,24],[-22,-22],[-19,-90],[-61,-85],[-26,2],[-11,29],[-26,-29],[-13,4],[10,156],[29,96],[1,46],[-15,16],[-31,-2],[-24,-29],[-24,-101],[4,-129],[-40,-140],[-7,-12],[-14,-85],[-21,36],[-19,-12],[13,-65],[10,-17],[1,-56],[-25,-38],[-19,33],[0,45],[-16,15],[-13,-60],[10,-49],[-17,-47],[-14,27],[-32,-8],[-16,18],[-14,74],[32,6],[-21,47],[-8,104],[-21,56],[-11,7],[-16,-33],[-10,-65],[7,-27],[14,0],[18,-70],[-11,-46],[14,-95],[0,-52],[-22,30],[-20,-19],[3,-26],[-17,-30],[-18,-7],[-22,28],[-16,59],[4,36],[-13,56],[-21,37],[-31,-25],[-10,-56],[49,-85],[4,-31],[-50,-111],[-24,-21],[-20,-33],[16,-56],[27,2],[9,24],[22,-50],[13,-83],[-26,6],[8,34],[-17,6],[-10,-28],[-16,22],[-17,62],[-25,-39],[2,-69],[-18,-1],[-28,-50],[-23,18],[-37,10],[-45,-5],[-34,-14],[-41,-40],[-29,-71],[-4,-69],[-29,-53],[-51,-33],[-29,3],[-28,28],[-9,30],[-9,74],[-10,30],[-1,55],[8,29],[44,41],[14,25],[23,110],[19,110],[-1,29],[22,54],[14,13],[25,-46],[38,39],[25,49],[25,0],[37,81],[34,20],[36,-14],[31,5],[1,-37],[28,-72],[9,-61],[-5,-50],[27,24],[-8,52],[2,37],[30,-30],[-15,42],[2,77],[-10,109],[32,46],[26,21],[42,-15],[21,14],[10,69],[-16,4],[4,28],[18,10],[7,38],[18,-4],[26,99],[3,-32],[15,-20],[21,48],[-5,83],[-20,-9],[27,68],[64,206],[33,52],[23,62],[19,13],[27,42],[25,68],[27,14],[35,39],[37,20],[89,70],[30,-9],[10,18],[45,5],[10,-10],[-20,-27],[-1,-47],[14,-2],[-3,-49],[-29,-18],[-3,-85],[38,-98],[11,22],[27,-39],[4,19],[-29,53],[-3,85],[-6,32],[26,-28],[57,3],[7,-86],[23,7],[26,-36],[7,22],[-14,40],[27,15],[-56,89],[-32,36],[1,58],[-16,-7],[39,166],[15,123],[11,56],[23,44],[36,96],[18,13],[40,74],[30,81],[82,96],[41,74],[35,39],[68,106],[17,42],[29,-68],[19,-14],[31,19],[8,59],[-13,47],[-2,46],[15,122],[29,108],[41,130],[24,62],[22,37],[40,41],[21,52],[22,87],[14,15],[26,62],[30,25],[8,-74],[18,-15],[4,41],[-10,105],[-23,-2],[-6,34],[2,95],[9,59],[25,409],[14,42],[38,16],[12,53],[-20,-9],[-34,77],[-3,62],[9,97],[20,106],[27,33],[29,101],[49,102],[4,57],[19,93],[-5,45],[13,33],[-3,43],[13,38],[-20,0],[-11,-32],[0,-38],[-21,-53],[-28,-31],[-38,-27],[-21,-31],[-29,-22],[-5,-21],[-41,-28],[-44,-61],[-79,-73],[-26,5],[-28,53],[-5,73],[-20,49],[-40,38],[2,46],[11,17],[9,167],[-12,-3],[-25,-101],[-41,-54],[-6,-58],[5,-58],[-8,-37],[-14,-12],[-3,-32],[9,-80],[16,-91],[19,-76],[-26,-87],[-28,-21],[-42,32],[-39,161],[-47,208],[-26,73],[-23,42],[-31,13],[16,65],[-16,44],[-25,-9],[-6,-87],[-15,7],[1,-65],[-29,-30],[-24,79],[3,26],[-19,19],[-11,-30],[-16,6],[-1,59],[-22,-18],[-25,61],[18,47],[-17,89],[-44,-52],[-46,-72],[-31,-62],[-20,-95],[-13,57],[-36,-33],[-94,-124],[-10,-41],[0,-49],[-41,-38],[-8,-26],[-22,-10],[-15,-44],[-20,-15],[-4,55],[-29,45],[-54,-20],[-29,33],[49,47],[15,-39],[18,12],[5,50],[25,77],[3,60],[-8,85],[1,81],[-16,74],[5,21],[-16,20],[-29,97],[-20,139],[29,128],[21,23],[24,79],[24,26],[-15,77],[-18,44],[-15,64],[-10,107],[-50,162],[-3,74],[-25,67],[-10,63],[-30,85],[-10,44],[-22,9],[-11,-37],[-2,-74],[6,-37],[-8,-56],[-12,-21],[-27,-10],[-18,21],[-19,-54],[-36,-29],[-50,-68],[-73,-48],[-88,-28],[-75,10],[-51,38],[-13,32],[-13,99],[23,18],[-18,69],[-54,62],[-32,108],[-5,34],[-33,51],[-18,62],[-42,8],[-31,42],[-47,110],[23,32],[24,55],[-2,36],[-24,6],[-38,-54],[-48,10],[-16,51],[11,32],[32,1],[57,128],[10,-4],[17,45],[-16,34],[-4,41],[32,24],[-27,7],[5,70],[27,78],[-17,3],[-18,-48],[-40,42],[-6,40],[22,49],[27,-6],[19,23],[0,45],[-17,-21],[-30,32],[-16,54],[2,23],[-20,7],[-13,35],[-10,-14],[-12,-99],[-14,-6],[-38,16],[-10,21],[-10,66],[1,129],[-11,19],[-43,10],[-18,37],[-10,98],[42,44],[6,38],[-17,46],[-30,31],[-45,-27],[0,-46],[-21,23],[-9,88],[8,147],[6,11],[-2,-107],[92,47],[0,19],[-35,20],[-20,28],[-24,82],[2,18],[36,19],[55,-8],[33,25],[-29,134],[-4,46],[3,84],[21,77],[101,278],[4,29],[27,77],[29,61],[5,70],[18,67],[21,34],[19,-4],[9,23],[-11,115],[26,188],[18,70],[38,61],[-18,24],[4,22],[58,133],[60,46],[48,11],[42,-45],[43,-11],[32,-84],[24,-6],[6,-26],[54,-88],[73,24],[61,124],[4,47],[44,29],[63,172],[23,89],[23,39],[-9,58],[14,5],[28,-28],[22,-5],[13,-77],[52,0],[45,20],[26,-20],[77,28],[48,38],[9,51],[56,128],[38,135],[0,71],[-12,81],[-23,95],[-17,121],[-1,118],[-5,52],[-71,157],[-9,32],[-41,28],[-27,1],[10,97],[27,33],[14,-25],[35,-20],[51,7],[-10,45],[31,10],[41,81],[2,114],[-42,122],[-47,68],[-25,48],[-1,-32],[-27,-48],[-20,-86],[-42,-30],[-42,42],[-59,-93],[-81,-34],[-18,-71],[-85,-103],[-21,-70],[-5,-99],[-44,-70],[-4,93],[-15,110],[-23,50],[-28,-3],[4,34],[-32,46],[-9,36],[-38,-60],[16,-45],[21,-7],[16,-39],[24,11],[2,-48],[-22,-81],[-19,-11],[-22,82],[-55,76],[-41,33],[-64,13],[-41,-27],[-27,12],[-52,3],[-45,-22],[-108,-112],[-58,-17],[-111,74],[-94,45],[-47,14],[-88,40],[-49,79],[-20,96],[1,74],[20,36],[-6,64],[-28,63],[-45,56],[-1,59],[-46,64],[-10,56],[39,-33],[33,3],[9,27],[24,15],[16,32],[-3,55],[35,61],[-38,63],[-19,9],[-29,-16],[-39,15],[-64,52],[-104,21],[-49,52],[-38,63],[-55,60],[-46,30],[-15,93]],[[2812,78476],[27,27],[-1,59],[18,0],[10,36],[0,57],[21,33],[5,57],[-10,16],[11,87],[46,106],[16,-26],[27,16],[28,-3],[-9,65],[-12,5],[9,77],[-6,26],[18,76],[40,67],[54,37],[29,-53],[31,1],[2,-23],[-21,-74],[5,-60],[-55,-95],[-65,-72],[-19,-66],[-1,-36],[-28,-81],[-15,-58],[-25,-10],[-28,-71],[-15,-17],[-4,-51],[-15,21],[-27,-49],[-54,-69],[13,45]],[[2752,78371],[29,49],[-1,-45],[-26,-25],[-2,21]],[[2615,78610],[4,50],[19,16],[4,-44],[-9,-45],[-12,-8],[-6,31]],[[2607,82847],[50,-13],[29,5],[10,-14],[-27,-68],[-23,4],[-9,46],[-20,10],[-10,30]],[[2611,78728],[8,-39],[-15,13],[7,26]],[[2547,78457],[17,17],[23,-3],[-2,19],[27,23],[19,-10],[10,-25],[-17,-105],[-30,50],[-25,-29],[-19,14],[-3,49]],[[2517,78521],[8,26],[23,-16],[1,-31],[-14,-31],[-13,16],[-5,36]],[[2497,78313],[4,72],[33,-18],[-7,-57],[-30,3]],[[2431,83489],[9,43],[22,15],[12,-10],[29,22],[-2,-56],[-32,-62],[-5,31],[-33,17]],[[2316,78170],[5,42],[40,72],[31,-27],[1,-27],[-13,-58],[-19,2],[-17,-26],[-15,-48],[-15,21],[2,49]],[[2228,78152],[9,-32],[-16,2],[7,30]],[[2183,78046],[17,42],[16,-37],[-12,-55],[-19,-1],[-2,51]],[[2036,90914],[2,37],[25,87],[-3,75],[8,18],[-5,57],[21,3],[8,-42],[-4,-48],[12,-34],[64,-57],[77,-48],[55,-20],[58,87],[58,58],[58,-14],[29,-69],[23,-15],[15,-104],[-2,-38],[53,-56],[56,-14],[22,-32],[9,-35],[36,-20],[88,-20],[14,6],[102,-55],[-27,-131],[-22,-43],[-51,35],[-43,-1],[-50,-29],[-44,-89],[-10,-61],[1,-53],[-20,-46],[-30,22],[3,24],[-26,119],[-32,62],[-50,60],[-39,-5],[-11,69],[-17,55],[-54,80],[-86,69],[-65,11],[-47,-44],[-18,-58],[-36,-34],[-28,33],[-49,36],[-24,83],[-7,56],[3,73]],[[1818,77819],[15,59],[33,49],[12,-2],[27,-39],[-1,-41],[-28,-51],[-32,-27],[-22,-1],[-4,53]],[[1695,87369],[6,69],[25,52],[11,-3],[-4,-58],[12,-54],[33,-70],[48,-63],[22,-14],[25,13],[57,-94],[-21,-19],[-9,37],[-51,8],[-26,-17],[-33,46],[-58,136],[-37,31]],[[1687,87598],[8,-5],[5,-84],[-20,42],[7,47]],[[1421,77626],[35,0],[33,-31],[9,30],[14,-2],[33,27],[25,-1],[-6,-28],[10,-29],[8,15],[31,-24],[23,16],[10,-11],[32,11],[5,-12],[41,-7],[-25,-23],[-16,6],[-14,-22],[-44,-1],[-22,-35],[-8,16],[-16,-19],[-19,4],[-18,25],[-52,3],[-9,-15],[-29,19],[-10,49],[-11,-1],[-10,40]],[[1064,77503],[55,37],[11,-28],[25,50],[3,-22],[19,38],[5,29],[18,-29],[27,8],[8,34],[6,-24],[35,37],[1,42],[44,10],[-13,41],[43,-5],[13,34],[-1,36],[-32,7],[-23,29],[5,26],[21,-16],[12,36],[-2,39],[38,46],[33,-32],[22,-76],[1,-31],[-21,-85],[-34,8],[-4,-43],[33,-79],[-3,-24],[-15,21],[-17,-10],[-4,-27],[-16,-4],[-20,23],[-19,-95],[-25,31],[-64,-55],[-13,29],[-29,12],[-23,-6],[-13,-35],[-22,-8],[-33,6],[-32,25]],[[1013,77451],[17,17],[7,-29],[-22,-4],[-2,16]],[[1005,77685],[16,-19],[-11,-12],[-5,31]],[[949,77433],[5,9],[40,-3],[1,-26],[-19,3],[-22,-24],[-5,41]],[[890,77452],[11,14],[28,-1],[15,-90],[-16,5],[-17,49],[-21,23]],[[821,77563],[14,45],[26,-9],[23,-80],[-20,-38],[15,-56],[-13,-34],[-18,-2],[-18,22],[3,57],[-7,2],[-8,77],[3,16]],[[811,77269],[5,56],[12,10],[10,-27],[19,10],[-12,22],[34,30],[10,-23],[-2,-55],[-23,0],[13,-52],[-29,29],[2,-40],[-12,12],[-5,-39],[-7,45],[-15,22]],[[601,77040],[11,67],[15,16],[7,36],[-13,66],[4,27],[32,7],[7,59],[-13,69],[10,45],[15,4],[18,-20],[19,59],[9,-14],[3,-74],[-20,-29],[-2,-50],[13,-20],[19,4],[31,26],[30,5],[7,-64],[-7,-88],[-15,-12],[-36,18],[-13,-52],[-18,-12],[-13,-41],[-23,31],[-6,-25],[6,-48],[-11,17],[-13,-26],[-4,55],[-14,29],[-19,-108],[-14,11],[-2,32]],[[469,77371],[13,9],[2,-26],[-14,-17],[-1,34]],[[402,77131],[18,33],[24,-17],[26,34],[50,39],[21,43],[2,128],[12,16],[16,-10],[15,-44],[-26,-98],[5,-86],[-7,-38],[-33,-31],[-36,61],[-27,-33],[-40,-10],[-1,-43],[-10,5],[-9,51]],[[257,77332],[8,29],[29,17],[39,-5],[11,-42],[-2,-30],[19,-32],[15,17],[18,-17],[33,34],[-10,-40],[-41,-32],[-12,-71],[4,-31],[-12,-31],[-8,16],[-9,-44],[8,-57],[-8,-5],[-9,56],[-14,-24],[-16,48],[-13,8],[4,28],[41,25],[-3,64],[-20,1],[-13,34],[-39,66],[0,18]],[[130,77016],[32,-12],[-3,-18],[-27,7],[-2,23]],[[81,76979],[27,-17],[7,-23],[-25,5],[-9,35]],[[77,77233],[14,52],[20,-35],[0,-61],[-19,-10],[-15,54]],[[43,76751],[8,25],[10,-22],[5,-50],[-12,-2],[-10,-32],[-1,81]],[[3,76640],[12,18],[6,-59],[-18,-25],[0,66]],[[99917,77451],[12,-2],[12,35],[26,14],[31,-61],[-9,-68],[-24,-42],[-12,-5],[-25,29],[-11,29],[0,71]],[[99678,77049],[5,24],[26,-29],[19,3],[27,-24],[4,-31],[24,-42],[27,-78],[25,-26],[11,-57],[44,-11],[21,-33],[-18,-19],[-9,14],[-29,-16],[-15,41],[-41,72],[-30,101],[-30,43],[-17,-8],[-22,25],[-22,51]],[[99628,77446],[9,11],[20,-16],[11,-33],[-14,-49],[-10,-4],[-16,91]],[[99570,77271],[19,-7],[21,-67],[-22,15],[-18,59]],[[99530,77510],[7,22],[17,-22],[3,-34],[-17,-20],[-10,54]],[[99282,77351],[24,27],[15,50],[39,26],[6,63],[16,96],[11,18],[20,-52],[-12,-32],[-8,-57],[-20,-53],[21,-18],[0,-35],[-13,-10],[-42,17],[-17,-31],[-4,-70],[-11,2],[-25,40],[0,19]],[[98911,77903],[26,-13],[-18,-27],[-8,40]],[[98408,78327],[22,-8],[3,-26],[-24,15],[-1,19]],[[98376,78346],[14,-8],[0,-29],[-14,37]],[[98352,78374],[20,-27],[-12,-2],[-8,29]],[[98210,77943],[6,31],[19,27],[23,-6],[26,67],[41,5],[-17,-40],[-5,-37],[10,-104],[-21,0],[-17,52],[-35,-19],[-30,24]],[[97960,78551],[47,86],[33,11],[100,-20],[29,-63],[24,-15],[35,-94],[2,-18],[-35,-8],[-21,38],[-17,-71],[-9,-13],[-38,15],[-26,-41],[-27,32],[-12,40],[-3,63],[-32,56],[-35,-24],[-15,26]],[[13347,81071],[9,23],[10,-28],[-5,-52],[-16,34],[2,23]],[[13279,80906],[61,56],[7,-80],[13,-14],[-20,-68],[-24,-1],[-33,63],[-4,44]],[[13241,80901],[26,65],[8,-25],[-26,-58],[-8,18]],[[13234,81005],[16,62],[-2,43],[13,20],[-14,43],[-2,70],[5,39],[11,9],[19,-32],[5,-35],[13,-7],[17,-40],[0,-165],[-9,-34],[-27,-2],[-13,32],[-23,-36],[-9,33]],[[13172,81388],[4,66],[6,1],[52,-135],[-12,-28],[-1,-68],[-15,-111],[-23,74],[-9,113],[-2,88]],[[12999,82714],[4,48],[9,-30],[-13,-18]],[[12979,82569],[2,29],[21,40],[21,-38],[-1,-22],[-24,-37],[-19,28]],[[12954,82690],[20,33],[17,52],[-5,-50],[-18,-75],[-14,40]],[[12888,80934],[18,6],[-4,-53],[-14,47]],[[12850,82395],[7,53],[10,-24],[22,-97],[10,-68],[-13,-15],[-21,61],[-9,4],[-6,86]],[[12838,82543],[18,86],[21,30],[30,-20],[24,22],[28,-42],[4,-36],[-18,-53],[6,-82],[-16,-19],[-44,-22],[-23,65],[-24,29],[-6,42]],[[12768,81460],[21,27],[-2,-46],[-16,-11],[-3,30]],[[12700,80811],[9,0],[10,-128],[-15,29],[-4,99]],[[12674,81692],[9,23],[1,61],[20,-30],[1,-32],[-22,-72],[-9,50]],[[12659,81749],[12,9],[-1,-36],[-11,27]],[[12637,81497],[8,92],[8,25],[32,-9],[10,-16],[-2,-35],[-16,-42],[8,-16],[20,40],[5,43],[13,-19],[19,68],[19,-2],[16,-39],[-5,-60],[-15,-35],[-19,15],[-13,-35],[17,-22],[-2,-37],[-22,-21],[-22,-50],[-9,-97],[-23,78],[17,61],[-1,78],[-29,51],[-14,-16]],[[12629,82086],[11,22],[24,102],[28,10],[11,20],[-22,13],[-1,47],[15,-22],[9,34],[-36,62],[14,29],[-10,86],[23,49],[45,-24],[71,-17],[24,-82],[11,-73],[-5,-69],[14,-6],[13,-68],[17,-48],[17,5],[57,-119],[12,-52],[33,-111],[3,-126],[29,-29],[8,-82],[8,-32],[31,-50],[13,-58],[-10,-6],[-19,46],[-75,98],[-3,-31],[-23,-74],[11,-8],[14,47],[8,-19],[23,10],[5,-37],[20,-13],[10,-29],[-38,-14],[8,-36],[32,21],[14,-52],[16,-14],[11,-87],[8,-9],[-12,-49],[-20,9],[2,-32],[22,-22],[11,8],[3,46],[14,36],[9,-21],[5,-91],[-15,-34],[4,-36],[-22,-94],[-29,-40],[18,-23],[27,59],[15,-10],[0,-203],[7,-72],[-20,-105],[-37,-9],[-26,48],[-14,-19],[-17,38],[-1,37],[-38,-2],[17,53],[27,-10],[1,39],[-19,42],[-19,13],[-35,78],[9,38],[10,115],[-15,9],[-11,-58],[7,101],[8,28],[-11,39],[-5,-55],[-27,-21],[14,-103],[-18,-58],[-47,56],[-4,35],[17,58],[-18,100],[-20,-5],[-10,50],[-21,3],[12,-78],[18,-65],[6,-72],[-7,-36],[15,-17],[20,-145],[24,-26],[-4,58],[24,18],[28,-65],[4,-124],[-14,-16],[-18,74],[-7,-7],[23,-170],[-29,0],[-26,32],[-2,60],[-20,40],[-49,177],[-10,22],[-2,84],[-12,10],[-8,61],[29,8],[-27,33],[3,119],[-33,-28],[-10,26],[-18,-19],[-9,42],[6,84],[33,30],[11,-63],[17,20],[-13,29],[6,39],[14,20],[14,-14],[22,44],[-29,96],[14,12],[-16,32],[4,66],[-24,-21],[-49,87],[-4,28],[16,-1],[-9,50],[3,35],[-27,18],[6,-57],[-10,-13],[-32,39],[-16,58],[12,52],[28,14],[37,-54],[28,35],[-17,67],[-18,16],[-12,-20],[-9,17],[8,30],[-2,42],[7,63],[-5,16],[-13,-47],[-27,-65],[-22,-33],[-23,38],[-5,45]],[[12611,83642],[15,25],[14,-33],[-27,-31],[-2,39]],[[12594,82026],[14,28],[11,-6],[4,-52],[-8,-48],[-10,3],[-11,75]],[[12476,82024],[28,22],[1,-43],[31,33],[8,75],[7,-2],[-9,-101],[-22,-24],[-20,-56],[-18,17],[8,30],[-14,49]],[[12463,83115],[17,52],[16,17],[7,33],[33,-1],[1,26],[28,-40],[11,-83],[18,-54],[31,-2],[9,-21],[10,26],[-29,44],[-13,80],[-2,55],[-35,79],[11,53],[34,26],[51,-37],[25,-9],[47,-44],[31,-20],[7,14],[57,-11],[30,-74],[14,-82],[3,-56],[9,-23],[23,-11],[16,-48],[5,-46],[33,-52],[9,-64],[15,-34],[-31,-38],[-20,-42],[-26,-24],[-16,16],[-31,4],[-43,24],[5,-48],[-23,-51],[-40,25],[-19,29],[-12,-47],[-15,-20],[-25,-2],[-17,15],[-3,87],[-11,32],[-30,-64],[13,-29],[-2,-90],[-23,-3],[-2,-31],[10,-51],[-11,-51],[-2,-62],[-17,-50],[4,-39],[-9,-64],[-10,-11],[-25,15],[-14,-103],[-15,19],[-12,52],[-7,63],[-1,109],[-10,87],[2,75],[14,48],[-3,57],[15,101],[-12,28],[-22,-1],[5,77],[-20,56],[-8,75],[2,43],[-5,91]],[[12311,84926],[43,-96],[7,-47],[14,-9],[8,-130],[19,1],[21,38],[11,-23],[20,-2],[21,-29],[54,13],[-3,-89],[25,-75],[2,-52],[21,-52],[14,-87],[17,-55],[2,-142],[21,-60],[4,-65],[-9,-2],[-5,47],[-38,120],[-10,115],[-19,37],[-9,53],[-21,0],[26,-101],[4,-34],[-13,-23],[35,-121],[23,-49],[-2,-62],[24,-113],[-19,6],[15,-102],[0,-27],[-25,-62],[-20,26],[-17,-1],[4,-34],[-21,-104],[-38,-83],[-24,-25],[-2,-33],[-31,-65],[-29,3],[-9,89],[-4,135],[21,80],[15,23],[-16,31],[-1,69],[14,6],[12,-39],[6,23],[-40,141],[-1,58],[-18,60],[-5,82],[-11,43],[8,125],[-12,81],[-3,95],[-11,91],[4,44],[-20,93],[-17,45],[-9,77],[-6,101],[3,42]],[[12292,85061],[35,-45],[27,-125],[-10,-5],[-22,115],[-23,19],[-7,41]],[[12202,85643],[15,-71],[0,-46],[-10,29],[-5,88]],[[12106,83714],[16,11],[1,26],[28,65],[-4,68],[36,64],[18,-12],[25,-85],[15,10],[18,-58],[23,-24],[38,4],[22,-14],[12,-79],[-2,-49],[-20,35],[-19,-2],[-1,-22],[21,-25],[11,-46],[29,-278],[-1,-71],[12,-56],[0,-58],[18,-142],[5,-107],[-5,-112],[-11,1],[8,-81],[3,-240],[-9,-111],[-11,6],[-28,70],[-10,86],[-21,59],[-40,212],[4,48],[22,23],[-18,30],[-26,-31],[-14,88],[-11,-15],[-17,42],[-12,55],[2,34],[-14,-22],[-10,24],[-30,2],[-19,96],[19,3],[10,-29],[10,13],[-3,105],[19,53],[6,38],[-39,86],[24,63],[-4,22],[14,35],[4,53],[-33,16],[-21,-28],[-14,79],[-26,72]],[[12097,84881],[16,18],[19,-7],[16,-52],[-29,-6],[-22,47]],[[12062,83572],[4,48],[-3,66],[25,9],[34,-62],[15,-74],[12,-19],[17,30],[23,-10],[-16,-82],[-24,-14],[-27,-161],[-12,6],[-40,-30],[-9,8],[3,102],[25,47],[1,50],[-22,4],[2,29],[-13,31],[5,22]],[[11978,85151],[9,14],[7,-59],[-16,45]],[[11978,84786],[30,41],[3,-53],[-16,-19],[-17,31]],[[11861,84371],[5,174],[16,33],[8,-9],[29,60],[3,51],[-12,92],[32,-2],[0,-54],[12,-60],[28,61],[29,-6],[17,-20],[17,49],[36,50],[14,-55],[41,-30],[25,-53],[-12,-78],[-31,-76],[4,-49],[12,-5],[8,60],[32,108],[15,12],[34,-55],[46,-10],[11,-32],[29,-16],[15,-79],[-4,-67],[-22,-44],[-37,49],[-10,-8],[12,-40],[18,-18],[33,-75],[-21,-29],[-25,-2],[4,-28],[21,-13],[23,24],[7,-95],[14,-69],[12,-143],[-14,-42],[-42,-11],[-17,12],[-44,95],[-65,99],[-27,50],[-22,-26],[-9,29],[-4,-32],[30,-55],[22,-8],[-21,-31],[6,-25],[0,-72],[-9,-50],[-31,-87],[-51,47],[-1,38],[-42,85],[-20,90],[-12,-38],[-19,43],[-10,79],[4,25],[-18,86],[2,24],[-16,57],[-26,30],[-7,49],[-25,36]],[[9331,87212],[28,-14],[12,-44],[-27,-9],[-13,67]],[[9232,87245],[16,14],[58,-26],[-3,-31],[-21,-10],[-50,53]],[[8867,87809],[26,35],[27,3],[15,-16],[-18,-53],[-50,31]],[[8817,87545],[4,86],[28,16],[21,-89],[-11,-44],[-37,-10],[-5,41]],[[8816,87079],[2,14],[43,47],[1,-36],[-40,-59],[-6,34]],[[8698,86532],[8,21],[3,71],[23,12],[-3,42],[21,54],[16,7],[-3,41],[30,34],[9,30],[43,75],[22,118],[27,44],[-3,40],[10,71],[27,34],[4,-43],[24,2],[-17,-51],[9,-17],[24,28],[8,-22],[-11,-37],[-62,-118],[-49,-129],[-8,-80],[-33,-60],[30,-57],[-19,-42],[-23,-8],[-22,15],[-17,-57],[-9,6],[-45,-47],[-14,23]],[[8692,87068],[44,270],[11,-41],[12,13],[-4,66],[44,84],[0,-54],[-12,-32],[-3,-82],[-20,-37],[20,-42],[-24,-97],[2,-46],[-17,-104],[-24,45],[-3,25],[-25,7],[-1,25]],[[8672,87628],[15,31],[17,-19],[17,-48],[-24,-45],[-25,81]],[[17950,55027],[5,31],[24,-13],[25,26],[-2,40],[18,63],[1,79],[-15,136],[-16,8],[-7,-13],[-13,25],[-3,-17],[-14,68],[7,67],[2,142],[-15,41],[9,65],[-8,51],[19,9],[28,138],[9,24],[-4,46],[4,110],[8,12],[-2,74],[-7,64],[1,51],[6,6],[-2,55],[-7,20],[28,116],[0,69],[8,28],[23,29],[10,40],[17,21],[1,19],[25,65],[-1,49],[-11,54],[-14,19],[-31,100],[-13,7],[2,58],[-26,239],[-23,63],[-7,69],[-16,57],[1,147]],[[17974,57684],[6,95],[-10,22],[21,43],[0,72],[-9,178],[-6,65],[-11,47],[-4,58],[6,36],[0,103],[-9,38],[3,39],[-7,31],[3,51],[-5,59],[4,56],[9,24],[-10,31],[-12,97],[4,43],[-7,80],[25,31],[9,29],[5,-14],[12,25],[17,-1],[2,-25],[24,19],[13,-3],[18,-71],[-2,-28],[21,-51],[24,11],[24,183],[5,15],[1,230],[-2,272],[0,437]],[[18136,60011],[200,0],[222,0],[313,1],[97,1],[160,2],[6,-7],[235,0],[162,1]],[[19531,60009],[0,-1691],[-1,-237],[1,-30],[0,-925],[-1,-608],[1,-145],[-1,-113],[0,-2847]],[[19530,53413],[-64,2],[-201,-1],[-128,-1],[-172,0],[-359,476],[-212,269],[-102,136],[-368,471],[5,66],[-5,17],[1,60],[8,16],[17,103]],[[19530,64667],[242,0],[154,2],[327,0],[66,-5],[137,-1],[242,1],[7,2],[217,2]],[[20922,64668],[282,1],[135,0],[140,0],[0,-1163]],[[21479,63506],[1,-381],[0,-434],[1,-193],[0,-1270],[1,-137],[0,-1089]],[[21482,60002],[-183,3],[-22,5],[-62,1]],[[21215,60011],[-204,-3],[-169,-5],[-184,0],[-34,2],[-301,-1],[-186,-2],[-2,9],[-152,-1],[-230,-1],[-222,0]],[[19531,60009],[0,583],[1,36],[0,738],[-5,129],[0,517],[2,216],[0,1857],[1,46],[0,536]],[[27414,45876],[14,60],[5,-33],[-14,-44],[-5,17]],[[27386,45813],[9,39],[11,4],[-5,-33],[-15,-10]],[[27310,45701],[52,90],[6,-30],[-45,-80],[-13,20]],[[27118,45540],[19,106],[20,46],[25,43],[3,23],[36,66],[38,-67],[4,-52],[14,-43],[-4,-11],[-40,-48],[-3,27],[-27,-5],[-3,-24],[-46,-73],[-36,-15],[0,27]],[[27062,45510],[39,24],[-10,-43],[-17,-14],[-13,8],[1,25]],[[27020,45533],[6,35],[12,-10],[-5,-41],[-13,16]],[[26992,48019],[5,-18],[19,-211],[8,-28],[17,-26],[7,17],[14,-21],[-14,-31],[-9,-1],[-21,50],[-7,28],[-13,115],[-6,76],[0,50]],[[26806,45614],[15,13],[4,-23],[-20,-10],[1,20]],[[26322,51623],[29,47],[0,-29],[-16,-37],[-11,-6],[-2,25]],[[26229,53027],[6,-79],[11,-52],[2,-83],[6,-75],[14,-48],[136,-25],[261,-56],[206,-51],[135,-34],[-5,-14],[2,-57],[7,-26],[-3,-71],[11,-76],[37,13],[0,75],[6,47],[3,119],[-12,91],[4,60],[-1,49],[8,16],[-4,24],[12,-8],[9,59],[15,-7],[7,-33],[17,-3],[18,-28],[7,-25],[33,-19],[17,-18],[14,15],[13,-19]],[[27221,52688],[4,-13],[-4,-113],[3,-92],[-4,-22],[10,-25],[4,-95],[1,-113],[23,-389],[13,-129],[0,-51],[28,-302],[32,-288],[29,-229],[65,-412],[38,-200],[4,-63],[10,-83],[-18,-57],[-4,-54],[-1,-87],[5,-130],[6,-96],[16,-145],[35,-269],[15,-166],[5,-84],[5,-29],[11,-140],[17,-152],[9,-66],[6,-94],[13,-109],[17,-258],[-1,-235],[-7,-175],[-5,-210],[-3,-37],[-8,-286],[0,-169],[-3,-80],[-7,-81],[0,-44],[-6,23],[3,51],[-5,20],[-16,-25],[-10,-102],[-6,-17],[-1,-64],[-8,-40],[-2,-78],[5,-33],[-2,-46],[6,-16],[-8,-53],[-8,-13],[-1,-49],[21,39],[25,194],[7,41],[0,-41],[-8,-83],[-34,-222],[-9,-82],[-25,-93],[-34,-139],[-24,-66],[-3,12],[34,122],[14,40],[7,53],[3,81],[5,32],[-6,23],[-9,-11],[-7,26],[-6,-18],[-34,-22],[-14,-41],[-9,-6],[-18,45],[-18,-13],[-7,-41],[-27,-18],[-23,-6],[-17,52],[-8,68],[2,79],[6,60],[6,-3],[-2,49],[-12,97],[-11,47],[2,34],[-8,62],[-11,32],[-5,85],[-6,18],[-11,-15],[-9,101],[-24,31],[-1,16],[-21,38],[-21,55],[-11,-13],[-8,-39],[-16,126],[-15,148],[-5,173],[-7,109],[-7,57],[-28,113],[-11,9],[-1,52],[-12,23],[0,-64],[-14,-11],[-1,66],[-8,113],[-12,51],[3,24],[13,-3],[9,-39],[11,159],[-2,86],[-8,14],[0,40],[8,10],[-4,31],[-12,-4],[-5,-33],[-11,-11],[8,-148],[-9,-20],[-20,-11],[-5,-50],[0,75],[-6,50],[-17,94],[-26,177],[-9,94],[-19,140],[-27,149],[-14,56],[-4,58],[-10,61],[10,-19],[1,-30],[15,30],[10,72],[12,28],[13,98],[13,34],[-2,23],[14,26],[11,84],[-5,75],[-22,21],[5,-113],[-22,30],[6,34],[-1,65],[-5,39],[-38,71],[1,-65],[-11,-28],[11,-37],[16,-6],[11,-110],[-10,-42],[0,-62],[-4,-27],[-21,-6],[-3,-32],[7,-38],[-9,-30],[-4,40],[2,83],[-14,85],[-9,26],[-8,58],[6,182],[-5,66],[-4,164],[9,1],[0,-93],[4,-89],[9,-7],[-4,153],[9,37],[1,41],[8,44],[0,38],[7,50],[0,39],[9,47],[1,91],[5,83],[-6,66],[2,56],[-13,29],[4,42],[-9,109],[12,64],[-21,110],[3,31],[-8,55],[-10,3],[5,33],[-1,49],[-7,13],[-47,23],[-9,-51],[-7,-4],[-9,100],[3,45],[-14,32],[-12,9],[-2,63],[-7,58],[-11,45],[-15,6],[-5,44],[-24,48],[0,111],[-4,67],[-12,7],[-10,38],[-13,17],[-13,61],[0,42],[-9,35],[-5,51],[-14,44],[-28,62],[-40,72],[-26,75],[-11,-2],[-26,-33],[-31,29],[-1,-35],[-26,-69],[9,-99],[-3,-28],[-10,-7],[-15,15],[-5,26],[-24,-22],[-31,-73],[-65,-132],[-6,2],[7,44],[-10,12],[-7,-39],[-15,-41],[-36,1],[13,-49],[2,-38],[16,-22],[30,53],[29,40],[27,84],[3,-13],[-24,-82],[-28,-43],[-35,-66],[-12,-14],[-10,33],[-16,22],[-23,51],[-19,7],[-17,-28],[-13,94],[-5,119],[8,42],[0,-105],[6,-91],[7,-22],[10,39],[1,97],[-17,105],[-18,60],[-17,13],[-15,40],[-16,71],[-27,47],[-22,69],[-41,95],[-47,76],[-58,70],[-31,20],[-62,18],[-33,-5],[-47,-25],[-65,-49],[-32,-15],[-7,10],[-63,-51]],[[26061,57664],[39,-2],[136,6],[183,1]],[[26419,57669],[196,-2],[-1,6],[143,10]],[[26757,57683],[-3,-72],[-31,-68],[-26,-105],[1,-36],[-8,-26],[3,-64],[30,-82],[17,-7],[23,-104],[23,-51],[28,16],[8,-12],[8,-64],[3,-64],[12,-30],[3,-50],[11,-52],[0,-51],[7,-68],[12,-24],[8,-67],[14,-48],[11,-101],[9,-1],[19,-72],[29,-52],[29,-98],[4,-61],[9,-41],[1,-40],[13,-38],[12,-2],[17,-37],[18,-93],[15,-26],[4,-24],[-7,-43],[4,-39],[-4,-32],[28,-82],[-4,-30],[13,-42],[11,5],[-2,-41],[8,-45],[27,-55],[9,1],[16,-58],[19,-43],[-5,-67],[12,-64],[2,-49],[9,-15],[0,-85],[4,-32],[-5,-45],[6,-8],[4,-48],[-5,-41],[12,-48],[25,-26],[0,-23],[23,-81],[-4,-34],[15,-105],[4,4],[6,-76],[-10,-44],[11,-67],[-4,-26],[5,-62],[21,-34],[11,17],[22,-71],[9,-4]],[[27376,54230],[12,-12],[-5,-64],[-14,-29],[-10,15],[-6,-48],[10,-8],[-16,-60],[-21,23],[-3,-56],[11,-11],[-9,-59],[-17,-54],[-17,13],[-3,-16],[12,-33],[8,5],[-1,-84],[-7,-62],[-28,-26],[0,-22],[17,10],[6,-24],[-23,-131],[-6,-91],[7,-13],[-5,-30],[-5,-97],[-13,-22],[-8,-59],[-9,-3],[0,-71],[-7,-69],[-7,2],[-12,-44],[13,-24],[11,24],[1,-81],[-16,-161],[5,-70]],[[25527,65491],[15,-41],[12,20],[7,-15],[-6,-40],[27,-23],[29,1],[28,25],[52,75],[31,59]],[[25722,65552],[90,-1],[198,-1],[187,1],[87,1],[0,-75]],[[26284,65477],[1,-242],[0,-1380],[-3,-437],[0,-441],[-2,-278],[0,-238]],[[26280,62461],[-19,-45],[-2,-20],[16,-71],[2,-31],[-11,-38],[3,-37],[17,-7],[4,-25],[-13,-46],[6,-44],[-22,3],[-16,-23],[-9,5],[-35,-63],[-14,-39],[-19,10],[-10,43],[-26,-7],[-16,7],[-12,-33],[4,-125],[6,-71],[-16,-40],[-7,-44],[-30,-34],[-19,-161],[-19,-39],[-14,24],[-10,-13],[-6,-63],[-16,-72],[1,-87],[-5,-70],[-8,-24],[-23,-18],[-4,-36],[-13,58],[-22,1],[-26,55],[-1,94],[-21,67],[-8,-2],[1,-34],[13,-12],[-1,-25],[-13,-2],[-8,-29],[-8,23],[-9,-29],[9,-17],[-6,-42],[-18,-9],[-2,-94],[5,-38],[-23,-9],[-2,-63],[-11,-29],[-7,24],[5,51],[-10,10],[-10,-25],[-10,22],[-12,89],[-17,-2],[-14,-52],[-29,-27],[-10,-30],[-5,-97],[-7,-27],[-11,-3],[-8,62],[-18,13],[-22,57],[-22,44],[-20,6],[-14,-37],[-14,19],[-6,49],[-8,6],[-7,-66],[11,-64],[-13,-40],[-11,3],[3,56],[-5,30],[-42,-31],[-11,52],[-9,4],[-10,-40],[10,-91],[-12,-47],[-23,32]],[[25386,60941],[-11,2],[-4,34],[12,-9],[-16,92],[24,-8],[-15,29],[15,67],[1,60],[-8,26],[19,19],[2,38],[-12,-19],[22,73],[-14,60],[-4,59],[9,-10],[9,68],[5,-35],[7,41],[8,-33],[13,102],[8,9],[13,84],[-2,38],[24,42],[0,66],[9,83],[7,32],[14,12],[14,76],[-1,42],[-15,94],[11,111],[-18,40],[1,79],[-16,55],[-3,73],[19,60],[-9,50],[2,60],[6,32],[13,9],[0,347],[-1,0],[0,397],[1,12],[0,294],[1,247],[0,1196],[1,254]],[[21479,63506],[257,-1],[104,0],[263,-1],[273,1],[163,0],[279,-1],[263,-1],[144,0],[133,0]],[[23358,63503],[16,-60],[13,-11],[1,-43],[13,6],[5,-36],[26,-14],[8,41],[24,-13],[-4,-28],[7,-33],[11,-11],[-4,-42],[-9,-1],[3,-36],[12,16],[-1,-49],[-10,-6],[-13,24],[-5,-75],[-15,-19],[-7,-41],[2,-41],[-17,-24],[1,-48],[15,-41],[1,-29],[16,-31],[12,-61],[14,0],[5,-21],[-9,-25],[6,-79],[18,-52],[-3,-28],[15,-13],[5,-31],[14,-11],[9,16],[5,-31],[20,-3],[-5,-41],[0,-444],[-1,-120],[0,-696],[-1,-52],[0,-779],[-1,-97],[0,-281]],[[23550,60009],[-249,1],[-196,-1],[-169,0],[-218,0],[-208,-1],[-258,2],[-103,0],[-154,3],[-149,-4],[-209,-4],[-155,-3]],[[30863,68384],[14,7],[-7,-35],[-7,28]],[[30827,68345],[7,83],[6,-34],[19,-55],[-15,-45],[-5,34],[-12,17]],[[30819,68560],[3,42],[11,-71],[-14,29]],[[30732,68434],[14,2],[3,-41],[-17,39]],[[30712,67988],[8,37],[1,-75],[-9,38]],[[30703,68290],[8,41],[25,45],[11,-50],[-9,-8],[14,-78],[-11,-39],[-18,-13],[-12,24],[5,25],[-3,50],[-10,3]],[[30697,68452],[13,68],[2,64],[9,25],[6,-26],[-9,-35],[1,-36],[-8,-70],[-10,-29],[-4,39]],[[30213,67064],[-35,81],[0,69],[6,42],[-41,128],[-9,53],[8,101],[-4,10],[6,88],[-6,23],[-5,313],[0,89],[-11,861],[-15,757]],[[30107,69679],[21,15],[0,33],[25,-41],[-1,-38],[7,-43],[11,-15],[13,85],[2,86],[-6,28],[12,36],[8,-3],[12,-44],[21,-9],[1,39],[-24,83],[-1,32],[22,107],[14,27],[11,43],[8,-1],[15,41],[24,38],[-9,71],[21,66],[23,45],[5,56],[-7,28],[-14,0],[0,66],[10,38],[-8,14],[15,51],[5,46],[-15,44],[16,115],[8,18],[-1,37],[17,32],[14,59],[11,8],[17,324],[215,890],[13,-3],[27,-38],[11,4],[-3,-58],[1,-141],[4,-18],[37,-73],[25,43],[26,30],[28,2],[11,52],[30,11],[25,-12],[0,62],[16,23],[25,-6],[23,-36],[4,-32],[33,-68],[36,-132],[0,-15],[28,-51],[0,-545],[3,-693],[-1,-71],[9,-30],[-15,-39],[14,-70],[-15,-34],[1,-136],[23,-18],[3,20],[10,-57],[19,-28],[30,-23],[14,19],[8,-62],[1,-56],[-13,8],[-11,-22],[7,-68],[16,-63],[-9,-73],[-10,-41],[23,-116],[0,-23],[18,-40],[13,28],[1,46],[18,-30],[19,-3],[13,-56],[6,-51],[-8,-14],[10,-32],[12,-98],[15,-38],[1,-118],[-12,-50],[-10,2],[-4,-32],[-32,-113],[-24,-25],[4,-22],[-15,-8],[6,42],[-4,85],[-27,-30],[12,-58],[-12,-43],[-11,13],[-13,-58],[-13,18],[-10,-12],[2,-35],[16,-40],[-22,-57],[-13,46],[-6,57],[-13,-10],[-3,-38],[-8,3],[-7,59],[-7,-62],[-9,-14],[-8,-74],[-7,19],[-6,-48],[-4,42],[-20,-51],[-5,27],[-12,-92],[-16,39],[0,36],[-10,-21],[-11,9],[2,-66],[-16,-71],[11,-33],[-35,-16],[-23,32],[-16,107],[6,29],[22,27],[-9,45],[-13,-35],[2,44],[-10,-3],[1,-68],[-5,0],[0,64],[-24,-56],[5,-35],[-6,-43],[14,-67],[-3,-45],[-23,-77],[9,-11],[-12,-31],[11,-56],[-5,-69],[-16,-10],[-3,85],[6,4],[-3,55],[-17,45],[-4,64],[15,51],[-19,40],[6,26],[-10,10],[-18,-21],[1,113],[11,44],[1,50],[-7,14],[-7,-46],[-14,-40],[-11,33],[-7,-32],[-15,-4],[14,-81],[-3,-48],[-12,-23],[-10,-71],[-4,-72],[-13,-78],[19,-30],[-13,-28],[10,-57],[-10,-38],[-27,4],[-13,-72],[-15,-1],[-2,-58],[-11,-9],[0,52],[7,37],[-9,15],[-3,-30],[-12,-13],[5,65],[-18,-9],[1,-52],[-16,-37],[-5,-50],[-12,51],[-2,-47],[-15,-32],[-12,26],[-3,-66],[-13,51],[-13,-92],[-23,-27],[-5,-19],[-5,83],[-16,5],[-15,-42],[-5,-39],[-20,4],[-7,-49],[-20,4],[-10,-49],[-3,-50],[5,-29],[-8,-32],[-13,29],[-22,-31],[-9,-46],[6,-67],[-8,-43],[-10,-15],[3,-33],[-14,-24],[-14,4],[-10,-25],[-11,-98],[5,-19],[-14,-80],[1,-22],[-14,-74],[-9,-13]],[[30332,65028],[13,-24],[29,5],[18,17],[12,70],[16,-105],[-1,-30],[-10,-16],[-33,4],[-41,60],[-3,19]],[[30177,65078],[18,0],[19,90],[27,60],[11,-15],[7,-70],[15,-27],[10,40],[-1,-84],[-41,1],[-31,-9],[-18,-47],[-16,61]],[[29500,66699],[224,-22]],[[29724,66677],[199,-23],[126,-12],[10,46],[21,1],[-1,62],[15,36],[19,-18],[9,62],[36,32],[15,-30],[8,13]],[[30181,66846],[2,-72],[9,-136],[25,-47],[12,42],[14,-34],[-16,-90],[-23,-7],[-38,-35],[12,-50],[-18,-50],[-7,9],[-5,-59],[-4,41],[-11,-53],[11,-74],[-13,10],[-5,-28],[8,-26],[-5,-27],[14,-14],[6,36],[14,8],[9,-47],[24,-28],[12,-42],[2,-46],[21,-93],[-1,-50],[-7,-39],[-12,-5],[3,-24],[21,-51],[12,8],[8,-24],[8,-83],[-5,-50],[13,-48],[23,-35],[34,-12],[9,-23],[19,44],[19,8],[27,33],[6,25],[-1,79],[-6,61],[-13,-31],[0,97],[-5,55],[-15,34],[-9,-7],[-5,-39],[-11,59],[13,11],[21,-18],[23,-58],[18,-123],[9,-119],[2,-137],[-15,-129],[-2,-44],[-7,9],[12,112],[-7,23],[-26,-5],[-43,-40],[-30,8],[-7,-28],[-17,-7],[-15,-62],[-33,-10],[-34,-66],[-16,-47],[-21,-28],[-23,-15],[6,26],[35,34],[16,47],[24,49],[5,40],[-2,117],[6,41],[-26,26],[0,-59],[-7,14],[-4,-50],[-14,3],[2,-32],[-31,-11],[-7,-49],[2,-44],[-6,-29],[-25,-23],[-12,17],[-10,-14]],[[30097,65246],[-3,189],[-18,18]],[[30076,65453],[-8,41]],[[30068,65494],[-10,48],[-19,33],[-5,56],[2,81],[-12,-6],[0,147],[-116,-13]],[[29908,65840],[-1,18],[-202,13],[-22,-4],[-42,6],[-3,-39],[-14,-6],[1,45],[-54,3],[-118,14],[-15,-1]],[[29438,65889],[-6,42],[34,395],[34,373]],[[22823,73980],[83,-1],[266,0],[229,-1],[0,449],[27,-37],[28,20],[29,-53],[8,-35],[14,-202],[7,-25],[18,-251],[-6,-69],[4,-54],[14,-43],[29,-45],[24,-12],[8,19],[44,-11],[11,-58],[61,-7],[48,-21],[8,-66],[-3,-49],[6,-12],[42,2],[5,15],[22,-2],[23,20],[-1,48],[33,46],[39,18],[9,-22],[53,0],[72,-98],[26,4],[1,-49],[-19,-7],[-4,-37],[16,-31],[41,13],[15,-54],[-6,-34],[6,-49],[24,-127],[25,27],[-8,84],[13,45],[15,-11],[42,16],[16,-44],[-2,-65],[17,-41],[14,9],[9,-36],[41,-9],[5,-67],[-4,-31],[20,-21],[23,13],[-3,-75],[22,28],[14,-22],[19,24],[34,17],[46,113],[17,13],[13,32],[25,30],[14,-13],[0,-67],[17,-17],[-6,-26],[10,-48],[16,-3],[35,29],[6,-29],[25,15],[26,-18],[19,13],[48,8],[29,-28],[9,-66],[34,-53],[15,35],[20,9],[13,-20],[23,6],[11,-18],[25,22],[-27,-56],[-10,20],[-4,-34],[-17,-15],[-26,-58],[-37,-34],[-14,-37],[-52,-44],[-48,-54],[-15,-6],[-42,-45],[-4,-14],[-51,-77],[-37,-79],[-72,-183],[-17,-69],[-55,-178],[-26,-72],[-26,-41],[-26,-88],[-11,-11],[-28,-83],[-10,-10],[-61,-134],[-9,-25],[8,-50],[14,-46]],[[24276,71309],[-21,50],[-14,-11],[-3,-29],[-16,-14],[9,-19],[-11,-43],[-22,16],[0,-685],[-10,-10],[-6,-59],[-24,7],[-10,-56],[-14,13],[-8,-38],[-25,-23],[-20,-47],[-20,-148],[-22,-49],[-7,-114],[1,-53],[21,-21],[10,9],[14,-32],[-1,-31],[23,-85],[-1,-50],[-15,-47],[1,-29],[-17,-49],[2,-91],[-4,-32],[6,-91],[-16,-58],[11,-34],[-2,-65],[6,-41],[-7,-42],[3,-75],[-12,-80],[5,-36],[16,-27],[31,-87],[-1,-24],[14,-16],[9,-44],[50,-9],[12,-17],[10,-78],[14,-38],[50,-51],[22,-39],[14,-40],[0,-53],[8,-15],[5,-84],[17,-45],[27,-41],[3,-29],[36,-90],[39,-29],[15,-55],[30,-136],[9,-75],[-8,-113],[2,-71],[10,-37],[-4,-44],[8,-53]],[[24498,67577],[-204,0],[-224,0],[-116,-1],[-223,0],[-180,1],[-313,0],[-199,0]],[[23039,67577],[0,1215],[1,101],[-1,302],[0,479],[-10,65],[-36,59],[-18,4],[-14,55],[-9,73],[-26,98],[5,46],[25,62],[22,39],[12,63],[14,46],[4,128]],[[23008,70412],[-4,106],[6,37],[-11,188],[-1,129],[-13,27],[-20,98],[-5,49],[-4,119],[-11,57],[-2,39],[5,68],[-6,112],[5,17],[6,117],[-6,-11],[-11,51],[1,171],[-5,92],[-2,114],[3,50],[-7,103],[1,217],[-5,3],[-7,89],[-11,92],[-8,17],[-11,101],[-3,58],[-11,34],[-5,121],[-16,101],[-3,110],[7,53],[-8,93],[3,52],[-1,107],[-7,59],[7,76],[9,24],[3,62],[-15,80],[-8,124],[-6,24],[-11,98],[3,40]],[[28860,63072],[14,65]],[[28874,63137],[9,32],[5,61],[12,42]],[[28900,63272],[17,44],[38,25],[25,45],[0,69],[16,25],[7,33],[34,72],[18,15],[12,51],[10,-8],[17,39],[-14,71],[-20,41],[-7,52],[-21,54],[-7,68],[-25,19],[-4,45],[2,95],[-10,37],[-17,-5],[-9,14],[-2,83],[7,30],[-8,22],[9,100],[11,-5],[23,113],[-24,120],[13,48],[18,29],[16,56],[-4,24],[17,35],[11,49],[14,124],[22,69],[16,13]],[[29101,65083],[88,-173],[132,-246],[3,-19],[-20,-187],[-12,-65],[-4,-65],[-6,-22]],[[29282,64306],[-7,-34]],[[29275,64272],[-37,-35],[-4,-84],[-9,-16],[-3,-50]],[[29222,64087],[0,-43],[19,-28],[16,18],[24,-44],[14,-9],[4,44],[4,-90],[-3,-107],[-14,-182],[-13,-247],[-5,-173],[-40,-241],[-11,-48],[-9,-9],[3,-32],[-10,-55],[-20,-63],[-1,-19],[-31,-55],[-32,-108],[-21,-118],[-22,-149],[-20,-60],[-19,-14],[-11,14],[6,88],[15,97],[3,69],[-21,37],[-18,4],[-6,25],[-18,-3],[-7,-36],[-9,24],[-2,47],[-18,37],[-3,30],[-10,-12],[-15,68],[-7,-8],[-18,58],[-10,56],[-19,25],[6,140],[-12,29]],[[28861,63044],[-1,28]],[[28814,58772],[18,-19],[12,-74],[1,-47],[-15,9],[2,45],[-18,86]],[[28734,57762],[8,60],[8,0],[47,86],[15,12],[14,33],[12,2],[16,35],[13,10],[5,74],[11,252],[0,54],[-8,95],[-6,105],[3,-2],[11,-106],[5,-95],[-3,-136],[-15,-286],[-24,-8],[-50,-64],[-43,-78],[-19,-43]],[[27156,59531],[84,-16],[55,-3],[95,-15],[37,4],[114,-21],[48,-2],[170,-2],[279,0],[74,4],[264,0],[106,-1],[0,10],[31,-2],[120,0],[142,0]],[[28775,59487],[2,-58],[17,-245],[16,-158],[23,-156],[35,-271],[-9,14],[-18,146],[-14,80],[-13,11],[-9,174],[-16,155],[-8,23],[3,39],[-5,89],[-10,30],[-4,48],[-25,13],[-1,40],[-13,-20],[6,-61],[16,-48],[11,10],[0,-67],[15,-135],[9,-61],[-1,-26],[11,-75],[0,-47],[-19,64],[1,37],[-13,61],[-3,38],[-12,12],[6,-38],[-3,-28],[14,-39],[-31,25],[-32,118],[-15,12],[19,-97],[10,-17],[6,-52],[-9,-23],[-24,-14],[-21,71],[7,-63],[10,-27],[-7,-14],[-31,45],[-13,5],[-5,29],[-18,24],[23,-73],[21,-23],[-7,-19],[-24,-8],[-13,-62],[-16,-22],[-17,1],[-8,31],[-20,12],[-12,121],[0,61],[12,78],[-5,13],[-14,-76],[-2,-76],[8,-94],[11,-77],[-5,-42],[8,-34],[40,10],[37,47],[9,-49],[13,6],[13,30],[26,24],[32,-1],[14,-41],[0,-43],[-14,-78],[3,-55],[2,-164],[9,5],[7,115],[3,150],[14,40],[-6,33],[14,20],[25,-21],[16,-94],[7,-65],[-4,-52],[7,-98],[-8,-25],[4,-54],[-13,-54],[-17,-10],[-6,18],[-10,-16],[-6,-40],[-10,-9],[-3,-43],[-7,-11],[-7,-71],[-13,-15],[-3,-46],[-17,-25],[-3,-24],[-26,25],[-29,-4],[-26,18],[-5,25],[-10,-14],[-15,45],[-13,115],[31,3],[5,45],[-28,-25],[-12,11],[-9,-33],[9,-57],[6,-86],[-7,0],[-29,47],[-14,-10],[-20,34],[-31,30],[-23,48],[-1,-29],[17,-61],[21,-5],[63,-102],[46,-28],[8,-31],[1,-40],[-7,-56],[-13,-54],[1,-28],[-9,-53],[-15,-42],[-50,-112],[-50,112],[1,-65],[24,-55],[36,-43],[36,80],[13,2],[27,30],[4,62],[11,-14],[3,-66],[8,-31],[18,-5],[-9,75],[20,-29],[2,-85],[-17,-75],[-18,-13],[0,-34],[-11,-20],[-14,-84],[-7,-71],[-17,20],[1,80],[-10,19],[1,-82],[-16,-7],[42,-64],[23,123],[33,120],[24,75],[47,176],[8,-21],[-28,-83],[-26,-96],[-22,-62],[-21,-78],[-18,-82],[-21,-115],[-3,-32],[-4,67],[-35,55],[-39,1],[-60,-38],[-29,-33],[-20,-32],[-32,-81],[-39,-75],[-26,-63],[-37,-113],[-14,-55],[-25,-128],[-14,-111],[-10,-112],[-9,-69],[-4,-69],[-13,7],[-3,34],[-21,21],[-23,9],[-28,-2],[-30,-12],[-35,-42],[-8,-17]],[[28030,56345],[-93,330],[-104,362],[-31,116],[-88,302],[-61,1],[-74,7],[-178,10],[4,135],[-42,199],[-30,-73],[-5,21],[7,48],[-2,53],[-55,13],[-105,16],[-188,29],[-23,-20],[-5,39],[-12,-52],[-7,9],[-20,-27],[-6,5],[-29,-47],[-28,-60],[-7,21],[-91,-99]],[[26419,57669],[9,275],[22,48],[3,-26],[28,4],[22,63],[-5,57],[9,25],[-4,44],[17,62],[13,15],[8,48],[16,8],[15,45],[80,7],[11,50],[22,32],[5,26],[10,-7],[16,48],[4,35],[16,4],[8,40],[21,29],[24,-18],[26,115],[-3,63],[10,30],[15,-36],[20,98],[33,70],[10,-40],[-5,-70],[15,-20],[28,62],[15,93],[15,35],[17,21],[12,-5],[9,33],[19,-12],[4,-50],[15,0],[14,28],[33,200],[21,53],[11,12],[8,-23],[17,0],[-10,74],[7,65],[6,12],[-4,80],[9,60]],[[20923,73979],[188,-1],[322,0],[212,0],[92,0],[193,1],[160,-1],[135,0],[141,1],[256,1],[201,0]],[[23008,70412],[-210,-1],[-186,1],[-119,1],[-252,4],[-192,2],[-179,2],[-253,1],[-123,0],[-292,1],[-173,0],[-105,0]],[[20924,70423],[0,2828],[-1,17],[0,711]],[[23550,60009],[0,-581]],[[23550,59428],[6,-130],[7,-206],[6,-127],[14,-355],[4,-82],[15,-387],[-2,-319],[-3,-261],[-1,-235],[-2,-170],[-2,-417],[-5,-642]],[[23587,56097],[-9,-25],[-19,73],[-16,-13],[-1,23],[-17,-1],[-18,79],[-15,-16],[-12,5],[-21,78],[-7,58],[-22,2],[-23,85],[-27,28],[-7,-68],[-11,-32],[-13,-7],[-34,4],[0,15],[-21,-7],[-7,61],[-10,3],[-24,-52],[-20,3],[1,-45],[-13,9],[-9,-31],[-29,61],[-1,-30],[-30,-29],[-15,13],[1,-20],[-14,8],[-8,-90],[-14,-14],[-19,19],[-7,-81],[-12,-3],[-1,22],[-17,79],[-21,-6],[-8,57],[-11,-4],[-16,30],[12,58],[-25,16],[-8,-86],[-18,-9],[-4,42],[-13,14],[-6,-33],[-9,25],[-6,95],[-5,11],[-14,-27],[-6,15],[3,-73],[-16,-57],[-13,19],[11,-42],[-13,-22],[3,-64],[-11,-31],[-11,14],[-12,94],[10,30],[-2,66],[-9,28],[-10,-19],[-2,-42],[-13,19],[-9,-7],[-11,-64],[-20,5],[-5,30],[1,63],[-12,19],[-16,-27],[-11,25],[3,41],[-19,42],[-9,-3],[-12,-58],[-29,-92],[-12,-9],[-16,34],[-9,3],[4,65],[-5,-1],[7,60],[-7,20],[-13,-14],[-19,11],[-10,91],[8,35],[-4,50],[-17,-47],[-20,22],[-15,0],[-19,28],[-11,-40],[-3,-44],[-20,-26],[-24,96],[-21,23],[-12,-37],[-21,4],[-13,26],[-13,3],[-17,24],[-19,46],[-16,-27],[-9,15],[-12,-11],[-2,20],[-18,-3],[-5,140],[-18,56],[4,22],[-16,5],[-18,57],[-4,-92],[-12,-4],[-22,47],[-17,2],[-6,-49],[-30,15],[-24,78],[-37,143],[-20,-19],[0,2257],[-123,0],[-179,0],[-150,0],[-175,1],[-210,0]],[[21214,59429],[1,119],[0,463]],[[27478,65805],[48,61],[45,74],[9,24],[10,60],[13,3],[3,-28],[36,72],[47,74]],[[27689,66145],[0,-314],[1,-2],[247,-1],[77,3],[167,-2],[243,1],[105,3],[111,-4],[169,-1],[107,2],[14,-59],[5,4],[8,-100],[15,4],[27,-34],[10,-49],[-8,-32],[14,-21],[2,-159],[-8,-12],[25,-113],[1,-34],[11,5],[15,-33],[-2,-18],[25,3],[3,-22],[16,8],[-1,-30],[13,-55]],[[28900,63272],[-23,37],[-22,6],[-24,-20],[-15,-34],[-20,-82]],[[28796,63179],[-217,-1],[-118,-1],[-151,0],[-236,3],[-305,-2]],[[27769,63178],[-167,0],[-124,0],[0,1068]],[[27478,64246],[0,1559]],[[20920,69320],[5,4],[0,872],[-1,227]],[[23039,67577],[-40,0],[5,-22],[-7,-37],[22,-64],[-1,-110],[-14,-5],[8,-52],[-3,-31],[24,-3],[2,-83],[9,-35],[-7,-66],[-14,-16],[5,-56],[-8,-28],[6,-21],[-12,-46],[0,-80],[-11,-16],[-3,-52],[-11,-26],[1,-76],[15,-27],[17,-60],[10,-87],[-4,-45],[13,-31]],[[23041,66402],[-17,-7],[-5,30],[-24,-5],[-7,53],[-21,66],[7,52],[-11,16],[-21,3],[-1,40],[-28,35],[-12,-17],[-8,48],[-43,13],[-5,28],[-18,20],[-1,38],[-25,25],[-15,-14],[-15,13],[-7,-23],[-18,14],[-16,-13],[-16,11],[-18,-17],[-25,9],[-20,21],[-8,-11],[-9,-74],[-12,-29],[-19,-9],[-31,69],[-36,62],[-58,85],[-9,59],[-112,0],[-186,-1],[-153,1],[-214,-1],[-206,-2],[-62,4],[-178,0],[-143,1],[-293,1]],[[20922,66996],[0,345],[-1,8],[0,1828],[-1,143]],[[23587,56097],[8,8],[0,-54],[11,-25],[9,6],[-2,-36],[10,-9],[5,27],[8,-18],[3,29],[21,-27],[11,46],[12,-17],[5,-30],[6,21],[16,-22]],[[23710,55996],[0,0]],[[23710,55996],[1,-11],[0,-608]],[[23711,55377],[0,-1196],[8,-12],[11,-72],[18,-31],[9,-83],[15,-55],[-2,-34],[8,-56],[-7,-42],[3,-45],[-7,-28],[6,-51],[9,-32],[13,-6],[3,-35],[-6,-27],[14,-36],[-1,-32],[8,-15],[3,-49],[-6,-53],[12,-47],[6,2],[6,-113],[19,12],[-6,-102],[8,-31],[2,-54],[-13,-21],[-1,-33],[12,-55],[-9,-22],[-3,-38],[4,-63],[-9,-33],[-9,-63],[-3,-73],[-12,-25],[-2,-68],[-14,-30],[-3,-40],[7,-24],[5,-91],[-13,-51],[-6,-74],[16,-52],[1,-53],[-5,-39],[9,-79],[-12,-70],[9,-19],[-11,-51],[-14,-39],[-7,-78],[-13,-74],[-17,-45],[-2,-25],[9,-30],[17,-94]],[[23768,51502],[0,-14],[-46,3],[-37,-40],[-128,-208],[-28,-61],[-10,-54],[-15,7],[22,71],[9,47],[13,-1],[9,19],[8,46],[9,-16],[11,8],[-15,55],[-54,-54],[-8,26],[17,90],[4,80],[0,74],[-12,5],[-5,23],[-17,-29],[-10,-41],[-4,-50],[-15,-24],[-6,46],[-18,-45],[-2,-35],[9,-32],[-10,-50],[10,-55],[20,-17],[-6,-54],[11,-20],[2,-78],[-2,-67],[-8,-31],[-9,10],[-19,-71],[-22,-65],[-3,26],[-13,-8],[-2,-88],[6,-26],[13,44],[26,65],[3,19],[32,99],[15,23],[0,45],[26,-15],[-20,-61],[-62,-153],[-24,-69],[-4,-25],[-32,-91],[-40,-143],[-15,-8],[-69,-146],[-35,-80],[-53,-89],[-61,-112],[-34,-87],[-13,-42],[-15,-74],[-53,-111],[-24,-68],[-47,-155],[-32,-143],[-11,-83],[-14,-59],[-33,-221],[-24,-197],[-11,-127],[-10,-192],[-2,-108],[1,-103],[8,-205],[14,-207],[12,-134],[16,-229],[11,-260],[-7,47],[-5,147],[-12,189],[-11,152],[-24,16],[18,27],[-9,83],[-6,87],[-9,88],[-3,106],[1,138],[-1,122],[11,276],[16,180],[19,148],[14,70],[10,87],[8,35],[-2,47],[13,86],[18,38],[9,45],[18,127],[28,58],[8,53],[16,2],[35,105],[23,49],[24,23],[-4,43],[9,29],[-9,16],[-16,-41],[-20,-35],[-11,-40],[-17,-5],[-6,40],[0,60],[-18,12],[-6,-31],[0,-84],[-5,-25],[6,-41],[-4,-36],[-20,-56],[-17,-61],[-8,-1],[-18,30],[-3,43],[-32,-61],[-17,-67],[21,-22],[24,57],[8,-74],[-7,-23],[-38,-223],[-12,-2],[-6,55],[-21,-10],[-4,18],[-32,-11],[-11,12],[-6,-38],[12,-32],[15,-1],[11,17],[-4,-64],[7,-48],[15,-34],[17,-18],[-19,-146],[-13,-185],[-12,-106],[-20,-27],[-7,-27],[-11,18],[14,21],[3,59],[-8,3],[-6,-31],[-29,-75],[4,-32],[24,-16],[25,38],[8,2],[-5,-116],[3,-4],[-4,-202],[-6,-207],[-4,-3],[10,-230],[8,-65],[1,-84],[9,-1],[23,-215],[5,-29],[-9,-47],[4,-34],[-1,-62],[8,-72],[20,-11],[1,-35],[12,18],[2,-127],[-23,7],[-13,-8],[0,-19],[-21,-12],[-6,-99],[-20,11],[-7,40],[-15,3],[-6,55],[-11,4],[-18,98],[-31,12],[-11,33],[-17,-9],[-7,16],[-23,-17],[-4,18],[-13,-1],[-3,-29],[-10,31],[-20,-14],[-8,22],[-6,-22],[-14,20],[-8,30],[3,25],[-16,1],[-3,44],[-15,-1],[-21,75],[-9,-11],[-25,48],[-19,-22],[-13,35],[-15,69],[-10,8],[-2,33],[-8,12],[-18,-15],[-21,47],[-12,-3],[-8,20],[-12,-19],[-9,44],[6,50],[-10,56],[-11,13],[-3,98],[-6,42],[-3,79],[-8,25],[-1,49],[-7,64],[-17,43],[2,31],[-13,26],[-7,37],[5,20],[-11,46],[-9,7],[-1,52],[6,31],[-3,66],[4,29],[-4,86],[-16,25],[1,37],[-12,11],[9,30],[5,86],[-3,31],[4,60],[-13,10],[5,76],[-12,58],[-7,-14],[-7,46],[-9,-18],[-9,39],[-10,-6],[-18,90],[-9,11],[-3,38],[-8,-9],[-10,38],[0,50],[-7,26],[3,41],[-13,48],[2,47],[-17,16],[-7,81],[-10,23],[-8,70],[-35,53],[-4,53],[-7,-2],[-13,59],[2,38],[-17,100],[3,47],[-9,39],[9,29],[-12,11],[-9,47],[4,39],[-14,28],[1,33],[-15,28],[-4,51],[2,41],[-8,26],[-4,73],[-6,1],[-9,88],[-8,1],[-6,47],[1,76],[-7,106],[-18,46],[-10,40],[3,14],[-9,71],[-23,41],[-2,30],[-17,46],[-18,25],[-13,84],[0,21],[-26,21],[-6,44],[-23,7],[3,57],[-2,65],[-5,5],[-6,-67],[-6,27],[2,53],[-17,27],[-13,108],[-8,-4],[-9,32],[-13,-25],[-7,44],[-8,-27],[-37,-13],[-19,31],[-6,-8],[-15,22],[-22,-14],[-12,24],[-17,-7],[-4,-22],[-26,21],[-11,50],[-13,-3],[-20,40],[-14,-18],[-10,-111],[-34,19],[-9,-37],[-7,11],[-22,-32],[-7,10],[-8,-54],[2,-23],[-13,-40],[0,-50],[-7,0],[-2,-59],[-11,-30],[1,-33],[-7,-58],[2,-52],[-5,-48],[-10,-5],[-3,-72],[-5,-37],[10,-22],[-5,-38],[-18,-38],[-10,8],[-7,-67],[-17,-43],[-7,-36],[-4,-84],[-14,-8],[-17,15],[-15,-11],[-14,46],[-27,24],[-27,111],[-24,33],[-10,-8],[-22,38],[-18,77],[-13,24],[-39,21],[-17,28],[-19,61],[-11,12],[-19,81],[0,24],[-14,47],[-21,7],[-12,27],[-5,34],[-30,78],[-9,43],[-7,110],[-12,56],[-7,60],[-13,63],[0,59],[-7,57],[6,72],[-3,54],[2,55],[-7,68],[-11,30],[-3,44],[-13,39],[-1,30],[-13,34],[2,33],[-13,177],[-7,40],[-12,4],[-11,91],[-15,0],[-14,66],[-12,10],[-3,24],[-15,34],[-12,-4],[-7,28],[-31,39],[0,39],[-44,118],[-13,107],[-12,37],[-18,26],[-9,33],[-9,2],[-2,36],[-24,106],[-20,35],[-4,54],[-14,32],[-21,7],[-35,78],[-11,88],[-10,24],[-6,68],[-13,89],[-9,41],[-19,38],[-11,-19],[-11,41]],[[20232,53938],[-5,28],[-16,20],[1,23],[-10,25],[-3,38],[7,18],[1,101],[331,0],[250,-1],[226,0],[183,1],[0,1212],[2,254],[0,149],[2,417],[2,232],[0,1518],[1,434],[0,809],[-1,213],[11,0]],[[20922,66996],[0,-2328]],[[19530,64667],[-136,-2],[-143,-1],[-52,-3],[-133,1],[-93,2],[0,442],[1,219],[-1,508]],[[18973,65833],[0,676],[1,163],[0,1090],[-1,26],[0,516],[-1,267],[1,140]],[[18973,68711],[-2,175],[-1,282],[1,156],[75,2],[22,-12],[85,2],[11,8],[45,-5],[25,8],[87,-2],[194,5],[11,-7],[221,0],[316,0],[14,-4],[144,-2],[178,-1],[23,7],[132,0],[251,-2],[115,-1]],[[29908,65840],[0,-107],[3,-222],[0,-150],[-3,-209],[-12,-8],[3,-76],[-8,-29]],[[29891,65039],[-7,19],[-17,2],[-21,-24],[-18,3],[-13,-24],[-16,28],[-6,-37],[-49,-35],[-3,20],[-15,0],[-27,-33],[-6,21],[-26,1],[-7,-26],[-18,23],[-40,-27],[-3,60],[-9,-17],[-19,-82],[-12,0],[-22,-73],[-13,23],[-24,-58],[-7,13],[-23,-28],[5,-22],[-10,-32],[-29,-11],[-22,-54],[-9,15],[-15,-35]],[[29390,64649],[1,33],[-20,102],[68,130],[-19,97],[4,161],[5,295],[9,422]],[[23231,64184],[167,-9],[159,-8],[156,3],[130,8],[62,0],[197,12],[152,13],[101,14],[12,-38],[1,-33],[18,-14],[-1,-36],[16,-57],[10,-2],[1,-56],[11,-31],[19,-7]],[[24442,63943],[-8,-18],[-17,-144],[-2,-71],[6,-165],[14,-99],[7,-28],[-8,-66],[5,-38],[15,-34],[4,-28],[-3,-61],[26,-77],[15,-57],[11,-14],[10,-69],[13,-8],[11,-76],[16,-54],[59,-137],[20,-90],[3,-90],[8,-78],[-9,-36],[11,-85],[3,-65],[22,-69],[11,7],[11,32],[9,66],[19,4],[27,-45],[16,-5],[38,-82],[-2,-60],[-12,-29],[-13,-59],[10,-92],[-2,-37],[-22,-96],[-6,-99],[-17,-68],[-7,-52],[-1,-78],[5,-70],[18,-50],[20,-89],[25,-37],[11,-54],[8,0],[17,-60],[16,7],[3,-27],[-12,-24],[6,-50],[20,-5],[10,31],[13,-28],[1,-29],[15,-12],[23,-70],[-2,-40],[14,-3],[9,-42],[19,-24],[0,-57],[11,-68],[-13,-8],[2,-50],[26,-161],[-4,-62],[-15,-12],[-8,-56],[17,-53],[-1,-47],[13,-87],[11,-46],[-1,-53],[24,-56],[10,27],[-15,45],[14,12],[17,-56],[8,-53],[11,14]],[[25079,59990],[9,-21],[-5,-90],[-6,-46],[-10,-9],[-1,-38],[17,-37],[-3,-28],[-16,3],[-4,-44],[11,-58],[-8,-29],[-7,-71],[-13,-18],[-18,78],[-13,-13],[-13,-142]],[[24999,59427],[-8,-40],[-13,7],[2,31]],[[24980,59425],[6,38],[-5,49],[-21,2],[-4,-30],[9,-58]],[[24965,59426],[6,-22],[-7,-64],[10,-59],[-5,-37],[-24,-1],[0,-37],[21,-39],[1,-27],[-15,-15],[-30,16],[-3,-21],[28,-74],[1,-61],[-22,-40],[-3,-75],[-12,-23]],[[24911,58847],[-179,-6],[16,110],[23,58],[0,23],[15,53],[16,28],[3,43],[9,7],[5,133],[-22,44],[3,15],[-5,71],[-349,-1],[-323,1],[-141,0],[-222,1],[-210,1]],[[23358,63503],[-31,56],[8,79],[-24,76],[-2,77],[-20,19],[1,32],[-18,26],[-12,110],[1,39],[-11,34],[-1,40],[13,42],[-11,18],[-1,-33],[-20,3],[1,63]],[[26900,61666],[18,-20],[35,40],[23,11],[5,49],[3,98],[12,28],[16,-7],[6,30],[-3,101],[-10,105],[21,52],[0,67],[14,88],[12,27],[6,37],[13,-40],[11,-1],[12,-79],[-8,-40],[11,-20],[9,22],[3,42],[9,20],[9,-25],[4,111],[-10,29],[-3,43],[19,19],[-3,96],[8,41],[10,12],[3,55],[31,-7],[3,83],[25,76],[17,-19],[6,-52],[11,3],[21,47],[17,8],[11,54],[11,8],[8,48],[16,57],[30,89],[16,9],[4,83],[10,26],[-11,50],[12,48],[0,57],[10,23],[-4,60],[13,-11],[-2,52],[7,20],[0,122],[9,30],[0,58],[10,48],[5,61],[10,23],[5,65],[-3,95],[4,71],[-9,84],[-11,44],[9,50],[14,-1],[18,27]],[[27769,63178],[-3,-600],[10,7],[33,103],[12,-1],[10,67],[31,60],[13,75],[11,-2],[28,-36],[11,54],[38,158],[13,-10],[-13,-14],[13,-18],[2,-26],[20,-34],[17,1],[7,-18],[28,-4],[14,38],[-7,49],[13,-1],[-11,32],[14,-11],[9,37],[19,-23],[28,87],[24,-20],[17,-49],[8,-40],[18,20],[17,-23],[14,4],[0,-37],[-16,-15],[12,-69],[19,-41],[-2,-33],[9,-12],[5,-43],[-6,-63],[10,-14]],[[28258,62713],[-9,-45],[-21,-175],[-78,209],[-66,179],[-4,-62],[5,-28],[-6,-36],[7,-11],[-23,-106],[6,-15],[-11,-54],[10,-36],[-16,-62],[-7,-7],[-24,-88],[6,-16],[-14,-63],[-7,21],[-15,-66],[-10,-24],[0,36],[-23,-71],[-20,-130],[-35,101],[-9,-69],[-17,-82],[-1,-71],[-8,1],[-10,-57],[-15,-138],[-28,-94],[-46,53],[-17,109],[-31,47],[-14,-121],[3,-65],[-12,-60],[-22,-87],[6,-44],[-12,-21],[-25,-81],[-7,-56],[6,-29],[-8,-30],[-6,-60],[-10,-51],[-18,-51],[-30,-104],[-21,-112],[2,-36],[-12,-39],[4,-41],[17,-34],[-12,-40],[-18,-34],[-1,-32],[13,-4],[-4,-29],[-49,-99],[-10,68],[-12,-9],[-19,-47],[-41,-71],[-4,26],[-21,38],[-7,-51],[9,-43],[-19,-47],[-17,-5],[-37,-27],[-31,-51],[-27,75],[-11,45],[-8,-21],[-8,-55],[-23,-17],[-2,-30],[-13,-29],[-34,-7],[-19,48],[0,24],[-12,25],[-18,3],[-7,52],[-14,31],[-2,90],[-15,22],[-1,33],[18,34],[-11,29]],[[27075,60636],[-14,-4],[-28,30],[-3,37],[-8,1],[-7,40],[-9,-2],[-7,42],[-15,11],[-13,134],[-10,19],[-13,61],[1,34],[-15,19],[-8,39],[11,55],[-15,22],[-9,80],[-10,45],[-15,37],[0,38],[8,0],[3,55],[-4,20],[11,33],[1,58],[-8,36],[1,90]],[[24442,63943],[12,16],[-2,50],[4,90],[-11,35],[13,69],[31,43],[18,-1],[18,41],[1,61],[6,49],[1,67],[10,27],[14,66],[11,19],[6,106],[-1,98],[-13,75],[-13,6],[-20,85],[11,77],[2,74],[6,55],[19,21],[13,-15],[23,40],[31,-6],[24,17],[16,56],[10,13],[26,-1],[18,57],[16,21],[-1,66],[9,59],[0,52],[9,29],[28,49],[-1,41],[8,72],[-3,58],[7,61],[-7,37],[1,89],[-13,41],[-47,73],[-15,74],[3,60],[-16,63],[-22,37],[-2,26],[-22,35],[0,47]],[[24658,66423],[45,-2],[227,-2],[51,-5],[194,-11],[41,4],[152,1],[82,-5]],[[25450,66403],[-2,-124],[-8,-97],[10,-109],[21,-117],[12,-37],[3,-54],[13,-139],[4,-75],[14,-93],[8,-20],[2,-47]],[[25386,60941],[-8,-66],[-17,-35],[-11,-56],[7,-105],[20,-68],[-6,-50],[-48,-19],[-12,-11],[-18,-52],[-14,26],[-18,-44],[-2,-55],[-9,-65],[2,-25],[17,-65],[7,-66],[-10,-89],[-15,-10],[-13,13],[-19,52],[-35,40],[-14,39],[-31,42],[-19,5],[-13,-21],[-13,-42],[-9,-65],[-16,-52],[-4,-55],[14,-52]],[[20232,53938],[-214,0],[-254,0],[0,-524],[-234,-1]],[[24911,58847],[4,-38],[18,-49],[0,-45],[-24,23],[-9,-49],[20,-36],[-11,-33],[-11,-1],[-9,-52],[-17,-22],[-9,21],[-15,-41],[6,-68],[9,-17],[12,23],[3,-38],[-26,-42],[1,-53],[9,-10],[-3,-40],[-22,56],[-9,-9],[-5,-58],[9,-42],[-11,-75],[-8,88],[-23,-67],[-3,-46],[12,-6],[2,43],[15,-35],[-9,-47],[0,-45],[-16,-10],[4,-47],[15,-7],[6,-29],[-12,-43],[15,-58],[-10,-25],[-12,21],[-9,-26],[-9,-100],[-25,13],[-3,-49]],[[24751,57677],[17,-55],[0,-45],[-18,-44],[-31,-44],[-4,59],[-11,2],[-2,-29],[8,-44],[-5,-25],[6,-72],[-14,-19],[-5,34],[2,57],[-10,-27],[2,-35],[-7,-14],[6,-40],[20,-2],[2,-31],[-14,-50],[-11,18],[1,49],[-10,-21],[0,-64],[12,-61],[1,-27],[-13,-51],[6,-83],[-25,-57],[0,-63],[-10,1],[3,54],[-19,-1],[-5,-27],[8,-45],[-7,-30],[-19,-15],[-4,-71],[-16,43],[-9,-29],[14,-43],[20,1],[2,-25],[-13,-28],[-16,33],[-12,-32],[9,-51],[11,3],[3,-24],[-8,-61],[-24,-6],[7,-45],[-11,-16],[-5,43],[-16,-23],[-3,-29],[22,-34],[-18,-78],[7,-55],[16,-26],[-10,-34],[-8,18],[-24,-2],[-1,-59],[10,-26],[13,14],[8,-50],[-12,-18],[-16,22],[-7,35],[-17,-16],[-2,-28],[25,-51],[2,-33],[-28,-41],[13,-63],[-14,-80],[18,16],[-1,51],[14,-27],[-4,-54],[-17,-10],[-3,-19],[10,-24],[17,14],[10,73],[5,-32],[-23,-90],[0,-64],[12,-68],[3,42],[10,13],[2,-23],[-13,-52],[2,-75],[-3,-23],[-14,-8],[-11,14],[-5,-39],[23,-62],[-13,-59]],[[24512,55359],[-219,4],[-154,5],[-157,7],[-86,0],[-185,2]],[[16868,55911],[16,-5],[28,-53],[21,-22],[1,-25],[16,-61],[-5,-43],[-13,25],[-26,7],[-6,35],[0,74],[-20,16],[-12,52]],[[16867,55390],[9,4],[22,-117],[40,-130],[-10,4],[-11,-22],[-17,44],[-13,72],[-14,119],[-6,26]],[[16741,55926],[8,7],[1,-41],[-11,7],[2,27]],[[16637,56552],[8,-17],[11,14],[0,-30],[-17,-4],[-9,21],[7,16]],[[16596,55679],[14,7],[20,-35],[8,-31],[-13,-15],[-20,21],[-9,53]],[[16501,56608],[18,-7],[13,-22],[15,5],[19,-43],[19,-4],[7,39],[20,-20],[-11,-43],[-28,-11],[-17,-31],[-42,24],[-1,61],[-12,52]],[[16410,56520],[22,8],[9,21],[13,-8],[13,19],[0,-48],[18,-13],[1,-48],[-41,-54],[-16,37],[-19,86]],[[16354,56562],[16,17],[6,28],[6,-35],[13,-26],[-21,-6],[-20,22]],[[15305,65829],[155,-4],[9,6],[77,-1],[56,12],[28,-8],[115,2],[37,5],[95,-1],[45,-5],[154,-8],[114,-4],[197,0],[92,2]],[[16479,65825],[0,-1]],[[16479,65824],[0,-1448],[1,-34],[0,-756],[-1,-393],[-1,-13],[0,-457],[-1,-122],[2,-263],[26,-77],[115,-330],[114,-336],[63,-182],[99,-298],[125,-377],[62,-186],[127,-394],[313,-989],[234,-759],[70,-234],[147,-492]],[[17950,55027],[-416,-126],[-254,-89],[-3,98],[-9,62],[-8,20],[-14,-23],[-3,66],[1,71],[-8,41],[9,61],[-9,161],[-13,127],[-9,54],[-40,193],[-25,61],[-10,51],[-15,37],[-9,-2],[-19,95],[-26,59],[-14,15],[-20,57],[-25,88],[-24,39],[-2,-47],[-21,-23],[-18,14],[-10,25],[-15,6],[-4,38],[9,34],[1,43],[-14,116],[-11,64],[-17,50],[-35,1],[-22,-8],[-16,-36],[-14,38],[-28,16],[-37,59],[-12,2],[-24,53],[-17,141],[-10,10],[-17,53],[-4,-3],[-20,65],[-21,25],[-6,20],[-32,4],[-16,-24],[-18,25],[-22,-10],[-37,60],[-23,0],[-15,15],[-44,-7],[-48,-22],[-1,31],[-13,66],[-16,30],[-12,-4],[-6,32],[13,143],[-11,60],[8,119],[-17,54],[9,115],[1,140],[-18,56],[-14,7],[-3,-21],[-27,55],[-11,48],[10,131],[-2,50],[-11,53],[-27,14],[-27,102],[-18,101],[-24,25],[-17,66],[-5,81],[-16,47],[-7,37],[-14,35],[-6,99],[-5,35],[-20,29],[-15,104],[-25,94],[-33,64],[-11,45],[-8,80],[1,42],[-11,101],[2,92],[-11,16],[10,74],[18,-38],[9,30],[7,61],[8,141],[-21,149],[-12,43],[-10,11],[-9,-28],[-37,2],[-28,68],[-22,102],[-14,18],[-2,31],[-17,60],[-4,62],[5,129],[-12,89],[-2,52],[-12,14],[-6,33],[-1,64],[5,27],[2,77],[-6,134],[14,28],[16,8],[6,-24],[7,-88],[-9,-9],[11,-107],[-2,-27],[27,-23],[27,-80],[8,5],[14,-63],[12,3],[-6,40],[-12,19],[-10,87],[-7,109],[-21,54],[-2,46],[-22,26],[9,74],[-7,68],[-15,-1],[-14,68],[8,-9],[9,26],[0,40],[19,-2],[10,39],[-10,71],[-26,44],[-13,-30],[-14,-6],[2,-47],[-5,-46],[15,-51],[-12,-25],[-4,-44],[19,-56],[-7,-14],[-11,29],[7,-71],[-15,-16],[-9,38],[-26,61],[-13,-12],[-23,67],[-10,53],[-17,33],[-16,8],[-20,-33],[14,127],[3,48],[-12,92],[7,20],[-16,70],[-11,-10],[-1,67],[-17,106],[-20,51],[-14,19],[-22,64],[-37,176],[-14,29],[-8,41],[-31,90],[-24,116],[14,78],[-1,42],[-14,126],[-16,123],[-7,105],[3,99],[13,132],[-5,52],[0,65],[-14,92],[-4,108],[-16,36],[-6,55],[-35,133],[-7,6],[0,43],[-8,43],[-22,32],[-49,151],[4,63],[-4,70],[-13,74],[9,98],[14,109],[42,265],[11,95],[7,119],[-12,37],[-1,97],[4,2],[11,99],[12,244],[-5,126],[-15,128],[-8,96],[-9,-4],[-17,54],[10,74],[5,110],[-3,67]],[[28861,63044],[-1,28]],[[28874,63137],[-6,7],[-22,-81],[2,-39],[11,-31],[1,-49],[-8,-28],[0,-41],[14,-52],[7,-58],[21,-62],[10,-68],[3,-58],[-5,-35],[2,-126],[16,-48],[7,-43],[2,-74],[34,-137],[16,-29],[10,24],[4,-36],[5,-129],[4,-244]],[[29002,61700],[-105,1],[-74,9],[-2,72],[-25,1311],[0,86]],[[28426,62262],[21,70],[37,-118],[-36,-118]],[[28448,62096],[0,93],[-22,73]],[[6433,39922],[2,44],[19,76],[12,7],[13,93],[16,52],[3,58],[-17,94],[-4,45],[-1,105],[8,37],[18,-9],[18,-32],[3,-32],[22,-44],[15,-47],[12,6],[25,-32],[39,-77],[13,-19],[22,-61],[16,-57],[17,-76],[-3,-47],[1,-90],[8,-10],[16,12],[7,-57],[-1,-57],[22,-82],[22,-39],[5,-21],[-4,-44],[-13,-51],[-17,-47],[-14,-56],[-23,-38],[-20,-47],[-20,-18],[-16,15],[-9,-9],[-18,-66],[-16,-25],[-13,-48],[-14,-16],[-12,-59],[1,-33],[-8,-37],[-5,-59],[-20,-63],[-15,61],[-22,52],[-22,29],[-10,95],[5,113],[4,151],[-10,106],[1,46],[-9,12],[-5,114],[-7,66],[-9,8],[-8,108]],[[6254,41293],[5,69],[11,56],[14,6],[13,-33],[10,-78],[10,-50],[24,29],[18,35],[26,-21],[0,-16],[17,-51],[10,-15],[5,-40],[31,-37],[5,-32],[0,-52],[-8,-43],[-13,-40],[-6,3],[-17,-36],[-14,10],[-30,-53],[-21,-9],[-17,26],[-7,210],[-7,20],[-14,-24],[-26,50],[-13,58],[-6,58]],[[6253,40841],[7,29],[28,57],[10,-30],[-4,-44],[5,-17],[-13,-19],[-5,15],[-18,-23],[-10,32]],[[6153,41274],[7,27],[13,5],[26,-19],[17,-60],[8,-51],[-9,-65],[-19,-29],[-17,-5],[-7,60],[-3,73],[-14,32],[-2,32]],[[6084,41504],[6,52],[9,29],[-2,58],[17,-2],[3,-14],[54,-29],[10,34],[4,-42],[22,-13],[27,18],[17,-25],[-8,-55],[-18,-51],[-20,-21],[-35,32],[-26,31],[-15,-14],[-29,-5],[-16,17]],[[5814,42059],[43,9],[13,49],[4,35],[13,48],[14,15],[6,-27],[6,-70],[20,-84],[4,-52],[-4,-15],[3,-47],[18,-55],[3,57],[12,-2],[-4,-64],[8,-24],[-1,-29],[17,-70],[-12,-37],[-11,18],[-21,-29],[-6,26],[-17,31],[-25,11],[-30,-20],[-7,4],[-7,84],[-11,34],[-1,31],[-14,67],[0,61],[-13,45]],[[5394,42585],[1,40],[11,38],[4,49],[33,72],[8,26],[23,-18],[3,25],[16,-11],[8,14],[15,-20],[10,-37],[5,-45],[0,-46],[-11,-63],[1,-106],[-4,-28],[-28,-78],[-8,15],[-36,12],[-18,71],[-24,29],[-9,61]],[[5266,42374],[4,43],[12,44],[19,45],[2,38],[11,9],[2,-31],[-5,-57],[2,-36],[-20,-28],[-16,-97],[-12,30],[1,40]],[[24498,67577],[-5,-52],[10,-50],[-1,-74],[27,-41],[13,-76],[-18,-60],[-6,-52],[-9,-24],[1,-108],[8,-88],[0,-68],[12,-25],[13,-169],[33,-64],[47,-37],[17,-20],[18,-109],[0,-37]],[[23231,64184],[4,28],[-10,56],[-13,16],[-15,58],[2,37],[13,35],[-4,83],[10,51],[-7,27],[2,66],[-9,20],[1,42],[-7,30],[5,27],[-5,93],[12,17],[-24,24],[4,37],[-5,63],[13,41],[-20,27],[7,29],[-1,116],[-20,10],[2,77],[-9,1],[-2,-37],[-15,28],[3,56],[-11,39],[7,39],[-8,41],[11,18],[-6,54],[8,20],[3,46],[-12,23],[-1,38],[-14,61],[6,11],[3,66],[-16,6],[1,30],[-15,11],[5,16],[-15,25],[1,83],[-22,56],[-3,48],[10,25],[-14,103],[-11,29],[0,76],[9,44],[-4,44],[-14,8]],[[26280,62461],[18,48],[7,-2],[15,-54],[21,-28],[14,29],[14,-3],[8,29],[8,-8],[4,-69],[29,-32],[10,-84],[16,-83],[0,-66],[5,-26],[40,-41],[33,19],[29,-46],[3,-34],[15,-26],[5,-50],[28,-29],[14,66],[26,22],[15,-32],[28,-20],[11,-24],[5,-43],[13,24],[30,-1],[10,53],[18,34],[9,39],[15,0],[21,32],[7,-33],[-3,-44],[9,-111],[13,-37],[21,-6],[21,-79],[13,-35],[2,-44]],[[27075,60636],[-108,-317],[-37,-39],[-22,-41],[-19,-49],[-25,-45],[0,-86],[-16,-39],[-12,-2],[-12,-33],[3,-59],[-6,-45],[-25,-36],[-29,-4],[-16,-80],[-2,-50],[-16,-4],[-33,-35],[-39,-52],[-21,2],[-33,-49],[-8,-27]],[[26599,59546],[-4,-21],[-83,8],[-79,2],[-76,5],[-83,11],[-51,16],[-74,9],[-55,-14],[-96,8],[-56,10],[-83,22],[-49,4],[-16,-22],[-7,22],[-146,-12],[-92,-2],[-114,-8],[1,35],[-61,17],[10,-147],[-6,-64],[-137,6],[-126,0],[-84,6],[-33,-10]],[[24980,59425],[-15,1]],[[28739,61120],[-14,0]],[[28725,61120],[-1,72],[8,28],[11,-40],[-4,-60]],[[28711,61320],[2,79],[11,13],[7,-30],[5,-118],[-15,21],[4,27],[-14,8]],[[28627,62072],[5,20],[5,-46],[-10,26]],[[29002,61700],[-1,-43],[-9,-105],[-5,-15],[-20,-211],[-18,-120]],[[28949,61206],[-107,-38],[-6,-55],[-6,4]],[[28830,61117],[-13,30],[-19,-4],[-22,-64],[-9,-1],[-1,67],[7,70],[17,28],[-17,2],[2,45],[11,40],[-21,9],[-12,-33],[-4,28],[5,58],[26,27],[-6,39],[-9,-13],[-4,36],[15,112],[-15,-24],[-7,-47],[0,-60],[-8,-1],[-11,77],[11,9],[-1,53],[-8,10],[-4,-49],[-9,-33],[6,-27],[-9,-62],[-4,29],[-17,-23],[-9,12],[-16,83],[-9,13],[2,43],[-24,151],[20,14],[5,39],[-8,-7],[-9,51],[8,40],[12,22],[6,-25],[12,26],[1,-36],[22,-9],[13,-39],[4,10],[-16,69],[-17,14],[-8,42],[-7,-3],[-16,77],[-5,-28],[-12,20],[-1,-59],[-7,8],[3,101],[18,92],[14,-45],[8,10],[-3,124],[-8,17],[-17,-47],[-12,4],[1,-48],[-12,-17],[4,104],[16,101],[7,-51],[21,-11],[11,31],[-6,54],[11,55],[-16,-9],[-3,-52],[4,-31],[-12,17],[3,63],[-6,59],[-7,14],[16,136],[12,42],[-2,24],[14,25],[7,37],[30,-6],[-11,24],[18,70],[-10,6],[12,122],[-35,-24],[-6,-48],[12,-24],[4,-32],[-12,-14],[-34,-97],[-7,31],[7,54],[-8,28],[0,-44],[-9,-51],[8,-34],[-7,-46],[-6,96],[-15,14],[6,-103],[-8,8],[-6,-42],[12,-22],[-21,-44],[-7,-28],[-13,8],[-2,26],[-22,46],[3,-46],[9,-13],[2,-41],[27,-54],[2,-67],[-5,-25],[13,-48],[-23,-45],[7,-37],[-3,-40],[-9,4],[-7,-55],[6,-53],[-17,-58],[9,-50],[-2,-54],[6,-73],[-2,-89],[7,-65],[22,-80],[8,-62],[-9,-45],[-14,7],[9,-42],[9,22],[8,-14],[-7,-47],[4,-48],[18,-92],[-5,-22],[5,-97],[-9,19],[-11,58],[-8,4],[-5,64],[-8,-9],[-2,-57],[-7,38],[-8,-3],[-5,48],[-12,45],[-23,23],[-35,3],[-8,129],[-8,13],[-4,-31],[10,-68],[-2,-22],[-22,43],[-2,34],[-13,31],[-12,114],[-20,-44],[-33,-56],[-12,27],[-7,115],[11,82],[15,57],[20,30],[-5,10]],[[28423,61914],[-1,45],[7,27],[18,25],[1,85]],[[28426,62262],[-9,37],[-20,6],[-8,17],[1,48],[-26,42],[-34,15],[-6,39],[-10,13],[1,58],[9,18],[7,49],[-23,43],[-6,45],[-15,-1],[-16,25],[-13,-3]],[[26327,70327],[8,17],[9,-60],[65,-63],[-17,-58],[-23,18],[-14,61],[-28,85]],[[26120,70229],[5,40],[7,-20],[-12,-20]],[[26084,70289],[21,-39],[-4,-36],[-19,38],[2,37]],[[26055,70019],[7,48],[3,69],[6,15],[1,57],[18,-7],[-1,-85],[4,-83],[-19,-44],[-19,30]],[[26035,70180],[13,8],[-5,-54],[-7,1],[-1,45]],[[25984,69839],[13,-17],[1,-59],[-14,76]],[[25933,69486],[6,23],[19,-25],[-6,-96],[-17,52],[-2,46]],[[25908,69335],[11,44],[6,-47],[-17,3]],[[25759,70041],[20,-64],[-8,-22],[-4,36],[-14,43],[6,7]],[[25722,65552],[30,68],[27,87],[37,261],[34,146],[19,134],[10,99],[10,176],[-1,58],[6,87],[-1,163],[-6,182],[-11,120],[-35,230],[-11,94],[-12,138],[-17,119],[0,48],[22,102],[7,50],[1,77],[-9,134],[-14,90],[4,32],[20,51],[24,151],[21,112],[4,124],[9,134],[-11,112],[1,33],[27,43],[20,15],[6,93],[-2,74],[10,36],[13,-18],[16,80],[18,-35],[17,13],[8,32],[9,86],[10,16],[15,94],[11,47],[9,-7],[12,35],[3,-39],[-19,-32],[-3,-42],[12,-81],[-23,-81],[13,19],[0,-74],[-6,-7],[-8,-84],[7,-95],[8,-2],[19,145],[3,98],[13,20],[-8,-158],[-15,-44],[-6,-67],[14,-14],[8,65],[7,13],[22,135],[5,78],[-1,56],[4,82],[-6,85],[5,94],[17,49],[10,3],[18,48],[18,16],[25,-7],[26,14],[12,20],[-1,33],[-33,17],[-14,47],[-8,114],[16,75],[13,14],[20,69],[-2,31],[-18,27],[60,-15],[7,49],[61,-102],[26,-58],[13,20],[11,-16],[13,10],[32,-34],[24,-85],[3,-57],[17,-27],[33,4],[8,-9],[29,-77],[23,-7],[34,-71],[29,6],[21,-78],[11,-25],[-9,-27],[15,-96],[11,-30],[14,-133],[-20,21],[-16,34],[-15,-41],[4,-110],[12,-44],[21,-26],[5,-59],[1,-98],[7,-37],[-4,-71],[-8,-67],[2,-65],[-5,-111],[-1,-121],[-12,-15],[-14,-64],[-24,2],[-8,-30],[-8,-108],[-4,-115],[-19,-5],[-8,-19],[0,-49],[-42,-6],[-13,-35],[-9,-76],[-5,-124],[-8,-42],[13,-91],[16,-32],[9,33],[5,-38],[20,-21],[13,-38],[10,16],[28,120],[14,0],[7,25],[-7,51],[9,44],[9,87],[4,-50],[19,31],[5,29],[-21,31],[24,-3],[11,24],[5,41],[23,10],[34,28],[9,45],[31,30],[11,-30],[23,-25],[15,-39],[17,-123],[10,-37],[7,-97],[5,-208],[17,-178],[4,-247],[10,-143],[18,-110],[2,-48],[-11,-46],[-7,-145],[4,-47],[-12,-113],[-4,-67],[-18,-66],[-15,4],[-12,-42],[1,66],[-9,27],[10,16],[15,62],[-14,26],[-15,-5],[-19,-34],[-7,-32],[9,-27],[2,-45],[-15,4],[-11,-52],[1,-84],[-7,-77],[-17,-53],[-30,-25],[-18,-97],[2,-127],[-3,-44],[-15,-25],[-1,-70],[-16,-39],[-6,-39],[-13,-4],[-7,-65],[-11,-11],[-17,-72],[5,-79],[-8,-9]],[[26661,65520],[-86,-11],[-167,-20],[-124,-12]],[[25045,72671],[21,69],[95,141],[7,-2],[43,98],[31,42],[6,-11],[28,29],[-1,-28],[-12,-16],[-30,-80],[0,-30],[-25,-55],[-51,-53],[-42,-66],[2,-20],[23,0],[-59,-73],[-18,3],[-18,52]],[[24721,71146],[19,40],[12,3],[39,49],[38,34],[31,77],[19,64],[16,27],[33,17],[15,-17],[29,27],[22,-3],[52,75],[30,94],[22,5],[29,23],[10,39],[5,51],[25,65],[14,16],[30,82],[23,23],[21,56],[11,54],[20,52],[58,85],[56,25],[50,-7],[23,-39],[1,-45],[-11,5],[-17,-24],[-19,13],[-21,-10],[5,-47],[-32,-57],[-30,-95],[-19,-20],[-5,-74],[-7,9],[-7,-52],[-14,-26],[-5,-67],[-12,-48],[-9,-6],[-12,-164],[6,-52],[-9,-35],[11,3],[20,87],[3,44],[7,-13],[29,80],[28,43],[-12,-55],[-12,-24],[-15,-77],[30,84],[26,18],[14,-13],[37,1],[15,-30],[8,8],[17,-35],[8,-39],[15,11],[22,-63],[3,-61],[17,-49],[6,-47],[14,-49],[19,-15],[-2,-79],[11,-28],[26,-15],[42,10],[25,43],[11,-8],[14,-72],[12,-27],[19,-4],[8,46],[16,-7],[9,-38],[4,69],[-7,53],[16,20],[7,-32],[-6,-56],[17,-26],[26,72],[40,62],[59,110],[11,-21],[61,42],[46,-16],[35,-3],[30,7],[62,85],[24,12],[30,-7],[32,14],[-22,-84],[-2,-135],[2,-45],[-8,-19],[9,-51],[16,-8],[9,16],[6,-26],[15,3],[17,-28],[34,49],[13,-4],[11,-46],[-1,-35],[25,28],[7,-7],[10,65],[19,24],[23,-19],[11,9],[8,39],[27,-5],[5,-30],[-10,-100],[7,-120],[1,-95],[-29,-2],[-8,-65],[15,-12],[5,21],[15,-4],[8,-38],[19,-19],[-13,-40],[24,-75],[12,-1],[20,-45],[8,38],[14,-35],[8,26],[-16,100],[14,-15],[41,13],[12,-15],[14,-91],[16,-31],[-10,-64],[-14,-20],[-27,39],[-31,-16],[-31,42],[-11,-12],[-27,1],[-27,23],[-60,-26],[-13,-28],[-37,69],[-15,48],[-13,-7],[-13,30],[-10,-41],[2,-51],[-15,-32],[1,-45],[9,-63],[-12,-20],[-24,42],[-3,31],[-21,37],[-5,30],[-22,64],[-38,46],[-13,-7],[-33,49],[-18,-5],[-13,23],[-5,-20],[-19,11],[-25,-75],[-17,-73],[-9,-8],[-32,23],[-23,-15],[-8,-22],[2,-34],[-23,37],[-21,17],[-24,-14],[-10,11],[-23,-24],[-13,-42],[-2,-63],[-9,-72],[-14,4],[-7,-39],[-22,-15],[-6,-46],[-13,-3],[0,-45],[-12,-9],[4,-61],[-20,32],[-9,40],[12,27],[1,34],[11,31],[1,40],[13,-4],[15,87],[-3,43],[-12,10],[-18,-75],[-38,24],[3,-51],[-13,-47],[-5,-56],[-30,-31],[-5,-27],[-6,39],[3,55],[-4,67],[-8,32],[-10,-19],[-5,-120],[3,-12],[-31,-55],[-26,-129],[-17,-146],[-19,-65],[-20,-112],[-41,-174],[6,-33]],[[25508,69434],[-19,14],[-8,47],[-13,28],[-2,29],[15,118],[11,48],[-2,34],[-11,25],[-16,-47],[-27,-10]],[[25436,69720],[0,0]],[[25436,69720],[-7,47],[7,24],[-3,38],[13,34],[6,40],[-3,47],[8,69],[-14,75],[12,13],[-8,44],[-13,18],[-6,33],[-24,4],[-9,43],[-21,-18],[-18,45],[17,52],[-7,21],[0,47],[-40,48],[-14,-14],[-24,47],[-12,-15],[-21,21],[-2,25],[-27,-2],[-3,-32],[-14,0],[-4,29],[-17,16],[-12,-13],[-86,142],[-287,231],[1,27],[-28,167],[-27,16],[-10,24]],[[24739,71113],[0,0]],[[24739,71113],[-12,-6],[-6,39]],[[25252,52115],[30,-13],[-14,-20],[-12,9],[-4,24]],[[25179,52148],[16,13],[30,-29],[6,-15],[-24,5],[-28,26]],[[25119,52114],[15,7],[15,31],[-4,-29],[-21,-27],[-5,18]],[[25071,52140],[21,-1],[8,13],[-5,-43],[-10,-7],[-17,26],[3,12]],[[24751,57677],[229,-2],[156,1],[202,1]],[[25284,52292],[-4,-32],[-7,15],[-10,-40],[-18,27],[-13,-15],[-5,30],[-18,7],[-18,-23],[-23,49],[-2,-28],[-21,38],[-22,-3],[-31,-27],[-28,-42],[-30,-33],[4,54],[-10,30],[-14,-27],[9,-17],[1,-40],[-25,-57],[-8,-80],[-9,10],[-13,-16]],[[24969,52072],[-12,0],[-13,50],[-4,66],[0,69],[-15,77],[0,54],[-10,43],[-11,19],[-4,39],[-10,34],[-4,95],[-8,14],[10,88],[-4,36],[7,25],[9,125],[7,19],[-1,45],[7,22],[-7,36],[-165,-2],[-134,-1],[-226,0],[13,21],[7,58],[-16,50],[-1,28],[10,46],[-3,41],[-12,30],[1,38],[18,-7],[17,20],[2,43],[-12,37],[-1,45],[-7,16],[9,39],[4,-50],[8,-29],[9,7],[0,29],[-13,75],[-1,74],[20,18],[12,35],[-4,32],[-18,-13],[-9,30],[5,38],[10,-28],[18,0],[1,106],[11,35],[23,5],[4,18],[-29,11],[7,94],[12,11],[2,-43],[7,-17],[5,28],[-6,21],[24,78],[-2,50],[7,25],[19,14],[0,50],[-19,26],[5,25],[13,-39],[5,36],[12,22],[9,69],[-15,24],[2,-62],[-32,11],[2,79],[27,20],[7,27],[14,-31],[5,42],[-2,53],[12,-8],[16,79],[-4,18],[-6,-40],[-23,17],[0,58],[8,20],[-8,35],[-10,-20],[-23,49],[3,58],[5,1],[17,-48],[10,7],[-5,26],[-21,50],[14,31],[8,37],[-7,37],[-6,-46],[-20,-26],[-6,14],[-3,52],[9,38],[16,33],[2,27],[-31,30],[1,71],[5,37],[21,52],[2,39],[-9,72],[-11,-4],[1,-67],[-14,-26],[-9,22],[3,48],[10,50]],[[17580,73980],[234,-2],[232,3],[190,-5],[190,2],[348,-2],[211,0],[232,2],[328,0],[141,0],[292,0],[227,1],[143,-1],[294,0],[114,0],[167,1]],[[18973,68711],[-21,23],[-6,49],[-24,59],[2,43],[-28,117],[-17,36],[-8,-52],[-20,-3],[5,-33],[-16,-98],[15,-64],[-32,26],[-9,-16],[-24,13],[-3,-19],[-30,-40],[-13,63],[-22,-8],[-13,-25],[-10,13],[-21,-30],[-8,22],[-14,-8],[-12,35],[-16,7],[-9,-35],[-9,0],[-2,-61],[-8,-45],[-24,38],[-8,-20],[-11,24],[-33,2],[-17,22],[-17,-23],[-15,-72],[6,-53],[-9,-22],[-11,44],[-18,24],[-15,40],[-6,53],[5,34],[-21,81],[9,48],[-5,50],[-18,109],[-32,58],[-26,-44],[-4,40],[-28,53],[-11,97],[14,13],[2,55],[-4,61],[-19,39],[2,26],[-17,15],[-7,73],[-24,73],[-1,35],[-14,54],[2,70],[-8,19],[-6,57],[6,30],[-1,46],[-19,0],[7,95],[-15,25],[-12,-2],[2,26],[-10,44],[-15,26],[-9,-13],[2,-41],[-15,-35],[-19,-82],[-19,-26],[-13,12],[-3,-58],[-24,-42],[-5,36],[-14,22],[-13,60],[-25,0],[4,53],[-8,36],[18,37],[1,48],[-19,74],[18,89],[25,1],[7,44],[-13,54],[6,49],[-19,27],[-4,54],[9,58],[-17,33],[2,49],[19,7],[-1,79],[-6,30],[13,24],[1,116],[13,65],[-7,69],[12,3],[10,123],[-3,58],[-8,10],[-26,-23],[-4,-21],[-22,15],[-19,-5],[-8,39],[6,39],[-7,30],[-14,9],[-4,-30],[-15,-21],[-6,17],[6,55],[-34,58],[-16,59],[4,71],[-20,60],[-13,-1],[-6,60],[-19,82],[-17,54],[-12,13],[-5,37],[-11,7],[2,38],[-9,41],[-24,10],[-32,45],[-7,54],[-47,87],[-11,-2],[12,36],[22,8],[3,22],[-16,7],[-5,57],[-11,5],[2,34],[13,32],[-12,55],[2,63],[-13,24],[-7,47],[-8,-6],[-8,88],[-15,21],[-39,152],[-1,279],[1,109],[0,804]],[[29991,69339],[3,68],[18,64],[-3,15],[11,74],[-13,36],[18,11],[4,26],[22,42],[15,-61],[28,-5],[13,70]],[[30213,67064],[-30,-174],[-2,-44]],[[29724,66677],[-9,53],[-6,-10],[-12,102],[9,73],[1,57],[13,10],[8,45],[-6,52],[9,33],[-5,65],[4,138],[12,64],[-6,60],[10,135],[-5,35],[5,74],[15,33],[6,109],[9,44],[19,43],[6,44],[-1,64],[19,67],[0,85],[12,44],[12,69],[0,47],[-10,68],[6,57],[-6,34],[10,61],[35,32],[10,-13],[16,21],[5,52],[24,14],[14,39],[7,45],[16,22],[-6,59],[11,13],[2,73],[-10,38],[-11,102],[15,52],[4,64],[18,75],[-13,89],[11,30]],[[29842,64964],[3,18],[27,22],[-21,-43],[-9,3]],[[29812,64781],[5,20],[11,-16],[0,-50],[-6,35],[-10,11]],[[29792,64880],[16,16],[-12,-43],[-4,27]],[[29275,64272],[5,-67],[-9,-39],[-38,-78],[-11,-1]],[[28633,68013],[16,50],[-5,-45],[-11,-5]],[[28611,68032],[12,40],[9,-5],[-21,-35]],[[27689,66145],[33,53],[53,111],[29,91],[30,50],[26,25],[11,70],[13,36],[4,52],[36,56],[19,54],[-4,80],[-13,40],[2,43],[-7,37],[-23,35],[1,92],[-18,15],[9,77],[-5,125],[-3,13],[28,22],[38,42],[56,47],[40,20],[33,2],[38,-9],[36,8],[86,-42],[23,-19],[15,-47],[23,-46],[12,-10],[40,49],[35,1],[43,12],[21,-19],[23,-1],[14,25],[30,20],[18,40],[9,1],[19,80],[30,64],[10,8],[19,54],[14,5],[20,-15],[17,19],[9,53],[2,87],[-9,180],[-20,40],[11,50],[14,11],[2,-33],[21,41],[-3,43],[-19,47],[-22,-15],[5,29],[-15,51],[-15,1],[1,80],[16,115],[19,5],[23,42],[0,48],[18,22],[27,55],[9,-5],[16,29],[25,75],[4,46],[12,51],[41,121],[31,100],[56,141],[-1,12],[68,109],[26,62],[18,0],[22,37],[27,-29],[19,10],[91,-8],[53,-1],[107,14],[24,-1],[93,10]],[[29478,69336],[1,-109],[-7,-30],[-4,-63],[13,-57],[-10,-55],[-2,-92],[-4,-31],[4,-70],[19,-88],[4,-69],[-12,-80],[7,-114],[-4,-36],[-19,-63],[-5,-89],[-8,-79],[9,-27],[-1,-103],[10,-67],[-5,-64],[12,-57],[-16,-97],[-7,-114],[10,-26],[7,66],[19,0],[2,-53],[13,-29],[-2,-343],[-6,-422],[0,-74],[-4,-37],[8,-65]],[[29390,64649],[-7,-42],[-21,-42],[-2,-79],[-13,2],[9,-60],[18,87],[11,-15],[10,42],[21,27],[18,2],[4,33],[22,-30],[2,41],[9,-28],[20,-8],[18,-23],[23,28],[2,43],[17,8],[10,-12],[75,3],[39,20],[14,18],[30,63],[9,40],[12,13],[13,50],[21,21],[12,-2],[-18,-52],[-9,-6],[15,-31],[5,-44],[17,-12],[11,25],[16,-72],[15,17],[23,48],[2,28],[17,11],[12,-12],[-5,-21],[-67,-94],[-78,-123],[-50,-62],[-81,-93],[-53,-78],[-43,-41],[-27,-12],[-6,15],[-64,-60],[-61,10],[-46,-55],[3,38],[-23,-2],[3,25],[-11,39],[7,35],[-8,36]],[[26861,65369],[16,17],[-2,-36],[-14,19]],[[26831,65420],[6,90],[11,-35],[-3,-35],[-14,-42],[0,22]],[[26661,65520],[1,-26],[21,-28],[13,17],[37,-82],[25,-20],[11,-21],[18,-66],[19,-29],[18,23],[2,50],[7,13],[14,-55],[19,2],[-1,-37],[29,-96],[16,-33],[22,-21],[41,57],[22,4],[17,35],[51,60],[37,-38],[19,15],[20,-9],[29,61],[29,86],[8,10],[16,58],[44,102],[10,1],[67,108],[30,17],[24,34],[65,69],[17,24]],[[15490,70789],[21,10],[13,-45],[-1,-55],[17,-42],[25,-1],[32,51],[14,-4],[59,-119],[7,-61],[18,-81],[1,-57],[7,-52],[-3,-67],[10,-88],[-4,-41],[3,-50],[33,-54],[46,-35],[11,-19],[17,14],[13,-32],[18,-5],[23,39],[23,7],[54,83],[12,45],[15,16],[21,-15],[29,12],[28,26],[19,-30],[17,-9],[18,14],[34,-40],[9,-75],[14,4],[19,50],[34,4],[13,-16],[11,34],[47,51],[15,35],[21,-9],[21,-51],[22,6],[34,26],[20,5],[11,42],[28,27],[29,46],[46,27],[37,10],[13,57],[14,23],[24,-22],[64,39],[17,-14],[19,6],[28,42],[11,36],[163,1],[250,-3],[164,-3]],[[17338,70482],[16,-107],[11,-27],[16,-75],[18,5],[10,-47],[19,-2],[16,-48],[0,-53],[13,-49],[7,-54],[-24,-108],[-1,-55],[-10,-23],[-24,-150],[1,-36],[-9,-51],[-7,-116],[-13,-40],[-6,-53],[-14,-44],[-3,-51],[7,-58],[-9,-68],[-18,-76],[0,-21],[-32,-49],[-14,-93],[-8,-97],[-10,-66],[-18,-48],[3,-66],[-8,-36],[15,-69],[-8,-56],[13,-35],[19,25],[16,-59],[20,12],[2,-53],[18,-17],[1,-31],[-10,-62],[-12,-17],[1,-42],[11,-32],[-1,-43],[-12,-81],[0,-54],[-11,-11],[-2,-59],[0,-2105]],[[17307,65831],[-166,-2],[-273,-5],[-26,-3],[-143,2],[-220,2]],[[15305,65829],[-21,55],[-15,55],[-7,69],[2,33],[-14,81],[2,32],[-7,63],[-2,126],[13,147],[-7,107],[-17,87],[-11,2],[-11,123],[15,90],[12,96],[6,83],[0,52],[9,80],[6,99],[-6,42],[17,53],[8,43],[16,132],[15,193],[15,283],[7,225],[4,188],[-2,8],[10,197],[-1,69],[7,184],[0,92],[-5,39],[8,91],[12,227],[8,117],[4,157],[-3,66],[3,109],[-4,69],[5,24],[5,176],[-1,76],[-11,41],[6,87],[-2,83],[-7,45],[16,36],[1,109],[-19,193],[27,-79],[14,-14],[-3,38],[23,10],[7,17],[11,-28],[12,31],[15,0],[20,51]],[[26599,59546],[33,-4],[78,1],[5,-5],[157,-1],[61,3],[151,-2],[3,26],[77,-5],[-8,-28]],[[18139,65823],[61,-6],[262,13],[192,2],[5,-5],[196,3],[118,3]],[[18136,60011],[0,880],[1,11],[-1,272],[1,173],[-1,298],[1,318],[0,1661],[1,149],[0,628],[1,266],[0,1156]],[[28738,60998],[7,-15],[-7,-27],[0,42]],[[28949,61206],[-16,-79],[-15,-98],[-8,-27],[-5,21],[-15,-7],[-19,-78],[-12,-70],[-11,-126],[1,-64],[-23,-128],[7,-14],[-18,-91],[-12,-79],[-9,-11],[1,-57],[-11,-86],[-18,-64],[-16,2],[4,-35],[-9,-5],[-1,84],[-10,55],[-4,61],[2,70],[9,59],[3,89],[10,105],[4,76],[16,79],[18,110],[-4,34],[21,17],[15,65],[1,28],[-20,21],[25,54]],[[28739,61120],[-11,-44],[-3,44]],[[28423,61914],[-20,-21],[-13,21],[0,-52],[-18,-113],[-4,-52],[2,-76],[15,-59],[29,15],[6,26],[15,0],[12,38],[9,-30],[-6,-74],[19,-64],[0,-49],[35,-59],[25,-2],[7,-28],[6,21],[24,-9],[4,-44],[16,-39],[8,-59],[13,-15],[15,-54],[20,-23],[30,-68],[-5,-65],[-15,-24],[-2,-107],[4,-29],[-11,-46],[13,-23],[-19,-30],[-31,64],[-11,-27],[-7,25],[0,41],[-13,81],[-19,32],[-8,35],[-12,12],[-21,103],[-11,11],[-4,45],[-13,30],[-2,-30],[28,-89],[20,-114],[15,-24],[1,-25],[16,-14],[10,-96],[11,-53],[30,-4],[7,-36],[31,-24],[-14,-29],[-1,-37],[13,-8],[4,22],[8,-41],[5,-110],[-8,-90],[-18,63],[-21,45],[-9,-42],[11,-39],[7,-55],[9,-14],[-22,-24],[-18,-4],[6,-39],[22,11],[-2,-76],[14,12],[4,-31],[12,-20],[6,-49],[-9,-97],[-4,15],[-16,-18],[-15,-34],[-10,68],[-29,61],[-14,45],[4,48],[-13,71],[-22,-9],[-8,-25],[-10,46],[-18,11],[-4,23],[-21,-35],[11,-33],[12,8],[18,-13],[15,-55],[9,-2],[8,58],[8,-119],[1,-67],[22,-19],[25,-82],[1,-65],[27,4],[9,27],[1,-33],[9,-11],[-3,86],[17,6],[13,-29],[35,-36],[17,27],[11,-11],[8,-128],[12,-140],[9,-71],[7,-94]],[[15775,72069],[4,105],[10,72],[12,-52],[-2,-58],[19,-32],[-18,-27],[-5,-26],[-18,-12],[-2,30]],[[15740,73454],[0,40],[20,-41],[-17,-26],[-3,27]],[[15720,73667],[6,14],[26,-115],[-18,42],[-14,59]],[[15715,73495],[8,29],[12,-47],[-15,-33],[-5,51]],[[15707,73080],[13,89],[14,59],[2,55],[16,11],[7,-19],[0,-49],[19,-38],[3,-26],[-15,-19],[-17,15],[-1,-29],[-13,-34],[-14,-7],[3,-24],[23,10],[11,-42],[8,-84],[-4,-14],[10,-100],[8,27],[-5,67],[10,-3],[16,-57],[16,-13],[7,-94],[-8,-58],[-14,13],[-12,86],[-21,-25],[2,30],[-19,44],[3,93],[-5,56],[-18,-4],[-3,30],[-22,54]],[[15649,73739],[11,-4],[34,-53],[-8,-8],[-22,20],[-15,45]],[[15623,73630],[17,26],[2,-33],[-19,7]],[[15618,73982],[15,0],[4,-29],[-17,-2],[-2,31]],[[15586,73509],[7,30],[20,1],[2,-29],[15,-33],[17,-9],[-18,69],[37,108],[12,-2],[37,-58],[-19,-50],[11,-66],[-2,-62],[-11,-25],[4,-69],[-20,-12],[-15,50],[-9,-12],[-22,11],[-31,62],[-6,76],[-9,20]],[[15577,73617],[18,-10],[18,-54],[-30,41],[-6,23]],[[17306,73978],[-1,-290],[0,-441],[-2,-286],[0,-702],[1,-52],[0,-1247],[-7,-48],[20,-76],[8,-54],[0,-63],[12,-40],[-17,-93],[7,-11],[11,-93]],[[15490,70789],[-34,9],[-3,34],[-12,6],[-10,-31],[-13,10],[-19,-51],[-9,7],[-21,74],[-10,8],[-7,-47],[-10,-10],[6,139],[1,124],[-4,165],[13,-61],[-2,-100],[4,-137],[17,0],[1,37],[-10,40],[0,61],[12,-37],[14,83],[-19,116],[11,42],[25,53],[-17,37],[-6,-27],[-18,-2],[4,-23],[-16,4],[-20,44],[-1,55],[-11,130],[8,8],[6,-52],[11,31],[52,63],[-10,27],[-34,23],[-2,45],[-27,14],[-8,-24],[8,-90],[-16,-21],[3,38],[-4,206],[-14,176],[-24,80],[-9,207],[-5,77],[-15,162],[-14,36],[-4,55],[-14,23],[-5,31],[-19,29],[-12,110],[-8,101],[1,53],[-11,56],[12,58],[9,138],[-19,46],[3,22],[17,1],[40,-55],[32,-64],[10,-1],[25,-39],[6,12],[41,-55],[-1,-20],[35,-41],[56,-11],[21,13],[31,-37],[9,19],[10,-18],[24,7],[12,-32],[41,2],[32,71],[-3,-24],[22,-42],[7,-45],[17,17],[17,-5],[-3,-32],[14,-20],[1,-59],[10,6],[3,53],[-14,34],[0,40],[12,28],[21,10],[3,-31],[-15,-34],[10,-50],[7,6],[2,48],[10,14],[8,-100],[-15,-10],[11,-42],[8,-78],[13,-21],[-8,-25],[-16,2],[2,-42],[-17,-36],[-9,-113],[-14,-9],[11,113],[-6,17],[-19,-101],[-4,-53],[-21,-70],[-38,-183],[-13,-119],[12,8],[23,-13],[12,27],[21,17],[3,38],[-44,-62],[-17,27],[42,226],[31,74],[29,28],[3,73],[16,73],[31,68],[-9,97],[22,-40],[14,-187],[-22,0],[3,-40],[11,-14],[-4,-56],[7,-19],[0,-53],[-14,-38],[-1,-38],[15,-16],[-10,-48],[-6,-87],[4,-21],[-10,-57],[7,-49],[-15,-79],[-27,78],[8,96],[-16,-42],[-6,-63],[30,-83],[-10,-16],[1,-48],[-11,-26],[-16,46],[-20,105],[12,37],[1,61],[-7,25],[0,-51],[-12,-57],[7,-72],[-6,-48],[13,14],[11,-66],[27,-22],[11,37],[0,33],[13,16],[8,79],[10,53],[-2,30],[25,-58],[10,25],[-4,36],[27,34],[0,50],[-8,58],[-8,11],[6,35],[-10,40],[-7,71],[22,38],[-24,58],[16,82],[-6,91],[15,46],[9,119],[22,25],[-1,69],[-14,23],[-23,86],[1,74],[-10,49],[-15,4],[3,-24],[-11,-28],[10,-67],[18,-50],[1,-35],[-26,85],[-12,4],[-7,58],[2,77],[18,24],[16,-22],[10,42],[-10,45],[-28,45],[-13,48],[1,39],[-29,-33],[-7,33],[4,45],[-13,-17],[3,39],[24,28],[13,-15],[9,-49],[19,7],[-10,108],[17,6],[5,34],[-21,66],[-5,66],[8,44],[-13,30],[-17,-6],[-11,-41],[9,-44],[-19,40],[8,57],[-10,25],[-9,-14],[-1,65],[-21,54],[11,21],[-5,36],[-13,16],[16,54],[184,0],[97,-6],[145,5],[143,-2],[190,0],[169,0],[165,1],[178,0],[325,-2]],[[25685,69733],[6,80],[31,-17],[-23,-128],[-14,65]],[[25568,69555],[12,14],[2,-63],[-14,23],[0,26]],[[24707,71654],[8,83],[12,4],[-5,-75],[-15,-12]],[[24691,71507],[21,33],[-14,-47],[-7,14]],[[24655,71564],[5,21],[30,29],[5,-13],[-11,-48],[-24,-11],[-5,22]],[[24625,71464],[3,27],[20,41],[1,-19],[-24,-49]],[[24631,71609],[14,-54],[-13,-3],[-8,37],[7,20]],[[24621,71679],[35,36],[11,-55],[14,34],[2,-44],[-16,-9],[-17,-49],[-11,42],[-16,20],[-2,25]],[[24616,71401],[17,18],[32,86],[14,-32],[-30,-33],[5,-35],[-17,-4],[-20,-37],[-1,37]],[[24563,71635],[15,17],[-1,-44],[-14,27]],[[24276,71309],[20,-30],[34,11],[49,52],[19,27],[18,0],[48,70],[25,27],[6,26],[17,-22],[7,33],[25,10],[22,70],[14,-12],[14,35],[10,-4],[24,-81],[-14,-76],[-24,-78],[9,-73],[-16,-35],[-11,-77],[13,-16],[42,73],[5,54],[42,-108],[13,-22],[9,10],[25,-27]],[[25508,69434],[-10,-58],[-1,-80],[-37,-13],[-21,-40],[3,-47],[-11,-59],[-9,-15],[-11,-83],[-12,-42],[-7,-104],[3,-25],[-13,-50],[20,-42],[12,7],[7,53],[26,64],[10,3],[15,63],[0,36],[31,133],[26,36],[11,-7],[11,34],[15,-32],[-6,46],[12,97],[27,109],[7,100],[12,-5],[21,32],[1,59],[17,60],[22,-3],[-2,-87],[-16,-5],[-2,-142],[-12,-40],[-8,4],[-5,-53],[-14,-52],[5,-43],[-13,-39],[4,-26],[-18,-33],[-13,-62],[-8,-87],[-17,-107],[-9,-26],[-9,-62],[-21,-268],[9,-94],[-2,-71],[-12,-41],[-23,-46],[-3,-62],[-8,-37],[-14,-162],[2,-82],[8,-50],[-2,-102],[-21,-118],[-7,-136],[-20,-107],[-9,-156],[8,-76],[-5,-38],[8,-85],[-7,-57],[14,-62],[0,-85],[6,-63],[16,-59],[-4,-89],[-11,-107],[6,-145]],[[2682,386],[26,11],[1,-51],[-9,8],[-8,-28],[-10,60]],[[2636,452],[21,8],[-4,-21],[-13,-12],[-4,25]],[[2313,271],[13,35],[16,2],[19,68],[4,-20],[27,2],[4,-44],[-7,13],[-29,-30],[-23,-89],[-11,47],[-13,16]],[[90204,32599],[5,15],[34,16],[21,137],[6,65],[7,-11],[7,-43],[14,-11],[-10,-88],[-32,-109],[-9,-44],[-2,-111],[-12,-56],[-18,30],[-7,101],[8,50],[-12,59]],[[90597,35570],[10,43],[4,-16],[-8,-45],[-6,18]],[[90537,37432],[5,20],[1,-49],[-6,29]],[[90507,37973],[14,53],[0,59],[11,0],[0,-66],[-9,-13],[-10,-55],[-6,22]],[[90501,34555],[4,28],[2,101],[9,-12],[20,67],[5,-22],[-14,-80],[4,-63],[-13,7],[0,-73],[-12,18],[-5,29]],[[90487,38800],[6,39],[11,-28],[-1,-51],[-8,-23],[-7,25],[-1,38]],[[90486,35993],[20,2],[3,-36],[-19,-8],[-4,42]],[[90472,34420],[4,45],[13,54],[5,-54],[-4,-24],[7,-40],[-2,-61],[-9,-29],[-14,109]],[[90343,33382],[11,51],[21,35],[15,-9],[-2,-35],[-12,-13],[-8,-39],[-11,-6],[-5,23],[-9,-7]],[[28030,56345],[-13,-8],[-36,-51],[-27,-66],[-35,-121],[-18,-79],[-7,-45],[-16,-58],[-14,-93],[-13,-174],[3,-55],[-7,-48],[-14,-47],[-23,-41],[-9,-97],[-17,10],[-17,-16],[-11,39],[-16,-33],[-10,-63],[3,-31],[8,10],[0,-33],[-15,-20],[-18,-45],[-9,-52],[-34,-59],[-10,38],[-11,-7],[-1,-32],[17,-22],[-5,-59],[-25,-52],[-7,-40],[-10,5],[-24,-22],[-17,-59],[-6,18],[-36,-90],[-8,21],[-15,-28],[-2,30],[-13,-1],[-4,-42],[15,-83],[-7,-74],[-32,-62],[-19,-20],[-2,41],[-19,40],[-11,-22],[-2,-31],[12,-15],[14,-59],[-15,-65],[-25,-59],[-9,0],[-17,-67],[5,-21]],[[31708,38299],[11,-21],[12,13],[9,-36],[-17,-36],[-12,19],[-3,61]],[[31642,38028],[49,54],[35,-32],[-18,-26],[-21,-7],[-11,-24],[-8,12],[-17,-17],[-9,40]],[[31637,38350],[7,-14],[0,-44],[-7,58]],[[31170,38320],[15,18],[17,49],[-4,63],[7,32],[14,12],[20,-6],[17,-25],[50,2],[20,-22],[24,26],[18,-5],[25,-25],[8,20],[28,0],[27,-20],[16,1],[7,-19],[6,24],[37,-35],[4,19],[18,-18],[6,7],[31,-33],[14,-49],[7,13],[5,-27],[10,-6],[14,22],[-5,-40],[3,-84],[13,-30],[-7,-43],[-11,19],[3,-28],[-10,2],[-7,-32],[-13,1],[-11,-59],[-7,-83],[-8,-6],[-1,-44],[-25,-46],[-15,-9],[-12,12],[-7,-27],[-10,13],[-21,-43],[-10,9],[-9,-29],[-8,9],[-18,66],[-12,-10],[-7,-34],[-21,60],[-8,0],[-25,-33],[-14,24],[-12,-19],[-25,47],[-7,-39],[-14,-27],[-21,-3],[-12,-18],[-8,41],[-21,8],[-11,-32],[-19,19],[-12,-12],[1,53],[10,31],[-11,12],[3,65],[5,15],[1,75],[7,31],[-10,101],[-13,21],[-9,78]],[[30985,38023],[20,12],[5,-43],[-15,-38],[-12,32],[2,37]],[[31858,38286],[13,39],[11,-4],[15,-28],[-13,-4],[1,-49],[-9,20],[-13,-5],[-5,31]],[[31828,37522],[7,36],[-4,40],[7,30],[10,-13],[8,22],[17,3],[6,-29],[39,5],[2,-18],[-32,-48],[-41,-30],[-19,2]],[[31779,38288],[6,50],[10,-23],[12,26],[19,-21],[33,6],[-2,-23],[-14,-4],[9,-42],[-16,-11],[-15,23],[-7,-20],[-12,49],[-23,-10]],[[17306,73978],[171,1],[103,1]],[[18139,65823],[-119,3],[-36,-2],[-58,9],[-63,-7],[-79,0],[-293,0],[-184,5]],[[29478,69336],[71,5],[115,0],[40,-9],[62,-5],[57,2],[168,10]],[[25149,51924],[13,-63],[5,-76],[-3,-101],[-10,-105],[-4,3],[8,90],[4,100],[-1,46],[-12,106]],[[25020,51931],[11,38],[32,81],[2,-14],[-13,-63],[2,-28],[13,-33],[-15,-50],[-3,47],[-10,-10],[-17,10],[-2,22]],[[24941,51321],[17,10],[-9,-42],[-8,32]],[[24732,50824],[7,27],[13,-65],[-8,-14],[-12,52]],[[24681,50807],[39,-33],[-19,-8],[-20,41]],[[24628,50763],[25,19],[2,-17],[-26,-20],[-1,18]],[[24275,51386],[10,27],[12,-5],[3,26],[22,-6],[23,-61],[9,7],[6,-29],[-15,-36],[-1,-40],[-14,-19],[-59,115],[4,21]],[[24969,52072],[-17,-35],[-8,7],[-17,-56],[-2,-38],[-12,-15],[3,-40],[-28,17],[-11,-45],[5,-68],[18,-10],[13,25],[-4,-59],[8,-34],[15,-19],[13,11],[6,29],[5,101],[-2,13],[24,54],[3,44],[18,-34],[13,6],[0,-21],[-17,-34],[0,-34],[15,-17],[3,-61],[15,14],[11,82],[16,-25],[-4,-55],[-13,0],[-12,-44],[22,2],[-3,-29],[-31,-22],[13,-66],[11,22],[-7,-59],[-9,26],[-14,11],[-12,-55],[-1,-99],[-9,-5],[-6,86],[-11,1],[-2,-66],[13,-58],[-13,33],[-14,5],[-8,-17],[-15,6],[18,-39],[0,-32],[-23,49],[0,-25],[12,-32],[-12,-14],[1,-34],[11,-36],[20,-11],[-1,-22],[12,-24],[-1,-34],[7,-46],[9,30],[5,-21],[22,-2],[16,-34],[3,30],[20,-91],[11,44],[24,-111],[0,-59],[6,-13],[18,28],[7,-41],[-24,-15],[-2,-33],[16,-3],[-8,-52],[-11,24],[-12,-96],[2,-44],[-21,36],[-2,55],[-8,16],[-31,-138],[-15,-41],[7,67],[9,29],[5,48],[9,21],[0,54],[9,23],[-1,51],[-10,24],[-4,-62],[-16,-29],[-12,29],[-14,77],[-34,43],[-10,45],[-56,33],[-12,-14],[-48,-143],[-46,-115],[-7,10],[4,41],[-12,16],[-2,41],[6,3],[-12,100],[-11,27],[-9,-1],[1,-28],[-8,-36],[2,76],[-10,56],[-13,-64],[-14,14],[-7,-22],[-7,31],[-6,-27],[10,-63],[-12,4],[-7,-27],[-4,-54],[-8,7],[-5,-57],[-8,12],[-19,-33],[-6,-76],[-16,16],[5,21],[-13,67],[-18,57],[-11,-13],[-26,21],[-10,33],[-25,12],[-16,25],[-16,60],[12,14],[7,58],[8,-12],[12,-52],[7,22],[-1,-68],[15,-17],[-4,104],[-23,64],[0,42],[-11,7],[-9,-41],[-13,-13],[2,41],[-10,-7],[3,39],[9,28],[-10,40],[-29,-50],[-10,80],[-10,-8],[-6,118],[-26,1],[6,33],[1,85],[-32,16],[-13,-10],[-20,-38],[-7,57],[8,41],[8,-3],[-2,46],[-16,8],[-14,-22],[-9,20],[-2,-40],[-24,-36],[-14,-34],[-6,32],[-18,-16],[0,-32],[9,-30],[18,-8],[-9,-30],[8,-63],[20,21],[5,-18],[-13,-14],[6,-20],[-32,-6],[-26,-49],[-20,-9],[-82,63],[-35,42],[-57,101],[-23,32],[-41,40],[-33,5],[-14,-14],[-36,7],[-58,-25],[-17,-13],[-26,-53]],[[30097,65246],[-20,-46],[-6,102],[2,64],[-10,22],[2,-159],[-17,2],[-2,-35],[-10,-7],[-1,55],[16,95],[8,68],[17,46]],[[30029,65436],[5,7],[11,-52],[-5,-7],[-11,52]],[[30019,65203],[6,51],[-4,23],[5,57],[4,-20],[0,-85],[-11,-26]],[[29960,64853],[11,80],[5,-14],[1,-76],[-17,10]],[[30068,65494],[-3,-45],[-14,-41],[-6,42],[4,35],[-19,54],[-8,40],[5,-129],[-22,17],[12,-39],[1,-75],[-12,-11],[8,-53],[0,-72],[-10,-45],[-8,-73],[-12,6],[-27,-18],[-27,-34],[-38,-30],[-1,16]]]} diff --git a/packages/flint-js/src/geo/topologies.d.ts b/packages/flint-js/src/geo/topologies.d.ts new file mode 100644 index 00000000..25905a24 --- /dev/null +++ b/packages/flint-js/src/geo/topologies.d.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** World Bank Official Boundaries for the whole world: objects `countries` (ISO 3166-1 numeric ids), `land` and `disputed`. */ +export declare const worldBankCoarse: Record; +/** World Bank Official Boundaries at the detail a region or a zoom is drawn at. */ +export declare const worldBankMedium: Record; +/** The world's countries at 1:110m: objects `countries` (ISO 3166-1 numeric ids) and `land`. */ +export declare const world: Record; +/** The US states at 1:10m in longitude and latitude: object `states`. */ +export declare const usStates: Record; +/** The US states and counties at 1:10m, projected with albersUsa into 975 × 610: objects `states` and `counties`. */ +export declare const usAlbers: Record; diff --git a/packages/flint-js/src/geo/topologies.js b/packages/flint-js/src/geo/topologies.js new file mode 100644 index 00000000..2a602108 --- /dev/null +++ b/packages/flint-js/src/geo/topologies.js @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// The bundled topologies. A JavaScript module with its types in `topologies.d.ts`, so the type +// checker reads a few declarations rather than megabytes of JSON as literal types. +export { default as worldBankCoarse } from './world-bank-coarse.json'; +export { default as worldBankMedium } from './world-bank-medium.json'; +export { default as world } from './world-110m.json'; +export { default as usStates } from './states-10m.json'; +export { default as usAlbers } from './counties-albers-10m.json'; diff --git a/packages/flint-js/src/geo/world-110m.json b/packages/flint-js/src/geo/world-110m.json new file mode 100644 index 00000000..a1ce852d --- /dev/null +++ b/packages/flint-js/src/geo/world-110m.json @@ -0,0 +1 @@ +{"type":"Topology","transform":{"scale":[0.0036000360003600037,0.0016925586033320111],"translate":[-180,-85.60903777459777]},"objects":{"land":{"type":"MultiPolygon","arcs":[[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[7,8,9]],[[10,11]],[[12]],[[13]],[[14]],[[15]],[[16]],[[17]],[[18]],[[19]],[[20]],[[21]],[[22]],[[23]],[[24]],[[25]],[[26]],[[27]],[[28]],[[29,30]],[[31]],[[32]],[[33]],[[34]],[[35]],[[36]],[[37]],[[38]],[[39]],[[40]],[[41]],[[42,43]],[[44]],[[45]],[[46]],[[47,48,49,50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62,63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76,77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83]],[[84]],[[85]],[[86]],[[87]],[[88]],[[89]],[[90,91]],[[92]],[[93]],[[94]],[[95]],[[96]],[[97]],[[98]],[[99]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105]],[[106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221]],[[222,223]],[[224]],[[225]],[[226]],[[227]],[[228]],[[229]],[[230,231,232,233]],[[234]],[[235]],[[236]],[[237]],[[238]],[[239]],[[240]],[[241]],[[242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477],[478,479,480,481,482,483,484]],[[485]],[[486]],[[487]],[[488]],[[489]],[[490]],[[491]],[[492]],[[493]],[[494]],[[495]],[[496]],[[497]],[[498]]]},"countries":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[499,500,501,502,503,504]],"id":4},{"type":"MultiPolygon","arcs":[[[505,506,352,507]],[[354,508,509]]],"id":24},{"type":"Polygon","arcs":[[510,511,414,512,513,514]],"id":8},{"type":"Polygon","arcs":[[312,515,314,516,517]],"id":784},{"type":"MultiPolygon","arcs":[[[518,11]],[[519,520,521,166,522,168,523,524]]],"id":32},{"type":"Polygon","arcs":[[525,526,527,528,529]],"id":51},{"type":"MultiPolygon","arcs":[[[0]],[[1]],[[2]],[[3]],[[4]],[[5]],[[6]],[[530,531]]],"id":10},{"type":"Polygon","arcs":[[13]],"id":260},{"type":"MultiPolygon","arcs":[[[14]],[[24]]],"id":36},{"type":"Polygon","arcs":[[532,533,534,535,536,537,538]],"id":40},{"type":"MultiPolygon","arcs":[[[539,-528]],[[484,540,479,541,-526,542,543]]],"id":31},{"type":"Polygon","arcs":[[544,545,546]],"id":108},{"type":"Polygon","arcs":[[547,548,549,550,437]],"id":56},{"type":"Polygon","arcs":[[551,552,553,554,366]],"id":204},{"type":"Polygon","arcs":[[555,556,557,-553,558,559]],"id":854},{"type":"Polygon","arcs":[[560,561,289,562]],"id":50},{"type":"Polygon","arcs":[[563,404,564,565,566,567]],"id":100},{"type":"MultiPolygon","arcs":[[[71]],[[73]],[[74]]],"id":44},{"type":"Polygon","arcs":[[568,569,570]],"id":70},{"type":"Polygon","arcs":[[571,572,573,574,575]],"id":112},{"type":"Polygon","arcs":[[576,145,577]],"id":84},{"type":"Polygon","arcs":[[578,579,580,581,-525]],"id":68},{"type":"Polygon","arcs":[[-521,582,-581,583,584,585,586,587,588,164,589]],"id":76},{"type":"Polygon","arcs":[[48,590]],"id":96},{"type":"Polygon","arcs":[[591,592]],"id":64},{"type":"Polygon","arcs":[[593,594,595,596]],"id":72},{"type":"Polygon","arcs":[[597,598,599,600,601,602,603]],"id":140},{"type":"MultiPolygon","arcs":[[[84]],[[85]],[[86]],[[87]],[[88]],[[96]],[[97]],[[99]],[[101]],[[103]],[[604,107,605,109,606,111,607,113,608,115,609,117,610,199,611,201,612,215,613,217,614,219,615,221]],[[616,223]],[[224]],[[225]],[[226]],[[227]],[[229]],[[230,617,232,618]],[[235]],[[237]],[[238]],[[240]],[[241]],[[485]],[[486]],[[488]],[[489]],[[490]],[[496]],[[497]]],"id":124},{"type":"Polygon","arcs":[[-536,619,620,621]],"id":756},{"type":"MultiPolygon","arcs":[[[-519,622,623,624]],[[-524,169,625,171,626,-579]]],"id":152},{"type":"MultiPolygon","arcs":[[[64]],[[627,274,628,276,629,278,630,280,631,632,633,634,635,-593,636,637,638,639,-503,640,641,642,643,644,645]]],"id":156},{"type":"Polygon","arcs":[[369,646,647,648,-556,649]],"id":384},{"type":"Polygon","arcs":[[650,651,652,359,653,654,655,656,-604,657]],"id":120},{"type":"Polygon","arcs":[[658,659,-545,660,661,662,663,-508,353,-510,664,-602,665]],"id":180},{"type":"Polygon","arcs":[[-509,355,666,-658,-603,-665]],"id":178},{"type":"Polygon","arcs":[[667,174,668,155,669,-585,670]],"id":170},{"type":"Polygon","arcs":[[178,671,151,672]],"id":188},{"type":"Polygon","arcs":[[70]],"id":192},{"type":"Polygon","arcs":[[77,673]],"id":-99},{"type":"Polygon","arcs":[[76,-674]],"id":196},{"type":"Polygon","arcs":[[-538,674,675,676]],"id":203},{"type":"Polygon","arcs":[[445,677,-675,-537,-622,678,679,-549,680,441,681]],"id":276},{"type":"Polygon","arcs":[[337,682,683,684]],"id":262},{"type":"MultiPolygon","arcs":[[[92]],[[-682,442,685,444]]],"id":208},{"type":"Polygon","arcs":[[62,686]],"id":214},{"type":"Polygon","arcs":[[687,688,689,690,691,384,692,693]],"id":12},{"type":"Polygon","arcs":[[173,-668,694]],"id":218},{"type":"Polygon","arcs":[[333,695,696,390,697]],"id":818},{"type":"Polygon","arcs":[[698,699,700,336,-685]],"id":232},{"type":"Polygon","arcs":[[431,701,433,702,427,703,429,704]],"id":724},{"type":"Polygon","arcs":[[450,705,706]],"id":233},{"type":"Polygon","arcs":[[-684,707,708,709,710,711,712,-699]],"id":231},{"type":"Polygon","arcs":[[713,452,714,715,455,716,717]],"id":246},{"type":"MultiPolygon","arcs":[[[18]],[[19]],[[20]]],"id":242},{"type":"Polygon","arcs":[[12]],"id":238},{"type":"MultiPolygon","arcs":[[[718,719,163,-589]],[[82]],[[720,-679,-621,721,426,-703,434,722,436,-551]]],"id":250},{"type":"Polygon","arcs":[[356,723,-651,-667]],"id":266},{"type":"MultiPolygon","arcs":[[[724,90]],[[725,726,727,728,729,730,731,732]]],"id":826},{"type":"Polygon","arcs":[[400,733,-543,-530,734]],"id":268},{"type":"Polygon","arcs":[[368,-650,-560,735]],"id":288},{"type":"Polygon","arcs":[[736,737,374,738,739,740,-648]],"id":324},{"type":"Polygon","arcs":[[741,377]],"id":270},{"type":"Polygon","arcs":[[375,742,-739]],"id":624},{"type":"Polygon","arcs":[[357,-652,-724]],"id":226},{"type":"MultiPolygon","arcs":[[[78]],[[407,743,409,744,411,745,413,-512,746,-566,747]]],"id":300},{"type":"Polygon","arcs":[[498]],"id":304},{"type":"Polygon","arcs":[[185,748,-578,146,749,750]],"id":320},{"type":"Polygon","arcs":[[161,751,-587,752]],"id":328},{"type":"Polygon","arcs":[[182,753,754,-750,147,755,149,756]],"id":340},{"type":"Polygon","arcs":[[757,-571,758,417,759,419,760,761]],"id":191},{"type":"Polygon","arcs":[[-687,63]],"id":332},{"type":"Polygon","arcs":[[-533,762,763,764,765,-762,766]],"id":348},{"type":"MultiPolygon","arcs":[[[26]],[[767,30]],[[31]],[[32]],[[35]],[[36]],[[39]],[[40]],[[768,43]],[[44]],[[45]],[[769,50]],[[46]]],"id":360},{"type":"Polygon","arcs":[[-639,770,-637,-592,-636,771,-563,290,772,292,773,294,774,296,775]],"id":356},{"type":"Polygon","arcs":[[91,-725]],"id":372},{"type":"Polygon","arcs":[[776,-505,777,300,778,302,779,780,781,-540,-527,-542,480]],"id":364},{"type":"Polygon","arcs":[[782,783,784,785,786,-781,787]],"id":368},{"type":"Polygon","arcs":[[100]],"id":352},{"type":"Polygon","arcs":[[788,789,-698,391,790,791,792]],"id":376},{"type":"MultiPolygon","arcs":[[[79]],[[80]],[[793,421,794,423,795,425,-722,-620,-535]]],"id":380},{"type":"Polygon","arcs":[[61]],"id":388},{"type":"Polygon","arcs":[[796,-785,797,332,-790,798,-793]],"id":400},{"type":"MultiPolygon","arcs":[[[75]],[[81]],[[83]]],"id":392},{"type":"Polygon","arcs":[[799,800,482,801,-643,802]],"id":398},{"type":"Polygon","arcs":[[342,803,804,805,-710,806]],"id":404},{"type":"Polygon","arcs":[[-803,-642,807,808]],"id":417},{"type":"Polygon","arcs":[[809,810,811,283]],"id":116},{"type":"Polygon","arcs":[[265,812,267,813]],"id":410},{"type":"Polygon","arcs":[[-515,814,815,816]],"id":-99},{"type":"Polygon","arcs":[[304,817,-783]],"id":414},{"type":"Polygon","arcs":[[818,819,-634,820,-811]],"id":418},{"type":"Polygon","arcs":[[-791,392,821]],"id":422},{"type":"Polygon","arcs":[[370,822,372,823,-737,-647]],"id":430},{"type":"Polygon","arcs":[[824,-694,825,388,826,-697,827,828]],"id":434},{"type":"Polygon","arcs":[[52]],"id":144},{"type":"Polygon","arcs":[[829]],"id":426},{"type":"Polygon","arcs":[[830,448,831,-572,832]],"id":440},{"type":"Polygon","arcs":[[-680,-721,-550]],"id":442},{"type":"Polygon","arcs":[[449,-707,833,-573,-832]],"id":428},{"type":"Polygon","arcs":[[-692,834,835,836,837,383]],"id":504},{"type":"Polygon","arcs":[[838,839]],"id":498},{"type":"Polygon","arcs":[[23]],"id":450},{"type":"Polygon","arcs":[[840,-577,-749,186,841,188,842,190,843,192,844,194,845]],"id":484},{"type":"Polygon","arcs":[[-817,846,-567,-747,-511]],"id":807},{"type":"Polygon","arcs":[[847,-689,848,-557,-649,-741,849]],"id":466},{"type":"Polygon","arcs":[[287,-561,-772,-635,-820,850]],"id":104},{"type":"Polygon","arcs":[[416,-759,-570,851,-815,-514,852]],"id":499},{"type":"Polygon","arcs":[[853,-645]],"id":496},{"type":"Polygon","arcs":[[854,344,855,856,347,857,858,859,860,861,862]],"id":508},{"type":"Polygon","arcs":[[863,379,864,-690,-848]],"id":478},{"type":"Polygon","arcs":[[-863,865,866]],"id":454},{"type":"MultiPolygon","arcs":[[[285,867]],[[-770,47,-591,49]]],"id":458},{"type":"Polygon","arcs":[[351,-507,868,-595,869]],"id":516},{"type":"Polygon","arcs":[[17]],"id":540},{"type":"Polygon","arcs":[[-558,-849,-688,-825,870,-656,871,-554]],"id":562},{"type":"Polygon","arcs":[[361,872,363,873,365,-555,-872,-655]],"id":566},{"type":"Polygon","arcs":[[179,874,181,-757,150,-672]],"id":558},{"type":"Polygon","arcs":[[-681,-548,438,875,440]],"id":528},{"type":"MultiPolygon","arcs":[[[876,-718,877,457,878,459,879,461]],[[487]],[[492]],[[493]]],"id":578},{"type":"Polygon","arcs":[[-771,-638]],"id":524},{"type":"MultiPolygon","arcs":[[[15]],[[16]]],"id":554},{"type":"MultiPolygon","arcs":[[[880,319,881,882,883,-517,315,884,317]],[[-516,313]]],"id":512},{"type":"Polygon","arcs":[[-640,-776,297,885,299,-778,-504]],"id":586},{"type":"Polygon","arcs":[[175,886,177,-673,152,887,154,-669]],"id":591},{"type":"Polygon","arcs":[[-627,172,-695,-671,-584,-580]],"id":604},{"type":"MultiPolygon","arcs":[[[51]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]]],"id":608},{"type":"MultiPolygon","arcs":[[[37]],[[38]],[[-769,42]],[[41]]],"id":598},{"type":"Polygon","arcs":[[-678,446,888,-833,-576,889,890,-676]],"id":616},{"type":"Polygon","arcs":[[60]],"id":630},{"type":"Polygon","arcs":[[262,891,264,-814,892,269,893,271,894,273,-628,895]],"id":408},{"type":"Polygon","arcs":[[-705,430]],"id":620},{"type":"Polygon","arcs":[[-582,-583,-520]],"id":600},{"type":"Polygon","arcs":[[-799,-789]],"id":275},{"type":"Polygon","arcs":[[308,896,310,897]],"id":634},{"type":"Polygon","arcs":[[898,-840,899,403,-564,900,-765]],"id":642},{"type":"MultiPolygon","arcs":[[[89]],[[-889,447,-831]],[[102]],[[104]],[[105]],[[228]],[[234]],[[236]],[[239]],[[901,243,902,245,903,247,904,249,905,251,906,253,907,255,908,257,909,259,910,261,-896,-646,-854,-644,-802,483,-544,-734,401,911,-574,-834,-706,451,-714,-877,912,913,914,915,464,916,466,917,468,918,470,919,920,473,921,475,922,477]],[[491]],[[494]],[[495]]],"id":643},{"type":"Polygon","arcs":[[923,-546,-660,924]],"id":646},{"type":"Polygon","arcs":[[-691,-865,380,-835]],"id":732},{"type":"Polygon","arcs":[[925,329,926,331,-798,-784,-818,305,927,307,-898,311,-518,-884,928]],"id":682},{"type":"Polygon","arcs":[[-599,929,-828,-696,334,-700,-713,930,931,932]],"id":729},{"type":"Polygon","arcs":[[-711,-806,933,-666,-601,934,-932,935]],"id":728},{"type":"Polygon","arcs":[[378,-864,-850,-740,-743,376,-742]],"id":686},{"type":"MultiPolygon","arcs":[[[25]],[[27]],[[28]],[[33]],[[34]]],"id":90},{"type":"Polygon","arcs":[[373,-738,-824]],"id":694},{"type":"Polygon","arcs":[[184,-751,-755,936]],"id":222},{"type":"Polygon","arcs":[[-708,-683,338,937,340,938]],"id":-99},{"type":"Polygon","arcs":[[-807,-709,-939,341]],"id":706},{"type":"Polygon","arcs":[[-568,-847,-816,-852,-569,-758,-766,-901]],"id":688},{"type":"Polygon","arcs":[[162,-720,939,-588,-752]],"id":740},{"type":"Polygon","arcs":[[-891,940,-763,-539,-677]],"id":703},{"type":"Polygon","arcs":[[-534,-767,-761,420,-794]],"id":705},{"type":"Polygon","arcs":[[-878,-717,456]],"id":752},{"type":"Polygon","arcs":[[941,-859]],"id":748},{"type":"Polygon","arcs":[[-797,-792,-822,393,942,-786]],"id":760},{"type":"Polygon","arcs":[[-871,-829,-930,-598,-657]],"id":148},{"type":"Polygon","arcs":[[-736,-559,-552,367]],"id":768},{"type":"Polygon","arcs":[[284,-868,286,-851,-819,-810]],"id":764},{"type":"Polygon","arcs":[[-808,-641,-502,943]],"id":762},{"type":"Polygon","arcs":[[-777,481,-801,944,-500]],"id":795},{"type":"Polygon","arcs":[[29,-768]],"id":626},{"type":"Polygon","arcs":[[53]],"id":780},{"type":"Polygon","arcs":[[-693,385,945,387,-826]],"id":788},{"type":"MultiPolygon","arcs":[[[399,-735,-529,-782,-787,-943,394,946,947,397,948]],[[949,-748,-565,405]]],"id":792},{"type":"Polygon","arcs":[[72]],"id":158},{"type":"Polygon","arcs":[[-804,343,-855,-867,950,-663,951,-661,-547,-924,952]],"id":834},{"type":"Polygon","arcs":[[-925,-659,-934,-805,-953]],"id":800},{"type":"Polygon","arcs":[[-912,402,-900,-839,-899,-764,-941,-890,-575]],"id":804},{"type":"Polygon","arcs":[[-590,165,-522]],"id":858},{"type":"MultiPolygon","arcs":[[[65]],[[66]],[[67]],[[68]],[[69]],[[118,953,120,954,122,955,124,956,126,957,128,958,130,959,132,960,134,961,136,962,138,963,140,964,142,-846,195,965,966,967,968,969,-611]],[[93]],[[95]],[[98]],[[-613,202,970,204,971,206,972,208,973,210,974,212,975,214]]],"id":840},{"type":"Polygon","arcs":[[-945,-800,-809,-944,-501]],"id":860},{"type":"Polygon","arcs":[[156,976,158,977,160,-753,-586,-670]],"id":862},{"type":"Polygon","arcs":[[282,-812,-821,-633]],"id":704},{"type":"MultiPolygon","arcs":[[[21]],[[22]]],"id":548},{"type":"Polygon","arcs":[[321,978,323,979,325,980,327,-929,-883,981]],"id":887},{"type":"Polygon","arcs":[[982,350,-870,-594,983,-860,-942,-858,348],[-830]],"id":710},{"type":"Polygon","arcs":[[-866,-862,984,-596,-869,-506,-664,-951]],"id":894},{"type":"Polygon","arcs":[[-984,-597,-985,-861]],"id":716}]}},"arcs":[[[33289,2723],[-582,81],[-621,-35],[-348,197],[0,23],[-152,174],[625,-23],[599,-58],[207,243],[147,208],[288,-243],[-82,-301],[-81,-266]],[[5242,3530],[-364,208],[-163,209],[-11,35],[-180,162],[169,220],[517,-93],[277,-185],[212,-209],[76,-266],[-533,-81]],[[35977,2708],[-658,35],[-365,197],[49,243],[593,162],[239,197],[174,254],[126,220],[168,209],[180,243],[141,0],[414,127],[419,-127],[342,-255],[120,-359],[33,-254],[11,-301],[-430,-186],[-452,-150],[-522,-139],[-582,-116]],[[16602,6806],[-386,47],[-278,208],[60,197],[332,-104],[359,-93],[332,104],[-158,-208],[-261,-151]],[[15547,6934],[-164,23],[-359,58],[-381,162],[202,127],[277,-139],[425,-231]],[[23277,7733],[-217,46],[-337,-23],[-343,23],[-376,-35],[-283,116],[-146,243],[174,104],[353,-81],[403,-46],[305,-81],[304,69],[163,-335]],[[30256,7743],[-364,11],[136,232],[-327,-81],[-310,-81],[-212,174],[-16,243],[305,231],[190,70],[321,-23],[82,301],[16,219],[-6,475],[158,278],[256,93],[147,-220],[65,-220],[120,-267],[92,-254],[76,-267],[33,-266],[-49,-231],[-76,-220],[-326,-81],[-311,-116]],[[794,704],[78,49],[94,61],[81,52],[41,26]],[[1088,892],[41,-1],[29,-10]],[[1158,881],[402,-246],[352,246],[63,34],[816,104],[265,-138],[130,-71],[419,-196],[789,-151],[625,-185],[1072,-139],[800,162],[1181,-116],[669,-185],[734,174],[773,162],[60,278],[-1094,23],[-898,139],[-234,231],[-745,128],[49,266],[103,243],[104,220],[-55,243],[-462,162],[-212,209],[-430,185],[675,-35],[642,93],[402,-197],[495,173],[457,220],[223,197],[-98,243],[-359,162],[-408,174],[-571,35],[-500,81],[-539,58],[-180,220],[-359,185],[-217,208],[-87,672],[136,-58],[250,-185],[457,58],[441,81],[228,-255],[441,58],[370,127],[348,162],[315,197],[419,58],[-11,220],[-97,220],[81,208],[359,104],[163,-196],[425,115],[321,151],[397,12],[375,57],[376,139],[299,128],[337,127],[218,-35],[190,-46],[414,81],[370,-104],[381,11],[364,81],[375,-57],[414,-58],[386,23],[403,-12],[413,-11],[381,23],[283,174],[337,92],[349,-127],[331,104],[300,208],[179,-185],[98,-208],[180,-197],[288,174],[332,-220],[375,-70],[321,-162],[392,35],[354,104],[418,-23],[376,-81],[381,-104],[147,254],[-180,197],[-136,209],[-359,46],[-158,220],[-60,220],[-98,440],[213,-81],[364,-35],[359,35],[327,-93],[283,-174],[119,-208],[376,-35],[359,81],[381,116],[342,70],[283,-139],[370,46],[239,451],[224,-266],[321,-104],[348,58],[228,-232],[365,-23],[337,-69],[332,-128],[218,220],[108,209],[278,-232],[381,58],[283,-127],[190,-197],[370,58],[288,127],[283,151],[337,81],[392,69],[354,81],[272,127],[163,186],[65,254],[-32,244],[-87,231],[-98,232],[-87,231],[-71,209],[-16,231],[27,232],[130,220],[109,243],[44,231],[-55,255],[-32,232],[136,266],[152,173],[180,220],[190,186],[223,173],[109,255],[152,162],[174,151],[267,34],[174,186],[196,115],[228,70],[202,150],[157,186],[218,69],[163,-151],[-103,-196],[-283,-174],[-120,-127],[-206,92],[-229,-58],[-190,-139],[-202,-150],[-136,-174],[-38,-231],[17,-220],[130,-197],[-190,-139],[-261,-46],[-153,-197],[-163,-185],[-174,-255],[-44,-220],[98,-243],[147,-185],[229,-139],[212,-185],[114,-232],[60,-220],[82,-232],[130,-196],[82,-220],[38,-544],[81,-220],[22,-232],[87,-231],[-38,-313],[-152,-243],[-163,-197],[-370,-81],[-125,-208],[-169,-197],[-419,-220],[-370,-93],[-348,-127],[-376,-128],[-223,-243],[-446,-23],[-489,23],[-441,-46],[-468,0],[87,-232],[424,-104],[311,-162],[174,-208],[-310,-185],[-479,58],[-397,-151],[-17,-243],[-11,-232],[327,-196],[60,-220],[353,-220],[588,-93],[500,-162],[398,-185],[506,-186],[690,-92],[681,-162],[473,-174],[517,-197],[272,-278],[136,-220],[337,209],[457,173],[484,186],[577,150],[495,162],[691,12],[680,-81],[560,-139],[180,255],[386,173],[702,12],[550,127],[522,128],[577,81],[614,104],[430,150],[-196,209],[-119,208],[0,220],[-539,-23],[-571,-93],[-544,0],[-77,220],[39,440],[125,128],[397,138],[468,139],[337,174],[337,174],[251,231],[380,104],[376,81],[190,47],[430,23],[408,81],[343,116],[337,139],[305,139],[386,185],[245,197],[261,173],[82,232],[-294,139],[98,243],[185,185],[288,116],[305,139],[283,185],[217,232],[136,277],[202,163],[331,-35],[136,-197],[332,-23],[11,220],[142,231],[299,-58],[71,-220],[331,-34],[360,104],[348,69],[315,-34],[120,-243],[305,196],[283,105],[315,81],[310,81],[283,139],[310,92],[240,128],[168,208],[207,-151],[288,81],[202,-277],[157,-209],[316,116],[125,232],[283,162],[365,-35],[108,-220],[229,220],[299,69],[326,23],[294,-11],[310,-70],[300,-34],[130,-197],[180,-174],[304,104],[327,24],[315,0],[310,11],[278,81],[294,70],[245,162],[261,104],[283,58],[212,162],[152,324],[158,197],[288,-93],[109,-208],[239,-139],[289,46],[196,-208],[206,-151],[283,139],[98,255],[250,104],[289,197],[272,81],[326,116],[218,127],[228,139],[218,127],[261,-69],[250,208],[180,162],[261,-11],[229,139],[54,208],[234,162],[228,116],[278,93],[256,46],[244,-35],[262,-58],[223,-162],[27,-254],[245,-197],[168,-162],[332,-70],[185,-162],[229,-162],[266,-35],[223,116],[240,243],[261,-127],[272,-70],[261,-69],[272,-46],[277,0],[229,-614],[-11,-150],[-33,-267],[-266,-150],[-218,-220],[38,-232],[310,12],[-38,-232],[-141,-220],[-131,-243],[212,-185],[321,-58],[321,104],[153,232],[92,220],[153,185],[174,174],[70,208],[147,289],[174,58],[316,24],[277,69],[283,93],[136,231],[82,220],[190,220],[272,151],[234,115],[153,197],[157,104],[202,93],[277,-58],[250,58],[272,69],[305,-34],[201,162],[142,393],[103,-162],[131,-278],[234,-115],[266,-47],[267,70],[283,-46],[261,-12],[174,58],[234,-35],[212,-127],[250,81],[300,0],[255,81],[289,-81],[185,197],[141,196],[191,163],[348,439],[179,-81],[212,-162],[185,-208],[354,-359],[272,-12],[256,0],[299,70],[299,81],[229,162],[190,174],[310,23],[207,127],[218,-116],[141,-185],[196,-185],[305,23],[190,-150],[332,-151],[348,-58],[288,47],[218,185],[185,185],[250,46],[251,-81],[288,-58],[261,93],[250,0],[245,-58],[256,-58],[250,104],[299,93],[283,23],[316,0],[255,58],[251,46],[76,290],[11,243],[174,-162],[49,-266],[92,-244],[115,-196],[234,-105],[315,35],[365,12],[250,35],[364,0],[262,11],[364,-23],[310,-46],[196,-186],[-54,-220],[179,-173],[299,-139],[310,-151],[360,-104],[375,-92],[283,-93],[315,-12],[180,197],[245,-162],[212,-185],[245,-139],[337,-58],[321,-69],[136,-232],[316,-139],[212,-208],[310,-93],[321,12],[299,-35],[332,12],[332,-47],[310,-81],[288,-139],[289,-116],[195,-173],[-32,-232],[-147,-208],[-125,-266],[-98,-209],[-131,-243],[-364,-93],[-163,-208],[-360,-127],[-125,-232],[-190,-220],[-201,-185],[-115,-243],[-70,-220],[-28,-266],[6,-220],[158,-232],[60,-220],[130,-208],[517,-81],[109,-255],[-501,-93],[-424,-127],[-528,-23],[-234,-336],[-49,-278],[-119,-220],[-147,-220],[370,-196],[141,-244],[239,-219],[338,-197],[386,-186],[419,-185],[636,-185],[142,-289],[800,-128],[53,-45],[208,-175],[767,151],[636,-186],[-99504,-147],[245,344],[501,-185],[32,21]],[[31400,18145],[-92,-239],[-238,-183],[-301,67],[-202,177],[-291,86],[-350,330],[-283,317],[-383,662],[229,-124],[390,-395],[369,-212],[143,271],[90,405],[256,244],[198,-70]],[[30935,19481],[106,-274],[139,-443],[361,-355],[389,-147],[-125,-296],[-264,-29],[-141,208]],[[33139,19680],[-139,266],[333,354],[236,-148],[167,237],[222,-266],[-83,-207],[-375,-177],[-125,207],[-236,-266]],[[69095,21172],[-7,314],[41,244],[19,121],[179,-186],[263,-74],[9,-112],[-77,-269],[-427,-38]],[[90796,24799],[-57,32],[-171,19],[-171,505],[-38,390],[-160,515],[7,271],[181,-52],[269,-204],[151,81],[217,113],[166,-39],[20,-702],[-95,-203],[-29,-476],[-97,162],[-193,-412]],[[97036,23023],[-256,13],[-180,194],[-302,42],[-46,217],[149,438],[349,583],[179,111],[200,225],[238,310],[167,306],[123,441],[106,149],[41,330],[195,273],[61,-251],[63,-244],[198,239],[80,-249],[0,-249],[-103,-274],[-182,-435],[-142,-238],[103,-284],[-214,-7],[-238,-223],[-75,-387],[-157,-597],[-219,-264],[-138,-169]],[[98677,25949],[-48,155],[-116,85],[160,486],[-91,326],[-299,236],[8,214],[201,206],[47,455],[-13,382],[-113,396],[8,104],[-133,244],[-218,523],[-117,418],[104,46],[151,-328],[216,-153],[78,-526],[202,-622],[5,403],[126,-161],[41,-447],[224,-192],[188,-48],[158,226],[141,-69],[-67,-524],[-85,-345],[-212,12],[-74,-179],[26,-254],[-41,-110],[-105,-319],[-138,-404],[-214,-236]],[[96316,37345],[-153,160],[-199,266],[-179,313],[-184,416],[-38,201],[119,-9],[156,-201],[122,-200],[89,-166],[228,-366],[144,-272],[-105,-142]],[[99425,39775],[-153,73],[-27,260],[107,203],[126,-74],[69,98],[96,-171],[-46,-308],[-172,-81]],[[99645,40529],[-36,220],[139,121],[88,33],[163,184],[0,-289],[-177,-145],[-177,-124]],[[0,40798],[0,289],[57,27],[-34,-284],[-23,-32]],[[96531,40773],[-93,259],[10,158],[175,-339],[-92,-78]],[[96463,41280],[-75,74],[-58,-32],[-39,163],[-6,453],[133,-182],[45,-476]],[[62613,35454],[-160,151],[-220,211],[-77,312],[-18,524],[-98,471],[-26,425],[50,426],[128,102],[1,197],[133,447],[25,377],[-65,280],[-52,372],[-23,544],[97,331],[38,375],[138,22],[155,121],[103,107],[122,7],[158,337],[229,364],[83,297],[-38,253],[118,-71],[153,410],[6,356],[92,264],[96,-254],[74,-251],[69,-390],[45,-711],[72,-276],[-28,-284],[-49,-174],[-94,347],[-53,-175],[53,-438],[-24,-250],[-77,-137],[-18,-500],[-109,-689],[-137,-814],[-172,-1120],[-106,-821],[-125,-685],[-226,-140],[-243,-250]],[[90643,27516],[-230,262],[-170,104],[43,308],[-152,-112],[-243,-428],[-240,160],[-158,94],[-159,42],[-269,171],[-179,364],[-52,449],[-64,298],[-137,240],[-267,71],[91,287],[-67,438],[-136,-408],[-247,-109],[146,327],[42,341],[107,289],[-22,438],[-226,-504],[-174,-202],[-106,-470],[-217,243],[9,313],[-174,429],[-147,221],[52,137],[-356,358],[-195,17],[-267,287],[-498,-56],[-359,-211],[-317,-197],[-265,39],[-294,-303],[-241,-137],[-53,-309],[-103,-240],[-236,-15],[-174,-52],[-246,107],[-199,-64],[-191,-27],[-165,-315],[-81,26],[-140,-167],[-133,-187],[-203,23],[-186,0],[-295,377],[-149,113],[6,338],[138,81],[47,134],[-10,212],[34,411],[-31,350],[-147,598],[-45,337],[12,336],[-111,385],[-7,174],[-123,235],[-35,463],[-158,467],[-39,252],[122,-255],[-93,548],[137,-171],[83,-229],[-5,303],[-138,465],[-26,186],[-65,177],[31,341],[56,146],[38,295],[-29,346],[114,425],[21,-450],[118,406],[225,198],[136,252],[212,217],[126,46],[77,-73],[219,220],[168,66],[42,129],[74,54],[153,-14],[292,173],[151,262],[71,316],[163,300],[13,236],[7,321],[194,502],[117,-510],[119,118],[-99,279],[87,287],[122,-128],[34,449],[152,291],[67,233],[140,101],[4,165],[122,-69],[5,148],[122,85],[134,80],[205,-271],[155,-350],[173,-4],[177,-56],[-59,325],[133,473],[126,155],[-44,147],[121,338],[168,208],[142,-70],[234,111],[-5,302],[-204,195],[148,86],[184,-147],[148,-242],[234,-151],[79,60],[172,-182],[162,169],[105,-51],[65,113],[127,-292],[-74,-316],[-105,-239],[-96,-20],[32,-236],[-81,-295],[-99,-291],[20,-166],[221,-327],[214,-189],[143,-204],[201,-350],[78,1],[145,-151],[43,-183],[265,-200],[183,202],[55,317],[56,262],[34,324],[85,470],[-39,286],[20,171],[-32,339],[37,445],[53,120],[-43,197],[67,313],[52,325],[7,168],[104,222],[78,-289],[19,-371],[70,-71],[11,-249],[101,-300],[21,-335],[-10,-214],[100,-464],[179,223],[92,-250],[133,-231],[-29,-262],[60,-506],[42,-295],[70,-72],[75,-505],[-27,-307],[90,-400],[301,-309],[197,-281],[186,-257],[-37,-143],[159,-371],[108,-639],[111,130],[113,-256],[68,91],[48,-626],[197,-363],[129,-226],[217,-478],[78,-475],[7,-337],[-19,-365],[132,-502],[-16,-523],[-48,-274],[-75,-527],[6,-339],[-55,-423],[-123,-538],[-205,-290],[-102,-458],[-93,-292],[-82,-510],[-107,-294],[-70,-442],[-36,-407],[14,-187],[-159,-205],[-311,-22],[-257,-242],[-127,-229],[-168,-254]],[[95110,44183],[-194,4],[-106,363],[166,-142],[56,-22],[78,-203]],[[83414,44519],[-368,414],[259,116],[146,-180],[97,-180],[-17,-159],[-117,-11]],[[94572,44733],[-170,60],[-58,91],[17,235],[183,-93],[91,-124],[45,-155],[-108,-14]],[[94868,44799],[-206,512],[-57,353],[94,0],[100,-473],[111,-283],[-42,-109]],[[84713,45326],[32,139],[239,133],[194,20],[87,74],[105,-74],[-102,-160],[-289,-258],[-233,-170]],[[84746,45030],[-181,-441],[-238,-130],[-33,71],[25,201],[119,360],[275,235]],[[82576,45238],[-149,5],[95,340],[153,5],[74,209],[100,-158],[172,48],[69,-251],[-321,-119],[-193,-79]],[[83681,45301],[-370,73],[0,216],[220,123],[174,-177],[185,45],[249,216],[-41,-328],[-417,-168]],[[94421,45535],[-218,251],[-152,212],[-104,197],[41,60],[128,-142],[228,-272],[65,-187],[12,-119]],[[93704,46205],[-121,134],[-114,243],[14,99],[166,-250],[111,-193],[-56,-33]],[[81823,45409],[-306,238],[-251,-16],[-288,44],[-260,106],[-322,225],[-204,59],[-116,-74],[-506,243],[-48,254],[-255,44],[191,564],[337,-35],[224,-231],[115,-45],[38,-210],[533,-59],[61,244],[515,-284],[101,-383],[417,-108],[341,-351],[-317,-225]],[[87280,46506],[-27,445],[49,212],[58,200],[63,-173],[0,-282],[-143,-402]],[[93221,46491],[-120,227],[-122,375],[-59,450],[38,57],[30,-175],[84,-134],[135,-375],[131,-200],[-39,-166],[-78,-59]],[[91733,46847],[-148,1],[-228,171],[-158,165],[23,183],[249,-86],[152,46],[42,283],[40,15],[27,-314],[158,45],[78,202],[155,211],[-30,348],[166,11],[56,-97],[-5,-327],[-93,-361],[-146,-48],[-44,-166],[-152,-144],[-142,-138]],[[85242,48340],[-192,108],[-54,254],[281,29],[69,-195],[-104,-196]],[[86342,48300],[-234,244],[-232,49],[-157,-39],[-192,21],[65,325],[344,24],[305,-172],[101,-452]],[[92451,47764],[-52,348],[-65,229],[-126,193],[-158,252],[-200,174],[77,143],[150,-166],[94,-130],[117,-142],[111,-248],[106,-189],[33,-307],[-87,-157]],[[89166,49043],[482,-407],[513,-338],[192,-302],[154,-297],[43,-349],[462,-365],[68,-313],[-256,-64],[62,-393],[248,-388],[180,-627],[159,20],[-11,-262],[215,-100],[-84,-111],[295,-249],[-30,-171],[-184,-41],[-69,153],[-238,66],[-281,89],[-216,377],[-158,325],[-144,517],[-362,259],[-235,-169],[-170,-195],[35,-436],[-218,-203],[-155,99],[-288,25]],[[89175,45193],[-247,485],[-282,118],[-69,-168],[-352,-18],[118,481],[175,164],[-72,642],[-134,496],[-538,500],[-229,50],[-417,546],[-82,-287],[-107,-52],[-63,216],[-1,257],[-212,290],[299,213],[198,-11],[-23,156],[-407,1],[-110,352],[-248,109],[-117,293],[374,143],[142,192],[446,-242],[44,-220],[78,-955],[287,-354],[232,627],[319,356],[247,1],[238,-206],[206,-212],[298,-113]],[[83276,47228],[-119,173],[79,544],[-43,570],[-117,4],[-86,405],[115,387],[40,469],[139,891],[58,243],[237,439],[217,-174],[350,-82],[319,25],[275,429],[48,-132],[-223,-587],[-209,-113],[-267,115],[-463,-29],[-243,-85],[-39,-447],[248,-526],[150,268],[518,201],[-22,-272],[-121,86],[-121,-347],[-245,-229],[263,-757],[-50,-203],[249,-682],[-2,-388],[-148,-173],[-109,207],[134,484],[-273,-229],[-69,164],[36,228],[-200,346],[21,576],[-186,-179],[24,-689],[11,-846],[-176,-85]],[[85582,50048],[-112,374],[-82,755],[56,472],[92,215],[20,-322],[164,-52],[26,-241],[-15,-517],[-143,58],[-42,-359],[114,-312],[-78,-71]],[[79085,47110],[-234,494],[-356,482],[-119,358],[-210,481],[-138,443],[-212,827],[-244,493],[-81,508],[-103,461],[-250,372],[-145,506],[-209,330],[-290,652],[-24,300],[178,-24],[430,-114],[246,-577],[215,-401],[153,-246],[263,-635],[283,-9],[233,-405],[161,-495],[211,-270],[-111,-482],[159,-205],[100,-15],[47,-412],[97,-330],[204,-52],[135,-374],[-70,-735],[-11,-914],[-308,-12]],[[80461,51765],[204,-202],[214,110],[56,500],[119,112],[333,128],[199,467],[137,374]],[[81723,53254],[110,221],[236,323]],[[82069,53798],[214,411],[140,462],[112,2],[143,-299],[13,-257],[183,-165],[231,-177],[-20,-232],[-186,-29],[50,-289],[-205,-201]],[[82744,53024],[-158,-533],[204,-560],[-48,-272],[312,-546],[-329,-70],[-93,-403],[12,-535],[-267,-404],[-7,-589],[-107,-903],[-41,210],[-316,-266],[-110,361],[-198,34],[-139,189],[-330,-212],[-101,285],[-182,-32],[-229,68],[-43,793],[-138,164],[-134,505],[-38,517],[32,548],[165,392]],[[84832,53877],[-327,343],[-78,428],[84,280],[-176,280],[-87,-245],[-131,23],[-205,-330],[-46,173],[109,498],[175,166],[151,223],[98,-268],[212,162],[45,264],[196,15],[-16,457],[225,-280],[23,-297],[20,-218],[28,-392],[16,-332],[-94,-540],[-102,602],[-130,-300],[89,-435],[-79,-277]],[[72318,54106],[-132,470],[-49,849],[126,959],[192,-328],[129,-416],[134,-616],[-42,-615],[-116,-168],[-242,-135]],[[32841,56488],[-50,53],[81,163],[-6,233],[160,77],[58,-21],[-11,-440],[-232,-65]],[[84165,55910],[-171,409],[57,158],[70,165],[30,367],[153,35],[-44,-398],[205,570],[-26,-563],[-100,-195],[-87,-373],[-87,-175]],[[82548,55523],[136,414],[200,364],[167,409],[146,587],[49,-482],[-183,-325],[-146,-406],[-369,-561]],[[83889,56748],[-10,275],[20,301],[-43,282],[166,-183],[177,1],[-5,-247],[-129,-251],[-176,-178]],[[84666,56567],[-11,416],[-84,31],[-43,357],[163,-47],[-4,224],[-169,451],[266,-13],[77,-220],[78,-660],[-214,157],[5,-199],[68,-364],[-132,-133]],[[83683,57791],[-119,295],[-142,450],[238,-22],[97,-213],[-74,-510]],[[84465,57987],[-216,290],[-103,310],[-71,-217],[-177,354],[-253,-87],[-138,130],[14,244],[87,151],[-83,136],[-36,-213],[-137,340],[-41,257],[-11,566],[112,-195],[29,925],[90,535],[169,-1],[171,-168],[85,153],[26,-150],[-46,-245],[95,-423],[-73,-491],[-164,-196],[-43,-476],[62,-471],[147,-65],[123,70],[347,-328],[-27,-321],[91,-142],[-29,-272]],[[31337,61183],[-16,253],[40,86],[227,-3],[142,-52],[50,-118],[-71,-149],[-209,4],[-163,-21]],[[28554,61038],[-156,95],[-159,215],[34,135],[116,41],[64,-20],[187,-53],[147,-142],[46,-161],[-195,-11],[-84,-99]],[[30080,62227],[34,101],[217,-3],[165,-152],[73,15],[50,-209],[152,11],[-9,-176],[124,-21],[136,-217],[-103,-240],[-132,128],[-127,-25],[-92,28],[-50,-107],[-106,-37],[-43,144],[-92,-85],[-111,-405],[-71,94],[-14,170]],[[30081,61241],[-185,100],[-131,-41],[-169,43],[-130,-110],[-149,184],[24,190],[256,-82],[210,-47],[100,131],[-127,256],[2,226],[-175,92],[62,163],[170,-26],[241,-93]],[[80409,61331],[-228,183],[-8,509],[137,267],[304,166],[159,-14],[62,-226],[-122,-260],[-64,-341],[-240,-284]],[[6753,61756],[-69,84],[8,165],[-46,216],[14,65],[48,97],[-19,116],[16,55],[21,-11],[107,-100],[49,-51],[45,-79],[71,-207],[-7,-33],[-108,-126],[-89,-92],[-41,-99]],[[6551,62734],[-47,125],[-32,48],[-3,37],[27,50],[99,-56],[73,-90],[-23,-71],[-94,-43]],[[6447,63028],[-149,17],[21,72],[137,-26],[-9,-63]],[[6192,63143],[-19,8],[-97,21],[-35,133],[-11,24],[74,82],[23,-38],[80,-196],[-15,-34]],[[5704,63509],[-93,107],[14,43],[43,58],[64,-12],[5,-138],[-33,-58]],[[28401,62311],[186,329],[-113,154],[-179,39],[-96,171],[-66,336],[-157,-23],[-259,159],[-83,124],[-362,91],[-97,115],[104,148],[-273,30],[-199,-307],[-115,-8],[-40,-144],[-138,-65],[-118,56],[146,183],[60,213],[126,131],[142,116],[210,56],[67,65],[240,-42],[219,-7],[261,-201],[110,-216],[260,66],[98,-138],[235,-366],[173,-267],[92,8],[165,-120],[-20,-167],[205,-24],[210,-242],[-33,-138],[-185,-75],[-187,-29],[-191,46],[-398,-57]],[[28394,64588],[-70,340],[-104,171],[60,375],[84,-23],[97,-491],[1,-343],[-68,-29]],[[83540,63560],[-146,499],[-32,438],[163,581],[223,447],[127,-176],[-49,-357],[-167,-947],[-119,-485]],[[28080,66189],[-19,219],[130,47],[184,-18],[8,-153],[-303,-95]],[[28563,65870],[-51,75],[4,309],[-124,234],[-1,67],[220,-265],[-48,-420]],[[86948,69902],[-181,168],[2,281],[154,352],[158,-68],[114,248],[204,-127],[35,-203],[-156,-357],[-114,189],[-143,-137],[-73,-346]],[[59437,71293],[8,-48],[-285,-240],[-136,77],[-64,237],[132,22]],[[59092,71341],[19,3],[40,143],[200,-8],[253,176],[-188,-251],[21,-111]],[[56867,71211],[3,98],[-339,115],[52,251],[152,-199],[216,34],[207,-42],[-7,-103],[151,71],[-35,-175],[-400,-50]],[[54194,72216],[-213,222],[-141,64],[-387,300],[38,304],[325,-54],[284,64],[211,51],[-100,-465],[41,-183],[-58,-303]],[[52446,73567],[-105,156],[-11,713],[-64,338],[153,-30],[139,183],[166,-419],[-39,-782],[-126,38],[-113,-197]],[[86301,68913],[-135,229],[69,533],[-176,172],[-113,405],[263,182],[145,371],[280,306],[203,403],[553,177],[297,-121],[291,1050],[185,-282],[408,591],[158,229],[174,723],[-47,664],[117,374],[295,108],[152,-819],[-9,-479],[-256,-595],[4,-610],[-104,-472],[48,-296],[-145,-416],[-355,-278],[-488,-36],[-396,-675],[-186,227],[-12,442],[-483,-130],[-329,-279],[-325,-11],[282,-435],[-186,-1004],[-179,-248]],[[52563,75028],[-126,120],[-64,398],[56,219],[179,226],[47,-507],[-92,-456]],[[88876,75140],[-39,587],[138,455],[296,33],[81,817],[83,460],[326,-615],[213,-198],[195,-126],[197,250],[62,-663],[-412,-162],[-244,-587],[-436,404],[-152,-646],[-308,-9]],[[32535,77739],[-353,250],[-69,198],[105,183],[97,-288],[202,-79],[257,16],[-137,-242],[-102,-38]],[[32696,79581],[-360,186],[-258,279],[96,49],[365,-148],[284,-247],[8,-108],[-135,-11]],[[15552,79158],[-456,269],[-84,209],[-248,207],[-50,168],[-286,107],[-107,321],[24,137],[291,-129],[171,-89],[261,-63],[94,-204],[138,-280],[277,-244],[115,-327],[-140,-82]],[[35133,78123],[-183,111],[60,484],[-77,75],[-322,-513],[-166,21],[196,277],[-267,144],[-298,-35],[-539,18],[-43,175],[173,208],[-121,160],[234,356],[287,941],[172,336],[241,204],[129,-26],[-54,-160],[-148,-372],[-184,-517],[181,199],[187,-126],[-98,-206],[247,-162],[128,144],[277,-182],[-86,-433],[194,101],[36,-313],[86,-367],[-117,-520],[-125,-22]],[[13561,81409],[-111,1],[-167,270],[-103,272],[-140,184],[-51,260],[16,188],[131,-76],[267,47],[-84,-671],[242,-475]],[[89469,77738],[-51,496],[31,575],[-32,638],[64,446],[13,790],[-163,581],[24,808],[257,271],[-110,274],[123,83],[73,-391],[96,-569],[-7,-581],[114,-597],[280,-1046],[-411,195],[-171,-854],[271,-605],[-8,-413],[-211,356],[-182,-457]],[[47896,83153],[233,24],[298,-365],[-149,-406]],[[48278,82406],[46,-422],[-210,-528],[-493,-349],[-393,89],[225,617],[-145,601],[378,463],[210,276]],[[53358,82957],[-291,333],[-39,246],[408,195],[88,-296],[-166,-478]],[[7221,84100],[-142,152],[-43,277],[252,210],[148,90],[185,-40],[117,-183],[-240,-281],[-277,-225]],[[48543,80097],[-148,118],[407,621],[249,127],[-436,99],[-79,235],[291,183],[-152,319],[52,387],[414,-54],[40,343],[-190,372],[-337,104],[-66,160],[101,264],[-92,163],[-149,-279],[-17,569],[-140,301],[101,611],[216,480],[222,-47],[335,49],[-297,-639],[283,81],[304,-3],[-72,-481],[-250,-530],[287,-38],[270,-759],[190,-95],[171,-673],[79,-233],[337,-113],[-34,-378],[-142,-173],[111,-305],[-250,-310],[-371,6],[-473,-163],[-130,116],[-183,-276],[-257,67],[-195,-226]],[[3835,85884],[-182,110],[-168,161],[274,101],[220,-54],[27,-226],[-171,-92]],[[27873,86994],[-123,50],[-73,176],[13,41],[107,177],[114,-13],[70,-121],[-108,-310]],[[26925,87305],[-196,13],[-61,160],[207,273],[381,-6],[-6,-114],[-325,-326]],[[2908,87788],[-211,128],[-106,107],[-245,-34],[-66,52],[17,223],[171,-113],[173,61],[225,-156],[276,-79],[-23,-64],[-211,-125]],[[26243,87832],[-95,346],[-377,-57],[242,292],[35,465],[95,542],[201,-49],[51,-259],[143,91],[161,-155],[304,-203],[318,-184],[25,-281],[204,46],[199,-196],[-247,-186],[-432,142],[-156,266],[-275,-314],[-396,-306]],[[44817,88095],[-365,87],[-775,187],[273,261],[-605,289],[492,114],[-12,174],[-583,137],[188,385],[421,87],[433,-400],[422,321],[349,-167],[453,315],[461,-42],[-64,-382],[314,-403],[-361,-451],[-801,-405],[-240,-107]],[[28614,90223],[-69,289],[118,331],[255,82],[217,-163],[3,-253],[-32,-82],[-180,-174],[-312,-30]],[[1957,88542],[-260,17],[-212,206],[-369,172],[-62,257],[-283,96],[-315,-76],[-151,207],[60,219],[-333,-140],[126,-278],[-158,-251],[0,2354],[681,-451],[728,-588],[-24,-367],[187,-147],[-64,429],[754,-88],[544,-553],[-276,-257],[-455,-61],[-7,-578],[-111,-122]],[[23258,91203],[-374,179],[-226,-65],[-380,266],[245,183],[194,256],[295,-168],[166,-106],[84,-112],[169,-226],[-173,-207]],[[99694,92399],[-49,187],[354,247],[0,-404],[-305,-30]],[[0,92429],[0,404],[36,24],[235,-1],[402,-169],[-24,-81],[-286,-141],[-363,-36]],[[26228,91219],[16,648],[394,-45]],[[26638,91822],[411,-87],[373,-293],[17,-293],[-207,-315],[196,-316],[-36,-288],[-544,-413],[-386,-91],[-287,178],[-83,-297],[-268,-498]],[[25824,89109],[-81,-258],[-322,-400]],[[25421,88451],[-397,-39],[-220,-250],[-18,-384],[-323,-74],[-340,-479],[-301,-665],[-108,-466]],[[23714,86094],[-15,-686],[408,-99]],[[24107,85309],[125,-553],[130,-448],[388,117],[517,-256],[277,-225],[199,-279]],[[25743,83665],[348,-162],[294,-249]],[[26385,83254],[459,-34],[302,-58],[-45,-511],[86,-594],[201,-661],[414,-561],[214,192],[150,607],[-145,934],[-196,311],[445,276],[314,415],[154,411]],[[28738,83981],[-22,395],[-189,502]],[[28527,84878],[-338,445],[328,619],[-121,535],[-93,922],[194,137],[476,-161],[286,-57],[230,155],[258,-200],[342,-343],[85,-229],[495,-45],[-8,-496],[92,-747],[254,-92],[201,-348],[402,328],[266,652],[184,274],[216,-527],[362,-754],[307,-709],[-112,-371],[370,-333],[250,-338],[442,-152],[179,-189],[110,-500],[216,-78],[112,-223],[20,-664],[-202,-222],[-199,-207],[-458,-210],[-349,-486],[-470,-96],[-594,125],[-417,4],[-287,-41],[-233,-424],[-354,-262],[-401,-782],[-320,-545],[236,97],[446,776],[583,493]],[[31513,79609],[416,59],[245,-290]],[[32174,79378],[-262,-397],[88,-637],[91,-446],[361,-295],[459,86],[278,664],[19,-429],[180,-214],[-344,-387],[-615,-351],[-276,-239],[-310,-426],[-211,44],[-11,500],[483,488],[-445,-19],[-309,-72]],[[31350,77248],[48,-194],[-296,-286],[-286,-204],[-293,-175]],[[30523,76389],[-159,-386],[-35,-98]],[[30329,75905],[-3,-313],[92,-313],[115,-15],[-29,216],[83,-131],[-22,-169],[-188,-96]],[[30377,75084],[-133,12],[-205,-104]],[[30039,74992],[-121,-29],[-162,-29],[-231,-171],[408,111],[82,-112],[-389,-177],[-177,-1],[8,72],[-84,-164],[82,-27],[-60,-424],[-203,-455],[-20,152]],[[29172,73738],[-61,31],[-91,147]],[[29020,73916],[57,-318]],[[29077,73598],[66,-106],[8,-222]],[[29151,73270],[-89,-230],[-157,-472],[-25,24],[86,402]],[[28966,72994],[-142,226],[-33,490]],[[28791,73710],[-53,-255],[59,-375]],[[28797,73080],[-175,88],[183,-186]],[[28805,72982],[12,-562],[79,-41],[29,-204],[39,-591],[-176,-439],[-288,-175],[-182,-346],[-139,-38],[-141,-217],[-39,-199],[-305,-383],[-157,-281],[-131,-351],[-43,-419],[50,-411],[92,-505],[124,-418],[1,-256],[132,-685],[-9,-398],[-12,-230],[-69,-361]],[[27672,65472],[-83,-74],[-137,71]],[[27452,65469],[-44,259]],[[27408,65728],[-106,136],[-147,508]],[[27155,66372],[-129,452],[-42,231],[57,393],[-77,325],[-217,494]],[[26747,68267],[-108,91],[-281,-269]],[[26358,68089],[-49,30]],[[26309,68119],[-135,276],[-174,146]],[[26000,68541],[-314,-75],[-247,66],[-212,-41]],[[25227,68491],[-118,-83],[54,-166]],[[25163,68242],[-5,-240],[59,-117],[-53,-77],[-103,87],[-104,-112],[-202,18]],[[24755,67801],[-207,313],[-242,-74]],[[24306,68040],[-202,137],[-173,-42],[-234,-138],[-253,-438],[-276,-255],[-152,-282],[-63,-266],[-3,-407],[14,-284],[52,-201]],[[23016,65864],[1,-1],[-1,-1],[-107,-516]],[[22909,65346],[-49,-426],[-20,-791],[-27,-289],[48,-322],[86,-288],[56,-458],[184,-440],[65,-337],[109,-291],[295,-157],[114,-247],[244,165],[212,60],[208,106],[175,101],[176,241],[67,345],[22,496],[48,173],[188,155],[294,137],[246,-21],[169,50],[66,-125],[-9,-285],[-149,-351],[-66,-360],[51,-103],[-42,-255],[-69,-461],[-71,152],[-58,-10]],[[25472,61510],[1,-87],[53,-3],[-5,-160],[-45,-256],[24,-91],[-29,-212],[18,-56],[-32,-299],[-55,-156],[-50,-19],[-55,-205]],[[25297,59966],[90,-107],[24,88],[82,-75]],[[25493,59872],[29,-23],[61,104],[79,8],[26,-48],[43,29],[129,-53]],[[25860,59889],[128,16],[90,65]],[[26078,59970],[32,66],[89,-31],[66,-40],[73,14],[55,51],[127,-82],[44,-13],[85,-110],[80,-132],[101,-91],[73,-162]],[[26903,59440],[-24,-57],[-14,-132],[29,-216],[-64,-202],[-30,-237],[-9,-261],[15,-152],[7,-266],[-43,-58],[-26,-253],[19,-156],[-56,-151],[12,-159],[43,-97]],[[26762,57043],[70,-321],[108,-238],[130,-252]],[[27070,56232],[100,-212]],[[27170,56020],[-6,-125],[111,-27]],[[27275,55868],[26,48],[77,-145],[136,42],[119,150],[168,119],[95,176],[153,-34],[-10,-58],[155,-21],[124,-102],[90,-177],[105,-164]],[[28513,55702],[143,-18],[209,412],[114,63],[3,195],[51,500],[159,274],[175,11],[22,123],[218,-49],[218,298],[109,132],[134,285],[98,-36],[73,-156],[-54,-199]],[[30185,57537],[-8,-139],[-163,-69],[91,-268],[-3,-309]],[[30102,56752],[-123,-343],[105,-469]],[[30084,55940],[120,38],[62,427],[-86,208],[-14,447],[346,241],[-38,278],[97,186],[100,-415],[195,-9],[180,-330],[11,-195],[249,-6],[297,61],[159,-264]],[[31762,56607],[213,-73],[155,184]],[[32130,56718],[4,149],[344,35],[333,9],[-236,-175],[95,-279],[222,-44],[210,-291],[45,-473],[144,13],[109,-139]],[[33400,55523],[183,-217],[171,-385],[8,-304],[105,-14],[149,-289],[109,-205]],[[34125,54109],[333,-119],[30,107],[225,43],[298,-159]],[[35011,53981],[95,-65],[204,-140],[294,-499],[46,-242]],[[35650,53035],[95,28],[69,-327],[155,-1033],[149,-97],[7,-408],[-208,-487],[86,-178],[491,-92],[10,-593],[211,388],[349,-212],[462,-361],[135,-346],[-45,-327],[323,182],[540,-313],[415,23],[411,-489],[355,-662],[214,-170],[237,-24],[101,-186],[94,-752],[46,-358],[-110,-977],[-142,-385],[-391,-822],[-177,-668],[-206,-513],[-69,-11],[-78,-435],[20,-1107],[-77,-910],[-30,-390],[-88,-233],[-49,-790],[-282,-771],[-47,-610],[-225,-256],[-65,-355],[-302,2],[-437,-227],[-195,-263],[-311,-173],[-327,-470],[-235,-586],[-41,-441],[46,-326],[-51,-597],[-63,-289],[-195,-325],[-308,-1040],[-244,-468],[-189,-277],[-127,-562],[-183,-337]],[[35174,30629],[-121,-372],[-313,-328],[-205,118],[-151,-63],[-256,253],[-189,-19],[-169,327]],[[33770,30545],[-19,-308],[353,-506],[-38,-408],[173,-257],[-14,-289],[-267,-757],[-412,-317],[-557,-123],[-305,59],[59,-352],[-57,-442],[51,-298],[-167,-208],[-284,-82],[-267,216],[-108,-155],[39,-587],[188,-178],[152,186],[82,-307],[-255,-183],[-223,-367],[-41,-595],[-66,-316],[-262,-2],[-218,-302],[-80,-443]],[[31227,23224],[274,-433],[265,-119]],[[31766,22672],[-96,-531],[-328,-333],[-180,-692],[-254,-234],[-113,-276],[89,-614],[185,-342],[-117,30]],[[30952,19680],[-247,4],[-134,-145],[-250,-213],[-45,-552],[-118,-14],[-313,192],[-318,412],[-346,338],[-87,374],[79,346],[-140,393],[-36,1007],[119,568],[293,457],[-422,172],[265,522],[94,982],[309,-208],[145,1224],[-186,157],[-87,-738],[-175,83],[87,845],[95,1095],[127,404]],[[29661,27385],[-79,576],[-23,666]],[[29559,28627],[117,19],[170,954],[192,945],[118,881],[-64,885],[83,487],[-34,730],[163,721],[50,1143],[89,1227],[87,1321],[-20,967],[-58,832]],[[30452,39739],[-279,340],[-24,242],[-551,593],[-498,646],[-214,365],[-115,488],[46,170],[-236,775],[-274,1090],[-262,1177],[-114,269],[-87,435],[-216,386],[-198,239],[90,264],[-134,563],[86,414],[221,373]],[[27693,48568],[148,442],[-60,258],[-106,-275],[-166,259],[56,167],[-47,536],[97,89],[52,368],[105,381],[-20,241],[153,126],[190,236]],[[28095,51396],[-37,183],[103,44],[-12,296],[65,214],[138,40],[117,371],[106,310],[-102,141],[52,343],[-62,540],[59,155],[-44,500],[-112,315]],[[28366,54848],[-93,170],[-59,319],[68,158],[-70,40]],[[28212,55535],[-52,195],[-138,165]],[[28022,55895],[-122,-38],[-56,-205],[-112,-149],[-61,-20],[-27,-123],[132,-321],[-75,-76],[-40,-87],[-130,-30],[-48,353],[-36,-101],[-92,35],[-56,238],[-114,39],[-72,69],[-119,-1],[-8,-128],[-32,89]],[[26954,55439],[-151,131],[-56,124],[32,103],[-11,130],[-77,142],[-109,116],[-95,76],[-19,173],[-73,105],[18,-172],[-55,-141],[-64,164],[-89,58],[-38,120],[2,179],[36,187],[-78,83],[64,114]],[[26191,57131],[-96,186],[-130,238],[-61,200],[-117,185],[-140,267]],[[25647,58207],[31,92],[46,-89]],[[25724,58210],[21,41]],[[25745,58251],[-48,185]],[[25697,58436],[-84,52],[-31,-140]],[[25582,58348],[-161,9],[-100,57],[-115,117],[-154,37],[-79,127]],[[24973,58695],[-142,103],[-174,11],[-127,117],[-149,244]],[[24381,59170],[-314,636]],[[24067,59806],[-144,192],[-226,154]],[[23697,60152],[-156,-43],[-223,-223],[-140,-58],[-196,156],[-208,112],[-260,271],[-208,83],[-314,275],[-233,282],[-70,158],[-155,35],[-284,187],[-116,270],[-299,335],[-139,373],[-66,288],[93,57],[-29,169],[64,153],[1,204],[-93,266],[-25,235],[-94,298],[-244,587],[-280,462],[-135,368],[-238,241],[-51,145],[42,365]],[[19641,66203],[-142,137],[-164,288]],[[19335,66628],[-69,412],[-149,48],[-162,311],[-130,288],[-12,184],[-149,446],[-99,452],[5,227]],[[18570,68996],[-201,235],[-93,-26]],[[18276,69205],[-159,163],[-44,-240],[46,-284],[27,-444],[95,-243],[206,-407],[46,-139],[42,-42],[37,-203],[49,8],[56,-381],[85,-150],[59,-210],[174,-300],[92,-550],[83,-259],[77,-277],[15,-311],[134,-20],[112,-268],[100,-264],[-6,-106],[-117,-217],[-49,3],[-74,359]],[[19362,64423],[-182,337],[-200,286]],[[18980,65046],[-142,150],[9,432],[-42,320],[-132,183],[-191,264],[-37,-76],[-70,154],[-171,143],[-164,343],[20,44],[115,-33],[103,221],[10,266],[-214,422],[-163,163],[-102,369],[-103,388],[-129,472],[-113,531]],[[17464,69802],[-46,302],[-180,340],[-130,71],[-30,169],[-156,30],[-100,159],[-258,59]],[[16564,70932],[-70,95],[-34,324]],[[16460,71351],[-270,594],[-231,821],[10,137],[-123,195],[-215,495],[-38,482],[-148,323],[61,489],[-10,507],[-89,453],[109,557],[67,1072],[-50,792],[-88,506],[-80,274],[33,115],[402,-200],[148,-558]],[[15948,78405],[68,156],[-44,485],[-94,484]],[[15878,79530],[-38,1],[-537,581],[-199,255]],[[15104,80367],[-503,245],[-155,523],[40,362]],[[14486,81497],[-356,252],[-48,476],[-336,429],[-6,304]],[[13740,82958],[-153,223],[-245,188],[-78,515],[-358,478],[-150,558],[-267,38],[-441,15],[-326,170],[-574,613],[-266,112],[-486,211]],[[10396,86079],[-385,-50],[-546,271]],[[9465,86300],[-330,252],[-309,-125],[58,-411],[-154,-38],[-321,-123],[-245,-199]],[[8164,85656],[-307,-126],[-40,348]],[[7817,85878],[125,580],[295,182],[-76,148],[-354,-329],[-190,-394],[-400,-420],[203,-287],[-262,-424]],[[7158,84934],[-299,-247],[-278,-181]],[[6581,84506],[-69,-261],[-434,-305],[-87,-278],[-325,-252],[-191,45],[-259,-165],[-282,-201],[-231,-197],[-477,-169],[-43,99],[304,276],[271,182],[296,324],[345,66],[137,243],[385,353],[62,119],[205,208],[48,448],[141,349],[-320,-179],[-90,102],[-150,-215],[-181,300],[-75,-212],[-104,294],[-278,-236],[-170,0],[-24,352]],[[4985,85596],[50,217],[-179,210]],[[4856,86023],[-361,-113],[-235,277],[-190,142],[-1,334],[-214,252],[108,340],[226,330],[99,303],[225,43],[191,-94],[224,285],[201,-51],[212,183],[-52,270],[-155,106],[205,228],[-170,-7],[-295,-128],[-85,-131],[-219,131],[-392,-67],[-407,142],[-117,238],[-351,343],[390,247],[620,289],[228,0]],[[4541,89915],[-38,-295],[586,22]],[[5089,89642],[-225,366]],[[4864,90008],[-342,226],[-197,295]],[[4325,90529],[-267,252],[-381,187],[155,309],[493,19],[350,270],[66,287],[284,281],[271,68],[526,262],[256,-40],[427,315],[421,-124],[201,-266],[123,114],[469,-35],[-16,-136],[425,-101],[283,59],[585,-186],[534,-56],[214,-77],[370,96],[421,-177],[302,-83]],[[10837,91767],[518,-142]],[[11355,91625],[438,-284],[289,-55]],[[12082,91286],[244,247],[336,184],[413,-72],[416,259],[455,148],[191,-245],[207,138],[62,278],[192,-63],[470,-530],[369,401]],[[15437,92031],[38,-448],[341,96]],[[15816,91679],[105,173],[337,-34],[424,-248],[650,-217],[383,-100],[272,38]],[[17987,91291],[375,-300],[-391,-293]],[[17971,90698],[502,-127],[750,70],[236,103],[296,-354],[302,299],[-283,251],[179,202],[338,27],[223,59],[224,-141],[279,-321],[310,47],[491,-266],[431,94],[405,-14],[-32,367],[247,103],[431,-200],[-2,-559],[177,471],[223,-16],[126,594],[-298,364],[-324,239],[22,653],[329,429],[366,-95],[281,-261],[378,-666],[-247,-290],[517,-120],[-1,-604],[371,463],[332,-380],[-83,-438],[269,-399],[290,427],[202,510]],[[19722,91216],[-824,-103],[-374,-41]],[[18524,91072],[-151,279],[-379,161],[-246,-66],[-343,468],[185,62],[429,101],[392,-26],[362,103],[-537,138],[-594,-47],[-394,12],[-146,217],[644,237],[-428,-9],[-485,156],[233,443],[193,235],[744,359],[284,-114],[-139,-277],[618,179],[386,-298],[314,302],[254,-194],[227,-580],[140,244],[-197,606],[244,86],[276,-94],[311,-239],[175,-575],[86,-417],[466,-293],[502,-279],[-31,-260],[-456,-48],[178,-227],[-94,-217],[-503,93],[-478,160],[-322,-36],[-522,-201]],[[20728,93568],[-434,413],[95,83],[372,24],[211,-130],[-244,-390]],[[27920,93557],[-80,36],[-306,313],[12,213],[133,39],[636,-63],[479,-325],[25,-163],[-296,17],[-299,13],[-304,-80]],[[31620,87170],[-753,236],[-596,343],[-337,287],[97,167],[-414,304],[-405,286],[5,-171],[-803,-94],[-235,203],[183,435],[522,10],[571,76],[-92,211],[96,294],[360,576],[-77,261],[-107,203],[-425,286],[-563,201],[178,150],[-294,367],[-245,34],[-219,201],[-149,-175],[-503,-76],[-1011,132],[-588,174],[-450,89],[-231,207],[290,270],[-394,2],[-88,599],[213,528],[286,241],[717,158],[-204,-382],[219,-369],[256,477],[704,242],[477,-611],[-42,-387],[550,172],[263,235],[616,-299],[383,-282],[36,-258],[515,134],[290,-376],[670,-234],[242,-238],[263,-553],[-510,-275],[654,-386],[441,-130],[400,-543],[437,-39],[-87,-414],[-487,-687],[-342,253],[-437,568],[-359,-74],[-35,-338],[292,-344],[377,-272],[114,-157],[181,-584],[-96,-425],[-350,160],[-697,473],[393,-509],[289,-357],[45,-206]],[[22678,92689],[-268,50],[-192,225],[-690,456],[5,189],[567,-73],[-306,386],[329,286],[331,-124],[496,75],[72,-172],[-259,-283],[420,-254],[-50,-532],[-455,-229]],[[89468,93831],[-569,66],[-49,31],[263,234],[348,54],[394,-226],[34,-155],[-421,-4]],[[23814,93133],[-317,22],[-173,519],[4,294],[145,251],[276,161],[579,-20],[530,-144],[-415,-526],[-331,-115],[-298,-442]],[[15808,92470],[-147,259],[-641,312]],[[15020,93041],[93,193],[218,489]],[[15331,93723],[241,388],[-272,362],[939,93],[397,-123],[709,-33],[270,-171],[298,-249],[-349,-149],[-681,-415],[-344,-414]],[[16539,93012],[0,-248],[-731,-294]],[[91548,94707],[-444,53],[-516,233],[66,192],[518,-89],[697,-155],[-321,-234]],[[23845,94650],[-403,44],[-337,155],[148,266],[399,159],[243,-208],[101,-187],[-151,-229]],[[88598,94662],[-550,384],[149,406],[366,111],[734,-26],[1004,-313],[-219,-439],[-1023,16],[-461,-139]],[[22275,94831],[-298,94],[5,345],[-455,-46],[-18,457],[299,-18],[419,201],[390,-34],[22,77],[212,-273],[9,-303],[-127,-440],[-458,-60]],[[18404,94533],[-35,193],[577,261],[-1255,-70],[-389,106],[379,577],[262,165],[782,-199],[493,-350],[485,-45],[-397,565],[255,215],[286,-68],[94,-282],[109,-210],[247,99],[291,-26],[49,-289],[-169,-281],[-940,-91],[-701,-256],[-423,-14]],[[65817,92311],[-907,77],[-74,262],[-503,158],[-40,320],[284,126],[-10,323],[551,503],[-255,73],[665,518],[-75,268],[621,312],[917,380],[925,110],[475,220],[541,76],[193,-233],[-187,-184],[-984,-293],[-848,-282],[-863,-562],[-414,-577],[-435,-568],[56,-491],[531,-484],[-164,-52]],[[25514,94532],[-449,73],[-738,190],[-96,325],[-34,293],[-279,258],[-574,72],[-322,183],[104,242],[573,-37],[308,-190],[547,1],[240,-194],[-64,-222],[319,-134],[177,-140],[374,-26],[406,-50],[441,128],[566,51],[451,-42],[298,-223],[62,-244],[-174,-157],[-414,-127],[-355,72],[-797,-91],[-570,-11]],[[16250,95423],[-377,128],[472,442],[570,383],[426,-9],[381,87],[-38,-454],[-214,-205],[-259,-29],[-517,-252],[-444,-91]],[[81143,94175],[250,112],[142,-379]],[[81535,93908],[122,153],[444,93],[892,-97],[67,-276],[1162,-88],[15,451]],[[84237,94144],[590,-103],[443,3]],[[85270,94044],[449,-312],[128,-378],[-165,-247],[349,-465],[437,-240],[268,620],[446,-266],[473,159],[538,-182],[204,166],[455,-83],[-201,549],[367,256],[2509,-384],[236,-351],[727,-451],[1122,112],[553,-98],[231,-244],[-33,-432],[342,-168],[372,121],[492,15],[525,-116],[526,66],[484,-526],[344,189],[-224,378]],[[97224,91732],[123,263],[886,-166]],[[98233,91829],[578,36],[799,-282],[389,-258],[0,-2354],[-2,-3],[-357,-260],[-360,44],[250,-315],[166,-487],[128,-159],[32,-244],[-71,-157],[-518,129],[-777,-445],[-247,-69],[-425,-415],[-403,-362],[-102,-269],[-397,409],[-724,-464]],[[96192,85904],[-126,220],[-268,-254]],[[95798,85870],[-371,81],[-90,-388],[-333,-572],[10,-239],[316,-132],[-37,-860],[-258,-22],[-119,-494],[116,-255]],[[95032,82989],[-486,-301],[-96,-675]],[[94450,82013],[-415,-144],[-83,-600],[-400,-551],[-103,407],[-119,862],[-155,1313],[134,819],[234,353]],[[93543,84472],[15,276],[431,132]],[[93989,84880],[496,744],[479,608],[499,471],[223,833],[-337,-50],[-167,-487]],[[95182,86999],[-705,-648],[-227,726]],[[94250,87077],[-717,-201],[-696,-990],[230,-362],[-620,-154],[-430,-61],[20,427],[-431,90],[-344,-291],[-850,102]],[[90412,85637],[-913,-175],[-900,-1153]],[[88599,84309],[-1065,-1394],[438,-74],[136,-370],[270,-132]],[[88378,82339],[178,296],[305,-39]],[[88861,82596],[401,-650]],[[89262,81946],[9,-502],[-217,-591]],[[89054,80853],[-23,-705],[-126,-945],[-418,-855],[-94,-409],[-377,-688],[-374,-682],[-179,-349],[-370,-346],[-175,-8],[-175,287],[-373,-432],[-43,-197]],[[86327,75524],[-106,36]],[[86221,75560],[-120,-201],[-83,-201]],[[86018,75158],[10,-424],[-143,-130],[-50,-105],[-104,-174],[-185,-97],[-121,-159],[-9,-256],[-32,-65],[111,-96],[157,-259]],[[85652,73393],[240,-697],[68,-383],[3,-681],[-105,-325],[-252,-113],[-222,-245],[-250,-51],[-31,322]],[[85103,71220],[52,443],[-123,615]],[[85032,72278],[206,99],[-190,506]],[[85048,72883],[-135,113],[-34,-112]],[[84879,72884],[-81,-49],[-10,112],[-72,54],[-75,94]],[[84641,73095],[77,260],[65,69]],[[84783,73424],[-25,108],[71,319]],[[84829,73851],[-18,97],[-163,64]],[[84648,74012],[-131,158]],[[84517,74170],[-388,-171],[-204,-277],[-300,-161],[148,274],[-58,230],[220,397],[-147,310],[-242,-209],[-314,-411],[-171,-381],[-272,-29],[-142,-275],[147,-400],[227,-97],[9,-265]],[[83030,72705],[220,-172],[311,421]],[[83561,72954],[247,-230],[179,-15]],[[83987,72709],[46,-310],[-394,-165]],[[83639,72234],[-130,-319],[-270,-296],[-142,-414]],[[83097,71205],[299,-324],[109,-582]],[[83505,70299],[169,-541],[189,-454],[-5,-439],[-174,-161],[66,-315],[164,-184],[-43,-481],[-71,-468],[-155,-53],[-203,-640],[-225,-775],[-258,-705],[-382,-545],[-386,-498],[-313,-68],[-170,-262],[-96,192],[-157,-294],[-388,-296],[-294,-90],[-95,-624],[-154,-35],[-73,429],[66,228]],[[80517,63220],[-373,190],[-131,-97]],[[80013,63313],[-371,-505],[-231,-558],[-61,-410],[212,-623],[260,-772],[252,-365],[169,-475],[127,-1093],[-37,-1039],[-232,-389],[-318,-381],[-227,-492],[-346,-550],[-101,378],[78,401],[-206,335]],[[78981,56775],[-233,87],[-112,307],[-141,611]],[[78495,57780],[-249,271],[-238,-11],[41,464],[-245,-3],[-22,-650],[-150,-863],[-90,-522],[19,-428],[181,-18],[113,-539],[50,-512],[155,-338],[168,-69],[144,-306]],[[78372,54256],[64,-56],[164,-356],[116,-396],[16,-398],[-29,-269],[27,-203],[20,-349],[98,-163],[109,-523],[-5,-199],[-197,-40],[-263,438],[-329,469],[-32,301],[-161,395],[-38,489],[-100,322],[30,431],[-61,250]],[[77801,54399],[-110,227],[-47,292],[-148,334],[-135,280],[-45,-347],[-53,328],[30,369],[82,566]],[[77375,56448],[-27,439],[86,452],[-94,350],[23,644],[-113,306],[-90,707],[-50,746],[-121,490],[-183,-297],[-315,-421],[-156,53],[-172,138],[96,732],[-58,554],[-218,681],[34,213],[-163,76],[-197,481]],[[75657,62792],[-79,309],[-16,301],[-53,284]],[[75509,63686],[-116,344],[-256,23],[25,-243],[-87,-329],[-118,120],[-41,-108],[-78,65],[-108,53]],[[74730,63611],[-39,-216],[-189,7],[-343,-122],[16,-445],[-148,-349],[-400,-398],[-311,-695],[-209,-373]],[[73107,61020],[-276,-386],[-1,-272]],[[72830,60362],[-138,-146]],[[72692,60216],[-250,-212],[-130,-31]],[[72312,59973],[-84,-450],[58,-769],[15,-490],[-118,-561],[-1,-1004],[-144,-29],[-126,-450],[84,-195]],[[71996,56025],[-253,-167],[-93,-402]],[[71650,55456],[-112,-170],[-263,552],[-128,827],[-107,596],[-97,279],[-148,568],[-69,739],[-48,369],[-253,811],[-115,1145],[-83,756],[1,716],[-54,553],[-404,-353],[-196,70],[-362,716],[133,214],[-82,232],[-326,501]],[[68937,64577],[-203,150]],[[68734,64727],[-83,425],[-215,449]],[[68436,65601],[-512,-111],[-451,-11],[-391,-83]],[[67082,65396],[-523,179]],[[66559,65575],[-302,136],[-314,76]],[[65943,65787],[-118,725],[-133,105],[-214,-106],[-280,-286],[-339,196],[-281,454],[-267,168],[-186,561],[-205,788],[-149,-96],[-177,196]],[[63594,68492],[-103,-231],[-165,29]],[[63326,68290],[58,-261],[-25,-135],[89,-445]],[[63448,67449],[109,-510],[137,-135],[47,-207]],[[63741,66597],[190,-248],[16,-244]],[[63947,66105],[-27,-197],[35,-199],[80,-165],[37,-194],[41,-145]],[[64113,65205],[-18,430],[75,310],[76,64]],[[64246,66009],[84,-186],[5,-345]],[[64335,65478],[-61,-348]],[[64274,65130],[53,-226]],[[64327,64904],[49,29],[11,-162],[217,93],[230,-15],[168,-18],[190,400],[207,379],[176,364]],[[65575,65974],[80,201],[35,-51],[-26,-244],[-37,-108]],[[65627,65772],[38,-466]],[[65665,65306],[125,-404],[155,-214]],[[65945,64688],[204,-78],[164,-107]],[[66313,64503],[125,-339],[75,-196],[100,-75],[-1,-132],[-101,-352],[-44,-166],[-117,-189],[-104,-404],[-126,31],[-58,-141],[-44,-300],[34,-395],[-26,-72],[-128,2],[-174,-221],[-27,-288],[-63,-125],[-173,5],[-109,-149]],[[65352,60997],[1,-239],[-134,-164]],[[65219,60594],[-153,56],[-186,-199]],[[64880,60451],[-128,-33],[-201,-159]],[[64551,60259],[-54,-263],[-6,-201],[-277,-249],[-444,-276],[-249,-417]],[[63521,58853],[-122,-32],[-83,34]],[[63316,58855],[-163,-245]],[[63153,58610],[-177,-113],[-233,-31]],[[62743,58466],[-70,-34],[-61,-156],[-73,-43]],[[62539,58233],[-42,-150],[-138,13]],[[62359,58096],[-89,-80],[-192,30],[-72,345],[8,323],[-46,174],[-54,437],[-80,243],[56,29],[-29,270],[34,114],[-12,257]],[[61883,60238],[-36,253],[-84,177]],[[61763,60668],[-22,236],[-143,212],[-148,495],[-79,482],[-192,406],[-124,97],[-184,563],[-32,411],[12,350],[-159,655],[-130,231],[-150,122],[-92,339],[15,133]],[[60335,65400],[-77,307],[-81,131]],[[60177,65838],[-108,440],[-170,476],[-141,406],[-139,-3],[44,325],[12,206],[34,236]],[[59709,67924],[-9,86]],[[59700,68010],[-78,-238],[-60,-446],[-75,-308],[-65,-103],[-93,191],[-125,263],[-198,847],[-29,-53],[115,-624],[171,-594],[210,-920],[102,-321],[90,-334],[249,-654],[-55,-103],[9,-384],[323,-530],[49,-121]],[[60240,63578],[90,-580],[-61,-107],[40,-608],[102,-706],[106,-145],[152,-219]],[[60669,61213],[161,-683],[77,-543]],[[60907,59987],[152,-288],[379,-558],[154,-336],[151,-341],[87,-203],[136,-178]],[[61966,58083],[66,-183],[-9,-245],[-158,-142],[119,-161]],[[61984,57352],[91,-109]],[[62075,57243],[54,-244],[125,-248]],[[62254,56751],[138,-2],[262,151],[302,70],[245,184],[138,39],[99,108],[158,20]],[[63596,57321],[89,12],[128,88],[147,59],[132,202],[105,2],[6,-163],[-25,-344],[1,-310],[-59,-214],[-78,-639],[-134,-659],[-172,-755],[-238,-866],[-237,-661],[-327,-806],[-278,-479],[-415,-586],[-259,-450],[-304,-715],[-64,-312],[-63,-140]],[[61551,49585],[-195,-236],[-68,-246],[-104,-44],[-40,-416],[-89,-238],[-54,-393],[-112,-195]],[[60889,47817],[-128,-728],[16,-335],[178,-216],[8,-153],[-76,-357],[16,-180],[-18,-282],[97,-370],[115,-583],[101,-129]],[[61198,44484],[45,-265],[-11,-588],[34,-519],[11,-923],[49,-290],[-83,-422],[-108,-410],[-177,-366],[-254,-225],[-313,-287],[-313,-634],[-107,-108],[-194,-420],[-115,-136],[-23,-421],[132,-448],[54,-346],[4,-177],[49,29],[-8,-579]],[[59870,36949],[-45,-274],[65,-102]],[[59890,36573],[-41,-246],[-116,-210]],[[59733,36117],[-229,-199],[-334,-320],[-122,-219],[24,-248],[71,-40],[-24,-311]],[[59119,34780],[-70,-430],[-32,-491],[-72,-267],[-190,-298],[-54,-86],[-118,-300],[-77,-303],[-158,-424],[-314,-609],[-196,-355]],[[57838,31217],[-209,-269],[-291,-229]],[[57338,30719],[-141,-31],[-36,-164],[-169,88],[-138,-113],[-301,114],[-168,-72],[-115,31],[-286,-233],[-238,-94],[-171,-223],[-127,-14],[-117,210],[-94,11],[-120,264],[-13,-82],[-37,159],[2,346],[-90,396],[89,108],[-7,453],[-182,553],[-139,501],[-1,1],[-199,768]],[[54540,33696],[-207,446],[-108,432],[-62,575],[-68,428],[-93,910],[-7,707],[-35,322],[-108,243],[-144,489],[-146,708],[-60,371],[-226,577],[-17,453]],[[53259,40357],[-26,372],[38,519],[96,541],[15,254],[90,532],[66,243],[159,386],[90,263],[29,438],[-15,335],[-83,211],[-74,358],[-68,355],[15,122],[85,235],[-84,570],[-57,396],[-139,374],[26,115]],[[53422,46976],[-39,183]],[[53383,47159],[-74,444]],[[53309,47603],[-228,626]],[[53081,48229],[-285,596],[-184,488],[-169,610],[9,196],[61,189],[67,430],[56,438]],[[52636,51176],[-52,90],[96,663]],[[52680,51929],[40,467],[-108,390]],[[52612,52786],[-127,100],[-56,265]],[[52429,53151],[-71,85],[3,163]],[[52361,53399],[-289,-213]],[[52072,53186],[-105,32],[-107,-133]],[[51860,53085],[-222,13],[-149,370],[-91,427]],[[51398,53895],[-197,390],[-209,-8]],[[50992,54277],[-245,1]],[[50747,54278],[-229,-69]],[[50518,54209],[-224,-126]],[[50294,54083],[-436,-346],[-154,-203],[-250,-171],[-248,168]],[[49206,53531],[-126,-7],[-194,116],[-178,-7],[-329,-103],[-193,-170],[-275,-217],[-54,15]],[[47857,53158],[-73,-5],[-286,282]],[[47498,53435],[-252,450],[-237,323]],[[47009,54208],[-187,381]],[[46822,54589],[-75,44],[-200,238],[-144,316],[-49,216],[-34,437]],[[46320,55840],[-122,349],[-108,232],[-71,76],[-69,118],[-32,261],[-41,130],[-80,97]],[[45797,57103],[-149,247],[-117,39],[-63,166],[1,90],[-84,125],[-18,127]],[[45367,57897],[-46,453]],[[45321,58350],[36,262]],[[45357,58612],[-115,460],[-138,210],[122,112],[134,415],[66,304]],[[45426,60113],[-24,318],[78,291],[34,557],[-30,583],[-34,294],[28,295],[-72,281],[-146,255]],[[45260,62987],[12,249]],[[45272,63236],[13,274],[106,161],[91,308],[-18,200],[96,417],[155,376],[93,95],[74,344],[6,315],[100,365],[185,216],[177,603],[144,235]],[[46494,67145],[259,66],[219,403],[139,158]],[[47111,67772],[232,493],[-70,735],[106,508],[37,312],[179,399],[278,270],[206,244],[186,612],[87,362],[205,-2],[167,-251],[264,41],[288,-131],[121,-6]],[[49397,71358],[267,323],[300,102],[175,244],[268,180],[471,105],[459,48],[140,-87],[262,232],[297,5],[113,-137],[190,35]],[[52339,72408],[302,239],[195,-71],[-9,-299],[236,217],[20,-113]],[[53083,72381],[-139,-289],[-2,-274]],[[52942,71818],[96,-147],[-36,-511],[-183,-297],[53,-322],[143,-10],[70,-281],[106,-92]],[[53191,70158],[326,-204],[117,51],[232,-98],[368,-264],[130,-526],[250,-114],[391,-248],[296,-293],[136,153],[133,272],[-65,452],[87,288],[200,277],[192,80],[375,-121],[95,-264],[104,-2],[88,-101]],[[56646,69496],[276,-69],[68,-196]],[[56990,69231],[369,10],[268,-156],[275,-175],[129,-92],[214,188],[114,169],[245,49],[198,-75],[75,-293],[65,193],[222,-140],[217,-33],[137,149]],[[59518,69025],[80,194],[-19,34],[74,276],[56,446],[40,149],[8,6]],[[59757,70130],[99,482],[138,416],[5,21]],[[59999,71049],[-26,452],[68,243]],[[60041,71744],[-102,268],[105,222],[-169,-51],[-233,136],[-191,-340],[-421,-66],[-225,317],[-300,20],[-64,-245]],[[58441,72005],[-192,-71],[-268,315]],[[57981,72249],[-303,-10],[-165,587]],[[57513,72826],[-203,328],[135,459],[-176,283],[308,565],[428,23],[117,449],[529,-78],[334,383],[324,167],[459,13]],[[59768,75418],[485,-416],[399,-229]],[[60652,74773],[323,91],[239,-53],[328,309]],[[61542,75120],[42,252],[-70,403],[-160,218],[-154,68],[-102,181]],[[61098,76242],[-354,499],[-317,223],[-240,347],[202,95],[231,494],[-156,234],[410,241],[-8,129],[-249,-95]],[[60617,78409],[-222,-48],[-185,-191],[-260,-31],[-239,-220],[16,-368],[136,-142],[284,35],[-55,-210],[-304,-103],[-377,-342],[-154,121],[61,277],[-304,173],[50,113],[265,197],[-80,135],[-432,149],[-19,221],[-257,-73],[-103,-325],[-215,-437]],[[58223,77340],[6,-152],[-135,-128],[-84,56],[-78,-713]],[[57932,76403],[-144,-245],[-101,-422],[89,-337]],[[57776,75399],[33,-228],[243,-190],[-51,-145],[-330,-33],[-118,-182],[-232,-319]],[[57321,74302],[-87,275],[3,122]],[[57237,74699],[-169,17],[-145,56],[-336,-154],[192,-332],[-141,-96]],[[56638,74190],[-154,0],[-147,304]],[[56337,74494],[-52,-130],[62,-353],[139,-277]],[[56486,73734],[-105,-130],[155,-272]],[[56536,73332],[137,-171],[4,-334],[-257,157],[82,-302],[-176,-62],[105,-521]],[[56431,72099],[-184,-7],[-228,257],[-104,472]],[[55915,72821],[-49,393],[-108,272],[-143,337],[-18,168]],[[55597,73991],[-48,41],[-5,130],[-154,199],[-24,281],[23,403],[38,184]],[[55427,75229],[-46,93],[-59,46]],[[55322,75368],[-78,192],[-120,118]],[[55124,75678],[-261,218],[-161,213],[-254,176]],[[54448,76285],[-233,435],[56,44]],[[54271,76764],[-127,248],[-5,200],[-179,93],[-85,-255],[-82,198],[6,205],[10,9]],[[53809,77462],[62,54]],[[53871,77516],[-221,86],[-226,-210],[15,-293],[-34,-168],[91,-301],[261,-298],[140,-488],[309,-476],[217,3],[68,-130],[-78,-118]],[[54413,75123],[249,-213],[204,-179]],[[54866,74731],[238,-308],[29,-111],[-52,-211],[-154,276],[-242,97],[-116,-382],[200,-219],[-33,-309],[-116,-35],[-148,-506],[-116,-46],[1,181],[57,317],[60,126],[-108,342],[-85,298],[-115,74],[-82,255],[-179,107],[-120,238],[-206,38],[-217,267],[-254,384]],[[53108,75604],[-189,341],[-86,584]],[[52833,76529],[-138,68],[-226,195],[-128,-80],[-161,-274],[-115,-43]],[[52065,76395],[-252,-334],[-548,160],[-404,-192],[-32,-355]],[[50829,75674],[15,-344],[-263,-393],[-356,-125],[-25,-199],[-171,-327],[-107,-481],[108,-338],[-160,-263],[-60,-384],[-210,-118]],[[49600,72702],[-197,-455],[-352,-8]],[[49051,72239],[-265,11],[-174,-209],[-106,-223],[-136,49],[-103,199],[-79,340],[-259,92]],[[47929,72498],[-112,-153],[-146,83],[-143,-65],[42,462],[-26,363],[-124,55],[-67,224],[22,386],[111,215],[20,239],[58,355],[-6,250],[-56,212],[-12,200]],[[47490,75324],[14,420],[-114,257],[393,426]],[[47783,76427],[340,-107],[373,4]],[[48496,76324],[296,-101],[230,31],[449,-19]],[[49471,76235],[144,354],[53,1177],[-287,620],[-205,299]],[[49176,78685],[-424,228],[-28,430]],[[48724,79343],[360,129],[466,-152],[-88,669],[263,-254],[646,461],[84,484],[243,119]],[[50698,80799],[222,117]],[[50920,80916],[143,162]],[[51063,81078],[244,870],[380,247]],[[51687,82195],[231,-17]],[[51918,82178],[54,125],[232,32],[52,-130],[188,291],[-63,222],[-13,335]],[[52368,83053],[-113,328],[-8,604],[46,159]],[[52293,84144],[80,178],[244,36]],[[52617,84358],[98,163],[223,167],[-9,-304],[-82,-192],[33,-166],[151,-89],[-68,-223],[-83,64],[-200,-425],[76,-288]],[[52756,83065],[4,-228],[281,-138],[-3,-210],[283,111],[156,162],[313,-233],[132,-189]],[[53922,82340],[189,174],[434,273],[350,200],[277,-100],[21,-144],[268,-7]],[[55461,82736],[63,260],[383,191]],[[55907,83187],[-59,497]],[[55848,83684],[10,445],[136,371],[262,202],[221,-442],[223,12],[53,453]],[[56753,84725],[32,349],[-102,-75],[-176,210],[-24,340],[351,164],[350,86],[301,-97],[287,17]],[[57772,85719],[316,327],[-291,280]],[[57797,86326],[-504,-47],[-489,-216],[-452,-125]],[[56352,85938],[-161,322],[-269,195],[62,581]],[[55984,87036],[-135,534],[133,344]],[[55982,87914],[252,371],[635,640],[185,124],[-28,250],[-387,279]],[[56639,89578],[-478,-167],[-269,-413],[43,-361],[-441,-475],[-537,-509],[-202,-832],[198,-416],[265,-328],[-255,-666],[-289,-138],[-106,-992],[-157,-554],[-337,57],[-158,-468],[-321,-27],[-89,558],[-232,671],[-211,835]],[[53063,85353],[-187,363],[-548,-684]],[[52328,85032],[-370,-138],[-385,301]],[[51573,85195],[-99,635]],[[51474,85830],[-88,1364],[256,380]],[[51642,87574],[733,496],[549,609],[508,824],[668,1141],[465,444],[763,741],[610,259],[457,-31],[423,489],[506,-26],[499,118],[869,-433],[-358,-158],[305,-371]],[[58639,91676],[286,206],[456,-358],[761,-140],[1050,-668],[213,-281],[18,-393],[-308,-311],[-454,-157],[-1240,449],[-204,-75],[453,-433],[36,-878],[358,-180],[217,-153],[36,286]],[[60317,88590],[-174,263],[183,215]],[[60326,89068],[672,-368]],[[60998,88700],[234,144],[-187,433]],[[61045,89277],[647,578],[256,-34],[260,-206],[161,406],[-231,352],[136,353],[-204,367],[777,-190],[158,-331],[-351,-73]],[[62654,90499],[2,-328],[218,-203]],[[62874,89968],[429,128],[68,377]],[[63371,90473],[581,282],[969,507]],[[64921,91262],[209,-29],[-273,-359],[344,-61],[199,202],[521,16],[412,245],[317,-356],[315,391],[-291,343],[145,195],[820,-179],[385,-185],[1006,-675],[186,309],[-282,313],[-8,125],[-335,58],[92,280],[-149,461],[-8,189],[512,535]],[[69038,93080],[182,537],[207,116]],[[69427,93733],[735,-156],[58,-328]],[[70220,93249],[-263,-479],[173,-189],[89,-413],[-63,-809],[307,-362],[-120,-395],[-544,-839],[318,-87],[110,213],[306,151],[74,293],[240,281],[-162,336],[130,390],[-304,49],[-67,328]],[[70444,91717],[222,594],[-361,481]],[[70305,92792],[497,398],[-64,421],[139,13],[145,-328],[-109,-570],[297,-108],[-127,426],[465,233],[577,31],[513,-337],[-247,492],[-28,630]],[[72363,94093],[484,119],[668,-26]],[[73515,94186],[602,77],[-226,309],[321,388],[319,16],[540,293],[734,79],[93,162],[729,55],[227,-133],[624,314],[510,-10],[77,255],[265,252],[656,242],[476,-191],[-378,-146],[629,-90],[75,-292],[254,143],[812,-7],[626,-289],[223,-221],[-69,-307],[-307,-175],[-730,-328],[-209,-175],[345,-83],[410,-149]],[[63720,73858],[-47,-207],[-102,-138]],[[63571,73513],[7,-293]],[[63578,73220],[88,-436],[263,-123],[193,-296],[395,-102],[434,156],[27,139]],[[64978,72558],[-52,417],[40,618],[-216,200],[71,405],[-184,34],[61,498],[262,-145],[244,189],[-202,355],[-80,338],[-224,-151],[-28,-433],[-87,383]],[[64583,75266],[-15,144],[68,246],[-53,206],[-322,202],[-125,530],[-154,150],[-9,192],[270,-56],[11,432],[236,96],[243,-88],[50,576],[-50,365],[-278,-28],[-236,144],[-321,-260],[-259,-124]],[[63639,77993],[-127,-350],[-269,-97],[-276,-610],[252,-561],[-27,-398],[303,-696]],[[63495,75281],[146,-311],[141,-419],[130,-28],[85,-159],[-228,-47],[-49,-459]],[[23807,96363],[-521,38],[-74,165],[559,-9],[195,-109],[-33,-68],[-126,-17]],[[18874,96315],[-411,191],[224,188],[406,60],[392,-92],[-93,-177],[-518,-170]],[[56247,96336],[-490,137],[191,152],[-167,189],[575,119],[110,-222],[401,-134],[-620,-241]],[[19199,96904],[-461,1],[5,84],[285,177],[149,-27],[361,-120],[-339,-115]],[[22969,96575],[-226,138],[-119,221],[-22,245],[360,-24],[162,-39],[332,-205],[-76,-214],[-411,-122]],[[22313,96609],[-453,66],[-457,192],[-619,21],[268,176],[-335,142],[-21,227],[546,-81],[751,-215],[212,-281],[108,-247]],[[77621,96617],[507,776],[229,66],[208,-38],[704,-336],[-82,-240],[-1566,-228]],[[54420,95937],[-598,361],[252,210],[-416,170],[-541,499],[-216,463],[757,212],[152,-207],[396,8],[105,202],[408,20],[350,-206],[915,-440],[-699,-233],[-155,-435],[-243,-111],[-132,-490],[-335,-23]],[[56395,97491],[-819,98],[-50,163],[-398,11],[-304,271],[858,165],[403,-142],[281,177],[702,-148],[545,-207],[-412,-318],[-806,-70]],[[63218,97851],[-301,140],[158,185],[-618,18],[542,107],[422,8],[57,-160],[159,142],[262,97],[412,-129],[-107,-90],[-373,-78],[-250,-45],[-39,-97],[-324,-98]],[[77154,97111],[-773,170],[-462,226],[-213,423],[-379,117],[722,404],[600,133],[540,-297],[640,-572],[-69,-531],[-606,-73]],[[24776,96791],[-575,76],[-299,240],[4,215],[220,157],[-508,-4],[-306,196],[-176,268],[193,262],[192,180],[285,42],[-122,135],[646,30],[355,-315],[468,-127],[455,-112],[220,-390],[334,-190],[-381,-176],[-513,-445],[-492,-42]],[[27622,95587],[-726,163],[-816,-91],[-414,71],[-525,31],[-35,284],[514,133],[-137,427],[170,41],[742,-255],[-379,379],[-450,113],[225,229],[492,141],[79,206],[-392,231],[-118,304],[759,-26],[220,-64],[433,216],[-625,68],[-972,-38],[-491,201],[-232,239],[-324,173],[-61,202],[413,112],[324,19],[545,96],[409,220],[344,-30],[300,-166],[211,319],[367,95],[498,65],[849,24],[148,-63],[802,100],[601,-38],[602,-37],[742,-47],[597,-75],[508,-161],[-12,-157],[-678,-257],[-672,-119],[-251,-133],[605,3],[-656,-358],[-452,-167],[-476,-483],[-573,-98],[-177,-120],[-841,-64],[383,-74],[-192,-105],[230,-292],[-264,-202],[-429,-167],[-132,-232],[-388,-176],[39,-134],[475,23],[6,-144],[-742,-355]],[[37559,86051],[-410,482],[-556,3],[-269,324],[-186,577],[-481,735],[-141,385],[-38,530],[-384,546],[100,435],[-186,208],[275,691],[418,220],[110,247],[58,461],[-318,-209],[-151,-88],[-249,-84],[-341,193],[-19,401],[109,314],[258,9],[567,-157],[-478,375],[-249,202],[-276,-83],[-232,147],[310,550],[-169,220],[-220,409],[-335,626],[-353,230],[3,247],[-745,346],[-590,43],[-743,-24],[-677,-44],[-323,188],[-482,372],[729,186],[559,31],[-1188,154],[-627,241],[39,229],[1051,285],[1018,284],[107,214],[-750,213],[243,235],[961,413],[404,63],[-115,265],[658,156],[854,93],[853,5],[303,-184],[737,325],[663,-221],[390,-46],[577,-192],[-660,318],[38,253],[932,353],[975,-27],[354,218],[982,57],[2219,-74],[1737,-469],[-513,-227],[-1062,-26],[-1496,-58],[140,-105],[984,65],[836,-204],[540,181],[231,-212],[-305,-344],[707,220],[1348,229],[833,-114],[156,-253],[-1132,-420],[-157,-136],[-888,-102],[643,-28],[-324,-431],[-224,-383],[9,-658],[333,-386],[-434,-24],[-457,-187],[513,-313],[65,-502],[-297,-55],[360,-508],[-617,-42],[322,-241],[-91,-208],[-391,-91],[-388,-2],[348,-400],[4,-263],[-549,244],[-143,-158],[375,-148],[364,-361],[105,-476],[-495,-114],[-214,228],[-344,340],[95,-401],[-322,-311],[732,-25],[383,-32],[-745,-515],[-755,-466],[-813,-204],[-306,-2],[-288,-228],[-386,-624],[-597,-414],[-192,-24],[-370,-145],[-399,-138],[-238,-365],[-4,-415],[-141,-388],[-453,-472],[112,-462],[-125,-488],[-142,-577],[-391,-36]],[[67002,71642],[284,-224],[209,79],[58,268],[219,89],[157,180],[55,472],[234,114],[44,211],[131,-158],[84,-19]],[[68477,72654],[154,-4],[210,-124]],[[68841,72526],[85,-72],[201,189],[93,-114],[90,271],[166,-12],[43,86],[29,239],[120,205],[150,-134],[-30,-181],[84,-28],[-26,-496],[110,-194],[97,125],[123,58],[173,265],[192,-44],[286,-1]],[[70827,72688],[50,-169]],[[70877,72519],[-162,-67],[-141,-109],[-319,-68],[-298,-124],[-163,-258],[66,-250],[32,-294],[-139,-248],[12,-227],[-76,-213],[-265,18],[110,-390],[-177,-150],[-118,-356],[15,-355],[-108,-166],[-103,55],[-212,-77],[-31,-166],[-207,1],[-154,-334],[-10,-503],[-361,-246],[-194,52],[-56,-129],[-166,75],[-278,-88],[-465,301]],[[66909,68203],[252,536],[-23,380],[-210,100],[-22,375],[-91,472],[119,323],[-121,87],[76,430],[113,736]],[[56642,44124],[29,-184],[-32,-286],[49,-277],[-41,-222],[24,-203],[-579,7],[-13,-1880],[188,-483],[181,-369]],[[56448,40227],[-510,-241],[-673,83],[-192,284],[-1126,-26],[-42,-41],[-166,267],[-180,17],[-166,-100],[-134,-113]],[[53422,46976],[115,79],[80,-11],[98,71],[820,-8],[68,-440],[80,-354],[64,-191],[106,-309],[184,47],[91,83],[154,-83],[42,148],[69,344],[172,23],[15,103],[142,2],[-24,-213],[337,5],[5,-372],[56,-228],[-41,-356],[21,-363],[93,-219],[-15,-703],[68,54],[121,-15],[172,89],[127,-35]],[[53309,47603],[112,255],[84,100],[104,-203]],[[53609,47755],[-101,-124],[-45,-152],[-9,-258],[-71,-62]],[[55719,75309],[-35,-201],[39,-254],[115,-144]],[[55838,74710],[-5,-155],[-91,-85],[-16,-192],[-129,-287]],[[55427,75229],[-47,93]],[[55380,75322],[-18,188],[120,291],[18,-111],[75,52]],[[55575,75742],[59,-159],[66,-60],[19,-214]],[[65575,65974],[52,-202]],[[65665,65306],[-142,-3],[-23,-384],[50,-82],[-126,-117],[-1,-241],[-81,-245],[-7,-238]],[[65335,63996],[-56,-125],[-835,298],[-106,599],[-11,136]],[[31400,18145],[-168,16],[-297,1],[0,1319]],[[32587,37434],[511,-964],[227,-89],[339,-437],[286,-231],[40,-261],[-273,-898],[280,-160],[312,-91],[220,95],[252,453],[45,521]],[[34826,35372],[138,114],[139,-341],[-6,-472],[-234,-326],[-186,-241],[-314,-573],[-370,-806]],[[33993,32727],[-70,-473],[-74,-607],[3,-588],[-61,-132],[-21,-382]],[[31227,23224],[273,-433],[266,-119]],[[30952,19680],[-257,93],[-672,79],[-115,344],[6,443],[-185,-38],[-98,214],[-24,626],[213,260],[88,375],[-33,299],[148,504],[101,782],[-30,347],[122,112],[-30,223],[-129,118],[92,248],[-126,224],[-65,682],[112,120],[-47,720],[65,605],[75,527],[166,215],[-84,576],[-1,543],[210,386],[-7,494],[159,576],[1,544],[-72,108],[-128,1020],[171,607],[-27,572],[100,537],[182,555],[196,367],[-83,232],[58,190],[-9,985],[302,291],[96,614],[-34,148]],[[31359,37147],[231,534],[364,-144],[163,-427],[109,475],[316,-24],[45,-127]],[[62492,74950],[57,-155],[106,-103],[-56,-148],[148,-202],[-78,-189],[118,-160],[124,-97],[7,-410]],[[62918,73486],[-101,-17]],[[62817,73469],[-113,342],[1,91],[-123,-2],[-82,159],[-58,-16]],[[62442,74043],[-109,172],[-207,147],[27,288],[-47,208]],[[62106,74858],[386,92]],[[1088,892],[38,-7],[32,-4]],[[1158,881],[402,-246],[352,246],[63,34],[816,104],[265,-138],[130,-71],[419,-196],[789,-151],[625,-185],[1072,-139],[800,162],[1181,-116],[669,-185],[734,174],[773,162],[60,278],[-1094,23],[-898,139],[-234,231],[-745,128],[49,266],[103,243],[104,220],[-55,243],[-462,162],[-212,209],[-430,185],[675,-35],[642,93],[402,-197],[495,173],[457,220],[223,197],[-98,243],[-359,162],[-408,174],[-571,35],[-500,81],[-539,58],[-180,220],[-359,185],[-217,208],[-87,672],[136,-58],[250,-185],[457,58],[441,81],[228,-255],[441,58],[370,127],[348,162],[315,197],[419,58],[-11,220],[-97,220],[81,208],[359,104],[163,-196],[425,115],[321,151],[397,12],[375,57],[376,139],[299,128],[337,127],[218,-35],[190,-46],[414,81],[370,-104],[381,11],[364,81],[375,-57],[414,-58],[386,23],[403,-12],[413,-11],[381,23],[283,174],[337,92],[349,-127],[331,104],[300,208],[179,-185],[98,-208],[180,-197],[288,174],[332,-220],[375,-70],[321,-162],[392,35],[354,104],[418,-23],[376,-81],[381,-104],[147,254],[-180,197],[-136,209],[-359,46],[-158,220],[-60,220],[-98,440],[213,-81],[364,-35],[359,35],[327,-93],[283,-174],[119,-208],[376,-35],[359,81],[381,116],[342,70],[283,-139],[370,46],[239,451],[224,-266],[321,-104],[348,58],[228,-232],[365,-23],[337,-69],[332,-128],[218,220],[108,209],[278,-232],[381,58],[283,-127],[190,-197],[370,58],[288,127],[283,151],[337,81],[392,69],[354,81],[272,127],[163,186],[65,254],[-32,244],[-87,231],[-98,232],[-87,231],[-71,209],[-16,231],[27,232],[130,220],[109,243],[44,231],[-55,255],[-32,232],[136,266],[152,173],[180,220],[190,186],[223,173],[109,255],[152,162],[174,151],[267,34],[174,186],[196,115],[228,70],[202,150],[157,186],[218,69],[163,-151],[-103,-196],[-283,-174],[-120,-127],[-206,92],[-229,-58],[-190,-139],[-202,-150],[-136,-174],[-38,-231],[17,-220],[130,-197],[-190,-139],[-261,-46],[-153,-197],[-163,-185],[-174,-255],[-44,-220],[98,-243],[147,-185],[229,-139],[212,-185],[114,-232],[60,-220],[82,-232],[130,-196],[82,-220],[38,-544],[81,-220],[22,-232],[87,-231],[-38,-313],[-152,-243],[-163,-197],[-370,-81],[-125,-208],[-169,-197],[-419,-220],[-370,-93],[-348,-127],[-376,-128],[-223,-243],[-446,-23],[-489,23],[-441,-46],[-468,0],[87,-232],[424,-104],[311,-162],[174,-208],[-310,-185],[-479,58],[-397,-151],[-17,-243],[-11,-232],[327,-196],[60,-220],[353,-220],[588,-93],[500,-162],[398,-185],[506,-186],[690,-92],[681,-162],[473,-174],[517,-197],[272,-278],[136,-220],[337,209],[457,173],[484,186],[577,150],[495,162],[691,12],[680,-81],[560,-139],[180,255],[386,173],[702,12],[550,127],[522,128],[577,81],[614,104],[430,150],[-196,209],[-119,208],[0,220],[-539,-23],[-571,-93],[-544,0],[-77,220],[39,440],[125,128],[397,138],[468,139],[337,174],[337,174],[251,231],[380,104],[376,81],[190,47],[430,23],[408,81],[343,116],[337,139],[305,139],[386,185],[245,197],[261,173],[82,232],[-294,139],[98,243],[185,185],[288,116],[305,139],[283,185],[217,232],[136,277],[202,163],[331,-35],[136,-197],[332,-23],[11,220],[142,231],[299,-58],[71,-220],[331,-34],[360,104],[348,69],[315,-34],[120,-243],[305,196],[283,105],[315,81],[310,81],[283,139],[310,92],[240,128],[168,208],[207,-151],[288,81],[202,-277],[157,-209],[316,116],[125,232],[283,162],[365,-35],[108,-220],[229,220],[299,69],[326,23],[294,-11],[310,-70],[300,-34],[130,-197],[180,-174],[304,104],[327,24],[315,0],[310,11],[278,81],[294,70],[245,162],[261,104],[283,58],[212,162],[152,324],[158,197],[288,-93],[109,-208],[239,-139],[289,46],[196,-208],[206,-151],[283,139],[98,255],[250,104],[289,197],[272,81],[326,116],[218,127],[228,139],[218,127],[261,-69],[250,208],[180,162],[261,-11],[229,139],[54,208],[234,162],[228,116],[278,93],[256,46],[244,-35],[262,-58],[223,-162],[27,-254],[245,-197],[168,-162],[332,-70],[185,-162],[229,-162],[266,-35],[223,116],[240,243],[261,-127],[272,-70],[261,-69],[272,-46],[277,0],[229,-614],[-11,-150],[-33,-267],[-266,-150],[-218,-220],[38,-232],[310,12],[-38,-232],[-141,-220],[-131,-243],[212,-185],[321,-58],[321,104],[153,232],[92,220],[153,185],[174,174],[70,208],[147,289],[174,58],[316,24],[277,69],[283,93],[136,231],[82,220],[190,220],[272,151],[234,115],[153,197],[157,104],[202,93],[277,-58],[250,58],[272,69],[305,-34],[201,162],[142,393],[103,-162],[131,-278],[234,-115],[266,-47],[267,70],[283,-46],[261,-12],[174,58],[234,-35],[212,-127],[250,81],[300,0],[255,81],[289,-81],[185,197],[141,196],[191,163],[348,439],[179,-81],[212,-162],[185,-208],[354,-359],[272,-12],[256,0],[299,70],[299,81],[229,162],[190,174],[310,23],[207,127],[218,-116],[141,-185],[196,-185],[305,23],[190,-150],[332,-151],[348,-58],[288,47],[218,185],[185,185],[250,46],[251,-81],[288,-58],[261,93],[250,0],[245,-58],[256,-58],[250,104],[299,93],[283,23],[316,0],[255,58],[251,46],[76,290],[11,243],[174,-162],[49,-266],[92,-244],[115,-196],[234,-105],[315,35],[365,12],[250,35],[364,0],[262,11],[364,-23],[310,-46],[196,-186],[-54,-220],[179,-173],[299,-139],[310,-151],[360,-104],[375,-92],[283,-93],[315,-12],[180,197],[245,-162],[212,-185],[245,-139],[337,-58],[321,-69],[136,-232],[316,-139],[212,-208],[310,-93],[321,12],[299,-35],[332,12],[332,-47],[310,-81],[288,-139],[289,-116],[195,-173],[-32,-232],[-147,-208],[-125,-266],[-98,-209],[-131,-243],[-364,-93],[-163,-208],[-360,-127],[-125,-232],[-190,-220],[-201,-185],[-115,-243],[-70,-220],[-28,-266],[6,-220],[158,-232],[60,-220],[130,-208],[517,-81],[109,-255],[-501,-93],[-424,-127],[-528,-23],[-234,-336],[-49,-278],[-119,-220],[-147,-220],[370,-196],[141,-244],[239,-219],[338,-197],[386,-186],[419,-185],[636,-185],[142,-289],[800,-128],[53,-45],[208,-175],[767,151],[636,-186],[-99504,-147],[245,344],[501,-185],[32,21],[294,188]],[[54716,79012],[-21,-241],[-156,-2],[53,-128],[-92,-380]],[[54500,78261],[-53,-100],[-243,-14],[-140,-134],[-229,45]],[[53835,78058],[-398,153],[-62,205],[-274,-102],[-32,-113],[-169,84]],[[52900,78285],[-142,16],[-125,108],[42,145],[-10,104]],[[52665,78658],[83,33],[141,-164],[39,156],[245,-25],[199,106],[133,-18],[87,-121],[26,100],[-40,385],[100,75],[98,272]],[[53776,79457],[206,-190],[157,242],[98,44],[215,-180],[131,30],[128,-111]],[[54711,79292],[-23,-75],[28,-205]],[[62817,73469],[-190,78],[-141,273],[-44,223]],[[63720,73858],[-48,-207],[-101,-138]],[[63578,73220],[-69,-29],[-173,309],[95,292],[-82,174],[-104,-44],[-327,-436]],[[62492,74950],[68,96],[207,-169],[149,-36],[38,70],[-136,319],[72,82]],[[62890,75312],[78,-20],[191,-359],[122,-40],[48,150],[166,238]],[[58149,47921],[-17,713],[-70,268]],[[58062,48902],[169,-46],[85,336],[147,-38]],[[58463,49154],[16,-233],[60,-134],[3,-192],[-69,-124],[-108,-308],[-101,-214],[-115,-28]],[[50920,80916],[204,-47],[257,123],[176,-258],[153,-138]],[[51710,80596],[-32,-400]],[[51678,80196],[-72,-22],[-30,-331]],[[51576,79843],[-243,269],[-143,-46],[-194,279],[-129,237],[-129,10],[-40,207]],[[50518,54209],[-69,407],[13,1357],[-56,122],[-11,290],[-96,207],[-85,174],[35,311]],[[50249,57077],[96,67],[56,258],[136,56],[61,176]],[[50598,57634],[93,173],[100,2],[212,-340]],[[51003,57469],[-11,-197],[62,-350],[-54,-238],[29,-159],[-135,-366],[-86,-181],[-52,-372],[7,-376],[-16,-952]],[[49214,56277],[-190,152],[-130,-22],[-97,-149],[-125,125],[-49,195],[-125,129]],[[48498,56707],[-18,343],[76,250],[-7,200],[221,490],[41,405],[76,144],[134,-79],[116,120],[38,152],[216,265],[53,184],[259,246],[153,84],[70,-114],[178,3]],[[50104,59400],[-22,-286],[37,-269],[156,-386],[9,-286],[320,-134],[-6,-405]],[[50249,57077],[-243,13]],[[50006,57090],[-128,47],[-90,-96],[-123,43],[-482,-27],[-7,-336],[38,-444]],[[75742,63602],[-6,-424],[-97,90],[18,-476]],[[75657,62792],[-79,308],[-16,301],[-53,285]],[[74730,63611],[-43,486],[-96,444],[47,356],[-171,159],[62,215],[173,220],[-200,313],[98,401],[220,-255],[133,-30],[24,-410],[265,-81],[257,8],[160,-101],[-128,-500],[-124,-34],[-86,-336],[152,-306],[46,377],[76,2],[147,-937]],[[56293,76715],[80,-243],[108,43],[213,-92],[408,-31],[138,150],[327,138],[202,-215],[163,-62]],[[57776,75399],[-239,79],[-283,-186]],[[57254,75292],[-3,-294],[-252,-56],[-196,206],[-222,-162],[-206,17]],[[56375,75003],[-20,391],[-139,189]],[[56216,75583],[46,84],[-30,70],[47,188],[105,185],[-135,255],[-24,216],[68,134]],[[55279,77084],[100,2],[-69,-260],[134,-227],[-41,-278],[-65,-27]],[[55338,76294],[-52,-53],[-90,-138],[-41,-325]],[[55155,75778],[-246,224],[-105,247],[-106,130],[-127,221],[-61,183],[-136,277],[59,245],[99,-136],[60,123],[130,13],[239,-98],[192,8],[126,-131]],[[56523,82432],[268,-4],[302,223],[64,333],[228,190],[-26,264]],[[57359,83438],[169,100],[298,228]],[[57826,83766],[293,-149],[39,-146],[146,70],[272,-141],[27,-277],[-60,-159],[174,-387],[113,-108],[-16,-107],[187,-104],[80,-157],[-108,-129],[-224,20],[-54,-55],[66,-196],[68,-379]],[[58829,81362],[-239,-35],[-85,-129],[-18,-298],[-111,57],[-250,-28],[-73,138],[-104,-103],[-105,86],[-218,12],[-310,141],[-281,47],[-215,-14],[-152,-160],[-133,-23]],[[56535,81053],[-6,263],[-85,274],[166,121],[2,235],[-77,225],[-12,261]],[[25238,61101],[-2,87],[33,27],[51,-70],[99,357],[53,8]],[[25297,59966],[-83,0],[22,667],[2,468]],[[31359,37147],[-200,-81],[-109,814],[-150,663],[88,572],[-146,250],[-37,426],[-136,402]],[[30669,40193],[175,638],[-119,496],[63,199],[-49,219],[108,295],[6,503],[13,415],[60,200],[-240,951]],[[30686,44109],[206,-50],[143,13],[62,179],[243,239],[147,222],[363,100],[-29,-443],[34,-227],[-23,-396],[302,-529],[311,-98],[109,-220],[188,-117],[115,-172],[175,6],[161,-175],[12,-342],[55,-172],[3,-255],[-81,-10],[107,-688],[533,-24],[-41,-342],[30,-233],[151,-166],[66,-367],[-49,-465],[-77,-259],[27,-337],[-87,-122]],[[33842,38659],[-4,182],[-259,302],[-258,9],[-484,-172],[-133,-520],[-7,-318],[-110,-708]],[[34826,35372],[54,341],[38,350],[0,325],[-100,107],[-104,-96],[-103,26],[-33,228],[-26,541],[-52,177],[-187,160],[-114,-116],[-293,113],[18,802],[-82,329]],[[30686,44109],[-157,-102],[-126,68],[18,898],[-228,-348],[-245,15],[-105,315],[-184,34],[59,254],[-155,359],[-115,532],[73,108],[0,250],[168,171],[-28,319],[71,206],[20,275],[318,402],[227,114],[37,89],[251,-28]],[[30585,48040],[125,1620],[6,256],[-43,339],[-123,215],[1,430],[156,97],[56,-61],[9,226],[-162,61],[-4,370],[541,-13],[92,203],[77,-187],[55,-349],[52,73]],[[31423,51320],[153,-312],[216,38],[54,181],[206,138],[115,97],[32,250],[198,168],[-15,124],[-235,51],[-39,372],[12,396],[-125,153],[52,55],[206,-76],[221,-148],[80,140],[200,92],[310,221],[102,225],[-37,167]],[[33129,53652],[145,26],[64,-136],[-36,-259],[96,-90],[63,-274],[-77,-209],[-44,-502],[71,-299],[20,-274],[171,-277],[137,-29],[30,116],[88,25],[126,104],[90,157],[154,-50],[67,21]],[[34294,51702],[151,-48],[25,120],[-46,118],[28,171],[112,-53],[131,61],[159,-125]],[[34854,51946],[121,-122],[86,160],[62,-25],[38,-166],[133,42],[107,224],[85,436],[164,540]],[[35174,30629],[-77,334],[122,280],[-160,402],[-218,327],[-286,379],[-103,-18],[-279,457],[-180,-63]],[[82069,53798],[-13,-291],[-16,-377],[-133,19],[-58,-202],[-126,307]],[[75471,66988],[113,-189],[-20,-363],[-227,-17],[-234,39],[-175,-92],[-252,224],[-6,119]],[[74670,66709],[184,439],[150,150],[198,-137],[147,-14],[122,-159]],[[58175,37528],[-393,-435],[-249,-442],[-93,-393],[-83,-222],[-152,-47],[-48,-283],[-28,-184],[-178,-138],[-226,29],[-133,166],[-117,71],[-135,-137],[-68,-283],[-132,-177],[-139,-264],[-199,-60],[-62,207],[26,360],[-165,562],[-75,88]],[[55526,35946],[0,1725],[274,20],[8,2105],[207,19],[428,207],[106,-243],[177,231],[85,2],[156,133]],[[56967,40145],[50,-44]],[[57017,40101],[107,-473],[56,-105],[87,-342],[315,-649],[119,-64],[0,-208],[82,-375],[215,-90],[177,-267]],[[54244,54965],[229,44],[52,152],[46,-11],[69,-134],[350,226],[118,230],[145,207],[-28,208],[78,54],[269,-36],[261,273],[201,645],[141,239],[176,101]],[[56351,57163],[31,-253],[160,-369],[1,-241],[-45,-246],[18,-184],[96,-170]],[[56612,55700],[212,-258]],[[56824,55442],[152,-239],[2,-192],[187,-308],[116,-255],[70,-355],[208,-234],[44,-187]],[[57603,53672],[-91,-63],[-178,14],[-209,62],[-104,-51],[-41,-143],[-90,-18],[-110,125],[-309,-295],[-127,60],[-38,-46],[-83,-357],[-207,115],[-203,59],[-177,218],[-229,200],[-149,-190],[-108,-300],[-25,-412]],[[55125,52650],[-178,33],[-188,99],[-166,-313],[-146,-550]],[[54447,51919],[-29,172],[-12,269],[-127,190],[-103,305],[-23,212],[-132,309],[23,176],[-28,249],[21,458],[67,107],[140,599]],[[26228,91219],[16,649],[394,-46]],[[25824,89109],[-81,-259],[-322,-399]],[[23714,86094],[-16,-686],[409,-99]],[[25743,83665],[348,-163],[294,-248]],[[28738,83981],[-23,395],[-188,502]],[[31513,79609],[415,58],[246,-289]],[[31350,77248],[-181,334],[0,805],[-123,171],[-187,-100],[-92,155],[-212,-446],[-84,-460],[-99,-269],[-118,-91],[-89,-30],[-28,-146],[-512,0],[-422,-4],[-125,-109],[-294,-425],[-34,-46],[-89,-231],[-255,1],[-273,-3],[-125,-93],[44,-116],[25,-181],[-5,-60],[-363,-293],[-286,-93],[-323,-316],[-70,0],[-94,93],[-31,85],[6,61],[61,207],[131,325],[81,349],[-56,514],[-59,536],[-290,277],[35,105],[-41,73],[-76,0],[-56,93],[-14,140],[-54,-61],[-75,18],[17,59],[-65,58],[-27,155],[-216,189],[-224,197],[-272,229],[-261,214],[-248,-167],[-91,-6],[-342,154],[-225,-77],[-269,183],[-284,94],[-194,36],[-86,100],[-49,325],[-94,-3],[-1,-227],[-575,0],[-951,0],[-944,0],[-833,0],[-834,0],[-819,0],[-847,0],[-273,0],[-825,0],[-788,0]],[[15104,80367],[-503,244],[-155,523],[40,363]],[[13740,82958],[154,285],[-7,373],[-473,376],[-284,674],[-173,424],[-255,266],[-187,242],[-147,306],[-279,-192],[-270,-330],[-247,388],[-194,259],[-271,164],[-273,17],[1,3364],[2,2193]],[[11355,91625],[438,-285],[289,-54]],[[15437,92031],[38,-449],[341,97]],[[17987,91291],[374,-300],[-390,-293]],[[19722,91216],[-704,-88],[-494,-56]],[[15020,93041],[119,250],[192,432]],[[16539,93012],[0,-257],[-731,-285]],[[52900,78285],[-22,-242],[-122,-100],[-206,75],[-60,-239],[-132,-19],[-48,94],[-156,-200],[-134,-28],[-120,126]],[[51900,77752],[-95,259],[-133,-92],[5,267],[203,332],[-9,150],[126,-54],[77,101]],[[52074,78715],[236,-4],[57,128],[298,-181]],[[31400,18145],[-92,-239],[-238,-183]],[[31070,17723],[-137,19],[-164,48]],[[30769,17790],[-202,177],[-291,86],[-350,330],[-283,317],[-383,662],[229,-124],[390,-395],[369,-212],[143,271],[90,405],[256,244],[198,-70]],[[29661,27385],[-80,576],[-22,666]],[[30452,39739],[143,151],[74,303]],[[86288,75628],[-179,348],[-111,-331],[-429,-254],[44,-312],[-241,22],[-131,185],[-191,-419],[-306,-318],[-227,-379]],[[83030,72705],[220,-173],[311,422]],[[83987,72709],[45,-310],[-393,-165]],[[83097,71205],[299,-325],[109,-581]],[[80517,63220],[-373,189],[-131,-96]],[[80013,63313],[-280,154],[-132,240],[44,340],[-254,108],[-134,222],[-236,-315],[-271,-68],[-221,3],[-149,-145]],[[78380,63852],[-144,-86],[42,-676],[-148,16],[-25,139]],[[78105,63245],[-9,244],[-203,-172],[-121,109],[-206,222],[81,490],[-176,115],[-66,544],[-293,-98],[33,701],[263,493],[11,487],[-8,452],[-121,141],[-93,348],[-162,-44]],[[77035,67277],[-300,89],[94,248],[-130,367],[-198,-249],[-233,145],[-321,-376],[-252,-439],[-224,-74]],[[74670,66709],[-23,465],[-170,-124]],[[74477,67050],[-324,57],[-314,136],[-225,259],[-216,117],[-93,284],[-157,84],[-280,385],[-223,182],[-115,-141]],[[72530,68413],[-386,413],[-273,374],[-78,651],[200,-79],[9,301],[-111,303],[28,482],[-298,692]],[[71621,71550],[-457,239],[-82,454],[-205,276]],[[70827,72688],[-42,337],[10,230],[-169,134],[-91,-59],[-70,546]],[[70465,73876],[79,136],[-39,138],[266,279],[192,116],[294,-80],[105,378],[356,70],[99,234],[438,320],[39,134]],[[72294,75601],[-22,337],[190,154],[-250,1026],[550,236],[143,131],[200,1058],[551,-194],[155,267],[13,592],[230,56],[212,393]],[[74266,79657],[109,49]],[[74375,79706],[73,-413],[233,-313],[396,-222],[192,-476],[-107,-690],[100,-256],[330,-101],[374,-83],[336,-368],[171,-66],[127,-544],[163,-351],[306,14],[574,-133],[369,82],[274,-88],[411,-359],[336,1],[123,-184],[324,318],[448,205],[417,22],[324,208],[200,316],[194,199],[-45,195],[-89,227],[146,381],[156,-53],[286,-120],[277,313],[423,229],[204,391],[195,168],[404,78],[219,-66],[30,210],[-251,413],[-223,189],[-214,-219],[-274,92],[-157,-74],[-72,241],[197,590],[135,446]],[[82410,80055],[333,-223],[392,373],[-3,260],[251,627],[155,189],[-4,326],[-152,141],[229,294],[345,106],[369,16],[415,-176],[244,-217],[172,-596],[104,-254],[97,-363],[103,-579],[483,-189],[329,-420],[112,-555],[423,-1],[240,233],[459,175],[-146,-532],[-107,-216],[-96,-647],[-186,-575],[-338,104],[-238,-208],[73,-506],[-40,-698],[-142,-16],[2,-300]],[[47857,53158],[22,487],[26,74],[-8,233],[-118,247],[-88,40],[-81,162],[60,262],[-28,286],[13,172]],[[47655,55121],[44,0],[17,258],[-22,114],[27,82],[103,71],[-69,473],[-64,245],[23,200],[55,46]],[[47769,56610],[36,54],[77,-89],[215,-5],[51,172],[48,-11],[80,67],[43,-253],[65,74],[114,88]],[[49214,56277],[74,-841],[-117,-496],[-73,-667],[121,-509],[-13,-233]],[[53632,51919],[-35,32],[-164,-76],[-169,79],[-132,-38]],[[53132,51916],[-452,13]],[[52680,51929],[40,466],[-108,391]],[[52429,53151],[-72,85],[4,163]],[[52361,53399],[71,418],[132,570],[81,6],[165,345],[105,10],[156,-243],[191,199],[26,246],[63,238],[43,299],[148,243],[56,414],[59,132],[39,307],[74,377],[234,457],[14,196],[31,107],[-110,235]],[[53939,57955],[9,188],[78,34]],[[54026,58177],[111,-378],[18,-392],[-10,-393],[151,-537],[-155,6],[-78,-42],[-127,60],[-60,-279],[164,-345],[121,-100],[39,-245],[87,-407],[-43,-160]],[[54447,51919],[-20,-319],[-220,140],[-225,156],[-350,23]],[[58564,52653],[-16,-691],[111,-80],[-89,-210],[-107,-157],[-106,-308],[-59,-274],[-15,-475],[-65,-225],[-2,-446]],[[58216,49787],[-80,-165],[-10,-351],[-38,-46],[-26,-323]],[[58149,47921],[50,-544],[-27,-307]],[[58172,47070],[55,-343],[161,-330]],[[58388,46397],[150,-745]],[[58538,45652],[-109,60],[-373,-99],[-75,-71],[-79,-377],[62,-261],[-49,-699],[-34,-593],[75,-105],[194,-230],[76,107],[23,-637],[-212,5],[-114,325],[-103,252],[-213,82],[-62,310],[-170,-187],[-222,83],[-93,268],[-176,55],[-131,-15],[-15,184],[-96,15]],[[53609,47755],[73,-60],[95,226],[152,-6],[17,-167],[104,-105],[164,370],[161,289],[71,189],[-10,486],[121,574],[127,304],[183,285],[32,189],[7,216],[45,205],[-14,335],[34,524],[55,368],[83,316],[16,357]],[[57603,53672],[169,-488],[124,-71],[75,99],[128,-39],[155,125],[66,-252],[244,-393]],[[53081,48229],[212,326],[-105,391],[95,148],[187,73],[23,261],[148,-283],[245,-25],[85,279],[36,393],[-31,461],[-131,350],[120,684],[-69,117],[-207,-48],[-78,305],[21,258]],[[29063,50490],[-119,140],[-137,195],[-79,-94],[-235,82],[-68,255],[-52,-10],[-278,338]],[[28366,54848],[36,287],[89,-43],[52,176],[-64,348],[34,86]],[[30185,57537],[-178,-99],[-71,-295],[-107,-169],[-81,-220],[-34,-422],[-77,-345],[144,-40],[35,-271],[62,-130],[21,-238],[-33,-219],[10,-123],[69,-49],[66,-207],[357,57],[161,-75],[196,-508],[112,63],[200,-32],[158,68],[99,-102],[-50,-318],[-62,-199],[-22,-423],[56,-393],[79,-175],[9,-133],[-140,-294],[100,-130],[74,-207],[85,-589]],[[30585,48040],[-139,314],[-83,14],[179,602],[-213,276],[-166,-51],[-101,103],[-153,-157],[-207,74],[-163,620],[-129,152],[-89,279],[-184,280],[-74,-56]],[[26191,57131],[42,76],[183,-156],[63,77],[89,-50],[46,-121],[82,-40],[66,126]],[[27070,56232],[-107,-53],[1,-238],[58,-88],[-41,-70],[10,-107],[-23,-120],[-14,-117]],[[59437,71293],[-30,21],[-53,-45],[-42,12],[-14,-22],[-5,59],[-20,37],[-54,6],[-75,-51],[-52,31]],[[53776,79457],[-157,254],[-141,142],[-30,249],[-49,176],[202,129],[103,147],[200,114],[70,113],[73,-68],[124,62]],[[54171,80775],[132,-191],[207,-51],[-17,-163],[151,-122],[41,153],[191,-66],[26,-185],[207,-36],[127,-291]],[[55236,79823],[-82,-1],[-43,-106],[-64,-26],[-18,-134],[-54,-28],[-7,-55],[-95,-61],[-123,10],[-39,-130]],[[53922,82340],[64,-300],[-77,-158],[101,-210],[69,-316],[-22,-204],[114,-377]],[[52074,78715],[35,421],[140,404],[-400,109],[-131,155]],[[51718,79804],[16,259],[-56,133]],[[51710,80596],[-47,619],[167,0],[70,222],[69,541],[-51,200]],[[52368,83053],[210,-78],[178,90]],[[61984,57352],[-102,-317]],[[61882,57035],[-62,106],[-67,-42],[-155,10],[-4,180],[-22,163],[94,277],[98,261]],[[61764,57990],[119,-51],[83,144]],[[52293,84144],[80,177],[244,37]],[[30081,61241],[5,161],[-71,177],[68,99],[21,228],[-24,321]],[[53333,64447],[-952,-1126],[-804,-1161],[-392,-263]],[[51185,61897],[-308,-58],[-3,376],[-129,96],[-173,169],[-66,277],[-937,1289],[-937,1289]],[[48632,65335],[-1045,1431]],[[47587,66766],[6,114],[-1,40]],[[47592,66920],[-2,700],[449,436],[277,90],[227,159],[107,295],[324,234],[12,438],[161,51],[126,219],[363,99],[51,230],[-73,125],[-96,624],[-17,359],[-104,379]],[[52339,72408],[-57,-303],[44,-563],[-65,-487],[-171,-330],[24,-445],[227,-352],[3,-143],[171,-238],[118,-1061]],[[52633,68486],[90,-522],[15,-274],[-49,-482],[21,-270],[-36,-323],[24,-371],[-110,-247],[164,-431],[11,-253],[99,-330],[130,109],[219,-275],[122,-370]],[[29063,50490],[38,-449],[-86,-384],[-303,-619],[-334,-233],[-170,-514],[-53,-398],[-157,-243],[-116,298],[-113,64],[-114,-47],[-8,216],[79,141],[-33,246]],[[60240,63578],[-1102,0],[-1077,0],[-1117,0]],[[56944,63578],[0,2175],[0,2101],[-83,476],[71,365],[-43,253],[101,283]],[[59518,69025],[182,-1015]],[[61764,57990],[-95,191],[-114,346],[-124,190],[-71,204],[-242,237],[-191,7],[-67,124],[-163,-139],[-168,268],[-87,-441],[-323,124]],[[60119,59101],[-30,236],[120,868],[27,393],[88,181],[204,97],[141,337]],[[60669,61213],[161,-684],[77,-542]],[[47783,76427],[340,-106],[373,3]],[[49471,76235],[111,-230],[511,-268],[101,127],[313,-267],[322,77]],[[49600,72702],[-197,-454],[-352,-9]],[[47929,72498],[-23,195],[103,222],[38,161],[-96,175],[77,388],[-111,355],[120,48],[11,280],[45,86],[3,461],[129,160],[-78,296],[-162,21],[-47,-75],[-164,0],[-70,289],[-113,-86],[-101,-150]],[[57772,85719],[42,-103],[-198,-341],[83,-551],[-120,-187]],[[57579,84537],[-229,1],[-239,219],[-121,73],[-237,-105]],[[61882,57035],[-61,-209],[103,-325],[102,-285],[106,-210],[909,-702],[233,4]],[[63274,55308],[-785,-1773],[-362,-26],[-247,-417],[-178,-11],[-76,-186]],[[61626,52895],[-190,0],[-112,200],[-254,-247],[-82,-247],[-185,47],[-62,68],[-65,-16],[-87,6],[-352,502],[-193,0],[-95,194],[0,332],[-145,99]],[[59804,53833],[-164,643],[-127,137],[-48,236],[-141,288],[-171,42],[95,337],[147,14],[42,181]],[[59437,55711],[-4,531]],[[59433,56242],[82,618],[132,166],[28,241],[119,451],[168,293],[112,582],[45,508]],[[57942,91385],[-41,-414],[425,-394],[-256,-445],[323,-673],[-187,-506],[250,-440],[-113,-385],[411,-405],[-105,-301],[-258,-341],[-594,-755]],[[56352,85938],[-161,323],[-269,193],[62,582]],[[55984,87036],[-135,533],[133,345]],[[56639,89578],[-93,230],[-8,910],[-433,402],[-371,289]],[[55734,91409],[167,156],[309,-312],[362,29],[298,-143],[265,262],[137,433],[431,200],[356,-235],[-117,-414]],[[34854,51946],[70,252],[24,269],[48,253],[-107,349]],[[34889,53069],[-22,404],[144,508]],[[51576,79843],[62,-52],[80,13]],[[51900,77752],[-11,-167],[82,-222],[-97,-180],[72,-457],[151,-75],[-32,-256]],[[49176,78685],[-424,227],[-28,431]],[[52636,51176],[94,35],[404,-6],[-2,711]],[[48278,82406],[-210,122],[-172,-9],[57,317],[-57,317]],[[49420,83612],[22,-62],[248,-697]],[[49690,82853],[190,-95],[171,-673],[79,-233],[337,-113],[-34,-378],[-142,-173],[111,-305],[-250,-310],[-371,6],[-473,-163],[-130,116],[-183,-276],[-257,67],[-195,-226],[-148,118],[407,621],[249,127]],[[49051,80963],[-2,1],[-434,98]],[[48615,81062],[-79,235],[291,183],[-152,319],[52,387]],[[48727,82186],[413,-54],[1,0]],[[49141,82132],[40,343]],[[49181,82475],[-186,364],[-4,8]],[[48991,82847],[-337,104],[-66,160],[101,264],[-92,163],[-149,-279],[-17,569],[-140,301],[101,611],[216,480],[222,-47],[335,49],[-297,-639],[283,81],[304,-3],[-72,-481],[-250,-530],[287,-38]],[[61098,76242],[34,70],[235,-101],[409,-96],[378,-283],[48,-110],[169,93],[259,-124],[85,-242],[175,-137]],[[62106,74858],[-268,290],[-296,-28]],[[50006,57090],[-20,-184],[116,-305],[-1,-429],[27,-466],[69,-215],[-61,-532],[22,-294],[74,-375],[62,-207]],[[47655,55121],[-78,15],[-57,-238],[-78,3],[-55,126],[19,237],[-116,362],[-73,-67],[-59,-13]],[[47158,55546],[-77,-34],[3,217],[-44,155],[9,171],[-60,249],[-78,211],[-222,1],[-65,-112],[-76,-13],[-48,-128],[-32,-163],[-148,-260]],[[45797,57103],[123,288],[84,-11],[73,99],[61,1],[44,78],[-24,196],[31,62],[5,200]],[[46194,58016],[134,-6],[200,-144],[61,13],[21,66],[151,-47],[40,33]],[[46801,57931],[16,-216],[44,1],[73,78],[46,-19],[77,-150],[119,-48],[76,128],[90,79],[67,83],[55,-15],[62,-130],[33,-163],[114,-248],[-57,-152],[-11,-192],[59,58],[35,-69],[-15,-176],[85,-170]],[[45357,58612],[302,17],[63,140],[88,9],[110,-145],[86,-3],[92,99],[56,-170],[-120,-133],[-121,11],[-119,124],[-103,-136],[-50,-5],[-67,-83],[-253,13]],[[45367,57897],[147,96],[92,-19],[75,67],[513,-25]],[[56638,74190],[-154,-1],[-147,305]],[[56486,73734],[-105,-129],[155,-273]],[[56431,72099],[-184,-8],[-228,257],[-104,473]],[[55838,74710],[182,53],[106,129],[150,-12],[46,103],[53,20]],[[57254,75292],[135,-157],[-86,-369],[-66,-67]],[[24381,59170],[7,172],[32,138],[-39,111],[133,481],[357,2],[7,201],[-45,36],[-31,128],[-103,136],[-103,198],[125,1],[1,333],[259,1],[257,-7]],[[25493,59872],[-127,-225],[-131,-166],[-20,-113],[22,-116],[-58,-150]],[[25179,59102],[-65,-37],[15,-69],[-52,-66],[-95,-149],[-9,-86]],[[34125,54109],[-44,-532],[-169,-154],[15,-139],[-51,-305],[123,-429],[89,-1],[37,-333],[169,-514]],[[33129,53652],[-188,448],[75,163],[-5,273],[171,95],[69,110],[-95,220],[24,215],[220,347]],[[25697,58436],[-84,51]],[[25613,58487],[19,237],[-38,64],[-57,42],[-122,-70],[-10,79],[-84,95],[-60,118],[-82,50]],[[25860,59889],[128,15],[90,66]],[[26903,59440],[-95,12],[-38,-81],[-97,-77],[-70,0],[-61,-76],[-56,27],[-47,90],[-29,-17],[-36,-141],[-27,5],[-4,-121],[-97,-163],[-51,-70],[-29,-74],[-82,120],[-60,-158],[-58,4],[-65,-14],[6,-290],[-41,-5],[-35,-135],[-86,-25]],[[55230,77704],[67,-229],[89,-169],[-107,-222]],[[55155,75778],[-31,-100]],[[54448,76285],[-233,434],[56,45]],[[53809,77462],[194,-20],[51,100],[94,-97],[109,-11],[-1,165],[97,60],[27,239],[221,157]],[[54601,78055],[88,-73],[208,-253],[229,-114],[104,89]],[[54716,79012],[141,-151],[103,-65],[233,73],[22,118],[111,18],[135,92],[30,-38],[130,74],[66,139],[91,36],[297,-180],[59,61]],[[56134,79189],[155,-161],[19,-159]],[[56308,78869],[-170,-123],[-131,-401],[-168,-401],[-223,-111]],[[55616,77833],[-173,26],[-213,-155]],[[54601,78055],[-54,200],[-47,6]],[[84713,45326],[28,-117],[5,-179]],[[89166,49043],[5,-1925],[4,-1925]],[[80461,51765],[47,-395],[190,-334],[179,121],[177,-43],[162,299],[133,52],[263,-166],[226,126],[143,822],[107,205],[96,672],[319,0],[241,-100]],[[72530,68413],[-176,-268],[-108,-553],[269,-224],[262,-289],[362,-332],[381,-76],[160,-301],[215,-56],[334,-138],[231,10],[32,234],[-36,375],[21,255]],[[77035,67277],[20,-224],[-97,-108],[23,-364],[-199,107],[-359,-408],[8,-338],[-153,-496],[-14,-288],[-124,-487],[-217,135],[-11,-612],[-63,-201],[30,-251],[-137,-140]],[[73107,61020],[-276,-387],[-1,-271]],[[72692,60216],[-251,-212],[-129,-31]],[[71996,56025],[-253,-168],[-93,-401]],[[68937,64577],[185,395],[612,-2],[-56,507],[-156,300],[-31,455],[-182,265],[306,619],[323,-45],[290,620],[174,599],[270,593],[-4,421],[236,342],[-224,292],[-96,400],[-99,517],[137,255],[421,-144],[310,88],[268,496]],[[64978,72558],[244,114],[197,338],[186,-17],[122,110],[197,-55],[308,-299],[221,-65],[318,-523],[207,-21],[24,-498]],[[66909,68203],[137,-310],[112,-357],[266,-260],[7,-520],[133,-96],[23,-272],[-400,-305],[-105,-687]],[[66559,65575],[-303,136],[-313,76]],[[63594,68492],[-104,-231]],[[63490,68261],[-153,311],[-3,314],[-89,0],[46,428],[-143,449],[-340,324],[-193,562],[65,461],[139,204],[-21,345],[-182,177],[-180,705]],[[62436,72541],[-152,473],[55,183],[-87,678],[190,168]],[[63326,68290],[-187,49],[-204,-567]],[[62935,67772],[-516,47],[-784,1188],[-413,414],[-335,160]],[[60887,69581],[-112,720]],[[60775,70301],[615,614],[105,715],[-26,431],[152,146],[142,369]],[[61763,72576],[119,92],[324,-77],[97,-150],[133,100]],[[63490,68261],[-164,29]],[[59873,69719],[-100,82],[-58,-394],[69,-66],[-71,-81],[-12,-156],[131,80]],[[59832,69184],[7,-230],[-139,-944]],[[59757,70130],[93,-1],[25,104],[75,8]],[[59950,70241],[4,-242],[-38,-90],[6,-4]],[[59922,69905],[-49,-186]],[[53835,78058],[-31,-291],[67,-251]],[[54413,75123],[249,-214],[204,-178]],[[53108,75604],[-189,340],[-86,585]],[[59922,69905],[309,-234],[544,630]],[[60887,69581],[-53,-89],[-556,-296],[277,-591],[-92,-101],[-46,-197],[-212,-82],[-66,-213],[-120,-182],[-310,94]],[[59832,69184],[41,173],[0,362]],[[69711,75551],[-159,-109],[-367,-412],[-121,-422],[-104,-4],[-76,280],[-353,19],[-57,484],[-135,4],[21,593],[-333,431],[-476,-46],[-326,-86],[-265,533],[-227,223],[-431,423],[-52,51],[-715,-349],[11,-2178]],[[65546,74986],[-142,-29],[-195,463],[-188,166],[-315,-123],[-123,-197]],[[63639,77993],[-142,96],[29,304],[-177,395],[-207,-17],[-235,401],[160,448],[-81,120],[222,649],[285,-342],[35,431],[573,643],[434,15],[612,-409],[329,-239],[295,249],[440,12],[356,-306],[80,175],[391,-25],[69,280],[-450,406],[267,288],[-52,161],[266,153],[-200,405],[127,202],[1039,205],[136,146],[695,218],[250,245],[499,-127],[88,-612],[290,144],[356,-202],[-23,-322],[267,33],[696,558],[-102,-185],[355,-457],[620,-1500],[148,309],[383,-340],[399,151],[154,-106],[133,-341],[194,-115],[119,-251],[358,79],[147,-361]],[[72294,75601],[-171,87],[-140,212],[-412,62],[-461,16],[-100,-65],[-396,248],[-158,-122],[-43,-349],[-457,204],[-183,-84],[-62,-259]],[[60889,47817],[-399,590],[-19,343],[-1007,1203],[-47,65]],[[59417,50018],[-3,627],[80,239],[137,391],[101,431],[-123,678],[-32,296],[-132,411]],[[59445,53091],[171,352],[188,390]],[[61626,52895],[-243,-670],[3,-2152],[165,-488]],[[70465,73876],[-526,-89],[-343,192],[-301,-46],[26,340],[303,-98],[101,182]],[[69725,74357],[212,-58],[355,425],[-329,311],[-198,-147],[-205,223],[234,382],[-83,58]],[[78495,57780],[-66,713],[178,492],[359,112],[261,-84]],[[79227,59013],[229,-232],[126,407],[246,-217]],[[79828,58971],[64,-394],[-34,-708],[-467,-455],[122,-358],[-292,-43],[-240,-238]],[[85103,71220],[51,443],[-122,615]],[[85048,72883],[17,54],[124,-21],[108,266],[197,29],[118,39],[40,143]],[[55575,75742],[52,132]],[[55627,75874],[66,43],[38,196],[50,33],[40,-84],[52,-36],[36,-94],[46,-28],[54,-110],[39,4],[-31,-144],[-33,-71],[9,-44]],[[55993,75539],[-62,-23],[-164,-91],[-13,-121],[-35,5]],[[63448,67449],[-196,-16],[-69,282],[-248,57]],[[79227,59013],[90,266],[12,500],[-224,515],[-18,583],[-211,480],[-210,40],[-56,-205],[-163,-17],[-83,104],[-293,-353],[-6,530],[68,623],[-188,27],[-16,355],[-120,182]],[[77809,62643],[59,218],[237,384]],[[78380,63852],[162,-466],[125,-537],[342,-5],[108,-515],[-178,-155],[-80,-212],[333,-353],[231,-699],[175,-520],[210,-411],[70,-418],[-50,-590]],[[59999,71049],[125,-31],[45,-231],[-151,-223],[-68,-323]],[[47498,53435],[-252,449],[-237,324]],[[46822,54589],[66,189],[15,172],[126,320],[129,276]],[[54125,64088],[-197,-220],[-156,324],[-439,255]],[[52633,68486],[136,137],[24,250],[-30,244],[191,228],[86,189],[135,170],[16,454]],[[56646,69496],[276,-70],[68,-195]],[[56944,63578],[0,-1180],[-320,-2],[-3,-248]],[[56621,62148],[-1108,1131],[-1108,1132],[-280,-323]],[[57708,32474],[-209,454],[148,374],[151,232],[130,120],[121,-182],[96,-178],[-85,-288],[-47,-192],[-155,-93],[-51,-188],[-99,-59]],[[56314,82678],[-23,150],[30,162],[-123,94],[-291,103]],[[55848,83684],[318,181],[466,-38],[273,59],[39,-123],[148,-38],[267,-287]],[[56523,82432],[-67,182],[-142,64]],[[57579,84537],[134,-136],[24,-287],[89,-348]],[[47592,66920],[-42,0],[7,-317],[-172,-19],[-90,-134],[-126,0],[-100,76],[-234,-63],[-91,-460],[-86,-44],[-131,-745],[-386,-637],[-92,-816],[-114,-265],[-33,-213],[-625,-48],[-5,1]],[[45272,63236],[13,274],[106,161],[91,308],[-18,200],[96,417],[155,376],[93,95],[74,344],[6,315],[100,365],[185,216],[177,603]],[[46350,66910],[5,8],[139,227]],[[46494,67145],[259,65],[218,404],[140,158]],[[57394,79070],[66,87],[185,58],[204,-184],[115,-22],[125,-159],[-20,-200],[101,-97],[40,-247],[97,-150],[-19,-88],[52,-60],[-74,-44],[-164,18],[-27,81],[-58,-47],[20,-106],[-76,-188],[-49,-203],[-70,-64]],[[57842,77455],[-50,270],[30,252],[-9,259],[-160,352],[-89,249],[-86,175],[-84,58]],[[23016,65864],[-107,-518],[-49,-426],[-20,-791],[-27,-289],[48,-322],[86,-288],[56,-458],[184,-440],[65,-337],[109,-291],[295,-157],[114,-247],[244,165],[212,60],[208,106],[175,101],[176,241],[67,345],[22,496],[48,173],[188,155],[294,137],[246,-21],[169,50],[66,-125],[-9,-285],[-149,-351],[-66,-360],[51,-103],[-42,-255],[-69,-461],[-71,152],[-58,-10]],[[24067,59806],[-144,191],[-226,155]],[[19641,66203],[-142,138],[-164,287]],[[18570,68996],[-201,234],[-93,-25]],[[19362,64423],[-181,337],[-201,286]],[[17464,69802],[316,46],[353,64],[-26,-116],[419,-287],[634,-416],[552,4],[221,0],[0,244],[481,0],[102,-210],[142,-186],[165,-260],[92,-309],[69,-325],[144,-178],[230,-177],[175,467],[227,11],[196,-236],[139,-404],[96,-346],[164,-337],[61,-414],[78,-277],[217,-184],[197,-130],[108,18]],[[55993,75539],[95,35],[128,9]],[[46619,59216],[93,107],[47,348],[88,14],[194,-165],[157,117],[107,-39],[42,131],[1114,9],[62,414],[-48,73],[-134,2550],[-134,2550],[425,10]],[[51185,61897],[1,-1361],[-152,-394],[-24,-364],[-247,-94],[-379,-51],[-102,-210],[-178,-23]],[[46801,57931],[13,184],[-24,229],[-104,166],[-54,338],[-13,368]],[[77809,62643],[-159,-137],[-162,-256],[-196,-26],[-127,-639],[-117,-107],[134,-519],[177,-431],[113,-390],[-101,-514],[-96,-109],[66,-296],[185,-470],[32,-330],[-4,-274],[108,-539],[-152,-551],[-135,-607]],[[55338,76294],[74,-101],[40,-82],[91,-63],[106,-123],[-22,-51]],[[55380,75322],[-58,46]],[[74375,79706],[292,102],[530,509],[423,278],[242,-182],[289,-8],[186,-276],[277,-22],[402,-148],[270,411],[-113,348],[288,612],[311,-244],[252,-69],[327,-152],[53,-443],[394,-248],[263,109],[351,78],[279,-78],[272,-284],[168,-302],[258,6],[350,-96],[255,146],[366,98],[407,416],[166,-63],[146,-198],[331,49]],[[59599,43773],[209,48],[334,-166],[73,74],[193,16],[99,177],[167,-10],[303,230],[221,342]],[[59870,36949],[-45,-275],[65,-101]],[[59890,36573],[-41,-245],[-116,-211]],[[59119,34780],[-211,5]],[[58908,34785],[-24,261],[-41,265]],[[58843,35311],[-23,212],[49,659],[-72,419],[-133,832]],[[58664,37433],[292,671],[74,426],[42,53],[31,348],[-45,175],[12,442],[54,409],[0,748],[-145,190],[-132,43],[-60,146],[-128,125],[-232,-12],[-18,220]],[[58409,41417],[-26,421],[843,487]],[[59226,42325],[159,-284],[77,54],[110,-149],[16,-237],[-59,-274],[21,-417],[181,-365],[85,410],[120,124],[-24,760],[-116,427],[-100,191],[-97,-9],[-77,768],[77,449]],[[46619,59216],[-184,405],[-168,435],[-184,157],[-133,173],[-155,-6],[-135,-129],[-138,51],[-96,-189]],[[45260,62987],[60,197],[1088,-4],[-53,853],[68,304],[261,53],[-9,1512],[911,-31],[1,895]],[[59226,42325],[-147,153],[85,549],[87,205],[-53,490],[56,479],[47,160],[-71,501],[-131,264]],[[59099,45126],[273,-110],[55,-164],[95,-275],[77,-804]],[[77801,54399],[48,105],[227,-258],[22,-304],[183,71],[91,243]],[[56448,40227],[228,134],[180,-34],[109,-133],[2,-49]],[[55526,35946],[0,-2182],[-248,-302],[-149,-43],[-175,112],[-125,43],[-47,252],[-109,162],[-133,-292]],[[54125,64088],[68,-919],[104,-153],[4,-188],[116,-203],[-60,-254],[-107,-1199],[-15,-769],[-354,-557],[-120,-778],[115,-219],[0,-380],[178,-13],[-28,-279]],[[53939,57955],[-52,-13],[-188,647],[-65,24],[-217,-331],[-215,173],[-150,34],[-80,-83],[-163,18],[-164,-252],[-141,-14],[-337,305],[-131,-145],[-142,10],[-104,223],[-279,221],[-298,-70],[-72,-128],[-39,-340],[-80,-238],[-19,-527]],[[52072,53186],[-105,31],[-107,-132]],[[51398,53895],[-197,389],[-209,-7]],[[25647,58207],[31,91],[46,-88]],[[51063,81078],[244,869],[380,248]],[[58639,91676],[-473,-237],[-224,-54]],[[55734,91409],[-172,-24],[-41,-389],[-523,95],[-74,-329],[-267,2],[-183,-421],[-278,-655],[-431,-831],[101,-202],[-97,-234],[-275,10],[-180,-554],[17,-784],[177,-300],[-92,-694],[-231,-405],[-122,-341]],[[52328,85032],[-371,-138],[-384,301]],[[51474,85830],[-88,1363],[256,381]],[[65352,60997],[1,-238],[-134,-165]],[[64880,60451],[-128,-34]],[[64752,60417],[-91,413],[-217,975]],[[64444,61805],[833,591],[185,1182],[-127,418]],[[65945,64688],[203,-78],[165,-107]],[[68734,64727],[-83,424],[-215,450]],[[28212,55535],[-52,196],[-138,164]],[[27170,56020],[-6,-126],[111,-26]],[[55461,82736],[342,-67],[511,9]],[[56535,81053],[139,-515],[-29,-166],[-138,-69],[-252,-491],[71,-266],[-60,35]],[[56266,79581],[-264,227],[-200,-84],[-131,61],[-165,-127],[-140,210],[-114,-81],[-16,36]],[[86221,75560],[-120,-200],[-83,-202]],[[85048,72883],[-135,112],[-34,-111]],[[84641,73095],[76,260],[66,69]],[[84829,73851],[-18,96],[-163,65]],[[86288,75628],[39,-104]],[[64246,66009],[84,-185],[5,-346]],[[64274,65130],[-77,-42],[-84,117]],[[56308,78869],[120,127],[172,-65],[178,-3],[129,-144],[95,91],[205,56],[69,139],[118,0]],[[57842,77455],[124,-109],[131,95],[126,-101]],[[56293,76715],[-51,103],[65,99],[-69,74],[-87,-133],[-162,172],[-22,244],[-169,139],[-31,188],[-151,232]],[[81143,94175],[251,112],[141,-379]],[[84237,94144],[590,-104],[443,4]],[[97224,91732],[123,262],[886,-165]],[[96192,85904],[-126,219],[-268,-253]],[[95032,82989],[-486,-302],[-96,-674]],[[93543,84472],[14,276],[432,132]],[[95182,86999],[-705,-649],[-227,727]],[[90412,85637],[-914,-175],[-899,-1153]],[[88378,82339],[178,295],[305,-38]],[[89262,81946],[9,-503],[-217,-590]],[[60617,78409],[9,262],[143,165],[269,43],[44,197],[-62,326],[113,310],[-3,173],[-410,192],[-162,-6],[-172,277],[-213,-94],[-352,208],[6,116],[-99,256],[-222,29],[-23,183],[70,120],[-178,334],[-288,-57],[-84,30],[-70,-134],[-104,23]],[[58639,91676],[286,206],[456,-358],[761,-140],[1050,-668],[213,-281],[18,-393],[-308,-311],[-454,-157],[-1240,449],[-204,-75],[453,-433]],[[59670,89515],[18,-274],[18,-604]],[[59706,88637],[358,-180],[217,-153],[36,286]],[[60317,88590],[-168,254],[177,224]],[[60998,88700],[233,144],[-186,433]],[[62654,90499],[1,-328],[219,-203]],[[63371,90473],[580,282],[970,507]],[[69038,93080],[183,537],[206,116]],[[69427,93733],[736,-156],[57,-328]],[[70444,91717],[222,593],[-361,482]],[[72363,94093],[483,119],[669,-26]],[[58449,49909],[110,-333],[-16,-348],[-80,-74]],[[58216,49787],[67,-60],[166,182]],[[61883,60238],[-37,252],[-83,178]],[[60335,65400],[-77,306],[-81,132]],[[63741,66597],[190,-249],[16,-243]],[[64444,61805],[-801,-226],[-259,-266],[-199,-620],[-130,-99],[-70,197],[-106,-30],[-269,60],[-50,59],[-321,-14],[-75,-53],[-114,153],[-74,-290],[28,-249],[-121,-189]],[[56351,57163],[3,143],[-102,174],[-3,343],[-58,228],[-98,-34],[28,217],[72,246],[-32,245],[92,181],[-58,138],[73,365],[127,435],[240,-41],[-14,2345]],[[59433,56242],[1,-71]],[[59434,56171],[-39,12],[5,294],[-33,203],[-143,233],[-34,426],[34,436],[-129,41],[-19,-132],[-167,-30],[67,-173],[23,-355],[-152,-324],[-138,-426],[-144,-61],[-233,345],[-105,-122],[-29,-172],[-143,-112],[-9,-122],[-277,0],[-38,122],[-200,20],[-100,-101],[-77,51],[-143,344],[-48,163],[-200,-81],[-76,-274],[-72,-528],[-95,-111],[-85,-65]],[[56635,55672],[-23,28]],[[59445,53091],[-171,-272],[-195,1],[-224,-138],[-176,132],[-115,-161]],[[56824,55442],[-189,230]],[[59434,56171],[3,-460]],[[25613,58487],[-31,-139]],[[62075,57243],[54,-245],[125,-247]],[[63596,57321],[-2,-9],[-1,-244],[0,-596],[0,-308],[-125,-363],[-194,-493]],[[34889,53069],[109,-351],[-49,-254],[-24,-270],[-71,-248]],[[56266,79581],[-77,-154],[-55,-238]],[[58908,34785],[-56,-263],[-163,-63],[-166,320],[-2,204],[76,222],[26,172],[80,42],[140,-108]],[[60041,71744],[74,129],[75,130],[15,329],[91,-115],[306,165],[147,-112],[229,2],[320,222],[149,-10],[316,92]],[[68841,72526],[156,598],[-60,440],[-204,140],[72,261],[232,-28],[132,326],[89,380],[371,137],[-58,-274],[40,-164],[114,15]],[[65546,74986],[313,8],[-45,297],[237,204],[234,343],[374,-312],[30,-471],[106,-121],[301,27],[93,-108],[137,-609],[317,-408],[181,-278],[291,-289],[369,-253],[-7,-362]],[[53083,72381],[-139,-290],[-2,-273]],[[58441,72005],[-192,-70],[-268,314]],[[57981,72249],[-303,-11],[-165,588]],[[59768,75418],[485,-417],[399,-228]],[[57321,74302],[-87,276],[3,121]],[[59099,45126],[-157,177],[-177,100],[-111,99],[-116,150]],[[58388,46397],[-161,331],[-55,342]],[[58449,49909],[98,71],[304,-7],[566,45]],[[30523,76389],[-147,-351],[-47,-133]],[[30377,75084],[-133,11],[-205,-103]],[[29172,73738],[-61,30],[-91,148]],[[29077,73598],[69,-105],[5,-223]],[[28966,72994],[-142,225],[-33,491]],[[28797,73080],[-183,93],[191,-191]],[[27672,65472],[-83,-75],[-137,72]],[[27408,65728],[-105,136],[-148,508]],[[26747,68267],[-108,90],[-281,-268]],[[26309,68119],[-135,275],[-174,147]],[[25227,68491],[-114,-92],[50,-157]],[[24755,67801],[-207,312],[-242,-73]],[[16564,70932],[-71,95],[-33,324]],[[16460,71351],[-270,594],[-231,821],[10,137],[-123,195],[-215,495],[-38,482],[-148,323],[61,489],[-10,507],[-89,453],[109,557]],[[15516,76404],[34,536],[33,536]],[[15583,77476],[-50,792],[-88,506],[-80,274],[33,115],[402,-200],[148,-558]],[[15948,78405],[69,156],[-45,484],[-94,485]],[[10396,86079],[-385,-51],[-546,272]],[[8164,85656],[-308,-126],[-39,348]],[[7158,84934],[-299,-248],[-278,-180]],[[4985,85596],[50,216],[-179,211]],[[4541,89915],[-38,-296],[586,23]],[[4864,90008],[-342,225],[-197,296]],[[30102,56752],[-123,-344],[105,-468]],[[31762,56607],[213,-74],[155,185]],[[63521,58853],[-122,-33],[-83,35]],[[63153,58610],[-177,-114],[-233,-30]],[[62539,58233],[-43,-150],[-137,13]],[[64752,60417],[-201,-158]],[[57838,31217],[-210,-269],[-290,-229]],[[58175,37528],[113,-7],[134,-100],[94,71],[148,-59]],[[58409,41417],[-210,-81],[-159,-235],[-33,-205],[-100,-46],[-241,-486],[-154,-383],[-94,-13],[-90,68],[-311,65]]]} \ No newline at end of file diff --git a/packages/flint-js/src/geo/world-bank-coarse.json b/packages/flint-js/src/geo/world-bank-coarse.json new file mode 100644 index 00000000..703bff70 --- /dev/null +++ b/packages/flint-js/src/geo/world-bank-coarse.json @@ -0,0 +1 @@ +{"type":"Topology","arcs":[[[78373,55973],[-166,-112],[79,-445],[-32,-348],[-120,25],[-39,278]],[[78095,55371],[-16,153],[-143,-234],[-91,11],[-71,173],[0,184],[-228,134],[59,249],[40,417],[-178,81],[10,166],[-105,511],[-179,-82],[-95,345],[48,394],[187,401],[106,733],[-22,645],[-102,-5],[-49,426],[-69,187],[-113,96],[-44,-204]],[[77040,60152],[-104,83],[-89,203],[-36,233],[-130,320],[-255,-211],[-123,164],[-98,-227],[-325,-404],[-144,-377],[-114,-19],[-101,-120],[-74,99]],[[75447,59896],[-487,266],[-73,-47],[-130,-395]],[[74757,59720],[-58,-206]],[[74699,59514],[-41,165],[32,215],[-69,187],[-140,-169]],[[74481,59912],[-114,-55],[-166,22],[-105,186],[-85,-134],[-151,144],[-66,140],[-154,31],[-44,168],[-199,224],[-15,249],[-151,-57],[-121,325],[-121,86],[-213,424],[-163,72],[-104,-161]],[[72509,61576],[-137,181]],[[72372,61757],[-93,100]],[[72279,61857],[-8,157],[-133,118]],[[72138,62132],[-80,73]],[[72058,62205],[-87,275],[-60,-121]],[[71911,62359],[-49,356]],[[71862,62715],[10,74]],[[71872,62789],[6,45]],[[71878,62834],[-76,235]],[[71802,63069],[-25,182]],[[71777,63251],[47,63]],[[71824,63314],[11,-10],[6,24]],[[71841,63328],[9,16]],[[71850,63344],[21,28]],[[71871,63372],[64,-259],[85,158]],[[72020,63271],[79,147],[-113,304]],[[71986,63722],[-60,147]],[[71926,63869],[16,467],[105,-30],[42,333],[153,178],[59,378],[-4,277],[-277,269],[-277,-192],[-89,-174]],[[71654,65375],[-172,29]],[[71482,65404],[-23,135],[-124,106],[-7,165],[-153,189],[-80,181]],[[71095,66180],[-146,121],[-17,135],[-220,52]],[[70712,66488],[90,146]],[[70802,66634],[73,125],[-71,182],[5,261],[-61,287],[-159,156],[-89,-21],[10,286],[-66,323]],[[70444,68233],[96,100],[26,360],[85,-4],[137,307],[111,-43],[96,145],[40,-260],[199,66],[86,403],[281,44],[108,263],[136,65],[188,244],[229,160],[8,128]],[[72270,70211],[-3,297],[63,268],[110,104],[-10,237],[-98,459],[4,358],[-147,216],[71,107],[211,48],[244,186],[41,-111],[183,-7],[-84,227],[15,290],[108,398],[86,525],[248,-171],[232,14],[51,-102],[205,259],[-39,566],[69,293],[219,87],[88,428],[109,-14]],[[74246,75173],[146,40]],[[74392,75213],[43,-428],[176,-170],[127,-251],[145,30],[140,-125],[224,-643],[50,-289],[-50,-178],[36,-209],[-98,-385],[74,-211],[189,-90],[525,-72],[415,-515],[112,32],[141,-762],[133,-367],[217,50],[285,-102],[363,-62],[226,87],[148,-10],[264,-122],[77,-200],[175,-53],[319,-253],[186,54],[-2,-154],[136,-56],[197,256],[296,253],[406,124],[166,-48],[193,53],[249,223],[175,413],[245,241],[-22,178],[-123,328],[96,420],[182,69],[117,-170],[218,-68],[198,271],[55,190],[227,3],[227,216],[63,312],[121,187],[148,-17],[258,270],[300,-94],[142,42],[-50,381],[-264,417],[-56,157],[-209,16],[-120,-269],[-140,182],[-170,-11],[-90,-142],[-100,172],[66,451],[251,933]],[[82420,75698],[302,-236],[209,291],[154,56],[106,535],[187,671],[136,180],[9,423],[-143,208],[142,262],[331,183],[485,87],[338,-294],[214,-40],[206,-501],[158,-955],[125,-342],[44,-550],[76,-161],[454,-110],[222,-414],[167,-406],[-46,-119],[101,-320],[407,20],[154,284],[399,225],[77,-510],[-165,-281],[-72,-751],[-217,-827],[-78,-47],[-284,179],[-201,-433],[55,-477],[-46,-798],[-188,-118],[50,-252]],[[86288,70360],[-6,8],[-13,3],[-2,22],[2,4],[4,1],[0,2],[-1,7],[-9,7],[1,15],[-1,7],[-7,14],[-4,28],[4,14],[-1,6],[-3,5],[-3,2],[-3,2],[-5,-5],[-4,-17],[0,-32],[-3,0],[-7,11],[0,10],[1,5],[4,12],[-4,10],[-5,-2],[-2,-7],[-2,-2],[-4,3],[0,9],[-7,17],[-6,5],[-8,17],[-2,16],[-1,6],[-5,1],[-4,1],[-3,11],[-1,5],[-1,2]],[[86177,70583],[-108,167],[-30,-356],[-122,-39],[-116,-277],[-207,-3],[47,-313],[-44,-146],[-253,82],[-99,210],[-240,-639],[-88,-25],[-270,-369]],[[84647,68875],[-52,-83],[-10,-16],[-46,-96],[1,-77],[-16,-24],[-2,-8],[-9,1],[-237,-106],[-280,-265],[-118,-276],[-231,-219],[-11,145],[165,128],[10,144],[-138,168],[175,322],[118,341],[-115,254],[-153,69],[-97,-62],[-148,-453],[-242,-208],[-121,-441],[-222,-192],[-160,55],[-52,-336],[141,-373],[226,13],[65,-238],[-43,-384],[99,-128],[119,24],[24,176],[246,328],[207,-255],[284,-44],[37,-148],[-79,-266],[-105,80],[-210,-181],[-143,-217],[0,-170],[-172,-191],[-102,-196],[-136,-413],[-8,-133],[106,-189],[193,-203],[137,-784],[45,-439],[133,-165],[-26,-617],[115,-166],[48,-317],[-108,-26],[-128,-162],[39,-186],[145,-252],[75,-543],[-127,-402],[-42,-373],[-102,-87],[-110,-312],[-33,-303],[-208,-398],[-57,-391],[16,-274],[-66,-298],[-70,-105],[-114,-372],[-136,-59],[-84,-360],[-90,-84],[-42,-202],[-119,1],[-68,-272],[-180,-310],[-245,11],[-94,-168],[-180,-41]],[[81729,56076],[-44,-19]],[[81685,56057],[-144,-54],[0,-163]],[[81541,55840],[-7,-23],[7,-32]],[[81541,55785],[-182,-202],[-179,-111],[-71,36],[-91,-151],[-250,-107],[-168,-299],[103,-363],[-69,-157],[-93,0],[-76,435],[30,342],[-299,259],[-202,-110]],[[79994,55357],[-166,37],[-129,272],[-66,22],[11,613],[-212,67],[-203,223],[-101,-229],[-251,-313],[-88,209],[-75,1],[-95,-256],[-145,241],[-101,-271]],[[83381,56347],[-40,106],[43,524],[240,891],[147,188],[89,-129],[-7,-420],[-63,-380],[-68,-631],[-104,-337],[-87,-399],[-106,305],[-44,282]],[[80354,54073],[125,174],[83,-40],[96,101],[161,-78],[9,-239],[-129,-465],[4,-147],[-257,-431],[-256,226],[-20,425],[19,195],[165,279]],[[90033,71580],[260,-239],[76,-359],[-67,-168],[-229,-34],[-181,-249],[-84,-433],[-232,158],[-162,221],[-120,8],[-131,-208],[-143,205],[-50,-248],[185,-236],[-144,-168],[-188,446],[32,266],[180,252],[175,87],[74,134],[-27,277],[93,225],[36,442],[-62,426],[107,202],[288,-689],[203,-315],[111,-3]],[[88189,64794],[-127,74],[-96,165],[-36,-283],[104,-121],[-172,-190],[-109,-453],[-146,35],[-85,228],[90,560],[-99,-52],[-27,-256],[-96,-105],[34,-213],[-94,-125],[-58,-288],[-125,208],[-132,-225],[-130,-343],[-86,160],[-48,360],[109,203],[20,174],[-101,264],[-80,-351],[-91,128],[-245,-69],[-3,290],[137,40],[454,807],[82,-53],[233,47],[105,99],[333,-126],[101,204],[-40,148],[217,597],[96,-21],[314,276],[94,148],[92,341],[94,101],[146,564],[82,520],[-51,286],[46,303],[-27,236],[86,101],[28,340],[85,-63],[71,219],[138,-70],[8,-485],[96,-258],[73,-555],[-36,-328],[-78,-97],[-53,-420],[-97,-12],[-45,-334],[32,-397],[-132,-767],[71,-379],[-112,-214],[-8,-204],[-159,-176],[-46,322],[-139,-109],[-4,-258],[-155,165],[-107,-365],[-196,52]],[[86225,63593],[-10,-161],[-188,39],[1,369],[216,360],[98,73],[69,-226],[181,-37],[-15,-219],[84,-326],[-84,-205],[-86,-799],[-109,-200],[-214,654],[101,273],[3,288],[-47,117]],[[86177,70583],[5,-19],[9,-4],[2,-16],[3,-10],[1,-3],[2,-5],[8,-8],[1,-3],[4,-7],[1,-4],[1,-12],[2,-1],[2,-2],[2,0],[4,8],[4,2],[-3,-33],[6,-11],[2,-1],[3,-4],[8,14],[-5,18],[-1,5],[0,1],[1,4],[6,12],[2,1],[6,-4],[2,-6],[-4,-17],[5,-31],[7,-12],[-1,-16],[1,-2],[0,-5],[2,-3],[6,-3],[1,-3],[0,-3],[-3,-2],[-3,-4],[1,-18],[3,-8],[21,-19],[-158,-227],[-120,-385],[18,-516],[-141,-104],[-152,-348],[-320,-335],[-17,-420],[253,-387]],[[85654,67627],[-86,-222],[-224,20],[-153,-353]],[[85191,67072],[-177,-18],[-98,105],[-65,-171],[-172,356],[153,834],[-48,158],[-182,92],[-72,125],[14,41],[0,85],[103,196]],[[99999,90885],[-323,-133],[-58,201],[381,331],[0,-399]],[[74246,75173],[-121,284],[-121,70],[-126,-85],[-160,105],[-98,299],[-212,192],[-122,403],[-107,94],[-187,-61],[-58,-129],[-310,7],[-76,307],[-203,17],[9,-173],[-114,-156],[-244,843],[-356,984],[-380,509],[-93,187],[-168,-115],[-308,-376],[-164,54],[-110,207],[-315,4],[-20,174],[-278,-1],[-84,639],[-57,154],[-156,-101],[-144,146],[-396,-105],[-129,-168],[-506,-249],[-42,52],[-308,-247],[-441,-123],[-359,-158],[-156,80],[-13,-746],[-149,-195],[98,-300],[-287,-311],[106,-192],[145,-23],[158,-150],[-15,-432],[-178,-107],[-226,13],[-51,-100],[-261,118],[-98,277],[-506,-8],[-288,-369],[-262,336],[-270,126],[-137,222],[-192,-41],[-63,207],[-251,-193],[-150,148],[-409,-598],[-168,-182],[24,-415],[-125,-131],[-233,451],[-72,-265],[-125,-166],[-34,-656],[-80,-372],[175,-118],[20,-366],[255,-11],[245,-720],[-125,-131],[214,-207]],[[63698,73130],[-28,-202],[-124,-104],[-11,-165],[-327,-11],[-134,-548],[-101,-132],[19,-205],[129,-121],[96,-360],[-32,-501],[312,-835]],[[63497,69946],[-143,-247],[-53,-201],[-91,-15],[-202,405],[-113,108]],[[62895,69996],[-226,214],[22,212],[-148,146],[-179,33],[-153,-148],[-111,230],[-195,224],[-345,30],[-266,246],[-158,-6],[-23,-122]],[[61113,71055],[-338,644],[-164,98],[-75,167],[-145,64],[-36,159],[-189,169],[68,183],[160,-89],[155,511],[21,436],[316,280],[2,180],[-269,-118]],[[60619,73739],[33,357],[148,186],[238,-34],[57,289],[-70,256],[137,500],[-165,314],[-345,207],[-81,-60],[-201,369],[-191,-158],[-135,153],[-148,-54],[-140,583],[-205,77],[-80,526],[-77,258],[-181,7],[-244,-194],[-141,6]],[[58828,77327],[-114,590],[14,199],[190,-95],[179,185],[-241,528],[-158,127],[-30,273],[-126,129],[76,184],[-26,404],[-183,173],[-427,74],[-163,146]],[[57819,80244],[-79,809],[-143,159]],[[57597,81212],[85,315],[-83,598],[235,423]],[[57834,82548],[64,226],[414,326],[-227,17],[-197,346],[-167,-75]],[[57721,83388],[399,520],[552,884],[101,295],[-96,222],[-352,388],[154,209],[-134,254],[0,281],[-116,192],[109,457],[-27,310],[-223,485],[-13,139],[238,379],[-167,397],[-189,87],[-59,247],[137,368]],[[58035,89502],[441,351],[85,178]],[[58561,90031],[182,-81],[171,190],[227,-120],[190,-339],[486,-42],[261,-104],[617,-547],[378,-217],[326,-288],[51,-578],[-338,-412],[-479,-144],[-759,236],[-179,150],[-409,105],[-103,-172],[411,-310],[121,-205],[-157,-300],[137,-347],[-34,-266],[254,-108],[153,-257],[331,-159],[176,164],[-79,255],[-176,12],[-142,372],[112,192],[621,-376],[343,-81],[3,162],[-223,415],[42,209],[248,261],[160,52],[269,321],[489,-226],[118,520],[-191,310],[136,391],[-62,458],[479,-43],[197,-241],[51,-235],[-388,-84],[-105,-254],[305,-369],[433,61],[120,518],[179,44],[560,441],[522,223],[269,213],[117,-322],[-205,-137],[-60,-203],[202,-86],[149,253],[481,301],[297,-86],[507,326],[266,-231],[191,41],[120,256],[-180,277],[162,289],[519,-100],[436,-161],[1170,-888],[214,505],[-207,-13],[-115,372],[-372,182],[175,714],[-141,405],[383,279],[195,739],[157,124],[570,22],[309,-124],[27,-328],[-145,-400],[-133,-130],[264,-464],[-14,-344],[-97,-98],[74,-373],[-46,-394],[74,-270],[231,-223],[-139,-211],[29,-203],[-321,-636],[-270,-171],[-267,-51],[-215,81],[-523,-45],[206,-209],[168,186],[183,-195],[259,-113],[548,-14],[37,206],[381,284],[75,323],[171,179],[21,195],[-141,288],[44,243],[482,199],[278,-301],[89,-313],[177,97],[-148,460],[-267,173],[-326,80],[-122,-108],[-329,-15],[-95,476],[40,268],[172,357],[-196,422],[-163,143],[171,314],[580,319],[-136,-305],[171,-451],[447,-43],[-316,287],[-63,225],[685,361],[264,-22],[626,-474],[324,59],[30,-262],[-215,-113],[45,-368],[-136,-273],[106,-279],[412,-99],[-222,331],[230,164],[-181,511],[140,293],[-278,199],[-116,245],[-411,181],[-59,751],[828,66],[825,170],[242,122],[-392,249],[891,770],[1145,248],[305,229],[447,-15],[180,-168],[365,175],[382,60],[35,173],[460,28],[-54,267],[314,347],[615,276],[487,-225],[-158,-301],[509,10],[-138,-377],[732,196],[596,-56],[524,-368],[119,-286],[-65,-343],[-513,-458],[-479,-194],[-530,-517],[-270,-92],[-274,-292],[434,19],[653,248],[-163,220],[216,152],[365,-184],[501,-75],[507,29],[931,-96],[-63,-203],[204,-141],[732,-96],[922,-289],[542,-456],[-51,356],[227,-37],[234,-229],[368,-691],[415,-255],[189,370],[172,480],[155,-230],[247,-148],[406,-8],[372,119],[272,-276],[110,307],[451,19],[-74,636],[254,-15],[461,172],[956,-135],[-66,-123],[830,-20],[396,-179],[-196,-223],[225,-170],[-232,-362],[34,-117],[211,18],[49,14],[58,2],[42,11],[14,3],[12,-1],[5,-5],[4,0],[11,5],[18,-13],[12,2],[52,0],[180,54],[202,-99],[153,-27],[826,187],[571,-38],[466,-231],[144,-320],[-112,-260],[340,-463],[416,299],[381,13],[867,-153],[228,215],[155,-159],[-4,-222],[314,-135],[79,-202],[369,216],[-122,729],[615,-116],[806,-37],[636,-283],[216,-48],[345,-313],[0,-2826],[-132,-165],[-330,-123],[-459,156],[23,-227],[335,-241],[100,87],[125,-424],[-19,-258],[245,-538],[-158,-207],[-260,138],[-276,9],[-492,-321],[-663,-543],[-234,-341],[-403,-327],[-62,-318],[-129,74],[-60,228],[-142,121],[-304,7],[-280,-151],[-236,-393],[-2,476],[-290,-276],[-442,-73],[-118,-299],[38,-195],[-324,-624],[-52,-320],[199,-28],[164,-164],[-143,-263],[-3,-415],[125,-45],[37,-381],[-87,-126],[-124,184],[-146,-131],[-95,-469],[107,-489],[-112,-175],[-250,34],[-223,-277],[-47,-260],[17,-395],[-256,-138],[-134,-203],[17,-332],[-184,-500],[-314,-452],[-61,208],[-14,526],[-96,587],[-115,1144],[-51,670],[27,435],[115,579],[170,209],[89,268],[-41,263],[187,17],[164,126],[270,314],[183,328],[30,170],[289,358],[293,574],[502,350],[-1,377],[83,183],[29,421],[161,130],[-100,171],[-314,-131],[-73,-519],[-154,-83],[-123,-216],[-445,-487],[-133,429],[-12,296],[-186,154],[-472,-93],[-229,-198],[-42,-225],[-220,-392],[-312,-388],[-132,-472],[228,27],[23,-233],[-303,-73],[-125,117],[-210,-234],[-373,-47],[77,440],[-559,216],[-224,-271],[-396,-79],[-253,142],[-157,-87],[-578,40],[-194,-28],[-300,-234],[-113,-255],[-250,-269],[-79,-295],[-197,-296],[-327,-378],[-285,-606],[-403,-594],[-186,-166],[-81,-171],[184,-187],[270,58],[-25,-611],[244,20],[-78,-205],[323,-2],[80,321],[142,143],[256,-88],[102,-299],[243,-339],[-95,-120],[111,-602],[-230,-600],[-5,-263],[-66,-302],[41,-339],[-4,-362],[-66,-251],[-38,-553],[-253,-468],[-58,-278],[-114,-208],[-148,-627],[-117,-313],[-249,-450],[-255,-558],[-111,-427],[-90,-215],[-345,-463],[-211,-133],[-225,320],[-162,143],[-90,-336],[-220,-319]],[[82420,75698],[-133,137],[-137,-108],[-209,207],[-181,80],[-311,-322],[-113,-231],[-398,-113],[-158,-131],[-170,-15],[-239,124],[-233,0],[-154,241],[6,198],[-220,52],[-162,235],[-344,102],[-452,-253],[-299,197],[-96,201],[-50,489],[-274,116],[-135,146],[-214,26],[-283,250],[-26,-167],[-202,-304],[-60,-315],[140,-389],[-41,-236],[-264,-291],[-377,215],[-84,-70],[-268,82],[-102,380],[-316,2],[-28,145],[-318,-42],[-128,-199],[-116,-20],[-374,-365],[25,-138],[-207,-192],[-223,-7],[-100,-202]],[[96810,90198],[251,-116],[-67,-219],[-386,189],[202,146]],[[91973,91181],[265,-292],[-130,4],[-183,-56],[-44,10],[-17,-11],[-7,8],[-13,4],[-11,-5],[-7,5],[-8,-1],[-8,7],[-5,-7],[-21,9],[-11,-2],[200,327]],[[90690,94200],[1010,-275],[140,-241],[-249,-96],[-435,35],[-554,305],[88,272]],[[88644,94642],[241,-265],[490,201],[238,-186],[400,-40],[336,-166],[-149,-303],[-601,-250],[-270,95],[-695,-214],[-253,88],[-346,421],[65,280],[287,263],[257,76]],[[89620,78926],[101,-186],[-17,-233],[50,-534],[57,-147],[-59,-632],[27,-297],[90,-221],[63,-582],[133,-645],[-27,-202],[-233,54],[-98,-169],[-112,-716],[1,-251],[108,-255],[63,-544],[-197,37],[-79,-457],[-67,61],[-33,359],[68,342],[-26,389],[67,255],[-36,395],[-60,194],[65,314],[17,817],[-29,110],[58,400],[-59,304],[-113,272],[5,371],[74,474],[-44,232],[242,120],[0,571]],[[89462,92992],[369,-254],[-58,-266],[-655,170],[90,329],[254,21]],[[85108,92622],[-295,-316],[-460,29],[-96,396],[327,143],[524,-252]],[[81136,93453],[382,-116],[-350,-181],[-32,297]],[[78464,96960],[449,-214],[381,-423],[-157,-169],[-541,-100],[-984,-107],[622,949],[230,64]],[[77076,97492],[707,-236],[-10,-659],[-569,-101],[-314,149],[-474,24],[-396,426],[510,351],[546,46]],[[76588,98287],[425,-307],[3,-443],[-1021,-159],[-555,203],[367,131],[74,341],[707,234]],[[69676,92683],[233,-227],[-341,-106],[-113,225],[221,108]],[[68821,95215],[359,-216],[-247,-320],[-985,-370],[-290,-67],[-756,-357],[-89,-221],[-518,-319],[-221,-279],[4,-173],[-325,-386],[-352,65],[-490,295],[374,304],[159,327],[235,113],[162,438],[359,135],[759,496],[990,72],[399,275],[473,188]],[[67158,97993],[-181,-357],[-513,79],[113,228],[581,50]],[[66397,90510],[395,-377],[-234,-152],[-226,178],[-90,205],[155,146]],[[65254,92644],[144,-81],[263,-61],[-72,-311],[-153,-190],[-56,-440],[234,-526],[356,-343],[-646,-113],[-386,275],[-159,380],[-358,-3],[-133,231],[364,404],[-25,373],[146,191],[481,214]],[[63649,89825],[282,-182],[-139,-286],[-286,-108],[-115,158],[34,244],[224,174]],[[56079,79468],[269,-147],[-17,-376]],[[56331,78945],[-360,-28],[-470,85]],[[55501,79002],[319,602],[8,-2],[251,-134]],[[0,89448],[323,-162],[232,-242],[745,-535],[123,-186],[-7,-272],[164,-491],[133,114],[-59,337],[659,-26],[87,-192],[352,-357],[-123,-395],[-398,-76],[-82,-401],[-157,-224],[140,-146],[-217,-148],[-744,505],[-37,333],[-286,139],[-413,-97],[-108,322],[19,197],[-281,-69],[138,-402],[-203,-125],[0,2594],[0,4],[0,1],[0,0]],[[262,91325],[448,-253],[-131,-153],[-426,-90],[-153,55],[0,400],[262,41]],[[79994,55357],[-162,-190],[-7,-180],[-169,-66],[-77,94],[-22,-15],[21,-112],[-12,-33],[12,-33],[9,-9],[-11,-24],[-2,-1],[-1,-6],[-2,1],[-2,-5],[2,-2],[2,-5],[-2,-4],[-1,-1],[-1,10],[-3,-10],[-1,0],[-2,6],[-1,3],[-4,1],[-3,-5],[-2,-10],[-10,-9],[-4,6],[-3,0],[-9,-14],[-2,4],[-3,-2],[-3,1],[-1,5],[-1,2],[-1,-1],[-3,-4],[0,-3],[1,-4],[3,-6],[-5,-5],[-4,-10],[-4,-3],[-3,-8],[-9,10],[-11,1],[-10,-28],[10,-37],[9,-10],[2,-42],[4,-13],[10,-12],[-4,-29],[2,-8],[6,-4],[7,-1],[5,-5],[1,-9],[-7,-13],[-3,-15],[2,-12],[6,0],[4,6],[5,-3],[0,-54],[-99,-241],[-94,-674],[84,-374],[140,-259],[65,-469],[150,-393],[175,-380],[59,-48],[100,-313],[62,-302],[56,-33],[70,-504],[61,-665],[-21,-237],[66,-399],[-64,-145],[-6,-456],[21,-129],[-74,-376],[-121,-127],[-67,-162],[-300,-413],[-65,208],[-182,-228],[-128,-53],[-128,199],[-30,220]],[[79260,47679],[122,122],[69,535],[81,-72],[132,293],[132,174],[77,19],[-14,488],[37,242],[-82,538],[62,410]],[[79876,50428],[13,529],[-60,51],[-48,238],[-16,311],[-138,156],[-31,325],[-221,534],[-33,232],[-147,327],[0,184],[-85,57],[-224,328],[32,200],[88,131],[60,-56],[97,339],[-105,131],[-16,322],[-75,146],[-108,-14],[-72,-133],[-154,160],[-61,225],[35,333],[-105,144],[-129,345]],[[79628,54704],[-54,-248],[-37,63],[-10,-24],[-7,-11],[-5,3],[0,15],[7,16],[1,5],[0,9],[-2,6],[-16,5],[2,34],[-3,15],[-9,5],[-3,43],[-3,15],[-8,6],[-2,52],[21,-3],[6,-2],[-2,9],[4,3],[5,11],[5,5],[-4,9],[-1,3],[5,5],[1,-7],[4,-1],[2,2],[2,-5],[9,16],[4,-7],[4,0],[9,9],[6,15],[4,-4],[2,-6],[1,0],[2,5],[1,-3],[1,-2],[1,1],[2,2],[0,5],[-1,3],[-1,6],[3,0],[1,7],[3,-3],[2,1],[5,9],[7,-1],[36,-91]],[[79264,47460],[119,-198],[87,-31],[131,-356],[-78,-94],[-173,388],[-86,291]],[[79012,47365],[117,70],[54,198]],[[79183,47633],[80,-242],[197,-502],[36,-275],[-185,-196],[-54,-199],[-115,-99],[-37,81],[16,568],[68,295],[-177,301]],[[79260,47679],[-17,20],[-23,16],[-4,1],[-34,-71],[1,-12]],[[79012,47365],[-57,108],[-170,-61],[23,274],[-171,33],[6,393],[-58,134]],[[78585,48246],[-57,375],[-12,295],[-86,496],[167,671],[168,157],[108,-67],[240,76],[110,-67]],[[79223,50182],[196,-299],[77,97],[0,207],[99,174],[81,-216],[200,283]],[[79223,50182],[93,172],[-20,395],[47,360],[-64,275],[-100,62],[-87,335],[19,583],[-92,195],[-101,328],[-137,212],[-85,22],[-101,-309],[-97,-32],[-143,187],[-48,-133],[-220,-399],[-27,298],[46,125],[-37,257],[79,416],[-60,409],[-176,-21],[-23,150],[46,248],[-66,217],[-68,-34]],[[77801,54500],[28,219],[85,114],[68,359],[113,179]],[[77801,54500],[-290,-227],[-16,-213],[-266,-73],[-65,-174],[-7,-588],[-90,-59],[65,-243],[-2,-197],[240,-707],[34,-318],[76,-92],[-85,-206],[-12,-479],[-77,-45],[-16,-347],[97,-362],[103,-176],[68,-482],[-31,-244],[84,-440],[65,-527],[-92,-367],[-143,-383],[9,-111]],[[77450,47440],[-27,267],[15,891],[-16,469],[-36,99],[-89,618],[-49,-61],[-27,422],[-58,443],[-21,687],[-29,64],[1,407],[-72,-5],[-107,579],[-76,-502],[-59,-96],[-74,206],[-24,1],[-43,-43],[-12,5],[-24,-44],[-33,-181],[-88,-76],[-99,137],[-76,-251],[-75,91],[-86,-166],[108,930],[-38,563],[-37,95],[-13,372],[-45,123],[-14,353],[-206,651],[-72,-123],[-84,266],[-99,113],[-50,309],[-5,1],[-5,27]],[[75606,55081],[55,230],[67,-3],[-5,358]],[[75723,55666],[108,53],[58,154],[-31,322],[66,237],[30,464],[52,234],[148,-117],[28,226],[135,628],[-44,165],[126,341],[9,526],[265,509],[215,118],[73,291]],[[76961,59817],[79,335]],[[76620,51734],[14,28],[-5,91],[74,71],[47,-266],[-130,76]],[[78585,48246],[-78,411],[-92,-25],[-148,375],[-91,-59],[-160,29],[31,574],[-97,44],[-156,-77],[-30,-572],[18,-313],[-46,-153],[-99,-584],[-2,-159],[-70,-302],[-20,-612],[47,-364],[142,83],[30,-464],[91,-283],[57,-629],[68,-244],[92,-137],[137,8],[147,-487]],[[78356,44306],[-39,-213],[-239,27],[3,253],[-78,130],[-126,76],[-67,-90]],[[77810,44489],[5,136],[-107,173],[9,204],[-119,189],[-15,205],[-126,237],[-49,279],[-126,89],[44,549],[124,890]],[[70712,66488],[-124,-139],[-124,53]],[[70464,66402],[-301,-53],[-112,-91],[-270,-452],[123,-464],[7,-167],[-165,-382],[-2,-439],[-148,-86],[-179,70],[118,-501],[-86,-147],[-124,-28],[-92,-456],[24,-384],[-132,-241],[-77,172],[-243,-231],[-87,-219],[-98,73],[-178,-265],[-40,-785],[-329,-230],[-145,42],[-137,-129],[-131,57],[-308,-71],[-444,338]],[[66908,61333],[250,683],[-18,408],[-236,79],[7,511],[-83,670],[89,295],[-90,41],[-17,334],[62,334],[68,67],[80,708]],[[67020,65463],[87,-121],[132,-2],[156,-161],[106,144],[83,322],[190,128],[127,148],[98,489],[93,232],[110,-5],[48,213],[231,-138]],[[68481,66712],[142,27],[60,-142],[146,-8]],[[68829,66589],[65,-179],[243,291],[99,-168],[75,349],[180,-37],[20,299],[147,368],[167,-143],[-27,-180],[89,-144],[-45,-539],[113,-271],[140,223],[93,24],[130,272],[174,25],[19,-146],[148,137],[143,-136]],[[75447,59896],[11,-270],[101,-3],[28,-421]],[[75587,59202],[-109,-57],[-284,-32],[-79,97],[-179,-146],[-230,167],[-10,245]],[[74696,59476],[61,244]],[[81729,56076],[-3,-167],[-84,77],[43,71]],[[89166,38001],[0,-1017],[0,-1655],[-43,-288],[48,-122],[0,-1607]],[[89171,33312],[-147,383],[-145,308],[-174,-28],[-140,45],[65,371],[21,50],[-53,39],[-27,136],[137,55],[-59,200],[-197,429],[-47,358],[-5,301],[-157,349],[-145,135],[-142,-4],[-129,172],[-218,85],[-53,-33],[-103,152],[-40,183],[-138,30],[-19,159],[-151,119],[-94,-361],[-112,64],[15,244],[-35,273],[-127,238],[117,93],[134,280],[38,-164],[116,-89],[74,197],[-21,323],[-276,-169],[-231,112],[-51,436],[-217,208],[22,292],[167,82],[158,261],[79,-15],[193,-271],[154,19],[83,-446],[-48,-247],[27,-487],[80,-168],[112,-475],[69,-94],[106,16],[136,292],[7,176],[157,301],[195,127],[6,190],[83,204],[83,8],[219,-182],[321,-415],[76,35],[159,-201],[87,8]],[[88458,34554],[103,0],[34,-107],[37,-13],[-77,-409],[-140,-183],[-183,-19],[64,406],[96,273],[66,52]],[[87249,35442],[106,-246],[-44,-256],[-63,10],[1,492]],[[86543,34656],[18,-279],[-82,-220],[-26,330],[90,169]],[[86312,39848],[163,-107],[-163,-184],[-102,224],[102,67]],[[85764,37824],[255,18],[89,-132],[107,16],[140,-428],[-17,-181],[-223,252],[-24,104],[-236,-2],[-55,99],[-100,-183],[-64,167],[-16,267],[144,3]],[[85468,40501],[54,-33],[79,387],[141,160],[1,-379],[-95,-108],[-4,-188],[-163,-248],[-57,179],[-34,485],[83,514],[88,-176],[-13,-302],[-80,-291]],[[85633,41575],[113,95],[-51,-317],[-62,222]],[[85432,38874],[41,38],[125,-249],[-183,-29],[17,240]],[[85034,37608],[185,66],[130,-225],[-10,-207],[-148,-144],[-181,312],[24,198]],[[85127,34402],[4,-258],[-184,75],[180,183]],[[84553,38676],[251,-51],[-215,-203],[-36,254]],[[84068,40247],[-213,-60],[-63,76],[-160,-104],[-120,89],[-135,-210],[-42,-371],[14,-247],[148,-374],[19,-180],[128,-14],[129,398],[143,-69],[28,125],[134,-17],[37,130],[126,34],[50,-127],[-39,-209],[-140,80],[-124,-415],[-136,-127],[-88,-341],[98,-188],[29,-207],[86,-145],[14,-159],[-49,-335],[94,-209],[18,-356],[-155,-128],[-9,-235],[-149,150],[26,468],[-61,37],[-133,393],[53,181],[5,411],[-138,-50],[-107,-198],[52,-173],[17,-388],[-27,-108],[18,-576],[-39,-325],[50,-236],[-224,-141],[-77,181],[45,356],[30,673],[-81,399],[-113,-98],[-49,578],[107,212],[55,382],[-11,478],[121,451],[41,464],[-1,330],[54,203],[106,27],[91,180],[7,194],[170,-41],[36,-129],[105,27],[200,-109],[351,-74],[108,123],[59,208],[128,276],[74,-128],[-61,-267],[-207,-531],[-278,-61],[-61,136],[-114,10]],[[84707,33434],[39,-360]],[[84746,33074],[-187,-505],[-223,-149],[27,190],[-10,343],[103,210]],[[84456,33163],[67,-83],[53,199]],[[84576,33279],[131,155]],[[84690,34003],[49,-136],[-195,-62],[35,226],[111,-28]],[[84181,39028],[140,-76],[-28,-169],[-112,245]],[[83755,33680],[109,87],[153,-78],[-191,-200],[-103,66],[-102,-118],[-122,100],[-187,-13],[-13,253],[89,127],[207,-28],[160,-196]],[[84057,36119],[-74,308],[99,127],[16,-241],[-41,-194]],[[83157,33132],[155,71],[109,-284],[41,43],[97,-366],[-100,-137],[-85,65],[-133,319],[-138,29],[54,260]],[[82712,34020],[86,31],[107,-106],[150,-45],[37,-317],[-190,-96],[-214,-27],[-185,-134],[-63,53],[-6,274],[108,208],[208,-38],[-38,197]],[[82646,42864],[40,-204],[-125,-281],[4,-176],[79,-281],[73,-72],[79,-292],[-95,-111],[29,-263],[211,-347],[110,-228],[-59,-154],[-197,67],[-88,-108],[-74,-392],[-19,-537],[-114,-474],[-130,-191],[-62,-171],[77,-401],[-63,-444],[-84,-277],[-26,-248],[-370,-406],[-10,403],[-154,191],[-113,-85],[-86,145],[-108,26],[-111,-155],[-95,79],[-85,-151],[-21,392],[-130,64],[-85,-104],[-205,48],[-65,759],[-5,433],[-87,270],[-36,422],[-145,443],[-45,50],[33,839],[167,427]],[[80456,41369],[5,-333],[147,-313],[27,-135],[113,-90],[149,155],[163,-71],[90,108],[17,214],[78,104],[99,-30],[229,-225],[86,162],[169,-3],[81,408],[-21,168],[95,164],[2,312],[102,106],[46,789],[187,169],[234,-39],[92,-125]],[[82242,33675],[-5,157],[78,137],[106,-97],[-48,-290],[-69,-109],[-62,202]],[[82276,37527],[32,-366],[-85,65],[53,301]],[[81996,33595],[-79,198],[71,284],[153,-242],[-145,-240]],[[79411,34960],[-113,-20],[97,306],[55,394],[200,-153],[172,84],[85,-186],[127,-65],[63,55],[72,-367],[385,-111],[129,-7],[73,349],[112,-136],[103,9],[155,-190],[99,17],[119,-296],[18,-252],[104,-113],[57,62],[171,-3],[99,-79],[-42,-579],[-76,-8],[-264,248],[-114,-116],[-94,80],[-171,-27],[-288,136],[-218,240],[-302,146],[-129,-125],[-173,110],[-77,115],[-256,70],[6,255],[-184,157]],[[81415,34750],[-67,162],[292,28],[-8,-152],[-91,-113],[-126,75]],[[79957,37675],[-78,20],[25,338],[121,-34],[56,-194],[-34,-201],[-90,71]],[[79371,38346],[-117,-7],[-53,126],[72,228],[147,99],[71,-265],[14,-308],[132,-173],[-55,-373],[-116,167],[-95,506]],[[78733,39329],[115,-280],[79,-93],[70,149],[35,-459],[-35,-244],[126,-288],[91,59],[114,-73],[140,-565],[-74,-309],[36,-132],[-37,-218],[23,-213],[-34,-984],[-100,152],[-75,-133],[-100,142],[-59,-201],[-140,347],[-93,306],[-231,353],[-174,383],[-11,196],[-172,319],[-83,363],[-138,403],[9,191],[-131,525],[-14,227],[-143,405],[-15,167],[-113,214],[-69,246],[-97,667],[-81,347],[-224,296],[-19,348],[-46,38],[-119,441],[-126,133],[-288,699],[-81,417],[55,264],[131,-106],[139,-210],[167,36],[60,-85],[81,77],[113,-260],[13,-194],[84,-167],[42,-229],[374,-652],[67,-269],[92,-176],[34,-215],[96,-92],[65,126],[76,-176],[32,-251],[96,-25],[111,-215],[17,-252],[74,-187],[118,-25],[71,-219],[66,82],[86,-166],[-96,-255],[-31,-461],[51,-39]],[[77440,39185],[31,37],[104,-550],[-110,-6],[-78,345],[53,174]],[[77093,40893],[106,-283],[-7,-279],[-133,225],[-73,299],[107,38]],[[76616,41955],[180,-315],[-35,-85],[-181,310],[36,90]],[[74699,59514],[-3,-38]],[[75587,59202],[150,49],[116,-53],[210,99],[133,406],[58,7],[216,253],[22,128],[137,125],[114,-62],[218,-337]],[[75723,55666],[-25,539],[-40,152],[-18,465],[-45,108],[-154,-544]],[[75441,56386],[-4,-8]],[[75437,56378],[-115,453],[22,236],[238,323],[109,410],[-119,176],[-162,-37],[-112,44],[-174,-33],[-174,149],[17,186],[-39,389],[-108,-108],[-196,302],[-131,-202],[-26,-168],[129,-285],[73,4],[42,-226],[-145,-25],[-16,-169],[-104,-195],[89,-203],[114,-93],[-1,-245],[-48,-200],[96,-288],[23,-570]],[[74719,56003],[-98,-285],[-106,-166],[-57,139],[-65,-214],[-170,-119],[-105,-306],[36,-195],[-78,-424],[-88,-220],[-219,-173],[-98,28],[-16,-209],[-75,-157],[-213,-669],[-117,-150],[-136,-368],[-179,-233],[-89,-237],[-8,-289],[-138,-159],[-95,41],[-117,-396],[-78,56],[-90,-100],[-85,-485],[41,-364],[-19,-320],[35,-252],[-43,-193],[67,-112],[-53,-651],[-73,-278],[-34,-309],[20,-205],[10,-750],[-89,33],[-86,-235],[-95,-399],[23,-140],[-159,-118],[-67,-168],[-11,-275],[-161,-299],[-159,219],[-100,339],[-75,386],[-25,355],[-117,874],[-84,428],[-92,222],[-103,596],[-62,743],[-70,470],[-108,391],[-182,1061],[-7,384],[-88,759],[-85,1292],[65,470],[-77,448],[-26,337],[7,347],[-109,-71],[40,-309],[-54,-310],[-186,-236],[-171,-129],[-140,169],[-307,741],[5,213],[259,211],[118,380],[-65,83],[-76,-195],[-170,-105],[-215,254],[-57,344],[44,136],[126,67],[-57,270]],[[69138,57312],[193,20],[38,-87],[234,181],[115,-41],[22,252],[-112,489],[3,200],[-113,27],[-47,163],[21,440],[-184,138],[21,315],[122,274],[96,323],[108,-209],[251,112],[150,371],[55,280],[151,176],[93,391],[32,269],[160,181],[28,233],[132,367],[6,578],[187,187],[22,177]],[[70922,63119],[54,-33],[111,227],[8,188],[128,223],[95,-5],[174,-256],[87,119],[83,-287],[115,-44]],[[71802,63069],[-17,-50],[93,-185]],[[71872,62789],[-25,-35],[15,-39]],[[71911,62359],[34,-173],[113,19]],[[72138,62132],[141,-275]],[[72372,61757],[89,-201]],[[72461,61556],[-138,-316],[-13,-306],[-72,-278],[133,-163],[378,-601],[45,49],[188,-302],[304,-55],[79,62],[140,-126],[6,-208],[192,-219],[76,82],[73,-201],[132,29],[109,-139],[77,78],[83,-118],[199,15],[44,259],[-55,274],[40,540]],[[72270,70211],[-57,160],[-125,17],[-118,230],[-627,139],[-137,-79],[-144,57],[-166,-63],[-256,260],[-211,-134],[-32,-367],[-450,229],[-225,-179],[-16,-232]],[[69706,70249],[-130,-116],[-154,-277],[-245,-252],[-133,-403],[-162,19],[-3,227],[-349,-5],[-49,529],[-149,43],[28,719],[-71,-57],[-79,308],[-174,322],[-112,-117],[-342,59],[-359,-107],[-241,518],[-9,96],[-307,461],[-392,423],[-720,-423],[1,-1678],[0,-969]],[[65555,69569],[-140,-47],[-199,575],[-157,235],[-338,-182],[-153,-261]],[[64568,69889],[-6,228],[87,469],[-232,72],[-163,444],[-151,568],[-146,104],[18,187],[278,-35],[-33,207],[54,302],[175,75],[482,-333],[218,37],[113,170],[-204,400],[-164,-210],[-144,253],[82,323],[-85,422],[-186,115],[-162,-86],[-163,145],[-289,-263],[-76,-135],[-27,-275],[-146,57]],[[70444,68233],[-122,-77],[-227,-13],[-239,196],[-182,-157],[-334,147],[-101,154],[75,208],[135,97],[142,-128],[126,124]],[[69717,68784],[81,85],[123,-136],[123,236],[137,19],[50,250],[-262,220],[-58,186],[-108,-226],[-301,335],[294,453],[-90,43]],[[85654,67627],[71,-341],[204,-643],[36,-394],[-26,-483],[16,-388],[-88,-279],[-177,2],[-178,-226],[-131,-32],[-121,-212],[-128,-45],[-54,155],[33,226],[-61,103],[145,531],[-69,574],[-75,206],[87,131],[-42,521],[95,39]],[[81541,55840],[0,-55]],[[80456,41369],[73,-284],[288,-121],[63,320],[184,263],[-14,337],[317,227],[142,462],[138,363],[40,234]],[[81687,43170],[51,-58],[91,-331],[71,141],[-18,330],[57,92]],[[81939,43344],[15,-79],[40,100],[117,228],[124,498],[27,210],[139,413],[58,-97],[105,49],[103,-299],[6,-262],[143,-193],[50,98],[236,-465],[-139,-124],[-80,69],[-74,-108],[105,-372],[-138,-103],[-80,146],[-50,-189]],[[78356,44306],[73,-1],[98,-348],[111,-198],[91,-426],[18,-354],[-41,-458],[29,-581],[86,-181],[136,-700],[10,-202],[-143,60]],[[78824,40917],[-38,-74]],[[78786,40843],[-402,625],[-108,260],[-89,80],[-50,404],[-163,459],[-42,307],[36,313],[-86,253],[-8,620],[-64,325]],[[72461,61556],[48,20]],[[70464,66402],[-173,-275],[-148,-311],[2,-155],[173,-31],[16,-121],[258,-400],[-18,-127],[-173,-265],[41,-487],[12,-577],[228,-214]],[[70682,63439],[62,-213],[178,-107]],[[69138,57312],[-128,-99],[-198,-34],[-78,322],[-209,264],[16,197],[-56,286],[-256,-153],[-205,-20],[-218,129],[-171,-215],[-281,37],[-154,-106],[-85,48]],[[67115,57968],[17,337],[45,71],[6,310],[127,247],[240,91],[2,442],[-105,-27],[-14,573],[-103,296],[-133,95],[-70,160],[-80,397],[-139,373]],[[84513,45067],[-60,290],[-128,159],[-78,-228],[-86,-43],[-121,189],[-110,-595],[-70,123],[110,669],[171,96],[41,265],[175,91],[50,-341],[101,38],[58,289],[84,-90],[8,338],[207,32],[-35,464],[138,-170],[117,-335],[22,-317],[-8,-450],[53,-114],[14,-329],[-73,-190],[-31,-408],[-115,666],[-118,-402],[90,-456],[-83,-430],[-95,204],[-208,185],[-77,216],[-23,286],[80,298]],[[84543,48700],[82,161],[140,48],[74,-215],[26,-809],[-85,-37],[-57,-216],[70,-305],[-33,-145],[-100,-24],[4,427],[-108,366],[81,45],[83,229],[-177,475]],[[84449,46770],[-41,230],[93,175],[87,-68],[-34,-297],[-105,-40]],[[83602,53226],[289,-210],[48,-122],[-13,-233],[30,-307],[77,-195],[-90,-474],[2,-142],[-181,-243],[18,-175],[-68,-238],[65,-521],[83,-423],[90,-84],[38,256],[113,50],[85,-239],[139,-184],[71,-652],[-143,131],[-33,296],[-202,371],[-20,-297],[-177,314],[-133,-260],[-114,220],[-70,-49],[-9,277],[107,189],[-39,193],[-123,-124],[-93,216],[-33,578],[-53,204],[42,305],[72,-256],[50,195],[-3,365],[37,426],[-31,164],[66,483],[106,195]],[[84216,48496],[30,299],[70,-144],[-100,-155]],[[84250,46670],[31,427],[125,543],[38,-292],[-100,-226],[-57,-406],[-37,-46]],[[84058,46644],[-64,206],[20,191],[113,86],[24,551],[70,103],[103,-151],[-117,-647],[-6,-246],[52,-179],[-52,-184],[-143,270]],[[83845,48326],[28,111],[140,-242],[104,22],[93,-101],[-42,-270],[-118,-292],[-86,-21],[-100,-152],[39,421],[13,481],[-71,43]],[[83505,49361],[93,212],[167,-287],[0,-354],[-123,-257],[-90,349],[-47,337]],[[82698,46113],[-14,282],[129,232],[190,450],[52,273],[48,5],[85,338],[59,-274],[-111,-156],[-28,-170],[-116,-181],[-71,-326],[-104,-142],[-119,-331]],[[68829,66589],[20,265],[152,460],[-96,273],[37,272],[-138,48],[-55,129],[-12,280],[70,61],[227,-91],[71,482],[137,-1],[20,412],[90,-101],[245,248],[67,-176],[-119,-247],[74,-154],[98,35]],[[68481,66712],[-38,495],[-134,177],[-97,8],[-380,485],[-480,715],[-36,338],[-57,80],[-69,406],[-119,138],[-275,-54],[-105,139],[-21,580],[-157,48],[-77,174],[-254,109],[-109,-368],[-162,-30],[-81,-162],[18,-470],[-293,49]],[[75606,55081],[-137,973],[-68,206],[40,126]],[[75437,56378],[-88,-192],[-114,-18],[-56,230],[-20,301],[-109,59],[-17,-165],[65,-228],[-72,-136],[-51,-255],[-137,103],[-119,-74]],[[76901,31101],[-5,11],[2,2],[3,-13]],[[72727,45228],[16,-306],[-51,-386],[-105,-206],[-240,-184],[-116,234],[-47,398],[-32,839],[23,115],[25,571],[55,189],[35,445],[152,-373],[30,-188],[126,-397],[33,-328],[96,-423]],[[70308,39402],[-3,17],[-3,9],[2,3],[1,-13],[3,-16]],[[63497,69946],[147,-397],[119,-470],[143,-31],[-179,-367],[-54,-672],[-114,-170],[19,-337]],[[63578,67502],[-240,285],[70,92],[-66,521],[-177,-160],[-240,-432]],[[62925,67808],[13,238],[-209,450],[29,338],[-133,147],[42,275],[-123,132],[-40,166]],[[62504,69554],[82,127],[138,-181],[162,-87],[61,211],[-120,229],[68,143]],[[62817,67791],[-196,116],[-175,447]],[[62446,68354],[-11,62]],[[62435,68416],[81,57],[113,-208],[63,72],[125,-546]],[[79353,32386],[9,-32],[-9,-29],[-11,31],[11,30]],[[67115,57968],[-58,-81],[-217,169],[-203,46],[-372,181],[-335,118],[-146,993],[-151,13],[-165,-132],[-233,-342],[-157,149],[-125,-14],[-98,183],[-218,238],[-53,220],[-127,172],[-183,96],[-83,390],[-42,388],[-89,323],[-196,498],[-96,-142],[-160,364],[-64,-228],[-181,190]],[[63363,61760],[-21,391],[-97,1],[0,285],[50,279],[-93,278],[-225,443],[-113,131],[-85,388],[-140,318],[66,456],[-10,147],[123,376],[-107,355],[-106,199],[-165,763]],[[62440,66570],[-45,403],[-106,186],[42,130],[-22,477],[-68,433],[98,0],[107,155]],[[62817,67791],[108,17]],[[63578,67502],[14,-389],[59,-214],[292,-160],[29,-164],[192,-279],[249,-138],[262,121],[333,47],[-14,385]],[[64994,66711],[73,-15],[154,145],[93,307],[189,126],[145,-31],[33,131],[170,-59],[394,-391],[241,-79],[56,-252],[136,-112],[84,-282],[222,11],[36,-747]],[[58035,89502],[113,306],[-382,440]],[[57766,90248],[218,546],[375,-102],[246,-304],[-370,-223],[326,-134]],[[57697,90235],[-288,-77],[-216,-220],[-33,-460],[-239,-297],[-260,159],[-226,-142],[-230,142],[-198,323],[-300,-155]],[[55707,89508],[-174,-506],[-499,130],[-62,-408],[-172,107],[-151,-147],[-93,-509],[-285,-518],[30,-145],[-269,-108],[-3,-592],[-237,-524],[128,-85],[-41,-326],[-210,63],[-146,-87],[-197,-507],[67,-193],[-45,-280],[68,-247],[-45,-391],[204,-264],[-180,-247],[106,-359],[-44,-341],[-210,-323],[23,-361],[-87,-70]],[[53183,82270],[-222,245],[-254,-228],[-236,-396],[-192,-248],[-149,-76],[-308,71],[-189,226],[-105,245],[191,354],[-195,9],[-7,312],[206,295],[-262,64],[-113,416],[103,485],[-4,373],[769,800],[143,36],[299,459],[266,475],[244,128],[-35,180],[225,269],[316,1031],[409,412],[45,452],[277,214],[391,429],[204,385],[307,307],[384,6],[194,109],[0,231],[212,80],[272,-89],[311,220],[190,339],[175,-97],[332,73],[430,-145],[65,-184],[-175,-302]],[[54355,89333],[232,-181],[-237,-182],[-120,193],[125,170]],[[78824,40917],[74,-66],[-96,-85],[-16,77]],[[55707,89508],[245,-265],[456,-281],[191,-623],[-56,-192],[122,-247],[-97,-376],[139,-331]],[[56707,87193],[-317,-64],[-367,-266],[-156,-422],[103,-284],[-305,-522],[-263,-71],[-93,-232],[-147,-55],[-166,-337],[-239,-787],[62,-617],[177,-105],[230,-365],[-31,-591],[-442,-451],[-88,-36],[2,-519],[-88,-421],[-31,-418],[-107,-366],[-365,-52],[-118,-181],[-12,-348],[-342,7],[24,191],[-138,345],[105,264],[-162,292],[-187,665],[45,232],[-148,144],[-55,429],[95,18]],[[55284,81474],[-96,-468],[-128,-144],[-31,362],[99,205],[156,45]],[[64994,66711],[-46,407],[12,532],[47,187],[-221,456],[47,354],[-158,-56],[-34,235],[40,271],[203,82],[38,-115],[224,63],[68,282],[-206,350],[-50,390],[-204,-19],[-155,-398],[-31,157]],[[62435,68416],[-80,181],[-161,40],[-98,321],[56,150],[-76,321]],[[62076,69429],[428,125]],[[58828,77327],[-189,-16],[-238,-434],[-297,117],[-99,-65],[-431,34],[-183,157],[-419,93],[-198,-51],[-109,-217],[-105,-52]],[[56560,76893],[10,405],[-121,186],[200,275],[-118,893]],[[56531,78652],[262,-34],[294,287],[61,356],[125,136],[124,495]],[[57397,79892],[284,179],[138,173]],[[62076,69429],[-220,343],[-59,-118],[-257,61]],[[61540,69715],[62,201],[-91,674],[-158,238],[-165,86],[-75,141]],[[62440,66570],[-143,67],[-181,-13],[-229,115],[-124,-192]],[[61763,66547],[-87,49],[-227,-86],[-127,46],[-262,-266],[-168,-62],[-129,27],[-141,156],[-214,-208],[-219,137],[-87,-466],[-125,-178]],[[59977,65696],[-37,287],[104,191],[-43,240],[-187,-271],[-163,187],[-54,-36],[-237,-422],[-248,-108],[-140,150],[-70,211],[-207,208],[-202,-12],[-35,-389],[-218,-80],[-156,185],[-4,198],[-127,98],[-149,-126],[-5,274],[-141,-30],[-95,354],[12,342],[-138,188],[49,168],[-62,204],[93,103],[-121,307],[-142,113],[17,385],[161,297],[278,-70],[283,63],[134,340],[-284,151],[-201,-74],[-57,-195],[-158,-162],[-106,-206],[-90,388]],[[57231,69147],[82,153],[-2,222],[87,94],[-77,236]],[[57321,69852],[79,187],[168,92],[82,-132],[135,47]],[[57785,70046],[20,-252],[205,-247],[273,-103],[123,45],[137,-87],[154,26],[26,140],[332,369],[200,133],[411,-43],[132,-172],[189,13],[122,-347],[133,62],[185,-227],[230,-81],[292,142],[226,-128],[231,208],[134,218]],[[60619,73739],[-192,-28],[-178,-195],[-326,-160],[-317,-417],[111,-235],[29,-231],[82,-71],[254,159],[41,-283],[-303,-89],[-249,-182],[-94,-203],[-200,95],[59,259],[-63,200],[-222,203],[297,282],[-147,181],[-250,6],[-68,377],[-226,-22],[-110,-136],[-156,-417],[-195,-291],[-321,-94],[-39,105]],[[57836,72552],[159,262],[79,261],[-38,188],[276,32],[14,181],[-106,151],[-12,207],[-102,142],[18,217],[-113,269],[-174,57],[-130,182],[-310,-143]],[[57397,74558],[-124,-190],[-265,-73],[-97,-122],[-72,164],[-112,-39],[-368,41]],[[56359,74339],[-205,322]],[[56154,74661],[114,492]],[[56268,75153],[21,318],[295,608],[81,26],[29,305],[-134,483]],[[57321,69852],[-63,-257],[-248,-78],[-215,204],[-427,-137]],[[56368,69584],[30,276],[-47,215],[-141,208]],[[56210,70283],[49,410],[125,165],[-125,259],[-49,243],[88,292]],[[56298,71652],[107,-302],[101,41],[214,-123],[86,59],[245,-104],[103,56],[98,196],[257,125],[267,-216],[162,-75]],[[57938,71309],[-34,-261],[-103,-5],[-55,-236],[3,-244],[-73,-93],[109,-424]],[[57597,81212],[-318,142],[-306,261],[-209,-145]],[[56764,81470],[-24,288],[-143,44],[-70,226],[-2,400],[242,188],[295,14],[100,93],[323,-132],[349,-43]],[[63363,61760],[96,-331],[-139,12]],[[63320,61441],[-68,68],[-149,-62],[-85,-417],[-87,-242]],[[62931,60788],[-36,-30],[-473,99],[-430,817],[-303,558],[-179,188],[-285,413],[-336,150]],[[60889,62983],[-114,877]],[[60775,63860],[513,676],[94,59],[69,273],[8,922],[40,333],[116,46],[148,378]],[[56079,79468],[-194,180],[-34,523]],[[55851,80171],[297,260],[523,-73],[257,33],[469,-499]],[[56531,78652],[-49,213],[-151,80]],[[55851,80171],[0,556],[96,150],[86,378],[233,128],[156,-280],[32,-184],[149,-99],[177,215],[-16,435]],[[57836,72552],[-6,3]],[[57830,72555],[-28,394],[46,318],[-44,371],[-229,510],[-33,213],[-145,197]],[[56268,75153],[-168,188],[-190,81],[-81,-111],[-154,80],[-142,-131],[-126,271],[-171,-69]],[[55236,75462],[-117,302],[-158,30],[-209,306],[-112,-222],[-96,204],[23,143],[-450,210]],[[54117,76435],[58,303],[-123,392],[47,163],[-45,392],[-108,150],[67,317],[-50,315]],[[53963,78467],[146,240],[343,163],[140,203],[199,137],[301,74],[110,-330],[253,59],[3,-3],[43,-8]],[[57830,72555],[40,-105],[240,-164],[-16,-234],[-140,-322],[-16,-421]],[[56298,71652],[-96,328],[-192,-9],[-76,146],[33,236],[-130,96],[-59,296],[-150,280]],[[55628,73025],[255,128],[97,299],[137,574],[67,152],[175,161]],[[60775,63860],[-542,-763],[-122,47],[-179,264]],[[59932,63408],[39,143],[-35,279]],[[59936,63830],[228,613],[-49,306],[-122,16]],[[59993,64765],[-30,195],[13,369],[-49,106],[50,261]],[[55827,69235],[-89,-548],[-181,-287]],[[55557,68400],[-42,253],[-107,123],[-45,313],[58,432],[-28,100],[1,675]],[[55394,70296],[67,215],[116,-52]],[[55577,70459],[124,-248],[19,-240]],[[55720,69971],[-35,-272],[73,-422],[69,-42]],[[54902,70698],[-19,36]],[[54883,70734],[-91,332],[-289,586],[-44,293],[-90,145],[15,263],[157,-137],[39,148],[491,-49],[212,-204]],[[55283,72111],[23,-348],[144,-229],[-29,-243],[-81,-134]],[[55340,71157],[-77,-5],[-139,-507],[-3,-187]],[[55121,70458],[-219,240]],[[55236,75462],[-185,-166],[-34,-181],[-312,-300]],[[54705,74815],[-136,132],[-97,-40],[-204,170],[-108,-8],[-71,-265],[-186,2],[-59,120]],[[53844,74926],[-288,410],[-165,546],[84,212],[117,12],[404,349],[121,-20]],[[53485,80105],[-146,-586],[-212,28],[-37,297],[111,219],[208,150],[76,-108]],[[52815,79518],[-86,189],[138,141],[116,-89],[-28,-358],[-140,117]],[[52616,79282],[-218,57]],[[52398,79339],[-4,371],[-152,94],[80,241],[-67,471],[139,415],[211,23],[159,312],[131,-10],[34,-252],[-79,-235],[25,-238],[135,-29],[-35,-279],[-311,-521],[-48,-420]],[[57721,83388],[-202,-8],[-294,-166],[-221,-42],[-426,-221],[-361,50],[-264,428],[-70,184],[133,502],[-103,310],[-46,575],[133,226],[220,165],[90,369],[187,64],[320,634],[220,63],[-36,473],[-294,199]],[[57697,90235],[69,13]],[[57231,69147],[-268,196],[-73,-113],[-113,63],[-92,-155],[-80,-380],[-242,137],[-100,-171],[84,-246],[40,-608],[-82,-82],[226,-258],[67,163],[103,-29],[59,-489],[-70,-137],[-234,129],[-24,-253],[-112,-165],[99,-446],[-207,-68],[-59,242],[-118,-155],[-45,261],[35,135],[-162,353],[71,235],[166,112],[253,-282],[-51,303],[-238,28],[-91,-66],[-109,106],[-111,423],[-104,177],[-92,293]],[[55827,69235],[171,9],[105,189],[215,24],[50,127]],[[56603,65469],[137,-183],[106,43],[383,-136],[19,-167],[-361,-53],[-115,195],[-222,29],[53,272]],[[54883,70734],[-197,330],[-256,183],[-218,376],[33,133],[-112,309],[-123,197],[-159,-184],[-64,187],[-14,294]],[[53773,72559],[64,-32],[217,140],[155,-146],[40,237],[114,121],[-10,218],[190,231],[67,-52]],[[54610,73276],[210,-384],[293,-146],[134,132]],[[55247,72878],[2,-251],[80,-292],[-46,-224]],[[55121,70458],[24,-97]],[[55145,70361],[-243,337]],[[55628,73025],[-193,37],[-188,-184]],[[54610,73276],[-134,283]],[[54476,73559],[97,117],[13,262],[180,438]],[[54766,74376],[173,-192],[246,17],[46,205],[317,85],[239,299],[187,-20],[57,-141],[123,32]],[[52091,71341],[48,187],[-193,138],[6,355],[-112,267],[142,111],[-89,417],[63,62]],[[51956,72878],[230,-1],[58,242],[96,29],[164,-178],[124,322],[70,-148],[173,181],[37,223]],[[52908,73548],[153,-64],[83,163],[222,10],[90,-228],[353,-119]],[[53809,73310],[-81,-207],[83,-460]],[[53811,72643],[-139,127],[-297,-334],[96,-242],[-72,-193],[43,-351],[82,-163],[234,-263],[161,-761],[176,-343],[110,-114],[263,10],[-27,-359],[294,-259],[267,-315],[142,-384],[-42,-225],[-104,144],[-39,209],[-96,7],[-110,161],[-141,-316],[-23,-300],[176,-187],[-15,-357],[-139,-70],[-5,-255],[-145,-380],[-107,23],[-11,197],[152,371],[-53,502],[-91,427],[-106,-4],[-209,412],[-135,176],[-65,240],[-213,29],[-117,157],[-134,339],[-264,428],[-184,522],[-128,567],[-230,227],[-137,61],[-189,-387],[-149,-76]],[[53899,66542],[-104,62],[-201,273],[-130,94],[24,259],[93,-28],[118,143],[118,-182],[173,32],[106,108],[95,-32],[32,-277],[-28,-305],[55,-166],[-58,-214],[-167,3],[-126,230]],[[52681,68300],[-24,-292],[-132,45],[-66,-238],[-117,181],[-10,557],[23,275],[-96,319],[327,330],[71,-53],[72,-421],[-56,-232],[8,-471]],[[53470,71437],[6,53],[-31,-26],[25,-27]],[[53459,69992],[-2,-3],[2,-2],[0,5]],[[55720,69971],[55,148],[221,129]],[[55996,70248],[214,35]],[[55394,70296],[-10,-180],[-1,-59],[-238,304]],[[55340,71157],[89,-202],[224,-297]],[[55653,70658],[-76,-199]],[[55996,70248],[56,279],[-87,69],[-95,264],[-129,-54],[-88,-148]],[[54766,74376],[-88,248],[27,191]],[[54476,73559],[-66,-108],[-281,-82],[-91,-139],[-229,80]],[[52908,73548],[-101,-10],[-139,158]],[[52668,73696],[-21,151]],[[52647,73847],[7,198]],[[52654,74045],[112,-8],[108,-157],[69,182],[193,-102],[248,196],[253,-52],[-96,347],[272,289],[31,186]],[[51616,75483],[-95,-33],[-177,387],[-179,-51],[7,209],[-398,338],[-68,259]],[[50706,76592],[229,201],[121,-114],[1,2],[119,97],[10,20]],[[51186,76798],[222,12],[218,-178],[46,-281]],[[51672,76351],[97,-215],[-65,-234]],[[51704,75902],[-111,-167],[23,-252]],[[51956,72878],[-62,363],[-181,-44],[75,285],[144,346],[176,249]],[[52108,74077],[186,18],[95,135],[265,-185]],[[52647,73847],[-4,-132],[25,-19]],[[52108,74077],[60,721],[108,261],[-412,167],[-96,202]],[[51768,75428],[42,241],[-106,233]],[[51672,76351],[95,777],[174,281],[61,730]],[[52002,78139],[10,307],[344,18],[109,252],[-56,255],[59,135],[-70,233]],[[52616,79282],[149,-38],[50,-213],[266,-204],[286,-11],[105,209],[479,-392],[-3,-46],[15,-120]],[[52400,66423],[-105,-721],[26,-192],[-58,-817],[-137,-241],[-36,-288],[79,-419],[142,-281],[10,-231],[199,-299],[134,-1335]],[[52654,61599],[-46,-44],[109,-532],[34,-481],[-20,-339],[37,-290],[-51,-441],[41,-296],[-19,-245],[-128,-231],[174,-605],[4,-286],[87,-304],[166,-3],[130,-236],[51,47],[109,-539]],[[53332,56774],[-498,-738],[-543,-835],[-220,-347],[-457,-1006],[-429,-214]],[[51185,53634],[-253,-130],[-65,116],[38,227],[-2,282],[-152,161],[-72,1],[-66,182],[-80,-67],[-88,267],[-122,104],[-3,281],[-298,512],[-416,705],[-579,959],[-370,607]],[[48657,57841],[-556,879],[-509,785]],[[47592,59505],[0,252]],[[47592,59757],[0,753],[299,478],[137,111],[111,-15],[250,75],[66,-90],[86,308],[257,439],[189,120],[27,255],[-65,125],[32,292],[234,119],[-14,225],[240,46],[211,-71],[18,238],[-77,458],[-57,171],[6,593],[-67,502],[-90,200]],[[49385,65089],[86,0],[179,222],[21,135],[226,235],[76,-84],[122,289],[277,257],[363,48],[101,145],[478,45],[155,-176],[263,203],[65,121],[128,-150],[161,117],[73,-126],[241,53]],[[52610,69966],[-49,-356],[-122,151],[-63,565],[48,137],[171,126],[53,-138],[-38,-485]],[[52091,71341],[-25,-25]],[[52066,71316],[-7,-10],[1,-7]],[[52060,71299],[-185,-219],[-24,-150],[-150,-95],[-188,94],[-30,97],[-213,15],[-147,137],[-212,-227],[-67,-216],[37,-363]],[[50881,70372],[-322,-59],[-80,109]],[[50479,70422],[-79,71]],[[50400,70493],[-400,59],[-152,77],[-221,207],[-123,193]],[[49504,71029],[94,211],[78,809],[-21,673],[49,246],[-46,166],[-163,155],[-90,233],[44,150],[-231,428],[-426,157],[-32,286],[-81,219],[451,230],[114,-239],[108,101],[225,-28],[-23,412],[-71,319],[135,41],[58,-214],[282,-87],[87,286],[239,165],[144,215],[10,459],[268,170]],[[51616,75483],[152,-55]],[[54017,65702],[32,-51],[-17,-44],[-50,53],[35,42]],[[53773,72559],[38,84]],[[52400,66423],[282,282],[244,-415],[139,231],[28,-145],[-182,-585],[55,-195],[102,-117],[23,-273],[-149,-510],[-131,-159],[-9,-278],[110,-215],[173,-50],[20,-256],[106,-27]],[[53211,63711],[-4,-548],[-249,-310],[-145,-365],[43,-274],[-19,-270],[-76,-235],[-107,-110]],[[50479,70422],[-77,-48],[-2,119]],[[50867,68573],[93,-134],[-113,-345],[-193,244],[213,235]],[[50881,70372],[16,-338],[-48,-124],[-224,-249],[-38,-111],[-315,-182],[-325,-946],[-40,-220],[58,-329],[91,-162],[-160,-208],[-153,-639],[-111,6],[-100,-154],[-122,-442],[-160,-36],[-152,51],[-320,-23],[-67,-155],[-161,-93],[-34,-161]],[[48516,65857],[-3,1]],[[48513,65858],[-72,-105],[-123,140],[-147,582],[-96,123],[-136,38]],[[47939,66636],[-25,236],[73,307],[-5,513],[87,228],[-96,311],[78,154],[65,499],[-15,477],[179,393],[-99,79],[-15,189],[-221,-88],[-194,-12],[-28,244],[-127,-83]],[[47596,70083],[-69,57],[17,404],[-127,179],[107,286],[292,317],[172,-139],[431,-18],[288,-103],[296,81],[149,-123],[87,63],[152,-99],[113,41]],[[45440,60373],[-5,-265],[-73,-111],[-62,259],[140,117]],[[49169,76756],[-158,61],[-227,228],[-189,-71],[-21,173],[258,291],[42,153],[-8,538],[216,77],[114,284],[-303,746],[-334,106],[149,379],[-66,269],[-187,220],[-25,276],[-130,186],[89,216],[-256,220],[113,240],[123,-146],[156,348],[117,448],[184,-57],[286,89],[24,-204],[-252,-303],[42,-259],[541,61],[34,-136],[-112,-414],[-163,-310],[0,-297],[182,-112],[134,-235],[45,-351],[89,-320],[166,-123],[95,-229],[199,-870],[210,-4],[108,-122],[35,-209],[-51,-285],[-268,-508],[226,11],[-14,-182],[-120,-165],[-205,-125],[-121,65],[-301,-11],[-180,-159],[-264,102],[-148,-94],[-78,-288],[-162,114],[-314,-119],[244,422],[99,300],[257,-15],[80,100]],[[48252,78764],[-436,77],[-82,158],[193,296]],[[47927,79295],[65,151],[207,137],[251,-414],[-68,-311],[-130,-94]],[[48234,81889],[-3,-317],[-168,-203],[-21,357],[192,163]],[[59417,65084],[-1,-2]],[[59416,65082],[1,-79]],[[59417,65003],[-44,10],[-1,1],[-11,-1]],[[59361,65013],[0,14]],[[59361,65027],[-7,31]],[[59354,65058],[63,26]],[[49399,75230],[1,47],[37,-20],[-1,-47],[-37,20]],[[52066,71316],[-6,-17]],[[51186,76798],[-115,315],[207,474],[35,350],[89,-27],[233,333],[271,46],[96,-150]],[[50667,48426],[-1,257],[122,107],[210,-506]],[[50998,48284],[-28,-293],[63,-118],[32,-319],[-89,-594],[-106,-312],[-13,-233],[-83,-90],[-31,-793],[29,-590],[-21,-428]],[[50751,44514],[0,-8],[0,-50],[-251,-59]],[[50500,44397],[-3,5],[1,1],[-51,222],[6,279],[-4,1480],[-57,193],[-16,477],[-161,280],[39,445]],[[50254,47779],[146,343],[161,-45],[106,349]],[[50254,47779],[-292,100]],[[49962,47879],[-120,-106],[-630,11],[-29,-267],[48,-266],[22,-556]],[[49253,46695],[-66,55],[-79,246],[-191,-4],[-115,-222],[-105,58],[-119,434],[-110,108]],[[48468,47370],[7,467],[64,115],[-1,426],[176,162],[64,181],[46,304],[-32,274],[108,257],[115,-222],[86,90],[110,550],[101,176],[103,-110],[34,236],[84,19],[169,204],[96,215],[133,-4],[136,-119]],[[50067,50591],[-23,-272],[134,-613],[97,-75],[0,-341],[244,-357],[148,-507]],[[49253,46695],[-24,-254],[53,-253],[25,-417],[-94,-278],[-34,-418],[-84,-426],[80,-722],[57,-29],[10,-328],[-59,-13]],[[49183,43557],[-295,90],[-519,-160],[-287,-260],[-173,-217],[-17,358]],[[47892,43368],[57,549],[-113,255],[-10,154],[-208,236],[70,209],[11,265],[-53,268]],[[47646,45304],[71,-13],[62,424],[-69,76],[81,399],[8,306],[-62,240],[7,365],[39,81]],[[47783,47182],[82,167],[88,-109],[191,63],[1,188],[119,101],[21,-271],[183,49]],[[49962,47879],[21,-364],[113,-234],[3,-581],[58,-67],[-51,-479],[96,-285],[-58,-597],[38,-140],[-34,-319],[60,-309],[125,-238]],[[50333,44266],[-77,-235],[-168,-3],[-189,-204],[-130,-206],[-214,-129],[-141,-198],[-46,104],[-231,137],[-1,18],[47,7]],[[51185,53634],[0,-1542],[-19,-436],[-95,-509],[-101,-236],[-128,51],[-110,-59],[-368,-49],[-87,-200],[-210,-63]],[[47783,47182],[-96,301],[18,218],[-81,231],[50,126],[-133,191],[14,260],[-99,338],[-148,-325],[-181,136],[-120,-198],[-45,204],[-81,-168],[-73,158],[31,140]],[[46839,48794],[9,381],[-79,326],[-95,102],[-1,464],[-73,417]],[[46600,50484],[113,66],[34,486],[83,75],[147,-371],[91,230],[136,-58],[204,102],[446,-1],[618,0],[46,599],[-77,120],[-35,839],[-79,1830],[-49,1141],[-45,1006],[-59,1294],[483,-1]],[[53332,56774],[425,-259],[184,-367],[225,255]],[[54166,56403],[55,-719],[0,-360],[85,-386],[34,-304],[104,-127],[-68,-299],[-45,-827],[-17,-1470],[-320,-734],[-164,-613],[-26,-228],[-63,-102],[46,-509]],[[53787,49725],[-76,0],[-215,-306],[-30,-145],[-104,25],[-179,191],[-223,-15],[-180,-128],[-98,-269],[-189,19],[-156,160],[-96,185],[-70,20],[-105,-163],[-138,-80],[-143,429],[-249,205],[-70,-94],[-226,-53],[-90,-146],[-11,-353],[-125,-334],[-16,-589]],[[53787,49725],[124,-449]],[[53911,49276],[41,-518],[125,-143],[-18,-465],[-117,-197],[-60,49],[-110,-448],[-22,-338],[-57,-94],[-25,-382],[-91,-116],[6,-199],[-55,-321],[-127,-204],[-9,-290],[-164,-723],[-29,-262],[-117,-66],[-92,313],[-251,-129],[-43,-190],[-100,-114],[-140,-377],[22,-190],[-70,-439]],[[52408,43433],[-106,-144],[-19,-136],[-171,-37],[-204,243],[-140,-225],[-83,33],[60,273],[-121,191],[-103,547],[-96,-100],[-203,365],[-138,57],[-333,14]],[[50500,44397],[1,-1],[-49,-42],[-119,-88]],[[53911,49276],[107,0],[99,-319],[17,-342],[49,-73],[2,-891],[65,-365],[-15,-230],[-125,-41],[-162,51],[-50,-280],[91,-314],[207,-376],[133,-633],[-26,-180]],[[54303,45283],[-69,-182],[-141,-736],[-33,-256],[28,-899],[103,-253],[44,-415],[154,-442],[74,-134],[34,-495]],[[54497,41471],[-46,-329],[-219,192],[-54,-40],[-151,136],[-334,4]],[[53693,41434],[-14,73],[-429,33],[-101,-106]],[[53149,41434],[-362,-6],[-41,45]],[[52746,41473],[0,3],[-2,2],[-17,197],[43,421],[-88,319],[35,170],[-27,196],[-111,-51],[-86,93],[-2,386],[-83,224]],[[49270,75426],[25,1],[1,-26],[-23,-9],[-3,34]],[[48516,65857],[0,-21],[-6,14],[3,8]],[[47646,45304],[-66,-25],[-110,-204],[-89,169],[22,199],[-36,431],[-81,145],[-142,-48]],[[47144,45971],[-108,432],[2,162],[-152,495],[-191,0],[-164,-109],[-55,-300],[-88,-229],[-83,-55]],[[46305,46367],[17,207],[-55,269],[-181,364],[-63,-4],[-75,197],[5,287],[-88,175]],[[45865,47862],[61,280],[110,123],[156,17],[0,701]],[[46192,48983],[182,-36],[192,-229],[83,91],[190,-15]],[[48749,78959],[54,-63],[-68,-140],[-53,50],[67,153]],[[48252,78764],[81,-823],[-129,-448],[-621,-549],[-189,-79],[-286,318],[143,228],[2,235],[174,430],[-215,170],[68,364],[-18,307],[347,-30],[-19,242],[112,384],[282,-62],[-39,-87],[-18,-69]],[[47892,43368],[8,-231],[-1,1],[-1,-111],[0,-1],[-190,133],[-288,416],[-212,547],[-179,230],[-46,162],[-176,334],[4,1],[3,2],[1,-1],[9,32],[1,1],[4,7]],[[46829,44890],[28,150],[196,420],[0,191],[87,135],[4,185]],[[47592,59757],[-392,0],[-487,0],[-373,0]],[[46340,59757],[71,207],[241,103],[163,172],[110,292],[156,208],[199,598],[53,384],[-51,151],[-17,562],[162,564],[-5,268],[204,500],[417,452],[71,154],[136,566],[103,657],[151,89],[11,-30],[28,-227],[137,-238],[109,-55],[180,101],[104,-74],[106,97],[7,-35],[33,-121],[166,-13]],[[46600,50484],[-154,285],[-116,387],[-46,258],[-125,52],[-140,365],[-171,-3],[-212,-115],[-154,37],[-42,-219]],[[45440,51531],[-26,-114],[0,-1],[20,415],[83,514],[32,454],[-10,351],[-54,431],[-74,211],[73,298],[15,304],[-132,341],[-104,68]],[[45263,54803],[29,403],[532,0],[564,0],[-30,1151],[147,242],[161,129],[0,1832],[304,0],[622,0],[0,945]],[[47939,66636],[-99,-144],[-236,70],[-45,289],[3,494],[-36,211],[-165,190],[40,417],[76,161],[61,397],[60,636],[-64,588],[62,138]],[[46192,48983],[-415,8],[-133,-187],[-100,35],[-94,-75]],[[45450,48764],[0,114],[-51,249],[-10,119],[-38,14],[10,70],[4,1],[3,4],[-1,2],[0,0],[1,0]],[[45368,49337],[242,51]],[[45610,49388],[0,2]],[[45610,49390],[228,171],[173,-180],[139,67],[-32,186],[-96,-90],[-208,265],[-112,-168],[-170,0]],[[45532,49641],[-6,0],[-110,0],[1,445],[-77,-115],[-153,548],[55,70],[168,648],[30,294]],[[55563,83061],[-139,107],[163,83],[-24,-190]],[[43483,50634],[-89,81],[28,125],[61,-206]],[[48003,84650],[121,-196],[-63,6],[-78,102],[20,88]],[[53693,41434],[-45,-344],[48,-341],[137,151],[132,-61],[55,-289],[-30,-221],[-114,-196],[-17,-424],[175,-278],[-26,-310],[23,-244],[-23,-373],[-92,-437],[-81,262],[-91,-201],[-107,52],[-71,301],[-106,-57],[16,-292],[-147,58],[-106,-214],[-20,-146],[113,-358],[-190,-250],[-28,-195]],[[53098,37027],[-204,619],[-149,293],[-73,212],[-167,765],[-62,393],[82,49],[56,234],[17,392],[85,-63],[12,267],[-38,346],[80,58]],[[52737,40592],[412,0],[0,842]],[[45610,49390],[-107,37],[29,214]],[[45368,49337],[-1,3],[-1,-2],[-1,-1],[-1,-3],[-4,-1],[-12,-70],[0,-1],[-14,227],[105,-100],[171,-1]],[[45865,47862],[-1,-1],[-4,-18],[0,-4],[-1,-4],[-57,65],[-96,315],[-21,204],[-186,156],[-70,184],[1,0],[0,0],[5,1],[4,1],[7,-1],[4,4]],[[52737,40592],[-138,111],[130,548],[17,222]],[[52392,42492],[86,-15],[-68,-297],[-66,51],[48,261]],[[46829,44890],[-292,285],[24,247],[-107,21],[-52,319],[-32,582],[-65,23]],[[51817,40130],[59,-44],[-68,-196],[-12,172],[21,68]],[[92652,19630],[16,-487],[-71,-311],[1,-183],[-89,-688],[15,-313],[-42,-396],[-119,-472],[2,-231],[-95,-218],[-106,-98],[-126,-533],[-28,-260],[-70,-170],[-56,-542],[-85,-220],[-90,-423],[-5,-305],[-65,-438],[20,-390],[-133,-222],[-315,-28],[-151,-58],[-259,-537],[-194,-72],[-214,158],[-126,473],[-160,-160],[11,-147],[-254,-414],[-317,365],[-188,63],[-49,-91],[-135,227],[-101,9],[-238,560],[14,424],[-96,524],[-131,259],[-145,-29],[-23,209],[18,450],[-111,423],[-119,-741],[-61,200],[1,332],[50,429],[94,197],[-88,434],[-58,-128],[-67,-381],[-237,-298],[-119,-327],[20,-327],[-182,219],[-1,297],[-45,279],[-94,177],[-12,219],[-134,101],[-52,238],[34,215],[-179,339],[-96,-85],[-190,195],[-86,-71],[-132,209],[-185,198],[-97,-102],[-241,12],[-239,-61],[-285,-286],[-224,-145],[-282,31],[-404,-479],[-162,-132],[-52,-338],[-119,-273],[-491,17],[-117,67],[-367,-78],[-110,-120],[-106,-306],[-85,47],[-194,-329],[-182,-148],[-444,197],[-98,266],[-174,154],[-13,394],[125,72],[78,228],[-28,453],[44,16],[-20,688],[-177,847],[-29,326],[12,399],[-111,634],[-117,358],[-20,439],[-152,664],[90,173],[99,17],[-19,368],[-151,754],[-60,191],[17,423],[85,301],[15,323],[-37,354],[83,477],[50,-327],[71,-175],[93,559],[182,190],[140,322],[215,297],[119,11],[71,-113],[135,89],[81,237],[152,11],[132,280],[120,-85],[160,113],[245,243],[117,327],[89,441],[158,274],[-66,405],[44,362],[133,344],[89,-110],[128,-556],[107,483],[-100,143],[49,337],[154,-180],[82,210],[-58,193],[5,219],[240,324],[-2,376],[112,69],[44,-91],[87,311],[150,21],[14,247],[197,-127],[100,-346],[97,-179],[-55,-456],[170,328],[131,-172],[102,95],[74,-97],[12,333],[-100,237],[70,204],[78,392],[96,123],[-30,291],[60,146],[165,54],[17,353],[117,-83],[177,-33],[129,145],[61,350],[71,145],[43,-214],[290,-234],[165,-70],[106,-110],[100,112],[102,0],[86,-237],[82,355],[37,-205],[80,-35],[-76,-280],[-53,-362],[-155,-37],[-14,-664],[-128,-325],[39,-325],[153,-186],[110,-262],[39,-199],[105,83],[206,-277],[117,-302],[241,-165],[49,-277],[238,-305],[210,186],[34,324],[75,250],[68,801],[63,261],[-46,508],[21,175],[-25,444],[62,176],[-41,258],[48,141],[-29,291],[82,394],[61,519],[-4,154],[155,-27],[39,-268],[0,-362],[92,-105],[-28,-266],[97,-189],[27,-810],[70,-468],[56,-104],[131,224],[63,-238],[170,-285],[-13,-325],[62,-475],[-19,-264],[151,-493],[56,-374],[-40,-416],[86,-321],[-24,-124],[235,-466],[112,31],[38,-251],[254,-209],[86,-242],[-51,-108],[149,-438],[70,-303],[35,-563],[118,34],[233,-241],[-29,-429],[198,-580],[140,-110],[66,-299],[79,-115],[115,-627],[82,-185],[-32,-260],[26,-551],[-19,-199],[63,-166],[66,-419]],[[90510,10377],[209,-83],[112,122],[273,175],[68,-75],[27,-558],[-68,-353],[-101,-773],[-87,220],[-148,-538],[-231,118],[-148,346],[-73,371],[6,213],[-159,669],[0,410],[320,-264]],[[87942,14030],[-2,149],[202,122],[92,-224],[-292,-47]],[[86212,31778],[82,-101],[155,126],[76,-113],[-62,-248],[-91,-142],[-124,193],[-36,285]],[[81687,43170],[252,174]],[[93950,44884],[27,-41],[-13,-80],[-32,12],[18,109]],[[6267,41214],[72,-72],[-9,-52],[-63,124]],[[97528,44975],[-12,11],[-3,5],[-6,22],[3,2],[1,-12],[6,-16],[11,-12]],[[96363,39494],[7,18],[4,-30],[-7,-7],[-4,19]],[[93041,35484],[-57,117],[9,285],[74,10],[45,-240],[200,-470],[-62,-257],[-103,113],[-39,309],[-67,133]],[[92062,37677],[68,7],[353,-684],[48,-278],[-42,-265],[-68,67],[-9,344],[-117,441],[-92,89],[-141,279]],[[92123,36329],[-7,327],[-36,191],[177,3],[66,-406],[-116,-263],[3,-273],[-131,1],[-31,-210],[-254,-317],[-238,-30],[-38,142],[-117,-9],[-205,334],[188,130],[362,-72],[35,88],[137,-37],[48,241],[83,172],[74,-12]],[[89166,38001],[57,-21],[248,-315],[213,-185],[177,-77],[131,-254],[154,-107],[139,-294],[118,-105],[98,-254],[-21,-412],[202,-134],[94,-181],[153,-47],[140,-364],[-29,-199],[-224,-27],[56,-454],[145,-298],[127,-190],[28,-358],[60,-91],[70,-336],[169,91],[-36,-249],[209,-495],[69,-24],[71,-227],[-9,-202],[-115,63],[-58,183],[-69,-17],[-217,185],[-95,-69],[-220,168],[-77,312],[-73,58],[-38,305],[-84,5],[-32,258],[-108,431],[-185,86],[-275,444],[-152,-465],[-92,-186],[-171,-72],[119,-302],[5,-149],[-217,-264],[-118,134],[-163,-46],[-169,58]],[[94885,32457],[143,-127],[-69,-203],[-92,147],[18,183]],[[94645,33534],[76,130],[69,-469],[-104,91],[-41,248]],[[94452,33105],[89,5],[133,-325],[-280,45],[-64,195],[28,199],[94,-119]],[[94377,33920],[-40,-60],[-116,129],[-163,303],[51,80],[268,-452]],[[93818,33959],[-127,-79],[32,252],[95,-173]],[[84707,33434],[49,229],[202,119],[195,-5],[113,111],[16,-255],[-150,-191],[-307,-234],[-79,-134]],[[84456,33163],[120,116]],[[99551,34097],[0,-9],[-2,-7],[0,-7],[-1,-5],[-1,8],[1,2],[2,10],[1,8]],[[96293,53722],[-4,10],[3,4],[1,-14]],[[99673,27945],[240,283],[86,45],[0,-14],[0,-7],[-73,-208],[-112,-248],[-38,75],[-141,-215],[-36,212],[74,77]],[[99542,27052],[58,-157],[-186,-157],[-160,117],[-20,112],[95,340],[171,114],[106,-230],[-64,-139]],[[90227,49623],[30,-30],[-42,-93],[-26,52],[38,71]],[[59936,63830],[-9,-11]],[[59927,63819],[-33,-31],[0,-1],[1,-22]],[[59895,63765],[-145,-107]],[[59750,63658],[243,1107]],[[90480,50815],[18,-42],[-29,-26],[11,68]],[[95853,24967],[51,-34],[100,-338],[237,-355],[151,-350],[-65,-110],[-178,211],[-138,267],[-101,114],[-208,485],[-97,291],[89,133],[159,-314]],[[96644,19020],[10,5],[7,-36],[-17,3],[0,28]],[[99195,12542],[123,87],[136,262],[143,-109],[-60,-248],[-15,-361],[-86,-102],[-40,-282],[-116,8],[-141,-214],[28,-342],[-106,-470],[-87,-163],[-139,-462],[-165,-52],[-167,107],[90,204],[80,453],[-96,354],[-302,334],[0,158],[167,147],[61,205],[21,413],[57,30],[-59,531],[-85,564],[-112,242],[-255,743],[63,217],[171,-87],[178,-415],[-24,-165],[102,-401],[-2,-341],[131,-99],[82,221],[87,-277],[44,-424],[293,-266]],[[97831,8318],[-262,-334],[-30,-411],[-87,-383],[-292,-712],[-118,-125],[-273,49],[-183,223],[-293,41],[-57,274],[107,389],[121,296],[132,206],[173,414],[120,25],[223,271],[181,349],[152,167],[98,254],[83,460],[119,207],[58,221],[0,267],[153,295],[117,-269],[27,-316],[179,259],[130,-563],[-205,-521],[-63,-302],[-117,-152],[-41,-310],[-152,-269]],[[87396,45391],[-10,-224],[-34,58],[44,166]],[[96453,28459],[150,-336],[-87,-158],[-63,494]],[[96266,29295],[143,-213],[37,-233],[-28,-189],[-81,-48],[-46,192],[-25,491]],[[59354,65058],[-86,97],[93,-128]],[[59361,65013],[-191,-241],[-72,5],[-122,179],[76,200]],[[59052,65156],[8,-7],[5,15]],[[59065,65164],[17,-4]],[[59082,65160],[183,-7],[-179,7]],[[59086,65160],[77,134],[136,-27],[179,122],[-34,-312]],[[59444,65077],[-27,7]],[[59416,65082],[29,-7]],[[59445,65075],[-28,-72]],[[56944,55685],[0,3488],[0,1725],[-84,649],[88,446],[-43,450],[80,183]],[[56985,62626],[93,-102],[113,81],[403,-184],[29,-113],[274,-92],[163,-190],[146,106],[147,244],[282,210],[132,-115],[78,58],[127,-199],[0,-495],[14,-197],[64,-235],[-62,-203],[60,-215],[13,-284],[157,-547],[110,-267],[-19,-150],[117,-504],[23,-235],[144,-623],[166,-818],[101,-358],[-7,-233],[53,-595],[146,-213],[192,-473]],[[60244,55685],[-778,0],[-414,0],[-719,0],[-1389,0]],[[59696,61061],[-46,-121],[-33,-420],[-101,-675],[-138,165],[-150,410],[-12,296],[-82,168],[-83,489],[-4,215],[-73,264],[1,369],[229,-40],[153,58],[148,147]],[[59505,62386],[13,-75]],[[59518,62311],[162,-1050],[16,-200]],[[59895,63765],[12,3]],[[59907,63768],[1,-399]],[[59908,63369],[-32,-217]],[[59876,63152],[-136,43],[-22,-346]],[[59718,62849],[11,-68],[12,-21]],[[59741,62760],[43,-34],[1,-7],[0,0],[0,-31],[69,-180]],[[59854,62508],[-5,-272],[-82,-485],[-5,-271],[-57,-419]],[[59705,61061],[-9,0]],[[59518,62311],[62,270]],[[59580,62581],[61,249],[109,828]],[[60889,62983],[-54,-111],[-556,-359],[276,-714],[-91,-125],[-43,-238],[-209,-97],[-66,-253],[-126,-238],[-309,125]],[[59711,60973],[-6,88]],[[59854,62508],[22,644]],[[59908,63369],[24,39]],[[64752,51840],[-308,1689]],[[64444,53529],[445,389],[388,329],[185,1438],[-127,509]],[[65335,56194],[7,289],[94,374],[-24,222],[148,91],[-70,333],[13,274],[155,49]],[[65658,57826],[1,1],[0,0],[149,-602],[86,-161],[426,-291],[149,-539],[140,-162],[4,-224],[-129,-571],[-80,-118],[-136,-419],[-34,-241],[-106,78],[-59,-155],[-46,-360],[42,-535],[-261,-140],[-72,-162],[-24,-324],[-59,-151],[-218,-34],[-81,-192],[0,-260],[-50,-139],[-287,-40],[-261,-245]],[[65579,58596],[94,-80],[-43,-225]],[[65630,58291],[-51,305]],[[59741,62760],[-23,89]],[[59505,62386],[75,195]],[[62931,60788],[253,-72],[67,-342],[201,7]],[[63452,60381],[110,-478],[7,-192],[112,-55],[19,-247],[176,-237],[32,-276],[68,-201]],[[63976,58695],[0,-2]],[[63976,58693],[-77,-130],[145,-662],[70,-244]],[[64114,57657],[32,-143],[132,58]],[[64278,57572],[-35,-234],[87,-33]],[[64330,57305],[0,-92],[275,-854],[710,-220],[20,55]],[[64444,53529],[-338,-152],[-463,-124],[-259,-323],[-162,-515],[-37,-240],[-130,-120],[-70,240],[-106,-36],[-269,72],[-50,72],[-237,0],[-189,-48],[-56,128],[-92,-266],[-9,-465],[-97,-89]],[[61880,51663],[-27,270],[-93,308],[-7,169],[-146,285],[-105,491],[-40,58],[-85,540],[-116,437],[-119,222],[-68,16],[-166,493],[-81,631],[36,363],[-131,822],[-96,306],[-231,363],[-70,231],[9,310],[-147,567],[-63,140],[-122,514],[-274,878],[-105,15],[78,881]],[[64330,57305],[140,-220],[131,133],[281,-62],[132,47],[155,242],[9,210],[123,208],[132,364],[118,213],[28,156]],[[65630,58291],[28,-465]],[[60716,52825],[100,-467],[57,-482],[27,-451],[62,-394],[116,-31],[76,-353],[135,-41],[42,-157],[110,-66],[129,-427],[177,-336],[137,-517],[94,-97]],[[61978,49006],[-122,-242],[-78,70]],[[61778,48834],[-96,239],[-115,420],[-132,247],[-63,254],[-189,237],[-94,3],[-246,161],[-161,-163],[-151,346],[-107,-511],[-60,189],[-82,-140],[-127,3]],[[60155,50119],[-35,655],[28,44],[99,706],[-3,248],[41,396],[102,-37],[32,204],[137,160],[72,4],[88,326]],[[61778,48834],[-176,-702],[8,-371],[41,-45],[184,114],[100,-53]],[[61935,47777],[-71,-259],[39,-300],[124,-441],[193,-433],[275,-235],[560,-486],[278,1],[-373,-962],[-469,-1258],[-267,33],[-267,-272],[-56,-214],[-213,-74],[-48,-142]],[[61640,42735],[-215,-11],[-122,199],[-230,-268],[-102,-289],[-165,34],[-99,95],[-115,-24],[-358,601],[-221,4],[-28,125]],[[59985,43201],[-39,115],[15,381],[-204,218],[-48,451],[18,153],[-155,328],[-74,86],[-53,272],[-78,171],[-183,98],[35,440],[160,-27],[105,172],[-11,642]],[[59473,46701],[53,779],[85,231],[98,31],[37,617],[51,98],[108,498],[97,63],[136,798],[17,303]],[[63320,61441],[5,-313],[57,-434],[70,-313]],[[60244,55685],[10,-291],[57,-319],[31,-1115],[50,-522],[194,-328],[-3,-98],[133,-187]],[[59473,46701],[-63,0],[32,404],[-132,417],[-69,133],[-37,574],[44,426],[-156,12],[3,-205],[-98,-176],[22,-476],[-134,-283],[-41,-194],[-155,-446],[-124,-7],[-232,387],[-129,-148],[0,-239],[-149,-55]],[[58055,46825],[0,355],[-324,0],[20,-398]],[[57751,46782],[-212,9],[-122,-98],[-86,54],[-50,253],[-126,367],[-184,-79],[-35,-296],[-116,-484],[6,-228],[-98,-197]],[[56728,46083],[-192,60],[38,839],[-102,416],[-118,336]],[[56354,47734],[31,204],[-119,295],[20,302],[-120,507],[-76,207],[101,224],[-60,302],[129,244],[-36,351],[148,366],[-6,266],[57,169],[243,-15],[0,1205],[0,1527]],[[56666,53888],[0,359],[278,0],[0,1438]],[[61935,47777],[81,333]],[[62016,48110],[62,-80],[54,-279],[178,-391],[175,-6],[239,328],[180,-129],[267,353],[201,-37],[144,143],[83,-61],[165,148],[146,45],[202,341],[133,-125],[-45,-228],[3,-586],[-65,-260],[-26,-574],[-51,-332],[-49,-112],[-88,-506],[-85,-193],[-40,-337],[-129,-506],[-87,-612],[-171,-631],[-94,-406],[-380,-1062],[-154,-388],[-272,-399],[-202,-367],[-264,-612],[-354,-988],[-148,-583]],[[61544,38678],[-158,596],[1,1013],[-1,1614],[94,241],[160,593]],[[59985,43201],[-46,-4],[-21,0],[-30,-1]],[[59888,43196],[-9,197],[-89,64],[-241,-266]],[[59549,43191],[-107,-286]],[[59442,42905],[-134,-338],[-134,102],[-298,-218],[-185,148],[-122,-210]],[[58569,42389],[-220,455],[-158,404],[-66,-247],[-65,104],[-225,-105],[-89,138],[-123,341]],[[57623,43479],[-69,520],[-177,210],[-73,269],[19,206],[-106,244],[-219,331],[26,218],[-120,273],[-196,155],[20,178]],[[57751,46782],[37,-191],[196,0],[71,234]],[[64893,49000],[132,2],[13,-252],[-157,-10],[12,260]],[[64752,51840],[-177,-158],[-89,-316],[15,-268],[-272,-304],[-209,-124],[-312,-273],[-92,-146],[-97,-284],[-180,7],[-179,-292],[-191,-161],[-292,-63],[-69,-198],[-143,-233],[-79,57],[-151,-153],[-154,160],[-73,324],[15,298],[-81,537],[-19,380],[-61,525],[37,236],[-19,272]],[[56666,32046],[25,-370],[-32,-178],[25,-555],[-47,-296],[45,-118],[-570,1],[-1,-861],[0,-1445],[37,-203],[302,-749],[59,-76]],[[56509,27196],[-559,-279],[-59,70],[-113,-78],[-133,126],[-397,33],[-131,306],[-503,0],[-666,-1],[-72,-29],[-167,329],[-103,-6],[-107,-181],[-183,37],[-41,-65]],[[53275,27458],[4,902],[59,322],[11,244],[63,337],[63,633],[4,310],[126,339],[-11,103],[147,229],[92,538],[18,536],[-28,264],[-158,697],[-56,424],[112,249],[0,250],[-93,465],[-70,573],[-144,565],[316,223]],[[53730,35661],[421,-4],[429,16],[67,-234],[-4,-228],[62,-538],[101,-287],[73,-354],[149,22],[34,87],[321,-18],[42,388],[4,331],[210,0],[70,-204],[341,0],[22,-117],[-24,-418],[49,-339],[-45,-659],[118,-434],[36,-850],[224,87],[93,103],[105,-69],[38,104]],[[53639,36506],[-76,-71],[-84,-282],[1,-407],[-91,-23]],[[53389,35723],[8,187],[-58,352]],[[53339,36262],[111,298],[97,157],[92,-211]],[[58170,36678],[-47,381],[4,603],[-61,239]],[[58066,37901],[92,-69],[145,67],[43,277],[138,-38]],[[58484,38138],[-38,-320],[113,-131],[4,-160],[-92,-182],[-123,-530],[-84,-154],[-94,17]],[[63976,58695],[76,42],[14,-93],[-90,49]],[[54303,45283],[87,-57],[165,168],[128,-99],[138,223],[188,116],[152,20],[150,453],[24,257],[236,83],[80,-20],[158,287],[94,328],[118,192],[44,435],[190,122],[99,-57]],[[57623,43479],[-100,137],[-157,-116],[-101,154],[-224,16],[-10,-181],[-177,-88],[-84,146],[-58,-154],[-160,-99],[-58,-121],[-130,163],[-88,-243],[-13,-189],[-82,-73],[-168,142],[-121,-16],[-102,116],[-89,1],[-50,227],[-184,269],[-161,-150],[-89,-365],[-67,-81],[32,-238],[-9,-368]],[[55173,42368],[-66,79],[-113,-28],[-142,119],[-121,-139],[-123,-18],[-23,-473],[-88,-437]],[[58569,42389],[-20,-343],[31,-121],[-41,-295],[70,-30],[80,-290],[-210,-523],[-149,-309],[-72,-663],[-43,-799],[4,-141]],[[58219,38875],[-121,-311],[5,-221],[-85,-223],[48,-219]],[[58170,36678],[-20,-253],[80,-684],[-35,-142],[67,-499],[157,-357],[128,-766]],[[58547,33977],[-522,-197],[5,-208],[-147,-349],[82,-402],[-4,-532],[-73,-660],[31,-292],[137,-293],[225,96],[0,-930],[-64,173],[-160,-158],[-50,301],[-135,412],[-192,105],[-117,361],[-98,-145],[-156,15],[-271,240],[3,302],[-271,-140],[5,218],[-109,152]],[[53730,35661],[-148,15],[-59,-118],[-134,165]],[[53639,36506],[75,-123],[98,107],[-1,180],[184,81],[4,-373],[125,39],[94,339],[103,213],[92,63],[85,416],[3,883],[86,196],[57,305],[98,271],[59,37],[117,330],[-8,294],[78,378],[-27,489],[64,455],[1,418],[154,682],[-7,182]],[[53339,36262],[-80,383],[-161,382]],[[61979,49008],[3,2],[78,-424],[-171,-385],[127,-91]],[[61978,49006],[1,2]],[[61544,38678],[-66,-208],[-81,-68],[-117,-370],[-117,-90],[-19,-435],[-42,-84],[-57,-398],[-86,-399],[-72,-107]],[[60887,36519],[-392,711],[-55,170],[24,273],[-653,962],[-344,503],[-41,16]],[[59426,39154],[13,624],[-19,164],[64,349],[83,197],[23,180],[129,401],[-12,579],[-96,324],[-82,567],[-87,366]],[[59549,43191],[339,5]],[[53211,63711],[193,-227],[185,-27],[88,70],[278,-157],[64,-129],[205,-97],[48,-347],[77,-320],[101,-125],[204,-46],[393,-304],[143,-277],[140,-99],[116,105],[127,323],[30,218],[-70,428],[11,167],[170,397],[318,284],[127,-10],[259,-210],[41,-309],[144,-28],[87,-110],[248,-31],[47,-224]],[[56666,53888],[-544,735],[-552,720],[-559,702],[-567,684],[-278,-326]],[[64114,57657],[-15,482],[79,453],[55,80],[95,-176],[-30,-285],[38,-369],[-58,-270]],[[58219,38875],[154,27],[91,211]],[[58464,39113],[102,-427],[3,-483],[-85,-65]],[[65405,36554],[21,-44],[-15,-22],[-6,66]],[[58464,39113],[91,42],[378,-1],[493,0]],[[60887,36519],[-17,-313],[-98,-697],[39,-273],[154,-297],[12,-216],[-51,-111],[-28,-683],[112,-653],[22,-402],[64,-267],[95,-113],[31,-171],[-6,-11],[-1,-6],[-1,-2],[-1,-4],[0,-3],[0,-4],[-2,-9],[-21,-10]],[[61190,32274],[-1,-1]],[[61189,32273],[-9,-11],[-1,-4],[-2,0],[-7,-13],[-1,-3],[-1,-13],[0,-3],[-2,-1],[-4,-2],[-3,-9],[-4,-12],[-4,-8],[-3,-4],[-5,-11],[0,0],[-18,-39],[-2,-3],[-1,-6],[-2,-5],[-4,-9],[-1,-1],[-4,-9],[-3,-3],[-25,-18],[-1,-1],[-3,-4],[-2,-3],[-4,-4],[-3,-5],[-28,-40],[-2,-2],[-13,-15]],[[61027,32012],[-123,-169],[-103,2],[-112,-180],[-57,88],[-123,-7],[-26,-177],[-91,-95],[-160,73],[-60,-110],[-225,228],[-45,-94],[-192,-16]],[[59710,31555],[-89,329],[12,262],[-39,491],[-138,410],[-168,-83],[-133,152]],[[59155,33116],[-145,202],[-125,32],[-167,335],[-83,-14],[-88,306]],[[69333,4577],[251,15],[-17,-211],[-158,21],[56,-274],[-239,120],[-128,262],[8,241],[227,-174]],[[57017,27086],[72,-426],[72,-173],[108,-662],[154,-283],[134,-102],[43,-278],[92,-16],[0,-429],[91,-351],[155,-39],[133,-123],[13,-187],[75,-97]],[[58159,23920],[-94,-15],[-26,-156],[-165,-99],[-119,-356],[-255,-416],[-38,-435],[-131,-277],[-141,-175],[-85,-545],[-72,-97],[-177,-36],[-217,143],[-174,252],[-84,-53],[-69,-479],[-133,-239],[-153,-369],[-298,53],[7,252],[57,206],[-44,403],[-87,399],[-106,195]],[[55555,22076],[0,1985],[277,0],[0,873],[0,1774],[127,0],[457,227],[55,0],[88,-359],[161,347],[85,-27],[114,176],[98,14]],[[70363,1806],[92,-54],[-40,-111],[-52,165]],[[63805,28446],[44,-237],[-5,-239],[-120,-517],[31,-298],[-52,-517],[-92,-575],[-50,-502],[-72,-426],[-34,-354],[-152,-1069],[-84,-936],[-136,-853],[-104,-145],[-113,-9],[-202,-257],[-120,-41],[-122,207],[-102,36],[-80,166],[-36,286],[-70,189],[-8,547],[31,109],[-110,442],[-41,413],[35,377],[59,298],[49,-8],[46,350],[171,637],[-19,419],[-56,487],[-56,271],[-26,578],[157,666],[-17,290],[94,-48],[130,213],[94,-37],[114,121],[241,451],[111,264],[66,-175],[60,350],[-11,146],[99,212],[-44,155],[250,340],[45,439],[-59,278],[150,134],[71,-108],[58,-277],[109,-732],[23,-691],[69,-330],[-69,-554],[-57,82],[-37,318],[-75,-91],[24,-245]],[[61027,32012],[85,85],[35,74],[30,79],[30,19],[12,39],[53,-56],[-6,-330],[-49,-189],[1,-249],[48,-823],[14,-952],[55,-195],[7,-287],[-53,-359],[-156,-477],[-102,-399],[-281,-397],[-354,-354],[-190,-524],[-184,-407],[-110,-132],[-91,-321],[-167,-313],[-37,-420],[37,-66],[143,-736],[17,-396],[51,-4],[0,-458],[-23,-584],[19,-332],[-97,-342],[-90,-116],[-316,-281],[-184,-222],[-122,-389],[61,-243],[23,-386]],[[59136,20569],[-210,13]],[[58926,20582],[-13,598],[-32,40]],[[58881,21220],[17,589],[-14,595],[-29,253],[-89,339],[1,212],[-71,549]],[[58696,23757],[307,794],[71,548],[100,374],[-69,485],[29,185],[4,400],[47,142],[-36,240],[32,481],[-95,537],[-187,112],[-89,175],[-159,153],[-201,-14],[0,277]],[[58450,28646],[-56,448],[406,350],[433,368]],[[59233,29812],[123,-443],[197,152],[44,-177],[13,-459],[-94,-453],[183,-595],[135,446],[112,96],[-5,591],[23,355],[-107,363],[-172,494],[-72,0],[-64,944],[71,309],[90,120]],[[61190,32274],[-1,-5],[-1,2],[1,1],[0,1]],[[65936,25154],[64,356],[57,-177],[-43,-186],[-78,7]],[[59233,29812],[-66,26],[-58,222],[60,312],[10,428],[118,143],[-59,204],[20,230],[-27,249],[41,173],[-12,296],[96,153],[-84,498],[-100,211],[-17,159]],[[56509,27196],[226,118],[206,-64],[76,-164]],[[55555,22076],[0,-1823],[0,-812],[-35,-11],[0,-1],[-1,-4],[0,0],[-103,-132],[0,0],[-62,-171],[1,0],[-352,28],[0,1],[-1,5],[0,0],[-51,46],[0,0],[-51,-9],[0,1],[-45,53],[0,0],[-32,135],[0,1],[-47,264],[0,0],[-3,28],[0,0],[-32,46],[0,-1],[-1,-2],[0,0],[-25,-12],[-1,0],[-40,-81],[0,-1]],[[54674,19624],[-6,-135],[-10,-24],[-1,-10],[3,-22],[-8,-19],[-5,-21],[-8,-2],[-8,18],[-15,-22],[-5,-20],[-37,-31],[-39,17],[-143,327],[-146,568],[-55,650],[-72,468],[13,471],[-118,781],[23,791],[-41,454],[-270,1006],[-61,477],[-174,809],[-144,412],[-54,265],[-33,401],[11,234],[1,-3],[3,-6]],[[65383,24858],[126,-210],[-53,-148],[-85,79],[12,279]],[[58926,20582],[-44,-343],[-230,83],[-96,271],[0,258],[90,392],[80,146],[155,-169]],[[58159,23920],[111,39],[141,-152],[155,44],[130,-94]],[[59136,20569],[-145,-1228],[-170,-290],[-174,-487],[-207,-866],[-109,-328],[-159,-277],[-253,-653],[-388,-662],[-179,-178],[-123,48],[-92,-66],[-32,-182],[-153,57],[-65,-163],[-328,158],[-71,-93],[-218,80],[-244,-286],[-344,-78],[-131,-237],[-96,36],[-87,241],[-78,75],[-155,353],[-91,350],[-74,442],[118,142],[-11,469],[-235,919],[-66,352],[-105,745],[-90,378],[22,11],[25,53],[10,-15],[5,-2],[6,7],[12,40],[-4,26],[12,30],[5,134]],[[58020,19194],[-63,144],[-255,-270],[-176,-563],[180,-628],[72,-40],[110,371],[128,40],[163,511],[-25,179],[-134,256]],[[58450,28646],[-236,-15],[-178,-217],[-30,-379],[-276,-351],[-80,-332],[-145,-383],[-96,-87],[-130,134],[-67,-81],[-82,135],[-113,16]],[[62039,31704],[48,-384],[-67,51],[19,333]],[[62544,30721],[14,-93],[-20,-20],[-14,90],[20,23]],[[48401,28411],[25,27],[7,-34],[-30,-49],[-2,56]],[[50926,777],[22,-35],[-26,-5],[4,40]],[[55699,97591],[553,-187],[457,169],[725,-97],[66,-250],[-446,-302],[-500,-126],[-197,123],[-534,-18],[-750,349],[626,339]],[[56339,96118],[326,-460],[-444,-16],[-238,240],[356,236]],[[54511,97415],[664,-364],[80,-248],[582,-251],[-521,-244],[-519,-1103],[-268,-280],[-604,506],[-155,537],[-563,495],[-246,581],[521,158],[860,71],[169,142]],[[30569,36836],[66,879],[73,1059],[6,369],[-51,369],[-121,283],[0,481],[253,224],[-51,155],[-146,-9],[0,456],[467,13],[162,305],[69,9],[57,-279],[11,-439],[66,40]],[[31430,40751],[146,-336],[162,177],[158,-40],[216,419],[89,90],[4,195],[173,143],[23,184],[-191,84],[15,159],[-64,271],[29,132],[-35,274],[-143,282],[115,65],[96,-171],[132,-35],[58,90],[98,-268],[63,310],[82,104],[83,-72],[161,121],[71,205],[96,6],[104,296],[-43,175]],[[33128,43611],[149,47],[64,-138],[-42,-411],[119,-88],[49,-312],[-69,-230],[-63,-676],[76,-323],[-8,-276],[138,-335],[206,-79],[53,208],[205,88],[76,221],[141,-96],[91,61]],[[34313,41272],[145,-63],[-24,265],[92,122],[200,142],[106,-187]],[[34832,41551],[74,-130],[169,113],[230,-83],[97,233],[20,188],[140,656]],[[35562,42528],[92,259],[37,277],[121,-394],[-4,-380],[109,-882],[62,-227],[153,-89],[12,-385],[-112,-213],[-194,-663],[22,-224],[45,-977],[101,-166],[102,101],[87,-62],[99,132],[101,-87],[70,245],[101,169],[61,303],[109,139],[122,27],[60,-222],[231,-127],[153,-254],[131,-118],[33,68],[163,-281],[49,-305],[-67,-168],[-27,-396],[186,334],[220,213],[241,-253],[36,-84],[250,-69],[209,56],[157,-8],[219,-272],[43,-126],[171,-222],[95,-302],[154,-357],[282,-355],[159,66],[136,-84],[64,-255],[128,-1174],[-12,-619],[-94,-691],[-49,-206],[-284,-880],[-159,-262],[-131,-515],[-95,-480],[-153,-501],[-111,236],[-29,-393],[-79,-308],[38,-362],[-26,-389],[26,-782],[-14,-391],[-57,-758],[24,-276],[-59,-78],[-106,-515],[11,-550],[-36,-270],[-56,-83],[-113,-619],[-89,-156],[-89,-463],[25,-311],[-63,-149],[-157,-162],[-63,-180],[-14,-253],[-296,5],[-121,-76],[-89,112],[-91,-108],[-106,0],[-227,-542],[-135,34],[-266,-326],[-46,-131],[-299,-482],[-147,-718],[-9,-611],[75,-383],[-60,-269],[-64,-559],[-178,-313],[-123,-387],[-112,-625],[-106,-39],[-138,192],[-72,-615],[-131,-159],[-85,-314],[28,-302],[-184,-805],[-163,-329]],[[35175,15620],[-45,40],[3,385],[123,296],[-141,208],[-74,325],[-72,66],[-132,324],[-185,180],[-91,268],[-120,20],[-214,488],[-117,-114],[-111,77]],[[33999,18183],[250,589],[31,171],[197,461],[29,168],[242,435],[177,146],[120,204],[54,675],[-61,399],[-203,48]],[[34835,21479],[93,880],[-51,333],[-63,63],[-109,-127],[-107,55],[-61,765],[11,161],[-60,246],[-225,21],[-354,98],[-10,401],[30,177],[-7,434],[-80,390]],[[33842,25376],[86,143],[-76,153],[97,520],[62,570],[-55,486],[-67,36],[-111,238],[-9,619],[-483,41],[-29,1182],[-50,221],[-7,368],[-149,225],[-237,-28],[-70,271],[-188,112],[-103,267],[-61,-20],[-110,161],[-50,-73],[-125,62],[-116,306],[-116,211],[-32,414],[31,113],[-49,362],[39,194],[-74,276],[-88,57],[-208,-101],[-158,-320],[-135,-192],[-94,-31],[-62,-218],[-133,-140],[-144,149],[-94,-4]],[[30674,32006],[-100,18],[-75,-96],[-116,39],[6,1001],[-216,-282],[-223,0],[-32,334],[-118,88],[-134,0],[71,300],[-281,1028],[89,583],[144,209],[-36,244],[79,331],[26,336],[301,511],[234,76],[35,129],[139,39],[102,-58]],[[36021,39442],[21,339],[171,-83],[121,79],[202,-70],[-11,-468],[-107,-446],[-257,-226],[-101,141],[-112,47],[129,603],[-56,84]],[[36222,40146],[-71,-267],[-69,161],[140,106]],[[33453,49420],[41,-97],[-54,-51],[13,148]],[[34832,41551],[71,137],[49,298],[-12,152],[65,327],[-104,316],[-24,651]],[[34877,43432],[107,342],[30,228],[318,-313],[127,-292],[150,-204],[41,-403],[-88,-262]],[[33128,43611],[-188,553],[77,148],[-21,251],[197,256],[57,185],[-113,256],[250,581]],[[33387,45841],[188,-194],[177,-487],[2,-245],[147,-194],[224,-537],[1,-5],[0,-9],[2,-54],[1,-2],[0,-9],[-1,0],[0,-6],[0,-1],[-3,-19],[0,0],[-2,-13],[0,-4],[-3,-10],[-1,-6],[0,-13],[0,0],[0,-5],[0,-3],[0,-2],[-2,-9],[-1,-18],[6,-25],[0,-6],[-1,-4],[-1,-9],[0,-6],[0,-7],[1,-5],[0,-15],[0,-1],[-2,-11],[0,-4],[-5,-26],[0,0],[-15,-50],[-2,-3],[-3,-9],[0,0],[-1,-4],[-1,-1],[-1,-9],[0,-1],[0,-7],[1,-5],[-5,-50],[-1,-1],[-3,-5],[0,0],[-6,-11],[-2,-5],[-2,-9],[-1,-1],[0,-9],[14,0],[-2,-52],[10,0],[-1,2],[13,0],[1,-16],[7,-22],[-4,-31],[0,0],[-2,-1],[-1,-2],[-4,-11],[-7,37],[-2,1],[0,0],[-1,0],[0,0],[-3,1],[-1,0],[-1,-2],[-1,0],[-4,-12],[0,-18],[-6,-34],[0,0]],[[34077,43537],[-97,-62],[-110,-613],[111,-449],[107,-148],[22,-354],[52,-136],[99,-459],[52,-44]],[[46095,86380],[-252,-285],[-269,-122],[-196,-241],[-289,-66],[-133,-180],[-290,-34],[-312,134],[-111,124],[-284,62],[-6,213],[-161,290],[-90,316],[120,311],[-267,81],[-273,-32],[101,384],[346,308],[357,-388],[-40,-169],[251,-140],[28,377],[410,120],[950,19],[196,-292],[339,-213],[27,-321],[-152,-256]],[[33040,49888],[50,26],[-8,-148],[-49,31],[7,91]],[[33054,50344],[-41,57],[34,131],[34,-97],[-27,-91]],[[34077,43537],[6,12],[2,35],[17,-25],[17,24],[-12,70],[-19,44],[33,174],[28,277],[206,-41],[104,-70],[64,128],[214,-81],[58,75],[198,-95],[-2,-219],[-114,-413]],[[33007,49491],[16,-94],[-14,-92],[-31,86],[29,100]],[[35052,74304],[60,-268],[214,-188],[-35,-351],[-120,-36],[-110,216],[-54,520],[-133,-246],[-119,-31],[-99,-313],[-141,-57],[125,383],[-178,194],[-255,-88],[-422,110],[-185,-87],[-104,236],[205,342],[49,455],[151,435],[134,622],[104,219],[111,401],[220,207],[122,-20],[-74,-369],[-283,-764],[183,-10],[83,-389],[276,-122],[71,177],[288,-189],[-88,-327],[30,-221],[113,-101],[-139,-340]],[[31310,72353],[-145,349],[4,999],[-120,200],[-190,-119],[-88,201],[-215,-549],[-117,-647],[-113,-284],[-155,-120],[-33,-158],[-964,-22],[-261,-442],[-146,-197],[-100,-333],[-526,0],[-141,-129],[73,-448],[-318,-312],[-324,-134],[-319,-381],[-187,134],[2,327],[150,208],[111,707],[-110,1256],[-300,347],[-99,169],[-75,343],[-92,-53],[-85,308],[-455,476],[-519,542],[-269,-238],[-221,99],[-360,-46],[-432,414],[-446,67],[-66,415],[-91,-213],[-885,1],[-910,0],[-852,0],[-651,0],[-502,0],[-761,-2],[-589,0],[-956,1],[-806,1],[-756,2]],[[15900,75092],[-77,0],[-15,0],[-49,235],[-192,127],[-221,329],[33,238],[-201,145],[-96,-54],[-113,239],[-183,124],[-68,-79],[-214,271],[-31,447],[80,219],[-130,214],[-10,245],[-129,266],[-197,169],[-218,378],[-113,399],[148,605],[-18,449]],[[13886,80058],[-26,152],[-273,203],[-288,336],[22,123],[-142,325],[-228,671],[-440,611],[-19,204],[-125,168],[-198,-114],[-109,-340],[-241,-185],[-43,241],[-580,784],[-80,-110],[-283,89],[0,1200],[0,1325],[0,1537],[0,1448],[0,1203]],[[10833,89929],[513,-103],[201,-211],[340,-201],[395,25],[-62,169],[439,305],[220,-179],[186,49],[648,479],[303,-84],[202,-177],[293,317],[191,-15],[96,-291],[222,-265],[207,40],[387,-96],[183,326],[481,4],[313,-264],[433,-123],[245,-175],[399,-73],[215,66],[219,-117],[249,-336],[-335,-149],[103,-233],[300,-95],[350,-6],[408,67],[257,171],[88,-194],[183,-8],[333,-422],[82,258],[-128,177],[253,389],[-469,-18],[127,245],[592,225],[219,-143],[27,-244],[238,-256],[273,36],[206,-187],[330,-94],[371,121],[280,-96],[328,150],[-34,281],[88,158],[514,-304],[373,-1],[295,313],[-267,284],[74,360],[-496,287],[-133,286],[111,269],[-118,120],[49,278],[344,567],[613,-437],[2,-375],[399,-484],[-321,-292],[244,-175],[286,-92],[77,-622],[306,513],[319,-218],[126,-374],[-170,-299],[262,-493],[194,88],[226,427],[59,439],[262,83],[-187,371],[24,381],[226,54],[278,-129],[274,2],[368,-754],[-338,-115],[103,-410],[246,-321],[-73,-336],[-149,-42],[-159,-264],[-271,-165],[-301,-82],[-174,43],[-54,216],[-314,-53],[189,-226],[-174,-367],[-187,-236],[-187,-24],[-208,242],[-312,194],[197,-437],[411,-22],[175,-110],[-313,-688],[-195,-143],[-377,-58],[-11,-197],[-186,-91],[54,-301],[-344,-363],[-163,-36],[-242,-382],[10,-183],[-155,-127],[-47,-258],[-192,-526],[-41,-361],[19,-688],[144,-162],[293,-19],[26,-205],[192,-805],[77,-225],[278,146],[142,-7],[194,-172],[311,-116],[233,-262],[95,-259],[554,-398],[236,-232],[253,42],[453,-133],[16,-219],[-64,-329],[83,-373],[4,-375],[-48,-148],[211,-486],[51,-234],[211,-277],[43,-261],[177,-136],[82,290],[253,386],[-89,834],[-61,165],[5,482],[-108,153],[-17,252],[167,85],[324,306],[184,282],[160,460],[0,571],[-84,415],[-195,395],[-242,229],[17,261],[141,273],[28,238],[120,136],[-80,207],[-6,483],[-155,69],[157,430],[-110,193],[-19,455],[185,158],[528,-235],[310,-7],[205,170],[300,-369],[216,-196],[27,-298],[273,-141],[378,-123],[-92,-442],[129,-713],[2,-289],[175,-1],[98,-267],[168,-196],[231,137],[126,289],[202,158],[69,307],[-42,151],[164,404],[146,1],[44,-371],[149,-183],[322,-728],[-18,-217],[134,-160],[107,-559],[74,-15],[-121,-684],[153,-24],[97,-233],[141,-50],[85,-219],[-53,-150],[270,-90],[159,-240],[255,-44],[191,-168],[-259,-115],[-117,-229],[-394,-197],[123,-169],[426,509],[162,-29],[95,-335],[225,-73],[158,-348],[-62,-461],[93,-44],[-19,-260],[-138,-209],[-269,-276],[-355,-69],[-139,-342],[-334,-447],[-352,-29],[-382,80],[-225,-34],[-227,57],[-429,-23],[-197,-117],[-137,-255],[-60,-323],[-206,-34],[-19,-123],[-242,-242],[-234,-713],[-152,-247],[-17,-305],[434,925],[219,253],[535,400],[254,39],[237,-143],[72,-129],[-1,-267],[-155,-212],[-313,-205],[61,-166],[245,82],[-45,-363],[14,-340],[95,-413],[196,-76],[4,345],[170,-157],[298,55],[-94,-364],[-91,-9],[-244,202],[-43,-204],[138,-159],[171,14],[73,-102],[112,122],[235,-201],[-72,-250],[-598,-500],[-152,83],[-21,-159],[-215,-473],[-116,-157],[-175,201],[-33,248],[119,420],[385,487],[-129,189],[-290,-315],[-233,-103],[-149,101]],[[33058,72901],[263,211],[59,-210],[-169,-227],[-248,-54],[-61,343],[266,719],[81,-139],[-21,-438],[-170,-205]],[[30720,98269],[1080,179],[236,-82],[-1584,-763],[-214,-394],[-1111,-291],[202,-240],[-327,-651],[-366,-164],[-623,-505],[-78,-188],[445,-31],[-110,-273],[-515,-206],[-187,137],[-564,-27],[-395,50],[-285,-124],[-861,76],[-370,135],[38,199],[500,369],[-119,314],[237,71],[-49,394],[229,245],[393,91],[263,205],[-206,300],[-393,116],[115,540],[-403,67],[-725,306],[-56,237],[257,379],[1077,366],[808,-46],[686,414],[903,115],[914,-103],[1046,121],[1382,-146],[1028,-477],[-895,-380],[-1403,-335]],[[26389,90972],[104,416],[-259,89],[68,335],[-108,459],[158,291],[672,300],[309,3],[117,-340],[160,-69],[28,-561],[394,-33],[424,307],[659,-189],[51,-268],[209,-35],[-13,-254],[347,-313],[136,267],[280,-120],[112,-175],[-222,-329],[396,101],[602,-255],[272,-375],[-194,-205],[20,-218],[222,-4],[53,-197],[-396,-244],[14,-154],[335,-159],[94,-213],[184,-102],[342,-39],[241,-225],[52,-286],[214,-188],[310,75],[199,-271],[-50,-230],[-285,-98],[-46,-432],[-197,5],[-6,-409],[-311,43],[-274,454],[18,162],[-452,395],[-100,-606],[151,-464],[374,-224],[-34,-168],[317,-576],[-122,-761],[-256,250],[-215,42],[-237,325],[-315,198],[-30,-153],[163,-256],[150,-70],[439,-628],[-74,-255],[-292,209],[-349,74],[-165,126],[-115,249],[-154,-26],[-398,275],[72,307],[-250,72],[-181,362],[-349,295],[-148,-129],[-228,114],[-369,-245],[-255,101],[-130,252],[22,189],[232,167],[-34,171],[605,-133],[381,210],[40,162],[-188,220],[397,481],[204,363],[-217,717],[-193,47],[-453,463],[-65,205],[-538,425],[-41,268],[-187,2],[-126,-222],[-727,146],[-121,-171],[-898,163],[-176,-63],[-261,239],[-304,-62],[-257,156],[-180,240],[288,110],[38,199],[-418,58],[-102,465],[81,477],[135,347],[341,393],[523,149],[333,-135],[-331,-296],[-159,-302],[125,-323],[38,-429],[333,-264],[-23,-234]],[[32518,75606],[288,-263],[-97,-208],[-231,118],[-322,375],[25,146],[337,-168]],[[29116,88926],[39,-468],[-113,-185],[-430,-73],[-82,351],[180,386],[406,-11]],[[27924,92160],[-207,361],[-183,65],[27,298],[734,-63],[258,-111],[246,-322],[-48,-180],[-339,62],[-488,-110]],[[27927,84390],[-200,-110],[-9,253],[169,199],[96,-126],[-56,-216]],[[25401,93418],[-397,22],[-463,138],[-237,355],[139,270],[-300,554],[-241,-71],[-562,117],[-250,353],[405,102],[424,-88],[218,-243],[454,67],[160,-189],[447,-95],[-255,-168],[560,-385],[562,-16],[615,214],[793,-27],[449,-280],[-229,-573],[-403,-78],[-511,51],[-936,-58],[-442,28]],[[27083,85665],[-7,173],[-279,107],[-13,-204],[-455,-511],[-124,169],[20,224],[-299,-11],[-40,220],[174,100],[-56,370],[71,230],[37,564],[226,71],[298,-427],[483,-319],[174,-198],[45,-232],[290,-133],[-10,-251],[-128,-135],[-407,193]],[[27211,77965],[115,144],[144,-10],[93,-351],[-352,217]],[[27222,84926],[-297,-359],[-185,-19],[-63,195],[184,358],[312,40],[49,-215]],[[25555,96657],[39,-303],[-245,-283],[-911,8],[-632,564],[476,284],[-880,33],[-243,340],[26,330],[295,336],[947,286],[437,-476],[801,-114],[264,-533],[492,-283],[-866,-189]],[[23579,91955],[-154,244],[3,662],[149,217],[487,106],[890,-203],[-458,-737],[-154,-112],[-437,49],[138,-236],[-172,-275],[-306,-70],[14,355]],[[23473,95558],[-18,222],[647,-38],[-91,-207],[-538,23]],[[24037,93777],[-6,-233],[-292,-35],[-570,326],[275,340],[358,26],[226,-226],[9,-198]],[[23598,95924],[-370,-89],[-332,105],[-235,358],[253,212],[738,-329],[-54,-257]],[[23389,89239],[-127,-151],[-866,296],[186,217],[57,290],[181,215],[434,-383],[135,-484]],[[23141,92134],[46,-631],[-748,-347],[-126,296],[-265,307],[-328,89],[-259,323],[172,232],[217,-257],[250,5],[51,265],[-366,272],[154,227],[298,108],[203,-152],[561,86],[-216,-490],[356,-333]],[[22401,93777],[-282,23],[-64,291],[-387,82],[94,306],[-126,237],[529,243],[676,-94],[108,-761],[-165,-309],[-383,-18]],[[21472,96611],[198,103],[585,-273],[31,-294],[-271,-146],[-669,199],[-264,440],[390,-29]],[[19444,91941],[27,382],[642,-689],[-186,795],[75,164],[314,-27],[424,-336],[153,-711],[124,-170],[-42,-425],[276,-323],[693,-272],[22,-374],[-329,-132],[9,-353],[-358,-162],[-304,103],[-496,260],[-347,-218],[-280,-27],[-315,-216],[-750,-103],[-275,65],[-98,447],[-396,27],[-389,113],[-210,274],[-28,179],[791,203],[418,-59],[258,182],[-525,163],[-272,-79],[-662,12],[-300,268],[103,488],[-288,-5],[161,602],[327,299],[792,324],[146,-157],[534,-191],[561,-321]],[[20553,92868],[434,-134],[-229,-484],[-225,294],[-259,147],[279,177]],[[19444,94846],[338,250],[273,-556],[350,7],[328,-256],[-169,-470],[-338,-106],[-386,98],[-1079,-454],[-296,7],[-254,193],[805,345],[-1148,-148],[-553,201],[293,625],[292,229],[300,47],[157,-222],[419,-10],[271,-257],[29,-190],[617,-38],[-45,430],[-204,275]],[[19443,96017],[-15,-395],[-548,-171],[-323,170],[184,307],[702,89]],[[15000,91605],[272,426],[72,427],[197,362],[-199,486],[891,155],[407,-204],[804,-66],[530,-504],[-1073,-616],[-267,-278],[-97,-483],[-362,-88],[-281,-257],[-181,97],[-149,321],[-564,222]],[[16486,95035],[399,405],[775,178],[276,-160],[-175,-515],[-541,-152],[-474,-373],[-610,120],[-195,198],[309,85],[236,214]],[[15679,74757],[-32,-154],[-397,287],[-252,373],[-154,116],[-32,332],[-310,258],[-172,374],[130,94],[207,-186],[485,-209],[182,-607],[235,-181],[108,-308],[2,-189]],[[14142,78157],[143,-125],[-7,-351],[-143,139],[7,337]],[[13607,77383],[-63,-49],[-359,664],[212,109],[33,-474],[177,-250]],[[13040,78797],[351,-60],[-50,-574],[-139,-101],[-130,274],[-59,266],[27,195]],[[34338,73701],[36,-21],[-22,-66],[-14,87]],[[32928,47435],[-43,162],[168,69],[3,-387],[-46,-164],[-103,111],[21,209]],[[31430,40751],[-94,810],[-128,322],[-59,49],[147,338],[-74,298],[-71,555],[-2,537],[64,141],[38,553],[-86,66],[-66,-94],[-179,-49],[-99,69],[-107,-84],[-191,627],[-179,85],[-73,-89],[-285,49],[-56,242],[-62,80],[33,485],[-83,327],[-30,328],[-64,140],[-104,-71],[117,478],[15,439],[113,467],[66,34],[77,360],[164,119]],[[30172,48362],[-159,-156],[1,-151],[100,-523],[-14,-156],[-92,-232],[-43,-224],[105,-340],[13,-196],[102,24],[77,165],[5,300],[-123,468],[-12,240],[41,166],[148,172],[182,120],[-29,388],[111,169],[49,-395],[246,-104],[123,-212],[59,-458],[526,97],[138,-313],[186,-117],[110,55],[148,254],[108,-27],[175,194],[169,-389],[33,-153],[100,19],[148,-124],[186,-244],[16,-141],[-190,-252],[-75,-159],[123,-201],[118,124],[191,-34],[115,-175]],[[31310,72353],[84,-239],[0,0],[-71,-159],[-270,-244],[-207,18],[-72,-278],[-224,-55],[-219,-679],[-1,-469],[83,-341],[-119,-178],[-247,-161],[-315,-47],[-174,-164],[-87,-157],[-19,-44],[-2,-24],[-24,-9],[3,-71],[-4,-472],[-132,-452],[-89,-89],[-172,70],[110,-354],[11,-236],[-164,-580],[-67,447],[-114,136],[-37,-896],[120,-219],[93,-646],[-22,-283],[-246,-335],[75,-175],[-76,-142],[-248,-181],[-109,-344],[-173,-78],[-136,-224],[-88,-321],[-146,-249],[-65,12],[-208,-306],[-82,-318],[-117,-687],[86,-852],[79,-456],[109,-402],[1,-335],[145,-894],[-21,-801],[-88,-342],[-66,-28],[-111,133],[-27,202],[-146,192],[-92,408],[-181,634],[-46,325],[52,406],[7,331],[-107,186],[-169,513],[-109,159],[-206,-229],[-151,-71],[-14,150],[-145,233],[-203,127],[-290,-105],[-69,115],[-166,-65],[-138,48],[-236,-165],[11,-503],[-99,247],[-142,-394],[-112,39],[-19,178],[-230,203],[-100,-217],[-240,172],[-226,7],[-207,-186],[-171,-466],[-201,-180],[-263,-432],[-117,-873],[46,-464],[44,-149],[-1,-3],[-36,-5]],[[22978,58521],[-270,90],[-154,213],[-85,42],[-95,458],[-7,299],[-110,228],[-117,350],[-140,693],[-121,198],[-49,177],[-339,-26],[-145,-547],[-241,244],[-137,236],[-48,387],[-89,365],[-152,217],[-270,572],[-467,-1],[0,-323],[-796,-1],[-578,467],[-461,368],[26,161],[-668,-132]],[[17465,63256],[-101,561],[-288,514],[-192,83],[-111,197],[-237,22],[-49,92],[4,379],[-181,403],[-153,418],[-38,233],[52,170],[-154,222],[-53,504],[-91,141],[-76,313],[-165,365],[-36,629],[-141,304],[-7,183],[67,283],[23,386],[-80,473],[-55,534],[88,519],[72,1143],[21,1002],[-57,190],[-107,721],[-68,249],[27,161],[181,-160],[329,-53],[137,-102],[-64,594],[-62,163]],[[29440,69112],[13,20],[2,24],[39,41],[25,47],[15,-6],[31,42],[304,63],[-47,-151],[-350,-148],[-26,-13],[-6,81]],[[13886,80058],[-45,-97],[47,-361],[-82,-222],[-177,-118],[-44,281],[52,377],[-89,207],[-205,-32],[-10,282],[-299,524],[-226,641],[-91,166],[-83,109],[-180,-106],[-243,126],[-183,-119],[-250,273],[-182,319],[-568,468],[-160,29],[-189,169],[-378,87],[-271,-75],[-114,144],[-320,139],[-157,208],[-133,8],[-82,252],[-352,-11],[-93,-169],[121,-260],[-136,-337],[-287,-13],[-217,-318],[-251,-206],[-139,-27],[-56,434],[131,345],[-3,339],[281,228],[-39,175],[-263,-194],[-229,-361],[-112,-428],[-94,-157],[-295,-283],[-25,-168],[242,-102],[-262,-572],[-573,-510],[-59,-317],[-242,-139],[-283,-317],[7,-245],[-429,-132],[-160,-246],[-270,-81],[-127,-186],[-277,41],[194,379],[259,194],[156,-76],[110,292],[465,491],[278,480],[60,621],[-358,282],[19,-269],[-100,-49],[-186,337],[-174,126],[-389,-356],[-73,468],[87,200],[-204,373],[-194,-126],[-277,-4],[-147,332],[177,328],[-157,114],[-160,14],[-120,124],[-40,682],[188,340],[182,489],[297,-133],[186,140],[101,226],[327,-23],[103,193],[-63,337],[53,265],[-109,220],[-372,-276],[-489,21],[-176,-88],[-359,101],[-329,590],[-185,125],[150,178],[797,521],[216,32],[32,-370],[539,-56],[70,315],[375,-36],[14,177],[-474,58],[47,158],[-540,117],[-134,386],[-588,463],[8,428],[531,35],[323,296],[39,303],[309,389],[286,28],[343,334],[444,20],[378,359],[585,-244],[640,-107],[-54,-139],[315,-169],[601,54],[402,-201],[504,-50],[353,-123],[382,108],[626,-339]],[[13426,79652],[-13,350],[119,99],[95,-250],[-75,-310],[-126,111]],[[13017,79741],[-75,126],[128,299],[124,-178],[146,-455],[3,-286],[-95,-47],[-60,280],[-171,261]],[[12979,80784],[93,-60],[-61,-273],[-137,96],[105,237]],[[12711,80429],[-50,298],[109,26],[94,-198],[-153,-126]],[[12728,81673],[77,-253],[10,-315],[-172,-230],[-69,498],[-5,380],[117,-93],[42,13]],[[12593,80242],[-173,593],[-113,259],[202,18],[97,-514],[-13,-356]],[[12214,81443],[-116,202],[172,116],[237,-168],[31,-317],[-272,-156],[-52,323]],[[7669,81646],[-131,-93],[-96,151],[198,123],[29,-181]],[[7341,81437],[103,99],[223,-103],[20,-277],[-253,-151],[-185,-331],[-173,166],[-29,363],[294,234]],[[6710,54439],[156,-178],[131,-355],[-134,-188],[-95,-234],[-68,70],[-47,531],[63,179],[-6,175]],[[4536,79432],[108,-247],[-222,-56],[-214,-144],[116,368],[212,79]],[[4264,83645],[92,-85],[-109,-353],[-136,146],[153,292]],[[3843,83299],[121,-125],[45,-233],[-291,-54],[-192,152],[317,260]],[[3453,78166],[115,135],[108,386],[136,-227],[-109,-145],[-250,-149]],[[3127,78008],[140,337],[110,-103],[-250,-234]],[[2370,85372],[328,273],[276,-359],[-80,-112],[-419,283],[-105,-85]],[[33999,18183],[-81,-241],[23,-283],[-103,-902],[27,-600],[-46,-74]],[[33819,16083],[-80,-272],[-11,-440],[32,-313],[79,-157],[186,-202],[106,-300],[-66,-218],[4,-202],[71,-185],[101,-28],[19,-392],[-130,-451],[-107,-269],[-8,-164],[-205,-264],[-231,-168],[-484,-201],[-208,-17],[-222,132],[46,-378],[52,-72],[-72,-307],[-32,-415],[32,-302],[-232,-206],[-178,-1],[-307,317],[-76,-251],[46,-303],[-19,-376],[127,-297],[137,-1],[100,252],[48,-387],[-145,-190],[-62,245],[-98,19],[-95,-189],[158,-209],[-148,-145],[-95,-281],[28,-351],[-38,-285],[-89,-127],[12,-235],[-153,45],[-234,-244],[-163,-521],[54,-369],[184,-324],[249,-60],[43,-167],[-39,-390],[-177,-393],[-180,-202],[-120,-247],[-44,-533],[-87,-207],[-227,-182],[-82,-480],[111,-667],[95,-330]],[[30995,2226],[-215,165],[-224,108],[-535,0],[-115,299],[-6,695],[-197,-124],[-93,243],[-45,313],[26,586],[261,290],[-15,223],[99,122],[-82,293],[147,442],[13,348],[84,87],[-67,404],[76,109],[-51,224],[132,268],[-62,207],[115,382],[-184,41],[-16,215],[68,298],[-79,247],[45,114],[-121,287],[38,200],[-36,236],[120,59],[-65,997],[36,365],[66,226],[60,455],[-14,249],[92,120],[38,223],[-70,537],[25,172],[2,560],[112,237],[80,339],[-13,406],[70,504],[114,262],[-24,232],[26,457],[-145,740],[11,269],[-79,216],[91,698],[119,336],[-58,592],[63,134],[40,531],[146,355],[93,574],[138,129],[-82,310],[57,226],[-58,523],[68,244],[-62,227],[85,282],[261,265],[92,743],[-53,134]],[[31338,23476],[123,414],[125,109],[59,181],[117,-199],[184,21],[127,-152],[81,-196],[87,407],[311,1],[48,-171]],[[32600,23891],[250,-715],[178,-273],[29,-141],[198,-170],[67,23],[191,-338],[282,-372],[126,-55],[90,-280],[-84,-392],[-63,-74],[-64,-533],[-80,-315],[190,22],[104,-119],[221,-51],[197,137],[85,-98],[100,344],[69,22],[117,349],[32,617]],[[33821,15303],[-1,-2],[-3,5],[2,5],[2,-8]],[[30942,2026],[89,-211],[31,-262],[177,-437],[299,-399],[216,-133],[95,-187],[-258,-47],[-557,138],[-92,-68]],[[30942,420],[0,1606]],[[33842,25376],[-19,284],[-231,350],[-252,-5],[-175,-116],[-314,-128],[-52,-327],[-96,-340],[2,-357],[-105,-846]],[[31338,23476],[-195,-14],[13,180],[-36,378],[-59,325],[0,218],[-75,470],[-80,137],[14,515],[68,216],[-141,362],[-30,629],[-62,66],[-52,338]],[[30703,27296],[-41,170],[125,385],[47,45],[11,335],[-89,57],[-37,357],[77,287],[-62,296],[103,315],[4,554],[34,253],[-4,275],[59,265],[-256,1116]],[[30067,52833],[17,223],[-58,82],[74,555],[-33,332]],[[30067,54025],[61,159],[85,-59],[105,55],[194,-206],[46,46],[98,-421],[250,-103],[114,-241],[-44,-203],[-199,83],[-188,14],[-75,-170],[-196,81],[-103,-320],[-76,-126],[-72,219]],[[30067,52833],[-82,147],[-205,-66],[-197,64],[-125,-73],[-117,118],[-15,229],[79,34],[291,-158],[107,-9],[106,181],[-111,195],[18,303],[-111,186],[-29,213],[107,15],[195,-191],[89,4]],[[35175,15620],[-113,-476],[-105,-167],[-219,-222],[-237,126],[-145,-90],[-227,322],[-196,-16],[-160,399],[-5,281],[51,306]],[[28551,58828],[9,-368],[-46,131],[40,76],[-3,161]],[[28365,57468],[-138,36],[60,345],[114,-229],[-36,-152]],[[32011,63096],[6,23],[11,-11],[-21,-40],[-5,23],[9,5]],[[27064,56182],[-149,-140],[-100,-219],[-122,-5],[-100,-136],[-36,239],[103,235],[223,241],[191,48],[63,81],[286,-27],[30,-83],[148,45],[273,-247],[85,-239],[149,-17],[207,-222],[109,-22],[26,-192],[129,-226],[204,-131],[101,-138],[123,-55],[-24,-193],[254,-89],[134,-392],[-159,-26],[-51,-91],[-459,38],[-88,-54],[-172,106],[148,258],[-67,239],[-221,23],[-89,193],[-36,327],[-56,117],[-123,-58],[-209,131],[-129,211],[-152,4],[-127,107],[-97,-8],[-8,369],[-212,-2]],[[26964,55616],[65,-20],[18,-261],[-70,-54],[-13,335]],[[22978,58521],[22,-222],[-39,-173],[-94,-13],[-7,-508],[-42,-164],[22,-239],[4,-795],[-36,-259],[59,-707],[164,-802],[178,-504],[41,-371],[120,-354],[189,-92],[108,-131],[87,-269],[316,193],[139,29],[127,149],[194,-158],[113,96],[43,319],[108,220],[9,248],[61,144],[1,444],[48,350],[180,221],[266,82],[158,136],[253,-125],[61,91],[56,-261],[-11,-199],[-114,-308],[-57,-404],[-80,-226],[55,-370],[-91,-529],[-78,292],[-59,-194]],[[25452,53158],[-40,-15],[-96,-409],[-81,-57]],[[25235,52677],[-510,0],[-21,-640],[99,-149],[86,-238],[-12,-224],[-358,0],[-133,-585],[42,-136],[-47,-388]],[[24381,50317],[-405,1038],[-181,189],[-100,-21],[-41,159],[-164,-327],[-295,-229],[-195,188],[-159,42],[-85,148],[-136,102],[-80,147],[-249,151],[-66,122],[-284,248],[-176,296],[-46,160],[-103,19],[-364,297],[-87,303],[-139,239],[-198,213],[-131,438],[-35,346],[106,104],[13,606],[-84,191],[42,293],[-72,115],[-65,270],[-173,414],[-195,628],[-94,142],[-120,293],[-9,205],[-178,246],[-88,203],[-97,47],[-49,191],[86,274],[-85,265],[-115,58],[-19,199],[-141,141],[-51,273],[26,143],[-155,65],[-119,328],[-57,48],[-122,380],[-17,198],[-149,469],[-8,222],[-97,425],[-19,295],[-98,50],[-108,224],[-96,-44],[-145,196],[-22,-506],[45,-129],[14,-529],[78,-303],[51,-25],[161,-353],[145,-536],[56,-23],[40,-451],[107,-204],[99,-412],[126,-211],[68,-446],[4,-219],[77,-230],[103,-464],[-23,-130],[49,-296],[107,31],[96,-139],[37,-287],[62,-74],[5,-261],[-128,-234],[-68,314],[-239,564],[-295,493],[7,627],[-37,241],[-228,412],[-68,199],[-88,-94],[-60,158],[-193,217],[-6,130],[-116,306],[208,-27],[38,162],[-1,318],[-257,655],[-149,173],[-83,256],[2,200],[-70,157],[-6,247],[-172,545],[22,183],[-77,149],[-66,360]],[[30101,55519],[-52,-4],[-2,60],[44,-10],[10,-46]],[[30541,48904],[8,26],[38,-90],[-17,-23],[-29,87]],[[32479,52938],[8,52],[16,-18],[-24,-34]],[[32833,52211],[29,-97],[-38,-20],[9,117]],[[31000,48716],[53,-56],[-26,-21],[-31,36],[4,41]],[[32542,52736],[11,14],[4,-14],[-13,-14],[-2,14]],[[25452,53158],[77,-114],[-56,-536],[-1,-616],[-68,-324],[-127,-269]],[[25277,51299],[-63,-1],[22,836],[-1,543]],[[30569,36836],[-93,290],[-119,19],[182,746],[-48,136],[-204,252],[-66,-113],[-144,142],[-62,-128],[-255,-61],[-81,132],[-129,713],[-182,205],[-33,314],[-189,329],[-51,-23]],[[29095,39789],[-144,113],[-78,210],[-218,-67],[-189,132],[-49,229],[-135,141],[-157,321]],[[28125,40868],[-29,284],[89,15],[-32,312],[216,231],[67,373],[108,360],[-56,398],[45,411],[-28,550],[43,228],[-71,289],[42,272],[-97,223],[-57,247]],[[28365,45061],[159,488],[14,226],[-29,330]],[[28509,46105],[116,-358],[84,359],[85,176],[73,301],[92,57],[67,536],[4,272],[158,363],[181,-123],[23,308],[253,-13],[154,298],[134,142],[28,246],[166,144],[118,-254],[-58,-171],[-5,0],[0,-1],[-1,-2],[0,-1],[-4,-2],[0,0],[-7,-7],[0,0],[0,-10],[2,-3]],[[30819,48638],[55,-15],[9,-94],[-64,109]],[[32929,51112],[55,-86],[4,-134],[-33,-73],[-26,293]],[[32941,51707],[10,-90],[-48,-38],[3,119],[35,9]],[[32888,48624],[-17,-112],[-25,73],[42,39]],[[25468,51144],[20,21]],[[25488,51165],[0,-1],[-1,-3],[0,-1],[1,-4],[-20,-12]],[[25277,51299],[21,-7],[0,0],[170,-153]],[[25468,51139],[-101,-239],[-133,-197],[-55,-466]],[[25179,50237],[-212,-484]],[[24967,49753],[-162,137],[-144,-5],[-160,191],[-120,241]],[[25488,51165],[-2,9],[2,-2],[0,0],[2,1],[144,141],[218,-117],[178,39],[138,129],[82,-91],[136,86],[194,-119],[56,-338],[53,-86],[101,57],[42,-200]],[[26832,50674],[-122,-183],[-237,-77],[-33,117],[-170,-518],[-91,-101],[-89,73],[-95,-224],[-98,-2],[7,-251],[-110,-293]],[[25794,49215],[-7,-2],[-3,0],[-171,300]],[[25613,49513],[-11,363],[-135,-14],[-115,109],[-84,203],[-89,63]],[[25468,51139],[0,5]],[[28694,53001],[95,-71],[-47,-228],[-92,97],[-245,-86],[-110,429],[229,8],[170,-149]],[[32543,52341],[9,50],[22,-34],[-16,-48],[-15,32]],[[32475,52843],[1,29],[19,16],[-1,-38]],[[32494,52850],[-19,-7]],[[32736,51884],[-24,10],[8,54],[16,-64]],[[26832,50674],[34,-25],[0,-3],[-37,-112],[60,-347],[-83,-417],[-21,-329],[24,-610],[-70,-282],[25,-341],[-63,-185],[50,-291]],[[26751,47732],[1,0],[3,-14],[-66,-148],[-212,270],[-64,-102],[-194,199],[-23,-102]],[[26196,47835],[-229,505],[-70,286],[-165,333],[-25,208],[87,48]],[[31455,53156],[214,-15],[103,-67],[-82,-280],[-360,-18],[19,397],[106,-17]],[[25613,49513],[-57,-179],[-506,265],[-86,154],[2,-2],[1,2]],[[32494,52850],[-3,-31],[-30,29],[2,0],[12,-5]],[[32044,53136],[16,-30],[-25,-21],[9,51]],[[31992,52641],[22,13],[9,-60],[-47,-10],[16,57]],[[26751,47732],[-1,4],[6,-3],[1,-3],[-1,-4],[73,-384],[181,-530],[55,-62],[0,-4],[-10,-3],[-1,-1],[-2,-42]],[[27052,46700],[-90,-19],[5,-521],[24,-174],[-20,-334]],[[26971,45652],[-67,234],[-164,167],[64,194],[-76,232],[-132,233],[-76,2],[-68,352],[-90,-316],[-48,158],[-99,74],[-63,259],[63,268],[-19,326]],[[27429,53775],[44,7],[-6,-43],[-38,36]],[[29095,39789],[-60,-128],[68,-184],[-99,-718],[-128,-416],[-163,-331],[-337,-295],[-110,-294],[-90,-420],[-25,-422],[-66,-223],[-102,-56],[-79,319],[-170,158],[-91,179],[96,103],[-25,331]],[[27714,37392],[64,157],[96,482],[-59,218],[-158,-275],[-126,226],[42,318],[-33,204],[27,202],[-43,186],[90,94],[27,381],[120,335],[21,164],[-32,278],[99,202],[218,124],[58,180]],[[24633,39971],[39,-253],[111,-390],[-106,-209],[-97,101],[119,230],[-83,229],[17,292]],[[28365,45061],[-115,348],[1,552],[-126,269],[-127,121],[-150,-124],[-14,-194],[-183,-237],[128,-522],[-123,-197],[-120,-26],[-105,304],[-89,92],[-9,165],[-199,265],[-146,-46],[-17,-179]],[[27052,46700],[60,-52],[50,-313],[120,12],[80,-150],[78,-9],[301,303],[160,302],[135,-133],[143,-4],[140,-137],[140,-385],[50,-29]],[[30703,27296],[-98,-135],[20,-185],[-61,-229],[-114,-64]],[[30450,26683],[-268,510],[-36,249],[-103,91],[-167,333],[-74,39],[-321,369],[-363,549],[-105,354],[-104,171],[-130,528],[50,385],[-75,241],[-83,469],[-98,227],[-10,243],[-131,308],[-17,320],[-128,511],[-168,1124],[-59,266],[-134,360],[-61,423],[-81,259],[-315,504],[70,345],[-94,266],[31,175],[-68,205],[25,310],[125,361],[156,214]],[[2590,29636],[-17,-83],[-28,24],[9,23],[18,1],[18,35]],[[30995,2226],[-210,134],[-182,-216],[-263,-211],[-59,-432],[3,-284],[-89,-81],[-227,154],[-48,311],[261,95],[56,207],[-136,182],[-249,19],[-98,-196],[-34,-19],[-2,-6],[0,-5],[3,-6],[19,-30],[-15,-116],[-107,4],[-82,320],[86,290],[-245,900],[-15,354],[-114,197],[97,147],[-17,739],[16,275],[107,130],[-137,230],[248,222],[-306,41],[174,513],[-161,95],[-132,187],[6,522],[263,59],[157,-358],[71,291],[-65,83],[55,596],[68,1],[100,148],[26,148],[-138,342],[54,195],[-27,341],[60,353],[16,944],[-193,-205],[-104,265],[-24,336],[61,311],[11,405],[76,45],[55,390],[-79,506],[8,443],[-52,222],[1,386],[125,19],[25,320],[82,321],[48,483],[113,341],[49,324],[13,395],[100,319],[-25,409],[85,350],[-18,527],[-48,541],[3,618],[106,272],[-15,404],[-52,308],[99,400],[21,409],[52,122],[-21,324],[45,80],[51,765],[-30,123],[80,330],[-36,461],[20,653],[-11,549],[57,27],[76,1229],[-34,346],[18,527],[-45,578],[-26,670]],[[31148,200],[-81,216],[261,-36],[-1,-267],[-179,87]],[[30560,213],[21,65],[385,120],[56,-398],[-302,23],[-160,190]],[[30942,420],[-137,-48],[-308,60],[-410,194],[87,168],[380,79],[-62,565],[25,333],[210,391],[80,-164],[135,28]],[[30421,1374],[42,-319],[-158,56],[116,263]],[[29719,1884],[5,2],[3,3],[4,0],[5,8],[12,-5],[42,36],[17,50],[20,-19],[21,-70],[100,127],[220,-100],[-317,-364],[-111,102],[15,76],[-10,107],[-26,47]],[[29716,1279],[4,225],[234,-280],[-103,-238],[-135,293]],[[29698,7955],[112,-86],[-38,-148],[-109,-146],[-53,261],[88,119]],[[29433,9823],[144,-14],[46,-365],[-120,-188],[88,-156],[-53,-361],[-205,36],[69,308],[-5,412],[36,328]],[[29212,4867],[102,6],[15,-871],[-124,-91],[-147,398],[146,126],[8,432]],[[29072,3940],[152,-96],[-54,-202],[-134,75],[36,223]],[[5631,24602],[-25,-6],[0,39],[18,-1],[7,-32]],[[19657,47283],[8,0],[-3,-17],[-5,17]],[[33950,93937],[-165,274],[-509,348],[-529,169],[-1196,-121],[-584,-45],[-252,168],[284,248],[-608,90],[-215,155],[790,247],[-1027,419],[-156,144],[99,276],[729,201],[350,173],[681,46],[437,313],[82,279],[-776,89],[7,256],[578,406],[593,145],[399,246],[-110,203],[675,216],[1131,169],[675,-346],[616,429],[898,-332],[783,234],[-515,253],[44,275],[1022,71],[861,-66],[202,347],[2084,83],[1129,-80],[738,-217],[3,-205],[945,-100],[360,-162],[-412,-389],[67,-247],[1080,-225],[460,256],[610,-17],[480,-302],[-711,-357],[-1141,-811],[-442,-163],[78,-265],[-334,-171],[-342,-939],[334,58],[455,-318],[-922,-485],[752,-276],[106,-595],[-361,-3],[13,-386],[456,-196],[-110,-148],[-656,-154],[289,-127],[40,-313],[-467,-144],[-499,257],[-378,-110],[230,-745],[561,-358],[-9,-325],[254,-200],[49,-467],[-502,-64],[-194,126],[-89,335],[-214,142],[-390,-239],[-339,21],[-128,-453],[418,86],[384,-45],[488,-210],[395,-21],[-822,-706],[-408,-301],[-351,-87],[-656,-316],[-558,-60],[-253,-261],[-150,-431],[-417,-599],[-136,31],[-138,-266],[-304,-120],[-160,211],[-118,-304],[-355,6],[-147,-131],[-2,-263],[-237,-8],[75,-292],[-10,-629],[-346,-703],[-150,-1],[59,-691],[-177,-477],[24,-335],[-190,-244],[-307,-267],[-189,115],[-16,268],[-156,44],[-78,287],[-359,-59],[-459,522],[-347,598],[1,250],[-204,237],[-142,374],[-25,241],[204,269],[-145,160],[-201,-55],[39,321],[-466,980],[64,220],[-126,340],[66,473],[397,563],[336,7],[-16,466],[45,539],[-385,61],[-249,205],[-233,55],[-53,280],[446,-55],[239,-186],[222,282],[-125,189],[-219,40],[-94,370],[-325,4],[-47,-179],[-448,11],[-19,400],[189,159],[152,430],[-301,189],[83,221],[-246,162],[125,156],[-258,325],[124,233],[-487,313],[8,108]],[[43704,92065],[-6,-319],[-470,298],[-41,180],[381,-3],[136,-156]],[[42946,90788],[-176,-237],[-487,-66],[196,325],[384,72],[83,-94]],[[34922,90134],[-25,287],[297,-90],[355,-285],[-17,-214],[-400,-188],[-130,193],[-225,59],[145,238]],[[2820,26252],[20,-75],[-18,-65],[-29,55],[27,85]],[[14362,22320],[-17,42],[14,11],[3,-53]],[[8452,27272],[64,-8],[-1,-152],[-64,10],[1,150]],[[2287,33250],[0,5],[-5,26],[1,0],[1,-10],[3,-11],[0,-7],[0,-3]],[[1292,24719],[35,-28],[8,-71],[-41,54],[-2,45]],[[1042,30312],[8,49],[16,-23],[-10,-55],[-14,29]],[[2167,30028],[-91,-75],[-34,204],[93,47],[32,-176]],[[71926,63869],[-57,130],[3,310],[70,224],[-79,154],[-117,65],[-92,623]],[[71850,63344],[14,34],[7,-6]],[[71824,63314],[17,14]],[[72020,63271],[-34,451]],[[71482,65404],[-156,97]],[[71326,65501],[-168,117],[-63,562]],[[70682,63439],[-122,345],[48,148],[-64,179],[-3,607],[100,153],[408,-195],[373,399],[-96,426]],[[45263,54803],[-14,50],[42,717],[41,232],[86,117],[82,561],[130,507],[-4,106],[240,535],[26,514],[87,547],[252,403],[109,665]],[[59907,63768],[20,51]],[[59444,65077],[1,-2]],[[59052,65156],[3,1],[8,7],[2,0]],[[59082,65160],[4,0]],[[70111,34618],[2,10],[6,-17],[-1,-5],[-7,12]],[[39475,1058],[347,-85],[112,-142],[115,-342],[-79,-67],[-124,281],[-205,254],[-166,101]],[[33805,2584],[-134,-9],[-261,-165],[198,502],[125,87],[171,-41],[32,-259],[-131,-115]],[[33227,2414],[-57,97],[161,434],[155,-56],[-114,-364],[-145,-111]]],"transform":{"scale":[0.0036000360003600046,0.0013913574536245361],"translate":[-180,-55.47732514599994]},"objects":{"countries":{"type":"GeometryCollection","geometries":[{"arcs":[[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42]],[[43]],[[44]]],"type":"MultiPolygon","properties":{"name":"China"},"id":156},{"arcs":[[[45]],[[46]],[[47]]],"type":"MultiPolygon","properties":{"name":"Japan"},"id":392},{"arcs":[[-37,48,49,50]],"type":"Polygon","properties":{"name":"D. P. R. of Korea"},"id":408},{"arcs":[[[51]],[[-33,52,53,54,55,56,57,58,59,60,61,62,63,64,-35,65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[83,84,85]],[[86]],[[87]]],"type":"MultiPolygon","properties":{"name":"Russian Federation"},"id":643},{"arcs":[[[-43,88,89,90]],[[91]],[[92]],[[93,94]]],"type":"MultiPolygon","properties":{"name":"Viet Nam"},"id":704},{"arcs":[[-34,-66]],"type":"Polygon","properties":{"name":"Mongolia"},"id":496},{"arcs":[[-90,95,-94,96,97,98]],"type":"Polygon","properties":{"name":"Cambodia"},"id":116},{"arcs":[[-1,-91,-99,99,100]],"type":"Polygon","properties":{"name":"Lao People's Democratic Republic"},"id":418},{"arcs":[[[-2,-101,101,102,103,104,105]],[[106]]],"type":"MultiPolygon","properties":{"name":"Myanmar"},"id":104},{"arcs":[[-98,107,108,109,-102,-100]],"type":"Polygon","properties":{"name":"Thailand"},"id":764},{"arcs":[[-29,110,111,112,113,114,115]],"type":"Polygon","properties":{"name":"Afghanistan"},"id":4},{"arcs":[[-4,116,117,118]],"type":"Polygon","properties":{"name":"Bhutan"},"id":64},{"arcs":[[-39,119]],"type":"Polygon","properties":{"name":"Hong Kong SAR, China"},"id":344},{"arcs":[[[120,121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134,135,136,137]],[[138]],[[139]],[[140]],[[141]],[[142]],[[143]],[[144,145]],[[146]],[[147]],[[148]],[[149]],[[150]],[[151]],[[152]],[[153]],[[154]],[[155]],[[156]]],"type":"MultiPolygon","properties":{"name":"Indonesia"},"id":360},{"arcs":[[-6,157,-118,158,-105,159,160,161,162,163,164,-17,165,-15,166,-13,167,-11,168,-9,169,170]],"type":"Polygon","properties":{"name":"India"},"id":356},{"arcs":[[-32,171,172,173,174,-53]],"type":"Polygon","properties":{"name":"Kazakhstan"},"id":398},{"arcs":[[-31,175,176,-172]],"type":"Polygon","properties":{"name":"Kyrgyz Republic"},"id":417},{"arcs":[[-50,177]],"type":"Polygon","properties":{"name":"Republic of Korea"},"id":410},{"arcs":[[-41,178]],"type":"Polygon","properties":{"name":"Macau SAR, China"},"id":446},{"arcs":[[[-146,179,180,181]],[[-109,182,183,184]]],"type":"MultiPolygon","properties":{"name":"Malaysia"},"id":458},{"arcs":[[-7,-171,185]],"type":"Polygon","properties":{"name":"Nepal"},"id":524},{"arcs":[[-112,186,187,-164,188,189]],"type":"Polygon","properties":{"name":"Pakistan"},"id":586},{"arcs":[[[190]],[[191]],[[192]],[[193]],[[194]],[[195]],[[196]],[[197]],[[198]],[[199]]],"type":"MultiPolygon","properties":{"name":"Philippines"},"id":608},{"arcs":[[-30,-116,200,-176]],"type":"Polygon","properties":{"name":"Tajikistan"},"id":762},{"arcs":[[-115,201,-173,-177,-201]],"type":"Polygon","properties":{"name":"Uzbekistan"},"id":860},{"arcs":[[[-104,202,-160]],[[-162,203]]],"type":"MultiPolygon","properties":{"name":"Bangladesh"},"id":50},{"arcs":[[204]],"type":"Polygon","properties":{"name":"Cocos (Keeling) Islands (Aus.)"},"id":166},{"arcs":[[205]],"type":"Polygon","properties":{"name":"Sri Lanka"},"id":144},{"arcs":[[206]],"type":"Polygon","properties":{"name":"Maldives"},"id":462},{"arcs":[[[-55,207,208,209,210]],[[211,212,213]]],"type":"MultiPolygon","properties":{"name":"Azerbaijan"},"id":31},{"arcs":[[214]],"type":"Polygon","properties":{"name":"Christmas Island (Aus.)"},"id":162},{"arcs":[[-113,-190,215,216,217,-212,218,-209,219,220]],"type":"Polygon","properties":{"name":"Islamic Republic of Iran"},"id":364},{"arcs":[[[-64,221,222]],[[223,224,225]],[[226]]],"type":"MultiPolygon","properties":{"name":"Norway"},"id":578},{"arcs":[[-184,227]],"type":"Polygon","properties":{"name":"Singapore"},"id":702},{"arcs":[[[-225,228,229]],[[230]]],"type":"MultiPolygon","properties":{"name":"Sweden"},"id":752},{"arcs":[[-114,-221,231,-174,-202]],"type":"Polygon","properties":{"name":"Turkmenistan"},"id":795},{"arcs":[[-210,-219,-214,232,233]],"type":"Polygon","properties":{"name":"Armenia"},"id":51},{"arcs":[[-59,234,235,236,237]],"type":"Polygon","properties":{"name":"Belarus"},"id":112},{"arcs":[[-56,-211,-234,238,239]],"type":"Polygon","properties":{"name":"Georgia"},"id":268},{"arcs":[[-213,-218,240,241,242,243,244,245,-239,-233]],"type":"Polygon","properties":{"name":"Türkiye"},"id":792},{"arcs":[[-58,246,247,248,249,250,251,-235]],"type":"Polygon","properties":{"name":"Ukraine"},"id":804},{"arcs":[[-245,252,253,254,255,256]],"type":"Polygon","properties":{"name":"Bulgaria"},"id":100},{"arcs":[[-61,257,258]],"type":"Polygon","properties":{"name":"Estonia"},"id":233},{"arcs":[[-217,259,260,261,262,263,-241]],"type":"Polygon","properties":{"name":"Iraq"},"id":368},{"arcs":[[-84,264,265,-237,266]],"type":"Polygon","properties":{"name":"Lithuania"},"id":440},{"arcs":[[-60,-238,-266,267,-258]],"type":"Polygon","properties":{"name":"Latvia"},"id":428},{"arcs":[[-248,268,269]],"type":"Polygon","properties":{"name":"Moldova"},"id":498},{"arcs":[[-85,-267,-236,-252,270,271,272,273]],"type":"Polygon","properties":{"name":"Poland"},"id":616},{"arcs":[[-249,-270,274,-256,275,276]],"type":"Polygon","properties":{"name":"Romania"},"id":642},{"arcs":[[-242,-264,277,278,279,280]],"type":"Polygon","properties":{"name":"Syrian Arab Republic"},"id":760},{"arcs":[[281,282,283,284,285]],"type":"Polygon","properties":{"name":"Albania"},"id":8},{"arcs":[[286,287,288,289,290]],"type":"Polygon","properties":{"name":"Bosnia and Herzegovina"},"id":70},{"arcs":[[-272,291,292,293]],"type":"Polygon","properties":{"name":"Czech Republic"},"id":203},{"arcs":[[[294]],[[295]],[[296,297]]],"type":"MultiPolygon","properties":{"name":"Denmark"},"id":208},{"arcs":[[-63,298,-229,-224,299,-222]],"type":"Polygon","properties":{"name":"Finland"},"id":246},{"arcs":[[[-244,300,-282,301,-253]],[[302]]],"type":"MultiPolygon","properties":{"name":"Greece"},"id":300},{"arcs":[[[-288,303,304,305,306]],[[-291,307,308]]],"type":"MultiPolygon","properties":{"name":"Croatia"},"id":191},{"arcs":[[-250,-277,309,-306,310,311,312]],"type":"Polygon","properties":{"name":"Hungary"},"id":348},{"arcs":[[[313,314,315,316,317],[320],[321]],[[318]],[[319]]],"type":"MultiPolygon","properties":{"name":"Italy"},"id":380},{"arcs":[[-254,-302,-286,322,323]],"type":"Polygon","properties":{"name":"North Macedonia"},"id":807},{"arcs":[[-284,324,-308,-290,325,326]],"type":"Polygon","properties":{"name":"Montenegro"},"id":499},{"arcs":[[-255,-324,327,-326,-289,-307,-310,-276]],"type":"Polygon","properties":{"name":"Serbia"},"id":688},{"arcs":[[-251,-313,328,-292,-271]],"type":"Polygon","properties":{"name":"Slovak Republic"},"id":703},{"arcs":[[-285,-327,-328,-323]],"type":"Polygon","properties":{"name":"Kosovo"},"id":"XKX"},{"arcs":[[-293,-329,-312,329,-316,330,331,332,333]],"type":"Polygon","properties":{"name":"Austria"},"id":40},{"arcs":[[334,335,336,337,338]],"type":"Polygon","properties":{"name":"Belgium"},"id":56},{"arcs":[[-315,339,340,-333,341,-331]],"type":"Polygon","properties":{"name":"Switzerland"},"id":756},{"arcs":[[-273,-294,-334,-341,342,343,-338,344,345,-297,346]],"type":"Polygon","properties":{"name":"Germany"},"id":276},{"arcs":[[347,348,349,350,351,352,353,354]],"type":"Polygon","properties":{"name":"Algeria"},"id":12},{"arcs":[[[355]],[[-314,356,357,358,359,360,361,362,-335,363,-343,-340]]],"type":"MultiPolygon","properties":{"name":"France"},"id":250},{"arcs":[[-332,-342]],"type":"Polygon","properties":{"name":"Liechtenstein"},"id":438},{"arcs":[[-339,-344,-364]],"type":"Polygon","properties":{"name":"Luxembourg"},"id":442},{"arcs":[[364]],"type":"Polygon","properties":{"name":"Malta"},"id":470},{"arcs":[[-321]],"type":"Polygon","properties":{"name":"San Marino"},"id":674},{"arcs":[[-305,365,-317,-330,-311]],"type":"Polygon","properties":{"name":"Slovenia"},"id":705},{"arcs":[[-348,366,367]],"type":"Polygon","properties":{"name":"Tunisia"},"id":788},{"arcs":[[-322]],"type":"Polygon","properties":{"name":"Vatican City"},"id":336},{"arcs":[[-361,368]],"type":"Polygon","properties":{"name":"Andorra"},"id":20},{"arcs":[[[369]],[[-360,370,371,372,373,374,-362,-369]],[[375]]],"type":"MultiPolygon","properties":{"name":"Spain"},"id":724},{"arcs":[[[376]],[[377,378]],[[379]],[[380,381,382,383,384,385]]],"type":"MultiPolygon","properties":{"name":"United Kingdom"},"id":826},{"arcs":[[386]],"type":"Polygon","properties":{"name":"Jersey (U.K.)"},"id":832},{"arcs":[[-358,387]],"type":"Polygon","properties":{"name":"Monaco"},"id":492},{"arcs":[[-337,388,-345]],"type":"Polygon","properties":{"name":"Netherlands"},"id":528},{"arcs":[[389,390,391,392,393]],"type":"Polygon","properties":{"name":"Benin"},"id":204},{"arcs":[[-394,394,395,396,397,398]],"type":"Polygon","properties":{"name":"Burkina Faso"},"id":854},{"arcs":[[-397,399,400,401,402,403]],"type":"Polygon","properties":{"name":"Côte d'Ivoire"},"id":384},{"arcs":[[-396,404,405,-400]],"type":"Polygon","properties":{"name":"Ghana"},"id":288},{"arcs":[[-351,406,-398,-404,407,408,409]],"type":"Polygon","properties":{"name":"Mali"},"id":466},{"arcs":[[-350,410,411,412,-390,-399,-407]],"type":"Polygon","properties":{"name":"Niger"},"id":562},{"arcs":[[-391,-413,413,414,415]],"type":"Polygon","properties":{"name":"Nigeria"},"id":566},{"arcs":[[-393,416,-405,-395]],"type":"Polygon","properties":{"name":"Togo"},"id":768},{"arcs":[[-415,417,418,419,420,421,422]],"type":"Polygon","properties":{"name":"Cameroon"},"id":120},{"arcs":[[423]],"type":"Polygon","properties":{"name":"Guernsey (U.K.)"},"id":831},{"arcs":[[-372,424]],"type":"Polygon","properties":{"name":"Gibraltar (U.K.)"},"id":292},{"arcs":[[-403,425,426,427,428,429,-408]],"type":"Polygon","properties":{"name":"Guinea"},"id":324},{"arcs":[[430]],"type":"Polygon","properties":{"name":"Isle of Man (U.K.)"},"id":833},{"arcs":[[-378,431]],"type":"Polygon","properties":{"name":"Ireland"},"id":372},{"arcs":[[-402,432,433,-426]],"type":"Polygon","properties":{"name":"Liberia"},"id":430},{"arcs":[[-354,434,435]],"type":"Polygon","properties":{"name":"Morocco"},"id":504},{"arcs":[[-352,-410,436,437,438]],"type":"Polygon","properties":{"name":"Mauritania"},"id":478},{"arcs":[[-374,439]],"type":"Polygon","properties":{"name":"Portugal"},"id":620},{"arcs":[[-409,-430,440,441,442,443,444,445,-437]],"type":"Polygon","properties":{"name":"Senegal"},"id":686},{"arcs":[[446]],"type":"Polygon","properties":{"name":"Åland (Fin.)"},"id":248},{"arcs":[[447]],"type":"Polygon","properties":{"name":"Cabo Verde"},"id":132},{"arcs":[[448]],"type":"Polygon","properties":{"name":"Faroe Islands (Den.)"},"id":234},{"arcs":[[-421,449,450,451]],"type":"Polygon","properties":{"name":"Gabon"},"id":266},{"arcs":[[[-445,452]],[[-443,453]]],"type":"MultiPolygon","properties":{"name":"The Gambia"},"id":270},{"arcs":[[-429,454,-441]],"type":"Polygon","properties":{"name":"Guinea-Bissau"},"id":624},{"arcs":[[[-422,-452,455]],[[456]]],"type":"MultiPolygon","properties":{"name":"Equatorial Guinea"},"id":226},{"arcs":[[-427,-434,457]],"type":"Polygon","properties":{"name":"Sierra Leone"},"id":694},{"arcs":[[458]],"type":"Polygon","properties":{"name":"São Tomé and Príncipe"},"id":678},{"arcs":[[[459]],[[460]],[[461]],[[462]]],"type":"MultiPolygon","properties":{"name":"Australia"},"id":36},{"arcs":[[-181,463]],"type":"Polygon","properties":{"name":"Brunei Darussalam"},"id":96},{"arcs":[[464]],"type":"Polygon","properties":{"name":"Federated States of Micronesia"},"id":583},{"arcs":[[465]],"type":"Polygon","properties":{"name":"Kiribati"},"id":296},{"arcs":[[466]],"type":"Polygon","properties":{"name":"Marshall Islands"},"id":584},{"arcs":[[467]],"type":"Polygon","properties":{"name":"Naoero"},"id":520},{"arcs":[[[468]],[[469]],[[470]],[[-121,471]]],"type":"MultiPolygon","properties":{"name":"Papua New Guinea"},"id":598},{"arcs":[[[472]],[[473]],[[474]],[[475]],[[476]]],"type":"MultiPolygon","properties":{"name":"Solomon Islands"},"id":90},{"arcs":[[[-135,477]],[[-137,478]]],"type":"MultiPolygon","properties":{"name":"Timor-Leste"},"id":626},{"arcs":[[479]],"type":"Polygon","properties":{"name":"Tuvalu"},"id":798},{"arcs":[[480]],"type":"Polygon","properties":{"name":"U.S. Minor Outlying Islands"},"id":581},{"arcs":[[[481]],[[482]]],"type":"MultiPolygon","properties":{"name":"Fiji"},"id":242},{"arcs":[[483]],"type":"Polygon","properties":{"name":"Guam (U.S.)"},"id":316},{"arcs":[[-280,484,485,486,487]],"type":"Polygon","properties":{"name":"Lebanon"},"id":422},{"arcs":[[488]],"type":"Polygon","properties":{"name":"Northern Mariana Islands (U.S.)"},"id":580},{"arcs":[[489]],"type":"Polygon","properties":{"name":"New Caledonia (Fr.)"},"id":540},{"arcs":[[490]],"type":"Polygon","properties":{"name":"Norfolk Island (Aus.)"},"id":574},{"arcs":[[[491]],[[492]]],"type":"MultiPolygon","properties":{"name":"New Zealand"},"id":554},{"arcs":[[493]],"type":"Polygon","properties":{"name":"Palau"},"id":585},{"arcs":[[[494]],[[495]]],"type":"MultiPolygon","properties":{"name":"Vanuatu"},"id":548},{"arcs":[[[-386,496,-384,497,498,499,500,501,502]],[[-382,503,504]]],"type":"MultiPolygon","properties":{"name":"Cyprus"},"id":196},{"arcs":[[[505,506,507]],[[508,509,510]]],"type":"MultiPolygon","properties":{"name":"Arab Republic of Egypt"},"id":818},{"arcs":[[-487,511,512,513,514,515,516,517,518,-511,519,520]],"type":"Polygon","properties":{"name":"Israel"},"id":376},{"arcs":[[-263,521,522,-518,523,-514,524,-278]],"type":"Polygon","properties":{"name":"Jordan"},"id":400},{"arcs":[[[525,526,527,528]],[[529,530]]],"type":"MultiPolygon","properties":{"name":"Oman"},"id":512},{"arcs":[[[-515,-524,-517,531]],[[-510,532,-520]]],"type":"MultiPolygon","properties":{"name":"West Bank and Gaza"},"id":275},{"arcs":[[-262,533,534,535,536,537,538,539,-527,540,541,-522]],"type":"Polygon","properties":{"name":"Saudi Arabia"},"id":682},{"arcs":[[-528,-540,542,-531,543]],"type":"Polygon","properties":{"name":"United Arab Emirates"},"id":784},{"arcs":[[544,545,546,547]],"type":"Polygon","properties":{"name":"Eritrea"},"id":232},{"arcs":[[-547,548,549,550,551,552]],"type":"Polygon","properties":{"name":"Ethiopia"},"id":231},{"arcs":[[-261,553,-534]],"type":"Polygon","properties":{"name":"Kuwait"},"id":414},{"arcs":[[-508,554,-548,-553,555,556,557,558,559,560]],"type":"Polygon","properties":{"name":"Sudan"},"id":729},{"arcs":[[-550,561,562,563]],"type":"Polygon","properties":{"name":"Federal Republic of Somalia"},"id":706},{"arcs":[[-552,564,565,566,567,568,569,-558,570,-556]],"type":"Polygon","properties":{"name":"South Sudan"},"id":728},{"arcs":[[[571]],[[-526,572,-541]]],"type":"MultiPolygon","properties":{"name":"Republic of Yemen"},"id":887},{"arcs":[[[573,574,575,576]],[[577,578,579]]],"type":"MultiPolygon","properties":{"name":"Angola"},"id":24},{"arcs":[[580,581,582]],"type":"Polygon","properties":{"name":"Burundi"},"id":108},{"arcs":[[-536,583]],"type":"Polygon","properties":{"name":"Bahrain"},"id":48},{"arcs":[[-419,584,-559,-570,585,586]],"type":"Polygon","properties":{"name":"Central African Republic"},"id":140},{"arcs":[[-569,587,588,-581,589,590,-577,591,-578,592,-586]],"type":"Polygon","properties":{"name":"Democratic Republic of Congo"},"id":180},{"arcs":[[-420,-587,-593,-580,593,-450]],"type":"Polygon","properties":{"name":"Congo"},"id":178},{"arcs":[[594,-562,-549,-546,595]],"type":"Polygon","properties":{"name":"Djibouti"},"id":262},{"arcs":[[-551,-564,596,597,598,-567,599,-565]],"type":"Polygon","properties":{"name":"Kenya"},"id":404},{"arcs":[[-349,-368,600,-506,-561,601,-411]],"type":"Polygon","properties":{"name":"Libya"},"id":434},{"arcs":[[-538,602]],"type":"Polygon","properties":{"name":"Qatar"},"id":634},{"arcs":[[-582,-589,603,604]],"type":"Polygon","properties":{"name":"Rwanda"},"id":646},{"arcs":[[605]],"type":"Polygon","properties":{"name":"Seychelles"},"id":690},{"arcs":[[-412,-602,-560,-585,-418,-414]],"type":"Polygon","properties":{"name":"Chad"},"id":148},{"arcs":[[-583,-605,606,-598,607,608,609,610,611,612,-590]],"type":"Polygon","properties":{"name":"Tanzania"},"id":834},{"arcs":[[-568,-599,-607,-604,-588]],"type":"Polygon","properties":{"name":"Uganda"},"id":800},{"arcs":[[613]],"type":"Polygon","properties":{"name":"French Southern and Antarctic Lands (Fr.)"},"id":260},{"arcs":[[614,615,616]],"type":"Polygon","properties":{"name":"Botswana"},"id":72},{"arcs":[[617]],"type":"Polygon","properties":{"name":"Heard Island and McDonald Islands (Aus.)"},"id":334},{"arcs":[[618]],"type":"Polygon","properties":{"name":"Madagascar"},"id":450},{"arcs":[[[-611,619,620,621,622,623,624,625]],[[-609,626]]],"type":"MultiPolygon","properties":{"name":"Mozambique"},"id":508},{"arcs":[[627]],"type":"Polygon","properties":{"name":"Mauritius"},"id":480},{"arcs":[[-612,-626,628]],"type":"Polygon","properties":{"name":"Malawi"},"id":454},{"arcs":[[-575,629,-617,630,631]],"type":"Polygon","properties":{"name":"Namibia"},"id":516},{"arcs":[[632]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[-622,633]],"type":"Polygon","properties":{"name":"Eswatini"},"id":748},{"arcs":[[-616,634,-623,-634,-621,635,-631],[636]],"type":"Polygon","properties":{"name":"South Africa"},"id":710},{"arcs":[[-574,-591,-613,-629,-625,637,-630]],"type":"Polygon","properties":{"name":"Zambia"},"id":894},{"arcs":[[-615,-638,-624,-635]],"type":"Polygon","properties":{"name":"Zimbabwe"},"id":716},{"arcs":[[638]],"type":"Polygon","properties":{"name":"Comoros"},"id":174},{"arcs":[[-637]],"type":"Polygon","properties":{"name":"Lesotho"},"id":426},{"arcs":[[639]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[640]],"type":"Polygon","properties":{"name":"Saint Helena, Ascension and Tristan da Cunha (U.K.)"},"id":654},{"arcs":[[641]],"type":"Polygon","properties":{"name":"Bouvet Island (Nor.)"},"id":74},{"arcs":[[[642]],[[643]],[[644]]],"type":"MultiPolygon","properties":{"name":"Svalbard and Jan Mayen (Nor.)"},"id":744},{"arcs":[[[645,646,647,648,649,650,651,652,653,654,655]],[[656]],[[657]]],"type":"MultiPolygon","properties":{"name":"Brazil"},"id":76},{"arcs":[[658]],"type":"Polygon","properties":{"name":"Barbados"},"id":52},{"arcs":[[-650,659,660]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[-648,661,662,663]],"type":"Polygon","properties":{"name":"Guyana"},"id":328},{"arcs":[[664]],"type":"Polygon","properties":{"name":"Iceland"},"id":352},{"arcs":[[665]],"type":"Polygon","properties":{"name":"Saint Lucia"},"id":662},{"arcs":[[666]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[-649,-664,667,-660]],"type":"Polygon","properties":{"name":"Suriname"},"id":740},{"arcs":[[668]],"type":"Polygon","properties":{"name":"Saint Vincent and the Grenadines"},"id":670},{"arcs":[[[669]],[[670,671,672,673]],[[674]],[[675]],[[676]],[[677]],[[678]],[[679]],[[680]],[[681]],[[682]],[[683]],[[684]],[[685]],[[686]],[[687]],[[688]],[[689]],[[690]],[[691]],[[692]],[[693]],[[694]],[[695]],[[696]],[[697]],[[698]],[[699]],[[700]],[[701]],[[702]],[[703]]],"type":"MultiPolygon","properties":{"name":"Canada"},"id":124},{"arcs":[[704]],"type":"Polygon","properties":{"name":"Saint-Pierre-et-Miquelon (Fr.)"},"id":666},{"arcs":[[705]],"type":"Polygon","properties":{"name":"Trinidad and Tobago"},"id":780},{"arcs":[[-647,706,707,-662]],"type":"Polygon","properties":{"name":"Republica Bolivariana de Venezuela"},"id":862},{"arcs":[[[-671,708,709,710]],[[711]],[[-673,712]],[[713]],[[714]],[[715]],[[716]],[[717]],[[718]],[[719]],[[720]],[[721]],[[722]],[[723]],[[724]],[[725]],[[726]],[[727]],[[728]]],"type":"MultiPolygon","properties":{"name":"United States of America"},"id":840},{"arcs":[[[-653,729,730,731,732,733]],[[734]],[[735,736]]],"type":"MultiPolygon","properties":{"name":"Argentina"},"id":32},{"arcs":[[-655,737,-733,738,739]],"type":"Polygon","properties":{"name":"Bolivia"},"id":68},{"arcs":[[-654,-734,-738]],"type":"Polygon","properties":{"name":"Paraguay"},"id":600},{"arcs":[[740,741]],"type":"Polygon","properties":{"name":"Dominican Republic"},"id":214},{"arcs":[[-741,742]],"type":"Polygon","properties":{"name":"Haiti"},"id":332},{"arcs":[[-652,743,-730]],"type":"Polygon","properties":{"name":"Uruguay"},"id":858},{"arcs":[[[744]],[[745]]],"type":"MultiPolygon","properties":{"name":"The Bahamas"},"id":44},{"arcs":[[746]],"type":"Polygon","properties":{"name":"Bermuda (U.K.)"},"id":60},{"arcs":[[[747]],[[748]]],"type":"MultiPolygon","properties":{"name":"Cuba"},"id":192},{"arcs":[[-710,749,750,751,752]],"type":"Polygon","properties":{"name":"Mexico"},"id":484},{"arcs":[[753]],"type":"Polygon","properties":{"name":"Turks and Caicos Islands (U.K.)"},"id":796},{"arcs":[[754]],"type":"Polygon","properties":{"name":"Aruba (Neth.)"},"id":533},{"arcs":[[755]],"type":"Polygon","properties":{"name":"Anguilla (U.K.)"},"id":660},{"arcs":[[756]],"type":"Polygon","properties":{"name":"Antigua and Barbuda"},"id":28},{"arcs":[[757]],"type":"Polygon","properties":{"name":"Bonaire (Neth.)"},"id":535},{"arcs":[[758]],"type":"Polygon","properties":{"name":"Saint-Barthélemy (Fr.)"},"id":652},{"arcs":[[-751,759,760]],"type":"Polygon","properties":{"name":"Belize"},"id":84},{"arcs":[[-646,761,762,763,764,765,-707]],"type":"Polygon","properties":{"name":"Colombia"},"id":170},{"arcs":[[766]],"type":"Polygon","properties":{"name":"Curaçao (Neth.)"},"id":531},{"arcs":[[767]],"type":"Polygon","properties":{"name":"Dominica"},"id":212},{"arcs":[[768]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[769]],"type":"Polygon","properties":{"name":"Grenada"},"id":308},{"arcs":[[[770,771]],[[-752,-761,772,773,774,775]]],"type":"MultiPolygon","properties":{"name":"Guatemala"},"id":320},{"arcs":[[-772,776,777,778,779,-774,780]],"type":"Polygon","properties":{"name":"Honduras"},"id":340},{"arcs":[[781]],"type":"Polygon","properties":{"name":"Jamaica"},"id":388},{"arcs":[[782]],"type":"Polygon","properties":{"name":"Saint Kitts and Nevis"},"id":659},{"arcs":[[783,784]],"type":"Polygon","properties":{"name":"Saint-Martin (Fr.)"},"id":663},{"arcs":[[785]],"type":"Polygon","properties":{"name":"Montserrat (U.K.)"},"id":500},{"arcs":[[-778,786,787,788]],"type":"Polygon","properties":{"name":"Nicaragua"},"id":558},{"arcs":[[789]],"type":"Polygon","properties":{"name":"Puerto Rico (U.S.)"},"id":630},{"arcs":[[-775,-780,790]],"type":"Polygon","properties":{"name":"El Salvador"},"id":222},{"arcs":[[-785,791]],"type":"Polygon","properties":{"name":"Sint Maarten (Neth.)"},"id":534},{"arcs":[[792]],"type":"Polygon","properties":{"name":"British Virgin Islands (U.K.)"},"id":92},{"arcs":[[793]],"type":"Polygon","properties":{"name":"United States Virgin Islands (U.S.)"},"id":850},{"arcs":[[-788,794,795,796]],"type":"Polygon","properties":{"name":"Costa Rica"},"id":188},{"arcs":[[797]],"type":"Polygon","properties":{"name":"Cayman Islands (U.K.)"},"id":136},{"arcs":[[[-763,798,799]],[[800]]],"type":"MultiPolygon","properties":{"name":"Ecuador"},"id":218},{"arcs":[[-765,801,-796,802]],"type":"Polygon","properties":{"name":"Panama"},"id":591},{"arcs":[[-656,-740,803,804,-799,-762]],"type":"Polygon","properties":{"name":"Peru"},"id":604},{"arcs":[[805]],"type":"Polygon","properties":{"name":"American Samoa (U.S.)"},"id":16},{"arcs":[[[-732,806,-804,-739]],[[807]],[[808]],[[-737,809]],[[810]],[[811]],[[812]],[[813]],[[814]],[[815]],[[816]]],"type":"MultiPolygon","properties":{"name":"Chile"},"id":152},{"arcs":[[817]],"type":"Polygon","properties":{"name":"Cook Islands (N.Z.)"},"id":184},{"arcs":[[818]],"type":"Polygon","properties":{"name":"Clipperton Island (Fr.)"},"id":"CPT"},{"arcs":[[[819]],[[820]],[[821]],[[822]]],"type":"MultiPolygon","properties":{"name":"Greenland (Den.)"},"id":304},{"arcs":[[823]],"type":"Polygon","properties":{"name":"Niue (N.Z.)"},"id":570},{"arcs":[[824]],"type":"Polygon","properties":{"name":"Pitcairn Islands (U.K.)"},"id":612},{"arcs":[[825]],"type":"Polygon","properties":{"name":"French Polynesia (Fr.)"},"id":258},{"arcs":[[826]],"type":"Polygon","properties":{"name":"Tokelau (N.Z.)"},"id":772},{"arcs":[[827]],"type":"Polygon","properties":{"name":"Tonga"},"id":776},{"arcs":[[828]],"type":"Polygon","properties":{"name":"Wallis and Futuna (Fr.)"},"id":876},{"arcs":[[829]],"type":"Polygon","properties":{"name":"Samoa"},"id":882},{"arcs":[[-25,830]],"type":"Polygon","properties":{"name":"Aksai Chin","ndlsa":true},"id":"NDLSA-Aksai-Chin"},{"arcs":[[-21,831]],"type":"Polygon","properties":{"name":"Chumar East","ndlsa":true},"id":"NDLSA-Chumar-East"},{"arcs":[[-19,832]],"type":"Polygon","properties":{"name":"Chumar West","ndlsa":true},"id":"NDLSA-Chumar-West"},{"arcs":[[-23,833]],"type":"Polygon","properties":{"name":"Demchok","ndlsa":true},"id":"NDLSA-Demchok"},{"arcs":[[-12,-168]],"type":"Polygon","properties":{"name":"Jadh Ganga Valley","ndlsa":true},"id":"NDLSA-Jadh-Ganga-Valley"},{"arcs":[[-27,834,835]],"type":"Polygon","properties":{"name":"Karakoram Range","ndlsa":true},"id":"NDLSA-Karakoram-Range"},{"arcs":[[-16,-166]],"type":"Polygon","properties":{"name":"Kauirik","ndlsa":true},"id":"NDLSA-Kauirik"},{"arcs":[[-10,-169]],"type":"Polygon","properties":{"name":"Lapthal","ndlsa":true},"id":"NDLSA-Lapthal"},{"arcs":[[-14,-167]],"type":"Polygon","properties":{"name":"Shipki Pass","ndlsa":true},"id":"NDLSA-Shipki-Pass"},{"arcs":[[-18,-165,-188,836,-835,-26,-831,-24,-834,-22,-832,-20,-833]],"type":"Polygon","properties":{"name":"Jammu and Kashmir","ndlsa":true},"id":"NDLSA-Jammu-and-Kashmir-IND"},{"arcs":[[-3,-106,-159,-117]],"type":"Polygon","properties":{"name":"Arunachal Pradesh","ndlsa":true},"id":"NDLSA-Arunachal-Pradesh"},{"arcs":[[-5,-119,-158]],"type":"Polygon","properties":{"name":"Doklam","ndlsa":true},"id":"NDLSA-Doklam"},{"arcs":[[-8,-186,-170]],"type":"Polygon","properties":{"name":"Kalapani","ndlsa":true},"id":"NDLSA-Kalapani"},{"arcs":[[-28,-836,-837,-187,-111]],"type":"Polygon","properties":{"name":"Jammu and Kashmir","ndlsa":true},"id":"NDLSA-Jammu-and-Kashmir-PAK"},{"arcs":[[-353,-439,837,-435]],"type":"Polygon","properties":{"name":"Western Sahara","ndlsa":true},"id":732},{"arcs":[[-279,-525,-513,838,-485]],"type":"Polygon","properties":{"name":"Golan Heights","ndlsa":true},"id":"NDLSA-Golan-Heights"},{"arcs":[[-516,-532]],"type":"Polygon","properties":{"name":"No Man's Land","ndlsa":true},"id":"NDLSA-No-Man-s-Land"},{"arcs":[[-486,-839,-512]],"type":"Polygon","properties":{"name":"Shebaa Farms Dispute","ndlsa":true},"id":"NDLSA-Shebaa-Farms-Dispute"},{"arcs":[[[-381,-503,839,-504]],[[-499,840]],[[-385,-497]],[[-501,841]]],"type":"MultiPolygon","properties":{"name":"UN Buffer Zone","ndlsa":true},"id":"NDLSA-UN-Buffer-Zone"},{"arcs":[[-557,-571]],"type":"Polygon","properties":{"name":"Abyei","ndlsa":true},"id":"NDLSA-Abyei"},{"arcs":[[-566,-600]],"type":"Polygon","properties":{"name":"Ilemi Triangle","ndlsa":true},"id":"NDLSA-Ilemi-Triangle"},{"arcs":[[842]],"type":"Polygon","properties":{"name":"British Indian Ocean Territory","ndlsa":true},"id":86},{"arcs":[[843]],"type":"Polygon","properties":{"name":"South Georgia and South Sandwich Islands","ndlsa":true},"id":239},{"arcs":[[[844]],[[845]]],"type":"MultiPolygon","properties":{"name":"Falkland Islands","ndlsa":true},"id":238}]},"land":{"type":"GeometryCollection","geometries":[{"arcs":[[[35,48,177,50,37,119,39,178,41,88,95,94,96,107,182,227,184,109,102,202,160,203,162,188,215,259,553,534,583,536,602,538,542,529,543,528,572,541,522,518,508,532,520,487,280,242,300,282,324,308,286,303,365,317,356,387,358,370,424,372,439,374,362,335,388,345,297,346,273,85,264,267,258,61,298,229,225,299,222,64],[53,207,219,231,174],[56,246,268,274,256,245,239]],[[43]],[[44]],[[45]],[[46]],[[47]],[[51]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[82]],[[86]],[[87]],[[91]],[[92]],[[106]],[[121,471]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[135,478,137,477]],[[138]],[[139]],[[140]],[[141]],[[142]],[[143]],[[144,179,463,181]],[[146]],[[147]],[[148]],[[149]],[[150]],[[151]],[[152]],[[153]],[[154]],[[155]],[[156]],[[190]],[[191]],[[192]],[[193]],[[194]],[[195]],[[196]],[[197]],[[198]],[[199]],[[204]],[[205]],[[206]],[[214]],[[226]],[[230]],[[294]],[[295]],[[302]],[[318]],[[319]],[[354,366,600,506,554,544,595,594,562,596,607,626,609,619,635,631,575,591,578,593,450,455,422,415,391,416,405,400,432,457,427,454,441,453,443,452,445,437,837,435]],[[355]],[[364]],[[369]],[[375]],[[376]],[[378,431]],[[379]],[[382,497,840,499,841,501,839,504]],[[386]],[[423]],[[430]],[[446]],[[447]],[[448]],[[456]],[[458]],[[459]],[[460]],[[461]],[[462]],[[464]],[[465]],[[466]],[[467]],[[468]],[[469]],[[470]],[[472]],[[473]],[[474]],[[475]],[[476]],[[479]],[[480]],[[481]],[[482]],[[483]],[[488]],[[489]],[[490]],[[491]],[[492]],[[493]],[[494]],[[495]],[[571]],[[605]],[[613]],[[617]],[[618]],[[627]],[[632]],[[638]],[[639]],[[640]],[[641]],[[642]],[[643]],[[644]],[[650,743,730,806,804,799,763,801,796,788,778,790,775,752,710,671,712,673,708,749,759,772,780,770,776,786,794,802,765,707,662,667,660]],[[656]],[[657]],[[658]],[[664]],[[665]],[[666]],[[668]],[[669]],[[674]],[[675]],[[676]],[[677]],[[678]],[[679]],[[680]],[[681]],[[682]],[[683]],[[684]],[[685]],[[686]],[[687]],[[688]],[[689]],[[690]],[[691]],[[692]],[[693]],[[694]],[[695]],[[696]],[[697]],[[698]],[[699]],[[700]],[[701]],[[702]],[[703]],[[704]],[[705]],[[711]],[[713]],[[714]],[[715]],[[716]],[[717]],[[718]],[[719]],[[720]],[[721]],[[722]],[[723]],[[724]],[[725]],[[726]],[[727]],[[728]],[[734]],[[735,809]],[[741,742]],[[744]],[[745]],[[746]],[[747]],[[748]],[[753]],[[754]],[[755]],[[756]],[[757]],[[758]],[[766]],[[767]],[[768]],[[769]],[[781]],[[782]],[[783,791]],[[785]],[[789]],[[792]],[[793]],[[797]],[[800]],[[805]],[[807]],[[808]],[[810]],[[811]],[[812]],[[813]],[[814]],[[815]],[[816]],[[817]],[[818]],[[819]],[[820]],[[821]],[[822]],[[823]],[[824]],[[825]],[[826]],[[827]],[[828]],[[829]],[[842]],[[843]],[[844]],[[845]]],"type":"MultiPolygon"}]},"disputed":{"type":"MultiLineString","arcs":[[118,4,157],[105,2,116,158],[15,165],[13,166],[11,167],[9,168],[7,169,185],[164,17,18,19,20,21,22,23,24,25,26,27,110,186,187],[438,352,434],[384,496],[498],[500],[502,380,503],[278,484,485,511,512,524],[515,531],[556,570],[565,599],[830],[831],[832],[833],[834,835],[836],[838]]}}} \ No newline at end of file diff --git a/packages/flint-js/src/geo/world-bank-medium.json b/packages/flint-js/src/geo/world-bank-medium.json new file mode 100644 index 00000000..727158e5 --- /dev/null +++ b/packages/flint-js/src/geo/world-bank-medium.json @@ -0,0 +1 @@ +{"type":"Topology","arcs":[[[78373,56072],[-4,24],[-30,16],[-52,-29],[-15,61],[-30,-19],[-1,-74],[-20,-73],[-14,-17],[16,-64],[-9,-32],[11,-45],[1,-50],[44,-108],[-8,-72],[10,-63],[14,-10],[-15,-79],[-14,-116],[11,-48],[20,-22],[-34,-83],[-12,44],[-20,25],[-34,7],[-28,-19],[-26,-32],[-18,39],[8,44],[-18,26],[-12,58],[17,24],[2,82],[-18,5]],[[78095,55472],[7,22],[-23,130],[-26,-51],[-34,-21],[-41,-117],[-42,-45],[-27,9],[-12,57],[-23,-8],[-29,-46],[-11,31],[-21,-2],[-5,68],[14,54],[-12,20],[-20,-23],[-16,24],[-13,85],[13,99],[-8,64],[-20,14],[-6,-31],[-35,33],[-20,2],[-19,25],[-24,-6],[-11,23],[-18,-26],[-39,2],[-28,34],[18,107],[18,83],[23,58],[1,55],[-13,99],[13,39],[4,46],[15,23],[-3,58],[26,-30],[7,36],[-10,29],[0,61],[-26,9],[-29,34],[-17,-25],[-48,3],[-25,41],[-33,19],[16,91],[-14,18],[8,57],[-13,49],[-12,-8],[-7,46],[24,54],[-11,13],[-8,77],[-9,30],[-27,3],[-3,87],[5,55],[46,59],[6,53],[-66,-24],[-14,-17],[-16,33],[-48,-12],[-7,-10],[-36,11],[-49,-30],[-15,-28],[-24,-14],[-54,-96],[-18,-8],[-31,42],[13,42],[43,91],[6,36],[-10,153],[-13,56],[-39,-9],[8,38],[4,136],[5,59],[32,53],[26,5],[-19,44],[0,95],[13,56],[18,109],[18,-40],[11,0],[17,47],[18,22],[19,52],[5,47],[-9,41],[18,47],[21,19],[10,-36],[28,37],[2,44],[17,31],[1,55],[16,45],[31,-33],[17,39],[-5,57],[-19,29],[-12,105],[26,3],[19,46],[-16,47],[1,38],[14,33],[14,192],[-10,56],[4,73],[-18,296],[7,7],[5,78],[-11,36],[-4,75],[5,23],[-33,51],[-6,37],[-37,10],[0,-74],[-26,-30],[-14,104],[-14,25],[-3,87],[-15,29],[10,28],[-21,67],[8,86],[-22,72],[-47,115],[-18,-22],[-31,44],[1,47],[-21,53],[-27,7],[-17,-34],[5,-37],[-13,-45],[7,-49],[-28,-25],[-15,-48]],[[77040,60241],[-17,12],[-13,45],[-31,49],[-43,-23],[-23,41],[-8,69],[-28,26],[-3,35],[-27,32],[-1,56],[-13,64],[-22,63],[0,50],[-21,1],[-1,40],[-22,35],[-28,145],[-30,35],[-4,32],[-24,31],[-24,-6],[-23,-36],[-20,17],[-21,-36],[-11,-53],[-26,-22],[-47,-2],[-15,-37],[-23,-1],[-7,-22],[-38,-13],[-10,35],[-24,4],[-46,29],[-11,-13],[-32,109],[-29,-34],[-13,-36],[-45,-48],[-24,-2],[13,-107],[-22,-49],[-23,3],[-11,-33],[-22,-12],[-40,-77],[-58,-74],[-23,16],[-31,-13],[-3,-28],[-49,-77],[-43,-59],[-6,-52],[-44,-68],[-12,-8],[-9,-44],[-23,-18],[-14,8],[-32,-41],[-2,-37],[22,-27],[-3,-44],[-21,-45],[-49,-57],[-38,-28],[-13,54],[-14,12],[-51,-77],[-21,-3],[-5,-27],[-24,-13],[-18,65],[-12,-11],[-44,45]],[[75447,59986],[-6,35],[-30,27],[-14,43],[-25,41],[-19,-38],[-33,-18],[-63,42],[-52,8],[-14,19],[-29,-41],[-22,31],[-16,-12],[-24,34],[-20,46],[-22,-10],[-25,33],[-6,-37],[-16,-4],[-17,41],[-21,-10],[-13,36],[-25,-5],[-14,-37],[-34,-5],[-7,-32],[-30,-60],[-3,-42],[-17,-61],[-27,-30],[-20,-58],[-26,-111]],[[74757,59811],[-26,-25],[-16,-67],[-2,-130],[-14,16]],[[74699,59605],[-31,55],[-10,110],[20,75],[4,110],[8,29],[-12,98],[-25,63],[-24,-3],[-8,29],[-40,-44],[-23,-53],[-25,-1],[-20,-26],[-30,15],[-2,-60]],[[74481,60002],[-10,-13],[-20,30],[-45,4],[-8,29],[-31,-105],[-31,4],[-9,37],[-36,-28],[-22,16],[-15,-14],[-53,7],[-24,82],[-30,9],[-22,47],[-17,-6],[-12,54],[-41,5],[-18,-35],[-6,-69],[-20,-35],[-41,48],[-19,5],[-8,113],[-18,-16],[-15,-68],[7,-70],[-11,-17],[-32,29],[8,33],[-23,57],[1,30],[-23,65],[-19,27],[-4,73],[-20,-26],[-40,20],[-28,-2],[-45,-24],[-41,37],[-2,74],[16,35],[9,50],[-7,54],[-14,32],[-16,-5],[-30,-72],[-25,-7],[-45,47],[-19,72],[-38,-1],[-15,25],[-8,60],[-49,28],[3,108],[-15,3],[3,56],[-10,49],[4,32],[-60,67],[-39,-21],[-8,-40],[-22,-1],[-22,-62],[-54,113],[-8,76],[-18,52],[-18,3],[-23,81],[-36,-2],[-16,44],[-21,24],[-22,-14],[-26,33],[-7,60],[-11,30],[-27,24],[-11,47],[-17,-6],[-28,54],[-10,-8],[-33,46],[-33,109],[-4,86],[-32,-19],[-38,42],[-31,7],[-35,41],[-16,-12],[-8,-41],[-35,35],[2,-84],[-6,-70],[-22,-39],[-19,-101],[-27,1],[-16,30],[-3,68],[-13,35]],[[72509,61663],[-1,35],[-29,15],[-26,33],[-33,72],[-30,41],[-18,-16]],[[72372,61843],[-12,28],[-42,23],[-9,32],[-30,17]],[[72279,61943],[-4,55],[16,40],[-20,62],[-14,-19],[-22,45],[-44,53],[-4,35],[-28,14],[-21,-11]],[[72138,62217],[-36,-15],[-16,56],[-24,-3],[-4,35]],[[72058,62290],[-28,59],[-8,61],[-19,82],[-32,72],[-22,-21],[0,-55],[-21,13],[-17,-57]],[[71911,62444],[-31,26],[-5,44],[8,32],[-10,81],[28,47],[-22,48],[-17,77]],[[71862,62799],[10,74]],[[71872,62873],[6,45]],[[71878,62918],[-22,119],[-15,9],[-39,106]],[[71802,63152],[-5,121],[-20,61]],[[71777,63334],[6,30],[41,33]],[[71824,63397],[11,-11],[6,25]],[[71841,63411],[9,16]],[[71850,63427],[21,27]],[[71871,63454],[11,-74],[-6,-17],[15,-94],[16,-17],[28,-56],[6,25],[31,16],[4,44],[19,42],[25,31]],[[72020,63354],[34,-22],[19,59],[23,50],[3,60],[-22,28],[-3,49],[-29,50],[-10,69],[22,111],[-24,1],[-29,34],[-18,-40]],[[71986,63803],[-22,29],[-15,73],[-23,45]],[[71926,63950],[0,113],[-8,55],[48,-2],[-20,49],[6,48],[-18,50],[-8,64],[-14,43],[30,46],[33,-33],[17,24],[55,-21],[32,95],[5,50],[30,40],[-13,58],[-12,90],[29,-7],[47,24],[4,43],[-7,60],[32,50],[15,-13],[33,20],[17,116],[17,14],[9,60],[-9,107],[25,81],[-5,46],[4,111],[12,14],[-15,105],[-11,26],[-29,8],[-30,110],[-21,0],[-30,-34],[-6,15],[-46,30],[-51,49],[-6,44],[-47,20],[-17,-15],[-11,-54],[10,-51],[-30,-8],[-30,23],[-7,29],[-30,-24],[-17,13],[-34,-13],[-33,-57],[-25,-7],[-17,-23],[-36,-5],[-6,-31],[-19,-4],[-9,-89],[-21,-3],[-10,27],[-21,-12],[-3,-61]],[[71654,65453],[-26,12],[-34,-3],[-15,-30],[-36,24],[-50,-9],[-11,34]],[[71482,65481],[36,-3],[4,25],[-22,113],[-41,0],[-42,59],[-27,-11],[-55,58],[-21,79],[21,27],[-7,59],[-20,25],[-18,54],[-45,21],[-13,57],[-21,31],[-36,0],[-49,120],[-15,15],[-16,46]],[[71095,66256],[-21,46],[-41,61],[-52,14],[-18,-40],[-14,40],[1,83],[-18,51],[-34,0],[-20,41],[-68,-26],[-22,47],[-28,-17],[-10,47],[-38,-40]],[[70712,66563],[-30,80],[3,39],[20,38],[36,-5],[22,30],[17,-50],[22,14]],[[70802,66709],[6,29],[46,29],[5,40],[16,27],[-26,83],[-35,31],[-10,68],[32,81],[-28,58],[1,120],[-13,1],[-13,43],[-6,84],[-28,19],[2,38],[-11,68],[8,34],[-52,34],[-62,91],[-27,30],[-18,1],[-35,-86],[-20,15],[-34,49],[1,34],[-17,53],[6,35],[-20,51],[16,63],[22,-15],[2,65],[-28,19],[-5,55],[-31,96],[-20,22],[18,130]],[[70444,68304],[59,6],[17,11],[10,77],[10,7],[-11,104],[-19,8],[5,65],[51,181],[58,19],[27,-23],[50,83],[18,52],[19,-6],[12,46],[49,18],[-23,52],[12,61],[42,-49],[29,-12],[40,18],[62,103],[34,42],[13,-30],[5,-83],[20,-21],[-17,-80],[19,-45],[55,25],[18,33],[44,-12],[22,28],[24,-28],[36,20],[26,52],[-2,31],[38,129],[-8,52],[17,19],[15,119],[59,76],[33,2],[27,-37],[30,-5],[32,25],[18,-30],[82,13],[10,75],[28,46],[30,5],[34,40],[6,96],[23,14],[41,-4],[41,34],[7,25],[24,-4],[19,59],[39,19],[25,47],[21,8],[29,48],[26,2],[29,60],[40,31],[15,-12],[31,40],[47,20],[15,73],[48,19],[33,-11],[23,21],[-22,39],[7,67]],[[72270,70277],[30,18],[-14,81],[-7,86],[4,46],[-16,66],[16,63],[11,80],[29,3],[30,29],[35,17],[-58,76],[-2,35],[28,17],[30,49],[54,2],[-2,122],[-15,46],[7,69],[-64,253],[-4,58],[-14,53],[-3,65],[-13,28],[2,100],[-16,167],[18,91],[-27,67],[-27,20],[-13,49],[-48,13],[-32,67],[71,106],[21,-24],[21,28],[26,-16],[29,61],[32,-16],[34,33],[48,-18],[16,31],[32,3],[8,31],[84,45],[33,3],[31,53],[40,20],[41,-112],[33,19],[30,-24],[43,10],[47,-42],[30,31],[1,90],[-12,54],[-73,82],[-6,58],[8,67],[16,62],[-3,103],[34,27],[16,132],[58,238],[17,135],[24,106],[19,135],[14,32],[12,116],[32,8],[25,-39],[35,-2],[54,-84],[50,-20],[52,-34],[16,7],[39,-20],[21,25],[71,4],[16,-23],[19,18],[50,3],[51,-101],[11,37],[26,12],[25,38],[14,49],[46,-5],[41,16],[13,53],[29,58],[0,149],[-19,77],[-20,338],[6,102],[31,80],[5,51],[27,60],[34,13],[86,-3],[26,40],[25,-7],[48,43],[16,65],[38,65],[-6,45],[19,46],[-19,35],[-3,79],[26,32],[17,61],[51,-4],[10,16],[48,-26]],[[74246,75229],[41,-32],[15,48],[90,23]],[[74392,75268],[14,-43],[-11,-44],[14,-19],[-2,-53],[-32,-25],[18,-78],[33,-35],[24,-5],[13,-50],[-28,-52],[0,-23],[76,-53],[55,-83],[10,8],[35,-41],[-10,-45],[20,-70],[21,-4],[30,-52],[25,6],[26,-39],[15,-46],[48,-11],[30,34],[67,6],[20,-90],[24,-13],[5,-43],[51,3],[3,37],[37,-18],[-4,-56],[19,-40],[43,-22],[29,-110],[20,-35],[5,-119],[29,-113],[46,-112],[37,-35],[16,-57],[-3,-41],[30,-74],[-9,-103],[16,-13],[-29,-144],[-21,-34],[33,-136],[3,-72],[-48,-97],[-37,-115],[-10,-87],[-3,-85],[28,-42],[12,-75],[34,-94],[17,16],[35,-1],[32,-55],[38,-19],[15,33],[18,-36],[34,-28],[52,11],[81,-4],[39,-46],[22,10],[47,-20],[16,14],[65,19],[43,-21],[66,-2],[33,-22],[23,4],[17,-23],[21,8],[41,-36],[22,-39],[133,-140],[32,-61],[10,-48],[28,-4],[39,-45],[30,-73],[65,-40],[15,-28],[112,32],[-8,-49],[-14,-144],[55,-15],[28,-110],[32,-184],[33,-130],[6,-98],[9,-30],[126,-241],[7,-125],[100,22],[63,-1],[54,29],[285,-102],[97,-11],[266,-51],[129,59],[83,-9],[14,37],[148,-10],[199,-106],[65,-15],[77,-200],[102,-58],[27,12],[46,-7],[79,-83],[117,-111],[123,-58],[61,3],[125,50],[-2,-153],[45,-11],[66,6],[25,-52],[62,120],[16,-1],[82,99],[37,38],[66,52],[181,163],[49,37],[73,18],[61,34],[6,32],[48,37],[30,-34],[101,-6],[25,23],[62,20],[14,-17],[67,3],[85,-33],[49,43],[74,-16],[70,26],[40,63],[60,53],[57,6],[9,22],[55,45],[28,32],[9,40],[44,71],[29,109],[10,10],[64,153],[19,30],[82,60],[26,38],[41,13],[52,115],[44,14],[3,94],[-25,84],[-25,47],[-27,28],[-34,89],[-21,98],[-16,12],[0,53],[14,66],[25,64],[-2,49],[17,96],[42,144],[63,80],[31,-13],[74,-8],[14,10],[30,-53],[17,-51],[31,-36],[39,-29],[22,1],[54,-31],[106,-16],[36,-22],[75,119],[43,12],[27,46],[7,32],[46,61],[34,71],[15,52],[6,66],[55,38],[49,-40],[69,11],[54,-5],[92,49],[67,123],[68,43],[29,58],[-12,80],[8,57],[38,117],[71,141],[29,6],[21,39],[70,-21],[78,4],[6,85],[14,33],[-8,40],[49,16],[31,-64],[36,11],[29,63],[27,8],[74,78],[39,-22],[98,-14],[16,60],[18,-22],[27,4],[26,-70],[42,-4],[34,-26],[15,24],[64,-15],[63,32],[11,42],[-2,130],[-38,86],[4,25],[-25,98],[-63,92],[-30,53],[-4,59],[-60,46],[-6,87],[-101,79],[-56,157],[-91,34],[-77,-23],[-41,4],[-90,-183],[-30,-85],[-80,131],[-60,50],[-54,-1],[-64,-38],[-52,28],[-41,-42],[-49,-99],[-100,171],[-14,167],[81,73],[-5,150],[4,60],[68,177],[-5,57],[106,396],[50,194],[32,107]],[[82420,75752],[95,-114],[60,-39],[55,-3],[45,-45],[47,-34],[22,-2],[3,57],[43,12],[44,57],[9,34],[40,29],[2,26],[46,77],[154,56],[48,88],[22,132],[-11,38],[-26,-8],[-28,23],[36,62],[5,98],[21,18],[39,83],[7,115],[21,56],[35,48],[18,89],[-7,30],[13,44],[21,22],[21,63],[5,65],[30,136],[23,1],[81,120],[9,29],[46,30],[16,59],[-9,21],[28,84],[-8,72],[-35,46],[15,74],[2,66],[-27,55],[-44,33],[-43,-13],[-26,-31],[-30,5],[-13,39],[9,43],[-10,52],[41,25],[45,66],[7,32],[54,98],[23,17],[13,49],[75,89],[49,-14],[125,53],[82,55],[60,-4],[22,36],[41,20],[27,-37],[48,11],[84,-1],[42,31],[25,-6],[42,46],[27,-17],[67,7],[23,-39],[50,-8],[48,-57],[16,-40],[35,23],[24,-37],[31,-80],[77,-18],[1,-30],[33,-7],[37,41],[53,7],[43,-45],[51,-35],[30,-8],[33,-102],[-19,-16],[4,-42],[43,26],[42,-99],[33,-2],[-9,-40],[-28,-31],[13,-54],[23,10],[31,-51],[40,-99],[-13,-129],[55,-34],[16,-24],[-15,-64],[-18,-7],[4,-54],[14,-21],[32,-104],[30,-49],[-5,-100],[35,-24],[-16,-67],[32,-23],[1,-49],[-22,-6],[21,-95],[7,-103],[61,-105],[27,-99],[17,-15],[-3,-59],[23,-63],[-22,-84],[20,-22],[-10,-69],[12,-32],[64,-37],[0,-46],[-26,-79],[-3,-62],[13,-33],[-4,-84],[40,-40],[0,-46],[36,-76],[19,-14],[32,24],[24,-47],[72,2],[13,31],[49,11],[67,-40],[-13,-45],[41,-2],[32,-25],[11,-48],[24,-17],[23,33],[34,-34],[9,49],[17,13],[28,-33],[11,-81],[30,11],[18,-31],[6,-48],[21,-5],[2,-46],[21,-24],[1,-34],[64,-81],[20,-41],[64,27],[21,-33],[19,17],[20,-22],[-19,-45],[-25,-114],[24,-40],[8,-60],[27,18],[-1,-50],[10,-61],[19,-42],[-17,-31],[-6,-51],[-23,-37],[2,-52],[51,-86],[26,-86],[0,-66],[22,-29],[39,7],[23,28],[77,-1],[7,-45],[22,-3],[22,30],[28,-31],[51,34],[62,-9],[25,41],[51,-31],[29,17],[-3,37],[26,67],[-2,54],[36,-21],[17,46],[36,30],[15,53],[63,-13],[32,20],[24,-34],[17,31],[15,61],[32,-9],[10,47],[27,-12],[11,25],[34,-7],[6,59],[23,-7],[48,34],[36,5],[21,25],[53,-10],[25,-37],[-26,-74],[-2,-71],[-34,-89],[-1,-29],[31,-68],[4,-53],[26,-44],[1,-35],[-25,-57],[1,-22],[-28,-55],[-5,-35],[-24,-23],[-43,-5],[-41,-83],[-7,-48],[21,-50],[-1,-55],[-19,-8],[-26,-86],[2,-35],[-12,-87],[7,-20],[-9,-81],[-28,-50],[-20,-87],[24,-39],[-15,-42],[11,-61],[-19,-54],[-38,-27],[8,-63],[-17,-82],[-18,-14],[-10,-54],[-19,16],[-13,-40],[4,-101],[-24,-82],[-57,-63],[-13,-45],[-13,-131],[12,-85],[-51,-75],[-27,28],[-235,137],[-21,21],[-6,41],[-22,-20],[-13,-48],[-30,-22],[-8,-39],[12,-24],[-25,-48],[-47,-66],[-22,16],[-21,-48],[-33,17],[-17,-34],[-32,-23],[-5,-31],[27,-28],[13,-54],[55,-476],[-13,-10],[0,-83],[-14,-67],[6,-106],[-9,-103],[20,-27],[12,-67],[-10,-15],[-7,-82],[-14,-20],[1,-76],[-24,-45],[-6,-33],[12,-62],[-35,-15],[-35,-45],[-62,-3],[-56,-55],[-17,-29],[17,-31],[34,-8],[13,-54],[-20,-67],[10,-15],[0,-27],[13,-20]],[[86288,70427],[-6,7],[-13,4],[-2,22],[2,3],[4,2],[0,2],[-1,6],[-9,8],[1,14],[-1,7],[-7,15],[-4,27],[4,14],[-1,7],[-3,4],[-3,2],[-3,2],[-5,-5],[-4,-17],[0,-32],[-3,1],[-7,10],[0,10],[1,5],[4,12],[-4,10],[-5,-2],[-2,-7],[-2,-2],[-4,3],[0,9],[-7,17],[-6,5],[-8,18],[-2,15],[-1,6],[-5,1],[-4,1],[-3,11],[-1,5],[-1,2]],[[86177,70649],[3,128],[-41,4],[5,34],[-46,13],[-29,-13],[-2,-48],[-23,-134],[-6,-91],[1,-82],[-11,-28],[-27,7],[-20,-49],[-23,51],[-41,-19],[-22,-45],[-10,-107],[-23,-45],[-44,-40],[-17,-40],[-32,4],[-54,-23],[-40,15],[-81,1],[-31,-18],[19,-37],[0,-89],[14,-67],[35,-60],[10,-41],[-24,-102],[-20,-44],[-28,8],[-31,32],[-30,-15],[-76,9],[-18,32],[-14,-13],[-56,29],[-28,52],[-10,51],[-21,22],[5,49],[-45,36],[-26,-58],[-47,-28],[-20,-130],[-13,-40],[1,-34],[-22,-27],[-30,-85],[-4,-28],[-41,-73],[-38,-135],[-22,-17],[-20,21],[-18,-32],[-28,3],[-19,-40],[-62,-100],[-67,-51],[-47,-59],[10,-22],[-50,-38],[-35,-58]],[[84647,68945],[-8,-28],[-26,-20],[-18,-35],[-10,-16],[-46,-95],[1,-78],[-16,-23],[-2,-9],[-9,1],[-27,-71],[-41,-22],[-43,19],[-44,-10],[-22,-21],[-60,0],[-37,-20],[-1,-33],[-35,-40],[-11,17],[-41,-40],[-20,-6],[-48,-50],[-49,-89],[-38,-4],[-18,-26],[-23,-69],[-30,-40],[-6,-57],[-41,-83],[-21,11],[-6,-70],[-21,54],[-50,-55],[29,-31],[-16,-31],[-24,11],[-28,-41],[-31,4],[-27,-24],[-18,-48],[-18,2],[-11,144],[15,20],[23,-4],[31,19],[-4,33],[50,6],[50,54],[-21,76],[31,67],[-16,44],[-28,-31],[-32,68],[-14,-40],[-21,21],[-22,-3],[24,72],[-29,37],[25,39],[22,6],[36,45],[-19,58],[4,37],[20,48],[18,1],[32,34],[37,54],[0,28],[41,73],[-2,41],[31,45],[3,42],[20,36],[25,74],[0,32],[-38,74],[5,44],[-82,104],[-8,74],[-30,-13],[-13,-36],[-34,10],[-24,21],[-44,13],[-40,-5],[-27,-28],[0,-28],[-30,-1],[-8,-95],[-31,-36],[-47,-115],[-19,-12],[0,-73],[-25,-27],[-1,-56],[-17,-38],[-37,-8],[-10,-24],[-88,-67],[-9,-41],[-36,-32],[-62,-35],[-9,-65],[-18,-2],[-33,-65],[-27,-176],[15,-39],[-33,-39],[-16,-54],[-48,-88],[-66,-23],[-32,22],[-76,-103],[-24,15],[-31,102],[-44,22],[-42,-36],[-19,-49],[-4,-94],[-30,-77],[-13,-56],[-5,-108],[18,-93],[32,-116],[30,-59],[18,-11],[35,-49],[8,-43],[31,16],[14,-26],[35,-18],[33,-3],[12,-41],[26,29],[2,48],[22,10],[6,-42],[23,6],[-1,42],[23,-9],[32,-130],[24,-28],[9,-79],[37,-55],[9,-57],[-45,49],[-25,-23],[-19,-59],[-10,-59],[0,-119],[10,-60],[39,-40],[14,-34],[46,-54],[13,17],[36,7],[21,-15],[49,15],[11,39],[27,43],[6,41],[-20,53],[91,84],[31,60],[25,90],[21,34],[39,11],[39,48],[60,-7],[0,-29],[51,-77],[6,-49],[30,-18],[24,7],[26,-35],[10,-47],[29,-22],[14,27],[35,-16],[67,25],[17,37],[23,11],[0,-57],[10,-33],[21,23],[23,-38],[45,0],[27,-35],[-10,-53],[20,-60],[-39,-38],[-5,-63],[20,-28],[1,-33],[-36,-44],[-20,-59],[-40,20],[-14,57],[-31,-13],[-20,15],[-56,-46],[-2,-24],[-32,-24],[0,-53],[-42,24],[-23,-8],[-7,-28],[-48,-22],[-33,-49],[-36,-26],[4,-25],[-18,-66],[-42,3],[-18,-53],[10,-41],[-14,-39],[4,-89],[-74,-69],[-38,2],[22,88],[-14,39],[-17,-35],[-16,22],[-17,-27],[-7,-60],[29,-29],[12,-64],[-16,-34],[-36,-24],[-11,-43],[-8,-77],[-15,-2],[-21,-75],[-15,26],[-16,-28],[-16,4],[-20,-53],[-20,-112],[-42,-89],[-10,-115],[-44,-43],[-8,-133],[30,-80],[11,14],[40,-26],[-7,-38],[32,-59],[61,-69],[1,-20],[61,-31],[25,-38],[45,-45],[22,-166],[22,-102],[29,-117],[17,-101],[-9,-63],[25,-33],[14,-64],[17,-136],[19,-79],[-3,-44],[19,-18],[8,-98],[-6,-116],[8,-82],[14,-6],[25,-48],[70,-72],[24,-39],[-2,-76],[-8,-40],[17,-29],[4,-38],[24,-9],[58,-58],[33,-85],[21,-134],[-15,-28],[-67,37],[-88,105],[-33,-27],[-23,-42],[-46,21],[-9,68],[-30,77],[-54,45],[-19,-15],[-24,6],[-51,-83],[-27,-4],[-39,19],[-32,112],[-12,102],[-18,37],[-29,-10],[-10,-57],[-23,21],[6,-54],[31,39],[19,-43],[1,-51],[28,-33],[5,-40],[26,-35],[48,-26],[75,38],[2,38],[43,-29],[25,5],[20,-27],[24,-137],[41,-6],[61,-86],[21,-84],[15,-12],[46,-81],[15,-10],[39,-62],[41,-127],[17,-139],[-10,-50],[-20,7],[-43,-9],[-45,-25],[-25,-32],[-22,-49],[-21,-5],[-20,-25],[-11,-37],[-29,-13],[-14,-23],[-15,-54],[3,-42],[-10,-34],[-45,-30],[-1,26],[-29,27],[14,-101],[10,-25],[24,-4],[8,-50],[48,53],[46,71],[27,7],[21,-11],[34,-58],[63,-189],[20,-4],[77,-61],[-54,-134],[-22,-34],[-18,-61],[-52,-38],[-10,23],[-16,-53],[28,-4],[31,22],[23,31],[11,-50],[17,54],[-9,42],[30,14],[25,-29],[-15,-45],[10,-38],[-17,-85],[3,-46],[13,-46],[-25,-37],[-19,-9],[-16,22],[-16,-18],[-17,12],[-15,57],[-16,-51],[-18,-25],[-1,-35],[31,10],[18,-18],[0,-37],[25,-74],[-16,-26],[5,-82],[-12,-46],[-35,-44],[15,-98],[7,-114],[18,-18],[-12,-48],[-28,40],[-15,-2],[-27,-132],[-22,25],[2,-64],[-38,-35],[-5,42],[39,84],[-17,73],[-19,18],[-16,-125],[-19,-22],[-7,-83],[-12,-30],[-20,13],[-6,-92],[-24,-56],[-9,-44],[-16,-22],[-2,-43],[-21,-38],[8,-61],[15,-22],[-22,-58],[-20,-23],[9,-46],[-23,-91],[-19,-18],[-37,-64],[-13,-94],[-34,3],[-22,-39],[14,-37],[12,-77],[-2,-56],[-45,-18],[-20,-67],[-14,13],[18,65],[15,-5],[7,39],[29,80],[-38,9],[-5,-45],[-15,-44],[-18,37],[-6,64],[-28,-45],[-14,-4],[-9,-68],[36,-27],[24,-99],[-20,-14],[-19,10],[-1,-90],[50,43],[-5,-52],[-36,-36],[-40,-106],[-10,-46],[52,-47],[-9,-68],[-16,-9],[-5,-51],[6,-44],[-12,-54],[-34,-16],[5,-57],[35,-14],[-7,-38],[16,-37],[4,-59],[-34,-1],[-41,101],[-27,-52],[-13,31],[-26,-34],[-3,-40],[43,-48],[16,-33],[-13,-60],[-30,-6],[-27,-40],[-6,47],[-23,70],[-28,-28],[24,-42],[-10,-61],[-23,-15],[14,-40],[2,-49],[-11,-46],[-29,-30],[-33,3],[2,-50],[16,8],[15,-39],[-20,-57],[-4,-41],[-24,-60],[-8,41],[-25,34],[-33,-37],[-19,0],[-18,-29],[-20,75],[-15,-65],[26,-18],[-1,-32],[-16,-42],[-31,13],[-33,29],[-21,-35],[23,-28],[34,13],[26,-88],[-49,-95],[-14,-47],[-2,-48],[-32,-23],[-18,24],[-1,-54],[-15,-22],[-12,-64],[-12,56],[-18,-31],[-9,-46],[7,-54],[-22,-70],[-21,41],[1,48],[-19,-13],[-1,-78],[-30,-12],[-11,-30],[-14,37],[-24,8],[-8,-63],[-18,1],[-8,-72],[-24,-59],[-10,-79],[-32,-50],[-13,3],[-13,-58],[9,-62],[-18,-54],[-34,-10],[-21,25],[-22,-29],[-36,-74],[-16,20],[-44,-37],[-16,-38],[-10,58],[-36,36],[-24,-32],[-13,-58],[-15,-33],[-24,-10],[-20,75],[-23,-7],[-4,36],[-45,-33],[-7,-59],[-42,-75],[-34,-10],[-2,115],[22,32],[-8,25],[-17,-36],[-14,9],[-33,-44],[-19,-53],[27,0],[-14,-60],[22,-42],[-30,-43],[-8,61],[-28,55],[-31,-18],[-13,-32]],[[81729,56175],[-44,-19]],[[81685,56156],[-36,4],[-18,-39],[-8,69],[-23,85],[-2,39],[-38,11],[-9,-41],[16,-41],[3,-42],[-15,-11],[-14,-88],[14,-82],[-4,-67],[-10,-13]],[[81541,55940],[-7,-24],[7,-31]],[[81541,55885],[-2,-41],[-19,4],[-17,51],[-10,-48],[10,-19],[-13,-55],[-17,9],[-10,40],[-27,-65],[-18,66],[2,63],[-11,98],[1,84],[28,7],[15,-78],[12,53],[-12,84],[-19,-57],[-29,-8],[6,-183],[-21,-34],[0,-66],[6,-42],[-12,-42],[-25,-23],[-8,53],[-26,6],[-22,-50],[-14,-61],[-22,-23],[-37,46],[-7,-58],[-43,-23],[-16,35],[-2,36],[-53,-35],[-22,-51],[6,-51],[-21,-32],[-3,76],[-13,12],[-12,-52],[-19,-15],[-7,-38],[-34,-27],[-43,3],[-31,-63],[-2,54],[-69,-36],[-37,-43],[-34,5],[-33,-76],[-9,-49],[-22,-8],[-32,20],[-5,-54],[-45,-80],[-22,-51],[5,-73],[14,-31],[26,9],[17,-21],[2,-48],[-6,-70],[27,10],[1,-63],[17,-76],[-4,-33],[-22,-69],[-43,-54],[-24,14],[-22,-21],[-17,33],[-30,-27],[-8,64],[-14,41],[10,21],[22,-33],[6,30],[-31,49],[-18,6],[-1,50],[-23,121],[5,33],[-24,53],[-2,69],[11,75],[-9,40],[21,53],[9,104],[33,26],[-2,60],[-18,-4],[-19,37],[-17,-13],[-19,66],[-14,1],[-13,-56],[-24,-30],[-36,-2],[-46,-38],[-31,34],[27,36],[7,31],[-33,58],[-23,-19],[-32,35],[-33,-21],[-6,57],[-41,68],[14,38],[-18,34],[-16,-19],[16,-152],[-20,-68],[-22,-3],[7,88],[-30,-6],[3,-58],[-22,-34],[0,57],[-19,-14],[-27,-47],[-27,7]],[[79994,55458],[-25,38],[-7,37],[-14,7],[-35,-34],[-51,-10],[-12,47],[-22,-48],[-7,53],[-17,52],[-14,-27],[-14,11],[-31,63],[-22,18],[16,43],[-19,40],[-21,18],[-30,-1],[-7,22],[-29,0],[9,66],[-12,62],[8,30],[-11,79],[-21,32],[-8,57],[16,105],[9,-19],[24,17],[10,103],[14,19],[-27,61],[-19,6],[-18,48],[-67,-55],[-25,17],[-6,54],[-13,24],[-52,3],[-12,-29],[-29,-5],[-5,31],[-26,31],[-6,23],[-44,22],[3,48],[-21,30],[-14,66],[-21,16],[-14,54],[-26,-94],[-14,19],[-20,-30],[-62,-58],[-2,-29],[-20,-7],[17,-124],[-27,-41],[-9,-39],[-17,-9],[-26,26],[-50,-109],[-33,28],[-10,74],[-36,-23],[-21,-63],[-7,-144],[-15,-12],[-38,82],[-15,50],[-35,77],[-22,-71],[4,-25],[-13,-50],[-12,18],[-17,70],[4,26],[-19,32],[-24,-44],[-1,-38],[-24,-24],[-11,-41],[7,-24],[-28,-34],[-1,-44],[-13,-6],[-30,34],[-13,76],[-25,22],[-27,56],[-23,21],[-10,-21],[-17,53],[-16,-16],[-13,-88],[-23,-55],[-23,-93],[-26,-19]],[[84002,61434],[-26,47],[-12,-1],[-31,37],[-38,0],[-14,49],[3,29],[-12,40],[40,-1],[17,-32],[39,-33],[12,-39],[-5,-27],[32,-46],[-5,-23]],[[83917,61742],[20,25],[15,-32],[-2,-35],[-19,0],[-14,42]],[[83902,61325],[17,42],[25,-63],[-12,-25],[-15,43],[-15,3]],[[83381,56446],[-3,34],[-37,71],[15,40],[-4,42],[10,50],[5,64],[8,16],[0,60],[-8,29],[5,111],[12,111],[22,21],[46,238],[27,111],[38,121],[17,90],[49,100],[1,49],[40,159],[58,61],[25,5],[19,25],[10,61],[35,35],[31,-84],[31,-33],[27,-11],[13,-72],[10,-20],[-26,-41],[-16,-59],[-3,-61],[15,-166],[-15,-52],[-21,-145],[-23,-53],[1,-30],[-13,-42],[8,-57],[-11,-33],[-1,-59],[-28,-257],[3,-23],[-14,-125],[-10,-25],[-7,-108],[-10,-23],[-16,-90],[-30,-124],[-19,-53],[-29,-46],[-12,-66],[-25,-168],[-3,-144],[4,-71],[-21,-71],[-30,29],[-8,33],[8,60],[-20,143],[-16,49],[-70,112],[-23,83],[7,29],[-19,93],[-9,77]],[[83855,60896],[18,41],[9,-24],[-6,-66],[-21,49]],[[83665,62826],[27,35],[31,-35],[22,-49],[56,-80],[57,-34],[18,-35],[-15,-68],[-26,-1],[-28,39],[-30,17],[-62,69],[-59,124],[9,18]],[[83868,61521],[-22,-19],[-3,57],[13,23],[12,-61]],[[83251,63146],[21,31],[23,-45],[12,-113],[-31,19],[1,49],[-26,59]],[[83253,58381],[5,17],[29,-30],[-9,-72],[6,-22],[-25,-37],[-11,10],[7,60],[-11,61],[9,13]],[[83244,56917],[-21,-37],[-13,28],[13,28],[21,-19]],[[82505,56817],[29,33],[3,-59],[-32,26]],[[81327,55597],[10,-58],[-13,-52],[-12,22],[-1,75],[16,13]],[[80354,54177],[-18,-23],[-14,25],[28,100],[40,-27],[32,-11],[3,68],[22,38],[32,3],[9,-24],[28,-19],[19,33],[27,-30],[47,86],[21,-28],[10,33],[18,10],[55,-72],[0,59],[7,32],[29,17],[6,-47],[15,-37],[49,-30],[13,-114],[-4,-125],[-33,-85],[-16,-22],[-16,-53],[-22,-27],[2,-45],[-22,-89],[-9,-106],[-13,-36],[-3,-73],[-10,-12],[17,-62],[-20,-18],[-15,-76],[-35,6],[-23,-36],[-24,-55],[-10,-63],[-30,-31],[-16,3],[-26,-26],[-14,10],[-13,-68],[7,-31],[-32,-20],[-6,-25],[-50,69],[-28,12],[-48,-8],[-6,42],[-21,12],[-19,-9],[-8,33],[-23,15],[-15,32],[-38,27],[-4,31],[9,83],[-8,89],[-14,24],[9,83],[-12,115],[18,56],[-13,29],[1,56],[13,54],[15,4],[36,58],[38,89],[50,53],[26,74]],[[80698,55199],[25,-6],[-8,-49],[-12,-12],[-5,67]],[[80647,55058],[-22,-20],[-10,22],[31,60],[19,15],[8,-26],[35,4],[-7,-58],[-31,14],[-23,-11]],[[90033,71643],[-7,-62],[44,7],[12,-40],[37,-31],[39,-14],[62,8],[32,52],[68,128],[52,103],[7,-44],[-34,-140],[-25,-62],[-17,-66],[-10,-76],[22,-95],[15,-18],[15,-75],[5,-62],[19,-109],[45,-12],[8,28],[31,46],[39,16],[8,-22],[-66,-58],[-10,-67],[-64,-11],[-52,-40],[-6,-47],[-32,-50],[-7,47],[-23,18],[-24,-13],[-15,-42],[15,-44],[-42,13],[-40,-9],[-36,42],[-25,3],[-63,-46],[-36,-49],[-82,-153],[-48,-122],[-32,-124],[-5,-38],[7,-59],[-6,-89],[-32,-69],[-16,47],[-48,67],[-42,18],[-41,36],[-24,37],[-29,22],[-56,73],[-29,60],[-40,18],[-37,69],[-24,21],[-49,19],[-47,-32],[-32,-37],[-69,-101],[-30,-70],[-17,24],[-17,91],[-44,85],[-39,-8],[-26,13],[-26,-53],[-24,-99],[-5,-66],[5,-29],[26,-15],[37,-70],[16,-12],[35,21],[15,-15],[17,-59],[24,-36],[15,-49],[51,-43],[-9,-49],[-29,-52],[-60,41],[-26,32],[-21,-9],[-6,-45],[-44,-44],[-7,-111],[-43,-30],[-18,-62],[-33,18],[-14,29],[-13,99],[7,65],[32,96],[3,104],[-32,105],[-27,12],[-16,61],[-18,8],[-9,52],[24,116],[-8,94],[16,55],[44,13],[25,40],[16,58],[33,0],[31,83],[28,33],[3,24],[-30,89],[-27,55],[9,74],[25,7],[11,28],[43,-79],[38,-29],[4,-21],[62,32],[0,-33],[40,-35],[53,66],[21,67],[1,65],[-19,67],[7,54],[-16,90],[17,65],[48,39],[18,44],[10,77],[-5,205],[26,75],[15,161],[-5,91],[-14,105],[-38,167],[-5,62],[38,116],[43,30],[8,51],[18,4],[26,-83],[33,-43],[27,-71],[67,-145],[64,-200],[43,-78],[28,-67],[96,-133],[14,-37],[84,-81],[9,-63],[66,-16],[3,23],[42,-11]],[[88189,64873],[-40,-19],[-55,-41],[-31,3],[8,40],[17,-11],[55,81],[-5,41],[-21,10],[-10,-24],[-45,-6],[-27,51],[-4,-56],[-21,-5],[8,54],[-13,48],[12,96],[-51,-24],[-9,-73],[-25,-82],[-10,-74],[8,-53],[72,-75],[32,-46],[-13,-52],[4,-68],[-13,-19],[-23,8],[-1,31],[-24,6],[-19,-38],[-12,18],[-42,-56],[-29,-19],[-16,-55],[-1,-47],[-14,-85],[-24,-21],[-10,-28],[-44,-216],[-52,-52],[-59,33],[-35,54],[-12,59],[14,24],[-21,36],[-37,38],[-9,43],[-20,27],[-2,46],[26,41],[-20,40],[22,68],[-19,29],[-10,50],[42,36],[31,62],[21,91],[8,59],[-9,37],[-33,1],[-11,-33],[-55,-19],[-15,-71],[-26,-76],[-2,-50],[16,-59],[-62,-56],[-24,-9],[-10,-40],[-4,-80],[13,-1],[17,-63],[-13,-28],[21,-41],[-44,-45],[-17,-44],[-33,-35],[-8,-45],[-29,-73],[-13,-65],[-8,-105],[-40,88],[-2,29],[-20,22],[-7,33],[-56,36],[-49,-25],[-42,-73],[-34,-19],[-7,-31],[0,-77],[-25,-56],[-21,-81],[-23,-18],[0,-92],[-16,-15],[-2,-56],[-26,3],[-17,-27],[-19,34],[-19,-11],[5,61],[-7,45],[-46,31],[-3,85],[-9,57],[29,34],[-14,55],[-33,22],[10,96],[-28,10],[30,52],[26,61],[27,26],[26,64],[-3,58],[6,51],[12,2],[5,62],[42,50],[4,44],[22,0],[9,94],[26,41],[-17,21],[-52,-13],[-33,-51],[-38,-38],[-34,39],[-5,65],[-25,12],[-19,-19],[-30,-60],[5,-64],[-13,-29],[3,-87],[25,-53],[-10,-38],[-41,-1],[-66,76],[-25,52],[-44,-5],[-25,-34],[-28,-5],[-13,25],[-29,-67],[-32,0],[-3,33],[-19,40],[-23,-5],[-5,-28],[-24,-22],[0,74],[-13,30],[20,60],[-15,77],[5,48],[34,10],[15,35],[25,-38],[44,15],[19,18],[19,49],[-1,28],[26,36],[14,61],[60,24],[22,59],[26,37],[32,85],[35,61],[22,19],[26,80],[39,64],[23,21],[10,30],[-1,82],[48,43],[54,26],[18,41],[16,-27],[28,-9],[20,-58],[28,-5],[7,25],[40,27],[21,-18],[35,-4],[102,22],[36,39],[44,31],[25,29],[109,-15],[27,30],[16,35],[35,18],[17,-16],[-1,-54],[-16,-50],[21,-58],[41,53],[28,-73],[26,35],[10,-34],[20,3],[33,63],[32,29],[-5,72],[18,29],[15,-74],[8,85],[-29,78],[-11,69],[15,35],[12,69],[11,18],[15,72],[20,17],[20,49],[33,50],[65,180],[26,105],[8,64],[1,70],[-13,38],[-2,67],[-9,45],[12,40],[-1,42],[33,55],[23,-4],[46,59],[46,37],[20,0],[9,-57],[-30,-16],[3,-72],[-9,-22],[-37,-14],[-8,-42],[-16,-25],[-15,20],[-20,-33],[6,-54],[18,-30],[21,43],[-4,-132],[-14,-38],[28,-62],[27,-19],[42,4],[17,32],[9,84],[18,21],[45,19],[67,53],[43,53],[14,33],[32,-4],[18,23],[44,87],[32,38],[18,72],[27,60],[14,60],[10,81],[23,67],[52,73],[42,27],[35,66],[22,70],[6,39],[2,112],[25,106],[19,99],[37,72],[35,211],[5,95],[10,62],[20,44],[12,107],[4,163],[-20,101],[-35,20],[-12,-27],[-21,10],[-13,85],[30,-24],[27,40],[26,118],[9,101],[-4,41],[-18,28],[-5,166],[18,64],[17,25],[18,-20],[33,33],[12,51],[9,73],[7,214],[30,-50],[28,26],[27,-38],[-3,-55],[12,-150],[17,-41],[16,5],[18,37],[0,60],[25,15],[13,-40],[28,-45],[14,4],[15,41],[21,160],[-10,53],[-23,30],[-28,-66],[-81,-27],[-1,35],[21,157],[17,45],[2,45],[30,-40],[27,-15],[24,-57],[28,-24],[27,21],[2,-99],[-5,-183],[11,-202],[16,-102],[25,-14],[31,-65],[24,-76],[23,-126],[-8,-50],[36,-83],[-4,-49],[10,-32],[3,-132],[13,-82],[11,-18],[-33,-54],[-4,-62],[10,-49],[-19,-6],[12,-60],[-24,-23],[11,-55],[-26,-10],[1,-32],[-53,-55],[12,-62],[-21,-7],[0,-36],[-21,-50],[4,-92],[-18,-39],[8,-36],[0,-66],[13,-97],[-23,6],[-7,60],[-49,8],[-23,-24],[-25,4],[-15,-75],[-20,-67],[-12,-110],[2,-81],[15,-64],[13,-117],[5,-129],[-1,-86],[-9,-113],[-1,-68],[-14,-111],[-37,-32],[-24,-125],[-4,-55],[-17,-62],[-12,-71],[2,-83],[-16,-46],[4,-90],[11,-73],[37,-151],[19,-63],[-5,-43],[-43,-19],[-42,-77],[-22,-75],[-7,-61],[7,-53],[-8,-90],[-16,-34],[-59,-20],[-12,-39],[-27,-42],[-16,-66],[-20,-3],[-9,29],[7,139],[-5,38],[13,22],[-15,61],[23,84],[32,45],[20,80],[-23,49],[-13,5],[-16,-40],[-24,17],[-14,-15],[14,-57],[-45,-107],[-4,-66],[27,-25],[-1,-37],[-20,-20],[-24,79],[-38,18],[-27,-4],[-36,-27],[-16,-27],[-20,-138],[8,-55],[11,-12],[-3,-53],[-13,-15],[-8,-52],[-22,-54],[0,-40],[-42,-35],[-24,73],[9,34],[-5,92],[8,102],[32,0],[-16,53],[-28,25],[-46,-17],[-22,-67],[3,-29],[-41,-44],[-7,-65],[-33,-82],[-7,-78],[-38,35],[-38,12],[-31,-15],[-62,24],[-27,-4]],[[89234,72351],[-23,26],[-9,55],[16,30],[22,-15],[17,-62],[-23,-34]],[[88824,63786],[24,-58],[-10,-13],[-18,33],[4,38]],[[88726,70261],[29,30],[-7,-106],[-20,-7],[-2,83]],[[88709,64917],[22,24],[1,-65],[-23,41]],[[88451,67440],[8,39],[16,17],[-6,-92],[-16,-83],[38,-20],[-20,-97],[-38,-67],[-16,-3],[-7,57],[18,43],[-10,28],[-21,-23],[0,62],[27,99],[27,40]],[[87006,66049],[15,19],[29,-53],[-12,-68],[-26,1],[-15,30],[9,71]],[[86789,64566],[15,14],[-2,-83],[-29,56],[16,13]],[[86225,63675],[3,35],[-14,48],[-24,20],[-10,31],[-29,-56],[0,-29],[22,-83],[-20,-36],[11,-41],[30,23],[21,-72],[-8,-76],[-50,-60],[-11,35],[22,71],[-8,40],[-26,0],[-36,-37],[-17,-58],[-29,-34],[7,91],[-19,58],[-13,8],[-21,104],[16,87],[-11,57],[-25,26],[9,56],[-15,13],[-25,-83],[-16,6],[17,105],[33,22],[39,-25],[44,40],[-22,34],[13,50],[17,20],[18,-13],[3,-53],[44,39],[14,86],[20,-22],[41,3],[-5,51],[20,38],[1,54],[8,33],[42,25],[19,40],[37,7],[23,-38],[13,47],[16,1],[-8,-80],[3,-67],[22,-88],[34,-13],[17,-24],[39,-8],[26,71],[24,13],[20,-14],[21,-63],[-3,-86],[-6,-40],[-29,-41],[-27,8],[3,-67],[22,-15],[25,24],[35,-27],[22,18],[-21,-100],[19,-13],[18,-40],[-15,-44],[26,-57],[0,-63],[-27,-27],[-3,-36],[-26,-44],[-12,-61],[-16,-36],[12,-36],[-20,-24],[-8,-83],[-11,-40],[-31,-242],[-5,-93],[9,-28],[-10,-70],[5,-26],[-19,-46],[-8,-110],[-33,-34],[-11,49],[-26,19],[-22,-36],[-7,-47],[25,-18],[-11,-77],[-13,1],[-11,-56],[-29,-39],[-12,-1],[-43,-43],[-5,27],[24,43],[3,57],[9,27],[5,61],[-13,58],[-47,125],[25,29],[24,-47],[16,68],[-8,31],[-37,19],[-27,-92],[-14,-102],[14,-97],[28,-41],[-11,-61],[-32,-4],[-12,52],[-51,13],[-15,-10],[-5,68],[4,40],[22,52],[8,87],[-5,45],[-42,97],[16,84],[-12,66],[8,40],[-26,48],[-2,63],[23,-11],[5,-29],[28,-36],[15,32],[8,51],[21,45],[5,53],[24,56],[-3,71],[9,61],[-40,1],[44,64],[-7,91],[-37,50],[-10,67]],[[86378,61847],[5,-37],[-30,-41],[-5,73],[27,100],[-3,62],[15,38],[2,43],[23,-2],[-10,-95],[2,-33],[-16,-41],[-10,-67]],[[86238,61831],[32,1],[27,-42],[-5,-54],[-19,-42],[-39,-2],[-14,61],[-3,51],[21,27]],[[86208,63244],[-36,7],[-5,29],[31,47],[40,2],[-12,-70],[-18,-15]],[[86143,63345],[17,5],[11,-113],[-3,-41],[-21,-33],[-16,-56],[-23,-11],[-7,35],[3,61],[19,131],[20,22]],[[86052,64220],[-27,-36],[-11,67],[14,41],[24,-72]],[[85943,60361],[32,18],[9,39],[31,28],[13,-16],[2,-41],[-27,-15],[-21,-67],[-21,-7],[-17,-101],[-22,-14],[-30,65],[1,52],[50,59]],[[85948,64881],[21,-31],[-9,-75],[-24,-64],[3,-116],[-15,-8],[-15,-106],[-13,-21],[-16,20],[7,113],[27,24],[-5,109],[15,53],[-2,76],[26,26]],[[85862,63738],[-4,-74],[5,-33],[-12,-57],[-19,63],[14,30],[16,71]],[[85805,59910],[-3,93],[22,7],[-1,-50],[20,-38],[-14,-71],[-14,-7],[-10,66]],[[85774,63392],[-28,-4],[-11,69],[2,58],[25,-24],[12,20],[28,-93],[-28,-26]],[[85487,58864],[-11,78],[42,77],[27,22],[5,32],[-24,20],[-9,29],[11,32],[16,6],[18,-57],[15,12],[10,42],[28,59],[14,53],[16,-55],[-14,-80],[-11,-29],[-21,0],[-5,-54],[-25,-25],[-30,-56],[-16,11],[-14,-29],[18,-61],[-18,-6],[-19,-87],[18,-27],[-30,-54],[-19,-4],[-5,83],[13,41],[20,27]],[[84795,57875],[12,-48],[41,-81],[-42,-16],[-13,64],[11,32],[-9,49]],[[84536,57653],[1,-24],[-24,-79],[0,-74],[-23,-20],[-15,25],[8,65],[23,-1],[2,31],[17,29],[11,48]],[[84411,57499],[13,-45],[-18,-52],[-8,12],[-43,7],[13,38],[7,49],[36,-9]],[[86177,70649],[5,-19],[9,-4],[2,-16],[3,-10],[1,-3],[2,-5],[8,-8],[1,-3],[4,-7],[1,-4],[1,-12],[2,-1],[2,-2],[2,0],[4,8],[4,2],[-3,-33],[6,-11],[2,-1],[3,-3],[8,13],[-5,18],[-1,6],[0,0],[1,4],[6,12],[2,1],[6,-4],[2,-6],[-4,-17],[5,-31],[7,-12],[-1,-15],[1,-2],[0,-5],[2,-4],[6,-2],[1,-4],[0,-3],[-3,-2],[-3,-4],[1,-18],[3,-8],[10,1],[11,-19],[0,-10],[2,-1],[1,-13],[-6,-17],[10,-44],[-13,-11],[-15,33],[-27,17],[-50,-72],[-25,-57],[-6,-37],[-29,-15],[-31,-93],[-17,-31],[-18,-96],[-22,-13],[-32,-151],[4,-65],[27,-54],[7,-40],[-16,-59],[-5,-85],[2,-101],[9,-28],[-10,-83],[-40,5],[-16,-32],[-23,-10],[-62,-66],[-15,-102],[-21,-49],[-32,-20],[-24,-51],[-66,-46],[6,-80],[-40,-49],[-41,-29],[-23,-38],[-36,-15],[-33,21],[-12,-8],[-33,-70],[0,-32],[-35,-31],[-32,-16],[-35,-67],[-3,-65],[18,-47],[-14,-44],[7,-97],[-26,-13],[-20,-64],[1,-49],[20,-40],[44,2],[17,-39],[23,18],[28,-102],[14,-18],[30,-75],[23,-12],[22,-47],[5,-37],[22,11],[24,-46],[1,-41]],[[85654,67700],[-13,-19],[0,-57],[-8,-53],[-41,-74],[-24,-18],[-47,17],[-16,-20],[-14,23],[-23,-9],[-31,9],[-22,-26],[-32,26],[-23,-17],[-16,16],[-54,-54],[-23,-50],[-7,-41],[-16,-21],[-19,-75],[-30,-33],[-4,-79]],[[85191,67145],[-26,-50],[-48,59],[-8,29],[-37,-39],[-29,-2],[0,-67],[-19,7],[-10,46],[-41,21],[-28,97],[-16,26],[-49,5],[11,-30],[25,-14],[0,-47],[-20,-12],[-2,-61],[-31,-12],[-12,-39],[-42,-10],[13,58],[22,32],[-17,23],[-25,-30],[-2,52],[-26,-19],[-29,4],[-24,44],[30,75],[-63,55],[-38,-16],[29,88],[14,111],[10,48],[23,43],[-6,52],[37,17],[18,83],[-13,49],[-2,61],[17,91],[26,79],[0,39],[28,71],[1,87],[-18,53],[20,68],[-37,-19],[-13,56],[-37,-28],[-11,47],[-40,14],[-6,42],[-32,22],[-3,-36],[-24,-50],[-29,80],[-4,61],[-31,2],[-27,32],[-10,31],[14,40],[0,85],[73,150],[24,18],[6,28]],[[99999,90904],[-56,-17],[-54,-58],[-99,1],[-114,-58],[-50,132],[-8,69],[58,59],[19,48],[69,29],[90,104],[86,25],[59,65],[0,-399]],[[74246,75229],[4,40],[-10,43],[-19,15],[-47,0],[-29,69],[1,51],[-26,23],[5,42],[-33,44],[-32,-2],[-5,27],[30,57],[20,71],[-52,15],[-3,-59],[-46,-83],[-40,-18],[-20,-84],[-24,42],[-42,-26],[-22,55],[-52,0],[-57,24],[-29,26],[-18,-31],[-31,26],[-2,84],[-15,16],[-25,85],[-22,18],[3,56],[12,45],[-64,69],[-14,-7],[-36,55],[-16,-13],[-32,37],[-26,-25],[-30,56],[6,20],[-19,105],[12,36],[-22,27],[-61,140],[8,23],[-40,71],[-33,8],[-10,26],[-48,34],[-16,25],[-64,-7],[-86,-65],[-37,12],[-16,-22],[-4,-59],[-38,-48],[-60,21],[-41,-29],[-34,11],[-18,26],[-36,13],[-24,-23],[-60,-22],[-37,10],[10,49],[-14,27],[-6,82],[-98,-20],[13,84],[11,16],[8,68],[-20,-2],[-51,28],[-3,28],[-64,42],[-12,-79],[-53,0],[10,-69],[-1,-104],[-28,-27],[-51,-20],[-2,-52],[-28,0],[-5,-57],[-166,576],[-78,266],[-131,363],[-127,362],[-59,147],[-39,110],[-176,243],[-111,141],[-93,124],[-29,89],[2,31],[56,-31],[32,27],[33,100],[-5,43],[20,69],[-56,-29],[-15,-51],[-56,-20],[-60,29],[-20,-41],[5,-29],[-168,-116],[-19,12],[-43,-33],[18,-45],[-18,-34],[-89,-117],[-22,19],[-52,4],[-9,-60],[-25,8],[-9,-63],[-49,17],[-10,-70],[19,-13],[-26,-82],[-29,22],[-1,49],[-60,50],[-48,15],[-22,-52],[-43,25],[-6,-43],[-57,-85],[-21,24],[9,38],[-44,33],[24,78],[9,65],[26,29],[1,49],[66,-14],[21,142],[-30,-5],[-39,-31],[-4,-46],[-63,2],[-58,31],[-21,81],[-107,27],[-10,-61],[30,-5],[10,-67],[-47,20],[-17,-56],[-32,31],[14,40],[-6,37],[12,49],[-40,48],[-5,94],[-26,27],[-31,-112],[-35,32],[-55,7],[-8,-105],[-65,-4],[1,41],[-54,19],[-33,-65],[-30,80],[1,49],[-21,44],[64,13],[-16,77],[-1,71],[35,77],[-55,32],[-19,84],[-20,42],[15,59],[-4,74],[-20,40],[-37,115],[-47,-26],[-40,14],[-21,-40],[-48,-50],[-47,44],[-30,1],[-24,64],[-43,37],[-84,1],[-58,-15],[-9,37],[-33,32],[-32,10],[-1,-88],[-50,43],[-25,-102],[-59,-29],[-45,6],[-26,-38],[23,-48],[-11,-83],[-56,-13],[-34,24],[-25,-9],[-13,-61],[-58,-30],[-64,20],[-14,-34],[-50,-9],[-201,-78],[-106,-57],[-4,66],[-38,-14],[-28,-64],[-31,24],[-39,-31],[-52,-21],[-26,-27],[-3,-47],[9,-63],[-32,-34],[-39,63],[-67,-46],[-42,12],[-40,-27],[-39,1],[-59,-15],[-30,-28],[11,-31],[-30,-24],[-32,52],[-95,-53],[-35,4],[-50,-14],[1,-43],[-20,-13],[-72,8],[-39,-16],[-31,-33],[8,-37],[-13,-45],[-29,-4],[-15,55],[-17,20],[-91,-2],[11,-58],[-52,10],[-44,41],[-24,-21],[-37,29],[0,37],[-51,-6],[-32,-73],[-22,2],[-29,-28],[17,-29],[22,7],[25,-78],[-31,-54],[-60,-67],[62,-9],[25,-37],[40,-1],[10,29],[44,-7],[4,-39],[-13,-46],[-25,-13],[-38,42],[-19,-21],[-19,-57],[6,-67],[13,-20],[48,-7],[36,-43],[29,6],[12,30],[31,-58],[36,-30],[31,0],[26,-22],[3,-87],[-47,-29],[-29,35],[-43,0],[-20,-32],[-21,42],[-24,17],[-22,-32],[-39,32],[-35,-35],[-13,-43],[-53,-69],[-15,-42],[-33,-6],[1,-73],[35,-17],[0,-84],[39,-10],[2,-60],[21,-55],[-32,-55],[-46,-29],[-19,-53],[-57,0],[-49,-74],[-38,-44],[-54,1],[8,-57],[36,-15],[71,-65],[28,-3],[-28,-61],[-1,-47],[35,-21],[110,-2],[-7,-44],[25,-61],[29,-14],[27,9],[84,-39],[12,-60],[39,-48],[-33,-13],[-33,-310],[-178,-107],[-135,10],[-39,77],[1,43],[-48,-11],[-11,-37],[6,-69],[-23,-27],[-28,-73],[-82,-6],[-16,11],[-11,68],[-85,33],[-67,12],[-27,83],[-51,38],[-4,51],[18,34],[-34,70],[-38,-7],[-17,63],[-33,-25],[-10,-47],[-83,26],[-27,28],[-5,-58],[2,-97],[-55,10],[-15,-43],[-51,49],[-39,123],[-11,-20],[-73,-20],[-27,25],[-24,-14],[14,-64],[-32,-1],[-35,70],[-17,-18],[4,-66],[-45,-45],[-33,25],[-13,-78],[1,-54],[-23,-41],[-109,-97],[-35,38],[-9,41],[-33,-12],[-66,102],[-25,17],[20,42],[-65,31],[1,27],[-50,49],[-33,1],[-6,-64],[33,-34],[-5,-125],[15,-70],[-33,-59],[-20,-8],[-36,67],[15,104],[17,46],[-24,35],[-42,16],[-23,43],[-19,106],[-31,39],[-61,37],[-17,-8],[-42,73],[1,65],[-58,68],[-38,15],[-28,-18],[-51,-13],[-35,26],[-78,-35],[-31,120],[-32,86],[-26,-14],[-42,-47],[-55,18],[-34,-72],[12,-61],[-44,-35],[-4,64],[-58,-45],[-40,9],[-1,31],[27,23],[-1,56],[-49,18],[-86,11],[-7,52],[-27,14],[12,-74],[-23,-30],[-26,0],[-27,-28],[2,-89],[-14,-27],[-44,-33],[10,-36],[-37,-37],[-56,-21],[-36,-36],[-37,-67],[-59,2],[-47,-14],[-15,-74],[19,-19],[3,-80],[-82,-46],[-32,-73],[-54,-63],[-45,4],[2,-52],[20,-195],[21,-62],[-12,-51],[23,-6],[15,-52],[-43,-69],[-82,-62],[-52,16],[-37,101],[-10,72],[-24,31],[-20,75],[-30,59],[-18,8],[-42,88],[-39,-30],[-18,-61],[-30,-24],[10,-46],[-22,-33],[27,-70],[-47,-115],[-78,-51],[-13,-158],[-21,-217],[60,-78],[15,-47],[-6,-55],[-38,-77],[-31,-22],[-80,-372],[71,-57],[104,-60],[1,-80],[-10,-39],[31,-35],[-42,-41],[36,-103],[-16,-16],[20,-51],[53,-57],[8,112],[67,-57],[127,-9],[27,-39],[32,-104],[35,-96],[19,0],[53,-226],[57,-156],[22,-98],[-21,-35],[-47,-6],[-10,25],[-45,-23],[6,-58],[-8,-33],[44,1],[24,-15],[10,-44],[47,-36],[16,-26],[31,-7],[42,-80]],[[63698,73190],[5,-92],[-24,8],[2,-96],[-11,-22],[-32,50],[-23,19],[1,-88],[-43,-38],[-27,-46],[1,-41],[-12,-124],[-44,5],[1,33],[-30,10],[-19,-65],[-14,25],[-17,73],[-15,-36],[-24,-14],[-6,-64],[-24,23],[-14,-174],[-13,17],[11,51],[-73,39],[-5,74],[-41,-8],[-4,-57],[-31,-44],[-12,-36],[9,-31],[-28,-50],[-10,-41],[1,-49],[-22,-72],[-1,-36],[-27,-80],[-9,-51],[-28,56],[-7,-62],[-21,-62],[-28,-22],[-17,-41],[-7,-135],[26,-70],[64,-3],[21,-87],[17,-28],[27,-2],[14,-83],[23,-56],[23,-129],[26,-24],[5,54],[34,-4],[-29,-118],[-27,-215],[-1,-57],[18,-46],[-12,-40],[-11,-105],[1,-36],[26,-32],[42,-92],[2,-94],[20,-67],[20,-8],[41,-147],[28,-52],[36,-131],[12,-21],[21,-108],[36,-35],[28,-47]],[[63497,70013],[-46,-130],[-12,-48],[-27,-22],[-13,-30],[-45,-16],[-18,-47],[-14,-85],[-19,-16],[-2,-53],[-29,-24],[-45,37],[-17,-28],[-24,42],[-26,11],[-33,47],[-1,45],[-27,71],[-15,67],[-15,-27],[-61,149],[-38,52],[-40,-8],[-4,42],[-31,21]],[[62895,70063],[-40,25],[-12,46],[-39,-12],[-31,37],[-15,-9],[-9,53],[-31,-3],[-11,31],[-38,46],[16,52],[20,8],[-1,61],[13,49],[-26,41],[-75,34],[-18,-21],[-20,60],[-35,73],[-34,-11],[-15,38],[-26,1],[-5,-40],[-20,-52],[-16,79],[-19,15],[-44,3],[-6,-36],[-45,12],[-22,-28],[-7,-36],[-59,-29],[-14,-31],[-34,36],[-24,2],[15,87],[-13,32],[-30,20],[-25,53],[-25,16],[-32,-1],[-42,29],[-47,72],[-1,45],[-48,62],[-32,5],[-22,-34],[-53,46],[-17,39],[-22,-27],[-33,8],[-49,-31],[-38,30],[-27,-20],[-22,30],[-30,-16],[-21,36],[-36,38],[-53,40],[-51,14],[-105,117],[-26,-31],[-24,20],[-61,27],[-47,-22],[-23,-121]],[[61113,71120],[-27,29],[-9,52],[-41,50],[-9,35],[-66,122],[-49,115],[-28,39],[-48,107],[-40,32],[-21,61],[-61,49],[-103,49],[-41,98],[-23,17],[-11,51],[-35,57],[-3,-46],[-19,-11],[-50,19],[-38,46],[-31,107],[-5,51],[-29,41],[-71,59],[-51,7],[-29,23],[-9,38],[39,18],[67,44],[-11,35],[-38,-18],[-12,79],[23,26],[47,-47],[57,-38],[56,-4],[30,37],[18,44],[3,144],[10,30],[55,56],[23,144],[16,54],[29,15],[18,-14],[12,61],[18,31],[57,-89],[35,5],[-5,47],[-61,66],[-54,116],[-22,24],[-45,6],[-28,93],[-1,78],[29,-11],[39,8],[22,33],[43,11],[12,-30],[49,-16],[26,29],[-7,31],[-46,21],[1,39],[24,51],[18,-18],[37,10],[42,30],[5,25],[30,20],[26,37],[34,6],[21,29],[24,58],[-43,92],[-28,3],[-43,-21],[1,-43],[-41,-17],[-69,-41],[-24,29],[-65,-28]],[[60619,73797],[8,86],[-11,48],[23,62],[-5,109],[18,52],[30,20],[44,0],[15,39],[33,27],[0,57],[26,43],[56,-5],[18,-19],[26,17],[65,-4],[12,-25],[61,1],[15,31],[6,93],[19,29],[-3,54],[18,46],[2,36],[21,17],[-21,68],[-26,158],[-44,12],[11,124],[19,60],[49,-35],[5,54],[-19,19],[-27,-5],[-38,116],[68,23],[26,70],[13,5],[30,68],[3,44],[-46,79],[3,49],[36,34],[-10,34],[-51,-14],[-17,-28],[-23,0],[-41,41],[-19,75],[-31,26],[-28,-12],[-26,12],[-29,95],[-32,-52],[-40,-8],[-7,47],[-42,19],[-16,47],[-94,32],[-6,56],[-41,-4],[12,-72],[-14,-27],[-32,-13],[-38,81],[-45,30],[-40,98],[3,56],[-39,46],[-6,53],[-36,4],[-42,-52],[-68,-10],[-47,-35],[-34,-60],[-24,24],[-20,43],[-53,-14],[-38,99],[-26,15],[-54,-20],[-11,8],[-26,-57],[-31,0],[-11,68],[-31,29],[-24,109],[22,28],[5,69],[-21,20],[-7,85],[-15,8],[-6,102],[-27,-22],[-25,86],[4,37],[-52,7],[-37,-42],[-66,46],[-54,29],[-22,-25],[-19,39],[21,30],[-25,67],[23,60],[-39,96],[15,41],[56,14],[-2,74],[-31,45],[-16,-5],[-16,62],[-25,26],[-5,48],[10,50],[-17,22],[-31,80],[-34,58],[-60,-21],[-62,27],[-12,-15],[-47,16],[-30,-45],[-48,-47],[-34,8],[-60,51],[-54,0],[-2,-104],[-16,-57],[-62,-49],[-38,40],[-41,15]],[[58828,77377],[0,54],[-43,74],[0,68],[-13,94],[10,43],[-33,86],[29,35],[-10,38],[-54,97],[-11,113],[25,86],[34,-14],[24,29],[44,-39],[12,-48],[22,-16],[54,-7],[54,36],[10,32],[31,25],[21,72],[63,19],[-3,90],[-38,13],[-49,93],[19,75],[-39,18],[-41,44],[-60,4],[-34,-16],[-27,29],[33,103],[-2,74],[-30,31],[-59,17],[-35,51],[-34,28],[2,65],[-24,91],[-41,31],[33,86],[-8,31],[-46,3],[-15,44],[-57,50],[23,72],[53,112],[-9,59],[-25,79],[-23,17],[4,42],[28,46],[-8,36],[13,39],[-6,85],[-46,-24],[-10,50],[-55,64],[-14,45],[-31,-3],[-27,40],[-39,-22],[-43,28],[-24,-7],[-16,-43],[-60,-17],[-38,-51],[-34,42],[14,78],[19,31],[-25,40],[-49,11],[-35,32],[-97,-47],[-34,94],[-18,11],[-69,-37],[-42,76]],[[57819,80287],[25,73],[-21,74],[8,48],[-28,50],[10,51],[-24,6],[-8,59],[-32,56],[19,54],[-33,39],[-52,-33],[21,61],[9,61],[-3,91],[17,8],[13,110],[-73,86],[-24,6],[14,65],[-19,18],[-41,-16]],[[57597,81254],[-9,44],[24,24],[-8,39],[36,71],[13,47],[52,-3],[21,25],[-44,67],[-15,116],[-31,77],[-1,56],[18,45],[-54,302],[103,132],[21,109],[41,106],[50,14],[20,62]],[[57834,82587],[-44,66],[14,88],[-27,73],[28,69],[26,-13],[8,-61],[39,-16],[20,19],[1,73],[22,34],[66,-47],[60,28],[24,33],[1,70],[25,16],[51,-1],[111,-31],[80,-53],[29,0],[30,35],[-15,54],[-60,18],[-11,97],[-57,29],[-50,5],[-26,-23],[-94,5],[-31,48],[-114,103],[32,78],[-37,61],[24,78],[-71,-22],[-33,-54],[-61,-44],[-62,5],[-11,18]],[[57721,83425],[21,42],[73,98],[108,155],[37,-4],[15,67],[30,55],[115,105],[24,57],[51,82],[66,82],[21,57],[64,84],[72,137],[82,128],[149,215],[23,41],[35,104],[25,101],[41,89],[-34,83],[-55,65],[-7,73],[-72,65],[-13,34],[-40,36],[-85,44],[-27,56],[-39,45],[-76,107],[80,47],[17,61],[57,101],[7,60],[-24,52],[5,41],[-122,100],[4,35],[-19,99],[40,44],[-22,46],[-3,57],[-85,-2],[-26,54],[-13,93],[8,47],[54,60],[11,51],[-63,11],[-9,21],[40,62],[-3,90],[36,63],[-40,55],[83,43],[33,-20],[-19,162],[-20,60],[-21,107],[-63,109],[-49,155],[-44,101],[-67,118],[-24,89],[11,51],[123,204],[36,39],[79,134],[24,108],[-99,93],[-92,195],[-189,87],[-59,246],[75,139],[27,98],[-93,11],[8,32],[120,88]],[[58035,89525],[36,-26],[51,70],[20,89],[-8,40],[32,22],[47,-5],[80,76],[29,-12],[43,45],[30,132],[81,-81],[80,-8],[37,23],[2,88],[-34,75]],[[58561,90053],[47,-4],[135,-77],[58,21],[25,91],[73,-13],[-36,95],[51,-5],[119,-78],[1,-27],[107,-15],[47,-46],[2,-48],[-74,-52],[-185,54],[4,-40],[75,-24],[16,-50],[149,-23],[0,-54],[75,32],[54,-13],[-3,-47],[-37,-46],[19,-42],[48,62],[93,1],[131,-11],[21,-25],[222,-43],[19,35],[146,-43],[49,-49],[66,-11],[33,-49],[61,-21],[58,-59],[204,-140],[127,-141],[134,-136],[35,22],[83,-77],[86,-69],[94,-94],[80,2],[140,-111],[-21,-34],[60,-72],[41,48],[36,-60],[28,11],[42,-70],[-8,-93],[30,-69],[-11,-110],[18,-28],[58,-16],[-15,-39],[13,-107],[-17,-23],[-17,-92],[-39,-64],[-70,-75],[-64,-92],[-12,-40],[-50,-50],[-55,-33],[-48,-57],[-60,-28],[-88,-24],[-102,-59],[-63,1],[-31,-21],[-135,-12],[-174,43],[-63,48],[-79,42],[-110,29],[-56,-5],[-170,55],[-107,23],[-95,60],[-84,90],[-43,5],[-24,-32],[-47,-13],[-29,34],[-2,50],[-128,22],[-64,86],[-25,1],[-14,-64],[-33,16],[-89,88],[-37,25],[-33,48],[-18,63],[-31,42],[-56,5],[-27,27],[-33,-32],[18,-51],[59,-28],[-14,-55],[13,-36],[62,-74],[54,-30],[-8,-33],[58,-28],[-28,-66],[7,-37],[54,11],[9,-25],[75,-27],[-16,-37],[45,-37],[24,-45],[55,-39],[41,5],[30,-47],[94,-68],[48,-70],[-6,-56],[37,-5],[-3,-57],[45,-17],[-23,-70],[-36,2],[-9,-42],[17,-36],[-106,-153],[18,-79],[47,-52],[5,-62],[33,-14],[3,-63],[-33,-27],[64,-49],[7,-61],[-42,-40],[18,-46],[41,-43],[-58,-76],[49,-14],[7,-46],[36,-11],[6,-39],[52,-38],[40,3],[64,37],[63,-68],[9,-55],[35,10],[46,-143],[112,-66],[157,-28],[10,-43],[52,-22],[50,24],[5,45],[61,6],[42,34],[18,55],[-20,97],[-30,46],[32,53],[-61,59],[-26,52],[-25,-60],[-42,17],[-31,-28],[-52,31],[-65,100],[-45,108],[-51,33],[-13,82],[-23,64],[55,-16],[52,51],[4,127],[56,13],[102,-50],[69,-46],[9,-47],[53,-55],[53,-31],[77,-2],[51,-51],[91,-24],[75,-60],[41,-9],[75,-77],[42,-1],[30,57],[71,-2],[18,-42],[54,-1],[23,-24],[50,-6],[7,-28],[60,-22],[22,-62],[33,12],[-16,42],[-126,73],[-9,65],[12,24],[0,73],[-41,41],[10,28],[-37,86],[4,23],[-71,78],[-55,118],[-33,40],[-3,112],[18,61],[27,36],[84,49],[84,82],[45,90],[35,39],[61,12],[99,40],[69,63],[49,67],[25,56],[33,33],[36,85],[57,15],[79,-47],[3,-35],[73,-1],[110,13],[25,-52],[52,-22],[51,-85],[43,-6],[17,-52],[58,-9],[-22,71],[21,106],[40,93],[25,21],[5,64],[24,55],[-33,82],[34,29],[2,69],[-54,106],[-69,70],[-44,-6],[-33,30],[9,110],[31,108],[27,62],[32,113],[-11,67],[57,40],[-42,76],[23,155],[-9,63],[-48,54],[-127,101],[-63,65],[24,43],[180,-100],[138,13],[94,1],[162,-20],[85,-38],[65,-100],[75,-103],[57,-37],[11,-93],[43,-82],[-3,-59],[-108,4],[-126,-43],[-106,-9],[-48,-36],[13,-23],[-10,-61],[-37,-1],[-60,-72],[-11,-97],[55,-57],[114,-60],[75,-195],[61,-56],[41,0],[105,30],[30,-36],[120,31],[100,43],[37,-6],[46,72],[2,102],[-20,25],[34,47],[-7,59],[43,66],[2,33],[-29,70],[49,42],[36,-10],[58,36],[31,-23],[54,41],[47,-5],[-6,113],[53,-9],[45,14],[185,115],[40,4],[24,49],[172,159],[28,36],[83,-8],[81,44],[43,8],[8,48],[65,10],[75,30],[71,-60],[-1,-31],[-38,-41],[33,-30],[37,11],[81,66],[13,41],[-49,34],[-8,64],[-39,-24],[-30,15],[211,147],[-2,-37],[-51,-45],[1,-23],[63,-19],[-18,52],[35,22],[-16,58],[115,67],[131,-52],[-71,-135],[8,-48],[33,-32],[16,-55],[-11,-58],[-44,-22],[-86,9],[-64,-65],[-4,-74],[-39,-42],[-17,-86],[-71,-47],[-3,-26],[-117,-86],[86,22],[69,34],[51,40],[-7,31],[72,-11],[-60,-70],[-122,-68],[-90,-62],[-45,-43],[-18,-5],[15,-22],[23,29],[10,-7],[21,7],[5,-14],[25,-1],[10,8],[14,32],[14,-2],[6,-8],[17,27],[33,8],[56,-21],[52,39],[20,58],[70,9],[1,19],[65,44],[105,120],[23,38],[21,94],[81,46],[39,-85],[55,-12],[19,79],[-22,26],[32,77],[100,94],[120,28],[57,48],[63,-34],[57,-9],[56,27],[121,-70],[75,7],[41,32],[10,45],[46,70],[49,32],[55,14],[76,48],[155,77],[42,-17],[119,-143],[-6,-61],[-67,1],[-26,-86],[21,-25],[-13,-82],[75,-23],[82,-40],[51,41],[33,60],[-41,86],[-4,59],[33,31],[31,-14],[84,6],[43,17],[61,70],[17,39],[35,18],[12,55],[-5,74],[-31,62],[-56,7],[3,56],[-96,152],[-29,70],[2,42],[34,36],[86,-1],[39,49],[-15,59],[45,33],[202,-72],[38,10],[81,-24],[198,-14],[107,-27],[171,-60],[158,-74],[162,-131],[-77,-105],[-62,-129],[80,61],[9,30],[56,55],[3,50],[33,4],[42,-39],[66,-33],[113,-36],[-38,-28],[97,-31],[79,-68],[111,-48],[65,-17],[53,-101],[42,-22],[100,-94],[27,-61],[37,-7],[73,-42],[23,-51],[-23,-69],[48,-17],[51,43],[36,118],[59,100],[65,213],[-34,13],[88,60],[-149,-40],[-58,27],[-123,200],[-23,89],[31,82],[-11,56],[-48,-34],[-33,9],[-31,56],[-54,26],[-35,-8],[-69,40],[-73,-37],[-18,74],[19,164],[42,4],[90,36],[10,61],[-26,67],[-46,30],[23,103],[54,1],[3,-12],[16,-14],[-8,-17],[15,-6],[9,11],[10,-4],[-5,-13],[18,1],[9,-1],[7,-5],[3,-2],[3,1],[11,15],[5,-18],[40,16],[-2,14],[6,7],[-1,5],[-14,4],[-46,-5],[-25,47],[-30,20],[-24,1],[-48,68],[12,56],[45,77],[-24,60],[-37,32],[-87,-40],[-50,15],[-24,48],[24,18],[35,73],[43,47],[-71,31],[50,120],[144,72],[78,-2],[-36,46],[96,64],[101,98],[65,152],[56,227],[27,165],[29,94],[18,100],[61,66],[41,112],[50,14],[5,-69],[184,17],[255,-10],[131,16],[309,-124],[-14,-86],[41,-241],[-34,-37],[-11,-58],[-31,-56],[-32,-121],[-34,-17],[-3,-111],[-41,-24],[-6,-50],[-86,-56],[9,-74],[42,-90],[73,-71],[70,-37],[23,-58],[-14,-36],[61,-96],[-11,-152],[-18,-68],[17,-37],[-2,-87],[-27,-10],[-70,-87],[56,-92],[-29,-76],[10,-51],[34,-61],[3,-93],[-44,-73],[38,-97],[-20,-77],[-65,50],[-15,-43],[75,-18],[19,-81],[-34,-53],[-2,-82],[24,-106],[52,-82],[89,-69],[94,-86],[48,-67],[-32,-38],[-14,-62],[-93,-111],[4,-48],[-14,-75],[39,-79],[0,-53],[-39,-46],[15,-51],[-55,-21],[-25,-52],[-71,-19],[-2,-53],[-35,-32],[5,-62],[-14,-55],[-49,6],[-50,-19],[42,-34],[11,-40],[-71,-57],[17,-47],[-67,-66],[-59,-13],[-41,18],[-29,-47],[-74,-62],[-55,7],[-45,-44],[-167,-15],[-31,44],[-94,6],[-45,29],[-45,2],[-46,47],[-51,-34],[-39,-2],[-13,-54],[-42,-22],[-54,10],[-48,42],[-53,-18],[-17,-24],[-58,-7],[-16,17],[-86,1],[14,-50],[-110,-60],[26,-43],[52,52],[40,-38],[62,-12],[36,-40],[86,-18],[95,78],[73,107],[89,11],[19,-33],[-14,-80],[89,-92],[79,-12],[47,-49],[133,-52],[162,18],[89,-3],[98,-24],[45,-56],[73,-5],[81,56],[14,29],[-13,71],[36,106],[108,27],[36,63],[136,74],[37,78],[64,41],[26,140],[-11,50],[60,132],[125,119],[46,60],[12,50],[9,145],[-8,50],[-49,134],[-84,103],[39,87],[-3,112],[8,43],[89,64],[194,79],[199,56],[110,-10],[27,-82],[-13,-74],[93,-79],[-15,-23],[76,-32],[23,-137],[-36,-38],[-1,-47],[50,-15],[-14,-58],[-25,-36],[-2,-104],[29,-47],[-18,-41],[-43,-41],[78,-61],[51,-22],[45,-61],[-19,-143],[-44,-29],[16,-35],[-28,-28],[76,-3],[31,-27],[-8,-6],[-8,-20],[20,-7],[14,-3],[2,6],[3,1],[2,0],[9,-1],[29,-27],[10,-18],[2,-34],[29,-11],[-6,-33],[-15,-25],[-48,-1],[9,-29],[-43,-33],[-9,-39],[20,-112],[23,67],[-29,82],[35,10],[31,51],[11,2],[28,44],[-8,23],[-20,12],[9,45],[-55,85],[13,69],[-16,23],[-26,24],[-4,58],[102,54],[31,-21],[70,12],[175,-184],[98,-66],[20,27],[-28,40],[3,39],[-95,126],[-60,48],[-87,44],[-20,37],[-51,41],[-13,29],[7,9],[-15,7],[-21,-6],[-1,-12],[5,-5],[0,-2],[2,-1],[6,-2],[-6,-5],[-1,-7],[-10,-10],[-11,-5],[-10,-27],[-1,-26],[-85,36],[-84,1],[-21,114],[19,26],[-16,49],[14,97],[43,54],[78,16],[56,27],[-56,82],[-12,103],[-41,11],[-19,56],[10,79],[-30,129],[-92,29],[-15,23],[-87,25],[-73,94],[-68,-9],[-13,22],[-98,64],[-56,-8],[-91,11],[-91,-65],[-31,-42],[-71,-18],[-77,38],[-82,0],[-51,-35],[-48,0],[-27,64],[36,140],[-17,97],[-51,72],[-36,102],[38,67],[32,168],[-30,32],[28,52],[67,85],[54,83],[25,74],[-2,62],[-34,83],[-71,85],[-4,86],[-45,46],[-42,121],[-78,88],[-85,55],[25,46],[86,89],[29,57],[-6,89],[37,33],[272,129],[79,65],[52,106],[-1,147],[-31,151],[-49,89],[57,58],[130,-90],[-39,-30],[92,-119],[-42,-30],[25,-106],[35,-52],[-40,-40],[-53,-198],[-32,3],[-11,-70],[16,-93],[55,-48],[-16,-57],[26,-38],[-27,-57],[-52,-10],[21,-70],[148,-76],[120,-20],[101,0],[81,-14],[145,-9],[90,-24],[22,-20],[22,-94],[163,-42],[-13,42],[1,90],[-51,-22],[-9,48],[17,68],[-34,25],[-80,22],[-64,-21],[-114,46],[-35,50],[-65,15],[-75,37],[-13,25],[-78,41],[-5,56],[-41,67],[-17,101],[72,84],[136,42],[130,-90],[62,-67],[68,-16],[93,40],[37,49],[-11,60],[-43,53],[-85,1],[-52,-29],[-39,36],[33,51],[43,3],[59,92],[76,29],[75,-15],[31,37],[264,-21],[128,-105],[241,-92],[-40,-19],[167,-151],[25,-62],[105,-44],[145,10],[121,42],[58,7],[75,-30],[38,-45],[-48,-77],[-48,-29],[13,-81],[-79,-32],[-136,-81],[19,-140],[-31,-28],[57,-199],[-56,-43],[0,-52],[-41,-31],[-49,-4],[-5,-20],[24,-27],[-11,-32],[2,-64],[-68,-27],[-32,-40],[-52,-4],[1,23],[-9,12],[-62,56],[-64,17],[-21,5],[-8,-3],[-18,-13],[15,12],[-7,8],[-11,-10],[3,-12],[4,-8],[-9,-6],[-2,-5],[2,-4],[15,-23],[30,-7],[93,0],[14,-18],[31,1],[-2,-22],[7,-9],[35,-3],[14,-43],[54,7],[86,67],[46,-14],[35,-77],[-35,-14],[-9,-47],[30,-76],[41,-4],[83,-57],[117,-23],[80,-51],[12,-47],[12,-9],[-2,-12],[2,-8],[8,-7],[5,-11],[87,-45],[15,-32],[18,-25],[45,-7],[-15,7],[8,11],[13,4],[11,8],[4,8],[49,18],[42,49],[141,85],[70,-25],[13,-46],[32,-17],[83,-80],[30,0],[-51,107],[-75,76],[-146,2],[-49,-14],[-81,-105],[-44,56],[-60,7],[-31,65],[-55,23],[-63,89],[-32,63],[-78,21],[5,54],[-54,103],[28,11],[89,-5],[40,19],[68,81],[5,57],[-57,138],[-18,109],[-37,104],[-58,40],[19,49],[-30,71],[66,87],[11,87],[57,47],[6,70],[-61,73],[-22,70],[-46,24],[-149,33],[-20,51],[-84,69],[21,75],[-33,49],[-122,50],[-160,21],[-93,49],[-36,60],[32,54],[-46,31],[-6,74],[43,45],[8,111],[-37,72],[-51,16],[30,85],[-10,50],[-72,25],[15,42],[72,44],[-34,55],[-3,45],[53,10],[172,6],[12,19],[262,34],[233,-8],[96,5],[178,40],[69,6],[112,33],[48,-37],[74,-6],[67,15],[14,58],[88,13],[75,34],[100,14],[153,-14],[8,-44],[-39,-14],[-75,-74],[-45,-9],[-34,-45],[110,-19],[102,26],[61,67],[97,31],[21,32],[-15,99],[-62,35],[-40,51],[-152,19],[-30,35],[20,50],[-48,42],[-69,20],[-81,3],[-49,35],[17,44],[97,30],[35,28],[57,-12],[4,50],[-79,38],[-3,21],[-133,6],[-14,69],[58,3],[47,60],[32,-54],[115,-21],[66,32],[18,59],[95,84],[89,18],[1,44],[-117,12],[-110,37],[88,34],[172,-27],[106,11],[20,41],[86,97],[80,49],[42,7],[39,52],[134,-20],[16,28],[77,13],[1,42],[92,25],[97,6],[16,27],[105,4],[55,-15],[91,46],[150,38],[62,-2],[76,25],[173,31],[48,43],[-80,99],[169,34],[21,25],[147,27],[36,-44],[46,10],[60,51],[60,-35],[90,33],[122,-10],[33,-20],[14,-77],[-122,-91],[56,-7],[49,49],[151,26],[32,-67],[83,31],[50,46],[50,-25],[63,31],[18,37],[101,54],[156,48],[226,12],[-41,-46],[73,-11],[38,-51],[71,-20],[-47,-42],[-12,-65],[25,-33],[70,91],[-24,96],[-135,129],[-26,44],[-57,-1],[-69,95],[33,27],[136,-40],[182,14],[62,-10],[103,20],[305,-55],[44,-29],[140,-51],[53,73],[-31,19],[-72,-42],[-75,19],[-32,39],[-79,3],[-45,34],[-95,-6],[18,137],[35,29],[-67,29],[-40,71],[47,74],[65,5],[-15,59],[34,45],[183,164],[49,-11],[117,122],[97,32],[76,65],[89,-15],[187,82],[74,-44],[83,5],[-6,-42],[157,-54],[139,5],[40,-95],[-114,-112],[-70,-42],[-115,-31],[-40,-43],[80,-25],[165,30],[62,-17],[-56,-44],[-70,-17],[64,-13],[80,17],[60,44],[135,-26],[170,-11],[41,-77],[-44,-61],[-131,-62],[-5,-82],[-97,-70],[98,-24],[151,32],[78,-24],[86,33],[24,44],[-17,91],[72,1],[152,-20],[186,38],[121,-45],[68,-3],[77,36],[210,-18],[22,-21],[98,-5],[-13,-40],[93,-30],[105,-96],[124,-77],[20,-114],[65,-45],[0,91],[81,9],[49,-65],[-4,-67],[38,-83],[81,-25],[4,-111],[-43,-104],[-43,25],[-102,20],[-150,100],[0,-36],[60,-41],[-30,-100],[153,49],[-11,-53],[24,-35],[98,-23],[6,-44],[-27,-100],[-46,-61],[-208,-191],[-138,-38],[-29,-21],[-92,-145],[-93,25],[-36,-15],[-83,-79],[-129,-49],[-52,-46],[-86,-30],[-37,-53],[-9,-69],[-103,-91],[-100,-15],[-53,-34],[-74,-74],[-71,-112],[-83,-68],[-38,6],[-89,-28],[-156,-15],[-59,15],[-19,-34],[91,-35],[-93,-88],[-4,-49],[-61,-34],[-102,17],[-39,-33],[-18,-89],[-40,-29],[1,-70],[-77,-95],[-82,-63],[64,-25],[58,58],[50,18],[13,43],[177,-52],[118,-13],[-32,42],[-94,5],[-104,44],[-9,122],[36,41],[98,-35],[89,18],[101,-10],[110,4],[56,44],[60,12],[12,38],[193,38],[102,38],[-17,21],[-8,94],[96,-77],[56,-7],[103,47],[5,33],[90,66],[92,15],[35,28],[-8,47],[-64,22],[-20,-31],[-84,-51],[-48,17],[-129,-18],[-32,91],[78,42],[46,98],[92,12],[98,-29],[102,-53],[47,40],[30,-74],[88,-68],[72,-24],[113,-18],[139,10],[50,39],[4,107],[51,-39],[72,-149],[-68,-155],[108,-89],[91,17],[-62,42],[-40,47],[19,35],[202,60],[55,-14],[106,14],[67,28],[29,44],[54,9],[131,-11],[100,-28],[101,8],[150,-43],[57,-26],[338,-6],[102,-50],[-141,-37],[-1,-62],[-23,-54],[34,-73],[170,-67],[113,-31],[48,-44],[42,25],[85,-18],[150,-15],[98,-32],[103,27],[93,-8],[132,-50],[123,-33],[64,-36],[137,-41],[98,7],[132,-19],[4,-19],[39,-29],[115,-24],[14,-27],[64,-17],[54,-45],[7,-23],[48,-23],[64,-59],[111,-46],[-2,-46],[71,-64],[84,-37],[105,-112],[36,-72],[61,59],[-48,61],[-64,46],[-12,182],[-56,68],[32,11],[130,-9],[97,-28],[46,-35],[15,-37],[67,-72],[54,-24],[6,-35],[46,-25],[2,-60],[54,-80],[8,-54],[92,-20],[48,36],[-15,64],[29,14],[45,-121],[-131,-20],[-34,-45],[21,-43],[84,15],[20,-88],[27,-44],[12,-74],[77,-61],[29,-109],[80,-4],[71,-123],[40,5],[18,-40],[97,-8],[7,-67],[36,-30],[66,13],[79,93],[56,148],[-4,45],[150,-4],[13,-33],[62,29],[-123,83],[-44,8],[51,231],[30,83],[91,166],[43,30],[-1,-131],[48,-19],[65,-111],[42,-42],[91,-61],[114,-44],[108,-11],[68,27],[94,-12],[71,-24],[65,12],[72,-68],[32,7],[-3,-80],[30,-60],[56,-28],[11,-51],[44,-53],[-42,-13],[-12,-79],[-82,-63],[-93,30],[-38,-48],[77,-10],[42,12],[102,69],[8,83],[39,12],[9,33],[-39,24],[-21,56],[-62,36],[54,103],[-44,54],[38,18],[5,50],[56,47],[98,40],[35,-2],[69,-83],[61,-11],[53,-54],[9,-47],[51,-31],[29,-50],[56,-13],[14,60],[52,37],[-99,83],[87,139],[62,5],[90,36],[88,-42],[35,-123],[58,19],[16,45],[82,-27],[81,5],[-9,42],[-52,59],[-24,81],[7,40],[-23,107],[6,90],[41,35],[8,40],[67,-11],[32,32],[-62,59],[-58,-30],[-65,2],[-53,-53],[-62,19],[-13,52],[38,62],[52,20],[-21,35],[56,55],[92,4],[162,-18],[105,30],[21,32],[80,25],[-32,55],[-49,29],[-56,64],[0,60],[150,-25],[51,-41],[74,-37],[117,-21],[199,-13],[164,-3],[73,-18],[89,-3],[431,-98],[250,-95],[6,-31],[-238,-3],[-84,6],[-41,59],[-35,-25],[-45,25],[-42,-19],[-84,-125],[-49,39],[-53,-10],[-85,-66],[23,-18],[60,21],[119,-22],[61,49],[123,31],[58,0],[300,35],[126,0],[-109,-156],[-151,-144],[-2,87],[93,61],[-28,38],[-59,-2],[-70,22],[-41,-62],[48,-45],[10,-68],[-66,-15],[-63,-34],[-93,61],[-4,-34],[56,-48],[-51,-56],[-1,-66],[81,8],[39,-14],[54,43],[33,-11],[92,63],[170,218],[28,58],[87,92],[131,15],[96,-10],[114,5],[230,-75],[100,-50],[66,-54],[70,-88],[18,-49],[-12,-40],[-102,-54],[-31,34],[-20,60],[-66,-32],[-53,-52],[-33,-67],[99,15],[37,-30],[68,1],[37,-36],[17,-53],[-46,-94],[-38,9],[-20,-34],[-17,-5],[-5,-9],[10,-5],[22,-22],[-24,-19],[5,-49],[-38,-14],[-7,-68],[-74,-51],[-5,-67],[-10,-26],[-21,-5],[7,-16],[-13,-31],[-44,-1],[2,-21],[38,16],[41,-9],[39,43],[106,15],[17,36],[18,-10],[2,-8],[19,2],[17,-3],[32,-14],[49,13],[58,3],[42,11],[14,2],[12,-1],[5,-4],[4,0],[11,5],[18,-13],[12,2],[52,0],[39,28],[14,3],[25,10],[28,-8],[74,20],[46,-26],[65,-8],[91,-65],[153,-26],[266,45],[120,43],[237,57],[117,19],[86,23],[352,-3],[219,-35],[165,-50],[135,-62],[166,-119],[59,-78],[49,-102],[36,-139],[-37,-67],[-47,-44],[44,-13],[-24,-69],[-48,-66],[45,-81],[130,-93],[21,-55],[26,-20],[15,-27],[-14,-19],[26,-59],[91,-108],[31,-17],[45,65],[-26,97],[84,63],[9,-12],[0,-21],[-5,-4],[7,-16],[-13,-25],[-11,-3],[1,-24],[21,-80],[54,-1],[-32,75],[34,10],[53,69],[55,17],[11,35],[98,70],[48,9],[79,-26],[92,46],[78,-18],[84,2],[62,55],[33,-4],[39,-63],[75,-53],[92,-20],[108,21],[56,-12],[96,0],[100,-43],[114,-8],[92,-26],[92,71],[136,143],[91,-13],[-20,-68],[13,-28],[71,-49],[-19,-117],[15,-104],[21,-20],[103,-5],[48,-27],[63,-55],[60,-3],[19,-25],[15,-165],[64,-37],[128,23],[61,20],[39,-22],[19,-31],[21,-9],[24,18],[8,-27],[15,0],[-4,15],[-11,0],[-1,11],[-9,2],[-6,-4],[-6,4],[7,5],[-1,5],[-5,2],[11,26],[-13,78],[73,57],[19,43],[-7,54],[-28,18],[11,82],[-27,59],[-44,134],[-37,36],[-92,-13],[4,72],[108,58],[-24,105],[14,122],[129,3],[108,-22],[124,-45],[254,-51],[69,-52],[48,-8],[31,-47],[54,22],[-57,85],[44,11],[84,-74],[91,32],[110,-23],[87,-5],[119,5],[65,-12],[61,29],[40,-59],[137,-7],[45,-34],[112,-60],[83,-29],[91,-13],[128,-80],[70,-19],[53,3],[93,-33],[-11,-89],[170,-23],[95,-120],[8,-58],[83,-22],[0,-2588],[0,-231],[-48,-38],[-84,-127],[-106,-34],[-66,-63],[-39,2],[-119,-28],[-44,21],[-96,8],[-45,14],[-48,88],[-5,70],[-68,13],[-5,53],[-94,42],[-75,-45],[29,-17],[77,33],[15,-33],[47,-35],[14,-69],[22,-20],[-73,-39],[-31,47],[-79,25],[-37,-40],[-92,77],[24,-98],[34,-54],[-22,-39],[-37,-14],[-36,-62],[-23,-113],[36,-12],[41,-58],[26,18],[-88,54],[21,63],[1,47],[30,55],[30,-12],[33,51],[22,2],[48,-52],[12,-40],[91,120],[25,-6],[44,38],[54,-11],[-35,-159],[20,-73],[103,-128],[33,-21],[77,49],[23,38],[72,-190],[-56,-44],[86,-48],[23,-141],[-7,-91],[-36,16],[-60,-10],[-34,-30],[32,-44],[39,42],[57,-18],[9,-51],[-31,-36],[12,-36],[69,-45],[102,-85],[34,-56],[-51,-58],[-37,-6],[65,-108],[40,-6],[19,-34],[14,-92],[-10,-47],[-42,-34],[-23,-73],[-41,11],[-27,-42],[18,-30],[0,-51],[-43,12],[-191,85],[-69,53],[-117,20],[-84,-1],[-10,29],[13,55],[-39,16],[-23,74],[-53,-79],[37,-105],[-68,-26],[-1,76],[-48,-18],[-12,-99],[-51,-49],[-47,-63],[-131,-56],[-110,-77],[-24,-7],[-28,-61],[-98,-53],[-22,9],[-19,-68],[-73,-35],[-46,-5],[-43,24],[-37,-16],[-5,-81],[-49,-18],[-47,47],[-43,-23],[5,-108],[-57,-30],[6,-32],[-43,-55],[-25,-8],[-51,59],[-41,-35],[53,-53],[6,-41],[-38,-10],[-37,-37],[-11,-38],[-79,-3],[32,-78],[-23,-32],[-37,0],[-39,-66],[-8,-36],[-60,-34],[-31,39],[-42,-71],[2,-42],[-36,-5],[-29,-68],[-66,-49],[-79,-41],[-23,-50],[-39,-5],[-7,-44],[15,-35],[-38,-26],[-15,-43],[-17,-169],[-43,-30],[-39,38],[-11,44],[-36,22],[-22,93],[13,35],[-39,10],[-12,89],[-86,74],[-14,60],[-42,-13],[-136,4],[-47,21],[-65,-1],[-56,-17],[-43,-32],[-69,-32],[-46,-36],[-49,3],[-24,-51],[-49,-3],[-75,-103],[-32,-79],[-44,-71],[-44,-52],[-41,-87],[-52,-5],[2,49],[22,70],[-4,32],[14,84],[27,46],[-10,124],[30,41],[-31,34],[-72,-36],[-13,-47],[-37,-30],[-21,-38],[-84,-52],[-63,-73],[-26,-136],[-23,-38],[-64,-26],[-12,87],[-20,50],[-62,73],[-47,-20],[2,-65],[-46,-4],[-93,44],[-33,-6],[-18,-31],[26,-55],[-15,-18],[-48,-2],[-23,-35],[-14,-81],[14,-57],[-16,-36],[-42,-15],[-5,-58],[34,-48],[9,-88],[-75,-32],[2,-52],[40,-31],[-29,-24],[-26,34],[-35,-33],[24,-63],[5,-54],[-30,8],[-42,-99],[-51,-39],[-60,-111],[-47,-126],[-51,-216],[-1,-104],[30,-86],[-1,-60],[33,22],[64,-22],[16,75],[23,36],[34,7],[94,-92],[45,0],[25,-72],[-19,-35],[2,-36],[-27,-36],[-14,-62],[-49,-32],[-36,-61],[-4,-113],[22,-112],[-21,-189],[41,-62],[43,36],[41,-19],[6,-199],[30,-88],[1,-93],[-50,-35],[-37,-91],[-37,10],[-29,33],[-16,53],[-35,62],[22,28],[10,52],[37,12],[66,111],[-27,21],[-32,-83],[-38,37],[-70,-37],[-31,-35],[36,-36],[20,-44],[-112,-86],[-34,-45],[-19,-108],[-23,-95],[-29,-82],[-18,-90],[-6,-93],[6,-83],[16,-111],[19,-68],[45,-78],[26,-65],[-5,-82],[-79,-108],[-33,-67],[-65,6],[-53,-20],[-24,27],[-2,43],[-44,6],[-62,-29],[-70,-67],[-38,-50],[-50,-88],[-65,-70],[-15,-98],[-22,-89],[-10,-73],[4,-87],[-13,-18],[40,-61],[-3,-71],[-29,-17],[23,-51],[-5,-89],[37,-30],[-6,-83],[-111,113],[-48,-29],[-6,-31],[-60,-19],[-62,-59],[-45,-67],[-24,-52],[-22,31],[5,29],[-18,50],[-52,-26],[4,-82],[55,10],[3,-50],[-40,-45],[-3,-34],[31,-29],[-26,-55],[0,-130],[15,-27],[0,-57],[-28,-48],[-21,-82],[-31,-90],[0,-37],[-66,-122],[-38,-119],[-36,-40],[-38,-24],[-36,-58],[-11,-60],[-34,-30],[-30,-86],[-40,-40],[-44,-79],[-45,-34],[-3,63],[-15,17],[2,68],[-17,37],[-28,22],[-18,185],[5,123],[-1,216],[-23,211],[-21,116],[-7,91],[-13,20],[-32,149],[-28,388],[-21,236],[-24,219],[-42,298],[-17,156],[-25,270],[-10,160],[1,82],[10,82],[13,167],[4,186],[23,106],[58,354],[34,117],[36,20],[5,39],[38,29],[31,43],[33,97],[27,-20],[62,167],[27,101],[-11,121],[-29,80],[-19,15],[18,46],[44,41],[12,-39],[34,-21],[49,0],[48,36],[16,77],[30,61],[52,-25],[66,13],[75,73],[10,27],[68,90],[117,123],[37,90],[31,33],[71,119],[14,46],[30,40],[-7,63],[37,106],[33,34],[63,112],[30,9],[29,40],[22,110],[34,7],[78,46],[14,55],[49,43],[42,64],[61,137],[18,3],[76,76],[33,73],[-6,64],[6,57],[25,10],[43,60],[60,16],[29,47],[36,-10],[39,33],[29,80],[37,17],[18,-18],[89,45],[97,69],[-74,71],[37,35],[-3,39],[90,79],[25,101],[-35,58],[-41,-7],[32,155],[51,27],[3,114],[11,50],[-6,124],[21,132],[79,63],[24,55],[58,13],[59,-35],[41,2],[-6,58],[-47,38],[-51,22],[-32,76],[-64,9],[-146,-61],[-144,-49],[-24,-21],[-2,-140],[-43,-68],[16,-74],[-3,-82],[-19,-27],[-22,-126],[100,-63],[-5,-31],[-52,-24],[-7,-55],[-26,-25],[-21,95],[-30,50],[-73,-51],[-40,20],[-57,-113],[-66,-102],[-19,3],[-37,-54],[-54,-41],[-8,-43],[-105,-138],[-49,-42],[-38,-71],[-22,-71],[-38,10],[-13,-26],[-62,-12],[-28,-61],[-40,-16],[31,105],[-5,70],[12,43],[41,65],[-17,39],[-46,1],[-38,-26],[-31,-45],[-30,23],[45,91],[-27,139],[57,106],[2,44],[26,7],[31,109],[-13,24],[38,45],[-12,127],[-94,-65],[-14,-53],[-33,-49],[-40,3],[-53,-27],[2,79],[-34,6],[-4,62],[-57,30],[-45,4],[-38,-18],[-13,-56],[-38,12],[-128,-11],[-38,-53],[-28,-6],[-57,31],[-87,5],[-48,-67],[-80,-35],[-24,-63],[-37,-29],[-40,-3],[-12,-105],[7,-123],[-37,2],[-110,-128],[-46,-68],[-13,-115],[-51,-79],[-14,2],[-52,-55],[-3,-36],[-33,-2],[-32,-31],[-26,-51],[-52,-35],[-100,-179],[-53,-35],[16,-67],[4,-59],[-46,6],[-30,-16],[12,-132],[-28,-109],[-21,-27],[14,-33],[46,-15],[24,27],[16,-42],[26,0],[-28,78],[62,-5],[29,-41],[53,25],[22,-46],[51,-61],[-15,-39],[12,-39],[-47,-47],[-66,12],[-32,-30],[-49,53],[-47,-19],[-7,-74],[-42,1],[-28,-31],[-32,15],[-27,70],[-60,17],[-38,30],[-36,-9],[-6,-95],[-62,-1],[-26,-14],[-36,-107],[-44,-8],[-51,32],[-39,51],[-69,-28],[-4,-46],[-21,-22],[-67,-10],[-38,-22],[-42,17],[-42,-19],[-21,36],[-48,133],[67,36],[14,25],[80,-20],[60,-2],[48,13],[59,55],[-50,54],[-35,-26],[-70,52],[-27,83],[-40,37],[-32,72],[-23,-32],[-74,15],[-46,-23],[18,-48],[-13,-27],[-42,-9],[-1,39],[-27,8],[-56,84],[-85,30],[-30,25],[-108,45],[-44,-1],[-51,-30],[-57,-57],[-3,-61],[33,-18],[-79,-50],[-44,35],[-16,-80],[37,-8],[23,-48],[-18,-26],[-81,-27],[-43,11],[-6,90],[-26,18],[-58,0],[-61,-13],[-25,-30],[3,-58],[-46,32],[-58,-28],[-44,49],[-30,-11],[-35,35],[-69,1],[-28,44],[-47,23],[-35,-10],[-21,-36],[-2,-88],[14,-52],[-40,1],[-34,-28],[-27,10],[-45,45],[7,41],[26,31],[-104,54],[-60,-23],[-38,17],[-52,-28],[-71,8],[-107,-11],[-105,24],[-41,-1],[-107,-58],[-45,29],[-42,0],[-85,-60],[-45,-15],[-71,-42],[-99,-116],[-46,-89],[-23,-69],[-44,-97],[-41,-59],[-94,-92],[-42,-19],[-73,-97],[-29,-79],[-19,-96],[-31,-120],[0,-33],[-49,-61],[-56,-16],[-54,-69],[-38,-117],[-51,-17],[-24,-77],[-28,-37],[-64,-21],[-68,-91],[-4,-58],[-16,-36],[-23,10],[-49,-50],[-12,-70],[-34,-12],[-18,-88],[-34,-39],[2,-26],[-42,-36],[6,-62],[-18,-67],[-41,-24],[-24,-99],[-16,-8],[-15,-57],[-39,-16],[-44,-58],[-4,-40],[-33,-12],[-13,-30],[-42,-43],[-11,-52],[-19,6],[-37,-40],[-26,-65],[-13,13],[-48,-61],[-24,-1],[-28,-39],[-29,-101],[-32,-70],[-122,-125],[-17,2],[-47,-43],[-46,-69],[-32,-69],[-3,-32],[25,-61],[120,-66],[4,-46],[35,-13],[46,9],[54,28],[20,-13],[66,-6],[30,28],[25,-15],[29,26],[6,-109],[-23,-53],[18,-80],[-17,-60],[18,-35],[-8,-76],[-26,-39],[-5,-67],[12,-90],[17,-20],[26,46],[90,15],[20,110],[-30,25],[-12,94],[42,58],[53,44],[29,-13],[49,9],[-72,-129],[-46,-5],[-5,-41],[38,-16],[35,-52],[58,-10],[10,-34],[-39,-24],[-19,-38],[-10,-63],[-18,-44],[-26,3],[-36,-26],[-15,-39],[27,-34],[40,10],[62,0],[67,19],[24,36],[49,36],[39,61],[12,102],[59,67],[3,-110],[-21,-61],[-36,-61],[-6,-47],[-27,-60],[39,-9],[19,14],[30,60],[21,67],[12,92],[-3,51],[20,51],[2,73],[-13,47],[0,116],[57,-48],[60,-36],[36,-10],[46,13],[96,71],[1,-64],[45,-55],[68,-52],[2,-37],[34,-33],[-20,-59],[25,-67],[48,-48],[13,-55],[102,-105],[-9,-46],[59,-22],[23,-58],[58,-8],[-7,-37],[17,-62],[-27,-45],[-30,-18],[-9,-55],[-29,-2],[-36,48],[-26,16],[-15,35],[-84,-10],[-55,76],[-95,47],[-8,34],[54,69],[-33,27],[-32,-78],[-38,24],[14,49],[36,32],[-24,48],[-38,-18],[-33,-70],[13,-55],[20,-10],[26,-50],[4,-53],[-14,-109],[-31,-57],[5,-30],[-59,7],[4,37],[-15,30],[-61,-41],[-4,-35],[7,-5],[8,19],[7,4],[1,-7],[7,-12],[33,-25],[41,20],[53,-13],[21,-37],[57,-57],[6,-129],[62,-27],[28,-110],[-11,-81],[-13,-22],[-15,-10],[-8,-19],[-12,0],[-15,-7],[-32,7],[-37,-47],[17,-25],[34,8],[13,35],[19,26],[15,3],[14,11],[7,-48],[-17,-22],[-33,-96],[2,-43],[23,-59],[-8,-31],[-31,-38],[-34,-59],[-36,-85],[45,-17],[18,29],[8,53],[23,-5],[-23,-71],[19,-10],[17,41],[47,-28],[36,5],[21,58],[-47,-22],[-26,8],[-9,38],[-36,27],[41,36],[24,43],[65,21],[-43,25],[-33,75],[-6,63],[33,189],[-4,49],[-46,124],[-39,13],[-2,46],[-18,85],[-20,40],[-8,47],[-57,6],[-8,63],[26,25],[14,107],[50,1],[57,23],[43,-78],[49,-24],[48,8],[38,-54],[15,-64],[24,-10],[37,-49],[-3,-48],[23,-37],[6,-103],[-16,-61],[-27,-18],[1,-56],[37,-77],[38,-54],[42,-12],[-11,-32],[-37,-37],[-5,-82],[19,-33],[-69,-87],[4,-32],[-22,-72],[-37,-11],[-26,-56],[3,-68],[-25,-6],[-1,-47],[17,-37],[-20,-25],[-31,-6],[8,-51],[-11,-25],[-4,-72],[9,-62],[-7,-52],[-24,-23],[-18,-42],[5,-27],[-25,-83],[11,-51],[-15,-76],[18,-53],[6,-70],[1,-147],[16,-68],[-22,-52],[-23,-88],[13,-45],[23,-20],[-8,-75],[13,-81],[-36,-120],[-9,-62],[-21,-69],[12,-58],[-19,-29],[25,-88],[-4,-37],[-35,-57],[-16,-125],[3,-68],[-4,-90],[-31,-46],[-8,-37],[-26,-15],[-20,-45],[-41,-60],[-20,-70],[-39,-76],[-27,-23],[-41,-94],[-19,-102],[-24,-63],[-16,-67],[1,-46],[-19,-41],[-41,-54],[-34,-91],[-20,-22],[-39,-128],[-5,-58],[-18,-34],[-20,-88],[-1,-107],[-48,-71],[-21,-107],[4,-32],[-52,-126],[-42,-89],[-23,-97],[-55,-96],[-37,-45],[-17,-66],[-25,-44],[-19,-62],[-22,-15],[-32,-63],[-42,-58],[-8,-66],[-36,-47],[-53,-143],[-21,-17],[-7,-36],[-38,-78],[-15,-106],[-77,-64],[-22,-102],[-21,-19],[-20,-45],[-10,-101],[-24,-22],[-14,-137],[-29,-63],[-26,-28],[-28,-56],[-7,-67],[-32,-25],[-54,-68],[-17,-56],[-26,-11],[-36,-41],[-24,-42],[-34,-40],[-45,-35],[-17,-55],[-20,-16],[-40,-73],[-7,26],[-35,-41],[-29,6],[-64,-60],[-52,-17],[-24,-47],[-36,20],[9,35],[-18,49],[-24,0],[-3,-49],[-24,4],[-9,41],[2,59],[-56,-49],[-15,46],[-33,13],[-17,-44],[-14,68],[13,126],[14,42],[-20,42],[-40,-23],[-32,-48],[-27,-55],[-24,39],[13,55],[18,22],[4,51],[-68,18],[6,-107],[-23,-11],[-29,-82],[-27,-32],[-5,-44],[-27,-23],[15,-37],[-48,-64],[-21,-152],[-18,78],[-10,-25],[-67,16],[-33,32],[-19,-41],[51,-57],[1,-65],[-18,-8],[-9,-77],[-12,-43],[-14,25],[6,26],[-2,13],[-3,6],[0,7],[-4,12]],[[82420,75752],[-25,65],[-79,45],[-29,27],[-46,-18],[-91,-90],[-56,14],[-60,34],[-39,43],[-29,51],[-25,64],[-43,37],[-49,18],[-38,-13],[-51,39],[-44,-28],[-81,-99],[-41,-26],[-27,-59],[-44,-13],[-3,-26],[-71,-71],[-41,-139],[-20,-34],[-52,-57],[-93,5],[-54,-27],[-25,-26],[-70,-53],[-71,6],[-43,-43],[-42,26],[-34,-39],[-124,-93],[-32,-7],[-56,18],[-28,46],[-17,-39],[-37,-33],[-47,28],[-40,0],[-61,23],[-31,-3],[-60,77],[-45,19],[-30,-23],[-32,14],[-30,-6],[-48,8],[-48,-13],[-37,75],[-20,86],[-38,7],[-59,72],[9,51],[-15,87],[12,60],[-48,-4],[-17,34],[-22,-14],[-133,36],[-26,38],[-28,104],[-46,64],[-62,29],[-92,-29],[-22,30],[-27,-5],[-11,49],[-40,8],[-16,20],[-65,-8],[-23,21],[-28,-10],[-20,25],[-62,-63],[-34,-3],[-33,14],[-23,-49],[-29,19],[-40,-42],[-46,3],[-8,-35],[-64,-88],[-37,8],[-42,34],[-34,-50],[-59,51],[-25,9],[-46,-14],[5,60],[-10,33],[-82,-12],[-29,23],[-31,51],[-22,-5],[-11,75],[-19,19],[-2,40],[-64,67],[9,41],[-35,56],[8,72],[-10,85],[-14,14],[-8,60],[0,160],[-28,24],[-35,5],[-41,38],[-35,9],[-24,24],[-49,-18],[-34,51],[-28,-18],[-13,42],[-20,-8],[-48,59],[-54,53],[-41,17],[-26,-14],[-71,20],[-27,-19],[-49,22],[-21,108],[-38,-7],[-48,34],[-53,5],[-8,44],[-70,33],[-15,58],[-30,-26],[-15,-63],[-11,-103],[-26,-39],[-42,-32],[-20,-28],[-27,-4],[-32,-97],[-3,-98],[-30,10],[-22,-15],[-27,-95],[0,-82],[-19,-101],[-14,-36],[17,-63],[41,-48],[-17,-80],[12,-65],[22,-45],[49,-43],[16,-45],[-17,-56],[10,-54],[-36,-82],[2,-43],[-66,-120],[-58,-4],[-49,-36],[6,-48],[-20,-32],[-48,-40],[-29,-10],[-29,52],[-31,11],[-5,41],[-74,15],[-35,-25],[-25,49],[-23,-47],[-22,20],[-26,51],[-43,9],[-38,-13],[-26,51],[-58,-56],[-26,-14],[-11,-33],[-29,43],[-96,3],[-18,13],[-5,46],[-109,10],[-24,83],[-37,29],[-13,205],[-28,62],[-107,10],[-42,-11],[-51,13],[-34,22],[-18,-18],[-64,-14],[-25,15],[-12,41],[15,35],[-6,54],[-58,9],[-8,-53],[-38,-20],[-3,47],[-17,21],[-63,22],[-4,-54],[-39,-34],[-28,-7],[-60,27],[-37,-25],[-19,-39],[-1,-42],[-33,-3],[-21,-24],[-17,-66],[-28,12],[-37,-36],[-51,4],[-20,-16],[2,-39],[-57,-27],[7,-56],[-16,-19],[-35,25],[-28,-34],[-18,1],[-26,-54],[-56,-21],[-24,-31],[-7,-56],[-55,-14],[-41,-23],[2,-86],[21,-10],[2,-42],[-38,-38],[-35,-8],[-28,-58],[-32,45],[-15,-10],[4,-78],[-63,-44],[-26,9],[-41,-16],[-37,36],[-47,-22],[-26,17],[-46,-31],[-1,-115],[-42,-46],[-8,-32],[-49,-9]],[[97396,89417],[11,-64],[-6,-17],[17,-10],[-6,-6],[-6,-15],[-21,4],[-29,76],[40,32]],[[96810,90219],[86,-42],[19,-28],[146,-46],[7,-47],[-49,-25],[8,-76],[-33,-70],[-75,2],[-106,36],[-88,48],[-32,53],[-85,50],[38,67],[73,61],[91,17]],[[96511,79355],[27,-51],[53,-26],[-18,-36],[-61,80],[-1,33]],[[96101,79711],[45,-32],[31,-40],[13,-106],[18,-19],[26,-94],[41,-33],[23,-119],[-27,-20],[-26,49],[0,34],[-33,1],[-38,71],[-44,100],[3,32],[-23,63],[-23,32],[-44,22],[50,35],[8,24]],[[95719,82488],[14,-80],[26,-67],[-9,-79],[-18,-36],[-51,-5],[-65,-36],[-100,-85],[-53,-76],[-25,-16],[-20,-47],[-20,41],[39,15],[53,163],[4,60],[41,94],[108,65],[22,45],[54,44]],[[94967,89954],[5,-64],[-46,1],[41,63]],[[94869,89930],[35,-26],[2,-64],[-38,-55],[-46,-13],[25,37],[-7,19],[8,35],[-9,40],[30,27]],[[94593,89972],[109,-46],[27,-57],[-21,-65],[26,-110],[-37,-31],[-80,95],[-30,74],[13,10],[-2,19],[-39,39],[-11,45],[45,27]],[[93454,76475],[20,-64],[-21,-66],[-21,-29],[-24,2],[-25,36],[5,60],[23,12],[43,49]],[[93345,76414],[27,-17],[2,-86],[-6,-100],[-20,-6],[-47,-165],[-27,-37],[-53,-11],[-34,-46],[-14,-70],[-22,26],[-35,-2],[11,72],[-2,49],[-14,40],[51,46],[73,26],[34,69],[14,49],[11,82],[51,81]],[[93187,76477],[15,47],[34,-13],[6,-61],[-41,-7],[-14,34]],[[92989,75552],[15,32],[24,-6],[-5,-52],[-14,-17],[-8,-60],[5,-92],[-30,-24],[-27,18],[7,83],[33,118]],[[92802,75030],[3,33],[27,12],[1,-42],[-31,-3]],[[92458,94642],[-4,-64],[-80,28],[84,36]],[[92338,73971],[25,8],[7,-45],[-24,-7],[-8,44]],[[92279,73831],[22,-26],[-34,-56],[-39,-110],[-41,-48],[-21,-45],[-18,17],[10,47],[22,-6],[22,68],[36,39],[41,120]],[[91973,91200],[104,-43],[52,-38],[67,-116],[42,-94],[-39,-12],[-91,16],[-78,-21],[-19,7],[-15,-2],[-5,-4],[-26,-9],[-40,-27],[-44,10],[-17,-12],[-7,9],[-13,4],[-11,-6],[-7,6],[-8,-1],[-8,7],[-5,-8],[-21,10],[-11,-3],[-60,-8],[31,59],[22,-1],[6,-14],[17,5],[-5,18],[12,2],[-1,14],[9,0],[6,-1],[8,-6],[6,2],[2,8],[-1,2],[-4,1],[-15,7],[6,33],[10,0],[8,26],[11,0],[-4,13],[-10,54],[64,86],[82,27]],[[90690,94212],[57,-31],[14,-40],[-24,-45],[71,-70],[69,20],[72,51],[56,9],[108,-35],[98,7],[61,-24],[-16,-99],[45,-26],[196,49],[120,-34],[83,-7],[107,-77],[87,33],[39,-15],[-82,-94],[-11,-87],[-150,-37],[-77,-29],[-22,-30],[-154,-6],[-146,10],[-135,31],[-132,121],[-150,34],[-112,75],[-115,41],[-45,34],[27,89],[-10,37],[55,85],[16,60]],[[91870,91196],[-50,-109],[-1,-45],[17,-13],[-13,-18],[-2,-16],[-15,5],[4,-9],[-5,-30],[9,-6],[11,-3],[-6,-10],[-6,4],[-8,3],[-19,0],[7,-7],[2,-8],[-12,-2],[-2,-5],[-39,-3],[-46,-71],[-54,-7],[-25,8],[-24,3],[-7,-3],[-29,37],[24,0],[-18,49],[56,40],[37,3],[-13,45],[25,42],[105,29],[97,97]],[[91831,91284],[32,-42],[-61,-84],[-28,91],[57,35]],[[91726,73127],[34,29],[22,-2],[13,-34],[-73,-125],[-7,-47],[-49,-82],[-19,0],[-66,-119],[-8,-22],[-40,-35],[-18,5],[4,60],[11,10],[21,72],[23,49],[27,2],[23,42],[11,48],[48,84],[33,7],[10,58]],[[91725,91290],[47,-38],[9,-103],[-68,-65],[-77,-2],[18,-27],[-34,-71],[-64,-42],[22,-49],[-33,0],[9,-19],[-20,-30],[-87,-14],[-58,-49],[-10,51],[38,1],[-12,31],[26,16],[-1,64],[52,43],[10,68],[27,1],[7,8],[4,19],[-4,30],[18,15],[3,9],[-6,9],[11,6],[13,-1],[37,10],[63,32],[9,51],[51,46]],[[91728,91316],[-58,-68],[-8,-55],[-27,-10],[-19,-12],[-35,-15],[-8,1],[-12,-6],[-8,3],[-6,-5],[-29,15],[25,17],[51,22],[13,28],[43,19],[16,40],[62,26]],[[91525,95051],[-74,-54],[9,-26],[-201,14],[88,47],[178,19]],[[88644,94653],[-25,-20],[44,-67],[70,-25],[117,-96],[35,-56],[121,-28],[40,-66],[98,-4],[-2,145],[24,92],[47,23],[86,5],[24,47],[52,-14],[238,-185],[155,-41],[77,33],[82,-3],[86,-30],[106,-69],[63,-4],[59,-47],[108,-45],[-29,-50],[-105,-77],[14,-68],[-29,-107],[-91,-68],[-129,-28],[-41,38],[-114,-13],[-85,63],[-38,4],[-60,121],[-49,21],[20,80],[55,65],[76,53],[-8,64],[-109,20],[-140,-91],[-14,-70],[38,-132],[155,-185],[69,-4],[179,-73],[-40,-45],[-190,-23],[-85,-47],[-60,12],[-99,70],[22,57],[-55,5],[-78,-49],[-214,-36],[-179,-55],[-40,56],[-81,57],[-63,-65],[22,-36],[-39,-85],[-57,-43],[-44,-6],[-125,61],[-128,27],[-49,56],[-39,77],[-135,81],[-115,146],[-8,59],[140,-9],[13,31],[-85,43],[34,30],[-28,53],[26,24],[-35,108],[124,44],[-47,82],[59,59],[116,8],[35,69],[180,74],[77,2]],[[89620,78973],[25,59],[17,-79],[50,-116],[9,-50],[-24,-59],[-7,-79],[2,-87],[12,-7],[21,-85],[9,-73],[16,-41],[4,-70],[18,-11],[22,-143],[-56,35],[16,-145],[34,-111],[23,-35],[-2,-164],[-9,-92],[-26,-1],[-20,-63],[12,-53],[-6,-99],[-13,-33],[11,-63],[-6,-63],[11,-40],[22,-1],[22,-91],[-16,-45],[-12,-119],[64,-14],[8,-77],[-25,-24],[27,-48],[16,-58],[25,-185],[22,-211],[0,-56],[16,-129],[24,-128],[42,-143],[-2,-23],[38,-174],[5,-102],[26,-73],[-5,-55],[17,-128],[32,-132],[-2,-26],[30,-35],[54,-84],[-12,-52],[-23,74],[-50,96],[-13,8],[-55,133],[-39,34],[-68,26],[-12,22],[-66,18],[-21,36],[-43,-16],[16,-66],[-60,-63],[-31,-65],[-7,-42],[9,-115],[-44,-148],[-20,-98],[-10,-79],[-21,-106],[-26,-168],[-10,-118],[11,-132],[26,-116],[26,-66],[56,-73],[18,-64],[10,-109],[-6,-19],[35,-162],[45,-47],[20,-4],[24,32],[13,-88],[14,-269],[-15,-83],[-13,-30],[0,-66],[-17,7],[7,73],[-26,163],[13,77],[-28,10],[-31,37],[-28,-4],[-51,23],[-31,-14],[-12,91],[-49,-19],[-26,-41],[-13,-44],[-16,-95],[-28,-131],[-1,-49],[-21,-137],[-40,-61],[-30,81],[3,41],[-11,139],[-15,107],[-7,113],[49,218],[19,123],[-7,112],[-18,48],[9,52],[-9,53],[-1,122],[28,112],[7,64],[32,80],[-7,49],[-8,192],[-22,97],[1,56],[-32,21],[-24,88],[-4,84],[34,61],[16,149],[-2,42],[17,62],[-4,91],[15,69],[10,252],[-8,64],[9,174],[-9,109],[4,55],[-29,110],[2,85],[11,62],[-2,66],[8,54],[22,42],[17,90],[-6,75],[-16,80],[-26,75],[-11,74],[-33,49],[-39,87],[12,68],[-19,42],[-34,25],[11,71],[-12,90],[17,44],[-14,43],[-5,69],[8,53],[31,49],[18,75],[-6,29],[9,75],[4,123],[18,122],[-24,73],[-20,158],[36,46],[86,68],[12,-28],[-6,-53],[15,-41],[42,10],[34,83],[23,36],[-43,81],[43,23],[25,-39],[17,63],[-12,78],[-20,-76],[-25,-10],[29,99],[3,63],[-71,136],[-30,100],[56,21],[28,30]],[[89462,93007],[59,-39],[96,-32],[53,-54],[102,-73],[59,-55],[58,-88],[-34,-22],[19,-122],[-101,-34],[-147,33],[-280,44],[-66,19],[-162,73],[-99,0],[-134,-55],[-36,6],[-7,57],[149,9],[56,39],[48,55],[54,148],[59,70],[67,11],[52,-13],[135,23]],[[89084,93267],[54,-3],[57,-54],[-8,-93],[-27,-58],[-142,-51],[-34,27],[-47,89],[6,91],[57,41],[84,11]],[[88968,77266],[26,16],[-5,-113],[-26,-35],[-30,11],[26,42],[-18,83],[13,-7],[-2,-3],[4,-1],[3,3],[2,0],[0,1],[1,6],[2,-5],[4,2]],[[88956,77339],[22,-25],[-6,-34],[-4,0],[-1,-9],[-3,-6],[-2,4],[-1,-6],[-2,0],[-4,-3],[0,11],[-1,2],[-10,-1],[-15,35],[27,32]],[[88855,77000],[32,34],[-1,-55],[-31,21]],[[88675,77998],[27,27],[6,-12],[32,20],[3,-50],[-12,-31],[-34,25],[-1,8],[-5,3],[0,6],[-4,1],[-12,3]],[[88202,79547],[7,31],[49,-23],[55,-6],[25,-65],[52,-11],[-36,-38],[-22,-44],[3,-85],[-38,-41],[-39,-72],[-18,-1],[-12,58],[-42,104],[-65,-76],[17,100],[48,89],[16,80]],[[88273,91351],[55,-18],[10,-54],[-66,-64],[-47,48],[-102,25],[-11,39],[47,16],[79,-8],[35,16]],[[88048,79507],[10,17],[51,2],[-39,-94],[2,-44],[-62,22],[-23,-46],[-20,49],[81,94]],[[87938,91357],[10,-48],[-75,-41],[14,67],[51,22]],[[87623,93246],[65,-37],[108,-85],[58,-63],[6,-48],[-37,-25],[-35,51],[-77,57],[-16,42],[-71,50],[-1,58]],[[87704,94415],[20,-66],[53,-78],[66,-34],[-40,-31],[-37,-74],[13,-36],[-47,-39],[-71,-5],[-17,58],[33,95],[-10,56],[37,154]],[[86672,91079],[47,-48],[-95,4],[48,44]],[[86608,70876],[28,12],[9,-39],[-25,-38],[-12,65]],[[85756,92126],[71,-42],[-9,-34],[-84,23],[-27,41],[49,12]],[[85600,91918],[165,-44],[-17,-29],[-139,29],[-9,44]],[[85750,92432],[2,-61],[-46,-27],[-146,-43],[-53,27],[58,34],[36,-9],[44,39],[105,40]],[[85654,92578],[-12,-27],[-36,-8],[-46,-19],[-22,2],[-20,-13],[-15,24],[6,7],[72,20],[73,14]],[[85659,92291],[-79,-67],[-45,16],[19,44],[105,7]],[[85566,91911],[29,-35],[65,-32],[-23,-30],[-52,23],[-48,52],[29,22]],[[85601,92153],[46,-7],[-6,-47],[-117,8],[77,46]],[[85612,92541],[-24,-40],[-60,-30],[-74,-81],[-37,11],[-86,-39],[-34,-74],[-94,-62],[-4,78],[30,35],[79,22],[24,55],[60,14],[61,73],[22,-10],[33,23],[11,-4],[17,12],[24,-2],[52,19]],[[85583,92650],[-40,-86],[-36,-19],[-8,-8],[-19,-39],[-26,7],[-46,-33],[-18,-40],[-58,-15],[7,94],[45,19],[-1,25],[10,6],[12,2],[10,-8],[15,8],[-4,9],[21,11],[41,45],[95,22]],[[85488,92417],[5,-67],[-76,-23],[-14,-9],[-1,-18],[-10,-4],[-28,-3],[-5,-3],[-23,-2],[43,79],[90,15],[19,35]],[[85440,92706],[67,-16],[-62,-105],[-50,-19],[-8,-4],[-8,-11],[2,-19],[-24,21],[26,16],[-10,27],[41,19],[-19,26],[8,47],[37,18]],[[85434,92329],[51,-20],[-27,-36],[-115,-27],[-66,-35],[5,63],[55,14],[23,1],[7,3],[24,3],[11,3],[32,31]],[[85386,92017],[31,-46],[-56,-16],[-42,26],[67,36]],[[85319,92731],[57,-13],[13,-75],[-19,-21],[16,-12],[-16,-13],[10,-25],[-82,-22],[19,66],[-31,27],[-8,82],[41,6]],[[85333,92150],[41,-26],[-29,-44],[-42,-4],[-42,-43],[-32,40],[104,77]],[[85277,92026],[42,-27],[-40,-54],[-83,7],[3,45],[78,29]],[[85245,91665],[86,-54],[-48,-18],[-38,72]],[[85276,92584],[4,-33],[49,-38],[-25,-74],[-80,-18],[-20,28],[14,4],[0,7],[-4,14],[12,16],[-16,23],[22,20],[9,3],[2,9],[8,5],[-10,4],[-3,9],[10,8],[3,9],[25,4]],[[85256,92660],[59,-43],[-30,-37],[-47,22],[11,19],[7,39]],[[85228,92676],[5,-70],[-2,-7],[13,-2],[15,-10],[-13,-10],[-12,-13],[8,-12],[-2,-15],[-7,-2],[-5,-6],[-14,-8],[-13,-17],[-33,23],[20,29],[-9,23],[-13,14],[62,83]],[[85234,92238],[2,-65],[-62,19],[60,46]],[[85138,91866],[68,-97],[-7,-81],[-102,47],[-61,49],[1,53],[80,6],[21,23]],[[85136,92618],[28,-6],[-2,-18],[24,-35],[-12,-3],[-12,-27],[33,-24],[6,-23],[9,-3],[2,-13],[5,-8],[-14,-8],[15,-45],[-53,-61],[-37,-13],[-16,-20],[-65,-34],[-8,6],[-8,1],[-8,-6],[-1,-6],[8,-13],[-9,-9],[-18,-9],[-1,-4],[-34,74],[38,56],[-4,31],[6,15],[8,4],[-6,9],[10,5],[18,2],[7,4],[2,3],[6,37],[21,5],[-13,29],[25,-6],[19,4],[-19,35],[29,39],[19,9],[2,26]],[[85181,92344],[4,-44],[-50,-126],[-29,85],[75,85]],[[85125,92041],[49,-34],[4,-82],[-44,0],[-54,72],[45,44]],[[85108,92638],[20,-14],[-4,-25],[-37,-36],[-8,-19],[22,-32],[-19,-3],[-15,5],[-13,-3],[15,-20],[-21,-13],[-1,-23],[-61,-5],[-40,-29],[-16,-29],[15,-1],[8,-23],[-4,-6],[-22,-5],[4,-42],[35,-48],[47,-54],[55,-44],[-7,-55],[19,-43],[-43,-44],[-55,14],[6,27],[-4,8],[-34,11],[-3,33],[-24,49],[1,28],[-9,14],[-50,22],[-32,2],[-6,5],[-6,10],[-11,8],[15,21],[-12,43],[-18,9],[-69,0],[-39,-17],[-68,6],[-41,-4],[-23,14],[-40,-4],[-25,21],[-35,9],[-53,-25],[-49,20],[-10,44],[24,34],[-34,29],[24,39],[-55,27],[-34,78],[27,45],[-38,100],[43,19],[-12,48],[56,-2],[37,-38],[68,12],[8,47],[52,21],[42,61],[33,-26],[115,-25],[66,-54],[4,-35],[55,-42],[71,5],[16,-45],[72,27],[130,-7],[-5,-75]],[[84890,92038],[69,-27],[16,7],[3,20],[111,-56],[34,-59],[-91,-80],[-60,46],[-57,4],[-34,53],[-71,22],[-3,22],[75,19],[8,29]],[[85035,92284],[13,-8],[46,12],[-12,-23],[7,-85],[-74,33],[1,12],[-11,10],[0,6],[19,10],[6,7],[-6,17],[11,9]],[[84990,92451],[6,-16],[24,10],[14,1],[11,-8],[-31,-7],[-6,-6],[6,-7],[-8,-6],[-6,-16],[4,-28],[-51,-5],[2,8],[-6,20],[-16,3],[16,27],[41,30]],[[84926,92095],[27,-15],[24,-5],[6,-11],[-10,-29],[-1,-17],[-15,-5],[-35,37],[-27,6],[31,39]],[[84792,92331],[20,-10],[10,-41],[-15,-23],[19,-19],[9,-4],[7,-2],[8,-11],[14,8],[15,-6],[44,-26],[-1,-30],[12,-45],[-50,20],[-36,32],[-64,33],[15,27],[-21,40],[22,22],[-8,35]],[[84794,92120],[55,-4],[44,-61],[-85,-63],[-24,42],[10,86]],[[84470,92337],[37,-25],[63,-12],[17,-3],[19,3],[31,-13],[60,5],[63,22],[33,-77],[-13,-33],[37,-18],[-66,-74],[-23,-2],[-10,-17],[-10,1],[-6,-5],[-22,-4],[-42,28],[-41,-12],[-71,24],[-9,37],[-61,25],[-77,5],[-74,32],[11,21],[104,78],[50,14]],[[84737,92110],[33,-5],[-12,-26],[24,-13],[-50,-23],[-50,41],[22,4],[11,5],[12,-11],[10,3],[-10,14],[10,11]],[[84500,92335],[20,-13],[36,6],[28,-17],[29,8],[34,-4],[50,-2],[-62,-21],[-24,10],[-24,-3],[-45,14],[-35,4],[-7,18]],[[84652,93020],[-14,-42],[-46,-35],[-57,30],[40,30],[77,17]],[[84316,92449],[37,-23],[-22,-59],[19,-18],[39,-16],[-41,-63],[-61,-17],[-44,19],[-73,1],[-133,83],[60,12],[77,-39],[29,-42],[49,10],[35,35],[-11,61],[40,56]],[[84268,92247],[46,-33],[-35,-47],[-49,41],[38,39]],[[81136,93466],[186,-29],[76,1],[84,-28],[36,-59],[-73,-128],[-61,-18],[-42,-76],[-174,41],[-58,51],[-89,24],[-46,40],[46,51],[69,-24],[45,69],[-20,13],[21,72]],[[81192,94965],[53,-20],[32,-52],[2,-70],[-43,-3],[-46,64],[-60,5],[-11,53],[73,23]],[[79872,96076],[62,-27],[-9,-48],[-98,-13],[-232,35],[111,41],[92,-13],[74,25]],[[79812,95380],[-8,46],[35,43],[91,-29],[-79,-63],[-39,3]],[[79607,96178],[0,-73],[-85,-35],[-40,45],[91,13],[34,50]],[[78464,96966],[120,-39],[88,-52],[-94,-78],[-34,-85],[61,-48],[154,67],[6,40],[148,-18],[11,-98],[89,-9],[37,-49],[-14,-50],[78,-29],[38,36],[89,-40],[27,-44],[26,-139],[-92,-122],[-65,-48],[-141,3],[-175,-57],[-225,-46],[-105,24],[-115,-17],[-87,6],[-165,-15],[-42,-32],[-307,-130],[-120,-12],[-43,70],[70,111],[127,121],[-17,44],[54,39],[2,58],[34,39],[27,92],[96,91],[93,182],[57,83],[86,6],[-7,81],[67,10],[38,-82],[78,-6],[-24,86],[71,56]],[[77076,97497],[50,-1],[116,-78],[-38,-114],[40,-47],[96,20],[31,121],[180,13],[76,-26],[156,-123],[24,-52],[-60,-29],[-31,-257],[8,-71],[-138,-39],[96,-42],[49,-46],[42,-122],[-115,-53],[-15,-29],[-258,-3],[-181,-16],[-86,19],[-182,89],[-46,41],[-91,-8],[-59,23],[-71,-20],[-81,20],[9,34],[-62,29],[-119,-55],[-116,64],[12,42],[-100,50],[-17,69],[23,95],[-119,23],[-79,51],[0,32],[106,104],[183,41],[-106,52],[9,49],[95,18],[35,43],[67,13],[81,-23],[40,52],[230,-8],[167,16],[72,38],[77,1]],[[76588,98290],[286,-213],[139,-93],[169,-42],[15,-60],[61,-53],[-187,-14],[-100,-61],[69,-55],[-40,-69],[87,-45],[-71,-44],[-152,-13],[-227,4],[-343,-72],[-200,-76],[-99,-1],[-170,78],[-137,18],[-37,77],[-211,29],[52,43],[146,25],[46,57],[123,6],[-15,84],[124,92],[-28,15],[-160,-21],[70,93],[91,38],[-8,40],[122,40],[114,9],[122,38],[115,14],[128,75],[-40,36],[146,21]],[[77044,94581],[-43,-66],[-40,39],[83,27]],[[76906,94759],[73,-41],[-12,-44],[-108,-28],[47,113]],[[76795,95352],[31,-43],[-69,-49],[-23,-51],[-90,-21],[-127,27],[21,34],[177,56],[80,47]],[[76634,94735],[143,-42],[23,-63],[-193,-18],[-49,35],[22,62],[54,26]],[[76726,94999],[34,-13],[-30,-60],[-48,20],[44,53]],[[75544,97434],[39,-20],[347,-42],[146,-61],[-47,-59],[-140,-85],[-145,-29],[-149,9],[-125,-26],[-95,28],[-41,40],[219,-22],[107,33],[-64,38],[-140,0],[-123,21],[52,55],[-69,107],[87,-7],[141,20]],[[75299,98258],[122,-33],[37,-39],[-78,-57],[-113,-12],[-210,42],[-5,63],[247,36]],[[74860,95441],[71,-41],[-31,-51],[-81,-5],[-27,72],[68,25]],[[74298,93070],[72,-74],[-9,-48],[-38,-27],[-34,12],[21,17],[-19,19],[6,22],[-5,34],[-17,30],[23,15]],[[74280,93040],[16,-50],[-7,-21],[20,-18],[-23,-17],[-30,16],[24,90]],[[74179,93109],[85,-8],[27,-29],[-18,-16],[9,-14],[-21,-17],[-46,1],[-66,65],[30,18]],[[74169,93783],[47,-32],[-19,-42],[-74,-37],[-132,3],[-40,32],[88,26],[4,39],[126,11]],[[74031,93668],[79,-26],[-63,-38],[-16,64]],[[73882,93499],[42,-30],[-100,-68],[-3,67],[61,31]],[[73753,93647],[39,-39],[-56,-21],[-38,34],[55,26]],[[73700,90038],[65,-32],[33,-34],[-6,-44],[-69,46],[-23,64]],[[73692,93486],[63,-6],[-24,-81],[-72,20],[33,67]],[[73318,90014],[29,-35],[30,-73],[31,-16],[-16,-21],[-11,-2],[-20,-16],[-26,7],[-30,60],[13,96]],[[73200,90011],[62,-9],[34,-40],[-34,-29],[-28,22],[-14,-1],[-5,11],[-8,9],[2,16],[-9,21]],[[73211,90108],[81,-86],[-90,5],[-11,46],[20,35]],[[73154,93171],[-1,-62],[-82,30],[83,32]],[[73155,90776],[20,-84],[-46,-9],[26,93]],[[73024,90260],[42,-10],[77,-106],[-89,40],[9,39],[-39,37]],[[73088,90580],[42,-13],[14,-34],[-60,-30],[4,77]],[[73108,90708],[34,-66],[-24,-65],[-33,5],[8,98],[15,28]],[[72972,90210],[9,-15],[62,-8],[61,-31],[-40,-40],[-74,54],[-18,40]],[[72999,90877],[70,-158],[-61,-35],[-47,58],[26,62],[12,73]],[[73009,90606],[59,-50],[-12,-62],[-87,35],[2,68],[38,9]],[[73011,90257],[47,-31],[-14,-37],[-54,6],[-3,57],[24,5]],[[72935,90725],[2,-31],[3,-5],[5,-5],[17,-3],[8,-19],[2,-4],[4,-1],[7,6],[4,7],[5,-3],[6,1],[28,-27],[-53,-42],[-69,32],[-6,52],[37,42]],[[72940,90316],[61,-34],[-14,-28],[-57,32],[10,30]],[[72950,93177],[57,-41],[-45,-29],[-64,41],[52,29]],[[72910,90490],[50,-11],[40,-37],[-32,-55],[-43,47],[-15,56]],[[72949,90751],[44,-60],[7,-21],[-9,-2],[-4,3],[-4,-7],[-11,-5],[-5,17],[-4,6],[-20,5],[-4,8],[-3,16],[0,21],[13,19]],[[72941,90583],[21,-104],[-51,36],[30,68]],[[72882,90316],[84,-73],[-42,-41],[-40,19],[-30,53],[28,42]],[[72887,90630],[41,-40],[-24,-74],[-42,32],[25,82]],[[72805,94159],[73,-128],[-78,-11],[-92,-42],[-36,55],[63,17],[70,109]],[[72801,90604],[-16,-115],[-29,32],[10,29],[-4,11],[-14,13],[-4,11],[57,19]],[[72753,90449],[7,-27],[-52,-71],[-44,42],[89,56]],[[72449,90501],[44,-13],[19,-10],[23,-24],[-98,-16],[0,15],[0,6],[-15,0],[-6,6],[8,6],[5,7],[13,2],[-1,12],[8,9]],[[72107,98023],[161,-43],[-69,-57],[-107,-15],[-163,5],[-21,67],[72,28],[127,15]],[[72030,93521],[69,-20],[-6,-60],[-73,23],[10,57]],[[72018,88361],[23,-35],[46,-21],[-2,-46],[28,-36],[-20,-25],[-38,31],[10,69],[-53,40],[6,23]],[[71991,92415],[59,-49],[38,-65],[5,-147],[-54,-10],[-129,23],[-73,50],[19,53],[135,145]],[[72010,88387],[0,-55],[54,-36],[-47,-32],[-37,29],[-12,54],[42,40]],[[71876,88470],[32,-24],[45,-78],[-12,-22],[-63,81],[-2,43]],[[71763,88638],[0,-11],[5,-16],[-6,-18],[12,-18],[43,-11],[30,-44],[-63,15],[-50,-19],[-24,45],[24,32],[7,10],[1,5],[7,3],[-2,4],[-7,2],[-1,5],[-3,6],[1,8],[26,2]],[[71565,92070],[139,-27],[52,-41],[-59,-84],[-65,-30],[-17,-42],[-155,0],[-90,-10],[1,58],[73,46],[46,78],[75,52]],[[71620,88252],[21,-9],[26,-83],[-17,8],[-12,1],[-3,-1],[0,-2],[-4,-4],[-13,10],[-13,-1],[-2,7],[13,18],[-31,31],[35,25]],[[71640,88324],[24,-33],[-12,-45],[-38,21],[13,12],[-2,20],[15,25]],[[71588,88373],[48,-54],[-12,-22],[0,-16],[-10,-7],[-6,-21],[-5,15],[-5,-4],[-7,9],[-7,3],[-1,3],[3,8],[0,6],[-16,24],[17,10],[1,46]],[[71565,88298],[4,-7],[17,1],[-4,-13],[1,-3],[2,-3],[6,-1],[7,-8],[5,2],[5,-15],[-49,-17],[6,64]],[[71189,97124],[359,-89],[-3,-32],[-222,-4],[-93,30],[-90,74],[49,21]],[[71158,92497],[134,-26],[-5,-28],[-80,3],[-49,51]],[[71063,92730],[21,-64],[-80,10],[12,48],[47,6]],[[70665,92434],[100,-24],[-35,-97],[-4,-69],[-80,51],[-61,58],[11,36],[69,45]],[[69676,92698],[70,-20],[8,-133],[41,-15],[62,41],[52,-99],[-86,-5],[-48,-36],[-76,3],[-131,-67],[-64,3],[-36,41],[-16,78],[3,102],[74,38],[64,52],[83,17]],[[69744,87882],[39,-26],[75,-16],[21,-44],[-61,-11],[-68,54],[-6,43]],[[69836,87957],[31,-75],[-81,-25],[-44,52],[46,45],[48,3]],[[69680,87865],[88,-42],[-16,-45],[-19,22],[-29,17],[-24,48]],[[69641,87847],[18,-20],[71,-26],[16,-35],[-27,-4],[-66,49],[-12,36]],[[69609,87822],[83,-50],[14,-42],[-95,-28],[-59,38],[-28,46],[85,36]],[[69315,87887],[-5,-37],[60,-36],[5,-23],[21,-11],[25,-1],[13,-11],[2,-45],[-41,16],[-30,24],[0,-15],[-24,7],[-42,126],[16,6]],[[69330,87878],[47,-5],[65,-98],[-21,8],[-22,-2],[-25,17],[-2,18],[-44,35],[2,27]],[[69369,87756],[22,-21],[47,-22],[-10,-26],[-53,20],[-23,26],[14,9],[3,14]],[[68821,95225],[102,-10],[192,-90],[0,-39],[48,-25],[17,-51],[-56,-41],[-55,-105],[15,-41],[-88,-31],[17,-31],[-65,-34],[-15,-37],[-229,-90],[-19,-19],[-127,-44],[-243,-55],[-204,-100],[-99,-19],[-64,-42],[-96,-5],[-75,-53],[-119,-9],[-14,-26],[-99,-37],[-45,4],[-181,-88],[-102,-5],[-10,-34],[-77,-45],[-38,-71],[-76,28],[-53,-69],[-61,-13],[-30,-99],[-65,41],[-19,-47],[35,-42],[-10,-73],[-87,-1],[8,-79],[-93,-18],[-17,-79],[-37,-23],[-72,32],[-45,51],[-69,-34],[34,-27],[-29,-94],[-79,-2],[-32,-45],[4,-125],[-48,-49],[-65,5],[-33,-135],[-79,26],[-91,49],[90,-124],[5,-98],[-63,-41],[-21,-84],[-104,-30],[-98,57],[-27,-46],[101,-30],[25,-22],[-31,-85],[-58,-50],[-39,5],[-10,-59],[-102,26],[-61,-6],[-38,37],[-75,19],[-76,-11],[-53,51],[-94,33],[-99,-35],[-76,-55],[-60,33],[77,43],[-14,55],[22,36],[174,76],[-113,28],[-99,-68],[-66,19],[-29,42],[-60,36],[100,39],[61,81],[98,23],[44,35],[-46,30],[117,95],[41,4],[69,-33],[75,-9],[-24,52],[-138,53],[92,17],[64,27],[-104,28],[22,39],[71,18],[53,-9],[86,29],[-31,40],[-82,6],[-35,64],[61,41],[32,-27],[83,28],[104,2],[-45,69],[-144,-7],[-28,18],[142,75],[-12,82],[-128,-29],[28,58],[-49,19],[52,77],[54,-36],[117,-23],[52,72],[55,22],[-63,37],[26,44],[60,29],[80,-10],[75,-43],[37,31],[3,53],[-35,57],[99,33],[100,13],[-64,67],[172,47],[7,53],[41,35],[70,-10],[59,52],[103,-8],[175,73],[-85,27],[134,59],[71,-11],[-87,-71],[57,-9],[76,29],[62,76],[-74,8],[42,78],[178,29],[48,-28],[152,-9],[-19,-50],[64,-15],[50,76],[80,-53],[65,49],[65,0],[63,52],[151,3],[93,18],[98,86],[45,-26],[79,29],[58,42],[97,-30],[65,31],[-108,76],[65,66],[173,49],[16,47],[104,50],[180,42]],[[68933,87916],[69,-29],[-3,-46],[-29,-39],[51,-24],[-67,-58],[-64,-11],[-8,28],[-94,38],[-36,57],[18,47],[110,-1],[53,38]],[[68712,90522],[10,-13],[24,-1],[29,-20],[23,-46],[21,-3],[26,6],[15,-3],[2,-6],[-43,-35],[-3,19],[-8,-6],[-6,-11],[-2,0],[-9,8],[-9,2],[-17,-3],[5,16],[-39,23],[-6,15],[-27,5],[14,53]],[[68703,89905],[11,-36],[-25,-69],[-70,26],[36,58],[48,21]],[[68605,89818],[56,-30],[-43,-28],[-13,58]],[[67927,98232],[118,-14],[69,-33],[42,-83],[1,-62],[-130,-110],[-145,-45],[-180,-15],[-188,-32],[-85,72],[-65,26],[63,52],[169,77],[203,4],[37,132],[91,31]],[[67577,98600],[134,-48],[-106,-51],[-185,18],[-3,65],[160,16]],[[67158,97997],[75,-6],[36,-69],[-43,-129],[-136,-31],[-7,-57],[-106,-65],[-127,17],[-82,46],[-159,-41],[-145,57],[60,156],[53,72],[93,22],[112,-38],[267,33],[109,33]],[[66994,98177],[111,-11],[-12,-61],[-133,-78],[-62,-7],[-215,42],[67,52],[244,63]],[[66397,90530],[99,-82],[51,-83],[121,-97],[63,-74],[61,-40],[-1,-33],[31,-65],[-16,-50],[-67,-35],[-65,31],[-24,-36],[-92,36],[17,61],[-61,61],[-54,0],[-53,-22],[-31,53],[-44,25],[-51,80],[-6,50],[-31,22],[-2,52],[77,-8],[-28,51],[35,36],[6,46],[65,21]],[[66517,97442],[119,-36],[-41,-58],[-99,-39],[-164,77],[185,56]],[[66374,98397],[95,-53],[-108,-37],[-111,32],[124,58]],[[66102,97715],[243,-32],[130,-74],[-115,-12],[-77,17],[-165,-65],[117,-25],[-9,-44],[-151,-36],[-141,45],[-24,33],[-9,133],[-66,48],[267,12]],[[66325,98005],[62,-39],[-15,-33],[-144,-37],[-135,24],[60,66],[172,19]],[[66150,98158],[146,-48],[-28,-65],[-79,3],[-117,74],[78,36]],[[66025,98495],[59,-46],[180,-44],[-70,-39],[-121,-3],[-80,30],[-163,18],[-40,28],[85,38],[150,18]],[[65588,98171],[178,-16],[62,-29],[123,-6],[143,-74],[107,-18],[-117,-58],[-68,-5],[-105,37],[-3,46],[-83,41],[-240,66],[3,16]],[[66126,97827],[-41,-65],[-90,-7],[-74,24],[27,36],[178,12]],[[66073,98256],[-30,-86],[-123,-5],[-76,27],[88,44],[141,20]],[[65722,98384],[219,-38],[11,-29],[-230,-111],[-71,47],[-114,-28],[-93,8],[-15,85],[188,-20],[74,26],[31,60]],[[65198,98171],[206,-79],[94,13],[130,-12],[100,-30],[64,-77],[155,-9],[91,-57],[-53,-40],[-112,-22],[-137,81],[-161,15],[-182,83],[-133,14],[-144,61],[82,59]],[[65254,92660],[90,-38],[54,-43],[102,6],[41,-55],[120,-12],[49,-49],[-3,-35],[-75,-17],[39,-49],[-71,-19],[-18,-30],[38,-68],[-31,-43],[-101,-23],[43,-75],[-61,-30],[-34,-61],[-5,-51],[-35,-106],[41,-97],[-32,-28],[-25,-158],[42,-36],[18,-120],[39,-96],[87,-161],[48,-112],[190,-184],[43,-55],[79,-40],[44,-63],[-20,-75],[-61,14],[-18,-49],[-111,44],[-60,62],[-92,-19],[6,-31],[-98,-1],[-30,30],[-64,8],[-32,32],[-50,-54],[11,-56],[-27,-18],[-108,79],[-25,61],[-54,13],[-23,-28],[-50,-6],[-78,42],[-54,2],[-57,57],[63,54],[-62,75],[51,28],[116,12],[-58,43],[-49,-6],[-62,38],[-58,92],[-11,72],[-26,26],[-83,-8],[-58,24],[-24,60],[-117,-27],[28,-43],[-104,-9],[-81,55],[-52,176],[34,202],[68,48],[30,-19],[99,-19],[73,36],[-10,79],[70,75],[-12,50],[54,67],[-39,24],[35,88],[-94,2],[-28,46],[59,96],[82,32],[100,61],[-36,98],[67,74],[51,-1],[82,46],[94,-25],[49,24],[51,58],[87,37]],[[65807,97627],[82,-30],[-33,-30],[-3,-134],[-210,-12],[-142,22],[115,71],[-79,81],[270,32]],[[65689,97921],[123,-40],[-5,-54],[-171,3],[-80,-21],[-108,12],[31,62],[67,26],[143,12]],[[65306,98004],[210,-62],[-230,-50],[-275,59],[37,38],[258,15]],[[64976,97807],[102,-14],[54,-68],[-90,-27],[-66,109]],[[65007,88919],[27,-68],[-47,-77],[-23,1],[-22,-9],[-4,3],[1,30],[13,10],[-1,11],[17,23],[8,33],[31,43]],[[64997,88926],[-48,-102],[3,-13],[-12,-7],[-3,-14],[1,-24],[-3,-14],[5,-6],[-38,-36],[-59,-9],[-4,36],[54,49],[2,54],[22,52],[54,7],[26,27]],[[64728,97656],[120,-20],[-28,-34],[148,-60],[-158,-50],[-108,-6],[-143,21],[-46,53],[119,8],[23,51],[73,37]],[[64922,88704],[-41,-34],[-28,-34],[0,-18],[-53,4],[37,59],[85,23]],[[64851,88947],[42,-97],[0,-60],[-51,-46],[-45,-15],[-56,3],[9,37],[-20,56],[59,65],[-2,31],[64,26]],[[64785,88683],[0,-63],[-42,-38],[-30,-53],[-88,12],[-11,35],[77,37],[49,9],[45,61]],[[64646,91208],[48,-23],[12,-62],[82,-100],[-24,-49],[-90,3],[-42,96],[-89,10],[-33,61],[136,64]],[[64597,88542],[19,-14],[-23,-21],[-10,-1],[-3,-2],[-1,-11],[-15,-25],[-26,0],[-4,12],[-13,2],[-6,-7],[-15,7],[66,34],[31,26]],[[64123,98055],[46,-66],[-147,-30],[49,-32],[176,19],[135,-61],[-115,-58],[-64,-4],[-33,-48],[-189,-16],[-197,-43],[31,-76],[-107,-12],[-136,22],[-17,-39],[41,-47],[-30,-38],[72,-26],[-177,-48],[-170,40],[-27,49],[-211,6],[-74,38],[129,63],[68,-39],[168,-21],[41,29],[-138,19],[112,35],[-65,41],[23,45],[121,15],[105,-49],[39,31],[91,-3],[50,87],[79,11],[-19,45],[-111,11],[-60,32],[171,46],[54,47],[112,24],[95,-38],[79,39]],[[64167,97446],[60,-41],[-28,-37],[46,-55],[-243,12],[79,78],[86,43]],[[64033,98223],[133,-43],[-141,-37],[-31,55],[39,25]],[[63917,97532],[80,-36],[-89,-35],[-149,24],[158,47]],[[63649,89847],[57,-8],[28,-28],[197,-145],[37,-63],[-90,-58],[-34,-47],[12,-24],[-64,-93],[-127,-67],[-96,-31],[-63,-10],[-90,94],[-25,63],[8,133],[26,110],[35,63],[79,81],[110,30]],[[63186,97989],[152,-40],[136,-4],[-18,-44],[89,-56],[-82,-18],[-78,17],[-140,87],[-68,-30],[-82,-90],[-97,-49],[-57,5],[-102,-73],[-35,79],[-186,0],[-145,32],[192,31],[170,15],[211,65],[45,49],[95,24]],[[63270,71546],[-33,-23],[-2,33],[35,-10]],[[61805,87893],[42,-27],[-16,-45],[-45,50],[19,22]],[[61169,86429],[30,24],[26,-100],[-29,9],[-27,67]],[[61185,86350],[-25,-7],[-39,36],[30,23],[34,-52]],[[59880,86709],[28,31],[46,-22],[1,-109],[-68,38],[-7,62]],[[56079,79514],[54,-48],[21,22],[38,7],[47,-15],[35,19],[4,-41],[70,-91],[5,-70],[-34,-41],[2,-57],[-20,-44],[5,-99],[25,-64]],[[56331,78992],[-149,-16],[-211,-12],[-62,3],[-74,18],[-107,12],[-81,22],[-146,30]],[[55501,79049],[37,39],[13,54],[20,-17],[74,81],[-40,21],[-19,-26],[-41,94],[-10,58],[17,68],[38,-13],[40,14],[35,-15],[49,40],[31,44],[75,159],[8,-3],[-77,-157],[-45,-81],[53,-9],[33,-20],[64,-10],[34,20],[5,56],[-12,144],[26,3],[8,38],[26,22],[29,-71],[42,-5],[19,-34],[46,-29]],[[0,89471],[46,-36],[69,-21],[39,16],[25,-68],[53,-10],[91,-43],[39,-78],[-2,-70],[91,-36],[104,-57],[16,-115],[55,-7],[34,-131],[34,-36],[-22,-65],[-51,-19],[-15,-29],[-60,-23],[11,-18],[51,30],[27,42],[32,-6],[34,36],[5,30],[-5,52],[5,4],[-3,8],[2,7],[-4,2],[-4,7],[-4,1],[-2,9],[5,6],[-6,27],[7,40],[31,23],[52,-33],[-4,-39],[60,-2],[264,-203],[-20,-25],[-1,-64],[-52,-28],[32,-41],[75,3],[10,-40],[47,-8],[13,33],[-60,30],[-18,58],[53,32],[121,-82],[35,-113],[-19,-123],[54,8],[26,44],[27,-2],[35,-72],[-31,-24],[-11,-175],[33,-69],[23,-122],[-52,-44],[-14,-34],[31,-52],[27,11],[75,-44],[-4,-108],[45,-28],[41,40],[0,36],[56,-5],[9,-60],[-24,-33],[11,-61],[50,51],[30,86],[-40,60],[-66,16],[-44,31],[85,77],[-11,117],[-23,95],[-46,10],[2,45],[-98,-13],[14,28],[231,6],[7,21],[115,-53],[-23,-50],[9,-107],[37,1],[0,111],[30,-35],[85,-27],[42,25],[149,14],[22,12],[83,-14],[-6,-41],[24,-43],[76,-55],[-7,-52],[80,-82],[53,-39],[60,-63],[25,-48],[40,-31],[61,-16],[33,-77],[46,-22],[55,4],[21,-53],[-20,-54],[-76,26],[-50,-29],[-90,-93],[7,-49],[-16,-125],[-23,-19],[-62,15],[-12,23],[-78,35],[-14,39],[-51,1],[47,-76],[52,-20],[20,-48],[-30,-63],[-60,41],[-94,-12],[-93,8],[-67,46],[-41,64],[-77,-8],[73,-64],[-8,-29],[29,-44],[-17,-36],[51,-20],[-34,-94],[-62,-12],[-4,-32],[81,11],[24,-103],[-30,-78],[-76,-40],[-62,-54],[4,-45],[-23,-85],[69,-72],[47,-12],[24,-61],[-21,-32],[-54,-24],[-36,19],[-8,73],[-58,-7],[45,-50],[-11,-87],[-27,-28],[-47,-13],[-73,36],[-6,67],[-64,-43],[-101,71],[-16,76],[-85,71],[-79,53],[-42,43],[-46,19],[-30,-20],[-108,26],[-9,55],[-85,50],[-3,97],[17,38],[-44,90],[-7,108],[-40,36],[-64,15],[-90,50],[-92,38],[-10,25],[-70,-68],[-24,-40],[-125,-28],[-102,14],[-82,-1],[-14,54],[22,114],[-49,24],[-34,50],[-33,80],[45,72],[5,54],[46,32],[4,133],[-21,19],[-44,-67],[-16,-47],[-58,-20],[-46,80],[-43,-23],[20,-42],[-25,-40],[-64,-12],[-20,46],[-45,-57],[-8,-108],[28,-115],[66,-87],[51,-23],[1,-69],[-66,-89],[-52,7],[-45,-14],[-40,-28],[0,2588],[0,4],[0,1],[0,0]],[[262,91343],[95,-10],[119,-38],[83,-62],[62,-88],[89,-54],[-9,-59],[-30,-38],[-92,-56],[-220,-44],[-118,-46],[-88,1],[-61,35],[-92,20],[0,399],[94,10],[131,-5],[37,35]],[[675,88925],[-5,-33],[19,-46],[3,-9],[6,-2],[5,-10],[-28,-11],[-22,55],[22,56]],[[144,86917],[-16,-124],[-38,-76],[-28,-4],[-62,-66],[0,196],[0,9],[0,5],[44,46],[29,8],[57,-12],[14,18]],[[79994,55458],[-2,-42],[-38,34],[-24,-90],[-23,-3],[-24,-73],[-11,24],[-40,-40],[-10,-62],[7,-43],[-4,-75],[-14,-21],[-19,2],[-18,-37],[-73,4],[1,-33],[-22,-5],[-24,25],[-4,-40],[-19,-9],[-17,36],[-18,60],[-19,47],[-4,1],[-2,-3],[-7,1],[-4,-5],[-2,-9],[-3,0],[-1,-40],[5,-26],[14,-5],[0,-23],[3,-19],[-12,-32],[12,-33],[9,-9],[-11,-24],[-2,-1],[-1,-6],[-2,1],[-2,-5],[2,-2],[2,-5],[-2,-4],[-1,-1],[-1,10],[-3,-10],[-1,0],[-2,6],[-1,3],[-4,1],[-3,-5],[-2,-10],[-10,-9],[-4,6],[-3,0],[-9,-14],[-2,4],[-3,-2],[-3,1],[-1,5],[-1,2],[-1,-1],[-3,-4],[0,-3],[1,-4],[3,-6],[-5,-5],[-4,-10],[-4,-3],[-3,-8],[-9,11],[-11,0],[-10,-28],[10,-37],[9,-10],[2,-41],[4,-13],[10,-12],[-4,-29],[2,-8],[6,-5],[7,0],[5,-6],[1,-8],[-7,-14],[-3,-14],[2,-12],[6,0],[4,6],[5,-3],[0,-25],[1,-2],[4,2],[-2,-18],[-3,-11],[-15,-4],[-17,-31],[-4,-17],[-2,-29],[9,-46],[1,-24],[-9,-55],[-28,-35],[-15,33],[-19,-32],[-6,-103],[-19,-44],[-15,-112],[-7,-124],[5,-80],[-18,-40],[-2,-76],[-24,-28],[-8,-66],[6,-63],[15,-16],[10,-51],[14,-30],[8,-83],[14,-73],[17,-57],[50,-134],[17,-7],[26,-38],[26,-71],[21,-9],[5,-42],[20,-75],[-17,-47],[3,-80],[19,-94],[35,-130],[44,-111],[40,-78],[43,-74],[-1,-50],[24,-79],[31,-73],[56,-111],[-4,-34],[42,-33],[50,-128],[-13,-8],[11,-54],[18,-9],[11,35],[32,-12],[3,-61],[25,-7],[-5,-59],[19,-41],[16,-6],[12,-73],[30,-65],[4,-41],[28,-122],[28,-92],[2,-46],[21,-8],[20,-39],[15,14],[22,-111],[-4,-33],[3,-75],[9,-88],[20,-114],[20,-82],[-2,-109],[15,-79],[0,-50],[21,-101],[6,-68],[-2,-38],[11,-49],[-2,-55],[13,-48],[1,-66],[-23,-26],[4,-75],[17,-58],[1,-75],[-20,-4],[10,-67],[17,-73],[-7,-31],[2,-59],[44,-168],[-28,-52],[-36,-91],[-10,-47],[2,-43],[28,-69],[6,-40],[-8,-51],[-14,42],[-12,-5],[5,-134],[-6,-72],[3,-37],[20,-82],[1,-46],[-41,22],[-6,-41],[18,-6],[15,-73],[-9,-21],[-9,-67],[-12,-34],[-24,10],[-6,-51],[0,-115],[-24,-35],[-21,19],[-27,-38],[-7,-68],[-42,-5],[-20,-30],[-9,-63],[-33,-23],[-5,-45],[-27,-1],[-45,-32],[-10,-49],[-8,-74],[-14,-23],[-23,10],[-18,-16],[-16,-39],[-20,-12],[-32,-41],[-16,-48],[-19,-23],[-19,2],[-33,-66],[-19,38],[-28,-78],[-4,42],[19,23],[7,41],[-21,15],[-18,80],[-1,47],[-55,-27],[-18,48],[-7,-44],[-13,13],[-9,-64],[-2,-12],[1,-16],[-2,-8],[2,-4],[2,0],[2,-10],[7,-41],[11,29],[14,-54],[0,-83],[-26,5],[-12,-12],[-54,24],[-23,28],[-46,-23],[-25,-25],[-35,36],[-22,-41],[-43,59],[-15,35],[-32,27],[-6,44],[-14,29],[-18,5],[-9,39],[-21,142],[0,38]],[[79260,47797],[19,53],[36,12],[67,57],[33,-134],[22,33],[27,-57],[26,0],[6,18],[-14,57],[15,40],[-1,59],[-46,62],[-2,33],[-29,37],[-12,55],[5,37],[0,119],[-21,50],[22,54],[17,-26],[15,46],[6,50],[21,-19],[41,-14],[19,-38],[14,15],[23,-17],[-10,63],[14,80],[-14,70],[59,3],[16,-7],[15,25],[15,60],[37,-14],[20,23],[39,97],[4,33],[32,35],[26,-4],[7,-34],[44,56],[-1,44],[13,106],[-8,111],[1,55],[-18,62],[-4,48],[3,61],[37,242],[-3,114],[-23,155],[-23,39],[-2,139],[-24,19],[3,44],[-10,27],[20,84],[-4,60],[16,68],[11,-4],[19,154],[0,47]],[[79876,50540],[-13,79],[22,48],[-1,20],[-30,48],[-1,44],[19,21],[22,1],[-6,96],[7,34],[1,72],[-7,64],[-24,-3],[-1,40],[-17,22],[-18,-8],[-15,93],[-19,23],[3,30],[-17,92],[5,14],[54,62],[10,61],[-5,28],[-32,4],[-24,63],[-23,14],[-1,64],[-18,37],[-34,-5],[-1,33],[-26,64],[4,61],[-14,21],[-18,-85],[-24,8],[-7,22],[-3,86],[-19,11],[-8,61],[-1,166],[-9,33],[-21,16],[-38,153],[1,41],[-21,-10],[-39,79],[-65,188],[-29,33],[-6,54],[-16,38],[3,27],[-21,43],[7,69],[-15,16],[0,36],[-22,89],[-12,12],[-13,-37],[-25,34],[3,40],[-20,8],[-21,41],[-22,88],[8,103],[18,34],[-26,46],[-38,29],[-16,33],[-31,-5],[-34,40],[-25,47],[-12,50],[-26,9],[-13,50],[-29,42],[-24,5],[-8,55],[-33,32],[-20,-2],[-19,33],[-5,32],[15,39],[25,29],[16,66],[0,38],[-14,59],[22,6],[7,25],[21,9],[52,-6],[8,-34],[30,-30],[22,8],[6,57],[17,39],[32,28],[2,94],[14,23],[11,58],[15,39],[-23,41],[-13,-5],[-25,41],[-14,0],[-30,54],[3,65],[24,33],[-14,44],[-13,-36],[-40,-39],[-13,5],[-7,80],[35,44],[5,35],[17,6],[-3,50],[-10,33],[-61,98],[-14,49],[-53,28],[-17,-46],[-38,4],[-33,-74],[4,-39],[-16,-11],[-13,-53],[-14,44],[-36,25],[-18,31],[-16,-10],[-26,38],[-18,9],[-4,36],[-24,5],[-12,25],[-13,82],[-18,9],[-17,115],[-13,19],[16,107],[-8,46],[28,82],[-1,97],[-36,1],[-2,88],[-10,-3],[3,-75],[-25,-55],[-17,-1],[-7,55],[3,37],[-14,97],[-27,32],[-22,107],[-28,37],[-25,51],[-27,117]],[[79918,51856],[58,-117],[-19,-2],[-39,119]],[[79852,55239],[13,-5],[13,-51],[-43,-79],[5,78],[15,16],[-3,41]],[[79716,54957],[15,10],[16,-57],[-33,-19],[-15,31],[17,35]],[[79637,54944],[26,-76],[-19,-24],[-8,6],[-10,-5],[-9,8],[-20,51],[-21,73],[3,12],[-3,23],[3,8],[-1,9],[-4,4],[11,22],[46,-83],[6,-28]],[[79630,47339],[28,-36],[-20,-72],[-24,76],[-21,21],[-5,41],[42,-30]],[[79621,47377],[13,12],[16,-21],[1,-43],[-30,52]],[[79636,47604],[12,-22],[-8,-42],[-7,0],[-3,-4],[-2,11],[-3,1],[0,12],[-1,9],[2,16],[4,2],[7,39],[7,-15],[-8,-7]],[[79628,54806],[-19,-46],[1,-60],[-6,-89],[-30,-52],[-37,62],[-10,-23],[-7,-12],[-5,3],[0,16],[7,16],[1,5],[0,8],[-2,7],[-16,5],[-2,9],[4,25],[-3,14],[-9,6],[-3,42],[-3,15],[-8,6],[-2,52],[21,-3],[6,-2],[-2,9],[4,3],[5,11],[5,5],[-4,9],[-1,3],[5,5],[1,-7],[4,-1],[2,2],[2,-5],[9,16],[4,-7],[4,0],[9,9],[2,10],[4,5],[4,-4],[2,-6],[1,0],[2,5],[1,-3],[1,-2],[1,1],[2,2],[0,5],[-1,3],[-1,6],[3,0],[1,7],[3,-4],[2,2],[5,9],[7,-1],[18,-28],[5,-16],[9,-8],[11,3],[3,-31],[-10,-11]],[[79551,47294],[-9,43],[22,12],[2,19],[29,-44],[19,-20],[22,-74],[-12,-67],[-13,2],[-34,43],[-26,86]],[[79531,47345],[20,-79],[28,-78],[48,-59],[7,-31],[-17,-56],[-33,72],[-36,59],[-26,59],[-37,109],[-19,24],[-33,3],[-6,22],[15,24],[25,-38],[17,0],[19,-26],[28,-5]],[[79558,55099],[3,2],[2,10],[6,3],[2,0],[5,3],[3,-1],[3,-8],[5,-17],[10,-18],[-12,-17],[-27,10],[0,33]],[[79565,54502],[-22,-27],[-45,-126],[4,38],[0,27],[-9,38],[5,45],[17,33],[8,-9],[6,9],[4,11],[2,20],[0,4],[-3,-2],[-1,2],[2,42],[23,-19],[16,-32],[19,20],[13,-39],[-39,-35]],[[79548,46844],[-12,39],[19,32],[34,2],[-6,-55],[-35,-18]],[[79264,47579],[9,10],[26,-29],[11,-46],[20,-41],[30,-9],[23,-83],[25,-12],[14,8],[13,-14],[6,4],[29,-17],[19,-35],[5,-38],[84,-207],[10,-60],[13,-15],[-12,-76],[-34,-3],[-32,-15],[-31,58],[-25,60],[-32,106],[-36,56],[-12,43],[-37,64],[-17,65],[-34,74],[-8,70],[-16,6],[-17,60],[6,16]],[[79549,47348],[-25,23],[-16,-15],[-7,46],[54,14],[13,-24],[-5,-43],[-14,-1]],[[79482,46932],[43,-56],[-19,-44],[-24,100]],[[79012,47484],[30,27],[9,46],[30,8],[16,-14],[32,3],[25,83],[39,59],[-10,55]],[[79183,47751],[18,-64],[20,-15],[3,-49],[7,-24],[8,-20],[17,-12],[7,-57],[14,-15],[16,-57],[56,-154],[29,-54],[18,-58],[30,-67],[34,-96],[41,-176],[-5,-98],[-76,-73],[-109,-123],[-35,-85],[-19,-114],[-18,5],[-33,-55],[-20,19],[-18,-17],[-11,-17],[-15,-33],[-17,1],[10,72],[-20,-17],[-10,25],[5,67],[11,499],[5,91],[13,93],[15,2],[24,61],[18,6],[-7,42],[-25,65],[-33,-1],[-26,85],[-15,9],[-25,-60],[-14,74],[-39,128]],[[79263,47677],[8,-5],[13,-78],[-15,-2],[-6,85]],[[79224,47757],[25,-42],[18,-120],[-10,-26],[-15,11],[-15,35],[-5,60],[-21,14],[3,42],[20,26]],[[79243,47817],[10,-45],[-21,-14],[-12,75]],[[79220,47833],[23,-16]],[[79216,47834],[9,-76],[-32,-30],[-11,35]],[[79182,47763],[-8,57],[22,19],[20,-5]],[[79142,46239],[15,18],[1,16],[10,16],[18,19],[32,-31],[-22,-77],[-30,-27],[-43,-25],[-27,21],[11,72],[35,-2]],[[78872,47456],[15,48],[23,-59],[1,-89],[-18,-117],[-7,-24],[-12,137],[-24,46],[-7,52],[23,-13],[6,19]],[[79260,47797],[-17,20]],[[79220,47833],[-4,1]],[[79182,47763],[1,-12]],[[79012,47484],[-8,41],[-36,0],[-13,67],[-54,-19],[-34,38],[-16,46],[-17,-87],[-21,-33],[-28,-7],[-15,38],[-21,75],[12,52],[33,16],[14,93],[-14,89],[16,86],[-33,-15],[-13,51],[-13,4],[-17,-52],[1,-36],[-11,-66],[-2,-51],[-15,4],[-21,32],[-31,-46],[-18,33],[0,104],[5,48],[-14,91],[9,28],[-2,83],[8,38],[-17,36],[-3,41],[-38,57]],[[78585,48363],[1,68],[-22,79],[-16,107],[-1,48],[-19,72],[7,143],[16,31],[-25,76],[-10,44],[-22,51],[-20,12],[-3,50],[9,52],[-8,27],[-4,70],[2,47],[-26,99],[-14,87],[-2,55],[6,164],[44,-9],[23,37],[-16,31],[9,29],[30,36],[21,76],[5,55],[35,63],[-3,26],[15,107],[13,5],[23,60],[28,28],[75,23],[29,41],[28,-7],[12,-20],[68,-41],[23,5],[62,32],[51,-17],[18,12],[18,-16],[24,50],[29,-11],[15,21],[54,-53],[-4,-37],[17,-69],[14,-1],[29,93]],[[79223,50294],[0,-47],[22,-77],[21,-47],[25,-2],[29,42],[26,-37],[38,-18],[0,-30],[35,-81],[53,-14],[0,51],[24,59],[-19,35],[-2,51],[-17,14],[-8,78],[-8,27],[54,2],[13,31],[6,67],[20,-35],[22,8],[15,73],[23,29],[7,-53],[19,-50],[29,-16],[15,-71],[11,-25],[18,30],[18,-15],[14,60],[17,18],[9,-21],[22,31],[5,37],[34,74],[33,-45],[4,56],[26,57]],[[78604,48154],[10,43],[9,-81],[-17,-26],[-2,64]],[[79223,50294],[20,8],[42,47],[31,117],[-6,49],[1,124],[15,52],[-1,75],[-29,94],[16,78],[18,24],[-5,38],[-19,-9],[-2,52],[21,12],[6,78],[12,86],[-11,64],[-28,32],[-17,-9],[-26,120],[18,68],[-48,20],[-52,41],[-9,103],[-34,71],[-12,73],[-20,33],[-12,55],[8,91],[-7,82],[6,25],[-8,110],[17,95],[4,71],[-1,107],[-24,96],[-68,99],[-36,131],[-17,15],[-17,95],[-31,87],[-13,78],[-24,85],[-32,-37],[-13,40],[-30,1],[-25,44],[-59,33],[-26,-11],[-18,-58],[15,-36],[-31,-26],[-13,-74],[-15,-22],[-1,-63],[-12,-48],[-26,19],[-44,-50],[-6,-26],[-34,-49],[-15,13],[7,42],[-5,38],[-33,5],[-33,51],[-22,18],[-26,61],[-6,41],[-23,10],[-35,-82],[-13,-51],[-32,24],[-7,-9],[-10,-97],[-32,-18],[-18,-60],[-57,-108],[-11,-7],[-22,-81],[-31,-42],[-38,68],[8,113],[-4,54],[11,20],[-4,42],[27,42],[2,35],[17,48],[-6,43],[8,62],[-13,33],[10,52],[-27,37],[-9,30],[14,68],[23,30],[24,94],[-10,34],[7,50],[-4,59],[25,80],[1,48],[-23,39],[-1,83],[-17,99],[6,70],[14,-5],[7,72],[-13,24],[-34,-22],[-26,42],[-31,-3],[-31,-80],[-10,-12],[-32,42],[-16,-36],[-30,26],[-11,60],[0,57],[-12,32],[11,61],[16,24],[19,163],[-32,77],[-34,139],[-16,2],[-16,-62],[-29,-46],[-7,73]],[[77801,54603],[10,37],[1,57],[17,124],[19,67],[21,26],[8,32],[37,-11],[32,17],[8,43],[-35,-8],[10,99],[25,25],[17,81],[11,101],[20,-15],[39,62],[13,4],[18,50],[28,52],[-5,26]],[[77801,54603],[-36,81],[-25,-14],[-16,-79],[-22,10],[-13,-24],[-41,29],[-8,-22],[12,-107],[-26,-56],[-40,-20],[-14,30],[-29,15],[-24,-29],[-8,-41],[-2,-129],[-14,-84],[-15,25],[-28,16],[-15,-31],[-29,-1],[-18,-30],[-24,4],[-13,-14],[-43,1],[-20,-15],[-8,35],[-23,46],[-28,12],[-2,-121],[-14,-25],[-32,-18],[4,-51],[-23,-79],[13,-122],[-1,-95],[-28,-38],[1,-44],[-14,-22],[13,-44],[11,-142],[-2,-80],[-33,0],[-12,-29],[-45,-30],[-12,-31],[14,-45],[3,-56],[12,-32],[12,48],[25,-32],[-7,-46],[18,-48],[3,-55],[13,-87],[-18,-55],[6,-39],[18,-41],[2,-32],[44,-133],[19,-21],[18,-52],[13,-66],[20,-63],[19,-26],[12,-48],[0,-32],[16,-45],[26,-9],[27,-97],[-12,-42],[-8,-82],[13,-19],[0,-38],[14,-13],[5,-53],[22,-71],[-6,-23],[8,-96],[60,96],[14,-69],[-8,-53],[-14,-29],[0,-56],[-13,-23],[-29,23],[-21,-68],[-11,-88],[7,-33],[-17,-135],[1,-60],[9,-93],[-1,-69],[-26,13],[-20,-20],[-6,-74],[-25,37],[-26,-98],[-8,-58],[14,-37],[7,-130],[-3,-23],[21,-87],[32,-73],[31,-125],[13,-76],[10,-9],[34,-72],[22,-31],[13,-35],[24,-29],[15,-98],[16,-37],[12,-87],[9,-12],[9,-187],[7,-61],[-6,-87],[6,-58],[-22,-4],[-1,-71],[-8,-22],[22,-57],[3,-105],[8,-13],[7,-77],[14,-31],[33,-45],[6,-35],[-9,-76],[11,-43],[-2,-41],[22,-140],[16,-2],[-10,-57],[1,-37],[15,-16],[-4,-61],[13,-54],[9,-2],[-6,-73],[-15,-34],[-5,-38],[-27,-9],[2,-58],[-22,-52],[0,-56],[-23,-48],[-2,-72],[-22,-57],[-19,-73],[-15,-15],[-7,-42],[-15,12],[-7,-43],[3,-39],[-14,-32],[-27,-24],[-20,-68],[9,-111]],[[77450,47559],[-4,-40],[-18,-57],[-4,-58],[-34,-66],[10,-45],[-12,-16],[-7,-82],[-13,-7],[-9,143],[11,120],[-4,77],[-13,64],[-3,51],[32,46],[5,64],[36,72],[9,67],[-14,110],[9,30],[-2,135],[4,49],[15,-20],[-7,87],[-13,54],[3,44],[37,24],[-11,39],[-2,62],[-8,12],[-3,101],[-24,125],[22,-30],[23,43],[-7,85],[-12,-7],[-32,67],[-3,75],[10,73],[5,132],[-23,16],[-3,74],[-10,8],[3,99],[-9,44],[6,29],[-35,108],[-7,81],[-20,89],[-4,41],[-20,41],[11,20],[-14,65],[-9,94],[-22,-92],[-4,-76],[-14,13],[-7,64],[8,68],[-7,19],[-5,91],[12,57],[1,63],[-13,13],[-16,47],[-8,51],[-4,95],[-14,58],[0,89],[24,21],[-7,51],[-24,37],[5,-84],[-17,-12],[-13,136],[8,59],[-7,24],[3,88],[-21,89],[0,55],[13,34],[-9,64],[5,35],[-10,55],[-3,182],[-29,63],[-14,91],[9,6],[13,98],[0,60],[-7,32],[0,119],[-27,21],[-45,-25],[-8,72],[-25,72],[-2,76],[-16,103],[1,75],[-19,-42],[-19,14],[9,66],[-11,45],[-1,45],[-16,52],[-24,-4],[6,-111],[-7,-80],[-22,-115],[-12,-34],[4,-43],[-21,-114],[-15,-43],[-44,-53],[-24,-1],[-31,55],[-6,66],[-9,27],[-4,58],[-24,1],[-43,-42],[-12,4],[-24,-44],[11,-32],[-1,-48],[-14,-28],[-3,-34],[-5,0],[-3,9],[-9,6],[-7,-9],[-2,-44],[-17,-14],[-1,12],[-2,6],[-5,2],[-2,-25],[-4,6],[-2,-1],[-1,-10],[-7,-6],[-4,2],[-2,-3],[-7,-24],[-34,-21],[-8,10],[-19,16],[1,73],[-2,5],[-9,2],[9,46],[13,15],[15,36],[0,45],[7,20],[-2,31],[17,7],[-9,44],[-30,-15],[-10,-13],[0,-10],[3,-2],[-2,-18],[6,-22],[-7,-3],[-8,20],[-3,0],[-3,-3],[-8,-23],[0,-13],[-2,-2],[0,-5],[-1,-3],[-1,-4],[-3,-2],[-3,1],[-3,-14],[-8,-2],[1,-5],[-2,-11],[1,-3],[-1,-11],[-7,0],[-2,-2],[-2,5],[-6,-4],[-11,-49],[-6,-70],[-8,-20],[11,-27],[-10,-47],[-18,-37],[-20,-14],[-8,-43],[-17,7],[-16,-43],[-11,-63],[-27,-9],[24,103],[2,55],[-7,34],[14,107],[-4,60],[11,20],[3,44],[8,4],[1,20],[-5,16],[-5,1],[-5,19],[7,53],[-3,160],[13,47],[9,14],[0,13],[3,12],[6,0],[3,12],[0,15],[6,8],[-1,15],[7,4],[5,12],[1,19],[3,14],[3,1],[0,14],[-7,36],[5,39],[11,13],[2,-16],[4,-2],[2,7],[3,1],[1,-6],[3,2],[2,7],[6,9],[4,13],[-1,21],[6,-1],[0,7],[-4,12],[3,20],[-1,13],[3,2],[1,9],[9,1],[0,10],[-5,9],[2,3],[4,0],[5,6],[3,0],[3,8],[-2,49],[3,8],[6,1],[3,3],[2,0],[1,3],[-3,60],[22,14],[3,4],[2,9],[4,9],[1,14],[4,2],[13,25],[10,2],[6,-31],[-14,-16],[12,-31],[14,42],[-6,106],[-13,-69],[-17,-2],[3,-12],[-13,-16],[0,-14],[-4,-7],[-3,-11],[-4,-4],[-8,-4],[-7,2],[-5,-11],[0,-48],[2,-8],[0,-5],[0,-1],[-11,-5],[-5,-10],[-3,-26],[6,-23],[-2,-6],[-13,-5],[-2,-5],[1,-4],[4,-6],[-6,-5],[-3,-6],[-1,-8],[-3,-2],[2,-15],[-3,-15],[0,-6],[4,-11],[-5,-3],[-4,-19],[0,-14],[-7,-11],[-3,-9],[-2,8],[-2,0],[-4,-9],[0,17],[-5,1],[-11,-14],[-6,-37],[8,-43],[-6,-16],[-6,-36],[-7,-4],[-3,-8],[-3,-19],[0,-12],[-4,-13],[-4,1],[-4,-13],[-22,-72],[1,-169],[-19,-137],[4,-60],[-20,-78],[-27,-48],[-1,-65],[-20,-69],[-21,-24],[-33,-68],[-11,60],[0,80],[9,23],[-1,108],[30,150],[7,62],[-2,67],[13,52],[-8,54],[15,13],[15,132],[15,80],[-10,49],[25,57],[-10,67],[3,56],[-7,37],[17,81],[-17,7],[-6,58],[-10,29],[-4,116],[3,75],[-7,36],[6,75],[-20,20],[-23,0],[0,36],[24,10],[-5,38],[-15,4],[-5,50],[-17,51],[-4,107],[9,76],[-21,22],[0,49],[-24,51],[7,176],[-12,41],[-6,54],[8,73],[-11,8],[-19,78],[-18,-29],[-20,20],[7,87],[-26,116],[-7,87],[-10,33],[-15,-32],[-28,63],[-41,71],[-4,42],[-14,76],[-11,37],[-30,-32],[-24,17],[-1,-59],[-17,-49],[-18,29],[11,92],[29,49],[-2,57],[-16,38],[-14,-68],[-3,-98],[-19,-28],[-4,51],[-24,106],[-24,38],[-7,-117],[-9,-43],[-26,118],[-21,52],[-4,41],[-32,62],[-22,146],[5,23],[-16,61],[-6,47],[-11,31]],[[75616,55154],[-4,-2],[-1,3]],[[75611,55155],[-5,27]],[[75606,55182],[9,52],[-5,55],[51,123],[25,-90],[25,18],[10,-98],[23,31],[-16,136],[-6,162],[3,101],[6,23],[-8,71]],[[75723,55766],[20,25],[4,93],[48,-54],[8,-42],[28,31],[15,111],[31,-5],[12,48],[-5,115],[-12,22],[-8,75],[7,17],[-13,92],[15,167],[-3,76],[21,-1],[11,-30],[22,24],[15,132],[-4,79],[9,41],[-1,86],[9,55],[2,70],[-11,46],[-1,125],[-16,37],[-2,73],[19,6],[15,-73],[25,-25],[23,44],[28,-9],[27,-53],[20,20],[34,-18],[39,-56],[3,57],[20,76],[5,92],[42,199],[13,94],[15,16],[10,82],[23,34],[1,61],[17,49],[3,54],[11,38],[-1,64],[-41,49],[-2,52],[30,142],[31,20],[11,49],[15,7],[11,70],[28,52],[-8,113],[23,40],[25,86],[-18,19],[1,184],[-14,83],[22,80],[0,22],[23,48],[19,-23],[36,36],[31,97],[18,-15],[16,64],[24,4],[4,48],[13,27],[17,1],[20,29],[22,89],[17,28],[61,54],[22,-7],[21,16],[16,-15],[24,58],[27,4],[27,-20],[24,-84],[4,-42],[23,-9],[24,-47],[19,1],[7,36],[-21,70],[-24,54],[-13,66],[-14,33],[6,53],[-6,63],[21,35],[11,55],[12,7]],[[76961,59908],[66,119],[22,-16],[-2,102],[-12,35],[5,93]],[[77431,48810],[22,10],[6,-63],[-15,-27],[-13,80]],[[77410,48819],[16,6],[8,-40],[-9,-31],[-15,65]],[[77357,48446],[15,-31],[-8,-33],[9,-49],[-15,-28],[-14,2],[-1,49],[-8,46],[22,44]],[[77303,49077],[19,19],[11,-29],[-3,-38],[10,-93],[-17,-87],[-17,7],[7,69],[1,85],[-11,67]],[[77285,47210],[9,-20],[-3,-46],[-37,-34],[15,78],[16,22]],[[77256,47849],[14,40],[15,-45],[-6,-27],[-23,32]],[[77293,48430],[8,-60],[-6,-30],[2,-108],[-24,-13],[0,54],[20,157]],[[77238,48799],[20,-17],[-14,-52],[-10,31],[4,38]],[[77235,48883],[0,-36],[-15,-29],[-9,77],[24,-12]],[[77224,48464],[14,-8],[-1,-59],[-12,4],[-1,63]],[[77067,51806],[16,43],[31,-31],[-23,-191],[-20,77],[5,31],[-9,71]],[[76620,51843],[14,27],[1,59],[-6,33],[19,37],[11,-5],[44,38],[16,-14],[14,-67],[-2,-42],[9,-61],[17,-41],[-7,-40],[-49,-55],[-40,67],[-17,-3],[-10,6],[-7,36],[-9,4],[2,21]],[[76657,51696],[7,65],[23,-55],[-16,-47],[-14,37]],[[76635,51646],[5,76],[12,5],[-2,-62],[-15,-19]],[[76601,51791],[-9,26],[6,10],[10,-5],[4,-11],[6,-5],[10,3],[0,-18],[5,-12],[11,-11],[2,-16],[-7,-30],[-4,-66],[-33,-78],[-7,-2],[-9,162],[15,53]],[[76491,51630],[6,24],[0,41],[40,25],[6,12],[2,13],[5,-1],[6,5],[3,12],[4,-6],[2,3],[1,23],[6,-9],[0,-11],[11,-13],[-5,-61],[9,-34],[6,-88],[-8,-25],[-10,-82],[-44,-119],[-57,72],[12,41],[1,78],[-7,29],[11,71]],[[76431,51758],[10,24],[3,51],[14,28],[2,44],[16,24],[-1,32],[9,8],[-8,22],[4,17],[-4,9],[8,13],[6,2],[12,4],[10,-26],[-5,-9],[-1,-15],[-6,-21],[2,-38],[-15,-57],[-14,-15],[-5,-28],[-5,-22],[-4,1],[1,-17],[-3,-13],[2,-24],[5,-9],[-4,-33],[-9,-7],[-13,-46],[-12,18],[5,83]],[[76468,51650],[-2,65],[5,12],[23,-20],[2,-11],[-1,-41],[-20,-39],[-4,-23],[7,-44],[-29,-57],[-10,53],[24,50],[5,55]],[[76463,51610],[-9,29],[0,63],[7,6],[2,9],[2,29],[-6,7],[-1,24],[2,9],[-1,19],[13,-4],[4,-6],[-2,-61],[-9,-14],[-3,-39],[1,-71]],[[76440,51916],[8,14],[2,3],[0,4],[2,2],[5,21],[5,24],[5,0],[8,-47],[-16,-29],[-2,-41],[-22,-28],[-1,-29],[-19,-12],[3,64],[12,23],[2,-1],[0,11],[1,16],[7,5]],[[76419,51383],[1,40],[28,-46],[-11,-34],[-18,40]],[[76413,51505],[6,34],[17,27],[2,-64],[-25,3]],[[76362,51527],[8,21],[6,38],[17,-4],[25,109],[2,-122],[-58,-42]],[[76405,51677],[-14,-93],[-11,6],[-7,-4],[-20,-61],[-5,43],[10,53],[20,10],[18,50],[6,37],[0,31],[16,34],[8,-51],[-21,-55]],[[76349,51475],[10,12],[13,-40],[-26,-42],[-7,40],[10,30]],[[76324,51522],[22,15],[-22,-80],[-12,40],[12,25]],[[76298,51849],[7,77],[15,6],[3,-30],[-8,-6],[-3,-44],[-14,-3]],[[76272,51605],[24,25],[-6,-61],[-21,-85],[-19,-13],[-14,-43],[-16,-17],[-3,74],[17,13],[18,66],[20,41]],[[75964,53897],[11,47],[26,-19],[1,-108],[8,-36],[29,35],[14,-40],[18,5],[12,-44],[-1,-38],[15,-32],[10,-55],[-14,-66],[-19,14],[-26,53],[-30,32],[-9,91],[-11,11],[-34,150]],[[76048,53967],[14,-41],[7,-76],[-32,37],[-1,37],[12,43]],[[75966,53540],[41,17],[32,-9],[2,-107],[-7,-38],[-17,-5],[-33,68],[-18,74]],[[75951,54266],[20,12],[1,-90],[-16,9],[-5,69]],[[75912,54528],[-6,43],[13,14],[13,-36],[15,-106],[-11,-37],[-12,18],[-12,104]],[[75897,54527],[18,-50],[-18,-14],[-14,30],[14,34]],[[75863,54255],[-36,176],[23,6],[20,-90],[-9,-39],[2,-53]],[[75841,54626],[9,70],[13,-45],[-22,-25]],[[75781,54500],[30,-12],[-7,-44],[-13,-2],[-10,58]],[[78585,48363],[-1,44],[-11,60],[-25,80],[-6,97],[-27,60],[2,34],[-10,34],[-20,10],[-12,-46],[-60,12],[-9,62],[30,55],[-18,29],[-23,-45],[-17,49],[-41,92],[-24,8],[-8,48],[-38,76],[-13,1],[-21,-48],[-24,-11],[-33,-1],[-4,-28],[-38,48],[-52,17],[-29,-16],[-37,8],[-5,62],[14,9],[5,37],[-15,66],[18,57],[-12,87],[16,68],[-10,67],[24,60],[-4,60],[-23,2],[-74,41],[-78,-29],[-21,0],[-57,-47],[-19,-65],[-12,-18],[3,-40],[30,-71],[-1,-51],[8,-28],[-15,-53],[-4,-53],[-16,-110],[-4,-82],[13,-203],[-7,-47],[12,-62],[-46,-152],[-11,-70],[-6,-96],[-17,-44],[-21,-95],[-14,-96],[-14,-71],[-4,-80],[-12,-32],[-2,-158],[9,-33],[-22,-17],[-5,-55],[-13,-64],[-16,-26],[-13,-91],[-10,-15],[-5,-101],[-19,-3],[-3,-39],[22,-68],[-20,-73],[9,-69],[-8,-31],[4,-91],[-7,-28],[7,-108],[13,-51],[10,-91],[13,-48],[-22,-51],[2,-56],[31,-66],[22,29],[15,-6],[20,64],[22,-9],[19,40],[15,-2],[29,-34],[9,-43],[-1,-56],[11,-41],[0,-103],[11,-220],[18,-54],[20,-110],[7,-18],[24,-1],[15,-36],[-20,-30],[8,-60],[7,-4],[12,31],[15,-214],[27,-298],[15,-115],[15,-71],[16,-36],[37,-137],[23,-51],[10,6],[23,-50],[36,-41],[15,0],[40,49],[21,-25],[14,19],[47,-35],[20,-87],[53,-198],[16,-18],[36,-94],[22,-32],[-2,-41],[2,-17]],[[78356,44431],[-9,-63],[-30,-66],[0,-83],[-22,-58],[-20,-29],[-11,34],[-17,-30],[-9,44],[1,37],[-23,47],[-27,-46],[-24,2],[-7,-30],[-27,-14],[-4,-72],[-34,-70],[-9,50],[-20,39],[-13,52],[14,77],[13,-6],[10,147],[-17,20],[19,36],[-9,49],[-18,-12],[-14,26],[-17,-23],[-23,30],[-6,109],[-29,21],[-13,-14],[-46,50],[-38,19],[-19,102],[-32,3],[-6,-98],[1,-55],[-11,-42]],[[77810,44614],[5,136],[-26,-6],[-15,64],[-36,60],[-1,22],[-29,33],[2,81],[-13,33],[5,59],[15,30],[-45,84],[-8,-26],[-19,20],[8,53],[-13,25],[-22,-27],[-3,31],[-17,29],[-9,72],[2,39],[-13,27],[5,66],[-11,20],[-14,-20],[-24,75],[-6,-60],[-18,-1],[4,147],[-24,89],[-24,36],[-9,-49],[-30,45],[10,53],[-10,91],[-29,17],[10,72],[-25,12],[-36,-19],[-10,-55],[10,-51],[-5,-59],[-19,-31],[13,-44],[-5,-60],[4,-50],[-9,-47],[-20,-57],[-2,105],[-7,123],[8,32],[-6,93],[-17,197],[8,91],[-4,57],[8,23],[1,66],[11,6],[13,101],[1,114],[9,22],[-3,68],[5,52],[19,115],[10,-40],[11,90],[-4,24],[16,85],[-1,85],[9,49],[-5,31],[20,81],[16,115],[13,40],[-5,32],[10,68],[5,12],[5,49]],[[78479,48388],[7,55],[16,-80],[-5,-64],[-13,25],[-5,64]],[[78407,48692],[24,3],[17,-104],[-23,6],[-12,26],[-6,69]],[[77838,45889],[-9,60],[19,29],[6,-60],[-16,-29]],[[77795,46877],[-3,-76],[-12,-37],[-21,8],[-1,105],[37,0]],[[77766,47010],[6,25],[20,-4],[7,-78],[-27,21],[-6,36]],[[77677,44797],[12,6],[3,-108],[-22,22],[0,67],[7,13]],[[70712,66563],[-60,-49],[-30,-49],[-18,16],[-16,-56],[-45,3],[-19,50],[-25,-16],[-35,16]],[[70464,66478],[-28,-17],[-48,8],[-25,-22],[-63,13],[-12,-19],[-27,5],[-14,-20],[-39,11],[-45,-13],[-24,-38],[-23,-2],[-65,-51],[7,-34],[-32,-11],[-45,-72],[-5,-27],[-30,-2],[-4,-75],[-38,59],[-20,-99],[-39,-55],[-64,-134],[12,-60],[31,-22],[4,-45],[13,-13],[22,-107],[4,-95],[27,-25],[-8,-51],[18,-45],[-32,-91],[39,-76],[-42,-81],[6,-49],[-22,-53],[-34,-25],[-15,-26],[-5,-56],[-53,-91],[7,-33],[-24,-48],[-6,-41],[15,-56],[32,-45],[-12,-56],[0,-85],[-17,-40],[3,-34],[-31,-23],[-24,-40],[-93,-22],[-98,29],[-41,37],[-40,3],[-1,-41],[-11,-41],[13,-19],[18,-101],[50,-45],[13,-54],[-8,-58],[22,-71],[13,-7],[9,-62],[-46,-90],[-25,1],[-15,-58],[-22,-5],[-17,-27],[-22,27],[-19,-27],[-44,3],[-21,-56],[0,-97],[-16,-58],[-14,-26],[16,-40],[2,-38],[-23,-69],[-26,-24],[-10,-47],[11,-86],[-3,-131],[9,-125],[7,-41],[-38,-58],[-21,-106],[-27,-52],[-46,-24],[-17,24],[-18,48],[-5,54],[-18,5],[-19,41],[-28,-44],[32,-15],[-7,-27],[-38,29],[-41,1],[-4,33],[-33,1],[-21,-78],[-28,-41],[-31,-10],[-44,-79],[-36,8],[22,-95],[28,17],[13,-24],[-3,-37],[-33,-31],[-33,-18],[-45,-39],[-35,-6],[-25,32],[-28,-22],[-13,30],[3,39],[-37,-12],[-19,-21],[-10,-39],[-19,-3],[-15,-99],[-27,-65],[-51,-26],[-29,-261],[-1,-37],[20,-35],[-5,-118],[-14,-108],[-16,-70],[39,-66],[-34,-88],[-193,-134],[-136,-95],[-145,41],[-59,-48],[-22,-2],[-20,-24],[-14,-75],[-22,21],[-131,56],[-308,-70],[-144,111],[-190,144],[-110,82]],[[66908,61420],[85,233],[165,448],[9,18],[-6,55],[14,44],[2,46],[-19,154],[2,38],[-20,52],[-236,79],[-12,159],[2,218],[17,133],[-6,49],[-13,154],[-29,155],[-22,233],[-13,78],[14,70],[53,123],[7,59],[15,42],[-56,4],[-34,37],[-8,30],[-1,66],[10,53],[-18,184],[5,64],[42,114],[64,-4],[-31,113],[-18,46],[43,29],[7,40],[18,-2],[5,66],[18,73],[0,83],[11,89],[10,15],[-14,80],[-1,56],[28,21],[-1,77],[12,23],[13,62],[-1,62]],[[67020,65541],[26,14],[5,-42],[56,-93],[53,-18],[53,31],[26,-15],[25,-67],[31,-33],[17,-107],[42,96],[41,-50],[34,32],[36,67],[36,45],[26,6],[9,91],[-6,63],[38,34],[-15,23],[-23,78],[3,30],[51,-4],[64,32],[10,35],[37,12],[79,49],[22,-28],[-2,73],[28,44],[22,-7],[21,41],[36,25],[37,78],[16,65],[-5,139],[25,114],[25,92],[-12,136],[65,76],[40,19],[37,-9],[73,4],[31,75],[1,71],[16,66],[33,-26],[70,-35],[25,-54],[24,-9],[16,-27],[29,16],[34,-2]],[[68481,66787],[17,18],[71,-11],[28,32],[26,-12],[19,-39],[4,-39],[29,-28],[8,-36],[55,41],[11,30],[20,-41],[30,6],[30,-44]],[[68829,66664],[3,-66],[18,-13],[44,-100],[28,28],[26,47],[16,-10],[6,65],[36,6],[19,35],[43,36],[11,50],[13,-9],[45,42],[22,-6],[32,-68],[7,-35],[38,-58],[42,52],[5,49],[-12,66],[1,74],[39,107],[79,-8],[30,37],[10,-37],[44,-31],[17,2],[26,60],[11,59],[-7,88],[-25,21],[-5,63],[20,8],[24,40],[10,39],[38,66],[12,71],[16,25],[2,48],[21,12],[4,40],[20,26],[52,-10],[53,-31],[11,-39],[31,-23],[20,-40],[1,-69],[-16,-44],[-12,-67],[16,-86],[47,48],[20,-12],[6,-93],[-12,-51],[-16,-138],[3,-64],[-6,-149],[-8,-23],[-6,-113],[9,-71],[21,-80],[7,-60],[30,-64],[46,5],[63,115],[77,107],[37,3],[56,21],[26,120],[12,30],[21,8],[17,34],[39,25],[15,55],[19,3],[25,41],[20,-15],[22,23],[21,-2],[32,-26],[35,0],[-1,-64],[-28,-26],[0,-43],[48,-12],[34,47],[66,26],[11,33],[37,31],[53,-37],[31,12],[35,-25],[24,-86]],[[75447,59986],[9,-64],[-4,-50],[-16,-29],[-2,-55],[24,-71],[22,-10],[79,7],[14,-109],[16,-30],[-27,-85],[5,-83],[17,-34],[3,-79]],[[75587,59294],[-16,-32],[-20,8],[-26,42],[-19,-40],[-28,-35],[-26,6],[-35,-22],[-25,35],[-20,-42],[-28,23],[-39,7],[-13,-31],[-16,7],[-82,-15],[-43,33],[-36,64],[-17,-3],[-15,-37],[-28,-10],[-3,-48],[-40,-28],[-40,-5],[-36,-15],[-27,27],[-12,32],[-70,56],[-32,-33],[-34,-3],[-13,57],[-15,25],[-27,6],[-26,125],[-21,19],[-3,31],[11,49],[29,20]],[[74696,59567],[22,-44],[21,18],[2,33],[23,26],[7,44],[-23,65],[9,102]],[[81729,56175],[21,-33],[-34,-33],[10,-19],[28,37],[22,-39],[-6,-49],[-27,26],[-1,-92],[-16,35],[-67,50],[-17,27],[23,50],[20,21]],[[81701,55972],[22,24],[3,-51],[-25,27]],[[81666,56015],[-2,-57],[-30,-15],[3,65],[29,7]],[[89166,38141],[0,-168],[0,-846],[0,-702],[0,-249],[0,-701],[-10,-1],[-3,-120],[-6,-53],[-15,-42],[-9,-71],[15,-92],[23,-37],[10,8],[0,-550],[0,-553],[0,-501]],[[89171,33463],[-35,30],[-30,90],[-52,120],[-19,76],[-11,66],[-13,21],[-68,155],[-37,63],[-27,69],[-2,49],[-68,-1],[-44,-29],[-14,-28],[-46,-20],[-24,37],[-13,41],[-47,-31],[-15,-44],[5,-67],[-17,-17],[-29,127],[2,30],[21,13],[-5,36],[4,83],[26,39],[2,79],[15,89],[18,-7],[3,57],[-17,22],[-36,17],[-16,107],[-11,29],[-52,66],[69,16],[36,-31],[36,6],[21,15],[27,-17],[0,52],[11,33],[-13,54],[-33,28],[-10,29],[-14,3],[-43,86],[-11,34],[-32,8],[-1,59],[-8,22],[-34,47],[-28,81],[-40,91],[0,27],[-12,82],[2,33],[-30,155],[-7,60],[42,28],[-2,64],[27,55],[30,5],[14,16],[1,13],[-18,3],[-31,19],[-19,-53],[-21,-2],[0,43],[-27,1],[4,45],[-5,63],[-21,8],[-9,34],[-19,29],[8,47],[12,5],[3,4],[1,7],[1,27],[-2,15],[10,16],[1,23],[-25,23],[-3,-48],[-23,-12],[3,74],[7,27],[1,36],[-2,22],[-3,0],[-8,-15],[-6,-6],[-13,-28],[-21,-57],[-18,64],[-11,5],[-20,49],[-6,49],[-12,22],[-16,-29],[-32,25],[-30,-8],[-16,38],[-33,37],[-18,-4],[-17,-35],[-23,13],[-19,46],[-15,-11],[-11,21],[-19,-26],[-20,-7],[-34,58],[-23,-1],[-17,22],[-2,32],[-28,12],[-25,48],[-23,8],[-15,-14],[-11,26],[-23,14],[-68,7],[-78,44],[-20,0],[-33,-33],[-22,59],[-19,27],[-10,40],[-52,26],[-23,51],[3,45],[-15,39],[-5,48],[14,17],[21,-23],[37,17],[4,27],[-38,5],[-28,28],[-25,-33],[-8,-35],[-21,-32],[-18,27],[0,53],[-33,13],[-4,-79],[-39,44],[-9,40],[9,50],[-19,69],[-7,-43],[-16,-32],[-24,-9],[-12,49],[-2,62],[-29,80],[1,-66],[-31,31],[-2,45],[-13,55],[0,36],[17,27],[-8,56],[-1,74],[29,76],[16,30],[9,40],[-36,-4],[-23,-66],[3,-175],[-9,-31],[-21,-33],[8,-83],[-24,-33],[-28,-84],[5,-48],[13,-34],[-16,-35],[-25,-86],[-19,-41],[-46,15],[-34,-36],[-10,41],[-22,44],[-3,54],[-26,161],[-1,40],[45,-11],[5,74],[-10,58],[-15,7],[-4,74],[9,35],[-20,24],[-26,-41],[-10,42],[0,58],[-20,17],[0,30],[-38,84],[-33,48],[-44,2],[-18,-21],[-23,103],[13,62],[26,7],[-1,40],[50,4],[26,-29],[41,9],[47,-85],[16,17],[33,80],[39,128],[21,39],[25,16],[23,-34],[-9,-62],[11,-5],[13,-63],[-8,-31],[39,-18],[27,31],[17,-11],[5,-55],[36,-4],[37,74],[-17,18],[-7,47],[4,43],[19,24],[38,-10],[-2,72],[12,27],[-22,30],[3,52],[-13,31],[10,39],[-9,72],[-26,-19],[-29,-6],[-4,-23],[-23,4],[-18,-23],[-30,23],[-40,-54],[-10,27],[-22,-3],[-6,-38],[-15,1],[-33,-28],[-20,-30],[-19,5],[-26,27],[-29,-43],[-20,17],[-14,58],[-27,-16],[-47,-50],[-26,92],[-23,22],[19,104],[-23,-9],[-18,99],[14,94],[6,82],[-17,1],[-20,-34],[5,150],[-14,20],[-3,-72],[-28,26],[-16,2],[-23,37],[-31,-12],[-3,122],[-17,-7],[-2,-47],[-21,-18],[-45,52],[-16,-58],[32,-58],[-36,-45],[-11,43],[-22,10],[-25,-5],[6,122],[8,23],[33,20],[16,66],[6,81],[20,63],[-21,40],[1,41],[48,45],[33,22],[5,-28],[81,43],[15,23],[20,68],[22,21],[11,51],[48,71],[19,-1],[23,27],[15,-8],[64,-6],[33,-47],[31,-24],[27,-41],[57,-61],[23,-66],[22,-32],[36,-4],[21,9],[32,-13],[7,22],[21,-18],[16,24],[21,-1],[25,-63],[8,-45],[-17,-58],[17,-61],[8,-67],[28,-63],[14,-88],[-15,-86],[4,-37],[-8,-41],[-29,-83],[7,-62],[11,-165],[-11,-39],[3,-69],[17,-150],[11,-45],[12,-6],[15,-57],[7,-65],[29,-150],[13,-47],[10,58],[-7,95],[-10,49],[4,49],[14,34],[28,-13],[6,-30],[4,-233],[7,-75],[34,-42],[-1,-72],[12,-18],[4,-74],[23,-6],[10,-48],[23,-5],[13,-35],[34,5],[29,-15],[22,22],[21,4],[17,42],[-1,28],[16,59],[45,37],[11,62],[13,-10],[15,53],[20,20],[-8,45],[0,67],[20,6],[-5,59],[59,68],[19,61],[1,84],[16,11],[2,100],[24,35],[16,-22],[17,6],[3,-44],[45,-2],[28,32],[0,25],[38,22],[20,-34],[9,40],[21,7],[23,36],[11,1],[4,54],[-20,71],[16,10],[-31,95],[18,0],[19,-40],[26,6],[34,-15],[0,44],[-30,9],[-5,49],[25,29],[33,82],[17,-2],[22,24],[14,-28],[30,14],[24,-67],[31,-1],[23,11],[51,-60],[73,-45],[17,-20],[29,-82],[22,-34],[34,-3],[37,-42],[42,-65],[23,-18],[47,-69],[33,-35],[26,-43],[28,-23],[61,18],[15,17],[26,-52],[12,6],[15,-33],[18,-9],[4,42],[30,-31],[32,2],[37,-59],[-15,-66],[11,-14],[23,20],[29,-13],[24,14]],[[88530,35058],[20,32],[37,15],[27,-33],[31,-58],[17,-5],[8,-28],[36,-26],[10,-46],[-21,-68],[-19,48],[-22,-45],[-24,-7],[-30,32],[-31,8],[-23,25],[-48,91],[-10,42],[19,43],[23,-20]],[[88458,34702],[49,22],[36,-2],[18,-20],[34,-107],[37,-13],[-24,-138],[2,-52],[-30,-61],[-1,-83],[-20,-41],[-4,-33],[-32,-7],[-20,-74],[-40,-72],[-48,-30],[-27,5],[-87,2],[-69,-25],[15,146],[8,50],[22,85],[0,21],[19,103],[48,175],[19,46],[29,51],[43,42],[23,10]],[[88518,35217],[7,40],[35,-54],[0,-83],[-16,44],[-25,23],[-1,30]],[[88567,34118],[1,-35],[18,-24],[-3,-61],[-47,-3],[-46,22],[6,48],[23,49],[2,36],[38,23],[8,-55]],[[88507,35140],[3,41],[28,-21],[16,-53],[-19,-34],[-15,11],[-13,56]],[[88484,35955],[-12,-1],[-35,-51],[8,-67],[-35,-17],[-23,13],[6,67],[36,42],[27,13],[11,48],[48,-29],[-13,-16],[-18,-2]],[[88379,36074],[13,7],[9,-133],[-51,-41],[-5,72],[5,45],[29,50]],[[88332,36200],[19,14],[10,105],[10,-40],[2,-48],[-11,-1],[-7,-8],[-8,-59],[-15,37]],[[88320,36396],[13,22],[7,21],[5,-22],[-1,-35],[-8,-27],[-31,-55],[-4,51],[18,-2],[1,47]],[[87701,38797],[-31,-5],[-18,23],[-21,-10],[6,50],[40,-13],[40,1],[62,-16],[52,-5],[47,-44],[26,9],[36,-18],[59,-13],[27,-28],[-15,-28],[-38,4],[-15,-34],[-32,-2],[-28,-14],[-34,20],[-19,-17],[-28,23],[-22,4],[-24,22],[-26,55],[-17,-1],[-27,37]],[[87705,39432],[-4,25],[23,61],[16,-16],[16,-60],[29,-33],[5,-34],[35,-115],[23,19],[28,-67],[-12,-21],[-50,-43],[-27,38],[-25,1],[-25,-14],[-15,48],[6,54],[-10,42],[-13,115]],[[87616,39542],[11,4],[55,-18],[7,-34],[16,-13],[-27,-108],[-31,74],[-12,-15],[-26,58],[7,52]],[[87460,39341],[24,-28],[-7,-73],[5,-42],[-23,2],[-17,68],[3,54],[15,19]],[[87472,35478],[-17,-72],[-6,38],[23,34]],[[87332,35690],[6,-2],[5,7],[8,30],[10,15],[9,24],[5,-3],[3,-17],[25,-18],[28,-77],[-13,-63],[14,-5],[-10,-82],[-38,-42],[-33,47],[-2,43],[-23,-5],[-13,16],[-16,72],[13,59],[7,-22],[15,23]],[[87398,35189],[25,86],[4,-72],[-19,-59],[-10,45]],[[87374,36019],[51,-38],[-8,-70],[-25,-6],[-21,64],[3,50]],[[87391,36103],[9,-8],[6,-56],[-9,-32],[-35,20],[-3,89],[32,-13]],[[87318,35685],[-9,25],[0,58],[15,44],[-4,53],[-40,42],[8,37],[29,-50],[18,65],[12,67],[21,-8],[2,-48],[42,-124],[-17,-33],[-7,-43],[-8,-10],[-12,9],[-1,-8],[-16,-35],[-13,-36],[-13,3],[-7,-8]],[[87370,35446],[18,-54],[-28,-35],[-2,28],[12,61]],[[87379,38323],[6,-31],[-7,-34],[-15,36],[16,29]],[[87249,35588],[17,-44],[19,-4],[16,-40],[6,-79],[14,-11],[5,6],[6,5],[5,-8],[3,-8],[-2,-13],[10,-1],[7,-48],[-17,-137],[-27,-118],[-33,-42],[-9,38],[-21,13],[-12,64],[10,50],[3,145],[35,-30],[5,25],[-25,27],[-10,29],[6,67],[-11,114]],[[87346,35503],[22,-48],[-5,-33],[-16,-23],[-8,20],[-8,3],[-3,0],[-2,51],[20,30]],[[87335,38572],[-9,-96],[-17,44],[13,53],[13,-1]],[[87264,35671],[15,19],[12,-36],[-5,-43],[20,-27],[8,-60],[-14,-19],[-11,34],[-15,82],[-21,12],[11,38]],[[87034,37057],[35,-49],[-18,-13],[-17,62]],[[86977,36221],[19,-21],[-5,-30],[-14,-153],[-44,-127],[0,-81],[-24,-72],[3,86],[14,48],[1,59],[18,28],[2,36],[30,227]],[[86883,36039],[9,-108],[-12,-2],[-8,37],[11,73]],[[86869,35961],[22,-115],[-8,-99],[-33,32],[11,74],[-2,48],[-13,16],[23,44]],[[86659,34861],[-9,-49],[-19,60],[-41,-4],[8,38],[33,6],[15,-11],[13,-40]],[[86543,34804],[-11,61],[15,28],[19,-3],[30,-52],[-23,-10],[-9,-65],[13,-42],[-2,-87],[-14,-108],[-19,-56],[-18,-3],[-7,-56],[-28,-47],[-10,-58],[-18,9],[-10,-48],[-34,8],[2,98],[14,34],[-3,43],[20,75],[-11,32],[14,78],[33,59],[14,55],[9,-8],[11,74],[23,-11]],[[86501,37176],[12,-85],[-7,-6],[-16,75],[11,16]],[[86312,39984],[24,20],[65,-40],[24,-6],[16,-39],[34,-42],[-4,-46],[11,-24],[-28,-70],[-12,26],[-31,19],[-7,-18],[-32,-1],[-12,52],[-27,41],[-7,43],[-12,4],[-9,45],[-23,-8],[39,-139],[25,-3],[23,-39],[-4,-32],[-29,-32],[-24,-1],[-13,75],[-12,16],[-25,-2],[-8,52],[-18,-24],[-13,36],[11,25],[-24,45],[50,50],[26,-3],[26,20]],[[86411,34646],[-29,-8],[1,39],[49,22],[-21,-53]],[[86391,34212],[36,-56],[-42,-53],[-18,4],[-7,-40],[-29,-2],[20,47],[15,7],[25,93]],[[86306,39254],[-19,52],[29,36],[52,27],[3,-35],[26,21],[7,-36],[5,-82],[-7,-25],[-4,-102],[-21,-76],[-18,27],[-9,-16],[-14,56],[-18,22],[-2,50],[-16,40],[6,41]],[[86333,39462],[22,-3],[-2,-46],[-15,-27],[-23,-5],[-41,-27],[-31,6],[12,46],[22,11],[35,-5],[21,50]],[[85764,37964],[23,-11],[34,18],[21,33],[10,-18],[-1,-63],[18,-44],[60,80],[8,49],[27,4],[31,-29],[24,0],[22,-29],[41,-71],[26,-32],[49,2],[17,-6],[13,18],[28,1],[32,-82],[31,-37],[8,-61],[0,-65],[9,-52],[40,-11],[5,-75],[15,-43],[-16,-85],[-1,-96],[-29,5],[-18,16],[-29,66],[-13,5],[-23,53],[-79,71],[-10,23],[-22,13],[-24,104],[-34,12],[-38,-1],[-41,18],[-3,-27],[15,-56],[-10,-41],[-35,38],[-44,8],[-46,46],[-33,-14],[-1,99],[-21,14],[-27,-41],[-31,-74],[0,-50],[-23,5],[-19,-22],[-17,0],[-16,22],[-20,76],[-11,68],[-12,17],[-19,-18],[-5,117],[-20,-47],[-10,-149],[-19,-30],[-12,20],[-15,58],[-4,55],[31,81],[32,6],[8,121],[29,36],[47,-11],[29,26],[18,-15],[23,9],[27,-7]],[[86256,39646],[0,26],[24,43],[24,-28],[-17,-51],[-9,24],[-22,-14]],[[86197,38797],[9,-32],[21,-35],[5,-50],[-28,-48],[9,-42],[-25,2],[-4,-56],[-36,-4],[-9,25],[-36,8],[-26,21],[-42,61],[8,33],[34,20],[8,30],[21,13],[20,29],[41,4],[14,-9],[16,30]],[[86073,39188],[24,-16],[-6,-35],[-15,-10],[-23,18],[20,43]],[[86032,34420],[28,-16],[13,-66],[-17,-73],[-14,-32],[-13,11],[-35,104],[3,47],[21,30],[14,-5]],[[85931,40018],[33,-72],[20,-30],[-7,-49],[-17,79],[-16,12],[-13,60]],[[85468,40635],[18,-48],[15,-6],[21,21],[16,44],[-4,55],[17,87],[10,18],[44,6],[7,62],[-24,60],[13,55],[22,38],[28,28],[6,29],[27,36],[17,-9],[8,22],[33,15],[14,-12],[-12,-50],[3,-37],[14,-61],[-1,-40],[-13,-80],[-4,-98],[-16,-11],[-48,-82],[-31,-15],[-39,-87],[35,-100],[22,-27],[23,-11],[47,-45],[9,-48],[-3,-92],[34,-18],[14,-40],[-65,42],[-15,0],[-21,54],[-28,10],[-26,-6],[-23,17],[-7,24],[-39,17],[-28,-8],[-11,-27],[1,-47],[-10,-43],[14,-22],[2,-108],[-10,-28],[0,-55],[21,-123],[6,-83],[17,-97],[38,-153],[8,-49],[24,-48],[28,-85],[-29,2],[-15,68],[-49,48],[-18,36],[-17,118],[-21,98],[-27,29],[-22,40],[-7,39],[10,91],[0,75],[6,31],[-7,61],[11,115],[-4,33],[-27,10],[-12,47],[-6,66],[-8,23],[5,125],[16,21],[9,60],[-32,36],[-7,74],[-17,37],[-8,131],[36,156],[-7,82],[21,92],[-8,19],[15,49],[26,115],[12,17],[24,80],[40,91],[24,-6],[-14,-69],[-17,-45],[-1,-34],[-27,-46],[-2,-77],[24,-8],[17,-33],[8,-46],[-8,-67],[12,-25],[-4,-72],[-9,-66],[-4,-71],[-14,-32],[-8,-58],[-11,8],[-29,-68],[-29,-26],[-5,-66],[16,-49]],[[85722,37501],[23,-35],[-22,-31],[-1,66]],[[85729,34939],[20,-26],[-13,-79],[-26,40],[-7,31],[26,34]],[[85633,41707],[3,44],[20,56],[29,59],[16,-10],[15,43],[15,-66],[15,-31],[1,-52],[-11,-41],[0,-43],[-9,-71],[-32,-110],[-29,-1],[-28,-15],[-13,45],[-4,110],[-9,28],[21,55]],[[85684,37490],[24,-19],[-3,-54],[-27,-11],[-8,70],[14,14]],[[85646,39330],[25,-53],[-17,-12],[-8,65]],[[85578,37340],[-24,-43],[-15,5],[-7,39],[31,93],[41,6],[10,41],[21,25],[16,-12],[-18,-80],[5,-55],[-20,-38],[-19,-1],[-21,20]],[[85608,34127],[12,-50],[-40,5],[1,33],[27,12]],[[85432,39012],[23,42],[18,-4],[38,-71],[12,7],[26,-41],[26,-77],[14,17],[12,-43],[-3,-41],[-19,-27],[-18,-3],[-32,30],[-26,-12],[-30,8],[-15,-30],[-43,6],[-25,44],[-4,33],[6,96],[8,35],[17,-14],[15,45]],[[85502,34197],[40,-30],[41,5],[-16,-87],[-23,10],[-47,45],[5,57]],[[85533,37920],[22,-23],[-25,-67],[-18,1],[21,89]],[[85421,39792],[14,-10],[14,-71],[20,-29],[-27,-103],[17,-34],[0,-34],[40,11],[19,-25],[3,-70],[-24,-36],[-21,5],[-15,31],[-3,44],[-22,-14],[-27,-39],[-9,62],[9,48],[-5,28],[-22,28],[-20,57],[-3,55],[13,38],[6,47],[32,-48],[11,59]],[[85487,37749],[12,-22],[-1,-51],[-24,-5],[-19,28],[32,50]],[[85456,34145],[13,16],[14,-43],[-31,-16],[4,43]],[[85436,39153],[29,-24],[-11,-40],[-20,26],[-27,-7],[12,56],[17,-11]],[[85427,37666],[25,-36],[-8,-22],[-27,13],[10,45]],[[85377,34586],[1,43],[27,-18],[3,-45],[-18,-8],[-6,-35],[-17,15],[10,48]],[[85403,40488],[-8,-30],[-16,15],[6,75],[16,-5],[2,-55]],[[85379,40265],[13,13],[7,-43],[-13,-29],[-12,26],[5,33]],[[85385,40588],[-6,-35],[-20,23],[8,55],[18,-43]],[[85336,39553],[20,-23],[5,-94],[-26,13],[-11,45],[12,59]],[[85351,39807],[-4,-37],[7,-84],[-6,-32],[-25,-26],[-11,11],[-3,83],[8,96],[21,6],[13,-17]],[[85034,37749],[27,-23],[22,64],[46,7],[36,14],[54,4],[40,-60],[14,3],[34,-63],[-26,-85],[15,-37],[31,29],[22,-12],[-2,-158],[-8,-48],[-22,-1],[-26,-20],[-27,-59],[-40,-24],[-33,-40],[-16,28],[-53,51],[-57,94],[-11,-3],[-10,59],[-25,47],[-9,35],[-9,118],[5,65],[18,42],[10,-27]],[[85321,34197],[-6,50],[17,15],[8,-65],[-19,0]],[[85223,42926],[-12,-53],[-26,6],[-1,27],[24,73],[11,70],[-23,25],[-8,44],[18,151],[18,-10],[13,-36],[-1,-84],[15,-57],[-10,-49],[-21,-56],[3,-51]],[[85207,42766],[15,-8],[14,-58],[-23,8],[-6,58]],[[85127,34551],[4,16],[44,21],[2,-33],[22,-43],[25,-9],[9,-40],[-41,-12],[-40,-53],[-21,-105],[-15,28],[-26,12],[-43,-7],[-28,27],[-35,-21],[-25,-44],[-10,18],[-2,62],[16,36],[22,111],[21,-23],[41,-25],[18,29],[24,-5],[24,50],[14,10]],[[84975,38722],[98,-15],[-6,-46],[-50,-3],[-40,-40],[-23,31],[-15,-25],[-57,1],[-14,-14],[-24,15],[-13,46],[-19,22],[11,38],[25,1],[13,-31],[13,14],[25,-20],[31,17],[45,9]],[[84963,38555],[12,37],[20,-30],[-6,-118],[30,-170],[-6,-41],[-20,41],[-5,67],[-15,59],[-14,107],[4,48]],[[84904,42520],[5,-55],[-9,-32],[-33,23],[-11,52],[8,59],[-27,52],[-3,57],[28,2],[19,-61],[2,-42],[21,-55]],[[84834,41898],[-9,25],[-3,59],[5,36],[14,3],[6,-38],[-13,-19],[0,-66]],[[84553,38815],[41,16],[28,2],[45,-31],[17,0],[34,-26],[16,-38],[18,11],[-1,47],[27,-24],[26,-8],[7,-43],[-1,-69],[-53,10],[-32,-17],[-5,-22],[-29,5],[-9,24],[-24,-18],[-29,-42],[-40,-31],[-31,2],[-19,77],[0,68],[14,107]],[[84068,40383],[2,-26],[-71,25],[-65,-35],[-13,20],[-66,-45],[-25,17],[-8,32],[-30,27],[-37,6],[-1,-37],[-21,-19],[-44,16],[-12,-24],[-19,-2],[-7,-35],[-19,-9],[-21,31],[-30,-31],[-11,32],[-36,25],[-22,32],[-33,-4],[-33,-28],[-27,-39],[-31,-115],[-11,-24],[-15,-99],[-2,-76],[-18,-44],[0,-56],[-8,-25],[1,-69],[17,-118],[-6,-28],[3,-101],[13,-73],[32,-81],[25,-87],[28,30],[6,-33],[21,-20],[23,-109],[-8,-58],[21,-59],[6,-63],[50,32],[8,-42],[70,-4],[16,65],[14,96],[14,28],[16,67],[29,61],[10,57],[30,23],[21,39],[-2,-70],[29,-43],[18,8],[34,-27],[23,42],[20,-17],[13,37],[4,66],[11,21],[59,3],[13,18],[32,-18],[11,16],[19,-36],[30,26],[35,8],[-14,38],[-18,2],[4,56],[34,-11],[35,58],[27,-13],[30,0],[30,-41],[20,-86],[-19,-122],[-2,-56],[-18,-30],[-42,72],[-1,41],[-15,45],[-12,-48],[-23,-4],[-47,-27],[-2,-44],[-19,-60],[-6,-38],[-20,-26],[-1,-44],[-17,-17],[-3,-38],[-20,-32],[-36,-114],[-16,-14],[-33,-54],[-42,0],[-20,-44],[-25,-15],[-19,-31],[-12,-48],[1,-37],[-24,-64],[-25,-6],[-30,69],[-5,29],[-43,21],[8,-48],[-5,-59],[27,11],[11,-57],[22,-38],[6,-83],[21,-25],[22,11],[25,-72],[30,-101],[17,-70],[14,-88],[-2,-49],[20,-46],[28,-29],[6,-48],[12,9],[20,-30],[-18,-66],[32,-93],[12,8],[5,-81],[-30,3],[-10,-51],[1,-36],[-15,-28],[-6,-60],[10,-39],[-16,-51],[46,-108],[23,6],[11,-72],[14,-34],[37,1],[-18,-57],[13,-18],[1,-89],[9,-27],[28,3],[28,26],[0,-135],[4,-49],[-19,-46],[-19,-3],[-5,-41],[-41,80],[-24,15],[0,-41],[-27,5],[-37,-46],[-21,17],[-30,-20],[-16,-57],[1,-136],[19,-41],[-29,-58],[-40,22],[-14,24],[-29,-15],[-25,45],[-15,10],[-26,64],[0,73],[15,134],[-2,46],[28,133],[-2,54],[-13,26],[-61,37],[-8,51],[-21,65],[-20,1],[-23,79],[-16,17],[-22,49],[-19,67],[-4,63],[27,111],[10,10],[16,60],[1,94],[9,97],[-20,59],[3,44],[18,40],[-6,77],[-45,-34],[-19,8],[-15,28],[-59,-52],[-12,-48],[-23,-51],[-27,-29],[-27,-57],[-18,-13],[19,-91],[-1,-52],[34,-30],[6,-58],[0,-109],[-6,-45],[10,-52],[-1,-50],[8,-73],[-15,-44],[-12,-64],[3,-124],[-5,-19],[12,-60],[-4,-84],[8,-28],[-13,-50],[14,-49],[-6,-29],[9,-73],[12,-32],[-12,-26],[-8,-106],[-21,-19],[0,-94],[-10,-105],[19,-102],[18,-38],[13,-96],[0,-68],[-15,-12],[-9,42],[-39,-9],[-25,-35],[-13,0],[-43,30],[-39,-111],[-23,0],[-18,22],[-39,81],[-17,-28],[-2,56],[-19,72],[6,184],[7,36],[19,39],[-2,24],[15,72],[-9,110],[9,69],[19,81],[-4,22],[5,84],[11,80],[-11,37],[10,64],[-6,61],[6,63],[-12,12],[-15,50],[-16,110],[-8,25],[4,52],[13,58],[-14,53],[-33,38],[-41,-43],[-49,-16],[-23,-38],[-16,70],[-9,67],[3,58],[-8,91],[-14,55],[17,8],[3,68],[10,54],[-11,45],[-21,-4],[-3,65],[16,101],[14,-41],[27,28],[19,44],[2,50],[29,29],[-6,104],[6,87],[11,33],[8,115],[36,43],[5,76],[-13,24],[-9,76],[12,68],[-10,134],[13,50],[-9,48],[11,76],[7,-3],[28,78],[18,124],[7,27],[35,77],[-4,30],[19,41],[28,-169],[12,41],[-6,77],[-10,19],[-19,142],[-2,90],[19,125],[-7,50],[-15,-16],[-20,23],[-17,74],[26,8],[12,-28],[9,-55],[13,-1],[18,83],[-6,81],[-25,60],[7,27],[24,-17],[0,60],[-11,28],[12,42],[-2,48],[34,19],[11,17],[-8,102],[17,65],[28,10],[18,44],[1,99],[28,21],[-5,-95],[19,-43],[17,-10],[42,26],[7,87],[26,23],[16,44],[-1,64],[11,39],[-3,91],[33,12],[4,24],[32,-34],[11,10],[43,-62],[47,9],[2,-57],[34,-72],[29,-10],[16,22],[60,15],[14,-56],[36,31],[32,-36],[25,-7],[6,15],[61,-48],[26,-8],[15,-58],[18,-6],[23,-45],[21,49],[3,67],[13,7],[20,-35],[33,-13],[20,13],[38,-17],[49,-5],[5,11],[35,-24],[13,-30],[45,13],[45,55],[17,3],[15,39],[31,25],[15,85],[18,40],[19,-5],[33,36],[-26,51],[12,50],[14,28],[18,-15],[27,48],[15,2],[4,46],[-10,31],[18,26],[19,52],[11,8],[27,-19],[25,0],[-6,-42],[28,-67],[-14,-53],[-19,-8],[-14,-47],[-14,-158],[-44,-122],[-42,-54],[-4,-40],[-23,-51],[-17,-85],[1,-43],[-19,-45],[6,-39],[-53,-22],[-12,-29],[-38,-5],[-24,-17],[-89,-34],[-15,-15],[-34,14],[-20,-10],[-58,7],[-33,58],[-28,77],[-20,-16],[-56,7],[-25,-15],[-13,35]],[[84707,33585],[-2,-64],[16,-12],[28,48],[24,-21],[-4,-68],[6,-25],[-27,-33],[-23,23],[-8,-15],[6,-74],[13,-27],[10,-92]],[[84746,33225],[-39,-85],[10,-43],[-10,-29],[-25,-24],[-29,-116],[-47,-93],[-14,-18],[-7,-44],[-26,-52],[-18,-7],[-38,9],[-10,24],[-20,-29],[-24,-76],[-15,-2],[-28,-40],[-40,-23],[-30,-4],[-21,29],[-13,75],[12,34],[49,51],[28,43],[-9,19],[-35,7],[-18,-18],[-2,65],[18,38],[11,136],[-3,52],[32,63],[4,35],[23,21],[30,87],[14,4]],[[84456,33314],[15,-53],[17,-8],[16,40],[19,-62],[17,11],[9,54],[23,44],[4,90]],[[84576,33430],[14,-8],[23,21],[57,109],[37,33]],[[84690,34153],[20,18],[35,-4],[14,-55],[1,-69],[-21,-26],[-50,-7],[-31,-26],[-32,8],[-32,-37],[-13,17],[-15,-24],[-22,7],[-5,36],[22,71],[-6,53],[24,65],[18,4],[26,-36],[29,19],[38,-14]],[[84503,34086],[19,61],[11,-7],[-6,-106],[-24,-55],[0,-35],[-19,-55],[-22,-12],[0,44],[-9,50],[-27,-2],[8,53],[25,39],[9,-60],[35,85]],[[84443,35790],[12,-18],[0,-50],[-20,30],[8,38]],[[84359,34110],[21,39],[40,-62],[-45,-32],[-21,-90],[-15,17],[-20,-47],[9,-52],[-18,-15],[-8,35],[-28,-49],[-21,40],[-29,-7],[26,61],[8,34],[39,47],[-9,30],[11,35],[22,-3],[-17,-62],[12,-21],[26,55],[-3,49],[20,-2]],[[84385,38660],[20,-70],[-12,-31],[-14,70],[6,31]],[[84326,36248],[19,-39],[-2,-52],[-11,-11],[-16,29],[-6,58],[16,15]],[[84314,38944],[17,-79],[5,-74],[-21,-20],[-14,9],[-4,43],[7,49],[-4,35],[14,37]],[[84181,39166],[14,10],[9,-33],[14,41],[13,-62],[-13,-48],[14,-58],[13,19],[22,94],[22,-8],[32,-31],[-6,-84],[-22,-85],[-26,14],[-18,61],[-12,-25],[-4,-105],[-22,-33],[-15,53],[21,38],[-7,70],[0,77],[-14,-5],[-20,-75],[-6,-53],[-38,-77],[-15,76],[-10,13],[1,66],[11,76],[22,70],[14,-21],[26,25]],[[84270,32702],[6,40],[16,13],[2,-58],[-14,-31],[3,-37],[-32,-14],[-2,27],[21,60]],[[84117,32233],[-6,29],[17,33],[48,18],[26,63],[9,-4],[28,92],[30,31],[7,-44],[-8,-45],[17,-36],[-25,-21],[-24,-38],[-8,-64],[-20,6],[-17,-29],[-28,-3],[-11,-31],[-35,-13],[0,56]],[[84209,34092],[15,19],[25,-16],[-1,-101],[-46,-2],[-37,-10],[9,66],[35,44]],[[84248,39091],[-5,61],[13,-4],[-8,-57]],[[84173,37155],[15,-28],[38,-4],[11,-34],[-7,-53],[-31,-83],[-15,11],[-22,44],[-13,64],[24,83]],[[84079,36191],[7,45],[23,13],[3,30],[-16,37],[13,32],[10,158],[8,70],[-5,33],[3,121],[15,80],[37,65],[11,2],[-1,-64],[18,-21],[15,-86],[5,-158],[-11,-9],[-1,72],[-47,7],[7,-43],[-9,-29],[4,-56],[-11,-33],[-4,-52],[6,-64],[-13,-53],[6,-27],[21,63],[17,-26],[18,-59],[20,-14],[-26,-86],[-32,-34],[-12,35],[-35,-68],[14,-22],[-1,-33],[-26,-94],[-25,55],[-11,-46],[-16,23],[-15,96],[10,44],[16,14],[0,81],[10,1]],[[84185,37413],[2,31],[23,13],[6,-38],[-31,-6]],[[84172,33949],[-28,-112],[-14,16],[3,39],[18,27],[8,41],[13,-11]],[[84192,38744],[15,-36],[-3,-35],[-15,-38],[-7,61],[10,48]],[[83755,33830],[22,54],[2,41],[54,-19],[10,18],[21,-7],[10,26],[21,9],[-3,-58],[25,-3],[15,-17],[17,-47],[21,-16],[9,17],[38,11],[15,40],[-11,41],[20,23],[15,48],[45,21],[13,47],[17,3],[12,60],[-5,22],[-24,-13],[-8,64],[23,32],[28,-48],[-1,-53],[15,-81],[-15,-25],[-13,17],[-11,-41],[-2,-50],[-25,25],[5,-54],[9,-16],[0,-51],[-27,-16],[-49,-40],[-25,-48],[-53,-15],[-27,16],[-27,-7],[-14,-38],[-41,-24],[-30,-39],[-37,24],[-14,31],[-52,11],[-10,-24],[-1,-42],[-15,-20],[-14,17],[-33,-8],[-29,-40],[-35,24],[-21,65],[-13,-7],[-10,-38],[-27,16],[-16,39],[-65,-1],[-14,-27],[-23,8],[-18,40],[-67,-32],[-29,31],[-6,21],[1,135],[17,23],[4,42],[22,23],[29,51],[7,-54],[31,106],[17,16],[28,-9],[14,15],[41,-19],[22,18],[27,-52],[19,7],[30,-16],[9,13],[22,-51],[14,1],[61,-47],[14,-52],[19,-20],[12,10],[18,-37]],[[84057,36263],[9,-29],[0,-67],[-11,-33],[-23,-24],[-15,25],[-54,14],[2,62],[8,27],[5,104],[20,19],[-5,100],[-15,66],[5,44],[16,22],[26,11],[30,74],[27,19],[11,-91],[-4,-75],[9,-24],[0,-50],[-34,-79],[-12,-69],[5,-46]],[[83966,39822],[27,-9],[-6,-40],[-21,49]],[[83912,39810],[18,-86],[-24,-7],[6,93]],[[83869,36115],[-16,31],[-22,77],[13,122],[36,31],[6,-74],[11,15],[9,-42],[-9,-100],[4,-78],[-24,-16],[-8,34]],[[83883,39758],[19,-52],[-49,10],[2,46],[28,-4]],[[83852,32528],[15,8],[23,-35],[-6,-52],[-34,-58],[-31,6],[-18,25],[43,65],[8,41]],[[83824,39709],[7,-23],[20,29],[12,-20],[1,-53],[-8,-20],[-29,29],[-36,-32],[33,90]],[[83817,34697],[3,40],[18,15],[1,-48],[-22,-7]],[[83785,39921],[6,-50],[-16,-14],[-8,37],[18,27]],[[83157,33283],[29,15],[14,-14],[30,23],[16,-27],[33,-8],[33,83],[44,-137],[35,-15],[12,-107],[18,-25],[41,43],[11,-52],[14,-6],[34,-145],[38,-57],[9,-44],[-9,-62],[-20,-45],[-36,-47],[-22,10],[-22,-54],[-30,48],[-38,-3],[-17,20],[-35,89],[-8,44],[-34,78],[-23,6],[-23,42],[-10,59],[-40,10],[-13,17],[-19,-17],[-31,16],[-35,3],[-40,45],[-28,84],[19,79],[29,21],[14,27],[20,-5],[22,23],[18,-15]],[[83506,34967],[38,-35],[0,-35],[-38,8],[0,62]],[[83459,35829],[19,-4],[12,-159],[-12,-119],[4,-76],[-26,44],[3,137],[-2,108],[2,69]],[[83228,33838],[26,-55],[2,-41],[-8,-51],[-24,52],[12,46],[-8,49]],[[83180,33964],[6,-36],[25,-3],[-4,-37],[-22,-52],[-10,-51],[-12,76],[12,33],[-3,55],[8,15]],[[82712,34169],[44,46],[8,-17],[34,2],[20,-27],[0,-46],[23,-91],[17,-28],[26,26],[21,60],[51,-29],[13,-50],[31,52],[24,1],[31,-18],[-3,-46],[16,-64],[-9,-75],[11,-61],[15,30],[13,-19],[4,-48],[-10,-34],[-47,5],[-12,40],[-19,-26],[-24,24],[-15,-35],[14,-21],[35,6],[14,-22],[-6,-35],[-27,2],[-17,29],[-33,-11],[-34,-45],[-19,-7],[-20,42],[-1,39],[15,36],[-3,84],[-13,-19],[-11,-65],[-12,-13],[-29,-82],[-16,-17],[-16,27],[-18,-10],[-6,-28],[-34,-30],[-12,26],[-11,-23],[-27,6],[-36,-56],[-44,-36],[-17,-2],[-31,25],[-12,-2],[-11,-43],[-34,-19],[-17,36],[-15,-4],[-31,20],[-13,28],[-3,73],[16,56],[-6,117],[6,44],[19,38],[28,20],[55,106],[66,-78],[12,43],[37,2],[19,-40],[-2,-72],[30,2],[3,-53],[15,-74],[19,32],[24,-38],[23,55],[13,14],[33,-14],[17,9],[2,52],[-46,66],[-7,32],[-27,-11],[-23,35],[-58,126],[9,65],[11,5]],[[83066,34174],[14,2],[7,-64],[-18,-28],[-14,23],[11,67]],[[82646,42993],[-4,-8],[-44,31],[-18,-1],[1,-62],[18,-51],[-2,-66],[14,-45],[10,21],[34,4],[7,-24],[24,-2],[8,-34],[-16,-31],[-12,24],[-11,-24],[-8,-15],[-3,7],[-5,-7],[-3,5],[-4,-10],[-28,-86],[-43,-23],[-8,-47],[8,-40],[41,-54],[-7,-82],[5,-46],[-35,6],[9,-61],[15,-11],[17,-92],[-17,-83],[3,-7],[1,-13],[1,-9],[3,-6],[2,-14],[2,26],[3,6],[5,-12],[18,-7],[7,3],[7,-7],[3,7],[14,-61],[13,23],[46,-34],[2,-70],[6,-31],[55,-146],[-1,-35],[17,-9],[4,-57],[-18,-49],[-24,-11],[-10,14],[-47,-8],[-2,-54],[-10,-21],[8,-42],[25,-29],[8,-116],[19,-7],[20,-28],[10,-36],[30,-60],[65,-95],[11,-26],[6,-58],[15,-26],[35,-10],[49,-105],[1,-41],[28,-51],[21,-6],[11,-24],[-6,-53],[-53,-102],[-29,36],[-22,-32],[-25,4],[-22,23],[-13,-33],[-9,25],[-77,44],[-19,79],[0,55],[-31,41],[-8,-53],[27,-49],[20,-124],[-15,-37],[-13,41],[-28,-24],[-21,-36],[-37,-167],[-17,-132],[-10,-8],[-10,-84],[0,-130],[10,-35],[-12,-42],[-16,-100],[10,-100],[-6,-25],[3,-58],[-8,-46],[-34,-49],[3,-48],[-5,-80],[-8,-20],[-2,-68],[-19,-26],[-49,-183],[-33,-55],[-20,-4],[5,56],[-28,73],[13,70],[-12,14],[-14,-45],[7,-87],[13,-40],[3,-90],[-49,-52],[-15,-30],[6,-97],[-34,-27],[-34,-46],[-25,-55],[-18,38],[0,-70],[35,8],[29,-10],[15,-37],[5,-111],[-27,-43],[9,-83],[31,25],[18,-17],[5,-46],[-12,-141],[-18,-37],[-19,8],[-33,-20],[26,-62],[-8,-109],[1,-82],[-26,-89],[-13,-3],[-1,52],[-15,68],[-23,-2],[3,-69],[-15,-14],[9,-61],[15,17],[28,-69],[-25,-43],[-2,-68],[-19,5],[-17,-124],[-9,-123],[-29,-10],[-41,-78],[-17,-9],[-71,-78],[-109,-115],[-86,-116],[-17,1],[1,114],[-9,137],[5,96],[-7,55],[-32,81],[-11,-1],[-34,32],[-20,47],[-31,7],[-26,25],[-26,-18],[-32,-52],[-30,-17],[-25,1],[-4,32],[9,74],[-15,116],[-24,1],[-24,-18],[-3,-25],[-25,-35],[-35,120],[-29,41],[-21,15],[-25,-75],[12,-27],[-10,-48],[-74,-102],[-9,-25],[-28,-27],[-24,34],[-11,33],[-19,22],[-22,5],[-19,-16],[-57,-95],[-28,-56],[-33,24],[12,67],[1,61],[-6,92],[8,109],[-3,39],[-27,109],[-24,-82],[-22,-37],[-29,64],[-28,10],[-44,-59],[-41,-46],[-24,-7],[-38,60],[-22,-6],[-27,-31],[-7,115],[-12,23],[-42,-39],[-33,-66],[-13,22],[-9,51],[11,55],[-14,117],[-15,8],[10,68],[-4,56],[-8,25],[-3,85],[-15,48],[8,81],[-4,100],[-9,41],[-40,52],[3,59],[12,8],[14,66],[2,106],[10,78],[-6,63],[-24,37],[-15,43],[8,60],[-33,29],[-23,100],[15,27],[3,50],[25,16],[11,28],[1,47],[-10,-9],[-6,12],[2,13],[-1,9],[-6,18],[-5,-2],[-2,-11],[-7,7],[3,34],[-19,-25],[-11,-1],[-23,-23],[-27,43],[-13,60],[-28,21],[-33,-51],[-29,90],[-13,14],[-5,59],[23,-2],[17,-38],[5,-7],[9,-4],[2,-4],[2,-7],[1,-1],[6,1],[3,-5],[3,-12],[2,-1],[19,60],[23,-5],[27,20],[-10,66],[-33,64],[-15,66],[-14,44],[-1,6],[-7,16],[-40,55],[-25,126],[-18,31],[-27,18],[6,83],[-10,31],[6,77],[-4,53],[-12,37],[2,44],[-11,31],[30,59],[8,54],[-1,40],[-18,88],[15,12],[7,77],[16,56],[-1,95],[24,72],[34,52],[16,89],[17,31],[16,-10],[7,33],[-10,26],[-13,-24],[-13,47],[29,16],[12,23],[32,7],[16,64]],[[80456,41501],[-7,-70],[-13,-5],[-9,-37],[3,-46],[20,-41],[17,-13],[-6,-120],[49,-99],[0,-42],[25,3],[9,-16],[5,-75],[20,-23],[13,-49],[26,-11],[13,-46],[14,-89],[20,-8],[36,-77],[24,-16],[33,11],[53,80],[5,33],[69,19],[22,23],[43,-51],[28,15],[17,-41],[32,48],[9,-20],[34,-22],[11,13],[7,49],[14,35],[58,11],[10,120],[15,53],[-8,41],[35,52],[25,14],[18,38],[53,-18],[28,6],[18,-18],[12,35],[29,-6],[22,-27],[-12,-52],[20,-18],[13,-40],[27,4],[32,-26],[18,-51],[33,26],[35,-70],[10,30],[28,24],[5,53],[29,27],[14,28],[46,11],[17,-33],[49,53],[4,19],[53,-54],[9,50],[-2,43],[27,47],[3,64],[-3,65],[11,34],[12,-14],[12,34],[12,84],[-22,31],[7,45],[-24,22],[15,37],[3,33],[33,6],[8,49],[42,72],[12,37],[28,17],[-18,80],[-12,-18],[-11,80],[16,68],[-17,21],[17,35],[-1,28],[28,39],[10,60],[13,-52],[19,3],[11,32],[21,24],[6,62],[-4,32],[6,126],[18,106],[-11,121],[13,115],[-14,56],[14,13],[9,36],[9,120],[23,64],[18,-7],[10,39],[3,74],[15,-27],[13,3],[33,-31],[20,25],[1,25],[38,-11],[13,14],[35,-61],[23,62],[17,-36],[29,6],[6,30],[26,-46],[16,29],[18,-19],[64,-3],[14,27],[12,-42],[22,-21],[27,-79],[17,-10]],[[82693,42997],[56,0]],[[82749,42997],[7,-75],[-20,-20],[-34,63],[-9,32]],[[82724,42577],[12,-34],[-13,-36],[-13,58],[14,12]],[[82635,42711],[4,-2],[4,6],[4,-6],[9,12],[16,-7],[18,-33],[17,-62],[-23,-17],[-19,8],[-23,38],[-8,26],[1,37]],[[82683,42858],[-16,35],[-3,48],[21,40],[23,-62],[-10,-53],[-15,-8]],[[82664,42065],[-1,26],[35,-5],[-2,-25],[-32,4]],[[82632,34130],[21,38],[32,-5],[4,-26],[-21,-37],[-22,-105],[-16,21],[10,63],[-8,51]],[[82684,42434],[-5,-101],[-29,61],[-8,44],[10,39],[32,-18],[0,-25]],[[82641,39674],[27,43],[4,-37],[-31,-6]],[[82624,42872],[14,42],[13,-26],[0,-45],[-15,-26],[-12,55]],[[82645,42070],[-8,-19],[-14,15],[-15,2],[6,10],[1,10],[12,23],[18,-41]],[[82644,42367],[-32,-7],[10,45],[22,-38]],[[82628,42482],[-39,30],[-26,5],[-8,29],[10,35],[20,-20],[15,4],[34,-53],[-6,-30]],[[82616,39603],[1,-46],[-21,-5],[-1,34],[21,17]],[[82619,42178],[6,-42],[-12,-1],[-2,-6],[-6,0],[-2,3],[-1,-1],[-1,-5],[-2,4],[11,52],[9,-4]],[[82604,42131],[2,-4],[6,2],[0,4],[8,2],[-5,-24],[-1,-30],[-6,-11],[-7,-1],[-2,-18],[-5,11],[-2,26],[4,30],[4,1],[3,-3],[-1,13],[2,2]],[[82242,33825],[-2,65],[-9,34],[6,58],[33,45],[17,53],[28,38],[34,-9],[55,-47],[17,-40],[-2,-68],[-14,-32],[2,-51],[-12,-30],[-22,-109],[-21,-49],[-23,-28],[3,-57],[-28,26],[-28,0],[-13,29],[-39,-29],[-18,44],[-31,21],[2,60],[18,-31],[44,46],[3,61]],[[82334,37590],[8,-40],[-10,-142],[-9,-8],[-9,87],[20,103]],[[82276,37668],[23,28],[-8,-98],[15,-61],[-12,-55],[11,-117],[3,-62],[-14,-49],[11,-20],[-27,-49],[-1,-28],[-16,-42],[-29,8],[12,71],[-3,93],[-18,81],[8,72],[2,75],[15,73],[28,80]],[[81996,33745],[13,-49],[-18,-33],[-17,3],[16,91],[-30,99],[-43,87],[-46,44],[-42,-2],[-39,131],[-3,86],[16,1],[8,-26],[18,7],[30,-15],[46,-38],[35,12],[48,83],[28,-16],[54,-54],[29,-51],[42,-120],[-35,-83],[-42,-42],[-17,0],[-31,-65],[-1,-33],[-19,-17]],[[82082,33790],[18,0],[18,-70],[-11,-35],[-14,16],[-25,54],[14,35]],[[82007,35104],[5,9],[42,-6],[44,-48],[-3,-42],[-24,38],[-21,8],[-15,-44],[-30,17],[2,68]],[[79411,35107],[-30,-11],[-18,11],[-28,-6],[-20,-20],[-17,6],[-31,38],[-35,-4],[7,39],[28,76],[8,-23],[9,-94],[20,16],[3,47],[31,83],[-1,39],[9,50],[19,-30],[15,11],[15,58],[0,142],[16,120],[23,43],[16,87],[13,6],[12,-37],[-3,-39],[22,-29],[12,11],[11,42],[61,-66],[43,30],[21,-25],[8,-45],[31,-12],[38,21],[-1,61],[10,64],[22,-17],[13,-33],[44,19],[15,-19],[30,-116],[19,-22],[23,-6],[13,-42],[18,7],[24,36],[19,-36],[44,-55],[22,-17],[32,67],[31,-11],[6,-52],[22,-75],[23,-35],[8,-149],[13,-56],[41,-32],[21,40],[9,-35],[23,-16],[30,39],[20,-53],[47,-18],[24,9],[40,53],[11,-33],[35,-18],[50,-41],[34,-6],[61,46],[10,-35],[29,-33],[29,15],[13,36],[34,142],[2,39],[24,131],[31,29],[40,0],[18,-13],[4,-55],[19,-96],[31,-39],[39,-8],[33,56],[18,-11],[43,-93],[31,-22],[32,26],[10,-7],[21,-83],[19,-10],[33,22],[47,5],[17,-24],[27,-13],[22,-74],[-7,-78],[10,-55],[28,7],[22,-58],[-1,-170],[19,-82],[41,-24],[16,-45],[38,-15],[9,-28],[49,43],[8,18],[50,-27],[13,20],[12,-21],[31,40],[18,-13],[26,64],[21,-65],[30,-12],[8,15],[16,-36],[23,-7],[22,-39],[2,-56],[-12,-23],[4,-79],[-14,-114],[-12,-176],[22,-120],[39,-38],[12,-45],[-19,-44],[-50,25],[4,50],[-18,42],[-22,20],[-2,-39],[-24,17],[-28,-6],[-18,23],[-59,56],[-32,46],[-44,31],[-26,9],[-9,37],[-28,43],[-48,2],[-29,-30],[-11,-40],[-19,-19],[-16,6],[-29,-13],[-10,-19],[-33,31],[-31,3],[-30,46],[-20,-12],[-33,25],[-30,-3],[-17,27],[-12,-17],[-20,26],[-24,7],[-15,-80],[-25,33],[-21,14],[-11,-19],[-17,41],[-35,1],[-18,19],[-18,-21],[-21,17],[-34,0],[-26,30],[-62,20],[-85,80],[-9,29],[-36,31],[-26,38],[-62,62],[-96,56],[-45,10],[1,25],[-31,15],[-44,9],[-19,-8],[-9,-30],[-19,65],[-7,-16],[-33,20],[-12,-37],[-13,13],[-50,-10],[-12,-19],[0,-54],[-17,-19],[-25,1],[-56,24],[-60,40],[-22,-5],[-8,30],[-27,20],[-34,70],[-33,25],[-10,20],[-55,13],[-37,23],[-64,15],[-29,-1],[-71,20],[-9,23],[-24,15],[-9,34],[8,87],[40,95],[-1,49],[-28,24],[-17,-29],[-31,14],[-21,46],[-27,24],[-9,30],[-22,15],[-28,-16]],[[81757,34949],[12,-22],[10,-60],[-27,8],[-11,43],[16,31]],[[81415,34898],[-4,-14],[4,-59],[-79,51],[-26,-10],[-13,70],[31,59],[20,64],[43,16],[35,-10],[75,6],[22,-8],[86,8],[31,16],[17,-7],[35,-41],[9,-34],[-38,-22],[-31,-47],[4,-42],[-21,0],[-39,17],[-19,-12],[-16,-76],[-62,13],[-44,-10],[-20,23],[0,49]],[[81469,33951],[30,-7],[3,-25],[-31,-10],[-2,42]],[[81275,35868],[23,37],[14,-14],[2,-63],[-11,-17],[-29,1],[1,56]],[[80567,38040],[15,51],[7,-53],[-22,2]],[[80526,39485],[9,-38],[-10,-28],[-24,-6],[-7,-25],[-26,57],[3,49],[5,-1],[6,-2],[3,0],[6,4],[2,9],[10,15],[6,4],[7,13],[6,-21],[-1,-20],[5,-10]],[[80487,39538],[18,25],[-4,-34],[1,-11],[-9,-13],[-4,-11],[-6,-3],[-15,5],[-6,-1],[7,37],[18,6]],[[80404,39272],[10,29],[13,-14],[18,13],[13,-46],[25,25],[10,-93],[-66,-90],[-10,-26],[-21,12],[-6,35],[12,99],[2,56]],[[80355,39510],[32,-16],[32,-43],[13,21],[10,-37],[26,-26],[7,-52],[-2,-46],[-30,32],[-5,22],[-40,42],[-17,6],[-20,-51],[-18,66],[2,104],[10,-22]],[[80357,40010],[8,-3],[7,-15],[8,-27],[8,-24],[15,-68],[33,-63],[-2,-70],[-21,-9],[-19,46],[-20,40],[-20,-6],[-27,58],[3,71],[-9,40],[3,53],[33,-23]],[[80307,39817],[25,33],[23,-42],[19,6],[19,-37],[3,-47],[-20,-58],[-6,16],[-3,2],[-4,-1],[-1,2],[-3,8],[-3,3],[-4,1],[-5,5],[-11,21],[-6,22],[-21,12],[-2,54]],[[80222,34502],[23,-31],[21,1],[6,-36],[-48,26],[-2,40]],[[80261,38892],[11,-32],[-12,-36],[-30,-10],[4,59],[18,30],[9,-11]],[[80221,42097],[11,51],[14,15],[-4,-88],[-14,-27],[-7,49]],[[80041,42741],[-24,20],[-21,76],[12,81],[12,8],[43,107],[1,-64],[47,-123],[-6,-18],[2,-93],[-23,-59],[0,-34],[-30,-11],[-12,-18],[-18,36],[17,92]],[[79957,37816],[-9,-19],[5,-57],[-32,-19],[-30,-35],[-7,26],[12,37],[-17,86],[11,86],[-5,80],[10,26],[9,146],[48,5],[73,-39],[20,-59],[20,-23],[13,-59],[3,-52],[-13,-35],[-11,-61],[2,-31],[-12,-74],[-24,-6],[-1,-54],[-32,-3],[2,35],[-12,51],[-23,48]],[[79851,37985],[-3,-64],[-18,-13],[-9,23],[17,48],[13,6]],[[79669,37937],[26,-57],[-10,-45],[-13,-1],[-31,47],[5,27],[23,29]],[[79371,38485],[-41,1],[-13,48],[-28,-49],[-35,-6],[-12,42],[-33,3],[-10,25],[2,55],[10,22],[31,20],[32,75],[13,17],[-5,36],[-18,7],[9,50],[24,58],[35,10],[9,-59],[-1,-81],[48,-57],[9,18],[-20,48],[2,53],[-13,52],[1,40],[26,-2],[27,20],[37,-71],[-8,-37],[28,-115],[14,-42],[-6,-88],[7,-86],[14,-104],[-1,-29],[22,-87],[19,-35],[21,-1],[16,-24],[54,-26],[32,-26],[-28,-40],[-11,-43],[-20,-123],[-3,-51],[13,-29],[30,-26],[-11,-59],[-38,9],[-19,16],[-27,68],[-20,2],[-14,43],[-12,2],[-43,51],[-29,17],[-15,53],[-10,67],[16,123],[-14,48],[-19,27],[1,37],[-10,46],[2,72],[-17,15]],[[79505,42252],[-7,66],[10,8],[16,-46],[-3,-37],[-16,9]],[[78733,39466],[26,-37],[4,-38],[59,-94],[13,-6],[1,-34],[-1,-6],[1,-10],[12,-54],[15,1],[13,-30],[51,-64],[12,74],[-2,37],[13,45],[31,9],[16,-16],[4,-130],[14,-61],[-6,-107],[10,-102],[13,-59],[-24,-27],[-11,-36],[-5,-100],[11,-45],[-6,-34],[48,-6],[2,-77],[48,46],[-7,74],[30,-7],[14,-35],[8,-94],[-12,1],[-48,-108],[10,-79],[19,46],[19,13],[-5,-62],[-6,-14],[-3,-34],[-10,-39],[-1,-13],[6,-13],[1,-46],[-6,-1],[-2,-7],[-3,-24],[0,-16],[3,-6],[3,11],[8,6],[13,-22],[13,-10],[5,-30],[10,37],[5,48],[3,107],[18,88],[17,-21],[17,58],[16,0],[22,-27],[37,-10],[39,-36],[0,-46],[9,-80],[19,-38],[23,-1],[5,-125],[20,-62],[51,-30],[2,-87],[11,-62],[0,-33],[-25,-34],[-31,-88],[-14,-94],[-4,-92],[8,-39],[21,-27],[7,-66],[-25,-122],[-5,-88],[-7,-7],[-1,-114],[-3,-41],[17,-18],[10,-40],[-5,-89],[9,-39],[-12,-41],[-4,-92],[5,-85],[-5,-92],[2,-128],[-10,-31],[-3,-50],[3,-152],[-14,-183],[-18,-16],[-30,19],[-4,69],[-10,26],[-38,54],[-32,124],[-14,-14],[-4,-85],[-25,-157],[-16,36],[-46,47],[-26,50],[-12,8],[-22,64],[-29,18],[-16,-43],[7,-39],[21,-64],[-1,-31],[18,-63],[4,-74],[-39,-6],[-2,37],[-55,153],[-21,26],[3,36],[-67,131],[-19,97],[-28,37],[7,57],[-24,55],[-28,31],[-1,29],[-26,35],[-22,7],[-21,38],[-22,7],[-2,32],[-23,32],[-9,43],[-47,95],[-36,46],[-23,17],[-7,40],[-52,118],[-87,163],[-28,62],[10,40],[-3,34],[-16,44],[-2,77],[-40,87],[-48,65],[-7,33],[-29,42],[-48,91],[-27,90],[-12,76],[-18,48],[-26,148],[-51,81],[-30,94],[-11,46],[-27,72],[-4,55],[-15,54],[15,92],[-6,99],[-20,67],[-27,111],[-14,40],[0,31],[-21,87],[5,44],[-10,50],[-15,8],[-29,86],[7,75],[-16,82],[-5,69],[-22,70],[-34,83],[-16,76],[-43,101],[-10,47],[-18,27],[-7,60],[-13,56],[5,51],[-38,91],[-47,61],[-17,5],[-11,57],[-40,-13],[-18,27],[3,28],[-8,63],[2,36],[-8,104],[-15,57],[0,59],[-20,80],[-4,65],[-17,138],[-19,116],[3,16],[-19,78],[-6,57],[4,44],[14,34],[-1,50],[-22,73],[-5,-46],[-23,57],[-48,134],[-27,23],[-9,22],[-19,-1],[-47,105],[-42,56],[-27,-12],[-32,41],[-21,61],[-3,193],[-11,123],[-5,31],[-46,38],[-31,86],[-12,100],[-8,31],[-21,16],[-47,207],[-27,41],[-11,66],[-33,41],[-55,-15],[-13,12],[-31,73],[-34,123],[-29,78],[-40,62],[-73,199],[-68,151],[-37,155],[-2,78],[-18,58],[1,37],[-25,87],[10,72],[-11,130],[18,-13],[38,74],[13,-2],[11,-34],[28,20],[79,-89],[0,-29],[16,-46],[37,-77],[34,-24],[16,4],[36,-38],[21,19],[16,-28],[32,11],[59,45],[10,-20],[29,10],[44,-48],[16,-37],[81,76],[14,-23],[7,-45],[22,-25],[-1,-32],[45,-104],[26,-30],[15,-99],[4,-64],[-6,-31],[31,-107],[21,24],[32,-83],[-3,-83],[-9,-12],[-7,-55],[6,-40],[25,-11],[30,-28],[15,-33],[12,-60],[29,-49],[24,10],[5,-68],[19,-45],[31,-31],[18,-6],[48,-78],[29,-38],[37,-81],[30,-36],[19,-76],[44,-33],[14,-26],[38,-117],[26,-49],[3,-103],[11,-36],[25,-52],[16,33],[40,-121],[13,-119],[21,-95],[34,-62],[33,-26],[55,-71],[-26,68],[-3,50],[21,66],[19,12],[28,-3],[12,-51],[30,-66],[34,-58],[16,-182],[16,-69],[19,-9],[20,-32],[46,23],[11,-7],[66,-143],[45,-71],[-3,-61],[4,-46],[13,-17],[-5,-56],[8,-72],[30,-72],[19,-62],[25,-52],[33,-8],[18,11],[33,-17],[24,3],[10,-14],[52,-163],[2,-23],[-42,-55],[-13,-27],[-40,-41],[27,-24],[35,46],[19,38],[31,30],[7,45],[30,30],[7,22],[22,-15],[52,-100],[6,-29],[28,-36],[11,-53],[6,-86],[9,-73],[-33,-12],[-35,35],[-9,23],[-17,-42],[-14,-8],[-14,-39],[8,-65],[-3,-58],[-32,-4],[-12,-24],[25,-56],[-5,-43],[2,-47],[17,-16],[-17,-52],[8,-31],[-22,-64],[51,-39]],[[79360,42089],[12,52],[29,12],[-19,-54],[-6,-62],[-17,17],[1,35]],[[79166,38309],[8,-34],[-14,-93],[-9,29],[-4,106],[19,-8]],[[79166,39794],[-19,19],[-20,-29],[-30,69],[-14,9],[-49,-50],[-22,21],[-5,45],[22,38],[-2,76],[18,29],[24,-48],[21,-61],[5,-34],[40,-29],[31,-55]],[[79121,38246],[21,30],[6,-28],[-6,-53],[7,-55],[3,-106],[-13,-9],[-9,20],[-5,-7],[-11,22],[-9,-7],[-5,-6],[0,26],[3,16],[8,6],[-1,41],[-5,26],[9,42],[6,3],[1,39]],[[79025,40177],[10,-7],[22,-56],[-14,-17],[-18,80]],[[79026,40711],[-15,16],[-11,39],[-20,-44],[-21,5],[-12,48],[9,37],[20,39],[24,19],[27,-23],[16,18],[20,-59],[8,-56],[-8,-36],[8,-29],[-26,-93],[-19,19],[-16,48],[-3,49],[19,3]],[[79016,39760],[19,-12],[17,-87],[-15,-35],[-17,-74],[-10,37],[-27,-51],[-6,81],[-19,39],[36,54],[22,48]],[[79000,40127],[18,-45],[-8,-29],[-14,35],[4,39]],[[78912,40838],[18,-10],[-4,-74],[-17,-4],[6,-53],[24,-66],[21,-19],[-3,-36],[11,-58],[-26,13],[-13,91],[-16,31],[-11,55],[-39,45],[-6,39],[12,32],[16,2],[10,35],[17,-23]],[[78864,39304],[31,-13],[28,-34],[18,-5],[-5,-40],[2,-40],[-29,-37],[-26,16],[-20,39],[-15,-1],[-4,41],[-8,17],[6,36],[22,21]],[[78755,39825],[25,19],[28,-31],[10,-43],[-44,-27],[1,33],[-27,-12],[7,61]],[[78698,39746],[36,-20],[11,7],[22,-21],[-9,-52],[-59,65],[-1,21]],[[78719,40646],[6,-37],[25,-48],[0,-37],[-12,-56],[-30,72],[-2,44],[13,62]],[[78726,39814],[-17,-5],[-19,-26],[-10,32],[45,19],[1,-20]],[[78697,40787],[19,36],[4,-102],[-19,18],[-4,48]],[[78651,40450],[3,47],[12,15],[19,-21],[7,-33],[-2,-69],[-35,-20],[-4,81]],[[78527,40812],[14,26],[35,-18],[29,-30],[48,-139],[-13,-49],[-43,58],[-29,50],[10,43],[-7,41],[-34,-38],[-23,-8],[13,64]],[[78538,40726],[38,-34],[19,-48],[29,-46],[0,-75],[-15,-20],[-19,59],[-20,16],[-44,-1],[-30,-19],[-41,40],[-8,51],[10,31],[31,19],[8,21],[42,6]],[[78463,40788],[20,27],[17,-45],[-12,-58],[-18,-12],[-7,88]],[[78336,41134],[14,26],[40,-39],[14,8],[56,-31],[-7,-42],[15,-40],[6,-108],[-35,60],[-23,65],[-51,23],[-29,78]],[[78401,40779],[1,86],[-12,59],[6,38],[-4,54],[20,7],[40,-93],[10,-71],[-8,-81],[9,-47],[-14,-62],[-15,4],[-25,56],[-8,50]],[[78359,36191],[14,30],[65,-81],[-6,-79],[-36,32],[-7,32],[-32,41],[2,25]],[[78239,41452],[16,15],[16,-36],[-19,-27],[-13,48]],[[78208,41450],[7,-25],[32,-33],[18,-4],[-5,-102],[-33,-65],[-46,26],[-20,130],[5,71],[23,39],[19,-37]],[[77830,37964],[-4,34],[16,15],[10,-45],[24,-39],[16,-49],[15,-69],[-6,-57],[-24,-17],[32,-118],[-9,-9],[-17,41],[-15,86],[2,26],[-40,101],[3,46],[-3,54]],[[77769,38206],[56,-94],[13,-84],[-24,-50],[-34,-11],[-6,42],[5,88],[-8,31],[-2,78]],[[77656,38534],[19,10],[20,-39],[3,-51],[10,-46],[22,-63],[-24,-19],[-53,98],[5,42],[-2,68]],[[77440,39322],[31,37],[10,-24],[1,-96],[17,-28],[13,-123],[11,-17],[9,-67],[14,-22],[-8,-34],[18,-34],[5,-56],[14,-48],[-12,-82],[-29,-16],[-32,33],[-37,59],[-14,47],[-7,71],[-46,164],[-11,63],[17,77],[2,80],[13,25],[21,-9]],[[77368,40104],[12,30],[39,1],[26,-10],[14,-34],[-28,-28],[-54,12],[-9,29]],[[77345,39955],[7,-78],[27,-70],[-7,-38],[-19,53],[-25,100],[-8,91],[17,-3],[8,-55]],[[77355,39798],[11,-51],[-5,-125],[-23,-5],[-20,23],[7,33],[3,90],[16,42],[11,-7]],[[77093,41027],[42,-172],[34,-30],[7,-36],[23,-45],[7,-53],[-11,-38],[-5,-109],[2,-78],[-16,-57],[-17,15],[-18,-13],[-22,172],[-41,100],[-19,7],[-8,64],[-14,70],[-51,164],[5,30],[20,-2],[28,52],[23,27],[31,-68]],[[76977,41604],[17,6],[11,-21],[14,19],[18,-58],[-2,-68],[-31,87],[-27,35]],[[76616,42087],[14,10],[3,-62],[26,-10],[14,-40],[21,-10],[1,-77],[22,11],[18,-45],[21,-21],[17,-60],[23,-11],[8,-69],[-16,-25],[-27,9],[-7,55],[-25,17],[-18,51],[-25,41],[-50,21],[-38,72],[-18,53],[19,36],[7,73],[10,-19]],[[74699,59605],[-3,-38]],[[75587,59294],[13,-27],[86,44],[51,31],[34,-42],[30,15],[52,-26],[76,30],[62,8],[47,46],[25,15],[9,115],[59,162],[34,77],[31,52],[58,7],[76,87],[23,17],[19,39],[39,33],[59,76],[16,63],[6,65],[47,43],[26,34],[64,48],[30,-74],[24,-5],[60,17],[5,-56],[21,-14],[14,32],[25,-61],[27,-28],[18,-62],[32,-18],[17,-38],[34,-10],[25,-81]],[[75723,55766],[-8,101],[5,43],[-3,89],[-9,83],[-10,221],[-12,28],[-2,67],[-26,57],[6,85],[-10,38],[-2,93],[14,1],[-5,82],[-8,28],[-13,138],[-21,72],[-24,35],[-23,-63],[-35,27],[10,-129],[-58,-139],[12,-92],[2,-82],[-26,-56],[-36,-8]],[[75441,56485],[-4,-8]],[[75437,56477],[-9,24],[2,28],[-11,48],[-2,62],[-25,51],[-9,-63],[9,-66],[-12,-9],[-13,64],[-4,111],[-16,121],[-25,80],[-3,85],[17,26],[12,63],[-4,61],[18,53],[16,-9],[9,47],[-6,41],[61,-21],[13,23],[5,53],[28,-27],[-4,73],[21,-27],[24,-51],[9,93],[-5,49],[24,32],[25,-6],[18,33],[-3,58],[17,3],[12,126],[11,41],[-13,124],[13,5],[25,-46],[25,11],[4,54],[-19,16],[2,43],[-57,52],[-8,24],[-37,41],[-66,-8],[-32,-12],[-19,-27],[-18,36],[-27,-26],[-32,29],[-48,17],[-32,-2],[-41,-25],[-23,-4],[-21,18],[-10,-20],[-27,15],[-31,-2],[-21,-15],[-77,51],[-15,0],[-58,61],[-19,0],[-5,36],[17,185],[-14,74],[0,109],[4,51],[-18,117],[-11,38],[-36,14],[-5,-28],[13,-55],[-35,-38],[-45,-1],[-35,82],[-20,12],[-3,47],[-15,135],[-15,5],[-22,41],[-13,-63],[21,-15],[16,-77],[-26,0],[-41,46],[-38,-24],[10,46],[-15,67],[-34,37],[-22,39],[-14,64],[-13,-82],[41,-54],[5,-58],[-23,-14],[-23,-37],[-1,-44],[-28,-23],[-19,-30],[2,-61],[-28,-106],[5,-62],[10,-23],[36,-9],[37,-79],[15,-7],[1,-47],[25,-58],[15,-1],[17,-31],[41,36],[8,-110],[21,-42],[17,-4],[-4,-70],[-14,-22],[-21,24],[-6,-26],[-28,23],[-26,-1],[-11,-20],[-29,25],[-10,-27],[2,-96],[-18,-73],[-32,-37],[-13,54],[-22,-35],[7,-37],[-15,-35],[-14,-66],[-15,-38],[27,-88],[27,-61],[17,-10],[18,-44],[27,-1],[45,-50],[34,-3],[8,-39],[-10,-100],[11,-48],[-2,-96],[-21,-33],[-20,2],[4,-41],[-9,-64],[-2,-63],[21,-19],[10,-45],[25,-72],[-5,-101],[-8,-38],[25,-25],[28,12],[11,-21],[-5,-46],[-18,-47],[1,-90],[11,-51],[17,-26],[-16,-62],[14,-45],[-9,-31],[17,-150]],[[74719,56102],[-8,-27],[-40,-32],[-3,-19],[-1,-3],[0,-4],[2,-3],[-5,-43],[-14,-44],[-22,-10],[-13,-59],[6,-40],[-11,-41],[-12,11],[-18,-29],[3,-34],[-22,-7],[-11,-51],[-13,19],[-22,-33],[-16,14],[-13,89],[17,51],[-13,31],[-32,-47],[-20,-102],[-45,-111],[-40,-42],[-67,-42],[-21,-32],[-42,-3],[-24,-25],[-39,-73],[-34,-110],[-10,-60],[2,-38],[36,-194],[1,-41],[-25,2],[-15,-25],[-13,-80],[28,-4],[-15,-60],[-22,-48],[-2,-54],[-16,-63],[1,-50],[-41,-46],[-10,-54],[-35,-100],[-2,-20],[-66,-61],[-85,-54],[-68,-57],[0,90],[-46,9],[-17,-13],[-35,-58],[-14,-60],[1,-28],[-11,-90],[21,13],[8,55],[-5,27],[54,28],[4,-32],[-26,-38],[-48,-84],[-21,-54],[-54,-102],[-22,-62],[-36,-136],[-20,-49],[-16,-76],[-17,-37],[-38,-132],[-44,-99],[-20,-77],[-52,-72],[-65,-77],[-37,-65],[-7,-36],[-26,-46],[-10,-55],[-56,-165],[-54,-61],[-8,-24],[-64,-73],[-53,-76],[-35,-66],[-31,-74],[-23,-96],[2,-97],[14,-51],[-14,-24],[3,-53],[-13,-63],[-78,-101],[-29,-21],[-31,-37],[-11,14],[-84,27],[-39,-88],[-17,-72],[1,-33],[-12,-48],[-4,-52],[-30,-78],[-16,-24],[-33,33],[-21,-1],[-24,24],[-31,-18],[-59,-82],[-28,-72],[-7,-88],[-12,-64],[-21,-73],[-6,-86],[-11,-101],[2,-60],[15,-180],[9,-30],[15,-93],[-7,-147],[-10,-81],[-2,-92],[11,-99],[24,-151],[-6,-72],[-11,-29],[-9,60],[-20,-17],[-11,-79],[14,-56],[35,-19],[32,-93],[2,-50],[-14,-106],[-11,-151],[0,-105],[-26,-186],[-4,-51],[-26,-84],[-47,-193],[-13,-84],[-21,-225],[-2,-47],[8,-64],[-2,-41],[16,-53],[6,-145],[-2,-258],[6,-345],[-7,-20],[-25,-2],[-13,36],[-44,19],[-22,-28],[-18,8],[-38,-60],[-12,-100],[4,-55],[-32,-93],[-9,-44],[-31,-102],[-16,-74],[-7,-84],[26,-85],[33,-50],[42,8],[14,25],[3,-62],[-33,30],[-31,-16],[-31,10],[-31,-13],[-59,-45],[-3,-27],[-66,-33],[-53,-99],[-14,-69],[-1,-98],[-11,-63],[1,-113],[-18,-54],[0,-33],[-21,-21],[-31,-54],[-21,-19],[-24,-54],[-35,-16],[-11,-47],[-68,37],[-91,182],[-5,27],[-72,227],[-23,83],[-20,35],[-8,85],[-47,265],[-14,145],[-11,210],[-10,69],[-30,259],[-57,329],[-20,215],[-29,184],[-13,64],[-19,26],[-23,153],[-66,176],[-2,67],[-24,-21],[-45,272],[-18,80],[-40,241],[-33,363],[-14,225],[-5,20],[-10,134],[-11,56],[-15,29],[-12,131],[-13,75],[-2,48],[-17,130],[-9,-6],[-12,69],[0,47],[-9,45],[-12,-6],[-22,36],[-8,79],[-15,19],[1,32],[-22,75],[-14,16],[8,41],[-16,139],[-23,28],[12,53],[-23,28],[-21,161],[-29,139],[-21,22],[-20,186],[-23,172],[-12,73],[4,105],[-6,32],[-7,117],[5,62],[-3,68],[-13,107],[-8,35],[8,31],[-10,48],[-4,60],[-13,54],[-8,108],[5,10],[-20,156],[-9,13],[3,65],[-10,13],[-9,57],[-4,131],[-12,40],[-5,63],[5,89],[-16,80],[4,78],[25,-32],[19,24],[-34,68],[27,33],[1,81],[-14,8],[-12,-41],[-28,-13],[4,81],[-11,46],[17,70],[-18,33],[-11,113],[9,23],[-15,35],[-3,114],[-13,165],[16,40],[7,157],[8,93],[12,24],[2,47],[16,51],[4,58],[-30,226],[-10,32],[-14,97],[-23,92],[-6,62],[12,36],[12,121],[-21,51],[37,74],[-60,-9],[10,96],[15,37],[-28,14],[-3,43],[13,156],[10,33],[19,6],[23,-27],[3,41],[-27,36],[-23,7],[-17,-23],[-19,13],[-22,43],[-6,-69],[-13,-8],[-5,-108],[-32,-14],[-20,-84],[33,-9],[9,-36],[-3,-83],[21,-96],[-26,-149],[-28,-82],[-7,-43],[7,-36],[-33,-43],[-50,-51],[-14,-33],[-30,-17],[-19,9],[-16,-17],[-4,-46],[-20,-37],[-34,-17],[-47,-64],[-40,-14],[-8,-24],[-36,2],[-6,-12],[-66,65],[-33,41],[-41,63],[-63,132],[-24,62],[-83,240],[-35,76],[-102,229],[-72,203],[-6,47],[22,100],[15,-41],[30,-10],[-5,-43],[9,-41],[12,-3],[30,47],[18,-8],[40,41],[13,-37],[17,50],[49,49],[24,-5],[4,24],[27,47],[37,3],[31,128],[26,-11],[11,72],[15,18],[35,172],[48,62],[42,14],[-19,60],[-10,-24],[-50,-39],[-36,-4],[-40,14],[-28,-24],[-28,-81],[-20,-89],[-42,-17],[-70,-72],[-32,10],[-26,-27],[-42,42],[-34,4],[-63,91],[-76,118],[-17,50],[10,54],[-14,65],[-16,19],[-21,103],[1,51],[26,71],[18,65],[23,27],[32,0],[-12,108],[31,-7],[15,-80],[37,19],[11,101],[11,59],[-30,12],[-26,33],[-23,64]],[[69138,57408],[13,28],[11,-54],[30,34],[28,-28],[33,33],[53,-10],[25,17],[38,-87],[82,0],[11,20],[12,69],[40,22],[89,70],[-3,-52],[6,-52],[17,-38],[44,-3],[21,58],[30,46],[17,-7],[15,57],[-29,6],[-3,109],[24,47],[-2,40],[-22,109],[-14,50],[-13,150],[-39,93],[-4,39],[-20,46],[3,200],[-18,28],[-22,-22],[-40,-7],[-33,28],[-13,57],[-13,25],[-21,81],[-4,103],[16,54],[9,66],[3,88],[-3,128],[-33,35],[-44,-16],[-30,15],[-17,37],[-60,66],[-7,44],[8,147],[20,123],[85,182],[11,45],[26,47],[30,174],[26,69],[19,25],[21,54],[37,18],[23,-19],[25,-64],[2,-67],[21,-77],[40,-8],[83,90],[50,27],[78,3],[65,60],[8,116],[21,69],[36,68],[20,58],[26,197],[29,82],[22,20],[70,98],[59,57],[16,90],[23,60],[54,240],[32,268],[56,53],[58,35],[46,93],[-3,46],[-16,63],[8,90],[29,40],[10,-6],[16,78],[18,25],[18,76],[29,87],[26,52],[25,19],[0,29],[34,15],[5,53],[-38,-30],[-11,33],[12,168],[26,71],[-18,40],[9,26],[-17,36],[-8,57],[12,107],[30,65],[39,23],[3,28],[27,49],[24,-22],[31,33],[33,12],[37,94],[-1,35],[-14,47]],[[70922,63202],[54,-33],[21,57],[27,11],[37,74],[26,85],[-5,47],[4,55],[-9,40],[-27,60],[25,20],[20,-35],[41,63],[5,37],[46,18],[2,50],[34,55],[20,-5],[23,22],[17,-31],[35,9],[9,43],[18,5],[-8,-74],[25,-46],[18,-56],[22,-1],[27,-24],[8,-37],[55,-65],[9,44],[18,-19],[60,93],[34,-58],[-5,-36],[24,-28],[13,-33],[-1,-59],[18,-73],[13,1],[22,52],[30,2],[11,27],[33,37],[5,-33],[-5,-79],[-19,-26],[-6,-70],[11,-15],[20,61]],[[71802,63152],[-17,-50],[8,-49],[17,-8],[25,-49],[-3,-20],[29,-27],[17,-31]],[[71872,62873],[-25,-35],[15,-39]],[[71911,62444],[31,-89],[-6,-39],[9,-45],[25,-36],[24,16],[17,-49],[24,14],[-1,41],[24,33]],[[72138,62217],[16,-19],[18,-64],[16,6],[17,-53],[9,-60],[19,-77],[26,-29],[20,22]],[[72372,61843],[22,-12],[13,-63],[13,-11],[41,-114]],[[72461,61643],[5,-26],[-21,-31],[-19,-66],[-16,-28],[-27,-16],[-8,-61],[-40,-41],[-12,-47],[12,-93],[-19,-64],[-26,-46],[0,-27],[20,-75],[-13,-115],[-24,-5],[-11,-24],[-5,-69],[-19,-65],[1,-56],[15,-6],[72,-144],[23,-5],[22,49],[31,-40],[18,-47],[53,-74],[30,-20],[18,-38],[37,-17],[6,-52],[24,-65],[35,-26],[9,-57],[46,-63],[15,-4],[30,-61],[26,-36],[19,54],[26,-5],[17,-40],[24,-17],[54,-100],[19,-19],[66,30],[13,-97],[-5,-58],[53,-1],[29,-37],[37,6],[46,-90],[16,32],[1,74],[61,-7],[61,-72],[0,40],[28,17],[24,-10],[27,55],[38,-42],[6,-41],[96,-43],[19,-83],[-4,-85],[-9,-40],[36,-20],[53,-41],[2,-32],[33,-34],[28,1],[2,-72],[38,-20],[21,35],[24,5],[31,42],[20,-9],[15,-34],[-2,-90],[6,-23],[29,-22],[5,-23],[44,65],[35,-41],[53,5],[62,-86],[47,-52],[8,25],[21,-16],[25,56],[23,13],[16,38],[5,-97],[20,-33],[24,7],[18,-33],[21,36],[22,16],[39,-43],[28,34],[15,-13],[8,42],[16,-23],[14,29],[9,-42],[27,-21],[17,26],[3,89],[17,65],[7,78],[-5,86],[-9,20],[-3,56],[-25,44],[-13,68],[14,172],[9,45],[-8,32],[13,84],[15,49],[15,124],[-18,32]],[[76060,45198],[18,-23],[1,-76],[8,-36],[0,-73],[-10,-103],[-17,14],[-8,58],[-10,12],[-5,47],[-18,30],[0,36],[17,78],[24,36]],[[76022,45304],[21,-7],[-9,-46],[-27,-31],[7,72],[8,12]],[[75967,45884],[18,-80],[-15,-13],[-10,43],[7,50]],[[75919,45712],[7,42],[34,-52],[-22,-41],[-5,56],[-14,-5]],[[75846,49599],[-19,-19],[-2,-49],[17,-2],[6,-31],[-7,-40],[-3,-90],[-39,-30],[-6,-37],[3,-51],[-19,12],[-2,80],[16,98],[1,52],[-6,104],[20,31],[-9,32],[21,52],[24,25],[4,-137]],[[75779,49229],[12,-2],[6,25],[15,-4],[8,-58],[6,-187],[-5,-39],[-17,-29],[-14,23],[-5,-64],[5,-58],[-41,17],[3,200],[9,42],[2,123],[16,11]],[[75773,48817],[27,-7],[-9,-73],[-30,-62],[12,142]],[[75755,46598],[2,22],[25,-1],[3,-56],[-26,-12],[-4,47]],[[75760,48698],[-2,-75],[-8,-57],[23,-49],[-11,-124],[2,-59],[-11,-87],[-19,25],[-10,51],[-6,104],[-10,-15],[-2,147],[18,-21],[4,152],[6,52],[17,25],[14,-35],[-5,-34]],[[75682,47794],[28,5],[1,-55],[9,-79],[-15,-46],[8,-24],[-20,-49],[-19,26],[-4,61],[-10,50],[22,111]],[[74722,55998],[10,-54],[-14,-12],[-11,37],[15,29]],[[74691,55973],[7,-33],[-30,-6],[6,40],[-7,21],[2,19],[-2,6],[2,9],[2,12],[9,4],[11,-14],[13,-33],[-13,-25]],[[74623,55881],[12,33],[21,9],[-28,-121],[-5,79]],[[74554,55657],[10,55],[16,-37],[-13,-31],[-13,13]],[[74508,55539],[-9,23],[7,52],[13,-6],[9,-53],[-20,-16]],[[74462,55595],[19,101],[10,-46],[-7,-125],[-22,-3],[-7,25],[7,48]],[[74112,54857],[8,41],[39,3],[5,-39],[-44,21],[-8,-26]],[[72270,70277],[-26,93],[-28,28],[-3,39],[-50,10],[-26,21],[-49,-14],[-25,43],[-23,62],[-21,13],[-24,50],[-4,46],[-21,16],[-46,-2],[-18,19],[-75,33],[-36,35],[-32,-30],[-42,20],[-14,-18],[-85,18],[-17,24],[-23,-8],[-41,25],[-35,-8],[-21,-20],[-31,8],[-23,44],[-42,7],[-46,-9],[-36,-47],[-56,10],[-5,-21],[-40,-20],[-12,36],[-33,15],[-45,-16],[-27,33],[-27,-12],[-13,-73],[-18,-30],[-64,32],[-71,9],[-53,47],[-57,60],[-23,-9],[-55,106],[-24,8],[-44,48],[-74,-31],[-19,36],[-18,-81],[-23,14],[-77,-72],[-4,-61],[-10,-16],[1,-111],[-21,-90],[2,-88],[24,-70],[-45,4],[-14,59],[-55,24],[-36,-9],[-40,19],[-27,64],[-36,26],[-35,6],[-34,39],[-49,10],[-12,-14],[-53,55],[-38,15],[-36,-14],[-23,-32],[-16,26],[-74,-48],[-27,-49],[0,-45],[-49,-16],[18,-81],[-24,15],[-8,-70],[-19,-39],[2,-58],[15,0]],[[69706,70315],[-30,-49],[-12,10],[-29,-62],[-13,-74],[-25,8],[-3,35],[-18,17],[-43,-47],[4,-45],[-23,-19],[-19,-60],[-50,-48],[-23,-58],[-21,3],[-64,-42],[-32,-83],[-13,16],[-28,-73],[-29,0],[-26,-23],[3,-29],[-35,-20],[0,-80],[-16,-33],[-48,-65],[-27,-61],[5,-45],[-25,-19],[-15,60],[-23,-20],[4,-41],[18,-13],[-6,-85],[6,-69],[17,-11],[3,-58],[-12,-26],[-30,2],[-37,27],[-42,50],[-40,74],[-27,30],[10,43],[21,24],[-19,68],[-15,91],[-28,-9],[-36,34],[-46,-11],[-57,-30],[-15,6],[-167,5],[-29,260],[-20,268],[-149,43],[1,305],[24,-10],[3,423],[-71,-57],[-24,86],[-55,221],[-17,34],[-87,116],[-51,157],[-19,15],[-112,-117],[-187,20],[-155,38],[-235,-91],[-124,-15],[-161,355],[-80,161],[-9,96],[-43,68],[-264,392],[-218,238],[-174,185],[-164,-94],[-278,-160],[-278,-169],[1,-404],[0,-314],[0,-478],[0,-478],[0,-478],[0,-488]],[[65555,69638],[-34,5],[-90,-31],[-16,-21],[-63,132],[-43,124],[-13,64],[-33,96],[1,52],[-48,105],[-157,234],[-177,-63],[-161,-118],[-18,-24],[-135,-237]],[[64568,69956],[13,128],[-19,100],[8,72],[34,93],[18,82],[11,90],[20,53],[-4,78],[-30,12],[-5,38],[-39,24],[-37,-7],[-13,-32],[-19,59],[-23,12],[-66,-34],[-38,143],[-29,51],[-11,58],[-94,-28],[-5,18],[12,103],[2,97],[-13,82],[-32,51],[-36,125],[-9,91],[-35,70],[2,55],[-10,62],[-18,31],[-53,32],[-43,6],[-32,27],[-18,39],[-2,115],[20,72],[119,-31],[17,21],[25,-14],[34,-71],[23,-28],[28,0],[27,47],[19,3],[15,-30],[26,6],[15,31],[-37,34],[-33,-3],[-33,207],[23,92],[-8,111],[39,98],[55,26],[39,43],[41,11],[40,-5],[80,-70],[52,7],[48,-20],[6,-30],[51,-44],[75,-12],[26,3],[33,35],[28,46],[41,-2],[77,-77],[31,56],[9,-21],[-23,-59],[-102,-88],[-26,-65],[-24,-110],[-65,-229],[2,-47],[33,-20],[35,87],[14,75],[23,79],[3,65],[19,49],[36,59],[38,-16],[57,48],[8,31],[34,9],[6,-26],[75,-9],[51,70],[21,49],[41,50],[-34,31],[-15,57],[-48,50],[-8,45],[-22,43],[-32,23],[7,48],[-52,103],[-67,-16],[-21,-67],[-43,-70],[7,-47],[-40,-9],[-30,74],[-16,65],[-99,48],[1,65],[-13,29],[24,28],[14,60],[16,21],[6,74],[20,46],[15,64],[4,83],[-9,53],[-29,37],[-12,96],[-29,42],[3,48],[-13,62],[-27,23],[-31,64],[-21,-30],[-78,18],[-29,40],[-30,-44],[-24,-14],[-67,27],[-41,-55],[-31,15],[-6,53],[20,54],[-41,10],[-12,-30],[-68,19],[-25,24],[-41,-36],[-59,-9],[-26,-28],[-3,-35],[-46,-13],[-14,-51],[-68,-55],[-22,-72],[-10,36],[-32,-60],[-16,-71],[-28,-3],[-3,-96],[-16,-66],[-8,-113],[-53,27],[-32,-30],[-24,39],[-37,21]],[[64231,72304],[-17,-17],[-3,-73],[-18,-4],[-12,37],[27,46],[23,11]],[[63976,72322],[12,-13],[-13,-89],[-20,51],[21,51]],[[70444,68304],[-24,11],[-34,-15],[-11,-43],[-53,-30],[-62,14],[-16,-16],[-52,34],[-58,-13],[-3,-21],[-36,-11],[-19,-77],[-47,29],[-18,75],[-39,-61],[-27,-10],[-15,45],[16,40],[-9,53],[-40,-14],[-20,10],[-6,40],[9,34],[-24,32],[-20,-25],[-20,1],[-40,-45],[-27,5],[-11,-78],[-32,14],[-32,-28],[-22,28],[3,41],[-14,16],[-16,55],[-33,28],[-31,-35],[-18,0],[-18,-34],[-32,19],[-17,26],[-38,-17],[-16,8],[-15,-35],[-21,36],[-46,10],[-22,-34],[-58,1],[-4,125],[-17,62],[9,80],[17,50],[21,-10],[15,19],[13,69],[40,18],[31,41],[64,37],[50,-71],[25,-1],[42,-56],[25,0],[14,-36],[20,70],[41,23],[1,34],[50,33]],[[69717,68854],[-7,43],[33,9],[14,27],[41,6],[66,-58],[0,-23],[30,-17],[22,26],[5,-64],[32,37],[14,40],[22,-15],[0,56],[24,37],[31,81],[26,-2],[37,-60],[12,41],[-3,68],[15,2],[50,-30],[4,57],[22,5],[15,58],[53,62],[28,4],[15,43],[-37,11],[-21,-32],[-29,41],[-27,-11],[-46,22],[-5,64],[-15,4],[-15,46],[-29,10],[-26,-31],[-19,82],[-29,3],[-51,30],[9,94],[-36,86],[-31,6],[-13,-58],[-18,-35],[-28,3],[-8,-35],[3,-65],[-44,-36],[-5,45],[-22,18],[-22,-37],[-22,34],[-18,-18],[-39,60],[-16,-24],[1,124],[-25,60],[-33,-22],[-16,-31],[-57,86],[-22,-19],[-15,18],[10,41],[80,105],[8,56],[19,14],[23,68],[44,7],[1,55],[16,35],[26,-13],[16,36],[35,45],[18,7],[8,37],[-38,56],[-29,8],[-23,-22]],[[69777,68658],[-5,54],[-21,16],[-8,71],[-19,13],[0,-83],[22,-44],[12,-75],[17,8],[2,40]],[[69591,68609],[12,-49],[20,-11],[13,49],[-45,11]],[[86334,66902],[24,27],[-4,-61],[-20,34]],[[85654,67700],[30,-120],[-1,-20],[24,-83],[18,-117],[16,-42],[58,-182],[49,-113],[-3,-28],[19,-39],[3,-44],[36,-100],[4,-38],[22,-56],[-2,-50],[19,-111],[2,-96],[11,-53],[6,-83],[-19,-75],[9,-33],[-1,-88],[-16,-68],[5,-141],[10,-22],[-14,-55],[17,-25],[26,53],[10,-45],[-15,-52],[4,-43],[-12,-59],[-5,-77],[-9,-27],[6,-42],[-6,-70],[-25,-28],[-5,-67],[-19,-25],[-3,-53],[-17,-61],[-21,-8],[2,-36],[-80,-12],[-13,17],[-27,-6],[-23,43],[-11,-47],[-23,7],[-3,-78],[-13,-27],[15,-49],[12,25],[23,-6],[19,65],[14,-42],[-21,-152],[-21,5],[-4,66],[-65,31],[-8,43],[-24,4],[-3,-34],[-41,25],[-12,40],[-20,11],[-14,-32],[2,-60],[17,-48],[9,20],[20,-11],[-8,-69],[-22,-4],[-1,44],[-29,7],[-10,46],[12,71],[-18,-7],[-1,-38],[-26,20],[-23,-47],[46,7],[-12,-93],[-20,18],[-13,-79],[-13,7],[-3,46],[11,21],[-18,68],[-35,-13],[-8,-59],[27,-56],[9,-42],[-28,-72],[-28,-25],[-6,23],[-46,40],[30,48],[4,52],[21,-23],[4,62],[-41,-43],[-32,-23],[-18,-40],[-17,-112],[-58,0],[-29,-29],[-7,-69],[-21,14],[-13,38],[-7,103],[-19,24],[-5,-85],[-11,-27],[-45,-38],[-20,44],[9,37],[18,21],[26,76],[-7,67],[7,46],[28,-19],[-5,57],[13,25],[-3,50],[-17,0],[-13,35],[27,43],[-21,21],[-37,3],[21,60],[20,2],[4,-49],[21,22],[-18,56],[-16,19],[18,53],[12,89],[22,80],[-5,82],[66,116],[-2,31],[-23,35],[0,39],[19,29],[-14,83],[-31,38],[7,82],[-18,83],[6,31],[-13,122],[-23,17],[0,-56],[17,-88],[-27,15],[-3,83],[-18,119],[-18,-32],[-3,148],[14,21],[25,-37],[26,27],[-19,45],[2,33],[26,-2],[13,43],[36,-44],[19,-3],[41,-31],[-15,53],[-5,72],[-25,-8],[-11,52],[-19,21],[-5,41],[37,41],[-6,41],[-21,35],[-3,35],[-45,-49],[-13,34],[65,61],[-13,34],[-44,-5],[-8,28],[-7,112],[25,27],[46,-53],[20,16],[4,48]],[[85547,64996],[13,54],[13,-39],[-26,-15]],[[85487,64889],[11,-18],[-3,-62],[-20,28],[12,52]],[[85189,64066],[25,12],[33,-27],[9,-73],[-26,-85],[-53,-30],[-13,-21],[-77,1],[-9,-26],[-28,42],[-5,59],[30,66],[31,39],[29,21],[54,22]],[[85179,64628],[-2,36],[24,1],[9,-66],[-31,29]],[[85001,65031],[22,4],[17,-19],[-16,-41],[-23,56]],[[84999,64961],[-14,-28],[16,-52],[-24,-10],[-6,76],[28,14]],[[81541,55940],[0,-55]],[[80456,41501],[4,-63],[-2,-59],[15,-48],[38,-41],[18,-72],[15,-13],[13,21],[22,2],[16,-32],[15,9],[11,-45],[23,-8],[-2,78],[11,40],[13,-113],[7,23],[5,69],[17,-8],[-31,-122],[15,-52],[26,75],[17,12],[32,-33],[21,19],[42,-42],[22,-58],[15,0],[-23,97],[11,73],[30,1],[-15,57],[5,57],[18,91],[20,37],[25,6],[60,116],[24,-8],[1,30],[4,23],[7,8],[-1,17],[7,2],[15,-29],[8,8],[3,-18],[7,8],[-3,16],[7,47],[-12,41],[20,41],[-1,42],[-6,67],[-5,10],[1,13],[-1,12],[0,14],[4,5],[6,-5],[2,10],[-22,86],[-27,31],[50,25],[26,5],[53,29],[46,34],[66,35],[38,29],[65,38],[29,48],[13,44],[-3,28],[25,48],[5,33],[30,69],[5,44],[16,38],[16,62],[6,47],[29,50],[42,91],[21,60],[14,61],[32,101],[11,56],[7,108],[-8,67],[30,2]],[[81687,43298],[24,-10],[27,-48],[20,-113],[-4,-61],[29,-8],[22,-78],[13,-15],[11,-54],[16,-30],[22,31],[14,50],[19,89],[11,129],[-15,5],[-3,116],[-11,79],[33,82],[24,10]],[[81939,43472],[9,-12],[6,-67]],[[81954,43393],[1,-62],[16,-117],[-2,-58],[18,-9],[38,-37],[11,45],[-17,43],[5,114],[-14,141],[-16,40]],[[81994,43493],[15,28],[28,-12],[13,19],[10,46],[25,40],[11,38],[1,41],[14,28],[-2,44],[-15,-7],[-29,93],[-20,19],[30,70],[36,62],[10,-16],[34,-12],[19,11],[16,52],[4,96],[22,24],[19,61],[2,65],[15,32],[11,66],[-1,45],[27,65],[22,34],[2,50],[44,85],[24,113],[12,18],[8,47],[-5,33],[36,178],[20,-44],[9,-57],[-3,-80],[-16,-65],[-9,-8],[-10,-83],[28,-16],[8,46],[76,160],[-22,17],[-5,31],[22,32],[11,53],[22,-59],[-6,-115],[10,-2],[-3,-68],[66,-145],[5,44],[23,-4],[2,-50],[40,-20],[-33,-123],[-14,-24],[-2,-52],[17,-2],[1,-59],[-17,-35],[-18,-7],[-8,-14],[1,-26],[14,-30],[-2,-17],[14,11],[15,5],[5,-11],[46,-2],[-9,31],[45,15],[0,33],[20,31],[11,-84],[26,-58],[-30,-36],[-44,21],[3,-70],[14,-56],[13,-4],[20,28],[28,-43],[11,33],[3,85],[36,-20],[11,-45],[11,14],[19,-42],[-9,-22],[24,-99],[28,44],[9,57],[28,-66],[-7,-53],[19,-29],[4,-27],[29,-24],[31,19],[23,41],[20,3],[15,-33],[7,-130],[-26,-71],[-22,-24],[-57,-37],[-6,-21],[-54,-42],[-34,21],[-17,29],[-29,18],[-25,-12],[-49,-95],[3,-38],[18,-25],[-2,-37],[17,-30],[15,-52],[19,-12],[4,-49],[27,-32],[4,-96],[-29,-24],[-38,-8],[-40,-30],[-31,-41],[-33,16],[-10,44],[-37,86],[-15,14],[-22,-15],[-16,-42],[6,-65],[-18,1],[0,-48],[15,-34]],[[82926,43129],[-11,32],[3,64],[8,25],[19,-22],[3,-52],[-22,-47]],[[82693,42997],[-8,67],[21,-4],[23,-50],[20,-13]],[[82646,44236],[-10,25],[-9,15],[23,19],[6,-36],[-10,-23]],[[82521,45168],[-5,71],[25,39],[36,1],[-8,-69],[-40,-78],[-8,36]],[[82466,45226],[29,33],[-7,-52],[-18,-14],[-4,33]],[[81040,42012],[31,-80],[-8,-6],[-3,-3],[-2,-11],[2,-35],[5,-15],[6,-101],[-21,-43],[13,-39],[-9,-65],[-4,16],[-5,-9],[-5,18],[-20,13],[0,18],[-3,19],[-15,34],[-9,56],[-8,-19],[-9,17],[-4,25],[-11,-10],[-16,33],[8,122],[17,32],[45,58],[25,-25]],[[80972,41630],[-3,60],[31,-15],[15,14],[4,-19],[1,-41],[-6,-7],[-5,-26],[0,-28],[-36,30],[-1,32]],[[80988,41761],[13,-53],[-32,-13],[-21,48],[1,50],[10,-11],[12,12],[4,-26],[8,-13],[5,6]],[[80939,41700],[18,7],[4,-48],[-25,-2],[3,43]],[[80953,41636],[-14,-21],[-2,-14],[-2,-31],[-13,-15],[-10,34],[25,12],[2,14],[4,8],[10,13]],[[80916,41759],[3,52],[-8,99],[2,68],[17,31],[9,-39],[-2,-185],[10,-78],[-15,-7],[-16,59]],[[80888,41621],[-3,80],[16,-4],[-2,-49],[-11,-27]],[[78356,44431],[-1,39],[7,8],[6,-13],[23,7],[38,-41],[7,-26],[24,-139],[24,-70],[24,-40],[19,-72],[54,-97],[15,-5],[42,-96],[24,-102],[29,-159],[38,-164],[5,-82],[-3,-32],[11,-91],[-8,-43],[3,-52],[10,-53],[-5,-45],[-14,-18],[6,-40],[-16,-45],[6,-106],[-11,-34],[2,-72],[-14,-50],[5,-47],[36,-124],[-12,-69],[-2,-59],[6,-69],[-4,-200],[5,-59],[20,-72],[30,-78],[36,-31],[22,-78],[0,-54],[33,-92],[2,-78],[42,-169],[-2,-64],[22,-64],[17,-99],[2,-62],[11,-84],[-3,-55],[-40,-20],[-15,100],[-21,-6],[-12,-33],[-23,7],[-13,32],[-19,-21]],[[78824,41050],[-27,-17],[-11,-56]],[[78786,40977],[-30,-11],[-4,-47],[-18,39],[-22,149],[-31,53],[-30,32],[-38,62],[-27,20],[-8,39],[-26,36],[-29,2],[-22,77],[-34,91],[-39,33],[-44,48],[-9,-2],[-27,90],[-34,60],[-20,-8],[-18,120],[-12,18],[-40,19],[-37,42],[-19,78],[10,48],[-24,151],[-12,36],[-5,91],[-30,77],[-25,91],[-12,79],[-44,108],[-23,24],[1,41],[-30,37],[-2,57],[17,25],[-2,68],[-14,37],[-29,31],[-12,88],[31,174],[6,74],[-1,65],[-14,41],[1,37],[-13,46],[-21,17],[-18,-12],[-14,46],[-7,77],[12,43],[-4,121],[-25,16],[-7,-57],[-26,21],[-4,113],[20,12],[25,-45],[10,34],[-12,74],[21,53],[-17,35],[4,61],[-5,138],[-24,147],[-26,83],[-14,94]],[[78933,42085],[16,-85],[-1,-40],[-14,-4],[-13,48],[12,28],[0,53]],[[78159,42090],[13,-26],[-3,-41],[-34,27],[24,40]],[[77734,44625],[10,-87],[-19,4],[-23,-38],[-5,66],[-16,1],[-4,51],[37,-9],[20,12]],[[72461,61643],[48,20]],[[70464,66478],[14,-55],[45,-59],[-1,-36],[-47,8],[-33,-14],[-46,36],[-38,-32],[-32,11],[-23,-25],[1,-55],[-13,-54],[-20,-12],[-1,-41],[-19,3],[-9,-52],[-20,-41],[-38,-52],[-24,-4],[-17,-111],[18,-44],[-21,-83],[5,-28],[59,-47],[75,7],[22,34],[17,-25],[16,-121],[33,-5],[20,-55],[5,-46],[17,14],[23,-9],[17,14],[48,-21],[-1,-50],[-19,-22],[-10,-67],[18,-77],[17,16],[31,-21],[30,-46],[29,-24],[-18,-40],[0,-86],[-12,-46],[-16,-7],[-13,-38],[-22,3],[-33,-38],[-18,-68],[-1,-49],[-58,-22],[-6,-73],[1,-88],[18,-92],[-1,-63],[7,-91],[22,-78],[-9,-80],[10,-57],[-9,-25],[16,-61],[-8,-101],[-8,-47],[18,-108],[2,-98],[18,3],[21,-40],[41,-23],[11,-42],[50,-31],[30,-39],[16,-43],[41,2]],[[70682,63521],[21,-31],[35,29],[-2,-63],[12,-27],[-16,-33],[15,-57],[-3,-30],[84,-30],[12,33],[46,-51],[36,-59]],[[69138,57408],[-12,48],[-21,-15],[-13,23],[-12,-29],[-30,29],[2,-93],[-42,-62],[-19,24],[-30,-64],[-18,46],[17,33],[-23,31],[-7,-63],[-44,1],[-13,19],[-2,48],[-35,-24],[-13,-24],[-11,-61],[-40,0],[3,33],[-22,23],[7,82],[12,31],[-10,78],[-19,20],[-9,55],[14,45],[2,101],[-6,34],[-38,-1],[-11,25],[-24,2],[-38,-48],[-30,53],[-1,34],[-21,1],[-20,-22],[-20,9],[-16,30],[5,112],[-2,27],[13,58],[-45,150],[-11,135],[-69,36],[-27,-10],[-21,-45],[-7,-57],[27,22],[15,-5],[33,26],[32,-34],[3,-51],[-30,34],[-33,12],[-89,-38],[-32,3],[-18,-24],[-40,-22],[-47,27],[-12,-11],[-44,0],[-10,-45],[-29,-7],[-63,17],[-45,-9],[-24,-44],[-35,15],[-31,-26],[-48,45],[4,32],[45,11],[34,-50],[16,-3],[10,90],[-47,11],[-39,-29],[-1,34],[-27,32],[-30,19],[-8,-16],[-27,10],[-28,-54],[20,-22],[25,9],[-3,-55],[-42,12],[-39,26],[-41,-5],[-25,-33],[-7,-29],[4,-58],[-101,38],[-39,-33],[-53,28],[-47,12],[-41,-7],[-41,-80],[-28,50],[-28,1],[-20,-33],[8,-50],[-45,6],[-14,-9],[-6,-45],[-33,-9],[2,36],[14,33],[-3,65],[-32,-1],[-13,-22]],[[67115,58063],[10,95],[7,241],[14,59],[31,12],[1,95],[-5,60],[10,154],[15,56],[43,52],[8,-29],[32,-13],[13,101],[15,47],[1,33],[55,41],[24,-1],[42,50],[31,-4],[88,4],[5,20],[-2,99],[14,21],[2,180],[18,42],[-11,48],[-24,31],[-41,-17],[-26,-25],[-38,15],[4,62],[-9,20],[15,90],[-5,216],[-19,184],[9,185],[-55,-22],[-57,132],[-32,14],[-32,30],[-32,11],[-37,40],[-53,129],[-17,31],[-23,91],[-28,148],[-16,15],[3,42],[-21,63],[5,36],[-58,140],[-81,233]],[[67827,58209],[12,-50],[-33,7],[21,43]],[[84513,45191],[-13,23],[3,62],[-9,46],[-41,158],[-33,45],[-39,16],[-22,70],[-34,28],[-41,-25],[0,-38],[16,-26],[-5,-66],[-21,-16],[-15,-46],[12,-44],[19,-33],[1,-50],[-13,-10],[-22,47],[-9,79],[-36,-26],[-16,42],[25,34],[-21,84],[-21,-41],[-6,-85],[-11,-50],[-26,47],[-9,-13],[-14,43],[-6,69],[9,44],[-19,7],[-12,33],[-44,-41],[-21,-84],[-7,-5],[-5,-70],[-21,-43],[-2,-45],[-28,-151],[4,-42],[-30,-154],[-17,-11],[-35,37],[-11,30],[-7,66],[8,85],[24,57],[13,6],[-8,51],[12,94],[18,54],[-7,113],[2,54],[31,90],[-3,22],[20,42],[47,43],[34,9],[27,27],[21,-7],[42,23],[24,55],[-13,43],[11,50],[-3,45],[22,72],[34,14],[34,-11],[13,84],[28,34],[17,-44],[18,-11],[10,32],[21,-7],[26,-75],[16,-79],[2,-124],[6,-62],[-31,-80],[-19,-4],[-20,-39],[8,-39],[28,41],[27,75],[49,67],[41,-7],[18,23],[9,41],[-5,34],[10,53],[1,48],[9,59],[34,54],[36,-70],[48,-20],[8,69],[-8,81],[12,72],[-4,115],[27,30],[22,-30],[32,-77],[21,-12],[13,39],[-4,78],[14,44],[18,-55],[39,-10],[25,25],[5,49],[-1,82],[-8,78],[-9,42],[-6,81],[-16,131],[2,68],[12,32],[34,-34],[22,-100],[61,-54],[19,-54],[-12,-27],[26,-69],[20,-66],[31,54],[2,-117],[-4,-27],[42,-109],[7,-82],[-13,-49],[-51,-92],[5,-73],[24,12],[50,-33],[-12,-66],[-7,-126],[5,-44],[26,37],[3,-101],[-9,-98],[-14,-51],[6,-41],[17,-14],[14,-48],[16,-11],[13,-198],[-12,-5],[0,-89],[13,-36],[-23,-103],[-10,-10],[-10,-70],[-12,-16],[-18,9],[-13,-74],[15,-34],[-12,-34],[-13,84],[-18,14],[-6,-46],[25,-93],[-8,-56],[-1,-168],[-17,-46],[-22,111],[-4,96],[7,50],[-8,93],[-19,25],[-7,39],[2,57],[-27,68],[2,29],[-15,63],[4,77],[-11,3],[-32,-53],[-14,-39],[5,-82],[-17,-55],[-17,-2],[-16,-45],[1,-42],[-28,-83],[-4,-55],[4,-90],[50,-52],[5,-67],[8,-17],[27,-174],[-7,-141],[-7,-39],[-41,-122],[-4,-34],[-24,-93],[-21,-7],[-19,106],[-22,44],[9,85],[19,65],[-5,72],[-29,17],[-7,-61],[-13,-51],[-7,-66],[-41,2],[-25,19],[-88,99],[-27,47],[-27,17],[-38,69],[-8,44],[-31,102],[-7,78],[9,52],[-10,93],[5,37],[-20,25],[-1,59],[13,109],[17,72],[25,19],[13,57],[13,-18]],[[85042,47041],[-11,-42],[-29,12],[-3,128],[20,80],[13,-134],[10,-44]],[[84989,46963],[6,-10],[-6,-83],[-14,11],[-2,99],[16,-17]],[[84543,48816],[-10,105],[-10,28],[-6,55],[27,7],[41,-24],[16,7],[24,-17],[39,23],[21,-4],[4,24],[55,-19],[21,24],[37,-75],[6,-45],[-5,-32],[7,-66],[29,3],[19,-73],[-15,-36],[17,-44],[-21,-91],[4,-81],[10,-17],[0,-68],[-10,-65],[21,-84],[11,-64],[22,-48],[-26,-58],[-1,-45],[17,-14],[19,16],[7,-39],[-30,-20],[-18,23],[-24,-39],[-36,33],[-25,-30],[-5,62],[-15,70],[-35,-3],[-1,-78],[8,-72],[-1,-98],[-8,-96],[10,-57],[20,-16],[0,-26],[20,-48],[-9,-48],[11,-38],[-3,-33],[21,-39],[3,-51],[-15,-39],[-24,17],[3,-71],[20,-30],[17,-113],[-4,-42],[-22,94],[-15,31],[1,57],[-12,35],[-17,109],[-15,7],[4,-136],[11,-70],[-16,-31],[-21,52],[-31,12],[-7,36],[10,84],[-16,56],[-3,77],[12,34],[8,73],[0,67],[-9,63],[-22,87],[-31,50],[-14,-96],[-13,-6],[-16,43],[-4,138],[-5,60],[6,26],[-18,55],[-1,41],[-13,87],[8,48],[35,-100],[9,19],[-24,79],[-8,70],[3,24],[26,11],[19,-21],[13,-77],[10,-17],[-9,-50],[-17,0],[8,-97],[12,-27],[28,-1],[44,90],[14,-31],[17,47],[-25,17],[-12,37],[13,36],[13,-5],[19,38],[12,104],[-9,11],[-27,-29],[-55,150],[-6,38],[-26,45],[-17,-6],[-26,76],[-14,23],[-9,62]],[[84923,45010],[-4,68],[-13,28],[9,61],[17,-20],[11,-37],[-6,-56],[5,-71],[-19,27]],[[84911,47188],[-3,-53],[-19,10],[-6,70],[-22,14],[-7,45],[9,27],[2,111],[24,40],[21,3],[-9,-56],[3,-113],[11,-63],[-4,-35]],[[84822,43896],[17,0],[0,-36],[-20,0],[3,36]],[[84658,46519],[-27,30],[-11,70],[9,23],[18,-1],[13,-32],[7,-67],[-9,-23]],[[84449,46890],[-38,21],[-24,-53],[-15,20],[25,46],[7,40],[-20,29],[7,83],[17,43],[52,57],[22,84],[19,34],[30,4],[9,-28],[36,-50],[12,7],[11,-51],[-5,-24],[13,-109],[-5,-56],[-26,18],[-19,-32],[-3,-43],[-44,-38],[-14,8],[-28,-16],[-19,6]],[[84558,47629],[-38,-27],[12,87],[23,-17],[14,20],[13,-51],[-24,-12]],[[84482,49943],[0,117],[21,45],[14,-38],[5,-58],[15,-6],[24,-65],[-7,-137],[-13,-34],[-30,-15],[-22,-36],[-30,59],[-8,32],[19,29],[12,67],[0,40]],[[83602,53332],[37,34],[29,-19],[24,-49],[42,-49],[46,-68],[72,-64],[18,-9],[21,14],[34,75],[4,83],[20,11],[16,-75],[12,-27],[3,-79],[-19,-73],[-22,-37],[2,-148],[-15,-85],[9,-67],[-2,-63],[23,-176],[12,-19],[29,-9],[8,-39],[-3,-83],[31,-44],[-15,-85],[-1,-65],[-8,-59],[-43,-198],[-23,-66],[8,-104],[-6,-37],[-37,-83],[7,60],[-9,12],[-27,-63],[-25,-8],[-23,-38],[-10,4],[-26,-51],[-31,-76],[3,-95],[19,-11],[-4,-69],[-24,-78],[-11,-16],[-6,-77],[-27,-67],[14,-82],[11,-5],[10,-90],[19,-77],[9,-101],[30,-73],[-20,-44],[-8,-47],[5,-55],[15,-101],[13,-40],[9,-60],[-8,-46],[9,-33],[40,-87],[65,-70],[25,-14],[19,46],[6,38],[-39,87],[9,36],[27,-56],[16,104],[18,47],[30,18],[21,-36],[44,22],[21,-28],[18,-44],[25,-80],[7,-49],[14,-38],[4,-70],[-8,-11],[-5,-70],[21,-35],[29,1],[27,52],[-10,92],[-17,42],[23,59],[22,-26],[10,-79],[17,2],[42,-32],[27,6],[13,-35],[40,-36],[1,-50],[-17,9],[-18,-34],[-62,31],[-13,-77],[25,-95],[15,-10],[18,-108],[20,-28],[-17,-80],[12,-93],[23,69],[32,-36],[29,-56],[9,43],[18,-24],[-16,-51],[-5,-50],[10,-63],[-6,-108],[-15,-90],[-25,6],[-17,60],[-15,20],[-11,121],[11,33],[39,4],[2,69],[-39,-18],[-15,-49],[-22,-22],[-16,35],[-11,-13],[-35,48],[-34,72],[-23,-28],[-9,101],[11,36],[-25,65],[-10,93],[-12,26],[-32,39],[-19,10],[-24,38],[-18,52],[10,32],[-6,28],[-27,55],[-17,14],[-31,74],[-26,2],[-6,-21],[13,-45],[5,-78],[-11,-26],[6,-38],[19,-47],[16,-67],[14,-86],[7,-101],[-29,-44],[-24,56],[3,68],[-9,49],[-20,52],[-4,31],[-55,84],[-32,103],[-8,-4],[-49,83],[-25,14],[-8,34],[-74,-75],[-19,-65],[10,-58],[-22,-9],[-28,-52],[-36,32],[-22,-15],[-11,16],[6,59],[-23,40],[-14,-16],[-4,81],[-10,22],[-38,24],[-12,-33],[4,-36],[-24,-4],[-2,129],[2,68],[-10,16],[1,63],[9,33],[22,14],[46,104],[30,38],[1,66],[-10,60],[-30,66],[-51,12],[-18,33],[-12,-63],[11,-65],[7,-89],[-9,-56],[-11,-8],[-41,27],[1,86],[-7,34],[-15,0],[-19,48],[7,75],[-17,11],[-14,-53],[-28,101],[0,135],[-12,140],[-13,58],[-18,41],[12,55],[-1,69],[-8,36],[7,42],[-15,94],[8,16],[-16,90],[-24,-29],[-6,33],[8,114],[-7,31],[10,117],[31,42],[8,-41],[23,-23],[-9,-38],[9,-51],[21,-28],[2,-51],[18,-23],[35,10],[20,30],[19,58],[-8,57],[-16,39],[-3,116],[-9,98],[10,49],[-1,101],[12,31],[20,85],[2,40],[-7,103],[-6,27],[16,139],[-7,52],[-24,49],[0,63],[23,69],[-7,35],[11,40],[-1,43],[10,86],[-1,46],[11,74],[20,89],[2,74],[-9,58],[20,40],[28,-13],[14,27],[3,47],[18,-8],[13,-41],[17,11]],[[84428,49503],[18,34],[4,-51],[-22,17]],[[84216,48612],[11,96],[17,23],[-2,54],[-14,12],[18,113],[-10,28],[-4,95],[25,-16],[12,-41],[20,9],[60,-128],[10,-6],[19,-81],[12,19],[21,-18],[36,-145],[5,-65],[11,-56],[-16,-46],[-25,60],[-24,31],[-32,15],[2,39],[-31,78],[-21,85],[-30,-7],[-36,-126],[-39,-88],[5,66]],[[84250,46790],[-1,31],[13,209],[14,59],[5,128],[29,72],[18,80],[2,60],[21,47],[13,61],[0,49],[24,111],[18,62],[18,139],[-8,19],[16,45],[-4,69],[15,60],[18,8],[-8,-97],[-12,-47],[13,-26],[-2,-83],[6,-29],[-5,-70],[-8,-21],[8,-155],[-9,-104],[4,-64],[-21,8],[-21,-53],[-28,-19],[-23,-76],[-11,-22],[-8,-68],[-1,-84],[-21,-54],[-6,-73],[-21,-126],[-24,-71],[-13,25]],[[84405,49509],[-5,74],[22,-15],[-17,-59]],[[84364,48024],[-7,34],[12,55],[10,-64],[-15,-25]],[[84346,48995],[-18,79],[20,6],[19,-25],[19,-148],[-1,-50],[-29,89],[-10,49]],[[84329,46531],[-8,5],[-29,63],[5,24],[23,0],[26,38],[11,-39],[-9,-26],[11,-40],[-30,-25]],[[84058,46764],[-16,38],[-48,168],[6,69],[-7,24],[18,55],[3,42],[15,10],[32,-8],[22,14],[14,36],[30,34],[-5,85],[6,119],[-19,104],[34,62],[12,87],[-4,93],[14,39],[21,-1],[17,43],[18,22],[34,-37],[15,7],[26,-31],[28,-89],[-17,-62],[-10,-112],[-13,-51],[-16,-20],[-10,-53],[-2,-87],[-27,-182],[-22,-80],[4,-132],[-10,-112],[16,-51],[12,-11],[24,-117],[-8,-67],[-20,-64],[-24,-53],[-15,15],[-15,-20],[-22,27],[-19,124],[1,47],[-17,31],[-40,21],[-16,24]],[[84262,49149],[-9,4],[-14,57],[-18,7],[-8,31],[-26,52],[-2,26],[-23,9],[-10,24],[-2,59],[15,27],[11,-14],[24,-82],[16,-81],[27,-17],[3,-50],[16,-52]],[[83845,48443],[12,61],[-1,35],[17,15],[20,-16],[17,-40],[23,-9],[27,-29],[20,-36],[14,1],[19,-113],[13,12],[22,-23],[36,10],[5,22],[28,1],[37,-95],[41,50],[15,-56],[-18,-173],[7,-46],[-25,2],[-6,-52],[-25,-22],[-39,-58],[-4,-30],[6,-61],[-14,-50],[-18,7],[-16,-15],[-8,-62],[-29,0],[-57,-22],[-47,-54],[-12,-58],[-28,-63],[-13,23],[1,39],[14,61],[3,62],[-15,67],[16,118],[20,74],[-5,120],[6,101],[-2,48],[10,70],[-2,27],[6,114],[-51,47],[-20,-4]],[[84138,45263],[-20,-26],[-11,50],[5,49],[28,5],[7,-38],[-9,-40]],[[84082,47579],[-15,-76],[-27,-29],[-20,58],[11,12],[-1,54],[41,122],[15,-27],[4,-72],[-8,-42]],[[84021,48962],[18,12],[24,-7],[19,-65],[-8,-65],[-10,-23],[-19,23],[-11,43],[-20,18],[-7,44],[14,20]],[[83958,49009],[7,51],[14,-58],[-21,7]],[[83898,44844],[29,-25],[1,-28],[45,-17],[2,-36],[-28,-7],[-5,-86],[-44,-37],[-22,2],[-14,34],[-10,84],[-17,8],[-3,31],[23,13],[37,66],[6,-2]],[[83868,48821],[4,72],[18,40],[-4,89],[14,37],[23,8],[4,-37],[-8,-59],[-4,-101],[-26,-166],[-10,22],[14,58],[-25,37]],[[83841,49574],[-5,77],[12,53],[44,20],[36,-127],[-27,-67],[-5,-56],[-45,61],[-10,39]],[[83887,54698],[-14,-99],[-9,17],[23,82]],[[83838,50765],[26,33],[22,0],[8,-90],[-14,-44],[12,-33],[6,-70],[-17,-53],[-17,1],[6,62],[-23,140],[-14,8],[5,46]],[[83876,53974],[-17,54],[20,17],[6,-52],[-9,-19]],[[83849,53499],[-9,35],[19,100],[14,1],[12,-44],[-27,-52],[-9,-40]],[[83844,54943],[11,-5],[-8,-69],[-19,-4],[16,78]],[[83505,49476],[-32,45],[-19,116],[-25,-32],[-13,45],[12,42],[22,16],[14,-15],[56,-9],[19,-20],[59,23],[28,-66],[38,14],[32,-63],[20,-63],[18,-32],[-1,-42],[26,-4],[6,-31],[-20,-64],[4,-50],[-6,-121],[16,-47],[6,-71],[-14,-38],[-19,-23],[-8,-53],[3,-39],[-24,-69],[-16,-7],[-4,-32],[-41,5],[-10,62],[-28,68],[-16,79],[5,31],[-11,55],[-17,50],[-13,3],[-6,180],[-30,143],[-11,14]],[[83752,53809],[-28,27],[-12,56],[7,21],[30,-14],[11,-74],[-8,-16]],[[83687,53530],[39,36],[10,-36],[-38,-12],[-11,12]],[[83604,44342],[10,30],[39,-5],[18,-59],[17,17],[40,-43],[-34,-59],[-18,14],[-12,44],[-25,-42],[-20,22],[-30,-28],[-14,45],[13,52],[16,12]],[[83643,48723],[-22,51],[9,53],[13,-104]],[[83560,43974],[15,36],[9,-30],[-8,-32],[-16,26]],[[83368,48622],[-22,9],[-16,-11],[-6,46],[-30,130],[31,12],[19,-26],[5,-29],[34,-57],[10,21],[18,-12],[16,-48],[0,-34],[-59,-1]],[[83403,49830],[-43,63],[-3,57],[38,-31],[14,-60],[-6,-29]],[[83405,48475],[-18,91],[21,-7],[-3,-84]],[[83394,43682],[-22,44],[-17,-14],[-13,14],[-25,-67],[-30,-31],[-2,50],[36,75],[18,10],[31,59],[20,19],[9,-119],[-5,-40]],[[83319,48373],[-2,53],[-9,38],[-1,44],[-10,55],[18,15],[5,-38],[17,21],[11,-105],[-9,-56],[-20,-27]],[[83269,47525],[11,78],[11,33],[15,-31],[22,5],[1,-35],[-23,-25],[-25,-53],[-12,28]],[[82698,46235],[-25,-18],[-16,13],[-17,-25],[8,-49],[-11,-49],[-37,5],[-9,-40],[-32,-18],[0,50],[10,51],[32,126],[17,33],[32,101],[22,53],[12,48],[20,-8],[11,71],[23,33],[13,38],[13,-21],[19,9],[7,35],[16,14],[7,61],[14,6],[5,46],[37,83],[1,34],[19,20],[8,39],[16,19],[32,92],[18,100],[15,19],[25,-10],[-2,121],[34,7],[6,55],[13,31],[1,59],[29,21],[19,-16],[5,30],[18,23],[17,75],[7,104],[-21,31],[-1,65],[34,-53],[17,-67],[7,19],[-10,51],[3,36],[-21,10],[-17,72],[17,55],[13,-10],[3,63],[-11,48],[7,20],[5,98],[12,24],[24,-57],[-7,-87],[-11,-34],[13,-39],[-17,-72],[-1,-68],[28,-81],[31,-192],[-26,-55],[-8,-36],[-44,0],[-33,-65],[-12,-48],[-16,-121],[-70,-49],[-17,2],[-37,-37],[0,-58],[8,-39],[-26,-26],[8,-60],[13,-4],[-21,-72],[-15,-31],[-30,-132],[-25,-47],[-23,-69],[-11,3],[-45,-29],[-38,-177],[-26,-36],[-37,-94],[-18,-23]],[[82574,45924],[0,47],[23,-17],[-1,-58],[-14,-20],[-8,48]],[[82504,45605],[-18,86],[7,69],[11,32],[16,1],[3,-113],[-7,-48],[-12,-27]],[[68829,66664],[17,96],[-9,92],[12,77],[29,94],[23,58],[33,131],[33,-7],[7,73],[16,31],[11,79],[-9,43],[-20,10],[-3,48],[-16,0],[-27,65],[-4,47],[-17,59],[9,60],[-10,47],[19,19],[-9,55],[22,13],[6,77],[-17,17],[-15,46],[-14,-13],[-30,13],[-14,-18],[-48,3],[-6,101],[-26,31],[-23,-3],[-38,53],[-5,35],[36,10],[4,40],[-7,61],[-17,34],[15,46],[49,20],[21,41],[23,-2],[29,-33],[62,-36],[53,-5],[17,-16],[43,1],[8,48],[18,30],[6,147],[72,10],[10,47],[-23,104],[18,-7],[22,23],[-17,42],[-46,-36],[-38,-18],[-28,48],[69,43],[71,18],[66,-19],[15,68],[-18,146],[-1,54],[24,7],[0,136],[57,-4],[12,-52],[21,-45],[24,7],[11,42],[40,11],[36,27],[16,48],[21,0],[24,38],[23,16],[1,75],[19,30],[30,-46],[46,-134],[21,-42],[-43,-79],[-15,-43],[-20,-11],[-10,-36],[-39,-26],[8,-51],[30,-24],[21,5],[7,-88],[16,-47],[36,8],[29,24],[33,3]],[[68481,66787],[-12,33],[25,57],[-13,32],[-3,60],[8,71],[-3,53],[19,72],[20,33],[-2,42],[-47,48],[-30,-8],[-35,55],[-7,35],[-20,-2],[-72,89],[-23,-16],[-74,24],[-110,153],[-37,75],[-39,46],[-23,10],[-27,47],[-50,64],[-57,112],[-37,-23],[-25,26],[-112,161],[-3,34],[-76,104],[-118,173],[-146,215],[-10,30],[-14,188],[0,49],[-14,37],[2,34],[-19,37],[-16,3],[-22,40],[-11,87],[-17,37],[0,37],[-14,51],[0,104],[-27,89],[-22,23],[-47,81],[-50,33],[-36,-106],[-24,-3],[-67,70],[-88,10],[-29,-24],[-31,0],[-22,42],[-41,36],[-42,60],[-2,67],[26,52],[-6,49],[-31,74],[39,58],[-24,56],[-35,22],[15,29],[7,82],[-10,89],[-42,67],[-19,-29],[-21,20],[-43,-15],[-32,6],[-9,26],[-31,25],[-10,49],[-27,73],[-44,-3],[-40,61],[-55,107],[-18,-26],[-4,-55],[-30,-3],[-44,29],[-19,-1],[-30,-39],[22,-39],[20,-11],[30,-128],[31,-41],[-34,-21],[-6,79],[-20,37],[-72,36],[-19,-15],[-4,-92],[-27,-133],[-35,-3],[-25,-19],[-61,11],[-41,-19],[-44,-145],[-37,-17],[-7,-52],[3,-112],[19,-80],[-1,-90],[18,-56],[-13,-29],[-1,-50],[-80,24],[-213,26]],[[75606,55182],[4,-25],[2,-5],[1,-2],[3,3],[11,-41],[-3,-27],[6,-78],[-11,-7],[-13,78],[-38,123],[-4,106],[-20,72],[11,56],[1,77],[-10,33],[-6,36],[-1,19],[-5,-6],[-4,19],[-5,8],[6,52],[-3,70],[-7,29],[-5,109],[-8,1],[-18,108],[-2,62],[-19,101],[-42,137],[-20,33],[-6,36],[10,62],[7,9],[23,55]],[[75437,56477],[-27,-58],[-8,-40],[-23,-55],[-20,-6],[-10,-34],[0,-87],[-21,-33],[0,-35],[-27,-3],[-7,39],[-47,92],[-12,9],[-19,82],[1,34],[-19,37],[-19,77],[-2,171],[7,37],[-19,81],[-2,55],[13,24],[20,-2],[-5,41],[3,16],[11,14],[6,20],[-1,57],[-17,9],[-7,-39],[22,-13],[-6,-19],[2,-16],[-10,-12],[-5,-17],[-7,-22],[-24,-13],[1,-72],[-24,-9],[-28,41],[-37,13],[-35,65],[-25,32],[-5,89],[-45,-9],[5,-81],[44,-25],[41,-57],[15,-43],[-9,-11],[-18,9],[-9,8],[-3,8],[-2,-1],[-4,-28],[12,-25],[1,-81],[3,-8],[0,-6],[5,1],[10,0],[9,-16],[-3,-29],[8,-9],[4,-32],[9,0],[2,-10],[4,-4],[6,1],[2,-4],[-8,-19],[6,-26],[-6,-35],[14,-32],[-2,-51],[-5,7],[-2,0],[-3,-3],[-7,-12],[-3,-9],[-2,-11],[-5,-19],[-8,16],[-11,3],[-24,-56],[-9,-54],[3,-24],[-16,-37],[0,-67],[-29,-73],[-21,63],[-33,47],[-10,-4],[3,12],[-3,3],[-5,-17],[-6,7],[-1,0],[-2,-17],[1,-13],[-5,-3],[-5,-27],[-8,63],[-12,38],[3,57],[-4,35],[-5,19],[-8,2],[-6,-46],[-20,-71],[10,-45],[0,-63],[-14,-2],[-15,-115],[7,-56],[-27,23],[-33,-46],[-21,27],[-6,56],[-11,21],[1,81]],[[75616,55154],[-4,-2],[-1,3]],[[75525,55530],[-3,30],[8,26],[9,12],[1,-21],[4,-31],[7,-23],[-4,-93],[-21,11],[-1,89]],[[75398,56196],[16,-5],[12,-45],[7,-64],[-23,-11],[-16,81],[4,44]],[[75295,55942],[2,132],[17,-15],[15,-62],[-6,-90],[-29,-65],[-11,16],[12,84]],[[75155,56337],[11,27],[15,-17],[18,-111],[10,-21],[5,-60],[25,-64],[-6,-43],[0,-74],[-9,-100],[-32,-83],[-13,-10],[-14,34],[8,104],[15,65],[-4,193],[-12,14],[-7,107],[-10,39]],[[75182,56389],[-32,-35],[-16,6],[14,62],[34,-33]],[[75122,56132],[19,69],[23,-36],[0,-80],[10,-26],[-10,-86],[-44,-132],[-12,7],[4,59],[-2,45],[6,33],[-5,8],[-8,6],[12,29],[-7,38],[1,18],[8,6],[9,-3],[-4,45]],[[75166,56668],[3,-28],[-30,-76],[-3,-37],[-23,-22],[-20,17],[-5,42],[4,10],[0,5],[-9,1],[-6,14],[-8,0],[-8,63],[-2,10],[-9,12],[-9,1],[-4,-3],[-1,8],[-1,3],[-2,9],[3,34],[-4,46],[-12,20],[6,28],[4,-9],[7,-6],[15,-13],[6,2],[8,12],[34,-38],[12,-31],[44,-44],[10,-30]],[[75153,55880],[10,-53],[-17,-48],[-9,12],[-1,58],[17,31]],[[75135,56477],[7,48],[21,-67],[-15,-6],[-13,25]],[[75149,56782],[15,-40],[-20,-12],[-35,49],[40,3]],[[75110,56471],[21,15],[16,-41],[-16,-40],[0,-37],[-13,-18],[-3,-29],[-3,9],[-3,18],[-2,5],[-10,8],[1,77],[12,33]],[[75124,56158],[-9,-13],[-11,1],[1,-12],[-4,8],[-4,3],[4,9],[0,5],[-5,2],[2,14],[-3,13],[5,7],[1,16],[10,-13],[3,1],[3,11],[5,6],[2,5],[-1,3],[-5,0],[6,14],[-1,9],[6,2],[12,-28],[-18,-29],[1,-34]],[[75058,55944],[5,-22],[-8,-49],[-10,5],[-22,-50],[-8,-59],[-15,15],[16,148],[15,52],[-4,48],[22,61],[-1,19],[10,36],[-1,9],[-6,-3],[0,15],[4,34],[1,37],[12,-3],[10,5],[3,18],[15,-11],[12,44],[12,11],[8,20],[8,-43],[-6,-31],[-7,-1],[-1,-2],[2,-10],[-5,-8],[-2,-4],[2,-3],[4,-2],[-7,-11],[-3,-9],[-2,0],[-2,10],[-7,1],[-6,14],[-3,-12],[6,-5],[-6,-30],[5,-5],[-3,-9],[1,-4],[4,-3],[-3,-9],[-1,-2],[2,-7],[-12,-15],[-31,-99],[3,-81]],[[75114,55759],[1,46],[16,4],[1,-72],[-18,22]],[[75114,56129],[3,-38],[-6,-2],[-3,-7],[-9,-37],[-3,3],[-5,-1],[-8,2],[-4,7],[-6,-4],[12,67],[29,10]],[[75092,56258],[-11,5],[-4,-20],[-11,-5],[-17,10],[-1,1],[-1,0],[-1,2],[-4,2],[-7,12],[-17,4],[11,64],[18,39],[15,4],[7,-14],[6,22],[2,12],[9,4],[0,14],[3,4],[3,-7],[4,-5],[0,-43],[2,-7],[10,-9],[3,-18],[9,-18],[-13,-19],[-15,-34]],[[75062,55952],[-5,54],[2,20],[12,2],[7,23],[5,-3],[8,-2],[5,1],[1,-6],[-1,-8],[15,5],[-8,-37],[0,-9],[9,-2],[3,-6],[-4,-14],[-2,-22],[1,-58],[-7,-50],[-17,-64],[-15,-23],[-28,21],[-14,-47],[-15,-21],[-6,43],[12,16],[5,52],[18,50],[11,-6],[7,19],[5,48],[-4,24]],[[75048,55722],[10,29],[24,-11],[-21,-93],[-18,-5],[-20,29],[25,51]],[[75020,56032],[8,-27],[-10,-64],[-12,-7],[0,-90],[-24,-63],[-10,58],[3,39],[-11,113],[14,78],[29,78],[1,66],[26,51],[10,-13],[4,-3],[1,-3],[0,-3],[-1,-11],[4,-43],[-3,-25],[1,-12],[7,4],[0,-6],[-4,-8],[-7,-35],[1,-12],[-27,-62]],[[75002,56964],[-5,-26],[-31,4],[-1,62],[27,-5],[10,-35]],[[74911,56150],[9,32],[34,-49],[11,-34],[3,-55],[-24,-61],[-11,29],[3,34],[-18,34],[-17,-12],[-15,50],[3,6],[4,25],[5,3],[0,18],[5,7],[4,0],[3,5],[1,-5],[0,-27]],[[74861,56134],[-6,38],[22,15],[6,-81],[-22,28]],[[74841,56251],[16,86],[9,-19],[3,-56],[-28,-11]],[[74835,56194],[24,52],[6,-42],[-30,-10]],[[76901,31257],[-5,11],[2,2],[3,-13]],[[72727,45352],[13,-87],[-2,-165],[5,-53],[-9,-82],[-5,-105],[-15,-68],[-4,-45],[-18,-86],[-21,-50],[-33,-53],[-5,-22],[-46,-80],[-33,-25],[-19,-30],[-37,-17],[-37,-40],[-16,-6],[-24,-54],[-40,-16],[-34,4],[-35,36],[-25,14],[-31,64],[-25,119],[1,23],[-16,151],[-32,223],[-7,82],[8,25],[-4,82],[6,18],[-11,75],[2,36],[-15,194],[3,103],[-4,64],[-22,206],[-4,109],[16,-20],[-6,-32],[6,-105],[24,11],[-9,43],[8,62],[-4,82],[8,37],[-1,71],[7,81],[11,13],[11,61],[3,66],[-11,63],[5,43],[-16,70],[-31,64],[24,12],[19,-93],[38,58],[17,130],[-1,70],[-16,29],[-2,31],[31,40],[6,29],[22,19],[0,-38],[19,-3],[16,20],[-7,39],[-35,62],[-19,22],[-20,-28],[-26,32],[-24,59],[14,44],[39,4],[38,13],[33,-119],[81,-167],[38,-86],[14,-58],[16,-130],[4,-78],[12,28],[14,-31],[60,-202],[-16,-102],[23,-40],[8,37],[21,-8],[17,-199],[16,-129],[24,-73],[9,-76],[31,-62],[21,-89],[11,-121]],[[70308,39539],[-3,17],[-3,9],[2,3],[1,-13],[3,-16]],[[63497,70013],[16,-26],[79,-200],[38,-110],[14,-59],[8,-89],[17,-102],[55,-124],[34,-32],[-5,-72],[10,-50],[32,-17],[9,-23],[31,-11],[71,20],[15,-49],[30,-16],[32,-72],[6,-60],[-63,35],[-37,-23],[-28,27],[-18,-46],[-37,-20],[-17,-33],[-47,-48],[-15,-62],[17,-57],[-19,-37],[8,-63],[-16,-51],[11,-66],[-28,-46],[-13,-80],[1,-33],[34,-72],[-3,-56],[-30,40],[-9,-10],[-7,-139],[-26,-14],[-13,19],[-20,90],[-14,-35],[-2,-44],[-21,-131],[-18,-55],[4,-65],[10,-58],[5,-213]],[[63578,67575],[-25,7],[-37,-43],[-19,43],[-37,113],[-30,-10],[-28,52],[2,31],[-38,43],[-28,48],[3,44],[16,34],[51,14],[19,49],[-10,54],[-20,17],[-23,46],[2,69],[59,63],[-8,25],[-85,197],[-29,-18],[-33,-5],[-16,-38],[-69,-78],[-30,-20],[-22,-71],[-51,-54],[-21,-41],[-1,-32],[-26,-38],[-26,11],[-74,-178],[-19,-29]],[[62925,67880],[-7,59],[12,80],[-15,64],[23,35],[-12,75],[-36,46],[-4,61],[18,-4],[31,87],[-37,0],[-18,49],[-48,-25],[-54,109],[-49,51],[-11,86],[-49,21],[3,33],[73,0],[6,58],[15,17],[4,74],[-12,48],[-40,23],[-64,72],[-29,52],[-4,45],[-20,64],[20,67],[31,22],[15,76],[-33,29],[-17,71],[-29,-15],[-25,14],[-19,32],[12,68],[-42,58],[-10,40]],[[62504,69622],[43,83],[39,44],[22,-33],[19,21],[78,-81],[-11,-33],[30,-54],[41,-35],[50,22],[43,-21],[28,-54],[74,23],[0,51],[12,69],[-25,68],[-29,13],[-48,62],[-10,53],[-25,35],[-8,65],[15,33],[45,60],[8,50]],[[62817,67863],[-18,20],[-44,1],[-72,57],[-12,-7],[-50,45],[5,33],[-41,102],[-44,10],[-1,40],[-17,63],[-33,49],[-21,119],[-23,30]],[[62446,68425],[-11,62]],[[62435,68487],[30,16],[18,-8],[33,48],[17,-22],[17,-56],[-4,-66],[33,17],[8,-44],[32,-15],[10,-21],[63,72],[29,-23],[11,-73],[-14,-63],[59,-65],[-2,-61],[22,-91],[22,-136],[-2,-33]],[[79353,32539],[9,-32],[-9,-29],[-11,31],[11,30]],[[67115,58063],[-15,27],[-24,-81],[-19,-27],[-61,41],[-3,26],[-23,23],[-66,36],[-64,43],[-6,80],[-20,23],[-26,-16],[-8,-60],[-20,-5],[-20,42],[-42,-31],[-8,24],[-53,-11],[-28,29],[-52,-11],[-45,59],[-38,-14],[-13,31],[-28,-1],[-14,-65],[-32,17],[-28,71],[-27,34],[-26,-4],[-41,34],[-27,-22],[-27,24],[-34,-26],[-24,4],[-13,-19],[-13,29],[0,40],[-17,1],[-12,28],[-21,-3],[-31,-41],[5,49],[-11,27],[-24,9],[-31,-6],[-8,22],[-28,-8],[-19,10],[-15,39],[-5,65],[-26,119],[12,38],[-8,54],[-17,22],[-1,59],[-18,69],[4,92],[-3,62],[-16,129],[-20,99],[9,53],[-28,3],[-14,87],[-25,-7],[-32,24],[-31,-9],[-29,13],[-34,-8],[-18,-25],[-27,2],[-8,-26],[-61,-71],[-24,-5],[-11,-23],[-16,17],[-50,-76],[-1,-49],[-18,-43],[-29,18],[-28,-8],[-5,-29],[-33,-29],[-11,-37],[-24,-17],[-34,-72],[-14,-16],[-21,13],[-27,-11],[-19,66],[-42,3],[-19,68],[-15,26],[-24,-13],[-30,10],[-18,24],[-27,-26],[-26,-8],[-38,19],[-29,33],[-30,58],[-1,72],[-57,52],[-88,74],[-38,51],[-10,30],[-25,30],[-32,72],[26,15],[-16,35],[-31,98],[-19,33],[-23,4],[-43,38],[-42,96],[-74,2],[-20,-13],[-29,18],[-27,38],[-16,39],[-17,12],[-14,73],[-15,40],[-1,77],[-29,81],[-24,118],[-4,115],[-12,72],[-6,71],[-15,17],[-20,-54],[-21,70],[6,53],[18,-48],[14,13],[-2,79],[-32,74],[-40,6],[-4,26],[13,65],[-13,28],[0,44],[-13,79],[-24,38],[-57,128],[-17,63],[-29,73],[0,80],[-19,102],[-13,19],[-37,-6],[-96,-142],[-17,44],[0,50],[-11,18],[-28,3],[-19,-14],[-19,58],[7,33],[-11,51],[14,44],[-15,67],[-61,8],[6,-75],[-22,9],[-19,-51],[-17,-6],[-7,-21],[-15,6],[3,-35],[1,-11],[3,-13],[-1,-18],[4,-12],[-11,4],[-19,18],[15,-44],[10,-48],[-8,-49],[-9,19],[-8,5],[-4,21],[-14,16],[-6,26],[6,15],[1,11],[-3,17],[-6,5],[-6,-4],[-10,-16],[-3,0],[-4,5],[-6,20],[0,34],[-18,21],[-17,29],[-7,19],[-11,12],[-3,7],[-2,12],[-4,14],[2,10],[15,22],[-6,7],[-17,-28],[-13,-8],[-15,18]],[[63363,61846],[-23,21],[2,369],[-97,1],[0,284],[50,279],[-16,42],[1,28],[-22,42],[-6,58],[-50,107],[10,17],[-29,92],[1,50],[-24,59],[-26,16],[-32,-28],[-59,101],[-19,25],[-47,110],[-27,26],[-29,55],[-57,50],[-39,-11],[-22,23],[16,55],[-18,21],[31,65],[-2,59],[-15,19],[-36,156],[-13,39],[-28,50],[-38,20],[-22,53],[1,21],[-40,134],[-18,-2],[13,92],[27,50],[-7,38],[7,75],[-24,24],[-15,87],[21,12],[-1,55],[25,-2],[38,26],[-11,79],[-13,21],[14,47],[45,76],[9,46],[-6,51],[19,43],[30,-31],[18,19],[19,79],[-11,92],[-22,40],[-23,91],[8,123],[16,18],[25,-2],[20,18],[32,52],[-13,30],[-25,-24],[-37,45],[-36,-23],[-15,8],[-37,-22],[-27,86],[-30,52],[-58,-13],[9,74],[-17,73],[-5,64],[-11,19],[4,54],[-12,40],[-33,-20],[-9,15],[-15,127],[11,61],[-15,47],[-49,45],[19,33],[-6,66],[3,54],[-21,7],[-9,76]],[[62440,66645],[-8,60],[12,58],[-59,93],[7,116],[-13,28],[16,48],[-19,53],[-29,-10],[-37,79],[-27,8],[6,55],[25,89],[17,41],[2,75],[30,67],[-16,29],[-20,-19],[-17,11],[-3,112],[5,34],[-17,101],[14,65],[-27,55],[-13,77],[11,20],[4,54],[-13,52],[-18,14],[-9,98],[-13,38],[10,25],[34,-7],[28,-21],[36,27],[-2,104],[18,39],[-4,53],[40,68],[16,-47],[12,1],[27,-63]],[[62817,67863],[12,0],[27,41],[22,11],[47,-35]],[[63578,67575],[-3,-53],[10,-207],[8,-82],[-1,-46],[27,-147],[32,-67],[55,-67],[31,-20],[80,-22],[31,-3],[18,20],[13,-28],[64,-39],[29,-163],[47,-91],[51,-61],[8,-22],[86,-106],[40,-29],[81,-27],[68,-63],[60,-18],[59,16],[94,61],[109,44],[111,70],[38,17],[123,28],[-35,-29],[-20,6],[-22,-25],[-22,5],[-15,-30],[55,-13],[21,9],[60,-12],[39,20],[4,37],[-1,107],[-14,154],[-3,87]],[[64994,66786],[73,-16],[12,23],[31,7],[54,71],[20,-18],[37,63],[6,63],[-10,16],[25,97],[23,22],[49,108],[103,95],[86,31],[18,-23],[43,-12],[39,12],[9,-15],[36,6],[-6,66],[39,66],[86,5],[22,-30],[41,-11],[21,-24],[25,64],[24,1],[16,-53],[0,-34],[19,-38],[-5,-80],[44,-47],[20,13],[45,-16],[24,-38],[18,6],[37,-47],[49,-23],[2,-64],[41,-20],[8,-22],[27,8],[20,47],[19,-31],[32,-20],[43,18],[44,-27],[46,-73],[37,8],[11,-36],[-4,-51],[15,-71],[34,-94],[1,-33],[27,8],[32,-12],[44,-60],[32,-15],[34,-123],[28,-66],[22,-92],[94,-5],[128,16],[11,-56],[-8,-58],[-2,-106],[22,-124],[-18,-93],[-6,-62],[20,-15],[12,-58],[-8,-141],[13,-32]],[[65577,59349],[36,18],[16,-48],[-28,-18],[-7,-44],[-18,-44],[-37,-65],[-22,35],[-26,-39],[-20,2],[-23,-35],[-83,-62],[-11,57],[81,59],[30,40],[34,10],[2,43],[-21,60],[17,11],[19,-32],[21,11],[17,29],[23,12]],[[64999,59061],[14,-36],[-19,-17],[-23,35],[28,18]],[[63663,61753],[17,-38],[-28,-23],[-39,42],[19,37],[31,-18]],[[63557,61744],[14,0],[20,-57],[2,-116],[-18,-22],[-35,93],[6,17],[-5,10],[0,20],[-3,10],[-1,35],[13,1],[7,9]],[[63533,61620],[36,-56],[-3,-26],[-26,-1],[-1,52],[-6,31]],[[63400,61813],[2,-12],[3,-9],[34,-58],[19,-22],[1,-41],[4,-14],[7,-6],[2,1],[5,6],[5,9],[6,3],[5,-4],[3,-14],[-2,-18],[-4,-8],[0,-9],[6,-23],[11,-11],[5,-19],[8,-10],[-2,-74],[-39,13],[-17,23],[-5,51],[-16,35],[-1,15],[9,44],[-39,99],[-9,6],[-14,-8],[-5,57],[4,17],[12,-8],[2,-11]],[[58035,89525],[-34,42],[7,81],[108,125],[32,58],[-56,155],[-203,88],[-16,45],[-51,29],[-49,67],[-7,54]],[[57766,90269],[57,13],[15,42],[-11,32],[1,117],[52,79],[27,80],[13,93],[64,89],[94,17],[52,-30],[22,-52],[-2,-56],[104,39],[24,-37],[81,17],[67,-68],[5,-45],[72,-8],[36,-51],[52,-13],[28,-38],[-14,-80],[-132,-35],[-39,-27],[-2,-40],[-76,-46],[-57,-14],[-210,51],[-66,-40],[212,-72],[-30,-40],[62,-26],[-22,-78],[59,-23],[15,17],[69,6],[-19,57],[47,19],[35,-46],[110,-19]],[[58333,90113],[25,-41],[-66,-40],[-13,52],[9,58],[45,-29]],[[57691,90984],[35,-36],[101,41],[23,-27],[-24,-42],[96,-5],[1,-44],[-48,-74],[-37,-27],[-120,5],[-68,17],[-4,34],[-115,36],[10,38],[101,27],[-5,50],[54,7]],[[57697,90256],[-79,-38],[-34,-43],[-76,-34],[-12,17],[-87,21],[-58,-17],[-29,-69],[-71,-82],[-58,-51],[22,-34],[-28,-59],[-37,-151],[-13,-82],[23,-133],[-42,-90],[-40,8],[-90,-75],[-23,-127],[-44,-13],[-86,55],[-85,26],[-89,79],[-57,-6],[-29,-82],[-64,-9],[-76,-46],[-34,44],[-68,-1],[-74,40],[-44,-20],[-10,80],[-46,92],[-152,230],[-97,25],[-51,-36],[-30,-50],[34,-63],[-14,-48],[-95,59],[-47,-42]],[[55707,89531],[-135,-11],[68,-85],[8,-89],[-37,-98],[-73,-77],[80,-49],[-85,-96],[-260,115],[-101,-7],[-60,54],[-78,-33],[-6,-93],[13,-149],[-69,-164],[-66,49],[-106,58],[-28,-49],[-123,-98],[-51,-192],[-41,-81],[-69,-10],[-19,-60],[87,-166],[-4,-114],[-97,-95],[-116,-229],[-68,-78],[30,-145],[-125,-93],[-144,-15],[30,-230],[-23,-79],[-12,-129],[2,-152],[-35,-44],[-15,-93],[-55,-100],[-117,-243],[-15,-43],[66,-52],[62,-32],[12,-192],[-53,-134],[-70,27],[-140,36],[-79,-27],[-67,-60],[-98,-186],[-51,-87],[18,-83],[-66,-150],[67,-193],[-39,-70],[17,-111],[-23,-97],[68,-247],[-45,-390],[78,-115],[42,4],[84,-152],[-23,-115],[-23,-38],[-7,-59],[-65,-8],[-62,-27],[30,-88],[18,-112],[32,-66],[26,-93],[0,-76],[-30,-59],[12,-94],[-26,-110],[-29,-53],[-47,-54],[-52,8],[-41,-43],[24,-34],[4,-71],[-23,-33],[-38,-17],[-8,-26],[35,-175],[3,-73],[-12,-26],[-3,-86],[-18,-38],[-21,-90],[-48,-13],[0,71]],[[53183,82309],[-24,92],[-14,0],[-27,-21],[-19,41],[-33,3],[-29,45],[-35,-12],[-22,29],[5,41],[-24,27],[-8,97],[14,40],[-28,168],[17,62],[-46,-15],[15,-101],[18,-9],[6,-71],[-42,-38],[-24,10],[-13,-43],[32,-13],[20,-114],[-40,-43],[-27,-68],[9,-39],[-22,-31],[-33,-10],[-39,-44],[-41,3],[-22,31],[-34,-40],[-67,-131],[-40,-41],[-11,-37],[-47,-38],[-37,-108],[-52,-42],[-49,-95],[-66,-40],[-25,-70],[-59,18],[-5,-40],[-54,-7],[-31,-47],[-72,-4],[-38,25],[-71,-5],[-33,32],[-60,-7],[-34,29],[44,79],[-97,41],[-13,24],[-45,22],[-78,60],[-3,32],[-52,51],[-39,93],[-11,69],[21,94],[-4,86],[44,-30],[77,-12],[-31,89],[26,28],[58,97],[-15,41],[-54,34],[-126,-65],[-40,36],[-31,85],[4,80],[25,57],[37,-12],[-2,65],[92,-44],[-3,29],[24,62],[-29,45],[4,66],[21,3],[35,46],[16,53],[46,34],[-31,52],[28,28],[44,88],[40,25],[8,52],[-73,-58],[-31,-95],[-38,19],[-31,-105],[6,-45],[-20,-50],[-35,8],[7,50],[-6,57],[-42,4],[-13,29],[-37,-13],[-38,18],[-28,137],[-42,112],[-3,63],[-33,42],[-7,62],[51,19],[64,-36],[8,36],[-60,19],[-23,85],[12,75],[45,13],[56,-39],[68,57],[67,19],[51,-16],[33,5],[36,-29],[30,-2],[75,58],[41,-4],[9,-41],[125,23],[53,51],[-36,10],[-17,-35],[-108,-28],[-26,48],[-38,-2],[-36,31],[-11,-62],[-49,-20],[-45,39],[-133,2],[-79,-64],[-32,31],[-22,-13],[-74,129],[25,30],[-18,57],[19,32],[42,5],[2,107],[-73,45],[5,49],[39,1],[14,53],[35,9],[5,61],[-86,21],[-3,67],[58,-41],[27,4],[11,48],[-58,71],[23,45],[24,-58],[56,-70],[15,97],[41,3],[48,21],[33,-20],[-6,69],[66,62],[51,1],[42,26],[14,47],[-86,-39],[15,40],[49,33],[-61,17],[-13,40],[151,48],[79,-1],[41,-29],[35,-2],[26,55],[-24,40],[-107,-11],[14,70],[-34,60],[54,60],[52,14],[8,-27],[27,-10],[11,-40],[63,48],[57,17],[25,69],[37,13],[6,-52],[55,-50],[-12,-26],[46,-59],[24,24],[-65,92],[-40,85],[46,17],[46,-8],[15,14],[33,15],[-17,11],[-31,61],[59,34],[-13,59],[44,14],[94,-25],[18,30],[-1,58],[67,32],[41,43],[37,-10],[19,-66],[47,-52],[-10,-50],[69,55],[73,5],[27,-19],[94,11],[-37,40],[-12,82],[37,16],[30,44],[71,15],[0,25],[53,16],[11,39],[-54,26],[-63,-33],[-17,-55],[-93,-53],[-4,-17],[-133,-104],[-53,-2],[-36,92],[35,90],[-75,-56],[-20,-3],[-6,76],[13,30],[58,51],[33,-7],[41,34],[-27,35],[9,87],[45,39],[1,23],[72,88],[16,31],[-14,42],[19,22],[76,-33],[-18,52],[45,22],[49,44],[-11,56],[103,-13],[5,65],[50,45],[-37,22],[-62,3],[9,43],[63,60],[69,25],[-11,23],[57,91],[31,2],[47,47],[42,-40],[20,55],[-26,30],[-67,-24],[41,184],[45,29],[-12,67],[20,46],[42,49],[27,117],[76,58],[-3,8],[5,32],[-14,-9],[-62,6],[40,49],[65,16],[86,49],[111,18],[44,-7],[4,50],[-90,-46],[-17,22],[-103,-51],[-4,53],[-47,61],[43,34],[-17,65],[44,91],[-8,37],[44,41],[57,-28],[-26,76],[57,10],[1,42],[-46,45],[54,9],[21,28],[53,12],[11,32],[51,-39],[23,57],[10,73],[57,3],[27,30],[49,14],[132,-35],[10,54],[-46,-8],[10,52],[-140,-56],[5,33],[-86,-20],[27,53],[35,31],[6,66],[77,70],[61,-7],[19,-55],[59,6],[6,28],[-66,15],[-15,55],[40,74],[56,22],[-24,34],[-70,-70],[-61,-38],[-19,29],[6,53],[-34,11],[23,61],[39,19],[68,-10],[21,18],[106,36],[69,12],[-9,35],[-178,22],[35,56],[35,-5],[91,30],[55,55],[24,-65],[-19,-79],[78,-9],[-18,52],[52,77],[-71,43],[14,67],[90,35],[46,-1],[55,-45],[143,69],[-15,50],[-47,-42],[-76,42],[-30,-39],[-99,-12],[4,21],[-20,17],[2,21],[31,31],[11,47],[97,50],[88,16],[-4,27],[102,86],[-49,0],[26,100],[65,59],[83,31],[-28,50],[5,59],[44,64],[-7,41],[66,0],[7,-43],[58,-13],[-45,94],[138,41],[1,43],[45,79],[159,57],[15,-8],[-22,-104],[32,14],[23,66],[36,-5],[42,124],[55,16],[18,-48],[-27,-98],[-22,-129],[50,7],[36,87],[-11,27],[102,74],[22,-39],[70,73],[17,82],[34,8],[43,-29],[10,-39],[81,-60],[14,23],[-7,78],[-42,49],[-70,30],[-19,37],[-61,52],[80,60],[82,-66],[5,41],[45,45],[90,-49],[-17,-88],[28,-5],[6,72],[28,16],[58,-25],[79,-11],[13,-114],[33,-43],[105,-2],[-95,75],[69,22],[-48,60],[65,62],[0,29],[95,86],[5,22],[69,24],[50,73],[23,53],[41,-3],[11,44],[-71,23],[-2,44],[55,-11],[34,28],[-6,77],[55,9],[55,-31],[55,-11],[65,-55],[51,49],[77,-11],[22,-24],[-79,-97],[-72,-62],[-46,-86],[6,-59],[-38,-57],[26,-50],[-65,-44],[-8,-61],[63,-60],[26,23],[16,59],[64,96],[-34,18],[61,75],[16,38],[86,82],[16,82],[54,47],[37,62],[53,54],[47,-27],[-18,-35],[5,-84],[-42,-33],[31,-40],[-16,-120],[-21,-34],[59,-12],[7,46],[81,8],[-25,42],[36,69],[9,74],[47,17],[3,46],[148,-33],[79,-29],[-8,-27],[63,-21],[-27,-60],[-87,-61],[29,-23],[45,22],[50,-14],[-45,-83],[-6,-86],[2,-32],[14,-30],[-19,-45],[-121,-25]],[[57114,91010],[47,36],[16,-72],[55,-66],[-73,-3],[-61,-32],[-85,71],[5,50],[96,16]],[[56689,90862],[-37,7],[-18,46],[44,31],[11,-84]],[[56609,90712],[55,-4],[34,-43],[-2,-40],[-61,-58],[-29,3],[-36,81],[39,61]],[[56506,90488],[-26,-66],[-51,-22],[-71,65],[-7,59],[70,69],[90,15],[43,-40],[11,-50],[-59,-30]],[[56305,90566],[-126,-14],[15,88],[-71,15],[132,64],[28,-56],[55,7],[-38,66],[34,19],[38,-57],[50,40],[-20,38],[89,26],[36,-24],[-66,-87],[-23,5],[-33,-83],[-35,-28],[-65,-19]],[[56206,90451],[95,35],[33,-14],[57,-90],[-68,-1],[-102,36],[-15,34]],[[55805,90208],[8,-47],[-38,-6],[-22,53],[52,0]],[[55673,90333],[32,32],[51,6],[24,-33],[-17,-63],[12,-34],[-64,-14],[-53,36],[15,70]],[[55421,90362],[41,14],[46,-29],[32,-44],[50,-28],[-67,-37],[-40,7],[-19,74],[-43,43]],[[55444,90158],[48,52],[31,-24],[-46,-86],[-86,-12],[53,70]],[[55224,90199],[80,62],[58,-3],[103,-56],[-91,-124],[-78,-23],[-52,65],[-43,21],[23,58]],[[55307,90359],[39,12],[-15,-83],[-52,29],[28,42]],[[55189,90088],[0,30],[87,-43],[17,-33],[-54,-62],[-32,-11],[6,-75],[-155,-34],[-56,33],[15,40],[62,-1],[16,48],[-11,63],[19,14],[67,-25],[45,29],[-26,27]],[[55186,90249],[8,37],[51,-7],[12,-40],[-47,-20],[-24,30]],[[54999,89855],[22,-113],[-40,-11],[15,-112],[-47,-18],[-115,0],[-53,-51],[3,-46],[-121,23],[8,49],[45,14],[-20,67],[43,73],[-36,32],[94,21],[-16,47],[53,5],[-5,35],[36,41],[46,-48],[48,42],[40,-50]],[[54758,89403],[29,35],[70,-39],[-59,-55],[-40,59]],[[54702,89342],[23,45],[47,-64],[-81,-32],[11,51]],[[54538,89446],[77,15],[1,-44],[-42,-14],[-36,43]],[[54355,89357],[-36,33],[25,60],[60,15],[29,-56],[-21,-88],[35,8],[53,62],[40,11],[38,-17],[27,-42],[3,-108],[-21,-59],[-76,-1],[-36,-24],[-32,-89],[-77,-17],[-16,-51],[-107,48],[-11,-26],[-61,-55],[-10,36],[76,118],[-20,37],[13,34],[64,38],[3,132],[58,1]],[[54494,89138],[49,32],[28,-22],[-3,-14],[19,-28],[-27,-33],[-22,2],[-58,-27],[-14,23],[28,67]],[[54437,89691],[56,2],[-20,-82],[-51,-64],[-13,-40],[-76,-35],[-39,29],[59,86],[39,17],[12,56],[33,31]],[[54178,89254],[-37,6],[-73,-23],[-42,-37],[-34,64],[31,30],[-9,36],[72,24],[64,-16],[64,116],[61,-72],[-29,-72],[35,-47],[-105,-78],[-62,31],[64,38]],[[54156,88745],[74,-9],[1,-24],[-74,0],[-1,33]],[[54047,89042],[-4,33],[74,5],[66,22],[20,-33],[-46,-54],[-85,-75],[-121,-49],[-7,64],[-37,32],[4,29],[63,-16],[73,42]],[[54145,89172],[-7,-43],[-36,-2],[-44,44],[17,20],[70,-19]],[[53839,88976],[45,43],[11,-49],[41,-14],[-44,-49],[-44,-6],[2,-42],[-87,-44],[-24,15],[21,80],[-7,38],[49,46],[37,-18]],[[53611,88803],[21,40],[44,1],[24,48],[37,-22],[-17,-72],[-91,-62],[-9,-50],[-54,-18],[19,81],[26,54]],[[53523,87307],[-39,-42],[-45,2],[45,69],[27,18],[22,-9],[56,18],[2,-24],[-68,-32]],[[53416,87356],[70,95],[31,-37],[-50,-47],[-51,-11]],[[53077,86571],[40,8],[12,-51],[-32,-34],[-31,50],[11,27]],[[53061,86601],[8,-29],[-61,-55],[-26,25],[79,59]],[[52466,85636],[28,-28],[33,8],[27,-31],[-40,-34],[-59,-24],[-59,-11],[-25,-24],[-58,3],[-4,48],[78,81],[79,12]],[[52414,85746],[36,12],[4,-68],[-95,-30],[55,86]],[[52315,85368],[36,17],[30,-72],[-22,-13],[-41,3],[-26,43],[23,22]],[[52215,85514],[39,4],[25,-69],[-29,-42],[-88,35],[0,32],[53,40]],[[52212,85328],[45,27],[13,-54],[-74,-7],[16,34]],[[52145,85262],[33,23],[13,-53],[-24,-30],[-29,9],[7,51]],[[52116,85255],[21,-79],[-45,-33],[-46,25],[18,32],[56,32],[-4,23]],[[51870,84980],[54,25],[4,-28],[-58,3]],[[51654,84773],[35,-60],[-47,-62],[-23,41],[-4,49],[39,32]],[[51542,84675],[25,9],[49,-20],[-16,-49],[-47,-11],[-18,26],[7,45]],[[51549,82399],[50,5],[-6,-37],[-44,32]],[[51495,83033],[28,38],[56,20],[6,-39],[-40,-97],[-50,78]],[[51483,82897],[-18,52],[10,67],[40,-27],[19,-38],[4,-62],[-21,-36],[-34,44]],[[51414,82937],[40,-7],[31,-73],[-55,-72],[10,72],[-26,80]],[[51450,82587],[20,-4],[10,-71],[-9,-86],[-28,-6],[-5,84],[12,83]],[[51348,84377],[26,27],[73,-28],[-78,-73],[-21,74]],[[51380,83325],[52,-17],[-10,-85],[8,-57],[-39,13],[-23,96],[12,50]],[[51359,83863],[36,-24],[-23,-35],[-30,-1],[17,60]],[[78824,41050],[13,14],[18,-40],[43,-40],[-18,-32],[-27,-23],[-11,-33],[-18,22],[-22,-18],[-21,18],[5,59]],[[55707,89531],[63,-20],[60,-97],[114,-100],[8,-47],[127,-77],[43,-75],[85,1],[83,-46],[118,-84],[23,-49],[-4,-56],[39,2],[33,-81],[66,-56],[2,-35],[-35,-23],[-12,-48],[1,-84],[19,-85],[-42,-69],[101,-38],[5,-67],[-15,-41],[-41,-10],[-5,-73],[122,-247],[-33,-49],[-5,-141],[-56,-70],[9,-52],[-12,-63],[24,-76],[51,-23],[6,-61],[50,-108],[8,-62]],[[56707,87221],[-43,-35],[-72,30],[-19,-25],[-66,16],[-12,-29],[-105,-20],[-47,32],[-78,-3],[-52,54],[-1,-164],[-17,-67],[-85,-23],[2,-43],[-33,-32],[-56,-20],[-28,31],[-26,-40],[40,-25],[2,-63],[-30,-12],[15,-53],[-14,-55],[-25,-19],[-58,-107],[-32,-78],[35,-10],[-10,-68],[24,-61],[46,-14],[8,-131],[-41,-67],[-33,-12],[-25,-57],[-23,-6],[-37,-70],[-1,-66],[-34,-50],[-6,-47],[-38,-43],[-31,0],[-24,-44],[-12,-58],[-110,-6],[-76,-112],[-39,11],[-38,36],[-9,-77],[-44,-21],[-3,-78],[-33,-4],[-4,-52],[-22,-33],[-29,28],[-58,-49],[-38,0],[-32,-98],[21,-37],[-24,-79],[-91,-74],[-27,60],[-28,-61],[15,-48],[-10,-43],[29,-33],[-39,-25],[-19,-52],[-45,2],[-42,-32],[-13,44],[-43,-19],[17,-34],[-8,-65],[38,-62],[44,-17],[-50,-78],[-4,-59],[-35,-98],[10,-107],[41,-40],[-9,-59],[-40,38],[-25,-2],[-36,-44],[13,-87],[-23,-65],[38,-53],[-16,-45],[10,-25],[-16,-53],[14,-51],[-11,-24],[13,-87],[33,-84],[7,-42],[-28,-33],[16,-32],[43,-14],[42,4],[-3,-52],[20,-28],[42,34],[45,16],[9,-72],[28,-55],[80,-65],[57,-73],[-22,-31],[78,-67],[26,-119],[38,-23],[-49,-79],[55,-18],[1,-33],[-47,-5],[-42,-25],[-23,-70],[-50,-45],[-66,-94],[43,-19],[21,45],[41,-38],[21,-67],[-58,-43],[-45,48],[26,-104],[-27,-33],[-52,-9],[-30,-24],[-32,-138],[-30,-32],[-21,90],[2,83],[-30,12],[-5,-126],[-15,-38],[-49,-29],[-37,-54],[-30,-16],[-9,-37],[-88,-36],[24,-61],[-8,-47],[-41,-16],[36,-94],[-28,-22],[30,-60],[-27,-58],[16,-160],[-35,0],[-20,28],[-20,-33],[33,-62],[14,-47],[-21,-56],[0,-43],[24,-64],[2,-35],[-46,-66],[-19,-42],[6,-43],[-13,-45],[32,-56],[-27,-47],[-14,-135],[15,-42],[-33,-10],[3,-39],[-41,-80],[0,-36],[-27,-58],[-39,-191],[-42,-83],[-22,36],[-18,-44],[-28,27],[23,33],[-35,26],[-28,-33],[-39,18],[-57,-17],[-14,26],[-31,-19],[-74,-22],[29,-65],[-19,-28],[-28,1],[-22,31],[-45,-57],[-33,-62],[-10,-41],[-2,-85],[43,-103],[-4,-35],[-39,-84],[-42,-7],[-34,37],[-64,-5],[-29,-26],[-33,-7],[-33,-30],[-24,5],[-83,41],[-2,42],[-20,79],[46,69],[-33,59],[-12,70],[-19,6],[-23,96],[-51,113],[-13,106],[74,-54],[15,38],[-28,63],[-32,27],[29,54],[36,-30],[24,60],[-2,54],[-16,44],[-46,21],[-24,45],[-5,56],[-33,49],[-36,21],[-2,60],[-31,58],[-10,75],[-33,48],[21,21],[-12,45],[-55,31],[-2,111],[7,22],[-23,75],[-41,31],[9,55],[-15,32],[36,128],[9,104],[-42,-40],[-39,-19],[-41,35],[40,73],[-12,29],[-54,65],[-27,1],[3,50],[21,20],[-20,59],[13,36],[-4,49],[-22,62],[4,52],[-9,69],[-14,31],[21,81],[41,24],[33,-88]],[[55302,81579],[46,-13],[-49,-43],[3,56]],[[55284,81515],[-1,-67],[-20,-6],[-13,-47],[-27,19],[2,-134],[-16,-28],[16,-54],[30,-26],[-47,-30],[-23,-56],[3,-38],[-77,-64],[-17,-49],[7,-63],[-19,-39],[-48,-10],[26,82],[0,76],[-19,73],[10,110],[-18,53],[-4,49],[62,97],[37,108],[41,19],[4,27],[35,29],[76,-8],[0,-23]],[[55109,83365],[54,-92],[-17,-17],[-35,43],[-2,66]],[[54592,80710],[32,90],[49,96],[37,151],[1,45],[37,8],[-8,-77],[-24,-77],[-34,-179],[-21,-31],[-27,-157],[-10,-10],[-22,-136],[-28,-104],[-20,-5],[3,97],[-10,124],[45,165]],[[53234,81648],[32,4],[-1,-48],[-49,-52],[-21,83],[39,13]],[[64994,66786],[-30,187],[-11,93],[-5,126],[2,73],[12,130],[2,132],[-11,96],[7,99],[22,107],[25,81],[-24,63],[-35,54],[-30,17],[4,34],[-8,60],[-17,-42],[-35,126],[-24,36],[-19,-19],[-37,17],[-17,-36],[-16,63],[37,81],[57,16],[18,-51],[44,6],[9,60],[-12,45],[-35,28],[-29,80],[15,49],[37,54],[44,-25],[-3,-54],[21,9],[30,-25],[50,-16],[-34,65],[-31,16],[-26,43],[-44,44],[-25,-16],[-39,25],[-29,-53],[-35,34],[-13,-15],[-33,14],[-27,-8],[-21,-27],[-17,34],[-9,53],[8,58],[-16,89],[11,170],[29,100],[9,128],[21,124],[11,-40],[11,-105],[-19,-19],[4,-34],[27,-21],[43,4],[41,35],[23,-22],[32,32],[8,66],[30,-181],[33,3],[29,31],[47,13],[69,-2],[46,19],[13,54],[-45,-8],[-28,52],[14,32],[27,-66],[41,7],[36,59],[15,55],[-8,40],[3,55],[-27,45],[-43,96],[-57,51],[-57,91],[-22,67],[-8,169],[-28,68],[6,71],[-7,60],[-13,21],[-84,15],[-45,-11],[-28,-22],[-28,11],[-19,-12],[-37,-62],[-52,-164],[-15,-32],[6,-45],[-11,-39],[40,-26],[-16,-128],[-28,30],[-42,69],[12,68],[-4,32],[-39,56]],[[62435,68487],[-21,58],[-11,0],[-48,123],[-36,44],[-29,15],[-96,-20],[-68,66],[16,35],[-34,132],[5,64],[-17,24],[37,79],[19,71],[0,38],[-20,84],[-2,64],[-20,33],[-36,34],[2,66]],[[62076,69497],[26,16],[31,-6],[19,-19],[26,38],[48,17],[41,2],[6,38],[24,-21],[32,6],[22,-29],[55,41],[17,-25],[21,15],[2,48],[42,-25],[16,29]],[[58828,77377],[-17,-11],[-88,33],[-22,-26],[-8,-39],[-54,28],[-47,-13],[1,-43],[-36,-46],[-30,-67],[-47,-209],[34,-132],[-23,-78],[-48,30],[-20,36],[6,44],[-28,44],[-55,10],[-35,-6],[-36,-35],[-36,44],[-35,-15],[-12,-62],[-39,-8],[-30,83],[-19,106],[-16,6],[-31,-57],[-29,8],[-23,-21],[-16,-52],[-22,-30],[-10,92],[-50,14],[-29,-37],[-23,59],[-30,15],[-16,-43],[-41,-18],[-30,51],[-33,-112],[-18,47],[15,38],[-50,31],[-26,-18],[-52,-3],[-17,44],[-1,76],[-58,-4],[-13,-23],[-54,49],[-40,15],[-39,-18],[-27,45],[-60,2],[-17,33],[-29,14],[-78,-11],[-51,17],[-48,-5],[-25,25],[-45,-10],[-46,-44],[-35,14],[-17,-22],[-34,15],[-66,-14],[-25,-49],[6,-45],[-55,-61],[-35,-62],[-32,20],[-27,43],[-50,-33],[17,-32],[-13,-50]],[[56560,76944],[-22,68],[6,71],[-8,30],[28,28],[-6,97],[22,55],[-10,56],[-31,34],[-16,44],[-79,33],[5,75],[38,99],[31,57],[48,42],[37,11],[46,64],[-6,162],[8,15],[-19,94],[10,52],[-26,58],[-31,138],[-44,238],[-10,135]],[[56531,78700],[25,-21],[54,6],[30,22],[21,-30],[61,33],[42,-53],[29,9],[14,37],[33,36],[19,-14],[40,21],[-11,69],[43,38],[39,-14],[34,76],[38,6],[45,31],[14,-27],[-9,-82],[32,-20],[38,76],[-30,64],[-35,-6],[3,37],[33,122],[23,29],[-8,72],[0,90],[33,67],[28,39],[35,3],[29,26],[48,114],[29,-15],[43,13],[30,65],[31,34],[-12,25],[-35,13],[-48,-3],[17,39],[-9,87],[29,45],[1,77]],[[57397,79936],[8,19],[58,5],[14,53],[27,30],[51,4],[24,-36],[19,19],[72,-17],[11,102],[40,37],[11,41],[24,16],[63,78]],[[62076,69497],[-8,39],[-27,20],[-31,-20],[-12,55],[5,26],[-53,64],[-14,48],[-32,19],[-17,32],[10,51],[-41,9],[-30,-25],[-1,-42],[-28,-51],[-51,40],[-92,23],[-38,-66],[-19,28],[-33,11],[-24,24]],[[61540,69782],[8,62],[27,34],[27,105],[2,43],[-6,106],[-27,90],[-6,97],[-21,86],[-18,177],[-15,74],[-59,45],[-22,-4],[-13,37],[-7,73],[-11,35],[-18,-12],[-28,64],[-13,9],[-68,6],[-18,37],[-31,20],[-17,-18],[-18,31],[-11,94],[-46,42],[-18,5]],[[62440,66645],[-44,32],[-23,-49],[-41,-51],[-25,-57],[-11,3],[-21,76],[9,56],[15,8],[-2,49],[-41,60],[-29,4],[-28,-74],[-64,7],[-19,-10],[-57,45],[-15,32],[-17,-17],[-16,29],[-32,20],[-26,-12],[-20,-31],[-46,49],[-28,-57],[-32,-110],[-64,-25]],[[61763,66622],[-8,54],[6,34],[-37,40],[-48,-79],[-67,-37],[-39,-9],[-38,-28],[-62,2],[-21,-14],[-28,24],[-56,26],[-43,-4],[-65,-70],[-30,-8],[-12,-28],[-54,-72],[-34,-17],[-67,-70],[-29,-4],[-62,-36],[-77,-22],[-54,29],[-75,-2],[-17,20],[-38,79],[-44,40],[-42,16],[-45,-34],[-49,-60],[-34,-31],[-21,6],[-60,-65],[-5,-23],[-70,29],[-37,-29],[-18,24],[6,47],[-34,37],[-35,8],[-31,21],[-19,-59],[-11,-62],[4,-50],[-13,-61],[16,-96],[16,-22],[10,-68],[-19,-21],[-25,22],[-46,-49],[2,-118],[-21,0],[-54,-104],[-30,11],[2,43],[-24,-9]],[[59977,65773],[17,60],[-22,101],[-31,91],[-1,35],[20,32],[12,46],[22,25],[15,42],[35,45],[14,56],[-1,79],[-26,73],[-30,32],[-59,-117],[-35,1],[-9,-104],[-19,-42],[-42,19],[-23,-28],[-96,118],[-23,6],[-13,38],[-31,25],[-28,-6],[-26,-30],[-34,-70],[-43,-58],[-11,-35],[-43,-87],[-2,-69],[-28,-43],[-23,43],[-26,-61],[-27,-42],[-29,2],[-9,-33],[-28,22],[-18,-24],[-74,5],[-12,-38],[-37,16],[-41,-57],[-38,15],[-29,40],[-12,-3],[-39,55],[-22,42],[-8,43],[-17,36],[-12,52],[-33,80],[-54,45],[-30,35],[-18,6],[-30,43],[-50,43],[-25,35],[-93,31],[-60,-7],[-15,26],[-34,-61],[-6,-129],[9,-30],[-28,-111],[6,-56],[-16,-62],[-22,8],[-21,30],[-28,3],[-23,-50],[-124,-71],[-7,37],[-80,23],[-32,64],[-27,29],[-10,32],[5,100],[-25,17],[-1,24],[17,56],[-39,41],[-23,-32],[-21,-5],[-47,25],[3,69],[-23,10],[-13,-28],[-29,-4],[-24,23],[-21,-12],[10,-40],[-49,-75],[-26,46],[24,17],[-7,33],[-54,-21],[-43,8],[-12,-69],[-19,17],[-55,-15],[6,61],[49,11],[59,36],[57,-17],[12,25],[-6,69],[24,9],[55,84],[-69,-20],[-28,7],[-54,-27],[-37,3],[-22,-13],[-30,13],[-7,23],[-30,-15],[-18,-33],[-10,69],[41,65],[23,-39],[25,21],[2,109],[-28,-15],[-19,51],[-5,51],[-30,-45],[-16,17],[7,81],[-8,16],[0,82],[-50,27],[53,45],[10,22],[-1,62],[8,87],[-15,31],[-27,2],[-20,39],[-27,19],[-26,-22],[-10,83],[-13,35],[-35,0],[-13,-76],[-23,48],[-68,70],[6,43],[19,-14],[32,47],[10,41],[-28,29],[-14,67],[-3,52],[17,30],[17,-3],[41,-105],[-7,-42],[13,-94],[14,62],[18,-39],[90,20],[7,36],[-23,13],[-21,-17],[-28,71],[-1,24],[-32,51],[-1,58],[26,23],[21,-18],[4,59],[42,38],[-40,50],[-17,-18],[-17,30],[1,54],[24,34],[-20,55],[-13,7],[-9,53],[-30,42],[41,50],[22,71],[21,14],[6,43],[-24,14],[-38,1],[-66,-28],[-46,-34],[-58,-18],[-13,12],[10,80],[16,54],[-6,132],[10,105],[40,19],[10,29],[16,103],[30,12],[65,133],[56,-14],[21,5],[16,37],[27,-6],[27,26],[15,-76],[56,-45],[26,18],[34,-15],[12,60],[-32,60],[8,34],[40,-3],[45,-21],[0,-25],[-34,-44],[15,-26],[57,30],[98,0],[39,-25],[35,24],[41,-28],[37,6],[10,79],[-35,-9],[-23,13],[-26,51],[28,23],[28,44],[80,11],[27,29],[14,-8],[25,27],[10,-28],[65,25],[41,-3],[-2,30],[-44,-12],[-16,23],[-58,3],[-39,-15],[-5,35],[-24,43],[-32,25],[-14,36],[-32,35],[-36,-20],[-22,5],[-41,-14],[-42,45],[-65,39],[-45,-15],[-33,-57],[-19,-9],[-42,34],[-62,-27],[-16,-93],[-33,-63],[-8,-39],[-45,-62],[-32,-16],[-81,-84],[-27,-52],[-16,-61],[-18,-19],[-45,-73],[7,-34],[-20,-35],[-40,-29],[29,100],[2,41],[-11,25],[8,44],[18,12],[34,55],[47,48],[24,4],[35,50],[-11,53],[-52,-14],[-21,-32],[-15,14],[-42,-13],[-47,-3],[-18,11],[-17,90]],[[57231,69216],[25,9],[9,45],[48,99],[8,41],[-13,57],[3,124],[20,-3],[29,57],[24,-5],[14,44],[-12,103],[0,60],[-17,8],[-24,47],[-24,17]],[[57321,69919],[-8,18],[14,62],[44,1],[11,39],[-4,34],[22,33],[32,-7],[8,20],[50,5],[28,69],[32,-16],[18,21],[36,-39],[19,-55],[27,-38],[39,40],[54,20],[11,-19],[31,6]],[[57785,70113],[4,-48],[-17,-32],[5,-55],[28,-116],[48,-97],[101,-104],[56,-46],[49,-30],[42,-15],[25,8],[83,-43],[59,-11],[15,-12],[93,-3],[30,48],[64,-43],[44,-14],[29,-29],[70,-10],[54,17],[30,19],[27,64],[-1,75],[59,46],[64,86],[81,73],[40,84],[56,44],[32,35],[100,41],[19,29],[39,20],[42,43],[129,-30],[87,4],[56,-27],[38,18],[35,-14],[66,6],[27,44],[15,42],[17,11],[28,-63],[-7,-50],[13,-57],[39,-98],[65,-58],[42,5],[82,66],[30,-38],[15,-46],[4,-112],[30,-76],[25,-23],[18,-51],[26,-2],[22,29],[15,54],[19,3],[51,-22],[38,-45],[12,-72],[35,-22],[31,0],[29,-30],[40,-58],[20,21],[18,55],[31,-12],[-4,-29],[28,-59],[35,-6],[57,-30],[23,4],[22,-25],[46,6],[25,39],[19,-18],[63,66],[28,-5],[40,34],[24,-23],[47,43],[19,-11],[22,-47],[29,-22],[31,4],[21,-32],[51,1],[23,-33],[30,12],[42,69],[48,5],[46,41],[23,52],[35,10],[37,31],[56,88],[40,32],[38,96]],[[57655,69153],[19,16],[24,-36],[-26,-24],[-17,44]],[[57159,68839],[43,25],[12,-13],[-2,-70],[-63,-23],[-19,44],[29,37]],[[60619,73797],[-26,-49],[-13,41],[-34,-13],[-19,16],[-28,-19],[-46,6],[-26,-9],[-57,-139],[-26,46],[-95,-101],[-19,-77],[-31,54],[-27,1],[-57,-38],[-44,-71],[-11,24],[-79,0],[-58,-53],[-40,-76],[-35,-29],[-27,-62],[-44,19],[-41,-82],[-43,-19],[-22,-53],[-52,5],[4,-56],[-17,-64],[-25,-17],[-11,22],[-6,77],[-14,55],[-34,-8],[-5,-111],[32,4],[14,-48],[23,-35],[44,9],[-12,-68],[16,-23],[24,12],[7,-65],[21,7],[14,-40],[23,-4],[31,-108],[4,-32],[-25,-32],[19,-59],[32,-14],[50,-57],[16,34],[-38,64],[-56,139],[-45,140],[-9,46],[-19,13],[1,74],[56,-219],[72,-183],[46,-78],[17,-13],[52,36],[11,46],[25,38],[26,-52],[22,-4],[15,49],[19,18],[43,10],[26,-20],[51,-9],[20,-41],[-12,-25],[-37,-4],[-15,-43],[-4,-51],[12,-89],[-61,-42],[-53,16],[-23,-27],[-31,-10],[-29,66],[-40,28],[-39,-21],[-17,-33],[-10,-66],[-22,4],[-9,-34],[-21,-14],[-25,-78],[-28,34],[-22,-17],[-46,-3],[-76,-73],[-29,-89],[-29,-58],[-23,-9],[-13,-47],[-43,-26],[-28,11],[-24,-14],[-36,30],[-5,37],[-35,17],[-29,40],[10,31],[30,41],[-2,94],[17,40],[4,52],[-13,115],[-16,42],[-34,42],[-28,-35],[-28,26],[-46,89],[-4,33],[-71,6],[-26,-34],[-43,20],[-5,44],[29,54],[56,58],[34,56],[67,66],[47,29],[48,60],[15,-12],[30,25],[27,55],[-33,9],[2,82],[-12,56],[-22,-52],[-27,-31],[-60,97],[-22,-36],[-60,-12],[-40,10],[-61,-29],[-43,10],[-46,27],[-10,31],[-36,55],[-79,21],[8,33],[48,15],[24,30],[-10,37],[-74,33],[-31,-7],[-27,42],[56,7],[69,-42],[23,7],[62,-23],[34,12],[50,71],[-11,33],[-24,-7],[-5,-34],[-44,-12],[-15,27],[-32,-25],[-6,32],[-38,40],[-52,-34],[-39,28],[-27,-33],[-27,26],[-31,-27],[-50,18],[-119,-69],[9,-66],[-60,-205],[-96,-211],[-102,-152],[-40,-54],[-21,-48],[9,-52],[-14,-28],[-26,44],[21,67],[17,-9],[16,33],[14,18],[-38,104],[-10,-146],[-21,-67],[-29,-10],[-49,4],[-15,-33],[-53,-33],[-12,-51],[-32,38],[-33,-77],[-37,15],[-61,53],[-22,94],[-17,11]],[[57836,72614],[26,56],[58,-34],[8,57],[-11,84],[57,60],[21,37],[-8,69],[6,31],[56,23],[8,33],[-16,32],[33,73],[-32,46],[12,49],[-18,93],[26,3],[4,31],[34,7],[62,-49],[17,37],[33,-59],[4,-40],[28,1],[1,46],[26,21],[8,-50],[36,10],[45,-17],[10,29],[-35,27],[-23,35],[12,68],[-6,34],[8,78],[-25,68],[-38,9],[-4,36],[-24,6],[-15,32],[5,98],[-17,108],[13,4],[-7,81],[-24,-10],[0,-36],[-24,-4],[-17,50],[-6,57],[-37,0],[-18,75],[27,42],[9,99],[-8,34],[-12,140],[-42,-34],[-28,10],[-24,54],[1,65],[-82,31],[-27,-63],[-4,62],[-24,9],[4,43],[-41,-25],[-8,34],[-39,52],[-22,0],[-28,59],[-33,36],[-78,-7],[-5,-28],[-36,25],[-9,-52],[-55,30],[-26,-38],[-61,42],[-3,-47],[-19,-19],[-18,-48]],[[57397,74615],[-82,-55],[-19,-76],[-23,-59],[-90,-18],[-24,-22],[-41,7],[-110,-40],[-32,-99],[-21,-21],[-44,-1],[-15,70],[-43,30],[-14,63],[-52,13],[-15,-31],[-45,-21],[-30,13],[-28,37],[-45,-19],[-8,31],[-43,0],[-39,15],[-30,-13],[-37,46],[-4,26],[-34,9],[-20,-65],[-50,-39]],[[56359,74396],[-16,26],[12,33],[-28,60],[-28,-20],[-22,38],[-31,78],[-41,18],[-6,54],[-29,51],[-16,-16]],[[56154,74718],[-5,11],[13,132],[49,91],[-3,30],[35,158],[19,11],[6,58]],[[56268,75209],[20,-20],[65,-21],[-3,50],[-34,43],[2,143],[-14,97],[-15,25],[57,129],[34,92],[86,178],[53,94],[31,35],[34,78],[27,21],[54,5],[21,66],[8,69],[-8,87],[-32,53],[9,31],[31,-2],[-36,83],[-28,139],[-36,49],[-28,85],[17,53],[-23,73]],[[57321,69919],[-20,0],[-31,27],[-29,-28],[-2,-34],[25,-41],[9,-61],[-3,-62],[-12,-56],[-33,-8],[-35,-29],[-18,32],[-35,-34],[-37,13],[-17,-23],[-46,-33],[-27,3],[-16,45],[-32,38],[-93,40],[-34,8],[-16,89],[-24,-17],[-107,10],[-1,-53],[-30,-21],[-17,13],[-30,-15],[-9,-28],[-25,10],[-10,-25],[-32,21],[-33,-3],[-19,-24],[-29,6],[-9,-39],[-29,-3],[-47,15]],[[56368,69652],[13,159],[-6,20],[23,96],[-19,36],[-26,117],[-2,62],[-52,30],[-22,25],[-36,74],[-31,79]],[[56210,70350],[26,14],[19,48],[8,78],[-31,47],[14,126],[-13,41],[26,55],[24,10],[34,-7],[11,68],[32,39],[24,54],[0,66],[-24,17],[-20,73],[-16,34],[-25,13],[-40,55],[-13,70],[1,51],[-23,40],[-14,82],[14,93],[0,46],[34,12],[25,31],[-3,31],[18,78]],[[56298,71715],[21,-14],[48,-67],[34,-30],[-11,-35],[-35,-22],[-12,-74],[12,-32],[50,-27],[58,37],[43,4],[55,-45],[36,7],[29,-31],[31,-9],[63,-44],[40,9],[46,49],[33,-15],[33,-41],[61,33],[42,-34],[21,10],[55,-57],[51,18],[32,34],[20,4],[26,41],[21,60],[35,48],[16,47],[53,39],[84,21],[51,22],[32,34],[37,9],[42,-18],[25,7],[4,-39],[30,-45],[59,0],[18,13],[10,-51],[65,19],[14,-102],[67,-61],[58,-17],[37,3]],[[57938,71373],[-3,-98],[11,-43],[-17,-76],[-25,-43],[-36,29],[-49,-8],[-18,-26],[-20,-103],[-19,-43],[-16,-90],[5,-80],[-6,-71],[4,-92],[-46,6],[-4,-37],[-20,-14],[-3,-48],[-41,-33],[-13,-46],[24,-18],[16,17],[30,-27],[17,-96],[0,-28],[55,-111],[21,-81]],[[57597,81254],[-65,32],[-24,30],[-99,-27],[-33,-38],[-24,44],[-54,18],[-19,82],[-50,44],[9,44],[-66,20],[-93,79],[-6,23],[-45,19],[-24,29],[-31,2],[-23,-43],[-53,-32],[-68,-8],[-65,-61]],[[56764,81511],[36,144],[-8,69],[10,61],[27,31],[-13,41],[-33,21],[-32,-7],[-11,-72],[-43,-27],[-21,44],[-79,27],[-34,132],[-28,50],[-8,43],[14,83],[-26,94],[6,55],[-17,25],[5,46],[30,11],[-14,85],[81,53],[45,-9],[71,51],[8,37],[31,22],[6,34],[81,-30],[41,13],[32,37],[58,-13],[41,21],[42,-15],[36,41],[42,23],[22,29],[73,1],[15,-25],[47,0],[15,-22],[65,-26],[14,24],[94,-83],[116,7],[65,-23],[88,-9],[33,45],[47,-63]],[[56407,82043],[34,47],[44,-26],[16,-69],[-43,-18],[-51,66]],[[56435,82300],[6,49],[42,-11],[-12,-42],[-36,4]],[[56291,81779],[-25,-21],[-29,13],[-56,-48],[3,-30],[-22,-85],[4,-22],[-48,-49],[-12,28],[29,92],[22,8],[13,47],[-41,14],[-13,43],[-47,27],[9,50],[32,7],[-26,82],[32,23],[12,-44],[38,53],[27,-15],[4,53],[39,9],[35,39],[14,-36],[70,31],[34,-19],[39,-57],[1,-45],[-29,-64],[-27,-1],[-5,-45],[-27,-26],[-50,-12]],[[56311,82169],[-15,-69],[-50,3],[-15,115],[-19,25],[-44,-13],[-40,30],[69,20],[105,90],[4,-46],[63,-28],[26,-54],[-13,-35],[-48,-53],[-23,15]],[[63363,61846],[17,-30],[6,-54],[7,-15],[10,17],[9,-13],[31,-80],[-5,-57],[1,-10],[14,-29],[6,-59],[25,-57],[-36,10],[-62,79],[-24,4],[-26,-29],[-12,19],[-3,47],[-13,33],[13,103],[-17,29],[-8,-81],[12,-70],[12,-34],[0,-42]],[[63320,61527],[-68,69],[-94,0],[-55,-62],[-9,-22],[-16,-97],[-21,-93],[-3,-42],[-26,-99],[-10,-63],[-23,-59],[-28,-96],[-36,-86]],[[62931,60877],[-36,-30],[-122,28],[-123,25],[-228,45],[-100,192],[-171,326],[-159,297],[-161,299],[-142,258],[-179,187],[-144,211],[-141,202],[-131,60],[-205,89]],[[60889,63066],[27,55],[-11,89],[-60,-36],[-16,124],[28,17],[-82,626]],[[60775,63941],[213,284],[165,216],[135,175],[94,59],[12,43],[28,140],[29,89],[-5,262],[3,83],[13,88],[1,74],[31,101],[-3,156],[-32,155],[8,208],[32,125],[116,46],[19,35],[136,311],[-7,31]],[[56079,79514],[-46,31],[-18,34],[-43,4],[-29,73],[-26,-19],[-8,46],[-24,10],[16,50],[-3,75],[-25,116],[-17,38],[-10,136],[5,107]],[[55851,80215],[40,11],[5,52],[26,41],[36,25],[14,33],[32,21],[30,-7],[31,41],[37,4],[7,25],[39,14],[30,-23],[50,7],[116,-31],[45,29],[7,-54],[19,-19],[22,46],[59,7],[44,-33],[23,20],[108,-22],[29,-58],[47,26],[45,-19],[35,21],[13,61],[58,27],[30,-26],[8,-46],[23,-32],[10,-57],[40,4],[13,-24],[103,-17],[10,-34],[37,-23],[11,-29],[51,-50],[21,-47],[23,-15],[18,-65],[73,-65],[28,2]],[[56531,78700],[-9,31],[13,47],[-12,63],[-41,71],[-68,33],[-30,66],[-41,12],[-12,-31]],[[55851,80215],[-23,107],[-3,111],[4,105],[20,137],[2,95],[52,57],[44,92],[0,155],[34,94],[17,23],[35,105],[88,26],[145,102],[15,-109],[64,-79],[29,-57],[48,-34],[32,-184],[34,-45],[37,-11],[18,-38],[60,-4],[56,37],[15,29],[54,48],[38,56],[14,44],[-13,220],[7,25],[-13,66],[3,123]],[[57836,72614],[-6,3]],[[57830,72617],[-10,66],[-15,38],[20,16],[-2,69],[-12,39],[2,65],[-11,99],[11,76],[-4,61],[39,181],[-12,31],[11,76],[-20,112],[-18,38],[-5,113],[-50,63],[-47,125],[-4,36],[-27,7],[-19,51],[2,60],[-27,20],[-20,71],[-37,76],[4,40],[-24,69],[-13,103],[-15,15],[-16,72],[-65,106],[-49,4]],[[56268,75209],[-42,10],[-107,88],[1,39],[-20,50],[-55,25],[-18,25],[-47,12],[-27,-16],[-43,34],[-24,-43],[-19,26],[-21,-14],[-17,-79],[-61,46],[-21,35],[-37,-30],[-35,29],[-79,-72],[-20,-100],[-43,41],[-21,-29],[-24,15],[13,76],[-21,50],[-26,15],[-15,34],[-15,80],[-17,30],[-65,-74],[-16,-69],[-41,-15],[-19,44],[3,36],[-33,9]],[[55236,75517],[-13,116],[-47,26],[-18,85],[9,16],[-48,59],[-42,1],[-20,41],[-29,18],[-67,-31],[-23,29],[-13,56],[-39,45],[46,33],[-19,68],[-20,-25],[-78,12],[-63,87],[-35,11],[-21,-21],[9,-51],[22,-29],[-6,-45],[-28,4],[-24,-23],[-29,-67],[-40,49],[0,29],[-56,125],[-26,0],[-19,45],[40,39],[28,60],[-28,58],[-31,6],[-12,-30],[-23,26],[-25,-25],[-7,40],[-35,-3],[-13,54],[-31,-13],[-74,51],[-45,59],[4,45],[-33,47],[-43,2],[-4,-110],[-50,1]],[[54117,76487],[19,47],[24,102],[15,153],[-15,36],[-1,71],[-14,30],[-52,32],[8,60],[-7,52],[-23,41],[-19,70],[29,45],[4,56],[14,62],[-20,31],[8,92],[-34,27],[-16,84],[28,74],[-11,82],[-37,38],[-31,64],[-40,49],[-14,41],[-4,61],[54,61],[14,69],[-3,42],[20,41],[-41,211],[4,46],[-13,58]],[[53963,78515],[21,11],[21,-27],[35,0],[6,64],[20,85],[24,41],[19,65],[136,83],[57,14],[97,52],[53,14],[47,38],[33,53],[31,72],[29,40],[66,20],[51,31],[25,39],[57,46],[115,36],[89,36],[97,2],[26,-34],[-8,-30],[19,-42],[1,-38],[25,-61],[1,-62],[46,-62],[52,-21],[47,-1],[85,23],[69,58],[3,-4],[-16,-20],[-95,-69],[7,-36],[34,-15],[27,45],[49,26],[37,62]],[[53992,78669],[36,36],[45,28],[8,-47],[-22,-52],[-89,-2],[22,37]],[[57830,72617],[23,-19],[17,-86],[62,-58],[84,-33],[13,-31],[41,-29],[40,-13],[32,-84],[17,-26],[21,19],[46,-68],[-4,-30],[-82,-22],[-46,-23],[-33,-47],[-24,-64],[-20,-70],[-63,-140],[4,-81],[-4,-97],[9,-63],[-21,-105],[-4,-74]],[[56298,71715],[1,47],[-33,20],[-29,115],[28,16],[18,43],[19,-24],[20,28],[-14,33],[-28,11],[-36,65],[-42,-26],[-15,-34],[-28,-107],[-13,0],[-24,48],[-14,66],[-60,19],[-38,-2],[-11,67],[-52,16],[-13,64],[54,18],[-3,30],[-39,34],[14,45],[7,108],[-78,53],[-7,43],[-22,-21],[-23,20],[-41,101],[-28,106],[11,32],[-1,57],[-28,10],[-12,56],[-40,45],[-9,44],[-37,33],[-1,35],[-23,56]],[[55628,73085],[26,31],[29,-19],[23,26],[24,-36],[23,27],[10,60],[35,27],[42,-15],[43,27],[7,71],[21,0],[10,34],[-16,37],[19,93],[24,7],[32,56],[-13,32],[10,51],[21,18],[36,170],[18,11],[19,53],[-2,37],[24,96],[21,2],[6,37],[-3,67],[29,56],[12,-5],[26,100],[45,14],[6,38],[28,-22],[38,13],[22,73],[23,11],[13,33]],[[60775,63941],[-130,-177],[-146,-201],[-14,-64],[-49,-24],[-19,-30],[-18,-57],[-25,-31],[-27,-7],[-23,-33],[-16,-58],[-29,-5],[-46,-75],[-122,48],[-56,108],[-34,-12],[-13,61],[-2,43],[-17,6],[-8,39],[-49,18]],[[59932,63490],[22,59],[17,84],[-7,22],[-9,135],[-19,121]],[[59936,63911],[14,43],[36,60],[25,84],[-29,43],[10,48],[25,65],[52,30],[35,-23],[4,23],[-32,46],[35,90],[21,-3],[32,106],[2,85],[-20,47],[8,30],[-30,50],[-16,44],[7,49],[-29,51],[-13,-40],[-38,11],[-42,-6]],[[59993,64844],[-14,107],[-16,88],[8,74],[-3,66],[17,91],[-8,40],[-1,97],[-49,106],[13,47],[-5,28],[21,56],[-8,75],[17,12],[12,42]],[[55827,69304],[-6,-58],[28,-75],[-5,-79],[-19,-27],[-4,-37],[-32,9],[-15,-37],[1,-48],[-22,-57],[4,-42],[-19,-95],[-30,-20],[-28,7],[-16,-56],[-20,-16],[25,-93],[-8,-42],[-22,19],[-1,-70],[-22,-35],[-23,-8],[-36,27]],[[55557,68471],[-9,38],[11,53],[-44,162],[-107,122],[-28,67],[31,26],[3,73],[-25,39],[-26,108],[16,54],[3,60],[17,136],[5,84],[17,97],[-3,27],[-24,25],[-1,47],[26,75],[-8,57],[21,2],[11,166],[-50,38],[-12,-7],[0,15],[-2,19],[1,15],[1,4],[-1,3],[-5,10],[0,9],[10,5],[-3,8],[2,17],[10,-11],[11,15],[2,5],[1,7],[1,7],[5,13],[-1,5],[-3,0],[0,45],[-34,85],[18,67]],[[55394,70363],[67,214],[17,23],[14,-49],[-8,-34],[24,-56],[21,29],[27,1],[21,34]],[[55577,70525],[24,-35],[17,-63],[9,-72],[26,-7],[29,-26],[19,-44],[12,-65],[14,-128],[-7,-47]],[[55720,70038],[-6,-64],[-11,-8],[-5,-82],[12,-58],[-24,-16],[-1,-43],[23,-88],[-14,-36],[9,-87],[38,-84],[17,-126],[23,-9],[10,28],[36,-29],[0,-32]],[[55383,70124],[1,59]],[[55384,70183],[6,-6],[4,-1],[7,-6],[12,-7],[-4,-16],[-2,-7],[0,-2],[-2,-4],[-1,-6],[-10,-4],[-3,9],[-8,-9]],[[54902,70764],[-19,35]],[[54883,70799],[36,25],[-19,83],[-58,64],[-3,37],[-22,17],[-25,106],[7,50],[-36,18],[-42,64],[-55,127],[-13,5],[-12,61],[-44,71],[-34,93],[-16,-1],[-44,97],[-20,188],[-9,34],[-25,26],[10,44],[-40,79],[-34,8],[-16,57],[8,32],[-6,47],[12,49],[-9,44],[12,36],[-2,55],[30,27],[34,-9],[19,-76],[41,-67],[33,-12],[12,80],[19,21],[8,47],[29,17],[29,-25],[32,-8],[35,64],[6,-30],[61,-61],[45,-3],[48,-25],[41,19],[55,-65],[21,27],[14,46],[24,-5],[10,-40],[23,-4],[18,44],[19,-27],[22,7],[21,-36],[53,-2],[34,-45],[-8,-65],[24,-36],[47,1]],[[55283,72174],[42,47],[54,-28],[-11,-109],[-19,-51],[-24,-97],[-14,-15],[7,-64],[-12,-30],[17,-62],[22,-17],[21,8],[11,-63],[37,-50],[5,-24],[31,-21],[-27,-69],[-76,-1],[39,-104],[35,-69],[3,-44],[-14,-55],[-32,24],[-25,-8],[-13,-50]],[[55340,71222],[-20,6],[-31,-24],[-26,12],[37,-144],[-20,-49],[-27,79],[-50,-57],[-23,-96],[3,-79],[-35,-3],[-15,-75],[8,-30],[-17,-51],[22,-66],[7,-59],[-32,-61]],[[55121,70525],[-20,43],[-40,5],[-50,90],[-43,47],[-12,63],[-16,-7],[-30,20],[-8,-22]],[[55236,75517],[-85,-12],[-46,-122],[-54,-31],[-34,-181],[-39,-11],[-10,-66],[-29,-2],[-22,-46],[-51,-34],[-34,0],[-57,44],[-41,-79],[-29,-106]],[[54705,74871],[-9,70],[-37,-2],[-28,43],[-62,21],[-25,-52],[-72,12],[-30,25],[-18,39],[-28,26],[-39,-10],[-19,28],[-29,13],[-41,49],[-21,2],[-28,-30],[-9,34],[-38,22],[-12,-36],[-6,-153],[-36,19],[-24,-59],[-5,-71],[-32,19],[-29,-9],[-45,-45],[-40,28],[-40,8],[-14,75],[-45,45]],[[53844,74982],[-30,83],[-17,-5],[-25,65],[-50,12],[-3,48],[-28,46],[-15,-4],[-62,138],[-17,27],[-41,-1],[-13,38],[-28,29],[-3,62],[-33,69],[-1,49],[-22,13],[-11,41],[40,99],[-14,52],[-33,30],[-47,63],[-2,62],[-13,29],[13,32],[36,-25],[50,113],[54,9],[32,36],[31,-33],[24,24],[10,39],[39,11],[14,54],[34,21],[27,-14],[22,54],[33,40],[46,-6],[45,69],[12,-11],[52,39],[6,20],[40,9],[3,26],[-38,35],[15,51],[37,-15],[42,-35],[14,-39],[-9,-53],[51,-25],[6,34]],[[54086,79606],[32,23],[68,-69],[23,-55],[-20,-66],[-33,12],[-71,56],[1,99]],[[53485,80149],[-8,-41],[14,-47],[4,-82],[27,-80],[-24,-53],[-54,40],[-46,-53],[-5,-78],[41,-22],[22,-35],[2,-47],[-26,-32],[-22,3],[-71,-58],[3,-28],[42,-8],[-16,-45],[12,-32],[-47,-26],[-48,40],[-29,93],[-86,38],[-43,-4],[-9,65],[-30,53],[23,13],[0,47],[-21,55],[0,64],[-36,79],[36,20],[39,-16],[30,31],[1,35],[40,36],[1,33],[54,25],[4,-40],[-29,-90],[63,-30],[6,59],[23,28],[-30,89],[91,95],[26,14],[63,-27],[29,-33],[-16,-48]],[[53207,79325],[31,52],[23,-3],[20,30],[70,1],[58,62],[52,-3],[24,-30],[-11,-26],[-47,12],[-102,-191],[0,-83],[-28,48],[-50,14],[-30,-6],[-34,-32],[-54,64],[-73,45],[28,51],[-21,56],[16,21],[47,11],[58,-81],[23,-12]],[[53024,81077],[39,34],[47,3],[-56,-76],[-30,39]],[[52815,79564],[-42,10],[-27,50],[1,47],[-17,30],[-1,51],[-35,51],[30,41],[34,-30],[52,49],[57,30],[51,-55],[40,33],[25,-67],[-16,-40],[30,-58],[7,-92],[-20,-117],[-31,-9],[2,-41],[53,-48],[-26,-134],[-25,62],[11,30],[-10,68],[-24,-13],[-25,66],[-77,15],[-17,71]],[[52616,79328],[-21,-20],[-29,33],[-53,16],[-28,22],[-61,-8],[-26,14]],[[52398,79385],[0,87],[14,70],[-7,78],[3,60],[-14,76],[-52,22],[-38,75],[-10,-35],[-52,31],[29,153],[-7,96],[26,-19],[32,11],[-16,117],[-43,37],[-8,145],[22,43],[-20,43],[-2,84],[14,80],[32,-60],[29,2],[35,-27],[-6,62],[-39,35],[-17,61],[-18,16],[36,123],[73,122],[34,-19],[65,42],[59,-14],[53,14],[42,44],[52,117],[21,66],[44,85],[39,-4],[121,73],[-29,-80],[31,-78],[-6,-61],[9,-112],[-28,-39],[-26,-116],[-25,-79],[4,-71],[24,-101],[-3,-66],[43,-41],[73,18],[19,-5],[31,-53],[-10,-82],[-47,-83],[-9,-61],[-58,96],[-18,14],[-62,-98],[16,-80],[-4,-98],[-14,-17],[-66,-5],[23,-42],[-7,-87],[-82,-28],[17,-47],[-47,-69],[19,-27],[-28,-32],[33,-111],[-5,-48],[-31,-3],[-23,-25],[23,-80],[45,28],[62,-55],[29,-93],[-38,-16],[-42,37],[-9,-48],[-51,30],[-41,-35]],[[52944,80101],[12,-81],[-26,-20],[-5,60],[19,41]],[[52855,79373],[67,-28],[-28,-29],[-39,57]],[[57721,83425],[-16,-39],[-81,-13],[-54,38],[-51,6],[-25,-20],[-14,-55],[-50,34],[-12,-30],[-40,-22],[-32,53],[-19,-49],[-101,-16],[27,-43],[-28,-18],[-23,35],[-21,-44],[-78,-20],[-36,-27],[-18,21],[-45,-7],[-72,-65],[-40,11],[-84,-107],[-45,4],[-14,21],[-92,-26],[-79,-59],[-89,-4],[-39,-28],[-9,-46],[-76,-3],[15,58],[-23,8],[-3,46],[36,3],[-1,82],[-64,-17],[1,-43],[-61,8],[-48,-14],[-5,60],[29,137],[-72,-61],[-34,65],[6,103],[-40,-12],[17,-50],[-55,10],[-12,64],[-98,111],[-3,35],[-26,33],[21,69],[-36,8],[-26,39],[52,98],[-20,60],[43,13],[2,44],[-20,30],[30,44],[21,59],[-17,66],[10,69],[32,19],[-34,89],[10,33],[-35,51],[-4,93],[-40,42],[19,139],[-11,45],[10,38],[-29,58],[-5,49],[-29,22],[-6,51],[27,33],[-33,25],[26,72],[-15,42],[34,35],[4,36],[40,9],[15,85],[40,60],[-52,73],[-40,-33],[-35,33],[-15,68],[16,20],[62,-39],[24,-46],[132,39],[28,55],[77,-20],[23,15],[-53,102],[68,13],[20,71],[-1,42],[45,39],[11,101],[68,5],[44,15],[11,29],[64,15],[-3,90],[49,-13],[24,70],[56,101],[17,6],[35,90],[89,86],[15,94],[42,43],[-4,66],[49,38],[114,32],[25,-32],[32,25],[-35,37],[36,21],[21,43],[-9,36],[-40,27],[21,109],[-17,25],[26,100],[-39,73],[-33,6],[-11,37],[-50,33],[-72,17],[-15,36],[-113,70]],[[57697,90256],[69,13]],[[56878,86581],[-31,10],[-26,58],[26,30],[63,2],[-15,-39],[15,-46],[-32,-15]],[[55973,83138],[18,27],[34,-4],[-7,-42],[-45,19]],[[57796,66112],[36,19],[14,-30],[-11,-27],[-17,-88],[-22,-83],[-36,-56],[-21,-72],[-20,-32],[-16,20],[8,120],[-16,46],[18,29],[12,62],[18,34],[53,58]],[[57499,66380],[21,53],[56,47],[22,-39],[-52,-39],[-15,-35],[-27,5],[-21,-56],[-5,55],[21,9]],[[57545,65661],[15,-34],[-19,-78],[24,-80],[-22,-46],[-12,74],[-14,39],[15,30],[13,95]],[[57499,67098],[17,-46],[-45,-25],[-8,-29],[-23,9],[-17,43],[-23,-6],[-13,43],[39,36],[31,-4],[9,-19],[33,-2]],[[57499,66506],[-20,25],[14,37],[19,-26],[-13,-36]],[[57499,65403],[-32,-52],[5,58],[27,-6]],[[57436,66662],[11,24],[20,-53],[-8,-23],[-23,52]],[[57231,69216],[-6,59],[-17,21],[-108,11],[-56,56],[-64,14],[-17,35],[-29,-51],[-26,-21],[-18,-41],[-50,9],[-21,68],[-42,-14],[-23,-48],[-2,-36],[-48,-58],[-19,-13],[-61,49],[-32,-25],[-11,-60],[13,-9],[26,-70],[-3,-64],[16,-49],[85,-37],[27,-72],[25,-39],[5,-40],[-24,-17],[-7,35],[-33,85],[-34,8],[-33,51],[-51,-7],[-12,-47],[24,-71],[38,-23],[21,-31],[8,-71],[-22,-56],[-43,93],[-4,35],[-33,78],[-35,9],[-38,27],[-15,-38],[8,-55],[15,-14],[26,-73],[46,-37],[0,-40],[-24,4],[-42,35],[-36,78],[4,82],[-6,26],[-44,31],[-66,76],[-26,88],[29,4],[17,33],[-8,49],[-58,-60],[-28,-15],[-11,-26],[5,-67],[11,-14],[-16,-65],[-15,-97],[13,-94],[31,-41],[8,-60],[32,-50],[15,-125],[8,-38],[45,-53],[5,-26],[45,-107],[20,-89],[-9,-31],[-28,-30],[-14,121],[-16,26],[-45,23],[-2,-33],[-33,-15],[12,-88],[28,-23],[18,-75],[-9,-44],[-68,-61],[-40,29],[-17,-23],[2,-31],[41,4],[20,-45],[15,9],[38,-31],[19,7],[22,-87],[24,33],[34,-30],[-6,-51],[31,-49],[29,-13],[31,43],[-33,34],[-4,33],[-82,143],[-32,3],[-25,31],[-9,-33],[-30,25],[40,28],[38,71],[21,-3],[20,24],[27,-22],[15,-38],[11,-85],[44,-58],[24,5],[11,-38],[56,-34],[22,14],[25,-10],[1,-58],[28,-45],[-12,-27],[-1,-64],[20,-79],[5,-63],[42,-39],[37,-2],[9,-58],[-9,-58],[-22,-17],[-8,35],[-31,-13],[-7,54],[-31,21],[2,64],[-25,51],[-18,102],[-44,-7],[-62,19],[2,-50],[25,-1],[51,-39],[27,-55],[2,-48],[-21,-23],[7,-102],[11,-46],[0,-58],[11,-18],[-18,-100],[-23,11],[-10,73],[-37,39],[-14,53],[-45,44],[3,59],[-33,-16],[-17,-36],[-40,1],[-29,-39],[-23,-6],[-14,-46],[30,0],[18,-33],[-17,-39],[15,-32],[-4,-56],[49,-66],[-6,61],[28,1],[-11,-49],[29,-48],[11,-38],[-30,-20],[-20,8],[-54,-83],[-19,53],[14,55],[-33,12],[-21,49],[-23,-10],[-26,48],[-10,-18],[10,-120],[17,-41],[25,-113],[-4,-34],[25,-45],[3,-69],[33,-143],[-22,-30],[0,-76],[32,-67],[-16,-65],[-15,60],[-18,-4],[-7,37],[-19,37],[-25,124],[-41,7],[-21,-25],[-24,-111],[-5,-118],[-18,10],[-8,153],[-19,97],[-20,57],[-23,25],[3,63],[-23,8],[-37,-28],[-4,-89],[10,-52],[-23,-49],[-19,59],[-22,-5],[-13,62],[8,41],[-37,85],[-3,73],[9,37],[20,31],[6,66],[-17,83],[-28,74],[-59,100],[-10,52],[-48,44],[5,68],[12,-8],[30,46],[21,81],[3,48],[27,17],[40,-37],[18,18],[30,100],[51,14],[41,-43],[29,-61],[34,-3],[15,-30],[28,0],[65,-72],[19,-47],[22,-26],[22,7],[-8,48],[4,46],[33,-16],[44,34],[-30,77],[-22,4],[-25,-21],[-39,66],[-24,23],[-6,34],[-26,-1],[-11,-51],[-15,72],[-13,33],[-15,-45],[-32,-20],[-26,0],[-39,41],[-33,8],[-28,-9],[-20,-45],[-33,18],[-38,-39],[-18,17],[-20,49],[-22,-36],[-41,-28],[-10,49],[2,55],[-28,69],[2,47],[-8,42],[-19,1],[-14,89],[-38,-47],[-3,-59],[-30,-34],[-17,59],[25,107],[25,15],[4,52],[44,-2],[20,17],[11,-35],[20,-14],[14,28],[3,56],[-9,33],[-37,-18],[-76,16],[-64,125],[-4,48],[-36,4],[-30,94],[8,67],[-30,23],[11,53],[-51,55]],[[55827,69304],[78,4],[28,14],[16,28],[30,-5],[19,-32],[25,54],[27,-9],[5,34],[32,54],[16,56],[26,19],[18,-24],[34,31],[20,-20],[39,-15],[41,10],[15,40],[22,-17],[6,117],[44,9]],[[57269,68223],[15,27],[35,-1],[20,-33],[-13,-41],[43,-77],[21,-116],[-52,-35],[-57,41],[-13,-4],[-17,42],[50,64],[-9,32],[-25,-8],[-26,-76],[-32,13],[-29,49],[3,56],[56,29],[30,38]],[[57284,66997],[-2,-49],[-30,-11],[-12,-26],[-25,9],[23,68],[46,9]],[[56603,65547],[2,-48],[60,-26],[50,55],[7,-35],[-10,-31],[26,-31],[2,-67],[27,-5],[51,16],[28,32],[25,4],[27,-13],[58,-8],[1,-36],[53,-10],[37,6],[19,-34],[63,40],[18,-5],[-1,-151],[24,-15],[21,51],[30,13],[8,22],[37,-23],[29,50],[4,-113],[-13,-51],[-38,-30],[-33,31],[-51,-30],[-30,12],[-50,-23],[-36,12],[-33,-27],[-128,-27],[-13,12],[3,56],[-10,53],[-45,7],[-50,66],[-27,-14],[-23,18],[-49,-2],[-8,22],[-31,8],[-84,-3],[-16,42],[12,94],[-4,31],[16,38],[30,-10],[15,77]],[[57178,67656],[2,15],[43,20],[23,-35],[20,-2],[-7,-94],[7,-78],[-15,-28],[-2,-47],[-28,-38],[-30,48],[-5,32],[24,20],[11,34],[-16,86],[-22,22],[-5,45]],[[57211,66464],[-27,-76],[-6,46],[33,30]],[[57070,69024],[30,34],[27,-12],[10,-51],[-38,-18],[-29,47]],[[57069,66642],[24,44],[17,-61],[-12,-109],[-33,-33],[-18,77],[0,46],[22,36]],[[56959,68681],[50,15],[16,-47],[22,46],[20,-12],[-29,-78],[0,-69],[-28,52],[-50,-9],[-1,102]],[[57016,66355],[13,37],[22,-44],[-8,-62],[-27,69]],[[57007,66626],[12,-51],[-25,-52],[-17,14],[-3,49],[10,33],[23,7]],[[56939,67009],[13,18],[31,-34],[31,-15],[-7,-54],[-18,-2],[-50,87]],[[56857,67228],[14,22],[24,-17],[4,-36],[32,-10],[-3,-38],[15,-65],[-19,-43],[-45,128],[-16,-3],[-6,62]],[[56827,69236],[19,30],[35,-38],[3,-87],[-36,-38],[-40,64],[19,69]],[[56849,66543],[12,11],[18,-50],[-17,-32],[-13,71]],[[56816,67937],[10,-48],[30,-52],[-21,-26],[-18,45],[-31,33],[16,70],[14,-22]],[[56787,66340],[21,34],[10,-47],[-14,-26],[-46,-10],[1,55],[28,-6]],[[56788,66666],[26,14],[-4,-53],[-22,39]],[[56769,66848],[27,0],[-7,-58],[-20,58]],[[56754,67013],[26,-11],[-32,-86],[-7,64],[13,33]],[[56562,68084],[7,14],[37,-47],[-16,-26],[-19,15],[-9,44]],[[56508,67072],[10,24],[27,-3],[-28,-64],[-9,43]],[[56363,66045],[21,10],[32,-52],[-12,-22],[-1,-49],[-29,3],[-13,54],[2,56]],[[55729,67168],[20,42],[18,-63],[39,-29],[5,-49],[-22,-27],[-36,19],[-24,69],[0,38]],[[55705,67552],[24,-46],[0,-63],[23,-22],[30,-83],[-6,-33],[-26,3],[-22,34],[-19,-18],[-32,50],[-28,13],[5,58],[15,59],[18,-24],[20,34],[-2,38]],[[55731,67572],[12,-39],[19,-4],[-9,-54],[-22,97]],[[55462,68539],[36,3],[15,23],[30,-34],[-8,-30],[-23,-20],[1,-42],[20,-21],[-2,-50],[6,-54],[27,-27],[15,-50],[-61,65],[-10,85],[-41,72],[-12,57],[7,23]],[[54883,70799],[-29,32],[-37,87],[-49,52],[-25,41],[-36,89],[-21,28],[-64,30],[-34,44],[-45,37],[-49,-32],[-18,-26],[-32,13],[-19,40],[-4,55],[9,23],[-45,70],[-24,12],[-21,54],[-44,52],[-30,71],[-21,34],[-33,81],[14,78],[36,0],[17,24],[-34,31],[-52,109],[-30,44],[-26,90],[-4,66],[13,114],[-24,115],[-46,26],[-3,-42],[43,-78],[-32,-27],[-74,88],[24,41],[10,109],[-26,32],[-39,26],[-15,-49],[-10,-85],[-21,-68],[2,-68],[-33,-29],[-19,-68],[-32,-24],[-13,33],[-15,89],[-36,64],[-14,90],[0,75],[-12,21],[-10,127],[22,-20]],[[53773,72620],[25,-25],[25,17],[14,-23],[71,37],[20,-8],[29,21],[23,-23],[47,55],[4,42],[23,15],[23,-28],[38,-92],[45,28],[49,-53],[19,0],[41,51],[-19,28],[1,69],[28,13],[-30,75],[78,67],[15,-13],[21,66],[2,97],[-31,39],[0,36],[19,46],[29,-10],[4,34],[58,34],[42,70],[42,-19],[-17,86],[32,35],[67,-51]],[[54610,73336],[30,-50],[44,-37],[7,-54],[23,-39],[52,-39],[28,-112],[26,-53],[57,-2],[29,-71],[33,-16],[20,-25],[41,8],[22,-20],[31,16],[14,-18],[46,-17],[41,40],[20,57],[21,32],[29,-11],[23,13]],[[55247,72938],[-9,-42],[33,-86],[-1,-62],[-21,-60],[14,-28],[11,-60],[-3,-56],[28,-22],[9,-33],[38,-35],[48,-9],[0,-49],[-65,1],[-22,-63],[-1,-49],[11,-50],[-43,-25],[9,-36]],[[55121,70525],[0,-52],[24,-45]],[[55145,70428],[-81,99],[-1,31],[-72,79],[-45,68],[-22,-11],[-80,56],[-62,80],[-42,2],[0,27],[57,-8],[48,-42],[2,-19],[55,-26]],[[54814,70685],[14,6],[58,-26],[-8,-20],[-64,40]],[[54623,70825],[11,14],[48,-26],[50,15],[26,-11],[-2,-40],[-43,13],[-21,-20],[-62,20],[-7,35]],[[54594,70994],[32,5],[12,-40],[77,-8],[-2,-27],[-51,10],[-30,-4],[-75,44],[37,20]],[[54567,71109],[28,12],[66,-21],[32,-34],[-14,-29],[-44,-9],[-48,11],[-25,26],[5,44]],[[54461,70874],[12,23],[36,1],[-3,-38],[-34,-12],[-11,26]],[[54108,72011],[34,-15],[40,-95],[51,-89],[-24,-40],[-15,22],[4,38],[-21,19],[-69,160]],[[53970,72346],[18,-5],[11,-52],[21,-43],[-8,-59],[19,-166],[-34,38],[1,37],[-16,47],[-10,88],[26,23],[-28,92]],[[55628,73085],[-22,24],[-34,-10],[-35,22],[-33,-35],[-33,43],[-36,-6],[-18,-27],[-24,-69],[-15,5],[-22,-40],[-38,0],[-12,31],[-39,-82],[-20,-3]],[[54610,73336],[-21,21],[-4,43],[-32,49],[-3,47],[-18,40],[8,61],[-15,24],[-49,-3]],[[54476,73618],[45,85],[52,32],[0,48],[14,36],[-24,25],[17,69],[-12,90],[18,-7],[42,42],[12,49],[-15,71],[-22,-2],[-42,32],[60,66],[23,-15],[8,-39],[45,5],[44,29],[7,174],[18,26]],[[54766,74434],[24,8],[25,-18],[33,-78],[42,-44],[28,-47],[21,-13],[84,12],[57,-18],[40,18],[65,5],[35,43],[-10,68],[21,93],[50,21],[63,-17],[17,25],[27,-4],[27,20],[8,67],[29,33],[47,-40],[4,-19],[45,-1],[26,16],[50,65],[10,-12],[35,77],[2,36],[24,50],[-1,27],[43,24],[50,16],[34,-44],[30,3],[17,-24],[56,48],[50,-3],[32,-64],[25,-78],[34,-16],[51,41],[38,8]],[[52091,71406],[-8,65],[17,19],[39,101],[-8,56],[3,38],[-91,-41],[-80,83],[-17,2],[-31,101],[-11,112],[31,63],[-6,24],[23,55],[-6,79],[-40,7],[-31,40],[4,39],[-26,43],[-13,58],[39,42],[22,-17],[33,52],[29,1],[19,33],[-6,52],[19,57],[-36,63],[-15,7],[-3,87],[-50,70],[2,80],[50,26],[13,36]],[[51956,72939],[21,-45],[44,30],[29,-4],[47,65],[32,-9],[19,-36],[38,-3],[10,55],[23,0],[12,75],[21,8],[16,46],[-24,59],[16,31],[48,54],[16,54],[27,-7],[0,-78],[-11,-26],[12,-46],[17,-11],[23,-69],[36,0],[31,-43],[-13,-29],[33,-84],[2,-31],[27,-26],[15,51],[-17,29],[-2,81],[16,49],[34,44],[29,106],[-7,67],[2,55],[50,1],[-2,-57],[24,-81],[48,-9],[17,30],[37,32],[24,-26],[0,-42],[14,-40],[36,18],[-19,69],[17,41],[-36,28],[4,61],[21,53],[27,17],[5,-37],[26,-25],[37,0],[5,52],[-23,14],[-1,71],[12,20],[7,67]],[[52908,73608],[24,-11],[30,25],[36,-60],[26,-20],[37,2],[26,119],[14,24],[43,19],[24,-20],[20,34],[17,-20],[24,21],[28,-29],[57,47],[70,39],[6,-47],[-24,-15],[25,-92],[16,7],[12,-73],[37,-70],[35,-26],[63,-7],[10,-23],[72,-7],[62,-34],[31,3],[80,-24]],[[53809,73370],[-6,-57],[-28,-6],[-7,-27],[-36,-31],[-12,-64],[8,-22],[59,-31],[3,-39],[-42,-56],[-5,-38],[14,-28],[32,11],[-15,-72],[2,-52],[21,-7],[36,-43],[33,-78],[-22,-35],[-33,9]],[[53811,72704],[13,42],[-38,81],[-20,9],[-8,-40],[-27,-34],[-15,37],[-44,32],[-42,-42],[8,-56],[-50,-16],[-50,-57],[-72,-61],[13,50],[-44,-3],[-31,-39],[1,-29],[-25,-22],[-5,-58],[27,-89],[23,-14],[-11,-60],[33,-31],[24,-48],[-5,-75],[-22,17],[-2,-74],[-30,39],[-13,-99],[12,-79],[-2,-72],[22,-154],[11,-46],[38,-85],[44,-77],[61,-46],[26,-47],[78,-127],[41,-45],[28,2],[26,-50],[0,-33],[24,-120],[19,-74],[19,-101],[5,-61],[23,-155],[13,-61],[32,-104],[27,-60],[56,-87],[31,-79],[54,-52],[8,-64],[45,-47],[25,-10],[40,-57],[56,-6],[15,-12],[69,18],[33,-6],[66,20],[24,-4],[25,-39],[4,-80],[-35,-57],[-46,-58],[7,-87],[18,-36],[77,-83],[24,-14],[64,-71],[118,-87],[11,-4],[64,-78],[54,-101],[64,-51],[38,-49],[47,-35],[8,-57],[24,-50],[35,-40],[50,-110],[25,-127],[-24,-59],[-12,-84],[-6,-82],[-46,33],[-35,48],[-23,63],[4,82],[-25,61],[-3,43],[-15,23],[-54,13],[-42,-6],[-77,76],[6,32],[-39,53],[-24,-10],[-35,-51],[-31,-94],[-28,-112],[-23,-49],[0,-107],[-31,-85],[8,-107],[23,-27],[47,-4],[25,-57],[42,-38],[11,-35],[28,-26],[-12,-61],[-1,-49],[11,-30],[-10,-80],[21,-53],[-5,-49],[-19,-34],[-39,24],[-59,-39],[-41,-54],[-18,-72],[5,-36],[8,-147],[-34,-83],[-36,-28],[-47,-121],[-5,-70],[-23,-77],[-83,-6],[-24,29],[-6,52],[-5,145],[44,35],[30,114],[7,79],[-23,45],[2,36],[36,42],[34,-7],[22,26],[10,71],[0,51],[-18,26],[-15,51],[-9,77],[-4,112],[-17,112],[-33,78],[-16,89],[-7,131],[-35,128],[-26,28],[-19,-10],[-24,-53],[-37,31],[-6,35],[-36,64],[-18,-5],[-21,39],[-21,13],[20,129],[-32,126],[-32,61],[-18,-31],[-18,10],[-27,-30],[-13,15],[-43,-39],[42,91],[-58,104],[-32,-19],[-31,24],[-13,72],[-21,53],[-10,52],[-21,62],[-29,49],[-36,-7],[-7,-26],[-50,53],[-21,11],[-36,-16],[-34,-34],[-17,76],[-41,59],[-19,-5],[-28,35],[-12,-9],[-25,79],[-48,98],[-36,36],[-13,86],[-12,39],[-61,87],[-24,-6],[-28,90],[-11,59],[-20,46],[-51,58],[-77,39],[8,55],[-21,40],[-8,41],[-20,21],[-13,52],[-54,39],[-2,95],[-47,28],[-21,-22],[5,150],[-3,76],[-29,116],[-26,54],[-9,43],[-7,157],[-9,83],[-16,51],[-32,62],[-31,10],[-16,30],[-50,24],[-97,128],[-36,35],[-137,60],[-68,-74],[-14,-26],[-8,-68],[-42,-37],[-27,-135],[-30,-46],[-109,-81],[-40,6]],[[53899,66617],[-29,-8],[-30,35],[-21,4],[-24,31],[-31,67],[-20,1],[-58,73],[-28,74],[-42,2],[-22,56],[-40,6],[-34,-15],[-19,58],[-37,44],[-4,147],[13,74],[15,38],[42,32],[22,1],[29,-62],[51,46],[-6,31],[14,43],[22,-16],[37,40],[11,-23],[7,-61],[42,-1],[2,-34],[56,-63],[25,8],[55,42],[54,-22],[39,3],[77,46],[29,63],[40,5],[43,-15],[12,-23],[23,22],[15,42],[20,-1],[42,31],[20,33],[25,-17],[-38,-158],[-49,-135],[-26,-93],[-8,-114],[-25,-68],[5,-122],[32,-25],[-10,-51],[11,-55],[22,-35],[-10,-55],[-31,-63],[-17,-95],[13,-70],[-17,-26],[-19,39],[-31,18],[-30,-17],[-29,13],[-15,30],[-39,16],[-30,120],[-24,59],[-41,43],[-31,7]],[[53333,66413],[15,-43],[-17,-17],[-18,46],[20,14]],[[52873,70697],[-58,-46],[-4,51],[27,-7],[17,21],[18,-19]],[[52681,68371],[-3,-77],[-16,-69],[5,-41],[-9,-34],[-1,-70],[-13,-22],[-24,7],[-38,63],[-57,-3],[-23,-61],[10,-47],[-21,-73],[-32,-57],[-34,39],[-17,-17],[-27,50],[0,39],[-39,70],[-19,71],[17,31],[-8,47],[-4,85],[25,104],[-8,113],[19,-16],[13,57],[-9,61],[-36,2],[4,99],[23,33],[-10,46],[6,97],[-23,38],[0,65],[-29,117],[-26,-16],[-15,38],[16,39],[-19,37],[27,129],[23,-47],[49,-18],[24,12],[33,54],[20,3],[19,28],[17,55],[31,64],[28,10],[17,30],[1,49],[14,10],[24,-49],[30,-9],[41,-45],[-12,-58],[20,-10],[-8,-56],[33,-78],[-4,-37],[22,-73],[1,-60],[20,-48],[-20,-106],[-34,-76],[-2,-49],[17,-69],[12,-15],[-12,-78],[-3,-195],[-7,-38],[1,-75]],[[52321,68015],[30,-5],[-17,-54],[-13,59]],[[53470,71501],[6,53],[-31,-26],[25,-27]],[[53459,70059],[-2,-3],[2,-1],[0,4]],[[55720,70038],[37,-9],[13,39],[-7,77],[12,41],[28,10],[14,29],[61,42],[24,-74],[31,93],[30,41],[33,-12]],[[55996,70315],[30,-22],[43,67],[27,13],[33,-33],[54,49],[27,-39]],[[55394,70363],[-12,-34],[-52,-46],[15,-57],[39,-43]],[[55383,70124],[-2,-16],[2,-9],[-8,-3],[-1,-13],[5,-8],[1,-5],[-2,-17],[2,-17],[-10,-5],[-4,9],[-44,44],[-6,74],[-65,127],[-7,42],[-33,0],[-17,60],[-3,82],[-46,-41]],[[55340,71222],[-1,-32],[38,-52],[25,-16],[22,-51],[5,-51],[20,-11],[18,-45],[24,-2],[6,-30],[56,-51],[36,-64],[14,7],[48,-46],[2,-54]],[[55653,70724],[-15,2],[-24,-65],[-32,22],[-20,-8],[-1,-37],[25,-42],[-9,-71]],[[55996,70315],[-15,69],[31,35],[-6,32],[19,36],[12,72],[15,34],[-11,36],[-21,-9],[-55,42],[-20,-1],[8,91],[-46,29],[-25,62],[-12,82],[-47,8],[-36,43],[13,27],[-17,36],[-57,-49],[19,-58],[-4,-61],[-25,-18],[-26,-61],[14,-28],[-27,-40],[-24,0]],[[54766,74434],[-26,17],[7,49],[-32,52],[-23,101],[-14,27],[2,70],[29,70],[-4,51]],[[54476,73618],[-36,-30],[-10,-100],[-20,23],[-30,-15],[-49,-7],[-23,-52],[-27,28],[-49,-12],[-35,15],[-26,-14],[-11,-28],[-31,2],[-13,-68],[-29,-7],[-11,-35],[-38,-28],[-30,25],[-34,-12],[-42,3],[-10,30],[-32,4],[-34,29],[-25,-12],[-22,13]],[[52908,73608],[5,60],[-37,38],[-34,-90],[-35,-18],[-22,39],[-42,30],[4,37],[-31,36],[-48,15]],[[52668,73755],[4,65],[-25,86]],[[52647,73906],[40,85],[-30,74],[-3,38]],[[52654,74103],[43,-15],[29,16],[40,-9],[41,-76],[3,-38],[33,-1],[-7,-48],[38,6],[35,84],[-12,51],[46,47],[43,-23],[39,0],[25,-77],[37,-25],[25,28],[24,-5],[40,64],[38,-1],[10,48],[66,0],[46,30],[55,-7],[-7,62],[50,-12],[18,9],[23,-51],[25,34],[36,5],[21,-50],[-3,-38],[57,-67],[13,21],[-1,65],[14,32],[-14,61],[-31,-3],[2,55],[17,49],[-70,184],[34,66],[21,3],[19,34],[48,30],[17,-2],[45,58],[13,100],[19,53],[56,-53],[22,51],[9,134]],[[51616,75538],[-49,2],[-46,-36],[-15,71],[-43,70],[-29,-2],[-20,51],[-59,20],[-8,43],[11,41],[-28,35],[14,58],[-4,87],[-34,-47],[-5,-70],[-29,-10],[-38,-33],[-30,19],[-39,3],[-16,38],[26,38],[-20,91],[17,41],[-54,72],[-33,-22],[-19,19],[-48,-5],[-1,79],[-15,28],[-78,8],[-24,115],[-26,88],[-58,-33],[-11,-36],[-31,25],[-19,60],[-24,0],[-8,52],[7,41],[-24,105]],[[50706,76644],[58,53],[90,99],[81,48]],[[50935,76844],[3,-67],[19,-24],[40,45],[57,-34],[2,-33]],[[51056,76731],[1,2]],[[51057,76733],[22,-9],[51,35],[46,71]],[[51176,76830],[10,19]],[[51186,76849],[33,24],[15,43],[26,10],[10,-36],[27,-4],[23,52],[24,-15],[-3,-41],[28,-18],[41,54],[-2,-56],[48,-63],[-5,-27],[53,-4],[20,27],[20,-56],[27,-26],[30,-1],[25,-28],[-27,-80],[-12,-90],[-20,-26],[14,-43],[32,-40],[22,10],[37,-11]],[[51672,76404],[26,-23],[19,-65],[22,-15],[-23,-50],[14,-32],[39,-29],[-8,-54],[18,-41],[-30,-14],[-6,-27],[-28,-22],[-11,-76]],[[51704,75956],[-9,29],[-37,3],[-32,-83],[-6,-59],[-27,-57],[5,-76],[36,-58],[6,-51],[-24,-66]],[[51956,72939],[-9,54],[-59,99],[1,48],[17,58],[-22,35],[10,68],[-38,19],[-45,2],[-52,-38],[-32,-66],[21,-61],[-46,-62],[-46,3],[0,38],[39,63],[18,58],[-20,31],[-7,40],[24,58],[-13,22],[47,82],[44,51],[7,92],[-9,28],[56,49],[30,80],[60,97],[29,71],[-27,11],[-7,53],[13,43],[43,7],[8,-43],[24,-13],[36,5],[35,47],[-2,34],[24,33]],[[52108,74135],[29,-41],[54,39],[6,-27],[31,0],[66,47],[19,-32],[38,1],[16,52],[-33,38],[23,54],[32,22],[54,-50],[28,-62],[34,28],[70,-22],[79,-79]],[[52647,73906],[-13,-65],[9,-67],[25,-19]],[[52108,74135],[-18,50],[1,87],[8,70],[18,69],[-14,40],[1,61],[25,76],[39,266],[83,166],[25,95],[-64,62],[-27,-7],[-83,33],[-37,72],[-20,-6],[-18,-39],[-68,-4],[-7,42],[-31,37],[-23,-51],[-34,27],[-14,67],[-20,29],[-1,44],[-14,37],[-30,30],[-17,-6]],[[51768,75482],[-2,74],[18,66],[23,38],[3,63],[-32,11],[-39,43],[-42,129],[7,50]],[[51672,76404],[-1,66],[21,51],[-21,12],[-22,73],[56,98],[-19,50],[43,84],[-4,110],[-33,67],[-18,86],[-23,70],[31,20],[30,-8],[32,24],[23,-28],[89,59],[11,-15],[29,69],[-39,34],[20,56],[27,1],[37,77],[23,89],[-17,56],[-87,41],[12,114],[87,-1],[5,119],[30,94],[9,50],[-1,166]],[[52002,78188],[9,64],[-50,2],[-17,16],[7,93],[17,61],[44,70],[32,12],[44,-11],[52,23],[57,11],[30,-5],[41,-119],[-29,-28],[11,-43],[28,-31],[22,8],[9,74],[-20,46],[28,22],[11,-27],[36,-16],[-8,102],[20,96],[36,45],[25,-39],[37,-6],[89,43],[-68,3],[-22,31],[-14,50],[6,29],[31,8],[-16,51],[-34,34],[9,57],[-28,27],[-18,77],[62,9],[-7,83],[4,42],[-37,68],[-21,78],[-20,37],[8,50]],[[52616,79328],[48,8],[56,-34],[23,-30],[22,18],[21,-89],[-5,-130],[34,7],[27,-49],[24,14],[89,-62],[12,-27],[30,1],[38,49],[42,0],[-20,44],[15,66],[50,-29],[20,-66],[-55,2],[-12,-45],[6,-102],[-56,-75],[-25,-4],[-14,-38],[13,-31],[38,-20],[26,27],[44,7],[25,-59],[17,19],[30,-37],[0,83],[32,5],[34,90],[47,-6],[75,28],[16,35],[48,56],[41,117],[52,-30],[-48,-42],[-22,3],[-22,-54],[34,1],[22,51],[43,21],[27,-38],[24,36],[36,26],[23,-98],[30,-43],[19,-4],[14,-49],[39,-35],[61,22],[31,-34],[-14,-61],[77,-47],[1,43],[-29,11],[-45,-6],[11,58],[58,-33],[57,-89],[-3,-45],[-54,2],[-40,-35],[26,-34],[43,-25],[41,2],[-1,-30]],[[53673,79168],[18,46],[48,-74],[48,11],[9,-47],[-27,-36],[13,-49],[38,-42],[-70,0],[-49,-76],[-35,24],[-24,44],[12,64],[1,89],[39,7],[15,19],[26,-75],[15,51],[-33,24],[-3,24],[-26,-36],[-15,32]],[[52345,79228],[-5,38],[44,-1],[-5,-46],[-34,9]],[[52322,79450],[1,-91],[-21,3],[20,88]],[[52400,66499],[-4,-60],[12,-29],[-27,-32],[-40,-10],[16,-44],[-19,-54],[-37,-61],[-30,-17],[10,-48],[54,-17],[-7,-90],[-21,-97],[9,-22],[-21,-139],[0,-148],[26,-44],[-1,-148],[-11,-62],[6,-70],[33,-44],[-15,-65],[-12,-21],[-13,-103],[-16,-27],[9,-80],[1,-61],[-15,-31],[2,-33],[-26,-69],[-29,-30],[-34,-55],[-18,-7],[-4,-57],[-13,-85],[-20,-30],[-19,23],[-14,-63],[-21,-34],[7,-32],[-9,-81],[7,-50],[-6,-28],[18,-33],[0,-73],[10,-54],[32,-107],[19,-151],[93,-93],[-11,-25],[60,-162],[10,-231],[199,-298],[25,-243],[85,-850],[24,-239]],[[52654,61685],[-46,-44],[7,-90],[34,-99],[68,-342],[25,-286],[9,-193],[-20,-339],[37,-289],[-6,-32],[0,-76],[-14,-87],[-8,-79],[-13,-26],[-10,-139],[13,-118],[9,-124],[19,-54],[-8,-82],[3,-70],[-14,-93],[-98,-97],[-30,-133],[105,-364],[69,-239],[4,-286],[15,-50],[35,-172],[22,-35],[15,-46],[52,-1],[19,29],[29,-1],[14,-45],[19,44],[33,-29],[26,-75],[24,-23],[80,-137],[51,46],[104,-519],[5,-18]],[[53332,56872],[-176,-259],[-154,-228],[-168,-250],[-200,-304],[-212,-327],[-131,-202],[-220,-346],[-166,-361],[-105,-231],[-186,-412],[-197,-97],[-232,-116]],[[51185,53739],[-253,-130],[-33,70],[-32,45],[23,129],[-8,38],[9,53],[14,7],[-8,103],[6,178],[-15,5],[-35,49],[-33,32],[-34,5],[-26,22],[-9,48],[-32,-14],[-33,51],[-7,-36],[-39,118],[0,38],[-27,26],[-21,-55],[-26,18],[-33,-30],[-14,53],[-19,-2],[-37,79],[0,90],[-18,46],[-69,58],[-8,38],[-45,8],[8,170],[-11,110],[-112,194],[-186,317],[-115,197],[-116,195],[-185,312],[-162,270],[-139,230],[-139,229],[-139,228],[-231,376],[-139,229]],[[48657,57936],[-232,369],[-139,219],[-185,289],[-185,287],[-139,214],[-185,282]],[[47592,59596],[0,252]],[[47592,59848],[0,303],[0,448],[61,62],[33,82],[34,58],[10,2],[48,78],[19,45],[41,66],[39,31],[14,53],[27,-10],[43,22],[26,61],[41,38],[27,-22],[62,-32],[22,39],[22,12],[26,-6],[11,24],[89,22],[26,-15],[76,37],[21,-14],[-8,-48],[38,-29],[15,2],[64,199],[2,49],[20,59],[87,158],[93,107],[77,173],[49,39],[45,7],[41,24],[54,50],[-3,110],[20,28],[13,68],[-3,48],[-31,29],[-3,43],[-31,53],[6,86],[26,22],[0,183],[234,118],[-5,63],[-24,98],[3,53],[12,11],[78,1],[16,25],[25,9],[50,0],[36,-15],[35,26],[32,-9],[83,-49],[25,7],[71,-20],[28,25],[-25,67],[-2,34],[17,112],[34,31],[19,47],[-76,128],[-31,32],[-45,156],[14,6],[8,57],[-31,74],[-26,97],[2,67],[11,51],[6,120],[-13,44],[-16,0],[-7,41],[16,28],[-8,69],[15,171],[-17,82],[1,61],[-21,63],[26,71],[-14,11],[-28,77],[24,97],[-38,39],[-23,52],[-67,120],[0,28]],[[49385,65168],[16,11],[26,-22],[44,10],[34,24],[22,43],[12,-1],[29,67],[38,21],[34,37],[10,31],[21,134],[10,5],[43,66],[15,35],[13,-16],[27,41],[39,-39],[41,56],[10,71],[28,16],[21,-24],[5,-40],[50,-20],[32,46],[29,125],[61,117],[19,12],[49,53],[19,33],[26,3],[33,28],[18,53],[69,49],[37,2],[7,24],[48,-16],[39,19],[73,14],[23,-7],[31,13],[66,44],[21,-35],[33,-4],[29,20],[47,66],[23,58],[31,20],[21,-50],[18,-5],[39,37],[57,-17],[53,55],[8,23],[50,32],[17,-19],[70,-3],[24,11],[30,-12],[91,-6],[8,8],[92,-84],[0,-55],[24,-28],[31,-17],[52,21],[22,38],[4,32],[38,40],[24,-10],[66,31],[57,51],[8,76],[28,36],[29,8],[28,-43],[1,-35],[28,-23],[57,-11],[14,-37],[44,29],[12,-9],[23,33],[11,49],[-16,38],[87,-24],[31,-58],[27,-4],[15,-64],[21,-17],[36,9],[61,61],[24,-18],[21,5],[18,-19],[60,33]],[[52610,70033],[1,-127],[-17,-96],[-33,-132],[-35,27],[-16,41],[-51,34],[-20,49],[37,75],[-38,14],[-20,21],[19,62],[2,71],[-48,-12],[13,74],[24,22],[-11,51],[-33,28],[-1,66],[30,14],[-17,49],[-20,29],[28,32],[3,57],[17,47],[43,49],[36,8],[31,65],[27,3],[18,-44],[16,45],[-8,77],[11,52],[-3,59],[31,-18],[10,-129],[-12,-78],[24,-101],[-1,-116],[8,-72],[-7,-138],[-33,-96],[-5,-62]],[[52091,71406],[-25,-26]],[[52066,71380],[-7,-10],[1,-7]],[[52060,71363],[-44,-22],[-31,-33],[-6,-53],[-51,-38],[-7,-52],[-17,-27],[-29,7],[-20,-102],[-4,-48],[-48,-44],[-81,-25],[-21,-26],[-42,21],[-18,-6],[-60,31],[-1,25],[-33,-3],[-34,26],[-20,35],[-10,62],[-31,-12],[-52,-1],[-20,71],[-30,-14],[1,-49],[-51,5],[-30,15],[2,46],[-14,16],[-86,6],[-24,16],[1,31],[-26,22],[-45,-37],[-24,-47],[-40,-37],[-39,-82],[-22,11],[-42,-35],[-32,-61],[-22,-70],[-13,-84],[6,-16],[-6,-79],[-1,-130],[4,-61],[24,-18],[10,-59]],[[50881,70438],[-24,-6],[-15,35],[-54,-11],[-11,-26],[-23,-2],[-15,-31],[-45,-25],[-24,35],[-44,34],[-35,-19],[-32,-43],[-15,51],[-43,48],[-22,10]],[[50479,70488],[13,55],[-10,22],[-72,28],[-10,-34]],[[50400,70559],[-23,83],[-54,-7],[-23,54],[-42,3],[-20,27],[-42,25],[-16,-57],[5,-66],[-33,8],[-31,-8],[-21,25],[-18,-37],[-31,45],[-51,-36],[-18,6],[-32,66],[-39,41],[-20,-31],[-33,18],[-10,-23],[-52,74],[-5,51],[-54,-10],[-20,29],[-33,10],[-26,34],[-31,19],[-4,-38],[-24,13],[-8,33],[15,25],[9,90],[-41,29],[-45,13],[-25,27]],[[49504,71094],[3,18],[40,28],[23,57],[28,107],[2,46],[36,326],[16,237],[-2,24],[18,96],[45,-4],[-6,38],[-31,44],[-25,-52],[9,115],[17,317],[1,123],[25,30],[73,-118],[19,-120],[18,0],[-16,129],[-27,91],[-60,95],[-55,62],[1,60],[27,24],[16,55],[5,107],[-30,66],[-16,99],[-39,48],[-28,-1],[-13,43],[-21,4],[-62,61],[-12,83],[-23,58],[-55,91],[-4,52],[48,98],[-20,49],[-32,49],[-3,87],[-34,-36],[-47,55],[-22,41],[29,50],[-2,49],[-19,14],[-40,-7],[-41,-22],[-12,42],[35,5],[5,30],[-28,21],[-38,-9],[-9,-23],[-39,-4],[-25,51],[-37,46],[-31,-4],[-20,47],[-85,21],[-39,41],[-42,7],[-26,-52],[-41,3],[6,32],[-21,87],[-24,31],[-52,15],[1,25],[89,36],[18,-16],[9,48],[-8,30],[-44,30],[-28,-5],[-1,39],[39,3],[1,76],[-51,-42],[-43,29],[-9,26],[11,92],[37,23],[21,38],[23,0],[33,35],[19,-20],[25,27],[35,1],[19,26],[16,-48],[38,40],[59,-31],[0,74],[12,36],[30,-19],[32,28],[32,0],[20,20],[32,-38],[0,-32],[52,-79],[4,-33],[26,-57],[23,-5],[25,53],[60,53],[36,-64],[14,37],[84,49],[1,-61],[37,-7],[29,21],[24,-3],[5,37],[-20,49],[4,181],[-14,67],[2,77],[-27,76],[-30,44],[-12,98],[-2,101],[-24,19],[1,34],[64,-33],[25,-25],[28,10],[41,36],[23,-10],[17,-51],[-22,-51],[40,-102],[26,-13],[41,1],[24,-24],[65,-14],[53,-2],[28,-25],[45,-10],[44,30],[33,52],[10,37],[-27,42],[27,125],[46,41],[68,76],[60,18],[65,30],[50,39],[69,99],[25,75],[-1,61],[11,191],[-5,97],[13,49],[-8,61],[42,61],[52,32],[95,44],[47,9],[32,23]],[[51616,75538],[13,-34],[20,1],[29,-38],[23,30],[37,14],[30,-29]],[[49614,72972],[39,16],[17,-75],[-3,-40],[-53,99]],[[49572,73145],[68,-16],[-3,-32],[-43,43],[-22,5]],[[49094,73964],[29,8],[22,-55],[-41,5],[-10,42]],[[54017,65779],[32,-51],[-17,-43],[-22,14],[-28,38],[4,68],[31,-26]],[[53773,72620],[38,84]],[[52400,66499],[53,23],[34,63],[19,54],[34,30],[20,44],[10,-17],[45,39],[11,-6],[56,51],[24,10],[33,-10],[4,-46],[-26,-23],[9,-69],[27,11],[18,65],[25,15],[35,-43],[-14,-56],[16,-18],[-6,-48],[6,-37],[42,-80],[-19,-62],[16,-41],[19,-11],[35,29],[14,77],[33,12],[52,83],[4,35],[36,23],[28,-145],[-32,-64],[-28,-93],[-31,-143],[-71,-54],[-17,-72],[-7,-99],[4,-59],[35,-135],[20,-59],[18,-18],[28,3],[4,-61],[52,-41],[-4,-61],[8,-25],[-8,-92],[3,-38],[24,-56],[-13,-63],[-15,-30],[-6,-74],[-22,-32],[-2,-62],[-21,-64],[-25,-50],[-6,-51],[-25,-16],[-14,-67],[-44,-34],[-16,-49],[-71,-75],[-23,-78],[-4,-64],[4,-62],[14,-73],[29,-82],[39,-78],[42,-55],[69,50],[1,-71],[-13,-30],[3,-47],[21,-14],[42,42],[5,65],[-9,40],[-24,42],[-18,-28],[-10,46],[5,90],[17,8],[49,-27],[21,-27],[-2,-33],[-37,-71],[7,-36],[30,-4],[16,-45],[3,-57],[-7,-37],[23,-82],[-14,-23],[15,-56],[23,0],[30,-18],[20,6],[33,-16]],[[53211,63792],[-10,-67],[-2,-69],[-8,-62],[4,-32],[-6,-138],[33,-99],[2,-38],[-17,-41],[-53,-63],[-52,-37],[-30,-33],[-55,-81],[-18,-78],[-21,-22],[-20,5],[-4,-68],[-31,-100],[-40,-1],[-25,-40],[-45,-155],[43,-274],[-4,-33],[9,-103],[-24,-134],[-35,-108],[-16,-38],[-25,-88],[-107,-110]],[[53123,64964],[15,-36],[-51,-60],[36,96]],[[50479,70488],[-49,-52],[-28,5],[-7,85],[5,33]],[[51089,68725],[43,11],[51,-45],[14,-84],[-4,-41],[-16,-5],[-73,84],[-43,-5],[1,89],[27,-4]],[[50867,68643],[-12,-30],[20,-86],[29,-28],[33,28],[23,-18],[-1,-64],[-15,-18],[-47,-194],[-50,-67],[-25,69],[-47,0],[-12,28],[-6,94],[-27,24],[-42,-63],[-7,42],[-19,4],[-8,45],[65,82],[22,52],[31,46],[13,1],[35,43],[47,10]],[[50881,70438],[-5,-39],[38,-56],[-4,-35],[-33,7],[-13,-44],[4,-51],[16,-19],[13,-100],[-8,-53],[-40,-71],[-41,-60],[-38,-44],[-84,-72],[-61,-72],[-38,-111],[-46,-20],[-76,-46],[-37,-12],[-53,-40],[-13,1],[-90,-65],[-52,-117],[-24,-46],[21,-26],[23,-59],[-29,-35],[-43,-14],[-19,-40],[-37,-151],[-39,-107],[-18,-20],[-22,-84],[-20,-21],[-15,-84],[-22,-42],[-29,-98],[-8,-53],[-13,-31],[-16,-75],[-3,-60],[12,-77],[19,-87],[-4,-32],[13,-71],[18,-61],[29,-60],[33,-16],[28,-35],[1,-51],[-36,-65],[-24,-10],[-23,-74],[-15,8],[-62,-66],[-19,-58],[-18,-24],[0,-84],[-25,-18],[-12,-42],[-2,-92],[-29,-73],[-3,-39],[-27,-92],[35,-82],[-53,-34],[-18,24],[-24,-3],[-25,-29],[-23,23],[-21,-8],[-39,-59],[-16,-36],[-45,-59],[-31,-83],[-15,-117],[-14,-59],[-29,-75],[-1,-35],[-32,-72],[-20,-9],[-34,80],[-32,-14],[-12,16],[-25,-16],[-14,-59],[-23,-34],[-46,13],[-10,27],[-96,11],[-29,-16],[-19,-28],[-38,16],[-12,20],[-35,-10],[-31,17],[-34,-19],[-31,15],[-9,-15],[-41,-12],[-41,9],[-31,-87],[-23,-22],[-13,-46],[-28,-16],[-37,17],[-59,-42],[-37,-51],[-8,-48],[-20,-61],[-6,-53]],[[48516,65933],[-3,2]],[[48513,65935],[-8,17],[-30,-89],[-34,-33],[-11,32],[-41,18],[-33,77],[-38,13],[-46,135],[-18,84],[15,26],[-19,51],[-18,1],[-21,73],[18,54],[-19,74],[-39,83],[-96,122],[-8,45],[-19,-27],[-29,8],[-40,-14],[-40,26]],[[47939,66711],[-6,109],[-19,127],[15,57],[9,78],[28,46],[11,41],[10,83],[30,5],[11,32],[25,-16],[5,58],[15,71],[-13,7],[-29,-29],[-16,66],[-48,127],[4,75],[12,35],[-1,81],[64,123],[-5,21],[28,84],[-9,46],[-33,12],[-9,43],[-24,20],[-3,62],[-22,45],[4,83],[-24,25],[-33,71],[-9,55],[54,-19],[26,18],[28,-10],[36,13],[9,107],[22,36],[11,101],[-22,73],[-21,21],[3,61],[41,52],[22,47],[-19,62],[15,43],[-14,39],[13,63],[-8,61],[5,103],[-34,97],[27,8],[22,53],[30,104],[21,-6],[34,42],[16,62],[18,23],[38,113],[-18,42],[-28,31],[-53,7],[-5,47],[13,89],[-23,52],[-131,1],[-19,29],[-13,-14],[-3,-65],[-55,-38],[-16,28],[-33,-26],[-5,30],[-31,26],[-52,-35],[-27,7],[-30,-43],[-34,75],[15,50],[22,25],[-10,46],[-19,-6],[-2,54],[-40,-46],[-53,-8],[-34,-29]],[[47596,70150],[-3,-21],[-5,-9],[-18,-17],[-1,-19],[-10,-15],[-10,-5],[-11,-27],[-6,4],[0,115],[-5,51],[22,10],[2,43],[14,32],[-27,27],[13,95],[-6,113],[19,30],[-20,53],[-42,-81],[-23,27],[12,73],[28,59],[-31,3],[-10,-35],[-20,46],[5,78],[-46,8],[10,38],[-6,33],[19,93],[28,31],[15,-7],[30,57],[11,41],[23,5],[31,-28],[59,30],[18,36],[26,-24],[21,83],[-16,39],[90,133],[40,43],[6,-44],[32,34],[23,2],[17,-45],[16,34],[46,-47],[32,-73],[61,-13],[20,15],[122,-18],[43,2],[32,30],[33,-26],[44,16],[37,44],[39,-69],[81,5],[27,-11],[24,-43],[79,-9],[77,-44],[92,-9],[41,10],[64,48],[43,16],[9,-25],[47,41],[42,-36],[1,-36],[58,-14],[17,-30],[31,-7],[29,66],[58,-4],[63,-37],[39,-50],[50,-11],[76,32],[30,37],[7,-28]],[[50403,68041],[25,18],[19,-63],[-22,-59],[-51,-55],[-37,23],[5,51],[17,42],[44,43]],[[46243,60909],[16,60],[13,-20],[-13,-132],[-22,-43],[-27,-28],[-27,-10],[-3,-22],[-35,-11],[13,50],[4,74],[16,32],[43,42],[22,8]],[[46025,60193],[26,56],[4,77],[15,76],[13,26],[34,186],[24,15],[13,-20],[5,-78],[-8,-114],[0,-49],[-17,-97],[-9,-20],[-76,-47],[-31,-86],[-44,29],[51,46]],[[45712,60210],[6,-90],[13,-37],[-1,-39],[-17,-98],[-18,-9],[-29,-40],[-21,12],[-31,59],[-13,55],[5,69],[30,58],[5,58],[21,-14],[26,3],[15,-21],[9,34]],[[45440,60462],[27,35],[55,-14],[-31,-47],[-6,-26],[-30,-51],[-1,-53],[-17,-72],[-2,-37],[-30,-86],[-43,-24],[-12,64],[-26,81],[-2,42],[-22,72],[25,23],[21,-16],[21,21],[21,-4],[22,16],[26,51],[4,25]],[[45243,60140],[-22,-36],[-18,1],[-22,52],[7,72],[17,14],[39,-47],[-1,-56]],[[45010,60680],[16,20],[36,-10],[14,-70],[-12,-49],[5,-39],[-23,-117],[-36,151],[-12,84],[12,30]],[[45018,59978],[11,-12],[-21,-131],[-19,27],[-34,22],[8,39],[26,-7],[29,62]],[[49169,76808],[52,120],[19,7],[19,53],[-25,7],[-42,-33],[-24,3],[-32,-33],[-17,-61],[-48,-18],[-60,15],[-30,56],[-12,-3],[-39,100],[-32,-3],[-16,-34],[-27,5],[-32,-21],[-20,50],[42,31],[-17,22],[-29,-7],[-15,32],[-51,16],[-28,-7],[-17,-58],[-38,-3],[-19,-36],[-36,17],[-6,42],[-30,22],[19,42],[-4,67],[-37,7],[-13,24],[90,68],[41,16],[1,20],[54,63],[40,3],[33,52],[49,37],[21,52],[21,101],[-21,96],[23,65],[-27,68],[6,33],[-12,44],[-43,2],[-39,-27],[-12,-30],[-40,-21],[-19,39],[38,60],[14,-1],[48,69],[12,53],[-27,27],[-49,96],[7,71],[34,36],[45,-18],[21,-77],[39,4],[-6,-52],[68,47],[65,-2],[31,25],[52,6],[61,-71],[1,39],[-33,70],[45,38],[-18,74],[16,64],[42,70],[-31,4],[-15,30],[2,101],[46,16],[-7,66],[32,65],[-19,49],[-34,-28],[-11,27],[-41,-77],[-20,25],[-49,118],[-1,36],[-54,113],[12,111],[39,82],[11,78],[52,61],[-61,24],[-41,-6],[-5,-68],[-37,-6],[-71,-77],[-49,8],[-28,41],[-26,-16],[0,-80],[-15,-18],[-45,43],[-10,30],[-68,61],[-45,-58],[-26,34],[-22,61],[0,44],[35,35],[19,84],[37,62],[4,69],[21,53],[33,31],[7,45],[-20,72],[-26,18],[-32,48],[13,38],[-8,47],[-81,83],[-37,-58],[-11,34],[2,69],[-29,8],[8,-80],[29,-79],[-37,-56],[-15,-130],[-12,-55],[8,-57],[-24,-44],[-54,-6],[0,65],[24,49],[-1,86],[37,128],[-23,32],[-12,118],[41,113],[4,68],[-29,55],[28,38],[23,70],[10,58],[35,97],[-52,-39],[-44,-71],[-76,38],[-35,94],[-39,-3],[20,56],[86,21],[8,70],[-30,-14],[25,138],[-67,-14],[27,72],[-29,23],[-74,-14],[-39,75],[7,42],[-18,51],[-20,-40],[-43,25],[-17,61],[29,12],[30,56],[47,-31],[-8,95],[32,47],[45,-86],[1,-155],[12,-40],[55,-45],[45,15],[-24,82],[-11,83],[19,98],[-3,157],[30,7],[10,-50],[68,78],[54,3],[-22,54],[-38,54],[39,2],[10,28],[-13,90],[58,28],[-16,75],[28,64],[-14,42],[63,64],[82,-55],[14,32],[88,-34],[28,26],[96,4],[18,18],[84,30],[60,11],[47,-8],[-23,-122],[16,-17],[-16,-57],[-31,-47],[-42,-23],[-38,-73],[-90,-95],[-4,-24],[-47,-40],[1,-61],[43,-29],[-3,-35],[-35,-71],[-6,-54],[42,-8],[64,52],[80,44],[88,-44],[50,31],[58,-18],[129,-5],[25,19],[47,-19],[25,-42],[9,-93],[-22,-75],[-26,-38],[-23,-71],[0,-72],[-31,-79],[-10,-79],[-35,-81],[-42,-54],[6,-30],[-24,-81],[-68,-63],[-8,-65],[10,-39],[53,-38],[-28,-41],[-43,-28],[-37,15],[-50,-66],[-7,-36],[-49,-26],[15,-33],[41,2],[24,-27],[48,28],[31,58],[43,-8],[12,-32],[51,-27],[20,-29],[56,-15],[37,-107],[50,-91],[47,-37],[20,-109],[-10,-32],[17,-46],[-6,-33],[19,-57],[5,-74],[37,-97],[-4,-16],[16,-113],[36,-56],[4,-37],[54,-44],[54,-22],[58,-56],[26,-58],[30,-109],[24,-20],[15,-42],[39,-25],[-35,-44],[-1,-40],[27,-106],[64,-138],[-60,-22],[11,-38],[60,-73],[19,-52],[32,-119],[3,-94],[-58,-77],[-24,-74],[45,-61],[30,0],[34,26],[13,69],[98,22],[112,-26],[45,-35],[63,-87],[17,-35],[14,-69],[-4,-52],[8,-52],[-9,-60],[-28,-96],[-14,-128],[-31,-25],[-27,-63],[-49,-65],[4,-49],[-26,-23],[-55,28],[-15,-47],[24,-10],[-3,-68],[-34,-24],[-7,-58],[-41,13],[-16,-41],[12,-30],[-4,-45],[79,-25],[38,15],[109,20],[-13,-46],[7,-111],[-8,-24],[-52,-46],[-51,-33],[-17,-85],[-42,15],[-35,-43],[-89,-47],[-24,-50],[-15,0],[-83,52],[-38,13],[-87,-19],[-42,-17],[-26,-40],[-33,37],[3,46],[-35,3],[-2,-39],[-32,-11],[-20,27],[-27,1],[-30,-33],[-29,-7],[-16,-27],[-29,13],[-57,-17],[-14,-30],[-5,-57],[-41,4],[-87,28],[-14,-37],[-57,68],[-65,39],[-20,-21],[-78,-24],[-11,-30],[-39,-19],[-19,-69],[6,-76],[-43,-80],[-22,-63],[-39,26],[-5,34],[-118,55],[-36,-1],[-31,-26],[-60,2],[-9,-69],[-18,4],[-44,-42],[-20,-38],[6,-65],[-27,-22],[-25,15],[-19,47],[-56,25],[-7,-46],[-35,-18],[-10,24],[12,70],[37,36],[28,-16],[54,67],[24,43],[2,39],[31,36],[3,64],[43,38],[22,4],[9,48],[56,83],[-1,96],[10,74],[61,-17],[20,33],[9,113],[120,28],[43,-16],[23,10],[34,-33],[37,-3],[77,30],[3,69]],[[50210,76858],[-4,42],[44,-21],[-5,-44],[-35,23]],[[49759,83614],[13,-53],[-44,-11],[31,64]],[[49701,83559],[23,-39],[-11,-132],[-38,3],[-9,77],[19,71],[16,20]],[[49619,83310],[-49,75],[15,40],[53,56],[-5,-123],[35,-15],[33,-48],[-23,-60],[2,-93],[-14,-15],[-16,-140],[-32,-33],[30,177],[-16,29],[-51,-10],[-19,41],[-32,10],[0,47],[78,15],[11,47]],[[49607,76371],[26,40],[58,-31],[-20,-88],[-31,-17],[-53,66],[20,30]],[[49127,82412],[39,-48],[-2,-39],[32,-35],[27,18],[22,-36],[-46,-46],[-12,-71],[-26,25],[29,44],[-16,50],[-69,-11],[-40,52],[2,76],[39,37],[21,-16]],[[49087,82249],[21,-21],[18,-66],[-40,-5],[-40,68],[7,32],[34,-8]],[[48589,80081],[21,-82],[-35,17],[-25,81],[39,-16]],[[48538,79965],[30,-39],[0,-54],[20,-28],[-7,-79],[-40,-2],[-29,49],[-11,76],[9,48],[28,29]],[[48252,78812],[-92,-53],[-12,22],[9,56],[-31,30],[-37,64],[-9,69],[-33,33],[-51,-87],[18,-43],[-27,-25],[-2,-35],[-66,-23],[-33,14],[-22,43],[-48,11],[-8,59],[-16,3],[-58,96],[42,77],[45,-6],[39,50],[-52,35],[10,51],[29,-17],[56,61],[24,44]],[[47927,79341],[5,57],[16,11],[44,82],[27,-13],[31,23],[19,86],[19,-23],[43,7],[68,58],[95,-18],[30,-43],[-4,-82],[15,-48],[21,-18],[35,-83],[18,2],[10,-58],[-41,-43],[28,-24],[44,1],[13,-23],[27,-112],[-29,-37],[-5,69],[-39,14],[16,-62],[-1,-46],[26,-22],[4,-41],[-20,-45],[-60,-5],[-19,-27],[-1,-72],[-47,-58],[-35,51],[-28,13]],[[48333,80582],[12,-42],[43,-5],[43,-49],[-17,-62],[-35,-36],[-42,9],[-17,-22],[-94,-4],[5,37],[41,-1],[7,88],[-9,50],[-30,2],[6,50],[51,39],[36,-54]],[[48333,80146],[10,39],[62,82],[15,-19],[-70,-178],[-7,-53],[-28,9],[-8,61],[26,59]],[[48258,80082],[30,36],[38,-183],[-67,-72],[-20,9],[21,56],[-19,54],[-44,-53],[9,130],[52,23]],[[48234,81929],[29,39],[24,-60],[-5,-59],[-39,-59],[-17,-116],[5,-61],[-29,-12],[0,-46],[-55,-41],[-33,-53],[-51,-51],[-30,57],[61,82],[-61,27],[-14,109],[23,82],[24,2],[23,-33],[29,34],[-14,31],[32,39],[45,21],[53,68]],[[48263,80889],[-15,-52],[-42,50],[34,39],[23,-37]],[[47998,81377],[31,-56],[-15,-72],[-27,-2],[-48,53],[-30,6],[9,49],[60,3],[20,19]],[[47977,80990],[-26,-32],[-18,98],[12,43],[-9,59],[8,65],[45,22],[10,-67],[-19,-23],[19,-71],[-14,-14],[-8,-80]],[[47945,79410],[-3,41],[42,45]],[[47984,79496],[-39,-86]],[[59417,65162],[-1,-2]],[[59416,65160],[-20,-31],[21,-48]],[[59417,65081],[-44,10],[-1,2],[-11,-2]],[[59361,65091],[0,15]],[[59361,65106],[-7,31]],[[59354,65137],[24,-2],[16,24],[23,3]],[[59098,64856],[20,40],[17,-27],[28,8],[7,-26]],[[59170,64851],[-2,-36],[-17,-17],[-20,70],[-33,-12]],[[49399,75285],[1,47],[37,-20],[-1,-47],[-37,20]],[[52066,71380],[-6,-17]],[[51186,76849],[-14,98],[5,33],[-13,27],[25,42],[-27,20],[-32,-36],[-28,-12],[-22,13],[-21,46],[12,84],[40,26],[-4,50],[12,48],[81,-72],[8,-28],[-30,-45],[-47,41],[-3,-21],[36,-28],[38,-51],[54,-13],[60,27],[33,-8],[-1,32],[-18,2],[-43,-21],[-1,51],[-21,21],[-51,10],[-14,38],[-61,65],[57,102],[41,107],[38,134],[32,-21],[41,-16],[40,-49],[39,-13],[-4,38],[88,97],[7,39],[-18,54],[-28,33],[-47,-51],[-32,3],[19,-88],[-17,-82],[-18,-14],[-27,34],[-39,14],[-33,28],[10,181],[25,169],[40,-53],[27,30],[22,-5],[18,-55],[-3,-52],[13,-24],[31,9],[11,-44],[28,-32],[27,-66],[18,28],[75,-12],[0,25],[-48,1],[-19,36],[1,72],[18,47],[-73,19],[3,116],[-8,65],[17,74],[40,63],[84,63],[195,35],[44,21],[32,-11],[18,-88],[43,-22],[5,-32],[30,-7]],[[51319,78085],[26,62],[18,-36],[-16,-72],[-40,-11],[12,57]],[[51193,77155],[28,20],[44,-2],[16,-18],[2,-56],[-25,-17],[-80,51],[15,22]],[[51184,76849],[-6,0],[-12,23],[-34,0],[-28,40],[-21,-48],[-24,-7],[-43,52],[-23,-14],[-39,74],[35,36],[83,5],[10,-29],[44,-40],[11,-41],[36,-6],[-3,39],[-39,25],[-25,39],[40,51],[28,-64],[-5,-40],[15,-95]],[[51057,76733],[17,88],[41,47],[10,-26],[43,7],[8,-19]],[[50935,76844],[50,26],[67,-40],[14,-47],[-10,-52]],[[50667,48542],[-3,22],[14,62],[-17,109],[5,64],[40,11],[36,21],[18,43],[28,31],[49,-101],[17,-62],[40,-83],[28,-130],[18,3],[28,-20],[20,-97],[10,-14]],[[50998,48401],[-12,-73],[-6,-101],[-10,-119],[13,-32],[50,-85],[-1,-70],[11,-23],[3,-58],[-8,-56],[11,-77],[16,-35],[1,-67],[-10,-104],[-7,-27],[-26,37],[-12,-16],[-15,-131],[5,-35],[20,-26],[-5,-52],[-11,-8],[-8,-101],[-21,-62],[-13,7],[-27,-24],[-13,-59],[10,-34],[-13,-36],[-14,-5],[-19,-96],[-12,-14],[-5,-50],[7,-104],[-20,-129],[-51,-30],[-33,7],[1,-67],[-15,-149],[3,-49],[4,-152],[-17,-95],[6,-74],[9,-25],[-5,-98],[-16,-149],[14,-51],[-3,-119],[7,-69],[14,-32],[0,-48],[-13,-3],[0,-103],[10,-164],[-15,-25],[-4,-46],[8,-20],[-2,-101],[13,-12],[1,-53],[-15,-42],[6,-46],[-13,-36],[0,-46]],[[50751,44639],[0,-8]],[[50751,44631],[0,-50]],[[50751,44581],[-71,-14],[28,42],[-13,52],[-19,17],[-18,-27],[-5,-53],[22,-4],[-1,-36],[-26,5],[-69,-18],[-53,-2],[-26,-20]],[[50500,44523],[-3,4],[1,2],[-7,86],[-19,83],[-25,52],[-6,79],[4,131],[-13,68],[21,0],[0,316],[4,116],[-4,29],[0,504],[-4,21],[9,86],[-7,36],[2,231],[-4,138],[-15,81],[-12,17],[-30,94],[-5,105],[-15,58],[6,32],[-2,282],[-68,106],[-93,173],[3,105],[6,34],[-2,106],[20,59],[12,140]],[[50254,47897],[17,47],[34,1],[-7,46],[22,36],[-2,71],[32,-21],[18,73],[15,25],[4,47],[13,17],[39,-21],[4,-32],[19,-4],[51,35],[19,-21],[29,-1],[26,82],[30,61],[23,36],[-2,36],[20,73],[9,59]],[[50254,47897],[-70,0],[-46,-49],[2,55],[-178,94]],[[49962,47997],[-39,25],[-18,-63],[-24,20],[-2,-56],[-37,-32],[-7,-49],[-22,27],[-4,26],[-87,7],[-32,-16],[-77,1],[-10,25],[-44,0],[0,-23],[-151,-4],[-25,5],[-72,-2],[-99,14],[5,-50],[-14,-39],[-8,-85],[-12,-40],[0,-53],[30,-177],[-5,-49],[23,-39],[-8,-48],[1,-93],[13,-87],[-5,-44],[9,-34],[-14,-61],[-1,-46],[11,-37],[-5,-57],[21,-48]],[[49253,46815],[-20,-57],[-18,28],[-28,84],[-22,125],[-15,-12],[-9,60],[-33,73],[-15,-33],[-15,4],[-25,42],[-53,5],[-49,-7],[-10,-18],[-24,3],[-49,-69],[-13,26],[-19,-51],[-16,-7],[-18,-121],[-25,5],[-8,44],[-21,-13],[-30,56],[-21,-34],[-26,110],[-12,25],[-40,24],[3,79],[-12,63],[-20,11],[4,49],[-16,72],[-29,24],[-38,-22],[-16,16],[-27,89]],[[48468,47488],[15,90],[-1,125],[17,89],[-14,34],[-10,129],[29,18],[16,36],[0,32],[19,28],[1,86],[16,49],[-1,73],[-10,51],[-16,11],[10,86],[-25,63],[24,7],[38,88],[40,28],[41,16],[26,-14],[11,48],[20,-5],[13,102],[30,61],[21,17],[-12,76],[6,50],[15,33],[-12,53],[-20,38],[4,23],[33,38],[13,-30],[19,23],[7,59],[-5,34],[2,71],[-36,109],[25,89],[25,27],[14,32],[4,47],[40,62],[12,-65],[33,-7],[22,-58],[12,-12],[36,-79],[28,-5],[6,15],[-4,70],[56,9],[-6,52],[-6,140],[8,20],[1,71],[38,4],[22,-53],[43,28],[-9,52],[0,67],[20,126],[-1,42],[45,58],[24,58],[32,60],[49,-36],[54,-74],[30,33],[4,203],[21,9],[36,-5],[27,14],[100,164],[69,39],[96,215],[78,0],[17,-57],[38,53],[136,-118]],[[50067,50703],[-18,-48],[16,-67],[-18,-86],[-3,-71],[61,-346],[12,-52],[30,-94],[26,-54],[-4,-50],[9,-16],[35,7],[8,-43],[31,-10],[23,-28],[10,-69],[17,-14],[14,-36],[29,-14],[11,-26],[-30,-25],[-32,34],[-19,4],[0,-194],[80,-117],[164,-240],[16,63],[14,30],[31,-12],[20,-20],[19,-77],[0,-43],[13,-70],[-20,-2],[-33,-21],[-5,-32],[93,-322]],[[49253,46815],[3,-88],[-12,-40],[17,-43],[-32,-82],[2,-74],[27,-9],[5,-57],[19,-113],[24,-347],[1,-69],[-16,-43],[-16,4],[-5,-36],[6,-51],[-21,-7],[-42,-144],[-25,-149],[-3,-84],[-10,-117],[4,-67],[-19,-69],[-3,-50],[-15,-14],[-40,-163],[6,-66],[-13,-63],[21,-226],[22,-127],[8,-121],[15,-91],[-2,-106],[20,5],[-4,-54],[11,-16],[17,20],[29,-34],[-1,-32],[12,-149],[-12,-21],[-2,-41],[13,-84],[-3,-19],[-29,-7],[-27,13]],[[49183,43684],[-57,17],[-19,47],[12,67],[-22,37],[-7,-89],[-14,-46],[9,-32],[-63,28],[-72,26],[-30,25],[-32,10],[-3,31],[-31,16],[-32,-11],[-23,17],[-9,-29],[-23,17],[-3,-28],[-30,2],[-36,-25],[-29,-6],[0,-51],[25,18],[9,24],[29,10],[30,-4],[28,27],[22,-4],[18,25],[20,1],[23,-37],[-135,-39],[-59,-23],[-53,-10],[-18,56],[-4,-55],[-154,-44],[-81,-37],[-60,-61],[-31,-43],[-69,-65],[-39,-21],[-33,-50],[-55,-20],[-43,-92],[-35,-12],[-61,-99],[-34,-13],[-10,17],[6,38],[-5,106],[3,16],[-3,21],[-4,14],[4,6],[-3,12],[1,3],[2,0],[0,3],[-1,65],[-7,56]],[[47892,43496],[-1,33],[16,33],[-8,89],[24,52],[0,80],[29,48],[-15,40],[2,71],[10,102],[-14,49],[0,103],[-10,14],[-23,-19],[-10,48],[-28,-1],[-28,60],[-4,80],[-14,8],[8,66],[-35,74],[-26,11],[-28,-24],[-38,31],[-17,36],[-13,3],[-13,67],[-21,-16],[-17,53],[12,64],[31,45],[27,100],[-1,112],[11,21],[-6,71],[7,60],[-23,41],[-9,62],[-8,149],[-13,15]],[[47646,45427],[18,48],[15,-25],[13,17],[25,-52],[20,86],[14,100],[-11,61],[24,117],[27,-10],[-12,68],[2,50],[-23,-29],[-29,20],[-19,35],[8,90],[-7,61],[14,45],[75,-10],[14,-50],[23,37],[12,-70],[17,-2],[6,89],[-11,48],[8,38],[-17,29],[-8,51],[-14,27],[-39,16],[4,137],[27,61],[28,-1],[-31,82],[-20,25],[20,149],[-51,-19],[-14,31],[-17,79],[8,75],[-1,61],[8,68],[-9,52],[1,108],[31,29],[8,52]],[[47783,47301],[11,-13],[23,35],[26,62],[22,83],[17,42],[8,-30],[23,29],[15,-7],[8,-76],[19,-7],[-2,-60],[59,1],[21,-32],[4,-41],[14,-1],[10,50],[-9,30],[21,70],[19,-11],[21,20],[31,-23],[10,19],[5,51],[-10,15],[-4,102],[7,43],[12,-2],[19,-46],[31,-22],[9,30],[-6,69],[28,-11],[19,41],[15,-175],[6,-96],[-16,-41],[3,-30],[25,-42],[40,-7],[8,55],[21,6],[2,62],[30,52],[18,-6],[11,23],[28,0],[13,-24]],[[49962,47997],[15,-40],[21,17],[11,-92],[-11,-12],[-5,-104],[-14,-44],[4,-89],[28,-22],[5,-29],[23,-25],[9,-72],[24,-13],[24,-72],[5,-159],[13,-44],[-15,-20],[0,-106],[-11,-87],[18,-59],[-5,-50],[-35,-1],[10,-105],[16,15],[7,36],[36,-8],[2,-30],[20,-28],[-17,-109],[8,-32],[-22,-125],[19,-109],[-9,-60],[-31,-6],[1,-37],[24,-101],[49,-77],[1,-49],[22,-57],[1,-41],[-26,-19],[-14,-47],[6,-23],[-7,-50],[12,-162],[-12,-176],[-17,-20],[-1,-59],[5,-64],[9,-21],[20,6],[4,-60],[-11,-115],[-6,-111],[-15,-11],[7,-46],[-9,-35],[13,-81],[19,-17],[-4,-68],[22,-76],[10,-66],[24,-34],[16,-46],[30,2],[2,-31],[20,-88],[33,0],[0,-41]],[[50333,44392],[-34,-50],[-23,-84],[-4,-63],[-16,-37],[-33,-11],[-1,28],[-29,13],[-21,-38],[-49,10],[-35,-5],[-37,-28],[-29,-33],[-21,-50],[-61,-69],[-41,-24],[-27,-45],[-12,-42],[-63,-56],[-17,-51],[-11,-12],[-72,-11],[-43,-66],[-72,-43],[-27,-8],[-12,-43],[-26,-35],[-2,-30],[-47,-40],[-17,-47],[-37,-3],[-37,69],[-9,35],[-50,42],[-181,94],[-1,19],[47,6]],[[51185,53739],[0,-338],[0,-482],[0,-719],[-15,-1],[-5,-136],[1,-298],[-28,-51],[-10,-72],[-21,-102],[-3,-104],[-13,-51],[-8,-84],[-12,-44],[-37,-19],[-37,-102],[-15,-23],[0,-59],[-12,-32],[-128,50],[-4,-65],[-106,7],[-262,-35],[-106,-15],[-87,-199],[-26,-20],[-48,-9],[-12,-11],[-49,38],[-33,-24],[-42,22],[0,-58]],[[47783,47301],[10,60],[-12,65],[-19,-8],[-14,43],[-35,20],[-11,111],[-15,9],[1,62],[9,60],[-11,10],[6,61],[13,25],[-5,73],[-18,49],[-38,7],[-6,-45],[-22,-35],[-26,2],[-1,27],[33,98],[2,54],[22,11],[4,48],[25,-10],[-1,77],[-36,23],[-4,39],[-28,1],[-23,122],[-18,-9],[-24,15],[17,148],[2,73],[-5,38],[-30,24],[7,73],[-10,36],[-20,23],[16,64],[-20,49],[-42,68],[-26,15],[-32,-9],[-4,-30],[11,-50],[11,-11],[-9,-72],[-42,-7],[-14,-43],[-31,-21],[-10,-35],[-2,-60],[-15,-4],[-40,25],[-72,80],[-13,21],[-41,12],[-5,-32],[-26,-41],[-17,4],[-5,-64],[-14,-10],[-14,-83],[-13,-6],[-26,35],[-15,126],[-30,77],[-30,-6],[-8,-64],[-18,-22],[-2,-39],[-23,-36],[-23,18],[-16,61],[-24,19],[-10,60],[16,46],[-4,56],[19,38]],[[46839,48910],[5,68],[-16,41],[3,50],[-10,20],[5,47],[11,13],[-5,95],[16,46],[-44,145],[-8,38],[3,41],[-19,42],[-11,58],[-29,14],[-9,-54],[-17,-6],[-17,44],[5,54],[-28,50],[-17,59],[-11,72],[34,62],[5,85],[-21,44],[9,142],[-14,73],[-20,16],[-1,48],[-28,22],[-4,102],[20,69],[-19,45],[-7,41]],[[46600,50596],[25,8],[25,-39],[4,34],[20,-2],[32,64],[7,0],[12,124],[-15,52],[10,127],[13,49],[14,134],[25,-5],[35,83],[23,-3],[44,-156],[13,-15],[60,-122],[10,-51],[20,-26],[3,48],[10,17],[3,52],[31,62],[44,50],[22,10],[16,-16],[36,1],[62,-53],[39,28],[36,-6],[31,26],[78,9],[-13,119],[33,70],[6,-7],[-6,-137],[228,-1],[218,-1],[150,1],[210,-1],[258,1],[46,597],[-77,120],[-12,304],[-23,533],[-25,588],[-22,501],[-16,374],[-16,362],[-23,542],[-26,597],[-21,449],[-17,385],[-7,170],[-27,553],[-9,213],[-23,525],[181,1],[121,0],[181,-2]],[[53332,56872],[231,-140],[194,-119],[48,-69],[136,-297],[225,255]],[[54166,56502],[16,-217],[39,-501],[0,-359],[23,-34],[51,-293],[11,-59],[-5,-37],[-18,-28],[2,-54],[27,-43],[28,-141],[13,-3],[26,-54],[65,-69],[-68,-299],[-24,-425],[-21,-400],[-7,-614],[-7,-566],[-3,-287],[-148,-337],[-98,-201],[-74,-194],[-36,-123],[-78,-282],[-27,-78],[-23,-129],[6,-100],[-18,-22],[-21,-46],[7,-59],[-15,-26],[-19,-6],[-29,-36],[0,-34],[46,-507]],[[53787,49839],[-76,-1],[-33,-65],[-2,-38],[-14,-20],[-45,1],[-30,-36],[-42,-71],[-27,-73],[-22,-3],[-16,-51],[6,-36],[-17,-26],[-3,-32],[-44,3],[-17,24],[-43,-2],[-62,101],[-57,31],[-24,34],[-36,25],[-51,-1],[-172,-14],[-54,-52],[-72,-12],[-54,-63],[-47,-112],[-12,-51],[-39,-106],[-75,11],[-16,-9],[-41,17],[-57,-1],[-92,79],[-14,58],[-26,36],[-24,-12],[-46,112],[-50,72],[-70,20],[-105,-163],[-14,-12],[-47,22],[-27,-78],[-19,-14],[-31,2],[-34,101],[-34,140],[-75,187],[-42,55],[-34,-23],[-18,23],[-72,61],[-55,54],[-28,35],[-50,-37],[-20,-56],[-20,-14],[-36,11],[-20,-12],[-46,24],[-104,-63],[-64,-145],[-26,0],[0,-227],[-11,-125],[-13,-63],[-32,-110],[-46,-87],[-34,-73],[-1,-87],[5,-103],[-10,-100],[13,-102],[-16,-40],[3,-64],[14,-55],[-24,-37]],[[53787,49839],[124,-448]],[[53911,49391],[34,-391],[-7,-42],[2,-52],[12,-33],[28,10],[37,-11],[24,-58],[0,-31],[36,-52],[-16,-95],[6,-42],[-12,-152],[-1,-41],[13,-34],[1,-56],[-9,-44],[-27,-30],[-42,-83],[-35,-45],[-13,-38],[-21,11],[-39,38],[-12,-75],[-33,-101],[-6,-44],[-16,1],[-5,-103],[-19,-36],[-6,-72],[-13,-18],[-3,-89],[-14,-77],[6,-58],[-11,-112],[-29,-75],[-15,4],[-13,-23],[-14,-60],[10,-46],[-13,-20],[4,-39],[14,-21],[-10,-33],[-9,-69],[-1,-70],[-6,-24],[-48,-34],[-25,-61],[-18,-20],[-1,-34],[11,-70],[-9,-72],[5,-23],[-10,-71],[-12,-33],[-6,-84],[4,-38],[-27,-31],[-4,-64],[-25,-21],[-5,-31],[-30,33],[-11,-29],[4,-46],[-60,-108],[1,-153],[-16,-47],[6,-90],[-38,-131],[-16,-84],[-4,-72],[6,-38],[-25,-30],[-2,-67],[-19,-68],[1,-159],[-17,4],[-21,-24],[-29,-53],[-12,-96],[1,-78],[-10,-23],[-8,-64],[-23,-9],[-7,-48],[-26,-20],[-13,24],[-20,0],[-8,-27],[-20,14],[0,115],[-19,25],[-10,-20],[-21,16],[-1,35],[-21,39],[-6,29],[7,55],[-21,19],[-24,58],[-23,29],[-10,-29],[-5,-70],[-23,-16],[-68,-20],[-12,38],[-6,69],[-38,-97],[-42,-91],[-23,13],[-20,-203],[-31,12],[-3,-37],[-16,-24],[-17,9],[-9,-101],[-24,28],[-4,-47],[-19,-75],[-15,-11],[-16,-54],[-27,-67],[-59,-123],[11,-38],[-13,-61],[18,-46],[6,-44],[-25,-96],[4,-32],[-9,-73],[2,-69],[-11,-54],[-15,-28],[-16,-87]],[[52408,43560],[-5,-26],[-10,-10],[-4,-21],[6,-25],[-16,-13],[-10,-25],[-22,11],[-18,51],[-28,48],[-15,-2],[-6,53],[-15,35],[-15,-4],[6,-68],[46,-147],[-5,-47],[14,-29],[-28,-60],[-17,-12],[-47,-3],[-62,-19],[-31,14],[-14,-16],[-43,45],[-20,-3],[-29,22],[-20,84],[-18,-10],[-17,73],[-21,-19],[-33,23],[-3,27],[-46,-24],[7,-63],[-25,-36],[-27,10],[-27,-60],[-9,-58],[-13,6],[-9,80],[-24,-49],[-35,-3],[-8,-23],[-7,29],[4,11],[-1,16],[5,27],[1,17],[-2,9],[0,53],[2,10],[-4,15],[7,13],[1,13],[19,11],[7,7],[2,13],[-3,22],[5,-5],[3,5],[2,22],[12,13],[-3,42],[-19,5],[-6,-14],[-2,18],[-3,-17],[-1,20],[-6,1],[-4,-3],[-1,-5],[0,-18],[-3,-4],[-6,0],[-2,-3],[3,26],[1,18],[6,1],[4,15],[-3,25],[3,5],[9,1],[-1,14],[-10,-6],[-7,14],[-5,0],[-4,-8],[-3,-29],[-7,-3],[-10,16],[-10,31],[-31,48],[-5,57],[-9,9],[6,17],[-4,11],[-7,-11],[-16,-3],[3,103],[-19,83],[13,36],[-26,36],[4,40],[-20,59],[-9,67],[-14,42],[-29,-2],[-18,-36],[-27,-17],[-22,-45],[-6,47],[-12,-1],[-10,-74],[-18,93],[-91,196],[-12,52],[-54,51],[-97,43],[-41,14],[-55,-7],[-79,-4],[17,26],[17,-5],[10,28],[43,29],[11,43],[-15,24],[-16,-36],[-50,-24],[1,43],[-22,-3],[0,-59],[-13,-53],[-34,-2],[-26,14],[-31,-32],[-41,-1],[-23,37],[-27,-4]],[[52019,43207],[14,-32],[-29,-24],[-23,3],[10,43],[28,10]],[[51709,43621],[-2,-16],[5,-4],[8,-3],[3,15],[16,-6],[-13,-72],[-6,6],[4,-22],[0,-16],[-5,-10],[-7,16],[-9,19],[-4,65],[2,3],[1,6],[-1,13],[2,6],[6,0]],[[51697,43107],[29,-10],[1,-21],[-37,-6],[7,37]],[[51663,43474],[11,-61],[18,-9],[-1,-28],[2,-18],[-8,-41],[3,-9],[-3,-14],[1,-19],[-13,-14],[-4,-39],[-18,22],[-6,43],[-32,59],[12,130],[-57,78],[-20,-29],[5,-46],[-20,-8],[-22,80],[1,20],[-19,111],[11,6],[7,-3],[2,-13],[5,-11],[3,-4],[8,-1],[6,-18],[28,-31],[5,-5],[5,0],[12,7],[5,11],[1,11],[13,3],[6,18],[20,-9],[25,61],[13,-38],[7,-6],[6,1],[4,9],[6,32],[11,-16],[-2,-9],[1,-16],[1,-9],[-3,-16],[-4,0],[-3,-3],[-1,-13],[-11,-21],[19,-30],[1,-20],[-7,-9],[-3,4],[-2,-1],[-4,7],[0,-13],[5,-2],[1,-15],[-3,-16],[-3,-5],[-4,0],[-6,7],[-11,-32]],[[51688,43537],[3,5],[6,-11],[6,-7],[-7,-54],[-5,-7],[-2,-12],[-6,-36],[-11,13],[2,76],[6,-6],[3,-1],[3,3],[2,6],[3,15],[-1,11],[-2,5]],[[51633,43672],[-4,-28],[-20,11],[-5,-19],[-14,-5],[-3,-17],[-3,-3],[-7,4],[-5,-3],[-4,-9],[-18,32],[-11,1],[-10,23],[-10,2],[-1,36],[22,11],[11,-17],[36,30],[9,-7],[39,19],[11,-25],[-13,-36]],[[51613,43743],[-18,-28],[-6,7],[-27,-10],[-11,-20],[-12,43],[25,95],[24,8],[7,-12],[3,13],[7,-1],[6,12],[4,-9],[-5,-15],[0,-15],[9,2],[5,-54],[-11,-16]],[[51496,43694],[-8,35],[-10,121],[19,-7],[-6,-43],[21,-96],[-16,-10]],[[51499,43892],[-13,-16],[-28,30],[-20,55],[6,37],[19,26],[13,-83],[23,-49]],[[51417,44089],[15,27],[20,-48],[-10,-40],[-17,23],[-8,38]],[[50751,44631],[26,7],[25,-36],[-51,-21]],[[50500,44523],[1,-2],[-49,-42],[-66,-39],[-53,-48]],[[53911,49391],[107,0],[22,-112],[-7,-18],[39,-129],[11,4],[34,-63],[9,-46],[-2,-45],[16,-88],[-6,-163],[21,-48],[13,18],[15,-43],[4,-62],[-10,-47],[6,-47],[17,-40],[-16,-55],[10,-91],[10,-38],[-22,-95],[4,-52],[-5,-29],[4,-60],[8,-35],[-5,-140],[5,-61],[-8,-36],[26,-145],[-2,-66],[25,-39],[16,-115],[39,-85],[10,-49],[24,-44],[35,-49],[-76,-43],[-47,40],[-37,-2],[-15,-29],[-30,26],[-43,-35],[-87,46],[-75,4],[-24,-132],[-29,-62],[-13,-66],[16,-19],[19,-71],[13,-11],[22,-55],[9,-45],[12,5],[19,-56],[-3,-80],[30,-51],[6,-38],[27,-43],[70,-134],[9,8],[31,-68],[-1,-29],[35,-20],[26,-105],[54,-300],[0,-34],[16,-114],[15,-65],[22,-14],[1,-65],[-8,-73],[-19,-41]],[[54303,45407],[-19,-79],[-50,-103],[-9,-36],[3,-80],[-17,-36],[-15,-124],[-15,-87],[-26,-12],[-29,-177],[-15,-74],[3,-26],[-21,-82],[-58,-57],[-31,-93],[27,-106],[24,21],[5,-21],[2,-132],[-9,-73],[9,-67],[-7,-71],[-21,-93],[15,-39],[24,-23],[8,-70],[-4,-122],[7,-63],[4,-143],[25,-84],[57,-80],[3,-32],[18,-57],[3,-108],[19,-64],[-26,-23],[8,-46],[40,-173],[68,-181],[86,-261],[24,3],[22,-77],[9,3],[19,-62],[6,-57],[-12,-26],[9,-63],[1,-81],[-5,-49],[9,-69],[26,-149]],[[54497,41603],[-30,-18],[-2,-119],[-7,-16],[9,-83],[15,-67],[3,-72],[-33,-29],[-1,76],[-40,15],[-4,30],[-16,19],[-12,38],[-77,53],[-39,-49],[-31,86],[-10,3],[-44,-43],[-12,26],[-23,-10],[-1,45],[-20,16],[-10,-18],[-24,49],[-19,2],[-12,46],[-30,-21],[-13,-29],[-12,43],[-32,-10],[-142,0],[-135,0]],[[53693,41566],[2,25],[-16,49],[-25,8],[-19,-30],[-43,7],[-23,-15],[-39,-2],[-38,30],[-33,-14],[-42,23],[-18,-22],[-9,20],[-53,9],[-41,-15],[-32,-1],[-14,34],[-91,-18],[1,-35],[-11,-53]],[[53149,41566],[-42,14],[-10,-14],[-135,0],[-133,0],[-42,-6],[-41,45]],[[52746,41605],[0,3],[-2,2],[-8,8],[-8,76],[-1,113],[8,119],[13,91],[-3,32],[8,93],[11,24],[6,61],[-23,153],[-33,99],[-32,66],[3,68],[32,102],[13,6],[-17,105],[-15,18],[-8,66],[-44,10],[-14,53],[-40,-67],[-13,-46],[-22,-13],[-2,38],[-21,-3],[-41,70],[6,55],[-7,42],[-16,34],[-1,105],[15,47],[-5,41],[6,61],[-11,30],[-24,-9],[0,43],[-25,72],[-16,-41],[-18,36],[-7,39],[13,27],[5,26]],[[49270,75481],[25,1],[1,-26],[-23,-9],[-3,34]],[[48516,65933],[0,-21],[-6,14],[3,9]],[[47646,45427],[-24,50],[2,54],[-34,-2],[-11,-41],[1,-85],[-19,-72],[-21,-52],[5,-45],[-10,-22],[-13,25],[-34,-41],[-18,4],[-27,57],[1,46],[-24,-5],[-7,42],[-28,-11],[-4,38],[19,111],[-5,44],[8,44],[-6,41],[-16,43],[-3,82],[9,50],[-10,24],[-6,66],[-15,13],[11,111],[-21,23],[-31,86],[-9,-12],[-20,48],[-10,-36],[-28,-1],[-33,-48],[-6,47],[-20,23],[-29,-37],[-16,4]],[[47144,46093],[-28,3],[-14,-56],[-26,-65],[-30,12],[-2,99],[18,87],[23,21],[6,40],[-24,102],[-9,110],[4,52],[-26,26],[-17,-4],[6,59],[12,27],[1,80],[-18,46],[-20,10],[-11,37],[0,42],[-23,108],[-12,10],[-4,43],[-29,86],[-19,17],[-6,66],[-10,29],[-191,0],[-3,-43],[-59,-49],[-27,25],[-2,18],[-59,-36],[-14,-24],[-11,-94],[-11,-10],[-6,-73],[-8,2],[-19,-124],[-19,-47],[-10,-47],[-48,-45],[-11,-90],[-39,-40],[-10,27],[-34,-42]],[[46305,46488],[-5,20],[28,76],[11,-36],[23,13],[-9,42],[-31,92],[7,44],[-11,42],[-19,-40],[-20,15],[9,57],[-14,61],[-7,89],[-16,-4],[-28,-68],[-16,8],[13,54],[11,4],[18,62],[-7,30],[-20,-1],[-6,83],[-13,39],[-12,-22],[-4,-56],[-17,-12],[-40,62],[1,68],[-12,16],[-33,101],[-49,16],[-14,-21],[-42,40],[3,74],[-36,82],[27,75],[-11,14],[-13,97],[11,30],[-9,71],[-40,6],[-15,42],[20,37],[-25,54],[-28,-55],[9,85],[-9,6]],[[45865,47980],[13,62],[18,116],[30,101],[43,-6],[53,76],[14,53],[37,-9],[15,-26],[26,10],[18,31],[14,-18],[14,32],[17,-15],[15,12],[-2,129],[5,92],[-26,28],[-5,29],[-19,34],[-20,17],[8,54],[18,34],[25,-5],[10,-20],[20,55],[-3,48],[11,49],[-23,107],[1,48]],[[46192,49098],[62,0],[46,-24],[30,9],[9,-16],[35,-5],[-5,-95],[35,-12],[0,44],[14,13],[39,-64],[35,-21],[17,-50],[21,31],[24,-18],[12,-56],[63,56],[20,34],[26,-19],[19,31],[15,-40],[21,-8],[32,34],[48,15],[29,-27]],[[45820,47819],[30,-72],[-21,-9],[-16,51],[7,30]],[[48749,79006],[38,25],[-1,-75],[17,-13],[-68,-140],[-36,-24],[-17,74],[9,36],[33,50],[25,67]],[[48252,78812],[52,-81],[-17,-16],[-43,26],[-15,-65],[12,-34],[26,-11],[-5,-93],[12,-69],[36,-53],[-8,-112],[-28,-48],[30,-38],[0,-54],[18,-66],[-3,-79],[14,-29],[-39,-118],[0,-50],[-25,-76],[10,-44],[-44,-113],[-3,-33],[-28,-13],[25,-62],[3,-60],[-35,13],[-29,-14],[-31,33],[-54,-45],[-27,-9],[-37,19],[-11,-22],[-76,-8],[-53,-31],[13,-66],[-34,-31],[-36,0],[-62,-100],[-53,-11],[17,42],[-24,30],[-14,-19],[15,-42],[-10,-55],[-66,-62],[-37,-7],[-5,-41],[-47,12],[-6,-32],[-31,11],[-105,-69],[-16,46],[-90,-61],[-18,27],[40,33],[22,52],[40,54],[-17,33],[-40,-39],[-68,-16],[-37,-43],[-3,56],[54,58],[-25,37],[-42,-33],[-40,65],[-25,-29],[-15,26],[-6,51],[32,12],[10,44],[64,33],[28,42],[17,46],[-71,-32],[-67,13],[-25,-25],[0,65],[78,74],[0,-40],[41,27],[36,-32],[16,45],[-6,97],[49,42],[6,55],[58,14],[41,-7],[65,38],[23,-3],[13,83],[-26,-9],[-35,-74],[-35,-22],[-74,34],[-47,-36],[-46,-22],[88,140],[20,-2],[17,88],[26,45],[-24,23],[21,78],[26,57],[34,-24],[7,26],[47,28],[-25,52],[-35,-16],[-56,-3],[-41,-15],[-51,100],[-22,-43],[-37,17],[5,32],[-41,15],[-12,71],[-18,38],[42,50],[24,-7],[2,117],[45,6],[31,35],[9,53],[-55,0],[-31,-24],[0,64],[16,36],[-36,67],[15,27],[-13,50],[-19,-7],[-9,60],[22,17],[31,-31],[6,48],[82,-1],[31,-11],[51,2],[17,-24],[-4,-45],[26,-23],[20,80],[35,-2],[29,-27],[14,17],[46,4],[-18,54],[75,75],[34,11],[32,88],[-49,21],[-93,-7],[-32,30],[0,31],[24,34],[62,31],[29,64],[-19,87],[37,39],[11,67],[40,-11],[30,29],[44,-10],[16,39],[44,43],[8,-64],[26,-39],[-18,-39],[8,-34],[30,9],[-4,63],[-24,46],[12,64],[35,4],[13,54],[46,-24],[13,-30],[56,-41],[-8,-19],[-57,-43],[-28,-60]],[[47945,79410],[-16,-6],[-2,-63]],[[47187,78731],[49,13],[4,-87],[-25,18],[-28,56]],[[47892,43496],[7,-57],[0,-32],[-1,-16],[2,-9],[0,-9],[-3,0],[-1,-4],[3,-11],[-3,-5],[-1,-10],[4,0],[4,-29],[-7,-20],[4,-28],[-1,0],[-1,-110],[0,-1],[-14,-23],[-29,11],[-30,37],[0,25],[-38,41],[-79,41],[-28,49],[-28,25],[-17,39],[-78,89],[-26,61],[-42,30],[2,15],[-71,108],[-41,91],[-17,73],[-17,28],[3,27],[-24,29],[-41,74],[-24,72],[-39,77],[-15,40],[3,34],[-41,53],[-6,35],[-39,48],[-7,28],[-35,31],[-51,35],[-11,61],[-17,21],[-18,79],[-43,69],[-94,106],[10,13],[33,-31],[6,22],[-18,54],[-18,-9],[-52,109],[4,2],[3,1],[1,0],[3,0],[1,8],[4,3],[2,0],[3,3],[-2,8],[-2,9],[1,2],[4,6]],[[46829,45014],[23,72],[5,78],[13,31],[23,23],[23,90],[11,9],[36,77],[24,29],[38,117],[28,44],[0,190],[23,62],[17,22],[31,-5],[16,55],[-7,42],[9,40],[2,103]],[[47592,59848],[-334,0],[-58,0],[-487,0],[-373,0]],[[46340,59848],[28,49],[18,51],[6,53],[19,53],[102,32],[84,40],[55,31],[32,42],[97,86],[34,44],[34,113],[35,83],[33,65],[8,30],[99,122],[57,85],[34,106],[40,79],[45,151],[9,62],[18,64],[42,97],[11,38],[38,184],[15,199],[-17,34],[-12,69],[-22,48],[-30,15],[24,134],[-5,115],[4,25],[-9,66],[12,133],[-1,56],[-12,17],[20,86],[26,81],[1,53],[91,238],[7,60],[17,44],[5,89],[-13,45],[16,84],[-13,49],[48,91],[15,39],[46,89],[48,112],[28,97],[1,31],[18,40],[22,1],[35,52],[8,30],[29,21],[104,101],[42,49],[44,22],[33,60],[14,2],[35,63],[51,50],[29,49],[42,105],[18,60],[12,64],[43,149],[37,164],[26,128],[36,229],[5,8],[19,136],[20,95],[23,188],[40,-10],[26,45],[38,5],[25,49],[22,-1],[11,-30],[-1,-66],[6,-61],[12,-21],[11,-78],[19,-17],[30,-84],[17,-18],[22,-52],[16,-11],[33,-56],[90,-50],[19,-5],[31,29],[27,7],[29,27],[19,2],[39,-29],[18,18],[17,47],[35,-45],[30,-19],[39,-9],[46,40],[33,52],[15,74],[12,-70],[7,-35],[1,-63],[12,-37],[20,-21],[21,14],[32,-26],[23,-1],[30,45],[60,-44]],[[46600,50596],[-22,41],[-21,17],[-16,34],[-3,63],[-56,92],[-10,-8],[-26,45],[-11,88],[-15,39],[-12,3],[-10,115],[-24,-16],[-13,12],[3,63],[-45,50],[11,32],[-20,45],[5,20],[-27,130],[-4,63],[-34,16],[-19,40],[-33,-27],[-16,41],[-23,-19],[-15,49],[-25,33],[-5,46],[-23,71],[-19,34],[-23,65],[-21,21],[-9,46],[-47,-17],[-53,22],[-17,-14],[-54,6],[-2,32],[-37,-53],[-22,-10],[-17,-26],[-20,15],[-26,-27],[-23,37],[-9,-44],[-25,0],[-9,-26],[-22,-13],[-28,24],[-30,4],[-13,-20],[-24,-5],[-28,52],[-11,-24],[-20,6],[-12,-47],[-13,-135],[-17,-37]],[[45440,51640],[-20,36],[-7,-75],[1,-74],[0,-1],[-3,148],[15,123],[8,143],[36,229],[47,284],[15,114],[11,154],[6,184],[-5,214],[-5,136],[-22,137],[-13,185],[-19,108],[-31,90],[-30,45],[-13,76],[21,7],[36,64],[-4,48],[-16,-14],[-7,-57],[-16,-7],[34,152],[-2,38],[27,66],[1,72],[-15,20],[23,60],[-8,97],[14,54],[-11,60],[-33,97],[-5,71],[-15,68],[-27,81],[-1,-123],[-40,87],[-6,51],[-16,57],[-6,69],[-28,100],[-7,59],[-27,-99],[-14,-169]],[[45263,54905],[-5,87],[8,100],[12,71],[14,144],[219,0],[181,0],[132,0],[196,0],[140,0],[228,0],[-8,487],[-14,364],[-19,172],[11,77],[0,48],[26,54],[121,187],[60,33],[62,74],[39,23],[0,413],[0,507],[0,593],[0,314],[123,0],[181,0],[225,0],[166,0],[231,0],[0,619],[0,324]],[[45438,54190],[19,12],[-6,-72],[-19,2],[6,58]],[[47939,66711],[2,-40],[-56,-38],[-45,-66],[-42,-20],[-23,5],[-49,54],[-33,-13],[-17,21],[-23,-11],[-49,34],[-12,-34],[-17,0],[-71,-43],[23,100],[11,74],[-2,37],[15,55],[8,99],[-9,45],[9,82],[-6,152],[-18,32],[21,107],[6,76],[-10,122],[26,36],[-7,63],[-25,-29],[-20,18],[-44,-59],[-44,-16],[10,52],[-2,54],[-24,99],[-11,-17],[-39,14],[-11,62],[23,115],[-2,95],[22,94],[-3,112],[32,48],[44,113],[-1,25],[15,105],[16,78],[31,188],[-13,31],[15,93],[33,241],[27,15],[-17,37],[15,218],[-7,81],[-13,48],[-7,77],[-13,76],[2,80],[-27,161],[1,64],[15,40],[19,21],[2,11],[0,12],[5,11],[14,12],[5,8],[2,22]],[[45236,63463],[-18,21],[-15,55],[20,41],[41,-45],[40,20],[23,-49],[23,-14],[-26,-77],[-31,-6],[-45,33],[-12,21]],[[43031,66553],[-3,-47],[-19,-5],[-1,43],[23,9]],[[42919,67054],[-39,25],[-16,-13],[-42,68],[6,52],[27,-9],[8,-31],[29,-22],[51,10],[21,19],[50,-4],[0,-65],[-33,-8],[-28,-23],[-34,1]],[[42481,67743],[-6,-24],[-55,9],[-19,26],[-2,65],[29,15],[43,-13],[12,-18],[-2,-60]],[[42217,67737],[70,-78],[-18,-18],[-32,40],[-22,9],[-46,47],[-20,55],[68,-55]],[[42187,67581],[-31,-48],[-8,20],[-50,8],[-19,21],[-6,55],[16,23],[24,-2],[27,-37],[47,-40]],[[42042,67700],[12,-19],[-10,-47],[-24,-4],[-11,34],[17,55],[16,-19]],[[41349,68284],[-5,-31],[-25,-9],[-2,81],[29,8],[3,-49]],[[46192,49098],[-169,4],[-156,1],[-90,3],[-37,-54],[-20,-45],[-76,-88],[-59,17],[-18,-6],[-23,24],[-33,-17],[-12,8],[-49,-66]],[[45450,48879],[-10,43],[10,71],[27,43],[36,-7],[37,41],[27,-44],[30,-17],[10,48],[-40,-7],[-26,59],[-19,-30],[-50,7],[-26,41],[-1,-50],[-19,6],[-25,87],[-12,72],[37,-14],[21,13],[-46,42],[-22,78],[-12,-18],[-29,-82],[3,113],[10,70],[4,2],[3,4],[-1,2],[0,0],[1,0]],[[45368,49452],[134,-2],[108,0],[0,53]],[[45610,49503],[0,1]],[[45610,49504],[0,76],[32,12],[32,-8],[16,28],[38,-27],[22,8],[20,38],[8,79],[30,49],[8,-37],[22,-47],[45,-42],[16,-3],[25,-52],[26,10],[19,-40],[42,-53],[26,8],[7,-15],[27,1],[7,42],[31,8],[15,22],[26,1],[19,72],[-27,94],[-24,19],[-63,-46],[-10,-30],[-23,-13],[-29,32],[-28,99],[-25,13],[-27,-30],[-20,28],[-2,44],[-24,54],[-26,3],[-27,21],[-41,-53],[-29,24],[-28,-40],[-14,-99],[-170,1]],[[45532,49755],[-6,0]],[[45526,49755],[-110,0]],[[45416,49755],[0,81],[8,77],[16,18],[-1,82],[-14,35],[-6,86],[16,22],[40,-16],[13,21],[-42,39],[-29,-2],[-7,42],[-21,-76],[-16,-6],[-1,-54],[-23,-29],[-9,9],[-6,78],[-14,5],[-9,51],[-14,34],[-1,48],[-10,39],[-24,35],[-30,123],[-22,51],[-43,29],[-14,-48],[-22,57],[25,12],[31,32],[55,71],[4,25],[67,206],[78,312],[19,103],[16,181],[12,25],[2,87]],[[45420,48872],[-41,0]],[[45379,48872],[-2,42],[9,70],[2,69],[18,-23],[4,-101],[10,-57]],[[55563,83099],[46,-7],[7,-63],[-29,5],[-66,71],[-30,-6],[-34,55],[-37,4],[4,47],[29,35],[49,23],[2,69],[24,7],[23,-36],[36,-15],[40,-49],[-5,-53],[-55,-17],[-4,-70]],[[43668,51459],[-23,4],[-25,48],[16,56],[-1,62],[33,14],[24,-19],[10,-38],[-4,-73],[-30,-54]],[[43613,52066],[19,24],[14,-129],[-15,-57],[-15,76],[-3,86]],[[43552,50969],[7,30],[24,-35],[3,-79],[-19,-36],[-21,35],[6,85]],[[43483,50746],[-5,-43],[-15,-8],[-30,14],[-18,31],[-21,86],[10,119],[-4,57],[17,0],[5,-51],[21,-33],[8,-38],[20,-33],[19,-74],[-7,-27]],[[43234,51963],[20,-28],[19,10],[15,-21],[28,-4],[10,-44],[-25,4],[-14,25],[-28,-9],[-16,-58],[-11,58],[-17,50],[19,17]],[[43222,50787],[17,11],[11,-24],[6,-90],[-10,-36],[-28,-14],[-25,54],[5,62],[24,37]],[[43134,50628],[-8,40],[16,24],[3,-56],[-11,-8]],[[43057,52118],[23,-5],[13,-47],[-34,-26],[-27,38],[9,36],[16,4]],[[43051,52322],[14,-58],[-6,-24],[-27,-31],[-27,-67],[-33,-10],[-11,134],[70,74],[20,-18]],[[48187,84687],[26,-21],[-7,-71],[-45,28],[0,63],[26,1]],[[48065,84673],[56,-22],[4,-55],[33,-25],[-15,-58],[-86,92],[-27,77],[35,-9]],[[48057,84181],[27,16],[44,-51],[0,-50],[-38,-5],[-4,40],[-29,50]],[[48003,84684],[27,-16],[5,-20],[26,-52],[26,-28],[37,-80],[-14,-54],[-49,60],[-18,53],[-25,3],[-35,46],[20,88]],[[47978,84578],[59,-48],[-38,-47],[-46,24],[-27,48],[52,23]],[[53693,41566],[0,-76],[-24,-57],[-15,-73],[13,-32],[-6,-58],[-13,-46],[4,-67],[-4,-31],[17,-34],[17,-138],[-21,-25],[3,-48],[32,2],[20,49],[16,9],[11,-22],[23,6],[14,36],[35,30],[12,-7],[6,50],[27,2],[45,-38],[33,13],[27,-38],[8,-32],[0,-55],[26,-95],[9,-72],[12,-35],[3,-82],[-34,-89],[1,-49],[-38,-73],[-28,22],[-19,-53],[2,-48],[-31,-43],[-8,-66],[-14,-49],[12,-54],[-5,-27],[10,-101],[-31,-88],[19,-39],[11,12],[19,-33],[19,10],[23,-32],[14,-110],[28,7],[36,-36],[1,-32],[24,-63],[-1,-40],[-18,-93],[7,-49],[-14,-37],[0,-90],[11,-45],[-3,-39],[13,-76],[-12,-72],[14,-12],[-24,-157],[4,-143],[-3,-72],[-48,-55],[4,-54],[-3,-58],[-9,-42],[-12,-8],[2,-52],[18,-49],[-29,-32],[-3,-47],[-12,-39],[-17,26],[-23,8],[-21,-11],[-2,52],[10,31],[-28,155],[-14,35],[-8,-70],[-31,-99],[-38,-66],[-29,1],[-11,21],[-35,34],[-13,-17],[-19,12],[-23,40],[-4,46],[-29,65],[4,29],[-12,49],[-7,72],[-25,33],[-9,32],[-31,23],[-27,-79],[-12,22],[-2,-88],[13,-87],[-8,-23],[8,-40],[-11,-58],[13,-31],[1,-52],[-112,-2],[-19,7],[-16,52],[-22,-20],[-6,-40],[-31,-19],[-7,-60],[-30,54],[-3,39],[-16,23],[-10,-19],[3,-99],[16,-72],[-7,-76],[-13,-70],[37,-52],[5,-59],[23,-14],[8,-35],[-36,-57],[30,-51],[7,-27],[39,-61],[3,-66],[-14,-23],[-8,-67],[-10,-20],[12,-61],[-12,-26],[-15,7],[-35,-32],[-1,78],[-30,72],[-20,-5],[-33,-84],[-9,9],[-18,-32],[-7,-100],[-21,-95]],[[53098,37169],[-36,69],[-8,103],[23,-9],[19,-48],[6,18],[-25,49],[-24,12],[-22,52],[-58,105],[-12,90],[-32,63],[-3,23],[-32,91],[-39,83],[-82,151],[-28,58],[-2,27],[-31,80],[10,22],[17,-60],[48,-71],[16,-2],[10,71],[-14,21],[-19,-40],[-2,57],[-43,68],[-24,-54],[-39,93],[-9,38],[-1,64],[-11,42],[-40,106],[-32,97],[28,-28],[38,-11],[-13,64],[-44,12],[-14,-10],[0,65],[-11,113],[16,10],[7,-45],[22,23],[30,14],[-4,75],[-24,-56],[-28,-10],[-14,74],[16,11],[-10,70],[-14,-56],[-55,102],[-7,76],[-53,246],[-29,150],[22,-7],[5,-74],[37,43],[9,-18],[8,7],[8,18],[1,4],[2,3],[0,3],[17,-11],[19,99],[24,70],[13,64],[3,132],[6,35],[1,80],[5,55],[-9,114],[-4,84],[17,22],[-2,-130],[21,2],[14,-81],[7,69],[16,-31],[17,12],[10,-34],[19,6],[13,-51],[16,-23],[6,67],[18,24],[-24,85],[-14,14],[-15,-28],[-15,63],[-7,-37],[-26,58],[-17,-19],[-6,44],[-30,113],[-16,5],[4,74],[33,16],[2,-49],[26,-108],[19,16],[10,-36],[16,32],[-20,103],[-7,140],[-11,102],[2,53],[18,-12],[7,51],[25,-11],[16,-40],[12,17]],[[52737,40726],[169,0],[243,0],[0,462],[0,378]],[[52501,39545],[8,-12],[-5,-11],[4,-19],[-3,1],[0,-6],[-5,-11],[-13,-6],[-3,33],[17,31]],[[45610,49504],[-21,28],[-6,-10],[-19,38],[-34,-31],[-27,12],[0,56],[15,32],[32,2],[19,-17],[22,31],[38,-9],[20,24],[10,-29],[19,21],[7,33],[-40,31],[-15,-36],[-58,-14],[-16,9],[-25,-14],[1,94]],[[45368,49452],[-1,2],[-1,-2],[-1,0],[-1,-4],[-4,-1],[-12,-70],[0,0],[-12,68],[-5,83],[3,75],[35,75],[5,-52],[18,-23],[-6,-55],[53,-45],[19,-4],[5,29],[32,-10],[21,-21],[46,45],[16,-28],[8,7],[24,-18]],[[45526,49755],[-7,-66],[-28,-12],[1,-56],[-29,-41],[-23,-13],[-22,25],[10,63],[-18,29],[6,71]],[[45865,47980],[-1,-1],[-4,-18],[0,-4],[-1,-4],[-20,5],[-8,-64],[-23,-24],[1,54],[11,17],[24,90],[-42,-14],[-15,-26],[-11,42],[8,20],[15,-16],[-5,51],[9,84],[-8,15],[-6,-120],[-14,29],[-22,3],[10,31],[-20,20],[24,49],[-54,25],[20,21],[16,71],[15,34],[-8,23],[-28,-51],[-22,10],[-6,29],[4,56],[-10,25],[33,89],[18,-12],[39,4],[21,21],[11,37],[-13,19],[-20,-52],[-32,10],[-14,32],[-36,-15],[-16,-40],[-23,60],[15,29],[-40,18],[-9,-15],[-43,25],[-13,-73],[-50,-35],[-24,13],[-9,35],[21,38],[3,31],[-14,30],[14,62],[-20,36],[17,24],[13,-16],[19,20],[41,-8],[22,-34],[44,18],[16,45],[-29,14],[-23,-40],[-21,32],[-13,-2],[-38,38],[-23,-13],[-14,22],[-17,-31],[-20,6],[-16,-24],[-19,3],[-3,31],[1,0],[0,1],[5,1],[4,0],[7,-1],[4,4]],[[45644,48511],[-33,21],[-9,-48],[-25,45],[29,35],[30,5],[21,35],[4,-33],[19,-31],[-12,-46],[-17,-25],[-7,42]],[[45629,48085],[14,-19],[-19,-46],[-9,22],[14,43]],[[45547,48249],[20,14],[16,-41],[-15,-18],[-22,0],[1,45]],[[45512,48496],[31,-5],[-10,-51],[-21,56]],[[45523,48015],[-17,-99],[-13,26],[30,73]],[[45473,48287],[-3,-43],[-31,27],[8,27],[26,-11]],[[45423,48873],[2,0],[5,-38],[-12,-36],[-29,20],[-19,53],[3,0],[1,0],[4,0],[1,0]],[[45420,48872],[3,1]],[[52737,40726],[9,56],[-1,63],[-32,-48],[1,58],[-13,20],[-19,-90],[-21,-33],[-8,55],[-14,21],[-27,-30],[-13,39],[14,91],[15,35],[-1,43],[28,68],[16,75],[-2,55],[29,70],[8,58],[23,52],[-17,125],[8,38],[-4,130],[13,11],[5,-69],[12,-14]],[[52392,42621],[20,81],[60,6],[9,-35],[-3,-66],[-18,-59],[-26,-158],[-24,-80],[-66,52],[-7,57],[12,74],[29,-2],[13,77],[1,53]],[[46829,45014],[-5,-8],[2,-11],[0,-8],[-4,0],[-3,-3],[-2,-8],[-15,3],[-27,38],[-13,37],[-77,104],[-104,104],[-44,36],[0,78],[29,8],[29,21],[-15,36],[-29,22],[-10,59],[20,23],[-17,70],[-11,15],[-21,-59],[-26,-1],[-14,-35],[-18,31],[7,62],[-16,15],[-5,-39],[-31,47],[25,7],[5,43],[-17,20],[1,75],[10,17],[-31,71],[1,42],[-33,-10],[-26,-48],[-3,78],[-31,100],[-4,57],[24,-3],[27,-72],[11,42],[16,24],[4,33],[24,4],[-18,69],[-19,-10],[-25,28],[2,-76],[-15,0],[-16,77],[0,119],[50,-18],[-3,34],[15,57],[-13,54],[-23,-7],[-42,30]],[[46473,45461],[26,-21],[1,-29],[25,-32],[-7,-37],[-73,69],[12,63],[16,-13]],[[52047,41195],[16,-3],[-1,-68],[-24,2],[9,69]],[[51817,40265],[18,35],[23,-1],[18,-78],[-3,-35],[-25,-99],[-40,-61],[0,60],[-9,27],[-3,85],[21,67]],[[94147,900],[-12,-86],[-20,6],[15,69],[17,11]],[[92652,19812],[10,-69],[-9,-187],[6,-60],[16,-27],[-10,-90],[3,-53],[-37,-112],[-10,-56],[2,-54],[-26,-88],[6,-67],[-5,-116],[-7,-44],[-19,-200],[3,-35],[-21,-84],[1,-87],[-17,-75],[-18,-121],[-11,-40],[-12,-149],[3,-101],[24,-62],[-15,-67],[8,-30],[-16,-47],[-12,-72],[1,-73],[-14,-53],[6,-54],[-28,-81],[-9,-101],[-39,-114],[-29,4],[11,-56],[-16,-55],[-9,-67],[-1,-63],[12,-82],[-9,-86],[-52,-57],[-12,-43],[-26,-44],[-34,-26],[-30,20],[3,-48],[13,-13],[23,21],[20,-27],[-53,-34],[-53,-64],[-33,-112],[-15,-108],[-16,-36],[0,-34],[-16,-29],[-28,-138],[-30,-20],[-14,-33],[26,-22],[-11,-60],[-5,-116],[-12,-83],[-25,0],[6,-63],[-6,-24],[-45,-83],[-17,-63],[-10,-100],[-16,-25],[14,-81],[-15,-117],[-33,-73],[16,-38],[5,-44],[-32,-31],[8,-64],[-17,1],[-44,-125],[-1,-56],[-23,-69],[1,-49],[-27,-80],[-21,-133],[-19,-35],[1,-96],[-9,-32],[3,-176],[-19,-65],[-1,-110],[-24,-120],[-21,-143],[11,-77],[-19,-55],[22,-4],[14,-27],[5,-56],[-22,-45],[9,-125],[-4,-42],[-16,-20],[-33,-1],[-30,-100],[-37,-33],[-13,-26],[-58,-16],[-20,8],[-79,-3],[-57,-19],[-101,2],[-49,-18],[-52,-37],[-50,-2],[-28,32],[-18,-21],[21,-34],[-48,-71],[3,-28],[40,72],[3,-24],[-65,-110],[-111,-226],[-56,-126],[-124,-45],[-25,16],[-25,-10],[-20,-33],[21,-52],[2,-39],[55,-11],[5,-27],[-14,-49],[11,-45],[-15,-57],[-16,-7],[-6,53],[-48,156],[-38,20],[-17,-60],[-15,14],[-23,106],[-5,60],[-14,9],[-31,-31],[-25,16],[-23,71],[-18,31],[2,72],[25,-3],[9,53],[-16,74],[-56,22],[-28,-81],[8,-62],[-23,12],[-23,-28],[-7,-38],[-39,-7],[-16,88],[42,33],[13,70],[24,53],[-5,95],[-21,27],[-15,91],[-18,10],[-25,-28],[-44,-86],[-38,-32],[-1,-28],[-34,6],[-9,-42],[16,-17],[40,2],[20,34],[17,-8],[8,-40],[-28,-57],[-35,-26],[-18,6],[-28,-32],[-20,-49],[-61,-59],[-17,-64],[-37,-90],[-45,-34],[-5,-30],[-41,-54],[-24,53],[-35,24],[-23,-6],[-34,72],[-20,23],[-24,-1],[-41,42],[-71,115],[-45,42],[-61,-30],[-55,74],[-20,16],[-52,3],[-27,-44],[14,-49],[-36,2],[-34,36],[-30,89],[-24,42],[-47,59],[-55,23],[-46,-13],[-35,40],[-47,75],[-27,126],[-39,97],[-4,39],[-24,42],[-10,-9],[-52,148],[-15,62],[10,34],[-15,90],[-18,39],[46,92],[6,106],[-18,139],[-24,130],[-33,132],[1,39],[-22,83],[-36,66],[-23,60],[-72,132],[27,74],[31,-41],[-12,-69],[7,-31],[28,5],[9,65],[-39,57],[15,28],[25,9],[-27,92],[-27,19],[-8,-45],[-46,-19],[-9,-35],[-36,-18],[-10,-37],[-21,9],[-22,-21],[-7,-34],[-23,-37],[-67,3],[-26,-19],[-26,28],[18,70],[38,46],[12,51],[28,30],[8,83],[-1,83],[14,67],[-11,113],[3,42],[24,24],[-19,37],[-30,109],[-36,67],[-13,124],[-32,122],[-18,-24],[-11,-58],[-1,-79],[-23,-50],[-8,-60],[4,-76],[-12,-109],[-17,-78],[-11,-84],[-7,-95],[-15,-27],[-36,38],[-34,12],[-35,-50],[-22,-6],[-22,-48],[-39,14],[-17,-41],[-22,-5],[-9,29],[29,78],[8,41],[-7,35],[11,66],[10,14],[40,4],[34,16],[27,-43],[23,46],[13,218],[-12,113],[10,78],[1,62],[-15,67],[20,5],[13,63],[-3,39],[19,68],[5,46],[23,44],[30,93],[19,8],[22,52],[-31,115],[2,38],[-16,39],[5,57],[60,69],[-9,56],[-16,22],[-14,108],[-2,55],[-12,49],[-8,94],[-19,-17],[-4,-56],[16,-49],[1,-75],[-9,-102],[-32,29],[-15,-15],[-5,-48],[-16,-39],[-22,-25],[-4,-62],[-17,-62],[1,-53],[-19,-67],[-10,-70],[-18,-66],[-20,-26],[-33,-16],[-26,30],[-16,-41],[-4,-46],[-16,-3],[-37,-55],[-21,-16],[-4,-29],[-36,-45],[-24,-50],[-12,-78],[-15,-57],[-23,-54],[-27,-43],[10,-31],[-52,-63],[-19,-74],[-6,-88],[24,-9],[21,-156],[-42,48],[-18,42],[-21,-4],[-8,-57],[-19,38],[-38,104],[-36,47],[-2,37],[-30,61],[23,18],[23,-84],[15,16],[-4,53],[-19,79],[-7,117],[-10,53],[-19,31],[11,56],[-7,64],[-20,75],[-39,87],[-55,89],[5,61],[-5,82],[-12,76],[-17,37],[-11,73],[-29,25],[-10,-19],[-30,15],[-37,-31],[-16,25],[0,39],[-24,120],[-23,3],[11,51],[-4,52],[13,44],[19,-29],[16,49],[-10,99],[-19,53],[-36,33],[-18,-38],[-40,-12],[5,77],[22,-18],[-11,73],[-25,68],[-29,23],[-11,59],[-17,19],[-15,-59],[-27,48],[-34,-56],[-20,-18],[-35,21],[-23,52],[-42,48],[-21,39],[-69,35],[-28,-9],[-12,-38],[-46,-24],[-26,10],[-18,51],[-88,148],[-83,105],[-65,68],[-37,24],[-30,-53],[-49,-42],[-18,-7],[-61,16],[-20,-5],[-55,12],[-105,-10],[-18,-12],[-87,-12],[-134,-37],[-26,-15],[-42,-45],[-46,-66],[-57,-61],[-114,-98],[-89,-46],[-34,-28],[-17,-27],[-84,-45],[-77,-16],[-50,4],[-22,-11],[-77,19],[-56,36],[-35,-32],[-34,-8],[-33,-42],[-46,-74],[-38,-71],[-61,-42],[-63,-82],[-17,-6],[-35,-72],[-42,-49],[-83,-28],[-32,-21],[-26,-36],[-21,-47],[-19,-70],[-23,-146],[-10,-122],[-24,-27],[-6,-27],[-32,-66],[-4,-63],[-42,-52],[-11,-37],[-39,28],[-22,-17],[-11,-42],[-30,-23],[-18,84],[-32,6],[-48,-18],[-11,19],[-51,-10],[-28,-31],[-38,19],[-53,-72],[-18,31],[-9,53],[-24,48],[-24,-9],[-14,-34],[-21,-14],[-28,33],[-9,-19],[-24,39],[-56,14],[-55,-38],[-22,13],[-29,-14],[-31,9],[-17,-24],[-57,3],[-46,-62],[-34,21],[-37,6],[-17,-13],[-22,21],[-27,-38],[-26,4],[-33,-65],[-24,-21],[-32,-100],[-13,-105],[-20,1],[-3,-61],[-23,11],[-15,-52],[-54,42],[-31,5],[-15,-36],[-27,-7],[-16,-30],[-7,-74],[-73,-63],[-15,-46],[-13,-69],[-28,-3],[-24,-42],[-40,-38],[-14,21],[-56,-49],[-37,-3],[-11,-37],[-33,26],[-24,34],[-3,45],[-30,-38],[-50,-8],[-43,6],[-6,-28],[-56,53],[-24,-45],[-28,34],[-14,-3],[-61,92],[-37,26],[-35,3],[-14,81],[-41,96],[-43,88],[-59,84],[-26,27],[-49,-4],[-4,-34],[-36,81],[4,40],[-13,71],[2,62],[-7,107],[6,54],[-5,59],[14,52],[7,66],[21,-61],[28,-19],[21,1],[34,33],[40,111],[16,97],[22,19],[-8,84],[-2,126],[-12,122],[-6,121],[44,15],[2,34],[-17,46],[9,84],[-9,28],[17,136],[-9,92],[1,156],[-14,111],[-40,181],[-31,107],[-32,202],[-21,90],[-15,36],[-5,42],[-33,187],[3,22],[-9,101],[1,42],[-12,36],[1,66],[-13,58],[7,86],[-6,178],[11,134],[-20,130],[-15,140],[-66,175],[-8,71],[4,32],[-6,84],[-21,92],[-25,64],[-8,43],[-24,76],[-11,12],[-28,71],[-20,189],[16,102],[-16,147],[-37,186],[-54,235],[-67,213],[-58,132],[-17,114],[-20,61],[71,-16],[16,-76],[15,-25],[-1,-162],[19,9],[11,-57],[24,28],[18,1],[19,78],[-4,82],[3,32],[-22,60],[-32,27],[-19,84],[-11,3],[-6,110],[-11,15],[-11,94],[-2,60],[-16,-13],[6,75],[10,42],[12,5],[6,-51],[15,-13],[6,-55],[31,-52],[10,-64],[-7,-95],[-10,-21],[1,-66],[25,-51],[29,120],[22,-220],[29,-75],[35,53],[9,45],[-13,105],[19,14],[-3,55],[-15,61],[23,84],[-30,49],[-17,77],[-18,35],[-8,61],[-16,46],[-12,67],[-10,81],[-16,88],[-24,31],[-16,56],[5,70],[-19,50],[0,89],[-38,129],[-22,62],[-1,132],[-4,57],[14,30],[-6,65],[10,54],[4,84],[26,100],[13,90],[25,43],[21,67],[5,132],[-9,84],[2,35],[17,72],[-4,88],[-12,85],[-24,91],[-7,80],[10,9],[38,189],[9,87],[18,126],[18,74],[23,42],[24,22],[-7,-122],[-16,-136],[0,-33],[26,-100],[-18,-53],[0,-73],[13,-30],[20,32],[8,44],[16,-1],[0,-61],[32,-32],[13,116],[8,13],[4,94],[17,50],[-7,42],[24,3],[1,53],[10,8],[10,66],[18,54],[-5,59],[41,73],[23,-13],[31,57],[27,-2],[60,74],[18,-16],[15,82],[40,82],[47,60],[20,113],[14,27],[60,58],[-1,46],[36,17],[7,25],[34,15],[16,46],[21,2],[28,61],[30,100],[13,-6],[-22,-92],[13,-34],[40,-14],[10,45],[35,12],[24,-85],[21,9],[26,-37],[22,28],[22,8],[14,23],[19,-12],[35,39],[23,3],[9,60],[24,15],[4,32],[-9,40],[53,89],[14,-35],[25,31],[15,-20],[18,26],[39,6],[2,-15],[39,18],[29,29],[24,97],[19,37],[7,55],[18,1],[15,54],[20,6],[56,-34],[9,4],[38,-56],[17,1],[17,41],[13,-15],[16,47],[53,27],[61,14],[34,24],[70,67],[17,11],[98,107],[26,33],[44,93],[26,70],[47,163],[42,230],[-3,65],[25,6],[18,36],[-9,49],[16,54],[0,28],[25,5],[31,51],[13,46],[18,12],[26,55],[1,22],[27,25],[17,29],[0,53],[11,50],[-43,18],[-21,-30],[7,150],[-6,95],[-14,69],[1,146],[6,64],[15,20],[12,46],[15,9],[-5,75],[32,59],[17,-14],[2,43],[32,-31],[-15,71],[9,84],[12,-25],[39,18],[8,30],[-14,43],[11,66],[18,26],[16,45],[6,64],[29,25],[6,-72],[-13,3],[-10,-51],[-2,-49],[20,-20],[0,-38],[19,-43],[-4,-61],[22,-27],[-13,-54],[20,-10],[23,-63],[2,-49],[29,-134],[-20,-40],[6,-67],[31,56],[14,-32],[18,-73],[33,69],[-10,51],[20,12],[4,48],[-40,116],[11,31],[28,-95],[20,-17],[24,9],[3,39],[17,61],[-4,81],[1,76],[-27,21],[-18,-17],[0,56],[-38,26],[-17,57],[0,72],[-22,-11],[-1,44],[25,-23],[11,38],[-7,29],[27,56],[-21,34],[-20,91],[43,27],[14,-20],[8,-53],[-16,-12],[21,-51],[9,-49],[14,-8],[5,47],[17,67],[42,-22],[15,-21],[4,-64],[17,-20],[18,6],[24,-44],[-11,-37],[9,-47],[16,15],[10,38],[-13,37],[1,42],[47,3],[55,-17],[-1,26],[-55,65],[-38,-37],[-18,-1],[-4,49],[5,36],[39,67],[16,14],[-10,91],[7,75],[45,75],[-5,43],[12,19],[-8,54],[-15,-29],[-7,-49],[-24,-57],[-16,-89],[-21,61],[-16,-1],[-4,91],[15,45],[-6,82],[7,41],[19,19],[16,-33],[26,63],[8,107],[27,-14],[44,-67],[-3,-73],[25,-34],[16,84],[10,81],[-28,6],[-31,-39],[-11,39],[3,84],[8,54],[17,-20],[17,26],[-7,83],[18,2],[-2,-57],[29,-53],[32,25],[8,-38],[27,22],[2,47],[-12,33],[-26,9],[10,80],[-38,36],[3,33],[-15,31],[24,61],[15,60],[36,15],[13,-28],[9,60],[29,10],[7,69],[-11,63],[13,59],[19,-43],[-7,-26],[-5,-74],[9,-36],[38,-1],[6,-89],[35,62],[24,13],[-13,75],[22,53],[-9,50],[18,12],[10,45],[-2,34],[-15,38],[-17,-14],[-6,51],[35,28],[13,-44],[0,-86],[24,-53],[22,45],[-14,26],[12,30],[0,39],[40,37],[-10,-60],[20,-58],[23,-16],[25,24],[11,60],[-12,45],[48,16],[-16,42],[-17,84],[37,39],[21,5],[32,-68],[0,-36],[18,-63],[9,46],[17,-20],[9,25],[14,-41],[9,38],[31,-52],[-2,-54],[60,-94],[9,-43],[18,-41],[15,-113],[37,-45],[1,-62],[18,27],[41,-99],[-9,-20],[12,-57],[-17,-18],[-17,14],[12,-81],[-13,-83],[11,-99],[-2,-53],[-27,-13],[-2,6],[-5,2],[-2,16],[-6,3],[-9,99],[-11,-32],[4,-43],[13,-26],[8,-1],[0,-19],[8,-1],[3,-11],[7,-4],[1,-10],[-14,-24],[8,-121],[-35,1],[-9,-46],[1,-45],[48,32],[-6,50],[36,-56],[10,53],[-17,38],[11,34],[16,6],[18,-34],[31,29],[-5,63],[-10,23],[-1,81],[-26,61],[7,39],[14,13],[17,-58],[28,25],[21,65],[-4,89],[-11,18],[7,46],[21,-79],[19,6],[40,-33],[20,-33],[22,-65],[20,0],[10,-46],[27,-4],[7,-49],[13,-6],[12,106],[21,8],[7,35],[15,4],[11,-47],[23,-40],[4,-53],[16,19],[35,-39],[23,-12],[1,36],[-25,10],[-14,30],[5,153],[8,28],[25,0],[13,16],[8,49],[22,14],[-17,49],[-25,-41],[-27,-16],[0,80],[24,48],[8,62],[-15,12],[-7,-31],[-26,55],[-31,-28],[-23,48],[-31,8],[1,62],[18,44],[-6,32],[20,31],[12,-33],[18,69],[12,2],[-4,59],[33,39],[3,35],[-9,70],[18,46],[2,89],[28,159],[3,-47],[16,-20],[27,20],[14,37],[15,14],[24,71],[1,34],[-10,65],[-27,23],[6,169],[18,-13],[32,17],[11,86],[-1,56],[19,33],[13,0],[34,-47],[23,32],[-21,48],[-10,50],[7,62],[-2,53],[18,10],[29,-24],[1,-116],[27,-9],[27,-38],[4,95],[-32,94],[39,29],[15,-46],[16,36],[-21,65],[-4,79],[28,4],[27,-104],[27,-56],[35,73],[53,-10],[16,-15],[1,-58],[34,52],[-4,44],[26,32],[13,-43],[38,-34],[28,76],[26,24],[8,-49],[14,35],[13,-25],[2,-67],[25,36],[-12,79],[25,35],[40,-15],[-16,91],[7,65],[21,4],[4,54],[-23,14],[-18,31],[24,67],[11,-9],[11,47],[-35,52],[-16,76],[-13,16],[-28,-13],[-14,10],[-19,-19],[-15,11],[-29,-48],[-22,-3],[-20,66],[-5,62],[-27,31],[-13,47],[15,17],[12,-25],[42,35],[4,-80],[15,-20],[5,-60],[13,3],[7,53],[-12,32],[5,36],[-20,66],[13,17],[21,-33],[26,19],[6,-91],[18,45],[17,-41],[22,-92],[11,-9],[10,-70],[15,-10],[26,58],[4,27],[19,-18],[15,46],[18,-48],[27,-144],[16,-70],[9,4],[31,-38],[25,20],[65,-61],[57,82],[21,-34],[-3,-28],[-22,0],[-4,-38],[9,-45],[20,-23],[6,27],[27,46],[11,-57],[16,6],[17,-73],[-21,-112],[19,8],[7,83],[13,11],[8,42],[14,-43],[28,-36],[49,34],[22,60],[22,4],[11,-87],[-2,-55],[49,-10],[21,-67],[20,18],[16,-51],[15,-3],[10,34],[22,18],[12,42],[27,24],[14,-3],[30,75],[51,46],[-25,-78],[-25,-44],[2,-53],[24,-67],[10,71],[35,50],[10,-97],[14,8],[1,-56],[-26,-63],[30,-17],[40,-1],[17,-10],[29,72],[9,72],[12,36],[-25,15],[-22,-4],[-3,40],[13,65],[31,33],[10,41],[18,-41],[10,24],[18,-89],[0,-27],[19,-88],[13,-23],[15,29],[-11,55],[22,15],[23,-37],[18,-74],[-9,-49],[-27,-81],[-20,18],[-4,-53],[-16,-115],[-31,-20],[-5,-43],[-15,-32],[24,-51],[20,-27],[-19,-33],[0,-42],[-11,-64],[-16,-48],[-19,-19],[-10,32],[4,85],[-14,31],[-14,-88],[-14,1],[-8,-66],[-19,29],[-29,-26],[-17,35],[-15,-51],[-15,-121],[-2,-62],[-14,-27],[14,-42],[1,-98],[31,5],[18,23],[-12,-131],[-22,-66],[1,-33],[-14,-111],[-41,-76],[-7,-45],[-38,-89],[-10,-102],[-32,-12],[-25,23],[-16,43],[-18,-55],[3,-42],[16,-25],[16,-54],[-3,-63],[10,-88],[19,34],[19,-16],[-2,-32],[20,-49],[12,-86],[12,-25],[11,50],[30,19],[16,-23],[37,-77],[35,-44],[25,-50],[0,-29],[43,-111],[19,-6],[5,-48],[18,-18],[21,-85],[-9,-48],[19,-5],[8,-60],[21,24],[18,-29],[7,68],[35,-22],[-2,27],[26,15],[24,-50],[43,-44],[23,-68],[36,-44],[34,-9],[46,-61],[31,-115],[55,-125],[31,-62],[73,-60],[28,-10],[26,11],[35,-47],[36,-32],[43,-26],[14,-63],[18,-19],[-4,-42],[5,-59],[16,-94],[22,-42],[32,-11],[36,-54],[29,-64],[82,-67],[14,-57],[23,-9],[75,26],[71,65],[48,85],[16,10],[23,100],[-3,14],[16,161],[-2,48],[42,149],[33,100],[4,57],[12,32],[9,65],[-6,24],[18,145],[20,89],[-12,126],[7,0],[5,134],[11,128],[29,185],[3,40],[21,6],[10,29],[-11,82],[3,54],[-19,97],[-8,89],[-4,106],[-7,79],[21,174],[10,34],[-12,24],[-4,64],[-30,100],[11,221],[15,96],[19,70],[28,10],[-24,134],[-17,123],[11,71],[24,30],[13,40],[12,102],[25,-39],[-1,-74],[7,-66],[18,3],[0,36],[-14,32],[1,74],[-14,38],[2,42],[-31,30],[-10,44],[-23,44],[-5,-73],[-14,-9],[18,106],[16,129],[6,11],[21,126],[11,44],[18,-34],[-2,-102],[41,102],[-24,40],[-5,78],[14,84],[14,138],[10,67],[14,24],[-5,147],[14,57],[0,74],[-13,43],[9,36],[35,11],[20,25],[15,66],[6,51],[20,-1],[9,21],[18,-48],[-22,-56],[-14,-114],[68,19],[20,-76],[4,-58],[-4,-78],[19,-55],[-5,-62],[-1,-92],[7,-57],[-1,-150],[30,-63],[20,-4],[16,24],[15,-11],[11,-52],[-26,-121],[-2,-143],[9,-22],[21,30],[22,-39],[1,-81],[44,-77],[-21,-126],[-3,-90],[18,-41],[4,84],[15,-4],[9,-98],[-3,-80],[4,-40],[3,-110],[19,-61],[-3,-96],[-10,-62],[-5,-85],[4,-53],[13,-26],[6,-89],[19,-24],[5,-129],[23,-145],[19,-59],[37,-46],[34,-4],[-9,51],[26,37],[16,-3],[-8,125],[39,-47],[6,26],[27,39],[10,50],[29,-67],[-5,-35],[10,-122],[14,-23],[5,-40],[41,-29],[33,-50],[4,-59],[14,-14],[13,-64],[37,16],[28,-85],[16,-11],[-37,-108],[12,-86],[13,-8],[-6,-83],[-11,-28],[11,-103],[9,-21],[-2,-46],[13,-49],[-2,-62],[7,-23],[-7,-60],[19,-30],[14,-80],[-17,-132],[4,-46],[-6,-85],[18,-47],[27,-97],[4,-30],[25,-38],[14,-44],[17,-86],[16,30],[23,-3],[4,-41],[-10,-30],[-2,-60],[15,-46],[6,-75],[14,-79],[15,-37],[-3,-81],[24,-101],[-17,-88],[7,-64],[-7,-61],[-12,-38],[-10,-86],[-1,-78],[19,-79],[22,-54],[14,-84],[27,-8],[4,-95],[-10,-92],[-14,-33],[16,-26],[14,-50],[30,-77],[31,-55],[38,-39],[3,-22],[37,-26],[13,-39],[23,-31],[19,42],[22,-62],[-11,-35],[0,-44],[28,-6],[29,7],[6,33],[49,-4],[9,-64],[21,-72],[-10,-81],[18,-33],[30,-29],[46,-31],[40,-37],[22,-4],[43,-28],[-9,-30],[12,-53],[40,-67],[30,71],[41,-115],[26,13],[5,-41],[15,-43],[-1,-56],[-38,-31],[-13,-76],[18,-53],[37,-177],[24,-7],[14,13],[6,-70],[29,-14],[-1,-22],[33,-22],[-11,-86],[3,-76],[15,36],[16,-104],[-16,-89],[16,-28],[14,2],[22,-42],[-7,-121],[14,-48],[-4,-59],[19,-73],[0,-47],[9,-41],[-11,-42],[17,-39],[-2,-93],[25,-13],[-1,-59],[24,0],[24,51],[14,-49],[18,-25],[12,35],[-12,81],[14,13],[-11,101],[15,46],[14,6],[12,-62],[14,-28],[17,-103],[22,1],[29,-55],[25,-80],[35,3],[9,52],[-30,84],[11,51],[22,-84],[6,-98],[12,-46],[10,13],[21,-41],[-13,-166],[-16,-3],[12,-98],[-6,-59],[12,-57],[-18,-45],[17,-43],[5,-40],[18,-59],[-7,-20],[-35,13],[-3,-41],[-14,-30],[22,-59],[47,12],[20,28],[32,-42],[18,-84],[5,-53],[17,24],[17,-22],[26,-77],[13,-85],[11,10],[21,-31],[7,44],[35,-28],[30,-58],[19,-13],[17,-35],[16,-136],[29,-112],[21,-50],[44,-69],[19,-6],[16,-39],[6,-113],[45,-192],[21,-19],[49,-11],[1,-74],[-17,-6],[8,-88],[2,-123],[38,-97],[3,-82],[23,8],[18,-14],[-25,-175],[-7,-84],[12,-247],[9,-34],[-2,-125],[9,-81],[-2,-62],[-25,-29],[-11,-34],[8,-34],[18,-16],[-15,-38],[6,-48],[20,-20],[14,-74],[12,-2],[17,-70],[3,-97],[30,-188],[5,-76],[28,-57]],[[92614,20303],[8,48],[28,-17],[-19,-122],[-16,-30],[-1,121]],[[92600,20548],[0,52],[29,27],[-14,-142],[-15,21],[0,42]],[[92535,22227],[15,43],[23,26],[-2,-103],[9,-67],[17,-20],[2,-31],[-48,-262],[-19,-114],[-10,-86],[-1,-99],[-15,7],[-8,36],[-9,124],[7,73],[17,71],[2,83],[-15,26],[45,92],[20,82],[-13,76],[-17,43]],[[91946,23167],[19,15],[32,-60],[26,-97],[3,-46],[-28,-21],[-20,86],[-17,19],[-6,69],[-9,35]],[[91371,25500],[22,-23],[-11,-42],[-14,30],[3,35]],[[91166,11075],[37,39],[28,-57],[11,-49],[-34,-34],[-10,42],[-24,-24],[-9,20],[-42,-9],[-17,44],[44,37],[16,-9]],[[90510,10580],[32,-17],[60,-62],[56,-15],[61,12],[34,56],[18,-6],[24,40],[25,5],[11,26],[45,-22],[26,44],[26,11],[18,-48],[21,16],[33,98],[18,18],[11,-28],[35,-19],[19,26],[21,78],[30,-22],[19,-47],[19,-5],[28,-103],[-14,-91],[1,-127],[6,-55],[-9,-66],[15,-115],[-8,-39],[-6,-117],[15,-55],[-11,-84],[17,-60],[3,-52],[-13,-55],[-14,10],[12,85],[-17,31],[-20,4],[-26,-20],[1,-41],[-17,-48],[2,-83],[-12,-39],[6,-72],[-15,-32],[-2,-126],[-16,-25],[-20,-91],[32,15],[16,-16],[4,-53],[-13,-51],[9,-84],[-10,-44],[-23,32],[-23,-34],[-20,20],[-7,63],[-16,20],[-2,49],[25,5],[18,-40],[18,36],[-5,70],[-40,4],[-19,29],[-8,44],[-19,-13],[-4,-60],[7,-86],[-15,-3],[-4,64],[-16,38],[-39,-134],[-5,-60],[6,-54],[-26,-38],[-21,44],[-5,-67],[-15,-62],[2,-26],[-36,-64],[-9,-76],[-17,21],[-33,4],[-37,61],[-18,-21],[-53,-2],[-6,29],[-37,0],[-8,-35],[-21,2],[-1,59],[-20,61],[0,62],[-25,-18],[-31,90],[-10,61],[-15,21],[-17,64],[-30,4],[-2,34],[-20,73],[-15,129],[-36,134],[4,19],[-15,82],[4,37],[84,-113],[8,46],[-31,41],[-18,47],[-3,52],[-27,2],[-2,78],[-18,88],[-44,92],[-29,98],[-12,69],[-26,94],[-4,66],[-24,82],[-3,111],[-16,48],[-2,55],[21,30],[7,37],[-7,128],[43,-47],[36,-9],[33,-53],[47,15],[23,-34],[44,-4],[13,-39],[51,-26],[2,-29],[28,-37]],[[91073,11485],[25,36],[59,-151],[24,-20],[22,-177],[-35,1],[-14,-37],[-31,9],[-11,102],[-19,49],[-16,90],[-22,5],[-9,29],[27,64]],[[91137,10946],[27,28],[9,-40],[-13,-33],[-23,45]],[[91120,9433],[24,39],[8,-53],[-32,14]],[[91040,25830],[8,44],[20,-15],[-5,-61],[-12,-7],[-11,39]],[[90923,9080],[18,-15],[12,-52],[-24,-34],[-7,-53],[17,-24],[-24,-95],[-32,41],[17,105],[31,34],[7,60],[-15,33]],[[90626,26923],[16,-100],[10,-24],[-5,-42],[-25,-6],[-8,92],[-31,53],[6,38],[32,-60],[5,49]],[[90356,12530],[48,8],[-30,-80],[-17,18],[-1,54]],[[90320,12416],[34,20],[6,-41],[-22,-13],[-18,34]],[[90251,10859],[31,-23],[-21,-35],[-18,-1],[8,59]],[[89957,11490],[28,137],[45,-65],[-2,-144],[8,-81],[-23,-65],[-35,-40],[-12,7],[0,107],[-12,27],[8,72],[-5,45]],[[89517,32750],[19,-18],[0,-36],[-14,-36],[-19,10],[-7,30],[21,50]],[[89484,32379],[14,33],[22,-74],[-21,-20],[-22,2],[7,59]],[[89473,32772],[22,10],[-1,-52],[-11,-20],[-15,34],[5,28]],[[88804,28161],[-45,23],[-22,-58],[-2,-69],[-17,38],[-6,-50],[-21,-36],[-11,7],[-7,46],[-17,-6],[-1,43],[13,25],[9,50],[20,32],[20,-24],[42,62],[19,-20],[26,-63]],[[88747,27790],[15,4],[7,-35],[-17,-28],[-28,27],[23,32]],[[87942,14225],[-16,52],[14,97],[31,7],[23,27],[48,19],[32,4],[68,64],[57,-11],[20,22],[9,-71],[-12,-48],[25,-7],[30,12],[21,-51],[11,48],[31,1],[17,-24],[13,-63],[-20,-41],[-29,29],[-37,9],[-44,-28],[-8,-61],[-42,-69],[-24,42],[-45,28],[-32,-31],[-65,-1],[-44,-14],[-16,53],[-16,6]],[[88049,28792],[27,-6],[0,-67],[8,-21],[-12,-47],[-20,41],[-2,43],[-12,28],[11,29]],[[87978,29986],[17,-35],[-24,-70],[9,-49],[14,30],[32,-37],[18,25],[-4,-79],[-17,-22],[-29,33],[-37,-25],[-7,23],[-37,19],[-25,43],[12,40],[-10,104],[8,63],[18,35],[29,24],[3,72],[17,4],[12,-97],[25,-15],[10,25],[-2,52],[19,-11],[1,-32],[-14,-71],[-19,-4],[-19,-45]],[[87981,32026],[-18,-83],[-37,-138],[-6,33],[14,34],[24,114],[23,40]],[[87949,28736],[8,32],[18,-20],[-9,-53],[-17,41]],[[87920,28833],[4,38],[22,6],[-5,-88],[-22,-4],[1,48]],[[87849,30179],[10,-16],[-23,-68],[-10,41],[4,70],[19,-27]],[[87653,31369],[11,68],[11,-15],[12,30],[18,-4],[12,-24],[-64,-55]],[[87590,31323],[23,21],[31,-38],[-40,-25],[-9,-42],[-18,6],[13,78]],[[86817,32089],[10,28],[7,-86],[-8,-31],[12,-82],[-8,-34],[-32,123],[19,82]],[[86212,31933],[2,67],[8,3],[27,-75],[27,-14],[-13,-64],[13,-45],[18,27],[11,-82],[27,37],[-17,28],[10,45],[32,19],[27,-1],[11,-36],[46,66],[8,49],[14,14],[7,-42],[30,-49],[12,12],[13,-47],[3,-52],[-12,-28],[-4,-43],[-25,-43],[-24,-82],[-24,-44],[-19,5],[-18,-70],[-21,3],[-9,-36],[-24,55],[-31,26],[-33,71],[-36,41],[-5,47],[11,20],[-24,45],[5,46],[-17,60],[7,44],[-13,23]],[[86466,31333],[11,-62],[-16,0],[5,62]],[[86188,31858],[17,15],[13,-57],[-15,-116],[26,-18],[13,-62],[24,-3],[21,-47],[-37,-45],[-52,43],[-55,-41],[-24,15],[12,42],[17,10],[12,30],[31,2],[-25,71],[-1,59],[25,57],[-2,45]],[[84765,29628],[17,-15],[-9,-95],[-20,-7],[-5,62],[17,55]],[[84583,29047],[19,-7],[16,-70],[-17,-36],[-29,55],[11,58]],[[84546,29035],[23,30],[1,-34],[-24,4]],[[82075,25130],[-7,-57],[-14,-41],[-25,12],[5,47],[30,98],[11,-59]],[[81367,21664],[1,40],[18,19],[13,-84],[11,-108],[15,-81],[1,-69],[18,-18],[10,-63],[-16,-22],[-7,50],[-26,78],[-26,113],[4,21],[-16,124]],[[81954,43393],[15,36],[7,53],[18,11]],[[81687,43298],[39,3],[58,47],[51,71],[20,65],[45,81],[26,30],[26,3],[-7,-67],[-13,-29],[7,-30]],[[95276,43859],[9,-57],[-30,-10],[21,67]],[[93950,45008],[27,-40],[1,-31],[-14,-49],[-32,12],[0,44],[-10,26],[28,38]],[[88382,46891],[3,-45],[-25,-28],[4,60],[18,13]],[[6267,41347],[12,14],[0,65],[23,7],[-9,-59],[1,-42],[13,-27],[32,-30],[-9,-52],[-38,57],[-33,28],[8,39]],[[97528,45099],[-12,11],[-3,6],[-6,21],[3,2],[1,-12],[6,-16],[11,-12]],[[96363,39631],[7,17],[4,-29],[-7,-7],[-4,19]],[[93041,35630],[-37,60],[-20,57],[1,55],[-15,74],[5,85],[18,70],[-9,37],[-21,42],[11,21],[18,-46],[26,-40],[49,-4],[12,-74],[22,-67],[0,-46],[11,-53],[24,-29],[31,-57],[4,-77],[10,-36],[37,-55],[20,-1],[26,-80],[16,-15],[14,-80],[18,-39],[-2,-52],[12,-65],[-3,-51],[-13,7],[-27,-18],[-29,-77],[-49,28],[-54,85],[-46,130],[9,7],[8,60],[-6,42],[4,36],[-8,33],[-40,31],[-22,39],[-5,63]],[[92925,36343],[20,75],[12,-6],[8,-51],[-1,-51],[10,-16],[-7,-121],[-10,-38],[-13,-2],[-14,128],[6,14],[-11,68]],[[92809,31907],[29,-6],[17,-48],[-11,-30],[-13,16],[-47,-16],[-13,38],[39,9],[-1,37]],[[92548,31858],[8,30],[15,-29],[56,-55],[10,-17],[40,-22],[36,-76],[-32,-24],[-27,2],[-13,35],[-45,34],[-48,122]],[[92659,37088],[11,32],[13,-38],[-16,-36],[-8,42]],[[92062,37818],[-53,71],[-37,79],[-20,14],[-12,29],[-25,12],[-24,-13],[-26,26],[49,50],[34,-3],[10,-39],[37,-46],[8,-49],[23,4],[12,-27],[16,6],[25,-55],[51,-53],[11,-51],[18,-44],[45,-16],[15,-20],[32,-68],[27,-93],[41,-58],[-1,-29],[19,-59],[23,6],[13,-68],[-1,-31],[23,-23],[21,-37],[17,-13],[17,16],[1,-50],[11,-36],[21,-7],[2,-36],[15,-35],[9,-70],[19,-36],[3,-101],[-25,-67],[10,-64],[-27,-133],[-25,-43],[-28,94],[-15,15],[-3,64],[-10,57],[4,223],[-20,65],[0,37],[-33,135],[-13,17],[-30,101],[1,28],[-22,56],[-35,62],[-57,27],[-37,74],[-23,28],[-21,71],[-15,31],[-35,31],[-10,44]],[[92346,33595],[18,-36],[29,8],[35,-30],[11,16],[15,-50],[31,-7],[16,-49],[-19,-53],[-25,-20],[-22,18],[-19,60],[-25,54],[-23,33],[-22,56]],[[92461,32370],[-10,-32],[-29,-11],[-18,25],[-30,18],[-2,30],[36,-33],[33,34],[20,-31]],[[92374,37817],[23,17],[7,-87],[-9,-52],[-29,99],[8,23]],[[92123,36473],[11,47],[-8,74],[2,91],[-12,50],[0,65],[-24,61],[-12,129],[18,11],[37,-3],[43,-18],[-1,-37],[30,-47],[16,30],[7,37],[-9,41],[36,-11],[10,52],[10,-23],[-14,-45],[35,-83],[32,16],[-3,-55],[-14,-69],[11,-58],[3,-80],[-4,-60],[-26,-105],[-15,-39],[-21,-12],[-33,16],[-16,-6],[-5,-117],[34,-81],[18,-61],[-4,-40],[-45,-91],[-25,-16],[-15,-33],[-27,51],[-16,3],[-10,-37],[-14,28],[-24,6],[-12,-37],[2,-85],[-14,-24],[-7,-63],[-14,-15],[-43,-96],[-8,12],[-23,-29],[-4,-22],[-39,5],[-23,-24],[-24,-48],[-30,-32],[-19,2],[-27,-70],[-65,-23],[-17,31],[-18,-29],[-16,27],[-15,-32],[-10,23],[-14,-26],[-43,15],[-40,-16],[-10,21],[-28,121],[-47,28],[-19,-28],[-22,1],[-12,-43],[-17,33],[-3,62],[-19,-4],[-27,35],[-35,83],[-29,9],[-7,29],[-19,-20],[-16,31],[-26,15],[-14,29],[-10,64],[13,120],[16,21],[22,-21],[17,-47],[27,40],[23,-1],[17,-34],[23,34],[30,18],[17,-28],[42,-35],[3,-27],[51,23],[27,-10],[25,51],[26,4],[12,-40],[19,30],[28,-7],[15,33],[8,48],[-17,32],[4,38],[29,72],[-7,34],[8,45],[2,58],[24,6],[19,-34],[-5,-24],[-28,-35],[2,-63],[-9,-61],[9,-66],[4,-86],[15,-24],[22,8],[17,-14],[35,88],[15,8],[28,-33],[9,-54],[32,18],[10,49],[20,-21],[23,-4],[29,88],[-3,21],[22,131],[24,48],[27,75],[23,21],[9,28],[19,-15],[19,8],[19,-30],[17,25]],[[92208,37934],[29,-12],[0,-59],[-15,20],[-14,51]],[[92202,38037],[20,1],[-7,-56],[-20,20],[7,35]],[[91875,33042],[21,-22],[2,-31],[18,-19],[34,-87],[0,-33],[23,-40],[21,71],[25,17],[5,-57],[-19,-111],[-12,-5],[-32,32],[-30,11],[-2,67],[-19,30],[-1,56],[-10,36],[-19,27],[-5,58]],[[91976,33985],[8,-143],[-7,-24],[-7,-96],[-11,21],[24,102],[-9,35],[-29,2],[5,65],[26,38]],[[91945,32416],[17,-6],[-9,-58],[-12,31],[4,33]],[[91788,33250],[-5,34],[17,36],[40,-45],[16,-35],[25,28],[31,-76],[0,-44],[14,-72],[-21,-27],[-32,34],[-15,-10],[-38,35],[-27,-13],[2,45],[17,21],[-3,30],[-21,59]],[[91898,32445],[12,4],[5,-74],[-22,45],[5,25]],[[89166,38141],[57,-21],[35,-54],[28,-18],[93,-119],[13,-8],[19,-44],[28,7],[25,-35],[7,-43],[39,-18],[63,-70],[17,-26],[28,-12],[66,-58],[56,-27],[14,8],[33,-26],[74,-33],[32,-92],[20,-7],[28,-36],[12,-38],[25,-27],[14,-53],[16,-4],[41,-44],[28,-7],[21,29],[35,7],[-20,-93],[33,5],[20,-51],[17,-1],[56,-77],[-2,-50],[17,-12],[16,-36],[15,-66],[43,-40],[26,17],[49,-82],[31,-82],[8,-47],[31,-73],[28,-51],[-7,-87],[9,-72],[-5,-95],[-12,-81],[-6,-77],[17,-53],[17,16],[22,-1],[41,-24],[30,-38],[43,-9],[16,-32],[16,8],[23,-43],[24,-68],[22,-10],[25,-59],[18,16],[17,-44],[21,-30],[21,-11],[40,-2],[10,25],[26,-1],[9,-26],[18,-5],[15,-38],[21,-27],[26,-81],[14,-76],[26,-38],[11,-72],[-7,-119],[6,-43],[-28,-37],[-23,7],[-39,-35],[-37,20],[-13,-20],[-39,6],[-12,25],[-22,-2],[-14,-22],[-25,-6],[2,-168],[25,-48],[13,-83],[14,-42],[-3,-48],[5,-64],[23,-64],[57,-74],[22,-57],[3,-40],[14,-1],[6,-46],[20,-15],[9,-94],[48,-15],[25,-44],[4,-38],[17,-11],[24,12],[14,-129],[10,-52],[-1,-59],[8,-46],[-3,-71],[7,-27],[27,-20],[26,-44],[10,-44],[4,-108],[14,-93],[24,-59],[18,-31],[17,-5],[39,27],[12,32],[22,-5],[28,56],[8,-21],[29,22],[14,-15],[7,-90],[-22,-43],[-9,-79],[-12,-37],[17,-99],[35,-18],[22,-50],[40,-7],[15,-13],[31,19],[37,-29],[25,1],[24,-32],[-16,-43],[-63,-28],[-17,-38],[13,-44],[46,-113],[24,-21],[45,-3],[34,-68],[63,-33],[18,5],[6,-40],[27,17],[16,-32],[-39,-34],[-56,28],[-21,-19],[0,-43],[23,-8],[48,-46],[14,-4],[13,-58],[-24,-14],[-12,-34],[-21,5],[-27,-50],[-20,23],[-18,-27],[-23,8],[-9,24],[-45,35],[-18,39],[13,24],[25,-15],[1,32],[-22,42],[-25,-1],[-32,61],[-58,-1],[-11,-15],[-45,71],[-9,-32],[-44,47],[-25,11],[-31,-40],[-25,39],[-20,-4],[-18,93],[-12,14],[-17,-55],[-11,10],[-25,-32],[-30,-6],[-9,56],[-26,4],[-18,29],[19,50],[-10,23],[-14,-36],[-8,-48],[-16,-27],[-33,1],[-15,72],[-19,1],[-28,-19],[-5,20],[-38,41],[-16,62],[-19,104],[-19,41],[-23,104],[-16,23],[-10,-16],[-23,43],[-24,9],[-15,73],[-15,142],[20,44],[1,37],[-29,7],[-13,-57],[-27,41],[-44,22],[-17,59],[-1,65],[11,7],[12,64],[-32,27],[-5,35],[-9,1],[-28,58],[-24,93],[-7,53],[14,33],[-11,73],[-31,14],[-12,105],[-13,-6],[-69,34],[-2,106],[-26,-17],[-21,-36],[-7,14],[-47,-10],[-24,50],[-58,75],[14,13],[4,21],[-3,16],[7,24],[-1,28],[-19,76],[-7,2],[-8,11],[-1,17],[-3,17],[0,14],[4,7],[0,8],[3,11],[-9,-5],[5,-12],[-4,-9],[0,-18],[3,-17],[-5,-10],[-5,10],[-3,-34],[-4,-9],[-3,-3],[1,-7],[4,-15],[-3,-15],[3,-18],[-2,-12],[-13,8],[-2,-8],[0,-54],[-8,-16],[-15,56],[1,48],[-20,56],[-6,42],[-37,30],[-9,50],[-14,-35],[-38,51],[-13,-14],[-9,6],[-13,-10],[-3,9],[-3,3],[-18,-18],[2,-61],[-8,-68],[2,-34],[-32,-18],[-5,-114],[-33,35],[-22,9],[-46,88],[20,-84],[6,-69],[23,-124],[-15,-33],[-22,-16],[-19,6],[-32,35],[-34,-8],[-13,65],[-12,-4],[0,-58],[16,-24],[8,-41],[20,-21],[12,-31],[-1,-55],[-67,-5],[-17,-18],[-38,-13],[-49,-37],[-36,16],[-19,27],[-31,9],[-39,-46],[-38,20],[17,-47],[16,-4],[37,45],[33,-3],[46,-74],[48,-22],[44,-89],[41,-133],[5,-149],[-22,-44],[-12,7],[-35,-16],[-10,-23],[-33,-21],[-21,-46],[-84,-119],[-20,7],[-39,71],[-37,19],[-22,36],[2,74],[9,52],[-16,47],[-25,-5],[-18,33],[-5,-33],[-4,0],[-1,-2],[-2,-8],[-1,-11],[-6,-8],[0,-7],[5,-13],[4,-3],[5,4],[3,-22],[4,-11],[2,-48],[-3,-53],[-26,-4],[-18,-18],[-36,14],[-36,-24],[-31,12],[-19,35],[-33,3],[-20,-44],[-20,-23],[-19,8],[-27,67]],[[91721,38314],[26,-39],[41,-48],[1,-122],[-65,-7],[-10,-12],[-18,36],[-15,78],[-26,13],[12,36],[54,65]],[[91733,33405],[26,-47],[7,-69],[-8,-67],[3,-41],[-51,66],[-14,45],[-4,41],[17,65],[24,7]],[[91557,39049],[20,-34],[19,-97],[-16,-15],[-18,15],[-33,74],[11,43],[17,14]],[[91041,36052],[6,41],[20,-3],[13,-43],[21,-6],[23,-38],[10,-34],[-7,-91],[-12,-44],[-12,27],[-31,29],[-1,34],[-27,60],[-3,68]],[[91054,38383],[23,-21],[-14,-36],[-14,1],[5,56]],[[90776,38596],[15,8],[49,-7],[24,-19],[20,3],[23,-21],[9,-28],[-14,-67],[-19,-32],[-26,18],[-7,-23],[-26,-7],[-60,37],[-21,29],[-8,-61],[-14,18],[-8,-35],[-16,19],[0,42],[28,28],[-13,43],[21,55],[17,-22],[26,22]],[[90858,36277],[32,-90],[-2,-32],[-22,-48],[-25,56],[-12,61],[29,53]],[[90528,36717],[26,49],[18,-43],[-3,-92],[-24,-29],[-21,20],[-2,54],[6,41]],[[90294,34603],[14,19],[9,-10],[5,-21],[8,-8],[13,-52],[-4,-12],[1,-15],[-3,-19],[-4,-40],[-12,-11],[-17,19],[-28,-2],[2,35],[0,44],[10,-5],[3,-2],[1,2],[0,9],[-2,22],[3,14],[-1,10],[-3,7],[5,16]],[[90277,37060],[-2,48],[24,-15],[-9,-41],[-13,8]],[[90104,34736],[9,-37],[-21,-17],[-22,45],[5,3],[9,11],[5,4],[4,-12],[11,3]],[[89873,34022],[7,15],[26,-21],[-10,-37],[-13,34],[-10,9]],[[89875,34241],[9,22],[16,-10],[3,-31],[-23,-6],[-5,25]],[[89784,33978],[14,-37],[29,-14],[26,-32],[32,-71],[-4,-21],[-47,53],[-17,47],[-23,22],[-10,53]],[[89815,34023],[11,-15],[51,7],[3,-30],[-14,-27],[-13,16],[-22,-3],[-16,52]],[[89513,33572],[-8,-12],[-5,-97],[-7,-16],[-34,-9],[1,78],[-2,24],[-3,7],[5,27],[10,-4],[2,44],[26,0],[15,-42]],[[89454,33634],[16,-9],[-1,-44],[-11,-6],[-5,-8],[-3,6],[-5,-3],[-8,16],[6,14],[2,15],[2,2],[3,-2],[3,2],[1,17]],[[96338,31697],[33,-17],[11,-67],[-26,-5],[-14,21],[-10,49],[6,19]],[[96256,31971],[12,-17],[-2,-46],[-13,-9],[-9,46],[12,26]],[[96100,32362],[27,8],[22,-33],[-25,-62],[-28,17],[-20,-52],[-29,-1],[-4,62],[19,-4],[14,69],[24,-4]],[[94885,32610],[27,-39],[8,-24],[22,-4],[14,-33],[23,7],[16,-31],[33,-3],[24,-88],[3,-38],[21,-40],[0,-34],[-20,-33],[-24,-16],[-19,10],[-13,29],[-41,8],[-26,50],[-20,10],[-27,81],[-19,6],[1,54],[-12,40],[2,46],[-39,30],[-22,-1],[2,90],[29,9],[43,-52],[14,-34]],[[94841,33264],[35,-128],[6,-81],[-35,10],[-15,53],[3,17],[1,61],[-13,100],[18,-32]],[[94645,33684],[-15,49],[3,49],[-8,55],[16,61],[-37,94],[5,44],[33,-32],[9,22],[16,-24],[10,-64],[15,-22],[5,-39],[24,-63],[-20,-88],[4,-44],[19,-15],[26,-49],[13,-42],[9,-91],[17,-55],[1,-84],[25,-118],[16,-45],[2,-51],[-26,31],[-26,110],[-49,65],[-31,90],[-15,9],[-32,141],[-1,76],[-8,30]],[[94452,33257],[21,-12],[13,20],[19,-16],[36,12],[32,-60],[6,-29],[25,-11],[23,-66],[0,-42],[26,-20],[21,-96],[-23,-29],[-37,-28],[-38,38],[-14,-6],[-22,56],[-22,8],[-55,-13],[-52,32],[-17,-13],[-47,113],[3,28],[-20,54],[7,34],[-8,82],[7,56],[22,26],[26,-35],[34,-90],[34,7]],[[94432,31763],[7,24],[31,-17],[15,-42],[14,-9],[33,-61],[50,-45],[18,-45],[5,-42],[-38,-1],[-11,62],[-23,16],[-6,42],[-34,-15],[-26,52],[-14,-4],[-18,43],[-3,42]],[[94529,33496],[28,-43],[-15,-32],[-21,31],[4,13],[-2,9],[4,5],[1,7],[1,10]],[[94482,33562],[4,-19],[25,7],[13,-31],[2,-8],[0,-7],[2,-2],[1,-12],[-3,-9],[-3,-2],[-2,-15],[-34,28],[-5,70]],[[94377,34070],[26,-43],[-17,-64],[17,-19],[-7,-69],[-35,70],[-24,65],[-15,-11],[-30,57],[-32,30],[-13,32],[-26,21],[-30,73],[-14,0],[-17,41],[-34,47],[-50,124],[-18,16],[-31,150],[20,-16],[11,16],[33,-38],[18,-32],[19,-59],[15,-2],[18,-40],[3,-41],[20,-34],[34,-36],[18,-7],[11,-27],[21,11],[41,-88],[31,-39],[37,-88]],[[94339,33987],[2,-44],[19,-46],[-11,-21],[-34,51],[-3,49],[18,24],[9,-13]],[[94188,33533],[27,-24],[-9,-37],[-25,4],[-7,35],[14,22]],[[93985,34587],[32,-36],[-21,-17],[-11,53]],[[93942,33787],[5,-73],[-17,-35],[-5,50],[15,22],[2,36]],[[93875,33859],[4,45],[17,-33],[18,23],[8,-36],[-17,-25],[11,-35],[-9,-48],[-14,-32],[-28,26],[-13,51],[5,67],[18,-3]],[[93818,34109],[7,-40],[16,-34],[20,-111],[-10,-40],[-19,-14],[-21,39],[-13,-5],[-30,61],[8,31],[-15,94],[-23,-1],[-27,-23],[-20,-36],[-20,22],[-6,61],[6,23],[22,7],[14,83],[16,55],[21,22],[30,-44],[3,-64],[15,-91],[12,20],[14,-15]],[[93734,33754],[43,1],[7,-57],[-50,56]],[[93573,35110],[21,-14],[26,-42],[21,-51],[8,-104],[13,-35],[25,-16],[2,-28],[32,-62],[39,21],[6,-40],[-24,-44],[-31,3],[-18,39],[-20,-7],[-19,21],[-13,-14],[-7,42],[-43,54],[-46,120],[-30,106],[-37,49],[-9,34],[-23,37],[-6,58],[21,47],[23,-44],[21,-4],[16,-60],[41,-38],[11,-28]],[[93695,33960],[24,4],[5,-46],[-20,-54],[0,-103],[-40,104],[21,50],[10,45]],[[93645,34163],[14,-17],[-4,-68],[-19,56],[9,29]],[[93603,34347],[17,29],[22,3],[17,-48],[6,-102],[-14,-56],[-43,34],[-13,46],[2,76],[6,18]],[[93500,34422],[-27,67],[-1,49],[26,44],[31,-97],[23,-21],[-5,-40],[-15,-38],[-6,-41],[-29,32],[3,45]],[[93481,34282],[11,6],[11,-119],[-7,-24],[-16,62],[1,75]],[[93352,35132],[9,-94],[-12,-7],[-7,70],[10,31]],[[93250,34995],[17,3],[28,-40],[-14,-55],[-28,13],[-8,30],[5,49]],[[84707,33585],[16,68],[24,43],[2,80],[7,37],[24,24],[24,3],[33,29],[20,-2],[13,19],[43,1],[33,23],[12,21],[38,-9],[29,-23],[19,18],[20,-5],[35,54],[16,8],[38,-47],[49,56],[17,-9],[47,64],[43,-30],[23,23],[9,-29],[18,-12],[-5,-34],[-20,-49],[-33,-63],[-19,-61],[-15,1],[-40,-57],[-19,7],[-23,-12],[-29,-42],[-24,-87],[-17,0],[-32,-25],[-33,3],[-67,-111],[-25,6],[-36,-33],[-11,-22],[-23,10],[-15,-23],[-48,-39],[-29,-53],[-17,-46],[-14,-2],[-19,-33]],[[84874,34115],[20,62],[5,-29],[-15,-93],[-22,19],[12,41]],[[84456,33314],[36,41],[3,20],[81,55]],[[99551,34246],[0,-9],[-2,-7],[0,-7],[-1,-4],[-1,7],[1,2],[2,10],[1,8]],[[96293,53827],[-4,9],[3,4],[1,-13]],[[99999,27966],[0,-4],[0,-32],[0,-45],[0,-39],[0,-4],[-21,-31],[-9,48],[18,43],[12,64]],[[99673,28109],[2,23],[24,56],[60,33],[18,23],[17,-16],[41,49],[3,29],[33,40],[29,15],[13,30],[34,-28],[52,72],[0,-14],[0,-6],[-42,-76],[-31,-132],[-26,-32],[-23,-46],[-5,-47],[-19,-46],[1,-54],[38,32],[22,50],[4,33],[28,62],[25,35],[7,-22],[-22,-97],[21,-86],[-14,-11],[-22,37],[-41,-15],[-15,-40],[-71,0],[7,48],[-27,27],[-18,-1],[-19,-38],[-7,-35],[-17,-17],[-11,-71],[-36,45],[-19,-54],[-2,-41],[-30,-3],[-10,72],[-10,24],[-7,54],[-25,-28],[-7,55],[23,34],[2,55],[35,-35],[20,49],[17,9]],[[99822,27623],[19,21],[3,-53],[-16,-56],[-6,88]],[[99795,27138],[20,-31],[8,-77],[-36,75],[8,33]],[[99657,27371],[17,-20],[-2,-56],[-17,-1],[-7,51],[9,26]],[[99542,27217],[9,-48],[15,-21],[3,-14],[-6,-4],[-2,-11],[1,-9],[12,-2],[6,2],[20,-50],[-37,-45],[-26,1],[-36,-57],[-16,-47],[-14,11],[-57,-19],[-37,39],[-46,31],[-40,7],[-10,26],[-27,14],[1,39],[-21,72],[8,70],[30,26],[14,47],[-13,55],[15,54],[14,12],[27,76],[27,-6],[13,13],[6,43],[13,10],[42,-24],[22,43],[23,2],[25,32],[16,-42],[-9,-33],[29,-16],[1,-33],[22,-42],[47,-64],[-12,-82],[22,-67],[-12,-42],[15,-77],[-18,-29],[-12,58],[-3,3],[-6,-8],[-6,-1],[-13,8],[3,11],[6,3],[-3,16],[-16,21],[-9,48]],[[99552,26424],[24,-24],[-30,-57],[-27,41],[-12,-31],[-20,-13],[-14,-64],[-37,8],[15,44],[36,26],[1,34],[27,14],[15,30],[22,-8]],[[0,27966],[19,53],[18,17],[5,-70],[-10,-55],[-29,-57],[-3,-12],[0,37],[0,71],[0,16]],[[90227,49737],[11,63],[13,-35],[13,-4],[-7,-54],[-42,-93],[-1,-65],[-11,-37],[-20,13],[-7,48],[13,93],[21,7],[17,64]],[[59936,63911],[-9,-10]],[[59927,63901],[-33,-31],[0,-1],[1,-23]],[[59895,63846],[-15,35],[-18,-144],[-42,-23],[-10,34],[-35,-14],[-25,6]],[[59750,63740],[28,76],[-1,48],[12,44],[13,97],[19,44],[16,117],[17,74],[-1,79],[28,3],[21,129],[-5,76],[11,80],[14,8],[4,44],[46,65],[24,51],[-3,69]],[[90480,50926],[13,20],[5,-62],[-29,-26],[11,68]],[[90347,50192],[-3,-36],[-16,-25],[-7,38],[26,23]],[[96637,24674],[14,12],[15,-65],[34,-1],[-2,-119],[-22,-24],[-24,30],[-24,14],[4,34],[-13,49],[-9,72],[27,-2]],[[96505,23838],[6,11],[29,-44],[-15,-56],[-20,18],[0,71]],[[96461,25158],[8,-115],[-9,-21],[31,-35],[3,-48],[21,-26],[-12,-31],[0,-50],[-21,-13],[-22,66],[-29,3],[-16,31],[-13,68],[31,65],[2,47],[-9,49],[13,32],[22,-22]],[[95853,25137],[51,-34],[0,-54],[22,-53],[21,-5],[-2,-82],[26,-56],[11,3],[22,-53],[0,-37],[27,-33],[13,3],[12,-42],[26,-16],[62,-97],[33,-71],[23,-25],[6,-25],[35,-48],[41,-122],[24,-18],[-1,-26],[52,-44],[15,-37],[1,-37],[19,-66],[-4,-72],[-21,-40],[-15,50],[-25,-47],[-14,13],[-13,45],[-26,12],[-7,35],[-17,11],[-18,-26],[-6,64],[-41,4],[-20,43],[-16,9],[7,93],[-22,22],[-9,29],[-14,-37],[-28,58],[-19,17],[-25,97],[-28,-13],[-28,17],[-21,43],[-52,54],[-6,25],[-31,54],[-8,42],[-13,5],[-14,43],[-20,22],[-23,53],[-10,44],[8,46],[-14,36],[-32,9],[-8,45],[3,35],[-40,26],[-32,79],[2,38],[-29,68],[-4,36],[-19,22],[-15,46],[-6,65],[6,43],[-24,49],[-16,-10],[-9,34],[22,66],[48,-105],[13,40],[31,-19],[24,-30],[24,-69],[40,-55],[37,-111],[13,-11],[45,-67]],[[96276,25342],[-8,-90],[7,-37],[-7,-41],[-18,3],[15,53],[11,112]],[[96644,19203],[10,6],[7,-37],[-17,4],[0,27]],[[99195,12740],[15,29],[33,-4],[39,11],[36,51],[19,68],[19,36],[12,58],[39,20],[24,28],[23,51],[72,-20],[16,-42],[36,-8],[19,-38],[-37,-117],[-6,-61],[-17,-69],[10,-41],[-15,-22],[10,-37],[-6,-60],[3,-114],[-18,-41],[1,-46],[-66,-113],[-20,11],[-15,-136],[-7,-100],[5,-52],[25,-13],[-41,-91],[-7,111],[-44,17],[-72,-9],[-74,-58],[-29,-40],[-6,-44],[-32,-71],[-9,-64],[14,-20],[1,-63],[9,-38],[32,-41],[-15,-35],[-4,-81],[-18,-65],[-17,-86],[4,-21],[-19,-76],[-33,-45],[-23,-129],[0,-46],[-36,-29],[-33,-99],[-18,-35],[-25,-121],[-31,-92],[-13,-84],[-16,-27],[-11,-53],[-27,-32],[-16,-53],[-37,-38],[-25,-53],[-15,-6],[-25,-49],[-33,-30],[-25,8],[-11,51],[6,66],[-48,43],[-33,-46],[-21,56],[18,71],[-19,22],[-6,-82],[-33,-10],[-25,52],[28,47],[7,34],[30,58],[-3,21],[28,44],[13,85],[21,41],[25,114],[12,84],[9,128],[-6,117],[-18,91],[-35,88],[-37,57],[-46,7],[-43,36],[-39,61],[-19,55],[-43,50],[-58,24],[-54,100],[-12,97],[12,61],[33,52],[51,53],[29,41],[54,1],[43,87],[18,117],[8,174],[-2,53],[21,56],[0,83],[-6,46],[24,3],[33,28],[-4,88],[-26,5],[-8,65],[23,46],[-8,82],[-19,131],[-11,46],[-6,66],[-41,206],[34,13],[4,-61],[18,-1],[33,51],[-9,35],[-22,9],[8,52],[-29,-12],[-20,-51],[-30,-22],[-17,156],[-43,154],[-30,91],[20,40],[18,-72],[21,-26],[16,110],[-44,15],[-3,56],[-31,70],[8,-108],[-34,-23],[-12,38],[-12,84],[-32,104],[-60,174],[-51,134],[-29,93],[-46,128],[-7,36],[-30,73],[22,11],[12,64],[-18,108],[-71,214],[-47,106],[-3,46],[29,-19],[22,27],[33,-4],[10,-147],[9,-46],[35,-79],[-4,-30],[34,-35],[-18,-47],[3,-36],[26,7],[5,26],[-14,60],[45,38],[3,-26],[-25,-37],[12,-47],[38,-2],[42,19],[10,-61],[21,34],[23,-15],[24,-80],[27,6],[6,-27],[-12,-43],[19,-68],[45,68],[19,-157],[31,-42],[-2,-37],[21,-34],[-10,-43],[13,-103],[-36,6],[-16,32],[-10,-67],[35,11],[2,-76],[13,-74],[22,-12],[23,-105],[16,-37],[8,-52],[18,-44],[-35,-143],[16,-46],[0,-56],[17,-96],[18,4],[23,-49],[21,27],[15,-46],[28,7],[26,-41],[3,-95],[11,-59],[18,-15],[28,21],[10,42],[-12,125],[-24,77],[25,64],[-18,55],[-7,77],[-17,19],[-5,53],[17,3],[36,-45],[15,-53],[2,-49],[16,-31],[26,2],[8,-82],[16,-6],[7,-75],[14,-84],[-3,-69],[5,-81],[12,-49],[7,-109],[-10,-52],[13,-41],[20,-22],[53,-14],[100,-111],[47,-41],[46,-22],[40,-41],[7,-37]],[[98716,14156],[29,-96],[-2,-43],[20,-47],[-8,-26],[-25,28],[-23,58],[-6,67],[15,59]],[[97831,8526],[-49,-41],[-116,-127],[-45,-61],[-52,-105],[2,-53],[-27,-111],[3,-148],[-8,-98],[-14,-50],[-33,-62],[-19,-53],[-23,-113],[12,-44],[-10,-60],[-49,-114],[-17,-59],[9,-59],[32,-58],[-112,-46],[-38,-82],[-9,-70],[-54,-84],[-44,-50],[-10,-88],[-56,-75],[-28,5],[-34,-54],[-21,10],[-21,-27],[-19,14],[-19,-21],[-61,7],[-23,64],[-67,-19],[-21,27],[-21,-6],[-28,49],[-19,74],[-32,41],[-24,-30],[-15,15],[-44,-21],[-27,43],[6,50],[-35,55],[-45,25],[-17,-27],[-6,-45],[-66,-3],[-64,31],[-60,5],[-10,44],[18,20],[-22,37],[-2,36],[-42,13],[-6,65],[7,59],[84,40],[20,-4],[1,48],[-27,-18],[1,107],[-19,15],[30,151],[17,49],[47,-30],[-9,131],[83,194],[62,86],[16,7],[9,50],[19,7],[26,56],[19,-12],[13,110],[37,83],[26,-1],[-4,47],[48,79],[34,107],[20,-2],[42,26],[29,-17],[29,18],[23,45],[28,28],[62,107],[43,53],[67,37],[23,36],[28,83],[52,48],[20,53],[33,48],[25,81],[28,14],[14,33],[45,27],[65,92],[39,108],[39,82],[20,63],[18,101],[23,88],[9,120],[33,151],[1,95],[34,13],[22,-8],[44,64],[18,42],[28,107],[23,54],[7,59],[4,200],[-4,67],[35,102],[40,52],[23,52],[55,88],[23,-17],[-21,-92],[12,-52],[27,-60],[24,-14],[23,35],[16,-56],[13,-12],[-3,-61],[-13,-31],[7,-59],[-7,-40],[43,-125],[42,50],[2,34],[22,33],[17,-7],[30,72],[27,-8],[3,32],[36,53],[24,-29],[1,-98],[17,-8],[20,44],[8,58],[19,-6],[31,-54],[-21,-20],[10,-48],[-21,-24],[2,-57],[-28,-104],[14,-67],[19,-16],[9,-113],[26,-20],[-32,-94],[-41,-90],[-35,-138],[-55,-125],[-4,-35],[-38,-38],[-11,-74],[-52,-227],[-19,-48],[-28,-24],[-17,-46],[-53,-33],[-34,-67],[-14,-86],[0,-97],[7,-60],[18,-44],[48,-30],[36,-54],[6,-36],[-9,-53],[-23,-35],[-21,18],[-32,-22],[-95,118],[-19,-1],[-16,-42],[2,-44],[-47,-43]],[[98270,10686],[13,25],[-5,38],[35,42],[8,-14],[-15,-66],[-20,-44],[-16,19]],[[97001,2384],[9,-56],[-7,-34],[-23,-5],[-6,40],[27,55]],[[96666,6470],[9,-31],[30,-35],[-2,-27],[-43,-21],[55,-32],[6,-55],[-21,-42],[-52,-20],[-33,-39],[-18,14],[-33,-28],[3,-38],[-30,-16],[-23,6],[4,44],[28,29],[-3,61],[21,38],[13,51],[23,29],[-1,45],[-16,50],[14,71],[47,-3],[22,-51]],[[96267,7290],[33,19],[9,-17],[-1,-74],[-33,-20],[-14,54],[6,38]],[[96152,3787],[21,-31],[1,-46],[-20,-53],[24,-96],[-5,-23],[-43,25],[-16,-19],[-38,28],[3,32],[39,36],[15,32],[6,66],[13,49]],[[96087,3552],[19,-18],[26,13],[34,-20],[-27,-37],[-43,19],[-9,43]],[[992,8638],[-33,7],[15,-61],[-5,-47],[8,-46],[43,-60],[-42,-28],[-38,-37],[-19,85],[41,50],[-3,40],[-17,51],[-74,-20],[0,33],[25,23],[32,7],[15,39],[52,-36]],[[87396,45515],[5,-35],[-10,-67],[-5,-123],[-21,-4],[-13,62],[22,109],[17,10],[5,48]],[[97151,25530],[-1,22],[27,17],[17,-41],[-9,-39],[-27,10],[-7,31]],[[97064,25914],[-22,17],[-28,76],[-9,51],[8,81],[30,15],[-4,-48],[8,-56],[16,-7],[21,-44],[-20,-85]],[[96969,26653],[15,-7],[26,-141],[21,-28],[8,-54],[-17,-36],[-15,21],[-45,36],[-21,29],[7,39],[-8,48],[3,58],[26,35]],[[96742,27416],[35,21],[16,-8],[13,-69],[23,-33],[-12,-81],[-45,-19],[-19,62],[-34,67],[23,60]],[[96703,28071],[16,58],[18,-88],[17,1],[16,-59],[27,-6],[2,-41],[-47,37],[-13,-25],[-23,11],[-14,66],[1,46]],[[96688,28406],[14,55],[12,2],[13,-101],[23,-32],[-5,-46],[-44,-15],[-40,43],[-18,33],[0,33],[45,28]],[[96706,28927],[13,-42],[-2,-61],[23,-177],[2,-89],[-8,-27],[-17,18],[1,47],[-5,81],[-8,27],[-9,87],[11,73],[-1,63]],[[96682,29263],[4,63],[26,-201],[4,-100],[-12,-49],[-8,76],[0,76],[-8,46],[-6,89]],[[96575,28943],[34,73],[48,39],[5,-19],[-15,-65],[-23,-56],[-39,1],[-10,27]],[[96453,28621],[25,-23],[6,-42],[17,-44],[-1,-36],[18,-42],[36,-56],[6,-23],[43,-69],[2,-41],[14,-45],[-31,-33],[-32,19],[-18,-43],[-22,-15],[-3,48],[-19,110],[2,110],[-26,49],[-10,-28],[-20,20],[-9,42],[10,70],[-5,39],[17,33]],[[96539,29824],[18,-47],[-16,-73],[-38,15],[6,89],[30,16]],[[96520,30175],[20,-69],[-4,-69],[-15,-2],[-26,41],[4,73],[21,26]],[[96266,29455],[15,53],[29,-116],[11,-16],[17,-233],[27,-13],[20,53],[-2,102],[12,17],[14,-60],[1,-56],[16,-23],[9,-93],[11,-60],[-6,-30],[8,-56],[-30,-102],[-39,14],[-18,-14],[-24,-49],[-12,13],[2,47],[-13,30],[-23,102],[6,120],[-10,53],[-9,123],[-17,101],[5,93]],[[96424,28802],[33,-10],[-9,-80],[-30,35],[6,55]],[[96443,28873],[1,-59],[-21,9],[20,50]],[[59354,65137],[-25,-3],[-8,26],[-22,-8],[-21,98],[-10,-17],[24,-52],[3,-72],[47,13],[19,-16]],[[59361,65091],[-16,-28],[-1,-53],[-75,-96],[-36,-19],[-25,6],[-25,-20],[-13,-30]],[[59098,64856],[-14,-7],[-75,68],[-12,71],[-21,47],[-3,131],[27,-31],[24,31],[18,67],[10,1]],[[59052,65234],[8,-7],[5,15]],[[59065,65242],[17,-4]],[[59082,65238],[0,-29],[24,-18],[10,-28],[28,3],[32,46],[23,-7],[14,30],[26,-30],[26,27],[-19,-7],[-36,24],[-14,-30],[-25,-1],[-17,-37],[-26,-1],[-39,29],[-3,29]],[[59086,65238],[31,-30],[21,24],[11,95],[14,45],[29,-12],[107,-15],[55,24],[26,35],[23,-1],[35,23],[40,41],[14,41],[33,12],[15,32],[67,52],[-7,-35],[-38,-37],[-4,-26],[-35,-55],[-28,-26],[-29,-56],[-5,-28],[-24,-1],[-20,-55],[2,-59],[25,-70]],[[59444,65156],[-27,6]],[[59416,65160],[29,-6]],[[59445,65154],[21,-57],[-30,1],[-19,-17]],[[56944,55785],[0,3480],[0,605],[0,284],[0,832],[-38,194],[14,61],[-27,141],[2,66],[-19,134],[-16,51],[21,111],[40,112],[27,223],[-9,88],[-19,121],[-13,62],[6,65],[-8,113],[34,69],[26,36],[4,50],[16,27]],[[56985,62710],[10,-92],[30,-17],[53,8],[113,80],[168,-96],[71,-8],[24,-30],[38,1],[29,-43],[45,-18],[28,11],[13,-79],[16,-34],[51,-15],[14,-12],[41,29],[18,-36],[3,-42],[32,-16],[41,3],[42,-17],[32,14],[35,-25],[12,-24],[30,-12],[86,-129],[33,-1],[53,37],[60,70],[64,112],[83,132],[25,-30],[31,33],[32,108],[35,-7],[53,35],[73,57],[33,13],[66,-45],[36,-44],[30,-25],[53,28],[13,-16],[12,45],[29,-9],[16,-73],[20,-38],[62,-78],[4,-314],[7,-70],[-11,-110],[10,-33],[5,-71],[-12,-7],[-2,-49],[13,-36],[36,-16],[22,-45],[6,-175],[-29,-11],[-5,-32],[7,-52],[-18,-41],[-17,-66],[-4,-58],[8,-41],[56,-115],[15,-97],[11,-101],[-12,-30],[-1,-55],[19,-80],[39,-97],[10,-117],[18,-13],[25,-62],[8,-47],[38,-130],[42,-97],[40,-68],[28,-101],[-1,-25],[-25,-10],[10,-36],[-3,-79],[11,-36],[1,-44],[18,-22],[15,-56],[3,-45],[11,-35],[30,-36],[-1,-111],[15,-42],[14,-76],[17,-26],[-17,-78],[-1,-81],[24,-50],[25,-142],[21,-66],[10,-83],[19,-66],[12,-72],[34,-127],[23,-65],[14,-84],[14,-37],[15,-114],[17,-84],[27,-95],[38,-197],[2,-45],[21,-54],[8,-80],[10,-27],[1,-65],[15,-30],[10,-45],[25,-41],[25,-70],[5,-42],[20,-64],[13,6],[15,-69],[34,-20],[13,-30],[-22,-28],[-31,19],[-21,28],[-8,-138],[8,-29],[2,-113],[-7,-63],[16,-65],[8,-139],[15,-51],[9,-57],[2,-76],[21,-63],[11,5],[13,-64],[34,-70],[67,-21],[27,-62],[8,-61],[29,-63],[9,-36],[40,-52],[39,-85],[11,5],[18,-57],[14,-14],[-3,-47]],[[60244,55785],[-778,0],[-159,0],[-255,0],[-164,0],[-167,0],[10,61],[20,72],[-10,28],[-26,-55],[-17,-106],[-88,0],[-277,0],[-1389,0]],[[59696,61148],[-11,0],[-35,-120],[-1,-73],[-12,-31],[-9,-87],[7,-45],[-13,-29],[-5,-72],[0,-83],[-29,-125],[1,-37],[-18,-45],[-14,-104],[10,-74],[0,-117],[-4,-37],[-27,-43],[-4,-48],[-16,-42],[-19,-4],[-39,20],[-19,53],[-61,95],[-36,113],[-3,38],[-16,48],[-37,50],[-19,64],[-22,41],[-17,55],[-7,58],[9,74],[-16,55],[2,108],[-82,168],[-15,58],[-1,53],[-26,64],[-14,132],[-1,66],[-16,45],[4,35],[-14,35],[-4,214],[-13,35],[-22,23],[-3,45],[-19,41],[-7,69],[-9,50],[10,88],[-7,78],[-2,203],[13,49],[23,5],[4,-29],[44,-52],[42,-17],[28,40],[29,4],[33,62],[13,-102],[60,40],[15,-8],[16,33],[32,-11],[30,4],[57,34],[40,36],[51,76]],[[59505,62470],[13,-74]],[[59518,62396],[38,-259],[26,-128],[6,-106],[11,-27],[-4,-59],[19,-30],[26,-181],[40,-258],[8,-82],[-3,-34],[11,-84]],[[59895,63846],[12,4]],[[59907,63850],[1,-68],[-11,-100],[-2,-88],[11,-81],[2,-62]],[[59908,63451],[-30,-39],[5,-107],[-7,-70]],[[59876,63235],[-38,20],[-4,60],[-29,5],[-21,31],[-44,-74],[-10,-131],[-20,-65],[9,-23],[5,-72],[-6,-54]],[[59718,62932],[11,-67],[12,-21]],[[59741,62844],[43,-35],[1,-6],[0,-1],[0,-30],[-28,-9],[-36,-60],[-13,-39],[-2,-59],[-17,-85],[12,-36],[59,10],[24,12],[48,85],[22,1]],[[59854,62592],[-3,-80],[-18,-86],[16,-105],[-9,-50],[-3,-69],[-22,-55],[-20,-153],[-17,-55],[-11,-102],[8,-68],[-13,-45],[0,-157],[-19,-77],[2,-48],[-15,-81],[-4,-99],[-21,-114]],[[59705,61148],[-9,0]],[[59518,62396],[30,62],[1,60],[52,109],[-21,38]],[[59580,62665],[20,66],[41,182],[22,143],[24,212],[19,197],[3,66],[18,7],[14,40],[-1,40],[10,122]],[[60889,63066],[-54,-110],[-201,-127],[-178,-115],[-177,-117],[89,-230],[187,-482],[-1,-9],[-90,-115],[-40,-208],[-3,-30],[-209,-97],[-66,-253],[-15,-37],[-40,-64],[-71,-136],[-83,35],[-226,89]],[[59711,61060],[4,38],[-10,50]],[[59854,62592],[5,84],[18,106],[-9,118],[6,35],[-7,41],[13,116],[-4,143]],[[59908,63451],[24,39]],[[64752,51949],[-83,455],[-57,317],[-80,438],[-88,474]],[[64444,53633],[132,117],[187,163],[126,109],[223,190],[165,138],[44,340],[66,520],[75,575],[-127,508]],[[65335,56293],[5,59],[-4,103],[6,126],[13,48],[34,154],[47,172],[-1,64],[-10,25],[1,62],[-14,70],[41,57],[27,27],[29,-31],[18,22],[33,15],[-16,75],[-2,38],[-33,-16],[-16,24],[16,67],[0,59],[-19,86],[20,101],[-6,92],[-1,80],[11,39],[16,0],[14,29],[29,-42],[-4,-51],[-20,1],[28,-96],[34,29],[1,47],[33,35],[13,58]],[[65658,57921],[1,1],[0,0],[27,-178],[19,-88],[28,-100],[24,-55],[51,-179],[61,-130],[25,-32],[71,-55],[35,-35],[56,-29],[23,-30],[57,2],[28,-23],[29,-47],[25,-9],[34,22],[23,-9],[6,-36],[39,-41],[14,-87],[29,-49],[7,-56],[14,-26],[10,-71],[23,-69],[28,-47],[9,-70],[15,-62],[14,-13],[12,-47],[36,-82],[78,-20],[13,-83],[-6,-24],[-3,-116],[-37,-116],[-9,-95],[-19,-67],[-22,-57],[-10,-85],[-31,-123],[-1,-28],[-43,-47],[-37,-70],[-56,-145],[-16,-59],[1,-33],[-17,-59],[-30,-55],[-18,-67],[-1,-38],[-25,-95],[19,13],[-4,-67],[-23,-53],[-25,20],[-19,-4],[-24,22],[24,114],[-27,65],[-15,4],[-17,-29],[-3,-115],[-33,-51],[3,-55],[-29,-49],[-10,-52],[5,-47],[-6,-87],[-20,-131],[-15,-41],[-1,-52],[11,-11],[-5,-105],[16,-79],[-4,-119],[16,-55],[-2,-58],[11,-56],[-8,-17],[-35,-25],[-56,0],[-63,-19],[-53,-34],[-46,-44],[-32,-48],[-40,-114],[-1,-95],[-10,-104],[-15,-87],[2,-37],[-29,-47],[-5,-33],[-20,-39],[-5,-31],[-46,17],[-18,-14],[-36,6],[-17,-23],[-47,3],[-54,-23],[-36,-39],[-14,-99],[-31,-53],[-11,-61],[2,-34],[19,-48],[-15,-91],[5,-26],[-31,-78],[-19,-61],[-49,-58],[-30,-16],[-16,6],[-32,54],[-60,4],[-36,-5],[-64,-25],[-12,-45],[-24,-21],[-40,-14],[-53,-94],[-20,9],[-50,-24],[-39,-26],[-23,-29]],[[66343,54779],[28,-16],[3,-57],[-28,-36],[-14,-61],[-7,-65],[-14,-37],[-26,-23],[1,114],[20,59],[20,10],[3,56],[14,56]],[[65579,58689],[28,129],[40,-18],[-3,57],[13,59],[17,-11],[-8,-44],[13,-48],[-18,-15],[-13,-38],[30,-58],[-9,-14],[4,-78],[-26,-135],[-16,-32],[-1,-58]],[[65630,58385],[-26,-6],[-10,150],[10,47],[4,57],[-10,70],[-19,-14]],[[65652,58154],[-19,-49],[-16,9],[15,64],[20,-24]],[[65546,52553],[23,43],[1,-49],[-24,6]],[[59741,62844],[-23,88]],[[59505,62470],[32,71],[43,124]],[[62931,60877],[253,-73],[34,-117],[5,-130],[29,-80],[-1,-14],[201,7]],[[63452,60470],[20,-28],[0,-38],[12,-27],[-9,-48],[8,-42],[25,-59],[-6,-60],[16,-58],[22,-39],[22,-78],[-3,-123],[10,-68],[33,14],[16,-36],[29,-25],[34,-8],[8,-62],[-39,1],[19,-47],[27,-29],[4,-110],[25,9],[-3,-59],[37,60],[16,-82],[20,-41],[1,-29],[34,-61],[22,-28],[24,-5],[40,-120],[-21,7],[-4,-76],[19,2],[-12,-59],[10,-30],[36,-53],[8,-54],[-3,-69],[13,-6],[14,-18]],[[63976,58788],[0,-2]],[[63976,58786],[-13,17],[-14,5],[0,-19],[-13,-34],[-9,-64],[-30,106],[-12,-57],[14,-83],[18,-14],[0,-64],[36,-145],[-11,-24],[22,-75],[35,-100],[14,18],[12,-29],[11,-73],[-3,-37],[10,-47],[1,-71],[14,-32],[33,-120],[11,-109],[12,17]],[[64114,57752],[32,-142],[20,-33],[27,-20],[60,10],[14,26],[11,74]],[[64278,57667],[11,-51],[-9,-41],[-24,-48],[-13,-93],[24,-6],[12,25],[18,-9],[17,-45],[16,2]],[[64330,57401],[0,-91],[139,-427],[136,-425],[178,-53],[178,-54],[266,-85],[88,-29],[20,56]],[[64444,53633],[-205,-91],[-133,-60],[-267,-70],[-196,-54],[-78,-96],[-181,-226],[-162,-514],[-37,-239],[-79,-120],[-51,0],[-70,239],[-106,-36],[-74,12],[-195,60],[-50,72],[-158,0],[-23,-20],[-28,20],[-28,0],[-98,-22],[-13,-52],[-37,6],[-12,26],[-29,-6],[-33,84],[-23,44],[-36,8],[-31,-54],[-4,-68],[27,-41],[-35,-60],[-13,-51],[8,-106],[-8,-107],[32,-59],[-15,-61],[-15,-31],[-11,-99],[-35,-5],[-14,-23],[-5,-68],[-26,-11],[-17,18]],[[61880,51772],[1,50],[-10,20],[-7,58],[5,60],[-16,81],[-39,81],[5,89],[-24,21],[-13,42],[0,39],[-22,36],[-7,168],[-66,153],[-30,47],[-24,57],[-26,27],[-34,105],[-6,48],[-17,35],[-3,45],[-16,78],[-15,45],[-1,54],[-13,81],[-16,42],[-24,15],[-17,82],[11,93],[-23,25],[-5,66],[4,84],[-24,25],[-8,50],[1,48],[-24,66],[1,100],[-48,77],[5,50],[-19,90],[-29,-15],[-27,91],[1,43],[-47,81],[-24,17],[-14,63],[-19,2],[-15,59],[-37,3],[-31,13],[-38,69],[-37,108],[-10,57],[-28,86],[-15,72],[-12,19],[-26,80],[-1,39],[-20,44],[-8,86],[-18,68],[23,59],[-6,66],[-12,34],[-7,105],[-16,87],[-16,42],[-9,83],[20,26],[12,81],[-6,57],[11,36],[8,79],[-9,29],[4,41],[-3,86],[-45,201],[0,69],[-30,29],[-3,104],[-16,42],[-16,72],[-5,88],[-8,59],[-22,41],[-21,84],[-7,73],[-46,108],[-21,14],[-18,50],[-37,43],[-22,49],[-25,4],[-36,73],[-9,31],[-18,-40],[-34,30],[-20,59],[9,49],[-24,79],[-22,92],[-19,19],[-5,41],[22,164],[-12,60],[6,20],[-7,64],[-17,34],[-25,83],[-3,61],[-22,45],[0,33],[-16,70],[-60,81],[-20,78],[16,82],[-10,50],[-29,9],[-20,39],[-4,41],[-39,169],[-17,98],[-18,71],[-33,68],[-15,107],[-36,76],[-32,85],[2,80],[-20,70],[-21,27],[-35,125],[-2,50],[-15,51],[-12,71],[-19,15],[-4,41],[-80,185],[-37,-26],[-31,25],[-18,-4],[-19,19],[-10,-66],[-19,50],[24,66],[5,50],[26,150],[9,31],[-9,100],[16,106],[-3,52],[11,80],[3,60],[16,153],[9,47]],[[61600,52122],[17,-22],[18,-74],[24,-18],[36,31],[24,-46],[0,-90],[-9,-4],[-28,82],[-34,-7],[-27,49],[-21,99]],[[61645,52167],[4,-119],[-15,24],[-11,42],[22,53]],[[64330,57401],[13,-30],[24,5],[11,-44],[6,-89],[25,-43],[42,5],[19,-23],[32,11],[30,24],[39,67],[30,30],[8,46],[23,-46],[51,-4],[32,20],[20,-27],[34,33],[17,-46],[57,19],[27,-26],[12,-31],[37,15],[27,-13],[13,29],[20,-13],[35,29],[34,51],[-4,28],[-26,-42],[-14,19],[39,42],[15,-35],[49,41],[17,32],[4,69],[-39,43],[13,37],[20,-46],[22,-16],[25,19],[10,107],[10,50],[-11,52],[18,53],[29,32],[42,75],[34,48],[37,104],[19,69],[52,119],[24,71],[19,-5],[5,40],[23,40],[20,53],[16,3],[35,82],[28,155]],[[65630,58385],[23,-22],[5,-46],[-5,-127],[7,-12],[-5,-101],[3,-156]],[[65045,57447],[15,26],[15,-41],[-16,-20],[-14,35]],[[64917,57375],[39,33],[9,-28],[27,-32],[-12,-36],[-23,35],[-11,-36],[-21,1],[-28,35],[20,28]],[[64598,57435],[1,33],[19,17],[4,-52],[-14,-35],[-10,37]],[[60716,52931],[-4,-21],[71,-272],[33,-173],[8,-104],[10,-69],[16,-163],[23,-145],[0,-118],[13,-81],[2,-97],[12,-154],[18,-125],[38,-76],[-5,-32],[15,-69],[-11,-42],[7,-49],[27,9],[11,-13],[9,-56],[7,-74],[16,-66],[-7,-85],[20,-46],[14,6],[11,69],[-10,77],[-11,28],[-1,60],[30,61],[27,-59],[30,-48],[-17,-64],[6,-41],[27,-95],[3,-46],[37,-61],[15,16],[8,39],[26,12],[49,-47],[26,-70],[-2,-48],[18,-39],[30,8],[27,-44],[13,4],[40,-33],[9,-44],[25,-48],[7,-60],[17,-38],[6,-42],[26,-69],[10,-53],[29,-72],[10,-69],[34,-9],[13,-39],[31,-10],[18,-62],[22,-94],[8,10],[22,-68],[19,6],[5,-62],[12,-46],[8,-135],[22,-27],[24,6],[27,-63],[9,-39],[20,-21],[-3,-34],[13,-95],[12,13],[18,-41],[18,1],[15,51],[19,-38],[12,-83]],[[61978,49121],[-42,-44],[-30,-41],[-19,-80],[8,-31],[-21,-37],[-18,-8],[-40,89],[-22,23],[-16,-42]],[[61778,48950],[-35,119],[-16,93],[-45,26],[-8,48],[-17,41],[-21,106],[-43,117],[-19,63],[-7,44],[-67,84],[-26,55],[-39,107],[-15,71],[-48,182],[-37,66],[-65,69],[-34,27],[-53,75],[-13,-18],[-19,110],[-22,0],[-10,-44],[-30,-45],[-42,93],[-28,38],[-23,7],[-22,-40],[-4,-36],[-34,25],[-3,-39],[-26,1],[-7,57],[-10,1],[-30,51],[-17,2],[-18,-69],[-48,-54],[-26,3],[-23,-25],[-46,-17],[-9,41],[-17,17],[-28,128],[-21,15],[-13,-12],[-27,31],[-36,125],[-107,-509],[-16,47],[-21,36],[3,25],[-26,80],[-23,-1],[-27,-26],[-11,-99],[-21,-13],[-14,30],[-32,20],[-63,-8],[-18,-39]],[[60155,50232],[-10,59],[-19,503],[-6,91],[28,44],[23,160],[24,206],[18,71],[34,267],[19,53],[-7,33],[9,73],[-17,4],[-7,85],[6,93],[28,43],[4,62],[-8,29],[10,115],[1,53],[37,-27],[44,19],[21,-29],[19,48],[12,61],[1,94],[28,24],[42,8],[7,85],[16,1],[8,-40],[23,16],[13,66],[49,14],[23,-9],[4,44],[19,16],[30,177],[35,87]],[[61122,51367],[11,7],[16,-52],[7,-102],[18,-14],[8,61],[22,-33],[20,-13],[5,-52],[-31,-1],[-26,22],[-46,-11],[6,65],[-14,40],[-29,25],[5,21],[28,37]],[[61778,48950],[-18,-64],[-6,-51],[-20,-44],[-42,-171],[-40,-142],[-32,-56],[-18,-173],[11,-153],[-3,-217],[32,-24],[9,-21],[24,12],[32,38],[14,-13],[41,27],[21,-14],[21,38],[31,26],[22,-9],[20,10],[9,-61],[30,-12],[19,19]],[[61935,47895],[-15,-83],[-16,-21],[-7,-44],[-21,-58],[-12,-52],[-12,-10],[10,-59],[26,-64],[0,-57],[15,-110],[43,-95],[22,-132],[26,-10],[21,-30],[12,-173],[26,-36],[13,-78],[13,-34],[43,-31],[98,-253],[115,-97],[160,-138],[134,-114],[166,-143],[120,-105],[140,-122],[158,1],[120,-1],[-126,-325],[-152,-393],[-95,-241],[-72,-190],[-112,-289],[-103,-279],[-82,-227],[-100,-270],[-131,17],[-136,16],[-104,-75],[-86,-85],[-55,-73],[-22,-38],[-23,-130],[-15,-48],[-18,-36],[-47,-21],[-38,-31],[-43,-13],[-53,-1],[-32,-8],[-17,-50],[-11,-9],[-7,-52],[-13,-30]],[[61640,42865],[-16,-24],[-36,28],[-16,-15],[-75,-2],[-18,-18],[-54,20],[-49,127],[-14,9],[-16,63],[-25,28],[-18,-29],[-142,-149],[-88,-119],[-26,-143],[-46,-120],[-15,-71],[-15,46],[-46,1],[-40,10],[-28,42],[-19,-18],[-16,12],[-16,-12],[-68,59],[-23,7],[-8,28],[-28,-30],[-74,13],[-13,-7],[-40,85],[-61,100],[-97,172],[-79,133],[-28,62],[-53,48],[-46,-5],[-175,9],[-30,67],[2,58]],[[59985,43330],[-39,114],[3,222],[13,60],[-10,55],[9,43],[-47,51],[-20,-7],[-10,27],[-26,-1],[-22,-38],[-26,-16],[-8,25],[7,86],[-52,91],[1,45],[-35,145],[-3,40],[3,93],[-11,44],[-3,83],[10,55],[8,97],[-39,103],[-26,-12],[-23,72],[-22,37],[-19,-6],[-7,85],[-19,48],[-37,4],[-19,61],[-18,21],[-1,65],[-12,11],[-21,52],[-9,41],[-1,58],[-9,44],[-29,68],[-44,78],[-5,25],[-28,29],[-12,-6],[-27,42],[-26,-4],[-19,-20],[-7,26],[-30,29],[-34,2],[-17,47],[-1,63],[11,15],[22,101],[21,17],[-5,122],[8,21],[-4,53],[22,40],[35,-25],[26,27],[36,6],[15,-18],[5,-44],[21,-13],[31,39],[8,47],[32,1],[34,85],[0,305],[-11,335]],[[59473,46821],[-1,41],[17,149],[17,87],[3,117],[28,50],[1,116],[-11,85],[3,38],[-8,62],[4,33],[26,66],[21,98],[38,66],[28,-60],[24,-70],[23,9],[-1,49],[33,61],[-9,42],[13,171],[-10,33],[6,77],[16,58],[9,81],[2,79],[-11,64],[12,53],[51,98],[11,73],[97,423],[97,63],[18,1],[24,-20],[4,148],[-9,31],[39,306],[30,124],[5,80],[12,85],[13,41],[-9,103],[26,200]],[[63320,61527],[15,-15],[2,-103],[25,-100],[23,-113],[-60,19],[-32,-44],[-30,-78],[38,-55],[26,46],[22,-36],[21,-143],[12,-122],[18,-56],[13,-9],[4,-78],[22,-21],[1,-85],[12,-64]],[[63370,61479],[11,27],[31,-63],[25,-104],[-7,-40],[-26,-66],[-19,-5],[-22,121],[-12,23],[14,34],[18,11],[9,50],[-22,12]],[[60244,55785],[-3,-24],[13,-267],[39,-171],[39,-98],[33,-107],[-20,-40],[-10,53],[8,35],[-21,22],[-11,-12],[2,-112],[12,-85],[2,-120],[17,-120],[-12,-56],[-3,-94],[5,-35],[2,-160],[-8,-18],[23,-148],[-1,-105],[-8,-59],[24,-178],[5,-153],[15,-83],[6,-107],[27,-103],[17,-15],[25,11],[22,-12],[17,-65],[42,-45],[13,-47],[31,-51],[-9,-36],[6,-62],[17,-31],[27,-17],[37,-42],[6,-31],[46,-66]],[[59473,46821],[-63,0],[7,165],[17,56],[7,80],[1,103],[-6,59],[-19,18],[-28,118],[-37,76],[-42,144],[-76,97],[7,36],[-37,573],[12,88],[21,291],[11,46],[-156,12],[7,-160],[-4,-44],[-180,0],[82,-176],[0,-377],[22,-98],[-16,-31],[-73,-189],[-45,-62],[-41,-195],[-132,-403],[-23,-41],[-28,-7],[-96,0],[-1,-27],[-84,178],[-147,235],[-17,0],[-112,-148],[0,-238],[-116,0],[-20,-10],[-13,-45]],[[58055,46945],[0,354],[-197,0],[-127,0],[0,-267],[20,-130]],[[57751,46902],[-43,-4],[-70,12],[-99,2],[-33,-17],[-76,-76],[-13,-6],[-86,54],[-25,68],[-25,185],[-27,60],[-22,89],[-29,39],[0,144],[-25,27],[-23,7],[-19,-17],[-41,-5],[-20,-17],[-23,12],[-32,-36],[-18,13],[-13,-27],[-18,-2],[-10,-36],[-8,-71],[10,-23],[-9,-76],[-18,-90],[-37,-68],[-28,-66],[5,-74],[-27,-151],[-29,-123],[5,-53],[-9,-43],[3,-81],[7,-51],[-17,-53],[-35,-40],[-46,-103]],[[56728,46205],[-6,33],[-57,11],[-11,21],[-32,-5],[-52,5],[-20,13],[-14,-18],[-7,62],[17,46],[6,90],[-28,-21],[-9,51],[4,70],[38,61],[9,109],[9,54],[-12,14],[0,63],[19,80],[-8,158],[-102,415],[-42,108],[-41,61],[-6,47],[-29,119]],[[56354,47852],[15,117],[16,86],[-3,61],[-13,8],[4,79],[-44,-15],[-8,51],[-28,29],[-27,82],[-1,53],[21,248],[-44,3],[6,78],[-15,85],[-2,71],[-18,43],[21,78],[9,59],[-41,35],[-36,54],[0,-33],[-13,-29],[-58,-29],[-23,71],[-13,54],[10,28],[21,144],[22,49],[36,41],[13,57],[30,77],[-19,71],[-1,73],[-21,51],[-5,76],[-14,30],[41,115],[21,28],[27,57],[13,-1],[13,38],[14,7],[10,53],[-5,32],[-24,4],[-12,37],[10,40],[-7,45],[2,54],[-14,24],[4,61],[29,29],[19,4],[38,33],[-14,111],[26,40],[-3,44],[37,87],[16,17],[10,57],[7,94],[-4,62],[-19,53],[3,50],[18,23],[36,95],[23,2],[30,-25],[27,8],[23,34],[26,13],[74,-18],[40,-29],[0,359],[0,552],[0,292],[0,648],[0,423],[0,452]],[[56666,53992],[0,358],[278,0],[0,348],[0,1087]],[[61935,47895],[81,332]],[[62016,48227],[36,-59],[26,-21],[4,-76],[16,-46],[12,-69],[22,-87],[57,-158],[50,-92],[6,-24],[33,-52],[32,-65],[26,-19],[11,8],[39,-16],[43,29],[56,-7],[39,71],[40,37],[25,73],[36,0],[33,42],[6,29],[21,15],[39,60],[47,-62],[39,-10],[32,13],[27,-60],[35,-10],[21,22],[39,25],[54,78],[40,73],[25,18],[13,53],[75,84],[34,2],[25,-47],[19,-17],[25,20],[45,-3],[53,8],[28,58],[16,9],[15,36],[35,12],[9,14],[41,14],[60,-54],[23,-7],[81,45],[14,24],[33,-1],[24,32],[13,47],[30,12],[55,4],[25,34],[36,-5],[40,43],[62,82],[13,35],[19,116],[22,35],[11,-5],[35,34],[12,-23],[30,-17],[26,-37],[27,-2],[38,-46],[-10,-68],[2,-25],[-37,-134],[-2,-64],[-8,-46],[-3,-67],[5,-46],[13,-30],[2,-43],[-7,-69],[3,-220],[10,-67],[-33,-25],[-10,-28],[-1,-84],[18,21],[44,9],[-10,34],[1,36],[25,-36],[28,-2],[6,-22],[-12,-55],[-21,2],[-17,37],[-45,-16],[-48,-63],[2,-91],[-6,-67],[4,-48],[-13,-120],[-8,-146],[-6,-48],[1,-52],[11,-45],[-27,-113],[-25,-64],[-3,-82],[-7,-28],[-49,-112],[-10,-47],[-7,-88],[-13,-49],[-6,-91],[-22,-58],[-21,-88],[-9,-84],[-17,-39],[-27,-40],[-41,-113],[-5,-61],[5,-74],[-40,-202],[-57,-206],[-52,-210],[-20,-89],[-21,-128],[-16,-121],[-1,-85],[-27,-166],[-22,-110],[-40,-155],[-31,-136],[-33,-115],[-67,-223],[-24,-93],[-15,-78],[-42,-188],[-13,-46],[-39,-105],[-22,-70],[-40,-108],[-32,-103],[-74,-189],[-35,-104],[-41,-106],[-26,-88],[-41,-114],[-30,-73],[-67,-143],[-10,-44],[-23,-44],[-32,-103],[-22,-53],[-42,-75],[-22,-28],[-107,-169],[-101,-126],[-104,-173],[-98,-193],[-83,-203],[-67,-131],[-82,-191],[-32,-86],[-73,-208],[-68,-190],[-77,-197],[-70,-212],[-42,-148],[-24,-31],[-3,-33],[-24,-76],[-19,-97],[-7,-10],[-33,-136],[-13,-38],[-32,-134],[-17,-57]],[[61544,38817],[0,45],[-81,282],[-77,267],[0,490],[1,521],[0,314],[-1,395],[0,557],[0,344],[94,241],[91,335],[69,257]],[[59985,43330],[-46,-5],[-21,0]],[[59918,43325],[-30,0]],[[59888,43325],[-21,97],[-1,25],[13,74],[-27,23],[-23,-9],[12,64],[-6,19],[-40,-64],[-5,31],[-45,-48],[-119,-115],[-77,-102]],[[59549,43320],[-82,-211],[-25,-75]],[[59442,43034],[-134,-337],[-88,21],[-46,81],[-35,-56],[-51,-34],[-84,-16],[-61,-104],[2,-67],[-32,22],[-8,36],[-29,1],[-4,59],[-18,77],[-21,16],[-25,-59],[-37,-29],[-9,-18],[-71,102],[-29,0],[-46,-72],[-11,4],[-11,-57],[-25,-85]],[[58569,42519],[0,59],[-13,8],[-9,58],[-12,-37],[-11,14],[-16,-26],[-18,26],[4,67],[-8,76],[-23,-8],[-33,64],[-20,24],[-17,-16],[-8,72],[-13,55],[-23,18],[-29,75],[4,37],[-22,42],[-14,-9],[-12,56],[4,82],[-42,75],[-47,45],[-4,-73],[-9,-55],[-21,-33],[-6,-53],[-20,2],[-6,-34],[-48,57],[-17,46],[-51,-13],[-6,45],[-25,-3],[-15,-77],[-18,-6],[-5,-26],[-19,-4],[-15,-63],[-25,8],[-5,37],[-41,-2],[-26,69],[-21,22],[-4,50],[-19,15],[-19,-19],[-26,63],[-7,42],[5,41],[-8,37],[-14,-6],[-16,78],[-25,-5],[-32,91]],[[57623,43607],[5,45],[-26,85],[-22,46],[-14,114],[5,60],[10,34],[-16,34],[-4,72],[-7,29],[-25,48],[-17,0],[-13,38],[-22,29],[-24,-2],[-2,62],[-38,23],[-6,-13],[-30,24],[-11,59],[4,51],[-17,35],[3,25],[-25,26],[-27,72],[16,126],[17,43],[-14,37],[-31,11],[-21,68],[-20,5],[-15,100],[-19,59],[-21,22],[-44,84],[-17,8],[-64,68],[-16,41],[-13,3],[-4,56],[-20,40],[-20,9],[-7,58],[16,42],[12,5],[5,112],[-31,82],[-28,-6],[-10,31],[-21,26],[-16,39],[-14,101],[-30,5],[-7,19],[-31,9],[-13,-18],[-39,59],[-18,-25],[-35,29],[-14,28],[-9,48],[4,64],[26,68],[-10,46]],[[57751,46902],[37,-191],[196,0],[-2,41],[16,72],[51,102],[6,19]],[[64893,49115],[10,1],[33,-60],[20,-14],[10,32],[22,-2],[33,26],[4,19],[61,-67],[13,-3],[37,-43],[-22,-55],[-49,-31],[-27,-52],[-30,-1],[-78,-35],[-21,2],[-28,24],[-31,76],[-43,62],[22,15],[3,75],[40,41],[21,-10]],[[64752,51949],[-45,-28],[-35,-40],[-97,-90],[-23,-42],[-31,-83],[-20,-89],[-15,-101],[2,-97],[11,-39],[-3,-30],[8,-79],[-3,-23],[-94,-90],[-6,-15],[-42,-38],[-26,-60],[-28,-20],[-43,-53],[-33,-27],[-141,-90],[-68,-34],[-37,-62],[-41,-48],[-43,-33],[-8,20],[-24,-3],[-19,-23],[-74,-49],[-27,-37],[-39,-37],[-56,-84],[-13,0],[-23,-62],[-11,-93],[-32,-49],[-10,-55],[-44,-86],[-30,1],[-29,-36],[-7,21],[-27,0],[-24,-35],[-63,56],[-26,-17],[-34,-70],[-29,-17],[-16,-27],[-52,-124],[-22,-37],[-44,-30],[-80,-46],[-35,-49],[-32,-35],[-24,9],[-44,-22],[-55,19],[-48,-14],[-16,5],[-42,-16],[-63,-44],[-35,-86],[-34,-111],[-48,-30],[-32,-50],[-15,-81],[-37,-14],[-11,-58],[-23,26],[-19,-5],[-20,32],[-17,4],[-21,-24],[-27,-81],[-15,1],[-21,-30],[-38,19],[-29,-38],[-34,-3],[-5,32],[-30,33],[-56,42],[-20,-47],[-18,-4],[9,107],[-13,39],[-13,76],[-32,121],[-15,87],[5,46],[5,143],[7,41],[-2,68],[-10,66],[-6,75],[-19,46],[-19,123],[-5,75],[-10,48],[-12,102],[6,73],[-17,121],[-6,74],[6,42],[-8,69],[-16,54],[1,53],[-10,32],[-45,56],[13,52],[13,-31],[9,62],[-9,50],[-4,71],[-14,25],[1,100],[30,125],[7,111],[-11,146],[0,67],[-8,58]],[[61857,50048],[18,49],[11,-29],[-5,-77],[-24,57]],[[61843,51092],[-6,-76],[-15,33],[21,43]],[[56666,32200],[6,-42],[-4,-130],[7,-4],[0,-100],[16,-93],[-18,-30],[4,-62],[-18,-86],[10,-114],[-3,-32],[-5,-159],[0,-67],[16,-47],[11,-90],[-4,-45],[-16,-32],[-17,-61],[-14,-203],[24,-42],[21,-75],[-230,0],[-160,1],[-180,0],[-1,-515],[0,-344],[0,-583],[0,-284],[0,-574],[8,-9],[25,-92],[4,-102],[79,-183],[20,-65],[30,-59],[53,-145],[3,-32],[27,-26],[27,-52],[26,-100],[25,-44],[12,-42],[47,-31],[12,-44]],[[56509,27361],[-183,-93],[-203,-101],[-173,-85],[-50,50],[-9,20],[-64,-21],[-31,-51],[-18,-6],[-45,44],[-23,-6],[-26,45],[-27,18],[-12,25],[-21,-22],[-21,11],[-16,-24],[-24,4],[-28,30],[-30,-3],[-17,-31],[-24,44],[-37,-17],[-36,4],[-39,34],[-36,9],[-6,-20],[-62,14],[-58,94],[-32,72],[-41,140],[-210,0],[-109,0],[-184,-1],[-140,0],[-147,0],[-209,0],[-170,-1],[-32,-33],[-23,17],[-17,-13],[-24,64],[-53,70],[-46,78],[3,31],[-17,59],[-30,27],[-23,-18],[-22,20],[-58,-8],[-19,-28],[-30,-67],[-37,-42],[-21,-44],[-41,-15],[-8,34],[-39,-24],[-13,5],[-20,52],[-30,4],[-32,-19],[-41,-65]],[[53275,27622],[-4,10],[-6,5],[-1,103],[3,121],[15,135],[-1,75],[4,140],[-10,233],[4,78],[-20,85],[5,56],[35,24],[13,73],[20,39],[6,45],[3,125],[7,36],[1,82],[27,35],[-8,69],[12,45],[12,125],[20,62],[11,191],[9,60],[3,92],[-10,66],[9,10],[-3,56],[20,116],[-1,40],[25,0],[11,227],[-7,82],[35,79],[1,53],[35,51],[4,25],[22,40],[12,52],[17,39],[-11,103],[55,117],[3,25],[34,35],[20,-18],[35,70],[12,100],[16,18],[24,84],[5,62],[10,32],[5,82],[10,22],[10,136],[-8,133],[16,201],[-1,40],[11,161],[-9,77],[-31,110],[15,35],[-3,41],[-39,124],[-26,67],[-2,85],[-18,59],[-6,48],[-35,100],[9,24],[-18,105],[-23,83],[11,29],[-12,62],[-6,67],[2,37],[-8,55],[-43,174],[16,29],[15,69],[27,73],[4,36],[28,34],[22,8],[4,82],[-11,35],[-7,81],[14,51],[-7,43],[-30,118],[-31,165],[-9,71],[-16,67],[-16,125],[-19,105],[-8,75],[-15,40],[-1,116],[-11,110],[-27,94],[-38,101],[-21,95],[-28,158],[-30,116],[26,22],[32,7],[42,-14],[-4,57],[17,18],[40,8],[34,56],[6,37],[41,-3],[25,30],[39,-32],[18,36]],[[53730,35806],[34,-10],[62,4],[92,23],[23,-4],[14,-27],[17,12],[13,-20],[44,3],[25,-12],[29,19],[68,9],[132,-4],[72,6],[37,-11],[100,13],[67,-7],[21,18],[26,-27],[-2,-45],[26,-118],[17,-43],[-8,-70],[5,-42],[-12,-41],[12,-23],[-1,-52],[10,-28],[2,-121],[10,-22],[2,-49],[30,-87],[-4,-58],[19,-41],[-13,-53],[10,-54],[-4,-23],[36,-79],[10,-56],[27,-61],[3,-49],[25,-42],[4,-89],[37,-86],[22,-115],[-6,-31],[16,-32],[15,-2],[28,23],[22,-10],[19,22],[65,-11],[1,45],[33,42],[24,-30],[27,12],[34,0],[0,60],[64,0],[10,-60],[162,0],[-6,36],[1,102],[12,98],[-6,71],[25,0],[16,80],[-12,108],[3,102],[18,86],[-5,34],[210,0],[5,60],[85,0],[-9,-104],[-10,-52],[-1,-107],[191,0],[150,0],[12,-36],[10,-81],[-5,-60],[3,-54],[-22,-119],[1,-98],[-7,-26],[6,-60],[13,-30],[19,-132],[10,-38],[-1,-64],[8,-74],[-16,-143],[1,-61],[-8,-63],[-9,-152],[6,-103],[-14,-76],[-5,-60],[11,-28],[10,-75],[2,-64],[18,-26],[11,-53],[26,-82],[22,-9],[12,-32],[6,-63],[0,-100],[17,-73],[14,-97],[-15,-81],[10,-16],[5,-165],[-43,-65],[9,-56],[4,-131],[13,-33],[-4,-76],[26,45],[26,18],[18,47],[-4,34],[25,26],[37,-61],[17,-4],[22,38],[15,-15],[38,-3],[11,-16],[19,22],[13,-19],[28,61],[28,45],[24,16],[51,-46],[30,6],[24,-30],[10,43],[28,62]],[[53639,36650],[-14,6],[-36,-52],[-26,-26],[-4,-40],[-24,-51],[-2,-28],[-20,4],[-12,-59],[-29,-17],[-10,-21],[17,-69],[1,-406],[-70,0],[-21,-23]],[[53389,35868],[-16,96],[10,65],[14,26],[-7,67],[-20,127],[8,35],[-15,21],[-26,89],[2,12]],[[53339,36406],[40,92],[12,66],[31,5],[14,44],[14,91],[18,31],[42,1],[20,62],[20,-10],[-3,72],[32,-47],[60,-163]],[[58170,36822],[-9,208],[-22,138],[-16,33],[-7,121],[8,125],[-10,199],[8,19],[-5,49],[10,88],[-36,105],[-20,73],[-15,14],[10,47]],[[58066,38041],[6,102],[28,5],[16,-26],[29,-9],[8,-44],[-5,-30],[10,-67],[19,31],[23,-24],[38,31],[14,-22],[17,37],[34,14],[12,76],[-4,60],[13,52],[-7,86],[7,25],[22,-22],[14,-45],[24,-4],[20,39],[32,14],[10,32],[38,-74]],[[58484,38278],[-17,-104],[-17,-69],[17,-48],[-12,-17],[-9,-81],[27,-69],[20,43],[27,-71],[20,-3],[25,15],[-6,-46],[9,-88],[-9,-39],[4,-33],[-43,-40],[-10,-24],[9,-50],[-15,-31],[-33,-37],[-13,-30],[2,-33],[-20,-77],[7,-38],[-23,-13],[-6,-44],[-14,-28],[-27,-165],[-23,-38],[-6,-62],[-36,-67],[-20,-24],[-11,11],[-17,-74],[-25,18],[-69,0]],[[63976,58788],[29,-15],[14,47],[33,10],[14,-93],[-10,-171],[-6,-40],[-35,116],[8,40],[-10,86],[-37,18]],[[54303,45407],[14,-12],[49,4],[9,-37],[15,-13],[49,33],[27,69],[47,16],[13,30],[29,21],[7,24],[1,64],[16,-7],[19,55],[10,-72],[19,-20],[0,-52],[32,-45],[9,-50],[15,4],[25,72],[24,-5],[25,20],[37,64],[-1,21],[28,50],[12,-4],[20,36],[47,33],[5,29],[74,-22],[30,43],[152,21],[14,25],[0,45],[12,51],[35,34],[52,180],[13,13],[3,42],[21,62],[-30,62],[-39,59],[-3,25],[33,67],[63,43],[26,-16],[16,14],[35,-12],[34,20],[6,-13],[28,21],[37,13],[54,55],[80,-19],[30,32],[15,59],[-3,40],[14,28],[27,-21],[5,59],[28,6],[33,87],[9,-4],[11,74],[14,31],[-1,35],[33,66],[0,24],[23,45],[14,53],[24,-8],[13,17],[14,49],[5,51],[19,66],[18,-6],[25,22],[15,54],[1,50],[11,26],[-17,51],[5,113],[13,6],[2,87],[14,47],[37,28],[21,35],[21,0],[17,-23],[22,28],[29,11],[43,42],[16,1],[45,-29],[8,-19],[30,-9]],[[57623,43607],[-1,41],[-56,54],[-29,41],[-14,1],[-42,-48],[-19,-76],[-17,9],[-12,39],[-28,-17],[-13,7],[-26,-30],[-19,15],[-19,60],[-23,0],[-40,79],[-18,-12],[-8,-36],[-32,7],[-38,28],[-16,0],[-13,41],[-14,6],[-21,35],[-28,4],[-36,-58],[-12,-66],[10,-58],[-8,-56],[-63,-39],[-7,-36],[-28,43],[-14,-26],[-31,-18],[-5,-22],[-29,10],[-1,39],[-15,44],[-14,6],[-10,36],[-19,15],[-7,-34],[-18,40],[-5,-77],[-17,-2],[-23,-36],[-13,-39],[-16,15],[-22,-41],[-18,10],[-1,-44],[-36,14],[-14,-34],[-53,-19],[-16,-45],[-29,-32],[-13,-44],[-30,33],[-22,65],[-24,-12],[-27,34],[-8,49],[-19,-6],[-4,-44],[-14,-41],[-18,12],[-14,-64],[-1,-52],[-20,-44],[-17,-10],[4,-68],[-18,-72],[1,-48],[-31,-64],[-51,-9],[-26,29],[-17,42],[-26,23],[-17,-9],[-28,14],[-30,42],[-24,1],[-25,-44],[-36,29],[-18,-9],[-23,45],[-19,-37],[-30,44],[-7,30],[-37,36],[-28,6],[-13,-21],[-19,6],[-36,-14],[-21,30],[-21,76],[2,46],[-15,36],[-16,69],[-19,6],[-15,26],[-11,50],[-23,13],[-26,49],[-26,9],[-23,80],[-41,35],[-20,-9],[-22,12],[-29,-13],[-23,-50],[-33,-43],[-10,-44],[-24,-3],[-10,-32],[-14,-90],[-14,-26],[-13,-56],[-24,-47],[-14,-113],[-17,-40],[-36,-10],[-14,-32],[22,-125],[10,-112],[-16,-63],[-5,-76],[12,-228]],[[55173,42498],[-8,9],[-15,90],[-15,32],[-28,-52],[-34,3],[-10,-67],[-14,-7],[-12,58],[-20,6],[-23,-21],[-15,39],[-18,-44],[-9,65],[-28,19],[-6,-14],[-30,6],[-19,38],[-17,9],[-23,-33],[-6,-53],[-21,22],[-13,-25],[-25,-3],[-26,-21],[-7,-25],[-26,31],[-23,-32],[-28,33],[-24,-11],[-22,-39],[-2,-91],[-16,-63],[1,-51],[-8,-24],[9,-67],[-11,-61],[-3,-47],[7,-67],[-88,-437]],[[58569,42519],[26,-15],[-2,-57],[-18,-88],[-8,-7],[-18,-175],[21,-46],[10,-74],[-1,-33],[-17,-60],[-14,-91],[-9,-111],[25,-15],[14,-62],[15,-4],[5,48],[11,3],[22,-43],[16,-58],[19,18],[1,-50],[32,-53],[-10,-103],[-152,-359],[-58,-163],[-16,-1],[-28,-36],[-7,-31],[-19,-8],[-11,-29],[-2,-98],[-12,-25],[-9,-50],[-11,7],[-34,-37],[-10,-150],[7,-89],[-30,-89],[-13,-153],[-13,-4],[-16,-65],[3,-112],[-19,-273],[6,-25],[-9,-73],[3,-20],[-10,-71],[3,-126],[-13,0],[1,-55],[-5,-154],[8,-19],[-4,-121]],[[58219,39014],[-9,-1],[-30,-84],[-25,-2],[-14,-65],[-11,-21],[-7,-50],[-25,-88],[-7,-87],[11,-84],[1,-50],[-18,-98],[-30,-22],[-13,-57],[-12,2],[-12,-47],[7,-26],[0,-59],[7,-88],[24,-18],[10,-28]],[[58170,36822],[1,-102],[-21,-151],[3,-110],[8,-73],[19,-84],[23,-200],[18,-94],[9,-122],[-7,-48],[-28,-93],[-2,-79],[10,-80],[2,-65],[9,-58],[23,-78],[13,-99],[12,-40],[44,-86],[36,-42],[38,-87],[39,-140],[27,-158],[9,-127],[23,-121],[35,-125],[14,-70],[20,-164]],[[58547,34126],[-139,-52],[-121,-46],[-262,-98],[19,-107],[-3,-47],[-11,-54],[-29,-105],[-38,-104],[-31,-62],[-49,-77],[37,-69],[0,-72],[16,-27],[-1,-40],[20,-149],[10,-44],[-15,-129],[6,-21],[-4,-101],[-15,-46],[15,-47],[-3,-51],[7,-43],[-4,-70],[9,-23],[-1,-53],[9,-13],[-11,-53],[-26,-76],[-4,-83],[-18,-120],[5,-18],[-2,-77],[-10,-45],[-15,-120],[-4,-85],[14,-45],[-4,-50],[25,-112],[58,-81],[40,-112],[15,-18],[24,-81],[11,-72],[21,-8],[37,14],[13,-25],[17,-1],[34,-33],[4,41],[-10,47],[6,63],[26,47],[29,-36],[26,60],[11,-1],[0,-515],[0,-413],[-25,-10],[-31,40],[11,40],[6,59],[-25,44],[-15,-18],[-26,-62],[-21,-8],[-50,-88],[-11,50],[-14,-1],[-23,-31],[-12,33],[-13,137],[-19,22],[-6,108],[-20,45],[-11,54],[-17,37],[-31,-6],[-25,75],[16,21],[7,38],[-25,53],[-29,94],[-31,7],[-17,31],[-13,-43],[-11,62],[-34,27],[-8,51],[-21,4],[-24,-26],[-33,-8],[-10,47],[-25,42],[-3,49],[-13,35],[3,64],[-23,59],[-29,49],[-17,15],[2,71],[-8,83],[-13,-23],[-30,6],[-10,-19],[9,-64],[-12,-41],[0,-52],[-19,-73],[-17,-33],[-28,22],[-16,-35],[-38,14],[-42,53],[-32,-38],[-29,30],[-23,-13],[-37,15],[-17,22],[-20,58],[-10,-18],[-30,11],[-17,60],[-42,-40],[-2,50],[-44,64],[-10,49],[4,34],[-10,108],[19,110],[-13,13],[-17,-24],[-34,-21],[-53,-4],[-17,-22],[-36,-12],[-12,-17],[-32,-88],[-38,-9],[-19,45],[-18,-3],[22,77],[6,41],[-5,102],[-26,43],[-15,-7],[-28,14],[-3,78],[-19,25],[-18,-1]],[[53730,35806],[-20,-30],[-40,32],[-21,-19],[-13,14],[-54,19],[-37,-42],[-9,-37],[0,-17],[-13,-22],[-30,61],[-39,-45],[-21,15],[-44,133]],[[53639,36650],[3,68],[16,-27],[6,-38],[31,-73],[19,-12],[0,-42],[30,6],[7,52],[11,12],[17,-38],[33,76],[-5,46],[6,38],[-2,95],[32,18],[5,-41],[25,-20],[29,76],[39,14],[19,36],[40,45],[-5,-47],[23,-61],[-10,-61],[-22,-30],[19,-65],[0,-79],[-6,-77],[21,11],[23,-10],[26,-43],[15,15],[40,67],[17,97],[33,94],[20,37],[21,74],[3,36],[39,49],[20,-29],[20,30],[13,135],[11,28],[39,34],[31,8],[22,20],[41,231],[13,43],[11,71],[20,71],[5,63],[-9,21],[-2,87],[5,76],[-4,109],[16,198],[-13,122],[-3,139],[8,66],[34,58],[52,137],[30,125],[7,61],[20,118],[22,86],[29,84],[47,101],[59,36],[33,85],[50,154],[13,15],[21,76],[3,138],[-13,47],[2,108],[20,79],[7,133],[17,77],[34,88],[0,72],[-6,40],[-18,34],[-2,123],[3,71],[-10,43],[6,105],[18,54],[7,50],[-3,41],[13,94],[15,40],[8,66],[0,59],[6,50],[-11,96],[10,78],[-2,109],[6,28],[-2,106],[24,48],[0,21],[23,116],[22,72],[0,18],[21,70],[9,84],[13,27],[6,96],[18,48],[18,81],[-7,181]],[[53611,35803],[-7,-21],[-27,-4],[-24,-49],[-15,11],[23,55],[14,11],[22,-15],[14,12]],[[53339,36406],[-35,101],[-13,68],[0,32],[-19,60],[10,47],[-23,74],[-96,204],[-4,44],[-20,55],[-41,78]],[[61979,49123],[3,2],[5,-45],[55,-188],[6,-84],[9,-38],[3,-68],[-13,-101],[-52,-23],[-35,-100],[-22,-4],[-10,-25],[-20,11],[-26,-30],[-22,-79],[-6,-47],[-10,-9],[-24,22],[-7,-47],[20,-38],[23,6],[-2,40],[35,40],[97,5],[14,-62],[16,-34]],[[61978,49121],[1,2]],[[61544,38817],[-46,-135],[-20,-73],[-28,39],[-42,-64],[-11,-43],[-40,38],[8,-72],[1,-94],[-27,-5],[-10,-22],[-15,16],[-8,-49],[16,-8],[2,-37],[16,-14],[-39,-72],[-21,-50],[-23,20],[-48,-26],[-46,-84],[-6,-55],[3,-38],[-7,-136],[5,-29],[-2,-60],[-11,-48],[-1,-68],[-33,-52],[-9,-31],[-30,-168],[2,-40],[-11,-91],[-18,-99],[-42,-174],[-17,-130],[-27,-93],[-19,-22],[1,-73],[-22,11],[-13,38],[-19,-61]],[[60887,36663],[-172,312],[-81,147],[-139,250],[-11,95],[-44,75],[35,92],[-11,180],[-48,81],[-147,213],[-129,186],[-128,187],[-201,293],[-220,320],[-124,181],[-16,17],[-25,0]],[[59426,39292],[-3,315],[1,73],[15,234],[-19,164],[41,162],[13,32],[-5,63],[15,91],[15,30],[22,12],[21,94],[25,60],[10,56],[4,78],[9,46],[40,71],[35,10],[9,63],[-16,78],[21,28],[5,51],[22,35],[13,64],[12,180],[-13,48],[-2,48],[-17,243],[8,59],[-13,83],[-13,-4],[-21,82],[-3,89],[-15,31],[-16,2],[-15,40],[-8,124],[-8,28],[-23,27],[-4,77],[-13,65],[6,86],[8,20],[3,108],[-23,44],[-20,-13],[-17,51],[-8,70],[-25,-7],[2,65],[-20,47],[8,25],[-11,42],[-1,41],[-15,31]],[[59549,43320],[195,2],[144,3]],[[59888,43325],[29,-26],[1,26]],[[61362,38410],[24,-23],[-9,-35],[-15,58]],[[53211,63792],[23,-48],[58,-22],[14,-15],[61,-95],[37,-46],[38,-25],[46,-15],[50,-2],[51,16],[88,69],[42,-11],[7,-19],[46,-52],[61,3],[39,-20],[20,-32],[63,-25],[64,-129],[38,-12],[41,-42],[39,1],[57,-21],[30,-23],[16,-42],[24,-107],[0,-122],[8,-76],[40,-207],[37,-112],[43,-65],[58,-60],[58,-30],[45,-12],[101,-3],[69,-36],[83,-57],[25,-5],[20,-37],[62,-52],[46,-20],[18,-51],[70,-45],[30,-56],[18,-48],[47,-77],[48,-96],[29,-15],[40,-66],[34,-17],[37,0],[53,36],[55,72],[8,-4],[49,90],[35,91],[43,141],[23,118],[7,100],[-24,126],[-19,58],[-13,108],[-4,71],[-10,64],[11,166],[20,47],[12,58],[35,99],[57,115],[46,77],[86,94],[55,65],[77,6],[23,18],[45,77],[32,24],[57,-33],[70,23],[5,-33],[51,-6],[32,-43],[98,-77],[20,-24],[53,-27],[1,-91],[13,-35],[-21,-66],[2,-27],[35,-39],[11,-50],[18,7],[28,-29],[98,-6],[30,-33],[26,-10],[31,-67],[129,-21],[32,28],[25,-4],[34,-27],[28,-6],[17,-36],[-4,-46],[23,-74],[11,-68]],[[56666,53992],[-135,185],[-136,184],[-137,183],[-136,182],[-138,181],[-137,180],[-138,179],[-139,177],[-139,177],[-140,176],[-140,175],[-140,173],[-141,172],[-142,171],[-142,170],[-142,169],[-139,-162],[-139,-162]],[[64114,57752],[13,16],[0,96],[-17,60],[4,41],[-12,56],[-3,213],[9,82],[12,17],[19,-28],[9,79],[-12,62],[11,69],[17,67],[14,103],[30,29],[25,51],[33,-40],[-1,-29],[26,-81],[15,4],[22,-29],[4,-83],[-20,-31],[6,-94],[-15,-10],[-5,-67],[13,-51],[2,-108],[16,-8],[9,-51],[-2,-151],[-14,-68],[-17,-50],[-18,-128],[-47,-30],[22,-43],[16,50]],[[58219,39014],[24,3],[10,27],[41,-11],[15,-87],[28,47],[36,47],[7,55],[12,4],[37,100],[1,43],[34,8]],[[58464,39250],[1,-73],[9,-8],[12,-57],[5,-63],[17,-37],[13,-3],[16,-40],[3,-52],[26,-92],[-5,-30],[3,-86],[-7,-90],[25,-104],[-15,-88],[2,-84],[-23,-49],[-14,26],[-17,-42],[-31,0]],[[65405,36697],[21,-44],[-15,-21],[-30,56],[24,9]],[[58464,39250],[18,-13],[33,10],[12,34],[28,11],[141,0],[237,0],[198,0],[160,0],[135,0]],[[60887,36663],[-10,-86],[-7,-226],[-18,-70],[6,-19],[-18,-126],[-21,-109],[-4,-46],[-17,-26],[6,-44],[-21,-104],[0,-48],[-12,-72],[1,-32],[14,-57],[3,-123],[10,-63],[12,-29],[36,-34],[28,-59],[19,-64],[6,-52],[16,-49],[21,-32],[28,-7],[20,-88],[-2,-87],[-6,-40],[-24,-13],[-27,-98],[0,-62],[-18,-144],[4,-125],[-15,-56],[12,-34],[-1,-17],[2,-5],[1,0],[2,4],[1,2],[1,-2],[1,1],[1,-1],[2,2],[1,5],[3,-1],[3,4],[2,-4],[1,-3],[3,3],[3,1],[11,-21],[-10,-73],[-38,-155],[16,-77],[-1,-113],[21,-69],[-8,-52],[23,-31],[27,-107],[-34,31],[-7,-58],[21,-28],[23,-98],[15,0],[16,-50],[4,-139],[-13,-26],[21,-61],[10,-105],[0,-70],[22,-66],[-3,-69],[9,-41],[27,-50],[9,-40],[49,-46],[1,-52],[17,-13],[10,30],[18,-32],[16,-107],[15,-64],[-6,-11],[-1,-6],[-1,-2],[-1,-3],[0,-4],[0,-4],[-2,-9],[-21,-9]],[[61190,32428],[-1,-1]],[[61189,32427],[-9,-12],[-1,-4],[-2,0],[-7,-12],[-1,-4],[-1,-13],[0,-2],[-2,-2],[-4,-1],[-3,-10],[-4,-12],[-4,-8],[-3,-3],[-5,-11],[0,-1],[-18,-39],[-2,-2],[-1,-6],[-2,-5],[-4,-9],[-1,-2],[-4,-9],[-3,-3],[-25,-17],[-1,-2],[-3,-3],[-2,-3],[-4,-4],[-3,-5],[-28,-40],[-2,-3],[-13,-15]],[[61027,32165],[-44,-24],[-46,-73],[-33,-71],[-36,22],[-30,-21],[-37,1],[-24,-50],[-38,-24],[-35,-66],[-15,-39],[-31,30],[-26,57],[-46,30],[-14,-15],[-32,13],[-31,-35],[-2,-46],[-14,-61],[2,-38],[-12,-32],[-24,-17],[-19,-35],[-23,9],[-16,-16],[-9,-35],[-23,7],[-16,30],[-15,-15],[-37,20],[-27,34],[-22,-18],[-20,15],[-19,-46],[-41,-64],[-10,26],[-18,-43],[-8,57],[-28,2],[-10,-25],[-38,4],[-10,27],[5,65],[-75,101],[-33,14],[-12,-37],[-16,-4],[-17,-53],[-52,-22],[-64,9],[-76,-4]],[[59710,31709],[-1,59],[-12,77],[-31,46],[-12,80],[-33,67],[-4,81],[14,45],[2,135],[-6,46],[-21,83],[3,57],[-10,62],[7,73],[-4,70],[-14,63],[6,36],[-14,64],[-43,139],[-2,19],[-79,187],[-20,-21],[-7,-28],[4,-43],[-6,-54],[-31,42],[-15,40],[-21,-20],[-40,20],[-13,-28],[-19,10],[-7,39],[-24,51],[-35,-14],[-16,9],[-40,91],[-11,-24]],[[59155,33268],[-26,15],[-28,40],[-3,27],[-58,20],[-30,99],[-51,-9],[-26,54],[-25,6],[-23,-19],[-14,41],[3,59],[-45,33],[-14,-25],[-43,59],[0,76],[-8,35],[-17,2],[-9,32],[-20,22],[-30,-16],[-18,34],[-19,-32],[-16,0],[-20,33],[-46,151],[-22,121]],[[61034,34373],[8,32],[23,19],[9,74],[10,-25],[-7,-67],[-13,-72],[-14,9],[-26,-67],[-19,10],[0,35],[29,52]],[[61032,36432],[-12,27],[15,33],[25,-51],[3,-107],[7,-62],[-16,-132],[-9,-29],[-35,1],[6,106],[22,16],[4,60],[-19,40],[9,98]],[[60890,35679],[8,113],[11,10],[9,103],[14,-56],[0,-86],[19,-117],[7,-78],[18,-11],[18,-126],[-13,-59],[-13,-6],[-24,78],[-24,91],[-19,-24],[-8,14],[-3,154]],[[60910,34335],[21,27],[7,-20],[-5,-4],[1,-10],[-6,-1],[0,11],[-5,-11],[-3,2],[-2,-7],[-3,0],[-1,1],[-1,0],[-2,-6],[-3,5],[2,13]],[[69333,4794],[-19,-20],[-29,17],[-1,-72],[38,-41],[54,-16],[26,31],[2,28],[55,66],[31,-24],[43,72],[51,-27],[13,-73],[-5,-79],[-25,-58],[-28,26],[-26,-17],[-42,17],[-29,-21],[-33,16],[-32,-72],[13,-70],[38,-35],[18,40],[35,24],[46,-29],[3,-28],[-17,-56],[-48,-47],[-71,40],[-15,63],[-1,43],[-28,-11],[11,-36],[-5,-48],[-71,13],[-18,51],[-41,5],[-58,-109],[-60,-8],[-14,37],[6,49],[21,56],[-3,35],[19,39],[-29,46],[13,17],[-6,49],[-17,50],[11,44],[-17,43],[19,83],[15,23],[-20,47],[39,65],[1,46],[31,36],[8,-64],[15,-6],[-7,-166],[20,-27],[2,-49],[15,-13],[34,21],[17,40],[27,3],[32,-20],[-7,-39]],[[69238,4912],[30,37],[12,-33],[-20,-59],[1,-45],[-36,8],[-5,58],[18,34]],[[64496,6748],[37,-27],[-5,-31],[-35,-4],[-24,34],[27,28]],[[64344,6741],[28,35],[29,-36],[-5,-51],[-28,-3],[-24,55]],[[63941,6975],[22,5],[8,-38],[-28,-10],[-2,43]],[[61029,24633],[8,-42],[-26,-8],[-2,41],[20,9]],[[57017,27251],[-7,-87],[22,-119],[21,-31],[27,-127],[9,-61],[24,-72],[11,-9],[12,-55],[25,-37],[2,-68],[10,-84],[35,-54],[13,-86],[-9,-25],[3,-46],[19,-76],[27,-144],[8,-77],[21,-28],[18,6],[38,-126],[24,-14],[14,-24],[10,-56],[23,-3],[6,-38],[35,-16],[36,-38],[18,3],[27,-49],[18,-2],[22,-109],[5,-69],[-4,-121],[20,22],[30,1],[30,-19],[32,3],[10,-47],[-7,-35],[8,-72],[-1,-66],[-10,-50],[3,-124],[-3,-35],[17,-48],[14,-15],[33,-115],[15,-88],[-2,-43],[14,-41],[50,-20],[26,10],[19,-9],[38,-47],[22,27],[79,-90],[54,-33],[-11,-89],[4,-45],[20,-52],[25,-10],[15,11],[11,-44],[24,-53]],[[58159,24093],[-44,12],[-20,-27],[-30,-1],[-20,-73],[2,-41],[-8,-41],[-31,-39],[-34,-20],[-17,-29],[-83,-11],[-39,-67],[-13,-65],[-34,-63],[-1,-50],[-28,-36],[-4,-74],[-39,-55],[-10,-62],[-20,21],[-27,-47],[-3,-59],[-10,-27],[-53,-10],[-10,-45],[-43,-44],[-21,-105],[-19,18],[-8,-41],[-11,-110],[-7,-124],[-12,-51],[4,-72],[-4,-36],[-22,-40],[-12,1],[-65,-131],[-15,-87],[-17,-20],[-107,-62],[-12,-18],[-30,-5],[8,-90],[-44,-269],[-7,-23],[-11,-129],[-23,-122],[-18,-33],[-54,-63],[-42,4],[-37,32],[-39,-64],[-46,5],[-13,-14],[-65,64],[-19,-22],[-33,42],[-19,61],[-36,-11],[-27,15],[-18,-6],[-42,102],[-37,69],[-17,10],[-32,68],[-6,-25],[-40,27],[-25,-4],[-15,-27],[-22,-1],[-22,-21],[-15,-46],[-7,-55],[-22,-65],[11,-23],[-15,-80],[-10,-13],[-12,-120],[1,-75],[-40,-91],[-9,-61],[-21,18],[-14,-16],[-16,-69],[-33,-20],[-16,-39],[-7,-77],[-24,-52],[-7,-37],[-27,-25],[-36,5],[-11,-11],[-1,-89],[-24,-43],[-25,10],[-21,-10],[-25,23],[-30,1],[-55,-34],[-33,19],[-10,26],[-27,9],[-34,-49],[-23,3],[-15,55],[-2,78],[4,66],[-7,46],[12,61],[57,205],[-9,35],[5,107],[-11,37],[-13,92],[-21,60],[5,72],[-18,42],[3,23],[-21,75],[-34,143],[-17,115],[-24,38],[-8,37],[-40,32],[-9,35],[-25,52]],[[55555,22252],[0,671],[0,593],[0,717],[277,0],[0,446],[0,425],[0,669],[0,430],[0,671],[127,0],[109,53],[165,82],[183,92],[55,0],[29,-125],[34,-72],[12,-146],[13,-16],[20,49],[28,34],[6,34],[32,58],[2,38],[23,41],[22,19],[28,73],[27,-13],[22,63],[15,-2],[21,-74],[22,-8],[10,50],[58,105],[24,28],[27,-20],[19,0],[23,42],[29,-8]],[[70363,2028],[16,-39],[48,5],[28,-20],[22,-70],[-40,-38],[-22,-2],[-26,45],[-10,79],[-16,40]],[[63805,28608],[-7,-105],[9,-59],[34,-38],[8,-34],[-13,-88],[13,-76],[-5,-75],[-10,-30],[-22,-108],[23,-69],[-50,-26],[-11,-22],[-16,-85],[-9,-76],[-25,-100],[2,-72],[15,-70],[5,-123],[9,-32],[-25,-195],[-8,-93],[5,-31],[-14,-62],[-10,-135],[-10,-41],[-32,-216],[-50,-317],[-5,-82],[-33,-205],[-14,-157],[2,-57],[-38,-211],[-34,-213],[-15,-130],[-19,-224],[-25,-176],[-12,-120],[-50,-354],[-48,-290],[-17,-126],[-9,-125],[-1,-66],[-14,-163],[-14,-103],[-7,-103],[-23,-149],[-16,-225],[-27,-153],[-24,-112],[-28,-191],[-7,-81],[-24,-130],[2,-39],[-20,-57],[-8,-88],[-25,-11],[-14,-46],[-29,-26],[-36,-62],[-25,-16],[-37,25],[-51,-18],[-63,-54],[-61,-71],[-78,-131],[-31,-23],[-48,-2],[-41,-17],[-15,55],[-37,36],[-10,42],[-36,57],[-24,18],[-102,35],[1,27],[-16,49],[-30,59],[-20,0],[-15,31],[-13,118],[-18,43],[-10,54],[5,70],[-33,99],[-17,27],[-20,63],[-6,132],[4,108],[-4,27],[-7,176],[5,102],[29,30],[2,80],[-29,76],[-15,68],[3,40],[-7,97],[-36,63],[-8,44],[-18,52],[-12,117],[-13,92],[-6,131],[-10,73],[9,38],[-6,42],[2,88],[22,5],[9,93],[-1,109],[36,76],[6,93],[-4,40],[22,3],[-14,49],[13,36],[49,-7],[41,215],[-4,65],[9,69],[42,63],[9,144],[13,17],[3,54],[31,45],[-1,50],[13,69],[18,41],[31,97],[12,55],[-15,55],[15,60],[-14,45],[11,72],[-16,186],[2,44],[-29,27],[-9,112],[-12,61],[-8,242],[-13,19],[-11,71],[-16,68],[-1,33],[-15,80],[11,115],[-17,74],[-2,78],[5,59],[0,106],[-12,12],[-3,59],[9,52],[-17,22],[12,96],[9,-1],[13,74],[30,94],[12,94],[13,23],[13,74],[15,55],[9,68],[22,-7],[9,94],[-9,26],[-14,140],[12,83],[-6,40],[25,2],[40,-15],[29,-34],[4,-29],[25,24],[0,35],[24,37],[38,112],[24,45],[15,-12],[4,-79],[9,-35],[28,58],[3,43],[31,17],[6,-13],[-5,-71],[22,-6],[-4,49],[22,171],[18,-53],[32,14],[13,-17],[29,6],[18,-20],[9,43],[-10,30],[4,41],[28,10],[13,-12],[0,-57],[7,-51],[-4,-50],[11,-47],[25,-31],[14,11],[31,-21],[20,-31],[8,54],[-38,61],[-9,45],[-45,52],[23,69],[-23,-7],[12,72],[30,77],[6,-4],[111,216],[17,17],[8,-66],[21,-18],[-5,-52],[-20,-23],[1,-115],[10,-29],[-11,-34],[9,-53],[37,130],[12,23],[34,16],[-9,77],[-19,-15],[-12,43],[5,43],[-33,49],[1,34],[16,56],[26,32],[18,76],[34,42],[-8,33],[-21,-3],[47,129],[10,-43],[-2,-107],[-22,-74],[-2,-80],[7,-27],[28,28],[-5,26],[16,30],[7,88],[13,72],[23,71],[6,37],[15,38],[29,-71],[15,46],[12,-30],[-3,-67],[-10,-13],[-20,-71],[29,4],[8,56],[1,144],[-17,3],[-7,30],[-19,-31],[-12,10],[-21,-23],[-11,146],[6,47],[19,30],[-3,35],[41,-8],[24,-69],[11,71],[-5,17],[6,88],[-10,76],[5,55],[-39,23],[-9,100],[8,106],[29,12],[21,30],[21,-33],[5,-59],[-1,-55],[27,-46],[21,24],[7,28],[-8,63],[24,59],[27,2],[13,47],[17,28],[15,-16],[33,50],[8,43],[-4,34],[10,59],[1,114],[9,31],[24,36],[-6,82],[3,39],[-15,34],[-2,67],[-11,42],[9,56],[-17,1],[-23,77],[30,8],[22,-56],[16,109],[27,17],[15,26],[14,76],[-13,53],[14,26],[1,50],[12,29],[15,-12],[18,-96],[-12,-39],[-26,-14],[17,-43],[-20,-49],[38,1],[19,-25],[25,-9],[9,-26],[-6,-62],[8,-17],[-1,-122],[15,10],[10,-26],[9,-58],[23,-1],[27,-125],[24,-67],[-3,-103],[25,-168],[4,-70],[15,-68],[2,-53],[15,-76],[0,-153],[7,-32],[-6,-109],[16,-69],[-7,-120],[2,-82],[7,-40],[4,-85],[11,-78],[14,-58],[6,-61],[38,-132],[3,-81],[-13,-84],[-4,-87],[-17,-89],[-20,-137],[-11,-17],[-7,-58],[-16,-3],[-5,36],[-19,12],[-17,37],[1,60],[-18,37],[3,73],[-21,54],[4,39],[-6,55],[-47,-13],[-28,-78],[9,-37],[1,-70],[15,-101],[-1,-37]],[[63846,27816],[3,53],[19,80],[6,-53],[-20,-86],[-8,6]],[[63466,30384],[26,-21],[-15,-34],[-11,55]],[[63403,30510],[24,-48],[-8,-31],[4,-48],[-37,25],[-2,63],[19,39]],[[62931,28520],[23,-12],[-8,-48],[-15,60]],[[61027,32165],[27,18],[27,45],[31,22],[35,75],[30,78],[30,19],[12,39],[31,-48],[22,-7],[-4,-66],[-21,-26],[-2,-25],[25,-40],[4,-33],[-22,-35],[-6,-45],[20,-60],[-19,-62],[4,-36],[-20,-28],[-14,-63],[10,-59],[11,-12],[-12,-90],[2,-43],[-10,-44],[20,-58],[-2,-23],[10,-68],[-2,-37],[12,-52],[-3,-64],[-16,-72],[1,-62],[10,-126],[-13,-46],[20,-13],[11,-84],[0,-116],[-39,-62],[-4,-45],[23,-76],[7,61],[20,15],[-8,-65],[1,-188],[7,-30],[-21,-118],[15,-51],[-7,-58],[10,-31],[4,-125],[13,-88],[-7,-89],[-24,-20],[9,-36],[42,21],[7,-101],[-24,-44],[2,-54],[43,39],[6,-103],[-8,-52],[10,-39],[-1,-92],[-7,-25],[-33,-39],[8,-64],[-4,-68],[-20,-2],[-30,-30],[-8,-29],[18,-23],[23,11],[0,-89],[-35,-106],[0,-37],[-15,-21],[-26,-132],[-55,-136],[-25,-44],[6,-73],[-21,-80],[-18,-39],[-16,3],[-5,50],[-35,-61],[-6,-52],[15,-52],[-22,-94],[-45,-64],[-5,-19],[-67,-93],[-32,21],[-9,-84],[-55,-71],[18,-33],[-41,-32],[-45,-22],[4,43],[-17,4],[-26,-40],[-40,-21],[-2,-51],[-40,-33],[-32,-54],[-1,82],[-20,5],[5,-49],[-20,-8],[-15,-72],[-54,-59],[-16,14],[-11,-57],[-19,-28],[-15,7],[-35,-35],[-2,-38],[-22,-1],[-22,-33],[2,-31],[-17,-32],[-6,49],[-13,38],[-17,-15],[-5,-38],[22,-50],[-7,-46],[-28,-93],[-15,-6],[-10,70],[-15,13],[0,-101],[-30,-72],[-1,-39],[-21,-6],[16,-52],[1,-41],[-21,-49],[-9,6],[-23,-59],[-22,-14],[-4,-65],[-12,2],[-1,-19],[-14,-28],[-11,10],[-13,0],[-10,21],[-7,-38],[0,-29],[-2,-8],[3,-8],[5,-33],[-1,-41],[-18,23],[-18,-32],[-6,-44],[-24,-8],[-16,-57],[-26,14],[-3,-38],[-22,-40],[-19,-3],[-35,-145],[-31,-63],[-5,-42],[-15,-30],[-5,-40],[-29,-42],[-8,-38],[-47,-84],[-18,-18],[-31,-70],[-20,72],[-36,60],[-7,-55],[20,-20],[8,-29],[-6,-46],[7,-43],[-11,-119],[-14,-62],[16,-51],[-6,-33],[-18,-12],[-5,-55],[1,-86],[15,-56],[22,-11],[41,-211],[39,-41],[1,-44],[-22,-30],[20,-59],[0,-118],[19,-18],[12,-75],[33,-138],[4,-128],[9,-66],[-2,-46],[6,-87],[0,-67],[21,-30],[21,92],[9,-67],[6,-167],[-9,-107],[3,-183],[8,-78],[13,-23],[-21,-83],[-8,-63],[0,-109],[-18,-131],[3,-95],[-12,-21],[-8,-56],[-3,-82],[13,-37],[28,49],[16,-13],[-15,-86],[0,-86],[-27,-109],[-56,-168],[-14,-64],[-41,-61],[-49,-55],[-75,-64],[-71,-69],[-27,-18],[-58,-57],[-85,-72],[-103,-111],[-81,-110],[-35,-59],[-25,-61],[-23,-109],[-12,-7],[2,-60],[-29,-93],[-17,32],[-29,-68],[10,-35],[28,74],[30,-107],[-2,-37],[18,-10],[23,-91],[19,7],[-3,64],[10,70],[15,5],[-17,-372],[3,-53],[-4,-106]],[[59136,20749],[-55,-7],[-100,3],[-31,22],[-24,-5]],[[58926,20762],[0,225],[-16,87],[-1,71],[9,104],[-5,109],[-24,9],[-8,31]],[[58881,21398],[-12,81],[21,140],[-7,135],[9,51],[6,181],[-10,318],[3,166],[-7,110],[-21,88],[-8,165],[-31,48],[-20,117],[-2,69],[-36,104],[-3,48],[4,163],[-71,548]],[[58696,23930],[19,29],[139,365],[149,398],[11,5],[-14,72],[-6,70],[30,87],[10,59],[-11,181],[3,31],[20,42],[28,-1],[37,153],[19,47],[0,123],[19,7],[-3,39],[28,5],[-1,57],[10,128],[-21,25],[-14,49],[-23,-8],[0,144],[-21,17],[1,72],[21,57],[8,127],[-12,68],[-34,-12],[-6,64],[9,15],[-8,52],[31,44],[30,-1],[11,69],[-12,45],[-5,56],[20,51],[16,5],[1,53],[10,32],[-13,35],[-3,87],[-9,20],[-11,97],[10,59],[-7,31],[7,66],[13,11],[-2,67],[9,54],[-18,42],[-5,54],[25,97],[-16,28],[-2,87],[-14,83],[-29,105],[22,18],[20,138],[-18,6],[-41,-9],[-20,23],[3,56],[-39,48],[-47,46],[-36,24],[-65,-6],[-35,25],[-6,57],[-48,92],[-78,31],[-44,109],[-37,13],[-31,-24],[-14,-29],[-21,43],[-130,0],[-5,-4],[0,276]],[[58450,28807],[-17,45],[4,153],[-25,60],[-17,101],[-1,88],[45,28],[27,36],[89,86],[78,47],[54,44],[63,37],[50,71],[38,21],[38,49],[30,18],[53,47],[55,27],[36,43],[53,49],[130,114]],[[59233,29971],[16,-24],[7,-38],[-7,-44],[12,-51],[11,-9],[18,-73],[7,-51],[21,-23],[21,-64],[3,-46],[14,-19],[15,82],[17,-38],[32,54],[48,-9],[-1,23],[49,19],[11,23],[26,-2],[23,-94],[11,-15],[10,-68],[-9,-26],[18,-90],[-1,-70],[11,-75],[-8,-59],[-4,-76],[6,-62],[-22,-48],[1,-23],[-27,-64],[8,-97],[-25,-94],[-18,-12],[-13,-62],[2,-52],[26,-36],[23,-72],[-11,-83],[6,-47],[20,-33],[22,-13],[7,-75],[21,-16],[45,-115],[7,-53],[14,-12],[3,-39],[40,-64],[18,12],[11,-83],[-29,-43],[-1,-41],[11,-56],[55,2],[2,105],[-11,30],[14,77],[-11,90],[-13,43],[-17,19],[-7,41],[33,63],[1,58],[14,133],[25,60],[42,-1],[40,16],[32,53],[-2,27],[13,411],[-18,179],[36,196],[-13,0],[0,158],[-98,299],[-9,63],[-72,208],[-38,130],[-62,155],[-72,0],[-13,96],[4,83],[-3,90],[-9,142],[0,128],[-22,116],[-10,219],[-11,67],[29,142],[30,84],[12,83],[2,100],[-6,19],[94,0]],[[61190,32428],[-1,-5],[-1,1],[1,1],[0,2]],[[60105,26658],[1,-37],[-34,-53],[-9,25],[-5,18],[4,19],[-2,12],[8,19],[19,1],[11,-8],[7,4]],[[59647,31405],[-15,-55],[8,-44],[25,64],[-18,35]],[[59614,31422],[-10,-14],[1,-50],[23,17],[-14,47]],[[67636,25896],[-6,-43],[-19,-3],[-16,22],[31,34],[10,-10]],[[65936,25323],[-2,143],[10,58],[21,26],[14,84],[21,44],[22,-17],[0,-31],[35,-128],[-8,-78],[-20,-44],[4,-32],[-19,-31],[-35,-26],[-43,32]],[[59233,29971],[-10,-3],[-16,44],[-23,-38],[-17,22],[-32,107],[-17,20],[5,45],[-14,51],[-26,10],[-1,50],[17,4],[21,29],[3,43],[19,30],[9,104],[18,41],[-7,38],[0,93],[8,33],[2,69],[-13,9],[-7,81],[13,29],[14,75],[12,20],[32,-10],[17,46],[28,-11],[29,97],[22,38],[-21,33],[-29,-15],[-16,70],[-1,49],[-14,29],[13,95],[7,135],[-5,64],[2,68],[-24,116],[12,25],[4,47],[25,100],[7,55],[-8,15],[-22,107],[4,85],[7,33],[27,1],[27,40],[15,61],[27,52],[-5,53],[-28,91],[-7,71],[4,37],[-12,51],[-15,11],[-38,77],[3,38],[14,67],[-8,59],[-17,42],[-17,19],[-3,91],[-30,6],[-1,-39],[-24,33],[-6,34],[9,37],[-14,29],[-6,59]],[[56509,27361],[226,117],[22,-13],[17,17],[23,-12],[25,-39],[22,30],[24,-1],[21,-27],[22,7],[30,-26],[45,-103],[11,-44],[20,-16]],[[55555,22252],[0,-299],[0,-420],[0,-375],[0,-303],[0,-421],[0,-431],[0,-379],[-35,-12],[0,0],[-1,-4],[0,-1],[-6,-5],[-2,-7],[0,-8],[-6,-19],[-3,-2],[-8,5],[-11,11],[-20,-32],[-10,13],[-3,1],[-8,-8],[-3,-5],[-5,1],[-5,-11],[-13,-65],[0,0],[-9,-53],[-18,-22],[-4,3],[-2,-2],[-7,-3],[-1,-2],[-3,1],[-13,5],[-9,-14],[-6,-37],[10,-47],[1,0],[1,-26],[-9,5],[-2,-1],[-3,-5],[-1,-3],[-1,-6],[-8,-17],[-7,-8],[-7,-4],[-3,1],[-5,-6],[-13,9],[-6,15],[-6,5],[-4,-1],[-2,3],[-1,11],[-2,13],[-4,11],[-3,5],[-10,10],[-57,18],[-19,-9],[-8,3],[-6,-9],[-12,-4],[-9,-7],[-31,-24],[-45,15],[-11,-10],[-9,-16],[-4,9],[-7,8],[-1,0],[-1,-1],[-3,-1],[-9,14],[-5,4],[-10,-2],[-9,30],[0,0],[-1,5],[0,0],[-24,40],[-27,6],[0,0],[-14,3],[-6,11],[-3,-1],[-28,-22],[0,1],[-12,55],[-11,6],[-4,-10],[-18,2],[0,0],[-16,-18],[-2,39],[3,10],[1,5],[-1,8],[1,9],[0,6],[0,3],[-1,7],[2,13],[0,6],[-2,6],[-4,3],[-8,-6],[-2,6],[1,18],[-4,20],[0,0],[-7,9],[-2,15],[1,17],[5,11],[8,0],[3,5],[4,23],[-18,115],[-10,7],[-7,-12],[-2,-2],[-14,-4],[-3,2],[-1,4],[-7,19],[-1,11],[-1,11],[5,33],[0,0],[-3,28],[0,0],[-32,46],[0,-1],[-1,-2],[0,0],[-25,-12],[-1,-1],[-18,-7],[-6,-11],[0,-3],[-1,-6],[0,-6],[2,-9],[-1,-19],[-1,-3],[2,-16],[-17,0],[0,-1]],[[54674,19806],[-5,-29],[-1,-13],[5,-9],[0,-15],[-1,-5],[-6,-1],[-6,10],[-6,-3],[-1,-17],[0,-7],[2,-9],[5,-8],[4,-20],[4,-9],[-10,-23],[-1,-11],[3,-22],[-8,-19],[-5,-21],[-8,-2],[-8,18],[-15,-21],[-5,-21],[-37,-31],[-10,-34],[-29,52],[-82,201],[-61,125],[-37,102],[1,31],[-42,132],[-1,46],[-30,130],[-14,29],[-23,97],[-4,93],[-11,83],[-2,96],[-21,16],[-16,119],[-3,58],[19,7],[-3,101],[-14,75],[-39,63],[8,173],[-19,100],[1,55],[-23,76],[2,69],[13,79],[-20,111],[-3,64],[21,147],[-23,128],[1,53],[-15,83],[-41,124],[3,80],[-29,158],[-14,153],[16,62],[-3,118],[3,101],[-20,127],[17,35],[0,58],[-27,213],[16,16],[21,60],[2,75],[-6,41],[2,68],[-5,67],[-14,66],[-20,135],[-19,49],[-8,52],[-63,194],[-31,65],[7,43],[-27,90],[-6,61],[-15,62],[-27,79],[-5,35],[-31,87],[-7,62],[-38,125],[-11,59],[-3,75],[-9,62],[-23,104],[-3,97],[-12,79],[-39,100],[-6,61],[-23,98],[-5,42],[-64,295],[0,30],[-37,181],[-22,50],[-7,66],[-40,138],[-75,157],[-13,56],[-1,48],[-12,46],[-7,59],[-21,55],[-15,135],[0,44],[-9,84],[-9,138],[4,227],[7,6],[1,-3],[3,-6]],[[65383,25028],[25,5],[34,-8],[20,-22],[12,-73],[35,-112],[-9,-54],[2,-52],[-10,-24],[-36,-17],[-51,34],[-34,44],[-12,36],[-2,50],[-18,59],[-2,30],[18,28],[2,53],[26,23]],[[58926,20762],[-10,25],[-23,-2],[-9,-142],[-3,-102],[1,-121],[-133,1],[-97,82],[-53,150],[4,61],[-18,34],[-4,40],[-25,-15],[-3,183],[3,74],[25,104],[19,43],[42,200],[4,44],[38,81],[14,47],[28,18],[126,-202],[29,33]],[[60466,6430],[48,-21],[9,-48],[-14,-42],[-65,15],[1,52],[21,44]],[[58159,24093],[27,21],[16,-8],[16,25],[52,0],[67,-62],[32,-60],[28,11],[14,-41],[27,2],[31,25],[40,-13],[57,30],[44,-16],[28,-24],[23,11],[25,-25],[10,-39]],[[59136,20749],[-14,-179],[-36,-232],[-29,-251],[-3,-109],[-15,-174],[-29,-127],[-7,-101],[-12,-52],[-75,-167],[-19,6],[-6,-65],[-70,-64],[-38,-93],[-18,-59],[-18,-36],[-42,-108],[-58,-189],[-26,-126],[1,-57],[-40,-101],[-81,-355],[-50,-178],[-11,-48],[-56,-170],[-8,-32],[-45,-125],[-45,-89],[-27,-24],[-14,-47],[-54,-99],[-19,-17],[-43,-122],[-15,-57],[-21,-37],[-13,-59],[-101,-233],[-31,-65],[-29,-78],[-21,-20],[-19,-56],[-64,-72],[-10,-57],[-38,-63],[-21,-50],[-44,-54],[-35,-72],[-70,-104],[-66,-113],[-62,-65],[-41,-27],[-33,-48],[-43,-38],[-50,7],[-27,25],[-46,16],[-53,-15],[-39,-51],[-18,-48],[-5,-60],[24,-54],[-33,-19],[-48,12],[-46,42],[-59,2],[-25,-23],[-5,-56],[-35,-83],[-90,27],[-27,42],[-17,0],[-33,29],[-117,38],[-44,21],[-42,-17],[-24,-30],[-5,-45],[-63,19],[-52,4],[-46,34],[-57,23],[-25,-39],[-69,-6],[-29,-37],[3,-62],[-42,-14],[-20,-31],[-4,-61],[-19,-22],[-39,-14],[-44,28],[-29,-12],[-17,-37],[-24,-9],[-45,40],[-34,11],[-33,-11],[-10,-67],[-43,17],[-26,-3],[-39,-35],[-16,-48],[-40,-50],[-6,-35],[-42,-33],[-9,-57],[-18,-13],[-31,47],[-49,3],[-16,-14],[-34,80],[-19,11],[-11,35],[-23,115],[-15,27],[-15,-21],[-48,68],[-22,-15],[-41,-7],[-2,51],[15,101],[-15,44],[-33,20],[-26,-4],[-36,-22],[-12,-51],[14,-36],[-5,-58],[-15,0],[-11,89],[-13,29],[9,39],[-6,48],[19,89],[19,-8],[6,43],[-15,83],[-1,43],[-23,75],[-18,85],[-34,63],[0,28],[-19,74],[11,31],[-29,66],[4,29],[-16,37],[-27,13],[-2,92],[4,72],[21,32],[23,-51],[26,4],[28,65],[20,91],[4,89],[-5,81],[9,23],[-10,78],[1,70],[-13,92],[3,35],[-12,56],[-4,56],[-30,120],[-29,74],[-36,109],[-1,32],[-34,94],[-20,102],[-24,73],[-22,126],[-23,75],[3,16],[-20,71],[-49,264],[-11,110],[-12,45],[-15,123],[-7,90],[-28,186],[-15,47],[-11,59],[-6,84],[-19,37],[-17,85],[-24,35],[-9,103],[-25,60],[4,56],[22,11],[25,54],[10,-15],[5,-3],[6,7],[12,41],[-4,25],[12,30],[-8,27],[-7,18],[0,21],[6,5],[3,-7],[5,-6],[4,1],[2,7],[0,11],[-1,10],[-4,18],[5,29]],[[58020,19377],[-18,0],[-1,44],[-28,28],[0,38],[-16,34],[-22,-27],[-46,-11],[-15,-54],[-50,-7],[-33,-78],[-6,-41],[-24,19],[-20,-51],[-10,10],[-29,-30],[-5,-46],[-27,-110],[-17,-21],[-1,-38],[-23,-34],[-20,-83],[-33,-83],[-21,-31],[-13,5],[-39,-70],[23,-50],[35,-191],[21,-43],[19,-117],[7,-87],[20,19],[13,-53],[12,-10],[16,-67],[23,-36],[14,-42],[39,-7],[33,-33],[33,-5],[-3,37],[18,67],[1,60],[22,15],[4,44],[-18,46],[28,27],[25,79],[28,-5],[19,20],[28,-13],[53,38],[33,42],[42,72],[-1,91],[10,90],[34,25],[11,52],[-9,56],[31,35],[12,47],[-2,74],[-9,44],[-17,19],[3,42],[-14,37],[-14,-10],[-11,46],[-49,80],[-13,1],[-15,37],[2,56],[-20,8]],[[58450,28807],[-19,-25],[-28,18],[-12,-26],[-13,35],[-55,-18],[-39,24],[-54,-40],[-16,17],[-26,-36],[-9,8],[-65,-65],[-52,-120],[-26,-3],[-23,-71],[6,-45],[-10,-76],[6,-31],[-10,-37],[9,-49],[-8,-70],[-23,-52],[-29,-15],[-106,-112],[-33,-73],[-85,-98],[-56,-204],[-2,-65],[-22,-61],[-63,-124],[-48,-154],[3,-20],[-37,-85],[-53,-28],[-27,-27],[-16,-31],[-21,18],[-10,44],[-13,-2],[-28,36],[-30,3],[-28,35],[-31,-33],[-1,-34],[-24,3],[-11,-17],[-28,18],[-1,41],[-18,43],[-35,32],[-43,-37],[-18,16],[-20,-7],[-32,44]],[[62368,31193],[1,-58],[-40,87],[-35,30],[32,21],[11,19],[2,46],[15,12],[16,-132],[-2,-25]],[[62161,31183],[7,-47],[-30,11],[-17,28],[3,50],[37,-42]],[[62039,31859],[15,-7],[5,-53],[-6,-117],[17,-97],[0,-26],[17,-83],[-12,-28],[-24,54],[-31,24],[-12,67],[10,45],[-2,52],[5,70],[-3,50],[21,49]],[[62544,30878],[21,-16],[-13,-62],[6,-15],[-19,-98],[-16,27],[15,51],[-11,25],[-3,65],[-13,31],[15,40],[18,-48]],[[48401,28573],[25,27],[7,-34],[-10,-31],[-20,-18],[-2,56]],[[46572,13382],[6,48],[15,2],[13,-39],[-15,-36],[-19,25]],[[45997,34326],[21,9],[6,-38],[-25,-18],[-2,47]],[[50926,1002],[22,-35],[-26,-5],[4,40]],[[59127,97601],[180,-59],[-49,-62],[-479,-71],[-50,28],[61,70],[179,68],[158,26]],[[57888,96634],[144,-5],[26,-35],[-276,-23],[106,63]],[[55699,97595],[82,-14],[-2,-60],[158,4],[15,35],[111,-1],[-12,-84],[66,-17],[63,-94],[72,45],[-39,84],[19,68],[-31,88],[71,28],[46,57],[139,-40],[1,-135],[-58,-13],[-17,-64],[217,30],[-7,66],[116,0],[174,-28],[182,-15],[175,-34],[194,-21],[131,-66],[-47,-81],[27,-40],[-45,-61],[-112,-33],[-16,-31],[-242,-113],[59,-27],[-135,-98],[-126,-14],[-248,-66],[-14,-43],[-112,-3],[-204,34],[-38,36],[45,53],[-188,5],[-130,-25],[-112,19],[-104,-17],[-60,44],[-205,48],[-100,84],[105,24],[96,-36],[88,-11],[-46,81],[176,20],[124,-9],[66,40],[-77,17],[6,34],[-222,-19],[-34,9],[-184,-39],[-123,-8],[-240,37],[-120,33],[-26,64],[129,24],[32,42],[-140,23],[-18,34],[-101,42],[250,35],[157,-93],[36,51],[-66,34],[-48,98],[61,5],[94,-82],[69,36],[-12,75],[-66,3],[-19,57],[99,-3],[135,-32],[60,-76]],[[57367,96542],[94,-76],[-103,-9],[-35,61],[44,24]],[[56339,96126],[82,-35],[0,-90],[49,-59],[96,-62],[108,24],[81,-34],[-63,-78],[20,-60],[-53,-19],[6,-47],[-165,-142],[-75,-32],[-29,-45],[-91,-37],[-28,98],[51,46],[7,40],[54,30],[-168,26],[-172,-68],[-65,2],[-136,-42],[-59,6],[-6,62],[94,56],[15,91],[77,86],[14,47],[-89,35],[-112,73],[77,55],[183,44],[115,-14],[182,43]],[[55882,96399],[117,-74],[93,34],[53,-79],[20,-68],[-22,-75],[-253,-31],[-57,-18],[-62,48],[-63,123],[-94,45],[226,36],[42,59]],[[54511,97420],[87,-16],[47,-106],[111,44],[129,-52],[112,-94],[-68,-118],[12,-111],[64,20],[29,106],[42,11],[99,-48],[66,-118],[-8,-62],[-56,-27],[78,-39],[-21,-51],[71,-19],[49,51],[124,-38],[50,-63],[309,-131],[132,-19],[-54,-118],[-137,28],[-160,-8],[-60,-55],[-83,-6],[-159,-66],[-75,3],[62,-132],[-69,-23],[63,-51],[-57,-40],[51,-49],[-36,-47],[-141,-6],[20,-56],[-70,-39],[52,-56],[6,-56],[-42,-33],[18,-47],[-33,-100],[-77,8],[-57,35],[-54,-4],[35,-68],[-67,-43],[34,-25],[-73,-72],[35,-24],[-44,-175],[-56,-87],[-84,-17],[23,-64],[83,-26],[-26,-56],[-104,-57],[-104,27],[29,78],[-107,25],[-116,88],[-19,31],[148,43],[56,-2],[107,51],[-79,25],[-35,-38],[-93,8],[-143,-21],[-68,25],[-37,54],[37,26],[-112,30],[-83,-1],[-34,63],[-55,20],[-29,127],[-27,40],[52,23],[101,5],[24,-44],[112,38],[134,-30],[127,25],[-191,36],[-66,-1],[-53,33],[168,60],[154,13],[230,42],[3,40],[-249,-30],[-157,30],[-50,-40],[-205,-45],[-86,15],[-103,-24],[15,60],[-39,14],[-1,106],[-19,44],[104,36],[149,1],[138,30],[218,142],[104,16],[98,-20],[88,1],[-2,36],[-118,54],[46,82],[46,41],[-70,42],[-57,-101],[-87,-50],[-134,-18],[-43,27],[-35,78],[78,26],[14,77],[-17,56],[-52,-1],[-36,-120],[-48,-25],[-53,77],[-74,-33],[11,-99],[-63,8],[-21,-48],[108,-29],[39,-44],[-195,-14],[65,-36],[-141,-82],[-42,-4],[-206,31],[-20,93],[-73,18],[-59,62],[24,82],[-118,8],[-28,60],[-101,33],[81,79],[-65,14],[-80,70],[105,-3],[78,-32],[100,-18],[27,71],[-145,24],[-74,32],[119,133],[-109,36],[-9,-105],[-73,-36],[-57,5],[-10,77],[-80,81],[-3,49],[43,30],[-94,73],[71,28],[30,44],[90,1],[-52,56],[59,40],[122,43],[71,-137],[71,30],[-56,73],[115,-21],[81,7],[68,35],[194,39],[52,-53],[-81,-79],[-121,10],[-181,-88],[34,-15],[164,20],[163,-158],[37,50],[-52,69],[190,187],[120,-49],[111,-163],[15,-101],[185,-218],[27,-65],[97,-29],[-114,216],[-44,47],[-18,140],[-50,142],[-17,127],[101,1],[-19,66],[87,75]],[[55609,96747],[185,-14],[-18,-34],[-132,-37],[-61,47],[26,38]],[[55299,93442],[53,-39],[-59,-88],[-68,66],[0,49],[74,12]],[[55080,97638],[88,-36],[-25,-48],[-119,32],[56,52]],[[52919,96585],[86,-19],[89,-84],[-28,-28],[18,-69],[204,-155],[-10,-72],[-129,105],[-78,5],[-21,70],[-132,170],[1,77]],[[47779,90989],[2,-52],[-205,-74],[-71,-65],[-26,26],[108,82],[50,12],[34,65],[88,52],[20,-46]],[[30569,36978],[5,5],[25,360],[36,513],[28,403],[45,654],[4,82],[10,42],[-8,85],[8,90],[-9,29],[1,40],[-28,70],[1,35],[-27,96],[17,70],[-10,30],[-4,66],[-35,47],[-31,72],[-14,0],[-46,124],[5,40],[0,480],[31,-6],[14,17],[45,28],[10,35],[16,-25],[41,76],[35,-85],[17,24],[7,-35],[16,6],[5,29],[22,-4],[-21,71],[15,92],[-12,22],[-5,67],[-13,44],[-21,22],[-33,-10],[-37,-1],[-7,16],[-30,-11],[-11,24],[-17,-36],[-11,10],[0,454],[18,-13],[10,27],[25,-8],[34,42],[39,-36],[341,1],[-8,37],[-25,41],[23,118],[15,-20],[14,-53],[10,-5],[10,-54],[29,1],[10,54],[38,100],[24,-30],[17,37],[5,79],[37,14],[9,36],[13,-4],[10,-37],[-7,-82],[15,-105],[22,6],[4,-38],[23,-60],[-4,-119],[8,-12],[10,-100],[0,-63],[-22,-29],[16,-48],[3,-67],[66,40]],[[31430,40885],[2,-1],[144,-334],[34,18],[16,-23],[19,10],[19,31],[19,62],[14,9],[41,69],[32,11],[22,-32],[12,-74],[-13,-67],[-15,-43],[14,-44],[30,25],[13,45],[-2,46],[23,87],[21,-13],[21,19],[4,128],[15,24],[24,-36],[34,104],[17,25],[22,-42],[31,52],[30,83],[39,81],[14,-7],[-18,-83],[19,-15],[11,59],[29,40],[18,40],[16,55],[0,92],[4,103],[25,48],[50,-9],[25,50],[18,15],[20,45],[35,-7],[10,17],[10,69],[3,98],[-16,54],[-20,-19],[-78,9],[-21,38],[-26,-26],[-30,27],[-2,51],[18,67],[-1,41],[-23,147],[-20,80],[-21,44],[17,108],[12,24],[-3,146],[-14,26],[-2,42],[-16,59],[-12,-6],[-9,45],[-27,46],[-11,1],[-31,90],[-29,46],[-6,62],[-18,-3],[-11,92],[-9,33],[9,42],[24,-30],[0,-25],[27,-69],[14,-7],[16,26],[19,-16],[26,19],[24,-5],[34,-29],[38,-137],[10,-13],[27,44],[34,-23],[11,25],[7,50],[43,-117],[30,40],[-5,46],[23,-15],[10,19],[28,-27],[-7,-48],[10,-48],[24,-7],[14,-51],[-4,-29],[25,-55],[8,-3],[33,91],[20,-37],[12,16],[-2,63],[-15,71],[6,86],[9,19],[39,-3],[12,39],[24,38],[7,30],[23,-13],[60,-59],[20,53],[33,-18],[23,32],[13,-6],[5,43],[22,23],[45,-6],[15,48],[-2,62],[17,24],[29,-16],[9,28],[3,59],[25,-8],[18,-33],[27,31],[26,15],[16,124],[13,-11],[13,32],[24,21],[38,130],[-25,165],[-18,10]],[[33128,43739],[10,20],[44,-30],[45,22],[17,-13],[33,47],[19,-14],[19,-78],[26,-45],[-14,-209],[-1,-54],[-27,-74],[-11,-63],[11,-11],[71,-19],[24,-19],[24,-49],[1,-32],[-12,-36],[4,-85],[27,-25],[-9,-45],[19,-55],[19,-34],[-21,-44],[-1,-63],[-19,-10],[-1,-57],[-27,-55],[-24,-17],[-4,-31],[17,-36],[-10,-47],[10,-62],[-30,-116],[4,-28],[-16,-53],[2,-56],[-9,-51],[-3,-177],[27,-147],[1,-89],[48,-86],[-6,-42],[5,-58],[-7,-176],[27,-6],[-9,-53],[18,-39],[14,14],[12,-19],[26,-103],[26,-33],[24,-95],[57,-47],[32,0],[13,-67],[17,-42],[26,30],[6,60],[33,-18],[22,5],[11,59],[-12,74],[35,4],[-2,38],[21,32],[21,-12],[14,18],[22,-53],[14,18],[15,-14],[8,91],[22,29],[56,30],[12,-20],[21,1],[18,27],[4,48],[15,12],[10,70],[29,64],[21,-32],[13,35],[29,14],[5,-49],[15,-31],[28,8],[30,-41],[24,45],[24,13],[18,-26],[25,29]],[[34313,41405],[22,-20],[9,17],[31,-46],[24,10],[10,-25],[33,-15],[16,15],[8,47],[-5,48],[9,35],[-18,38],[-18,97],[-29,26],[15,65],[14,11],[14,43],[2,66],[18,-2],[19,-40],[24,-8],[15,-39],[28,21],[36,13],[25,-27],[10,23],[0,46],[11,14],[22,-9],[15,33],[14,-30],[39,57],[30,-115],[17,-9],[11,37],[17,-9],[7,-37],[-2,-56],[26,3]],[[34832,41683],[15,-7],[20,-80],[33,5],[6,-48],[19,-7],[22,19],[21,-38],[14,57],[14,-10],[19,24],[4,45],[48,69],[8,-46],[17,-6],[37,-37],[18,1],[37,74],[21,-55],[4,-50],[48,7],[24,-36],[24,20],[16,68],[51,59],[12,73],[18,31],[7,45],[-1,50],[14,93],[23,105],[20,109],[-8,34],[15,34],[2,38],[16,9],[60,252],[12,74]],[[35562,42658],[16,21],[-1,32],[14,24],[20,55],[15,86],[28,40],[12,86],[-1,35],[18,3],[-9,88],[7,56],[10,9],[24,-38],[21,-51],[36,-113],[12,-109],[0,-127],[14,57],[14,-13],[-4,-118],[2,-129],[-7,-34],[5,-98],[16,-105],[-3,-58],[7,-68],[20,-114],[0,-52],[11,-14],[6,-74],[11,-34],[3,-73],[18,-59],[2,-68],[10,-46],[0,-43],[12,-40],[-4,-31],[26,-46],[1,-45],[22,-64],[0,-30],[13,-42],[20,-14],[63,10],[43,-41],[27,-44],[7,-69],[8,-140],[-11,-122],[8,-53],[-24,-56],[-22,-23],[-10,-30],[-4,-23],[-52,-80],[-8,-67],[-42,-90],[-31,-155],[-37,-101],[-21,-71],[-32,-7],[-28,-48],[5,-123],[35,9],[40,32],[13,-11],[11,-57],[-26,-57],[-25,-34],[-20,3],[-2,-49],[-29,-80],[25,20],[23,-5],[8,-63],[-12,-30],[-46,-52],[8,-16],[34,32],[10,-75],[-8,-37],[-30,-16],[-13,-61],[18,-64],[31,-16],[-2,-88],[-10,-7],[-6,-32],[-11,-2],[-2,-8],[32,-57],[-2,-93],[6,-71],[12,-73],[17,-43],[-7,-42],[-5,-42],[0,-13],[15,-33],[-29,-88],[23,-17],[1,48],[13,39],[13,-8],[24,-82],[19,2],[5,-105],[17,78],[27,50],[29,-25],[3,35],[17,25],[26,16],[18,-13],[21,-52],[24,10],[24,-7],[18,35],[25,12],[11,48],[45,37],[19,-2],[0,-51],[-26,-75],[-6,-70],[-13,-49],[-5,-83],[-14,-55],[-3,-50],[-12,-66],[5,-70],[-20,-68],[-17,-10],[-25,-85],[0,-66],[8,-56],[0,-53],[24,-39],[2,45],[-9,82],[-2,61],[5,82],[37,30],[5,38],[22,68],[-3,71],[32,144],[3,56],[13,71],[31,95],[10,-11],[40,29],[2,25],[20,53],[9,46],[31,80],[8,41],[31,26],[23,-54],[35,23],[-29,35],[8,80],[-3,38],[36,20],[27,121],[-9,53],[27,12],[2,41],[14,76],[-6,37],[14,41],[15,18],[7,-53],[23,2],[11,40],[24,13],[21,40],[5,-119],[14,54],[23,34],[20,-8],[17,-41],[22,-1],[-23,59],[44,49],[0,-26],[25,-54],[5,-39],[24,-25],[6,-77],[18,48],[-2,-80],[7,-12],[18,56],[18,11],[25,-22],[17,-54],[17,10],[24,-43],[56,-22],[33,-19],[-10,-50],[8,-21],[18,21],[15,-4],[8,-39],[17,-9],[12,34],[28,-71],[27,-7],[24,26],[-12,-67],[18,-67],[14,42],[13,-4],[18,-77],[20,-28],[17,27],[18,-40],[-13,-80],[10,-47],[30,-33],[-2,41],[6,82],[23,30],[10,37],[22,8],[6,-62],[35,-27],[20,-41],[4,-43],[34,-45],[1,-36],[19,1],[22,-35],[12,-45],[-24,-41],[3,-38],[-13,-46],[0,-35],[-32,-60],[11,-113],[11,-27],[0,116],[8,35],[24,27],[-1,36],[23,21],[13,-41],[14,-94],[-9,-50],[-28,20],[-8,-29],[5,-41],[-27,-67],[2,-59],[-9,-41],[-13,-125],[-4,-99],[12,-14],[-15,-57],[-21,-42],[-9,9],[-10,-61],[23,-53],[8,18],[-2,69],[21,-3],[17,75],[49,104],[4,41],[47,29],[9,-9],[29,47],[16,-8],[-6,65],[11,53],[23,24],[9,36],[13,-29],[21,46],[19,-15],[50,33],[33,-58],[2,38],[18,4],[14,54],[-30,-9],[32,74],[16,14],[86,-95],[33,-45],[18,-7],[12,-26],[-16,-77],[17,-1],[7,38],[41,-28],[11,-39],[32,27],[36,-83],[91,2],[3,64],[13,-25],[16,14],[50,-103],[77,-22],[2,-43],[29,6],[-11,67],[73,-6],[40,23],[9,-44],[11,-3],[3,52],[53,5],[24,46],[19,-19],[34,3],[80,-38],[7,15],[43,-56],[38,-72],[23,-6],[44,-85],[27,-22],[37,-45],[16,-56],[17,-22],[10,-49],[28,3],[16,-60],[31,-36],[12,-45],[45,-73],[39,-10],[29,-119],[23,-40],[43,-142],[30,-76],[36,-80],[31,-30],[14,-77],[43,-93],[24,-5],[29,-25],[21,-33],[25,-122],[14,-35],[15,17],[16,-20],[24,21],[26,-28],[14,-46],[25,-47],[49,-32],[16,39],[20,2],[21,-26],[61,15],[41,37],[61,-35],[75,-50],[32,-89],[32,-165],[18,-134],[-4,-38],[15,-95],[1,-51],[12,-37],[3,-123],[16,-40],[2,-50],[-23,-44],[34,-5],[5,-45],[2,-114],[6,-114],[16,-93],[3,-115],[22,-73],[-3,-64],[3,-70],[-2,-98],[-8,-76],[7,-33],[-16,-61],[12,-30],[-6,-83],[6,-47],[-5,-56],[-21,-119],[-10,-40],[1,-80],[-8,-29],[-10,-129],[-12,-43],[-18,-21],[11,-37],[-27,-192],[-12,-30],[-20,-113],[-17,-62],[-29,-62],[-37,-134],[-16,-28],[-19,-77],[-20,-1],[-8,-49],[-32,-110],[-31,-126],[-13,-17],[-55,-141],[-4,-49],[-20,-84],[-24,-12],[-60,-98],[-28,-36],[-21,-43],[-26,-73],[-50,-186],[-21,50],[-17,-19],[24,-48],[4,-40],[-25,-70],[-13,-61],[-30,-69],[13,-11],[-16,-59],[-28,-142],[-26,-146],[-41,-192],[-54,-188],[-12,-61],[-87,-250],[-48,-65],[-13,12],[13,57],[4,59],[-8,20],[3,56],[-17,21],[-12,-15],[-11,53],[-22,38],[-19,-157],[-17,-26],[24,-34],[-13,-127],[-4,-49],[-29,-48],[-12,-55],[-2,-55],[-28,-16],[-8,-133],[31,-23],[-1,-139],[-12,-14],[-4,69],[-25,8],[-3,-44],[23,-4],[-9,-110],[4,-39],[25,12],[-2,-53],[11,-24],[-10,-190],[-16,-198],[-2,-87],[10,-32],[3,-92],[6,-51],[-3,-212],[2,-74],[12,-163],[-2,-69],[29,-87],[0,-26],[-20,-130],[-4,-80],[-19,-68],[2,-89],[-23,-51],[7,-30],[-11,-158],[-9,-30],[-1,-85],[-11,-174],[-9,-40],[-2,-98],[8,-103],[0,-87],[16,-86],[-21,-42],[-22,-4],[-16,-32],[-5,-77],[-32,-57],[-41,-168],[-28,-212],[-5,-133],[1,-173],[15,-243],[-2,-66],[-9,-64],[-25,-139],[-20,-15],[-36,-68],[-32,-135],[-11,-82],[-7,-102],[-31,-125],[-14,-91],[-18,-83],[-11,6],[-32,-127],[-20,-1],[-26,-33],[-17,-77],[0,-38],[-14,-84],[-26,-77],[-3,-92],[-29,-94],[6,-80],[10,-12],[-4,-73],[13,-145],[-7,-68],[-56,-80],[-84,-62],[-40,-44],[-33,-56],[-43,-123],[-10,-2],[-10,-55],[5,-83],[19,-39],[-33,-87],[-5,-43],[-50,14],[-113,3],[-19,-14],[-95,-14],[-19,16],[2,69],[11,63],[22,13],[5,39],[-17,14],[-51,-36],[-19,-34],[19,-29],[1,-59],[12,-47],[-39,-38],[-25,2],[-42,-33],[-10,40],[-30,10],[-14,39],[-35,23],[-58,-37],[-10,-49],[-23,-22],[-13,38],[-18,-4],[-5,62],[-31,-32],[-39,-64],[-25,0],[-7,-21],[-8,-86],[7,-21],[47,-29],[-16,-62],[-15,20],[-40,-33],[-35,31],[-29,-59],[-13,-1],[-4,-49],[-28,-8],[-30,-54],[-33,-36],[-8,-32],[10,-102],[-38,-14],[-7,25],[-25,12],[-65,12],[-64,-51],[-29,-51],[-20,-9],[-11,21],[-25,-4],[1,-20],[28,-10],[6,-31],[-25,0],[-8,-27],[-22,-15],[-52,-64],[-45,-64],[-45,-85],[-1,-46],[-67,-127],[-46,-74],[-32,-11],[-45,-79],[-12,-6],[-21,-51],[-24,-22],[-20,-66],[-13,6],[-19,-51],[15,-108],[-43,-131],[-22,61],[-28,35],[-19,-3],[3,-99],[-11,-46],[-20,15],[-21,-5],[-13,40],[-11,-79],[28,-10],[15,16],[20,-68],[14,33],[17,-20],[-20,-37],[-20,-83],[-11,-70],[-24,29],[-27,-27],[24,-37],[21,5],[-10,-56],[-4,-71],[7,-71],[-33,-60],[-13,14],[-14,-40],[15,-24],[28,37],[3,26],[37,4],[-26,-134],[-2,-37],[-17,-74],[-7,-79],[6,-65],[13,-16],[-6,-91],[4,-55],[14,-13],[-10,-63],[20,-59],[-18,-27],[-3,-49],[25,-40],[-14,-64],[-19,-38],[9,-55],[19,-15],[9,22],[-7,48],[6,39],[21,6],[19,-19],[-12,-50],[-1,-47],[-15,-53],[-13,-88],[-10,64],[6,57],[-24,6],[-12,-34],[21,-123],[-10,-91],[5,-49],[-16,-117],[-2,-49],[-26,-149],[1,-54],[-16,-49],[-48,-58],[-68,-112],[-62,-142],[-69,-199],[-54,-188],[-44,-196],[-28,-159],[-40,-268],[-17,-76],[-22,-74],[-92,-333],[-34,-91],[-31,-27],[-20,-47],[0,-36],[-50,-127],[-49,-92],[-89,-123],[-37,-62],[-51,-129],[10,80],[-4,35],[12,40],[-19,42],[9,38],[40,-40],[30,33],[-2,24],[30,6],[28,50],[46,156],[23,-24],[31,53],[15,59],[7,90],[-7,76],[2,51],[21,-20],[34,44],[18,94],[49,74],[14,98],[-1,119],[35,35],[-1,47],[12,102],[-8,34],[-30,-2],[-4,-70],[-32,7],[-4,-36],[-26,11],[-12,-54],[-30,13],[8,59],[-16,38],[-30,7],[-22,79],[8,46],[-19,40],[-7,-163],[34,-80],[2,-47],[-16,-41],[-17,-130],[-19,-4],[-5,-61],[4,-102],[-15,6],[-15,-31],[4,-84],[11,-41],[-49,-39],[-4,-84],[-45,-10],[-13,-36],[-20,10],[-20,-61],[-9,-108],[-25,-9],[13,-56],[-44,-79],[-1,-68],[10,-44],[0,-57],[23,-2],[7,-32],[-11,-98],[-34,-74],[-33,-140],[-16,-109],[-21,-179],[-37,-177],[-43,-124],[-105,-219],[-58,-110]],[[35175,15811],[-20,37],[-25,3],[-2,54],[7,110],[-2,220],[21,72],[55,85],[-13,25],[30,35],[30,79],[-31,69],[-41,43],[-27,15],[-11,59],[-31,21],[-17,48],[1,63],[-19,70],[-9,60],[-25,43],[-5,40],[-30,32],[-22,42],[-20,-8],[-96,184],[-1,41],[-15,60],[-20,39],[-24,1],[-23,22],[-23,-13],[-28,63],[-18,61],[-17,-44],[-31,45],[-20,11],[-1,33],[-33,131],[-58,137],[-23,-28],[6,-29],[-64,-114],[-30,-1],[-11,18],[2,173],[-38,72],[-11,73],[-55,76],[-3,35],[-26,36],[-33,85],[-15,59],[-9,-5],[-24,56],[-20,27],[-28,-8],[-34,7],[-25,-77],[-10,-62],[-24,-3],[-72,10],[-15,69]],[[33999,18368],[40,56],[6,32],[30,58],[0,66],[26,72],[32,12],[41,88],[1,27],[18,50],[35,70],[2,43],[19,14],[15,69],[-2,29],[18,73],[46,30],[5,74],[30,59],[-1,59],[31,27],[20,66],[31,54],[-5,45],[12,33],[28,13],[-6,46],[8,40],[33,-7],[18,-34],[6,59],[-30,64],[41,49],[19,8],[18,63],[15,-12],[21,55],[11,65],[17,-2],[10,34],[39,28],[18,35],[25,18],[9,34],[-1,58],[18,20],[5,46],[17,-25],[20,7],[21,29],[45,40],[-5,32],[20,15],[9,-31],[27,13],[21,91],[32,9],[16,35],[3,36],[48,32],[43,171],[-5,85],[-13,49],[8,50],[-4,107],[12,48],[-3,57],[15,58],[1,49],[-27,69],[1,54],[-28,52],[5,33],[-8,64],[7,24],[-12,44],[1,58],[-46,66],[-27,-1],[-19,25],[-17,-45],[-10,30],[-37,-73],[-36,49],[-11,-3]],[[34835,21657],[-3,79],[5,61],[27,92],[5,49],[13,34],[-11,42],[8,115],[13,115],[15,51],[4,91],[-1,84],[18,64],[-5,55],[-13,30],[-6,66],[16,66],[-36,78],[-7,38],[-20,14],[-43,49],[-10,-34],[-25,-3],[-74,-90],[-19,7],[-28,-21],[-24,36],[-5,-21],[-24,25],[-7,29],[4,91],[-12,100],[-15,17],[-4,128],[11,50],[-15,45],[10,85],[-21,56],[-19,192],[13,71],[-2,89],[-27,55],[-8,55],[1,66],[-12,2],[-14,67],[-45,-4],[-55,10],[-34,50],[-19,77],[-22,15],[-13,-20],[-9,-55],[-28,-52],[-15,15],[-27,-11],[-11,-35],[-19,30],[-36,16],[-38,3],[-17,-13],[-17,20],[-78,34],[-9,58],[-22,5],[-24,-27],[-41,4],[-12,78],[9,59],[-6,54],[14,59],[-8,29],[2,52],[-9,68],[19,132],[11,45],[-18,29],[17,31],[-3,137],[14,44],[-19,51],[6,65],[-8,20],[4,56],[-9,30],[-28,40],[-2,76],[6,51],[-21,36],[-8,46],[4,42],[-21,17],[-1,51]],[[33842,25545],[40,80],[17,23],[16,-12],[13,52],[-76,152],[97,519],[20,0],[-3,97],[-13,0],[58,472],[14,31],[-18,48],[-9,69],[-32,147],[3,73],[-18,51],[5,66],[-35,83],[-32,-48],[-17,41],[-16,8],[-11,46],[-24,25],[-43,118],[2,104],[-24,74],[5,25],[-5,63],[4,115],[7,43],[26,54],[-3,66],[13,39],[1,44],[-17,25],[-18,-34],[-106,11],[-183,20],[-194,9],[-1,3],[-18,565],[-94,270],[92,1],[-8,341],[-14,8],[-4,72],[-18,66],[-14,74],[1,46],[-9,83],[22,98],[-19,86],[-2,55],[-50,48],[-31,52],[-30,31],[-13,57],[-21,-9],[-4,45],[-34,-29],[-24,-1],[-18,33],[-17,-26],[-32,-24],[-39,37],[-21,3],[-30,-28],[-22,7],[-8,72],[-13,10],[-36,95],[-12,16],[-1,78],[-27,28],[-7,-23],[-42,6],[-13,40],[-19,-1],[-28,26],[-6,40],[-46,-4],[-2,35],[-18,24],[-14,51],[-14,-14],[-35,127],[2,33],[-22,9],[-21,-48],[-40,28],[-13,62],[-21,2],[-12,40],[-20,25],[-44,32],[-13,-23],[-15,11],[-7,-46],[-15,-14],[-35,30],[-40,23],[-37,-5],[-13,13],[-28,69],[6,34],[-4,50],[-14,-6],[-38,36],[-12,62],[-19,13],[-7,48],[-23,-7],[-34,26],[6,67],[-16,28],[4,51],[-7,52],[-46,-7],[9,62],[-2,87],[-23,12],[-15,177],[-1,75],[21,38],[-2,51],[12,24],[-7,88],[-25,51],[6,19],[-2,75],[-15,18],[3,38],[-9,72],[13,43],[-2,42],[18,49],[10,60],[-4,82],[-6,21],[-2,97],[10,42],[-17,114],[-21,32],[-14,-39],[-5,-41],[-15,-33],[-21,0],[-11,37],[-28,15],[-23,-25],[-5,30],[-38,-32],[-40,9],[-44,-33],[-13,-24],[-36,-3],[-37,-18],[-6,-39],[-24,-23],[-29,-58],[-41,-95],[-7,-36],[-20,-32],[-17,-7],[-14,-29],[-13,16],[-30,-43],[-22,-11],[-4,-42],[-31,-29],[-17,-52],[-18,-30],[-9,-75],[-43,49],[-32,-16],[-10,11],[-25,-49],[0,-41],[-26,-64],[-11,-65],[-27,-43],[-44,-28],[-14,-41],[-48,-27],[-23,106],[-32,-16],[-15,25],[-36,5],[-38,29],[-27,-8],[-26,16],[-19,-16],[-22,4]],[[30674,32160],[-41,-22],[-25,36],[-34,3],[-37,-51],[-38,-44],[-29,-12],[-33,24],[-29,74],[-25,-47],[0,456],[0,384],[23,43],[3,38],[-20,78],[23,74],[6,46],[-19,7],[-31,-72],[-20,-24],[-3,-26],[-31,-47],[-16,-55],[-13,-10],[-6,-44],[-39,-26],[-16,-64],[-29,-36],[-22,-5],[-223,0],[8,28],[-3,93],[-26,69],[2,55],[-13,89],[-32,40],[-34,3],[-49,32],[-3,12],[-134,0],[3,35],[45,131],[21,31],[2,103],[-14,51],[-17,12],[-15,63],[-7,56],[-12,39],[-28,14],[-18,45],[1,91],[-28,36],[-28,58],[5,55],[-18,54],[2,47],[-13,55],[-39,104],[26,36],[-3,64],[-36,36],[-20,81],[-19,28],[13,64],[-8,49],[33,49],[26,-4],[9,24],[-4,47],[-24,95],[9,34],[0,91],[35,133],[27,49],[40,31],[12,34],[42,18],[23,77],[-12,133],[-24,110],[7,73],[10,12],[10,98],[11,7],[18,71],[23,70],[4,82],[-2,59],[25,127],[-1,66],[37,97],[36,23],[2,24],[55,76],[25,82],[14,-8],[44,57],[12,40],[22,18],[17,45],[37,56],[37,-13],[10,-19],[16,36],[15,1],[9,30],[53,-5],[6,34],[50,15],[38,-3],[32,92],[3,37],[18,28],[7,-18],[46,4],[11,29],[18,-25],[5,28],[34,-7],[9,-19],[10,-72],[-2,-27],[22,-31],[6,55],[23,-8],[12,-61],[22,68],[0,36]],[[39258,30736],[16,-33],[-12,-40],[-29,-62],[-9,5],[-2,36],[6,33],[33,33],[-3,28]],[[39193,30408],[2,-40],[-10,-80],[-31,62],[2,51],[37,7]],[[37678,38027],[-2,60],[6,57],[-7,27],[16,46],[60,33],[20,-42],[-16,-37],[-16,-86],[-41,-46],[-20,-12]],[[37701,23426],[36,0],[2,-30],[-26,-23],[-40,19],[28,34]],[[37398,22942],[9,55],[29,-39],[-2,-130],[-16,35],[-41,-18],[-5,32],[26,65]],[[37187,22897],[-15,-45],[-2,-44],[-26,-24],[-6,71],[22,-14],[27,56]],[[36793,22291],[-6,-37],[-43,-79],[-32,-72],[-3,27],[32,70],[52,91]],[[36650,21889],[21,50],[-12,34],[4,30],[31,32],[-5,-64],[-39,-82]],[[36609,39305],[-28,-21],[-1,35],[25,93],[18,-4],[-14,-103]],[[36568,39134],[-10,-2],[-23,41],[4,24],[27,51],[14,-32],[-12,-82]],[[36021,39579],[1,80],[-5,28],[5,15],[-2,41],[-12,48],[-1,50],[18,42],[0,52],[17,-18],[34,-2],[77,-48],[60,-33],[59,20],[24,38],[25,1],[13,20],[20,-28],[31,9],[19,-46],[35,1],[21,-20],[35,14],[41,0],[19,-16],[2,-78],[-15,-41],[-8,-55],[-2,-152],[-10,-72],[3,-52],[-7,-28],[-21,-25],[-3,-80],[-26,-49],[-10,-69],[-10,-23],[-7,-105],[-23,-66],[-46,-30],[-15,31],[0,26],[-11,38],[-6,-7],[0,8],[-1,1],[0,-11],[2,-2],[0,-7],[-3,-3],[3,-8],[-4,-35],[-9,-19],[7,-26],[8,-12],[-1,-28],[-27,-8],[-21,57],[-11,-17],[-20,16],[-26,-62],[0,-59],[-19,-3],[-17,-42],[-13,16],[-27,-40],[-40,49],[-35,5],[-15,34],[0,21],[-11,32],[-39,-13],[12,-97],[-43,3],[-6,44],[-21,36],[-15,74],[18,94],[25,80],[20,3],[-17,57],[-22,45],[-15,-3],[-11,49],[22,63],[22,-8],[9,39],[6,-5],[19,11],[23,16],[20,45],[6,32],[4,83],[-27,43],[-3,41],[-9,18],[-17,-18]],[[36503,38970],[17,26],[-2,-79],[-15,53]],[[36413,38875],[6,-23],[-13,-56],[-6,-68],[-10,-1],[-2,6],[-3,-2],[-5,3],[1,14],[-3,9],[0,16],[-2,7],[19,80],[18,15]],[[36351,38698],[12,57],[8,15],[6,3],[0,-14],[3,-11],[-2,-9],[2,-6],[8,-12],[-12,-43],[-25,20]],[[36343,38988],[8,-14],[5,-42],[10,-41],[-19,-11],[-16,23],[8,40],[3,25],[-3,8],[2,2],[1,2],[1,8]],[[36214,40058],[12,14],[29,-5],[23,-16],[12,-53],[-26,-73],[-38,-15],[-38,0],[-30,25],[9,47],[47,76]],[[36222,40282],[13,-13],[-2,-49],[-36,-69],[-20,-45],[-26,-91],[-42,-46],[-18,60],[-38,12],[-38,-6],[-13,71],[0,55],[35,13],[23,-13],[22,15],[20,51],[15,9],[20,-20],[34,33],[51,33]],[[36129,40793],[6,-60],[-13,-38],[-25,-25],[-17,13],[13,61],[29,31],[7,18]],[[36104,40658],[-4,-54],[-16,-46],[-40,-18],[-15,17],[4,40],[26,51],[38,-14],[7,24]],[[36086,40468],[13,-50],[-20,-83],[-42,-72],[-11,1],[-2,64],[5,98],[47,17],[10,25]],[[36046,38790],[6,44],[18,-19],[2,-29],[9,-25],[-21,-39],[-15,33],[1,35]],[[36045,39581],[5,-47],[26,-42],[-10,-112],[-22,-45],[-33,3],[-10,107],[15,37],[12,56],[10,0],[7,43]],[[36031,38769],[-7,57],[15,1],[-8,-58]],[[36013,40447],[16,10],[-8,-183],[6,-52],[-8,-30],[-26,-30],[-1,-38],[-26,29],[-8,44],[17,15],[9,48],[15,161],[14,26]],[[35990,38731],[-25,24],[-12,27],[1,47],[29,-51],[7,-47]],[[35995,41524],[11,-58],[17,-43],[-15,-63],[-18,-11],[-24,94],[4,65],[25,16]],[[35922,39576],[-5,37],[29,7],[15,-31],[19,22],[6,17],[5,7],[2,11],[5,-14],[13,0],[9,-77],[-9,3],[-8,-7],[-14,-43],[-17,35],[-8,-16],[-37,30],[-5,19]],[[35963,39857],[18,-26],[18,38],[0,-58],[20,-71],[3,-36],[-6,-17],[2,-22],[-7,-6],[-1,-26],[-17,14],[-3,-3],[0,-9],[-4,-5],[-7,-16],[-32,8],[-20,33],[-13,42],[2,46],[19,89],[19,39],[9,-14]],[[36011,39555],[7,-9],[-2,-56],[-18,15],[13,50]],[[35914,39202],[34,-17],[9,-20],[17,4],[20,-60],[-3,-39],[-28,-82],[-16,-92],[-23,64],[3,25],[-1,41],[1,4],[-1,0],[-1,3],[-1,7],[3,6],[-8,12],[3,10],[2,31],[6,32],[-16,71]],[[35994,39302],[-13,34],[-3,7],[2,9],[-1,24],[-9,48],[8,26],[24,-32],[5,-101],[-8,-2],[-5,-13]],[[35978,39899],[12,-44],[-9,-21],[-21,37],[18,28]],[[35988,41525],[-16,-12],[-12,48],[9,18],[21,-13],[-2,-41]],[[35965,40132],[23,-36],[2,-51],[-56,14],[-4,64],[12,19],[23,-10]],[[35963,39297],[-9,-55],[-11,2],[-13,45],[4,25],[-13,34],[12,51],[7,-4],[1,11],[7,10],[4,31],[-6,36],[13,40],[21,-54],[-11,-45],[11,-74],[-2,-8],[2,-10],[-2,-4],[-3,-15],[-12,-16]],[[35939,39425],[-4,4],[1,11],[-5,9],[-2,36],[16,-3],[7,-35],[-4,-30],[-5,7],[-2,3],[-2,-2]],[[35923,39552],[27,-29],[-3,-35],[-17,-2],[-7,66]],[[35909,39412],[-5,35],[5,2],[5,-11],[4,5],[16,-1],[1,-14],[3,-4],[3,2],[2,-3],[-1,-7],[2,-5],[-13,-11],[-5,-19],[-17,31]],[[35922,39341],[8,-53],[13,-44],[-30,-7],[1,90],[8,14]],[[35900,39017],[8,-16],[19,-13],[-4,-28],[14,-60],[-9,-48],[-18,36],[-23,109],[13,20]],[[35923,38859],[12,-82],[-14,-42],[-16,44],[6,45],[7,43],[5,-8]],[[35892,39213],[6,16],[17,-86],[14,-12],[-6,-31],[-1,-31],[-3,-10],[7,-14],[-2,-3],[0,-6],[0,-2],[2,-5],[0,-3],[-2,-5],[-4,-14],[-11,-5],[-3,13],[-8,5],[-5,-6],[-7,24],[13,134],[-7,41]],[[35904,39596],[18,-46],[-2,-37],[-22,-12],[-5,10],[2,46],[9,39]],[[35894,39463],[1,38],[4,-2],[12,4],[6,-39],[-23,-1]],[[35900,39399],[10,-5],[-1,-95],[-16,-32],[-5,68],[12,64]],[[35890,40042],[20,-24],[-34,-30],[-31,16],[45,38]],[[35893,39831],[8,-34],[-9,-42],[-32,-2],[5,34],[28,44]],[[35876,39162],[-14,41],[6,22],[3,19],[15,-8],[11,-80],[-21,6]],[[35854,39378],[11,31],[20,-11],[-8,-36],[-23,16]],[[35851,39444],[11,40],[15,-4],[-1,-65],[-15,-3],[-6,-17],[-4,49]],[[33453,49534],[11,-49],[30,-47],[-23,-68],[-31,17],[-7,46],[-3,119],[23,-18]],[[34832,41683],[23,1],[13,71],[15,1],[20,64],[8,73],[15,69],[12,22],[12,73],[2,60],[-6,90],[5,28],[-11,34],[7,38],[25,69],[9,-4],[5,65],[11,57],[1,75],[7,26],[-27,45],[-14,93],[-18,1],[-25,91],[-4,49],[-16,36],[9,72],[-18,25],[1,121],[-12,17],[-6,109],[8,15],[0,122],[-13,19],[-1,105],[8,45]],[[34877,43560],[10,92],[7,13],[10,32],[20,85],[24,34],[19,57],[17,28],[14,67],[3,94],[13,66],[48,-23],[30,-43],[58,-67],[65,-48],[42,-46],[21,1],[54,-85],[36,-77],[17,-52],[39,-76],[35,-87],[13,34],[31,-92],[51,-91],[2,-48],[19,-67],[1,72],[6,29],[27,-40],[7,-32],[8,-107],[14,-27],[-3,-55],[22,-80],[-7,-101],[-28,-44],[-11,-79],[-29,-60],[-7,-28],[1,-30],[-14,-21]],[[33128,43739],[-85,249],[-103,302],[22,19],[16,64],[39,65],[2,56],[-13,56],[8,58],[-18,80],[9,105],[12,36],[37,7],[10,-12],[41,59],[30,-26],[12,48],[46,38],[13,39],[16,10],[22,52],[9,47],[-3,37],[-19,33],[-23,14],[-30,-36],[-22,66],[14,49],[-8,58],[-25,72],[0,46],[13,3],[25,100],[2,41],[17,52],[27,-9],[20,15],[32,84],[23,26],[3,24],[25,3],[9,31],[2,56],[13,43],[28,7],[11,57]],[[33387,45963],[10,71],[80,-109],[98,-155],[53,-156],[32,-69],[15,-67],[27,-24],[9,-42],[41,-128],[4,-33],[-3,-77],[4,-44],[-3,-90],[-20,-65],[-13,-101],[-5,-129],[4,-66],[-1,-123],[10,-64],[-3,-16],[2,-25],[-3,-69],[0,-113],[10,-16],[-7,136],[4,18],[-3,79],[5,35],[-8,23],[-3,78],[10,176],[17,75],[21,58],[39,8],[29,-46],[30,5],[32,-52],[67,-158],[32,-84],[18,-98],[12,33],[34,-22],[25,-47],[21,-52],[15,-108],[1,-5],[0,-9],[2,-53],[1,-3],[0,-9],[-1,0],[0,-6],[0,-1],[-3,-18],[0,-1],[-2,-13],[0,-4],[-3,-9],[-1,-7],[0,-13],[0,0],[0,-5],[0,-2],[0,-2],[-2,-10],[-1,-18],[6,-25],[0,-5],[-1,-4],[-1,-9],[0,-7],[0,-7],[1,-4],[0,-16],[0,0],[-2,-11],[0,-4],[-5,-26],[0,0],[-15,-50],[-2,-3],[-3,-9],[0,0],[-1,-5],[-1,0],[-1,-9],[0,-2],[0,-6],[1,-5],[-5,-49],[-1,-2],[-3,-5],[0,0],[-6,-11],[-2,-5],[-2,-8],[-1,-2],[0,-8],[14,-1],[-2,-52],[10,0],[-1,2],[13,0],[1,-15],[7,-23],[-4,-30],[0,0],[-2,-2],[-1,-2],[-4,-11],[-7,38],[-2,1],[0,0],[-1,0],[0,0],[-3,0],[-1,0],[-1,-1],[-1,-1],[-4,-11],[0,-19],[-6,-33],[0,0]],[[34077,43665],[3,-49],[-27,-27],[-35,16],[-21,-15],[-17,13],[-22,-35],[-4,-29],[-19,5],[-26,-81],[15,-41],[10,-87],[-14,-63],[-10,-73],[-9,-23],[2,-59],[-33,-126],[11,-64],[-4,-52],[27,-54],[24,-90],[5,-83],[48,-105],[-8,-85],[12,-32],[35,0],[12,-22],[41,20],[15,-29],[-6,-109],[12,-57],[15,-16],[-4,-91],[5,-79],[11,-19],[41,-118],[-4,-33],[19,-68],[12,-89],[14,-31],[-2,-34],[20,-20],[-1,-48],[41,-135],[22,16],[30,-59]],[[33386,45966],[-47,153]],[[33339,46119],[11,-21],[36,-132]],[[46095,86410],[-79,-25],[-68,-67],[33,-57],[-28,-64],[-40,9],[-22,-39],[-48,-42],[-71,-37],[-41,24],[-37,-42],[-61,-42],[-59,-24],[-90,-92],[-106,-148],[-34,-13],[-156,-10],[-99,-44],[-30,-35],[-33,-85],[-70,-59],[-167,-50],[-51,14],[-72,2],[-35,26],[-4,33],[-70,2],[-120,46],[-24,-13],[-59,39],[-111,125],[-93,40],[-66,62],[-20,-53],[-79,-18],[-26,30],[-48,-18],[-70,-5],[-48,19],[-58,-33],[-51,8],[12,82],[-17,25],[12,66],[43,-24],[6,-39],[41,5],[102,48],[15,66],[55,12],[-19,95],[-64,26],[29,123],[-56,-22],[-25,74],[-26,-6],[0,108],[10,34],[-61,33],[-17,-19],[-143,17],[-71,17],[-22,-24],[-41,8],[-16,-47],[-74,10],[-34,75],[32,43],[64,-18],[58,43],[74,-19],[-4,50],[155,5],[34,33],[63,11],[53,-27],[94,0],[-17,95],[-44,-33],[-149,35],[20,55],[42,43],[47,19],[67,58],[-18,71],[-35,5],[-37,-55],[-82,81],[-52,-24],[-51,35],[-82,-11],[-9,-45],[-56,7],[-59,-21],[-22,-35],[-37,-6],[-90,67],[-86,-7],[34,44],[21,62],[40,-22],[64,36],[-38,28],[-17,61],[30,10],[114,-72],[53,43],[-83,17],[-42,66],[15,37],[60,-36],[-64,117],[48,46],[12,37],[38,33],[45,-10],[88,-81],[18,-59],[67,41],[29,-71],[52,22],[-22,70],[-102,53],[-38,57],[87,42],[-26,22],[-77,-15],[-9,67],[32,55],[80,-37],[24,35],[84,-67],[16,-80],[70,7],[9,-41],[48,-23],[-3,-45],[21,-49],[42,27],[34,-89],[36,-28],[0,-66],[-13,-63],[-27,-39],[-66,-3],[104,-65],[-4,-51],[33,-65],[-2,-91],[36,20],[-4,72],[26,33],[25,87],[51,54],[26,-3],[-6,-95],[32,-33],[30,34],[-17,34],[43,18],[17,91],[-12,86],[-33,114],[32,61],[57,7],[43,-83],[24,-72],[36,-13],[31,-98],[60,-15],[13,81],[-22,63],[23,110],[76,-9],[10,67],[27,21],[72,-17],[46,-69],[0,-69],[56,-19],[37,-65],[27,26],[-51,89],[-9,101],[11,14],[78,-14],[74,-64],[25,-60],[62,7],[16,72],[25,55],[65,26],[31,-61],[56,17],[70,45],[-1,73],[-26,121],[65,6],[60,34],[54,-27],[-1,-46],[61,-25],[6,-37],[-22,-46],[15,-37],[48,-11],[42,-47],[13,79],[60,6],[33,59],[48,26],[-2,-58],[-37,-15],[12,-48],[-45,-58],[14,-66],[57,-20],[45,14],[18,-55],[-8,-37],[-54,-72],[39,-40],[98,26],[-18,-51],[19,-56],[81,-30],[49,9],[12,-30],[59,-40],[-12,-89],[-22,-21],[9,-43],[29,-15],[-9,-66],[-19,-37],[51,-50],[-42,-56],[-34,1],[-21,33],[-33,-20],[61,-49],[1,-51],[-29,-41],[-32,-8],[-23,-64]],[[33040,50001],[23,72],[8,53],[16,-43],[3,-56],[-8,-147],[-12,-32],[-25,27],[-12,35],[7,91]],[[33054,50456],[-24,23],[-17,34],[-7,70],[-14,54],[22,41],[33,-34],[19,-66],[15,-31],[2,-54],[19,-54],[6,-47],[-17,-17],[-33,8],[-20,-8],[-9,49],[25,32]],[[34077,43665],[6,12],[2,35],[17,-26],[17,24],[-12,70],[-19,44],[6,93],[27,80],[9,84],[0,67],[19,126],[38,20],[39,-27],[23,-1],[19,-36],[38,16],[49,-13],[40,-22],[64,-47],[12,-19],[5,111],[47,35],[89,-6],[46,-43],[20,0],[16,-22],[15,10],[28,-20],[5,1],[2,9],[9,11],[0,8],[14,9],[3,29],[25,8],[49,-26],[19,5],[48,-20],[82,-53],[11,-63],[-13,-59],[0,-97],[-37,-110],[-7,-31],[-33,-70],[-19,-88],[-11,-10],[-9,-65],[2,-38]],[[34714,44227],[-21,16],[7,50],[46,-10],[5,-52],[-13,-20],[-7,13],[-4,1],[-13,2]],[[33007,49605],[15,-37],[1,-57],[-14,-92],[-28,44],[-3,42],[20,89],[9,11]],[[35052,74361],[24,-12],[-13,-70],[-27,-9],[9,-55],[22,-60],[21,-16],[24,-45],[30,105],[-5,50],[22,81],[21,40],[19,72],[29,29],[19,-17],[26,31],[18,65],[17,-14],[-25,-78],[-2,-40],[-23,-37],[4,-33],[-40,-106],[7,-47],[-29,-56],[25,-18],[6,-86],[24,14],[46,53],[16,58],[15,128],[26,-35],[12,-69],[-5,-82],[19,-15],[-12,-63],[-15,-32],[-15,-77],[-16,-9],[-16,-117],[4,-30],[-18,-133],[-5,-69],[-23,-27],[-16,-73],[-36,-5],[-11,34],[-34,35],[-39,-84],[-26,14],[-9,44],[11,42],[-12,56],[17,63],[-17,50],[18,43],[19,87],[-22,5],[-5,-37],[-45,-68],[-33,-99],[-18,-34],[-38,-37],[-23,14],[-3,46],[8,80],[13,32],[34,180],[32,45],[-14,23],[9,107],[-1,56],[-20,105],[-33,54],[-27,22],[-5,-49],[-53,-183],[-21,-33],[19,-28],[-13,-28],[-40,-17],[-25,9],[-12,-23],[-42,0],[-18,-52],[-31,-59],[-15,-116],[-24,-2],[-11,-83],[-30,-15],[-18,-30],[-20,34],[-73,-46],[-25,5],[-37,33],[-3,56],[29,56],[26,28],[52,8],[21,19],[58,91],[4,87],[27,48],[25,24],[43,12],[24,38],[0,56],[-32,-32],[-37,-11],[-22,37],[-64,34],[6,-112],[-7,-33],[-35,-14],[-44,15],[-34,-13],[3,60],[-32,-7],[-12,-25],[-38,-24],[-10,39],[45,19],[34,51],[-18,31],[29,52],[5,43],[-44,-20],[-32,-48],[-19,14],[-3,-58],[-45,-7],[-16,-17],[-68,8],[-29,-39],[-33,-16],[-47,41],[-33,-13],[-29,22],[-24,-15],[-12,39],[-51,0],[-27,-22],[-27,37],[-13,-22],[-38,29],[-43,19],[-38,-19],[-40,14],[-86,-58],[-42,0],[-57,-29],[-51,7],[-25,33],[3,90],[-8,55],[-23,51],[28,34],[14,44],[49,66],[30,22],[14,37],[66,108],[4,30],[65,52],[-1,44],[-25,23],[-54,11],[-15,-18],[-44,-16],[-40,4],[-50,-36],[13,60],[36,57],[24,19],[11,-30],[49,-34],[20,-1],[17,59],[-10,23],[42,144],[11,93],[21,58],[13,-17],[61,-4],[14,87],[-28,37],[-13,39],[5,76],[18,51],[60,106],[2,78],[21,50],[46,22],[-34,53],[20,40],[47,201],[32,177],[24,40],[3,48],[25,29],[-30,54],[43,12],[39,36],[28,83],[-2,47],[17,53],[42,80],[12,108],[14,29],[63,56],[9,-5],[67,74],[28,15],[53,66],[11,-21],[-8,-68],[53,-2],[-13,56],[79,15],[12,-17],[-14,-53],[-5,-93],[-33,-46],[-56,29],[-39,-11],[-32,23],[-7,-34],[30,-104],[32,37],[42,-27],[-4,-72],[-42,-118],[-23,-44],[-31,-94],[-28,4],[13,-71],[-26,-44],[-28,-90],[-30,-51],[1,-33],[-34,-108],[-55,-113],[7,-51],[-13,-88],[-16,-31],[10,-39],[23,-16],[27,76],[45,56],[35,99],[44,88],[16,-22],[5,-82],[22,-4],[24,24],[31,-63],[74,32],[15,-48],[-120,-130],[14,-127],[23,-72],[37,-41],[20,50],[34,-9],[18,-48],[25,3],[-1,73],[43,25],[7,-56],[-19,-56],[-9,-85],[70,19],[51,3],[15,37],[-7,101],[-18,-8],[-20,68],[20,6],[19,-32],[43,68],[21,-13],[-23,-51],[-37,-11],[0,-36],[30,-21],[28,69],[15,-11],[7,-71],[31,-2],[29,-21],[24,41],[24,14],[48,-28],[63,-56],[-1,-25],[48,-30],[7,-32],[-36,-87],[4,-55],[-26,-4],[-26,-34],[-8,-36],[-74,-75],[25,-17],[13,24],[33,-10],[-29,-91],[40,14],[27,-57],[-22,-7],[14,-79],[39,-52],[12,6],[21,110],[64,-27],[38,78],[25,-52],[0,-44],[-20,-30],[-7,-67],[-27,-24],[-32,1],[-44,-85],[-16,-44],[-6,-77],[-41,-7],[17,-64],[-14,-52],[-35,-11]],[[34945,75657],[26,23],[19,-67],[-7,-15],[-72,-39],[4,105],[30,-7]],[[34573,76424],[1,-54],[-32,7],[1,45],[30,2]],[[34514,75512],[2,37],[47,-27],[-33,-28],[-16,18]],[[31310,72415],[-27,-28],[-27,88],[13,49],[-19,106],[22,42],[-22,26],[-49,32],[-10,36],[-26,-3],[0,138],[7,53],[-2,472],[-1,334],[-26,27],[-19,64],[-75,108],[-31,11],[-12,-52],[-56,0],[-91,-77],[-37,46],[-4,95],[5,27],[-52,32],[-215,-548],[-16,-200],[-43,-62],[-23,-99],[15,-31],[-14,-39],[-7,-95],[17,-42],[-46,-77],[5,-54],[-42,-38],[-26,-44],[-21,-66],[27,-77],[-25,-11],[-31,7],[5,-57],[-22,-62],[-9,55],[-20,16],[-30,-23],[-9,-41],[-28,3],[-15,37],[-27,-48],[-31,-121],[-2,-37],[-225,-7],[-90,8],[-119,1],[-302,-18],[-148,6],[-39,12],[-41,-23],[-47,-62],[-21,-14],[-80,-124],[-73,-136],[-15,-60],[-25,-46],[-25,-14],[-44,-48],[-1,-30],[-41,-29],[-11,-46],[-24,-29],[-100,-332],[-164,0],[-168,0],[-194,0],[-141,-130],[36,-134],[8,-86],[-9,-47],[18,-8],[-1,-58],[22,-21],[7,-40],[-8,-52],[-104,-102],[-214,-210],[-122,-50],[-202,-83],[-201,-240],[-118,-141],[-79,0],[-108,134],[-22,128],[7,60],[-1,81],[18,57],[65,40],[44,115],[41,53],[15,111],[-4,33],[7,85],[93,476],[-36,407],[-44,502],[-30,344],[-134,155],[-166,191],[46,127],[-39,77],[-23,12],[-29,-14],[-18,12],[-36,-45],[-14,67],[-29,66],[-10,127],[10,61],[-32,22],[-19,-30],[-23,12],[-28,-41],[-22,6],[-58,124],[-27,183],[-276,288],[-179,187],[-170,177],[-139,145],[-210,219],[-86,-44],[-183,-194],[-42,29],[-27,-9],[-51,15],[-36,-25],[-27,29],[-8,41],[-30,19],[-67,-15],[-74,9],[-34,-4],[-34,106],[-64,-57],[-37,-59],[-50,-25],[-39,32],[-40,15],[-1,61],[-41,5],[-40,42],[2,40],[-15,27],[-65,-11],[2,-71],[-26,-13],[-26,90],[3,35],[-14,34],[-41,-8],[6,76],[-26,-2],[-71,60],[-101,2],[-33,-27],[0,-30],[-50,-21],[-41,-1],[-15,82],[-110,16],[-5,31],[-91,15],[-28,44],[2,76],[-19,154],[-6,15],[-15,125],[-35,53],[-29,-11],[-27,23],[0,-277],[-184,1],[-269,0],[-242,0],[-190,0],[-274,0],[-285,-1],[-351,0],[-233,0],[-318,0],[-301,0],[-250,1],[-179,-1],[-222,1],[-301,0],[-201,-1],[-256,1],[-240,-1],[-265,-2],[-240,2],[-349,-1],[-185,3],[-251,-1],[-343,0],[-177,-1],[-211,1],[-220,0],[-141,0],[-234,-1],[-175,1],[-303,-2],[-278,3]],[[15900,75147],[-30,16],[-7,48],[-33,-20],[-7,-44],[-15,0],[-2,63],[-28,25],[-4,78],[17,67],[-32,2],[9,63],[-7,78],[25,117],[-24,-18],[2,-38],[-64,-59],[3,-62],[-19,-42],[-57,62],[-44,7],[-16,18],[-32,99],[16,78],[22,10],[-27,79],[-27,-68],[-50,-17],[-60,34],[-3,36],[-60,78],[-23,63],[38,33],[25,69],[-7,73],[-32,35],[-23,-27],[-46,27],[-19,48],[5,50],[23,15],[23,42],[6,92],[-18,-11],[3,-49],[-21,-49],[-30,-26],[1,-39],[-20,-27],[-53,63],[-21,-34],[-44,4],[-31,-24],[-31,57],[-40,-24],[-86,29],[22,31],[-30,54],[34,15],[81,13],[50,15],[-2,22],[-128,-34],[-6,31],[23,30],[-25,40],[-36,29],[-40,-27],[-27,44],[-41,-1],[-14,38],[-27,13],[-8,-43],[-33,-48],[-72,67],[-34,10],[-33,48],[4,76],[-43,-8],[-7,33],[-29,45],[4,37],[45,37],[-49,26],[17,48],[25,21],[29,52],[7,86],[-43,-76],[-38,18],[-1,27],[-25,83],[-2,86],[26,86],[28,4],[26,129],[43,28],[15,40],[30,14],[39,58],[-14,87],[-17,25],[-23,-40],[-30,-7],[-9,-48],[-39,-41],[-13,7],[-62,-50],[-10,66],[-28,9],[-12,65],[12,34],[-10,33],[-62,-183],[-20,28],[15,74],[25,57],[-7,37],[37,165],[-6,84],[-25,-51],[-58,6],[-19,54],[-3,83],[-18,89],[-18,38],[-24,14],[-44,78],[0,72],[-24,61],[1,39],[88,-56],[36,-51],[59,54],[-18,16],[-21,-44],[-19,-6],[-18,34],[-50,50],[-19,75],[15,46],[-9,35],[37,64],[-12,54],[-32,-45],[-10,-37],[-30,8],[1,-41],[-33,-28],[-38,-70],[0,-129],[-15,-63],[-27,32],[-73,114],[-38,99],[-80,133],[-11,41],[6,95],[-11,49],[-40,37],[10,42],[-14,65],[-24,-22],[-24,11],[-5,79],[30,169],[40,26],[18,109],[39,76],[10,63],[35,85],[13,60],[16,12],[25,109],[-30,26],[-16,-95],[4,-35],[-24,-87],[-59,-127],[-14,70],[24,81],[37,62],[-16,35],[-6,89],[-24,74],[7,90],[-12,61],[33,99]],[[13886,80102],[2,69],[-28,83],[-40,-19],[-50,32],[-11,73],[-43,17],[-44,72],[-85,28],[-24,31],[-83,74],[-30,42],[-71,-9],[-18,111],[8,37],[-70,49],[22,123],[-90,33],[33,86],[-34,99],[-51,106],[-54,143],[-33,103],[-56,115],[-28,110],[-49,88],[-32,80],[24,30],[-92,131],[-37,84],[-116,94],[-41,85],[7,43],[-29,66],[-22,0],[-32,44],[-6,40],[-72,23],[-20,47],[12,29],[-31,29],[20,34],[0,64],[-62,96],[-63,72],[-132,-97],[-66,-16],[-45,-29],[31,-29],[-18,-68],[-47,1],[2,-131],[-32,-84],[-68,-5],[-39,-42],[-87,-72],[-47,-66],[-14,55],[-29,186],[-283,376],[-23,99],[-96,63],[-40,67],[35,166],[-1,24],[-172,-13],[-80,-110],[-132,91],[-18,-64],[-133,62],[0,414],[0,396],[0,388],[0,559],[0,336],[0,427],[0,564],[0,636],[0,333],[0,667],[0,387],[0,391],[0,557],[0,643]],[[10833,89951],[163,-41],[134,17],[216,-79],[201,-211],[48,-9],[36,-39],[141,-88],[37,-12],[78,-52],[26,18],[95,-70],[70,32],[158,-49],[97,-54],[49,-54],[17,38],[-117,163],[19,52],[-49,31],[-32,87],[73,86],[24,-13],[115,13],[-17,73],[74,34],[59,9],[66,-33],[45,23],[-19,40],[19,72],[-11,47],[66,-24],[0,-49],[27,-45],[96,-28],[-38,-64],[3,-53],[57,-2],[20,40],[144,14],[42,34],[-5,92],[23,54],[64,2],[55,-19],[-21,79],[42,-2],[62,-33],[55,20],[91,107],[59,21],[4,36],[92,-38],[14,81],[38,47],[50,-2],[25,33],[65,-6],[67,-45],[78,14],[3,43],[34,42],[35,-8],[56,-60],[-35,-64],[-113,-62],[-35,-31],[-75,-32],[-61,-42],[-14,-55],[-43,-14],[-42,-72],[-21,-130],[40,-21],[59,39],[12,64],[38,49],[32,84],[72,14],[104,51],[32,28],[113,21],[12,-111],[92,43],[56,88],[88,80],[-29,61],[16,42],[56,24],[106,22],[-16,43],[-69,26],[-41,74],[14,74],[43,52],[131,-103],[42,-44],[87,-137],[44,-117],[52,-173],[128,-177],[94,-88],[64,-6],[65,-52],[29,44],[49,0],[0,54],[-68,3],[-18,42],[55,9],[8,48],[-40,1],[6,59],[94,50],[27,120],[34,62],[-105,13],[61,37],[26,-19],[75,19],[-37,34],[51,52],[57,-76],[1,-54],[-36,0],[15,-122],[-20,-79],[61,-22],[55,17],[15,-28],[-42,-33],[-17,-56],[-55,-59],[-13,-76],[42,-21],[56,-3],[46,46],[53,-60],[113,72],[6,43],[41,3],[23,53],[-8,39],[20,47],[-12,68],[24,30],[59,-11],[55,24],[249,-17],[57,-25],[37,3],[75,-61],[52,-17],[77,-85],[109,-100],[96,-44],[97,-22],[109,-13],[131,-43],[35,-24],[52,-65],[158,-86],[132,-27],[59,-41],[63,28],[71,-45],[74,12],[71,-48],[15,51],[-66,41],[27,29],[81,-36],[87,29],[93,-56],[61,-18],[65,-43],[18,-50],[53,-9],[32,-34],[12,-46],[87,-71],[16,-70],[31,-55],[-61,-75],[-33,-15],[-47,27],[-49,-19],[-78,-63],[-67,-4],[-21,-40],[5,-79],[-100,-43],[156,-89],[63,19],[91,-30],[48,-36],[85,-2],[76,-27],[153,11],[11,-18],[186,1],[76,33],[104,20],[44,-17],[80,47],[104,-16],[60,54],[61,35],[23,30],[113,52],[25,-85],[46,-19],[17,-90],[33,-31],[52,39],[40,-21],[58,5],[22,-40],[13,-91],[-12,-70],[59,-63],[15,69],[6,116],[32,-6],[20,-79],[-4,-33],[28,-48],[42,-4],[76,-70],[36,-102],[-26,-53],[-101,-47],[47,-24],[16,-84],[48,-40],[58,-100],[-4,-22],[46,-70],[8,72],[-39,89],[-4,81],[-20,58],[44,23],[64,-49],[62,-25],[-9,60],[-54,68],[40,33],[-34,23],[-58,78],[-20,157],[18,30],[-75,114],[-53,62],[24,76],[36,7],[47,48],[-21,68],[13,6],[3,15],[11,-5],[9,11],[15,2],[45,-17],[33,14],[28,49],[40,-13],[82,17],[-17,56],[79,17],[80,116],[43,0],[98,26],[6,57],[-32,70],[-26,22],[-134,-76],[-46,-3],[-10,-75],[34,-20],[-48,-40],[-40,49],[-61,-20],[-38,-69],[-50,23],[-93,22],[-55,-9],[-17,-48],[48,-27],[-9,-37],[-68,-28],[-79,48],[-21,62],[-95,-44],[-30,20],[57,92],[70,153],[25,19],[154,16],[116,33],[53,36],[122,47],[16,21],[106,52],[124,-25],[71,-76],[24,-42],[-27,-31],[31,-56],[23,-156],[55,-48],[54,-16],[14,-40],[71,17],[20,-17],[-3,-63],[27,-89],[51,16],[23,-18],[75,21],[20,-20],[104,37],[1,51],[28,11],[15,-113],[36,-32],[73,-28],[53,-75],[91,-18],[52,-46],[88,31],[57,-24],[42,-37],[40,3],[100,68],[22,-23],[71,49],[61,-3],[30,27],[47,-1],[83,-32],[126,1],[49,-23],[22,-41],[76,4],[93,42],[77,8],[-24,59],[-29,-2],[-49,74],[1,71],[52,1],[15,-31],[72,-84],[35,-117],[75,-42],[26,-36],[49,-31],[102,46],[22,81],[-13,53],[-83,52],[-62,50],[-107,-48],[3,-54],[-100,126],[-13,44],[46,22],[-6,45],[-29,17],[-70,93],[15,39],[73,-11],[47,-41],[86,74],[-35,73],[37,11],[149,-29],[43,-69],[52,-49],[-23,-24],[43,-36],[64,25],[55,-56],[-28,-52],[-52,-35],[30,-44],[32,31],[31,65],[35,29],[103,47],[-32,-57],[12,-50],[-29,-89],[-25,-129],[18,-80],[-80,-99],[-10,-58],[66,-34],[43,2],[-48,-111],[38,-41],[88,81],[69,-6],[-53,-75],[52,3],[59,-43],[50,92],[-42,33],[-26,89],[27,36],[-42,88],[-67,49],[-3,29],[55,84],[3,65],[23,44],[-11,34],[99,21],[27,-35],[71,5],[21,44],[136,119],[-9,61],[54,70],[58,21],[56,41],[22,39],[-54,58],[39,123],[-21,90],[-87,-24],[-30,-36],[3,-87],[-96,-37],[-53,34],[13,62],[-3,62],[39,4],[29,64],[40,35],[-37,56],[21,122],[69,21],[33,-15],[-2,-57],[33,-47],[56,77],[31,19],[-31,40],[22,82],[-36,26],[-89,-73],[-104,6],[-58,83],[-35,83],[-44,-7],[18,-45],[-25,-29],[-163,85],[-94,78],[-60,-3],[-35,40],[4,74],[-63,28],[-54,78],[-20,106],[4,64],[24,48],[37,10],[5,61],[41,85],[-53,41],[-24,50],[-41,29],[35,187],[-23,65],[37,26],[-20,69],[60,22],[21,69],[81,10],[24,-50],[44,-36],[41,27],[15,45],[-30,25],[11,50],[-88,14],[-25,43],[23,41],[43,7],[65,69],[44,19],[35,141],[132,30],[45,-1],[41,-47],[-27,-79],[88,-15],[70,-41],[65,-17],[-33,-45],[47,-57],[121,-85],[16,-57],[48,-22],[5,-85],[26,-47],[-1,-82],[-28,-160],[76,-34],[6,-64],[68,-17],[43,-61],[11,-64],[91,-88],[46,-3],[10,-82],[48,-70],[-118,-23],[-91,58],[-46,-48],[-6,-40],[77,12],[55,-28],[8,-28],[-60,-55],[-30,-48],[-78,-48],[-32,-44],[10,-48],[42,15],[92,-91],[100,-50],[56,47],[6,39],[79,89],[77,0],[-3,-116],[19,-48],[43,-26],[28,46],[77,-43],[-25,-42],[-71,-38],[-21,-31],[6,-55],[-86,-4],[131,-120],[-9,-63],[29,-50],[33,-20],[4,-77],[-22,-37],[15,-36],[-3,-128],[-33,-43],[19,-26],[66,-26],[-8,-50],[28,-49],[68,102],[-1,45],[41,63],[-30,64],[34,55],[27,7],[13,77],[-23,99],[35,76],[36,31],[34,88],[71,36],[45,-25],[51,-105],[82,-73],[70,-51],[82,-138],[-2,-97],[46,-138],[-3,-60],[-35,-74],[-75,28],[2,71],[-59,-51],[32,-92],[-1,-36],[-31,-84],[74,-223],[59,-48],[129,-221],[64,-53],[41,-8],[21,61],[-23,19],[91,69],[23,-35],[47,-7],[4,136],[13,23],[-22,71],[29,70],[93,141],[39,26],[24,158],[40,120],[-5,160],[29,82],[57,30],[81,-24],[95,-5],[-22,59],[-38,37],[-20,61],[88,49],[-62,66],[-31,-7],[-58,24],[-44,82],[-19,187],[37,40],[-39,49],[45,104],[-4,45],[83,-53],[85,44],[62,17],[65,-9],[60,-28],[13,-36],[140,-55],[274,2],[14,-103],[-36,-47],[103,-53],[-8,-27],[82,-68],[94,-5],[48,-43],[50,-12],[1,-65],[-41,-19],[-18,-48],[-92,-66],[67,-8],[36,-28],[49,-6],[16,-74],[3,-80],[-88,-75],[-46,-3],[-18,-49],[-60,-15],[-126,27],[-4,-53],[34,-31],[-12,-62],[39,-2],[-17,-89],[57,-37],[-20,-66],[26,-69],[75,-100],[54,-43],[13,-39],[56,-44],[48,-94],[-37,-115],[-4,-96],[-32,-125],[-29,11],[-42,-31],[-20,21],[-58,-43],[-1,-26],[-44,-87],[5,-54],[-45,16],[-66,-68],[-8,-44],[-82,-2],[-34,-13],[-1,-43],[-96,-94],[-58,-13],[-31,131],[-44,16],[-45,51],[-6,114],[-30,-53],[-46,12],[3,52],[-39,10],[8,46],[-45,81],[-77,33],[-28,-48],[-32,3],[-39,-73],[54,-6],[31,65],[48,8],[13,-53],[37,-25],[23,-43],[39,-13],[-20,-45],[70,-17],[-10,-83],[72,-83],[14,-99],[48,-73],[-3,-21],[-78,10],[-47,49],[-10,33],[-58,-14],[-33,83],[-38,-48],[73,-86],[-25,-42],[-50,47],[-38,-6],[-27,29],[-109,19],[-19,150],[-35,66],[-106,-59],[-66,-5],[-26,14],[-116,-3],[-38,16],[-16,-75],[53,-88],[73,-14],[117,-64],[5,-28],[-32,-42],[10,-48],[-64,-41],[-13,-32],[-46,-22],[-11,-86],[-23,-68],[-43,-30],[-3,-26],[-77,-59],[-37,-54],[-27,-66],[-47,-23],[-140,-1],[-96,56],[-9,32],[-47,67],[-71,48],[15,39],[-58,28],[-59,10],[-87,98],[-77,57],[-31,0],[-38,-46],[-43,19],[-33,-18],[39,-41],[107,-85],[18,-40],[38,-27],[24,-79],[47,-33],[38,-86],[119,-5],[83,-25],[209,8],[135,-37],[40,-73],[-37,-83],[2,-45],[-34,-18],[-38,-105],[5,-23],[-49,-33],[-23,-102],[-60,-35],[-24,-45],[1,-61],[-43,-55],[-13,-81],[-60,-29],[-12,-21],[-123,-93],[-108,30],[14,-42],[-57,9],[-16,39],[-53,-11],[-69,56],[-22,-25],[14,-100],[-47,27],[-33,-41],[41,-71],[-41,-57],[-11,-69],[-40,-15],[-69,6],[-77,-81],[-38,34],[-12,33],[-90,28],[-56,61],[-65,11],[-94,-3],[-43,28],[-27,-3],[-37,43],[-58,5],[-12,30],[-54,14],[-8,34],[-107,24],[-17,21],[-87,-36],[33,-60],[33,-22],[31,23],[-22,32],[23,36],[40,-46],[26,-3],[146,-94],[22,35],[30,-51],[49,0],[39,-44],[86,28],[53,-61],[-11,-35],[40,-34],[57,-28],[81,-22],[37,-36],[30,-70],[6,-55],[30,-117],[-52,-119],[-56,15],[-55,-63],[-61,-43],[-120,23],[-68,28],[-33,-21],[-37,9],[-19,-30],[34,-70],[42,-31],[71,-5],[10,-56],[-56,-37],[-28,30],[-44,-3],[-35,-25],[-24,-55],[-53,17],[-1,-74],[52,-46],[-3,-57],[-24,-1],[-22,50],[-21,-77],[-21,22],[-47,-13],[-16,-70],[22,-28],[-84,-50],[-7,-74],[-51,-5],[-27,-25],[47,-29],[48,-49],[-28,-35],[-40,-9],[-42,-52],[-45,-31],[-42,-81],[50,-80],[-25,-33],[-43,0],[13,-64],[-43,-100],[-17,-129],[-28,-18],[-32,-87],[4,-28],[-26,-47],[-9,-70],[-41,-45],[16,-67],[-21,-74],[-9,-77],[13,-47],[-20,-25],[-20,-71],[22,-130],[-17,-101],[33,-193],[-25,-82],[6,-73],[-8,-32],[8,-75],[43,-43],[6,-63],[34,-59],[16,-58],[29,12],[16,50],[64,-20],[109,19],[49,-19],[71,1],[18,-63],[8,-142],[23,-95],[65,-216],[-4,-18],[29,-176],[57,-173],[22,-125],[-16,-116],[93,-109],[77,24],[52,37],[149,85],[80,13],[62,-20],[78,-61],[116,-110],[122,-54],[38,0],[86,-50],[65,-12],[1,-31],[30,-27],[10,-39],[45,-33],[43,-64],[51,-42],[53,-25],[15,-59],[26,-36],[54,-164],[46,-46],[-2,-21],[74,-62],[87,-13],[71,-62],[75,-46],[29,-39],[84,-34],[90,-75],[40,-76],[41,-48],[34,-8],[27,-30],[10,-51],[34,14],[50,-32],[78,-2],[34,22],[60,8],[27,-17],[54,31],[38,-30],[20,13],[53,-36],[40,-15],[52,-2],[50,22],[44,-69],[27,22],[84,-38],[45,1],[-6,-43],[6,-125],[16,-51],[-26,-107],[-10,-107],[-28,-115],[5,-110],[42,-92],[14,-49],[22,-121],[2,-37],[-23,-87],[-1,-74],[26,-175],[0,-30],[-29,-34],[-19,-84],[1,-119],[47,-31],[47,-82],[7,-52],[44,-70],[32,-79],[33,-52],[-5,-43],[27,-94],[4,-42],[25,-54],[50,-39],[18,9],[34,-40],[26,-76],[51,-53],[32,-78],[19,-118],[24,-71],[0,-71],[31,-25],[56,-17],[38,-38],[15,-33],[37,-23],[28,90],[1,45],[32,86],[15,13],[6,55],[48,71],[27,-13],[-6,-71],[42,-9],[32,-53],[4,-58],[19,-1],[36,75],[-32,113],[-17,15],[-27,73],[19,28],[29,10],[9,35],[-6,55],[37,22],[16,55],[23,38],[18,102],[-13,33],[17,50],[-12,45],[11,22],[-17,46],[-40,4],[-8,121],[-29,38],[29,68],[-40,36],[28,56],[-48,88],[1,68],[14,56],[-37,111],[-24,53],[25,46],[36,-4],[-37,67],[-13,41],[11,145],[-2,95],[-19,39],[4,52],[-52,8],[3,37],[-34,33],[-25,74],[3,59],[-9,80],[-22,47],[-33,14],[44,52],[167,85],[6,22],[42,23],[65,59],[64,39],[44,66],[103,97],[42,78],[15,3],[127,200],[25,88],[66,155],[22,15],[21,90],[-3,34],[29,77],[9,113],[-10,68],[5,193],[-10,83],[6,112],[-9,30],[-22,167],[-30,81],[-27,104],[4,33],[-64,165],[-47,104],[-28,31],[-56,94],[-91,77],[-40,23],[-8,46],[-32,25],[-21,42],[-50,15],[-17,55],[-27,18],[21,45],[-5,81],[-15,57],[60,5],[40,126],[27,9],[-2,74],[38,41],[38,22],[28,98],[-30,2],[-8,56],[39,18],[-1,63],[-18,46],[50,-4],[34,22],[15,53],[39,18],[-22,69],[20,72],[-47,0],[-31,66],[26,38],[-6,78],[-31,80],[-34,21],[21,46],[31,31],[-61,74],[-8,37],[35,24],[21,53],[-62,1],[-54,22],[-36,-3],[-3,49],[77,124],[24,12],[1,69],[19,33],[-2,134],[-16,45],[54,12],[-5,81],[-24,16],[-16,65],[-42,-4],[-23,35],[-34,189],[-7,202],[22,63],[22,4],[27,45],[53,28],[9,25],[74,55],[27,-23],[147,-18],[45,-33],[98,-46],[26,-21],[67,-22],[47,-36],[71,-35],[20,36],[49,-5],[100,-31],[46,-32],[12,33],[83,-8],[39,51],[71,35],[31,51],[64,32],[20,-46],[60,-30],[101,-136],[112,-51],[7,-104],[54,-50],[50,-16],[19,-55],[39,-54],[7,-33],[47,12],[73,-57],[-16,-45],[-45,-7],[-3,-83],[33,-16],[-15,-89],[78,-48],[-3,-31],[63,-6],[20,-20],[59,-13],[1,-30],[55,7],[38,-49],[29,39],[46,14],[61,-16],[-13,-44],[18,-32],[7,-86],[41,-27],[24,56],[50,-5],[-10,78],[20,69],[30,-8],[16,-79],[21,-32],[-15,-94],[-76,-62],[19,-75],[-43,-74],[21,-21],[2,-115],[31,-63],[-12,-49],[4,-51],[-59,-6],[32,-70],[-2,-50],[39,-12],[-6,-62],[28,-84],[-15,-58],[-22,-5],[-30,-56],[24,-33],[9,-73],[48,-1],[60,-39],[-3,-59],[-46,-20],[-32,-40],[43,-11],[8,-23],[-34,-53],[8,-81],[-30,-69],[-31,-8],[-10,51],[11,23],[-26,63],[-17,-45],[7,-68],[-28,2],[1,-61],[74,0],[34,22],[30,67],[43,22],[96,-17],[35,26],[44,-11],[29,-48],[28,-12],[13,-35],[1,-122],[27,-49],[80,-7],[16,-20],[-14,-43],[32,-31],[37,13],[-13,-67],[30,-40],[-19,-90],[14,-9],[22,72],[35,50],[110,68],[24,67],[45,-22],[53,87],[12,72],[23,36],[14,64],[24,30],[33,-37],[38,-18],[22,56],[48,-20],[14,23],[-55,36],[39,28],[32,67],[31,22],[-25,62],[6,85],[30,-24],[19,17],[-14,80],[40,-5],[-4,78],[17,14],[-42,150],[18,54],[44,51],[54,85],[-2,46],[44,106],[6,61],[75,58],[71,-57],[13,-76],[3,-85],[24,7],[32,-31],[-21,-47],[30,-35],[-11,-59],[-26,-44],[27,-49],[59,1],[1,-55],[54,-53],[8,-27],[-26,-84],[33,-35],[35,11],[26,-53],[25,-12],[6,-40],[-11,-57],[71,-67],[-5,-109],[40,14],[29,-48],[1,-58],[20,-55],[-32,-60],[-52,-44],[2,-35],[44,-27],[48,43],[68,-10],[-20,-138],[2,-78],[-26,-32],[62,-13],[50,-54],[-29,-43],[7,-33],[70,15],[18,-53],[-23,-40],[47,-52],[28,-91],[-52,-32],[-8,-35],[-49,-2],[-10,-51],[70,-5],[52,-47],[-3,-55],[37,-94],[30,-31],[44,16],[36,-50],[-4,-81],[-52,-19],[-26,-62],[2,-38],[-42,-20],[29,-48],[-12,-66],[-84,-4],[32,-34],[17,10],[63,-47],[-18,-30],[-85,11],[24,-60],[41,-17],[-2,-53],[37,2],[12,-35],[-36,-19],[-12,28],[-30,8],[-35,-38],[24,-21],[65,7],[44,-23],[44,-8],[26,-111],[-43,2],[8,-49],[80,8],[26,-83],[72,-1],[33,-17],[17,-136],[19,104],[54,-6],[-17,-59],[-27,-25],[49,-58],[-11,-38],[37,-32],[2,-39],[-32,-13],[-19,-38],[-4,-60],[-23,-29],[8,-54],[27,9],[29,70],[61,-33],[33,7],[17,52],[39,-18],[-8,-59],[-34,-43],[76,17],[45,-8],[-24,-70],[-48,-54],[20,-18],[51,91],[20,13],[24,72],[40,21],[-10,-71],[48,13],[12,-51],[-18,-26],[30,-64],[5,-37],[-13,-43],[22,-16],[45,20],[5,-27],[75,-20],[54,24],[7,41],[61,43],[9,-31],[-1,-94],[30,-8],[33,-71],[70,13],[13,-50],[30,-9],[15,-43],[-89,-30],[14,-34],[-49,-43],[-44,22],[-91,-29],[-18,-81],[-51,-4],[-38,-23],[-14,-30],[-59,-15],[-123,-54],[-34,-30],[5,-23],[76,45],[32,4],[83,41],[29,42],[55,26],[-60,-126],[-44,-9],[-29,12],[-30,-57],[-59,-22],[-55,-54],[-50,-29],[-46,17],[-81,-55],[-22,-57],[-6,-46],[13,-37],[-15,-23],[-1,-53],[-52,-46],[5,-40],[33,14],[34,-16],[55,113],[79,22],[71,95],[58,17],[28,100],[44,54],[-1,21],[50,24],[98,68],[-20,52],[6,42],[56,33],[36,2],[127,-40],[35,11],[50,-139],[26,-43],[-5,-40],[17,-34],[7,-78],[-93,-71],[45,-46],[1,-44],[25,-5],[39,118],[23,44],[34,-9],[113,46],[4,-42],[-38,-13],[16,-56],[56,5],[32,-40],[50,0],[-39,-53],[36,-20],[1,-31],[38,-34],[5,-48],[20,-25],[15,-96],[-32,-38],[-25,-56],[21,-36],[20,-92],[-50,-15],[-26,-29],[33,-68],[52,9],[3,-59],[-58,9],[-24,-26],[24,-59],[40,2],[53,-46],[3,-55],[-27,5],[-68,-16],[67,-42],[6,-152],[-52,-60],[-2,-29],[-77,-101],[-7,-18],[-61,-46],[-52,-63],[-25,-6],[-4,-41],[-66,-64],[-13,-48],[-48,-7],[-30,63],[-36,-13],[-40,-32],[-61,-6],[-35,-32],[-37,-54],[-54,-29],[-23,-2],[-39,36],[-51,-70],[4,-47],[-52,-59],[-33,-11],[-12,-35],[5,-119],[-28,-63],[-40,5],[-39,-68],[-35,-28],[-33,-105],[-68,-44],[-15,-39],[8,-28],[-38,-50],[-46,-26],[-75,21],[-50,-29],[-45,24],[-28,-1],[-25,-30],[-35,29],[-11,-24],[-83,-19],[-91,-63],[-18,30],[-17,69],[-36,-10],[-72,33],[-57,-1],[-25,18],[-20,-12],[-46,15],[-76,-6],[-30,-25],[-51,-4],[-24,-22],[-10,33],[-34,-9],[-28,35],[-71,11],[-38,-9],[-16,-22],[-51,18],[-23,24],[-35,-24],[-115,-14],[-18,13],[-90,16],[-51,-21],[-84,-17],[-36,23],[-37,-69],[-34,18],[-39,-19],[-26,60],[-23,-41],[5,-36],[-43,-29],[-17,-58],[-55,-30],[-8,-57],[-22,-68],[-14,17],[-21,-59],[1,-69],[-20,-54],[-1,-97],[-40,-102],[-59,3],[-49,-17],[-98,-20],[-19,-123],[-107,-26],[-13,-33],[-2,-51],[-35,-37],[-53,-76],[-32,-18],[-7,-96],[-15,-47],[-20,14],[-17,-47],[-4,-45],[-37,-111],[-44,-56],[-37,-69],[-15,-70],[-10,-83],[-17,-36],[-11,-66],[-20,-38],[-41,-47],[-22,-58],[-8,-59],[-61,-44],[-27,-68],[-10,-55],[-36,-105],[-25,-41],[-20,-7],[-73,-111],[-11,-46],[54,11],[33,41],[43,29],[30,37],[25,11],[53,112],[37,109],[23,17],[18,43],[8,68],[34,32],[68,143],[27,77],[10,71],[34,60],[12,-5],[110,196],[100,105],[15,7],[21,52],[31,22],[52,66],[56,31],[36,48],[97,75],[33,32],[57,31],[97,79],[19,26],[67,26],[73,51],[52,18],[88,6],[50,19],[64,-4],[106,-31],[53,-47],[42,-24],[36,-40],[72,-129],[0,-56],[-48,40],[2,-59],[32,-44],[9,-31],[-18,-36],[2,-44],[20,-36],[-31,-47],[-111,-71],[-13,-94],[-55,-20],[0,-28],[-56,-71],[-40,-25],[-39,1],[-21,44],[-77,38],[-41,52],[-37,-72],[-24,14],[-54,-31],[3,-40],[71,-44],[5,-19],[52,-4],[47,-65],[14,-100],[24,-21],[29,9],[35,54],[51,50],[49,14],[11,-33],[46,8],[6,-41],[23,12],[2,67],[31,29],[19,-33],[-29,-78],[-47,-45],[-8,-48],[-26,-38],[9,-68],[-31,-100],[6,-19],[-106,-160],[38,5],[11,-31],[37,33],[14,-24],[34,21],[13,-76],[-20,-36],[-7,-71],[8,-58],[16,-38],[29,-1],[0,-89],[29,-109],[13,-117],[54,-21],[40,5],[30,-42],[23,8],[49,-25],[44,77],[-31,55],[-6,43],[-27,20],[-13,-22],[-42,12],[7,31],[-3,99],[-31,31],[-43,-7],[-7,63],[34,71],[34,102],[49,71],[4,-116],[-33,-81],[23,-27],[45,-79],[-3,-63],[19,-69],[20,83],[14,8],[36,-22],[23,-53],[10,27],[30,-8],[21,-59],[25,11],[49,-7],[95,39],[60,0],[69,12],[49,-15],[-7,-27],[-44,-52],[-50,-18],[-16,-83],[-33,-9],[22,-80],[-15,-79],[-46,-14],[-45,4],[-31,56],[-3,107],[-46,2],[-38,-47],[-56,45],[-45,18],[-25,22],[-34,-70],[16,-34],[-42,-33],[-41,-4],[-2,-32],[30,-6],[30,-25],[15,-51],[22,-14],[72,4],[12,-45],[29,-13],[-12,-40],[53,4],[36,33],[82,-23],[30,-30],[6,-24],[37,-48],[32,27],[56,76],[24,19],[42,71],[17,-146],[38,-38],[23,0],[23,43],[23,1],[24,-43],[18,-61],[27,-27],[-23,-56],[-45,-25],[13,-35],[81,7],[46,-18],[-1,-37],[-19,-32],[-71,14],[-22,-38],[-31,-30],[-43,7],[-12,-58],[-25,-1],[-19,-37],[-47,-16],[-2,-24],[-107,-58],[-7,-32],[-24,-6],[-65,-43],[-31,-39],[-37,-8],[-12,-35],[-25,14],[-49,-40],[-48,-21],[-20,-37],[12,-39],[-37,-26],[-80,29],[3,114],[-36,-28],[8,-80],[-47,48],[-5,-34],[-24,-16],[-11,-56],[19,-53],[-7,-48],[-27,-29],[-40,-108],[-22,-20],[-13,-51],[-48,-55],[15,-44],[-30,-32],[-43,-85],[-49,6],[-28,-13],[-6,-65],[-33,-84],[-23,24],[-13,-61],[-16,56],[-21,-14],[-16,55],[6,74],[-43,111],[-13,-68],[-36,23],[-21,102],[5,61],[-17,85],[20,81],[4,79],[43,109],[35,63],[-20,27],[37,59],[129,160],[43,62],[94,107],[102,67],[34,41],[-9,-74],[5,-23],[36,-40],[14,56],[44,31],[58,59],[69,3],[34,23],[-50,31],[-37,6],[-48,-28],[-7,23],[-32,10],[-71,-12],[-23,-16],[-49,27],[-37,-35],[-1,-31],[-38,29],[-26,-20],[5,60],[26,54],[71,85],[34,56],[1,36],[20,27],[-37,45],[-19,-13],[-30,-69],[-21,-73],[-28,11],[-42,-64],[-31,-14],[-90,-92],[-29,-59],[-52,-44],[-16,8],[-30,-49],[-28,15],[-4,39],[-31,-30],[-5,-36],[-87,-80],[-2,40],[-27,4],[-21,-37],[-28,-18],[-49,27],[-8,47],[-43,-25],[-18,34],[-31,18]],[[34492,78353],[2,-54],[-45,30],[10,35],[33,-11]],[[34426,74190],[25,10],[16,-59],[-51,27],[10,22]],[[33058,72961],[22,61],[15,-4],[24,-51],[21,37],[50,57],[35,79],[70,42],[26,-10],[30,-46],[28,-62],[-37,-56],[34,-18],[4,-27],[-64,-60],[-31,-14],[1,-50],[-16,-40],[-23,-12],[-36,-51],[-28,-6],[-47,-38],[-14,21],[-41,16],[-57,-37],[-18,17],[-43,-27],[-37,109],[-24,233],[19,37],[20,73],[28,30],[36,90],[27,86],[28,125],[22,81],[59,104],[9,55],[18,37],[22,-28],[36,11],[-22,-62],[11,-40],[34,-19],[-7,-76],[-19,-77],[-3,-62],[-14,-85],[-18,-40],[21,-22],[42,-7],[0,-59],[-23,-9],[-65,-110],[-39,5],[-52,-31],[-14,-70]],[[33090,80099],[35,24],[12,-34],[-39,-24],[-8,34]],[[33034,72694],[36,-17],[-25,-35],[-11,52]],[[33059,80247],[4,-38],[-20,-37],[-43,23],[-11,24],[24,53],[46,-25]],[[30720,98272],[36,-34],[359,64],[179,48],[144,20],[362,80],[283,34],[21,-37],[-68,-78],[-187,-81],[-211,-45],[-127,-112],[-262,-114],[-127,-76],[-91,-26],[-215,-145],[-82,-111],[-51,-22],[-231,-29],[128,-53],[-56,-44],[-151,8],[-134,-26],[-130,-43],[57,-25],[181,44],[75,-60],[-119,-50],[-137,-35],[152,-30],[-80,-79],[-90,-38],[-125,-18],[-97,-34],[-188,42],[-33,68],[-214,20],[-19,30],[-93,10],[-159,-39],[27,-32],[183,4],[180,-25],[79,-94],[1,-67],[-70,-24],[-148,-24],[-32,-21],[-164,-4],[-149,-45],[-242,41],[-19,-67],[-238,17],[-57,-17],[-162,6],[114,-58],[162,14],[169,-7],[46,-29],[90,7],[301,-4],[-10,-64],[48,-79],[-66,-16],[-126,12],[-154,31],[-85,80],[-209,8],[-163,-18],[311,-32],[-86,-27],[-202,-20],[2,-51],[145,25],[193,-18],[71,-43],[-101,-44],[236,8],[153,-52],[-33,-84],[4,-82],[-55,-39],[-221,-21],[68,-45],[132,-51],[-1,-41],[-72,-8],[-38,-63],[-310,27],[-98,-24],[55,-32],[148,-24],[175,-5],[-19,-72],[-53,-40],[-101,29],[-74,-19],[-23,-39],[-96,-23],[-81,29],[-76,-2],[-280,24],[29,-75],[111,-47],[-31,-87],[96,-54],[-79,-39],[11,-42],[-73,-34],[-1,-35],[-156,-65],[-93,-10],[-143,19],[-93,-32],[-206,39],[-156,70],[-4,28],[-94,52],[-39,-70],[67,-42],[99,-12],[14,-26],[-100,-23],[-104,-41],[30,-59],[189,94],[225,-55],[62,-7],[98,31],[155,-33],[40,-66],[-118,-121],[32,-20],[86,28],[39,-10],[-26,-67],[58,-14],[49,28],[-7,45],[68,60],[74,9],[72,-90],[11,-159],[-67,-24],[-54,-90],[-100,-14],[-79,28],[-35,-82],[-49,-8],[-58,-76],[-44,6],[-150,-59],[-236,-60],[-47,49],[96,148],[-66,46],[-88,19],[-41,-28],[-125,8],[-101,-64],[-143,-9],[-98,63],[-46,-43],[-111,11],[-64,51],[-90,38],[14,-69],[-119,-13],[-80,112],[-39,-52],[24,-68],[151,-63],[-138,-37],[-84,-3],[-138,52],[-163,18],[-66,73],[-42,-83],[-113,13],[-27,48],[-110,-58],[-202,13],[-26,13],[28,63],[-49,85],[-6,85],[-51,-11],[60,-109],[-94,-43],[14,-33],[-64,-32],[-64,20],[-40,65],[-78,31],[72,74],[-34,125],[155,100],[65,8],[96,88],[88,-9],[104,23],[59,-25],[35,52],[62,47],[-59,63],[-105,21],[-14,48],[37,30],[-11,45],[-152,91],[21,100],[237,71],[128,-9],[114,-31],[68,-35],[61,-68],[68,-190],[57,18],[42,-48],[112,-7],[55,-44],[42,46],[128,10],[94,-21],[42,16],[-49,49],[74,10],[96,70],[93,110],[103,167],[-58,-7],[-113,-113],[-13,-51],[-87,-101],[-56,-39],[-71,-19],[-252,31],[1,27],[-120,65],[-10,93],[-93,108],[152,75],[43,125],[53,78],[-50,3],[-70,-101],[-64,-69],[-195,-35],[-41,22],[17,82],[-79,3],[-56,-61],[-122,-11],[-88,12],[-16,76],[11,156],[111,80],[63,133],[55,32],[272,43],[121,47],[76,-5],[112,-39],[117,2],[131,-21],[158,-81],[124,12],[-133,52],[44,42],[143,-17],[102,20],[113,-10],[-21,53],[36,58],[-53,12],[-82,-78],[-78,-13],[-136,29],[-190,0],[-175,21],[-139,40],[-21,35],[61,53],[97,-16],[60,-48],[77,12],[-83,70],[-77,22],[-55,157],[-102,43],[-49,100],[-138,63],[-85,2],[-170,50],[3,114],[38,28],[135,-25],[47,18],[-242,48],[-30,65],[49,133],[114,18],[91,-7],[104,-39],[347,1],[148,-45],[88,-70],[322,-187],[30,-91],[133,-60],[251,-55],[-10,27],[177,37],[-95,24],[-66,-22],[-103,0],[-39,27],[-121,17],[-9,76],[-34,54],[76,30],[-168,40],[-79,40],[-131,101],[-102,104],[334,41],[358,52],[88,-1],[29,46],[250,18],[317,10],[-61,29],[-192,7],[-141,-15],[-76,25],[339,98],[211,37],[368,13],[-93,33],[-178,22],[-144,-10],[-244,-35],[-7,92],[135,68],[32,66],[110,62],[298,102],[-17,33],[-334,-100],[-135,-79],[-12,-46],[-166,-63],[-53,-137],[-180,-70],[-229,-69],[-190,-41],[-344,-42],[-83,15],[22,57],[80,33],[158,20],[135,72],[-66,12],[-153,-63],[-230,-46],[-51,47],[-69,-12],[31,-71],[-33,-63],[-194,-22],[-185,-1],[-244,14],[-186,48],[66,91],[163,117],[28,36],[141,49],[472,54],[115,29],[-698,-54],[-163,-81],[-89,-80],[-129,-73],[-33,-61],[-90,-8],[-194,43],[-125,59],[-180,63],[-37,43],[76,25],[310,42],[140,-20],[227,14],[235,83],[144,69],[185,46],[-61,26],[-288,-62],[-141,-76],[-282,-41],[-206,5],[-394,-44],[-134,30],[-51,90],[101,49],[38,42],[277,143],[-27,28],[-394,-115],[-123,31],[-5,26],[289,104],[-118,51],[-149,-8],[-68,-31],[2,-46],[-125,-29],[-24,54],[-120,25],[124,100],[106,1],[10,41],[124,38],[334,21],[123,76],[116,39],[171,24],[287,-36],[178,-4],[62,32],[-175,23],[-54,70],[343,17],[26,124],[77,46],[132,-12],[-6,-39],[307,-42],[104,-62],[188,13],[109,-55],[446,-147],[159,-22],[93,-59],[70,12],[-105,64],[-292,76],[-1,42],[-137,13],[-336,126],[24,105],[151,1],[-106,100],[55,23],[195,-26],[89,-30],[98,-69],[139,-16],[-246,183],[-107,44],[74,23],[231,-21],[142,12],[-116,43],[63,41],[213,23],[81,-29],[156,5],[15,-47],[112,3],[62,47],[208,-54],[144,-134],[219,-75],[48,47],[-179,48],[-8,63],[-110,69],[-210,82],[29,52],[123,15],[326,-25],[119,-25],[213,11],[146,-53],[56,-78],[185,-39],[-131,106],[96,54],[168,55],[299,4],[-45,-69],[301,73],[227,4],[114,-76],[112,19],[313,-51],[209,0],[220,-25],[-64,-48],[-123,-45],[-375,-80],[238,-26],[140,49],[367,95],[231,42],[35,-65],[85,-23],[127,37],[103,-2],[37,-54],[-54,-61],[112,-23],[93,-91],[340,-19],[155,-87],[-5,-88],[-292,-155],[-172,-70],[-161,-49],[-270,-105],[-162,23],[-200,-35],[-47,-52],[-189,0],[-349,-25],[11,-28],[185,7],[84,-50],[-612,-167],[-124,-7]],[[32898,80532],[37,14],[35,-34],[6,-29],[-64,6],[-14,43]],[[26389,90991],[25,-62],[-16,-47],[35,-13],[30,50],[-22,46],[11,146],[-6,58],[25,67],[51,19],[-5,60],[-26,27],[2,64],[-55,6],[-43,-21],[-72,12],[-89,92],[35,8],[-34,66],[-118,60],[10,28],[108,28],[47,64],[-24,38],[44,42],[97,-11],[49,79],[-69,28],[-78,5],[-55,39],[-48,128],[-4,190],[38,49],[38,117],[53,-52],[20,61],[94,-42],[163,-27],[-61,47],[-70,11],[-128,67],[11,60],[100,58],[170,65],[144,80],[162,44],[96,52],[112,-3],[197,6],[42,-31],[69,-118],[15,-97],[-9,-93],[160,-69],[26,-53],[-37,-63],[2,-51],[38,-70],[53,-19],[23,-53],[-87,-71],[-8,-41],[-113,-96],[64,7],[52,48],[25,-43],[-10,-55],[-46,-26],[-38,-52],[-16,-68],[32,-51],[-21,-90],[121,43],[19,29],[-47,73],[54,-1],[3,63],[62,83],[84,25],[79,-78],[50,65],[58,-48],[38,-98],[-17,-77],[-33,-62],[17,-22],[106,-39],[-68,74],[13,88],[36,7],[79,-46],[20,11],[-123,73],[26,53],[-21,28],[62,32],[123,-54],[-6,32],[-104,74],[2,52],[37,57],[125,81],[48,3],[64,40],[165,-8],[58,-17],[29,-62],[146,-35],[90,-2],[171,-64],[38,-126],[28,-41],[-23,-58],[8,-43],[107,-25],[102,-11],[37,-82],[-24,-31],[-7,-64],[-162,-66],[77,-64],[56,26],[10,29],[95,28],[89,5],[6,-35],[-74,-74],[60,-17],[28,-37],[-24,-70],[73,-44],[18,-26],[76,-43],[31,30],[-12,58],[62,19],[-27,49],[51,19],[31,91],[114,-53],[61,-12],[105,-55],[69,-82],[43,-92],[-50,-47],[-55,-87],[-99,37],[-57,-22],[-24,-82],[-27,-3],[-22,-59],[45,-36],[-7,-46],[74,17],[106,59],[77,22],[20,74],[120,80],[49,-46],[24,-88],[-53,-65],[-12,-55],[-102,-74],[-22,-52],[28,-89],[25,118],[46,10],[68,61],[101,47],[96,62],[28,-36],[-57,-78],[-53,-47],[22,-25],[90,69],[79,45],[78,1],[46,-49],[194,-98],[16,-48],[-61,-93],[-112,-60],[-133,-27],[-124,-80],[53,-3],[129,37],[23,-15],[76,28],[42,-3],[10,-37],[-37,-39],[-29,-60],[-67,-27],[-38,-38],[-37,-66],[20,-16],[64,84],[53,18],[64,0],[97,132],[-2,64],[78,55],[70,-36],[54,-55],[63,-89],[7,-46],[33,-41],[28,-141],[-77,-13],[-107,45],[-78,-8],[-80,-103],[-92,17],[-123,-61],[31,-19],[79,40],[53,-9],[152,-83],[63,16],[159,-20],[121,-95],[28,-63],[-30,-71],[-66,32],[-94,6],[-83,-15],[-155,102],[17,-81],[-120,25],[7,-32],[93,-29],[127,-83],[-67,-27],[-17,-39],[45,-119],[-149,49],[-22,-37],[-115,10],[-96,48],[1,-32],[167,-67],[78,-3],[89,-36],[-88,-37],[-9,-26],[78,-14],[1,-30],[109,5],[18,20],[73,-62],[19,15],[46,-67],[91,37],[-76,-128],[100,-35],[-21,-85],[87,22],[60,-18],[37,-106],[42,-9],[28,-65],[41,-8],[15,82],[22,18],[54,-17],[7,-43],[66,26],[26,63],[42,1],[60,-43],[-61,-44],[-31,-59],[12,-36],[48,-4],[25,26],[65,-5],[87,-101],[0,-49],[35,3],[-13,-85],[48,-57],[2,-47],[-73,-58],[71,4],[17,-42],[88,22],[36,-9],[43,54],[60,19],[28,-38],[-10,-79],[-66,-25],[-7,-28],[13,-91],[-72,-29],[21,-27],[51,3],[29,40],[69,11],[30,-22],[52,15],[47,-22],[42,16],[-7,58],[77,19],[-10,-76],[38,17],[50,-28],[-15,-40],[47,-24],[39,-68],[50,-51],[2,-58],[-69,-49],[-50,73],[-23,-12],[65,-93],[-2,-48],[27,-42],[-79,-21],[-39,-36],[-51,35],[-28,-13],[-9,73],[-74,8],[5,-41],[40,-47],[-50,-56],[16,-35],[72,-22],[36,-39],[13,-48],[-115,-38],[13,-85],[22,-36],[-82,-25],[3,-37],[-24,-67],[-83,-29],[-23,35],[-51,23],[-22,37],[-80,-29],[24,-29],[38,-2],[7,-133],[-36,-32],[27,-61],[6,-51],[-30,-45],[20,-87],[-72,-85],[-54,34],[-15,78],[-52,14],[-49,-7],[-31,57],[7,65],[-33,20],[5,-79],[-17,-54],[-50,36],[9,56],[-67,19],[34,79],[-23,31],[-57,-37],[-25,42],[2,77],[-35,22],[-7,47],[45,3],[3,32],[-65,-14],[-38,61],[46,122],[75,36],[57,41],[5,54],[-165,-92],[-144,-3],[-4,53],[17,37],[-67,37],[-46,73],[-40,-29],[-26,41],[22,35],[-69,51],[-28,57],[7,68],[-74,-26],[-68,8],[52,-66],[-21,-57],[18,-30],[-28,-30],[-52,13],[-22,66],[-69,85],[-34,-38],[47,-114],[-3,-49],[68,-37],[12,-31],[39,-17],[15,-113],[-57,-39],[-72,20],[-50,-20],[-28,25],[-13,71],[5,53],[-63,33],[-8,39],[-59,-5],[33,-56],[46,8],[48,-35],[-8,-55],[-75,-42],[38,-66],[33,-15],[18,-95],[66,-48],[92,32],[43,-24],[1,-41],[-38,-54],[31,-31],[65,-13],[-22,-70],[17,-68],[37,-68],[54,-7],[-37,-86],[38,-17],[-3,-67],[36,21],[42,-5],[97,-51],[48,-69],[32,80],[46,-36],[38,-80],[-7,-57],[-36,-35],[-6,-54],[15,-22],[65,6],[29,29],[29,-38],[42,-2],[-2,-47],[-29,-20],[7,-36],[-49,-64],[86,-144],[34,-39],[54,22],[24,-36],[-51,-35],[-48,-81],[26,-29],[63,-29],[37,-31],[-4,-80],[15,-185],[-33,-59],[-31,31],[-32,128],[-10,68],[-29,28],[-29,-54],[50,-174],[-22,-67],[61,-55],[-14,-91],[37,-15],[7,-43],[-53,-20],[-72,61],[-22,-60],[60,-105],[-1,-68],[-37,-41],[-32,-2],[-31,89],[-2,91],[-64,-5],[-25,67],[-40,1],[-25,50],[-51,17],[-12,-43],[-44,46],[-39,8],[-42,53],[-27,-39],[-62,91],[-33,73],[-48,26],[-94,134],[-29,87],[-47,21],[-5,-45],[47,-111],[-50,6],[-33,71],[-39,20],[-23,42],[-66,34],[-15,48],[-55,24],[-37,-27],[-57,16],[40,-68],[24,-74],[132,-174],[31,-80],[74,-34],[35,-47],[41,10],[39,-70],[95,-115],[39,-77],[12,-44],[55,3],[46,-50],[-1,-27],[33,-46],[61,-125],[60,-75],[7,-121],[-12,-25],[31,-76],[-18,-20],[-82,-12],[-79,48],[-27,39],[-58,36],[-22,-5],[-58,36],[-32,-10],[-16,64],[-28,-16],[-28,24],[-58,-2],[-82,40],[-21,-4],[-132,32],[-15,32],[-70,49],[-38,11],[-42,34],[-28,67],[-42,29],[-26,64],[2,46],[-21,42],[-73,-20],[-81,-6],[-42,34],[-47,61],[-95,18],[9,29],[-58,24],[-31,39],[-72,8],[-39,56],[-23,5],[-52,139],[23,30],[-98,24],[17,31],[110,-23],[72,106],[-59,21],[-33,74],[-28,20],[-63,-20],[-38,36],[-29,-59],[-26,74],[34,34],[-7,41],[-44,-38],[-52,33],[-38,96],[-42,22],[-22,35],[16,64],[-86,88],[-46,-11],[0,52],[-32,42],[-52,33],[20,39],[-23,37],[-56,-3],[11,-48],[-49,-35],[-36,100],[37,23],[-4,45],[-109,-39],[-24,6],[-43,65],[8,48],[25,39],[-19,31],[-69,-81],[17,-44],[35,-19],[56,-71],[-41,-24],[1,-29],[35,-35],[-53,-44],[-76,18],[-39,38],[-30,-16],[-83,74],[-26,-6],[-58,46],[13,-93],[-31,-69],[-30,21],[-51,-26],[-40,-73],[-52,2],[-16,22],[-78,-68],[-86,55],[-61,-34],[-1,37],[-35,47],[-72,-5],[-23,47],[-63,85],[-44,120],[40,84],[-18,105],[50,61],[56,25],[45,44],[28,-11],[53,47],[-59,92],[25,79],[51,25],[38,-41],[51,13],[71,-19],[81,-49],[91,-43],[38,40],[89,-34],[95,-24],[36,9],[9,39],[56,55],[72,-45],[26,0],[49,57],[13,38],[84,30],[36,25],[53,-52],[48,18],[-31,104],[-29,29],[-1,64],[-79,52],[-109,167],[-15,54],[16,35],[115,88],[78,97],[79,73],[13,47],[50,50],[61,36],[-7,31],[46,115],[6,50],[48,46],[54,2],[49,53],[8,65],[-34,53],[11,21],[-25,90],[-17,107],[-49,41],[23,60],[-57,84],[-44,34],[8,101],[-33,124],[-26,-13],[-42,48],[-28,-24],[-51,34],[-46,2],[-63,80],[22,53],[42,22],[-3,73],[-26,49],[-99,30],[80,-123],[-92,-31],[-73,53],[3,38],[-115,112],[24,34],[43,15],[-6,46],[-57,-6],[-49,12],[-28,-42],[-56,47],[-23,45],[-38,-90],[-105,-50],[-32,-45],[-97,-56],[-47,-2],[-24,35],[46,114],[-39,40],[15,68],[69,22],[112,-37],[57,51],[35,-4],[6,114],[-48,54],[-114,81],[-63,17],[-88,81],[-119,43],[41,53],[44,-5],[-26,86],[-95,31],[-70,-17],[2,-44],[-33,-10],[-16,175],[11,71],[-5,75],[-84,35],[-52,-35],[-51,2],[-55,76],[8,46],[-46,1],[-21,48],[-80,16],[-32,-32],[-110,12],[32,-52],[92,-42],[53,1],[48,-98],[0,-66],[25,-76],[-40,-55],[-69,-7],[-99,8],[-76,-27],[-65,96],[-85,19],[-30,-24],[-64,48],[-80,18],[-159,14],[-94,27],[13,-40],[113,-31],[50,-73],[45,-39],[58,-85],[-42,-27],[-177,146],[-52,15],[-35,-64],[-124,5],[-95,14],[-119,94],[-161,-43],[-98,19],[-181,15],[-120,59],[-166,15],[87,-49],[-97,-29],[-162,92],[-73,81],[9,40],[-35,25],[-47,-4],[-43,-29],[-147,32],[-67,-60],[-135,62],[28,43],[-150,50],[-49,46],[-41,74],[5,24],[-95,96],[-26,83],[64,23],[-10,31],[-63,47],[62,13],[11,-29],[125,11],[74,-10],[51,-59],[66,-11],[193,11],[8,70],[-120,66],[-27,38],[4,54],[-86,-30],[-121,11],[-151,36],[-32,-6],[-114,17],[-59,29],[-34,79],[15,38],[-17,89],[39,37],[13,56],[-37,47],[-22,89],[5,80],[54,35],[5,41],[-43,59],[-3,62],[35,41],[-17,35],[35,27],[10,96],[38,2],[15,111],[65,73],[-9,58],[26,102],[81,138],[85,100],[107,103],[68,51],[119,63],[103,40],[162,42],[139,4],[163,-26],[124,-6],[68,-56],[-22,-47],[-179,-128],[-81,-75],[-71,-92],[-86,-204],[-73,-97],[-13,-82],[12,-43],[92,-103],[34,-95],[-44,-62],[-13,-67],[10,-107],[18,-64],[67,-127],[30,-15],[92,-120],[80,-81],[131,-48],[-1,-52],[23,-56],[-72,16],[-51,-33],[-33,7],[-27,-59],[-124,7],[-81,-90],[-152,-35],[70,-23],[97,31],[123,90],[226,32],[20,-17],[-2,-62],[-39,10]],[[32907,80812],[24,22],[22,-58],[2,-110],[-7,-50],[-31,21],[-47,81],[9,69],[28,25]],[[32883,80444],[35,12],[23,-25],[-4,-37],[-38,3],[-16,47]],[[32833,81233],[19,40],[21,-11],[-13,-91],[-39,4],[12,58]],[[32846,81102],[1,50],[28,-9],[-4,-50],[-25,9]],[[32833,81411],[-19,62],[23,17],[36,-43],[-11,-57],[-29,21]],[[32518,75660],[83,-70],[34,-23],[32,-73],[40,-22],[1,-21],[98,-53],[50,-111],[13,-46],[-42,-49],[-107,6],[-11,-8],[-65,45],[-87,29],[-79,44],[-44,39],[-16,31],[-77,47],[-24,105],[-47,72],[-42,43],[-72,37],[-25,42],[-52,36],[14,40],[88,28],[50,-27],[27,-26],[137,-36],[101,-54],[22,-25]],[[32770,81249],[7,44],[39,10],[22,-26],[-25,-65],[-25,-5],[-18,42]],[[32754,81469],[20,69],[20,0],[17,-50],[-25,-42],[-32,23]],[[32679,87145],[26,-2],[26,-52],[-49,-26],[-30,17],[-6,58],[33,5]],[[32639,88137],[-76,-82],[4,66],[44,60],[28,-44]],[[32361,88247],[-82,9],[27,42],[63,2],[-8,-53]],[[32227,88466],[60,-18],[4,-37],[-69,-9],[5,64]],[[32198,82931],[16,-51],[24,-17],[-44,-48],[-25,33],[29,83]],[[32124,85530],[-28,62],[-2,54],[43,0],[-3,-55],[19,-35],[11,-93],[-40,12],[0,55]],[[31969,84814],[25,47],[43,-10],[57,6],[24,-53],[-21,-47],[-51,-29],[-78,42],[1,44]],[[32082,85721],[-68,6],[-44,29],[2,28],[78,58],[32,-121]],[[32102,83305],[-35,-33],[-57,33],[-28,49],[20,33],[37,-1],[63,-81]],[[31944,84053],[-23,1],[-28,54],[-74,56],[15,60],[106,25],[25,-20],[63,-9],[21,-45],[-8,-59],[-49,-127],[-39,13],[-9,51]],[[31944,84382],[43,-48],[13,-56],[-35,-15],[-56,45],[-30,65],[16,49],[49,-40]],[[31924,86081],[1,62],[29,3],[18,-79],[-48,14]],[[31805,86364],[64,62],[14,-74],[-37,-25],[-22,-56],[-67,0],[17,54],[31,39]],[[31583,88950],[10,-57],[-20,-15],[-89,23],[99,49]],[[31431,72090],[19,44],[12,-65],[-8,-38],[-35,1],[12,58]],[[31111,89971],[21,29],[56,-46],[-39,-32],[-19,-57],[-71,32],[-12,23],[64,51]],[[31111,83454],[48,-94],[-37,-110],[-29,-4],[-34,-43],[-39,-27],[-30,46],[14,81],[42,150],[65,1]],[[30772,82283],[-25,31],[10,56],[-20,37],[45,16],[10,-78],[-20,-62]],[[30334,84912],[5,29],[-21,61],[-41,61],[-2,31],[63,-22],[75,-44],[87,-120],[-6,-46],[-36,-16],[-66,22],[-35,-3],[-23,47]],[[30285,73691],[36,39],[11,-14],[-27,-66],[-30,-40],[-31,16],[41,65]],[[30000,90794],[-29,-4],[-32,48],[45,52],[9,61],[65,7],[119,-40],[-15,-48],[-139,-54],[-23,-22]],[[29722,91328],[0,43],[66,25],[24,-50],[-18,-38],[-72,20]],[[29713,91280],[51,-48],[-54,-21],[-9,-71],[-52,42],[-29,115],[65,31],[28,-48]],[[29444,88803],[61,-41],[60,22],[43,-31],[16,-122],[-19,-29],[-155,17],[-93,-20],[-71,38],[-47,85],[-10,63],[10,37],[67,-7],[34,43],[30,-31],[74,-24]],[[29452,84899],[-36,-4],[-106,41],[84,20],[54,-12],[4,-45]],[[29378,88956],[-46,122],[27,30],[67,-89],[-24,-61],[-24,-2]],[[29370,96429],[-93,16],[-15,51],[146,-41],[-38,-26]],[[29200,89208],[36,50],[25,-48],[-61,-2]],[[29067,89129],[-11,80],[26,70],[69,-13],[25,-27],[4,-51],[53,-77],[-26,-34],[18,-47],[-57,-10],[-9,39],[-61,33],[-31,37]],[[29116,88950],[44,-55],[-3,-97],[-30,-72],[24,-107],[4,-136],[-31,-101],[-82,-83],[-87,-51],[-76,-22],[-66,10],[-117,-33],[-84,22],[-62,154],[1,66],[-21,131],[25,82],[61,145],[65,125],[29,33],[108,32],[47,-10],[54,34],[46,-8],[91,-53],[60,-6]],[[27924,92177],[-147,84],[-42,141],[13,81],[-31,53],[-152,19],[-31,46],[5,98],[-9,96],[34,42],[-3,62],[100,6],[84,-53],[18,22],[125,-41],[22,-20],[121,-3],[40,21],[224,5],[87,-47],[171,-64],[17,-44],[65,-93],[93,-67],[-10,-72],[54,-5],[27,-40],[-2,-79],[76,-22],[-4,-44],[-41,-24],[-77,-11],[-214,31],[-125,31],[-196,-15],[-193,-87],[-99,-7]],[[28696,85456],[-36,0],[-61,32],[-79,106],[-23,18],[14,62],[92,-3],[71,-55],[43,-61],[21,-49],[-42,-50]],[[28646,89660],[-14,-57],[-49,-24],[-45,16],[-29,75],[5,106],[47,32],[63,-30],[72,12],[14,-42],[-64,-88]],[[28336,85269],[-45,52],[-71,114],[-29,61],[65,32],[87,-7],[96,-80],[35,-65],[-17,-67],[-24,-7],[-63,-52],[-34,19]],[[28386,85857],[-40,14],[7,48],[52,11],[48,-30],[-33,-52],[-34,9]],[[28333,89931],[-128,-73],[-109,-8],[130,141],[39,3],[20,38],[53,-38],[-5,-63]],[[27975,89488],[19,62],[74,15],[30,32],[-1,39],[36,47],[1,42],[35,39],[88,-7],[18,-57],[-73,-93],[-20,-51],[-49,-59],[0,-29],[-54,-44],[-97,-51],[-36,59],[29,56]],[[28159,83572],[7,18],[63,31],[-5,-53],[-56,-26],[-9,30]],[[28071,89129],[40,43],[51,-36],[-54,-46],[-37,39]],[[28103,80345],[0,75],[33,59],[16,-18],[-2,-143],[-63,-76],[-2,63],[18,40]],[[28055,91891],[-23,36],[32,27],[62,-53],[-71,-10]],[[27961,94415],[-67,21],[7,31],[112,86],[15,38],[83,-20],[-15,-31],[-83,-52],[40,-82],[-92,9]],[[28055,88902],[-53,40],[12,90],[57,-5],[36,-47],[-52,-78]],[[27983,80080],[37,173],[-30,22],[-30,-119],[-33,-80],[-37,8],[-26,-13],[63,167],[-30,3],[-64,-149],[-52,-4],[-7,23],[42,61],[28,83],[60,98],[24,133],[10,-4],[-32,-177],[40,23],[36,235],[39,-17],[2,-41],[37,-83],[-20,-9],[-13,-133],[-33,-176],[-11,-24]],[[27881,79314],[-9,21],[62,30],[97,36],[7,-16],[-74,-41],[-83,-30]],[[27874,77272],[81,93],[31,-25],[-21,-28],[1,-44],[-84,-38],[-8,42]],[[27927,84424],[3,-45],[-23,-48],[-17,-77],[-33,-78],[-47,2],[-28,88],[-55,49],[-25,89],[1,67],[15,96],[18,49],[35,47],[23,70],[43,6],[50,27],[41,-44],[55,-82],[-30,-144],[-26,-72]],[[27777,89949],[26,-86],[-25,-19],[-61,22],[-74,105],[-72,-5],[2,53],[71,36],[83,9],[23,-38],[45,-10],[75,57],[54,-3],[40,-74],[-87,-68],[-78,-2],[-22,23]],[[25401,93432],[-10,34],[29,80],[-2,132],[-124,-89],[-65,-88],[-114,-41],[-111,-6],[-105,47],[-71,16],[-44,68],[-46,30],[-81,-20],[34,-63],[-52,-9],[-111,32],[13,36],[-109,39],[8,86],[-60,127],[-76,103],[12,107],[22,68],[54,69],[51,25],[2,50],[-34,39],[-6,117],[-110,59],[-32,119],[-38,58],[-52,27],[-30,84],[-241,-71],[-225,18],[-84,-50],[-92,13],[14,87],[-175,48],[-42,57],[-8,52],[-87,80],[-119,10],[-21,25],[23,60],[98,-8],[-94,77],[44,31],[131,33],[-11,27],[165,18],[76,-8],[69,-47],[150,-7],[95,-66],[72,1],[38,32],[64,-18],[11,-34],[121,-83],[-1,-51],[-81,-124],[33,-26],[71,93],[62,17],[54,-21],[158,22],[49,31],[131,18],[91,-17],[158,-78],[23,-69],[-100,-3],[-12,-21],[244,-48],[76,-31],[127,-16],[25,-38],[-29,-35],[-95,-21],[-246,-2],[-181,22],[-22,-20],[167,-35],[126,-38],[-62,-24],[-1,-51],[98,17],[64,-14],[50,-51],[-39,-46],[102,10],[76,-65],[-22,-89],[34,-92],[43,-47],[63,25],[-41,108],[76,33],[40,-46],[79,-53],[78,20],[101,5],[65,42],[53,-26],[24,-44],[66,-35],[55,-1],[61,-38],[116,-2],[14,25],[-71,38],[140,53],[91,10],[74,50],[113,-15],[1,29],[89,16],[41,43],[66,28],[110,-10],[41,-34],[132,10],[77,39],[88,19],[240,-26],[105,-26],[-65,-52],[10,-30],[78,-23],[148,24],[111,-48],[33,-77],[69,-5],[24,-50],[41,-18],[-30,-69],[22,-38],[-89,-39],[-41,-60],[-90,-19],[-31,-37],[85,-45],[28,40],[118,9],[52,-105],[-159,-41],[-64,7],[-24,-44],[31,-38],[-37,-93],[-75,-11],[-186,16],[-142,-82],[-79,12],[-115,46],[-28,-24],[-66,7],[-84,78],[0,111],[-61,-9],[-40,-113],[-38,-57],[-91,4],[-91,-31],[-378,-7],[-376,-24],[-143,6],[-72,-9],[-227,31]],[[27777,80305],[-15,34],[7,52],[38,0],[8,43],[39,-18],[1,-45],[-78,-66]],[[27800,78067],[12,72],[18,-4],[3,-59],[-33,-9]],[[27794,80703],[-8,60],[38,-4],[-30,-56]],[[27797,78220],[-35,-39],[-8,94],[21,21],[29,-26],[-7,-50]],[[27083,85696],[2,54],[51,32],[-12,41],[-48,46],[-105,14],[-45,-25],[-16,52],[53,86],[-22,34],[-78,-26],[-29,-28],[-37,0],[-36,-63],[18,-66],[5,-75],[-43,-32],[-49,-73],[-58,-56],[-37,17],[-30,-38],[-22,-58],[-7,-81],[-95,-107],[-49,-43],[-65,-38],[-81,-1],[-29,49],[-14,120],[18,111],[2,112],[-35,33],[-81,-11],[-72,-36],[-43,18],[-68,-14],[-27,-43],[-48,-24],[-46,4],[-31,45],[1,71],[63,112],[48,54],[94,52],[31,32],[49,16],[-1,61],[-33,41],[-24,186],[2,81],[56,162],[15,68],[-23,47],[24,84],[-9,132],[17,47],[-10,40],[38,212],[34,61],[76,86],[27,-52],[89,-23],[15,-82],[29,-56],[-11,-28],[-56,-35],[74,-74],[4,-65],[33,-89],[25,4],[12,82],[58,112],[27,-18],[23,-57],[40,-11],[13,-48],[-17,-23],[29,-39],[111,-43],[59,8],[51,-62],[3,-50],[35,-41],[95,-65],[17,-35],[81,-51],[31,21],[136,-138],[38,-60],[-8,-36],[5,-91],[48,-105],[-35,-57],[-48,-7],[-32,-34],[13,-42],[127,39],[57,35],[59,-37],[44,68],[50,-45],[10,-44],[45,-8],[-17,-89],[37,-5],[73,-38],[13,-25],[-88,-29],[-28,-64],[-100,-88],[-28,-47],[-70,35],[-62,50],[-30,-1],[-34,37],[-42,7],[-47,45],[-38,-4],[-27,-26],[-46,18],[-11,31]],[[27211,78014],[-3,16],[38,87],[80,41],[71,9],[73,-19],[41,-57],[37,-76],[19,-56],[8,-59],[17,-47],[-29,-56],[-78,37],[-68,64],[-70,22],[-61,43],[-49,23],[-26,28]],[[27250,89746],[10,49],[101,-21],[-38,-43],[-30,40],[-43,-25]],[[27222,84959],[-36,-52],[-46,-19],[-49,-98],[-56,-56],[-36,-64],[-74,-68],[-66,51],[-32,-5],[-47,-56],[-40,-10],[-5,107],[-58,88],[7,38],[53,59],[32,73],[28,120],[64,67],[36,-15],[12,-37],[30,-9],[84,69],[79,-8],[31,39],[40,1],[86,-50],[-24,-58],[-1,-89],[-12,-18]],[[27018,90025],[31,39],[46,-22],[1,-37],[-78,20]],[[26979,87523],[-31,-43],[-80,40],[11,36],[37,1],[15,-36],[48,2]],[[26666,87154],[-33,84],[-8,70],[-76,53],[-8,62],[44,-9],[88,-49],[83,-76],[9,-21],[-16,-75],[63,-56],[49,3],[23,-54],[-42,-25],[-19,23],[-60,-6],[-37,28],[-21,60],[-39,-12]],[[26698,90054],[21,25],[60,-15],[-13,-61],[-68,51]],[[26360,87157],[-1,108],[-15,63],[21,30],[47,-9],[11,-55],[24,-24],[42,-100],[24,-108],[-49,-55],[-26,36],[-15,58],[-63,56]],[[25555,96664],[-58,-31],[-10,-106],[40,-96],[67,-70],[-44,-77],[-56,-16],[-93,93],[-51,-48],[56,-70],[-36,-69],[-21,-96],[-75,-15],[-43,29],[-63,96],[-107,108],[-37,59],[-55,-16],[41,-73],[59,-52],[52,-115],[-92,-4],[-35,62],[-90,-14],[20,-67],[-20,-33],[-188,2],[-173,30],[-56,38],[-49,-26],[-252,157],[-15,39],[96,6],[60,25],[142,12],[-25,28],[-156,12],[-44,25],[-160,-32],[-146,136],[-10,40],[-122,114],[183,54],[67,70],[174,6],[213,-10],[92,18],[251,21],[-55,29],[-356,-31],[-115,41],[44,32],[158,-8],[201,34],[-1,29],[-248,-30],[-132,29],[21,56],[-156,-66],[-113,-12],[-75,-49],[-101,-11],[-11,53],[-70,17],[-179,-69],[-40,12],[-16,81],[-87,-9],[-53,30],[14,80],[215,35],[168,59],[-48,52],[-73,-56],[-216,-23],[-101,14],[-89,70],[-3,32],[-91,43],[-19,33],[-15,176],[127,-13],[122,-56],[178,-12],[86,12],[31,82],[-169,-33],[-257,91],[-103,63],[26,19],[265,26],[-57,40],[-49,94],[66,-6],[199,21],[68,-30],[208,-8],[2,28],[-144,8],[-38,88],[-126,53],[-99,22],[72,38],[-6,85],[95,29],[219,-16],[3,49],[73,12],[148,-21],[84,61],[-115,43],[-83,-13],[-132,10],[-48,24],[29,68],[194,22],[125,-14],[289,-92],[73,-46],[31,-85],[155,-194],[132,-54],[46,-96],[185,-27],[126,10],[103,-66],[-12,-84],[-45,-28],[23,-49],[100,-61],[96,-32],[49,71],[-87,26],[-32,37],[17,75],[76,39],[202,-24],[17,-160],[-135,-36],[57,-51],[160,10],[57,-100],[29,-12],[-65,-244],[144,60],[144,-39],[87,5],[80,-48],[76,-106],[64,-25],[41,-69],[-83,-28],[-27,-34],[-338,-89],[-23,-55],[-57,-16],[-147,-113],[-80,-113],[-74,36],[-37,103],[17,56],[-17,65]],[[26111,96597],[-134,-12],[95,85],[85,39],[142,-7],[11,-55],[-199,-50]],[[25917,88591],[-47,39],[-25,91],[30,30],[0,38],[-38,39],[28,30],[-2,39],[60,92],[65,-46],[23,-238],[-26,-95],[-39,-37],[-29,18]],[[25795,90205],[-63,69],[99,17],[63,-23],[53,21],[30,-90],[-74,-14],[-108,20]],[[25048,95583],[24,-23],[5,-80],[24,-18],[-73,-73],[-132,-20],[-93,53],[-86,30],[-55,64],[-3,130],[94,52],[186,-35],[109,-80]],[[24966,94866],[-56,84],[-75,79],[41,56],[123,26],[82,-72],[3,-34],[-51,-59],[31,-90],[-98,10]],[[24992,89308],[20,73],[47,-55],[-29,-72],[-38,54]],[[24900,89676],[-40,80],[41,38],[61,-33],[-33,-76],[-29,-9]],[[23579,91972],[-55,58],[-4,62],[-67,42],[2,64],[-30,18],[14,107],[-6,128],[16,52],[-9,232],[-23,79],[11,62],[76,38],[70,-54],[38,35],[-93,118],[8,51],[50,29],[203,67],[284,38],[96,-15],[124,-37],[79,-46],[9,-60],[42,2],[52,44],[108,10],[118,-13],[118,-26],[81,-43],[63,-18],[-95,-146],[-114,-130],[-88,-165],[-161,-295],[-83,-91],[-71,-20],[-197,46],[-53,30],[-77,-21],[-110,-6],[-79,-31],[99,-21],[20,-36],[64,-47],[34,-101],[-52,-78],[-54,-20],[-54,-111],[-12,-65],[-50,-29],[-123,-7],[-133,-34],[-14,30],[22,57],[-18,94],[24,173]],[[24809,89667],[-10,83],[25,9],[54,-72],[-1,-30],[-42,-25],[-26,35]],[[24749,95404],[50,-26],[-25,-49],[-56,-5],[-74,66],[105,14]],[[24166,84355],[-73,26],[7,24],[47,13],[19,-63]],[[23473,95567],[-97,-8],[-62,24],[-60,70],[6,67],[60,36],[135,32],[39,-30],[196,35],[200,-36],[94,27],[118,-34],[40,-49],[-65,-13],[-48,-67],[-18,-77],[-160,2],[-80,23],[-119,7],[-110,-21],[-69,12]],[[24037,93790],[21,-84],[-27,-148],[-66,-24],[-144,8],[-82,-19],[-86,48],[-64,-8],[5,51],[-58,38],[-153,14],[-87,76],[-72,1],[5,51],[-60,54],[60,97],[76,55],[38,59],[5,48],[96,80],[70,9],[119,55],[116,-17],[53,-21],[117,-123],[68,-43],[41,-59],[-22,-52],[30,-46],[-14,-68],[15,-32]],[[23706,94328],[-44,35],[-15,87],[106,47],[53,-163],[-100,-6]],[[23598,95932],[-189,-43],[-84,-34],[-97,-12],[-58,28],[-92,-82],[-58,14],[33,77],[-83,25],[-74,43],[32,49],[125,-3],[34,44],[-129,53],[-69,-7],[-74,63],[-42,7],[-26,63],[-70,48],[-16,40],[87,18],[-3,40],[-67,59],[-11,40],[55,64],[192,-9],[135,-43],[34,-30],[104,-13],[48,-45],[14,-65],[101,-37],[66,31],[184,-65],[52,-61],[-114,-67],[47,-71],[55,-31],[-42,-88]],[[23366,97874],[192,5],[67,-54],[-68,-12],[-191,61]],[[23389,89262],[-39,-34],[-88,-116],[-75,-16],[-91,53],[-55,10],[-20,-19],[-64,30],[-35,-1],[-66,77],[-131,38],[-24,41],[13,47],[-45,13],[2,-70],[-79,21],[-41,35],[6,68],[-29,16],[-49,-27],[14,-30],[-52,-19],[-45,28],[-23,77],[-23,12],[21,78],[44,15],[104,11],[63,23],[12,61],[49,27],[23,48],[-47,36],[3,72],[17,46],[44,14],[13,79],[26,51],[35,16],[15,53],[48,1],[131,-128],[-31,-27],[47,-33],[51,25],[15,-57],[64,-64],[32,-1],[30,-41],[95,-56],[39,-56],[-10,-32],[73,-54],[-12,-69],[34,-83],[4,-48],[50,-32],[42,7],[48,43],[33,-34],[-10,-37],[-39,-24],[-98,-17],[-19,-47]],[[23513,93432],[-121,44],[30,62],[50,-1],[73,-81],[-32,-24]],[[23407,89736],[-47,58],[-16,55],[51,93],[56,-15],[70,-70],[-13,-79],[-50,-59],[-51,17]],[[23357,94192],[-58,-70],[-82,47],[-58,-88],[-60,-35],[-47,74],[34,50],[145,42],[15,50],[111,-70]],[[23146,89900],[82,5],[25,-38],[44,31],[22,-57],[-24,-99],[-67,73],[-46,21],[-36,64]],[[23141,92151],[55,5],[21,-121],[26,-26],[14,-74],[-106,-75],[28,-22],[27,-118],[-2,-125],[-17,-73],[-51,-26],[-62,4],[-41,-74],[-116,-62],[-77,29],[-116,-5],[-47,70],[-32,-9],[71,-105],[45,-43],[-42,-80],[-67,-68],[-66,-30],[-65,60],[-82,-8],[-44,137],[-46,52],[-36,107],[-46,61],[-51,9],[-64,68],[-104,168],[-82,-2],[-68,92],[-26,14],[-54,-58],[-44,36],[-54,7],[-41,107],[-30,47],[-44,7],[-103,83],[-41,78],[36,84],[26,101],[110,46],[63,-31],[41,-77],[58,-31],[55,-117],[140,-25],[110,30],[40,51],[-8,47],[84,16],[2,33],[-44,36],[16,29],[-39,53],[-93,28],[41,83],[81,23],[-12,27],[-96,-16],[-76,-30],[-54,45],[-54,12],[-103,98],[34,48],[51,7],[19,36],[92,-8],[55,-92],[37,65],[-163,126],[29,45],[132,47],[140,-69],[52,53],[-107,-2],[-8,55],[89,24],[67,-75],[66,-14],[70,-63],[289,52],[64,27],[15,33],[75,3],[39,-25],[79,-5],[72,-89],[-5,-68],[-65,-42],[-62,8],[-31,-75],[97,-29],[4,-62],[-147,-29],[-42,-29],[-37,-73],[-143,-120],[28,-49],[120,70],[102,-11],[85,-37],[9,-87],[49,-51],[14,-42],[-33,-24],[11,-62],[58,60],[56,21]],[[23055,92320],[-21,26],[-12,76],[70,70],[85,-74],[6,-31],[-29,-68],[-52,-16],[-47,17]],[[23065,92180],[24,71],[29,31],[48,-78],[-31,-43],[-70,19]],[[22837,93432],[52,35],[45,59],[46,-17],[-27,-66],[-81,-37],[-35,26]],[[22401,93790],[-50,-16],[-147,7],[-85,32],[6,53],[-32,59],[27,52],[-79,62],[67,26],[-53,38],[162,14],[-2,74],[108,96],[-256,-33],[-158,-38],[-114,-2],[-127,-29],[-117,-6],[-35,-26],[-62,34],[-28,57],[56,12],[27,48],[87,18],[-25,68],[53,34],[79,14],[102,-33],[-43,85],[-49,31],[-23,67],[41,45],[-80,27],[-15,67],[58,101],[113,-1],[107,-67],[9,-79],[42,-5],[91,-71],[14,-41],[69,-16],[41,-72],[72,-2],[-49,61],[-15,50],[27,35],[-114,43],[-19,31],[135,31],[-73,59],[-105,-8],[-83,71],[80,70],[129,53],[79,-24],[102,-7],[86,-88],[111,-15],[-60,88],[40,24],[103,3],[103,-57],[112,-18],[33,-67],[-39,-77],[82,-79],[1,-55],[-44,-102],[15,-42],[-12,-93],[-57,-22],[65,-39],[68,-14],[-14,-57],[10,-113],[-86,82],[-35,-21],[26,-51],[-59,-39],[-34,-64],[138,-120],[-21,-24],[-88,-9],[-6,-62],[-96,2],[-94,-25],[-58,16],[-135,-11]],[[22493,93044],[69,56],[94,7],[62,29],[134,27],[30,-49],[-41,-50],[-81,-63],[-90,-35],[-58,-8],[-170,7],[-62,45],[113,34]],[[22203,97290],[-24,10],[17,100],[79,78],[102,-26],[121,11],[83,-111],[-15,-61],[37,-65],[-92,-46],[-108,26],[19,55],[-91,42],[-128,-13]],[[21472,96618],[91,9],[-7,41],[114,52],[108,-16],[108,-74],[70,-18],[-70,-93],[58,-16],[112,12],[82,-10],[117,-57],[53,-72],[13,-90],[-31,-54],[-4,-77],[78,-10],[18,-53],[141,-109],[-47,-54],[-20,-91],[-49,-19],[-131,-5],[-13,-26],[-111,21],[-88,52],[-54,60],[-19,67],[24,21],[-147,59],[-60,43],[-187,42],[-130,-34],[-51,32],[40,61],[-134,-5],[-186,-53],[-25,-35],[-144,13],[-156,131],[-6,44],[66,52],[117,-13],[51,-25],[211,5],[-7,49],[-160,17],[46,28],[96,-1],[51,48],[-30,40],[-161,-21],[-44,43],[98,57],[-81,60],[-101,-30],[-37,-66],[-100,-38],[75,136],[-72,52],[-50,-28],[-121,3],[-23,98],[68,96],[413,57],[148,-57],[86,-8],[57,-82],[74,-72],[-27,-89]],[[22301,95045],[89,-31],[-46,-26],[-78,30],[35,27]],[[22222,89450],[-62,40],[5,62],[54,12],[3,-114]],[[22119,89278],[-20,46],[-42,-4],[-7,167],[39,37],[46,-15],[36,-75],[10,-84],[-33,-18],[-29,-54]],[[22110,90563],[-58,35],[-4,90],[50,-1],[77,-61],[-65,-63]],[[21944,95028],[67,23],[135,-18],[-142,-72],[-153,-53],[-102,25],[150,51],[45,44]],[[19444,91958],[57,43],[-28,64],[-47,45],[-46,124],[-63,5],[-62,63],[-12,35],[37,27],[56,1],[135,-26],[53,-67],[104,-75],[61,-11],[33,-80],[5,-60],[80,15],[40,-63],[-27,-103],[77,-194],[-8,-55],[60,-55],[-29,-87],[79,-66],[8,-51],[70,-3],[57,104],[47,33],[27,44],[-45,62],[-50,25],[-19,82],[-30,48],[16,70],[-20,70],[-45,83],[33,49],[-33,32],[-21,71],[-15,123],[-17,55],[10,55],[-45,55],[5,37],[44,23],[-5,48],[31,56],[107,-20],[51,-28],[65,-60],[37,51],[54,30],[64,-65],[49,3],[19,-49],[64,-63],[46,-24],[45,6],[13,-48],[46,-43],[46,-1],[32,-52],[8,-76],[-37,-23],[33,-37],[26,-181],[78,-161],[-13,-31],[55,-118],[3,-82],[44,-30],[80,-140],[-7,-80],[27,-83],[-57,-32],[18,-57],[-12,-48],[-49,-51],[38,-72],[102,-59],[30,-77],[5,-56],[46,-8],[55,-52],[38,-71],[68,7],[47,-60],[76,8],[86,-36],[34,-41],[48,-21],[7,-32],[167,-52],[-20,-36],[15,-45],[62,-7],[103,44],[11,-84],[20,-48],[10,-150],[-19,-91],[-108,16],[-34,64],[-34,-40],[-94,-2],[-25,52],[-65,29],[-51,-31],[-58,-71],[33,-27],[-9,-83],[-75,-15],[-92,61],[-45,64],[-61,-16],[45,-72],[39,-9],[14,-46],[44,-14],[6,-57],[-18,-34],[26,-42],[44,65],[85,21],[3,44],[50,19],[51,-8],[54,-65],[-53,-28],[25,-63],[-56,-7],[18,-40],[47,32],[67,-54],[-14,-124],[-53,-24],[-26,21],[-82,-55],[-21,-34],[-126,-60],[-65,36],[-64,-48],[-164,65],[-40,-11],[-100,48],[-19,-43],[-36,-3],[-130,25],[-32,47],[61,29],[-6,40],[-84,33],[-47,32],[-91,27],[-63,-24],[-87,19],[-5,44],[43,34],[-20,87],[-70,64],[-46,-42],[1,-36],[-60,-20],[12,-81],[-58,-63],[-46,-85],[-60,-42],[-175,-34],[-105,7],[0,-30],[-51,-57],[-79,-62],[-115,-27],[-70,-40],[-109,-16],[-25,15],[-78,-23],[-41,13],[-72,-44],[-49,26],[-63,-29],[-171,-23],[-76,4],[-66,-25],[-69,7],[-45,-29],[-34,13],[-87,-20],[34,58],[-74,35],[-26,74],[-41,44],[-22,100],[27,42],[0,63],[-34,79],[-2,45],[-124,28],[-16,20],[-256,-22],[-55,16],[-177,17],[-25,32],[-47,8],[-41,33],[-44,7],[-32,38],[5,74],[-51,0],[-29,27],[7,41],[-77,47],[-33,47],[-37,133],[9,45],[105,59],[229,66],[293,53],[58,0],[106,25],[106,-4],[32,-21],[107,-14],[105,10],[68,-31],[139,-4],[108,38],[41,-12],[136,13],[-4,50],[-95,5],[-40,17],[-27,76],[-156,49],[-82,14],[-64,44],[-112,4],[-44,36],[-67,15],[-45,-31],[-55,8],[-50,-33],[-122,-23],[-115,2],[-155,-12],[-33,-16],[-86,49],[-106,-26],[-167,16],[-50,-19],[-54,37],[5,40],[-100,66],[-56,55],[-45,87],[23,34],[143,87],[70,11],[142,45],[225,89],[47,-6],[33,78],[135,22],[-46,46],[-150,-46],[-34,6],[-143,-51],[-57,2],[-45,-24],[-94,-17],[-134,-4],[-67,12],[-19,56],[69,57],[82,-14],[-5,51],[-72,53],[-80,-68],[-44,55],[-164,8],[-10,129],[16,49],[54,72],[42,30],[35,77],[139,53],[-24,79],[-79,4],[-25,26],[13,82],[92,95],[92,51],[61,50],[82,102],[144,44],[69,52],[114,49],[205,71],[184,90],[76,17],[74,-36],[72,-120],[0,-91],[-20,-20],[4,-139],[-63,-7],[-38,-42],[20,-42],[-82,-51],[62,-39],[85,67],[70,-2],[82,40],[28,33],[-54,19],[104,153],[63,17],[104,-27],[73,-41],[96,-18],[57,-39],[73,-23],[68,-42],[36,-58],[-19,-72],[-62,-45],[-6,-42],[-65,-31],[-38,-47],[59,-45],[28,28],[-10,39],[75,64],[11,-48],[56,4],[125,129],[71,-11],[102,-82]],[[21944,95751],[-136,-3],[-69,-29],[-94,-1],[-124,79],[11,51],[110,27],[94,2],[138,-39],[85,-59],[-15,-28]],[[21877,89846],[-28,59],[66,-15],[45,-70],[-33,-7],[-50,33]],[[21742,96121],[48,-54],[-76,-6],[28,60]],[[21665,89359],[34,1],[51,-39],[6,-71],[-39,-56],[-38,26],[-39,-9],[-64,56],[73,54],[16,38]],[[21391,94328],[-109,14],[69,55],[18,40],[257,70],[32,-50],[-113,-39],[-32,-68],[-122,-22]],[[21389,94472],[-146,-37],[-102,7],[-1,31],[97,20],[201,69],[122,15],[12,-60],[-183,-45]],[[21502,94615],[-65,-41],[-151,-36],[-208,20],[-68,17],[-31,46],[62,49],[212,35],[111,31],[101,1],[60,-68],[-23,-54]],[[21389,96049],[-84,15],[87,74],[57,-48],[-60,-41]],[[21417,90592],[-54,32],[-4,66],[31,2],[53,-56],[-26,-44]],[[21227,94735],[-198,9],[-37,110],[-69,55],[4,30],[112,55],[66,-5],[77,-43],[31,-55],[177,-60],[-48,-62],[-115,-34]],[[21111,93827],[-64,-16],[-102,19],[-88,52],[114,204],[79,23],[72,-27],[61,-78],[-5,-46],[47,-47],[-74,-77],[-40,-7]],[[21111,95311],[-55,-29],[-56,7],[25,49],[86,-27]],[[20726,95404],[-50,56],[3,37],[-88,123],[10,51],[-77,77],[43,27],[70,-8],[138,-88],[112,-153],[96,-71],[31,-60],[-12,-55],[-95,-34],[-110,46],[-71,52]],[[20843,89193],[102,-14],[54,-66],[-7,-39],[-37,-19],[-48,14],[-72,58],[8,66]],[[20553,92883],[86,1],[52,24],[118,-13],[17,-26],[143,-85],[18,-34],[-31,-173],[-31,-60],[-67,-85],[-18,-70],[-45,-24],[-37,-72],[-131,130],[-42,77],[-41,15],[-11,72],[-49,29],[-44,51],[-166,66],[49,56],[47,84],[50,25],[133,12]],[[19444,94856],[67,0],[15,84],[50,20],[19,72],[95,68],[92,6],[110,-78],[-86,-86],[59,-32],[-33,-34],[43,-33],[-33,-37],[87,-18],[55,-115],[-82,-39],[-24,-57],[18,-33],[159,8],[54,-47],[-74,-66],[-41,-68],[39,-7],[40,64],[95,21],[103,-14],[134,123],[167,-36],[110,-66],[35,-56],[16,-97],[-26,-110],[-72,-50],[34,-38],[-36,-95],[-36,-17],[-4,-97],[-61,-32],[32,-30],[-73,-29],[-126,-11],[-25,-31],[-114,-35],[-198,65],[-9,-34],[-131,-25],[-48,92],[-59,18],[-42,-51],[-101,-32],[-52,-63],[-109,2],[-62,-25],[-70,5],[-57,-40],[0,-56],[-56,-22],[-142,-81],[-35,2],[-77,-51],[-217,-59],[-125,-11],[-171,18],[-65,28],[-130,84],[-59,81],[97,64],[206,54],[80,65],[58,22],[211,19],[114,-12],[109,66],[9,32],[61,29],[9,42],[-45,26],[-35,-46],[-69,-17],[-237,-35],[-8,40],[-85,16],[-11,-58],[-132,-32],[-115,-17],[-81,13],[9,75],[34,107],[-66,12],[-30,-79],[-77,-116],[-171,-79],[-40,23],[-28,100],[-87,-36],[22,-37],[-45,-45],[-161,68],[8,81],[-87,10],[-40,-53],[-175,41],[-98,54],[29,74],[84,86],[66,8],[285,4],[113,71],[-20,43],[-129,-51],[-84,-10],[-199,12],[-3,65],[55,73],[41,22],[140,2],[251,27],[48,29],[-151,7],[-45,-13],[-135,-1],[-85,18],[32,157],[60,38],[86,24],[101,-11],[144,0],[12,26],[-152,9],[-45,15],[-1,72],[87,56],[175,34],[125,13],[86,-19],[30,-39],[-33,-58],[74,-106],[61,6],[103,46],[131,-7],[38,-41],[86,-14],[-27,-55],[31,-44],[111,-28],[62,-37],[10,-36],[-122,-37],[69,-31],[41,22],[96,-10],[33,-78],[-23,-24],[19,-88],[97,-21],[75,32],[88,-23],[114,3],[243,-29],[88,79],[-68,90],[-130,44],[-36,45],[-80,-9],[-29,27],[115,48],[82,62],[13,44],[-63,51],[-105,50],[-32,-3],[-102,56],[-12,81],[79,12],[31,26]],[[20000,92796],[111,3],[12,-25],[-80,-28],[-43,50]],[[20029,88770],[6,55],[31,4],[23,-4],[-11,-17],[-18,3],[3,-17],[16,9],[11,-8],[-35,-11],[0,-21],[-26,7]],[[19975,88412],[-4,121],[36,-4],[20,-82],[-52,-35]],[[19972,88757],[22,-12],[-10,-55],[-45,26],[33,41]],[[19694,88748],[51,7],[17,-73],[-49,21],[-19,45]],[[19443,96432],[72,-48],[107,-42],[38,-59],[-48,-117],[-104,-11],[-44,19],[-119,-35],[-130,33],[-29,31],[-102,17],[-32,-80],[-103,0],[-23,57],[-43,23],[-131,-17],[-190,-68],[-40,47],[31,53],[267,98],[188,10],[57,25],[61,69],[203,53],[114,-58]],[[19443,96025],[100,-12],[19,-48],[-40,-60],[-81,-23],[-249,-36],[71,-71],[115,13],[54,-12],[-18,-61],[14,-85],[-37,-35],[-174,-61],[-109,6],[-228,-80],[-119,39],[-38,61],[-89,0],[-10,41],[-67,28],[38,46],[-57,30],[26,54],[-40,72],[217,105],[132,24],[97,2],[56,32],[334,32],[83,-1]],[[19149,89129],[69,43],[38,-50],[-73,-16],[-34,23]],[[18458,95032],[-235,-3],[-125,26],[54,72],[232,22],[100,-48],[-26,-69]],[[18055,95911],[71,41],[111,16],[97,-79],[77,-21],[47,-50],[-97,-73],[-108,-12],[-209,150],[11,28]],[[15000,91623],[43,-12],[25,30],[17,59],[-17,41],[31,31],[-10,35],[54,30],[-5,44],[52,101],[82,66],[-22,48],[39,41],[-20,100],[-27,18],[149,32],[36,28],[-23,41],[-76,33],[-13,29],[29,56],[61,61],[-3,27],[40,99],[33,49],[48,10],[18,115],[79,73],[-16,41],[-102,38],[3,37],[-78,127],[19,29],[-45,94],[-59,46],[193,43],[164,16],[69,17],[199,10],[96,18],[119,45],[51,6],[123,-25],[51,-70],[233,-109],[116,-25],[148,-14],[19,-63],[-26,-96],[58,4],[43,55],[10,92],[199,51],[120,-22],[117,-48],[137,-113],[119,-114],[152,-137],[114,-99],[8,-40],[-142,-101],[-111,-33],[-125,-53],[-93,-70],[-127,-51],[-155,-111],[-197,-108],[-123,-87],[-44,-176],[-34,-40],[-94,-69],[-95,7],[-14,-106],[-68,-86],[7,-56],[-16,-107],[21,-32],[-27,-94],[-52,-56],[-183,-77],[-25,0],[-46,59],[-56,-14],[-36,-33],[-32,-62],[-62,-44],[-75,-30],[-76,-87],[-88,-7],[-93,104],[-54,197],[-51,26],[-44,97],[-59,47],[-120,43],[-147,91],[-17,44],[-163,-19],[-51,7],[-7,8]],[[16486,95045],[86,50],[-21,44],[73,36],[99,125],[117,60],[45,89],[138,37],[272,3],[142,-56],[172,72],[-98,11],[-16,26],[93,69],[72,15],[99,-38],[177,-121],[-22,-48],[-76,-11],[-137,-86],[9,-66],[144,-70],[-60,-34],[-87,37],[18,-70],[56,-17],[34,-93],[-54,-55],[-121,-39],[-79,4],[-72,-20],[36,-114],[-8,-29],[-100,-63],[-64,10],[-133,99],[-4,54],[25,142],[42,29],[-131,43],[-55,-76],[31,-62],[-66,-64],[-41,30],[-60,-43],[78,-20],[34,-87],[-30,-33],[-79,-26],[21,-55],[-69,-63],[-53,36],[-13,68],[-34,60],[-70,-36],[46,-52],[-66,-62],[60,-16],[28,-53],[-58,-32],[-10,-54],[-162,-57],[-51,17],[25,95],[-89,45],[-4,70],[-81,23],[-8,-56],[31,-52],[-81,-22],[-190,57],[-52,-15],[-14,-38],[-61,-40],[-62,8],[-21,51],[63,63],[-51,59],[-61,-1],[63,68],[1,42],[70,48],[104,35],[41,-17],[94,19],[63,115],[55,45],[118,53]],[[16937,94337],[79,66],[9,27],[167,95],[49,18],[40,48],[95,-15],[-29,-75],[-91,-117],[-17,-52],[-99,-127],[-63,-35],[-57,-7],[-50,42],[-131,15],[19,47],[79,70]],[[15679,74813],[45,84],[8,-100],[24,-35],[-27,-40],[-25,10],[-24,-59],[-33,-13],[-26,35],[-35,8],[-88,54],[-47,38],[-95,59],[-27,49],[-79,43],[-24,62],[50,75],[-17,36],[-35,31],[-13,-44],[-33,47],[-36,-65],[-76,109],[-33,13],[-1,27],[22,-6],[17,-24],[11,64],[-19,-19],[6,60],[-40,35],[-31,-29],[-20,113],[-12,23],[-29,-19],[-17,-37],[-39,67],[-37,-31],[-1,127],[40,43],[-20,38],[-28,4],[-8,28],[-8,52],[0,64],[-7,-24],[-22,8],[-13,22],[-6,-19],[-61,-20],[-30,4],[-22,86],[22,61],[-32,41],[-5,-48],[-38,-15],[-26,71],[-36,11],[-46,-49],[-30,26],[35,78],[-23,86],[-26,29],[22,51],[57,26],[33,-9],[2,54],[-65,-43],[-49,-17],[-39,1],[-26,39],[-10,45],[-48,110],[2,25],[40,17],[45,49],[43,4],[77,-44],[62,-48],[7,-36],[61,-58],[61,-25],[88,-50],[15,-19],[80,-3],[65,-22],[39,-42],[65,-24],[37,8],[35,-31],[12,-39],[14,-101],[32,-65],[17,-90],[19,-23],[69,-135],[-12,-49],[12,-58],[19,-46],[31,-23],[16,-33],[47,-34],[25,0],[32,-35],[33,-12],[7,-23],[44,-20],[9,-68],[28,1],[20,-67],[-3,-60],[33,-68],[13,-11],[8,-35],[-9,-45],[18,-48],[4,-73],[-11,-23]],[[15707,75478],[21,49],[17,-41],[-38,-8]],[[15674,75064],[57,-82],[-36,-41],[-18,33],[5,23],[-7,18],[-1,49]],[[15496,75652],[33,48],[10,-23],[-8,-64],[-35,39]],[[15379,75683],[20,10],[57,-40],[31,-77],[11,-52],[-53,54],[-35,64],[-31,41]],[[15332,76028],[19,57],[26,-55],[-19,-51],[-26,49]],[[15283,76039],[17,42],[36,-15],[-9,-47],[19,-43],[-15,-31],[-48,94]],[[15290,75980],[17,-16],[-9,-55],[-38,31],[30,40]],[[15185,76132],[14,50],[28,-40],[12,-41],[-71,-27],[-3,31],[20,27]],[[15174,76058],[36,-7],[22,-22],[5,-34],[-21,-49],[-35,15],[-7,97]],[[15185,76158],[-14,-33],[-29,-9],[-10,24],[36,53],[17,-35]],[[15067,76152],[65,31],[-20,-44],[-41,-6],[-4,19]],[[15009,76179],[37,23],[12,-45],[-49,22]],[[15020,75292],[10,27],[32,-9],[-6,-22],[2,-48],[-19,5],[-2,31],[-17,16]],[[14943,75341],[-10,43],[3,44],[40,-15],[-3,-88],[-30,16]],[[14882,76440],[40,20],[19,-46],[-16,-82],[-81,-7],[-16,18],[15,49],[39,48]],[[14876,76262],[42,39],[12,-51],[-46,-18],[-8,30]],[[14815,76455],[-36,-42],[-30,50],[54,4],[12,-12]],[[14751,75752],[34,24],[7,-19],[8,10],[14,-9],[3,-46],[8,-35],[-6,-12],[10,-91],[-59,15],[-20,42],[-20,91],[21,30]],[[14681,76330],[77,4],[-5,-27],[-72,23]],[[14601,77570],[56,29],[6,-70],[-29,-44],[-33,-15],[-57,-73],[-21,-125],[-50,-18],[4,109],[32,110],[40,11],[42,42],[10,44]],[[14491,76490],[29,29],[16,-57],[-45,28]],[[14401,77039],[54,4],[13,-27],[11,-100],[-21,-11],[-38,19],[-19,115]],[[14442,77402],[35,9],[-16,-59],[-44,8],[-10,43],[35,-1]],[[14441,77469],[27,4],[6,-43],[-40,-7],[7,46]],[[14426,77330],[30,13],[3,-45],[-20,-132],[-51,15],[0,93],[13,51],[25,5]],[[14400,77548],[22,45],[9,-68],[-22,-26],[-9,49]],[[14395,77431],[12,-73],[-31,-4],[-14,24],[15,48],[18,5]],[[14388,77853],[-2,-64],[-17,-9],[-17,43],[2,34],[34,-4]],[[14351,77353],[-6,43],[-40,15],[18,56],[44,0],[-17,-47],[1,-67]],[[14320,77825],[16,49],[29,-92],[-2,-108],[-40,16],[-3,135]],[[14235,77698],[1,26],[33,9],[14,-6],[0,20],[12,10],[20,-120],[-9,-31],[-35,27],[-46,17],[10,48]],[[14142,78206],[15,29],[31,-14],[97,-140],[14,-93],[-6,-116],[-9,-50],[2,-33],[-8,-58],[-10,5],[-33,-9],[4,53],[-19,15],[-21,-32],[-33,35],[-31,71],[-4,89],[-20,31],[8,77],[25,17],[-2,123]],[[14257,77491],[-18,45],[-7,99],[38,-8],[0,-108],[-13,-28]],[[14152,78499],[49,29],[5,-78],[-13,-35],[-25,7],[-49,-89],[-1,131],[34,35]],[[14147,78323],[23,28],[19,-53],[-22,-43],[-43,1],[23,67]],[[14082,77842],[11,47],[42,-59],[52,-98],[-5,-94],[-39,36],[-40,88],[-21,80]],[[14089,78194],[30,25],[9,-120],[-24,-20],[-28,16],[-5,68],[18,31]],[[14012,78118],[20,32],[25,-72],[20,-27],[-6,-63],[-59,130]],[[13807,78623],[26,45],[22,-16],[52,-89],[25,-30],[40,-91],[69,-112],[5,-27],[-23,-133],[-20,-4],[-29,77],[-42,61],[-17,40],[12,44],[-55,56],[-12,73],[-28,14],[-3,65],[-22,27]],[[13982,78043],[28,-45],[-20,-16],[-8,61]],[[13775,78377],[-38,32],[1,55],[25,3],[96,-84],[58,-93],[40,-121],[-52,-37],[-44,76],[-4,36],[-53,45],[-30,60],[1,28]],[[13804,78545],[51,-32],[1,-92],[-58,35],[-23,41],[29,48]],[[13808,79409],[25,61],[13,-53],[-34,-88],[-38,-47],[-21,44],[55,83]],[[13767,78775],[30,1],[28,-79],[-30,-54],[-1,-34],[-37,8],[-30,63],[-40,9],[53,88],[27,-2]],[[13730,79271],[35,18],[-8,-52],[-27,34]],[[13665,78861],[15,17],[25,-33],[-20,-26],[-20,42]],[[13628,79165],[14,19],[38,-23],[-6,-33],[-53,-71],[-3,69],[10,39]],[[13575,77375],[3,30],[50,-53],[-28,-15],[-25,38]],[[13607,77433],[-63,-48],[-42,52],[-53,115],[-22,87],[-33,24],[-45,91],[-28,33],[-60,106],[-24,85],[45,10],[-20,39],[-77,20],[-12,29],[24,28],[113,17],[44,61],[43,-26],[44,-122],[-14,-20],[12,-51],[-21,-39],[-35,-5],[5,-89],[31,-82],[11,-66],[39,-13],[47,-152],[23,-12],[22,23],[25,-25],[3,-52],[18,-18]],[[13414,77792],[72,18],[-4,-65],[-39,-30],[-29,77]],[[13040,78844],[4,20],[60,-40],[46,18],[21,-24],[5,-59],[35,43],[35,9],[18,-52],[27,-38],[13,-75],[-43,-83],[-41,-14],[-40,-53],[99,0],[-6,71],[30,54],[5,40],[-23,93],[51,-1],[55,31],[38,58],[-17,-141],[-47,-137],[2,-47],[-22,-134],[13,-61],[-17,-110],[-58,-24],[13,-34],[-27,-36],[-67,-7],[-33,44],[-13,85],[27,36],[3,35],[-32,8],[-36,29],[-32,1],[-14,35],[-2,101],[-21,78],[-27,8],[-9,79],[12,88],[14,16],[-12,65],[13,25]],[[11303,89889],[55,57],[57,-24],[-52,-61],[-60,28]],[[34338,73760],[36,-21],[-18,-56],[0,-42],[20,-41],[-22,-32],[-7,48],[5,57],[-14,87]],[[33189,48126],[-5,-47],[-29,-45],[-28,-8],[-12,-33],[-13,10],[17,55],[20,44],[30,29],[20,-5]],[[32928,47553],[10,50],[-36,62],[-31,3],[14,48],[51,7],[18,39],[31,-14],[17,3],[51,34],[24,-7],[-7,-50],[-25,-57],[7,-117],[-8,-36],[12,-120],[-2,-71],[-16,-66],[-28,-27],[-36,7],[-18,-11],[-62,1],[-13,-11],[-19,22],[-31,0],[-5,34],[36,23],[17,34],[28,12],[22,50],[-10,61],[9,97]],[[31430,40885],[-8,53],[7,51],[-15,35],[-4,87],[-30,177],[-10,100],[-16,41],[7,50],[-4,60],[-11,-5],[-19,90],[9,69],[-8,32],[-22,34],[-26,95],[-22,35],[-6,31],[-21,1],[1,42],[-14,62],[-10,-11],[-28,29],[-20,-8],[-11,28],[147,337],[6,41],[-8,42],[-16,18],[-13,79],[2,33],[-14,81],[-31,4],[-25,132],[-4,77],[-26,144],[10,79],[-10,88],[-16,33],[2,88],[7,51],[-5,161],[9,83],[-13,59],[8,43],[-10,51],[16,62],[48,79],[8,51],[-10,85],[3,59],[9,65],[15,43],[16,24],[21,53],[-22,85],[5,47],[-7,40],[-33,42],[-39,1],[-14,23],[-23,-30],[-8,-34],[-35,-30],[-5,21],[-26,6],[-24,-23],[-5,-25],[-60,15],[-19,-28],[-12,13],[-28,-28],[-43,38],[-25,-7],[-31,38],[-44,-69],[-10,-44],[-17,0],[-15,56],[-21,-27],[-79,257],[-112,369],[-30,-4],[-27,-28],[-30,52],[-20,-2],[-13,50],[-17,-8],[-22,24],[-20,0],[-34,-23],[-16,-36],[-23,-29],[-25,12],[-4,29],[-31,-13],[-27,2],[-26,16],[-6,-18],[-36,27],[-34,-13],[-15,26],[-18,-25],[-33,-13],[-30,19],[-34,150],[5,53],[-19,50],[-8,-12],[-48,16],[-14,63],[6,49],[-7,64],[3,107],[6,43],[-11,64],[28,64],[8,94],[-10,68],[0,69],[-10,18],[-52,152],[-11,19],[-30,327],[-14,43],[-20,-3],[-13,-35],[-12,38],[4,34],[-9,63],[-22,-6],[-29,-62],[-21,-13],[-32,10],[28,110],[2,36],[19,50],[-2,22],[20,57],[11,0],[9,88],[30,113],[-15,62],[13,75],[14,146],[-1,88],[4,67],[13,29],[5,54],[24,65],[9,75],[16,78],[20,33],[26,132],[39,39],[27,-5],[77,360],[47,24],[53,48],[64,47]],[[30172,48479],[-1,-45],[-16,-22],[-86,-42],[-56,-48],[-4,-43],[5,-107],[16,-102],[35,-110],[-2,-28],[-24,-37],[17,-23],[17,3],[8,-78],[12,-64],[19,-41],[2,-41],[-11,-94],[-3,-62],[-42,-82],[-14,-86],[-16,-54],[-20,-9],[-23,-148],[-20,-76],[41,-140],[4,-96],[42,-46],[18,-57],[-12,-67],[11,-15],[-1,-63],[15,-51],[21,7],[21,-24],[60,41],[29,47],[12,54],[36,64],[-3,113],[-5,48],[9,66],[4,72],[-11,69],[-18,76],[-19,23],[-16,115],[-27,65],[-19,96],[-13,23],[5,71],[-20,40],[3,129],[-17,52],[42,-3],[-2,55],[18,61],[58,42],[90,129],[36,23],[55,9],[9,36],[14,-7],[44,54],[24,5],[11,36],[23,29],[5,40],[27,11],[39,-74],[24,53],[-21,134],[-17,2],[-89,-57],[-15,21],[8,87],[-20,44],[-4,62],[21,103],[3,40],[16,4],[35,64],[26,-20],[10,-23],[19,-96],[7,-137],[23,-161],[13,-52],[20,-42],[23,35],[42,-15],[22,36],[22,-23],[31,-14],[11,-31],[30,7],[32,-4],[18,-51],[31,-22],[15,-44],[19,-11],[21,-61],[19,-23],[23,-120],[-7,-49],[0,-78],[11,-96],[32,-114],[66,-44],[9,14],[55,25],[25,-1],[41,25],[26,-3],[60,19],[38,39],[23,-11],[27,17],[14,-8],[83,14],[24,-1],[16,-17],[19,29],[57,-50],[-9,-54],[49,-119],[-4,-24],[45,-66],[23,12],[81,-67],[25,-52],[16,23],[25,-2],[16,-31],[45,36],[37,-8],[28,27],[7,57],[17,27],[46,6],[19,25],[-4,34],[20,11],[9,45],[21,3],[13,46],[37,-26],[27,9],[44,-10],[18,42],[-24,37],[-26,3],[-9,18],[-61,-6],[-27,-18],[-10,62],[29,6],[16,-18],[25,25],[33,-18],[44,28],[22,-16],[43,-11],[40,42],[29,-15],[33,32],[33,6],[40,-19],[41,33],[45,3],[70,-21],[18,-15],[32,-6],[68,34],[7,-41],[-17,-21],[-35,-10],[-47,4],[-21,-70],[-18,16],[-11,-18],[-26,7],[-59,44],[-23,-37],[-42,-15],[-19,-62],[12,-84],[13,-50],[10,22],[-10,74],[31,-12],[19,-55],[11,18],[16,-35],[3,-89],[28,11],[22,-63],[11,-89],[21,-54],[5,-46],[10,-41],[-14,-38],[-15,-98],[33,109],[14,90],[2,95],[13,20],[31,-19],[45,-76],[19,-67],[13,25],[48,-34],[18,0],[5,29],[28,-37],[30,-89],[25,-31],[62,-34],[14,-27],[-4,-60],[-3,-8],[-1,-2],[0,-4],[1,-45],[-5,-11],[-12,-14],[-5,-1],[-1,-1],[-1,-6],[-5,-50],[1,-33],[3,-5],[2,20],[2,-1],[2,1],[4,6],[9,6],[11,11],[3,6],[4,11],[5,37],[1,33],[-2,30],[3,14],[0,15],[-2,40],[17,-15],[16,-41],[11,-61],[-11,-38],[-45,-60],[-13,-29],[-18,2],[-35,-51],[-5,7],[-1,4],[-3,-2],[-28,-62],[-3,-29],[-8,-14],[-2,11],[-5,-6],[-4,8],[-20,-31],[-6,-31],[-11,-15],[0,-12],[-1,-8],[-3,-10],[0,-10],[-4,-10],[-10,-4],[-9,-10],[-9,-25],[-4,-15],[-8,2],[-10,-10],[-40,25],[-16,-6],[-2,-6],[2,-10],[0,-6],[-4,-1],[-2,-7],[-2,-11],[-15,-2],[13,-16],[11,-20],[20,-3],[45,-27],[10,9],[30,-23],[47,-60],[16,8],[7,-18],[3,-27],[21,-4],[4,25],[26,26],[36,8],[8,35],[23,34],[34,-6],[17,15],[36,-49],[38,-9],[13,33],[31,-19],[22,1],[33,-37],[14,-42],[35,-43],[33,-53]],[[33386,45966],[-31,50],[-37,46],[-13,41],[-34,38],[-20,-1],[-36,30],[17,29],[55,-10],[32,-30],[20,-40]],[[33107,46208],[9,41],[26,-3],[4,-39],[-39,1]],[[33034,46325],[14,19],[35,1],[-4,-37],[-18,-47],[-23,5],[-28,-29],[-4,21],[28,67]],[[33071,46452],[13,33],[14,-29],[-13,-63],[-10,-19],[-38,-35],[34,113]],[[33068,46506],[7,-19],[-19,-46],[-1,-31],[-17,-55],[-12,-14],[1,27],[-3,12],[3,13],[0,16],[6,36],[16,12],[19,49]],[[33071,46587],[26,12],[-5,-65],[-26,-18],[5,71]],[[33048,46250],[-10,-46],[-21,8],[6,39],[25,-1]],[[33065,46808],[9,-37],[0,-11],[-3,-11],[0,-12],[2,-18],[-5,-41],[-3,-37],[-8,-15],[-13,-9],[-9,-12],[-3,1],[-1,-1],[0,-4],[-4,16],[5,44],[-1,12],[1,5],[8,4],[10,13],[5,13],[-1,21],[2,13],[0,5],[-2,7],[4,9],[3,42],[4,3]],[[32956,46444],[3,24],[17,3],[-3,24],[7,10],[4,22],[3,2],[7,-12],[39,50],[11,-5],[15,26],[-5,-89],[-15,-24],[-17,-65],[-5,4],[-14,-15],[-2,-15],[-4,-8],[0,-9],[-9,0],[-5,-6],[-4,-12],[-15,-14],[-5,-20],[-9,2],[-27,-19],[-8,23],[1,2],[1,4],[2,7],[0,9],[-1,8],[9,18],[12,58],[6,-1],[2,-2],[2,5],[4,7],[3,8]],[[33014,46148],[15,42],[30,-14],[-11,-51],[-19,-3],[-15,26]],[[32978,46105],[6,47],[11,10],[34,-41],[-7,-20],[-21,15],[-5,-13],[-8,8],[-10,-6]],[[32878,46227],[38,73],[23,-9],[11,25],[9,-2],[5,21],[16,15],[8,16],[6,-3],[3,4],[0,9],[3,2],[2,7],[2,15],[13,12],[6,-2],[3,-15],[-4,-11],[4,-15],[-2,-40],[-24,-87],[-3,-69],[-14,-13],[-43,23],[-12,-19],[-30,6],[-20,57]],[[32929,46155],[51,-1],[3,-11],[-5,-21],[-1,-20],[3,-2],[8,8],[13,-18],[-14,-11],[-18,18],[-8,-18],[-4,17],[-19,-7],[0,54],[-9,12]],[[32870,46220],[-14,-32],[-38,-5],[-27,22],[-6,11],[-4,13],[-3,7],[3,8],[3,1],[0,5],[16,23],[27,-25],[7,-2],[7,3],[17,8],[5,18],[9,13],[9,19],[8,3],[5,11],[4,24],[0,5],[1,11],[8,11],[6,17],[2,15],[15,-1],[-3,-32],[-11,-24],[2,-2],[1,-9],[-4,-14],[-4,-5],[-6,-4],[-3,-6],[-4,-40],[-28,-47]],[[32692,46993],[3,27],[-7,23],[4,74],[16,-45],[-16,-79]],[[32518,47514],[22,-19],[-41,-31],[-2,32],[21,18]],[[32248,48003],[17,-15],[18,-89],[-16,-32],[-46,-59],[-28,25],[-12,43],[28,5],[10,64],[29,58]],[[32224,47745],[24,2],[-3,-40],[-21,38]],[[32165,47936],[10,-54],[-11,-33],[-53,28],[4,51],[32,13],[18,-5]],[[31883,47852],[3,-25],[-28,-9],[-23,48],[27,14],[21,-28]],[[99897,77205],[-30,20],[-11,61],[45,30],[32,-56],[-36,-55]],[[99633,77045],[61,-23],[51,-89],[36,-37],[19,-36],[-13,-30],[-58,100],[-52,65],[-21,-3],[-23,53]],[[99256,77176],[-34,36],[35,37],[12,32],[30,4],[30,109],[21,-46],[-38,-71],[-50,-48],[-6,-53]],[[98256,77559],[-71,11],[-24,38],[41,11],[41,45],[13,-105]],[[98029,77832],[-10,38],[-32,9],[6,44],[-31,4],[-8,34],[-35,-16],[-13,19],[45,50],[39,8],[98,-14],[13,-27],[38,-21],[-38,-92],[-44,14],[-28,-50]],[[31310,72415],[33,-24],[31,-123],[3,-31],[-24,-17],[-3,-38],[44,-5],[0,-1],[0,-34],[-36,-71],[-35,-53],[-44,35],[-2,-63],[-39,31],[-7,-80],[-27,10],[-22,-12],[-28,34],[-14,-66],[1,-55],[-51,-14],[-23,82],[-15,10],[-11,-72],[18,-33],[-6,-51],[-25,-7],[-12,-47],[-25,58],[-7,103],[-28,-31],[-3,-62],[-35,-13],[-14,23],[-22,-15],[2,83],[-22,18],[-27,-21],[11,-70],[-30,-83],[-10,-89],[11,-11],[-43,-95],[-39,34],[-22,3],[-8,-61],[-43,-44],[-16,20],[-8,50],[-27,-44],[2,-63],[-23,0],[-1,58],[-39,-8],[-48,-80],[-18,-53],[16,-76],[-45,-27],[-2,-67],[-26,-67],[-21,-3],[-16,-66],[5,-22],[-64,-217],[-4,-58],[6,-45],[-7,-43],[19,-53],[36,40],[6,-41],[-26,-42],[-45,-23],[-9,-60],[-24,-25],[-19,-88],[29,-38],[37,9],[22,-37],[26,-89],[-10,-19],[7,-79],[27,-16],[11,-101],[-14,-11],[-7,-17],[-19,-5],[-20,-13],[-20,-66],[-36,-17],[-3,-48],[-28,-32],[-17,6],[-25,-33],[-62,51],[-1,-41],[-15,-61],[-67,-41],[-32,-10],[-39,25],[-39,-37],[-20,18],[-22,-30],[-82,-17],[-16,9],[-97,-15],[-46,-75],[-11,16],[-26,-37],[-30,-6],[-44,-64],[-17,2],[-27,-55],[-22,-21],[-14,-74],[-24,-6],[-19,-44],[-2,-23],[-24,-10],[-7,-32],[10,-38],[-16,-37],[-42,-60],[36,-5],[40,-36],[3,-79],[-14,-122],[-11,-133],[-13,5],[-5,-61],[-21,-94],[-1,-42],[-21,-21],[-22,-66],[-26,-13],[8,-40],[-15,-63],[22,-19],[-38,-37],[-27,-66],[-7,11],[-29,-78],[14,-17],[-18,-74],[-22,-43],[-27,-6],[2,49],[25,87],[0,49],[-30,16],[-9,23],[-44,9],[-27,76],[-30,7],[-8,43],[-20,22],[-12,84],[-16,33],[36,110],[-8,5],[-26,-93],[-14,-26],[13,-42],[-12,-75],[35,-122],[15,-83],[4,-81],[20,-26],[3,-66],[35,-75],[33,-23],[11,-235],[-10,-102],[-41,-55],[-21,-94],[-12,-13],[-7,-62],[-15,-31],[-58,-222],[-23,-67],[-30,-64],[-24,-113],[-8,-134],[-19,55],[-1,86],[26,196],[69,175],[-1,69],[-10,36],[-34,-27],[-6,25],[24,64],[-19,73],[13,41],[-24,32],[14,61],[-28,30],[-21,-2],[-21,21],[-17,-54],[-27,33],[-14,46],[23,71],[46,-5],[-4,32],[-43,54],[0,88],[14,53],[-19,64],[19,27],[3,52],[-23,-8],[-12,58],[25,122],[21,39],[23,9],[13,103],[-29,14],[-4,-75],[-36,-67],[-19,-15],[-11,32],[-19,-88],[-22,-62],[14,-28],[-6,-47],[17,-34],[-22,-20],[-11,-38],[1,-94],[-14,-24],[14,-109],[-1,-64],[9,-38],[28,-62],[-6,-55],[6,-69],[17,-55],[-2,-55],[-40,67],[-19,-2],[-15,46],[-26,19],[-18,-14],[-15,22],[-6,69],[-56,-27],[19,-39],[-1,-31],[61,-55],[22,8],[35,-52],[6,-35],[30,-46],[19,-12],[28,-46],[-3,-35],[-19,-27],[-13,-130],[1,-65],[31,-62],[-6,-77],[-32,42],[-7,-34],[7,-53],[-10,-32],[43,-96],[-40,-90],[-15,47],[-28,41],[-22,96],[-24,-5],[-40,33],[-4,-42],[24,5],[17,-41],[20,25],[1,-90],[22,-21],[28,-59],[-6,-41],[54,-2],[-3,50],[65,-35],[28,7],[9,-90],[20,-122],[21,-209],[23,-141],[20,-82],[16,-106],[-27,28],[-22,-3],[12,-60],[4,-83],[-17,-17],[12,-42],[-41,-34],[-28,-48],[-27,-96],[-17,-25],[-21,4],[-53,69],[-8,-21],[-44,-18],[-32,28],[-2,-39],[17,-25],[19,-70],[-9,-58],[7,-62],[-32,-50],[-52,-39],[38,-25],[29,48],[37,5],[48,-52],[-19,-61],[-24,-33],[0,-38],[-32,35],[-1,-45],[-70,-23],[-51,-24],[-16,24],[-45,-87],[-23,-9],[-7,-28],[-36,-34],[-51,-87],[-24,-68],[-20,-72],[-14,-116],[-30,-51],[-42,9],[-60,-12],[-41,-24],[-51,-58],[-29,-44],[-56,-121],[-47,-155],[-3,-38],[-16,-28],[-4,-48],[-18,-51],[-65,-63],[-29,-83],[-52,-102],[-16,8],[-9,-73],[-15,63],[-25,14],[-36,-76],[-14,-9],[-5,-15],[-8,-5],[-16,-21],[-5,2],[-3,-4],[-3,-6],[-1,14],[6,0],[2,12],[-2,-1],[-1,-8],[-4,-1],[-2,-3],[1,-13],[3,-1],[6,10],[1,-6],[-3,-11],[-7,-35],[-11,-10],[-61,59],[5,-65],[17,-20],[0,-66],[17,19],[8,-33],[-32,-62],[0,53],[-60,-4],[0,-59],[34,-10],[16,-41],[-15,-40],[-18,52],[-19,-12],[-27,-65],[0,-75],[-25,-24],[-28,-43],[-8,36],[-20,-17],[0,-44],[20,5],[-10,-88],[-21,33],[-1,-60],[-15,-19],[18,-86],[-15,-22],[-3,-48],[-26,-129],[13,-20],[-23,-85],[-11,-82],[-15,-60],[16,-22],[-10,-85],[10,-44],[-10,-25],[5,-60],[23,-23],[2,-58],[11,-92],[0,-53],[23,-243],[13,-91],[3,-54],[25,-160],[54,-294],[70,-274],[39,-128],[15,-95],[-12,-17],[-10,-54],[0,-62],[8,-106],[-14,6],[45,-233],[32,-131],[-8,-24],[20,-136],[58,-281],[12,-93],[1,-110],[5,-19],[-3,-110],[-20,-367],[-4,-193],[-14,7],[-17,-34],[-30,-142],[5,-79],[-6,-164],[-18,6],[-8,64],[-34,-5],[-14,-28],[-18,6],[-31,46],[-21,11],[-11,40],[-22,-11],[-4,35],[-22,11],[-22,84],[30,6],[-21,45],[-14,67],[-58,118],[-53,47],[-42,-25],[7,51],[-13,63],[-14,20],[-7,125],[-11,86],[-25,43],[-22,70],[-20,7],[-7,58],[19,-1],[-2,64],[11,76],[-15,66],[-27,35],[-8,-10],[12,-89],[-33,4],[-15,67],[-27,85],[3,21],[-22,110],[-18,60],[-32,80],[-5,47],[28,13],[6,38],[-16,21],[-11,77],[-17,13],[-24,71],[-7,44],[13,50],[10,93],[-6,74],[11,30],[6,71],[18,87],[8,242],[-1,89],[-18,17],[-12,86],[-12,17],[-4,53],[-40,25],[-21,-13],[-11,19],[-3,53],[-24,42],[-22,85],[-12,-6],[-27,50],[-7,116],[-37,42],[-26,111],[-42,70],[-38,39],[-29,50],[-69,-31],[-14,11],[-12,-34],[9,-85],[-29,14],[-26,-14],[-65,-90],[-28,-2],[-68,-47],[-55,-21],[3,80],[-17,69],[-16,38],[-16,6],[-19,51],[-24,30],[-24,79],[-12,-24],[-34,52],[-56,60],[-48,37],[-37,18],[-62,12],[-78,-15],[-73,-34],[-10,64],[-21,-27],[1,-25],[-39,-31],[-70,-37],[-25,24],[-28,68],[-16,23],[-8,53],[9,40],[-5,92],[-25,12],[-10,-18],[-18,-155],[2,-46],[-23,-10],[-42,29],[-15,-40],[-31,-21],[-30,38],[-37,-18],[-31,32],[-40,-4],[-67,-53],[-18,45],[-6,-53],[-25,-36],[-22,-50],[-9,9],[-51,-20],[-22,31],[-16,-39],[15,-70],[-34,-39],[30,-64],[53,-56],[-4,-44],[-16,-28],[-37,-21],[11,-42],[-3,-35],[28,-64],[30,-24],[29,-113],[-49,65],[-19,67],[-23,-33],[-19,19],[-2,40],[-33,83],[-17,-15],[-28,119],[-18,49],[-5,-71],[-28,-36],[-5,19],[-1,13],[-4,2],[-6,14],[-48,120],[-6,-52],[30,-13],[2,-53],[9,-3],[23,-17],[3,-37],[8,-48],[33,10],[15,-46],[-19,-41],[3,-71],[39,8],[-45,-81],[-11,40],[-18,6],[-9,58],[-33,-20],[-17,4],[-17,-75],[-1,-49],[-16,-23],[-18,65],[-7,-59],[-17,-15],[-26,39],[5,65],[-23,-4],[-26,-52],[-26,40],[-22,59],[-3,61],[32,18],[17,-19],[6,-12],[1,-14],[5,7],[9,4],[4,5],[3,-22],[9,3],[1,60],[-7,32],[-27,8],[-39,46],[-7,-22],[-23,-15],[-23,9],[-37,43],[-14,34],[-50,3],[-21,58],[-37,-6],[-45,-37],[-19,-29],[37,-115],[-17,2],[-32,-34],[-24,-4],[-79,37],[-29,21],[-66,72],[-13,42],[31,-4],[8,50],[17,11],[37,-20],[17,-37],[3,-35],[43,-39],[17,34],[-1,39],[-44,31],[-19,-16],[-12,60],[1,38],[-37,32],[-47,-35],[13,-19],[18,25],[19,-12],[-26,-56],[-13,-47],[-25,1],[-12,-24],[-41,23],[-39,-8],[4,55],[23,7],[2,55],[-23,53],[-14,-84],[8,-88],[-32,7],[-83,-28],[-22,-26],[-14,45],[-36,19],[8,24],[2,32],[-9,-13],[6,-10],[-6,-27],[-40,-72],[-55,-57],[-17,-14],[0,-16],[-30,-16],[-11,19],[-55,-36],[17,84],[4,95],[-8,13],[-27,-23],[-15,-59],[-21,15],[-20,-48],[-1,-54],[37,-127],[40,-39],[-88,-140],[-89,-181],[-24,-6],[-21,-41],[-29,-35],[-62,-9],[-16,-28],[-49,-61],[-15,-6],[-16,27],[-25,-6],[-30,15],[-1,-32],[-40,16],[-9,-44],[19,-20],[28,-87],[-58,-64],[-19,-2],[-3,46],[-20,35],[-21,-27],[18,-43],[-5,-47],[7,-36],[-40,-79],[-5,43],[-17,4],[-45,-48],[-14,-39],[19,-30],[20,25],[9,-32],[-40,-145],[-16,38],[-36,-27],[4,-71],[30,-30],[3,-43],[32,84],[-47,-244],[-14,-104],[-7,-112],[0,-101],[9,-144],[19,-148],[-17,1],[-37,175],[6,79],[15,38],[3,172],[7,110],[31,156],[-21,-10],[-22,-170],[-22,6],[-24,-16],[-35,10],[16,-64],[29,-11],[30,25],[-7,-74],[0,-77],[-6,-170],[0,-75],[15,-141],[-5,-21],[24,-57],[3,-77],[9,-38],[0,-58],[11,-58],[27,5],[-9,117],[-16,121],[-18,95],[14,5],[25,-232],[7,-118],[-15,-9],[18,-75],[-1,-3],[-36,-4]],[[22978,58615],[-25,-23],[-1,-54],[-15,1],[-49,84],[-12,50],[-28,-1],[-36,27],[-45,-16],[-59,22],[-53,90],[-40,43],[-22,-16],[-24,43],[-15,52],[-23,-8],[-24,32],[-38,18],[5,36],[-21,44],[-11,134],[-9,15],[-8,70],[-51,157],[7,21],[-4,114],[-15,16],[-3,45],[8,103],[-14,13],[4,53],[-25,50],[-30,12],[-15,51],[-30,48],[-5,74],[-27,67],[-8,51],[-19,60],[-35,35],[-23,63],[3,18],[-18,65],[3,30],[-20,77],[3,27],[-28,54],[-2,56],[-40,145],[2,31],[-11,89],[-22,37],[-10,62],[-57,84],[-16,67],[-25,14],[-23,33],[-8,76],[-23,23],[-18,78],[-70,0],[-30,12],[-53,7],[-31,-8],[-20,13],[-43,53],[-11,-6],[-19,-76],[-22,16],[-40,-37],[-17,-42],[-28,-103],[-11,-71],[-2,-53],[-11,-15],[-7,-54],[10,-29],[-36,-35],[-13,-56],[-30,-89],[-65,38],[-38,81],[-32,17],[-38,42],[-2,33],[-66,33],[-40,58],[-12,63],[-55,68],[-30,46],[-14,94],[-32,107],[-8,93],[6,93],[-20,87],[-28,64],[-3,86],[-14,67],[-14,5],[-10,54],[-12,-3],[-17,44],[-27,39],[-13,-2],[-83,139],[-14,69],[-46,58],[-27,89],[-17,17],[-7,37],[-34,24],[-40,59],[-45,181],[-40,36],[-176,0],[-157,0],[-134,0],[0,-323],[-245,0],[-182,1],[-198,-1],[-171,0],[-130,107],[-185,151],[-263,208],[-166,134],[-295,233],[1,87],[25,74],[-210,-38],[-284,-57],[-174,-37]],[[17465,63339],[-13,127],[-23,-9],[1,127],[-8,98],[-14,78],[-44,139],[-52,103],[-11,0],[-19,59],[-29,48],[-32,33],[-40,74],[-21,-1],[-18,-37],[-39,50],[10,46],[-16,83],[-21,55],[-59,1],[-20,-22],[-113,103],[-21,93],[-27,30],[-18,38],[-45,36],[-32,-17],[-15,14],[-26,-7],[-35,38],[-35,9],[-94,-16],[-12,53],[-37,39],[12,92],[-10,35],[8,64],[-17,42],[9,75],[2,71],[-19,47],[-43,24],[-11,49],[14,50],[-17,75],[-28,11],[-27,63],[-18,61],[-32,21],[-14,85],[-35,71],[-15,89],[-22,41],[-35,94],[-32,38],[-16,66],[-22,166],[10,47],[21,-20],[12,50],[9,93],[-21,83],[-21,38],[-10,-17],[-37,1],[-29,46],[-22,60],[-14,10],[-18,55],[-4,38],[4,80],[-18,101],[-14,16],[7,101],[-10,112],[-36,62],[-11,-8],[-44,87],[-21,14],[-22,-24],[22,151],[-38,103],[-17,68],[-57,83],[-36,110],[-50,90],[-22,81],[9,45],[-8,82],[-11,41],[-19,112],[7,96],[10,55],[-7,93],[-10,24],[-7,79],[-51,131],[-20,63],[-70,110],[4,42],[-17,92],[6,49],[28,126],[39,156],[9,91],[-14,70],[10,27],[18,198],[-11,114],[-13,84],[-27,37],[14,123],[-5,43],[-38,70],[-3,58],[-14,50],[-7,134],[12,86],[-5,72],[-27,65],[-11,67],[21,88],[20,157],[3,98],[25,31],[-2,28],[21,116],[17,167],[13,222],[3,99],[8,121],[7,172],[-4,103],[13,69],[15,188],[-1,131],[11,61],[-10,30],[14,158],[-13,56],[8,230],[-7,45],[32,31],[-37,84],[-23,23],[39,57],[-5,50],[13,43],[-17,45],[10,44],[19,21],[-10,35],[-32,-30],[-26,26],[-1,49],[19,25],[14,53],[-12,77],[-42,21],[-17,167],[-23,56],[-13,160],[-16,105],[-17,55],[-39,54],[-10,39],[-9,101],[-10,55],[12,40],[15,121],[69,-74],[42,-16],[70,-70],[32,-7],[46,8],[33,-22],[48,-14],[45,0],[37,25],[25,-49],[40,19],[23,-13],[33,-85],[12,-76],[25,37],[18,-73],[-37,-119],[24,-128],[-11,-103],[36,-47],[3,41],[29,22],[-25,158],[21,22],[-27,44],[17,48],[-6,55],[17,35],[8,67],[23,20],[-38,103],[-9,79],[-40,-34],[2,48],[40,17],[-11,45],[-58,53],[-10,67],[16,14],[34,-47],[-2,60],[20,42],[-22,40],[-9,86],[-20,-9],[-27,29],[-4,34],[-29,65],[18,43]],[[30943,71727],[-6,-43],[-24,29],[10,38],[20,-24]],[[30555,69889],[-115,-29],[-37,-56],[-31,-6],[12,95],[-1,46],[9,6],[12,20],[16,-3],[36,-28],[1,-21],[30,8],[6,19],[44,24],[17,24],[2,57],[-21,24],[-4,70],[19,-12],[21,-118],[0,-50],[-16,-70]],[[30555,69649],[11,-48],[-11,-20],[-33,2],[-16,37],[44,7],[5,22]],[[30367,69726],[21,29],[16,-57],[24,-39],[-91,-4],[30,71]],[[29981,69409],[30,51],[23,-14],[-65,-56],[-81,-78],[-15,23],[4,35],[35,48],[49,21],[20,-30]],[[29440,69181],[13,20],[2,24],[39,41],[25,47],[15,-6],[31,42],[12,-30],[54,40],[30,-18],[21,44],[102,-1],[38,12],[44,50],[3,-34],[-37,-64],[28,-13],[1,-44],[-39,-30],[-26,5],[-22,-23],[-92,-41],[-28,-1],[-37,-37],[-50,-12],[5,-40],[-67,3],[-24,36],[-9,-37],[-26,-13],[-13,32],[7,48]],[[27752,63513],[27,-50],[-7,-37],[-18,21],[2,20],[-7,4],[-17,13],[20,29]],[[27754,63465],[0,-14],[-15,-18],[-15,-48],[-17,25],[12,42],[30,17],[5,-4]],[[27689,63324],[-8,40],[-8,-8],[-5,23],[2,8],[1,9],[7,5],[6,12],[6,-18],[23,-18],[-8,-37],[-16,-16]],[[27464,58126],[23,-28],[-14,-25],[-9,53]],[[25220,60889],[12,28],[13,-59],[-17,-34],[-8,65]],[[25216,60995],[13,-5],[20,-55],[-16,-13],[-24,22],[7,51]],[[25141,61573],[16,-28],[-12,-35],[10,-34],[-6,-74],[-34,1],[-2,58],[10,58],[18,54]],[[24977,60941],[-28,-62],[-10,27],[38,35]],[[24712,61251],[23,-37],[-11,-42],[-4,5],[-2,-8],[-14,-6],[-1,10],[-5,10],[15,23],[-10,11],[-4,-22],[-18,6],[-1,35],[32,15]],[[24656,61071],[25,-93],[-17,-13],[-28,46],[20,60]],[[24651,61273],[4,-47],[-25,-51],[-16,-2],[-9,43],[8,51],[21,-5],[17,11]],[[24550,61298],[1,45],[20,-29],[40,-44],[-7,-55],[-26,0],[-9,43],[-19,40]],[[24464,61260],[28,-21],[16,-39],[0,-45],[-24,8],[-44,43],[3,31],[21,23]],[[24462,61390],[-49,-54],[-7,29],[45,38],[11,-13]],[[23784,61231],[63,71],[33,59],[1,-20],[9,-5],[26,11],[17,-57],[-51,1],[-27,-20],[-103,-101],[8,34],[12,7],[12,20]],[[23096,60132],[-31,-78],[6,71],[25,7]],[[17068,63983],[17,6],[29,-17],[20,-54],[-41,-13],[-7,68],[-18,10]],[[17067,63641],[17,-17],[35,-67],[-16,-25],[-20,34],[-16,75]],[[16697,64420],[36,11],[36,-32],[-25,-39],[-36,6],[-11,54]],[[16598,64391],[30,17],[43,-31],[3,-27],[-41,-36],[-16,21],[-19,56]],[[15919,74669],[18,44],[33,-62],[-39,-22],[-1,-38],[18,-32],[14,-100],[44,-8],[7,-57],[-46,17],[-22,37],[-4,92],[-44,50],[22,79]],[[15969,74016],[23,-15],[-8,-43],[-17,-7],[2,65]],[[15836,74907],[24,35],[44,-38],[-19,-40],[-34,-10],[-15,53]],[[15786,74852],[8,21],[35,-41],[-7,-72],[-34,48],[-2,44]],[[13886,80102],[-45,-96],[13,-70],[-8,-59],[27,-110],[15,-121],[-27,-47],[-55,-176],[-51,-91],[-12,21],[-54,-74],[-37,3],[-23,25],[-4,93],[-15,50],[6,49],[-26,42],[-5,45],[62,87],[-8,115],[7,22],[-9,153],[-52,127],[-37,79],[-41,-26],[-18,25],[-67,-61],[-33,-59],[7,-22],[-23,-124],[-25,-6],[3,-63],[-14,-27],[-55,65],[-13,85],[12,59],[16,15],[46,107],[-2,153],[28,21],[-16,23],[-20,85],[-49,33],[-10,45],[-22,17],[-44,79],[-26,17],[3,72],[-71,89],[-44,106],[46,7],[-82,57],[-66,18],[-40,31],[-18,33],[14,72],[61,-9],[7,28],[-62,23],[9,36],[-29,51],[2,49],[-28,24],[-16,57],[7,41],[73,-41],[-11,49],[-36,40],[-44,11],[-49,127],[-44,63],[-10,109],[-37,-6],[-83,108],[-25,-8],[-34,20],[-16,69],[-56,149],[16,39],[-32,15],[-29,74],[-14,154],[-23,93],[-33,83],[-23,-9],[13,-137],[15,-7],[-5,-91],[43,-134],[6,-51],[24,-70],[-8,-37],[19,-88],[14,-103],[-32,-66],[-36,19],[-28,64],[-63,74],[-30,-23],[-53,-10],[21,95],[-31,127],[-36,90],[-24,-45],[-21,-1],[-105,98],[-69,52],[-13,-45],[67,-30],[12,-48],[29,-33],[38,-17],[52,-75],[47,-167],[-17,-27],[-74,-30],[-37,1],[-26,-62],[-29,0],[-26,79],[-28,40],[-73,27],[-67,61],[-56,65],[-23,46],[-73,97],[-6,71],[-80,105],[-72,54],[-3,58],[-39,-41],[-66,72],[-118,76],[-66,70],[-81,64],[52,22],[51,102],[-17,22],[-23,117],[50,55],[38,-91],[16,6],[-48,103],[-49,-3],[-5,-39],[-28,-19],[-31,-75],[-88,-51],[-41,-36],[-92,11],[-68,18],[-29,25],[-124,76],[-1,19],[46,46],[-9,67],[-31,66],[-24,-22],[34,-63],[-51,-45],[-51,-8],[-42,34],[-189,58],[-96,3],[-56,-19],[-74,-6],[-76,-18],[-65,-32],[-31,23],[-37,61],[-37,22],[-9,38],[-46,-15],[-34,11],[-55,76],[-43,10],[36,86],[10,59],[-30,37],[-33,-18],[-27,-69],[-27,-24],[-71,-15],[-41,50],[-43,13],[-11,40],[27,50],[-39,15],[-50,39],[-35,-25],[-35,12],[19,62],[-82,-41],[-46,9],[37,60],[-4,27],[-37,34],[-11,76],[26,83],[103,3],[-18,37],[-81,-13],[-51,-64],[-19,-41],[-25,42],[-29,9],[-22,-72],[-64,-44],[-25,10],[-23,70],[-24,-22],[10,-61],[-35,2],[-17,-52],[-22,8],[-37,108],[22,85],[40,63],[-5,48],[-61,-112],[-16,-52],[-33,70],[-5,-102],[-31,-98],[-24,-39],[14,-62],[24,12],[19,-73],[-43,-56],[20,-30],[35,67],[21,-7],[31,-50],[0,-60],[-36,-31],[-33,-51],[-1,-60],[24,-40],[-67,-54],[-23,-101],[-92,5],[-18,-21],[-29,34],[-40,-13],[-21,52],[-35,-100],[-14,137],[-28,-32],[15,-25],[-25,-49],[-48,-35],[-18,11],[-27,-47],[26,-100],[-29,15],[-26,-15],[-55,-75],[-40,-72],[-41,45],[-15,-54],[-29,41],[-7,-74],[-40,-4],[-9,-36],[-41,-51],[-6,-49],[-46,14],[-17,-37],[-38,6],[-27,36],[-74,-69],[-27,42],[-27,-9],[-32,30],[-4,43],[32,34],[-3,43],[67,47],[22,-13],[35,53],[49,8],[23,24],[-3,41],[41,69],[39,38],[-19,20],[-38,-29],[-61,-68],[-55,-37],[-31,11],[-51,49],[-13,37],[33,112],[8,55],[90,177],[5,82],[22,18],[6,95],[-36,143],[53,43],[42,5],[99,107],[87,73],[37,-65],[57,-27],[58,42],[79,-23],[61,-30],[65,-12],[-24,49],[-36,-9],[-48,37],[-66,22],[-31,49],[-60,59],[48,43],[23,65],[47,51],[61,41],[7,32],[-69,-5],[-64,-69],[-15,-90],[-15,-16],[-65,16],[-67,-12],[-22,27],[-97,-52],[-50,-45],[-30,-73],[-46,-24],[-40,0],[-41,-38],[-46,-87],[26,-77],[-58,-7],[-42,-51],[-10,-39],[-58,-61],[-6,-47],[26,-36],[-36,-28],[-8,-36],[-47,-58],[-28,13],[-28,-34],[54,-89],[-39,-112],[-28,-26],[-57,6],[-50,-19],[23,-34],[34,-15],[-16,-69],[-45,-42],[-36,-10],[-34,23],[-33,-72],[-43,-7],[2,-77],[-48,-14],[-31,-30],[-27,-53],[-19,-93],[-6,-75],[122,-4],[14,11],[34,-62],[28,6],[44,-53],[-18,-126],[-44,-45],[-11,-38],[-49,-21],[-35,4],[-11,-83],[-41,-6],[10,-92],[-36,1],[20,-60],[-17,-55],[-30,-50],[-48,-27],[-24,11],[-10,-60],[-42,21],[-24,-38],[-18,20],[-44,-3],[-4,-50],[-20,-11],[9,-47],[-54,-36],[-15,-30],[7,-40],[-72,47],[-15,-7],[7,-87],[-40,-19],[-47,-70],[-38,20],[6,-93],[-43,35],[-12,-30],[-32,-14],[-59,-92],[54,23],[6,-98],[-30,-45],[-30,-105],[-35,13],[-48,-52],[-54,-28],[-6,-26],[-41,-56],[-47,65],[-25,-21],[14,-33],[-29,-21],[-10,-41],[28,-53],[-59,-10],[-26,48],[-43,-26],[-58,-64],[60,15],[21,-7],[-6,-64],[-47,25],[-28,-35],[-56,15],[-21,-20],[-67,-128],[17,-10],[41,60],[66,-38],[-30,-40],[15,-37],[-26,-22],[-18,-108],[-24,-16],[-26,44],[-44,-59],[-27,38],[-17,-61],[-22,2],[-100,-38],[-45,-25],[4,-58],[-35,-130],[-26,9],[12,114],[13,37],[-28,33],[-64,-22],[-51,-87],[4,-24],[-72,-42],[-41,-92],[-13,62],[-24,-14],[5,-46],[-42,-17],[-6,36],[-35,1],[-14,-50],[-67,-59],[-41,16],[-33,-10],[8,88],[31,70],[-9,31],[-39,0],[-21,-17],[-29,-69],[9,-71],[-59,-128],[-36,5],[18,-95],[-24,-22],[-24,28],[-38,-67],[-37,8],[-25,25],[7,41],[-12,91],[-41,34],[-17,-54],[29,-37],[-2,-50],[16,-60],[-36,-16],[-22,-44],[-29,0],[-19,33],[-15,70],[-49,40],[-8,-80],[45,-40],[-3,-27],[-54,-69],[-19,34],[10,124],[-22,23],[37,46],[33,22],[42,-12],[32,42],[-13,36],[38,19],[28,52],[22,-16],[20,32],[-5,71],[72,143],[57,70],[20,8],[49,66],[69,35],[64,14],[100,-12],[-15,-33],[20,-56],[36,-55],[24,5],[-9,76],[73,3],[40,-61],[19,22],[-2,41],[-49,40],[-26,57],[20,50],[35,138],[63,101],[51,44],[35,53],[64,49],[79,49],[36,56],[58,53],[52,-32],[42,26],[-15,91],[21,79],[52,110],[50,53],[13,32],[29,-15],[20,25],[28,95],[49,60],[29,-43],[22,19],[-8,63],[-27,2],[-1,79],[13,70],[20,217],[40,59],[-27,47],[0,85],[15,62],[42,54],[44,84],[30,30],[2,49],[17,32],[-25,40],[-67,-33],[-63,-56],[-147,-94],[-35,-7],[-31,29],[-16,68],[-51,37],[14,39],[10,85],[-82,-75],[-9,-96],[-22,-18],[30,-106],[20,-49],[-27,-62],[-27,-12],[-46,25],[-76,206],[-44,78],[-66,53],[-47,-88],[-30,76],[-42,-12],[-37,81],[5,33],[-23,36],[-110,-121],[-37,-13],[-81,-72],[-32,-12],[-23,-73],[-106,-65],[-1,45],[-86,-12],[24,43],[20,-22],[44,112],[-18,150],[64,43],[-8,40],[-54,-9],[-23,-30],[-25,53],[-10,54],[13,35],[5,68],[69,97],[-43,91],[-5,47],[-24,73],[-33,58],[-5,52],[-22,31],[-14,69],[13,47],[-28,47],[-47,54],[37,61],[-16,40],[-38,-75],[-16,-69],[37,-38],[-13,-38],[13,-78],[-34,-35],[-33,5],[-127,-96],[-55,-21],[-94,-18],[-65,5],[-63,30],[-23,67],[26,34],[-21,32],[-51,36],[-33,84],[-41,45],[-4,33],[13,20],[3,26],[23,18],[-10,34],[39,34],[43,112],[41,15],[25,68],[31,19],[38,-23],[-10,-94],[23,-36],[30,15],[44,51],[15,43],[-25,50],[-67,35],[-37,0],[-83,24],[-100,-22],[-16,52],[-97,18],[-35,-27],[-28,23],[13,100],[-49,74],[-29,-83],[-55,33],[-11,129],[-64,21],[-15,59],[48,47],[-7,33],[-39,28],[-42,-15],[-32,38],[11,33],[80,25],[-36,37],[-31,59],[38,24],[25,-8],[62,18],[-19,58],[-8,94],[19,56],[99,159],[19,58],[51,66],[80,2],[-25,180],[24,115],[28,52],[47,8],[9,29],[-30,36],[49,66],[79,34],[104,-32],[49,-89],[41,-2],[24,-43],[86,25],[52,65],[6,35],[42,14],[32,49],[57,117],[22,23],[-10,37],[66,-19],[73,-52],[38,17],[42,-7],[60,12],[48,26],[6,31],[41,50],[56,112],[-2,49],[-47,156],[-2,100],[-12,31],[-73,100],[-60,48],[0,40],[36,8],[88,-13],[6,29],[56,52],[5,75],[-25,66],[-89,79],[-61,-112],[-83,9],[-44,-18],[-12,-36],[-71,-13],[-18,-46],[-83,-60],[-22,-44],[-5,-60],[-49,-36],[-13,115],[-75,104],[-46,-5],[-20,-38],[56,-50],[-26,-31],[-65,53],[-93,23],[-41,-17],[-90,7],[-110,-32],[-44,-21],[-22,-35],[-71,18],[-136,46],[-152,37],[-47,41],[-24,68],[20,69],[-5,44],[-68,62],[-9,41],[-42,36],[90,37],[13,63],[92,44],[-121,37],[-63,2],[-52,28],[-113,17],[-58,39],[-65,59],[-62,27],[18,35],[60,59],[56,0],[28,38],[-12,45],[69,47],[25,-33],[44,20],[42,48],[44,81],[139,87],[47,-47],[104,-5],[39,33],[-94,66],[49,71],[88,53],[67,17],[56,-4],[16,30],[62,56],[64,21],[152,11],[35,-29],[7,-46],[-33,-53],[6,-104],[-28,-38],[45,-99],[38,-16],[36,19],[111,-16],[41,22],[51,2],[30,-36],[56,10],[30,-21],[62,29],[39,-10],[45,-39],[55,113],[21,60],[57,9],[11,-26],[88,-13],[-2,35],[-40,64],[-101,41],[-109,-11],[0,106],[-52,54],[-40,75],[-76,19],[-31,82],[4,35],[87,25],[54,-103],[8,-102],[40,-70],[96,-79],[69,28],[42,40],[55,-75],[56,-47],[41,-5],[112,23],[8,67],[-12,43],[18,67],[-143,-27],[-21,34],[-43,7],[-60,-13],[-45,-84],[-48,3],[-114,138],[9,69],[38,88],[64,20],[-39,33],[-68,29],[-102,-41],[-88,12],[-56,30],[-64,-18],[-187,52],[-25,21],[-3,83],[-34,127],[-72,154],[-101,59],[-33,48],[-79,59],[-123,117],[-96,45],[-51,14],[-45,64],[-60,56],[-79,44],[53,51],[34,117],[10,154],[-10,62],[181,-17],[65,4],[285,47],[105,48],[71,61],[57,81],[90,105],[37,150],[-21,24],[13,61],[35,22],[-25,46],[148,155],[15,49],[65,70],[81,114],[75,-40],[106,12],[105,56],[152,131],[191,202],[66,27],[59,-57],[83,22],[56,-4],[180,32],[90,43],[118,101],[132,182],[38,32],[92,-50],[46,-3],[63,-47],[59,3],[49,-22],[13,-65],[-59,-64],[-72,-13],[31,-97],[78,-1],[23,21],[0,55],[70,59],[30,67],[65,-37],[50,6],[47,-56],[-21,-74],[8,-37],[124,-47],[48,37],[25,46],[106,0],[107,28],[38,-18],[109,-9],[96,-32],[-3,-38],[-51,-101],[30,-36],[86,-12],[58,-23],[13,-45],[-26,-39],[86,6],[68,-20],[136,35],[30,27],[95,-6],[77,-43],[69,58],[25,-15],[169,-2],[57,-46],[103,-18],[28,-62],[36,-6],[67,29],[93,-40],[18,-57],[206,-42],[33,22],[103,2],[162,-32],[62,-28],[119,-76],[73,-14],[99,-5],[60,45],[47,1],[143,48],[23,-18],[81,13],[28,19],[83,-45],[51,-6],[53,-34],[100,-107],[91,-26],[101,-64],[45,-66],[45,37],[57,-27]],[[13426,79698],[-46,72],[49,73],[3,32],[-22,29],[6,46],[-3,97],[48,-1],[-15,43],[86,56],[58,-101],[28,-90],[9,-58],[-15,-108],[7,-59],[-20,-45],[-6,-49],[-41,-49],[-40,49],[-54,24],[-32,39]],[[13542,79448],[4,-84],[-24,-3],[-43,27],[20,43],[43,17]],[[13458,79644],[37,-40],[15,-40],[-8,-107],[-39,18],[-29,-12],[20,106],[-12,51],[16,24]],[[13380,79749],[34,-44],[6,-96],[-15,-53],[-25,33],[-10,82],[10,78]],[[13240,80502],[53,-90],[32,6],[30,-106],[-25,-8],[-17,-55],[-37,56],[-34,29],[-10,33],[8,135]],[[13017,79786],[25,100],[-25,2],[-37,-26],[-38,50],[20,55],[50,69],[-26,53],[-9,46],[8,45],[-11,46],[7,46],[-7,11],[-40,0],[-51,30],[-10,55],[12,54],[59,-16],[57,-2],[7,-35],[37,-72],[-20,-62],[4,-36],[41,11],[92,-110],[32,-67],[12,-90],[23,-20],[40,-126],[-50,21],[8,-61],[34,-16],[31,-51],[13,-54],[29,1],[6,-58],[-18,-106],[20,-54],[1,-126],[-22,-62],[-73,15],[-14,141],[-41,-11],[-30,49],[25,101],[-56,32],[-59,82],[-83,13],[-12,38],[14,32],[31,-3],[13,50],[-19,16]],[[13142,80231],[-10,39],[10,67],[25,0],[19,71],[31,7],[14,-87],[15,-27],[33,-14],[24,-41],[-29,-54],[-7,-78],[-32,-11],[-39,108],[-38,-9],[-16,29]],[[13093,80736],[34,-58],[34,-37],[21,-57],[-70,-63],[-43,10],[-5,71],[17,21],[-21,118],[33,-5]],[[13148,79345],[-3,-62],[-37,87],[7,30],[43,-30],[-10,-25]],[[13140,80487],[18,-22],[-15,-52],[7,-49],[-59,-32],[-24,46],[-30,25],[16,60],[23,31],[64,-7]],[[13051,79481],[17,-22],[-3,-45],[53,-83],[19,-90],[-38,-15],[-7,42],[-30,40],[-27,73],[-25,35],[-11,58],[-5,148],[22,14],[37,-116],[-2,-39]],[[13101,79592],[28,-47],[14,-63],[-23,-34],[-29,18],[9,48],[-16,45],[17,33]],[[12979,80827],[-13,63],[65,-11],[26,-40],[15,-72],[-17,-23],[18,-101],[-25,-44],[-45,75],[-13,51],[-30,-11],[40,-89],[24,-14],[8,-66],[-21,-50],[-59,26],[-38,-42],[-41,6],[1,106],[-18,71],[9,85],[-24,-3],[-28,39],[15,26],[-62,90],[8,34],[34,21],[81,-30],[68,-39],[22,-58]],[[12962,80085],[18,13],[15,-59],[-35,5],[2,41]],[[12962,79696],[29,-54],[-7,-35],[-56,2],[-1,69],[35,18]],[[12958,79848],[18,-38],[-21,-36],[-26,57],[29,17]],[[12837,80144],[43,99],[54,38],[42,-10],[-3,-32],[0,-65],[-28,7],[-69,-48],[-20,-39],[-19,50]],[[12869,79998],[4,41],[31,5],[34,-65],[-30,-34],[-39,53]],[[12921,79815],[15,-45],[-33,-13],[-19,18],[37,40]],[[12910,79744],[17,-26],[-63,-51],[24,72],[22,5]],[[12870,79848],[22,-11],[-21,-74],[-26,69],[25,16]],[[12711,80472],[24,-25],[33,20],[-17,45],[-47,56],[-9,64],[-27,50],[-7,88],[28,46],[44,-45],[2,52],[35,-27],[30,-92],[31,22],[22,-7],[-12,-69],[23,-52],[-55,-64],[-6,-105],[20,-30],[-12,-74],[-19,-24],[-3,-68],[-23,12],[5,40],[-20,22],[-9,-86],[-29,-6],[7,57],[-19,74],[24,41],[-14,85]],[[12728,81714],[-7,-33],[84,-220],[2,-89],[-19,3],[-20,96],[-66,176],[-16,-47],[23,-91],[30,-87],[57,-103],[13,-74],[-28,-32],[34,-66],[-27,-45],[-55,38],[17,-56],[-25,-68],[-82,-99],[-34,-3],[-11,140],[21,46],[1,57],[31,1],[-30,66],[-27,91],[-20,100],[7,67],[-16,117],[-1,67],[-36,73],[-13,62],[16,29],[38,-36],[18,-81],[32,24],[67,-36],[42,13]],[[12632,81844],[71,-95],[-20,-8],[-69,25],[-18,62],[36,16]],[[12593,80286],[-30,37],[-32,71],[-62,199],[-28,54],[13,57],[-59,49],[16,65],[-15,48],[24,11],[-32,81],[-6,45],[11,59],[-45,-9],[-41,83],[46,75],[-2,35],[31,40],[28,-18],[15,-50],[29,-9],[55,-55],[5,-75],[24,-2],[13,-62],[33,-212],[22,-162],[-14,-94],[10,-156],[-9,-105]],[[12214,81484],[-32,44],[-84,158],[39,9],[-11,45],[41,-8],[17,29],[34,-27],[52,67],[31,-34],[52,-33],[2,-48],[-30,-51],[9,-43],[36,101],[17,10],[37,-34],[44,-5],[39,-30],[17,-51],[-25,-63],[20,-95],[2,-56],[17,-52],[-9,-104],[-54,4],[-10,19],[-140,151],[-32,-20],[48,-57],[5,-102],[-42,-61],[-38,15],[-43,79],[-2,39],[-61,146],[-22,9],[-34,54],[18,63],[2,50],[90,-118]],[[12274,80879],[-8,65],[23,22],[-21,43],[3,91],[33,18],[22,-69],[15,-101],[-24,-54],[-43,-15]],[[12067,81641],[29,13],[27,-35],[-5,-64],[-31,-27],[-24,13],[11,50],[-7,50]],[[9479,83454],[12,-25],[-79,-57],[-56,-14],[-1,31],[124,65]],[[9295,83363],[40,17],[25,-48],[49,12],[13,-23],[-33,-37],[-29,-1],[-50,-37],[-35,-42],[-25,29],[30,28],[-39,47],[33,72],[21,-17]],[[9142,83278],[46,-23],[-12,-43],[-65,-70],[-45,-78],[-30,-134],[-113,-65],[-10,48],[63,118],[78,84],[34,82],[19,7],[13,53],[22,21]],[[8973,83387],[24,-44],[-9,-68],[-21,-49],[-12,-81],[-43,54],[26,152],[29,-6],[6,42]],[[8890,83626],[-41,-21],[4,49],[24,46],[25,-24],[-12,-50]],[[8877,83302],[5,-66],[-36,30],[31,36]],[[8876,83173],[-29,-114],[-32,-17],[8,71],[53,60]],[[8839,83568],[25,-49],[-22,-35],[-20,50],[17,34]],[[7669,81686],[-25,7],[-106,-99],[-43,38],[-18,47],[-38,34],[3,31],[45,75],[45,-27],[32,37],[-25,60],[22,7],[32,48],[48,-20],[-1,-57],[32,-16],[71,-9],[42,-76],[-31,-56],[-63,43],[-22,-67]],[[7341,81478],[4,-72],[61,53],[37,-9],[-8,75],[9,52],[44,-26],[30,11],[38,-34],[-13,-51],[72,63],[33,-17],[19,-49],[-23,-57],[4,-67],[83,-47],[-35,-50],[-9,-55],[-57,5],[-74,34],[20,-51],[28,-13],[-2,-60],[-21,-15],[-86,1],[21,-30],[-35,-33],[-47,11],[-29,-29],[-40,-73],[-49,-1],[33,-62],[-81,-116],[-19,-49],[-67,-17],[22,74],[34,46],[-4,64],[-33,-23],[-6,46],[9,63],[-43,25],[-68,-21],[0,-43],[27,-10],[18,41],[53,11],[0,-58],[-13,-70],[-18,-38],[-84,76],[-1,131],[-24,62],[-33,5],[-2,36],[31,128],[27,16],[55,78],[28,19],[62,-13],[23,-80],[6,-65],[28,-27],[-4,95],[8,25],[-24,43],[61,23],[-68,26],[-8,77],[21,39],[65,12],[14,-35]],[[7685,82053],[-11,-67],[-29,-50],[-40,18],[-2,67],[39,5],[43,27]],[[7452,81019],[62,-3],[10,-43],[-36,-4],[-50,-40],[-32,29],[18,61],[28,0]],[[7424,81706],[29,-43],[22,0],[29,-79],[-87,52],[-33,5],[40,65]],[[7352,81546],[50,5],[26,-34],[-17,-43],[-59,72]],[[7382,82610],[16,-51],[-41,-13],[-10,31],[35,33]],[[7179,80602],[21,-18],[-21,-52],[-53,-1],[14,60],[39,11]],[[7075,80588],[10,-58],[-46,-39],[-8,52],[44,45]],[[6710,54542],[25,-22],[7,-25],[39,-60],[37,-14],[48,-57],[39,-73],[14,-37],[0,-84],[27,-16],[4,-64],[21,-48],[26,-32],[-3,-33],[-42,-93],[-44,-55],[-21,-12],[-24,5],[-19,-41],[-37,-49],[-39,-143],[-68,70],[-11,60],[10,153],[-19,110],[-6,85],[-14,30],[-7,91],[19,50],[16,9],[10,55],[15,30],[3,35],[-19,73],[-4,52],[17,50]],[[6791,80097],[0,-86],[-44,-10],[30,101],[14,-5]],[[6480,55056],[11,30],[21,-13],[23,-84],[42,40],[27,-23],[31,-65],[31,-23],[5,-52],[-17,-47],[-23,-22],[-22,2],[-25,-31],[-32,1],[-8,15],[-6,125],[-21,-3],[-23,25],[-21,77],[7,48]],[[6477,54743],[26,38],[14,-17],[-5,-42],[-32,-11],[-3,32]],[[6385,55199],[31,-16],[45,9],[8,-19],[-25,-58],[-20,-14],[-56,43],[-48,-14],[-11,42],[21,53],[7,-12],[48,-14]],[[6373,54984],[19,33],[27,-13],[24,-64],[-7,-40],[-37,-25],[-7,62],[-19,47]],[[6093,55529],[23,48],[10,-17],[20,-93],[11,-21],[-1,-49],[37,-57],[15,-58],[-47,-30],[-18,32],[-25,11],[-31,-15],[-40,133],[-10,68],[40,5],[16,43]],[[5693,55930],[2,14],[41,-6],[15,-74],[-11,-45],[2,-62],[-33,-65],[-42,17],[-19,42],[-26,19],[-6,56],[14,58],[43,61],[20,-15]],[[5722,79491],[19,-59],[-34,-4],[15,63]],[[5509,79405],[9,51],[-13,79],[26,-12],[34,78],[43,-29],[-18,-55],[-81,-112]],[[5541,55769],[-6,-59],[-23,-20],[-13,-58],[-12,43],[17,56],[37,38]],[[5359,79735],[16,-9],[22,-79],[21,-38],[-1,-41],[-33,-13],[-19,33],[-47,9],[4,96],[37,42]],[[5353,82173],[-44,-159],[-21,-19],[-31,18],[5,88],[55,34],[36,38]],[[5029,79557],[36,12],[35,-30],[-32,-51],[-39,69]],[[4911,79436],[24,-30],[-1,-43],[-22,-38],[-27,35],[-3,32],[29,44]],[[4847,85640],[49,-8],[-3,-58],[-68,1],[-14,36],[36,29]],[[4847,79002],[-63,24],[-6,58],[64,-45],[5,-37]],[[4536,79477],[36,-12],[33,-56],[5,-75],[22,-64],[49,9],[10,-47],[-47,0],[-32,30],[-6,-61],[-47,-30],[-48,15],[-89,-11],[-46,-28],[-26,-40],[1,-29],[-32,-46],[-56,-23],[-55,22],[-24,72],[-4,41],[63,55],[47,140],[1,30],[33,30],[21,-24],[35,-1],[29,53],[17,-6],[47,53],[63,3]],[[4264,83682],[-5,-61],[61,3],[36,-27],[32,-75],[-34,-26],[-17,-50],[-32,-9],[20,-49],[-42,-33],[4,-45],[-17,-9],[-1,-21],[-22,-36],[-49,14],[-37,38],[-29,59],[35,24],[-17,45],[-39,-34],[-49,11],[-1,46],[30,1],[84,107],[2,48],[57,71],[30,8]],[[4165,78829],[15,-41],[-43,-5],[-12,40],[40,6]],[[3981,78895],[9,35],[43,-70],[-20,-48],[-32,83]],[[3843,83336],[26,-60],[20,-17],[32,20],[54,-38],[-11,-30],[18,-106],[-12,-24],[39,-102],[-38,-24],[-82,-10],[-38,-41],[-16,-49],[-27,48],[-41,26],[-49,-4],[-78,78],[-75,38],[-39,36],[-30,100],[27,24],[59,1],[18,-14],[63,4],[-5,35],[93,82],[33,-21],[59,48]],[[3888,78883],[38,-9],[32,-27],[4,-35],[-32,-42],[-56,15],[-13,51],[27,47]],[[3850,78619],[2,-54],[-15,-28],[-31,16],[-1,34],[45,32]],[[3453,78215],[-24,-23],[-38,21],[-6,32],[34,48],[41,1],[20,40],[39,-29],[9,51],[40,-7],[-2,97],[20,21],[36,105],[-53,37],[36,91],[71,34],[39,1],[-6,-58],[19,-55],[55,71],[33,17],[6,-64],[-25,-7],[-23,-45],[-45,-48],[5,-22],[61,54],[17,-70],[-36,-8],[-41,-39],[-32,-98],[-28,-30],[-36,-7],[-36,21],[-13,-28],[-60,-38],[-4,-27],[-41,-10],[-32,-29]],[[3127,78057],[-17,33],[10,55],[49,64],[14,-15],[47,47],[-9,78],[46,74],[72,25],[18,-28],[32,-3],[-15,-49],[3,-47],[-79,-80],[-39,-22],[-55,-136],[-35,-21],[-17,-36],[-62,-23],[0,36],[37,48]],[[2370,85405],[-76,43],[-30,85],[5,68],[21,44],[7,58],[67,-51],[-6,-34],[64,9],[95,-35],[80,70],[47,22],[54,-7],[58,-71],[9,-81],[70,-34],[38,2],[28,-50],[79,-10],[37,-37],[31,33],[94,-32],[-10,-44],[-39,-64],[-41,20],[-78,9],[-80,-112],[10,-30],[-26,-35],[-34,17],[15,51],[-55,80],[-28,-1],[-27,33],[-51,-2],[-22,71],[-38,40],[-96,51],[-67,8],[-43,-22],[-25,-43],[-37,-19]],[[2896,80546],[-19,5],[-31,55],[80,-13],[-30,-47]],[[2855,77852],[-50,55],[34,32],[31,-21],[-15,-66]],[[2754,77814],[-26,6],[2,42],[33,-14],[-9,-34]],[[2699,80977],[-38,21],[10,33],[70,12],[-11,-44],[-31,-22]],[[2558,77686],[-12,42],[45,71],[30,-19],[-12,-51],[-24,-1],[-27,-42]],[[1967,83452],[3,-46],[35,-49],[62,-48],[33,6],[15,-41],[-61,-13],[-36,30],[-56,82],[-34,13],[3,49],[36,17]],[[2074,77475],[-27,11],[20,66],[33,26],[31,-18],[1,-36],[-58,-49]],[[1666,77389],[50,-16],[54,33],[48,-35],[69,-5],[14,-25],[-93,-27],[-44,26],[-52,-13],[-28,17],[-18,45]],[[1665,77537],[3,-29],[-18,-50],[-38,-20],[16,-50],[-25,-25],[-48,9],[-13,-41],[-43,0],[-29,-28],[-48,24],[-37,-24],[-19,23],[44,48],[39,-12],[47,14],[6,24],[54,55],[22,-11],[21,51],[-32,2],[7,69],[40,30],[35,-22],[16,-37]],[[1087,77290],[-28,7],[-7,46],[22,34],[36,-30],[-7,-68],[-16,11]],[[1014,77103],[-14,9],[-2,89],[35,-3],[4,-57],[-23,-38]],[[940,77290],[10,-53],[-14,-39],[56,-17],[-1,-54],[-20,1],[-21,-53],[-40,-4],[-55,-53],[-17,35],[33,54],[-13,54],[40,0],[12,36],[-24,49],[7,23],[35,-4],[12,25]],[[653,77048],[-12,29],[15,34],[34,-11],[20,23],[63,37],[5,85],[40,-15],[-18,-48],[-4,-88],[-39,-27],[-33,38],[-24,-21],[-45,-12],[-2,-24]],[[555,77232],[13,4],[47,-87],[-28,-76],[-22,-27],[0,91],[-27,12],[-44,51],[8,32],[53,0]],[[33999,18368],[-13,-18],[9,-40],[-8,-60],[-69,-123],[2,-48],[22,-82],[-1,-152],[-21,-7],[6,-98],[-14,-52],[1,-62],[-19,-77],[0,-50],[-27,-44],[1,-30],[19,-26],[7,-42],[-17,-124],[-11,-42],[-30,-23],[-2,-43],[16,-81],[-12,-98],[20,-55],[2,-48],[-22,-50],[-6,-63],[12,-75],[3,-109],[10,-145],[8,-54],[-24,-55],[-22,-19]],[[33819,16273],[-10,25],[-34,-3],[-8,-134],[4,-21],[-32,-138],[3,-42],[-7,-110],[10,-90],[-81,-95],[-24,44],[-22,14],[-4,18],[-17,9],[-23,-10],[-9,25],[-33,21],[-16,-33],[10,-21],[8,-12],[5,-14],[4,-4],[4,-15],[-7,-23],[8,-3],[23,-27],[-2,-10],[15,-26],[13,-1],[9,-29],[2,-12],[3,10],[10,100],[17,38],[13,-42],[25,1],[23,-53],[20,-12],[2,-17],[7,-18],[-20,-128],[30,-26],[10,-103],[12,-56],[34,-59],[2,-25],[43,-72],[49,-31],[12,-27],[23,-4],[43,-69],[59,-70],[47,-96],[31,-80],[28,-124],[-7,-38],[-25,-64],[-34,-115],[-7,-77],[2,-82],[9,-43],[37,-115],[34,-69],[42,-38],[59,10],[9,-58],[10,-334],[-91,-303],[-39,-147],[-78,-173],[-29,-95],[-8,-85],[0,-79],[-12,-12],[-31,-70],[-45,-61],[-117,-120],[-59,-50],[-49,-25],[-123,-93],[-159,-69],[-27,-21],[-83,-25],[-94,-42],[-76,-22],[-45,-22],[-43,-1],[-35,-12],[-71,7],[-59,-11],[-37,26],[-21,-13],[-68,45],[-16,49],[3,24],[-27,29],[-26,-3],[-4,35],[-66,-8],[7,-50],[33,-1],[23,-55],[-6,-41],[13,-41],[-16,-74],[21,-109],[41,-19],[33,-44],[-21,-26],[-30,60],[-12,-29],[20,-37],[32,-35],[-8,-50],[-12,-127],[3,-107],[-55,-22],[-10,-140],[6,-61],[-5,-31],[-28,-38],[-11,-38],[16,-106],[71,-96],[-13,-51],[-26,-155],[-20,-26],[-43,-32],[-55,-59],[-16,7],[-25,-39],[-47,-45],[-26,-10],[-178,-1],[-22,14],[-21,43],[-72,49],[-30,39],[-64,66],[-56,32],[-38,-8],[23,63],[-27,17],[-35,-33],[-30,-66],[-11,-87],[0,-63],[18,-193],[16,-93],[12,-17],[-7,-89],[3,-158],[-10,-8],[-5,-120],[24,-79],[28,-43],[37,-22],[76,-18],[-20,-42],[-18,-93],[52,-10],[37,18],[48,-9],[21,56],[-4,53],[-20,25],[-66,4],[80,40],[55,67],[34,6],[44,-180],[-3,-114],[7,-92],[-15,-60],[2,-47],[-26,-33],[-106,-49],[-36,63],[-7,35],[6,92],[-25,55],[-64,32],[-34,-13],[-41,-70],[-25,-6],[-18,-29],[-14,-53],[3,-31],[40,-42],[20,-5],[56,-60],[21,2],[31,-24],[25,13],[5,-36],[-40,-57],[-86,-63],[-62,-81],[-18,-55],[0,-44],[-22,-43],[-17,-54],[-17,-23],[-21,-61],[-6,-77],[28,-189],[6,-85],[-22,-50],[15,-81],[-31,-153],[-26,-24],[-63,-103],[-11,-66],[4,-42],[39,-19],[-20,-107],[-25,4],[-32,27],[-25,-33],[-21,32],[-50,15],[-23,-50],[-25,7],[-64,-70],[10,-52],[-78,-12],[-31,-27],[-23,-39],[-53,-149],[-35,-78],[-3,-105],[-24,-24],[-26,-72],[-22,-92],[-1,-86],[17,-131],[38,-151],[21,-43],[61,-61],[30,-79],[19,-25],[53,-116],[39,-24],[33,3],[87,-33],[43,11],[47,-17],[30,-68],[13,-99],[-14,-182],[-24,-121],[-9,-14],[8,-72],[20,-53],[-40,1],[-13,-113],[-34,-10],[-19,-57],[-16,-4],[-32,-57],[-8,-53],[-23,0],[-12,-46],[-33,-7],[-39,-33],[-21,-35],[-13,-52],[-40,-23],[-34,-51],[-14,-83],[-76,-93],[-30,-71],[-16,-63],[-23,-131],[-23,-17],[9,-36],[29,-6],[-10,-97],[-10,-182],[-35,-131],[-52,-75],[-44,-33],[-34,-4],[-21,37],[-15,60],[-21,37],[-14,-20],[20,-40],[3,-43],[38,-40],[-13,-37],[-99,-71],[-27,-27],[-34,-80],[-26,-93],[-17,-126],[2,-114],[-24,-41],[17,-25],[15,-134],[30,-197],[14,-67],[-51,-40],[-8,-34],[56,16],[55,-210],[44,-124],[69,-165],[-18,-40]],[[30995,2448],[0,34],[-43,5],[-38,29],[-36,5],[-41,53],[-57,38],[-82,0],[-142,108],[-186,0],[-349,0],[-29,32],[27,26],[-5,32],[-36,73],[-42,50],[-30,86],[0,114],[8,33],[-14,43],[28,53],[-25,29],[-15,50],[8,80],[26,-5],[9,109],[-28,88],[17,69],[-20,30],[-52,-3],[-14,-43],[-34,38],[-48,-30],[-18,-51],[-31,-34],[-36,35],[13,52],[-12,37],[-26,19],[-39,75],[7,23],[-31,116],[-14,14],[3,64],[20,66],[-23,52],[2,50],[14,40],[15,98],[-16,33],[7,63],[-15,38],[-2,46],[22,15],[-6,36],[18,29],[2,60],[-22,29],[7,48],[91,-50],[1,65],[38,84],[16,85],[43,-11],[28,68],[14,0],[30,49],[-3,119],[-12,103],[40,-19],[19,47],[-8,26],[48,68],[-24,59],[3,68],[-16,48],[-23,6],[6,62],[-22,15],[-6,34],[15,65],[-8,48],[18,14],[4,49],[17,18],[19,92],[-14,31],[21,38],[29,14],[9,47],[23,-6],[14,31],[3,62],[28,-14],[9,46],[-8,40],[-20,16],[20,55],[-22,25],[-3,50],[6,68],[24,4],[60,83],[-6,114],[-25,132],[9,43],[-20,68],[-17,-2],[-8,48],[28,4],[20,24],[28,80],[-12,65],[-30,36],[6,20],[-15,103],[32,108],[34,-7],[23,19],[-15,61],[41,44],[17,42],[-28,93],[-13,10],[-21,103],[-16,24],[-39,9],[-20,27],[-22,-20],[-43,47],[4,53],[52,5],[17,36],[32,-26],[49,36],[27,-38],[37,-12],[16,39],[2,107],[28,14],[-9,81],[-30,38],[-24,-7],[-18,30],[-45,-16],[-67,-4],[-13,46],[15,15],[-11,50],[7,45],[-14,58],[28,18],[28,104],[-32,76],[18,73],[26,27],[0,51],[-27,4],[-20,61],[-25,-9],[5,48],[-23,20],[11,71],[28,43],[17,70],[-45,66],[-12,39],[-18,10],[-21,65],[-19,34],[-6,73],[19,113],[-6,28],[25,58],[0,82],[-28,15],[0,55],[-11,43],[3,41],[25,40],[31,-4],[9,-34],[55,56],[-19,108],[6,23],[-6,70],[8,36],[-7,57],[-27,69],[12,29],[4,59],[-20,108],[14,59],[-10,64],[19,71],[-25,64],[11,57],[-17,53],[-8,68],[24,42],[10,40],[-8,38],[16,108],[19,-21],[23,52],[-8,49],[-17,-8],[-23,65],[8,56],[28,15],[9,31],[0,56],[21,68],[-26,32],[0,71],[-8,76],[9,59],[30,-48],[20,0],[11,37],[-20,35],[17,30],[11,87],[16,74],[-12,85],[5,81],[-11,40],[4,43],[44,49],[8,32],[25,7],[15,31],[46,-6],[13,44],[-3,34],[19,41],[-6,44],[-31,66],[-17,165],[7,31],[-19,144],[-14,13],[2,43],[-15,37],[1,60],[-15,42],[5,48],[18,31],[2,93],[-23,67],[-4,66],[26,43],[-3,101],[-9,53],[6,50],[9,179],[20,21],[1,124],[23,-19],[14,20],[4,55],[20,2],[29,-23],[1,56],[19,76],[30,73],[12,-27],[19,17],[4,73],[-4,127],[29,41],[-28,136],[9,18],[-16,99],[-7,110],[-27,10],[6,69],[20,0],[31,51],[-4,59],[34,184],[-16,17],[24,63],[2,50],[24,90],[14,11],[20,56],[-7,71],[17,32],[14,-29],[32,31],[3,26],[-18,49],[6,97],[-15,59],[-2,117],[8,160],[11,22],[3,55],[14,63],[-8,40],[-33,14],[-24,-39],[-9,37],[-12,173],[14,6],[11,87],[-15,21],[-29,103],[-6,72],[13,65],[-8,52],[-23,25],[3,74],[-27,47],[2,78],[-21,75],[28,-4],[22,53],[-20,67],[-31,3],[-19,28],[-2,103],[-12,6],[-15,76],[2,117],[9,39],[-5,42],[10,113],[15,47],[13,-59],[32,111],[-8,56],[12,90],[11,140],[33,129],[5,47],[22,-22],[19,9],[14,33],[7,58],[13,31],[6,50],[-43,41],[14,44],[7,88],[-7,70],[10,58],[-18,57],[-9,174],[-13,14],[1,45],[20,42],[-1,35],[19,50],[25,7],[1,73],[10,53],[-4,41],[20,93],[-10,25],[2,49],[15,57],[-1,94],[7,44],[35,48],[19,105],[20,1],[21,38],[20,109],[15,4],[16,50],[23,220],[26,47],[-12,55],[17,25],[16,72],[4,93],[19,60],[32,4],[11,-46],[16,-11],[5,44],[21,-9],[4,27],[34,42],[15,78],[-20,89],[-62,221],[8,147],[49,78],[-27,338],[-19,55],[6,51],[-18,78],[17,58],[-5,73],[10,65],[24,33],[22,14],[-17,59],[-7,88],[-28,35],[-10,44],[26,126],[11,26],[14,70],[21,-4],[13,64],[261,264],[36,290],[56,452],[-53,133]],[[31338,23649],[15,66],[32,48],[-4,82],[15,0],[12,35],[41,39],[12,143],[15,20],[94,59],[16,30],[4,96],[10,61],[-1,52],[46,-29],[8,-60],[34,-11],[34,-101],[15,-25],[26,-1],[23,25],[28,-9],[133,5],[19,-28],[17,-1],[35,-51],[28,-1],[28,-70],[-8,-63],[20,-40],[3,-31],[20,-45],[-7,-77],[26,-111],[14,-6],[13,177],[41,162],[10,73],[36,171],[185,0],[126,1],[1,-104],[47,-67]],[[32600,24063],[2,-34],[23,-35],[8,-32],[46,-60],[34,-60],[-4,-50],[15,-29],[-3,-35],[34,-88],[21,-72],[5,-64],[17,-38],[19,-13],[13,-46],[16,-15],[4,-42],[20,-39],[16,2],[36,-97],[56,-52],[9,-36],[16,-5],[25,-45],[0,-32],[29,-109],[17,5],[24,-51],[28,-3],[37,-20],[5,-29],[24,-19],[8,14],[55,-67],[41,5],[26,18],[148,-217],[24,-67],[13,-9],[6,-44],[46,-58],[19,-43],[39,-27],[48,-81],[22,0],[14,-41],[30,6],[34,-40],[30,-87],[28,52],[28,-59],[16,-21],[20,1],[5,-32],[29,4],[30,-57],[21,-116],[39,-106],[-3,-54],[-11,-48],[-19,5],[-17,-35],[-21,-141],[-12,-6],[-9,-80],[8,-33],[-49,-71],[-14,-2],[-20,-105],[1,-57],[-17,-36],[-1,-98],[8,-47],[-2,-45],[-17,8],[4,-76],[-24,-41],[4,-35],[-49,-59],[7,-29],[-26,-46],[3,-48],[-27,-13],[-2,-45],[18,-22],[-4,-53],[28,15],[23,-10],[34,9],[10,17],[21,-17],[37,11],[37,-2],[18,-15],[11,-35],[29,6],[46,-75],[20,-11],[44,21],[25,-38],[50,-10],[33,52],[12,-3],[37,-62],[15,33],[26,14],[14,-16],[18,-70],[20,-29],[15,13],[18,63],[2,52],[23,23],[13,36],[33,18],[20,-32],[22,7],[13,-42],[30,-31],[13,43],[25,33],[6,71],[-10,49],[15,11],[5,40],[26,2],[-1,40],[21,55],[38,17],[13,-19],[18,23],[0,59],[20,39],[27,10],[5,74],[43,35],[-6,52],[6,34],[22,45],[3,52],[13,42],[-6,46],[14,23],[-14,60],[6,53],[-8,37],[16,21],[0,55],[10,56],[-20,101],[19,16],[-1,54]],[[33821,15495],[-1,-2],[-3,5],[2,5],[2,-8]],[[33725,15600],[31,24],[29,-10],[1,-65],[-29,13],[-32,38]],[[33729,15544],[-1,22],[-7,16],[3,17],[40,-57],[12,-77],[-14,8],[-14,27],[-4,20],[-15,24]],[[33766,15468],[8,-29],[-26,-23],[-39,24],[11,68],[11,16],[13,-5],[4,-21],[13,-25],[5,-5]],[[33684,15665],[53,15],[37,-17],[-18,-33],[-42,-28],[-13,9],[-17,54]],[[33703,15710],[45,51],[16,-19],[-13,-44],[-16,-6],[-32,18]],[[33554,15731],[7,34],[13,-32],[38,7],[3,-19],[18,-14],[-20,-35],[-59,59]],[[33540,15708],[-4,12],[-9,15],[3,16],[19,6],[6,-35],[52,-53],[14,-4],[-1,-8],[-9,-91],[-3,2],[-10,32],[-14,0],[-13,26],[1,9],[-11,22],[-13,24],[-3,21],[-5,6]],[[32256,764],[7,-44],[-47,-2],[-52,-40],[-22,42],[-37,-53],[-56,-30],[-30,71],[40,-10],[12,42],[36,-10],[18,29],[96,-6],[35,11]],[[30942,2248],[89,-211],[7,-36],[-29,-12],[-47,-89],[-6,-78],[24,-28],[47,-22],[35,5],[27,-62],[8,-70],[33,-102],[63,-91],[42,-50],[4,-62],[56,-81],[58,-65],[46,-36],[19,-30],[42,-28],[21,-57],[57,-101],[133,-84],[35,-32],[48,-17],[46,5],[76,22],[33,-18],[-20,-37],[-7,-81],[-33,-77],[-101,-19],[-9,32],[-69,2],[4,-42],[-37,-23],[-46,3],[-26,-32],[-43,-15],[-56,43],[-12,25],[-47,14],[-62,35],[-51,16],[-54,2],[-42,-14],[-39,19],[-58,8],[-67,37],[-29,-38],[-30,2],[-33,-32]],[[30942,646],[3,60],[-3,182],[0,398],[0,398],[0,564]],[[33842,25545],[7,48],[-6,27],[-11,145],[11,26],[-20,37],[-231,350],[-252,-5],[-175,-116],[-157,-65],[-157,-63],[-52,-326],[-96,-340],[2,-355],[-77,-621],[-28,-224]],[[31338,23649],[-107,-60],[-64,12],[-24,34],[5,65],[-2,75],[10,39],[-15,61],[-3,69],[-10,15],[5,82],[-10,73],[5,42],[-8,36],[-29,54],[3,152],[-33,119],[0,216],[-32,147],[-33,117],[-23,-6],[-16,48],[0,105],[29,59],[-24,56],[-11,-2],[-45,82],[-1,64],[18,8],[-11,93],[3,68],[-16,39],[34,21],[21,-1],[12,90],[-2,57],[-20,12],[-24,63],[17,28],[7,40],[44,147],[10,18],[-38,85],[-24,33],[-49,120],[-23,29],[-17,77],[7,67],[-15,74],[-3,46],[-12,33],[8,110],[-12,35],[-8,101],[3,40],[-21,46],[23,75],[-18,41],[-44,25],[-8,53],[-1,76],[-8,47],[-35,86],[0,76]],[[30703,27461],[0,89],[-41,80],[17,70],[29,50],[21,16],[-6,36],[17,26],[8,50],[33,85],[6,51],[47,45],[-12,65],[14,106],[53,55],[-44,108],[-40,-19],[-49,76],[-37,357],[31,97],[13,12],[1,70],[9,39],[22,45],[1,23],[-30,75],[-12,15],[-21,105],[4,49],[-3,51],[15,32],[18,6],[-5,53],[10,73],[22,8],[1,48],[15,43],[27,51],[-8,43],[14,67],[38,0],[-5,56],[-15,73],[-22,47],[-1,57],[17,58],[-30,56],[-10,55],[26,42],[22,123],[12,129],[-7,97],[6,55],[-7,18],[4,104],[8,40],[34,93],[-8,33],[25,98],[-89,416],[-80,330],[-85,353],[-2,15]],[[30067,52939],[6,46],[-14,66],[25,110],[-27,26],[-31,57],[7,34],[-32,91],[8,17],[44,-16],[6,53],[13,11],[4,110],[-16,54],[-15,14],[38,99],[14,9],[3,78],[-14,7],[-22,58],[25,82],[-7,71],[-11,36],[-4,76]],[[30067,54128],[11,36],[0,56],[18,36],[32,31],[54,-47],[31,-12],[7,23],[27,-9],[13,50],[21,8],[12,-17],[25,0],[23,-51],[50,-57],[38,21],[17,-28],[23,-62],[43,-28],[19,7],[8,31],[19,7],[25,-27],[-1,-68],[18,-130],[13,-40],[19,-27],[37,16],[11,20],[38,-3],[11,-14],[25,21],[16,-33],[2,-73],[-113,27],[-3,-89],[36,-7],[35,-20],[35,-33],[37,3],[13,-22],[20,23],[23,6],[51,-52],[20,-42],[32,-81],[23,-35],[39,-82],[-2,-37],[-19,-75],[-12,-27],[-11,-64],[-31,31],[-16,-117],[-21,-3],[-31,114],[-33,31],[-29,-17],[-36,24],[-2,20],[-36,-20],[-49,-15],[-25,31],[-78,18],[-41,-45],[-34,-125],[-69,1],[-29,-31],[-20,47],[-2,106],[-23,18],[-23,-61],[-30,1],[-17,-61],[-40,38],[-14,-45],[15,-69],[-11,-64],[-36,-119],[-24,-38],[-19,-55],[4,-52],[-15,-65],[-22,85],[-15,27],[-25,-6],[4,48],[-12,106],[-24,43]],[[30899,53025],[-1,32],[32,-27],[-10,-32],[-21,27]],[[30067,52939],[-46,113],[-36,34],[-40,-11],[-49,9],[-41,-14],[-13,-31],[-20,14],[-31,-5],[-11,-28],[-27,3],[-34,27],[-21,-1],[-23,18],[-52,4],[-5,40],[-33,-11],[-2,-16],[-56,-15],[-33,-44],[-6,-35],[14,-55],[-31,3],[-13,73],[-39,82],[-28,36],[-19,10],[-14,-19],[-17,9],[-21,36],[-7,49],[3,54],[13,70],[-3,20],[47,39],[32,-6],[20,-37],[30,-8],[16,-24],[17,4],[15,-24],[21,25],[23,-10],[12,-41],[36,19],[60,-38],[28,2],[13,-25],[34,16],[50,-26],[23,0],[23,87],[57,4],[20,-8],[-1,51],[7,47],[-34,27],[-5,28],[-21,13],[-29,102],[-22,25],[-3,26],[-21,29],[-2,26],[25,16],[8,28],[-17,26],[-3,74],[16,12],[2,38],[13,27],[-11,60],[-19,-4],[-23,57],[-30,31],[-28,41],[-19,-8],[-21,28],[-8,-23],[-36,-4],[-25,48],[7,75],[54,64],[19,33],[35,-10],[72,25],[52,-37],[17,-36],[60,-63],[20,18],[20,-37],[12,12],[14,-47],[37,14],[10,15],[42,-26]],[[29733,54388],[7,16],[37,10],[43,-43],[1,-26],[-88,43]],[[29638,53573],[26,39],[42,-33],[16,-29],[36,-31],[17,-39],[1,-57],[-33,27],[-20,1],[-36,54],[-32,24],[-17,44]],[[35175,15811],[-29,-72],[-11,-47],[-12,-113],[-28,-54],[-28,-76],[-9,-40],[4,-72],[-28,-22],[-50,-73],[-27,-72],[-81,-77],[-51,-62],[-87,-83],[-35,50],[-59,-8],[-16,56],[-16,15],[-37,-5],[-19,18],[-55,0],[-24,-20],[-51,-71],[-27,-22],[-10,33],[-33,-10],[-30,51],[13,32],[-19,21],[-31,-5],[-33,35],[-40,17],[-64,111],[-23,60],[-94,15],[-18,-19],[-13,21],[-39,-27],[-32,-7],[-15,34],[-1,34],[-50,137],[-37,16],[-6,64],[-27,77],[-24,37],[-4,67],[3,122],[-4,90],[12,51],[-7,70],[18,27],[0,139],[28,19]],[[29684,56083],[18,20],[31,-32],[37,-11],[27,-33],[-14,-40],[-25,53],[-37,10],[-16,-28],[-21,61]],[[29702,55417],[21,51],[23,-36],[-38,-60],[-6,45]],[[29688,55234],[16,63],[15,4],[-2,-93],[-19,-65],[-21,-101],[-25,-8],[-8,17],[-29,-30],[-32,-9],[-15,18],[-33,-11],[-8,60],[31,61],[24,25],[31,71],[12,-49],[24,-23],[25,20],[14,50]],[[29450,56265],[7,37],[24,-70],[6,-60],[-23,-69],[-21,-85],[-27,5],[3,43],[23,9],[8,39],[21,11],[6,62],[-27,78]],[[29374,56306],[-22,43],[7,35],[21,-21],[13,-41],[31,-5],[6,-40],[-33,0],[-23,29]],[[29317,57308],[6,-35],[-5,-46],[-16,-43],[-10,18],[2,66],[23,40]],[[29073,56989],[16,-31],[20,-73],[5,-56],[24,-93],[11,-130],[12,-27],[24,-10],[22,-69],[7,-81],[-9,-25],[-27,147],[-29,20],[-1,36],[-22,46],[11,54],[-10,75],[-23,41],[-8,74],[-13,35],[-10,67]],[[29036,57444],[18,7],[31,-124],[-38,-3],[11,51],[-8,53],[-14,16]],[[28889,56997],[40,-93],[-43,29],[3,64]],[[28846,57933],[4,-111],[-21,32],[4,53],[13,26]],[[28551,58921],[7,66],[17,56],[-34,35],[-26,12],[5,50],[-29,13],[-6,30],[4,56],[19,-55],[18,-27],[3,-42],[68,-74],[-2,-86],[10,-34],[-43,-119],[-6,-117],[4,-132],[-10,-9],[-21,102],[-15,38],[40,76],[-8,53],[11,31],[-6,77]],[[28521,57990],[12,-43],[-45,-27],[-30,22],[33,51],[30,-3]],[[28461,57100],[-19,9],[1,33],[23,22],[-5,-64]],[[28406,57150],[-17,51],[11,40],[12,-2],[12,61],[20,67],[14,-73],[7,-79],[-3,-44],[-21,3],[0,-29],[-15,-33],[-20,38]],[[28396,57387],[2,23],[25,24],[12,-62],[-27,-34],[8,-33],[-4,-53],[-41,59],[25,76]],[[28394,57489],[19,35],[8,-63],[-27,28]],[[28365,57564],[-15,14],[-8,-41],[21,-8],[-2,-64],[-30,-16],[-11,-37],[-15,65],[-78,122],[-22,51],[15,24],[28,-29],[22,43],[-11,96],[22,82],[6,78],[-14,98],[19,20],[10,-20],[21,21],[19,-71],[-9,-68],[19,-50],[8,-57],[41,-101],[1,-103],[5,-60],[-41,-36],[-1,47]],[[28206,59157],[27,-16],[68,12],[20,22],[39,2],[-1,-31],[-18,-25],[-44,-5],[-33,-21],[-41,-8],[-51,-46],[-22,-32],[-24,32],[30,31],[23,94],[27,-9]],[[32011,63179],[6,23],[11,-11],[-21,-40],[-5,23],[9,5]],[[27064,56281],[-17,-7],[-30,19],[-16,-9],[0,-51],[-42,-42],[-9,-20],[-35,-30],[-13,-83],[-30,-16],[-14,-52],[-43,-67],[-26,40],[-26,-46],[-13,10],[-37,-17],[-20,7],[-24,-67],[-2,-97],[-12,-33],[-29,12],[-38,-29],[-42,-83],[-22,22],[16,54],[-4,27],[-25,13],[-47,-41],[-23,-46],[-30,13],[50,60],[11,29],[34,19],[6,16],[56,-19],[25,14],[-7,54],[-15,12],[1,45],[-12,14],[-3,114],[37,105],[16,26],[50,104],[31,39],[55,50],[15,-3],[19,32],[28,20],[15,28],[14,-16],[22,60],[24,30],[25,-31],[2,31],[37,-27],[21,19],[7,30],[43,-1],[56,27],[38,63],[25,18],[85,9],[19,-18],[40,-8],[50,5],[14,-9],[16,-68],[16,30],[46,32],[30,-82],[38,22],[26,-9],[38,16],[12,23],[34,-8],[30,-69],[38,-39],[9,11],[34,-40],[29,34],[28,-18],[46,-67],[4,-28],[31,-7],[24,-24],[12,-75],[27,-80],[46,-83],[29,-23],[34,-4],[26,20],[60,-9],[14,-46],[24,22],[35,-36],[10,-37],[-20,-14],[-27,25],[-3,-29],[19,-43],[23,8],[17,-12],[43,16],[24,-32],[21,-4],[27,-40],[18,-75],[22,-41],[6,72],[-12,29],[-2,61],[-35,36],[6,43],[17,8],[40,-80],[3,-37],[46,-38],[11,-31],[-15,-42],[-59,50],[-6,-106],[17,25],[22,-26],[10,-45],[30,-20],[16,3],[76,-149],[10,-80],[43,4],[-6,62],[12,43],[45,-109],[32,-56],[-27,-25],[4,-38],[20,18],[3,37],[25,3],[21,-14],[21,-53],[-13,-39],[28,-33],[4,76],[35,-3],[44,-50],[25,-39],[3,-50],[29,1],[57,36],[26,-6],[27,-39],[13,-46],[-14,-68],[-26,9],[-2,-73],[-14,15],[3,-107],[17,-5],[12,37],[44,-42],[9,40],[65,-12],[50,-37],[22,16],[13,-24],[51,-30],[5,-44],[44,-69],[22,-84],[11,4],[18,-35],[20,-4],[23,19],[24,-46],[0,-55],[-23,-32],[-10,-45],[-29,7],[-57,-24],[-40,5],[-33,-14],[-13,-32],[-38,-58],[-77,-19],[-55,0],[-31,10],[-28,46],[-46,6],[-25,-9],[-31,6],[-42,22],[-35,-26],[-18,8],[-44,-18],[-27,12],[-32,-20],[-22,3],[-34,-37],[-38,5],[-20,17],[-32,-4],[-8,-38],[-74,-10],[-19,-13],[-15,26],[34,122],[29,48],[33,77],[56,56],[7,31],[23,46],[13,68],[6,74],[-14,-5],[-19,24],[-25,60],[-28,17],[-41,-17],[-28,11],[-14,-19],[-49,20],[-28,21],[-11,-30],[-26,5],[-24,32],[-5,40],[-29,47],[-24,71],[-11,-9],[-20,44],[-3,57],[-11,41],[0,86],[-10,37],[-12,105],[-26,77],[-30,39],[-40,-29],[-32,9],[-51,-38],[-22,8],[-25,32],[-12,-12],[-23,43],[-57,21],[-11,18],[-30,12],[-6,21],[-23,-12],[-20,16],[-2,29],[-32,16],[-38,49],[-37,101],[9,36],[-16,49],[-20,-9],[16,-47],[-37,-24],[-41,9],[-39,-15],[-24,5],[-40,44],[-8,84],[-15,-11],[-26,-46],[-14,0],[-24,36],[-60,11],[-37,-19],[-20,14],[-2,30],[-57,68],[-23,46],[6,20],[76,-2],[41,19],[16,28],[4,60],[-39,53],[-10,31],[-31,-15],[-22,4],[-28,-15],[-26,24],[-43,6],[-33,-13],[-29,8]],[[28499,55618],[23,-14],[13,-38],[27,-27],[19,-38],[-16,-29],[-44,49],[-21,54],[-1,43]],[[28285,56078],[23,-13],[-1,-67],[-20,10],[-2,70]],[[28209,56169],[19,10],[18,-45],[-7,-44],[-16,34],[-36,-12],[-8,33],[30,24]],[[26964,55716],[24,17],[41,-36],[3,-56],[15,-19],[1,-74],[15,-30],[5,-43],[-21,-40],[-39,-35],[-31,-18],[-55,23],[7,43],[26,26],[-6,62],[-27,111],[24,60],[18,9]],[[25842,54558],[-16,47],[2,41],[25,99],[15,-9],[37,8],[-44,-147],[-19,-39]],[[22978,58615],[37,4],[-6,-160],[-9,-66],[-39,-172],[-34,17],[-21,-2],[-3,-78],[-15,1],[-5,42],[-16,6],[-14,-89],[16,-56],[-22,-138],[18,-10],[14,-38],[-23,-70],[4,-105],[-11,-131],[-9,51],[-22,-12],[0,-72],[12,-47],[17,29],[1,-78],[-8,-142],[3,-186],[-3,-53],[1,-131],[5,-8],[-4,-132],[2,-284],[-2,-81],[-10,-81],[-8,-12],[-16,-84],[7,-63],[3,-76],[10,-94],[9,-37],[-15,-40],[-15,8],[-4,61],[-18,15],[-7,-41],[32,-138],[12,2],[-4,56],[17,39],[7,-117],[16,-114],[-4,-43],[7,-36],[6,-88],[30,-140],[17,5],[0,-52],[40,-217],[-11,-24],[14,-62],[16,-22],[19,-87],[14,-118],[25,-83],[30,-63],[8,-33],[66,-173],[39,-121],[3,-25],[32,-87],[12,-89],[11,-127],[14,-45],[-3,-45],[7,-65],[33,-55],[24,-71],[-3,-37],[22,-31],[15,0],[11,-120],[18,-39],[32,-31],[24,-35],[27,-17],[106,-9],[56,-107],[42,-10],[10,-13],[18,-98],[31,-73],[4,-66],[34,-32],[44,13],[44,26],[85,67],[-7,-32],[24,-31],[19,64],[36,-9],[15,45],[25,-7],[31,57],[40,-31],[11,-32],[24,6],[3,68],[22,-2],[39,20],[26,44],[23,64],[47,22],[9,-26],[22,44],[44,8],[27,-10],[2,-60],[45,-47],[45,-13],[31,-35],[41,-5],[15,10],[8,39],[38,31],[11,20],[2,49],[13,42],[1,39],[-33,34],[2,59],[-10,9],[68,87],[13,30],[51,84],[44,105],[10,94],[-2,72],[7,50],[-6,32],[13,59],[48,84],[11,58],[-10,74],[3,37],[-3,275],[15,134],[-2,27],[24,118],[11,69],[32,73],[47,53],[8,-5],[34,44],[58,21],[1,35],[77,32],[60,16],[43,3],[57,30],[29,1],[23,47],[70,38],[65,51],[4,23],[44,-10],[42,-41],[67,-42],[22,-8],[74,-47],[17,0],[17,31],[6,86],[21,-26],[32,-100],[11,-114],[13,-47],[-7,-96],[5,-14],[-9,-88],[-49,-165],[-36,-91],[-29,-52],[-18,-60],[-12,-70],[-16,-49],[-13,-78],[-19,0],[7,-78],[14,-67],[-12,-72],[-21,-17],[-21,-76],[-22,-12],[-4,-49],[21,-38],[39,7],[17,-19],[-12,-72],[-33,-31],[-13,-53],[1,-80],[13,-17],[26,93],[-4,-159],[-22,-113],[-11,-113],[-12,-42],[-14,-210],[-31,-113],[-1,63],[-14,61],[-25,19],[-7,54],[13,97],[0,77],[-20,61],[-25,-78],[-20,-121],[-15,-66],[-24,-7]],[[25452,53263],[-28,7],[-12,-21],[-8,-74],[-17,-49],[-3,-50],[-20,-21],[-8,-95],[-14,-32],[-26,-88],[-37,47],[-12,31],[-32,-45],[0,-89]],[[25235,52784],[-152,0],[-151,0],[-207,0],[0,-405],[-125,0],[3,-25],[41,-26],[3,-49],[57,-134],[0,-15],[36,-31],[63,-103],[8,-21],[10,-87],[16,-69],[22,-1],[5,-31],[20,-1],[5,-27],[-10,-57],[-5,-86],[7,-18],[-4,-63],[-185,0],[-173,0],[-133,-583],[42,-136],[-11,-43],[-14,-15],[3,-70],[-12,-34],[9,-133],[-10,-60],[-12,-32]],[[24381,50429],[-10,51],[-16,13],[-25,54],[-71,198],[4,36],[-19,8],[-9,96],[-76,118],[-35,84],[2,46],[-28,42],[-10,-9],[-35,86],[-1,68],[-29,-2],[-25,60],[-15,13],[5,44],[-12,30],[-26,-30],[-24,67],[-6,38],[-26,9],[-31,31],[-9,62],[-21,-26],[-38,37],[-10,44],[-19,-60],[14,-27],[84,-66],[17,-51],[-61,71],[-64,48],[-61,21],[20,40],[11,45],[-25,26],[-27,-29],[-20,76],[-23,-10],[-11,-56],[-15,-4],[-23,-70],[15,-8],[49,8],[3,-15],[-58,-22],[-19,4],[-26,-22],[-20,-46],[-15,-15],[-3,-39],[-18,-31],[-34,-12],[-29,-34],[-30,-12],[-8,-16],[-45,-33],[-44,-46],[-34,-57],[-51,9],[-20,-27],[-21,6],[-37,36],[-42,16],[-47,51],[-10,36],[-38,42],[-34,18],[-13,-5],[-51,29],[-23,36],[-38,-37],[-22,33],[-63,115],[-1,27],[-95,36],[-40,39],[-1,13],[-35,83],[-21,69],[-23,-18],[-50,36],[-6,36],[-37,-5],[-74,42],[-43,1],[-39,40],[-24,47],[-5,34],[-19,-2],[-18,44],[-164,144],[-120,103],[-13,38],[-41,87],[-70,74],[-10,58],[-28,15],[-14,23],[-10,61],[-18,29],[-18,70],[-59,69],[-21,-2],[-23,-49],[-40,43],[-79,53],[-49,24],[-56,65],[-35,15],[-38,29],[-67,68],[-24,124],[-33,72],[1,31],[-23,80],[-8,-4],[-45,83],[-40,53],[-62,57],[8,44],[-22,26],[-16,-22],[-13,27],[-54,37],[-13,45],[-21,-3],[3,43],[-23,-9],[-16,20],[-23,49],[-4,47],[-13,44],[-3,40],[-47,84],[-22,85],[-42,137],[-16,77],[-1,88],[-34,90],[-6,47],[22,43],[28,17],[52,14],[19,31],[7,42],[-31,104],[-14,-17],[-32,26],[31,114],[23,57],[21,27],[7,108],[-6,110],[14,76],[-15,52],[1,25],[-31,10],[-39,103],[2,55],[12,61],[-7,67],[-18,-25],[8,-54],[-16,-12],[-25,113],[23,-3],[7,-27],[19,8],[37,110],[5,55],[-14,14],[-13,-24],[-17,4],[-33,66],[-7,42],[5,84],[-14,69],[10,29],[-6,90],[-26,29],[-12,-14],[21,-88],[-1,-58],[-12,3],[-23,83],[-33,82],[-25,40],[-29,88],[-86,202],[-20,106],[-28,66],[-19,65],[-31,58],[4,18],[-25,84],[-2,32],[-44,107],[-30,91],[-44,64],[-8,42],[-21,-10],[-21,46],[5,68],[-20,80],[-12,-23],[-38,23],[-9,48],[-24,28],[-35,4],[-11,61],[24,3],[4,44],[-11,35],[5,51],[-7,75],[-19,-11],[2,49],[-23,36],[-17,-2],[-45,109],[-1,27],[-40,-19],[-35,56],[-39,92],[-8,47],[-38,12],[4,-43],[-44,25],[37,70],[-6,31],[-21,-13],[-9,-41],[-24,17],[-4,40],[-17,20],[-16,-7],[-15,62],[-12,3],[-22,125],[15,90],[29,33],[18,95],[32,-26],[-8,82],[-29,41],[-14,99],[-40,93],[-2,31],[-32,11],[-1,-22],[-37,-15],[-23,25],[-22,59],[-19,198],[-30,42],[-9,-32],[-42,35],[-42,58],[-18,38],[-13,76],[-13,20],[-22,127],[-3,50],[14,51],[-12,34],[24,58],[-14,23],[-30,8],[-49,41],[-6,-69],[-42,80],[-14,-19],[-27,42],[-28,62],[-31,135],[-19,32],[-14,56],[-57,48],[-15,95],[-40,80],[15,37],[3,38],[-24,4],[-28,34],[-5,30],[-28,61],[-4,90],[-11,47],[-2,61],[-19,57],[-26,-12],[-13,35],[11,57],[-2,32],[-25,66],[-48,176],[-4,40],[-23,17],[4,61],[-7,40],[2,77],[-7,43],[-22,35],[3,54],[-7,66],[-33,69],[-25,96],[-13,104],[10,120],[11,33],[-5,86],[-35,55],[-47,29],[-51,22],[-21,22],[3,36],[-7,71],[-9,23],[-60,69],[-14,2],[-25,-83],[-35,1],[-36,38],[-15,37],[-32,36],[-40,78],[-26,3],[-18,37],[-4,6],[-10,-1],[-4,-68],[10,-69],[-21,-93],[1,-81],[-8,-60],[0,-134],[16,-54],[-2,-30],[31,-45],[8,-139],[-2,-78],[13,-54],[6,-95],[-11,-162],[19,-65],[19,-101],[33,-55],[7,-81],[22,-27],[29,2],[13,-37],[46,-82],[45,-101],[17,-21],[40,-111],[-8,-33],[32,-105],[-6,-28],[10,-92],[12,35],[16,6],[16,-57],[3,-49],[26,27],[17,-30],[2,-38],[18,-102],[7,-69],[28,-37],[28,15],[15,-67],[-7,-74],[24,-58],[-7,-58],[14,-85],[1,-109],[15,-66],[31,-76],[18,-8],[43,-53],[12,-34],[8,-94],[29,-96],[8,-60],[42,-34],[8,-45],[-8,-48],[16,-63],[23,-49],[4,-31],[-13,-50],[29,-68],[18,-63],[17,33],[-38,98],[-2,125],[21,-35],[28,-73],[23,-34],[-2,-90],[32,-35],[-4,-80],[21,-51],[-1,-61],[12,-90],[10,-39],[-7,-36],[-3,-69],[14,-114],[22,-32],[9,-80],[22,-64],[27,-7],[-3,-46],[33,-218],[26,-82],[15,-14],[29,-148],[-9,-68],[-14,-63],[3,-79],[10,-31],[3,-79],[19,-75],[14,-31],[38,-27],[3,-47],[18,4],[13,46],[-8,80],[10,45],[17,-7],[16,-63],[47,-69],[5,-77],[17,-16],[27,23],[0,-100],[34,-84],[3,-102],[62,-74],[-1,-30],[15,-49],[0,-104],[-9,-77],[-21,-62],[-36,-35],[-20,-52],[-51,-84],[-18,6],[-20,45],[-13,57],[-15,147],[-2,58],[-28,119],[-31,85],[-53,61],[-32,64],[-38,103],[-57,131],[-24,41],[-101,141],[-9,36],[-31,54],[-11,70],[-38,-18],[-13,65],[-33,96],[-23,-12],[-12,19],[-1,81],[-8,57],[1,71],[-7,11],[5,76],[12,28],[5,301],[-37,241],[-28,51],[-14,84],[-19,52],[-24,-12],[-86,135],[-2,33],[-23,44],[-32,23],[-13,27],[-1,41],[-19,54],[-4,45],[5,71],[-16,57],[-5,-85],[-15,-11],[-2,-59],[-55,54],[-31,-89],[-31,64],[-13,3],[-16,91],[-20,36],[-22,16],[-21,-11],[-30,93],[-20,22],[-25,1],[-55,60],[-1,91],[-5,38],[-25,49],[-38,33],[-12,56],[-64,90],[-13,68],[36,9],[39,-14],[23,-19],[56,-11],[26,32],[26,-10],[4,-40],[18,-37],[21,-17],[15,-59],[24,51],[17,-3],[11,36],[-17,37],[-37,-33],[-18,61],[14,57],[-3,22],[27,82],[-17,25],[14,44],[0,77],[-20,22],[18,106],[4,43],[-38,137],[-25,5],[-19,50],[-19,94],[-22,49],[-16,1],[-16,42],[-9,76],[-22,10],[-9,51],[-21,36],[-41,103],[-27,27],[-35,11],[-16,61],[-37,35],[-21,45],[-13,-7],[-21,52],[-33,48],[4,60],[-16,78],[-17,18],[6,83],[-6,45],[2,72],[-19,84],[-51,72],[6,118],[-12,128],[-29,35],[-26,75],[-18,18],[6,117],[-22,92],[-26,61],[-11,49],[-38,66],[-8,31],[11,63],[-11,32],[21,29],[1,58],[-24,49],[-16,13],[-3,40],[-24,14],[-10,33],[0,71],[-13,79],[-25,19],[-26,143],[-2,48]],[[22948,55452],[-23,52],[-29,123],[68,-155],[-6,-81],[-18,-97],[-8,23],[16,80],[0,55]],[[20656,55994],[-6,-6],[-16,130],[17,-11],[5,-113]],[[20429,55386],[-2,36],[25,-9],[-4,-45],[-19,18]],[[20378,55519],[-1,46],[30,-26],[6,-42],[-9,-26],[-23,26],[-3,22]],[[19962,57914],[21,6],[4,-82],[-25,76]],[[19467,57423],[9,18],[24,-109],[-18,-8],[-15,99]],[[19337,57560],[14,34],[13,-36],[-10,-50],[-17,52]],[[19255,57949],[30,-1],[8,-103],[-31,53],[-7,51]],[[19170,53538],[19,-48],[0,-48],[-25,14],[-10,27],[16,55]],[[19121,58667],[22,-1],[-41,-123],[19,124]],[[18938,57556],[20,-21],[2,-68],[-63,123],[29,2],[12,-36]],[[18845,58063],[-6,-92],[3,-39],[-8,-55],[3,-37],[-28,-36],[24,157],[12,102]],[[18782,60949],[23,16],[8,-63],[19,-72],[-1,-50],[-18,-130],[-11,-27],[-74,91],[25,63],[-5,37],[5,84],[9,46],[20,5]],[[18454,61172],[24,13],[35,-103],[-7,-29],[10,-37],[45,-4],[1,-116],[18,-52],[-1,-49],[-36,57],[-21,65],[-21,32],[-13,52],[-18,35],[-24,82],[8,54]],[[18112,62823],[9,0],[13,-46],[14,-23],[-8,-31],[-18,17],[-13,42],[3,41]],[[17996,60356],[14,-82],[1,-88],[-8,-75],[-45,60],[31,82],[-3,78],[10,25]],[[17150,60940],[-6,-58],[15,-38],[2,-66],[-16,-57],[-11,109],[-13,28],[1,54],[28,28]],[[30101,55619],[-11,-43],[-14,42],[-27,-3],[-2,60],[44,-10],[10,-46]],[[30022,55746],[0,-86],[-35,81],[16,16],[19,-11]],[[29904,55614],[7,67],[17,-47],[-24,-20]],[[30541,49019],[8,26],[38,-90],[-17,-23],[-33,70],[4,17]],[[32479,53044],[8,52],[16,-18],[-24,-34]],[[32833,52319],[24,-52],[5,-45],[-38,-20],[-15,15],[-4,57],[15,45],[13,0]],[[32830,52704],[19,-47],[2,-64],[-31,37],[10,74]],[[31000,48832],[22,-32],[31,-24],[3,-72],[-12,-6],[-17,57],[-31,35],[4,42]],[[32542,52842],[11,14],[4,-13],[-13,-14],[-2,13]],[[25452,53263],[14,-42],[-23,-42],[20,-28],[26,23],[40,-24],[1,-84],[-3,-65],[-16,-49],[-11,-102],[-6,-88],[-16,-50],[-5,-97],[18,-43],[-19,-189],[-15,-2],[19,-136],[19,-68],[-17,-37],[4,-60],[-16,-46],[6,-34],[-32,-124],[1,-43],[-20,-70],[-17,-85],[-29,7],[-30,-37],[3,-54],[-30,-88],[-20,-30],[4,-62],[-25,-5]],[[25277,51409],[-48,11],[-15,-12],[7,265],[15,569],[-1,542]],[[30569,36978],[-45,123],[-18,77],[-14,19],[-16,71],[-25,21],[-20,-44],[-22,-19],[-14,48],[-21,-11],[-17,24],[105,429],[77,315],[-2,51],[-26,-3],[-17,40],[-3,48],[-35,56],[-17,-26],[-13,49],[-40,-18],[-18,51],[2,43],[-46,42],[-15,52],[-22,2],[-23,-32],[-23,-16],[1,-31],[-21,-33],[-27,28],[-15,-31],[-19,33],[-6,33],[-53,59],[-24,19],[-31,-11],[-13,-83],[-18,-33],[-18,-9],[-15,16],[-18,-44],[-26,-30],[-43,-28],[-8,50],[-44,10],[-21,33],[-7,-42],[-36,7],[-19,-24],[-26,37],[-55,95],[17,151],[-7,21],[2,103],[-10,49],[-27,-2],[-11,23],[-12,-31],[-15,32],[-12,-11],[-11,39],[-21,27],[19,72],[-2,50],[-22,77],[-17,111],[-34,21],[-11,-17],[-24,24],[-10,71],[-14,-4],[-20,50],[-40,40],[-29,19],[2,99],[-6,33],[-23,42],[10,43],[-11,16],[-5,81],[-54,113],[-24,9],[-17,30],[-7,76],[-9,25],[-28,-39],[-35,70],[-15,44],[-37,30],[-14,-53]],[[29095,39925],[-37,11],[-53,58],[-12,46],[-42,-2],[-21,62],[-7,4],[-50,144],[-14,-14],[-6,38],[-18,4],[-34,44],[-5,-32],[-22,-7],[0,-99],[-25,-4],[-8,15],[-21,-19],[-5,22],[-30,20],[-30,-35],[-17,4],[-27,31],[-22,-2],[-12,68],[-49,-12],[-34,42],[-28,0],[0,70],[9,48],[-1,54],[-18,-10],[-39,66],[9,50],[-14,29],[-42,-36],[-28,17],[-39,74],[-21,7],[-7,48],[-20,38],[-4,82],[-28,-14],[-31,31],[-11,35],[-26,18],[-6,32],[-24,50]],[[28125,41001],[-13,50],[3,27],[-12,61],[-18,-7],[-22,33],[-2,24],[15,62],[20,34],[29,-37],[15,8],[32,-11],[13,55],[-6,71],[-19,85],[-14,16],[7,139],[9,19],[9,94],[18,-7],[23,34],[10,-20],[36,-6],[34,65],[17,15],[4,40],[43,56],[13,-60],[7,-7],[3,3],[2,6],[13,-3],[2,7],[0,4],[-9,50],[22,73],[3,43],[19,57],[-3,67],[8,73],[13,21],[9,42],[17,-20],[11,77],[7,7],[4,24],[5,37],[17,63],[11,65],[14,43],[36,59],[1,98],[15,34],[3,45],[-18,-8],[-24,-40],[-16,-5],[-14,21],[-4,64],[23,32],[13,36],[-6,35],[-18,-7],[-11,-39],[-9,-69],[-24,100],[-3,41],[25,47],[-11,84],[13,117],[14,40],[-9,28],[13,39],[0,55],[-26,185],[-2,85],[8,45],[-1,146],[-7,88],[-44,10],[13,87],[44,15],[17,45],[13,70],[-18,44],[-13,113],[-27,73],[-13,59],[7,61],[13,-31],[8,35],[4,103],[10,103],[-19,41],[-2,46],[-22,9],[-17,25],[-11,61],[-26,41],[-5,46],[11,39],[-15,62],[-33,55],[-15,44]],[[28365,45185],[26,174],[25,35],[-13,75],[1,46],[13,10],[14,-28],[11,-81],[11,-23],[21,54],[50,225],[37,14],[4,41],[-13,24],[-2,58],[-12,88],[-20,45],[-4,59],[-10,60],[-18,43],[16,62],[-5,41],[12,20]],[[28509,46227],[22,-72],[11,-72],[32,-43],[27,-114],[14,3],[10,-60],[-11,-50],[13,-31],[-14,-21],[-4,-29],[1,-21],[-3,-16],[-6,-45],[-3,-44],[-4,-6],[-1,-21],[10,-16],[4,16],[-12,12],[8,31],[-2,24],[9,26],[1,-3],[2,-1],[2,4],[4,0],[1,4],[-1,5],[2,7],[1,2],[-1,3],[-1,5],[2,4],[0,7],[-1,7],[3,11],[2,17],[5,-13],[1,-51],[42,-6],[13,53],[-5,58],[1,76],[-9,71],[4,87],[-14,63],[-28,39],[6,64],[25,6],[42,31],[4,42],[21,17],[34,67],[6,31],[20,18],[21,57],[3,40],[18,45],[6,83],[17,26],[8,50],[31,22],[10,33],[13,-14],[5,-46],[33,62],[35,-18],[1,42],[16,107],[-11,59],[-11,19],[6,112],[16,69],[8,103],[7,42],[-5,93],[2,89],[13,16],[-6,73],[11,62],[16,39],[33,24],[4,62],[31,25],[29,46],[11,58],[13,7],[10,39],[27,9],[25,-54],[29,27],[17,-20],[-2,-49],[-10,-47],[-4,-60],[28,-99],[15,4],[12,54],[14,14],[14,82],[16,16],[3,94],[13,49],[-6,31],[-1,75],[14,58],[39,33],[71,-66],[118,4],[25,17],[41,79],[29,71],[48,54],[5,42],[31,51],[47,30],[6,20],[25,7],[56,84],[28,143],[0,102],[16,-4],[31,17],[-4,-77],[33,33],[-9,86],[40,13],[8,28],[32,47],[19,2],[73,-70],[15,-50],[30,-134],[-5,-57],[-24,-30],[-29,-83],[-5,-1],[0,0],[-1,-3],[0,0],[-4,-2],[0,0],[-7,-8],[0,0],[0,-9],[2,-3]],[[28650,45787],[-20,-19],[-3,-15],[-4,-20],[-3,-9],[0,-5],[2,-5],[-3,-10],[0,-5],[2,-1],[0,-3],[-1,-3],[-1,-3],[1,-10],[-5,0],[-2,-4],[-2,1],[0,3],[-1,10],[-3,14],[4,11],[-1,18],[4,34],[18,30],[18,-9]],[[28474,43000],[17,92],[13,-15],[8,-58],[-15,-17],[-23,-2]],[[28481,42314],[-9,57],[25,-6],[-6,-23],[-8,-12],[-2,-16]],[[28370,41883],[20,-5],[5,-31],[-1,-6],[-6,4],[-7,-1],[-3,-8],[-9,8],[1,39]],[[30819,48754],[-29,72],[1,69],[20,-25],[14,-84],[15,-32],[34,-15],[26,-79],[-17,-15],[-48,66],[-16,43]],[[32929,51222],[18,-30],[23,-16],[14,-40],[4,-133],[-8,-63],[-25,-10],[-10,93],[-20,97],[4,102]],[[32941,51816],[2,-57],[8,-33],[25,-13],[8,-47],[-58,-43],[-17,13],[-6,52],[6,83],[-3,36],[18,41],[17,-32]],[[32962,51442],[13,43],[15,-13],[8,-61],[-21,-24],[-15,55]],[[32870,51709],[24,-25],[-1,-81],[8,-81],[-18,-60],[-24,-16],[-18,81],[-1,78],[-8,92],[17,44],[21,-32]],[[32888,48740],[-7,-82],[-10,-29],[-26,5],[1,67],[8,45],[18,36],[16,-42]],[[25468,51254],[6,6],[1,7],[-1,5],[7,24],[7,-21]],[[25488,51275],[0,-1],[-1,-3],[0,0],[1,-5],[-6,-13],[-10,-5],[-1,-2],[-3,8]],[[25277,51409],[21,-7],[0,-1],[27,-11],[49,-79],[5,-49],[23,86],[-1,95],[33,-68],[36,-53],[6,-31],[-2,-18],[0,-11],[-4,-4],[-2,-4],[0,-4]],[[25468,51250],[-8,-41],[-93,-198],[-47,-72],[-35,-76],[-51,-49],[0,-63],[-19,-105],[16,-42],[2,-146],[-22,9],[-18,-64],[-14,-20],[0,-33]],[[25179,50350],[-61,-3],[1,-72],[13,-54],[-16,-28],[-24,-12],[-16,-48],[-7,-60],[-18,19],[-20,-13],[-21,-52],[-17,-23],[-16,-44],[-10,-93]],[[24967,49867],[-47,58],[-14,3],[-35,60],[-8,-17],[-58,32],[-57,-19],[-87,14],[-26,16],[-62,66],[-33,62],[-39,47],[-65,137],[-20,77],[-25,7],[-10,19]],[[25488,51275],[-2,9],[2,-2],[0,0],[2,1],[23,-29],[30,62],[30,36],[19,51],[33,5],[9,16],[33,-47],[-11,-57],[53,10],[21,43],[56,-39],[66,-27],[26,7],[17,25],[31,-9],[51,16],[15,-21],[38,21],[18,40],[29,27],[29,-3],[32,43],[14,-12],[16,34],[28,-24],[27,-42],[27,-25],[53,10],[36,23],[34,54],[13,-1],[71,-67],[27,-15],[-4,-46],[39,-17],[8,25],[53,1],[61,-124],[32,-78],[-51,-1],[16,-70],[-10,-30],[8,-34],[53,-86],[21,14],[-13,43],[-32,21],[7,44],[59,-95],[4,-41],[36,62],[19,9],[46,-38],[22,-115],[20,-42],[2,-36],[-48,31]],[[26832,50785],[-59,-103],[-20,-4],[-43,-76],[-12,9],[-24,-28],[-60,-22],[-23,13],[3,-43],[-21,1],[-7,30],[-20,-60],[-11,-12],[-28,26],[-34,9],[-15,73],[-18,44],[-23,-9],[-12,-44],[-21,-30],[-9,-45],[8,-29],[-21,-41],[-13,18],[-2,-65],[-16,-71],[14,-59],[-8,-40],[-37,4],[-30,-106],[-22,-14],[-4,-29],[-20,-3],[-45,-54],[-3,-59],[-15,-27],[-7,50],[-19,6],[-36,50],[9,43],[-18,10],[-63,-167],[-9,-49],[-23,-8],[-46,20],[-39,1],[-13,-23],[-5,-66],[11,-17],[1,-167],[11,-66],[-14,-33],[-21,33],[-24,-38],[-2,-128],[-8,-32],[-19,-21],[-33,-8]],[[25794,49329],[-7,-1],[-3,0],[-18,76],[-18,23],[-35,25],[-5,67],[24,95],[-10,19],[-25,1],[-13,-30],[-17,52],[-19,25],[-5,-50],[-30,-4]],[[25613,49627],[21,38],[-5,33],[-16,7],[11,59],[0,63],[12,79],[-10,37],[-24,46],[-51,-20],[-16,73],[-46,2],[-7,-41],[-15,-28],[-49,-26],[-2,76],[-24,28],[-40,31],[1,46],[-28,-6],[-10,52],[-29,24],[-16,43],[-2,43],[-32,15],[-57,49]],[[25468,51250],[0,4]],[[28694,53107],[37,-45],[24,2],[34,-28],[35,-138],[1,-46],[-31,-35],[-17,14],[-35,-22],[-20,13],[-15,45],[-24,26],[-33,13],[-18,-97],[-28,21],[-2,25],[-30,-18],[-19,-91],[-55,73],[-29,-16],[-12,17],[-52,0],[-27,60],[2,35],[-18,34],[-13,-3],[-21,59],[-10,59],[-32,11],[-18,-19],[-34,34],[6,91],[27,50],[28,17],[15,-10],[43,-1],[5,44],[24,12],[39,-28],[103,-9],[43,-34],[31,-2],[26,-15],[39,-50],[5,-34],[26,-14]],[[32627,52295],[-17,-28],[-8,24],[6,55],[18,-18],[1,-33]],[[32543,52448],[9,51],[22,-35],[17,-69],[-33,21],[-15,32]],[[32475,52950],[1,28],[19,16],[-1,-38]],[[32494,52956],[-19,-6]],[[32736,51993],[-17,-17],[-7,27],[8,54],[16,-64]],[[26832,50785],[34,-25],[0,-2],[12,-6],[-13,-106],[-8,46],[-11,5],[-17,-51],[8,-59],[23,-1],[2,-65],[21,-150],[6,-72],[-18,-27],[-10,42],[-10,-75],[14,-22],[-19,-133],[-15,-31],[-31,-11],[15,-48],[-9,-110],[-17,-56],[-16,-13],[13,-66],[13,-29],[-8,-53],[-6,-112],[2,-82],[16,-227],[-10,-158],[2,-74],[14,-67],[-4,-57],[-16,7],[-22,59],[0,44],[16,15],[2,80],[8,61],[-5,35],[-27,4],[11,-52],[6,-68],[-29,-68],[-21,-16],[12,-36],[1,-100],[23,12],[-10,-130],[0,-113],[-15,41],[-9,-89],[-19,-50],[17,-55],[21,39],[15,-185],[-29,-25],[-13,-85],[-18,-32],[-3,-43],[10,-138],[21,-114],[19,-38]],[[26751,47850],[1,0],[3,-14],[3,-84],[-11,-4],[-58,-59],[-24,38],[-34,2],[-26,25],[-1,52],[-27,32],[-10,55],[-17,-29],[-19,33],[-33,27],[-21,33],[-64,-101],[-88,85],[-36,46],[-18,2],[-52,65],[-23,-101]],[[26196,47953],[-24,22],[-11,56],[-42,113],[-58,130],[-48,78],[-16,47],[-30,57],[-9,46],[-19,45],[-18,71],[-24,124],[3,23],[-31,39],[-16,45],[-26,22],[-20,52],[-5,46],[-21,23],[-28,48],[-4,49],[-17,-15],[-19,57],[4,25],[-23,60],[-19,-9],[-34,61],[8,53],[20,45],[11,1],[20,-48],[7,-37],[26,-26],[16,19],[10,-26],[23,-1],[3,-29],[19,-32],[25,18],[-4,39],[-16,25],[-15,60]],[[31857,53020],[-37,-40],[-15,34],[30,19],[22,-13]],[[31455,53262],[15,-7],[23,16],[43,-18],[20,15],[59,-17],[28,-18],[26,14],[43,-21],[6,-16],[39,-34],[15,3],[-7,-120],[-22,-8],[-12,-27],[-18,-94],[-23,-30],[-48,-9],[-19,-25],[-16,26],[-20,-12],[-15,19],[-14,-21],[-20,31],[-34,-20],[-60,22],[-3,-21],[-40,-22],[-8,28],[-23,3],[-18,-18],[-22,2],[1,60],[14,113],[-11,69],[-10,6],[-10,48],[31,38],[4,61],[34,5],[30,-20],[42,-1]],[[25613,49627],[-11,33],[-19,-60],[22,-30],[9,-34],[-14,-37],[-44,-51],[-18,10],[-45,-11],[-47,48],[-21,35],[-12,-13],[-34,39],[-16,-20],[-8,-43],[-25,64],[-17,23],[-28,-1],[-23,12],[-44,62],[-26,27],[-61,6],[-43,27],[-38,0],[-8,53],[-41,65],[-8,27],[-15,-9],[-1,9],[-10,2],[-3,6],[2,-2],[1,3]],[[32494,52956],[-3,-31],[-30,29],[2,1],[12,-5]],[[32044,53241],[16,-29],[-25,-21],[9,50]],[[31992,52747],[22,14],[38,-36],[-29,-24],[-47,-10],[-2,45],[18,11]],[[26751,47850],[-1,4],[6,-3],[1,-3],[-1,-4],[15,-33],[5,-68],[28,-177],[25,-106],[86,-274],[22,-29],[45,-155],[28,-70],[40,-17],[15,-44],[0,-5],[-10,-3],[-1,-1],[-2,-41]],[[27052,46821],[-21,6],[-21,56],[-27,21],[-7,-32],[12,-51],[-26,-19],[0,-283],[54,-67],[8,-45],[-19,-34],[-24,-20],[0,-30],[-14,-42],[24,-79],[0,-94],[-10,-47],[-19,-12],[-30,-76],[28,-33],[15,-113],[-4,-52]],[[26971,45775],[1,41],[-20,102],[-48,90],[14,66],[-16,81],[5,24],[-54,54],[-12,41],[-30,-12],[12,-63],[17,-41],[24,-30],[-1,-114],[-40,44],[-35,5],[-48,112],[7,62],[17,15],[16,64],[16,-6],[8,58],[-26,68],[5,27],[-55,137],[-66,114],[-34,21],[-8,49],[-24,48],[-21,-18],[-45,28],[-10,-8],[-36,78],[-5,50],[12,32],[2,45],[-16,46],[-25,100],[-40,18],[-7,34],[-17,16],[-19,58],[-33,-7],[-13,29],[-6,-82],[15,-51],[21,-39],[58,-36],[-1,-73],[-8,-45],[-17,-18],[2,-32],[-17,-25],[-8,-62],[-30,81],[-18,77],[-36,46],[-63,27],[-47,155],[-1,33],[-15,72],[6,59],[16,85],[-8,47],[30,26],[19,49],[-8,36],[-7,92],[-24,1],[-42,72],[17,29],[38,-8],[8,32],[-1,72]],[[27429,53879],[44,7],[-6,-43],[-35,4],[-3,32]],[[29095,39925],[-16,-31],[-25,-7],[-31,40],[-15,-12],[24,-76],[3,-42],[24,-99],[44,-84],[1,-56],[-14,-29],[-1,-44],[15,-98],[-2,-52],[-23,-32],[-20,37],[-47,-440],[-8,-3],[-128,-414],[-163,-331],[-146,-128],[-191,-166],[-26,-48],[-29,-101],[-42,-114],[11,-32],[2,-48],[-20,-23],[-6,72],[-25,16],[-10,-103],[-16,-116],[4,-64],[-19,-57],[0,-37],[-24,-58],[7,-58],[-12,-45],[1,-45],[-20,-95],[5,-59],[-6,-119],[-16,-34],[-36,-18],[-13,-48],[-1,-122],[-23,-6],[-11,-83],[-16,31],[-52,2],[-13,47],[-24,50],[-26,147],[1,66],[-17,8],[-14,45],[-16,20],[-27,-36],[-18,-4],[-15,54],[-34,25],[-20,50],[-26,4],[-34,-73],[-13,-39],[-16,-13],[-18,25],[-1,46],[35,116],[-30,16],[-14,101],[10,41],[14,12],[27,-26],[19,49],[26,26],[-17,159],[-2,112],[-6,60]],[[27714,37534],[26,3],[35,25],[10,25],[-11,59],[4,44],[26,46],[1,42],[16,60],[-2,100],[25,99],[-2,28],[32,106],[-2,88],[-44,49],[-2,111],[-11,-30],[-22,17],[-20,-21],[-4,-84],[-16,3],[-16,-38],[12,-64],[-28,9],[-5,-86],[-20,18],[15,-75],[-18,-12],[-24,59],[-12,-1],[-17,50],[-45,108],[-41,31],[-23,37],[-15,77],[24,16],[30,67],[3,157],[-12,103],[-21,101],[10,61],[14,27],[3,113],[-26,85],[-17,101],[23,75],[46,20],[21,-2],[13,39],[20,171],[11,25],[-8,107],[-9,39],[24,65],[7,54],[42,72],[24,62],[23,81],[8,105],[17,-11],[9,27],[-13,43],[-3,76],[-13,58],[16,71],[-32,71],[1,61],[13,40],[27,4],[39,49],[19,49],[25,24],[29,0],[36,57],[20,-4],[47,15],[17,32],[15,55],[29,-56],[8,50],[11,-6],[21,118],[18,17]],[[27745,38071],[29,14],[31,-41],[-8,-38],[-26,-35],[-31,8],[7,-115],[-30,-6],[-12,-20],[0,118],[12,89],[28,26]],[[25203,39509],[7,-20],[-52,-149],[-36,-14],[-15,45],[36,52],[8,43],[32,50],[20,-7]],[[24921,39658],[32,-59],[-3,-72],[-19,-55],[-44,-17],[-33,49],[-7,57],[12,66],[16,15],[46,16]],[[24864,39091],[14,38],[22,-27],[-7,-48],[-12,-20],[-18,12],[1,45]],[[24885,40249],[-16,-42],[-19,27],[-1,26],[23,25],[13,-36]],[[24769,39867],[7,34],[16,-1],[46,-63],[10,-57],[-15,-40],[-20,16],[-19,-6],[-26,23],[-10,58],[11,36]],[[24633,40107],[14,-69],[20,-46],[5,-138],[20,-67],[30,-53],[16,-66],[-5,-92],[18,-3],[32,-108],[-12,-23],[-8,-68],[-15,-50],[-25,-4],[-6,-21],[-29,-21],[-11,-21],[-40,22],[-21,-4],[-36,83],[22,86],[36,66],[25,19],[8,-15],[25,34],[3,39],[-36,72],[-4,55],[-30,56],[-13,46],[-6,73],[-2,90],[-18,18],[-26,-23],[-5,38],[18,22],[9,45],[47,28]],[[24547,39793],[48,28],[12,-18],[9,-46],[-2,-73],[-12,-31],[-21,-8],[-26,15],[-14,67],[6,66]],[[28365,45185],[-29,58],[-15,65],[-25,75],[-11,60],[-35,89],[5,22],[-18,100],[-13,24],[-15,102],[51,12],[5,88],[-12,24],[12,40],[19,-7],[3,45],[27,-4],[0,41],[13,33],[-14,25],[-4,40],[-15,21],[-4,-50],[-13,-7],[-10,63],[-16,-61],[-30,67],[-7,-19],[11,-111],[-17,4],[0,43],[-16,11],[3,65],[-14,106],[-16,6],[-22,42],[-18,3],[0,51],[-32,31],[-20,36],[-25,23],[-21,85],[-29,-54],[-25,7],[-51,-13],[-24,-74],[-29,-13],[-21,-31],[-7,-45],[2,-72],[-20,8],[-9,-40],[19,-12],[1,-32],[-20,-14],[-23,-61],[-26,-44],[-48,-68],[-36,8],[-16,-15],[-14,-42],[-10,-72],[6,-68],[34,-49],[18,-89],[15,-18],[26,-65],[1,-20],[23,-53],[15,-88],[-10,-46],[-39,-28],[-8,16],[-34,1],[-20,-31],[0,-63],[-12,-45],[-55,-6],[-22,-17],[-43,-3],[-19,39],[6,45],[-3,58],[7,26],[-19,46],[6,37],[-16,59],[-3,170],[-32,32],[-19,0],[-14,-21],[22,-59],[-1,-34],[-20,2],[0,-96],[-47,39],[-20,39],[-22,14],[-7,34],[8,40],[-10,90],[-20,63],[-20,105],[-28,-41],[-31,29],[-22,34],[-41,-7],[1,47],[-38,35],[-22,-15],[-41,-7],[-5,-19],[-30,24],[-48,-29],[-10,-52],[7,-106],[-14,-21]],[[27052,46821],[16,47],[44,-100],[13,-7],[-11,-53],[11,-25],[-1,-72],[26,-19],[-4,-59],[5,-55],[11,-22],[23,-3],[7,-39],[31,17],[5,-20],[33,26],[19,-17],[2,49],[-22,35],[-16,65],[12,21],[15,-83],[17,1],[49,-146],[25,-44],[38,-10],[40,1],[41,18],[50,55],[18,5],[18,58],[34,55],[40,45],[100,67],[31,74],[22,-57],[1,-65],[42,-9],[-3,37],[-16,48],[-30,24],[-11,32],[15,31],[34,11],[37,83],[7,55],[13,28],[18,9],[10,-33],[22,13],[32,-16],[24,-23],[57,13],[-13,-44],[3,-43],[34,7],[20,-26],[40,27],[31,-26],[18,14],[62,-58],[6,-16],[55,-59],[17,-3],[19,-43],[33,-97],[7,14],[21,-61],[13,-72],[20,-48],[18,-15],[12,-32],[-3,-30],[29,-36],[21,7]],[[28075,46065],[15,13],[9,-38],[0,-66],[-27,-25],[-9,123],[12,-7]],[[27291,45493],[19,-103],[-14,-23],[10,-52],[20,-7],[-5,-52],[-37,31],[-23,57],[-1,54],[6,43],[25,52]],[[30703,27461],[-55,-116],[-36,10],[-7,-29],[7,-126],[13,-59],[-19,-123],[-42,-105],[-23,-5],[-27,-35],[-38,7],[-26,-31]],[[30450,26849],[-46,84],[-38,53],[-40,90],[-15,15],[-9,51],[-29,41],[-22,13],[-30,70],[-47,63],[8,28],[-5,95],[-10,88],[-21,66],[-54,55],[-49,36],[-22,57],[-28,48],[-14,1],[-36,82],[-24,28],[-4,35],[-39,81],[-44,29],[-30,10],[-22,26],[-36,70],[-25,5],[-40,64],[-38,15],[-3,37],[-41,49],[-45,35],[-23,1],[-9,25],[-39,42],[-42,78],[-8,50],[-37,48],[-41,31],[-31,39],[-6,49],[-53,48],[-54,68],[-8,24],[-47,51],[-36,61],[5,35],[-20,29],[3,37],[-20,52],[-29,42],[-14,73],[-17,25],[1,32],[-14,28],[-36,46],[-42,65],[-26,60],[-1,54],[-12,31],[0,38],[-28,64],[-14,17],[4,48],[-9,45],[-21,54],[-16,-21],[-3,63],[7,46],[-3,57],[-34,31],[6,71],[21,12],[10,-51],[18,178],[1,134],[-6,40],[-41,141],[-34,99],[-6,42],[-4,92],[-24,53],[-28,142],[-25,50],[4,89],[-21,64],[-48,64],[0,53],[-29,46],[0,80],[-14,93],[4,69],[-10,62],[-19,40],[-7,53],[-16,39],[-38,59],[-41,54],[0,64],[13,38],[-9,48],[-5,67],[-16,102],[-30,115],[-20,61],[-7,52],[-15,37],[-25,104],[-13,103],[-18,39],[-3,72],[-18,123],[4,55],[-13,30],[-25,97],[-8,116],[-10,36],[0,49],[-16,16],[-9,34],[9,49],[-20,37],[-18,95],[-10,75],[-28,99],[5,77],[-8,61],[-40,88],[5,49],[-17,73],[-7,55],[-37,83],[-10,40],[-38,71],[-25,77],[-4,32],[-20,57],[6,39],[-37,141],[1,43],[-10,95],[-23,65],[2,39],[-20,58],[-30,68],[-19,56],[-12,76],[-16,39],[-61,105],[-120,158],[-26,29],[-22,51],[-70,121],[-11,59],[0,63],[16,44],[48,-5],[17,47],[0,136],[-26,109],[-34,81],[-9,0],[-25,76],[8,30],[0,59],[21,3],[9,26],[-7,56],[-68,205],[14,102],[-7,43],[14,56],[-2,66],[6,42],[31,56],[20,50],[20,86],[35,63],[19,105],[10,22],[57,89],[11,62],[22,-9],[14,17],[17,45],[25,-12]],[[2590,29795],[-17,-82],[-28,23],[9,23],[18,1],[18,35]],[[31485,404],[35,41],[13,-36],[-10,-36],[-25,-10],[-13,41]],[[31383,542],[44,7],[8,-57],[-52,50]],[[31424,326],[-46,2],[-3,51],[17,25],[33,4],[8,-54],[-9,-28]],[[30995,2448],[-10,27],[-29,-1],[-51,25],[-14,-7],[-52,22],[-27,47],[-27,21],[-47,-39],[-27,-7],[-11,-28],[-2,-66],[-16,-48],[-45,-64],[-34,35],[-95,-69],[-99,-96],[-16,34],[-53,-79],[-29,-94],[18,-62],[-29,-118],[-4,-101],[-15,-56],[17,-173],[-12,-29],[-2,-81],[-40,-47],[-49,-34],[-35,35],[-66,28],[-28,31],[-98,60],[-22,44],[-43,53],[-36,105],[18,69],[35,39],[46,-2],[7,-77],[26,94],[41,-3],[26,-26],[24,51],[47,41],[44,17],[29,93],[35,55],[-8,59],[-29,26],[-35,-5],[-2,55],[-49,115],[-21,-10],[-80,24],[-33,-11],[-21,29],[-45,-7],[-36,-61],[-30,-8],[1,41],[35,6],[-2,32],[-38,-26],[-71,-16],[32,-79],[-59,-100],[-34,-20],[-2,-6],[0,-5],[3,-6],[19,-29],[-15,-116],[-34,-24],[-31,-1],[-42,29],[-4,49],[-25,31],[-13,42],[-54,-7],[63,83],[55,-5],[1,74],[-11,28],[-47,-20],[-28,-40],[-19,85],[29,52],[8,59],[-15,107],[0,79],[-38,98],[51,-51],[26,7],[25,-62],[35,31],[0,46],[25,0],[52,49],[38,76],[21,-19],[3,-67],[31,-43],[16,-47],[-7,-107],[-33,-11],[-20,-55],[54,17],[18,35],[13,98],[-51,115],[1,87],[23,-25],[30,34],[-13,57],[16,46],[-17,54],[-65,72],[18,-68],[42,-14],[-3,-35],[-27,-45],[-36,11],[-11,34],[-67,39],[14,-54],[23,-39],[-7,-36],[-49,-31],[-12,-63],[1,-57],[-29,4],[-2,-46],[-35,24],[-48,82],[-7,68],[-25,95],[-35,97],[-31,18],[4,56],[-10,56],[8,63],[66,-37],[-11,83],[-18,73],[-37,-24],[-24,31],[-31,8],[-1,53],[-26,47],[-9,61],[20,66],[53,-8],[29,28],[27,69],[2,67],[36,19],[-29,73],[-24,-104],[2,-70],[-27,-46],[-33,-3],[-32,82],[-4,37],[-35,144],[20,19],[-65,65],[-15,60],[-54,53],[41,100],[56,46],[12,79],[-5,61],[30,31],[-18,32],[-5,48],[27,49],[37,28],[6,68],[-25,25],[-1,-89],[-19,0],[-17,57],[-31,48],[12,46],[-8,190],[-12,64],[15,46],[-11,20],[3,68],[29,47],[8,32],[-28,62],[60,86],[23,-31],[23,6],[1,68],[-21,12],[-34,56],[-30,71],[-20,13],[-32,78],[-38,30],[2,42],[33,41],[53,-50],[61,23],[25,-8],[15,-41],[16,14],[33,-22],[35,-53],[21,-7],[9,-82],[20,55],[-7,51],[-35,71],[-7,83],[33,-3],[6,31],[-27,46],[-38,6],[-46,-44],[-32,17],[-17,31],[-25,-13],[-24,19],[-23,-16],[-32,24],[-10,-23],[-44,19],[-15,21],[24,112],[19,31],[62,-12],[-50,69],[9,64],[16,22],[35,91],[31,7],[2,39],[-14,32],[13,58],[27,-2],[-25,80],[-29,63],[6,34],[-62,5],[-14,-51],[20,-48],[-57,13],[-39,66],[-53,27],[-22,74],[-18,19],[-24,-16],[-44,-7],[-33,-25],[35,-28],[24,-90],[-4,-42],[-35,-41],[-49,55],[-2,42],[-16,17],[1,81],[12,76],[27,-6],[7,30],[48,74],[-2,30],[57,57],[1,29],[26,51],[19,-26],[9,49],[35,39],[4,68],[-33,-60],[-38,3],[-11,52],[-8,109],[19,20],[37,-20],[24,40],[31,11],[63,-25],[30,37],[25,-25],[34,20],[18,-82],[34,-86],[0,-73],[26,4],[13,-45],[23,-22],[-12,-107],[-26,-53],[-43,-152],[5,-30],[23,-22],[18,45],[7,63],[30,125],[41,79],[18,90],[34,96],[3,58],[16,46],[-52,29],[-13,54],[17,227],[57,107],[38,2],[11,-57],[62,-58],[-1,39],[-33,18],[-12,38],[-45,74],[-29,-36],[-30,11],[-24,34],[24,28],[34,-8],[7,33],[-24,62],[3,80],[68,1],[37,67],[13,-5],[50,86],[26,148],[-43,100],[-28,17],[3,32],[-21,36],[-58,25],[-2,32],[-23,18],[2,49],[32,32],[8,66],[18,69],[28,59],[-5,74],[22,61],[-32,20],[-22,80],[11,52],[-1,54],[51,62],[-12,75],[22,76],[33,73],[-34,66],[-4,42],[14,64],[-13,47],[10,75],[38,-8],[-8,70],[-15,27],[-13,73],[18,41],[39,23],[45,-46],[-7,83],[10,116],[-19,9],[-11,-53],[-29,3],[-47,48],[-3,57],[10,44],[23,30],[20,59],[-11,64],[-31,74],[-39,28],[-34,-33],[-15,-49],[17,-82],[-29,-60],[-56,11],[-37,-19],[-21,21],[-50,22],[25,98],[-30,32],[-21,48],[-7,43],[4,77],[-11,87],[-15,66],[-2,105],[19,17],[-3,39],[14,118],[-1,42],[20,28],[12,66],[-11,26],[2,151],[26,112],[-9,81],[3,34],[23,8],[47,63],[6,-26],[42,-1],[-3,45],[-35,-23],[-4,132],[23,39],[18,70],[14,127],[-7,82],[-27,196],[-45,227],[-11,197],[10,42],[-6,40],[14,32],[5,71],[-4,60],[-25,138],[-27,83],[-7,98],[21,49],[2,49],[-11,58],[-13,20],[9,111],[17,36],[15,-44],[26,-21],[37,0],[30,49],[15,83],[-13,44],[8,44],[1,72],[-11,35],[25,41],[29,-9],[12,83],[-6,67],[19,18],[3,40],[25,121],[-1,130],[8,21],[0,66],[26,45],[11,47],[20,23],[4,43],[-20,107],[10,39],[31,63],[-2,49],[26,62],[1,47],[11,30],[36,50],[15,90],[-1,80],[35,154],[0,85],[8,52],[-7,43],[21,59],[-2,85],[-7,70],[15,34],[19,86],[16,44],[9,92],[33,35],[8,27],[12,115],[-27,73],[12,51],[1,42],[-23,128],[20,16],[30,57],[1,62],[13,20],[-10,81],[14,11],[17,101],[-11,92],[11,12],[0,88],[-11,13],[0,51],[-20,70],[6,120],[8,30],[-1,50],[-14,38],[11,55],[-10,31],[-13,197],[-22,219],[5,121],[-8,34],[-8,99],[-1,141],[5,36],[1,101],[9,85],[36,-6],[23,83],[19,16],[1,50],[-7,68],[29,31],[5,29],[-15,122],[11,94],[-11,72],[7,39],[-7,76],[-46,106],[-3,38],[12,25],[-11,65],[-4,73],[9,47],[29,40],[4,38],[19,44],[4,41],[-9,41],[15,17],[28,132],[-6,43],[8,50],[-4,75],[7,122],[10,43],[6,75],[22,72],[30,49],[3,97],[-22,84],[10,42],[-12,100],[12,44],[33,37],[3,89],[-9,40],[14,69],[11,14],[12,127],[4,98],[-4,42],[19,30],[-12,41],[5,166],[8,46],[-30,123],[11,47],[4,66],[11,32],[3,82],[29,20],[2,49],[20,33],[3,119],[-19,71],[10,84],[-16,50],[-5,95],[-9,41],[8,96],[-9,28],[11,91],[-2,68],[13,107],[-5,42],[1,106],[5,53],[-2,61],[16,46],[12,62],[1,82],[-9,39],[-17,22],[-12,-50],[-23,25],[9,52],[2,71],[-6,51],[11,48],[-5,61],[10,39],[16,-35],[13,1],[28,61],[14,95],[-7,52],[14,122],[0,125],[5,63],[2,89],[12,173],[14,115],[-4,61],[4,92],[14,37],[10,109],[-11,61],[9,31],[-16,155],[-15,46],[13,68],[-16,77],[-3,76],[5,40],[-4,95],[8,17],[2,66],[-7,35],[15,47],[-6,100],[8,50],[-3,144],[-10,164],[-9,27],[0,71],[-9,97],[-14,74],[4,99],[-11,74],[0,63],[-13,110],[5,29],[0,140],[9,89],[-20,64]],[[31148,427],[-45,-29],[-29,37],[-11,62],[-1,70],[-42,7],[-14,33],[61,35],[53,3],[90,-24],[82,1],[36,-17],[45,-95],[2,-58],[-25,-46],[-23,-67],[-59,3],[-9,29],[14,48],[-26,24],[-24,-15],[-4,-56],[-38,18],[-33,-2],[0,39]],[[31250,122],[39,5],[-9,-51],[33,-13],[-2,-60],[-20,-3],[-41,30],[-20,55],[20,37]],[[30560,440],[21,64],[57,13],[160,58],[31,-13],[137,62],[33,-19],[27,-55],[-7,-39],[-58,-29],[-1,-51],[54,7],[48,-68],[-54,-22],[15,-63],[46,6],[3,-63],[45,-81],[-17,-83],[-21,48],[-34,45],[-23,70],[-42,-4],[-15,34],[-49,-26],[-22,-30],[-27,23],[-14,69],[20,32],[-1,48],[-66,7],[-41,53],[-12,-37],[-33,-33],[32,-31],[26,-50],[-10,-27],[22,-46],[-22,-15],[-38,12],[-10,43],[-105,71],[-17,31],[-3,49],[-35,40]],[[30942,646],[-65,-44],[-72,-4],[-23,21],[-87,31],[-54,36],[-62,-5],[-82,-23],[-40,16],[-71,52],[-34,-51],[-34,19],[12,36],[27,5],[49,40],[26,41],[-32,19],[-12,-67],[-70,-32],[-27,21],[-21,71],[-34,-43],[-34,15],[6,70],[-24,10],[-20,-64],[-28,-6],[-49,41],[-37,-27],[-40,20],[-10,68],[12,57],[32,-22],[13,-44],[24,45],[-44,27],[39,26],[35,-60],[17,40],[34,11],[12,27],[49,-38],[63,-26],[9,66],[45,30],[55,-19],[6,-34],[32,-59],[37,-29],[14,23],[-42,29],[-30,46],[7,25],[-26,46],[-65,11],[-18,28],[-12,70],[27,-3],[63,-75],[76,-55],[48,-65],[-12,69],[32,45],[22,-6],[11,-46],[31,-79],[14,7],[-12,100],[31,-17],[36,-42],[42,17],[20,-38],[50,-36],[10,47],[-43,48],[-59,48],[-102,67],[-33,35],[-33,122],[-8,109],[20,35],[37,18],[17,37],[33,-5],[32,16],[36,43],[52,46],[12,29],[-19,88],[-56,8],[-86,-24],[-64,-55],[-31,-15],[-23,50],[-39,22],[-5,64],[14,197],[22,0],[24,-36],[32,36],[10,81],[-37,13],[-19,100],[44,9],[35,-73],[31,-7],[18,38],[41,29],[29,72],[2,87],[42,46],[14,-5],[19,-79],[28,-68],[33,-17],[105,79],[30,-51]],[[30606,650],[62,2],[129,-64],[-101,-45],[-100,-24],[-23,35],[0,74],[33,22]],[[30616,302],[40,-21],[-32,-35],[-8,56]],[[30562,344],[8,-42],[-33,-7],[-15,42],[40,7]],[[30505,549],[1,41],[43,25],[9,-42],[-53,-24]],[[30421,1597],[1,-71],[17,-142],[-7,-25],[31,-80],[-11,-27],[-54,10],[6,-53],[40,-50],[47,-32],[-6,-44],[-66,22],[-54,40],[-44,63],[-16,127],[10,68],[29,7],[40,-33],[-2,45],[-23,20],[0,65],[30,30],[32,60]],[[30468,616],[23,-23],[-63,-35],[-2,35],[42,23]],[[30271,588],[28,17],[42,2],[33,-27],[44,55],[3,-117],[39,13],[-52,-106],[-7,57],[-58,0],[4,36],[-56,-14],[-20,32],[0,52]],[[30427,1202],[44,50],[-2,-72],[-42,22]],[[30388,695],[64,-39],[-61,-29],[-44,21],[14,33],[27,14]],[[30161,699],[75,-6],[27,-35],[-7,-62],[-30,37],[-35,15],[-15,-46],[-24,12],[9,85]],[[30273,1103],[-2,-38],[-25,-66],[-68,59],[-4,40],[-36,53],[-3,-54],[-44,27],[-7,59],[22,31],[2,27],[-12,26],[1,32],[15,33],[42,-8],[46,-36],[10,-92],[46,48],[22,-27],[10,-72],[-15,-42]],[[29719,2106],[5,2],[3,3],[4,1],[5,8],[12,-6],[42,37],[17,50],[20,-20],[21,-70],[32,20],[37,45],[31,62],[54,10],[28,-25],[62,-3],[53,36],[23,-64],[0,-54],[-143,-137],[-35,-96],[-33,1],[-8,27],[-31,-4],[20,-49],[-87,-105],[-2,-42],[43,-106],[-47,-10],[-6,27],[-40,29],[-25,48],[-19,2],[-44,72],[-37,17],[-37,68],[57,-8],[46,5],[0,45],[15,31],[-17,40],[7,67],[-11,29],[-9,7],[-4,6],[-2,4]],[[29995,1350],[21,45],[81,-55],[-14,-47],[4,-30],[19,-41],[-20,-21],[-26,-47],[15,-46],[-56,-64],[-3,60],[-34,37],[-54,97],[5,36],[-11,73],[46,-22],[27,25]],[[29716,1503],[-7,35],[-52,6],[-11,49],[-22,16],[-19,57],[17,4],[24,-18],[39,32],[-6,40],[41,4],[96,-100],[53,-62],[-7,-35],[60,-36],[32,-47],[-16,-60],[-27,8],[-26,-45],[24,-73],[-58,-67],[-26,16],[-37,-28],[-38,-8],[-24,18],[36,53],[2,29],[-43,90],[-5,49],[53,38],[-53,35]],[[29915,1235],[23,-37],[-27,-101],[-50,0],[-1,47],[55,91]],[[29887,1558],[42,-11],[-8,-27],[-34,38]],[[29831,9800],[10,35],[19,3],[-2,-69],[-27,31]],[[29698,8164],[35,26],[14,-30],[36,-23],[27,-60],[-32,-82],[-6,-65],[-53,-75],[-7,-25],[-49,-45],[-49,72],[1,62],[-12,29],[7,96],[42,-31],[2,132],[24,25],[20,-6]],[[29724,2783],[21,10],[-23,-110],[-36,8],[12,65],[26,27]],[[29705,10083],[21,-89],[-13,-5],[-23,41],[15,53]],[[29647,1408],[55,2],[0,-48],[-28,-16],[-20,21],[-7,41]],[[29695,1753],[-15,-23],[-33,1],[-40,42],[-37,-22],[-15,79],[-28,47],[-13,-12],[-27,56],[-31,15],[-15,-26],[-86,2],[-3,47],[-66,73],[-38,119],[26,12],[50,-44],[19,-71],[77,-16],[60,-46],[56,-68],[18,16],[26,-41],[20,0],[66,-123],[29,-17]],[[29650,8489],[5,27],[35,11],[-5,-68],[-20,-19],[-15,49]],[[29641,8199],[27,27],[12,-44],[-29,-12],[-10,29]],[[29611,1259],[23,19],[34,-48],[-5,-37],[-68,44],[16,22]],[[29554,1699],[46,20],[25,-30],[-23,-9],[1,-20],[28,-70],[-45,-24],[-68,65],[47,48],[-11,20]],[[29564,7098],[7,22],[46,-24],[1,-36],[-17,-87],[-24,-53],[-17,-86],[-22,-25],[14,141],[-6,94],[18,54]],[[29433,10027],[16,-34],[54,-15],[35,59],[21,2],[18,-26],[0,-93],[30,-81],[-14,-64],[29,-36],[1,-90],[-57,-2],[-30,-38],[8,-31],[-12,-31],[29,-36],[-58,-49],[50,-108],[18,-5],[20,-43],[-11,-43],[-29,-11],[3,-56],[16,-2],[19,-125],[-25,22],[-52,-23],[1,-42],[22,-43],[3,-37],[-40,5],[4,-71],[-25,-8],[-9,32],[-47,4],[-61,40],[-27,34],[21,127],[34,90],[14,90],[-4,51],[12,49],[-1,68],[-16,78],[-1,37],[14,90],[-9,38],[10,47],[22,38],[7,53],[-6,67],[16,55],[-13,67]],[[29516,9438],[6,26],[38,9],[-6,-49],[-38,14]],[[29526,7396],[6,30],[26,-5],[13,-28],[-9,-82],[-15,-34],[14,-28],[-17,-57],[-21,54],[-22,27],[8,69],[17,54]],[[29507,8057],[24,20],[29,-45],[-9,-35],[12,-37],[-25,-37],[-23,-5],[-37,114],[29,25]],[[29520,8454],[4,40],[31,-37],[7,-49],[-11,-45],[-31,91]],[[29518,7899],[33,34],[6,-71],[-34,6],[-5,31]],[[29546,5632],[-32,9],[7,43],[22,-10],[3,-42]],[[29503,8182],[38,30],[8,-20],[-26,-44],[-20,34]],[[29314,2900],[37,-8],[17,-45],[20,2],[110,-148],[40,-107],[-7,-30],[-39,48],[-9,32],[-57,47],[-18,52],[-66,56],[-28,101]],[[29470,6986],[22,38],[50,-54],[-22,-97],[-18,16],[-32,97]],[[29405,2657],[10,2],[99,-140],[7,-100],[19,-43],[-12,-24],[-5,-94],[-22,-55],[-41,-7],[12,51],[-44,21],[15,68],[49,67],[-9,42],[10,28],[-45,53],[-17,48],[-58,92],[32,-9]],[[29499,7128],[25,33],[12,-23],[0,-103],[-8,-36],[-35,34],[-24,2],[0,51],[30,42]],[[29505,8920],[7,26],[26,-24],[-16,-33],[-17,31]],[[29489,7736],[36,-46],[9,-93],[-22,-61],[-16,34],[-45,-14],[-13,46],[-35,22],[-15,-11],[-9,72],[23,35],[87,16]],[[29428,3041],[39,-168],[36,-62],[3,-31],[24,-47],[-14,-30],[-30,42],[0,55],[-69,86],[-36,23],[-2,43],[28,7],[-3,55],[24,27]],[[29499,3261],[21,-42],[-1,-52],[-32,6],[-15,55],[27,33]],[[29484,7850],[8,53],[29,-98],[-28,-37],[-25,70],[16,12]],[[29468,2928],[38,-8],[8,-32],[-20,-30],[-26,70]],[[29478,5636],[-59,1],[-48,-23],[-52,64],[28,46],[31,23],[28,-13],[22,15],[22,-37],[6,6],[28,-36],[31,7],[-7,-44],[-30,-9]],[[29476,8145],[12,41],[23,-29],[-13,-32],[-22,20]],[[29405,7571],[27,23],[16,-42],[44,9],[21,-61],[-22,-26],[-40,-2],[-43,32],[-3,67]],[[29416,8319],[23,40],[34,-115],[32,20],[-2,-61],[-40,20],[-22,-7],[-14,29],[-11,74]],[[29437,7415],[69,-12],[-17,-75],[-44,38],[-8,49]],[[29488,8599],[8,-36],[-35,-1],[10,-48],[-63,23],[1,46],[20,13],[27,-30],[32,33]],[[29422,7469],[60,-6],[-4,-47],[-41,23],[-15,30]],[[29450,8361],[15,28],[24,-21],[3,-56],[-36,8],[-6,41]],[[29360,8023],[52,10],[45,-7],[24,-35],[-17,-36],[-36,-42],[-47,-33],[-31,20],[-17,61],[0,55],[27,7]],[[29427,7327],[22,30],[34,-58],[-6,-67],[-42,-11],[-16,79],[8,27]],[[29435,7188],[39,8],[-17,-109],[-23,54],[1,47]],[[29442,8202],[28,-21],[1,-42],[-41,37],[12,26]],[[29381,7813],[21,25],[34,-25],[21,2],[17,-50],[-46,-31],[-37,2],[-35,-18],[-18,22],[43,73]],[[29341,2619],[26,35],[21,-21],[41,-66],[41,-88],[-34,-48],[-40,-2],[6,33],[-24,117],[-19,-20],[-44,25],[26,35]],[[29412,8131],[40,5],[14,-67],[-24,-13],[-23,10],[-7,65]],[[29395,7875],[43,20],[25,-3],[0,-34],[-30,-18],[-38,35]],[[29457,3271],[5,-73],[-33,-35],[-14,58],[1,49],[41,1]],[[29395,5299],[1,36],[50,-47],[-8,-47],[-35,32],[4,10],[-4,3],[-8,13]],[[29381,1783],[33,40],[14,-13],[-41,-61],[-6,34]],[[29370,3218],[33,19],[17,-89],[-22,-20],[-20,14],[-8,76]],[[29335,8137],[25,41],[16,-10],[36,-110],[-57,-12],[-55,41],[-11,26],[19,44],[27,-20]],[[29363,7204],[5,28],[22,-12],[18,-20],[2,-32],[-40,-18],[-7,54]],[[29347,5344],[15,49],[17,-17],[5,-68],[21,-29],[-4,-11],[-19,-16],[-30,49],[-5,43]],[[29262,3819],[32,39],[23,-43],[28,8],[15,-99],[18,-29],[24,-100],[-15,-22],[-40,-16],[-17,45],[-41,58],[-11,36],[44,62],[-60,61]],[[29358,3504],[30,-138],[10,-78],[-28,21],[-20,171],[8,24]],[[29328,7389],[9,31],[31,-24],[27,-107],[-5,-43],[-35,-5],[9,-12],[-21,-45],[-27,5],[5,66],[-12,49],[19,85]],[[29336,7601],[24,3],[31,-25],[1,-72],[-29,-3],[-29,59],[2,38]],[[29331,8271],[27,24],[22,-56],[-32,0],[-17,32]],[[29324,4518],[8,51],[26,-26],[13,-51],[-2,-38],[-41,-21],[-4,85]],[[29320,5275],[-4,44],[63,-69],[-29,-41],[-17,12],[-13,54]],[[29330,7686],[9,22],[28,-20],[6,-70],[-32,19],[-11,49]],[[29319,6244],[42,42],[5,-46],[-38,-52],[-9,56]],[[29300,7501],[31,36],[24,-28],[17,-62],[-22,-13],[-34,35],[-16,32]],[[29301,7929],[22,17],[37,-94],[-26,-9],[-18,22],[-15,64]],[[29307,5490],[50,-83],[-7,-30],[-33,-35],[-25,66],[-1,84],[16,-2]],[[29301,3621],[26,-28],[13,-55],[-5,-32],[11,-105],[-31,-26],[30,-53],[-21,-54],[-35,54],[-8,69],[-29,-39],[-44,74],[-29,19],[3,49],[17,35],[27,-24],[34,-4],[18,70],[-14,72],[37,-22]],[[29212,5082],[42,39],[33,-57],[27,25],[1,-127],[18,-44],[-15,-51],[14,-61],[4,-143],[-10,-96],[-16,-65],[12,-78],[14,-38],[2,-56],[-9,-110],[-14,-36],[-46,-71],[-64,16],[0,46],[-15,26],[8,55],[1,162],[5,58],[-22,11],[-9,-41],[14,-29],[-16,-58],[18,-21],[-18,-106],[-39,26],[-46,185],[12,30],[-40,53],[-17,148],[50,35],[55,-27],[20,34],[38,-64],[7,91],[16,69],[-40,74],[-25,111],[7,44],[43,41]],[[29299,7393],[31,33],[-24,-96],[-7,63]],[[29248,5442],[26,-23],[0,-41],[16,-19],[5,-46],[-7,-110],[29,-98],[-25,-13],[-35,45],[-60,10],[-19,32],[-3,67],[24,49],[25,23],[16,-70],[19,40],[-26,52],[2,68],[13,34]],[[29268,7983],[15,33],[36,-19],[5,-37],[-49,1],[-7,22]],[[29286,2747],[30,-4],[-10,-47],[-55,-60],[2,54],[33,57]],[[29284,7169],[24,41],[8,-44],[-32,3]],[[29260,3285],[31,-1],[15,-48],[-7,-52],[-25,-39],[-21,63],[-14,-62],[-17,-27],[-55,-29],[-6,33],[32,45],[-12,51],[34,57],[45,9]],[[29269,7292],[33,33],[-5,-70],[-14,-60],[-23,4],[-5,36],[14,57]],[[29235,3880],[18,24],[28,-9],[13,-29],[-58,-81],[-11,21],[16,48],[-6,26]],[[29269,2635],[0,-52],[-22,-18],[-23,26],[45,44]],[[29229,8761],[8,33],[27,-18],[24,-52],[-33,-9],[-26,-24],[-10,30],[10,40]],[[29243,2867],[34,-19],[1,-49],[-16,-32],[6,-40],[-23,-54],[-6,-35],[-33,-36],[16,154],[21,111]],[[29198,2570],[14,9],[61,-79],[-36,-18],[-33,50],[-6,38]],[[29217,3665],[28,-5],[-8,-46],[28,-51],[-12,-57],[-57,28],[-15,54],[5,71],[31,6]],[[29220,8010],[3,58],[22,-22],[-5,-40],[-20,4]],[[29147,5643],[20,21],[12,-39],[42,-45],[16,-47],[-24,-52],[-44,62],[-27,-3],[0,47],[-36,-21],[7,51],[34,26]],[[29113,5513],[56,18],[43,-58],[1,-38],[29,8],[-15,-57],[1,-60],[-22,-4],[-29,-55],[-49,157],[-15,89]],[[29187,2973],[23,14],[22,-23],[3,-121],[-32,-185],[-33,-16],[-10,86],[17,108],[21,-23],[16,80],[-27,80]],[[29230,5610],[-20,-14],[-29,30],[4,50],[32,62],[15,-14],[-2,-114]],[[29179,5157],[5,-21],[36,2],[11,-22],[-46,-58],[-14,6],[8,93]],[[29072,4158],[61,-24],[22,-63],[21,37],[14,-46],[34,0],[-7,-66],[-16,-12],[-2,-54],[-29,-69],[-28,6],[-20,-54],[-47,25],[-15,52],[-25,-21],[1,67],[30,115],[32,-31],[-3,-45],[27,6],[4,41],[-73,83],[19,53]],[[29160,4846],[35,15],[20,-59],[-12,-134],[-25,32],[-14,48],[-44,17],[-3,49],[24,56],[19,-24]],[[29153,5798],[4,28],[34,-19],[12,-51],[-25,-3],[-25,45]],[[29153,2898],[26,-35],[-11,-59],[-17,-25],[-17,72],[19,47]],[[29153,3670],[20,5],[-1,-117],[-33,83],[14,29]],[[29123,3232],[46,-30],[-6,-57],[-17,-9],[-19,-51],[-2,-56],[-44,-43],[-5,62],[37,40],[-8,112],[18,32]],[[29141,5106],[28,0],[-17,-110],[-31,40],[-5,33],[25,37]],[[29137,5802],[15,-9],[9,-52],[-31,-39],[-7,41],[-49,23],[7,23],[36,-14],[20,27]],[[29098,5011],[15,22],[39,-41],[11,-78],[-23,-9],[-12,-30],[-4,17],[-6,-2],[1,25],[-8,24],[-4,46],[-9,26]],[[29096,5536],[12,-38],[-1,-59],[53,-175],[5,-99],[-49,-69],[-21,156],[10,41],[-38,19],[-18,-21],[-18,43],[16,19],[7,65],[-21,15],[-14,92],[14,27],[27,-8],[13,45],[23,-53]],[[29117,7855],[10,54],[33,-61],[-13,-51],[-23,-4],[-7,62]],[[29035,3799],[19,23],[92,-41],[-44,-73],[-3,-101],[-7,-24],[-43,17],[-13,73],[14,79],[-15,47]],[[29043,4438],[22,5],[22,-34],[36,-140],[-38,-30],[-24,46],[-11,46],[-24,-22],[-23,-45],[-13,60],[26,16],[-10,38],[3,59],[34,1]],[[29023,5011],[44,6],[37,-34],[1,-27],[7,-21],[5,-31],[-3,-20],[9,1],[3,-14],[-24,-46],[-13,101],[-17,-14],[-30,-67],[-22,59],[-22,14],[-6,57],[31,36]],[[29053,5270],[31,25],[15,-91],[-2,-60],[-30,-68],[-40,-38],[-22,9],[-2,70],[13,44],[-14,20],[3,66],[22,37],[26,-14]],[[29057,4869],[31,47],[12,-96],[-63,-124],[-42,39],[18,66],[39,38],[5,30]],[[19634,20597],[23,-37],[-32,-30],[-28,-10],[18,87],[19,-10]],[[5631,24772],[-25,-5],[0,39],[18,-2],[7,-32]],[[19657,47402],[8,0],[-3,-17],[-5,17]],[[33950,93949],[-34,41],[-80,20],[-97,70],[95,45],[44,83],[-93,15],[-55,53],[18,46],[-103,3],[-54,26],[19,38],[-154,53],[1,59],[-85,1],[-20,54],[-76,14],[-100,-41],[-88,37],[52,77],[-73,-1],[-134,39],[-109,-28],[8,39],[-85,47],[-85,-56],[-15,48],[-48,0],[-142,37],[-37,41],[-79,-25],[39,-32],[-44,-40],[-21,-76],[-115,-23],[-27,79],[44,46],[-100,23],[9,-58],[-97,-40],[-174,-15],[5,-61],[-30,-65],[-126,56],[46,30],[-6,50],[50,35],[-2,55],[-178,-58],[-63,-72],[-84,9],[-33,105],[-46,-45],[-69,11],[-62,-70],[118,-22],[-31,-33],[115,-49],[-23,-47],[-176,47],[-177,24],[-116,25],[-61,58],[-24,56],[-167,54],[-52,34],[10,42],[160,41],[80,72],[253,-13],[13,39],[-83,19],[15,47],[-112,-34],[-95,-5],[-143,13],[-202,63],[-16,29],[-152,-10],[-57,33],[-8,63],[-92,19],[-58,40],[58,87],[124,54],[153,24],[185,-11],[77,-15],[235,-27],[-13,29],[-155,31],[-10,28],[136,46],[285,24],[223,-22],[22,43],[106,8],[81,34],[-73,109],[54,29],[-274,20],[-50,-80],[-142,-50],[-186,-5],[2,32],[-93,99],[-34,-29],[70,-74],[-18,-28],[-151,-36],[-207,63],[-76,32],[121,38],[-82,20],[-110,0],[-10,45],[87,66],[-51,19],[-79,-49],[-127,-17],[-94,31],[-45,39],[6,54],[-182,4],[-48,87],[-48,-3],[-60,59],[42,31],[14,93],[-55,38],[85,43],[13,70],[78,20],[114,3],[66,46],[85,13],[114,-21],[48,65],[133,28],[91,47],[123,0],[127,68],[-61,32],[161,72],[114,23],[87,-20],[98,56],[96,16],[114,-7],[122,-28],[50,7],[164,109],[55,56],[218,147],[81,72],[25,79],[-125,52],[101,75],[-118,40],[-116,17],[196,40],[-27,22],[-121,-21],[-86,8],[-172,-50],[-50,2],[-82,56],[-200,-25],[-45,72],[-81,27],[-3,109],[136,47],[85,57],[-29,33],[96,16],[169,105],[144,39],[110,103],[3,52],[293,79],[96,81],[204,-15],[191,-84],[90,-60],[77,-4],[149,46],[-183,119],[-71,99],[141,96],[5,33],[-153,116],[-18,36],[61,51],[247,75],[281,-33],[88,-28],[13,-90],[179,-34],[-136,162],[-268,79],[271,85],[389,45],[338,59],[102,-26],[62,50],[240,40],[97,-39],[121,-149],[-18,-69],[27,-98],[-113,-132],[17,-118],[77,9],[-24,84],[189,115],[0,123],[87,16],[215,-87],[115,-11],[164,-76],[50,73],[214,-33],[104,43],[-152,74],[-170,141],[2,127],[-52,35],[10,57],[331,-2],[205,-55],[65,-69],[187,-56],[166,-86],[275,-65],[89,-49],[43,-61],[243,-169],[165,-23],[89,31],[-30,67],[-72,17],[-110,107],[143,64],[-81,88],[69,53],[233,43],[2,66],[-132,43],[-57,76],[-140,43],[-186,90],[25,34],[386,-13],[132,12],[310,3],[403,-49],[190,-102],[192,6],[12,76],[-128,37],[-87,-9],[-124,46],[-203,40],[-247,13],[-409,-17],[-192,15],[-92,51],[110,46],[-126,24],[-108,61],[99,38],[216,5],[96,-19],[171,20],[44,83],[122,5],[274,-62],[18,-35],[114,-24],[200,-94],[335,-4],[183,-102],[25,51],[-117,62],[103,81],[398,60],[-180,38],[-197,-2],[-83,42],[40,41],[-52,36],[7,62],[233,-35],[-35,48],[71,56],[284,-54],[83,-53],[100,42],[-195,52],[166,50],[570,12],[343,35],[570,-34],[163,33],[158,-11],[202,-35],[253,-79],[76,39],[144,23],[296,-17],[266,-46],[212,-61],[-86,-52],[-309,-73],[-347,-12],[-440,22],[-375,-22],[-74,-35],[-250,-50],[-129,-4],[-445,-69],[56,-22],[610,54],[86,33],[186,28],[80,34],[198,13],[478,-29],[441,-12],[163,45],[323,48],[94,-6],[33,-83],[78,-34],[-108,-88],[85,-47],[99,48],[195,-23],[62,-44],[137,31],[99,-40],[170,-35],[98,10],[207,-79],[153,-82],[-29,-32],[-154,-52],[-116,-10],[-31,-52],[-115,-52],[-218,-32],[-169,4],[-153,-13],[-130,-46],[-171,-34],[-244,0],[-395,26],[-255,7],[-255,-14],[-201,-24],[-227,-1],[44,-35],[-271,-56],[-471,-122],[-8,-141],[145,5],[9,35],[208,89],[728,122],[320,25],[241,-2],[597,-26],[-27,-54],[-1,-101],[-226,-81],[-311,-84],[-293,-45],[117,-56],[138,-8],[104,22],[100,51],[365,81],[137,55],[236,19],[-7,99],[28,101],[229,36],[320,7],[75,-101],[-8,-145],[-80,-179],[-91,-96],[-139,-82],[-164,-140],[-152,-94],[42,-44],[-122,-102],[94,-3],[108,96],[-13,57],[130,25],[110,44],[18,38],[178,101],[101,27],[71,45],[31,68],[222,118],[140,15],[-2,-99],[231,49],[211,-43],[80,-51],[76,26],[1,48],[107,24],[-32,56],[51,38],[105,-10],[160,47],[68,52],[207,8],[78,-33],[210,24],[115,-16],[156,-80],[68,-2],[192,-61],[64,-159],[-210,-71],[-202,-94],[3,-20],[-161,-60],[-178,10],[-89,-14],[67,-80],[59,-27],[-68,-47],[-197,-10],[-76,-22],[-36,-62],[-169,-5],[-69,23],[-200,13],[-42,60],[-74,-13],[34,-58],[-79,-10],[-154,-53],[-304,65],[-15,-23],[111,-46],[133,-14],[137,-36],[168,9],[102,35],[71,-2],[50,-43],[90,-1],[153,-46],[-109,-54],[-71,-79],[-145,-42],[-211,7],[-118,-12],[-378,69],[-155,-108],[-49,-95],[-98,-83],[-34,-117],[61,-16],[100,19],[11,72],[68,102],[206,74],[83,-13],[185,36],[122,1],[93,-29],[17,-36],[-146,-163],[-74,-48],[-65,-8],[-132,36],[-101,5],[-76,-31],[-65,-63],[44,-54],[-112,-55],[74,-56],[-4,-65],[155,-27],[-146,-56],[-1,-60],[-127,-26],[-57,-36],[-182,-7],[-1,-75],[33,-27],[-82,-42],[-44,-64],[77,-50],[3,-66],[-37,-40],[-72,-189],[50,-107],[-47,-45],[-86,-39],[25,-44],[-17,-48],[-51,-39],[-61,-164],[107,-23],[88,62],[-15,84],[93,135],[101,24],[43,-51],[204,-86],[133,-16],[51,-32],[47,-86],[-85,-29],[-79,28],[-109,71],[-77,13],[-168,-36],[54,-39],[81,-11],[38,-39],[-136,-42],[181,-28],[129,-78],[108,-81],[48,14],[-24,51],[48,27],[137,-29],[49,-53],[4,-207],[-58,-105],[-114,1],[-28,33],[-131,10],[-110,64],[-142,13],[-147,-60],[-75,-58],[-58,10],[-21,-53],[-100,-46],[-102,149],[-79,-25],[32,-47],[-88,-40],[53,-49],[-16,-83],[59,-67],[81,-2],[72,16],[31,-35],[-63,-130],[203,70],[63,-9],[105,-57],[142,27],[59,-89],[-12,-50],[-78,6],[-91,-60],[173,-59],[67,-98],[-17,-52],[60,-106],[11,-84],[-7,-91],[-29,-73],[-38,-43],[-78,9],[-37,54],[15,37],[-46,43],[-52,1],[-96,-30],[-129,73],[-27,48],[-115,91],[-128,59],[-32,-22],[87,-36],[112,-65],[45,-100],[71,-26],[52,-50],[91,-46],[18,-35],[-50,-20],[-61,19],[-74,-15],[-6,-34],[128,-7],[13,-123],[-22,-25],[40,-71],[-36,-51],[131,-16],[154,-60],[73,75],[40,-14],[8,-95],[86,-35],[-58,-99],[-52,-49],[-76,-24],[-160,38],[-12,71],[-31,37],[-73,15],[55,-90],[25,-72],[60,-18],[-16,-36],[-102,-13],[-63,-23],[-145,-16],[-28,31],[-87,26],[-71,37],[21,66],[-42,3],[-8,-71],[-36,-41],[8,-41],[-85,-26],[64,-39],[91,1],[55,32],[96,-38],[74,-49],[119,-40],[110,1],[-1,-69],[-53,-13],[-13,-36],[21,-58],[-16,-45],[29,-66],[-37,-26],[-75,8],[-136,-5],[-73,26],[-5,-73],[-80,-25],[-98,-75],[-52,3],[-89,47],[-64,9],[-157,89],[-137,108],[-18,50],[25,71],[-47,21],[-63,-13],[-31,-60],[31,-106],[-149,36],[66,-70],[-85,-25],[-107,-13],[-36,-39],[16,-35],[-93,-73],[-105,-7],[-72,70],[-99,-3],[-56,36],[-57,82],[-68,-23],[105,-87],[70,-33],[105,-12],[-82,-101],[-102,33],[-7,-28],[55,-28],[66,-8],[56,60],[105,12],[57,-11],[56,-47],[162,-33],[32,-47],[-55,-56],[-69,-25],[-96,-15],[-49,-47],[-125,-26],[53,-37],[84,9],[97,73],[93,-27],[35,-37],[109,-42],[-8,-32],[26,-82],[-17,-21],[-121,-42],[3,-46],[85,44],[77,-13],[55,-60],[108,-41],[73,-43],[-8,-39],[127,-45],[74,-57],[132,-72],[-62,-36],[-18,-61],[-86,-78],[39,-30],[52,55],[106,-66],[30,83],[28,19],[42,-59],[-19,-51],[-92,-16],[-29,-84],[55,-87],[19,56],[57,52],[59,-59],[48,2],[-42,-98],[37,-20],[21,-45],[-54,-75],[46,-7],[-2,-110],[-16,-122],[35,-2],[-8,-99],[48,-51],[-48,-69],[-49,5],[-59,45],[-59,-38],[-36,1],[-23,134],[9,135],[-48,-12],[-14,-73],[22,-104],[-16,-93],[-26,-6],[-155,11],[-49,21],[-145,104],[-64,157],[0,98],[-25,79],[-114,123],[8,41],[-108,-22],[-49,45],[-34,64],[-68,64],[-59,19],[-114,-2],[-75,24],[-28,-42],[-39,-2],[-78,37],[-54,54],[-3,36],[-119,92],[4,32],[-77,46],[-134,19],[-50,-20],[16,-33],[128,-13],[-2,-20],[70,-33],[123,-84],[-14,-51],[21,-30],[82,-44],[94,-34],[69,20],[130,-3],[73,-13],[94,-103],[-4,-40],[-43,-70],[-70,-47],[-84,-34],[-96,-72],[-82,-24],[-71,10],[-51,-12],[-83,17],[-81,135],[-35,-8],[31,-67],[33,-30],[-8,-43],[-82,30],[-50,-19],[46,-51],[45,-8],[-33,-126],[-97,-116],[-99,-15],[-120,-39],[33,-54],[72,51],[75,8],[71,27],[-10,-53],[29,-44],[84,13],[94,32],[114,18],[34,-9],[92,32],[55,-16],[45,-64],[-67,-43],[-57,-8],[-38,19],[-107,-55],[-33,-47],[-121,-58],[-58,33],[-48,-3],[-15,-51],[54,9],[35,-57],[29,18],[98,24],[1,-56],[60,-5],[31,86],[3,51],[51,24],[26,36],[86,-11],[50,-31],[176,89],[128,71],[-14,-68],[41,-10],[39,46],[159,-90],[180,-67],[83,-21],[177,-26],[120,17],[93,36],[5,-47],[-73,-78],[-59,6],[0,-34],[-80,21],[-44,-68],[32,-37],[-34,-45],[-41,24],[-120,-51],[-1,-103],[-47,-46],[-44,20],[-42,-12],[10,-41],[-21,-44],[-41,19],[-41,-63],[-49,-25],[-3,-42],[-38,-17],[-104,47],[-85,-52],[117,-13],[-14,-72],[-34,-11],[-58,-54],[-55,40],[-8,-83],[-42,-65],[-38,16],[-41,-57],[-98,-2],[8,-61],[-42,-22],[-113,2],[-38,-58],[-69,19],[20,-48],[-64,-11],[-87,8],[-143,-92],[-42,26],[-52,-69],[-55,25],[-59,-24],[-23,-60],[-35,10],[-42,-53],[-60,17],[-48,52],[-17,73],[-40,5],[-24,-86],[28,-32],[-37,-25],[10,-39],[-17,-43],[-65,0],[-4,100],[-56,-7],[-51,34],[-21,-20],[95,-52],[16,-74],[-116,-2],[-11,-16],[-76,7],[-68,27],[-44,-30],[-35,26],[8,86],[-27,35],[-51,-10],[-32,28],[-13,49],[-70,50],[4,39],[-20,82],[-37,-37],[-86,28],[-8,-28],[78,-54],[36,-72],[68,-25],[64,-154],[-2,-50],[-34,-20],[16,-99],[-48,-28],[-20,23],[-68,-29],[-38,-74],[-44,-38],[-51,-15],[-43,-91],[-30,-5],[0,-62],[-67,-16],[11,-64],[28,-64],[-36,-52],[-13,-76],[-127,-147],[15,-87],[-32,-26],[-26,-60],[-75,8],[-19,-109],[-45,-42],[16,-21],[-63,-64],[-61,-50],[-44,5],[-57,30],[-35,-3],[-63,108],[-43,5],[85,-93],[20,-42],[5,-99],[-63,-18],[-69,-94],[-10,-33],[-67,27],[-23,78],[-26,-65],[-81,-48],[-7,-26],[-71,-51],[-29,-34],[-95,100],[-40,9],[-26,53],[1,47],[35,12],[30,36],[15,58],[45,58],[97,35],[3,37],[-115,-49],[-65,2],[-51,33],[-111,25],[-3,-37],[118,-31],[27,-34],[-48,-37],[-22,-54],[0,-59],[-16,-93],[-41,-21],[-72,9],[98,-74],[-42,-118],[-44,25],[-54,-27],[-10,-31],[-104,-14],[-40,77],[-69,-98],[-34,73],[-59,-13],[-10,-75],[-77,26],[-1,-68],[53,-5],[-8,-52],[22,-78],[-28,-44],[-46,-17],[5,-67],[-51,-7],[-8,-35],[-56,21],[-35,66],[-87,-52],[-43,18],[11,-84],[-28,-60],[84,-120],[51,-46],[8,-127],[59,-93],[-48,-25],[-27,43],[-48,-5],[-35,-43],[-42,-13],[-96,27],[-49,-59],[43,-12],[-19,-41],[120,-32],[51,21],[75,-34],[18,-48],[-26,-28],[10,-32],[-33,-26],[37,-43],[-8,-58],[29,-75],[-69,-13],[-69,19],[-23,20],[-116,62],[15,-36],[59,-56],[39,4],[55,-21],[43,-56],[0,-53],[-87,-6],[23,-37],[-13,-37],[-100,-22],[-10,41],[-37,6],[-25,49],[-25,9],[-48,-28],[6,-31],[16,-37],[40,-29],[56,-88],[11,-70],[-31,-21],[6,-40],[-93,16],[-8,34],[-70,9],[56,-64],[95,-29],[3,-37],[-40,-22],[-34,-62],[-33,15],[-10,-43],[-57,28],[-50,-1],[-57,-98],[-82,17],[-27,-14],[133,-53],[44,-36],[15,-50],[-16,-25],[41,-52],[-10,-24],[-88,51],[-15,23],[-73,29],[102,-128],[30,15],[41,-24],[0,-92],[-52,-62],[16,-87],[25,35],[56,-3],[-30,-66],[6,-45],[-22,-57],[-32,-25],[7,-88],[-22,-51],[-47,-2],[-132,31],[55,-41],[102,-3],[-15,-66],[41,13],[-18,-73],[-49,-64],[18,-54],[-63,3],[-27,-85],[54,-5],[-13,-106],[-67,-25],[65,-42],[-37,-27],[49,-44],[-6,-44],[-34,-65],[-46,-54],[-43,-30],[-87,52],[-31,41],[-20,-44],[54,-21],[57,-37],[-34,-41],[85,-45],[8,-43],[-47,-17],[35,-121],[-129,43],[-146,39],[-12,60],[-40,-90],[-44,-6],[-17,-86],[-66,-17],[-26,63],[-45,19],[-9,41],[40,5],[45,26],[-18,25],[-42,-40],[-68,-8],[35,75],[36,39],[20,61],[-19,41],[-66,-35],[-22,15],[0,72],[-36,-4],[-14,55],[-28,-98],[-67,55],[-11,36],[22,37],[9,54],[69,75],[32,60],[-6,25],[-84,-134],[-34,28],[-46,6],[-12,-76],[-44,3],[-13,37],[22,51],[67,57],[49,7],[67,41],[27,72],[-28,2],[-43,-69],[-66,-31],[-39,-36],[-27,48],[55,40],[61,29],[-6,76],[-110,-116],[-39,13],[-27,34],[-25,-57],[-50,26],[-1,-43],[-27,-95],[-38,-33],[-54,25],[-3,29],[33,27],[3,31],[-131,-15],[6,-66],[-85,-20],[-53,26],[-66,-24],[-20,38],[102,62],[29,38],[-31,36],[-54,28],[-16,-10],[-35,85],[-63,-14],[-19,36],[13,100],[-69,26],[-67,-25],[-3,48],[63,16],[38,31],[100,19],[-35,49],[-51,-42],[-124,-62],[-32,27],[2,35],[-43,12],[15,37],[51,-5],[-12,39],[-13,121],[47,43],[3,67],[-64,-89],[-4,-78],[-47,13],[-23,58],[14,63],[41,33],[21,-4],[67,68],[-30,21],[-56,-57],[-54,-27],[-11,31],[-43,11],[-13,60],[33,92],[-119,32],[-21,56],[-44,23],[-31,60],[12,73],[56,108],[-20,20],[-32,-52],[-15,100],[-22,25],[31,70],[-53,-15],[-42,60],[6,41],[53,37],[-40,56],[-67,-21],[-32,-45],[-38,28],[-16,97],[16,37],[-43,19],[36,76],[64,27],[-5,20],[-89,-25],[-52,25],[1,37],[-54,60],[-3,43],[37,33],[-9,49],[20,46],[-70,70],[145,56],[73,4],[43,52],[-12,33],[-43,-47],[-123,-38],[-30,-17],[-50,25],[-12,46],[28,31],[91,-33],[32,24],[62,132],[84,38],[-36,83],[-52,26],[36,35],[69,38],[62,-28],[45,-138],[57,-50],[29,-11],[57,-57],[18,11],[-45,63],[-79,55],[-21,29],[-17,79],[23,46],[-47,6],[-96,40],[-68,-26],[-15,-37],[-86,-30],[14,62],[-39,4],[-17,-70],[-21,-8],[-3,-72],[-61,-99],[-9,-62],[-44,-61],[-43,-7],[-1,55],[-24,32],[-16,159],[29,62],[-27,17],[19,99],[-10,44],[-31,46],[59,52],[-69,59],[29,36],[-15,58],[10,73],[-44,-8],[-18,-43],[-48,60],[24,50],[-38,82],[-49,35],[21,53],[-44,53],[-52,-26],[-45,13],[41,147],[-46,32],[-58,11],[-5,63],[72,69],[60,30],[70,67],[23,55],[85,72],[26,5],[60,54],[38,81],[54,29],[137,129],[33,-2],[6,55],[-42,-16],[-83,-66],[-78,-86],[-46,-24],[-14,-54],[-32,-51],[-78,-46],[-80,-73],[-24,-53],[-62,-59],[-88,-60],[-88,-1],[16,49],[-11,101],[-14,25],[28,125],[62,13],[-32,41],[6,40],[63,41],[68,-2],[72,76],[-43,9],[-40,-37],[-20,35],[32,26],[116,13],[-176,39],[-66,-12],[-57,5],[-45,46],[-1,68],[-29,33],[99,67],[49,3],[39,22],[64,11],[122,37],[10,22],[-168,-52],[-24,6],[-109,-34],[-40,-31],[-33,18],[19,128],[31,40],[111,71],[28,7],[46,104],[72,30],[113,11],[9,-18],[100,-35],[57,-43],[97,16],[53,53],[67,-7],[12,57],[-60,-33],[-19,16],[-17,77],[94,20],[-52,40],[-46,-37],[-55,14],[18,-56],[38,-27],[-24,-46],[-60,-18],[-40,-31],[-67,55],[-75,5],[-28,30],[-177,-40],[-47,-54],[-19,-47],[-119,-96],[-26,66],[53,100],[-30,51],[60,77],[56,21],[1,64],[46,36],[-93,82],[91,14],[40,-37],[48,40],[57,-3],[19,-24],[115,-56],[38,-28],[95,6],[35,-10],[88,16],[101,-79],[85,-28],[14,26],[-70,52],[-70,13],[-12,29],[-51,32],[-21,60],[6,51],[-118,-5],[-39,-29],[-67,2],[-21,-19],[-96,-25],[2,44],[-30,18],[-54,-29],[-52,43],[-68,20],[-38,-16],[-19,41],[42,18],[32,-35],[98,72],[87,51],[-54,24],[114,32],[29,-8],[51,6],[34,-40],[54,7],[168,43],[-8,27],[51,21],[-31,58],[-61,42],[1,73],[32,65],[-13,49],[15,69],[80,-9],[43,-61],[31,-71],[40,25],[-78,108],[76,-3],[86,23],[24,-40],[60,26],[46,1],[-22,75],[-42,-20],[-73,3],[-96,-19],[-74,19],[-53,-35],[-50,39],[23,63],[32,32],[-3,34],[38,50],[-19,124],[71,-17],[-47,70],[36,44],[82,-20],[38,8],[-36,58],[-7,43],[-73,12],[12,37],[91,9],[-41,44],[-152,-54],[-63,-7],[15,79],[-51,-11],[-44,-64],[-28,30],[-117,-1],[-97,35],[-97,116],[-60,49],[-92,40],[-175,33],[-58,22],[-38,67],[-107,113],[-1,34],[93,65],[64,17],[49,-28],[141,-29],[65,18],[127,-33],[76,-64],[67,-38],[96,-84],[96,-26],[103,-53],[95,-29],[45,31],[-59,41],[-49,-1],[-6,39],[-65,16],[12,50],[70,63],[-132,33],[28,77],[77,-19],[57,-51],[20,79],[-58,-4],[-12,36],[-61,-2],[-31,30],[-87,20],[-17,28],[-76,37],[37,35],[64,-39],[108,-39],[-62,118],[-40,-19],[-66,21],[-57,-27],[-48,6],[37,71],[68,40],[89,-7],[-6,45],[-68,28],[-128,-118],[-72,-27],[-1,52],[46,11],[22,36],[-12,49],[88,54],[95,18],[8,43],[-110,-34],[-80,-51],[-93,-12],[-104,38],[84,67],[93,35],[59,-1],[81,18],[36,31],[13,73],[-38,-8],[-20,-43],[-70,-35],[-128,11],[9,44],[-145,-2],[-52,14],[101,80],[5,62],[-37,1],[-4,-53],[-89,-26],[16,44],[-27,52],[3,72],[-35,-3],[7,-80],[24,-46],[-27,-47],[-65,-63],[-24,-51],[-42,25],[-35,-31],[59,-34],[-5,-88],[-140,-61],[-106,-10],[-58,60],[-105,-21],[-39,43],[-43,141],[-51,10],[16,38],[101,50],[37,56],[92,8],[0,29],[-80,-4],[-91,71],[189,158],[-10,127],[-67,-39],[-29,38],[-60,-25],[-36,43],[64,46],[137,-27],[40,29],[-6,83],[33,59],[118,61],[-32,34],[19,104],[-21,26],[-172,-19],[-12,46],[-75,-21],[-37,23],[-67,-9],[11,46],[53,-6],[29,61],[-29,43],[30,61],[53,54],[-58,52],[-188,111],[4,42],[45,57],[-7,43],[83,13],[-55,70],[-89,9],[40,45],[-48,30],[-38,70],[-73,-8],[-133,-35],[-27,42],[114,17],[45,44],[6,40],[109,41],[-1,38],[-121,-17],[9,35],[83,35],[-98,63],[161,10],[-18,27],[-149,80],[-15,60],[-81,10],[3,40],[-149,56],[-96,67],[70,61],[-62,46]],[[45183,98490],[-57,3],[-169,102],[154,4],[72,-109]],[[45104,93741],[8,45],[-69,24],[-62,-2],[-108,-41],[-122,32],[20,134],[-9,85],[98,39],[51,-48],[128,40],[-7,-61],[-39,-86],[46,-44],[50,-16],[80,61],[12,-94],[-77,-68]],[[45048,95809],[77,25],[27,-46],[-47,-101],[-42,-28],[-97,2],[36,75],[41,23],[5,50]],[[45132,98742],[-66,57],[-63,99],[38,10],[91,-166]],[[45020,96679],[10,85],[82,-10],[-13,-72],[-79,-3]],[[44869,94461],[-79,163],[-22,68],[-89,166],[34,68],[-30,78],[53,18],[65,-75],[-10,-77],[52,-234],[30,-98],[-4,-77]],[[44789,98663],[-81,18],[-136,126],[5,73],[81,24],[189,-202],[-58,-39]],[[44539,97391],[49,109],[107,19],[120,-50],[-199,-65],[-77,-13]],[[44780,93459],[-93,7],[-29,24],[101,67],[32,-19],[-11,-79]],[[44590,96426],[-77,38],[8,31],[111,92],[10,-155],[-52,-6]],[[44656,95759],[-118,17],[-170,66],[7,46],[138,-34],[36,-32],[105,0],[2,-63]],[[44378,93577],[-62,24],[-49,53],[48,158],[67,3],[71,-35],[-42,-30],[106,-68],[-89,-102],[-50,-3]],[[44429,95597],[-72,53],[70,29],[28,-59],[-26,-23]],[[44245,94774],[110,32],[30,-30],[-140,-2]],[[44191,94782],[-65,27],[66,68],[49,-26],[-50,-69]],[[44025,94914],[9,52],[107,-9],[-33,-61],[-83,18]],[[43899,94811],[-84,23],[-25,40],[10,58],[74,7],[101,-59],[-76,-69]],[[43854,92290],[37,-20],[-52,-56],[56,-24],[26,-40],[-52,-13],[-101,9],[-55,-16],[-69,105],[-72,28],[-124,-6],[-107,34],[-157,-11],[-7,64],[192,19],[151,38],[227,-39],[85,-39],[22,-33]],[[43704,92082],[46,-10],[94,-62],[52,-21],[8,-63],[-126,21],[-74,23],[-36,-22],[36,-52],[169,-70],[-63,-98],[-112,36],[-79,53],[-82,77],[-173,67],[-70,74],[-66,26],[-41,179],[82,30],[74,-3],[122,-31],[103,1],[38,-69],[98,-86]],[[43043,92584],[43,-1],[73,-33],[102,-12],[132,-42],[99,0],[138,-36],[-24,-37],[-103,-5],[-123,-26],[-160,-20],[-148,38],[-38,26],[-99,1],[-90,60],[132,95],[7,57],[116,16],[110,-9],[183,-44],[72,-28],[70,-72],[-175,17],[-112,42],[-38,-5],[-93,11],[-28,11],[-46,-4]],[[43502,89956],[-53,47],[92,20],[15,-47],[-54,-20]],[[43092,92196],[-134,48],[91,36],[28,-20],[15,-64]],[[42946,90807],[19,-27],[15,-106],[-77,-23],[-133,-79],[-60,48],[-101,-46],[-48,4],[-64,-24],[-120,-21],[-94,-27],[-58,-3],[-19,35],[34,41],[-20,33],[39,42],[67,8],[63,83],[42,18],[48,66],[87,-1],[134,48],[158,107],[5,-81],[40,-2],[44,-32],[-1,-61]],[[42714,90526],[-37,47],[41,36],[31,-56],[-35,-27]],[[42307,90723],[-5,96],[36,14],[100,-5],[-33,-54],[-98,-51]],[[41673,88903],[13,55],[54,-21],[-19,-36],[-48,2]],[[39834,87195],[-29,84],[48,28],[6,-37],[-25,-75]],[[39772,87147],[-49,48],[43,37],[6,-85]],[[39722,87027],[-30,18],[-30,61],[38,33],[45,-66],[-23,-46]],[[39466,87103],[-2,79],[77,86],[79,-69],[-26,-42],[43,-42],[-4,-24],[-95,-63],[-74,33],[2,42]],[[39003,99594],[-219,36],[-139,64],[-191,8],[39,70],[248,-51],[63,-47],[216,-33],[-17,-47]],[[38888,99726],[-139,38],[116,47],[98,-78],[-75,-7]],[[38728,99527],[-159,46],[-55,57],[144,-6],[222,-45],[-37,-69],[-115,17]],[[38823,86214],[-77,34],[-11,129],[-36,76],[-20,10],[-32,91],[34,20],[70,-82],[-5,-39],[42,-112],[-25,-40],[48,-24],[12,-63]],[[38611,99493],[-357,120],[182,11],[155,-76],[20,-55]],[[38600,86043],[11,56],[36,17],[54,-6],[-22,-65],[-79,-2]],[[38554,85356],[-17,-25],[-58,23],[-36,54],[-45,53],[-14,5],[-21,32],[0,18],[20,16],[26,4],[58,-59],[27,-48],[49,-10],[29,-46],[-18,-17]],[[38527,85264],[-34,5],[-14,55],[46,-5],[2,-55]],[[38247,84968],[-25,-18],[-14,57],[57,38],[58,-48],[0,-34],[-76,5]],[[38008,83074],[-8,-51],[-70,43],[-7,-5],[-7,-16],[-23,-81],[-64,37],[-45,72],[-40,42],[3,41],[94,-23],[49,-27],[118,-32]],[[37923,82987],[-3,41],[5,32],[18,-15],[21,-13],[-16,-41],[-25,-4]],[[37805,82877],[-61,14],[0,53],[40,72],[66,-45],[26,-35],[-35,-41],[-36,-18]],[[37693,82933],[-21,29],[32,61],[30,11],[-13,-85],[-28,-16]],[[37673,83005],[-37,39],[16,80],[37,-1],[33,-65],[-49,-53]],[[36799,98985],[-169,157],[-52,81],[258,23],[152,-15],[317,-103],[48,-54],[114,-55],[-3,-45],[-166,-50],[-46,-38],[99,-112],[-117,-12],[-43,86],[-75,15],[-317,122]],[[37390,83191],[22,117],[48,-20],[-12,-47],[-51,-82],[-7,32]],[[36994,99373],[-101,21],[-102,58],[71,70],[181,25],[91,-45],[154,-37],[-37,-26],[90,-56],[-347,-10]],[[37095,83621],[-42,-39],[-16,36],[111,85],[31,-26],[-51,-45],[-33,-11]],[[36693,83540],[-58,2],[-17,61],[73,21],[40,-19],[-4,-41],[-34,-24]],[[36389,99326],[-45,56],[65,28],[212,-56],[-56,-35],[-176,7]],[[35920,85288],[34,38],[23,-55],[-35,-15],[-22,32]],[[35833,89878],[-65,-14],[-31,125],[-12,12],[65,83],[-53,12],[32,54],[106,-18],[45,-39],[-38,-62],[-45,-18],[-4,-135]],[[35763,86050],[-2,47],[23,89],[40,103],[58,-22],[-63,-103],[-27,-77],[-29,-37]],[[35735,86159],[4,91],[43,2],[-22,-78],[-25,-15]],[[35595,88814],[3,33],[112,23],[44,-36],[-159,-20]],[[35615,90674],[-39,6],[0,47],[52,3],[73,-48],[-86,-8]],[[35555,88855],[-58,-5],[4,47],[164,54],[16,-40],[-72,-20],[-54,-36]],[[35643,90825],[-101,2],[-37,18],[18,57],[82,-20],[38,-57]],[[35442,89179],[-11,22],[61,34],[89,-40],[-52,-22],[-25,20],[-62,-14]],[[34922,90155],[-85,36],[-51,42],[-17,45],[1,80],[21,26],[106,57],[172,-53],[68,-8],[57,-29],[67,-60],[90,-139],[67,-47],[131,-38],[26,-52],[-7,-47],[29,-14],[-65,-100],[-198,-104],[-107,-32],[-95,-51],[-90,8],[-13,40],[-79,21],[-26,60],[91,7],[-13,56],[-91,39],[-56,-10],[-78,30],[-49,80],[17,24],[73,-6],[-75,64],[23,85],[38,12],[118,-22]],[[35420,98738],[-113,20],[-132,52],[-192,49],[-52,90],[107,72],[123,-45],[11,-45],[170,-61],[182,-115],[-104,-17]],[[35277,89191],[-28,35],[70,10],[38,33],[135,6],[-27,-49],[-119,-6],[-69,-29]],[[35282,91035],[-46,58],[-8,67],[62,37],[153,-32],[17,-44],[-58,-24],[-21,-57],[-99,-5]],[[35222,91307],[-72,31],[1,60],[36,15],[118,-16],[19,-24],[-72,-33],[-30,-33]],[[35277,87005],[-45,3],[-8,56],[78,18],[24,-21],[-49,-56]],[[35163,87929],[28,44],[109,10],[-84,-47],[-53,-7]],[[35277,89030],[-65,35],[50,51],[53,-24],[-38,-62]],[[35304,86915],[-43,29],[29,48],[24,-17],[-10,-60]],[[35166,88770],[-38,32],[17,37],[49,-1],[15,-40],[-43,-28]],[[35120,91096],[43,-88],[-3,-37],[-59,-28],[-102,63],[40,80],[53,54],[28,-44]],[[34756,90471],[-42,40],[48,32],[36,-30],[-42,-42]],[[34631,92115],[-61,-78],[-30,87],[14,54],[106,47],[18,24],[64,-22],[-52,-73],[-59,-39]],[[34576,91751],[-44,39],[110,86],[80,-14],[-58,-41],[-47,-57],[-41,-13]],[[34545,92356],[35,31],[53,-18],[-36,-48],[-52,35]],[[34575,91517],[-68,37],[74,43],[34,-24],[-40,-56]],[[34444,92119],[-26,33],[35,35],[72,9],[7,-49],[-88,-28]],[[34444,92932],[-85,24],[-100,0],[19,64],[67,-29],[68,-3],[53,-26],[-22,-30]],[[34106,93414],[1,24],[157,34],[28,-53],[-186,-5]],[[30620,94889],[-34,49],[104,4],[-8,-43],[-62,-10]],[[30277,95492],[-67,58],[149,8],[184,-49],[-266,-17]],[[30000,95445],[-20,25],[-119,33],[88,47],[190,-49],[-44,-53],[-95,-3]],[[2820,26419],[11,-8],[9,-67],[-18,-64],[-18,6],[-11,48],[14,70],[13,15]],[[14362,22496],[-17,42],[14,11],[3,-53]],[[11368,33027],[28,24],[21,-25],[5,-44],[-43,-4],[-18,-31],[-18,51],[25,29]],[[11235,33651],[19,-35],[-26,-28],[-10,22],[17,41]],[[11102,33704],[-3,-33],[9,-36],[-50,-51],[-9,24],[-6,93],[53,-22],[6,25]],[[11086,33310],[15,-31],[0,-45],[-14,-4],[-12,39],[11,41]],[[9659,29539],[22,4],[-23,-78],[1,74]],[[8452,27436],[24,25],[40,-32],[12,-46],[-2,-81],[39,-23],[11,-21],[-10,-71],[-24,13],[-27,77],[-18,-14],[-46,24],[-11,76],[0,55],[12,18]],[[8384,27464],[12,-35],[-18,-35],[-18,39],[0,34],[24,-3]],[[7925,27911],[-7,55],[6,51],[33,-101],[-22,-22],[-10,17]],[[7908,28113],[27,-19],[-8,-48],[-23,30],[4,37]],[[2287,33401],[0,5],[-5,26],[1,0],[1,-11],[3,-10],[0,-7],[0,-3]],[[1413,24739],[3,-111],[-20,48],[17,63]],[[1292,24889],[5,-24],[30,-3],[7,-43],[19,-6],[11,51],[12,-10],[-25,-99],[-16,36],[-22,16],[-19,37],[-2,45]],[[1042,30470],[8,48],[16,-22],[-10,-55],[-14,29]],[[2238,29982],[-36,84],[10,25],[57,27],[11,-24],[40,-35],[18,-3],[44,-89],[-3,-32],[-92,4],[-27,43],[-22,0]],[[2167,30186],[-8,-74],[-29,17],[-54,-18],[-44,132],[-33,74],[13,18],[30,-20],[33,32],[60,15],[28,-90],[7,-54],[-3,-32]],[[71926,63950],[-25,23],[-9,46],[-23,61],[-3,48],[16,79],[-7,28],[3,93],[-6,61],[-24,24],[4,42],[21,0],[33,53],[17,-8],[19,112],[-6,37],[-23,-2],[-50,119],[-44,34],[-73,31],[-8,66],[-16,20],[10,95],[-17,45],[-17,76],[7,22],[-37,119],[2,91],[26,56],[-2,43],[-40,-11]],[[71850,63427],[14,33],[7,-6]],[[71824,63397],[17,14]],[[72020,63354],[9,34],[-10,58],[7,27],[-19,67],[4,92],[-28,64],[3,107]],[[71482,65481],[-9,17],[-32,-17],[-37,55],[-38,9],[-22,45],[-18,-11]],[[71326,65579],[-23,63],[-21,11],[-16,43],[11,57],[-15,17],[-54,-68],[-14,9],[-36,-16],[-3,71],[-17,70],[-27,2],[-17,36],[-2,47],[23,26],[13,45],[-19,52],[11,72],[-14,73],[-17,40],[6,27]],[[70682,63521],[-12,77],[-21,40],[-8,56],[-39,33],[-1,33],[-27,53],[-14,7],[0,46],[20,10],[20,39],[8,98],[-14,59],[-29,14],[-15,43],[-6,62],[27,72],[38,13],[24,44],[-1,47],[-12,40],[-27,16],[-42,-24],[-17,8],[-6,59],[29,61],[-5,51],[-15,48],[-45,2],[-6,28],[35,59],[7,53],[13,30],[-4,55],[10,29],[35,-10],[40,39],[19,39],[24,3],[47,-15],[24,-42],[25,-19],[52,-5],[27,-31],[38,19],[28,-13],[28,-72],[82,-3],[33,-16],[78,128],[28,-40],[38,60],[37,24],[9,33],[39,-34],[22,0],[18,58],[0,60],[34,50],[35,-37],[3,66],[32,29],[-30,85],[-4,92],[-14,59],[-25,-2],[-5,31],[-26,75],[12,39],[-4,47]],[[45263,54905],[-14,50],[11,113],[9,229],[11,127],[4,99],[-1,59],[8,24],[0,64],[15,72],[26,160],[34,94],[12,-19],[40,41],[10,48],[9,93],[18,39],[8,132],[18,97],[30,55],[4,54],[-15,42],[20,56],[18,84],[30,116],[-6,33],[19,39],[49,178],[-4,106],[43,62],[4,31],[35,86],[35,71],[29,96],[21,42],[38,41],[5,50],[30,54],[2,72],[12,73],[3,97],[-7,62],[5,122],[11,88],[25,90],[17,162],[20,57],[18,97],[7,139],[20,60],[25,15],[19,39],[18,63],[39,14],[90,126],[41,85],[18,92],[23,151],[3,60],[24,93],[25,152],[16,116]],[[59907,63850],[20,51]],[[59444,65156],[1,-2]],[[59052,65234],[3,1],[8,7],[2,0]],[[59082,65238],[4,0]],[[70111,34766],[2,10],[6,-18],[-1,-5],[-7,13]],[[39475,1282],[16,-13],[40,27],[46,-24],[29,-34],[22,10],[69,-25],[24,18],[101,-43],[-18,-22],[24,-57],[26,-4],[19,-62],[17,29],[28,5],[16,-31],[19,-97],[41,-35],[-24,-32],[34,-21],[45,-156],[-24,0],[-9,-44],[-46,-24],[-57,103],[-12,66],[-35,56],[-20,56],[-72,29],[2,21],[-36,64],[-38,2],[-4,35],[-35,18],[-39,-9],[17,94],[-52,6],[-18,-23],[-35,-8],[-26,87],[-37,2],[2,36]],[[33805,2805],[-29,-13],[-105,4],[-4,-43],[52,-18],[-19,-84],[-15,33],[-34,-2],[-21,-35],[-25,54],[-51,4],[25,-63],[5,-58],[-39,-20],[-4,33],[-41,11],[16,-61],[-1,-37],[-37,6],[-24,49],[-16,4],[-28,63],[44,31],[-10,41],[35,75],[-7,59],[31,-5],[43,86],[58,42],[-40,51],[44,120],[3,31],[39,21],[-26,63],[79,-49],[30,21],[41,-8],[37,-55],[93,22],[26,-37],[9,-96],[-76,17],[8,-48],[33,-1],[49,-21],[-22,-34],[5,-38],[-65,-27],[-35,-25],[-31,-63]],[[33227,2636],[-37,-66],[-34,-35],[-8,41],[-28,64],[-15,-19],[-61,56],[44,24],[38,7],[-28,45],[72,-21],[23,35],[16,60],[0,53],[69,2],[4,50],[-53,-9],[-19,-38],[-41,5],[22,39],[40,27],[42,8],[-26,59],[-48,33],[-10,58],[-30,34],[29,22],[77,-87],[37,-7],[10,69],[19,20],[37,-22],[34,-36],[37,19],[16,-20],[31,3],[9,82],[58,-45],[-66,-165],[-25,9],[-25,-92],[-34,-42],[-20,-51],[-11,-59],[-25,-18],[-38,20],[-4,-33],[-39,14],[-12,-21],[1,-55],[-28,-17]],[[33268,3212],[42,8],[8,-26],[-22,-46],[-42,1],[14,63]],[[33045,2831],[15,44],[28,-27],[-2,-82],[-31,-38],[-35,62],[-1,60],[26,-19]],[[33424,3243],[54,-7],[-2,-45],[-29,1],[-23,51]]],"transform":{"scale":[0.0036000360003600046,0.0013945347997979982],"translate":[-180,-55.793524298999955]},"objects":{"countries":{"type":"GeometryCollection","geometries":[{"arcs":[[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]]],"type":"MultiPolygon","properties":{"name":"China"},"id":156},{"arcs":[[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]]],"type":"MultiPolygon","properties":{"name":"Japan"},"id":392},{"arcs":[[-37,82,83,84]],"type":"Polygon","properties":{"name":"D. P. R. of Korea"},"id":408},{"arcs":[[[85]],[[-33,86,87,88,89,90,91,92,93,94,95,96,97,98,-35,99]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105]],[[106]],[[107]],[[108]],[[109]],[[110]],[[111]],[[112]],[[113]],[[114]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134]],[[135]],[[136]],[[137]],[[138]],[[139]],[[140]],[[141]],[[142]],[[143]],[[144]],[[145]],[[146]],[[147]],[[148]],[[149]],[[150]],[[151]],[[152]],[[153]],[[154]],[[155]],[[156]],[[157]],[[158]],[[159]],[[160]],[[161]],[[162]],[[163]],[[164]],[[165]],[[166]],[[167]],[[168]],[[169]],[[170]],[[171]],[[172]],[[173]],[[174]],[[175]],[[176]],[[177]],[[178]],[[179]],[[180]],[[181]],[[182]],[[183]],[[184]],[[185]],[[186]],[[187]],[[188]],[[189]],[[190]],[[191]],[[192]],[[193]],[[194]],[[195]],[[196]],[[197]],[[198]],[[199]],[[200]],[[201]],[[202]],[[203]],[[204]],[[205]],[[206]],[[207]],[[208]],[[209]],[[210]],[[211]],[[212]],[[213]],[[214]],[[215]],[[216]],[[217]],[[218]],[[219]],[[220]],[[221]],[[222]],[[223]],[[224]],[[225]],[[226]],[[227]],[[228]],[[229]],[[230]],[[231]],[[232]],[[233]],[[234]],[[235]],[[236]],[[237]],[[238]],[[239]],[[240]],[[241]],[[242]],[[243]],[[244]],[[245]],[[246]],[[247]],[[248]],[[249]],[[250]],[[251]],[[252]],[[253]],[[254]],[[255]],[[256]],[[257]],[[258]],[[259]],[[260]],[[261]],[[262]],[[263]],[[264]],[[265]],[[266]],[[267]],[[268]],[[269]],[[270]],[[271]],[[272]],[[273]],[[274]],[[275]],[[276]],[[277]],[[278]],[[279]],[[280]],[[281]],[[282]],[[283]],[[284]],[[285]],[[286]],[[287]],[[288]],[[289]],[[290]],[[291]],[[292]],[[293]],[[294]],[[295]],[[296]],[[297,298,299]],[[300]],[[301]],[[302]],[[303]]],"type":"MultiPolygon","properties":{"name":"Russian Federation"},"id":643},{"arcs":[[[-43,304,305,306]],[[307]],[[308]],[[309]],[[310]],[[311]],[[312]],[[313]],[[314]],[[315]],[[316]],[[317]],[[318]],[[319]],[[320]],[[321]],[[322]],[[323,324]],[[325]],[[326]],[[327,328]],[[329,330]],[[331]],[[332]]],"type":"MultiPolygon","properties":{"name":"Viet Nam"},"id":704},{"arcs":[[-34,-100]],"type":"Polygon","properties":{"name":"Mongolia"},"id":496},{"arcs":[[[-306,333,-329,334,-331,335,-324,336,337,338]],[[339]]],"type":"MultiPolygon","properties":{"name":"Cambodia"},"id":116},{"arcs":[[-1,-307,-339,340,341]],"type":"Polygon","properties":{"name":"Lao People's Democratic Republic"},"id":418},{"arcs":[[[-2,-342,342,343,344,345,346,347,348]],[[349]],[[350]],[[351]],[[352]],[[353]],[[354]],[[355]],[[356]],[[357]],[[358]],[[359]],[[360]],[[361]],[[362]],[[363]],[[364]],[[365]],[[366]],[[367]],[[368]],[[369]],[[370]],[[371]],[[372]],[[373]],[[374]],[[375]],[[376]],[[377]],[[378]],[[379]],[[380]],[[381]],[[382]],[[383]],[[384]],[[385]]],"type":"MultiPolygon","properties":{"name":"Myanmar"},"id":104},{"arcs":[[[-338,386,387,388,-343,-341]],[[389]],[[390]],[[391]],[[392]],[[393]],[[394]]],"type":"MultiPolygon","properties":{"name":"Thailand"},"id":764},{"arcs":[[-29,395,396,397,398,399,400]],"type":"Polygon","properties":{"name":"Afghanistan"},"id":4},{"arcs":[[-4,401,402,403]],"type":"Polygon","properties":{"name":"Bhutan"},"id":64},{"arcs":[[[-39,404]],[[405]],[[406]]],"type":"MultiPolygon","properties":{"name":"Hong Kong SAR, China"},"id":344},{"arcs":[[[407,408]],[[409]],[[410]],[[411]],[[412]],[[413]],[[414]],[[415]],[[416]],[[417]],[[418]],[[419]],[[420]],[[421]],[[422]],[[423]],[[424]],[[425]],[[426]],[[427]],[[428]],[[429]],[[430]],[[431]],[[432]],[[433]],[[434]],[[435]],[[436]],[[437]],[[438]],[[439]],[[440]],[[441]],[[442]],[[443]],[[444]],[[445]],[[446]],[[447]],[[448]],[[449]],[[450]],[[451]],[[452]],[[453]],[[454]],[[455]],[[456]],[[457]],[[458]],[[459]],[[460]],[[461]],[[462]],[[463]],[[464]],[[465]],[[466]],[[467]],[[468]],[[469]],[[470]],[[471]],[[472]],[[473]],[[474]],[[475]],[[476]],[[477]],[[478]],[[479]],[[480]],[[481]],[[482]],[[483]],[[484]],[[485,486,487,488]],[[489]],[[490]],[[491]],[[492]],[[493]],[[494]],[[495]],[[496]],[[497]],[[498]],[[499]],[[500]],[[501]],[[502]],[[503]],[[504]],[[505]],[[506]],[[507]],[[508]],[[509]],[[510]],[[511]],[[512]],[[513]],[[514]],[[515]],[[516]],[[517]],[[518]],[[519]],[[520]],[[521]],[[522]],[[523,524]],[[525,526]],[[527]],[[528]],[[529]],[[530]],[[531]],[[532]],[[533]],[[534]],[[535]],[[536]],[[537]],[[538]],[[539]],[[540]],[[541]],[[542]],[[543]],[[544]],[[545]],[[546]],[[547]],[[548]],[[549]],[[550]],[[551]],[[552]],[[553]],[[554]],[[555]],[[556]],[[557]],[[558]],[[559]],[[560]],[[561]],[[562]],[[563]],[[564]],[[565]],[[566]],[[567]],[[568]],[[569]],[[570]],[[571]],[[572]],[[573]],[[574]],[[575]],[[576]],[[577]],[[578]],[[579]],[[580]],[[581]],[[582]],[[583]],[[584]],[[585]],[[586]],[[587]],[[588]],[[589]],[[590]],[[591]],[[592]],[[593]],[[594]],[[595]],[[596]],[[597]],[[598]],[[599]],[[600]],[[601]],[[602]]],"type":"MultiPolygon","properties":{"name":"Indonesia"},"id":360},{"arcs":[[[-6,603,-403,604,-348,605,606,607,608,609,610,-17,611,-15,612,-13,613,-11,614,-9,615,616]],[[617]],[[618]],[[619]],[[620]],[[621]],[[622]],[[623]],[[624]],[[625]],[[626]],[[627]],[[628]],[[629]],[[630]],[[631]],[[632]],[[633]]],"type":"MultiPolygon","properties":{"name":"India"},"id":356},{"arcs":[[[-32,634,635,636,637,-87]],[[638]],[[639]]],"type":"MultiPolygon","properties":{"name":"Kazakhstan"},"id":398},{"arcs":[[-31,640,641,-635],[642],[643]],"type":"Polygon","properties":{"name":"Kyrgyz Republic"},"id":417},{"arcs":[[[644]],[[-84,645]],[[646]],[[647]],[[648]],[[649]],[[650]],[[651]]],"type":"MultiPolygon","properties":{"name":"Republic of Korea"},"id":410},{"arcs":[[-41,652]],"type":"Polygon","properties":{"name":"Macau SAR, China"},"id":446},{"arcs":[[[-525,653,654,655,656,657]],[[658]],[[-526,659]],[[660]],[[661]],[[662]],[[663]],[[664]],[[665]],[[666]],[[667]],[[668]],[[669]],[[-388,670,671,672]],[[673]],[[674]],[[675]]],"type":"MultiPolygon","properties":{"name":"Malaysia"},"id":458},{"arcs":[[-7,-617,676]],"type":"Polygon","properties":{"name":"Nepal"},"id":524},{"arcs":[[[-397,677,678,-610,679,680]],[[681]]],"type":"MultiPolygon","properties":{"name":"Pakistan"},"id":586},{"arcs":[[[682]],[[683]],[[684]],[[685]],[[686]],[[687]],[[688]],[[689]],[[690]],[[691]],[[692]],[[693]],[[694]],[[695]],[[696]],[[697]],[[698]],[[699]],[[700]],[[701]],[[702]],[[703]],[[704]],[[705]],[[706]],[[707]],[[708]],[[709]],[[710]],[[711]],[[712]],[[713]],[[714]],[[715]],[[716]],[[717]],[[718]],[[719]],[[720]],[[721]],[[722]],[[723]],[[724]],[[725]],[[726]],[[727]],[[728]],[[729]],[[730]]],"type":"MultiPolygon","properties":{"name":"Philippines"},"id":608},{"arcs":[[[-30,-401,731,-641]],[[-644]]],"type":"MultiPolygon","properties":{"name":"Tajikistan"},"id":762},{"arcs":[[[-400,732,-636,-642,-732]],[[-643]]],"type":"MultiPolygon","properties":{"name":"Uzbekistan"},"id":860},{"arcs":[[[-347,733,-606]],[[-608,734]],[[736]],[[737]],[[738]],[[739]],[[740]],[[741]],[[742]],[[743]],[[744]],[[745]],[[746]],[[747]],[[748]],[[749]],[[750]],[[751]],[[752]],[[753]],[[754]],[[755]],[[756]],[[757]],[[758]],[[759]]],"type":"MultiPolygon","properties":{"name":"Bangladesh"},"id":50},{"arcs":[[760]],"type":"Polygon","properties":{"name":"Cocos (Keeling) Islands (Aus.)"},"id":166},{"arcs":[[761]],"type":"Polygon","properties":{"name":"Sri Lanka"},"id":144},{"arcs":[[762]],"type":"Polygon","properties":{"name":"Maldives"},"id":462},{"arcs":[[[-89,763,764,765,766]],[[767,768,769]]],"type":"MultiPolygon","properties":{"name":"Azerbaijan"},"id":31},{"arcs":[[770]],"type":"Polygon","properties":{"name":"Christmas Island (Aus.)"},"id":162},{"arcs":[[[-398,-681,771,772,773,-768,774,-765,775,776]],[[777]],[[778]],[[779]],[[780]],[[781]],[[782]]],"type":"MultiPolygon","properties":{"name":"Islamic Republic of Iran"},"id":364},{"arcs":[[[-98,783,784]],[[785]],[[786]],[[787,788,789]],[[790]],[[791]],[[792]],[[793]],[[794]],[[795]],[[796]],[[797]],[[798]],[[799]],[[800]],[[801]],[[802]],[[803]],[[804]],[[805]],[[806]],[[807]],[[808]],[[809]],[[810]],[[811]],[[812]],[[813]],[[814]],[[815]],[[816]],[[817]],[[818]],[[819]],[[820]],[[821]],[[822]],[[823]],[[824]],[[825]],[[826]],[[827]],[[828]],[[829]],[[830]],[[831]],[[832]],[[833]],[[834]],[[835]],[[836]],[[837]],[[838]]],"type":"MultiPolygon","properties":{"name":"Norway"},"id":578},{"arcs":[[-672,839]],"type":"Polygon","properties":{"name":"Singapore"},"id":702},{"arcs":[[[-789,840,841]],[[842]],[[843]],[[844]],[[845]],[[846]]],"type":"MultiPolygon","properties":{"name":"Sweden"},"id":752},{"arcs":[[-399,-777,847,-637,-733]],"type":"Polygon","properties":{"name":"Turkmenistan"},"id":795},{"arcs":[[-766,-775,-770,848,849]],"type":"Polygon","properties":{"name":"Armenia"},"id":51},{"arcs":[[-93,850,851,852,853]],"type":"Polygon","properties":{"name":"Belarus"},"id":112},{"arcs":[[-90,-767,-850,854,855]],"type":"Polygon","properties":{"name":"Georgia"},"id":268},{"arcs":[[[-769,-774,856,857,858,859,860,861,-855,-849]],[[862]],[[863]]],"type":"MultiPolygon","properties":{"name":"Türkiye"},"id":792},{"arcs":[[-92,864,865,866,867,868,869,-851]],"type":"Polygon","properties":{"name":"Ukraine"},"id":804},{"arcs":[[-861,870,871,872,873,874]],"type":"Polygon","properties":{"name":"Bulgaria"},"id":100},{"arcs":[[[-95,875,876]],[[877]],[[878]],[[879]],[[880]]],"type":"MultiPolygon","properties":{"name":"Estonia"},"id":233},{"arcs":[[-773,881,882,883,884,885,-857]],"type":"Polygon","properties":{"name":"Iraq"},"id":368},{"arcs":[[-298,886,887,-853,888]],"type":"Polygon","properties":{"name":"Lithuania"},"id":440},{"arcs":[[-94,-854,-888,889,-876]],"type":"Polygon","properties":{"name":"Latvia"},"id":428},{"arcs":[[-866,890,891]],"type":"Polygon","properties":{"name":"Moldova"},"id":498},{"arcs":[[[-299,-889,-852,-870,892,893,894,895]],[[896]]],"type":"MultiPolygon","properties":{"name":"Poland"},"id":616},{"arcs":[[-867,-892,897,-874,898,899]],"type":"Polygon","properties":{"name":"Romania"},"id":642},{"arcs":[[-858,-886,900,901,902,903]],"type":"Polygon","properties":{"name":"Syrian Arab Republic"},"id":760},{"arcs":[[[904,905,906,907,908]],[[909,910]]],"type":"MultiPolygon","properties":{"name":"Albania"},"id":8},{"arcs":[[911,912,913,914,915]],"type":"Polygon","properties":{"name":"Bosnia and Herzegovina"},"id":70},{"arcs":[[-894,916,917,918]],"type":"Polygon","properties":{"name":"Czech Republic"},"id":203},{"arcs":[[[919]],[[920]],[[921]],[[922]],[[923]],[[924,925]],[[926]],[[927]]],"type":"MultiPolygon","properties":{"name":"Denmark"},"id":208},{"arcs":[[[-97,928,-841,-788,929,-784]],[[930]],[[931]]],"type":"MultiPolygon","properties":{"name":"Finland"},"id":246},{"arcs":[[[932]],[[933]],[[934]],[[935]],[[936]],[[937]],[[938]],[[-860,939,-905,940,-871]],[[941]],[[942]],[[943]],[[944]],[[945]],[[946]],[[947]],[[948]],[[949]],[[950]],[[951]],[[952]],[[953]],[[954]],[[955]],[[956]],[[957]],[[958]],[[959]],[[960]],[[961]],[[962]],[[963]],[[964]],[[965]],[[966]]],"type":"MultiPolygon","properties":{"name":"Greece"},"id":300},{"arcs":[[[-913,967,968,969,970]],[[-916,971,972]],[[973]],[[974]],[[975]],[[976]],[[977]],[[978]],[[979]]],"type":"MultiPolygon","properties":{"name":"Croatia"},"id":191},{"arcs":[[-868,-900,980,-970,981,982,983]],"type":"Polygon","properties":{"name":"Hungary"},"id":348},{"arcs":[[[984,985,986,987,988],[994],[995]],[[989]],[[990]],[[991]],[[992]],[[993]]],"type":"MultiPolygon","properties":{"name":"Italy"},"id":380},{"arcs":[[-872,-941,-909,996,997]],"type":"Polygon","properties":{"name":"North Macedonia"},"id":807},{"arcs":[[-907,998,-910,999,-972,-915,1000,1001]],"type":"Polygon","properties":{"name":"Montenegro"},"id":499},{"arcs":[[-873,-998,1002,-1001,-914,-971,-981,-899]],"type":"Polygon","properties":{"name":"Serbia"},"id":688},{"arcs":[[-869,-984,1003,-917,-893]],"type":"Polygon","properties":{"name":"Slovak Republic"},"id":703},{"arcs":[[-908,-1002,-1003,-997]],"type":"Polygon","properties":{"name":"Kosovo"},"id":"XKX"},{"arcs":[[-918,-1004,-983,1004,-987,1005,1006,1007,1008]],"type":"Polygon","properties":{"name":"Austria"},"id":40},{"arcs":[[1009,1010,1011,1012,1013,1014,1015,1016,1017]],"type":"Polygon","properties":{"name":"Belgium"},"id":56},{"arcs":[[-986,1018,1019,-1008,1020,-1006]],"type":"Polygon","properties":{"name":"Switzerland"},"id":756},{"arcs":[[[-895,-919,-1009,-1020,1021,1022,-1017,1023,1024,-925,1025]],[[1026]],[[1027]],[[1028]]],"type":"MultiPolygon","properties":{"name":"Germany"},"id":276},{"arcs":[[1029,1030,1031,1032,1033,1034,1035,1036]],"type":"Polygon","properties":{"name":"Algeria"},"id":12},{"arcs":[[[1037]],[[-985,1038,1039,1040,1041,1042,1043,1044,-1010,1045,-1022,-1019]],[[1046]],[[1047]],[[1048]]],"type":"MultiPolygon","properties":{"name":"France"},"id":250},{"arcs":[[-1007,-1021]],"type":"Polygon","properties":{"name":"Liechtenstein"},"id":438},{"arcs":[[-1018,-1023,-1046]],"type":"Polygon","properties":{"name":"Luxembourg"},"id":442},{"arcs":[[1049]],"type":"Polygon","properties":{"name":"Malta"},"id":470},{"arcs":[[-995]],"type":"Polygon","properties":{"name":"San Marino"},"id":674},{"arcs":[[-969,1050,-988,-1005,-982]],"type":"Polygon","properties":{"name":"Slovenia"},"id":705},{"arcs":[[[-1030,1051,1052]],[[1053]]],"type":"MultiPolygon","properties":{"name":"Tunisia"},"id":788},{"arcs":[[-996]],"type":"Polygon","properties":{"name":"Vatican City"},"id":336},{"arcs":[[-1043,1054]],"type":"Polygon","properties":{"name":"Andorra"},"id":20},{"arcs":[[[1055]],[[1056]],[[-1042,1057,1058,1059,1060,1061,-1044,-1055]],[[1062]],[[1063]],[[1064]],[[1065]],[[1066]],[[1067]],[[1068]],[[1069]]],"type":"MultiPolygon","properties":{"name":"Spain"},"id":724},{"arcs":[[[1070]],[[1071]],[[1072]],[[1073]],[[1074]],[[1075]],[[1076]],[[1077]],[[1078]],[[1079]],[[1080,1081]],[[1082]],[[1083]],[[1084]],[[1085]],[[1086]],[[1087]],[[1088]],[[1089,1090]],[[1091,1092,1093,1094,1095,1096]],[[1097,1098]]],"type":"MultiPolygon","properties":{"name":"United Kingdom"},"id":826},{"arcs":[[1099]],"type":"Polygon","properties":{"name":"Jersey (U.K.)"},"id":832},{"arcs":[[-1040,1100]],"type":"Polygon","properties":{"name":"Monaco"},"id":492},{"arcs":[[[-1016,1101,-1024]],[[1102]],[[1103]],[[1104]],[[-1014,1105]],[[-1012,1106]]],"type":"MultiPolygon","properties":{"name":"Netherlands"},"id":528},{"arcs":[[1107,1108,1109,1110,1111,1112,1113]],"type":"Polygon","properties":{"name":"Benin"},"id":204},{"arcs":[[-1114,1114,1115,1116,1117,1118]],"type":"Polygon","properties":{"name":"Burkina Faso"},"id":854},{"arcs":[[-1117,1119,1120,1121,1122,1123]],"type":"Polygon","properties":{"name":"Côte d'Ivoire"},"id":384},{"arcs":[[-1116,1124,1125,-1120]],"type":"Polygon","properties":{"name":"Ghana"},"id":288},{"arcs":[[-1033,1126,-1118,-1124,1127,1128,1129]],"type":"Polygon","properties":{"name":"Mali"},"id":466},{"arcs":[[-1032,1130,1131,1132,-1108,-1119,-1127]],"type":"Polygon","properties":{"name":"Niger"},"id":562},{"arcs":[[[-1109,-1133,1133,1134,1135]],[[1136]],[[1137]],[[1138]],[[1139]],[[1140]],[[1141]],[[1142]],[[1143]],[[1144]],[[1145]],[[-1111,1146]]],"type":"MultiPolygon","properties":{"name":"Nigeria"},"id":566},{"arcs":[[-1113,1147,-1125,-1115]],"type":"Polygon","properties":{"name":"Togo"},"id":768},{"arcs":[[-1135,1148,1149,1150,1151,1152,1153]],"type":"Polygon","properties":{"name":"Cameroon"},"id":120},{"arcs":[[1154]],"type":"Polygon","properties":{"name":"Guernsey (U.K.)"},"id":831},{"arcs":[[-1059,1155]],"type":"Polygon","properties":{"name":"Gibraltar (U.K.)"},"id":292},{"arcs":[[[-1123,1156,1157,1158,1159,1160,-1128]],[[1161]]],"type":"MultiPolygon","properties":{"name":"Guinea"},"id":324},{"arcs":[[1162]],"type":"Polygon","properties":{"name":"Isle of Man (U.K.)"},"id":833},{"arcs":[[[-1081,1163,-1090,1164]],[[1165]]],"type":"MultiPolygon","properties":{"name":"Ireland"},"id":372},{"arcs":[[-1122,1166,1167,-1157]],"type":"Polygon","properties":{"name":"Liberia"},"id":430},{"arcs":[[-1036,1168,1169]],"type":"Polygon","properties":{"name":"Morocco"},"id":504},{"arcs":[[[-1034,-1130,1170,1171,1172]],[[1173]]],"type":"MultiPolygon","properties":{"name":"Mauritania"},"id":478},{"arcs":[[[-1061,1174]],[[1175]],[[1176]],[[1177]],[[1178]],[[1179]],[[1180]],[[1181]],[[1182]]],"type":"MultiPolygon","properties":{"name":"Portugal"},"id":620},{"arcs":[[[-1129,-1161,1183,1184,1185,1186,1187,1188,1189,1190,-1171]],[[1191,1192]]],"type":"MultiPolygon","properties":{"name":"Senegal"},"id":686},{"arcs":[[1193]],"type":"Polygon","properties":{"name":"Åland (Fin.)"},"id":248},{"arcs":[[[1194]],[[1195]],[[1196]],[[1197]],[[1198]],[[1199]],[[1200]],[[1201]],[[1202]]],"type":"MultiPolygon","properties":{"name":"Cabo Verde"},"id":132},{"arcs":[[[1203]],[[1204]],[[1205]],[[1206]],[[1207]]],"type":"MultiPolygon","properties":{"name":"Faroe Islands (Den.)"},"id":234},{"arcs":[[[-1152,1208,1209,1210]],[[1211]]],"type":"MultiPolygon","properties":{"name":"Gabon"},"id":266},{"arcs":[[[-1188,1212]],[[-1186,1213]],[[-1190,1214]]],"type":"MultiPolygon","properties":{"name":"The Gambia"},"id":270},{"arcs":[[[-1160,1215,-1184]],[[1216]],[[1217]],[[1218]],[[1219]],[[1220]],[[1221]],[[1222,-1192,1223]]],"type":"MultiPolygon","properties":{"name":"Guinea-Bissau"},"id":624},{"arcs":[[[-1153,-1211,1224]],[[1225]]],"type":"MultiPolygon","properties":{"name":"Equatorial Guinea"},"id":226},{"arcs":[[[-1158,-1168,1226]],[[1227]]],"type":"MultiPolygon","properties":{"name":"Sierra Leone"},"id":694},{"arcs":[[[1228]],[[1229]]],"type":"MultiPolygon","properties":{"name":"São Tomé and Príncipe"},"id":678},{"arcs":[[[1230]],[[1231]],[[1232]],[[1233]],[[1234]],[[1235]],[[1236]],[[1237]],[[1238]],[[1239]],[[1240]],[[1241]],[[1242]],[[1243]],[[1244]],[[1245]],[[1246]],[[1247]],[[1248]],[[1249]],[[1250]],[[1251]],[[1252]],[[1253]],[[1254]],[[1255]],[[1256]],[[1257]],[[1258]],[[1259]],[[1260]],[[1261]],[[1262]],[[1263]],[[1264]],[[1265]],[[1266]],[[1267]],[[1268]],[[1269]],[[1270]],[[1271]]],"type":"MultiPolygon","properties":{"name":"Australia"},"id":36},{"arcs":[[[-657,1272]],[[-655,1273]]],"type":"MultiPolygon","properties":{"name":"Brunei Darussalam"},"id":96},{"arcs":[[[1274]],[[1275]],[[1276]]],"type":"MultiPolygon","properties":{"name":"Federated States of Micronesia"},"id":583},{"arcs":[[1277]],"type":"Polygon","properties":{"name":"Kiribati"},"id":296},{"arcs":[[1278]],"type":"Polygon","properties":{"name":"Marshall Islands"},"id":584},{"arcs":[[1279]],"type":"Polygon","properties":{"name":"Naoero"},"id":520},{"arcs":[[[1280]],[[1281]],[[1282]],[[1283]],[[1284]],[[1285]],[[1286]],[[1287]],[[1288]],[[1289]],[[1290]],[[1291]],[[1292]],[[1293]],[[1294]],[[1295]],[[1296]],[[-408,1297]],[[1298]],[[1299]],[[1300]],[[1301]],[[1302]],[[1303]],[[1304]],[[1305]],[[1306]],[[1307]],[[1308]],[[1309]],[[1310]],[[1311]],[[1312]],[[1313]],[[1314]]],"type":"MultiPolygon","properties":{"name":"Papua New Guinea"},"id":598},{"arcs":[[[1315]],[[1316]],[[1317]],[[1318]],[[1319]],[[1320]],[[1321]],[[1322]],[[1323]],[[1324]],[[1325]],[[1326]],[[1327]],[[1328]],[[1329]],[[1330]],[[1331]],[[1332]],[[1333]],[[1334]],[[1335]],[[1336]],[[1337]],[[1338]],[[1339]],[[1340]]],"type":"MultiPolygon","properties":{"name":"Solomon Islands"},"id":90},{"arcs":[[[-486,1341]],[[1342]],[[-488,1343]]],"type":"MultiPolygon","properties":{"name":"Timor-Leste"},"id":626},{"arcs":[[1344]],"type":"Polygon","properties":{"name":"Tuvalu"},"id":798},{"arcs":[[1345]],"type":"Polygon","properties":{"name":"U.S. Minor Outlying Islands"},"id":581},{"arcs":[[[1346]],[[1347]],[[1348]],[[1349]],[[1350]],[[1351]],[[1352]],[[1353]]],"type":"MultiPolygon","properties":{"name":"Fiji"},"id":242},{"arcs":[[1354]],"type":"Polygon","properties":{"name":"Guam (U.S.)"},"id":316},{"arcs":[[-903,1355,1356,1357,1358]],"type":"Polygon","properties":{"name":"Lebanon"},"id":422},{"arcs":[[[1359]],[[1360]]],"type":"MultiPolygon","properties":{"name":"Northern Mariana Islands (U.S.)"},"id":580},{"arcs":[[[1361]],[[1362]],[[1363]],[[1364]],[[1365]]],"type":"MultiPolygon","properties":{"name":"New Caledonia (Fr.)"},"id":540},{"arcs":[[1366]],"type":"Polygon","properties":{"name":"Norfolk Island (Aus.)"},"id":574},{"arcs":[[[1367]],[[1368]],[[1369]],[[1370]],[[1371]],[[1372]],[[1373]],[[1374]],[[1375]],[[1376]]],"type":"MultiPolygon","properties":{"name":"New Zealand"},"id":554},{"arcs":[[1377]],"type":"Polygon","properties":{"name":"Palau"},"id":585},{"arcs":[[[1378]],[[1379]],[[1380]],[[1381]],[[1382]],[[1383]],[[1384]],[[1385]],[[1386]],[[1387]],[[1388]],[[1389]],[[1390]],[[1391]],[[1392]]],"type":"MultiPolygon","properties":{"name":"Vanuatu"},"id":548},{"arcs":[[[-1097,1393,-1095,1394,-1098,1395,1396,1397,1398,1399,1400]],[[-1093,1401,1402]]],"type":"MultiPolygon","properties":{"name":"Cyprus"},"id":196},{"arcs":[[[1403,1404,1405]],[[1406,1407,1408]]],"type":"MultiPolygon","properties":{"name":"Arab Republic of Egypt"},"id":818},{"arcs":[[-1358,1409,1410,1411,1412,1413,1414,1415,1416,-1409,1417,1418]],"type":"Polygon","properties":{"name":"Israel"},"id":376},{"arcs":[[-885,1419,1420,-1416,1421,-1412,1422,-901]],"type":"Polygon","properties":{"name":"Jordan"},"id":400},{"arcs":[[[1423,1424,1425,1426]],[[1427]],[[1428,1429]],[[1430]],[[1431]]],"type":"MultiPolygon","properties":{"name":"Oman"},"id":512},{"arcs":[[[-1413,-1422,-1415,1432]],[[-1408,1433,-1418]]],"type":"MultiPolygon","properties":{"name":"West Bank and Gaza"},"id":275},{"arcs":[[[-884,1434,1435,1436,1437,1438,1439,1440,-1425,1441,1442,-1420]],[[1443]],[[1444]]],"type":"MultiPolygon","properties":{"name":"Saudi Arabia"},"id":682},{"arcs":[[[-1426,-1441,1445,-1430,1446],[-1431]],[[1447]],[[1448]],[[1449]]],"type":"MultiPolygon","properties":{"name":"United Arab Emirates"},"id":784},{"arcs":[[[1450,1451,1452,1453]],[[1454]]],"type":"MultiPolygon","properties":{"name":"Eritrea"},"id":232},{"arcs":[[-1453,1455,1456,1457,1458,1459]],"type":"Polygon","properties":{"name":"Ethiopia"},"id":231},{"arcs":[[[-883,1460,-1435]],[[1461]]],"type":"MultiPolygon","properties":{"name":"Kuwait"},"id":414},{"arcs":[[-1406,1462,-1454,-1460,1463,1464,1465,1466,1467,1468]],"type":"Polygon","properties":{"name":"Sudan"},"id":729},{"arcs":[[-1457,1469,1470,1471]],"type":"Polygon","properties":{"name":"Federal Republic of Somalia"},"id":706},{"arcs":[[-1459,1472,1473,1474,1475,1476,1477,1478,-1466,1479,-1464]],"type":"Polygon","properties":{"name":"South Sudan"},"id":728},{"arcs":[[[1480]],[[-1424,1481,-1442]],[[1482]],[[1483]]],"type":"MultiPolygon","properties":{"name":"Republic of Yemen"},"id":887},{"arcs":[[[1484,1485,1486,1487]],[[1488,1489,1490]]],"type":"MultiPolygon","properties":{"name":"Angola"},"id":24},{"arcs":[[1491,1492,1493]],"type":"Polygon","properties":{"name":"Burundi"},"id":108},{"arcs":[[-1437,1494]],"type":"Polygon","properties":{"name":"Bahrain"},"id":48},{"arcs":[[-1150,1495,-1467,-1479,1496,1497]],"type":"Polygon","properties":{"name":"Central African Republic"},"id":140},{"arcs":[[[-1478,1498,1499,-1492,1500,1501,-1488,1502,-1489,1503,-1497]],[[1504]]],"type":"MultiPolygon","properties":{"name":"Democratic Republic of Congo"},"id":180},{"arcs":[[-1151,-1498,-1504,-1491,1505,-1209]],"type":"Polygon","properties":{"name":"Congo"},"id":178},{"arcs":[[1506,-1470,-1456,-1452,1507]],"type":"Polygon","properties":{"name":"Djibouti"},"id":262},{"arcs":[[[-1458,-1472,1508,1509,1510,-1476,1511,1512,-1473]],[[1513]]],"type":"MultiPolygon","properties":{"name":"Kenya"},"id":404},{"arcs":[[-1031,-1053,1514,-1404,-1469,1515,-1131]],"type":"Polygon","properties":{"name":"Libya"},"id":434},{"arcs":[[-1439,1516]],"type":"Polygon","properties":{"name":"Qatar"},"id":634},{"arcs":[[-1493,-1500,1517,1518]],"type":"Polygon","properties":{"name":"Rwanda"},"id":646},{"arcs":[[1519]],"type":"Polygon","properties":{"name":"Seychelles"},"id":690},{"arcs":[[-1132,-1516,-1468,-1496,-1149,-1134]],"type":"Polygon","properties":{"name":"Chad"},"id":148},{"arcs":[[[-1494,-1519,1520,-1510,1521,1522,1523,1524,1525,1526,-1501]],[[1527]],[[1528]],[[1529]],[[1530]]],"type":"MultiPolygon","properties":{"name":"Tanzania"},"id":834},{"arcs":[[-1477,-1511,-1521,-1518,-1499]],"type":"Polygon","properties":{"name":"Uganda"},"id":800},{"arcs":[[[1531]],[[1532]],[[1533]],[[1534]],[[1535]],[[1536]]],"type":"MultiPolygon","properties":{"name":"French Southern and Antarctic Lands (Fr.)"},"id":260},{"arcs":[[1537,1538,1539]],"type":"Polygon","properties":{"name":"Botswana"},"id":72},{"arcs":[[1540]],"type":"Polygon","properties":{"name":"Heard Island and McDonald Islands (Aus.)"},"id":334},{"arcs":[[[1541]],[[1542]],[[1543]],[[1544]],[[1545]]],"type":"MultiPolygon","properties":{"name":"Madagascar"},"id":450},{"arcs":[[[-1525,1546,1547,1548,1549,1550,1551,1552],[1555],[1556]],[[-1523,1553]],[[1554]]],"type":"MultiPolygon","properties":{"name":"Mozambique"},"id":508},{"arcs":[[[1557]],[[1558]]],"type":"MultiPolygon","properties":{"name":"Mauritius"},"id":480},{"arcs":[[[-1526,-1553,1559]],[[-1556]],[[-1557]]],"type":"MultiPolygon","properties":{"name":"Malawi"},"id":454},{"arcs":[[-1486,1560,-1540,1561,1562]],"type":"Polygon","properties":{"name":"Namibia"},"id":516},{"arcs":[[1563]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[-1549,1564]],"type":"Polygon","properties":{"name":"Eswatini"},"id":748},{"arcs":[[[1565]],[[-1539,1566,-1550,-1565,-1548,1567,-1562],[1568]]],"type":"MultiPolygon","properties":{"name":"South Africa"},"id":710},{"arcs":[[-1485,-1502,-1527,-1560,-1552,1569,-1561]],"type":"Polygon","properties":{"name":"Zambia"},"id":894},{"arcs":[[-1538,-1570,-1551,-1567]],"type":"Polygon","properties":{"name":"Zimbabwe"},"id":716},{"arcs":[[[1570]],[[1571]],[[1572]]],"type":"MultiPolygon","properties":{"name":"Comoros"},"id":174},{"arcs":[[-1569]],"type":"Polygon","properties":{"name":"Lesotho"},"id":426},{"arcs":[[1573]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[[1574]],[[1575]],[[1576]]],"type":"MultiPolygon","properties":{"name":"Saint Helena, Ascension and Tristan da Cunha (U.K.)"},"id":654},{"arcs":[[1577]],"type":"Polygon","properties":{"name":"Bouvet Island (Nor.)"},"id":74},{"arcs":[[[1578]],[[1579]],[[1580]],[[1581]],[[1582]],[[1583]],[[1584]],[[1585]],[[1586]],[[1587]],[[1588]],[[1589]]],"type":"MultiPolygon","properties":{"name":"Svalbard and Jan Mayen (Nor.)"},"id":744},{"arcs":[[[1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600]],[[1601]],[[1602]],[[1603]],[[1604]],[[1605]],[[1606]],[[1607]],[[1608]],[[1609]],[[1610]],[[1611]],[[1612]],[[1613]],[[1614]],[[1615]],[[1616]],[[1617]],[[1618]],[[1619]],[[1620]],[[1621]],[[1622]],[[1623]],[[1624]],[[1625]],[[1626]],[[1627]],[[1628]],[[1629]],[[1630]],[[1631]],[[1632]],[[1633]],[[1634]],[[1635]],[[1636]],[[1637]],[[1638]],[[1639]],[[1640]],[[1641]],[[1642]],[[1643]],[[1644]],[[1645]],[[1646]],[[1647]],[[1648]],[[1649]],[[1650]]],"type":"MultiPolygon","properties":{"name":"Brazil"},"id":76},{"arcs":[[1651]],"type":"Polygon","properties":{"name":"Barbados"},"id":52},{"arcs":[[-1595,1652,1653]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[[-1593,1654,1655,1656]],[[1657,1658]]],"type":"MultiPolygon","properties":{"name":"Guyana"},"id":328},{"arcs":[[1659]],"type":"Polygon","properties":{"name":"Iceland"},"id":352},{"arcs":[[1660]],"type":"Polygon","properties":{"name":"Saint Lucia"},"id":662},{"arcs":[[1661]],"type":"Polygon","properties":{"name":"France"},"id":250},{"arcs":[[[-1594,-1657,1662,-1653]],[[1663]]],"type":"MultiPolygon","properties":{"name":"Suriname"},"id":740},{"arcs":[[1664]],"type":"Polygon","properties":{"name":"Saint Vincent and the Grenadines"},"id":670},{"arcs":[[[1665]],[[1666]],[[1667]],[[1668]],[[1669,1670,1671,1672]],[[1673]],[[1674]],[[1675]],[[1676]],[[1677]],[[1678]],[[1679]],[[1680]],[[1681]],[[1682]],[[1683]],[[1684]],[[1685]],[[1686]],[[1687]],[[1688]],[[1689]],[[1690]],[[1691]],[[1692]],[[1693]],[[1694]],[[1695]],[[1696]],[[1697]],[[1698]],[[1699]],[[1700]],[[1701]],[[1702]],[[1703]],[[1704]],[[1705]],[[1706]],[[1707]],[[1708]],[[1709]],[[1710]],[[1711]],[[1712]],[[1713]],[[1714]],[[1715]],[[1716]],[[1717]],[[1718]],[[1719]],[[1720]],[[1721]],[[1722]],[[1723]],[[1724]],[[1725]],[[1726]],[[1727]],[[1728]],[[1729]],[[1730]],[[1731]],[[1732]],[[1733]],[[1734]],[[1735]],[[1736]],[[1737]],[[1738]],[[1739]],[[1740]],[[1741]],[[1742]],[[1743]],[[1744]],[[1745]],[[1746]],[[1747]],[[1748]],[[1749]],[[1750]],[[1751]],[[1752]],[[1753]],[[1754]],[[1755]],[[1756]],[[1757]],[[1758]],[[1759]],[[1760]],[[1761]],[[1762]],[[1763]],[[1764]],[[1765]],[[1766]],[[1767]],[[1768]],[[1769]],[[1770]],[[1771]],[[1772]],[[1773]],[[1774]],[[1775]],[[1776]],[[1777]],[[1778]],[[1779]],[[1780]],[[1781]],[[1782]],[[1783]],[[1784]],[[1785]],[[1786]],[[1787]],[[1788]],[[1789]],[[1790]],[[1791]],[[1792]],[[1793]],[[1794]],[[1795]],[[1796]],[[1797]],[[1798]],[[1799]],[[1800]],[[1801]],[[1802]],[[1803]],[[1804]],[[1805]],[[1806]],[[1807]],[[1808]],[[1809]],[[1810]],[[1811]],[[1812]],[[1813]],[[1814]],[[1815]],[[1816]],[[1817]],[[1818]],[[1819]],[[1820]],[[1821]],[[1822]],[[1823]],[[1824]],[[1825]],[[1826]],[[1827]],[[1828]],[[1829]],[[1830]],[[1831]],[[1832]],[[1833]],[[1834]],[[1835]],[[1836]],[[1837]],[[1838]],[[1839]],[[1840]],[[1841]],[[1842]],[[1843]],[[1844]],[[1845]],[[1846]],[[1847]],[[1848]],[[1849]],[[1850]],[[1851]],[[1852]],[[1853]],[[1854]],[[1855]],[[1856]],[[1857]],[[1858]],[[1859]],[[1860]],[[1861]],[[1862]],[[1863]],[[1864]],[[1865]],[[1866]],[[1867]],[[1868]],[[1869]]],"type":"MultiPolygon","properties":{"name":"Canada"},"id":124},{"arcs":[[1870]],"type":"Polygon","properties":{"name":"Saint-Pierre-et-Miquelon (Fr.)"},"id":666},{"arcs":[[[1871]],[[1872]]],"type":"MultiPolygon","properties":{"name":"Trinidad and Tobago"},"id":780},{"arcs":[[[-1592,1873,1874,-1655]],[[-1658,1875]],[[1876]],[[1877]],[[1878]],[[1879]],[[1880]],[[1881]],[[1882]],[[1883]],[[1884]],[[1885]],[[1886]],[[1887]],[[1888]],[[1889]],[[1890]],[[1891]],[[1892]],[[1893]],[[1894]]],"type":"MultiPolygon","properties":{"name":"Republica Bolivariana de Venezuela"},"id":862},{"arcs":[[[1895]],[[1896]],[[1897]],[[1898]],[[1899]],[[-1670,1900,1901,1902]],[[1903]],[[1904]],[[1905]],[[1906]],[[1907]],[[1908]],[[1909]],[[1910]],[[1911]],[[1912]],[[1913]],[[1914]],[[1915]],[[1916]],[[1917]],[[1918]],[[1919]],[[1920]],[[1921]],[[1922]],[[1923]],[[1924]],[[1925]],[[1926]],[[1927]],[[1928]],[[1929]],[[1930]],[[1931]],[[1932]],[[-1672,1933]],[[1934]],[[1935]],[[1936]],[[1937]],[[1938]],[[1939]],[[1940]],[[1941]],[[1942]],[[1943]],[[1944]],[[1945]],[[1946]],[[1947]],[[1948]],[[1949]],[[1950]],[[1951]],[[1952]],[[1953]],[[1954]],[[1955]],[[1956]],[[1957]],[[1958]],[[1959]],[[1960]],[[1961]],[[1962]],[[1963]],[[1964]],[[1965]],[[1966]],[[1967]],[[1968]],[[1969]],[[1970]],[[1971]],[[1972]],[[1973]],[[1974]],[[1975]],[[1976]],[[1977]],[[1978]],[[1979]],[[1980]],[[1981]],[[1982]],[[1983]],[[1984]],[[1985]],[[1986]],[[1987]],[[1988]],[[1989]],[[1990]],[[1991]],[[1992]],[[1993]],[[1994]],[[1995]],[[1996]],[[1997]],[[1998]],[[1999]],[[2000]],[[2001]],[[2002]],[[2003]],[[2004]],[[2005]],[[2006]],[[2007]],[[2008]],[[2009]],[[2010]],[[2011]],[[2012]],[[2013]],[[2014]],[[2015]],[[2016]],[[2017]],[[2018]],[[2019]]],"type":"MultiPolygon","properties":{"name":"United States of America"},"id":840},{"arcs":[[[-1598,2020,2021,2022,2023,2024]],[[2025]],[[2026]],[[2027]],[[2028]],[[2029]],[[2030]],[[2031]],[[2032]],[[2033]],[[2034,2035]]],"type":"MultiPolygon","properties":{"name":"Argentina"},"id":32},{"arcs":[[-1600,2036,-2024,2037,2038]],"type":"Polygon","properties":{"name":"Bolivia"},"id":68},{"arcs":[[-1599,-2025,-2037]],"type":"Polygon","properties":{"name":"Paraguay"},"id":600},{"arcs":[[[2039,2040]],[[2041]]],"type":"MultiPolygon","properties":{"name":"Dominican Republic"},"id":214},{"arcs":[[[-2040,2042]],[[2043]],[[2044]]],"type":"MultiPolygon","properties":{"name":"Haiti"},"id":332},{"arcs":[[-1597,2045,-2021]],"type":"Polygon","properties":{"name":"Uruguay"},"id":858},{"arcs":[[[2046]],[[2047]],[[2048]],[[2049]],[[2050]],[[2051]],[[2052]],[[2053]],[[2054]],[[2055]],[[2056]],[[2057]],[[2058]],[[2059]],[[2060]],[[2061]],[[2062]],[[2063]]],"type":"MultiPolygon","properties":{"name":"The Bahamas"},"id":44},{"arcs":[[2064]],"type":"Polygon","properties":{"name":"Bermuda (U.K.)"},"id":60},{"arcs":[[[2065]],[[2066]],[[2067]],[[2068]],[[2069]]],"type":"MultiPolygon","properties":{"name":"Cuba"},"id":192},{"arcs":[[[2070]],[[-1902,2071,2072,2073,2074]],[[2075]],[[2076]],[[2077]],[[2078]],[[2079]],[[2080]],[[2081]],[[2082]],[[2083]],[[2084]],[[2085]],[[2086]],[[2087]],[[2088]],[[2089]],[[2090]],[[2091]]],"type":"MultiPolygon","properties":{"name":"Mexico"},"id":484},{"arcs":[[[2092]],[[2093]],[[2094]]],"type":"MultiPolygon","properties":{"name":"Turks and Caicos Islands (U.K.)"},"id":796},{"arcs":[[2095]],"type":"Polygon","properties":{"name":"Aruba (Neth.)"},"id":533},{"arcs":[[2096]],"type":"Polygon","properties":{"name":"Anguilla (U.K.)"},"id":660},{"arcs":[[[2097]],[[2098]]],"type":"MultiPolygon","properties":{"name":"Antigua and Barbuda"},"id":28},{"arcs":[[2099]],"type":"Polygon","properties":{"name":"Bonaire (Neth.)"},"id":535},{"arcs":[[2100]],"type":"Polygon","properties":{"name":"Saint-Barthélemy (Fr.)"},"id":652},{"arcs":[[-2073,2101,2102]],"type":"Polygon","properties":{"name":"Belize"},"id":84},{"arcs":[[[-1591,2103,2104,2105,2106,2107,-1874]],[[2108]],[[2109]],[[2110]],[[2111]]],"type":"MultiPolygon","properties":{"name":"Colombia"},"id":170},{"arcs":[[2112]],"type":"Polygon","properties":{"name":"Curaçao (Neth.)"},"id":531},{"arcs":[[2113]],"type":"Polygon","properties":{"name":"Dominica"},"id":212},{"arcs":[[[2114]],[[2115]],[[2116]]],"type":"MultiPolygon","properties":{"name":"France"},"id":250},{"arcs":[[2117]],"type":"Polygon","properties":{"name":"Grenada"},"id":308},{"arcs":[[[2118,2119]],[[-2074,-2103,2120,2121,2122,2123]]],"type":"MultiPolygon","properties":{"name":"Guatemala"},"id":320},{"arcs":[[-2120,2124,2125,2126,2127,-2122,2128]],"type":"Polygon","properties":{"name":"Honduras"},"id":340},{"arcs":[[2129]],"type":"Polygon","properties":{"name":"Jamaica"},"id":388},{"arcs":[[[2130]],[[2131]]],"type":"MultiPolygon","properties":{"name":"Saint Kitts and Nevis"},"id":659},{"arcs":[[2132,2133]],"type":"Polygon","properties":{"name":"Saint-Martin (Fr.)"},"id":663},{"arcs":[[2134]],"type":"Polygon","properties":{"name":"Montserrat (U.K.)"},"id":500},{"arcs":[[-2126,2135,2136,2137]],"type":"Polygon","properties":{"name":"Nicaragua"},"id":558},{"arcs":[[[2138]],[[2139]]],"type":"MultiPolygon","properties":{"name":"Puerto Rico (U.S.)"},"id":630},{"arcs":[[-2123,-2128,2140]],"type":"Polygon","properties":{"name":"El Salvador"},"id":222},{"arcs":[[-2134,2141]],"type":"Polygon","properties":{"name":"Sint Maarten (Neth.)"},"id":534},{"arcs":[[2142]],"type":"Polygon","properties":{"name":"British Virgin Islands (U.K.)"},"id":92},{"arcs":[[2143]],"type":"Polygon","properties":{"name":"United States Virgin Islands (U.S.)"},"id":850},{"arcs":[[-2137,2144,2145,2146]],"type":"Polygon","properties":{"name":"Costa Rica"},"id":188},{"arcs":[[2147]],"type":"Polygon","properties":{"name":"Cayman Islands (U.K.)"},"id":136},{"arcs":[[[-2105,2148,2149]],[[2150]],[[2151]],[[2152]],[[2153]],[[2154]],[[2155]],[[2156]],[[2157]]],"type":"MultiPolygon","properties":{"name":"Ecuador"},"id":218},{"arcs":[[[-2107,2158,-2146,2159]],[[2160]],[[2161]]],"type":"MultiPolygon","properties":{"name":"Panama"},"id":591},{"arcs":[[-1601,-2039,2162,2163,-2149,-2104]],"type":"Polygon","properties":{"name":"Peru"},"id":604},{"arcs":[[2164]],"type":"Polygon","properties":{"name":"American Samoa (U.S.)"},"id":16},{"arcs":[[[2165]],[[2166]],[[2167]],[[-2023,2168,-2163,-2038]],[[2169]],[[2170]],[[2171]],[[-2036,2172]],[[2173]],[[2174]],[[2175]],[[2176]],[[2177]],[[2178]],[[2179]],[[2180]],[[2181]],[[2182]],[[2183]],[[2184]],[[2185]],[[2186]],[[2187]],[[2188]],[[2189]],[[2190]],[[2191]],[[2192]],[[2193]],[[2194]],[[2195]],[[2196]],[[2197]],[[2198]],[[2199]],[[2200]],[[2201]],[[2202]],[[2203]],[[2204]],[[2205]],[[2206]],[[2207]],[[2208]],[[2209]],[[2210]],[[2211]],[[2212]],[[2213]],[[2214]],[[2215]],[[2216]],[[2217]],[[2218]],[[2219]],[[2220]],[[2221]],[[2222]],[[2223]],[[2224]],[[2225]],[[2226]],[[2227]],[[2228]],[[2229]],[[2230]],[[2231]],[[2232]],[[2233]],[[2234]],[[2235]],[[2236]],[[2237]],[[2238]],[[2239]],[[2240]],[[2241]],[[2242]],[[2243]],[[2244]],[[2245]],[[2246]],[[2247]],[[2248]],[[2249]],[[2250]],[[2251]],[[2252]],[[2253]],[[2254]],[[2255]],[[2256]],[[2257]],[[2258]],[[2259]],[[2260]],[[2261]],[[2262]],[[2263]],[[2264]],[[2265]],[[2266]],[[2267]],[[2268]],[[2269]],[[2270]],[[2271]],[[2272]],[[2273]],[[2274]],[[2275]],[[2276]],[[2277]],[[2278]],[[2279]],[[2280]],[[2281]],[[2282]],[[2283]],[[2284]],[[2285]],[[2286]],[[2287]],[[2288]],[[2289]],[[2290]]],"type":"MultiPolygon","properties":{"name":"Chile"},"id":152},{"arcs":[[2291]],"type":"Polygon","properties":{"name":"Cook Islands (N.Z.)"},"id":184},{"arcs":[[2292]],"type":"Polygon","properties":{"name":"Clipperton Island (Fr.)"},"id":"CPT"},{"arcs":[[[2293]],[[2294]],[[2295]],[[2296]],[[2297]],[[2298]],[[2299]],[[2300]],[[2301]],[[2302]],[[2303]],[[2304]],[[2305]],[[2306]],[[2307]],[[2308]],[[2309]],[[2310]],[[2311]],[[2312]],[[2313]],[[2314]],[[2315]],[[2316]],[[2317]],[[2318]],[[2319]],[[2320]],[[2321]],[[2322]],[[2323]],[[2324]],[[2325]],[[2326]],[[2327]],[[2328]],[[2329]],[[2330]],[[2331]],[[2332]],[[2333]],[[2334]],[[2335]],[[2336]],[[2337]],[[2338]],[[2339]],[[2340]],[[2341]],[[2342]],[[2343]],[[2344]],[[2345]],[[2346]],[[2347]],[[2348]],[[2349]],[[2350]],[[2351]],[[2352]],[[2353]],[[2354]],[[2355]],[[2356]],[[2357]],[[2358]],[[2359]],[[2360]],[[2361]],[[2362]],[[2363]],[[2364]],[[2365]],[[2366]],[[2367]],[[2368]],[[2369]],[[2370]],[[2371]],[[2372]],[[2373]],[[2374]]],"type":"MultiPolygon","properties":{"name":"Greenland (Den.)"},"id":304},{"arcs":[[2375]],"type":"Polygon","properties":{"name":"Niue (N.Z.)"},"id":570},{"arcs":[[2376]],"type":"Polygon","properties":{"name":"Pitcairn Islands (U.K.)"},"id":612},{"arcs":[[[2377]],[[2378]],[[2379]],[[2380]],[[2381]],[[2382]],[[2383]],[[2384]],[[2385]]],"type":"MultiPolygon","properties":{"name":"French Polynesia (Fr.)"},"id":258},{"arcs":[[2386]],"type":"Polygon","properties":{"name":"Tokelau (N.Z.)"},"id":772},{"arcs":[[[2387]],[[2388]]],"type":"MultiPolygon","properties":{"name":"Tonga"},"id":776},{"arcs":[[2389]],"type":"Polygon","properties":{"name":"Wallis and Futuna (Fr.)"},"id":876},{"arcs":[[[2390]],[[2391]]],"type":"MultiPolygon","properties":{"name":"Samoa"},"id":882},{"arcs":[[-25,2392]],"type":"Polygon","properties":{"name":"Aksai Chin","ndlsa":true},"id":"NDLSA-Aksai-Chin"},{"arcs":[[-21,2393]],"type":"Polygon","properties":{"name":"Chumar East","ndlsa":true},"id":"NDLSA-Chumar-East"},{"arcs":[[-19,2394]],"type":"Polygon","properties":{"name":"Chumar West","ndlsa":true},"id":"NDLSA-Chumar-West"},{"arcs":[[-23,2395]],"type":"Polygon","properties":{"name":"Demchok","ndlsa":true},"id":"NDLSA-Demchok"},{"arcs":[[-12,-614]],"type":"Polygon","properties":{"name":"Jadh Ganga Valley","ndlsa":true},"id":"NDLSA-Jadh-Ganga-Valley"},{"arcs":[[-27,2396,2397]],"type":"Polygon","properties":{"name":"Karakoram Range","ndlsa":true},"id":"NDLSA-Karakoram-Range"},{"arcs":[[-16,-612]],"type":"Polygon","properties":{"name":"Kauirik","ndlsa":true},"id":"NDLSA-Kauirik"},{"arcs":[[-10,-615]],"type":"Polygon","properties":{"name":"Lapthal","ndlsa":true},"id":"NDLSA-Lapthal"},{"arcs":[[-14,-613]],"type":"Polygon","properties":{"name":"Shipki Pass","ndlsa":true},"id":"NDLSA-Shipki-Pass"},{"arcs":[[-18,-611,-679,2398,-2397,-26,-2393,-24,-2396,-22,-2394,-20,-2395]],"type":"Polygon","properties":{"name":"Jammu and Kashmir","ndlsa":true},"id":"NDLSA-Jammu-and-Kashmir-IND"},{"arcs":[[-3,-349,-605,-402]],"type":"Polygon","properties":{"name":"Arunachal Pradesh","ndlsa":true},"id":"NDLSA-Arunachal-Pradesh"},{"arcs":[[-5,-404,-604]],"type":"Polygon","properties":{"name":"Doklam","ndlsa":true},"id":"NDLSA-Doklam"},{"arcs":[[-8,-677,-616]],"type":"Polygon","properties":{"name":"Kalapani","ndlsa":true},"id":"NDLSA-Kalapani"},{"arcs":[[-28,-2398,-2399,-678,-396]],"type":"Polygon","properties":{"name":"Jammu and Kashmir","ndlsa":true},"id":"NDLSA-Jammu-and-Kashmir-PAK"},{"arcs":[[-1035,-1173,2399,-1169]],"type":"Polygon","properties":{"name":"Western Sahara","ndlsa":true},"id":732},{"arcs":[[-902,-1423,-1411,2400,-1356]],"type":"Polygon","properties":{"name":"Golan Heights","ndlsa":true},"id":"NDLSA-Golan-Heights"},{"arcs":[[-1414,-1433]],"type":"Polygon","properties":{"name":"No Man's Land","ndlsa":true},"id":"NDLSA-No-Man-s-Land"},{"arcs":[[-1357,-2401,-1410]],"type":"Polygon","properties":{"name":"Shebaa Farms Dispute","ndlsa":true},"id":"NDLSA-Shebaa-Farms-Dispute"},{"arcs":[[[-1092,-1401,2401,-1402]],[[-1397,2402]],[[-1096,-1394]],[[-1399,2403]]],"type":"MultiPolygon","properties":{"name":"UN Buffer Zone","ndlsa":true},"id":"NDLSA-UN-Buffer-Zone"},{"arcs":[[-1465,-1480]],"type":"Polygon","properties":{"name":"Abyei","ndlsa":true},"id":"NDLSA-Abyei"},{"arcs":[[[-1474,-1513]],[[-1475,-1512]]],"type":"MultiPolygon","properties":{"name":"Ilemi Triangle","ndlsa":true},"id":"NDLSA-Ilemi-Triangle"},{"arcs":[[2404]],"type":"Polygon","properties":{"name":"British Indian Ocean Territory","ndlsa":true},"id":86},{"arcs":[[2405]],"type":"Polygon","properties":{"name":"South Georgia and South Sandwich Islands","ndlsa":true},"id":239},{"arcs":[[[2406]],[[2407]],[[2408]],[[2409]],[[2410]]],"type":"MultiPolygon","properties":{"name":"Falkland Islands","ndlsa":true},"id":238}]},"land":{"type":"GeometryCollection","geometries":[{"arcs":[[[35,82,645,84,37,404,39,652,41,304,333,327,334,329,335,324,336,386,670,839,672,388,343,735,345,733,606,734,608,679,771,881,1460,1435,1494,1437,1516,1439,1445,1428,1446,1426,1481,1442,1420,1416,1406,1433,1418,1358,903,858,939,905,998,910,999,972,911,967,1050,988,1038,1100,1040,1057,1155,1059,1174,1061,1044,1010,1106,1012,1105,1014,1101,1024,925,1025,895,299,886,889,876,95,928,841,789,929,784,98],[87,763,775,847,637],[90,864,890,897,874,861,855]],[[43]],[[44]],[[45]],[[46]],[[47]],[[48]],[[49]],[[50]],[[51]],[[52]],[[53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60]],[[61]],[[62]],[[63]],[[64]],[[65]],[[66]],[[67]],[[68]],[[69]],[[70]],[[71]],[[72]],[[73]],[[74]],[[75]],[[76]],[[77]],[[78]],[[79]],[[80]],[[81]],[[85]],[[100]],[[101]],[[102]],[[103]],[[104]],[[105]],[[106]],[[107]],[[108]],[[109]],[[110]],[[111]],[[112]],[[113]],[[114]],[[115]],[[116]],[[117]],[[118]],[[119]],[[120]],[[121]],[[122]],[[123]],[[124]],[[125]],[[126]],[[127]],[[128]],[[129]],[[130]],[[131]],[[132]],[[133]],[[134]],[[135]],[[136]],[[137]],[[138]],[[139]],[[140]],[[141]],[[142]],[[143]],[[144]],[[145]],[[146]],[[147]],[[148]],[[149]],[[150]],[[151]],[[152]],[[153]],[[154]],[[155]],[[156]],[[157]],[[158]],[[159]],[[160]],[[161]],[[162]],[[163]],[[164]],[[165]],[[166]],[[167]],[[168]],[[169]],[[170]],[[171]],[[172]],[[173]],[[174]],[[175]],[[176]],[[177]],[[178]],[[179]],[[180]],[[181]],[[182]],[[183]],[[184]],[[185]],[[186]],[[187]],[[188]],[[189]],[[190]],[[191]],[[192]],[[193]],[[194]],[[195]],[[196]],[[197]],[[198]],[[199]],[[200]],[[201]],[[202]],[[203]],[[204]],[[205]],[[206]],[[207]],[[208]],[[209]],[[210]],[[211]],[[212]],[[213]],[[214]],[[215]],[[216]],[[217]],[[218]],[[219]],[[220]],[[221]],[[222]],[[223]],[[224]],[[225]],[[226]],[[227]],[[228]],[[229]],[[230]],[[231]],[[232]],[[233]],[[234]],[[235]],[[236]],[[237]],[[238]],[[239]],[[240]],[[241]],[[242]],[[243]],[[244]],[[245]],[[246]],[[247]],[[248]],[[249]],[[250]],[[251]],[[252]],[[253]],[[254]],[[255]],[[256]],[[257]],[[258]],[[259]],[[260]],[[261]],[[262]],[[263]],[[264]],[[265]],[[266]],[[267]],[[268]],[[269]],[[270]],[[271]],[[272]],[[273]],[[274]],[[275]],[[276]],[[277]],[[278]],[[279]],[[280]],[[281]],[[282]],[[283]],[[284]],[[285]],[[286]],[[287]],[[288]],[[289]],[[290]],[[291]],[[292]],[[293]],[[294]],[[295]],[[296]],[[300]],[[301]],[[302]],[[303]],[[307]],[[308]],[[309]],[[310]],[[311]],[[312]],[[313]],[[314]],[[315]],[[316]],[[317]],[[318]],[[319]],[[320]],[[321]],[[322]],[[325]],[[326]],[[331]],[[332]],[[339]],[[349]],[[350]],[[351]],[[352]],[[353]],[[354]],[[355]],[[356]],[[357]],[[358]],[[359]],[[360]],[[361]],[[362]],[[363]],[[364]],[[365]],[[366]],[[367]],[[368]],[[369]],[[370]],[[371]],[[372]],[[373]],[[374]],[[375]],[[376]],[[377]],[[378]],[[379]],[[380]],[[381]],[[382]],[[383]],[[384]],[[385]],[[389]],[[390]],[[391]],[[392]],[[393]],[[394]],[[405]],[[406]],[[408,1297]],[[409]],[[410]],[[411]],[[412]],[[413]],[[414]],[[415]],[[416]],[[417]],[[418]],[[419]],[[420]],[[421]],[[422]],[[423]],[[424]],[[425]],[[426]],[[427]],[[428]],[[429]],[[430]],[[431]],[[432]],[[433]],[[434]],[[435]],[[436]],[[437]],[[438]],[[439]],[[440]],[[441]],[[442]],[[443]],[[444]],[[445]],[[446]],[[447]],[[448]],[[449]],[[450]],[[451]],[[452]],[[453]],[[454]],[[455]],[[456]],[[457]],[[458]],[[459]],[[460]],[[461]],[[462]],[[463]],[[464]],[[465]],[[466]],[[467]],[[468]],[[469]],[[470]],[[471]],[[472]],[[473]],[[474]],[[475]],[[476]],[[477]],[[478]],[[479]],[[480]],[[481]],[[482]],[[483]],[[484]],[[486,1343,488,1341]],[[489]],[[490]],[[491]],[[492]],[[493]],[[494]],[[495]],[[496]],[[497]],[[498]],[[499]],[[500]],[[501]],[[502]],[[503]],[[504]],[[505]],[[506]],[[507]],[[508]],[[509]],[[510]],[[511]],[[512]],[[513]],[[514]],[[515]],[[516]],[[517]],[[518]],[[519]],[[520]],[[521]],[[522]],[[523,653,1273,655,1272,657]],[[526,659]],[[527]],[[528]],[[529]],[[530]],[[531]],[[532]],[[533]],[[534]],[[535]],[[536]],[[537]],[[538]],[[539]],[[540]],[[541]],[[542]],[[543]],[[544]],[[545]],[[546]],[[547]],[[548]],[[549]],[[550]],[[551]],[[552]],[[553]],[[554]],[[555]],[[556]],[[557]],[[558]],[[559]],[[560]],[[561]],[[562]],[[563]],[[564]],[[565]],[[566]],[[567]],[[568]],[[569]],[[570]],[[571]],[[572]],[[573]],[[574]],[[575]],[[576]],[[577]],[[578]],[[579]],[[580]],[[581]],[[582]],[[583]],[[584]],[[585]],[[586]],[[587]],[[588]],[[589]],[[590]],[[591]],[[592]],[[593]],[[594]],[[595]],[[596]],[[597]],[[598]],[[599]],[[600]],[[601]],[[602]],[[617]],[[618]],[[619]],[[620]],[[621]],[[622]],[[623]],[[624]],[[625]],[[626]],[[627]],[[628]],[[629]],[[630]],[[631]],[[632]],[[633]],[[638]],[[639]],[[644]],[[646]],[[647]],[[648]],[[649]],[[650]],[[651]],[[658]],[[660]],[[661]],[[662]],[[663]],[[664]],[[665]],[[666]],[[667]],[[668]],[[669]],[[673]],[[674]],[[675]],[[681]],[[682]],[[683]],[[684]],[[685]],[[686]],[[687]],[[688]],[[689]],[[690]],[[691]],[[692]],[[693]],[[694]],[[695]],[[696]],[[697]],[[698]],[[699]],[[700]],[[701]],[[702]],[[703]],[[704]],[[705]],[[706]],[[707]],[[708]],[[709]],[[710]],[[711]],[[712]],[[713]],[[714]],[[715]],[[716]],[[717]],[[718]],[[719]],[[720]],[[721]],[[722]],[[723]],[[724]],[[725]],[[726]],[[727]],[[728]],[[729]],[[730]],[[736]],[[737]],[[738]],[[739]],[[740]],[[741]],[[742]],[[743]],[[744]],[[745]],[[746]],[[747]],[[748]],[[749]],[[750]],[[751]],[[752]],[[753]],[[754]],[[755]],[[756]],[[757]],[[758]],[[759]],[[760]],[[761]],[[762]],[[770]],[[777]],[[778]],[[779]],[[780]],[[781]],[[782]],[[785]],[[786]],[[790]],[[791]],[[792]],[[793]],[[794]],[[795]],[[796]],[[797]],[[798]],[[799]],[[800]],[[801]],[[802]],[[803]],[[804]],[[805]],[[806]],[[807]],[[808]],[[809]],[[810]],[[811]],[[812]],[[813]],[[814]],[[815]],[[816]],[[817]],[[818]],[[819]],[[820]],[[821]],[[822]],[[823]],[[824]],[[825]],[[826]],[[827]],[[828]],[[829]],[[830]],[[831]],[[832]],[[833]],[[834]],[[835]],[[836]],[[837]],[[838]],[[842]],[[843]],[[844]],[[845]],[[846]],[[862]],[[863]],[[877]],[[878]],[[879]],[[880]],[[896]],[[919]],[[920]],[[921]],[[922]],[[923]],[[926]],[[927]],[[930]],[[931]],[[932]],[[933]],[[934]],[[935]],[[936]],[[937]],[[938]],[[941]],[[942]],[[943]],[[944]],[[945]],[[946]],[[947]],[[948]],[[949]],[[950]],[[951]],[[952]],[[953]],[[954]],[[955]],[[956]],[[957]],[[958]],[[959]],[[960]],[[961]],[[962]],[[963]],[[964]],[[965]],[[966]],[[973]],[[974]],[[975]],[[976]],[[977]],[[978]],[[979]],[[989]],[[990]],[[991]],[[992]],[[993]],[[1026]],[[1027]],[[1028]],[[1036,1051,1514,1404,1462,1450,1507,1506,1470,1508,1521,1553,1523,1546,1567,1562,1486,1502,1489,1505,1209,1224,1153,1135,1109,1146,1111,1147,1125,1120,1166,1226,1158,1215,1184,1213,1186,1212,1188,1214,1190,1171,2399,1169]],[[1037]],[[1046]],[[1047]],[[1048]],[[1049]],[[1053]],[[1055]],[[1056]],[[1062]],[[1063]],[[1064]],[[1065]],[[1066]],[[1067]],[[1068]],[[1069]],[[1070]],[[1071]],[[1072]],[[1073]],[[1074]],[[1075]],[[1076]],[[1077]],[[1078]],[[1079]],[[1081,1163,1090,1164]],[[1082]],[[1083]],[[1084]],[[1085]],[[1086]],[[1087]],[[1088]],[[1093,1394,1098,1395,2402,1397,2403,1399,2401,1402]],[[1099]],[[1102]],[[1103]],[[1104]],[[1136]],[[1137]],[[1138]],[[1139]],[[1140]],[[1141]],[[1142]],[[1143]],[[1144]],[[1145]],[[1154]],[[1161]],[[1162]],[[1165]],[[1173]],[[1175]],[[1176]],[[1177]],[[1178]],[[1179]],[[1180]],[[1181]],[[1182]],[[1192,1223,1222]],[[1193]],[[1194]],[[1195]],[[1196]],[[1197]],[[1198]],[[1199]],[[1200]],[[1201]],[[1202]],[[1203]],[[1204]],[[1205]],[[1206]],[[1207]],[[1211]],[[1216]],[[1217]],[[1218]],[[1219]],[[1220]],[[1221]],[[1225]],[[1227]],[[1228]],[[1229]],[[1230]],[[1231]],[[1232]],[[1233]],[[1234]],[[1235]],[[1236]],[[1237]],[[1238]],[[1239]],[[1240]],[[1241]],[[1242]],[[1243]],[[1244]],[[1245]],[[1246]],[[1247]],[[1248]],[[1249]],[[1250]],[[1251]],[[1252]],[[1253]],[[1254]],[[1255]],[[1256]],[[1257]],[[1258]],[[1259]],[[1260]],[[1261]],[[1262]],[[1263]],[[1264]],[[1265]],[[1266]],[[1267]],[[1268]],[[1269]],[[1270]],[[1271]],[[1274]],[[1275]],[[1276]],[[1277]],[[1278]],[[1279]],[[1280]],[[1281]],[[1282]],[[1283]],[[1284]],[[1285]],[[1286]],[[1287]],[[1288]],[[1289]],[[1290]],[[1291]],[[1292]],[[1293]],[[1294]],[[1295]],[[1296]],[[1298]],[[1299]],[[1300]],[[1301]],[[1302]],[[1303]],[[1304]],[[1305]],[[1306]],[[1307]],[[1308]],[[1309]],[[1310]],[[1311]],[[1312]],[[1313]],[[1314]],[[1315]],[[1316]],[[1317]],[[1318]],[[1319]],[[1320]],[[1321]],[[1322]],[[1323]],[[1324]],[[1325]],[[1326]],[[1327]],[[1328]],[[1329]],[[1330]],[[1331]],[[1332]],[[1333]],[[1334]],[[1335]],[[1336]],[[1337]],[[1338]],[[1339]],[[1340]],[[1342]],[[1344]],[[1345]],[[1346]],[[1347]],[[1348]],[[1349]],[[1350]],[[1351]],[[1352]],[[1353]],[[1354]],[[1359]],[[1360]],[[1361]],[[1362]],[[1363]],[[1364]],[[1365]],[[1366]],[[1367]],[[1368]],[[1369]],[[1370]],[[1371]],[[1372]],[[1373]],[[1374]],[[1375]],[[1376]],[[1377]],[[1378]],[[1379]],[[1380]],[[1381]],[[1382]],[[1383]],[[1384]],[[1385]],[[1386]],[[1387]],[[1388]],[[1389]],[[1390]],[[1391]],[[1392]],[[1427]],[[1431]],[[1443]],[[1444]],[[1447]],[[1448]],[[1449]],[[1454]],[[1461]],[[1480]],[[1482]],[[1483]],[[1504]],[[1513]],[[1519]],[[1527]],[[1528]],[[1529]],[[1530]],[[1531]],[[1532]],[[1533]],[[1534]],[[1535]],[[1536]],[[1540]],[[1541]],[[1542]],[[1543]],[[1544]],[[1545]],[[1554]],[[1557]],[[1558]],[[1563]],[[1565]],[[1570]],[[1571]],[[1572]],[[1573]],[[1574]],[[1575]],[[1576]],[[1577]],[[1578]],[[1579]],[[1580]],[[1581]],[[1582]],[[1583]],[[1584]],[[1585]],[[1586]],[[1587]],[[1588]],[[1589]],[[1595,2045,2021,2168,2163,2149,2105,2158,2146,2137,2126,2140,2123,2074,1902,1670,1933,1672,1900,2071,2101,2120,2128,2118,2124,2135,2144,2159,2107,1874,1655,1662,1653]],[[1601]],[[1602]],[[1603]],[[1604]],[[1605]],[[1606]],[[1607]],[[1608]],[[1609]],[[1610]],[[1611]],[[1612]],[[1613]],[[1614]],[[1615]],[[1616]],[[1617]],[[1618]],[[1619]],[[1620]],[[1621]],[[1622]],[[1623]],[[1624]],[[1625]],[[1626]],[[1627]],[[1628]],[[1629]],[[1630]],[[1631]],[[1632]],[[1633]],[[1634]],[[1635]],[[1636]],[[1637]],[[1638]],[[1639]],[[1640]],[[1641]],[[1642]],[[1643]],[[1644]],[[1645]],[[1646]],[[1647]],[[1648]],[[1649]],[[1650]],[[1651]],[[1658,1875]],[[1659]],[[1660]],[[1661]],[[1663]],[[1664]],[[1665]],[[1666]],[[1667]],[[1668]],[[1673]],[[1674]],[[1675]],[[1676]],[[1677]],[[1678]],[[1679]],[[1680]],[[1681]],[[1682]],[[1683]],[[1684]],[[1685]],[[1686]],[[1687]],[[1688]],[[1689]],[[1690]],[[1691]],[[1692]],[[1693]],[[1694]],[[1695]],[[1696]],[[1697]],[[1698]],[[1699]],[[1700]],[[1701]],[[1702]],[[1703]],[[1704]],[[1705]],[[1706]],[[1707]],[[1708]],[[1709]],[[1710]],[[1711]],[[1712]],[[1713]],[[1714]],[[1715]],[[1716]],[[1717]],[[1718]],[[1719]],[[1720]],[[1721]],[[1722]],[[1723]],[[1724]],[[1725]],[[1726]],[[1727]],[[1728]],[[1729]],[[1730]],[[1731]],[[1732]],[[1733]],[[1734]],[[1735]],[[1736]],[[1737]],[[1738]],[[1739]],[[1740]],[[1741]],[[1742]],[[1743]],[[1744]],[[1745]],[[1746]],[[1747]],[[1748]],[[1749]],[[1750]],[[1751]],[[1752]],[[1753]],[[1754]],[[1755]],[[1756]],[[1757]],[[1758]],[[1759]],[[1760]],[[1761]],[[1762]],[[1763]],[[1764]],[[1765]],[[1766]],[[1767]],[[1768]],[[1769]],[[1770]],[[1771]],[[1772]],[[1773]],[[1774]],[[1775]],[[1776]],[[1777]],[[1778]],[[1779]],[[1780]],[[1781]],[[1782]],[[1783]],[[1784]],[[1785]],[[1786]],[[1787]],[[1788]],[[1789]],[[1790]],[[1791]],[[1792]],[[1793]],[[1794]],[[1795]],[[1796]],[[1797]],[[1798]],[[1799]],[[1800]],[[1801]],[[1802]],[[1803]],[[1804]],[[1805]],[[1806]],[[1807]],[[1808]],[[1809]],[[1810]],[[1811]],[[1812]],[[1813]],[[1814]],[[1815]],[[1816]],[[1817]],[[1818]],[[1819]],[[1820]],[[1821]],[[1822]],[[1823]],[[1824]],[[1825]],[[1826]],[[1827]],[[1828]],[[1829]],[[1830]],[[1831]],[[1832]],[[1833]],[[1834]],[[1835]],[[1836]],[[1837]],[[1838]],[[1839]],[[1840]],[[1841]],[[1842]],[[1843]],[[1844]],[[1845]],[[1846]],[[1847]],[[1848]],[[1849]],[[1850]],[[1851]],[[1852]],[[1853]],[[1854]],[[1855]],[[1856]],[[1857]],[[1858]],[[1859]],[[1860]],[[1861]],[[1862]],[[1863]],[[1864]],[[1865]],[[1866]],[[1867]],[[1868]],[[1869]],[[1870]],[[1871]],[[1872]],[[1876]],[[1877]],[[1878]],[[1879]],[[1880]],[[1881]],[[1882]],[[1883]],[[1884]],[[1885]],[[1886]],[[1887]],[[1888]],[[1889]],[[1890]],[[1891]],[[1892]],[[1893]],[[1894]],[[1895]],[[1896]],[[1897]],[[1898]],[[1899]],[[1903]],[[1904]],[[1905]],[[1906]],[[1907]],[[1908]],[[1909]],[[1910]],[[1911]],[[1912]],[[1913]],[[1914]],[[1915]],[[1916]],[[1917]],[[1918]],[[1919]],[[1920]],[[1921]],[[1922]],[[1923]],[[1924]],[[1925]],[[1926]],[[1927]],[[1928]],[[1929]],[[1930]],[[1931]],[[1932]],[[1934]],[[1935]],[[1936]],[[1937]],[[1938]],[[1939]],[[1940]],[[1941]],[[1942]],[[1943]],[[1944]],[[1945]],[[1946]],[[1947]],[[1948]],[[1949]],[[1950]],[[1951]],[[1952]],[[1953]],[[1954]],[[1955]],[[1956]],[[1957]],[[1958]],[[1959]],[[1960]],[[1961]],[[1962]],[[1963]],[[1964]],[[1965]],[[1966]],[[1967]],[[1968]],[[1969]],[[1970]],[[1971]],[[1972]],[[1973]],[[1974]],[[1975]],[[1976]],[[1977]],[[1978]],[[1979]],[[1980]],[[1981]],[[1982]],[[1983]],[[1984]],[[1985]],[[1986]],[[1987]],[[1988]],[[1989]],[[1990]],[[1991]],[[1992]],[[1993]],[[1994]],[[1995]],[[1996]],[[1997]],[[1998]],[[1999]],[[2000]],[[2001]],[[2002]],[[2003]],[[2004]],[[2005]],[[2006]],[[2007]],[[2008]],[[2009]],[[2010]],[[2011]],[[2012]],[[2013]],[[2014]],[[2015]],[[2016]],[[2017]],[[2018]],[[2019]],[[2025]],[[2026]],[[2027]],[[2028]],[[2029]],[[2030]],[[2031]],[[2032]],[[2033]],[[2034,2172]],[[2040,2042]],[[2041]],[[2043]],[[2044]],[[2046]],[[2047]],[[2048]],[[2049]],[[2050]],[[2051]],[[2052]],[[2053]],[[2054]],[[2055]],[[2056]],[[2057]],[[2058]],[[2059]],[[2060]],[[2061]],[[2062]],[[2063]],[[2064]],[[2065]],[[2066]],[[2067]],[[2068]],[[2069]],[[2070]],[[2075]],[[2076]],[[2077]],[[2078]],[[2079]],[[2080]],[[2081]],[[2082]],[[2083]],[[2084]],[[2085]],[[2086]],[[2087]],[[2088]],[[2089]],[[2090]],[[2091]],[[2092]],[[2093]],[[2094]],[[2095]],[[2096]],[[2097]],[[2098]],[[2099]],[[2100]],[[2108]],[[2109]],[[2110]],[[2111]],[[2112]],[[2113]],[[2114]],[[2115]],[[2116]],[[2117]],[[2129]],[[2130]],[[2131]],[[2132,2141]],[[2134]],[[2138]],[[2139]],[[2142]],[[2143]],[[2147]],[[2150]],[[2151]],[[2152]],[[2153]],[[2154]],[[2155]],[[2156]],[[2157]],[[2160]],[[2161]],[[2164]],[[2165]],[[2166]],[[2167]],[[2169]],[[2170]],[[2171]],[[2173]],[[2174]],[[2175]],[[2176]],[[2177]],[[2178]],[[2179]],[[2180]],[[2181]],[[2182]],[[2183]],[[2184]],[[2185]],[[2186]],[[2187]],[[2188]],[[2189]],[[2190]],[[2191]],[[2192]],[[2193]],[[2194]],[[2195]],[[2196]],[[2197]],[[2198]],[[2199]],[[2200]],[[2201]],[[2202]],[[2203]],[[2204]],[[2205]],[[2206]],[[2207]],[[2208]],[[2209]],[[2210]],[[2211]],[[2212]],[[2213]],[[2214]],[[2215]],[[2216]],[[2217]],[[2218]],[[2219]],[[2220]],[[2221]],[[2222]],[[2223]],[[2224]],[[2225]],[[2226]],[[2227]],[[2228]],[[2229]],[[2230]],[[2231]],[[2232]],[[2233]],[[2234]],[[2235]],[[2236]],[[2237]],[[2238]],[[2239]],[[2240]],[[2241]],[[2242]],[[2243]],[[2244]],[[2245]],[[2246]],[[2247]],[[2248]],[[2249]],[[2250]],[[2251]],[[2252]],[[2253]],[[2254]],[[2255]],[[2256]],[[2257]],[[2258]],[[2259]],[[2260]],[[2261]],[[2262]],[[2263]],[[2264]],[[2265]],[[2266]],[[2267]],[[2268]],[[2269]],[[2270]],[[2271]],[[2272]],[[2273]],[[2274]],[[2275]],[[2276]],[[2277]],[[2278]],[[2279]],[[2280]],[[2281]],[[2282]],[[2283]],[[2284]],[[2285]],[[2286]],[[2287]],[[2288]],[[2289]],[[2290]],[[2291]],[[2292]],[[2293]],[[2294]],[[2295]],[[2296]],[[2297]],[[2298]],[[2299]],[[2300]],[[2301]],[[2302]],[[2303]],[[2304]],[[2305]],[[2306]],[[2307]],[[2308]],[[2309]],[[2310]],[[2311]],[[2312]],[[2313]],[[2314]],[[2315]],[[2316]],[[2317]],[[2318]],[[2319]],[[2320]],[[2321]],[[2322]],[[2323]],[[2324]],[[2325]],[[2326]],[[2327]],[[2328]],[[2329]],[[2330]],[[2331]],[[2332]],[[2333]],[[2334]],[[2335]],[[2336]],[[2337]],[[2338]],[[2339]],[[2340]],[[2341]],[[2342]],[[2343]],[[2344]],[[2345]],[[2346]],[[2347]],[[2348]],[[2349]],[[2350]],[[2351]],[[2352]],[[2353]],[[2354]],[[2355]],[[2356]],[[2357]],[[2358]],[[2359]],[[2360]],[[2361]],[[2362]],[[2363]],[[2364]],[[2365]],[[2366]],[[2367]],[[2368]],[[2369]],[[2370]],[[2371]],[[2372]],[[2373]],[[2374]],[[2375]],[[2376]],[[2377]],[[2378]],[[2379]],[[2380]],[[2381]],[[2382]],[[2383]],[[2384]],[[2385]],[[2386]],[[2387]],[[2388]],[[2389]],[[2390]],[[2391]],[[2404]],[[2405]],[[2406]],[[2407]],[[2408]],[[2409]],[[2410]]],"type":"MultiPolygon"}]},"disputed":{"type":"MultiLineString","arcs":[[403,4,603],[348,2,401,604],[15,611],[13,612],[11,613],[9,614],[7,615,676],[610,17,18,19,20,21,22,23,24,25,26,27,395,677,678],[1172,1034,1168],[1095,1393],[1396],[1398],[1400,1091,1401],[901,1355,1356,1409,1410,1422],[1413,1432],[1464,1479],[1473,1474,1511,1512],[2392],[2393],[2394],[2395],[2396,2397],[2398],[2400]]}}} \ No newline at end of file diff --git a/packages/flint-js/src/image-charts/assemble.ts b/packages/flint-js/src/image-charts/assemble.ts index ec2737ee..f3b7a61e 100644 --- a/packages/flint-js/src/image-charts/assemble.ts +++ b/packages/flint-js/src/image-charts/assemble.ts @@ -28,6 +28,7 @@ import type { ChartAssemblyInput, ChartEncoding, SemanticResult } from '../core/types'; import { resolveChannelSemantics, convertTemporalData } from '../core/resolve-semantics'; +import { resolvePivotAggregate } from '../core/field-semantics'; import { detectBandedAxisFromSemantics } from '../core/axis-detection'; import { computeChannelBudgets, deriveStretchCaps, resolveBaseSize } from '../core/compute-layout'; import { filterOverflow } from '../core/filter-overflow'; @@ -146,7 +147,7 @@ function pivotValues( seriesField: string | undefined, categories: Cell[], seriesKeys: Cell[], - aggregate: 'sum' | 'average', + aggregate: 'sum' | 'average' | 'count', ): (number | null)[][] { const SINGLE = '__single__'; const acc = new Map(); @@ -163,7 +164,7 @@ function pivotValues( const valueAt = (cv: Cell, sv: Cell): number | null => { const e = acc.get(pairKey(cv, seriesField ? sv : SINGLE)); if (!e) return null; - return aggregate === 'average' ? e.sum / e.count : e.sum; + return aggregate === 'average' ? e.sum / e.count : aggregate === 'count' ? e.count : e.sum; }; return seriesKeys.map((sv) => categories.map((cv) => valueAt(cv, sv))); } @@ -236,14 +237,15 @@ export function assembleImageCharts(input: ChartAssemblyInput): ImageChartsArtif input.chart_spec.baseSize?.height ?? DEFAULT_SIZE.height, ); + const aggregateOf = (ch: string) => encodings[ch]?.aggregate; if (mapping.noAxes) { - buildPartToWhole(params, mapping.cht, sem, table, fieldOf); + buildPartToWhole(params, mapping.cht, sem, table, fieldOf, aggregateOf); } else if (mapping.xy) { buildScatter(params, table, fieldOf, isMeasure, seriesField, flintType); } else { buildAxes( params, mapping, flintType, sem, table, - fieldOf, typeOf, isMeasure, seriesField, keptCategoryOrder, + fieldOf, aggregateOf, typeOf, isMeasure, seriesField, keptCategoryOrder, ); } @@ -261,6 +263,7 @@ function buildPartToWhole( sem: SemanticResult, table: any[], fieldOf: (ch: string) => string | undefined, + aggregateOf: (ch: string) => string | undefined, ): void { const catField = fieldOf('color') ?? fieldOf('x'); const measField = fieldOf('size') ?? fieldOf('theta') ?? fieldOf('y'); @@ -269,7 +272,7 @@ function buildPartToWhole( } const slices = distinct(table, catField); const measCh = fieldOf('size') === measField ? 'size' : fieldOf('theta') === measField ? 'theta' : 'y'; - const aggregate = sem[measCh]?.aggregationDefault ?? 'sum'; + const aggregate = resolvePivotAggregate(aggregateOf(measCh), sem[measCh]?.aggregationDefault); const [values] = pivotValues(table, catField, measField, undefined, slices, ['__single__'], aggregate); params.push(`cht=${cht}`); @@ -324,6 +327,7 @@ function buildAxes( sem: SemanticResult, table: any[], fieldOf: (ch: string) => string | undefined, + aggregateOf: (ch: string) => string | undefined, typeOf: (ch: string) => string | undefined, isMeasure: (ch: string) => boolean, seriesField: string | undefined, @@ -350,7 +354,7 @@ function buildAxes( } const seriesKeys = seriesField ? distinct(table, seriesField) : [measField]; - const aggregate = sem[measCh]?.aggregationDefault ?? 'sum'; + const aggregate = resolvePivotAggregate(aggregateOf(measCh), sem[measCh]?.aggregationDefault); const seriesValues = pivotValues(table, catField, measField, seriesField, categories, seriesKeys, aggregate); const cht = horizontal ? (mapping.horizontal as string) : mapping.cht; diff --git a/packages/flint-js/src/interactive/README.md b/packages/flint-js/src/interactive/README.md index c7b879ee..07d42f67 100644 --- a/packages/flint-js/src/interactive/README.md +++ b/packages/flint-js/src/interactive/README.md @@ -499,7 +499,7 @@ Canvas definitions have two declarative halves: 2. Optional `handle()` declares **what update JSON to produce** after normalization. Target-bearing events first pass through ChartDef semantic resolution. The handler consumes the same `CanvasInteractionEvent` emitted to applications and returns a - `ChartUpdate` containing renderer-neutral `set-style`, `set-annotation`, + `ChartUpdate` containing renderer-neutral `set-style`, `annotate-text`, `set-viewport`, or `set-order` operations. The backend mount reads `eventSource`; it does not infer a gesture from pointer motion. It installs the required native listeners, supplies renderer coordinates and hit testing, and runs the recognizer requested by the interaction. This keeps an identical drag stream deterministic and author-controlled. @@ -821,7 +821,10 @@ interface ChartUpdate { type ChartUpdateOp = | { op: 'set-style'; targets: readonly UpdateTarget[]; value: StyleSpec } - | { op: 'set-annotation'; target: UpdateTarget; value: AnnotationSpec | null } + | { op: 'annotate-text'; target: UpdateTarget; value: AnnotationSpec | null } + | { op: 'set-annotation'; target: UpdateTarget; value: AnnotationSpec | null } // deprecated: annotate-text; removed in 2.0 + | { op: 'annotate-region'; name: string; value: RegionAnnotationSpec | null } + | { op: 'annotate-enclosure'; name: string; value: EnclosureAnnotationSpec | null } | { op: 'set-viewport'; axes: 'x' | 'y' | 'xy'; value: { x?: Domain; y?: Domain } } | { op: 'set-order'; @@ -844,7 +847,12 @@ interface StyleSpec { Operators are plain JSON. Presets and applications construct object literals directly; there are no trivial operator factory functions. -`emphasized` and `focused` recede every other mark to `mutedOpacity`. `highlighted` gives its +`emphasized` and `focused` recede every other mark; `emphasis` says how far, as a note's +`highlight` does: `'light'` (the default: the rest keep 0.6 of their own opacity, so they stay +readable), `'strong'` (0.35) or `'exclusive'` (0.2). `mutedOpacity` states the receded opacity +outright. The labels of the marks set +back recede no further than half, and a label drawn on its mark takes the page's ink, so their +values still read. `highlighted` gives its targets their mark's hover cue (a wider line drawn in front, an outline, a contrast step) and leaves every other mark as drawn. @@ -896,23 +904,73 @@ type UpdateTarget = Selectors accept only ChartDef-declared semantic fields. At runtime they are resolved to the same `SemanticTargetRef` shape; the surrounding `ChartUpdateOp` does not change. -ChartDefs may enrich an operator without changing its kind. For example, -`set-annotation` can begin with text only and gain meaningful connection candidates in -its `value`: +`annotate-text` sets a caption on one mark, after Blabber's `text`: the words stand beside the +mark in the chart's label face, haloed in the page, with a leader only where they are not +plainly beside it. It is never a card or a callout box; draw those with `set-overlay` or +`set-freeform-overlay`. `set-annotation` is its deprecated name: still read in 1.x, reported +by `validateChart` as a `deprecated_op` warning and once on the console, and removed in 2.0. + +ChartDefs may enrich an operator without changing its kind: a template's presenter adds where +on its marks a note may connect (`AnnotationCandidate`), which an update does not write. + +In Vega-Lite every note is placed the same lightweight way: a ring of seats round the place +it names, each priced by what it would cover (marks, text, lines it cuts), how far it stands +and the leader it needs, and the cheapest kept, one note after another. What it names decides +the places it is tried from: + +- one mark (a dot, a bar's value end, a cell, a line's point): its outline; +- a stretch of a line or area: its middle and a quarter along either way, an area's from + the side away from its fill; +- a pie or donut slice: inside its wedge, preferring a seat out past the pie on a leader; +- a whole shape, such as a violin: the ellipse its box holds; +- a map's region: its middle, the other regions a ground the halo reads over. + +The note's `highlight` sets how much what it names stands out: + +- `'none'` leaves it as drawn. +- `'light'` (the default) lifts a dot above its neighbours with a halo, draws a stretch of a + line or area again in its ink, and gives a bar, a cell, a slice or a shape a faint outline. +- `'strong'` also draws a thin ring round a dot or point, and a full outline round a bar, + a cell, a slice or a shape. +- `'exclusive'` is strong and also fades every other mark, as `set-style` `emphasized` + does. + +The notes a chart mounts with (its first `updates`) also get +room in the compile: when a noted mark sits at the top of a vertical measure axis, the axis runs +on just far enough for the caption at its nearest seat over the mark, ending at a fine round +step, using at most a third of the axis (`AssembleOptions.notes`). A note added after mount is placed in the room the chart +already has. + +`annotate-region` and `annotate-enclosure` follow Blabber's `region` and `enclose`. A region +shades a stretch of the plot: one axis gives a band across it, both a box. On a faceted chart +the stretch is shaded in every panel, each wash cut at its panel. A continuous +stretch is two bounds, either `null` for the plot's end; a banded one lists the categories it +covers, which must be adjacent. Its caption is centred on the stretch, clear of the series that +cross it, and moves outside on a leader only where nothing inside is clear. A stretch of x +the chart mounts with gets room as a note does where its marks reach too near the plot's top +for the caption: the axis runs on past the stretch's tallest mark (`AssembleOptions.regions`). +A wash under the +marks is cut away where they stand; over an area or a heatmap it is drawn over them. An +enclosure outlines each of its targets (bars and cells with a rectangle, other marks with a +hull; `shape` may ask for `ellipse` or `circle`): a cluster sharing a colour in that colour, +any other group in a neutral grey over a thin halo of the page, and sets one shared caption beside them, with leaders to two or three outlines +(`connect`). Regions and enclosures are drawn before notes, whose captions keep clear of them. + +A note should say what the chart does not show: why the mark stands out, what changed +there, how it compares. It should not restate the mark's printed value or its axis label. +`validateChart` gives an info `note_repeats_chart` for a note that repeats a value the +chart prints on its mark. ```ts +// Set by a template's presenter, not by an update. The caption is placed from the first. interface AnnotationCandidate { connection: 'center' | 'top' | 'right' | 'bottom' | 'left' - | 'value-end' | 'value-side' | 'segment-midpoint' | 'outer-radial'; + | 'value-end' | 'value-side' | 'segment-midpoint' | 'radial-midpoint' | 'outer-radial'; valueAxis?: 'x' | 'y'; crossSide?: 'start' | 'end'; valueInset?: number; - anglePreference?: 'normal' | 'oblique'; - textAlign?: 'left' | 'center' | 'right'; connector?: 'line' | 'none'; maxWidth?: number; - maxDistance?: number; - priority?: number; } ``` diff --git a/packages/flint-js/src/interactive/chartjs.ts b/packages/flint-js/src/interactive/chartjs.ts new file mode 100644 index 00000000..d17fc05e --- /dev/null +++ b/packages/flint-js/src/interactive/chartjs.ts @@ -0,0 +1,23 @@ +import type { ChartAssemblyInput } from '../core/types'; +import { mountChartWith } from './mount'; +import type { BuildInteractiveChartOptions, InteractiveChartSurface } from './types'; + +export * from './exports'; + +/** + * Mounts a chart with Chart.js only, so a bundler resolves no other backend: the app installs + * chart.js and nothing else. Another backend draws where `options.renderers` gives its factory. + */ +export function mountChart( + container: HTMLElement, + input: ChartAssemblyInput, + options: BuildInteractiveChartOptions, +): InteractiveChartSurface { + return mountChartWith( + { chartjs: () => import('../chartjs/interactive').then((m) => m.createChartjsInteractiveRenderer) }, + container, input, options, + ); +} + +/** The former name of `mountChart`. */ +export const buildInteractiveChart = mountChart; diff --git a/packages/flint-js/src/interactive/echarts.ts b/packages/flint-js/src/interactive/echarts.ts new file mode 100644 index 00000000..5901de82 --- /dev/null +++ b/packages/flint-js/src/interactive/echarts.ts @@ -0,0 +1,23 @@ +import type { ChartAssemblyInput } from '../core/types'; +import { mountChartWith } from './mount'; +import type { BuildInteractiveChartOptions, InteractiveChartSurface } from './types'; + +export * from './exports'; + +/** + * Mounts a chart with ECharts only, so a bundler resolves no other backend: the app installs + * echarts and nothing else. Another backend draws where `options.renderers` gives its factory. + */ +export function mountChart( + container: HTMLElement, + input: ChartAssemblyInput, + options: BuildInteractiveChartOptions, +): InteractiveChartSurface { + return mountChartWith( + { echarts: () => import('../echarts/interactive').then((m) => m.createEChartsInteractiveRenderer) }, + container, input, options, + ); +} + +/** The former name of `mountChart`. */ +export const buildInteractiveChart = mountChart; diff --git a/packages/flint-js/src/interactive/exports.ts b/packages/flint-js/src/interactive/exports.ts new file mode 100644 index 00000000..5c800151 --- /dev/null +++ b/packages/flint-js/src/interactive/exports.ts @@ -0,0 +1,210 @@ +// Everything `flint-chart/interactive` exports but `mountChart`, which each entry binds to the +// backends it loads (see ./index.ts and ./vegalite.ts, ./echarts.ts, ./chartjs.ts, ./plotly.ts). +export { mountChartWith } from './mount'; +import type { BuildInteractiveChartOptions } from './types'; + +export type { + AssistedTargetingOptions, + TargetDetailsOptions, + TargetFeedbackOptions, + BuildInteractiveChartOptions, + InteractiveRenderers, + InteractiveRendererLoaders, + ChartChange, + ChartLayout, + ChartChangePhase, + ChartChangeSource, + ChartStateFacet, + ChartUpdateApplyOptions, + ChartUpdateTransition, + ChartUpdateComposition, + InteractiveBackend, + InteractiveChartSurface, + InteractiveChartSurfaceOptions, + InteractiveRenderer, + InteractiveRendererAdapter, + ViewportChannel, + ViewportGeometry, + ViewportState, +} from './types'; +export type { + AxisTargetValue, + ChartAnnotation, + ChartCategoryWindow, + ChartHiddenValue, + ChartState, + ChartStateEntry, + DomainPoint, + DomainValue, + LegendDomain, + LegendTargetValue, +} from '../core/interaction-contracts'; +export type { + GestureGuideController, + GestureGuideOptions, + AreaGestureGuideStyle, + InspectGuideOptions, + LineGestureGuideStyle, + RegionGuideOptions, +} from './guides'; +export type { + InteractionAffordance, + InteractionAffordances, + InteractionAffordanceTarget, + InteractionCursor, + InteractionHoverEffect, + ResolvedInteractionAffordance, +} from './affordances'; +export { DRAW_CURSOR, affordanceCursor, affordsTarget, resolveInteractionAffordance } from './affordances'; +export type { + AccessibleNavigationOptions, + AnnotationCandidate, + AnnotationConnection, + AnnotationSpec, + NoteTextStyle, + HighlightStyle, + ChartOverlaySpec, + ChartUpdate, + ChartUpdateOp, + ChartUpdatePresenter, + BrushOptions, + BrushZoomOptions, + AngularBrushOptions, + AxisHighlightOptions, + ClickAnnotateOptions, + ClickHighlightOptions, + ClickHighlightTarget, + ClickGroupFocusOptions, + ContextActivateOptions, + DoubleActivateOptions, + DragReorderOptions, + LegendToggleOptions, + LongPressOptions, + LinkedBrushOptions, + HoverGroupFocusOptions, + GroupBy, + ElementInteractionEvent, + FlintInteractionEventDetail, + InteractionPhase, + InteractionContext, + InteractionDef, + CanvasInteractionDef, + ExternalInteractionDef, + InteractionModifiers, + InspectOptions, + InspectIndexOptions, + LassoSelectOptions, + NavigateOptions, + NavigationTransition, + NavigationAxes, + NavigationDomainGuard, + NavigationInteractionEvent, + NavigationOperation, + PlotPoint, + PlotAngularSector, + PlotPolygon, + PlotRect, + OverlayFieldEncoding, + OverlayMark, + OverlayStyleSpec, + RegionAxis, + RegionOperation, + RenderHit, + SelectOptions, + SemanticElement, + SemanticInteractionEvent, + SemanticTarget, + StyleSpec, + UpdateDomain, + UpdateTarget, +} from './interactions'; +export type { + AccessibleElementDescription, + CanvasInteractionAction, + CanvasInteractionEvent, + DomainCoordinate, + DomainGeometry, + PathProjection, + PlotGeometry, +} from './language/events'; +export { toCanvasInteractionEvent } from './canvas-interaction'; +export { HOST_SOURCE, LINK_LAYER, conditionUpdates, createLinkState, gestureParts, linkCharts, linkInput, loadLinks, selectionParts, selectionTuples, shownFields } from './link'; +export type { ChartLink, ChartsLink, LinkChartsOptions, LinkCondition, LinkGesture, LinkPart, LinkSnapshot, LinkSpec, LinkState, LinkedChart } from './link'; +export type { + ChartUpdateResult, + FreeformOverlayBody, + FreeformCloneBody, + FreeformOverlaySpec, + FreeformOverlayTransform, + FreeformSvgBody, + SemanticTargetRef, + SemanticTargetSelector, +} from './language/updates'; +export { matchesSemanticTargetSelector, selectionUpdate, viewportUpdate } from './language/updates'; +export { accessibleNavigation, axisHighlight, brushAngle, brushX, brushY, brushZoom, clickAnnotate, clickGroupFocus, clickHighlight, contextActivate, doubleActivate, dragReorder, externalInteraction, hoverGroupFocus, inspect, inspectIndex, isCanvasInteraction, isExternalInteraction, lassoSelect, legendToggle, linkedBrush, longPress, navigate, select } from './interactions'; +export type { + AccessibleNavigationSection, + AccessibleNavigationSettings, + InspectIndexShow, + InteractionEventSource, +} from './triggers'; +export { + ACCESSIBLE_NAVIGATION_SECTIONS, + accessibleNavigationTrigger, + axisBrushTrigger, + angularBrushTrigger, + dragTrigger, + brushZoomTrigger, + clickTrigger, + contextTrigger, + doubleActivateTrigger, + hoverTrigger, + inspectTrigger, + inspectIndexTrigger, + keyboardTrigger, + lassoTrigger, + longPressTrigger, + navigationTrigger, + rectangleTrigger, + xBrushTrigger, + yBrushTrigger, +} from './triggers'; +export { clampViewportStart, mountInteractiveChartSurface } from './surface'; +export { filterControls, isFilterControls, rowMatchesFilters, valueMatchesFilter } from './filter-controls'; +export type { + FilterControlsDef, + FilterControlsOptions, + FilterControlsPayload, + FilterFieldOptions, + FilterPlacement, + FilterValue, + FilterWidget, +} from './filter-controls'; +export { contextMenu, isContextMenu } from './context-menu'; +export type { ContextMenuDef, ContextMenuGesture, ContextMenuItem, ContextMenuOptions } from './context-menu'; +export { INTERACTION_PRESET_TYPES } from '../core/interaction-spec'; +export type { + InteractionEntry, + InteractionPresetType, + InteractionSpec, +} from '../core/interaction-spec'; +export type { InteractionPresetOptions, InteractionPresetSpec } from './spec/types'; +export { INTERACTION_PRESETS, listInteractionPresets } from './spec/registry'; +export { INTERACTION_PRESET_OPTIONS } from './spec/preset-options'; +export type { InteractionPresetOption } from './spec/preset-options'; +export type { + InteractionCapability, + InteractionGestureFamily, + InteractionPresetDefinition, + InteractionPresetSummary, +} from './spec/registry'; +export { resolveInteractionSpec } from './spec/resolve'; +export { INTERACTION_RESET_GESTURES, interactionsToReset, normalizeResetGestures } from './reset'; +export type { InteractionResetGesture } from './reset'; +export { admitInteractions } from './spec/admission'; +export { composeInteractiveOptions } from './spec/compose'; +export type { ComposedInteractiveOptions } from './spec/compose'; +export type { InteractionAdmission, InteractionAdmissionPlan } from './spec/admission'; +export type { ResolvedInteractionSpec } from './spec/resolve'; + +export type MountChartOptions = BuildInteractiveChartOptions; diff --git a/packages/flint-js/src/interactive/index.ts b/packages/flint-js/src/interactive/index.ts index f03ebf39..8b5ff93d 100644 --- a/packages/flint-js/src/interactive/index.ts +++ b/packages/flint-js/src/interactive/index.ts @@ -1,302 +1,30 @@ import type { ChartAssemblyInput } from '../core/types'; -import { isCanvasInteraction } from './interactions'; -import { composeInteractiveOptions } from './spec/compose'; -import { mountInteractiveChartSurface } from './surface'; -import type { BuildInteractiveChartOptions, InteractiveChartSurface } from './types'; +import { mountChartWith } from './mount'; +import type { BuildInteractiveChartOptions, InteractiveChartSurface, InteractiveRendererLoaders } from './types'; -export type { - AssistedTargetingOptions, - TargetDetailsOptions, - TargetFeedbackOptions, - BuildInteractiveChartOptions, - ChartChange, - ChartLayout, - ChartChangePhase, - ChartChangeSource, - ChartStateFacet, - ChartUpdateApplyOptions, - ChartUpdateTransition, - ChartUpdateComposition, - InteractiveBackend, - InteractiveChartSurface, - InteractiveChartSurfaceOptions, - InteractiveRenderer, - InteractiveRendererAdapter, - ViewportChannel, - ViewportGeometry, - ViewportState, -} from './types'; -export type { - AxisTargetValue, - ChartAnnotation, - ChartCategoryWindow, - ChartHiddenValue, - ChartState, - ChartStateEntry, - DomainPoint, - DomainValue, - LegendDomain, - LegendTargetValue, -} from '../core/interaction-contracts'; -export type { - GestureGuideController, - GestureGuideOptions, - AreaGestureGuideStyle, - InspectGuideOptions, - LineGestureGuideStyle, - RegionGuideOptions, -} from './guides'; -export type { - InteractionAffordance, - InteractionAffordances, - InteractionAffordanceTarget, - InteractionCursor, - InteractionHoverEffect, - ResolvedInteractionAffordance, -} from './affordances'; -export { DRAW_CURSOR, affordanceCursor, affordsTarget, resolveInteractionAffordance } from './affordances'; -export type { - AccessibleNavigationOptions, - AnnotationCandidate, - AnnotationConnection, - AnnotationSpec, - ChartOverlaySpec, - ChartUpdate, - ChartUpdateOp, - ChartUpdatePresenter, - BrushOptions, - BrushZoomOptions, - AngularBrushOptions, - AxisHighlightOptions, - ClickAnnotateOptions, - ClickHighlightOptions, - ClickHighlightTarget, - ClickGroupFocusOptions, - ContextActivateOptions, - DoubleActivateOptions, - DragReorderOptions, - LegendToggleOptions, - LongPressOptions, - LinkedBrushOptions, - HoverGroupFocusOptions, - GroupBy, - ElementInteractionEvent, - FlintInteractionEventDetail, - InteractionPhase, - InteractionContext, - InteractionDef, - CanvasInteractionDef, - ExternalInteractionDef, - InteractionModifiers, - InspectOptions, - InspectIndexOptions, - LassoSelectOptions, - NavigateOptions, - NavigationTransition, - NavigationAxes, - NavigationDomainGuard, - NavigationInteractionEvent, - NavigationOperation, - PlotPoint, - PlotAngularSector, - PlotPolygon, - PlotRect, - OverlayFieldEncoding, - OverlayMark, - OverlayStyleSpec, - RegionAxis, - RegionOperation, - RenderHit, - SelectOptions, - SemanticElement, - SemanticInteractionEvent, - SemanticTarget, - StyleSpec, - UpdateDomain, - UpdateTarget, -} from './interactions'; -export type { - AccessibleElementDescription, - CanvasInteractionAction, - CanvasInteractionEvent, - DomainCoordinate, - DomainGeometry, - PathProjection, - PlotGeometry, -} from './language/events'; -export { toCanvasInteractionEvent } from './canvas-interaction'; -export { HOST_SOURCE, LINK_LAYER, conditionUpdates, createLinkState, gestureParts, linkCharts, linkInput, loadLinks, selectionParts, selectionTuples, shownFields } from './link'; -export type { ChartLink, ChartsLink, LinkChartsOptions, LinkCondition, LinkGesture, LinkPart, LinkSnapshot, LinkSpec, LinkState, LinkedChart } from './link'; -export type { - ChartUpdateResult, - FreeformOverlayBody, - FreeformCloneBody, - FreeformOverlaySpec, - FreeformOverlayTransform, - FreeformSvgBody, - SemanticTargetRef, - SemanticTargetSelector, -} from './language/updates'; -export { matchesSemanticTargetSelector, selectionUpdate, viewportUpdate } from './language/updates'; -export { accessibleNavigation, axisHighlight, brushAngle, brushX, brushY, brushZoom, clickAnnotate, clickGroupFocus, clickHighlight, contextActivate, doubleActivate, dragReorder, externalInteraction, hoverGroupFocus, inspect, inspectIndex, isCanvasInteraction, isExternalInteraction, lassoSelect, legendToggle, linkedBrush, longPress, navigate, select } from './interactions'; -export type { - AccessibleNavigationSection, - AccessibleNavigationSettings, - InspectIndexShow, - InteractionEventSource, -} from './triggers'; -export { - ACCESSIBLE_NAVIGATION_SECTIONS, - accessibleNavigationTrigger, - axisBrushTrigger, - angularBrushTrigger, - dragTrigger, - brushZoomTrigger, - clickTrigger, - contextTrigger, - doubleActivateTrigger, - hoverTrigger, - inspectTrigger, - inspectIndexTrigger, - keyboardTrigger, - lassoTrigger, - longPressTrigger, - navigationTrigger, - rectangleTrigger, - xBrushTrigger, - yBrushTrigger, -} from './triggers'; -export { clampViewportStart, mountInteractiveChartSurface } from './surface'; -export { filterControls, isFilterControls, rowMatchesFilters, valueMatchesFilter } from './filter-controls'; -export type { - FilterControlsDef, - FilterControlsOptions, - FilterControlsPayload, - FilterFieldOptions, - FilterPlacement, - FilterValue, - FilterWidget, -} from './filter-controls'; -export { contextMenu, isContextMenu } from './context-menu'; -export type { ContextMenuDef, ContextMenuGesture, ContextMenuItem, ContextMenuOptions } from './context-menu'; -export { INTERACTION_PRESET_TYPES } from '../core/interaction-spec'; -export type { - InteractionEntry, - InteractionPresetType, - InteractionSpec, -} from '../core/interaction-spec'; -export type { InteractionPresetOptions, InteractionPresetSpec } from './spec/types'; -export { INTERACTION_PRESETS, listInteractionPresets } from './spec/registry'; -export { INTERACTION_PRESET_OPTIONS } from './spec/preset-options'; -export type { InteractionPresetOption } from './spec/preset-options'; -export type { - InteractionCapability, - InteractionGestureFamily, - InteractionPresetDefinition, - InteractionPresetSummary, -} from './spec/registry'; -export { resolveInteractionSpec } from './spec/resolve'; -export { INTERACTION_RESET_GESTURES, interactionsToReset, normalizeResetGestures } from './reset'; -export type { InteractionResetGesture } from './reset'; -export { admitInteractions } from './spec/admission'; -export { composeInteractiveOptions } from './spec/compose'; -export type { ComposedInteractiveOptions } from './spec/compose'; -export type { InteractionAdmission, InteractionAdmissionPlan } from './spec/admission'; -export type { ResolvedInteractionSpec } from './spec/resolve'; +export * from './exports'; +/** Every backend, each loaded when a chart first draws with it. */ +const ALL_RENDERERS: InteractiveRendererLoaders = { + vegalite: () => import('../vegalite/interactive').then((m) => m.createVegaInteractiveRenderer), + echarts: () => import('../echarts/interactive').then((m) => m.createEChartsInteractiveRenderer), + chartjs: () => import('../chartjs/interactive').then((m) => m.createChartjsInteractiveRenderer), + plotly: () => import('../plotly/interactive').then((m) => m.createPlotlyInteractiveRenderer), +}; + +/** + * Mounts a chart on any backend, loading its renderer on first draw. A bundler resolves every + * backend this can load; an app that installs only some imports `flint-chart/interactive/` + * instead, or passes `options.renderers`. + */ export function mountChart( container: HTMLElement, input: ChartAssemblyInput, options: BuildInteractiveChartOptions, ): InteractiveChartSurface { - const { backend, renderer, expressionInterpreter, background, className, ariaLabel, chartId, availableSize } = options; - // Loaded with the renderer: it reads the theme, which the mount entry does not bundle. - const sized = async (chartInput: ChartAssemblyInput): Promise => { - if (!availableSize) return chartInput; - const { withCanvasSize } = await import('../core/compute-layout'); - return withCanvasSize(chartInput, availableSize); - }; - // The spec and the code are two sources of one configuration; the spec comes first. - const { interactions, updates, assistedTargeting, keyboardTargeting, warnings } = - composeInteractiveOptions(input, options); - const canvasInteractions = interactions.filter(isCanvasInteraction); - const hoverTolerance = Math.max(0, ...canvasInteractions - .filter((interaction) => interaction.eventSource.gesture === 'hover') - .map((interaction) => interaction.eventSource.targetTolerance ?? 0)); - switch (backend) { - case 'vegalite': - return mountInteractiveChartSurface( - container, - input, - { - async mount(chartContainer, chartInput) { - const { createVegaInteractiveRenderer } = await import('../vegalite/interactive'); - return createVegaInteractiveRenderer({ - renderer, - // External definitions too: the renderer reports their state (filters). - interactions, - enableSemanticUpdates: (options.semanticUpdates ?? true) - || interactions.length > 0 - || (updates?.length ?? 0) > 0, - expressionInterpreter, - background, - assistDistance: assistedTargeting === false - ? 0 - : typeof assistedTargeting === 'object' - && assistedTargeting.maxDistance !== undefined - ? Math.max(0, assistedTargeting.maxDistance) - : undefined, - hoverTolerance, - targetFeedback: { - assisted: typeof assistedTargeting === 'object' ? assistedTargeting : assistedTargeting ? {} : false, - keyboard: keyboardTargeting ? {} : false, - }, - keyboardTargeting, - liveValues: availableSize !== undefined, - }).mount(chartContainer, await sized(chartInput)); - }, - }, - { className, ariaLabel, chartId, updates, interactions, warnings }, - ); - case 'echarts': - return mountInteractiveChartSurface( - container, - input, - { - async mount(chartContainer, chartInput) { - const { createEChartsInteractiveRenderer } = await import('../echarts/interactive'); - return createEChartsInteractiveRenderer({ renderer }).mount(chartContainer, await sized(chartInput)); - }, - }, - { className, ariaLabel, chartId, updates, interactions, warnings }, - ); - case 'chartjs': - return mountInteractiveChartSurface( - container, - input, - { - async mount(chartContainer, chartInput) { - const { createChartjsInteractiveRenderer } = await import('../chartjs/interactive'); - return createChartjsInteractiveRenderer().mount(chartContainer, await sized(chartInput)); - }, - }, - { className, ariaLabel, chartId, updates, interactions, warnings }, - ); - case 'plotly': - return mountInteractiveChartSurface( - container, - input, - { - async mount(chartContainer, chartInput) { - const { createPlotlyInteractiveRenderer } = await import('../plotly/interactive'); - return createPlotlyInteractiveRenderer().mount(chartContainer, await sized(chartInput)); - }, - }, - { className, ariaLabel, chartId, updates, interactions, warnings }, - ); - } + return mountChartWith(ALL_RENDERERS, container, input, options); } /** The former name of `mountChart`. */ export const buildInteractiveChart = mountChart; -export type MountChartOptions = BuildInteractiveChartOptions; \ No newline at end of file +export type MountChartOptions = BuildInteractiveChartOptions; diff --git a/packages/flint-js/src/interactive/interactions.ts b/packages/flint-js/src/interactive/interactions.ts index 93d3676d..2025caa5 100644 --- a/packages/flint-js/src/interactive/interactions.ts +++ b/packages/flint-js/src/interactive/interactions.ts @@ -94,7 +94,11 @@ export type { AnnotationConnection, AnnotationConnectorAnchor, AnnotationSpec, + NoteTextStyle, + HighlightStyle, ChartOverlaySpec, + EnclosureAnnotationSpec, + RegionAnnotationSpec, ChartUpdate, ChartUpdateOp, OverlayFieldEncoding, @@ -109,8 +113,12 @@ export type { export interface CanvasInteractionDef { readonly id: string; - /** Set by the spec resolver. A definition made in code has no origin. */ - readonly origin?: 'spec'; + /** + * Set by the spec resolver (`'spec'`) or by the mount for a behaviour every chart has + * (`'baseline'`, which gives way silently to anything the spec or the code asks for). A + * definition made in code has no origin. + */ + readonly origin?: 'spec' | 'baseline'; /** The preset that made this definition; admission reads its requirements from the registry. */ readonly preset?: InteractionPresetType; /** The options the preset was made with, so a host can tell two definitions with one id apart. */ diff --git a/packages/flint-js/src/interactive/language/updates.ts b/packages/flint-js/src/interactive/language/updates.ts index eb3baf1a..18b1b80e 100644 --- a/packages/flint-js/src/interactive/language/updates.ts +++ b/packages/flint-js/src/interactive/language/updates.ts @@ -14,9 +14,13 @@ export type { AnnotationConnection, AnnotationConnectorAnchor, AnnotationSpec, + NoteTextStyle, + HighlightStyle, ChartUpdate, ChartUpdateOp, ChartOverlaySpec, + EnclosureAnnotationSpec, + RegionAnnotationSpec, FreeformOverlayBody, FreeformCloneBody, FreeformOverlaySpec, diff --git a/packages/flint-js/src/interactive/mount.ts b/packages/flint-js/src/interactive/mount.ts new file mode 100644 index 00000000..f4a82ba2 --- /dev/null +++ b/packages/flint-js/src/interactive/mount.ts @@ -0,0 +1,143 @@ +import type { ChartAssemblyInput } from '../core/types'; +import { isCanvasInteraction } from './interactions'; +import { enclosuresOfUpdates, notesOfUpdates, referencesOfUpdates, regionsOfUpdates } from './presentation/annotation'; +import { composeInteractiveOptions } from './spec/compose'; +import { mountInteractiveChartSurface } from './surface'; +import type { + BuildInteractiveChartOptions, + InteractiveBackend, + InteractiveChartSurface, + InteractiveRendererLoaders, + InteractiveRenderers, +} from './types'; + +const FACTORY_NAMES: Record = { + vegalite: 'createVegaInteractiveRenderer', + echarts: 'createEChartsInteractiveRenderer', + chartjs: 'createChartjsInteractiveRenderer', + plotly: 'createPlotlyInteractiveRenderer', +}; + +function missingRenderer(backend: InteractiveBackend): string { + return `Flint: this entry does not load the ${backend} renderer. Import { ${FACTORY_NAMES[backend]} } from ` + + `'flint-chart/${backend}/interactive' and pass it as renderers.${backend}, or import from ` + + `'flint-chart/react/${backend}' (or 'flint-chart/interactive/${backend}').`; +} + +/** A backend's renderer factory: the host's first, then the entry's own loader; an error names the fix. */ +export async function rendererFactory( + loaders: InteractiveRendererLoaders, given: InteractiveRenderers | undefined, backend: B, +): Promise> { + const own = given?.[backend]; + if (own) return own as NonNullable; + const load = loaders[backend]; + if (load) return load() as Promise>; + throw new Error(missingRenderer(backend)); +} + +/** + * Mounts a chart with the renderer factories `loaders` reach, and those `options.renderers` gives. + * No backend is imported here: an entry names the backends it loads, so a bundler resolves only those. + */ +export function mountChartWith( + loaders: InteractiveRendererLoaders, + container: HTMLElement, + input: ChartAssemblyInput, + options: BuildInteractiveChartOptions, +): InteractiveChartSurface { + const { backend, renderer, expressionInterpreter, background, className, ariaLabel, chartId, availableSize } = options; + const factory = (name: B) => rendererFactory(loaders, options.renderers, name); + // Loaded with the renderer: it reads the theme, which the mount entry does not bundle. + const sized = async (chartInput: ChartAssemblyInput): Promise => { + if (!availableSize) return chartInput; + const { withCanvasSize } = await import('../core/compute-layout'); + return withCanvasSize(chartInput, availableSize); + }; + // The spec and the code are two sources of one configuration; the spec comes first. + const { interactions, updates, assistedTargeting, keyboardTargeting, defaults, warnings } = + composeInteractiveOptions(input, options); + // The spec's updates are applied here, after the chart is drawn: the chart is drawn without them. + const { updates: _specUpdates, ...chart } = input; + const canvasInteractions = interactions.filter(isCanvasInteraction); + const hoverTolerance = Math.max(0, ...canvasInteractions + .filter((interaction) => interaction.eventSource.gesture === 'hover') + .map((interaction) => interaction.eventSource.targetTolerance ?? 0)); + switch (backend) { + case 'vegalite': + return mountInteractiveChartSurface( + container, + chart, + { + async mount(chartContainer, chartInput) { + const createVegaInteractiveRenderer = await factory('vegalite'); + return createVegaInteractiveRenderer({ + renderer, + // External definitions too: the renderer reports their state (filters). + interactions, + enableSemanticUpdates: (options.semanticUpdates ?? true) + || interactions.length > 0 + || (updates?.length ?? 0) > 0, + expressionInterpreter, + background, + notes: notesOfUpdates(updates), + regions: regionsOfUpdates(updates), + references: referencesOfUpdates(updates), + defaults, + enclosures: enclosuresOfUpdates(updates), + assistDistance: assistedTargeting === false + ? 0 + : typeof assistedTargeting === 'object' + && assistedTargeting.maxDistance !== undefined + ? Math.max(0, assistedTargeting.maxDistance) + : undefined, + hoverTolerance, + targetFeedback: { + assisted: typeof assistedTargeting === 'object' ? assistedTargeting : assistedTargeting ? {} : false, + keyboard: keyboardTargeting ? {} : false, + }, + keyboardTargeting, + liveValues: availableSize !== undefined, + }).mount(chartContainer, await sized(chartInput)); + }, + }, + { className, ariaLabel, chartId, updates, interactions, warnings }, + ); + case 'echarts': + return mountInteractiveChartSurface( + container, + chart, + { + async mount(chartContainer, chartInput) { + const createEChartsInteractiveRenderer = await factory('echarts'); + return createEChartsInteractiveRenderer({ renderer }).mount(chartContainer, await sized(chartInput)); + }, + }, + { className, ariaLabel, chartId, updates, interactions, warnings }, + ); + case 'chartjs': + return mountInteractiveChartSurface( + container, + chart, + { + async mount(chartContainer, chartInput) { + const createChartjsInteractiveRenderer = await factory('chartjs'); + return createChartjsInteractiveRenderer().mount(chartContainer, await sized(chartInput)); + }, + }, + { className, ariaLabel, chartId, updates, interactions, warnings }, + ); + case 'plotly': + return mountInteractiveChartSurface( + container, + chart, + { + async mount(chartContainer, chartInput) { + const createPlotlyInteractiveRenderer = await factory('plotly'); + return createPlotlyInteractiveRenderer().mount(chartContainer, await sized(chartInput)); + }, + }, + { className, ariaLabel, chartId, updates, interactions, warnings }, + ); + } +} + diff --git a/packages/flint-js/src/interactive/plotly.ts b/packages/flint-js/src/interactive/plotly.ts new file mode 100644 index 00000000..e91c3877 --- /dev/null +++ b/packages/flint-js/src/interactive/plotly.ts @@ -0,0 +1,23 @@ +import type { ChartAssemblyInput } from '../core/types'; +import { mountChartWith } from './mount'; +import type { BuildInteractiveChartOptions, InteractiveChartSurface } from './types'; + +export * from './exports'; + +/** + * Mounts a chart with Plotly only, so a bundler resolves no other backend: the app installs + * plotly.js-dist-min and nothing else. Another backend draws where `options.renderers` gives its factory. + */ +export function mountChart( + container: HTMLElement, + input: ChartAssemblyInput, + options: BuildInteractiveChartOptions, +): InteractiveChartSurface { + return mountChartWith( + { plotly: () => import('../plotly/interactive').then((m) => m.createPlotlyInteractiveRenderer) }, + container, input, options, + ); +} + +/** The former name of `mountChart`. */ +export const buildInteractiveChart = mountChart; diff --git a/packages/flint-js/src/interactive/presentation/annotation.ts b/packages/flint-js/src/interactive/presentation/annotation.ts index 7e06bee2..20f1bf0b 100644 --- a/packages/flint-js/src/interactive/presentation/annotation.ts +++ b/packages/flint-js/src/interactive/presentation/annotation.ts @@ -1,6 +1,8 @@ +import { isTextAnnotationOp, type PresentedAnnotationSpec, type RegionAnnotationSpec } from '../../core/interaction-contracts'; import type { AnnotationCandidate, AnnotationConnection, + ChartUpdate, ChartUpdatePresenter, InteractionContext, SemanticElement, @@ -9,10 +11,7 @@ import type { export function annotationCandidates( ...connections: readonly AnnotationConnection[] ): readonly AnnotationCandidate[] { - return connections.map((connection, priority) => ({ - connection, - priority, - })); + return connections.map((connection) => ({ connection })); } export function valueEndAnnotationCandidates( @@ -20,8 +19,8 @@ export function valueEndAnnotationCandidates( ...fallbacks: readonly AnnotationConnection[] ): readonly AnnotationCandidate[] { return [ - { connection: 'value-end', valueAxis, priority: 0 }, - ...fallbacks.map((connection, index) => ({ connection, priority: index + 1 })), + { connection: 'value-end', valueAxis }, + ...fallbacks.map((connection) => ({ connection })), ]; } @@ -32,12 +31,8 @@ export function lollipopAnnotationCandidates( ? ['right', 'left'] : ['top', 'bottom']; return [ - { connection: 'value-end', valueAxis, anglePreference: 'oblique', priority: 0 }, - ...sideConnections.map((connection, index) => ({ - connection, - anglePreference: 'oblique' as const, - priority: index + 1, - })), + { connection: 'value-end', valueAxis }, + ...sideConnections.map((connection) => ({ connection })), ]; } @@ -48,10 +43,10 @@ export function barAnnotationCandidates( ? ['top', 'bottom'] : ['right', 'left']; return [ - { connection: 'value-end', valueAxis, priority: 0 }, - { connection: 'value-side', valueAxis, crossSide: 'start', valueInset: 1 / 8, priority: 1 }, - { connection: 'value-side', valueAxis, crossSide: 'end', valueInset: 1 / 8, priority: 1 }, - ...crossAxisEdges.map((connection) => ({ connection, priority: 2 })), + { connection: 'value-end', valueAxis }, + { connection: 'value-side', valueAxis, crossSide: 'start', valueInset: 1 / 8 }, + { connection: 'value-side', valueAxis, crossSide: 'end', valueInset: 1 / 8 }, + ...crossAxisEdges.map((connection) => ({ connection })), ]; } @@ -70,7 +65,7 @@ export function presentAnnotationUpdate( return (update, context) => ({ id: update.id, ops: update.ops.flatMap((op) => { - if (op.op !== 'set-annotation' || op.value === null || 'select' in op.target) return op; + if (!isTextAnnotationOp(op) || op.value === null || 'select' in op.target) return op; const element = op.target.elements[0]; if (!element) return []; const presentation = presentAnnotation( @@ -78,26 +73,67 @@ export function presentAnnotationUpdate( context, op.value.anchor === 'point' ? { ...op.target.visual, kind: 'mark' } : op.target.visual, ); + // An empty text is a cue with no caption; an absent one is the chart's own wording. const text = op.value.text ?? formatAnnotation(element, context, op.target.visual); - if (!text) return []; - return { - ...op, - value: { - ...op.value, - text, - candidates: Array.isArray(presentation) ? presentation : [presentation], - subject: op.target.visual, - }, + if (text === undefined || (text === '' && op.value.text !== '')) return []; + const value: PresentedAnnotationSpec = { + ...op.value, + text, + candidates: Array.isArray(presentation) ? presentation : [presentation], + subject: op.target.visual, }; + return { ...op, value }; }), }); } export const suppressAnnotationUpdate: ChartUpdatePresenter = (update) => ({ id: update.id, - ops: update.ops.filter((op) => op.op !== 'set-annotation'), + ops: update.ops.filter((op) => !isTextAnnotationOp(op)), }); +/** + * The notes a list of updates sets, each by the fields that name its mark and its text, for a + * compile to make room for them: a note by `select.key`, or on an element with its row. A note + * whose text the chart would write, or set on a `where` selection, is left out. + */ +export function notesOfUpdates(updates: readonly ChartUpdate[] | undefined): { key: Record; text: string }[] { + return (updates ?? []).flatMap((update) => update.ops.flatMap((op) => { + if (!isTextAnnotationOp(op) || !op.value || typeof op.value.text !== 'string' || !op.value.text) return []; + const text = op.value.text; + if ('select' in op.target) return 'key' in op.target.select && op.target.select.key ? [{ key: { ...op.target.select.key }, text }] : []; + const record = op.target.elements[0]?.records?.[0]; + return record && typeof record === 'object' ? [{ key: { ...(record as Record) }, text }] : []; + })); +} + +/** The enclosures a list of updates sets, for a compile to make room for their outlines (`AssembleOptions.enclosures`). */ +export function enclosuresOfUpdates(updates: readonly ChartUpdate[] | undefined): { targets: readonly unknown[] }[] { + return (updates ?? []).flatMap((update) => update.ops.flatMap((op) => op.op === 'annotate-enclosure' && op.value ? [{ targets: op.value.targets }] : [])); +} + +/** The regions a list of updates sets, for a compile to make room for their captions (`AssembleOptions.regions`). */ +/** + * The y values the updates mark across the plot: a reference rule's (an overlay with y and no x) and + * a band's ends (an overlay rect, or a region, with y and no x), for the compile to keep in the axis. + */ +export function referencesOfUpdates(updates: readonly ChartUpdate[] | undefined): number[] { + const numbers = (values: readonly unknown[]) => values.filter((value): value is number => typeof value === 'number' && Number.isFinite(value)); + return (updates ?? []).flatMap((update) => update.ops.flatMap((op) => { + if (op.op === 'set-overlay' && op.value && (op.value.mark === 'rule' || op.value.mark === 'rect')) { + const { y, y2, x } = op.value.encodings ?? {}; + if (!y || x) return []; + return numbers((op.value.data?.values ?? []).flatMap((row) => [row[y.field], ...(y2 ? [row[y2.field]] : [])])); + } + if (op.op === 'annotate-region' && op.value && op.value.y && !op.value.x) return numbers(op.value.y); + return []; + })); +} + +export function regionsOfUpdates(updates: readonly ChartUpdate[] | undefined): RegionAnnotationSpec[] { + return (updates ?? []).flatMap((update) => update.ops.flatMap((op) => op.op === 'annotate-region' && op.value ? [op.value] : [])); +} + // In the chart's locale: Vega labels axes in en-US whatever the browser's. function displayValue(field: string | undefined, value: unknown): string | undefined { if (value === null || value === undefined) return undefined; diff --git a/packages/flint-js/src/interactive/presets/README.md b/packages/flint-js/src/interactive/presets/README.md index b81dd39d..b8bd2d47 100644 --- a/packages/flint-js/src/interactive/presets/README.md +++ b/packages/flint-js/src/interactive/presets/README.md @@ -38,7 +38,7 @@ const legendSelection: CanvasInteractionDef = { op: 'set-style', targets: [event.target], value: { state: 'emphasized' }, }, - { op: 'set-annotation', target: event.target, value: { text: 'Selected series' } }, + { op: 'annotate-text', target: event.target, value: { text: 'Selected series' } }, ], }; }, diff --git a/packages/flint-js/src/interactive/presets/click-annotate.ts b/packages/flint-js/src/interactive/presets/click-annotate.ts index 2076fad8..026f3eba 100644 --- a/packages/flint-js/src/interactive/presets/click-annotate.ts +++ b/packages/flint-js/src/interactive/presets/click-annotate.ts @@ -18,7 +18,7 @@ export function createClickAnnotateInteraction(options: ClickAnnotateOptions = { return { id, ops: [ - { op: 'set-annotation', target: { select: { key: {} } }, value: null }, + { op: 'annotate-text', target: { select: { key: {} } }, value: null }, { op: 'set-style', targets: [], value: { state: 'normal' } }, ], }; @@ -30,7 +30,7 @@ export function createClickAnnotateInteraction(options: ClickAnnotateOptions = { return { id, ops: [{ - op: 'set-annotation', + op: 'annotate-text', target: { visual: event.target.visual, elements: [element] }, value: text === undefined ? {} : { text }, }, ...(emphasis?.ops ?? [])], diff --git a/packages/flint-js/src/interactive/presets/drag-reorder.ts b/packages/flint-js/src/interactive/presets/drag-reorder.ts index 6e93c6d3..c524a5a9 100644 --- a/packages/flint-js/src/interactive/presets/drag-reorder.ts +++ b/packages/flint-js/src/interactive/presets/drag-reorder.ts @@ -1,5 +1,6 @@ import type { CanvasInteractionDef, DragReorderOptions, SemanticElement } from '../interactions'; import { dragTrigger } from '../triggers'; +import { DEFAULT_DIM_OPACITY } from './utils'; function categoryValue(element: SemanticElement | undefined, field: string): unknown { return element?.records?.[0]?.[field] @@ -118,7 +119,7 @@ export function createDragReorderInteraction(options: DragReorderOptions = {}): id, ops: [ { op: 'set-style', targets: mutedTargets, value: { state: 'muted', opacity: 0.35 } }, - { op: 'set-style', targets: sourceTargets, value: { state: 'emphasized', opacity: 1 } }, + { op: 'set-style', targets: sourceTargets, value: { state: 'emphasized', opacity: 1, mutedOpacity: DEFAULT_DIM_OPACITY } }, { op: 'set-freeform-overlay', name: 'drag-reorder-preview', diff --git a/packages/flint-js/src/interactive/presets/legend-dim.ts b/packages/flint-js/src/interactive/presets/legend-dim.ts new file mode 100644 index 00000000..282c5ad4 --- /dev/null +++ b/packages/flint-js/src/interactive/presets/legend-dim.ts @@ -0,0 +1,66 @@ +import type { CanvasInteractionDef, CanvasInteractionEvent, SemanticElement } from '../interactions'; +import type { LegendTargetValue } from '../../core/interaction-contracts'; +import { isActivationAction, semanticElementIdentity } from './utils'; +import { clickTrigger } from '../triggers'; + +/** How far a dimmed group recedes, and how far its legend entry fades. */ +export const LEGEND_DIM_OPACITY = 0.2; +export const LEGEND_DIM_ENTRY_OPACITY = 0.35; + +function legendKey(element: SemanticElement): string { + const legend = element.value as LegendTargetValue; + return legend.channel && legend.domain + ? JSON.stringify([legend.channel, legend.field, legend.domain]) + : semanticElementIdentity(element); +} + +/** Every value of one legend dimmed: nothing then stands out, so the legend starts over. */ +function dimsWholeLegend( + dimmed: readonly SemanticElement[], + legendDomains: Readonly> | undefined, +): boolean { + if (!legendDomains) return false; + return Object.entries(legendDomains).some(([channel, domain]) => + domain.length > 1 && domain.every((value) => dimmed.some((element) => { + const legend = element.value as LegendTargetValue; + return legend.channel === channel && legend.domain?.kind === 'value' && Object.is(legend.domain.value, value); + }))); +} + +function activation(event: CanvasInteractionEvent): boolean { + return isActivationAction(event.action) && event.phase === 'commit'; +} + +/** + * The legend click every chart has: a click on a legend item dims its group and fades the item; + * a second click brings it back. Nothing is hidden, so the axes and scales stay put. Items of + * several legends compose: a mark is dimmed when any of its legend values is. + */ +export function createLegendDimInteraction(options: { id?: string } = {}): CanvasInteractionDef { + const id = options.id ?? 'legend-dim'; + let dimmed: SemanticElement[] = []; + return { + id, + eventSource: clickTrigger, + affordances: { 'legend-item': { cursor: 'activate', hover: 'cohort' } }, + reset: ['escape'], + onReset() { dimmed = []; }, + handle(event, context) { + if (!activation(event)) return null; + const elements = event.target?.elements ?? []; + if (elements.length === 0) return null; + const keys = new Set(elements.map(legendKey)); + const remaining = dimmed.filter((element) => !keys.has(legendKey(element))); + const next = remaining.length === dimmed.length ? [...dimmed, ...elements] : remaining; + dimmed = dimsWholeLegend(next, context.legendDomains) ? [] : next; + return { + id, + ops: [{ + op: 'set-style', + targets: dimmed.length > 0 ? [{ visual: { kind: 'legend', role: 'legend-item' }, elements: dimmed }] : [], + value: { state: 'muted', opacity: LEGEND_DIM_OPACITY, mutedOpacity: LEGEND_DIM_ENTRY_OPACITY }, + }], + }; + }, + }; +} diff --git a/packages/flint-js/src/interactive/spec/admission.ts b/packages/flint-js/src/interactive/spec/admission.ts index 972095a0..e838440c 100644 --- a/packages/flint-js/src/interactive/spec/admission.ts +++ b/packages/flint-js/src/interactive/spec/admission.ts @@ -125,6 +125,8 @@ export function admitInteractions( code: 'unsupported_interaction' | 'conflicting_interactions', message: string, ): false => { + // A baseline behaviour the chart cannot honour is simply not there. + if (interaction.origin === 'baseline') return false; if (interaction.origin !== 'spec') throw new Error(message); warnings.push({ severity: 'warning', code, message: `${message} ${DROPPED}` }); return false; @@ -159,6 +161,18 @@ export function admitInteractions( const shared = firstSharedTrigger(admitted); if (!shared) break; const { trigger, earlier, later } = shared; + // A baseline behaviour gives way to anything asked for, silently: narrowed where it can keep + // the rest, else gone. + const baseline = later.origin === 'baseline' && earlier.origin !== 'baseline' ? later + : earlier.origin === 'baseline' && later.origin !== 'baseline' ? earlier : undefined; + if (baseline) { + const copy = without(baseline, trigger); + const stillShares = copy && triggersOf(copy).some((other) => other.id === trigger.id); + admitted = copy && !stillShares + ? admitted.map((candidate) => (candidate === baseline ? copy : candidate)) + : admitted.filter((candidate) => candidate !== baseline); + continue; + } const narrowed = [earlier, later] .map((interaction) => ({ interaction, copy: without(interaction, trigger) })) .filter(({ copy }) => copy); diff --git a/packages/flint-js/src/interactive/spec/compose.ts b/packages/flint-js/src/interactive/spec/compose.ts index b8e0758f..8a009fc8 100644 --- a/packages/flint-js/src/interactive/spec/compose.ts +++ b/packages/flint-js/src/interactive/spec/compose.ts @@ -7,23 +7,27 @@ import { resolveInteractionSpec } from './resolve'; export interface ComposedInteractiveOptions { /** Spec interactions first, then the code's, with no id shared between the two. */ readonly interactions: readonly InteractionDef[]; - /** From the code only. The spec carries behaviour, not state. */ + /** The spec's (`input.updates`) first, then the code's; a code update with a spec update's id replaces it. */ readonly updates: readonly ChartUpdate[]; readonly assistedTargeting: BuildInteractiveChartOptions['assistedTargeting']; readonly keyboardTargeting: boolean | undefined; + readonly defaults: BuildInteractiveChartOptions['defaults']; /** Warnings known before the mount, such as a spec a static backend ignores. */ readonly warnings: readonly ChartWarning[]; } -type ComposeInput = Pick; +type ComposeInput = Pick; type ComposeOptions = Pick< BuildInteractiveChartOptions, - 'backend' | 'interactions' | 'updates' | 'assistedTargeting' | 'keyboardTargeting' + 'backend' | 'interactions' | 'updates' | 'assistedTargeting' | 'keyboardTargeting' | 'defaults' >; /** * Merge `input.interaction_spec` with what the code passed to `mountChart()`. * + * The spec's updates (`input.updates`) are applied first and the code's after; a code update with + * the id of one of the spec's replaces it. + * * The spec's interactions come first and the code's follow. A code definition * with a spec entry's id replaces that entry, with an `info` warning. The * targeting policies come from the code when it sets them and from the spec @@ -56,9 +60,13 @@ export function composeInteractiveOptions(input: ComposeInput, options: ComposeO } return { interactions: normalizeInteractions([...specInteractions, ...code]), - updates: options.updates ?? [], + updates: [ + ...(input.updates ?? []).filter((update) => !(options.updates ?? []).some((own) => own.id === update.id)), + ...(options.updates ?? []), + ], assistedTargeting: options.assistedTargeting ?? resolved.surface.assistedTargeting, keyboardTargeting: options.keyboardTargeting ?? resolved.surface.keyboardTargeting, + defaults: options.defaults ?? resolved.surface.defaults, warnings, }; } diff --git a/packages/flint-js/src/interactive/spec/resolve.ts b/packages/flint-js/src/interactive/spec/resolve.ts index 4c760bd3..3f840079 100644 --- a/packages/flint-js/src/interactive/spec/resolve.ts +++ b/packages/flint-js/src/interactive/spec/resolve.ts @@ -11,7 +11,7 @@ import { INTERACTION_RESET_GESTURES, isResetGesture } from '../reset'; export interface ResolvedInteractionSpec { /** Definitions in spec order, each tagged `origin: 'spec'`; `filter-controls` is the one external definition. */ readonly interactions: readonly InteractionDef[]; - readonly surface: Pick; + readonly surface: Pick; } const EMPTY: ResolvedInteractionSpec = Object.freeze({ @@ -19,7 +19,7 @@ const EMPTY: ResolvedInteractionSpec = Object.freeze({ surface: Object.freeze({}), }); -const KNOWN_KEYS = new Set(['interactions', 'assistedTargeting', 'keyboardTargeting']); +const KNOWN_KEYS = new Set(['interactions', 'assistedTargeting', 'keyboardTargeting', 'defaults']); const RETIRED_KEYS: Record = { dismiss: 'put a "reset" list on each interaction instead', updates: 'state arrives through the surface (applyUpdate, setUpdates, dispatch), not the spec', @@ -49,6 +49,12 @@ export function resolveInteractionSpec(spec: InteractionSpec | undefined): Resol const hint = RETIRED_KEYS[key]; throw new Error(`interaction_spec: unknown key "${key}"${hint ? `; ${hint}` : ''}.`); } + const defaults = spec.defaults; + if (defaults !== undefined && typeof defaults !== 'boolean' && !(defaults && typeof defaults === 'object' + && !Array.isArray(defaults) && Object.entries(defaults).every(([key, value]) => + ['tooltip', 'legend'].includes(key) && typeof value === 'boolean'))) { + throw new Error('interaction_spec.defaults must be true, false, or { tooltip?, legend? } of booleans.'); + } if (!Array.isArray(spec.interactions)) { throw new Error('interaction_spec.interactions must be an array of preset entries.'); } @@ -127,6 +133,7 @@ export function resolveInteractionSpec(spec: InteractionSpec | undefined): Resol surface: { ...(spec.assistedTargeting !== undefined ? { assistedTargeting: spec.assistedTargeting } : {}), ...(spec.keyboardTargeting !== undefined ? { keyboardTargeting: spec.keyboardTargeting } : {}), + ...(defaults !== undefined ? { defaults } : {}), }, }; } diff --git a/packages/flint-js/src/interactive/surface.ts b/packages/flint-js/src/interactive/surface.ts index 110d79e6..cc4e5c89 100644 --- a/packages/flint-js/src/interactive/surface.ts +++ b/packages/flint-js/src/interactive/surface.ts @@ -1,4 +1,5 @@ import type { CategoryViewport, ChartAssemblyInput, ChartWarning } from '../core/types'; +import { RAIL_ROW_GAP, RAIL_THICKNESS } from './viewport-rail'; import type { InteractiveChartSurface, InteractiveChartSurfaceOptions, @@ -20,9 +21,7 @@ function nextChartId(): string { return `flint-chart-${generatedChartId}`; } -const RAIL_THICKNESS = 6; const RAIL_GAP = 9; -const RAIL_ROW_GAP = 6; const RAIL_TRACK_COLOR = 'rgba(31, 41, 55, 0.035)'; const RAIL_THUMB_COLOR = 'rgba(31, 41, 55, 0.16)'; const RAIL_THUMB_ACTIVE_COLOR = 'rgba(31, 41, 55, 0.3)'; @@ -329,6 +328,14 @@ export function mountInteractiveChartSurface( state[viewport.channel] = 0; const rail = createViewportRail(viewport, 0, (start) => setViewport(viewport.channel, start)); rails.set(viewport.channel, rail); + const railTop = viewport.channel === 'x' ? mounted.getViewportGeometry?.('x')?.railTop : undefined; + if (railTop !== undefined) { + // The chart keeps room for the rail under its axis, above the source line at its foot. + if (getComputedStyle(chart).position === 'static') chart.style.position = 'relative'; + applyStyles(rail.element, { position: 'absolute', left: '0', top: `${railTop}px` }); + chart.append(rail.element); + continue; + } if (viewport.channel === 'x') { rail.element.style.gridColumn = '1'; rail.element.style.gridRow = '2'; @@ -346,6 +353,9 @@ export function mountInteractiveChartSurface( const xGeometry = renderer?.getViewportGeometry?.('x'); const yGeometry = renderer?.getViewportGeometry?.('y'); rails.get('x')?.setGeometry(xGeometry?.offset ?? 0, xGeometry?.extent ?? extent.width); + if (xGeometry?.railTop !== undefined && rails.get('x')?.element.parentElement === chart) { + rails.get('x')!.element.style.top = `${xGeometry.railTop}px`; + } rails.get('y')?.setGeometry(yGeometry?.offset ?? 0, yGeometry?.extent ?? extent.height); // Sizing to content keeps the surface honest when the chart is wider than its host. root.style.width = 'max-content'; diff --git a/packages/flint-js/src/interactive/types.ts b/packages/flint-js/src/interactive/types.ts index 1e487e5f..f81e2212 100644 --- a/packages/flint-js/src/interactive/types.ts +++ b/packages/flint-js/src/interactive/types.ts @@ -2,8 +2,10 @@ import type { CategoryViewport, ChartAssemblyInput, ChartWarning } from '../core import type { ChartState, FlintInteractionEventDetail, InteractionContext, InteractionDef, SemanticTarget } from './interactions'; import type { CanvasInteractionAction, CanvasInteractionEvent } from './language/events'; import type { ChartUpdate, ChartUpdateResult } from './language/updates'; -import type { AssistedTargetingOptions } from '../core/interaction-spec'; +import type { AssistedTargetingOptions, InteractionDefaults } from '../core/interaction-spec'; import type { InteractionResetGesture } from './reset'; +import type { VegaInteractiveRendererOptions } from '../vegalite/interactive'; +import type { EChartsInteractiveRendererOptions } from '../echarts/interactive'; export type { AssistedTargetingOptions, @@ -17,6 +19,11 @@ export type ViewportState = Partial>; export interface ViewportGeometry { offset: number; extent: number; + /** + * Where the chart keeps room for a horizontal rail inside its own drawing, in px from its top: + * under the axis, above a source line at the foot. Undefined: the rail goes below the chart. + */ + railTop?: number; } export type ChartUpdateComposition = 'auto'; @@ -128,12 +135,32 @@ export interface InteractiveChartSurfaceOptions { /** Presets assist by default; false disables it and maxDistance overrides eligible presets. */ assistedTargeting?: boolean | AssistedTargetingOptions; keyboardTargeting?: boolean; + /** The baseline every chart has: a nearest-mark tooltip, a legend click that dims, a dense chart's zoom. Defaults to on. */ + defaults?: InteractionDefaults; /** Warnings known before the mount; the surface reports them with the mount's own. */ warnings?: readonly ChartWarning[]; } export type InteractiveBackend = 'vegalite' | 'echarts' | 'chartjs' | 'plotly'; +/** + * Each backend's interactive renderer factory, as `flint-chart//interactive` exports it + * (`createVegaInteractiveRenderer`, `createEChartsInteractiveRenderer`, + * `createChartjsInteractiveRenderer`, `createPlotlyInteractiveRenderer`). A factory given here is + * used in place of the one the entry would load, so an app bundles only the backends it imports. + */ +export interface InteractiveRenderers { + vegalite?: (options?: VegaInteractiveRendererOptions) => InteractiveRendererAdapter; + echarts?: (options?: EChartsInteractiveRendererOptions) => InteractiveRendererAdapter; + chartjs?: () => InteractiveRendererAdapter; + plotly?: () => InteractiveRendererAdapter; +} + +/** How an entry loads each backend's renderer factory when the host passes none. */ +export type InteractiveRendererLoaders = { + [B in InteractiveBackend]?: () => Promise>; +}; + export interface BuildInteractiveChartOptions extends InteractiveChartSurfaceOptions { backend: InteractiveBackend; renderer?: 'canvas' | 'svg'; @@ -150,6 +177,12 @@ export interface BuildInteractiveChartOptions extends InteractiveChartSurfaceOpt * ceiling on the sides given, so the chart lays out for that room. */ availableSize?: { width?: number; height?: number }; + /** + * Renderer factories to draw with, by backend, in place of the ones the entry loads. With + * `flint-chart/react/` (or `flint-chart/interactive/`) only that backend is + * loaded; pass another here to draw with it too. + */ + renderers?: InteractiveRenderers; } export interface InteractiveChartSurface { diff --git a/packages/flint-js/src/interactive/vegalite.ts b/packages/flint-js/src/interactive/vegalite.ts new file mode 100644 index 00000000..abb24ad0 --- /dev/null +++ b/packages/flint-js/src/interactive/vegalite.ts @@ -0,0 +1,23 @@ +import type { ChartAssemblyInput } from '../core/types'; +import { mountChartWith } from './mount'; +import type { BuildInteractiveChartOptions, InteractiveChartSurface } from './types'; + +export * from './exports'; + +/** + * Mounts a chart with Vega-Lite only, so a bundler resolves no other backend: the app installs + * vega, vega-lite and vega-tooltip and nothing else. Another backend draws where `options.renderers` gives its factory. + */ +export function mountChart( + container: HTMLElement, + input: ChartAssemblyInput, + options: BuildInteractiveChartOptions, +): InteractiveChartSurface { + return mountChartWith( + { vegalite: () => import('../vegalite/interactive').then((m) => m.createVegaInteractiveRenderer) }, + container, input, options, + ); +} + +/** The former name of `mountChart`. */ +export const buildInteractiveChart = mountChart; diff --git a/packages/flint-js/src/interactive/viewport-rail.ts b/packages/flint-js/src/interactive/viewport-rail.ts new file mode 100644 index 00000000..1a8d2e8a --- /dev/null +++ b/packages/flint-js/src/interactive/viewport-rail.ts @@ -0,0 +1,4 @@ +/** A category rail's track thickness, in px. */ +export const RAIL_THICKNESS = 6; +/** The space between a horizontal rail and the chart above it, in px. */ +export const RAIL_ROW_GAP = 6; diff --git a/packages/flint-js/src/plotly/assemble.ts b/packages/flint-js/src/plotly/assemble.ts index a8431c8c..ff505458 100644 --- a/packages/flint-js/src/plotly/assemble.ts +++ b/packages/flint-js/src/plotly/assemble.ts @@ -27,6 +27,7 @@ * This module has NO React, Redux, or UI framework dependencies. */ +import { noteSpecUpdates } from '../core/spec-updates'; import { authoredColorScale, withEncodingColorAnnotations } from '../core/color-controls'; import { applyAuthoredColorScalePlotly } from './color-controls'; import { @@ -42,20 +43,24 @@ import { applyAggregation, resolveImplicitAggregation } from '../core/aggregate' import { applyPivot, applyTransform, type PivotSurface, type TransformSurface } from '../core/pivot'; import { plGetTemplateDef } from './templates'; import { resolveChannelSemantics, convertTemporalData, repairEncodingSorts } from '../core/resolve-semantics'; -import { computeZeroDecision } from '../core/semantic-types'; +import { computeZeroDecision, zeroMarkType } from '../core/semantic-types'; import { filterOverflow } from '../core/filter-overflow'; import { computeLayout, computeChannelBudgets, deriveStretchCaps, planBandLabels, resolveBaseSize, resolveFacetColumnsOption } from '../core/compute-layout'; import { decideColorMaps } from '../core/color-decisions'; import { bandedSpan, plApplyBandLabels, plApplyCartesianAxisSpacing, plApplyLayoutToSpec, plApplyTooltips, plApplyAxisProperties } from './instantiate-spec'; -import { plCombineFacetPanels, niceBounds, type PlotlyFacetPanel } from './facet'; +import { plCombineFacetPanels, plFacetTimeTicks, plLayoutFacetGrid, niceBounds, type PlotlyFacetPanel } from './facet'; import { normalizeStaticSeries } from '../core/static-series'; import { normalizeChartProperties } from '../core/normalize-properties'; import { analysisReadsProperty } from '../core/analyze'; -import { groundTheme, resolveChartDefaults, resolveCompileDefaults, resolveThemeFontSize } from '../core/theme/ground'; +import { groundTheme, resolveChartDefaults, resolveCompileDefaults } from '../core/theme/ground'; +import { themedBandLabelOptions, xLabelOverflow } from '../core/plan'; +import { tableTextMeasurer } from '../core/text-width'; +import { BACKEND_MIN_LABEL_SIZE, BACKEND_TITLE_FLOOR, canvasFitSummary, fitBox, judgeBackendCanvas, refitCanvas, scaledTypeSize, treatedKeyFontSize, withTreatment } from '../core/backend-frame'; +import { PLOTLY_FONT, plDrawLargestFirst, plDropEmptyTitles, plFitPie, plFlowRowKey, plNiceAxes, plSizeKey, plFacetFurniture, plMeasure, plWriteHeader, plWriteSource, PLOTLY_FACET_GAP } from './frame'; import { resolveThemeSpec } from '../core/theme/presets'; -import { withChrome } from '../core/theme/chrome'; +import { chartChrome, withChrome } from '../core/theme/chrome'; import { - realizeThemePlotly, realizeValueLabelsPlotly, plCollectMarkTypes, plCollectPositional, fitPlotlyTitle, + plFloatingFloor, realizeThemePlotly, realizeValueLabelsPlotly, plCollectMarkTypes, plCollectPositional, fitPlotlyTitle, } from './theme'; // --------------------------------------------------------------------------- @@ -102,7 +107,7 @@ export function assemblePlotly(input: ChartAssemblyInput): any { const semanticTypes = withEncodingColorAnnotations(input.semantic_types ?? {}, input.chart_spec.encodings as Record); // `theme_spec` may name a house Flint ships rather than spell one out. // A chart may turn off part of its house's chrome (a logo, the header, the footer). - const themeSpec = withChrome(resolveThemeSpec(input.theme_spec), input.chart_spec.chrome); + const themeSpec = withChrome(resolveThemeSpec(input.theme_spec), chartChrome(input.chart_spec.chartType, input.chart_spec.chrome)); // A house may prefer a size, a stretch budget, a facet gap. Those settle // before anything is measured, and in a fixed order: the chart spec first, // the theme's presets under it, flint's own defaults under that. @@ -197,7 +202,7 @@ export function assemblePlotly(input: ChartAssemblyInput): any { ); // Finalize zero-baseline (requires template mark knowledge) - const effectiveMarkType = templateMarkType || 'point'; + const effectiveMarkType = zeroMarkType(chartTemplate.chart, templateMarkType); for (const [channel, cs] of Object.entries(channelSemantics)) { if ((channel === 'x' || channel === 'y') && cs.type === 'quantitative') { const numericValues = data @@ -225,9 +230,10 @@ export function assemblePlotly(input: ChartAssemblyInput): any { // matching Plotly's official low-cardinality bar style, but cap it so one // or two bars don't span the whole canvas. maxBandSize: 100, - // Plotly native font defaults (ticks/legend 12, axis titles 14). - baseLabelFontSize: 12, - baseTitleFontSize: 14, + // Plotly native font defaults (ticks/legend 12, axis titles 14), a size down where the + // canvas fit sets the type smaller. + baseLabelFontSize: scaledTypeSize(12, input.options?.canvasTreatment?.labelScale, BACKEND_MIN_LABEL_SIZE), + baseTitleFontSize: scaledTypeSize(14, input.options?.canvasTreatment?.labelScale, BACKEND_MIN_LABEL_SIZE + 1), ...options, ...(declaration.paramOverrides || {}), }; @@ -244,6 +250,12 @@ export function assemblePlotly(input: ChartAssemblyInput): any { effectiveOptions.bandStepFitCapacityX = sizeCeiling?.width ?? baseSize.width; effectiveOptions.bandStepFitCapacityY = sizeCeiling?.height ?? baseSize.height; effectiveOptions.facetColumns = resolveFacetColumnsOption(input.chart_spec.chartProperties); + // The furniture a facet grid keeps around its panels, as Plotly draws it, so the grid is planned + // into the room its panels have: y labels, their run and title on the left; x labels and title below. + if (channelSemantics.column?.field || channelSemantics.row?.field) { + effectiveOptions.facetFixedPadding ??= plFacetFurniture(effectiveOptions.baseLabelFontSize ?? 12, effectiveOptions.baseTitleFontSize ?? 14); + effectiveOptions.facetGap ??= PLOTLY_FACET_GAP; + } const { addTooltips: addTooltipsOpt = false, @@ -322,11 +334,22 @@ export function assemblePlotly(input: ChartAssemblyInput): any { }), }; if (chartType !== 'Bar Table') { - planBandLabels(instantiateContext, { - fontSize: themeSpec - ? resolveThemeFontSize(themeSpec, themeSpec.type?.axisLabel?.size, 10, layoutResult.subplotWidth || canvasSize.width) - : undefined, - }); + // A house's names are planned as Vega-Lite plans them; Plotly's own, in the face Plotly draws. + const bandOptions = themeSpec + ? themedBandLabelOptions(themeSpec, chartProperties, channelSemantics, layoutResult.subplotWidth || canvasSize.width) + : { + measure: (fontSize: number) => tableTextMeasurer(fontSize, PLOTLY_FONT, 'normal', 'normal'), + minFontSize: BACKEND_MIN_LABEL_SIZE, + ...xLabelOverflow(undefined, chartProperties, channelSemantics), + }; + // A house draws every axis's names at its own size; names the plan leaves alone are measured there too. + if ('fontSize' in bandOptions && bandOptions.fontSize) { + for (const sizing of [layoutResult.xLabel, layoutResult.yLabel]) if (sizing) sizing.fontSize = bandOptions.fontSize; + } + planBandLabels(instantiateContext, bandOptions); + // The names are cut in the face they were planned in. + const measure = bandOptions.measure; + if (measure) instantiateContext.measureText = (text, fontSize) => measure(fontSize)(text); } const colField = channelSemantics.column?.field; @@ -452,16 +475,23 @@ export function assemblePlotly(input: ChartAssemblyInput): any { ), }); + applyFieldDisplayNames(figure, input.field_display_names); // Apply the shared label rotation / wrapping / font decisions to every panel axis. + const measureText = instantiateContext.measureText; plApplyBandLabels(figure, layoutResult, { temporal: (channel) => channelSemantics[channel]?.type === 'temporal', + ...(measureText ? { measure: (fontSize: number) => (text: string) => measureText(text, fontSize) } : {}), }); plApplyCartesianAxisSpacing(figure); plApplyAxisProperties(figure, instantiateContext); + // The grid laid out around its labels and headers as Plotly draws them. + plLayoutFacetGrid(figure, measureText ? (fontSize) => (text) => measureText(text, fontSize) : plMeasure); if (addTooltipsOpt) plApplyTooltips(figure); } else { figure = structuredClone(chartTemplate.template); chartTemplate.instantiate(figure, instantiateContext); + // Names are printed as the reader sees them before the layout measures them. + applyFieldDisplayNames(figure, input.field_display_names); plApplyLayoutToSpec(figure, instantiateContext, warnings); plApplyAxisProperties(figure, instantiateContext); if (addTooltipsOpt) plApplyTooltips(figure); @@ -521,6 +551,15 @@ export function assemblePlotly(input: ChartAssemblyInput): any { labelOverflow: chartProperties?.labelOverflow, }); + // A pie whose names would crowd it out, or whose callouts would move the furniture hung from it, + // names its slices in a key: in the house's row where it fits there, else beside the pie. + const houseRow = Boolean(themeSpec) && ['top', 'bottom'].includes(String((design.legend as any)?.orient ?? design.legend?.placement)); + const pieKeyed = hasFacet ? false : plFitPie(figure, fitBox(baseSize, sizeCeiling, input.options?.maxStretch), { + anchored: Boolean(themeSpec) || Boolean(sourceOfSpec(input.chart_spec)), + row: houseRow && design.legend?.show !== false, + sliceNames: (chartProperties as Record | undefined)?.sliceNames as string | undefined, + }); + if (themeSpec) { // These are semantic inputs to realization, not persistent Plotly // properties. Sparklines never carry dots; theme-default line points @@ -530,6 +569,57 @@ export function assemblePlotly(input: ChartAssemblyInput): any { figure._themeDefaultLinePoints = chartTemplate.chart === 'Line Chart' && input.chart_spec.chartProperties?.showPoints == null && chartProperties?.showPoints === true; + // A canvas fit that sets the type smaller does so in the house's axes and title too. + const typeScale = input.options?.canvasTreatment; + if (typeScale?.labelScale) { + for (const channel of ['x', 'y'] as const) { + const axis = design.axes[channel]; + if (!axis) continue; + design.axes[channel] = { + ...axis, + label: { ...axis.label, fontSize: scaledTypeSize(axis.label.fontSize ?? 11, typeScale.labelScale, BACKEND_MIN_LABEL_SIZE) }, + title: { ...axis.title, fontSize: scaledTypeSize(axis.title.fontSize ?? 11, typeScale.labelScale, BACKEND_MIN_LABEL_SIZE) }, + }; + } + } + if (typeScale?.titleScale) { + const { headline, deck } = design.title; + design.title = { + ...design.title, + headline: { ...headline, fontSize: scaledTypeSize(headline.fontSize ?? 16, typeScale.titleScale, BACKEND_TITLE_FLOOR.headline) }, + deck: { ...deck, fontSize: scaledTypeSize(deck.fontSize ?? 12, typeScale.titleScale, BACKEND_TITLE_FLOOR.deck) }, + }; + } + // A canvas fit that sets the keys' text smaller does so in the house's key too. + if (input.options?.canvasTreatment?.keyScale && design.legend) { + const label = design.legend.label; + const title = design.legend.titleText; + design.legend = { + ...design.legend, + label: { ...label, fontSize: treatedKeyFontSize(label.fontSize ?? 11, input.options) }, + titleText: { ...title, fontSize: treatedKeyFontSize(title.fontSize ?? 11, input.options) }, + } as typeof design.legend; + } + // A canvas fit that stands the keys beside the plot overrides the house's row above or below it; + // so does a pie, which is square: a key in rows above it makes the drawing tall. + if ((input.options?.canvasTreatment?.keys === 'side' || pieKeyed === 'side') && design.legend?.show) { + design.legend = { ...design.legend, placement: 'right', orient: 'right', direction: 'vertical' } as typeof design.legend; + } + // A house that sets the key above or below the plot leaves the room kept for it beside the plot + // unused: it is given back before the theme lays the axes out in the width that remains. + const room = figure._legendRoom?.right ?? 0; + const placement = (design.legend as { placement?: string; orient?: string } | undefined); + const keyAboveOrBelow = ['top', 'bottom'].includes(String(placement?.orient ?? placement?.placement)); + if (room > 0 && keyAboveOrBelow && Number(figure.layout?.width) > room) { + figure.layout.width -= room; + figure._legendRoom = { ...figure._legendRoom, right: 0 }; + } + // A house that titles its key names the field the key is for; Plotly's templates leave it untitled. + const keyed = channelSemantics.color?.field ?? channelSemantics.group?.field; + if (design.legend?.title && keyed && figure.layout?.legend && !figure.layout.legend.title?.text) { + figure.layout.legend.title = { ...(figure.layout.legend.title ?? {}), text: input.field_display_names?.[keyed] ?? keyed }; + } + figure._titleRoom = fitBox(baseSize, sizeCeiling, input.options?.maxStretch).width; const realizeReport = realizeThemePlotly(figure, design, values); delete figure._suppressLinePoints; delete figure._themeDefaultLinePoints; @@ -540,8 +630,34 @@ export function assemblePlotly(input: ChartAssemblyInput): any { }; } else { realizeValueLabelsPlotly(figure, design, values); + figure._titleRoom = fitBox(baseSize, sizeCeiling, input.options?.maxStretch).width; + // Plotly's own 17 px headline, a step down where the canvas fit sets the type smaller. + const titleScale = input.options?.canvasTreatment?.titleScale; + if (titleScale && figure.layout?.title && typeof figure.layout.title === 'object') { + const size = Number(figure.layout.title.font?.size) || 17; + figure.layout.title.font = { ...(figure.layout.title.font ?? {}), size: scaledTypeSize(size, titleScale, BACKEND_TITLE_FLOOR.headline) }; + } fitPlotlyTitle(figure); } + plDropEmptyTitles(figure.layout); + // A key in rows flows, each entry its own width. + plFlowRowKey(figure); + // Bubbles drawn largest first, so the small ones stay in sight: after theming, which inks the + // series in their order. + plDrawLargestFirst(figure); + // Plotly draws no key to a size channel: one is drawn beside the chart's other key. + const sizeField = channelSemantics.size?.field; + if (sizeField && !hasFacet) plSizeKey(figure, input.field_display_names?.[sizeField] ?? sizeField); + for (const trace of figure.data ?? []) { delete trace?._sizeValues; delete trace?._sizeField; } + // Each continuous axis starts and ends on a labelled tick, as Vega-Lite's nice domains do. + plNiceAxes(figure); + // With the ranges final: a line along a floor that is not zero claims no base. + if (themeSpec) plFloatingFloor(figure, design); + // A facet panel's years, ticked across the width the panel is drawn at. + plFacetTimeTicks(figure); + // The house's header over the title, and its source line at the foot. + if (themeSpec) plWriteHeader(figure, design, (input.chart_spec as any).label); + plWriteSource(figure, design, (input.chart_spec as any).source); // ═══════════════════════════════════════════════════════════════════════ // RESULT @@ -561,6 +677,41 @@ export function assemblePlotly(input: ChartAssemblyInput): any { figure._height = figure.layout.height; } + // The canvas fit: the figure judged against its box from the margins it keeps; where the host + // would shrink it past legibility, the plot is laid out smaller once, if that reads better. + if (figure._plot && Number(figure.layout?.width) > 0 && Number(figure.layout?.height) > 0) { + const m = figure.layout.margin ?? {}; + const room = figure._legendRoom ?? { right: 0, bottom: 0 }; + const topKey = Number(figure._topKey) || 0; + const right = (m.r ?? 0) + room.right; + const plot = { + width: Math.max(1, figure.layout.width - (m.l ?? 0) - right), + height: Math.max(1, figure.layout.height - (m.t ?? 0) - (m.b ?? 0)), + }; + const box = fitBox(baseSize, sizeCeiling, input.options?.maxStretch); + const judged = judgeBackendCanvas({ + plot, designed: figure._plot, padding: 0, box, base: baseSize, + parts: { + yLabels: m.l ?? 0, xLabels: (m.b ?? 0) - room.bottom, title: (m.t ?? 0) - topKey, sideKeys: right, + ...(room.bottom + topKey ? { stackedKeys: room.bottom + topKey } : {}), + }, + }); + const refit = refitCanvas(judged, input.options, (treatment) => assemblePlotly(withTreatment(input, treatment, box))); + if (refit) return refit; + figure._canvasFit = canvasFitSummary(judged.estimate, box, input.options?.canvasTreatment); + } + // The plot the frame planned, for tools that compare it with what Plotly draws. + if (figure._plot) figure._planned = { plot: { width: Math.round(figure._plot.width), height: Math.round(figure._plot.height) } }; + delete figure._plot; + delete figure._legendRoom; + delete figure._topKey; + delete figure._titleRoom; + delete figure._facetTicked; + for (const [key, axis] of Object.entries(figure.layout ?? {})) { + if (/^[xy]axis\d*$/.test(key) && axis) { delete axis._framedTicks; delete axis._yearTicks; } + } + delete figure._keyNames; + // The author's colour controls win over every default. const authoredColor = authoredColorScale(input.chart_spec.encodings as Record); if (authoredColor) applyAuthoredColorScalePlotly(figure, authoredColor); @@ -583,9 +734,7 @@ export function assemblePlotly(input: ChartAssemblyInput): any { figure._pivot = legacyPivot.surface; } - applyFieldDisplayNames(figure, input.field_display_names); - - return figure; + return noteSpecUpdates(figure, input); } /** Inspect the Plotly legacy (composed) view transformation surface for an input. */export function getPlotlyPivot(input: ChartAssemblyInput): PivotSurface | undefined { @@ -613,3 +762,9 @@ function resolvePlValueLabelChoice( if (typeof choice === 'boolean') return choice ? 'on' : 'off'; return chartProperties?.showTextLabels === true ? 'on' : undefined; } + +/** The source line the spec gives, if any. */ +function sourceOfSpec(spec: any): unknown { + const source = spec?.source; + return typeof source === 'string' ? source.trim() : source?.text; +} diff --git a/packages/flint-js/src/plotly/facet.ts b/packages/flint-js/src/plotly/facet.ts index 555472fa..026bee41 100644 --- a/packages/flint-js/src/plotly/facet.ts +++ b/packages/flint-js/src/plotly/facet.ts @@ -15,6 +15,12 @@ * - one legend entry per series (deduped across panels via legendgroup) */ +import { PLOTLY_PROFILE, AXIS_TITLE_STANDOFF } from './profile'; +import { cutToWidth } from '../core/backend-frame'; +import { tableTextMeasurer } from '../core/text-width'; +import { PLOTLY_FONT } from './profile'; +import { PLOTLY_FACET_GAP, plAxisTitleRoom, plKeyBlock, plLabelDepth, plTickRun, plYTickTexts } from './frame'; + /** One instantiated facet cell. */ export interface PlotlyFacetPanel { rowIndex: number; @@ -52,7 +58,7 @@ export function niceBounds(min: number, max: number, targetTicks = 5): { min: nu }; } -const FACET_GAP_PX = 16; +const FACET_GAP_PX = PLOTLY_FACET_GAP; const COL_HEADER_H = 22; const ROW_HEADER_W = 28; const MARGIN = { l: 64, r: 24, t: 16, b: 48 }; @@ -126,6 +132,7 @@ export function plCombineFacetPanels( figure.layout.width = totalW; figure.layout.height = totalH; + const cells: FacetCell[] = []; const seenLegend = new Set(); let seenColorScale = false; let scaleMin = Infinity; @@ -190,7 +197,16 @@ export function plCombineFacetPanels( yAxis.showticklabels = false; delete yAxis.title; } - if (ri < rows - 1) delete xAxis.title; + // A panel with another below it in its column leaves the x labels and title to that one, + // where the axis runs continuous and so can share its range. + const below = panels.some((p) => p.colIndex === ci && p.rowIndex === ri + 1); + const banded = xAxis.type === 'category' || Array.isArray(xAxis.categoryarray); + if (below) { + delete xAxis.title; + if (!banded) xAxis.showticklabels = false; + } + if (!banded && n > 1) xAxis.matches = 'x'; + cells.push({ ri, ci, xName, yName, below, banded }); figure.layout[xName] = xAxis; figure.layout[yName] = yAxis; @@ -249,6 +265,7 @@ export function plCombineFacetPanels( y: 1 - yFrac(yTopPx - COL_HEADER_H / 2), xanchor: 'center', yanchor: 'middle', font: { size: 12 }, + _facetHeader: { kind: 'column', ri, ci }, }); } @@ -263,6 +280,7 @@ export function plCombineFacetPanels( y: (y0 + y1) / 2, xanchor: 'center', yanchor: 'middle', font: { size: 12 }, + _facetHeader: { kind: 'row', ri, ci }, }); } } @@ -271,5 +289,279 @@ export function plCombineFacetPanels( figure.layout.showlegend = false; } + // Stacked rows share one y title, as one measure runs down them all: repeated, each would run + // past its own panel into the next. + if (rows > 1) { + const first = cells.find((c) => c.ci === 0); + const yTitle = first ? figure.layout[first.yName]?.title : undefined; + const text = typeof yTitle === 'string' ? yTitle : yTitle?.text; + for (const cell of cells) delete figure.layout[cell.yName]?.title; + if (text && String(text).trim()) { + figure.layout.annotations.push({ + text: String(text), showarrow: false, textangle: -90, + xref: 'paper', yref: 'paper', x: 0, y: 0.5, xanchor: 'center', yanchor: 'middle', + font: { size: (typeof yTitle === 'object' && yTitle?.font?.size) || 14 }, + _facetAxisTitle: 'y', + }); + } + } + // Columns side by side share one x title, centred under the grid: repeated, a title longer + // than its panel runs into the next one's. + if (cols > 1) { + const last = cells.find((c) => !c.below && layoutTitleText(figure.layout[c.xName]?.title)); + const xTitle = last ? figure.layout[last.xName].title : undefined; + for (const cell of cells) delete figure.layout[cell.xName]?.title; + if (xTitle) { + figure.layout.annotations.push({ + text: layoutTitleText(xTitle), showarrow: false, + xref: 'paper', yref: 'paper', x: 0.5, y: 0, xanchor: 'center', yanchor: 'top', + font: { size: (typeof xTitle === 'object' && xTitle?.font?.size) || 14 }, + _facetAxisTitle: 'x', + }); + } + } + figure._facetGrid = { rows, cols, panelWidth, panelHeight, cells, hasColHeader, hasRowHeader, colHeaderPerRow, showLegend } satisfies FacetGrid; return figure; } + +function layoutTitleText(title: any): string { + const text = typeof title === 'string' ? title : title?.text; + return typeof text === 'string' ? text.trim() : ''; +} + +interface FacetCell { ri: number; ci: number; xName: string; yName: string; below: boolean; banded: boolean } +interface FacetGrid { + rows: number; cols: number; panelWidth: number; panelHeight: number; cells: FacetCell[]; + hasColHeader: boolean; hasRowHeader: boolean; colHeaderPerRow: boolean; showLegend: boolean; +} + +/** + * Lay the grid out around what it draws, once its labels are set ({@link PLOTLY_PROFILE}): the y + * labels, their tick run and the shared title left of the first column; the x labels and title under + * each column's last panel; a header band over each row of headers; rows apart by the x labels a row + * shows (a banded axis names every panel's bands) and the gap; columns apart by the gap; row headers + * and the key on the right. Times along x are thinned to round, flat ticks the panel's width holds. + * Panels keep their planned size; the figure is the grid and its margins. + */ +export function plLayoutFacetGrid(figure: any, measure: (fontSize: number) => (text: string) => number): void { + const grid: FacetGrid | undefined = figure?._facetGrid; + const layout = figure?.layout; + if (!grid || !layout) return; + delete figure._facetGrid; + figure._facetTicked = true; + const { rows, cols, panelWidth, panelHeight, cells } = grid; + const pad = PLOTLY_PROFILE.axisPad; + // Rows keep apart the y labels that stand at their panels' ends, half a line past each. + const firstY = layout[cells.find((c) => c.ci === 0)?.yName ?? 'yaxis']; + const rowGap = Math.max(FACET_GAP_PX, Math.ceil((Number(firstY?.tickfont?.size) || 12) * PLOTLY_PROFILE.labelBoxHeight) + 4); + + // Values down y: as many round ticks as a panel's height holds, shared by every panel, the range + // rounded out to the step so it starts and ends on a labelled tick, as Vega-Lite's nice domain does. + const yKeys = cells.map((c) => c.yName).filter((k) => layout[k] && layout[k].type !== 'category' && layout[k].type !== 'log'); + const yValues: number[] = []; + for (const trace of figure.data ?? []) { + if (trace?.orientation === 'h') continue; + for (const v of trace?.y ?? []) { const n = Number(v); if (v != null && v !== '' && Number.isFinite(n)) yValues.push(n); } + } + if (yKeys.length && yValues.length > 1) { + const first = layout[yKeys[0]]; + const fontSize = Number(first.tickfont?.size) || 12; + const stated = Array.isArray(first.range) ? first.range.map(Number) : undefined; + const lo = Math.min(...yValues, ...(stated && stated[0] <= 0 ? [stated[0]] : [])); + const hi = Math.max(...yValues); + if (hi > lo) { + const count = Math.max(2, Math.min(8, Math.floor(panelHeight / Math.max(28, fontSize * 2.6)))); + const step = niceStep(lo, hi, count); + const range = [Math.floor(lo / step) * step, Math.ceil(hi / step) * step]; + for (const k of yKeys) { + Object.assign(layout[k], { range, autorange: false, tick0: 0, dtick: step, _framedTicks: true }); + delete layout[k].nticks; + } + } + } + + // Times along x: as many round ticks as the panel holds flat. + let overhang = 0; + for (const cell of cells) { + const ax = layout[cell.xName]; + if (!ax || cell.banded) continue; + const size = Number(ax.tickfont?.size) || 12; + const sample = measure(size)('2000'); + if (ax.type === 'date' || isDateAxis(figure, cell)) { + // Provisional: the ticks are set from the panel's drawn width once the figure's width is + // final ({@link plFacetTimeTicks}). + ax.nticks = Math.max(2, Math.floor(panelWidth / (sample * 2.2))); + ax.tickangle = 0; + ax._framedTicks = true; + } + // A continuous axis may label its ends, half a label past each edge of the panel. + if (ax.showticklabels !== false) overhang = Math.max(overhang, sample); + } + // Panels side by side that both label their ends keep those labels apart. + const gap = cols > 1 && overhang > 0 ? Math.max(FACET_GAP_PX, Math.ceil(overhang) + 6) : FACET_GAP_PX; + + const headerFont = (kind: 'column' | 'row') => Number((layout.annotations ?? []).find((a: any) => a?._facetHeader?.kind === kind)?.font?.size) || 12; + const headerBand = grid.hasColHeader ? Math.ceil(headerFont('column') * PLOTLY_PROFILE.labelBoxHeight) + 6 : 0; + const rowHeaderWidth = grid.hasRowHeader ? Math.ceil(headerFont('row') * PLOTLY_PROFILE.labelBoxHeight) + 8 : 0; + const xDepth = (cell: FacetCell): number => { + const ax = layout[cell.xName]; + if (!ax || ax.showticklabels === false) return 0; + const size = Number(ax.tickfont?.size) || 12; + const texts: string[] = Array.isArray(ax.ticktext) ? ax.ticktext.map(String) : Array.isArray(ax.categoryarray) ? ax.categoryarray.map(String) : ['2000']; + const angle = Math.abs(Number(ax.tickangle) || 0) * Math.PI / 180; + const labels = angle > 0 + ? Math.max(0, ...texts.flatMap((t) => t.split('
')).map(measure(size))) * Math.sin(angle) + size * Math.cos(angle) + : plLabelDepth(Math.max(1, ...texts.map((t) => t.split('
').length)), size); + return Math.ceil(labels + plTickRun(ax)); + }; + // The labels a row shows under its panels, and the title under a column's last panel. + const rowFoot = (ri: number) => Math.max(0, ...cells.filter((c) => c.ri === ri && c.below).map(xDepth)); + const sharedX = (layout.annotations ?? []).find((a: any) => a?._facetAxisTitle === 'x'); + const sharedXRoom = sharedX ? Math.ceil(AXIS_TITLE_STANDOFF + (Number(sharedX.font?.size) || 14) * 1.2) : 0; + const bottomFoot = Math.max(0, ...cells.filter((c) => !c.below).map((c) => xDepth(c) + (sharedX ? sharedXRoom : plAxisTitleRoom(layout[c.xName])))); + const lastLabels = Math.max(0, ...cells.filter((c) => !c.below).map(xDepth)); + + // Rows top-down, in px from the grid's top. + const headerRows = grid.colHeaderPerRow ? rows : grid.hasColHeader ? 1 : 0; + const rowTop: number[] = []; + let y = 0; + for (let ri = 0; ri < rows; ri++) { + if (grid.colHeaderPerRow || (grid.hasColHeader && ri === 0)) y += headerBand; + rowTop.push(y); + y += panelHeight + (ri < rows - 1 ? rowFoot(ri) + rowGap : 0); + } + const gridHeight = y; + void headerRows; + const gridWidth = cols * panelWidth + (cols - 1) * gap; + + // Left of the first column: the widest y labels, their run and the shared or own title. + const first = layout[cells.find((c) => c.ci === 0)?.yName ?? 'yaxis']; + const ySize = Number(first?.tickfont?.size) || 12; + const yLabels = first && first.showticklabels !== false + ? Math.max(0, ...plYTickTexts({ ...figure, layout: { ...layout, yaxis: first } }).map(measure(ySize))) + plTickRun(first) + : 0; + const sharedTitle = (layout.annotations ?? []).find((a: any) => a?._facetAxisTitle === 'y'); + const titleSize = Number(sharedTitle?.font?.size) || 14; + const yTitle = sharedTitle ? Math.ceil(AXIS_TITLE_STANDOFF + titleSize * 0.7) : plAxisTitleRoom(first); + const left = Math.ceil(pad + yLabels + yTitle); + const right = Math.max(2 * PLOTLY_PROFILE.edge, rowHeaderWidth + PLOTLY_PROFILE.edge); + const bottom = Math.ceil(pad + bottomFoot); + const paperW = gridWidth + rowHeaderWidth; + const top = layout.margin?.t ?? 16; + + for (const cell of cells) { + const x0 = cell.ci * (panelWidth + gap); + const domainX: [number, number] = [x0 / paperW, (x0 + panelWidth) / paperW]; + const yTop = rowTop[cell.ri]; + const domainY: [number, number] = [1 - (yTop + panelHeight) / gridHeight, 1 - yTop / gridHeight]; + if (layout[cell.xName]) layout[cell.xName].domain = domainX; + if (layout[cell.yName]) layout[cell.yName].domain = domainY; + } + for (const a of layout.annotations ?? []) { + const h = a?._facetHeader; + if (h?.kind === 'column') { + const x0 = h.ci * (panelWidth + gap); + a.x = (x0 + panelWidth / 2) / paperW; + a.y = 1 - (rowTop[h.ri] - headerBand / 2) / gridHeight; + } else if (h?.kind === 'row') { + a.x = (gridWidth + rowHeaderWidth / 2) / paperW; + a.y = 1 - (rowTop[h.ri] + panelHeight / 2) / gridHeight; + } + if (a?._facetAxisTitle === 'x') { + a.x = gridWidth / 2 / paperW; + a.y = -(lastLabels + AXIS_TITLE_STANDOFF) / gridHeight; + } + // A header longer than its panel is cut there, as Vega-Lite cuts it at its label limit. + if (h) { + const size = Number(a.font?.size) || 12; + a.text = cutToWidth(String(a.text ?? ''), h.kind === 'row' ? panelHeight : panelWidth + gap - 4, measure(size)); + } + if (a?._facetAxisTitle === 'y') { + // Centred on the grid's rows, its baseline the standoff past the labels. + a.x = -(yLabels + AXIS_TITLE_STANDOFF + titleSize * 0.35) / paperW; + a.y = 1 - (rowTop[0] + (rowTop[rows - 1] + panelHeight - rowTop[0]) / 2) / gridHeight; + } + } + for (const a of layout.annotations ?? []) { delete a._facetHeader; delete a._facetAxisTitle; } + + const key = grid.showLegend ? plKeyBlock({ ...figure, layout: { ...layout, legend: { ...(layout.legend ?? {}), orientation: 'v' } } }, 'vertical') : undefined; + const keyRoom = key ? key.width + PLOTLY_PROFILE.key.gap + 16 : 0; + layout.margin = { ...(layout.margin ?? {}), l: left, r: right, b: bottom, t: top }; + layout.width = Math.ceil(left + paperW + right + keyRoom); + layout.height = Math.ceil(top + gridHeight + bottom); + figure._width = layout.width; + figure._height = layout.height; +} + +/** The step d3 and Vega tick a span with about `count` ticks: 1, 2 or 5 times a power of ten. */ +function niceStep(lo: number, hi: number, count: number): number { + const raw = (hi - lo) / Math.max(1, count); + const power = 10 ** Math.floor(Math.log10(raw)); + const error = raw / power; + return power * (error >= Math.sqrt(50) ? 10 : error >= Math.sqrt(10) ? 5 : error >= Math.sqrt(2) ? 2 : 1); +} + +/** + * The year ticks of each facet panel's time axis, set from the panel's drawn width once the figure's + * width is final (a title may have widened it past the plan). The rule is Vega-Lite's temporal tick + * plan (`planTemporalTicks`): the finest calendar step at which every label stands apart from the next + * by half of each one's width and a separation of 0.6 em, measured in the face the labels are drawn + * in. Spans under two years keep Plotly's own date ticks. + */ +export function plFacetTimeTicks(figure: any): void { + const layout = figure?.layout; + if (!figure?._facet || !layout) return; + const width = Number(layout.width) || 0; + const margin = layout.margin ?? {}; + const paper = width - (margin.l ?? 0) - (margin.r ?? 0); + for (const [key, ax] of Object.entries(layout)) { + const match = /^xaxis(\d*)$/.exec(key); + if (!match || !ax || ax.type === 'category' || ax.tickvals != null && !ax._yearTicks) continue; + const ref = `x${match[1]}`; + const times: number[] = []; + for (const trace of figure.data ?? []) { + if ((trace?.xaxis ?? 'x') !== ref) continue; + for (const v of trace?.x ?? []) { + const t = typeof v === 'string' && /^\d{4}-\d{2}/.test(v) ? Date.parse(v) : v instanceof Date ? v.getTime() : NaN; + if (Number.isFinite(t)) times.push(t); + } + } + if (times.length < 2) continue; + const start = Math.min(...times); + const end = Math.max(...times); + const y0 = new Date(start).getUTCFullYear(); + const y1 = new Date(end).getUTCFullYear(); + if (y1 - y0 < 2) continue; + const domain = Array.isArray(ax.domain) ? Math.abs(ax.domain[1] - ax.domain[0]) : 1; + const span = paper * domain; + const fontSize = Number(ax.tickfont?.size ?? layout.font?.size) || 12; + const widthOf = tableTextMeasurer(fontSize, ax.tickfont?.family ?? layout.font?.family ?? PLOTLY_FONT, 'normal', 'normal'); + const gap = Math.round(fontSize * 0.6); + const at = (year: number) => (Date.UTC(year, 0, 1) - start) / (end - start) * span; + let chosen: number[] | undefined; + for (const step of [1, 2, 5, 10, 20, 25, 50, 100]) { + const years: number[] = []; + for (let y = Math.ceil(y0 / step) * step; Date.UTC(y, 0, 1) <= end; y += step) if (Date.UTC(y, 0, 1) >= start) years.push(y); + if (!years.length) continue; + const fits = years.every((y, i) => i === 0 || at(y) - at(years[i - 1]) >= (widthOf(String(y)) + widthOf(String(years[i - 1]))) / 2 + gap); + if (fits) { chosen = years; break; } + } + if (!chosen) continue; + Object.assign(ax, { + tickmode: 'array', + tickvals: chosen.map((y) => `${y}-01-01`), + ticktext: chosen.map(String), + tickangle: 0, + _yearTicks: true, + }); + delete ax.nticks; + } +} + +/** Whether a panel's x axis carries times (a date axis Plotly infers from its traces' values). */ +function isDateAxis(figure: any, cell: FacetCell): boolean { + const ref = cell.xName.replace('axis', ''); + const trace = (figure.data ?? []).find((t: any) => (t?.xaxis ?? 'x') === ref); + const first = trace?.x?.find?.((v: unknown) => v != null); + return typeof first === 'string' && /^\d{4}-\d{2}(-\d{2})?/.test(first) || first instanceof Date; +} diff --git a/packages/flint-js/src/plotly/frame.ts b/packages/flint-js/src/plotly/frame.ts new file mode 100644 index 00000000..1be684e8 --- /dev/null +++ b/packages/flint-js/src/plotly/frame.ts @@ -0,0 +1,995 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The frame around a Plotly figure, measured as the layout measures Vega-Lite's but drawn in Plotly's + * idiom: a legend beside the plot (Plotly's default) whose long names stand on lines (`
`), or a + * horizontal legend at the foot where it will not stand beside it; axis titles longer than their axes + * on two lines; many lines thinned. The figure keeps the plot the layout planned; its margins hold + * what is measured around it. + */ + +import type { InstantiateContext } from '../core/types'; +import { tableTextMeasurer } from '../core/text-width'; +import { fitAxisTitle } from '../core/axis-title-fit'; +import { planKeyLayout, type KeyToLayout } from '../core/legend-layout'; +import { denseLineWidth, linesPerPanel } from '../core/line-density'; +import { cutToWidth, valueTickLabels } from '../core/backend-frame'; +import { planSource } from '../core/source-plan'; +import { planHeader } from '../core/header-plan'; +import { roundSample, sizeKeySwatches, SIZE_KEY_SWATCHES } from '../core/legend-plan'; +import { exactFormat, printFormatted } from '../core/sample-format'; +import { keyBlock, keyPlanStyle, type KeyBlock } from '../core/backend-profile'; +import type { DesignDecisions } from '../core/theme/types'; + +import { AXIS_TITLE_STANDOFF, PLOTLY_FONT, PLOTLY_PROFILE } from './profile'; + +export { PLOTLY_FONT }; +/** Plotly's line width, which a trace draws where it sets none. */ +const PLOTLY_LINE_WIDTH = 2; +/** Room Plotly keeps between the plot and a legend beside it, and around the legend. */ +const LEGEND_ROOM = 16; +/** The right margin the layout pass keeps on a cartesian figure without a colour bar. */ +const RIGHT_MARGIN = 2 * PLOTLY_PROFILE.edge; + +export const plMeasure = (fontSize: number, weight: string | number = 'normal') => tableTextMeasurer(fontSize, PLOTLY_FONT, weight, 'normal'); + +/** The traces the legend lists, by Plotly's rule: those that do not opt out, with a name, where the figure shows a legend. */ +function legendTraces(figure: any): any[] { + if (figure.layout?.showlegend === false) return []; + const traces = (figure.data ?? []).filter((t: any) => t && t.showlegend !== false && t.name != null && String(t.name) !== '' && t.type !== 'indicator'); + const pie = (figure.data ?? []).some((t: any) => t?.type === 'pie'); + if (pie) return []; + if (figure.layout?.showlegend !== true && traces.length < 2) return []; + // One entry per legend group. + const seen = new Set(); + return traces.filter((t: any) => { + const key = t.legendgroup ? `g:${t.legendgroup}` : `n:${t.name}`; + if (seen.has(key)) return false; + seen.add(key); + return true; + }); +} + +/** The y axis's tick labels as Plotly prints them, for measuring: names as printed, numbers as its ticks fall. */ +export function plYTickTexts(figure: any): string[] { + const ax = figure.layout?.yaxis; + if (!ax || ax.showticklabels === false) return []; + if (Array.isArray(ax.ticktext)) return ax.ticktext.flatMap((t: unknown) => String(t).split('
')); + if (Array.isArray(ax.categoryarray)) return ax.categoryarray.map(String); + const dates = plDateTickTexts(figure, 'y'); + if (dates) return dates; + const stacked = ['stack', 'relative'].includes(figure.layout?.barmode); + const sums = new Map(); + let lo = Infinity; + let hi = -Infinity; + for (const trace of figure.data ?? []) { + if ((trace?.yaxis ?? 'y') !== 'y' || trace?.orientation === 'h') continue; + (trace?.y ?? []).forEach((v: unknown, i: number) => { + const n = Number(v); + if (!Number.isFinite(n)) return; + lo = Math.min(lo, n); + hi = Math.max(hi, n); + if (stacked) { + const key = String(trace.x?.[i]); + const sum = (sums.get(key) ?? 0) + n; + sums.set(key, sum); + hi = Math.max(hi, sum); + } + }); + } + if (!Number.isFinite(lo)) return []; + const range = Array.isArray(ax.range) ? ax.range.map(Number) : [ax.rangemode === 'tozero' ? Math.min(0, lo) : lo, hi]; + const fmt = (v: number) => (Math.abs(v) >= 10000 ? `${v / 1000}k` : String(Number(v.toPrecision(6)))); + return valueTickLabels([range[0], range[1]], 6, fmt); +} + +/** How deep a row of x labels stands: its first line's box and each further line. */ +export function plLabelDepth(rows: number, fontSize: number): number { + return fontSize * (PLOTLY_PROFILE.labelBoxHeight + Math.max(0, rows - 1) * PLOTLY_PROFILE.labelLineHeight); +} + +/** The room past an axis's labels its title takes: Plotly's standoff, 0.7 em for the first line, a line for each other. */ +export function plAxisTitleRoom(ax: any): number { + const text = typeof ax?.title === 'string' ? ax.title : ax?.title?.text; + if (typeof text !== 'string' || !text.trim()) return 0; + const size = Number(ax.title?.font?.size) || 14; + const lines = text.split('
').length; + return Math.ceil(Number(ax.title?.standoff ?? AXIS_TITLE_STANDOFF) + size * (0.7 + (lines - 1) * PLOTLY_PROFILE.labelLineHeight)); +} + +/** + * An axis whose title was taken away (moved into the deck, hidden) loses the title itself: Plotly's + * automargin keeps a line for a title whose text is empty, and its standoff besides, which grows the + * margin past what was planned and shrinks the plot under everything hung from it. + */ +export function plDropEmptyTitles(layout: any): void { + for (const [key, axis] of Object.entries(layout ?? {})) { + if (!/^[xy]axis\d*$/.test(key) || !axis || axis.title == null) continue; + const text = typeof axis.title === 'string' ? axis.title : axis.title.text; + if (!String(text ?? '').trim()) delete axis.title; + } +} + +/** The px between an axis line and its labels: a drawn tick (Plotly keeps 2.4 px past its length) and the standoff. */ +export function plTickRun(ax: any): number { + return (ax?.ticks ? Number(ax.ticklen ?? 5) + 2.4 : 0) + Number(ax?.ticklabelstandoff ?? 0); +} + +/** The gap between facet panels. */ +export const PLOTLY_FACET_GAP = 16; + +/** + * The room a facet grid keeps around its panels, from the profile: three-figure y labels, their run + * and a title on the left; a line of x labels, their run and a title below. + */ +export function plFacetFurniture(labelSize: number, titleSize: number): { width: number; height: number } { + const p = PLOTLY_PROFILE; + const title = AXIS_TITLE_STANDOFF + titleSize * 0.7; + return { + width: Math.ceil(p.axisPad + p.tickLabelGap + plMeasure(labelSize)('100') + title), + height: Math.ceil(p.axisPad + p.tickLabelGap + labelSize * p.labelBoxHeight + title), + }; +} + +/** Break a name onto lines no wider than `width`, word by word; undefined where it takes more than `most` lines or a word runs past. */ +function wrapName(name: string, width: number, widthOf: (text: string) => number, most = 2): string[] | undefined { + const lines: string[] = []; + let line = ''; + for (const word of name.split(/\s+/).filter(Boolean)) { + const next = line ? `${line} ${word}` : word; + if (widthOf(next) <= width) { line = next; continue; } + if (!line || widthOf(word) > width) return undefined; + lines.push(line); + line = word; + } + if (line) lines.push(line); + return lines.length <= most ? lines : undefined; +} + +/** + * Set a key that stands in a row (above or below the plot) for the row: its names as written, or + * broken onto two lines at the width that lets more of them share a row, whichever makes the key + * shortest as Plotly wraps it ({@link plKeyBlock}); fewer lines where two read the same. Names broken + * for a column beside the plot (`plFitLegend`) are set again from the names as written. + */ +export function plFitRowKey(figure: any): void { + const layout = figure?.layout; + const legend = layout?.legend; + if (!legend || legend.orientation !== 'h' || layout.showlegend === false) return; + // Measured as Plotly will set it: each entry in a group of its own, so the rows flow. + plFlowRowKey(figure); + const original = (name: string) => figure._keyNames?.[name] ?? name.replace(/
/g, ' '); + const traces = (figure.data ?? []).filter((t: any) => t && t.showlegend !== false && t.visible !== false && t.name != null && String(t.name) !== '' && t.type !== 'pie'); + const names = [...new Set(traces.map((t: any) => String(t.name)))] as string[]; + if (names.length < 2) return; + const written = names.map(original); + const fontSize = Number(legend.font?.size) || 12; + const widthOf = tableTextMeasurer(fontSize, legend.font?.family ?? PLOTLY_FONT, 'normal', 'normal'); + const width = Number(layout.width) || 0; + const margin = layout.margin ?? {}; + const plotWidth = Math.max(1, width - (margin.l ?? 0) - (margin.r ?? 0)); + const hungLeft = typeof legend.x === 'number' && legend.x < 0 && legend.xref !== 'container'; + const room = legend.xref === 'container' ? width : plotWidth + (hungLeft ? margin.l ?? 0 : 0); + const { lead, gap } = PLOTLY_PROFILE.key; + // The names as written, and at the width that lets k entries share a row, for each k. + const candidates: string[][][] = [written.map((n) => [n])]; + for (let k = 2; k <= names.length; k++) { + const each = Math.floor((room - (k - 1) * gap) / k) - lead; + if (each < fontSize * 4) break; + const wrapped = written.map((n) => wrapName(n, each, widthOf)); + if (wrapped.every(Boolean)) candidates.push(wrapped as string[][]); + } + let best: { lines: string[][]; height: number; count: number } | undefined; + for (const lines of candidates) { + const block = keyBlock(PLOTLY_PROFILE.key, { entries: lines, fontSize, widthOf, orientation: 'horizontal', room }); + const count = lines.reduce((sum, l) => sum + l.length, 0); + if (!best || block.height < best.height - 2 || (block.height <= best.height + 2 && count < best.count)) best = { lines, height: block.height, count }; + } + if (!best) return; + const set = new Map(names.map((name, i) => [name, best!.lines[i].join('
')])); + for (const trace of figure.data ?? []) { + const now = set.get(String(trace?.name)); + if (now === undefined || now === trace.name) continue; + trace.hoverlabel = { ...(trace.hoverlabel ?? {}), namelength: -1 }; + trace.name = now; + } +} + +/** The step d3 and Vega tick a span with about `count` ticks: 1, 2 or 5 times a power of ten. */ +function tickStep(lo: number, hi: number, count: number): number { + const raw = (hi - lo) / Math.max(1, count); + const power = 10 ** Math.floor(Math.log10(raw)); + const error = raw / power; + return power * (error >= Math.sqrt(50) ? 10 : error >= Math.sqrt(10) ? 5 : error >= Math.sqrt(2) ? 2 : 1); +} + +/** A trace's marker radius at each point, in px, as Plotly sizes it (`sizemode`, `sizeref`). */ +function markerRadii(trace: any, count: number): number[] { + const mode = String(trace?.mode ?? 'markers'); + if (!mode.includes('markers')) return new Array(count).fill(trace?.line?.width ? trace.line.width / 2 : 1); + const marker = trace?.marker ?? {}; + const ref = Number(marker.sizeref) || 1; + const radius = (v: unknown) => { + const size = Number(v); + if (!Number.isFinite(size) || size <= 0) return 3; + return (marker.sizemode === 'area' ? Math.sqrt(size / (2 * ref)) : size / (2 * ref)) + (Number(marker.line?.width) || 0); + }; + return Array.from({ length: count }, (_, i) => radius(Array.isArray(marker.size) ? marker.size[i] : marker.size ?? 6)); +} + +/** Plotly's own short number form for a log axis's labels (2k, 50k, 1M), for measuring them. */ +const siLabel = (v: number) => { + const units: Array<[number, string]> = [[1e9, 'G'], [1e6, 'M'], [1e3, 'k']]; + for (const [n, u] of units) if (Math.abs(v) >= n) return `${Number((v / n).toPrecision(3))}${u}`; + return String(Number(v.toPrecision(3))); +}; + +/** + * Start and end each continuous axis on a labelled tick, as Vega-Lite's `nice` domain does: a linear + * axis Plotly would autorange past its data, to a range rounded out to its tick step (one step more + * where a bubble at the edge would run past it), ticked at that step; a log axis over few decades, + * labelled at 1·2·5 or 1·3 of each decade where those labels fit apart, rather than at the powers + * alone, which can leave its start and end unnamed. Axes a template or house ranged or ticked, banded + * and time axes, and axes bars or areas stand on are left to Plotly. + */ +export function plNiceAxes(figure: any): void { + const layout = figure?.layout; + if (!layout || figure._facet) return; + const width = Number(layout.width) || 0; + const height = Number(layout.height) || 0; + const margin = layout.margin ?? {}; + for (const [key, channel] of [['xaxis', 'x'], ['yaxis', 'y']] as const) { + const ax = layout[key]; + if (!ax || ax.range != null || ax.autorange === 'reversed' || ax.tickvals != null || ax.matches || ax.visible === false) continue; + if (ax.type === 'category' || ax.type === 'date' || ax.type === 'multicategory') continue; + const ref = channel; + const traces = (figure.data ?? []).filter((t: any) => (t?.[`${channel}axis`] ?? ref) === ref && t?.visible !== false); + if (!traces.length || traces.some((t: any) => !['scatter', 'scattergl'].includes(t?.type ?? 'scatter') || t.fill && t.fill !== 'none' || t.stackgroup)) continue; + const points: Array<{ v: number; r: number }> = []; + let numeric = true; + for (const trace of traces) { + const values: unknown[] = Array.isArray(trace[channel]) ? trace[channel] : []; + const radii = markerRadii(trace, values.length); + values.forEach((value, i) => { + if (value == null || value === '') return; + const n = typeof value === 'number' ? value : typeof value === 'string' && value.trim() !== '' && Number.isFinite(Number(value)) ? Number(value) : NaN; + if (!Number.isFinite(n)) { numeric = false; return; } + points.push({ v: n, r: radii[i] }); + }); + } + if (!numeric || points.length < 2) continue; + const span = channel === 'x' ? width - (margin.l ?? 0) - (margin.r ?? 0) : height - (margin.t ?? 0) - (margin.b ?? 0); + if (!(span > 40)) continue; + const fontSize = Number(ax.tickfont?.size) || 12; + const widthOf = plMeasure(fontSize); + + if (ax.type === 'log') { + const positive = points.filter((p) => p.v > 0); + if (positive.length < 2) continue; + const lo = Math.min(...positive.map((p) => p.v)); + const hi = Math.max(...positive.map((p) => p.v)); + const decades = Math.log10(hi / lo); + if (!(decades > 0.3) || decades > 3) continue; + // Plotly pads a log range as it pads a linear one; the decades the axis shows, a little wider. + const perDecade = span / (decades * 1.1); + const label = (v: number) => (channel === 'x' ? widthOf(siLabel(v)) : fontSize * 1.2) + 10; + for (const steps of [[1, 2, 5], [1, 3]]) { + const values: number[] = []; + for (let e = Math.floor(Math.log10(lo)); e <= Math.ceil(Math.log10(hi)); e++) { + for (const m of steps) { + const v = m * 10 ** e; + if (v >= lo / 1.05 && v <= hi * 1.05) values.push(v); + } + } + const fits = values.every((v, i) => i === 0 || Math.log10(v / values[i - 1]) * perDecade >= (label(v) + label(values[i - 1])) / 2); + if (values.length >= 3 && fits) { + ax.tickmode = 'array'; + ax.tickvals = values; + ax.ticktext = values.map(siLabel); + delete ax.dtick; + break; + } + } + continue; + } + + const lo0 = Math.min(...points.map((p) => p.v)); + const hi0 = Math.max(...points.map((p) => p.v)); + const lo = ax.rangemode === 'tozero' ? Math.min(0, lo0) : lo0; + const hi = ax.rangemode === 'tozero' ? Math.max(0, hi0) : hi0; + if (!(hi > lo)) continue; + // As many ticks as the axis holds apart: a label's height down y, its width (and a gap) along x. + const each = channel === 'y' ? Math.max(36, fontSize * 3) : Math.max(...[lo, hi].map((v) => widthOf(String(v)))) + 24; + const count = Math.max(3, Math.min(10, Math.floor(span / each))); + let step = tickStep(lo, hi, count); + let start = Math.floor(lo / step) * step; + let end = Math.ceil(hi / step) * step; + // A bubble at an edge keeps its whole disc in the plot: the range goes a step further. + for (let pass = 0; pass < 3; pass++) { + const perUnit = span / (end - start); + const under = points.some((p) => (p.v - start) * perUnit < p.r); + const over = points.some((p) => (end - p.v) * perUnit < p.r); + if (!under && !over) break; + if (under && !(ax.rangemode === 'tozero' && start === 0 && lo0 >= 0)) start -= step; + if (over && !(ax.rangemode === 'tozero' && end === 0 && hi0 <= 0)) end += step; + } + // Too many ticks after widening: a step twice as wide, rounded out again. + if ((end - start) / step > count + 2) { + step *= 2; + start = Math.floor(start / step) * step; + end = Math.ceil(end / step) * step; + } + ax.range = [start, end]; + ax.autorange = false; + ax.tick0 = 0; + ax.dtick = step; + delete ax.nticks; + } +} + +/** The smallest a pie is drawn across when it gives its key room. */ +const PIE_FLOOR = 200; + +/** + * A pie whose slice names run long beside its radius: standing outside the pie, Plotly's callouts + * push the margins until the pie is a small disc among its names. The names move to a key beside + * the pie (long ones on two lines) and the slices print their share inside, as the plan sets a pie + * with long names. Returns whether it did. + */ +export function plFitPie( + figure: any, box?: { width: number; height: number }, + options: { anchored?: boolean; row?: boolean; sliceNames?: string } = {}, +): 'side' | 'row' | false { + const layout = figure?.layout; + const pies = (figure?.data ?? []).filter((t: any) => t?.type === 'pie' && Array.isArray(t.labels) && t.labels.length > 1); + if (pies.length !== 1 || !layout) return false; + const pie = pies[0]; + const parts = typeof pie.textinfo === 'string' ? pie.textinfo.split('+') : []; + if (!parts.includes('label') || options.sliceNames === 'onSlices') return false; + const width = Number(layout.width ?? figure._width) || 0; + const height = Number(layout.height ?? figure._height) || 0; + const margin = layout.margin ?? {}; + const radius = Math.min(width - (margin.l ?? 0) - (margin.r ?? 0), height - (margin.t ?? 0) - (margin.b ?? 0)) / 2; + if (!(radius > 0)) return false; + const fontSize = Number(pie.textfont?.size ?? layout.font?.size) || 12; + const widthOf = plMeasure(fontSize); + // A name's callout is set on two lines where it runs long: the room it takes is half its width or so. + const twoLine = Math.max(...pie.labels.map((label: unknown) => { + const text = String(label); + const lines = wrapName(text, widthOf(text) / 2 + fontSize * 2, widthOf); + return Math.max(...(lines ?? [text]).map(widthOf)); + })); + // A few callouts, or short ones, stand round the pie; many long ones squeeze it to a disc among them. + const crowded = pie.labels.length >= 5 && twoLine > radius * 0.5; + // A figure that hangs furniture from the plot area (a house's tab or rule, a source line) cannot + // let a callout outside the pie grow the margins under it: Plotly would move the plot, and the + // furniture with it, after it was placed. + const asked = options.sliceNames === 'key'; + if (!asked && !crowded && !(options.anchored && someCalloutOutside(pie, radius, widthOf))) return false; + pie.textinfo = parts.filter((part: string) => part !== 'label').join('+') || 'percent'; + delete pie.texttemplate; + pie.textposition = 'inside'; + pie.automargin = false; + // A share too long for its slice is hidden rather than shrunk past reading. + layout.uniformtext = { minsize: Math.max(9, fontSize - 2), mode: 'hide' }; + const written = [...pie.labels]; + // Each name whole on one line, or on two at the key's width. + const keyWidth = 120; + const keyWidthOf = plMeasure(Number(layout.legend?.font?.size) || 12); + pie.labels = pie.labels.map((label: unknown) => { + const text = String(label); + if (keyWidthOf(text) <= keyWidth) return text; + // A key beside the pie has the height for a third line where a name needs one. + const lines = wrapName(text, keyWidth, keyWidthOf, 3); + return lines ? lines.join('
') : text; + }); + pie.hovertemplate ??= '%{label}
%{percent}'; + layout.showlegend = true; + // A house that keys in a row keeps its row where the names stand in one or two rows across the + // pie: a square pie under a short row stays near square. + if (options.row) { + // In a row the names are set for the row (`plFitRowKey`), from the names as written. + const wrapped = pie.labels; + pie.labels = written; + layout.legend = { ...(layout.legend ?? {}), orientation: 'h' }; + const row = plKeyBlock({ ...figure, layout: { ...layout, margin: { ...margin, l: 0, r: 0 } } }, 'horizontal'); + if (row && row.rows <= 2) { + if (figure._width != null) figure._width = width; + return 'row'; + } + pie.labels = wrapped; + } + layout.legend = { ...(layout.legend ?? {}), orientation: 'v', x: 1.02, xanchor: 'left', y: 1, yanchor: 'top' }; + // The pie draws in a square: width past its height is room only the key can use. The key beside + // it takes its own room from there. + const area = { width: width - (margin.l ?? 0) - (margin.r ?? 0), height: height - (margin.t ?? 0) - (margin.b ?? 0) }; + const spare = Math.max(0, area.width - area.height); + const block = plKeyBlock(figure, 'vertical'); + const room = block ? block.width + PLOTLY_PROFILE.key.gap + PLOTLY_PROFILE.edge : 0; + layout.margin = { ...margin, r: Math.max(margin.r ?? 0, room) }; + const grow = (layout.margin.r ?? 0) - (margin.r ?? 0) - spare; + layout.width = Math.round(width + grow); + // Past its box, the pie gives the key its room: smaller, still square, never below a legible disc. + const side = Math.min(area.width, area.height); + const over = box ? layout.width - box.width : 0; + const shrink = Math.max(0, Math.min(over, side - PIE_FLOOR)); + if (shrink > 0) { + layout.width -= shrink; + layout.height = Math.round(height - shrink); + if (figure._height != null) figure._height = layout.height; + } + if (figure._width != null) figure._width = layout.width; + return 'side'; +} + +/** + * Whether any slice's name and share would stand outside the pie, as Plotly sets text that will not + * fit inside its slice: measured against the slice's width a little inside its rim, on one line or two. + */ +function someCalloutOutside(pie: any, radius: number, widthOf: (text: string) => number): boolean { + const values = (pie.values ?? []).map((v: unknown) => Math.max(0, Number(v) || 0)); + const total = values.reduce((sum: number, v: number) => sum + v, 0); + if (!(total > 0)) return false; + return pie.labels.some((label: unknown, i: number) => { + const share = values[i] / total; + const pct = `${(share * 100).toFixed(1)}%`; + const name = String(label); + const need = Math.min(widthOf(`${name} ${pct}`), Math.max(widthOf(name), widthOf(pct))); + const room = share >= 0.5 ? 1.2 * radius : 2 * 0.62 * radius * Math.sin(Math.PI * share); + return need > room; + }); +} + +/** + * Let a key set in rows (above or below the plot) flow, each entry its own width, rather than stand + * as Plotly's grid at the widest entry's width, where one long name leaves one entry a row. Plotly + * flows a horizontal key whose entries are grouped (`traceorder: 'grouped'`), each group as wide as + * its own entries: each entry is put in a group of its own, with no gap between the groups' rows. + * A key whose groups already hold several entries, or a pie's, is left as it is. + */ +export function plFlowRowKey(figure: any): void { + const layout = figure?.layout; + const legend = layout?.legend; + if (!legend || legend.orientation !== 'h' || layout.showlegend === false) return; + const traces: any[] = figure.data ?? []; + if (traces.some((t) => t?.type === 'pie')) return; + const shown = traces.filter((t) => t && t.showlegend !== false && t.visible !== false && t.name != null && String(t.name) !== ''); + if (shown.length < 2) return; + const perGroup = new Map(); + for (const t of shown) if (t.legendgroup) perGroup.set(t.legendgroup, (perGroup.get(t.legendgroup) ?? 0) + 1); + if ([...perGroup.values()].some((n) => n > 1)) return; + shown.forEach((t, i) => { t.legendgroup ??= `flint-key-${i}`; }); + legend.traceorder = 'grouped'; + legend.tracegroupgap = 0; +} + +/** The first and last instant a channel's values hold where they are dates, and the axis is a time axis. */ +function dateSpan(figure: any, channel: 'x' | 'y'): [number, number] | undefined { + const ax = figure?.layout?.[`${channel}axis`]; + if (!ax || ax.type === 'category' || ax.type === 'linear' || ax.type === 'log' || ax.tickvals != null) return undefined; + let lo = Infinity; + let hi = -Infinity; + for (const trace of figure.data ?? []) { + if ((trace?.[`${channel}axis`] ?? channel) !== channel) continue; + for (const v of trace?.[channel] ?? []) { + const t = typeof v === 'string' && /^\d{4}-\d{2}/.test(v) ? Date.parse(v) : v instanceof Date ? v.getTime() : NaN; + if (!Number.isFinite(t)) { if (v != null && typeof v !== 'string') return undefined; continue; } + lo = Math.min(lo, t); + hi = Math.max(hi, t); + } + } + return hi > lo ? [lo, hi] : undefined; +} + +const DAY = 86_400_000; + +/** + * The widest labels Plotly prints on a time axis, by the span it covers: years ("2024") over a few + * years, months with their year ("Jan 2024") over months, days ("Feb 28") over weeks, times + * ("12:00") within a day; the year (or date) under a day's or time's tick stands on a second line. + * Undefined where the axis is not a time axis. + */ +export function plDateTickTexts(figure: any, channel: 'x' | 'y'): string[] | undefined { + const span = dateSpan(figure, channel); + if (!span) return undefined; + const days = (span[1] - span[0]) / DAY; + if (days > 3 * 365) return ['2024']; + if (days > 90) return ['Sep 2024']; + if (days > 2) return ['Sep 28', '2024']; + return ['12:00', 'Sep 28, 2024']; +} + +/** How many lines a time axis's labels stand on: two where Plotly sets the year or date under days and times. */ +export function plDateLabelRows(figure: any, channel: 'x' | 'y'): number { + const texts = plDateTickTexts(figure, channel); + return texts && texts.length > 1 ? 2 : 1; +} + +/** Px between a size key's swatches, and between a swatch and its value. */ +const SIZE_KEY_GAP = 12; +const SIZE_KEY_LABEL_GAP = 4; + +/** + * Plotly draws no key to a size channel, and its legend caps a symbol at 16 px, so the key is drawn: + * a few round values ({@link roundSample}, as many as the edge holds, {@link sizeKeySwatches}) as + * circles at the size the chart draws them — the drawn diameters fitted back to the values they + * carry, area against value — with their numbers and the field's name, in the house's key type. It + * stands where the chart's other key does: in a row under a key set in rows (above or below the + * plot), else beside the plot under the colour key. The figure grows by its room, so the plot keeps + * its size. Pixel-sized shapes hung from paper coordinates, so the circles stay round. + */ +export function plSizeKey(figure: any, title: string | undefined): void { + const layout = figure?.layout; + if (!layout || figure._facet) return; + const traces = (figure.data ?? []).filter((t: any) => Array.isArray(t?._sizeValues) && Array.isArray(t?.marker?.size)); + if (!traces.length) return; + // The drawn diameters against the values they carry: area runs straight with value. + const pairs: Array<[number, number]> = []; + for (const t of traces) t._sizeValues.forEach((v: number, i: number) => { + const d = Number(t.marker.size[i]); + if (Number.isFinite(v) && Number.isFinite(d) && d > 0) pairs.push([v, Math.PI * (d / 2) ** 2]); + }); + if (pairs.length < 2) return; + const lo = pairs.reduce((a, b) => (b[0] < a[0] ? b : a)); + const hi = pairs.reduce((a, b) => (b[0] > a[0] ? b : a)); + if (!(hi[0] > lo[0])) return; + const slope = (hi[1] - lo[1]) / (hi[0] - lo[0]); + const diameterAt = (v: number) => 2 * Math.sqrt(Math.max(4 * Math.PI, lo[1] + (v - lo[0]) * slope) / Math.PI); + + const width = Number(layout.width) || 0; + const height = Number(layout.height) || 0; + const margin = (layout.margin ??= {}); + // The width kept beside the plot for a key Plotly hangs in its right margin is not the plot's. + const keyRoom = Number(figure._legendRoom?.right) || 0; + const plot = { width: Math.max(1, width - (margin.l ?? 0) - (margin.r ?? 0) - keyRoom), height: Math.max(1, height - (margin.t ?? 0) - (margin.b ?? 0)) }; + const legend = layout.showlegend === false ? undefined : layout.legend; + // A key at the canvas's foot (`yref: 'container'`) stands in rows too. + const atFoot = legend?.orientation === 'h' && legend.yref === 'container'; + const inRows = atFoot || (legend?.orientation === 'h' && typeof legend.y === 'number' && (legend.y > 1 || legend.y < 0)); + const rows = pairs.map(([v]) => ({ v })); + const field = traces[0]._sizeField as string; + const values = roundSample(rows, 'v', sizeKeySwatches(inRows ? 'top' : 'right', plot)); + if (!values) return; + + const fontSize = Number(legend?.font?.size ?? layout.font?.size) || 12; + const family = legend?.font?.family ?? layout.font?.family ?? PLOTLY_FONT; + const color = legend?.font?.color ?? layout.font?.color ?? '#444'; + const widthOf = tableTextMeasurer(fontSize, family, 'normal', 'normal'); + const titleOf = tableTextMeasurer(fontSize, family, 'bold', 'normal'); + const name = title ?? field; + // Each round value printed as it is: 0.0005 stays "0.0005", not "0.001" or "0". + const format = (v: number) => printFormatted(v, exactFormat([v])); + const ink = traces[0].marker?.line; + const outline = ink && Number(ink.width) >= 1 && String(ink.color).toLowerCase() !== '#ffffff' ? { color: ink.color, width: ink.width } : { width: 0 }; + const swatch = { fillcolor: 'rgba(128,128,128,0.5)', line: outline }; + const lineH = Math.ceil(fontSize * 1.3); + const shapes = (layout.shapes ??= []); + const notes = (layout.annotations ??= []); + const px = (x: number) => (x - (margin.l ?? 0)) / plot.width; + const circle = (cx: number, cy: number, d: number) => shapes.push({ + type: 'circle', xref: 'paper', yref: 'paper', xsizemode: 'pixel', ysizemode: 'pixel', + xanchor: px(cx), yanchor: cy, x0: -d / 2, x1: d / 2, y0: -d / 2, y1: d / 2, layer: 'above', ...swatch, + }); + const text = (x: number, y: number, t: string, bold = false, yanchor: 'middle' | 'top' = 'middle') => notes.push({ + text: bold ? `${t}` : t, showarrow: false, xref: 'paper', yref: 'paper', x: px(x), y, xanchor: 'left', yanchor, + font: { family, size: fontSize, color }, + }); + // The title holds its place in px from the top as the figure grows. + const holdTitle = (before: number) => { + const t = layout.title; + if (t && typeof t === 'object' && t.yref === 'container' && Number.isFinite(Number(t.y))) { + t.y = 1 - (1 - Number(t.y)) * before / layout.height; + } + }; + + if (inRows) { + // A row under the key in rows: the field's name, then each value's circle and number. + const diam = values.map(diameterAt); + const rowH = Math.ceil(Math.max(...diam, lineH)) + 6; + const centred = legend.xanchor === 'center'; + const start = (margin.l ?? 0) + Number(legend.x ?? 0) * plot.width + PLOTLY_PROFILE.key.pad.x; + const room = centred ? width - 2 * PLOTLY_PROFILE.edge : width - start - PLOTLY_PROFILE.edge; + let shown = values; + const runOf = (vs: number[]) => titleOf(name) + 10 + vs.reduce((sum, v) => sum + diameterAt(v) + SIZE_KEY_LABEL_GAP + widthOf(format(v)) + SIZE_KEY_GAP, 0) - SIZE_KEY_GAP; + while (shown.length > 2 && runOf(shown) > room) shown = shown.filter((_, i) => i !== Math.floor(shown.length / 2)); + // A key centred under the plot has its row centred with it. + const left = centred ? Math.max(PLOTLY_PROFILE.edge, (margin.l ?? 0) + Number(legend.x ?? 0.5) * plot.width - runOf(shown) / 2) : start; + const key = plKeyBlock(figure); + const keyH = key?.height ?? 0; + const gap = 6; + const before = layout.height; + let centre: number; + if (legend.y > 1) { + const above = (legend.y - 1) * plot.height; + margin.t = (margin.t ?? 0) + rowH + gap; + layout.height = Math.round(before + rowH + gap); + holdTitle(before); + legend.y = 1 + (above + rowH + gap) / plot.height; + centre = 1 + (above - keyH + rowH / 2) / plot.height; + } else if (atFoot) { + // Over the key, which stands on the canvas's foot: the foot grows by the row. + margin.b = (margin.b ?? 0) + rowH + gap; + layout.height = Math.round(before + rowH + gap); + centre = -((margin.b ?? 0) - (keyH + gap + rowH / 2)) / plot.height; + } else { + const below = -legend.y * plot.height; + margin.b = (margin.b ?? 0) + rowH + gap; + layout.height = Math.round(before + rowH + gap); + centre = -(below + keyH + gap + rowH / 2) / plot.height; + } + let x = left; + text(x, centre, name, true); + x += titleOf(name) + 10; + for (const v of shown) { + const d = diameterAt(v); + circle(x + d / 2, centre, d); + text(x + d + SIZE_KEY_LABEL_GAP, centre, format(v)); + x += d + SIZE_KEY_LABEL_GAP + widthOf(format(v)) + SIZE_KEY_GAP; + } + return; + } + + // Beside the plot, under the colour key: the name, then a column of circles and their numbers. + const key = legend ? plKeyBlock(figure, 'vertical') : undefined; + const keyX = typeof legend?.x === 'number' && legend.x >= 1 ? legend.x : 1.02; + const plotRight = (margin.l ?? 0) + plot.width; + const startTop = key ? key.height + 14 : 0; + const columnHeight = (vs: number[]) => lineH + 4 + vs.reduce((sum, v) => sum + Math.max(diameterAt(v), lineH) + 6, 0) - 6; + // As many values as stand in the height the colour key leaves beside the plot, from the field's + // own round sample; never fewer than the three that tell a reader the scale. + let shown = values; + for (let count = values.length - 1; count >= SIZE_KEY_SWATCHES && startTop + columnHeight(shown) > plot.height; count--) { + shown = roundSample(rows, 'v', count) ?? shown.filter((_, i) => i !== Math.floor(shown.length / 2)); + } + // A column that still runs below the plot's foot passes the x axis's labels there: it starts + // clear of the last label's overhang past the plot's right edge. + const runsBelow = startTop + columnHeight(shown) > plot.height; + const overhang = runsBelow ? plXEndOverhang(figure) : 0; + const left = Math.max(plotRight + plot.width * (keyX - 1) + PLOTLY_PROFILE.key.pad.x, plotRight + overhang + (overhang ? SIZE_KEY_GAP : 0)); + const diam = shown.map(diameterAt); + const largest = Math.max(...diam); + // The circles centre where the colour key's swatches do (its symbol room's middle), and the + // numbers start where its names start, so the two keys read as one column. + const swatchCentre = Math.max(left + PLOTLY_PROFILE.key.gap + 15, left + largest / 2); + const textStart = Math.max(left + PLOTLY_PROFILE.key.lead - 3, swatchCentre + largest / 2 + SIZE_KEY_LABEL_GAP); + let top = startTop; + text(left, 1 - top / plot.height, name, true, 'top'); + top += lineH + 4; + shown.forEach((v, i) => { + const h = Math.max(diam[i], lineH); + const cy = 1 - (top + h / 2) / plot.height; + circle(swatchCentre, cy, diam[i]); + text(textStart, cy, format(v)); + top += h + 6; + }); + const columnW = Math.max(titleOf(name), textStart - left + Math.max(...shown.map((v) => widthOf(format(v))))); + // Right of the plot: the room kept for the colour key, widened where the size key runs past it. + const reserved = (margin.r ?? 0) + keyRoom; + const need = Math.ceil(left + columnW + PLOTLY_PROFILE.edge - ((margin.l ?? 0) + plot.width)); + const right = Math.max(reserved, need); + margin.r = right; + if (figure._legendRoom) figure._legendRoom = { ...figure._legendRoom, right: 0 }; + layout.width = Math.round((margin.l ?? 0) + plot.width + right); + // A column that runs past the plot's foot takes the room it needs below it. + const past = top - plot.height - (margin.b ?? 0) + PLOTLY_PROFILE.edge; + if (past > 0) { + margin.b = (margin.b ?? 0) + Math.ceil(past); + layout.height = Math.round(layout.height + Math.ceil(past)); + } +} + +/** + * Text as Plotly measures it, its markup tags (`
`, ``) dropped: a `<` through the next `>`, in + * one pass. Only measured, never written out as markup. + */ +function stripTags(text: string): string { + let out = ''; + let from = 0; + for (let open = text.indexOf('<'); open >= 0; open = text.indexOf('<', from)) { + const close = text.indexOf('>', open + 1); + if (close < 0) break; + if (close === open + 1) { + // `<>` is no tag: kept, and the scan moves past it. + out += text.slice(from, close + 1); + } else out += text.slice(from, open); + from = close + 1; + } + return out + text.slice(from); +} + +/** + * How far the x axis's last label runs past the plot's right edge, in px: half its width, where the + * axis labels its end (a range rounded to its ticks, or Plotly's own ticks over the data); 0 where + * the axis prints no labels or ends on a band. + */ +export function plXEndOverhang(figure: any): number { + const ax = figure?.layout?.xaxis; + if (!ax || ax.visible === false || ax.showticklabels === false || ax.type === 'category') return 0; + const size = Number(ax.tickfont?.size ?? figure.layout?.font?.size) || 12; + const widthOf = tableTextMeasurer(size, ax.tickfont?.family ?? figure.layout?.font?.family ?? PLOTLY_FONT, 'normal', 'normal'); + let last: string | undefined; + if (Array.isArray(ax.ticktext) && ax.ticktext.length) last = String(ax.ticktext[ax.ticktext.length - 1]); + else if (Array.isArray(ax.range) && ax.dtick != null && ax.type !== 'log' && ax.type !== 'date') last = Number(ax.range[1]).toLocaleString('en-US'); + else { + let hi = -Infinity; + for (const t of figure.data ?? []) for (const v of t?.x ?? []) { const n = Number(v); if (Number.isFinite(n)) hi = Math.max(hi, n); } + if (Number.isFinite(hi)) last = valueTickLabels([0, hi], 5).slice(-1)[0]; + } + return last ? Math.ceil(widthOf(stripTags(last)) / 2) : 0; +} + +/** + * Draw bubbles largest first, so a small one laid over a large one stays in sight: each sized trace's + * points sorted by size, descending, and the traces drawn in order of their largest bubble. Plotly + * draws whole traces in order, so a series of large bubbles drawn last would bury another series' + * small ones. The key keeps the series' order (`legendrank`). + */ +export function plDrawLargestFirst(figure: any): void { + const traces: any[] = figure?.data ?? []; + const sized = traces.filter((t) => Array.isArray(t?._sizeValues) && Array.isArray(t?.x)); + if (!sized.length) return; + for (const t of sized) { + const n = t.x.length; + const order = Array.from({ length: n }, (_, i) => i) + .sort((a, b) => (Number(t._sizeValues[b]) || 0) - (Number(t._sizeValues[a]) || 0)); + const permute = (arr: unknown) => (Array.isArray(arr) && arr.length === n ? order.map((i) => arr[i]) : arr); + for (const key of ['x', 'y', 'text', 'hovertext', 'customdata', 'ids', '_sizeValues'] as const) { + if (Array.isArray(t[key])) t[key] = permute(t[key]); + } + if (t.marker) { + for (const key of ['size', 'color', 'symbol', 'opacity'] as const) { + if (Array.isArray(t.marker[key])) t.marker[key] = permute(t.marker[key]); + } + } + } + if (sized.length < 2) return; + traces.forEach((t, i) => { if (t && t.legendrank == null) t.legendrank = 1000 + i; }); + const largest = (t: any) => Math.max(0, ...(t._sizeValues ?? []).map((v: unknown) => Number(v) || 0)); + const rest = traces.filter((t) => !sized.includes(t)); + figure.data = [...[...sized].sort((a, b) => largest(b) - largest(a)), ...rest]; +} + +/** + * The key's box as Plotly will draw it ({@link keyBlock} with {@link PLOTLY_PROFILE}): its entries as + * the figure names them (lines at `
`), in its own font, wrapped across the width Plotly gives a row + * where the key's position puts it — the plot's width, or the plot and its left margin for a row hung + * from the left of the plot. Undefined where the figure shows no key. + */ +export function plKeyBlock(figure: any, orientation?: 'horizontal' | 'vertical'): KeyBlock | undefined { + const layout = figure?.layout ?? {}; + if (layout.showlegend === false) return undefined; + const legend = layout.legend ?? {}; + const names: string[] = []; + const seen = new Set(); + for (const t of figure.data ?? []) { + if (!t || t.showlegend === false || t.visible === false) continue; + if (t.type === 'pie' && Array.isArray(t.labels)) { names.push(...t.labels.map(String)); continue; } + if (t.name == null || String(t.name) === '') continue; + const id = t.legendgroup ? `g:${t.legendgroup}` : `n:${t.name}`; + if (seen.has(id)) continue; + seen.add(id); + names.push(String(t.name)); + } + if (!names.length) return undefined; + const fontSize = Number(legend.font?.size) || 12; + const family = legend.font?.family ?? PLOTLY_FONT; + const widthOf = tableTextMeasurer(fontSize, family, 'normal', 'normal'); + const entries = names.map((name) => name.split('
').map((line) => stripTags(line))); + const titleText = typeof legend.title === 'string' ? legend.title : legend.title?.text; + const titleSize = Number(legend.title?.font?.size) || fontSize; + const title = titleText && stripTags(String(titleText)).trim() + ? { + lines: String(titleText).split('
').map(stripTags), + fontSize: titleSize, + widthOf: tableTextMeasurer(titleSize, legend.title?.font?.family ?? family, //.test(String(titleText)) ? 'bold' : 'normal', 'normal'), + } + : undefined; + const width = Number(layout.width) || 0; + const margin = layout.margin ?? {}; + const plotWidth = Math.max(1, width - (margin.l ?? 0) - (margin.r ?? 0)); + const x = typeof legend.x === 'number' ? legend.x : 1.02; + const hungLeft = x < 0 && (legend.xanchor ?? 'left') === 'left' && legend.xref !== 'container'; + const room = legend.xref === 'container' ? width : plotWidth + (hungLeft ? margin.l ?? 0 : 0); + return keyBlock(PLOTLY_PROFILE.key, { + entries, fontSize, widthOf, orientation: orientation ?? (legend.orientation === 'h' ? 'horizontal' : 'vertical'), room, + ...(title ? { title } : {}), + }); +} + +/** + * Lay the legend out as the layout lays Vega-Lite's keys ({@link planKeyLayout}): beside the plot, as + * Plotly sets it, its long names on lines, or in a row at the foot where it will not stand beside it. + * Returns the room it takes beside or below the plot, or undefined where the figure shows no legend. + */ +export function plFitLegend(figure: any, plot: { width: number; height: number }, sideWidth?: number, moveTo?: 'top' | 'bottom', drawnSize = 12): { right: number; bottom: number } | undefined { + const traces = legendTraces(figure); + if (!traces.length) return undefined; + const legend = (figure.layout.legend ??= {}); + if (legend.orientation === 'h' || (typeof legend.x === 'number' && legend.x < 1)) return undefined; + const fontSize = legend.font?.size ?? drawnSize; + const names: string[] = traces.map((t: any) => String(t.name)); + const title = legend.title?.text ? String(legend.title.text) : null; + const key: KeyToLayout = { + gradient: false, + labels: names, + count: names.length, + title, + style: { + labelFont: PLOTLY_FONT, labelFontSize: fontSize, labelFontWeight: 'normal', labelFontStyle: 'normal', + titleFont: PLOTLY_FONT, titleFontSize: legend.title?.font?.size ?? fontSize, titleFontWeight: 'normal', titleFontStyle: 'normal', + // Plotly's entry, and its side legend in one column, scrolling past its height. + ...keyPlanStyle(PLOTLY_PROFILE.key), + titlePadding: 4, + }, + orient: 'right', + edges: ['right', 'bottom'], + fixed: false, + fixedTitle: true, + ...(moveTo ? { moveTo: 'bottom' } : {}), + }; + const laid = planKeyLayout([key], plot, tableTextMeasurer, sideWidth !== undefined ? { sideWidth } : {}).keys[0]; + if (!laid) return undefined; + const widthOf = plMeasure(fontSize); + const limit = laid.labelLimit > 0 ? laid.labelLimit : undefined; + const bottom = laid.orient === 'bottom' || laid.orient === 'top'; + names.forEach((name, index) => { + const lines = laid.labelLines?.[index] ?? [name]; + // In a row at the foot a name stands on one line, cut only where it would run past the figure. + const text = bottom ? cutToWidth(name, plot.width + 40, widthOf) : lines.map((line) => cutToWidth(line, limit, widthOf)).join('
'); + if (text === name) return; + // Every trace of the entry's group carries the name the legend prints; the hover still names it. + for (const trace of figure.data ?? []) { + if (String(trace?.name) !== name) continue; + trace.hoverlabel = { ...(trace.hoverlabel ?? {}), namelength: -1 }; + trace.name = text; + // The name as written, should the key later stand in a row and need its names set again. + (figure._keyNames ??= {})[text] = name; + } + }); + if (bottom) { + // A horizontal legend at the figure's foot, in rows across the plot's width as Plotly wraps them. + figure.layout.legend = { ...legend, orientation: 'h', x: 0.5, xanchor: 'center', yref: 'container', y: 0, yanchor: 'bottom' }; + const block = keyBlock(PLOTLY_PROFILE.key, { + entries: traces.map((t: any) => String(t.name).split('
')), fontSize, widthOf, orientation: 'horizontal', room: plot.width, + }); + return { right: 0, bottom: block.height + LEGEND_ROOM }; + } + // Plotly sets a legend beside the plot in one column (it scrolls past the plot's height), each entry + // 40 px of item before its widest line, and hangs it in the figure's right margin, which keeps its own room. + const box = keyBlock(PLOTLY_PROFILE.key, { + entries: traces.map((t: any) => String(t.name).split('
')), fontSize, widthOf, orientation: 'vertical', + ...(title ? { title: { lines: [title], fontSize: legend.title?.font?.size ?? fontSize, widthOf } } : {}), + }); + // Plotly keeps a gap after each entry's text; the key hangs in the right margin, which keeps its own room. + return { right: Math.max(0, box.width + PLOTLY_PROFILE.key.gap + 10 + LEGEND_ROOM - RIGHT_MARGIN), bottom: 0 }; +} + +/** + * Fit each axis title to its axis: longer ones on two lines (`
`), the second cut where two will + * not hold it. Returns the extra px each side's titles take past one line. + */ +export function plFitAxisTitles(figure: any, plot: { width: number; height: number }): { x: number; y: number } { + const extra = { x: 0, y: 0 }; + for (const [key, axis] of Object.entries(figure.layout ?? {})) { + const match = /^([xy])axis\d*$/.exec(key); + if (!match || !axis?.title) continue; + const title = typeof axis.title === 'string' ? { text: axis.title } : axis.title; + const text = typeof title.text === 'string' ? title.text.replace(/
/g, ' ') : ''; + if (!text.trim()) continue; + const channel = match[1] as 'x' | 'y'; + const fontSize = title.font?.size ?? 14; + const widthOf = plMeasure(fontSize); + const fit = fitAxisTitle(text, channel === 'x' ? plot.width : plot.height, widthOf, fontSize); + if (!fit) continue; + axis.title = { ...title, text: fit.lines.map((line) => cutToWidth(line, fit.limit, widthOf)).join('
') }; + extra[channel] = Math.max(extra[channel], (fit.lines.length - 1) * fit.lineHeight); + } + return extra; +} + +/** Thin a figure's lines where many share the plot, from Plotly's 2 px. */ +export function plThinLines(figure: any, context: InstantiateContext, plotHeight: number): void { + const lines = (figure.data ?? []).filter((t: any) => (t?.type === 'scatter' || t?.type === 'scattergl') && String(t.mode ?? 'lines').includes('lines')); + if (lines.length < 2) return; + const width = denseLineWidth(PLOTLY_LINE_WIDTH, Math.max(lines.length, linesPerPanel(context.table, context.channelSemantics)), plotHeight); + if (width === undefined) return; + for (const trace of lines) { + if (trace.line?.width != null && trace.line.width !== PLOTLY_LINE_WIDTH) continue; + trace.line = { ...(trace.line ?? {}), width }; + } +} + +/** + * The source line under the chart, as the house sets it ({@link planSource}): its lead-in, words and + * credit as runs, broken to the figure's width, standing from the chart's left (where the title + * starts) or its right edge. Written as annotations in the figure's foot; the figure grows by the + * room the footer takes. + */ +export function plWriteSource(figure: any, design: DesignDecisions, source: string | { text: string; href?: string } | undefined): void { + const layout = figure?.layout; + const width = Number(layout?.width); + const height = Number(layout?.height); + if (!source || !(width > 0) || !(height > 0)) return; + const titleX = typeof layout.title === 'object' && layout.title?.xref === 'container' && layout.title.xanchor === 'left' ? Number(layout.title.x) : undefined; + const left = titleX !== undefined && Number.isFinite(titleX) ? titleX * width : 8; + const plan = planSource({ design, source, block: width - left - 8, measure: tableTextMeasurer }); + if (!plan) return; + const margin = (layout.margin ??= {}); + margin.b = (margin.b ?? 0) + plan.room; + layout.height = Math.round(height + plan.room); + const font = { family: plan.font ?? design.font ?? PLOTLY_FONT, size: plan.fontSize, ...(plan.color ? { color: plan.color } : {}) }; + const annotations = layout.annotations ?? []; + for (const line of plan.lines) { + const text = line.runs.map((run) => { + let t = run.text; + if (run.fontWeight === 'bold' || (typeof run.fontWeight === 'number' && run.fontWeight >= 600)) t = `${t}`; + if (run.fontStyle === 'italic') t = `${t}`; + return t; + }).join(' '); + const start = line.align === 'start'; + annotations.push({ + text: line.href ? `${text}` : text, + showarrow: false, + xref: 'paper', yref: 'paper', + // Positioned in px from the figure's corners, as the plan measures them. + x: (start ? left - (margin.l ?? 0) : width - 8 - (margin.l ?? 0)) / Math.max(1, width - (margin.l ?? 0) - (margin.r ?? 0)), + xanchor: start ? 'left' : 'right', + y: -((margin.b ?? 0) - line.bottom - plan.lineHeight) / Math.max(1, layout.height - (margin.t ?? 0) - (margin.b ?? 0)), + yanchor: 'top', + align: start ? 'left' : 'right', + font, + }); + } + layout.annotations = annotations; +} + +/** + * The house's header, as the core plans it ({@link planHeader}): tabs, bands and rules on the canvas's + * top edge and pieces on the line above the headline, drawn as shapes and annotations; the figure + * grows by their room and the title moves down under them. + */ +export function plWriteHeader(figure: any, design: DesignDecisions, label: string | undefined): void { + const layout = figure?.layout; + const width = Number(layout?.width); + const height = Number(layout?.height); + if (!(width > 0) || !(height > 0)) return; + const title = typeof layout.title === 'object' ? layout.title : undefined; + const anchor: 'start' | 'middle' | 'end' = title?.xanchor === 'left' ? 'start' : title?.xanchor === 'right' ? 'end' : 'middle'; + const left = anchor === 'start' && Number.isFinite(Number(title?.x)) ? Number(title.x) * width : 8; + const header = planHeader({ design, ...(label ? { label } : {}), block: width - left - 8, titleAnchor: anchor, measure: tableTextMeasurer }); + if (!header || !header.pieces.length) return; + const extra = header.edge + header.line; + const margin = (layout.margin ??= {}); + const titleTop = title && Number.isFinite(Number(title.y)) ? (1 - Number(title.y)) * height : 8; + margin.t = (margin.t ?? 0) + extra; + layout.height = Math.round(height + extra); + if (title) title.y = 1 - (titleTop + extra) / layout.height; + const plotWidth = Math.max(1, width - (margin.l ?? 0) - (margin.r ?? 0)); + const plotHeight = Math.max(1, layout.height - margin.t - (margin.b ?? 0)); + const px = (x: number) => (x - (margin.l ?? 0)) / plotWidth; + const py = (y: number) => 1 + (margin.t - y) / plotHeight; + const shapes = layout.shapes ?? []; + const annotations = layout.annotations ?? []; + for (const piece of header.pieces) { + const frameStart = piece.frame === 'canvas' ? 0 : left; + const frameEnd = piece.frame === 'canvas' ? width : width - 8; + const zoneTop = piece.zone === 'canvasTop' ? 0 : header.edge; + const top = zoneTop + piece.dy; + const w = piece.align === 'span' ? frameEnd - frameStart : piece.width ?? 0; + const x0 = piece.align === 'end' ? frameEnd - piece.offset - w + : piece.align === 'middle' ? (frameStart + frameEnd - w) / 2 : frameStart + piece.offset; + if (piece.kind === 'rect') { + shapes.push({ type: 'rect', xref: 'paper', yref: 'paper', x0: px(x0), x1: px(x0 + w), y0: py(top + piece.height), y1: py(top), fillcolor: piece.color ?? '#000', line: { width: 0 }, layer: 'above' }); + } else if (piece.kind === 'text' && piece.text) { + const bold = piece.fontWeight === 'bold' || Number(piece.fontWeight) >= 600; + annotations.push({ + text: bold ? `${piece.text}` : piece.text, showarrow: false, xref: 'paper', yref: 'paper', + x: px(x0), xanchor: 'left', y: py(top), yanchor: 'top', + font: { family: piece.font ?? design.font ?? PLOTLY_FONT, size: piece.fontSize ?? 11, ...(piece.color ? { color: piece.color } : {}) }, + }); + } + } + layout.shapes = shapes; + layout.annotations = annotations; +} diff --git a/packages/flint-js/src/plotly/instantiate-spec.ts b/packages/flint-js/src/plotly/instantiate-spec.ts index a0b0e5fd..0bacc78b 100644 --- a/packages/flint-js/src/plotly/instantiate-spec.ts +++ b/packages/flint-js/src/plotly/instantiate-spec.ts @@ -20,22 +20,18 @@ * ============================================================================= */ +import { plAxisTitleRoom, plDateLabelRows, plTickRun, plFitAxisTitles, plFitLegend, plLabelDepth, plMeasure, plThinLines, plYTickTexts } from './frame'; +import { cutToWidth, treatedKeyEdge, treatedKeyFontSize, treatedKeySide, valueTickLabels } from '../core/backend-frame'; import type { InstantiateContext, LayoutResult, ChartWarning, } from '../core/types'; -const AXIS_TITLE_STANDOFF = 16; -// Plotly places tick labels ~1px from the axis by default — much tighter than -// the other renderers (ECharts axisLabel.margin 8, Vega-Lite labelPadding+tick -// ~7). Nudge them out to a comparable, comfortable gap. `ticklabelstandoff` is -// the purpose-built property (Plotly ≥ 2.34 / 3.x); harmlessly ignored on older -// builds, which keeps the current behavior rather than regressing. -const TICK_LABEL_STANDOFF = 7; - -/** Average glyph width as a share of the font size, as the layout pass estimates it. */ -const GLYPH = 0.62; +// Plotly places tick labels ~1px from the axis by default — much tighter than the other renderers; +// the profile nudges them out (`ticklabelstandoff`, Plotly ≥ 2.34) and sets the title's standoff. +import { AXIS_TITLE_STANDOFF, PLOTLY_PROFILE, TICK_LABEL_STANDOFF } from './profile'; +import { calendarLabels, widestLines } from '../core/calendar-labels'; /** The plot length a banded axis takes: one step per band, as Vega-Lite's `{ step }` width gives it. */ export function bandedSpan(context: InstantiateContext, channel: 'x' | 'y'): number | undefined { @@ -49,10 +45,9 @@ export function bandedSpan(context: InstantiateContext, channel: 'x' | 'y'): num return count > 0 ? (channel === 'x' ? layout.xStep : layout.yStep) * count : undefined; } -function clipLabel(text: string, limit: number, fontSize: number): string { - const glyph = fontSize * GLYPH; - if (!(limit > 0) || text.length * glyph <= limit) return text; - return `${text.slice(0, Math.max(1, Math.floor(limit / glyph) - 1)).trimEnd()}…`; +function clipLabel(text: string, limit: number, widthOf: (text: string) => number): string { + if (!(limit > 0) || !Number.isFinite(limit)) return text; + return cutToWidth(text, limit, widthOf); } /** @@ -63,8 +58,13 @@ function clipLabel(text: string, limit: number, fontSize: number): string { export function plApplyBandLabels( figure: any, layout: LayoutResult, - options: { fit?: boolean; temporal?: (channel: 'x' | 'y') => boolean } = {}, + options: { + fit?: boolean; temporal?: (channel: 'x' | 'y') => boolean; + /** How wide a name is in the face it was planned in; Plotly's own face where not given. */ + measure?: (fontSize: number) => (text: string) => number; + } = {}, ): void { + const measure = options.measure ?? plMeasure; for (const [key, ax] of Object.entries(figure.layout ?? {})) { const match = /^([xy])axis\d*$/.exec(key); if (!match || !ax || typeof ax !== 'object') continue; @@ -80,16 +80,26 @@ export function plApplyBandLabels( let angle = sizing.labelAngle; // Names the layout set straight but that overrun their band stand on end. if (match[1] === 'x' && banded && !angle && !sizing.labelLines && layout.xStep > 0) { - const widest = Math.max(...ax.categoryarray.map((name: unknown) => - Math.min(String(name).length * fontSize * GLYPH, limit))); + const widthOf = measure(fontSize); + const widest = Math.max(...ax.categoryarray.map((name: unknown) => Math.min(widthOf(String(name)), limit))); if (widest + 4 > layout.xStep) angle = -90; } + // Dates in bands are named as a calendar names them (`Jan` over `2025`, `Feb`, …), flat, as + // Vega-Lite's time axis names them; every few bands where even those will not stand in one. + // Only where the dates are a regular run the calendar names (months, days), not one-off dates. + if (match[1] === 'x' && banded && ax.tickvals == null && layout.xStep > 0 && regularRun(ax.categoryarray.map(String))) { + const named = calendarBandLabels(ax.categoryarray.map(String), layout.xStep, measure(fontSize), fontSize); + if (named) { + Object.assign(ax, { tickmode: 'array', tickvals: named.values, ticktext: named.text, tickangle: 0 }); + continue; + } + } if (match[1] === 'x' && (banded || angle != null)) ax.tickangle = angle ?? 0; if (!banded || ax.tickvals != null) continue; const lines = new Map((sizing.labelValues ?? []).map((value, index) => [value, sizing.labelLines?.[index]])); const names = ax.categoryarray.map(String); const text = names.map((name: string) => (lines.get(name) ?? [name]) - .map((line) => clipLabel(line, limit, fontSize)).join('
')); + .map((line) => clipLabel(line, limit, measure(fontSize))).join('
')); if (text.every((label: string, index: number) => label === names[index])) continue; ax.tickmode = 'array'; ax.tickvals = ax.categoryarray; @@ -97,36 +107,126 @@ export function plApplyBandLabels( } } +/** Whether dates are a sorted run at one step (each month, or each day): a calendar names those in order. */ +function regularRun(values: string[]): boolean { + const times = values.map((v) => Date.parse(v.length === 7 ? `${v}-01` : v)); + if (times.some((t) => !Number.isFinite(t)) || times.length < 3) return false; + const days = times.slice(1).map((t, i) => (t - times[i]) / 86_400_000); + if (days.some((d) => d <= 0)) return false; + const monthly = values.every((v) => /^\d{4}-\d{2}(-01)?$/.test(v)); + if (monthly) return days.every((d) => d >= 28 && d <= 31); + return days.every((d) => Math.abs(d - days[0]) < 0.5); +} + +/** + * Calendar names for a banded axis of dates whose names as written would not stand flat in their + * bands ({@link calendarLabels}): each band its month (or day), the first of each year with the year + * under it. Where those still will not stand in one band, every k-th band is named, k the fewest + * that hold the widest name and a gap, the bands that open a year named first so every year shows. + * Undefined where the values are not dates or stand flat as written. + */ +function calendarBandLabels(values: string[], band: number, widthOf: (text: string) => number, fontSize: number): { values: string[]; text: string[] } | undefined { + const calendar = calendarLabels(values); + if (!calendar) return undefined; + const gap = Math.max(6, fontSize / 2); + if (Math.max(0, ...values.map(widthOf)) + gap <= band) return undefined; + const widest = widestLines(calendar, widthOf) + gap; + const stride = Math.max(1, Math.ceil(widest / band)); + const picked: number[] = []; + calendar.forEach((lines, i) => { + const opensYear = lines.length > 1; + const last = picked[picked.length - 1]; + if (last !== undefined && i - last < stride) { + // A year's opening band takes the place of the band before it, so the year is named. + if (opensYear && !(calendar[last].length > 1)) picked[picked.length - 1] = i; + return; + } + if (stride === 1 || i % stride === 0 || opensYear) picked.push(i); + }); + // The first named band of each year states the year. + let year: string | undefined; + const text = picked.map((i) => { + const lines = calendar[i]; + const own = lines.length > 1 ? lines[1] : String(values[i]).slice(0, 4); + const out = own !== year && lines.length === 1 ? [lines[0], own] : lines; + year = own; + return out.join('
'); + }); + return { values: picked.map((i) => values[i]), text }; +} + /** The widest label line an axis prints, capped at its limit, and how many lines a label takes. */ -function labelExtent(ax: any, sizing: LayoutResult['xLabel'] | undefined): { width: number; rows: number } | undefined { +function labelExtent(ax: any, sizing: LayoutResult['xLabel'] | undefined, measure: (fontSize: number) => (text: string) => number = plMeasure): { width: number; rows: number } | undefined { const texts = Array.isArray(ax?.ticktext) ? ax.ticktext : Array.isArray(ax?.categoryarray) ? ax.categoryarray : undefined; if (!texts) return undefined; const fontSize = sizing?.fontSize ?? 10; const lines = texts.map((text: unknown) => String(text).split('
')); + const widthOf = measure(fontSize); return { - width: Math.min(sizing?.labelLimit ?? 100, - Math.max(0, ...lines.flat().map((line: string) => line.length * fontSize * 0.6))), + width: Math.min(sizing?.labelLimit || Infinity, + Math.max(0, ...lines.flat().map((line: string) => widthOf(line)))), rows: Math.max(1, ...lines.map((parts: string[]) => parts.length)), }; } +/** + * The room a colour bar beside the plot takes: its 30 px bar and padding, its widest tick label, or + * its title where that is wider. 0 where the figure draws none. + */ +function colorbarRoom(figure: any): number { + const trace = (figure.data ?? []).find((t: any) => t?.colorbar || t?.marker?.colorbar); + if (!trace) return 0; + const bar = trace.colorbar ?? trace.marker?.colorbar ?? {}; + const colors = Array.isArray(trace.marker?.color) ? trace.marker.color : Array.isArray(trace.z) ? trace.z.flat() : []; + const numbers = colors.filter((v: unknown): v is number => typeof v === 'number' && Number.isFinite(v)); + const lo = typeof trace.cmin === 'number' ? trace.cmin : typeof trace.marker?.cmin === 'number' ? trace.marker.cmin : Math.min(...numbers); + const hi = typeof trace.cmax === 'number' ? trace.cmax : typeof trace.marker?.cmax === 'number' ? trace.marker.cmax : Math.max(...numbers); + const fontSize = bar.tickfont?.size ?? 12; + const ticks = Number.isFinite(lo) && Number.isFinite(hi) ? valueTickLabels([lo, hi]) : ['100']; + const tickWidth = Math.max(...ticks.map(plMeasure(fontSize))); + const title = typeof bar.title === 'string' ? bar.title : bar.title?.text; + const titleWidth = title ? plMeasure(bar.title?.font?.size ?? 14)(String(title)) : 0; + return Math.ceil(Math.max(30 + 10 + 6 + tickWidth + 16, titleWidth + 24)); +} + + + +/** + * The margins a cartesian figure's axes take, measured as Plotly draws them ({@link PLOTLY_PROFILE}): + * the widest y label, its tick run and title on the left; the x labels' depth (turned or on lines), tick + * run and title below; the canvas's edge around all. Plotly's automargin only ever grows a margin, and + * a margin it grows shrinks the plot under everything hung from it, so each is set to what it will take. + */ function reserveCartesianMargins(figure: any, context: InstantiateContext): void { const { layout } = context; - const hasXAxis = !!figure.layout.xaxis; - const hasYAxis = !!figure.layout.yaxis; - if (!hasXAxis && !hasYAxis) return; + const xaxis = figure.layout.xaxis; + const yaxis = figure.layout.yaxis; + if (!xaxis && !yaxis) return; + const edge = PLOTLY_PROFILE.edge; + const pad = PLOTLY_PROFILE.axisPad; + const measureText = context.measureText; + const measure = measureText ? (fontSize: number) => (text: string) => measureText(text, fontSize) : plMeasure; - const xFontSize = layout.xLabel?.fontSize ?? 10; - const x = labelExtent(figure.layout.xaxis, layout.xLabel) ?? { width: 0, rows: 1 }; - const xAngle = Math.abs(figure.layout.xaxis?.tickangle ?? 0) * Math.PI / 180; - const xDepth = xAngle > 0 - ? Math.ceil(x.width * Math.sin(xAngle) + xFontSize * Math.cos(xAngle)) - : (x.rows - 1) * Math.ceil(xFontSize * 1.2); - const bottom = hasXAxis ? Math.max(xAngle > 0 ? 96 : 56, 40 + xDepth) : 24; + let bottom = edge; + if (xaxis && xaxis.visible !== false) { + const xFontSize = xaxis.tickfont?.size ?? layout.xLabel?.fontSize ?? 12; + const x = labelExtent(xaxis, layout.xLabel, measure) ?? { width: 0, rows: 1 }; + const xAngle = Math.abs(xaxis.tickangle ?? 0) * Math.PI / 180; + const depth = xaxis.showticklabels === false ? 0 : xAngle > 0 + ? x.width * Math.sin(xAngle) + xFontSize * Math.cos(xAngle) + : plLabelDepth(Math.max(x.rows, plDateLabelRows(figure, 'x')), xFontSize); + bottom = pad + Math.ceil(depth) + (plTickRun(xaxis) || TICK_LABEL_STANDOFF) + plAxisTitleRoom(xaxis); + } - const left = hasYAxis ? Math.max(64, 36 + (labelExtent(figure.layout.yaxis, layout.yLabel)?.width ?? 28)) : 24; - const hasColorbar = (figure.data ?? []).some((trace: any) => trace.colorbar || trace.marker?.colorbar); - const right = hasColorbar ? 96 : 32; + let left = edge; + if (yaxis && yaxis.visible !== false) { + const yFontSize = yaxis.tickfont?.size ?? layout.yLabel?.fontSize ?? 12; + const banded = labelExtent(yaxis, layout.yLabel, measure); + const width = yaxis.showticklabels === false ? 0 + : banded?.width ?? Math.max(0, ...plYTickTexts(figure).map(measure(yFontSize))); + left = pad + Math.ceil(width) + (plTickRun(yaxis) || TICK_LABEL_STANDOFF) + plAxisTitleRoom(yaxis); + } + const right = Math.max(2 * edge, colorbarRoom(figure)); figure.layout.margin = { t: 24, r: right, b: bottom, l: left }; } @@ -193,12 +293,19 @@ export function plApplyLayoutToSpec( context: InstantiateContext, warnings: ChartWarning[], ): void { + // The key's text size: the layout's, a size or two smaller where the canvas fit says so. + // Plotly sets its key in the size of its ticks (12 px), not a size over them: the layout's key + // size follows the axis titles' (14 px), which leaves names larger than the numbers they key. + // The ticks as the layout fitted them: a small plot sets them below the library's 12 px. + const tickSize = Number(context.layout.xLabel?.fontSize ?? context.layout.yLabel?.fontSize ?? context.assembleOptions?.baseLabelFontSize) || 12; + const keyFontSize = treatedKeyFontSize(Math.min(context.layout.legendFontSize ?? tickSize, tickSize), context.assembleOptions); const { layout, canvasSize } = context; if (!figure.layout) figure.layout = {}; // ── Figure dimensions ──────────────────────────────────────────────── let usedDefaultDimensions = false; + let legendRoom: { right: number; bottom: number } | undefined; if (!figure._width) { usedDefaultDimensions = true; const PADDING = 80; // approximate space for axes, labels @@ -221,18 +328,25 @@ export function plApplyLayoutToSpec( plotHeight = layout.subplotHeight || canvasSize.height; } - const legendGutter = figure.layout.showlegend ? 96 : 0; - figure._width = plotWidth + PADDING + legendGutter; - figure._height = plotHeight + PADDING; + // The legend beside the plot (or at its foot) takes the room it measures, long names on lines, + // in the size it is drawn at. + if (figure.layout.legend) figure.layout.legend.font = { ...(figure.layout.legend.font ?? {}), size: keyFontSize }; + legendRoom = plFitLegend(figure, { width: plotWidth, height: plotHeight }, treatedKeySide(context.assembleOptions, PLOTLY_PROFILE.key), treatedKeyEdge(context.assembleOptions), keyFontSize); + figure._width = plotWidth + PADDING + (legendRoom?.right ?? 0); + figure._height = plotHeight + PADDING + (legendRoom?.bottom ?? 0); + figure._plot = { width: plotWidth, height: plotHeight }; + figure._legendRoom = legendRoom ?? { right: 0, bottom: 0 }; } // ── Tick labels: font, angle, wrapped and cut names ────────────────── if (layout.xLabel && !figure.layout.xaxis) figure.layout.xaxis = {}; if (layout.yLabel?.fontSize && !figure.layout.yaxis) figure.layout.yaxis = {}; // A bar table lays out its own name column. + const measureText = context.measureText; plApplyBandLabels(figure, layout, { fit: context.chartType !== 'Bar Table', temporal: (channel) => context.channelSemantics[channel]?.type === 'temporal', + ...(measureText ? { measure: (fontSize: number) => (text: string) => measureText(text, fontSize) } : {}), }); // ── Axis title + legend fonts — canvas-adaptive header sizes ───────── @@ -247,18 +361,27 @@ export function plApplyLayoutToSpec( if (figure.layout.legend) { figure.layout.legend.font = { ...(figure.layout.legend.font || {}), - size: layout.legendFontSize, + size: keyFontSize, }; } if (figure.layout.margin == null) { reserveCartesianMargins(figure, context); + const margin = figure.layout.margin; + // A legend set at the foot stands under the x axis, in room of its own. + if (legendRoom?.bottom) margin.b += legendRoom.bottom; + // Axis titles longer than their axes take a second line. + if (figure._plot) { + const titles = plFitAxisTitles(figure, figure._plot); + margin.b += titles.x; + margin.l += titles.y; + } if (usedDefaultDimensions) { - const margin = figure.layout.margin; figure._width += Math.max(0, margin.l + margin.r - 80); - figure._height += Math.max(0, margin.t + margin.b - 80); + figure._height += Math.max(0, margin.t + margin.b - 80 - (legendRoom?.bottom ?? 0)); } } + if (figure._plot) plThinLines(figure, context, figure._plot.height); plApplyCartesianAxisSpacing(figure); figure.layout.width = figure._width; figure.layout.height = figure._height; diff --git a/packages/flint-js/src/plotly/profile.ts b/packages/flint-js/src/plotly/profile.ts new file mode 100644 index 00000000..ea19467b --- /dev/null +++ b/packages/flint-js/src/plotly/profile.ts @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * How Plotly (2.35) sets the furniture the layout plans, read off its source + * (`src/components/legend/draw.js`, `constants.js`; `svg_text_utils` line spacing). + */ + +import type { BackendProfile } from '../core/backend-profile'; + +/** + * The family Plotly's text is measured in: its default stack (`"Open Sans", verdana, arial`) draws in + * Verdana wherever Open Sans is not installed or loaded, and Verdana runs the wider of the two. + */ +export const PLOTLY_FONT = 'Verdana, sans-serif'; + +/** Plotly's `constants.itemGap`: the gap around a key's symbol, between entries and inside its box. */ +const ITEM_GAP = 5; +/** Plotly's default `legend.itemwidth`: the room a symbol is drawn in. */ +const ITEM_WIDTH = 30; +/** How much wider Plotly's measured text box runs than the width table's advance, in px (2–3 seen). */ +const TEXT_BOX_SLACK = 3; +/** `svg_text_utils.LINE_SPACING`. */ +const LINE_SPACING = 1.3; + +/** Gap between tick labels and the axis line (`ticklabelstandoff`), wider than Plotly's own ~2 px. */ +export const TICK_LABEL_STANDOFF = 7; +/** Gap between an axis's tick labels and its title (`title.standoff`). */ +export const AXIS_TITLE_STANDOFF = 16; + +export const PLOTLY_PROFILE: BackendProfile = { + id: 'plotly', + font: PLOTLY_FONT, + key: { + // An entry's text starts past its symbol's room and a gap either side of it; Plotly sizes the + // entry by its text's drawn box, a little wider than its advance. + lead: ITEM_WIDTH + 2 * ITEM_GAP + TEXT_BOX_SLACK, + symbol: 16, + gap: ITEM_GAP, + rowGap: 0, + // `endPad`: the box keeps a gap at its top and bottom; along a row only the gap after each entry. + pad: { x: 0, y: ITEM_GAP }, + // An entry stands its lines' height, at least 16 px, and 3 px more. + entryHeight: (fontSize, lines) => Math.max(fontSize * LINE_SPACING * lines, 16) + 3, + lineHeight: LINE_SPACING, + // Plotly sets a row that will not hold every entry as a grid at the widest entry's width; the + // frame sets each entry in a group of its own (`plFlowRowKey`), so rows flow, each entry its own width. + wrap: 'flow', + // Each group steps on by its width and the gap after it, and a row breaks once that would pass the room. + breakAt: 'overWithGap', + // A horizontal key's title stands at the start of its rows (`title.side: 'left'`), 10 px before them. + rowTitle: 'start', + titleGap: 2 * ITEM_GAP, + titleRowGap: 0, + // A key beside the plot never wraps into columns: it scrolls. + sideColumns: 'one', + }, + edge: 8, + tickLabelGap: TICK_LABEL_STANDOFF, + axisTitleGap: AXIS_TITLE_STANDOFF, + labelLineHeight: LINE_SPACING, + // Plotly's automargin keeps 11 px past an axis's labels; a label's box is 1.2 em tall. + labelBoxHeight: 1.2, + axisPad: 11, +}; diff --git a/packages/flint-js/src/plotly/templates/bar-table.ts b/packages/flint-js/src/plotly/templates/bar-table.ts index c21483e6..e455a278 100644 --- a/packages/flint-js/src/plotly/templates/bar-table.ts +++ b/packages/flint-js/src/plotly/templates/bar-table.ts @@ -25,6 +25,7 @@ import { ChartTemplateDef, ChartPropertyDef } from '../../core/types'; import { getRegistryEntry } from '../../core/type-registry'; +import { resolveDisplayAggregate } from '../../core/field-semantics'; const HEADER_H = 16; const FACET_HEADER_H = 20; @@ -175,7 +176,7 @@ export const plBarTableDef: ChartTemplateDef = { const maxRows = Math.max(0, Number(chartProperties?.maxRows ?? 20)); const showPercent = chartProperties?.showPercent === true; - const useMean = channelSemantics.x?.aggregationDefault === 'average'; + const useMean = resolveDisplayAggregate(channelSemantics.x, ctx.encodings?.x?.aggregate) === 'average'; const reversed = !!channelSemantics.y?.reversed; // Ordinal measures (Rank) are standings, not magnitudes — length-encoding // them inverts the ranking (see issue #85). Honor the documented `Rank` @@ -504,7 +505,8 @@ export const plBarTableDef: ChartTemplateDef = { key: 'showPercent', label: '% of total', type: 'binary', defaultValue: false, check: (ctx) => { const mcs = ctx.channelSemantics?.x; - if (!mcs?.field || mcs.type !== 'quantitative' || mcs.aggregationDefault === 'average') { + if (!mcs?.field || mcs.type !== 'quantitative' + || resolveDisplayAggregate(mcs, ctx.encodings?.x?.aggregate) !== 'sum') { return { applicable: false }; } let sum = 0, hasNeg = false, hasPos = false, count = 0; diff --git a/packages/flint-js/src/plotly/templates/bar.ts b/packages/flint-js/src/plotly/templates/bar.ts index 4da16baa..efeec006 100644 --- a/packages/flint-js/src/plotly/templates/bar.ts +++ b/packages/flint-js/src/plotly/templates/bar.ts @@ -24,6 +24,30 @@ const BAR_CORNER_RADIUS: ChartPropertyDef = { min: 0, max: 15, step: 1, defaultValue: 0, }; +/** + * The axis a bar chart's bands stand on. Times the layout keeps continuous (a temporal field, banded) + * stand on Plotly's date axis, which spaces them in time and picks round calendar ticks it can set + * flat; names, numbers and times sorted by their values stand as categories in their order. + */ +function bandAxisSpec(semantics: any, categories: unknown[], isHorizontal: boolean, title: string, sorted: boolean): any { + const dated = semantics?.type === 'temporal' && !sorted && categories.length > 1 + && categories.every((value) => typeof value === 'string' && /^\d{4}-\d{2}(-\d{2})?([T ].*)?$/.test(value)); + if (dated) { + return { + type: 'date' as const, + ...(isHorizontal ? { autorange: 'reversed' as const } : {}), + title: { text: title }, + }; + } + return { + type: 'category' as const, + categoryorder: 'array' as const, + categoryarray: categories, + ...(isHorizontal ? { autorange: 'reversed' as const } : {}), + title: { text: title }, + }; +} + function continuousColorValue(value: unknown, temporal: boolean): number | null { if (value == null || value === '') return null; const dateLike = temporal || ( @@ -130,13 +154,7 @@ export const plBarChartDef: ChartTemplateDef = { const palette = getPlotlyPalette(ctx); const cornerRadius = Number(chartProperties?.cornerRadius ?? 0); - const catAxisSpec = { - type: 'category' as const, - categoryorder: 'array' as const, - categoryarray: categories, - ...(isHorizontal ? { autorange: 'reversed' as const } : {}), - title: { text: catField }, - }; + const catAxisSpec = bandAxisSpec(channelSemantics[categoryAxis], categories, isHorizontal, catField, !!catEnc?.sortBy); const valCS = channelSemantics[valueAxis]; // Bars encode length — include zero unless the semantic decision says otherwise. const includeZero = valCS?.zero ? valCS.zero.zero !== false : true; @@ -291,13 +309,7 @@ export const plStackedBarChartDef: ChartTemplateDef = { }); } - const catAxisSpec = { - type: 'category' as const, - categoryorder: 'array' as const, - categoryarray: categories, - ...(isHorizontal ? { autorange: 'reversed' as const } : {}), - title: { text: catField }, - }; + const catAxisSpec = bandAxisSpec(channelSemantics[categoryAxis], categories, isHorizontal, catField, !!catEnc?.sortBy); const valCS = channelSemantics[valueAxis]; const includeZero = valCS?.zero ? valCS.zero.zero !== false : true; const valAxisSpec = { title: { text: valField }, rangemode: (includeZero ? 'tozero' : 'normal') as 'tozero' | 'normal' }; @@ -442,13 +454,7 @@ export const plGroupedBarChartDef: ChartTemplateDef = { }); } - const catAxisSpec = { - type: 'category' as const, - categoryorder: 'array' as const, - categoryarray: categories, - ...(isHorizontal ? { autorange: 'reversed' as const } : {}), - title: { text: catField }, - }; + const catAxisSpec = bandAxisSpec(channelSemantics[categoryAxis], categories, isHorizontal, catField, !!catEnc?.sortBy); const valCS = channelSemantics[valueAxis]; const includeZero = valCS?.zero ? valCS.zero.zero !== false : true; const valAxisSpec = { title: { text: valField }, rangemode: (includeZero ? 'tozero' : 'normal') as 'tozero' | 'normal' }; diff --git a/packages/flint-js/src/plotly/templates/choropleth.ts b/packages/flint-js/src/plotly/templates/choropleth.ts index 67745628..8bbd7737 100644 --- a/packages/flint-js/src/plotly/templates/choropleth.ts +++ b/packages/flint-js/src/plotly/templates/choropleth.ts @@ -72,7 +72,7 @@ function buildGeoLayout(scope: 'us' | 'world'): any { export const plChoroplethDef: ChartTemplateDef = { chart: 'Choropleth', template: { mark: 'geoshape', encoding: {} }, - channels: ['id', 'color', 'detail'], + channels: ['id', 'color', 'detail', 'text'], markCognitiveChannel: 'color', instantiate: (spec, ctx) => { const { channelSemantics, chartProperties, colorDecisions } = ctx; @@ -91,6 +91,9 @@ export const plChoroplethDef: ChartTemplateDef = { const locations: string[] = []; const z: number[] = []; const labels: string[] = []; + // `text` names each region at its middle, as Plotly places a location's text. + const textField = channelSemantics.text?.field; + const named: string[] = []; for (const r of rows) { const code = codeResolver(r[idField]); if (!code) continue; @@ -99,6 +102,7 @@ export const plChoroplethDef: ChartTemplateDef = { locations.push(code); z.push(colorField ? (raw as number) : 1); labels.push(labelField ? String(r[labelField] ?? r[idField]) : String(r[idField])); + if (textField) named.push(r[textField] == null ? '' : String(r[textField])); } if (locations.length === 0) return; @@ -119,7 +123,10 @@ export const plChoroplethDef: ChartTemplateDef = { colorbar: { title: { text: valueLabel } }, marker: { line: { color: '#ffffff', width: 0.5 } }, hovertemplate: `%{text}
${valueLabel}: %{z}`, - }], + }, ...(textField ? [{ + type: 'scattergeo', mode: 'text', locations, locationmode, text: named, + textfont: { size: 10, color: '#2b2f33' }, hoverinfo: 'skip', showlegend: false, + }] : [])], layout: { geo, showlegend: false, diff --git a/packages/flint-js/src/plotly/templates/map.ts b/packages/flint-js/src/plotly/templates/map.ts index 477351eb..29f49639 100644 --- a/packages/flint-js/src/plotly/templates/map.ts +++ b/packages/flint-js/src/plotly/templates/map.ts @@ -20,6 +20,7 @@ import { ChartTemplateDef, ChartPropertyDef, OptionEvalContext } from '../../core/types'; import { inferBubbleScope, pickMapScope } from '../../chart-types/geo'; import { getPlotlyPalette, getSeriesColor, groupBy } from './utils'; +import { ROUTE_WIDTH, bearing, buildRoutes, headSize, largestMagnitude, legWidths, routeArrows, widestLeg, routeDotsEverywhere, routeOpacity, routeProperties, routeStartRows, stopRadii } from '../../chart-types/map-routes'; // --------------------------------------------------------------------------- // Projection mapping (Vega-Lite d3 projection name → Plotly geo projection type) @@ -155,6 +156,9 @@ function buildGeoLayout(scope: 'us' | 'world', chartProperties: any): any { return geo; } +/** The symbols a `shape` field's categories take, in turn, as the Plotly scatter's do. */ +const SYMBOLS = ['circle', 'square', 'triangle-up', 'diamond', 'cross', 'x', 'star']; + /** Sqrt (area-truth) scale from data values to marker pixel diameters. */ function bubbleDiameters(values: number[], minPx = 6, maxPx = 34): number[] { const finite = values.filter(v => Number.isFinite(v)); @@ -173,7 +177,8 @@ function bubbleDiameters(values: number[], minPx = 6, maxPx = 34): number[] { export const plMapDef: ChartTemplateDef = { chart: 'Map', template: { mark: 'circle', encoding: {} }, - channels: ['longitude', 'latitude', 'color', 'size', 'opacity'], + // `size` is always the dots' area; `strokeWidth` the width of the legs `order` joins them by. + channels: ['longitude', 'latitude', 'color', 'size', 'shape', 'opacity', 'order', 'detail', 'strokeWidth', 'text'], markCognitiveChannel: 'position', instantiate: (spec, ctx) => { const { channelSemantics, chartProperties, colorDecisions } = ctx; @@ -197,6 +202,8 @@ export const plMapDef: ChartTemplateDef = { const opacity = 0.85; const traces: any[] = []; + // The rows each marker trace draws, so a route map can size and hide its stops row by row. + const traceRows = new Map(); if (isContinuousColor && colorField) { const toColorVal = colorType === 'temporal' @@ -227,6 +234,7 @@ export const plMapDef: ChartTemplateDef = { + (sizeField ? `
${sizeField}: %{customdata}` : '') + '', customdata: sizeField ? sizeValues : undefined, }); + traceRows.set(traces[traces.length - 1], rows); } else if (colorField) { // Nominal/ordinal color: one trace per group (legend by group name). // Bubble diameters come from the SAME global sqrt scale computed @@ -254,6 +262,7 @@ export const plMapDef: ChartTemplateDef = { + (sizeField ? `
${sizeField}: %{customdata}` : '') + '', customdata: groupSizes, }); + traceRows.set(traces[traces.length - 1], groupRows); i++; } } else { @@ -273,7 +282,53 @@ export const plMapDef: ChartTemplateDef = { + (sizeField ? `
${sizeField}: %{customdata}` : '') + '', customdata: sizeValues, }); + traceRows.set(traces[traces.length - 1], rows); + } + + // A shape tells the points apart, a symbol per category in the order the rows give them. + const shapeField = channelSemantics.shape?.field; + if (shapeField) { + const categories = [...new Set(rows.map((row: any) => String(row?.[shapeField])))]; + for (const [trace, own] of traceRows) { + trace.marker = { ...trace.marker, symbol: own.map((row) => SYMBOLS[categories.indexOf(String(row?.[shapeField])) % SYMBOLS.length]) }; + } + } + + // `text` names each point beside it, as Plotly writes a trace's text (it does not keep labels apart). + const textField = channelSemantics.text?.field; + if (textField) { + for (const [trace, own] of traceRows) { + Object.assign(trace, { + mode: 'markers+text', text: own.map((row) => (row?.[textField] == null ? '' : String(row[textField]))), + textposition: 'middle right', textfont: { size: 10, color: '#2b2f33' }, + }); + } + } + + const routes = routeTraces(ctx, rows, lonField, latField, isContinuousColor ? undefined : colorField); + // A route's stops are drawn as on the Vega-Lite map: a dot at every one where the points carry + // what the routes do not (`size`, `shape`, `text`, a quantity's colour), else at each route's + // start; each of `stopRadii`'s size, haloed, beneath the lines. A stop not drawn keeps its hover. + if (routes.lines.length > 0) { + const everywhere = routeDotsEverywhere({ size: Boolean(sizeField), shape: Boolean(shapeField), text: Boolean(textField), pointColor: isContinuousColor }); + const radii = stopRadii(sizeField, rows, routes.widths); + const shown = new Set(routes.starts.map((row) => rows[row])); + const indexOf = new Map(rows.map((row: any, index: number) => [row, index])); + for (const trace of traces) { + const own = traceRows.get(trace); + if (!own) continue; + trace.marker = { + ...trace.marker, + symbol: trace.marker?.symbol ?? 'circle', + size: own.map((row) => 2 * radii.radius(indexOf.get(row) ?? 0)), + opacity: everywhere ? 1 : own.map((row) => (shown.has(row) ? 1 : 0)), + line: { color: '#ffffff', width: 1 }, + }; + } } + // The casing beneath the dots, the lines and heads over them, as on the Vega-Lite map. + traces.unshift(...routes.casings); + traces.push(...routes.lines, ...routes.heads); const width = scope === 'us' ? 520 : 620; const height = scope === 'us' ? 320 : 360; @@ -291,5 +346,78 @@ export const plMapDef: ChartTemplateDef = { delete spec.mark; delete spec.encoding; }, - properties: [regionProperty, projectionProperty, projectionCenterProperty], + properties: [regionProperty, projectionProperty, projectionCenterProperty, ...routeProperties], }; + +/** A route drawn in no series' colour, as the Vega-Lite map draws it. */ +const ROUTE_INK = '#4a5058'; + +/** + * The routes an `order` field joins the points into (`chart-types/map-routes`): a white casing + * beneath the points, the line — which Plotly draws along great circles between vertices — and, + * unless `arrows` is false, a head over them. A Plotly marker is centred on its point and cannot set + * its tip on the stop, so the head stands mid-leg, turned to the leg's compass bearing there + * (`angleref: 'north'`). Structure: no hover, no legend entry. + */ +function routeTraces(ctx: any, rows: any[], lonField: string, latField: string, colorField: string | undefined): { casings: any[]; lines: any[]; heads: any[]; widths: number[]; starts: number[] } { + const none = { casings: [], lines: [], heads: [], widths: [], starts: [] }; + const orderField = ctx.channelSemantics.order?.field; + if (!orderField) return none; + const series = ctx.channelSemantics.detail?.field ?? colorField; + const globe = ctx.chartProperties?.projection === 'orthographic'; + const routes = buildRoutes(rows, { longitude: lonField, latitude: latField, order: orderField, series, curve: ctx.chartProperties?.curve, globe }); + if (!routes.length) return none; + // The points' own colours: one trace per colour group, in the order they were grouped. + const palette = getPlotlyPalette(ctx, 'color'); + const groups = colorField ? Array.from(groupBy(rows, colorField), ([name]) => name) : []; + // A category that names stretches of a route (a leg of a voyage), not the route: each leg takes + // the colour of the row it leaves, as the Vega-Lite map draws it. (A quantity's colour arrives unset.) + const byRow = Boolean(colorField && series !== colorField); + const ink = (value: unknown) => { + const at = groups.findIndex((name) => String(name) === String(value)); + if (at >= 0) return getSeriesColor(palette, at); + // No series colour: the theme's mark colour, as a plain dot's — neutral beside dots coloured by another field. + return ctx.channelSemantics.color?.field ? ROUTE_INK : getSeriesColor(palette, 0); + }; + const opacity = routeOpacity(routes.length); + const quiet = { type: 'scattergeo', hoverinfo: 'skip', showlegend: false }; + // `strokeWidth` is a route's width, leg by leg from the row each leaves; Plotly draws a trace one + // width, so a widened route is a trace per leg. + const sizeField = ctx.channelSemantics.strokeWidth?.field; + const legs = routes.flatMap((route) => route.legs.map((leg) => ({ route, leg }))); + const widths = sizeField + ? legWidths(legs.map(({ leg }) => rows[leg.from]?.[sizeField]), largestMagnitude(rows.map((row) => row[sizeField])), + widestLeg(legs.map(({ leg }) => leg), legs.map(({ leg }) => rows[leg.from]?.[sizeField]), Math.sqrt(620 * 360))) + : legs.map(() => ROUTE_WIDTH.plain); + const widthOf = new Map(legs.map(({ leg }, index) => [leg, widths[index]])); + const line = (path: readonly [number, number][], color: string, width: number, alpha: number) => ({ + ...quiet, mode: 'lines', lon: path.map(([lon]) => lon), lat: path.map(([, lat]) => lat), + line: { color, width }, opacity: alpha, + }); + const legInk = (series: unknown, from: number) => (byRow ? ink(rows[from]?.[colorField!]) : ink(series)); + const perLeg = Boolean(sizeField || byRow); + const casings = perLeg + ? legs.map(({ leg }) => line(leg.path, '#ffffff', widthOf.get(leg)! + 2, Math.min(0.9, opacity + 0.05))) + : routes.map((route) => line(route.path, '#ffffff', ROUTE_WIDTH.plain + 2, Math.min(0.9, opacity + 0.05))); + const lines = perLeg + ? legs.map(({ route, leg }) => line(leg.path, legInk(route.series, leg.from), widthOf.get(leg)!, opacity)) + : routes.map((route) => line(route.path, ink(route.series), ROUTE_WIDTH.plain, opacity)); + const heads: any[] = []; + if (ctx.chartProperties?.arrows !== false) { + const arrows = routeArrows(routes, ctx.chartProperties?.curve, globe, 'middle'); + // One trace per colour, each head turned to its own bearing. + const arrowInk = (arrow: (typeof arrows)[number]) => legInk(arrow.series, arrow.from); + for (const color of new Set(arrows.map(arrowInk))) { + const own = arrows.filter((arrow) => arrowInk(arrow) === color); + heads.push({ + ...quiet, mode: 'markers', lon: own.map((arrow) => arrow.tip[0]), lat: own.map((arrow) => arrow.tip[1]), + // Sized to its line, as the Vega-Lite map's heads are. + marker: { + symbol: 'triangle-up', angleref: 'up', angle: own.map((arrow) => bearing(arrow.base, arrow.tip)), + size: own.map((arrow) => headSize(widthOf.get(arrow.leg) ?? ROUTE_WIDTH.plain).length), color, line: { width: 0 }, + }, + }); + } + } + return { casings, lines, heads, widths, starts: routeStartRows(routes, rows.length) }; +} diff --git a/packages/flint-js/src/plotly/templates/pie.ts b/packages/flint-js/src/plotly/templates/pie.ts index ab7fc9d4..76ff1154 100644 --- a/packages/flint-js/src/plotly/templates/pie.ts +++ b/packages/flint-js/src/plotly/templates/pie.ts @@ -143,6 +143,18 @@ const PIE_PROPERTIES: ChartPropertyDef[] = [ ], defaultValue: 'categoryPercent', }, + { + // Where the names stand: on the slices (inside, or as callouts past the ring), in a key, or + // chosen by fit — a key where many long names would crowd the pie, or where a callout past + // the ring would move furniture hung over the chart (a house's tab, a source line). + key: 'sliceNames', label: 'Slice names', type: 'discrete', + options: [ + { value: 'auto', label: 'Auto' }, + { value: 'onSlices', label: 'On slices' }, + { value: 'key', label: 'In a key' }, + ], + defaultValue: 'auto', + }, ]; export const plPieChartDef: ChartTemplateDef = { diff --git a/packages/flint-js/src/plotly/templates/scatter.ts b/packages/flint-js/src/plotly/templates/scatter.ts index 3e73eeb3..b136e4c4 100644 --- a/packages/flint-js/src/plotly/templates/scatter.ts +++ b/packages/flint-js/src/plotly/templates/scatter.ts @@ -27,7 +27,8 @@ function sizeScale(table: any[], field: string): (row: any) => number { const values = table .map((r: any) => Number(r[field])) .filter((v: number) => Number.isFinite(v)); - const min = values.length ? Math.min(...values) : 0; + // From zero, as Vega-Lite's size scale is: a value twice another draws twice its area. + const min = values.length ? Math.min(0, ...values) : 0; const max = values.length ? Math.max(...values) : 1; const MIN_AREA = 40; const MAX_AREA = 900; @@ -111,6 +112,7 @@ export const plScatterPlotDef: ChartTemplateDef = { ...(sizeOf ? { size: rows.map((r: any) => sizeOf(r)) } : {}), line: { color: '#ffffff', width: 0.5 }, }, + ...(sizeField ? { _sizeValues: rows.map((r: any) => Number(r[sizeField])), _sizeField: sizeField } : {}), showlegend: !!shapeField, }); } @@ -140,6 +142,7 @@ export const plScatterPlotDef: ChartTemplateDef = { ...(sizeOf ? { size: rows.map(r => sizeOf(r)) } : {}), line: { color: '#ffffff', width: 0.5 }, }, + ...(sizeField ? { _sizeValues: rows.map((r: any) => Number(r[sizeField])), _sizeField: sizeField } : {}), }); if (colorField || shapeField) { diff --git a/packages/flint-js/src/plotly/theme.ts b/packages/flint-js/src/plotly/theme.ts index 3f91eeb3..2acfda6b 100644 --- a/packages/flint-js/src/plotly/theme.ts +++ b/packages/flint-js/src/plotly/theme.ts @@ -30,9 +30,17 @@ * ============================================================================= */ +import { cutToWidth, planTitleBlock } from '../core/backend-frame'; +import { alreadyNamed, tickUnitOf } from '../core/title-plan'; +import { PLOTLY_FONT, plAxisTitleRoom, plDateLabelRows, plDropEmptyTitles, plFitRowKey, plTickRun, plKeyBlock, plLabelDepth, plYTickTexts } from './frame'; +import { PLOTLY_PROFILE } from './profile'; +import type { KeyBlock } from '../core/backend-profile'; +import { plotHeightAfter } from '../core/title-fit'; import { groupPadding } from '../core/group-gaps'; import { applyTextCase } from '../core/text-case'; import { chooseLabelStep, DEFAULT_LABEL_OVERFLOW, TURNED_LABEL_LIMIT } from '../core/axis-labels'; +import { fitTwoLineLabels } from '../core/decisions'; +import { tableTextMeasurer } from '../core/text-width'; import type { LabelFitStep } from '../core/theme/types'; import type { DesignDecisions, @@ -202,6 +210,7 @@ function fontOf(t: ResolvedText | undefined, fallbackFamily?: string): any { } /** True when this text role asks for weight or slope Plotly cannot set as a property. */ + function needsMarkup(t: ResolvedText | undefined): { bold: boolean; italic: boolean } { const w = t?.fontWeight; const bold = w === 'bold' || (typeof w === 'number' && w >= 600); @@ -329,15 +338,34 @@ export function realizeThemePlotly(figure: any, d: DesignDecisions, table: any[] applySurface(figure, d); applyGeoSurface(figure, d); applyFurnitureTraces(figure, d); + const footBefore = xFootDepth(figure, d); moveAxisTitlesToSubtitle(figure, d); - const titleH = applyTypography(figure, d); + // The axes first: the title, set from the chart's left, is broken to the width it has from there. applyAxes(figure, d, table, say); + plDropEmptyTitles(figure.layout); + if (figure._plot) { + // A figure the frame laid out takes the margins its axes need as the house draws them. + fitAxisMargins(figure, d); + } else { + refitFoot(figure.layout, xFootDepth(figure, d) - footBefore); + } applyMarks(figure, d, table, say); applySeriesInk(figure, d, table, say); - const legendH = applyLegend(figure, d, say); + applyLegend(figure, d, say); + // Where the key stands is settled: the value axis may take the right-hand side. + sideYAxis(figure.layout, d); + const titleH = applyTypography(figure, d); applyFacetChrome(figure, d); applyDataLabels(figure, d, table, say); - layoutTopChrome(figure, d, titleH, legendH); + alignToChartLeft(figure, d); + delete figure._facetTicked; + // The margins are settled: a key above the plot is measured as Plotly will wrap it there. + // A key in a row sets its names for the row, not for the column the frame planned beside the plot. + plFitRowKey(figure); + const key = figure.layout.showlegend !== false && figure.layout.legend?.y > 1 ? plKeyBlock(figure) : undefined; + layoutTopChrome(figure, d, titleH, key); + // A key in rows under the plot stands below the x labels and title, in room of its own. + layoutFootKey(figure); return report; } @@ -411,6 +439,8 @@ function moveAxisTitlesToSubtitle(figure: any, decisions: DesignDecisions): void const layout = figure.layout; if (layout.title === null) return; const titles = new Map>(); + const head = typeof layout.title === 'string' ? layout.title : layout.title?.text; + const said = (deckOnly: boolean) => [deckOnly ? undefined : head, layout.title?._deck].filter((t) => typeof t === 'string').join(' '); for (const channel of ['x', 'y'] as const) { const resolved = decisions.axes[channel]?.title; if (resolved?.placement !== 'subtitle') continue; @@ -420,9 +450,12 @@ function moveAxisTitlesToSubtitle(figure: any, decisions: DesignDecisions): void if (typeof text !== 'string' || !text.trim()) continue; const label = resolved.unit && !text.includes(`(${resolved.unit})`) ? `${text} (${resolved.unit})` : text; + axis.title = { ...(typeof axis.title === 'object' ? axis.title : {}), text: '' }; + // A title the headline or deck already names is not said again (the house's `unlessNamed`). + const unlessNamed = resolved.unlessNamed; + if (unlessNamed && alreadyNamed(text, said(unlessNamed === 'deck'), tickUnitOf(decisions.axes[channel]))) continue; if (!titles.has(channel)) titles.set(channel, new Set()); titles.get(channel)!.add(label); - axis.title = { ...(typeof axis.title === 'object' ? axis.title : {}), text: '' }; } } if (!titles.size) return; @@ -459,36 +492,53 @@ function applyTypography(figure: any, d: DesignDecisions): number { // of the title with its own inline type. const h = d.title.headline; const deck = d.title.deck; - const width = Number(layout.width) || 400; - - const headlineSize = h.fontSize ?? 16; - const headLines = headlineText ? wrapToWidth( - String(headlineText).replace(/
/g, ' '), + let figureWidth = Number(layout.width) || 400; + // A title set from the start stands where the chart does (see {@link chartLeft}). + const left = d.title.anchor === 'start' ? chartLeft(figure, d) : 4; + // A narrow chart's title may run as wide as its box allows: broken to the chart's own width it + // stacks into many lines and makes the drawing tall and thin. The figure then widens to hold it. + const room = Math.max(figureWidth, titleRoomOf(figure)); + const width = room - left + 4; + + // Broken to full lines with no widow, as every backend breaks a title ({@link planTitleBlock}), + // measured in the case it is drawn in. + const block = planTitleBlock( + { + title: headlineText ? applyTextCase(String(headlineText).replace(/
/g, ' '), h.textCase) : undefined, + subtitle: deckText ? applyTextCase(deckText, deck.textCase) : undefined, + }, width - 8, - headlineSize, - needsMarkup(h).bold, - ) : []; + { + headline: { fontSize: h.fontSize ?? 16, fontWeight: needsMarkup(h).bold ? 'bold' : 'normal', font: h.font ?? d.font ?? PLOTLY_FONT }, + deck: { fontSize: deck.fontSize ?? 12, fontWeight: needsMarkup(deck).bold ? 'bold' : 'normal', font: deck.font ?? d.font ?? PLOTLY_FONT }, + gap: d.title.deckPadding, + }, + ); + const headlineSize = block?.headline?.fontSize ?? h.fontSize ?? 16; + figureWidth = widenForTitle(layout, block ? (d.title.anchor === 'middle' ? 2 * Math.max(left, 4) : left + 4) + block.width : 0, figureWidth); + const headLines = block?.headline?.lines ?? []; const lines = headLines.length ? [styleText(headLines.join('
'), h)] : []; - let height = 8 + (headLines.length ? titleBlockHeight(headLines.length, headlineSize) + 6 : 0); + // Plotly sets headline and deck as one block of lines; the block is as tall as its lines. + let height = 8 + (headLines.length ? titleBlockHeight(headLines.length, headlineSize) : 0); if (deckText) { const size = deck.fontSize ?? 12; const color = deck.color ?? d.text.secondary; - const deckLines = wrapToWidth(deckText, width - 8, size, needsMarkup(deck).bold); + const deckLines = block?.deck?.lines ?? [deckText]; const style = [ `font-size:${size}px`, `color:${color}`, ...(deck.font ? [`font-family:${deck.font}`] : []), ].join(';'); lines.push(`${styleText(deckLines.join('
'), deck)}
`); - height += titleBlockHeight(deckLines.length, size) + d.title.deckPadding; + height += titleBlockHeight(deckLines.length, size); } const anchor = d.title.anchor; layout.title = { text: lines.join('
'), font: { ...fontOf(h, d.font), size: headlineSize }, - x: anchor === 'start' ? 0.005 : anchor === 'end' ? 0.995 : 0.5, + x: anchor === 'start' ? left / figureWidth : anchor === 'end' ? 0.995 : 0.5, xanchor: anchor === 'start' ? 'left' : anchor === 'end' ? 'right' : 'center', xref: 'container', y: titleY(layout, headLines.length + (deckText ? 1 : 0), headlineSize), @@ -498,6 +548,23 @@ function applyTypography(figure: any, d: DesignDecisions): number { return height + d.title.offset; } +/** The width the box gives a title, set by the assembler (`_titleRoom`); 0 where none is known. */ +function titleRoomOf(figure: any): number { + return Number(figure?._titleRoom) || 0; +} + +/** + * Widen a figure to hold its title where the title runs past it: the margins are held in px, so + * the plot takes the width (Plotly fills a banded axis), and the drawing grows wider rather than + * taller. Returns the figure's width. + */ +function widenForTitle(layout: any, need: number, width: number): number { + const want = Math.ceil(need + 4); + if (!(want > width)) return width; + layout.width = want; + return want; +} + /** * Restate the template's own grey text in the house's inks. * @@ -551,25 +618,6 @@ function titleLineCount(title: any): number { return Math.max(1, String(text ?? '').split('
').length); } -/** Break a line of text to a pixel width, at word boundaries where it can. */ -function wrapToWidth(text: string, width: number, fontSize: number, bold = false): string[] { - const perChar = fontSize * (bold ? 0.63 : 0.55); - const max = Math.max(8, Math.floor(width / perChar)); - if (text.length <= max) return [text]; - const words = text.split(/\s+/); - const lines: string[] = []; - let line = ''; - for (const w of words) { - if (!line) line = w; - else if ((line + ' ' + w).length <= max) line += ' ' + w; - else { - lines.push(line); - line = w; - } - } - if (line) lines.push(line); - return lines; -} /** * Give the title and any legend above the plot room of their own. @@ -579,9 +627,45 @@ function wrapToWidth(text: string, width: number, fontSize: number, bold = false * rectangle. The chart was already sized to fit; the chrome the theme adds is * therefore paid for in figure height, not taken out of the plot. */ -function layoutTopChrome(figure: any, d: DesignDecisions, titleH: number, legendH: number): void { +/** + * A key the house sets in rows under the plot: measured as Plotly will wrap it ({@link plKeyBlock}), + * hung a gap below what the x axis takes (its labels and title), with the figure grown by its height + * so the plot keeps its size. Without this Plotly's automargin pushes the foot out by the key and + * takes the room from the plot. + */ +function layoutFootKey(figure: any): void { + const layout = figure.layout; + const legend = layout?.legend; + if (layout?.showlegend === false || !legend || legend.orientation !== 'h' || legend.yref === 'container') return; + if (!(typeof legend.y === 'number' && legend.y < 0)) return; + const key = plKeyBlock(figure); + const margin = layout.margin; + if (!key || !margin || !Number(layout.height)) return; + const before = margin.b ?? 0; + // What the x axis takes under the plot, without the edge the margin keeps past it. + const foot = Math.max(0, before - PLOTLY_PROFILE.axisPad); + margin.b = Math.ceil(foot + FOOT_KEY_GAP + key.height + PLOTLY_PROFILE.edge); + layout.height = Math.round(layout.height + margin.b - before); + const plotH = Math.max(1, layout.height - (margin.t ?? 0) - margin.b); + legend.yanchor = 'top'; + legend.y = -(foot + FOOT_KEY_GAP) / plotH; +} + +/** Px between the x axis's labels (or title) and a key in rows under them. */ +const FOOT_KEY_GAP = 12; + +/** Px kept between a title's estimated last line and a key hung under it. */ +const TITLE_KEY_SLACK = 4; + +function layoutTopChrome(figure: any, d: DesignDecisions, titleH: number, key: KeyBlock | undefined): void { const layout = figure.layout; - const need = titleH + legendH; + const legendH = key?.height ?? 0; + // The canvas fit weighs a key above the plot apart from the title (see `assemblePlotly`). + if (legendH > 0) figure._topKey = legendH; + // Plotly pads a key's box inside its edge; the house's gaps are between what is drawn. + const inset = titleH > 0 && key ? key.inset : 0; + // A few px between the title's last line and the key: the title's drawn block is estimated. + const need = titleH + legendH - inset + (legendH > 0 ? TITLE_KEY_SLACK : 0); if (need <= 0) return; const margin = (layout.margin ??= { t: 24, r: 32, b: 56, l: 64 }); const before = margin.t ?? 0; @@ -603,11 +687,162 @@ function layoutTopChrome(figure: any, d: DesignDecisions, titleH: number, legend if (legendH > 0 && layout.legend && layout.legend.y > 1) { const plotH = Math.max(1, (Number(layout.height) || 300) - margin.t - (margin.b ?? 0)); layout.legend.yanchor = 'top'; - layout.legend.y = 1 + Math.max(8, margin.t - titleH) / plotH; + layout.legend.y = 1 + Math.max(8, margin.t - titleH - TITLE_KEY_SLACK + inset) / plotH; } void d; } +/** How many lines the x axis's names stand on: the most `
` breaks a tick text holds, plus one. */ +function xLabelRows(layout: any): number { + const ax = layout?.xaxis; + if (!ax || Math.abs(Number(ax.tickangle) || 0) > 0) return 1; + const texts = Array.isArray(ax.ticktext) ? ax.ticktext : []; + return Math.max(1, ...texts.map((t: unknown) => String(t).split('
').length)); +} + +/** The x axis's names as Plotly prints them: its tick texts, its category order, or the traces' own names. */ +function xTickNames(figure: any): string[] { + const ax = figure.layout?.xaxis; + if (Array.isArray(ax?.ticktext)) return ax.ticktext.map(String); + if (Array.isArray(ax?.categoryarray)) return ax.categoryarray.map(String); + const names = new Set(); + for (const trace of figure.data ?? []) { + if ((trace?.xaxis ?? 'x') !== 'x' || trace?.orientation === 'h') continue; + for (const v of trace?.x ?? []) if (typeof v === 'string') names.add(v); + } + return [...names]; +} + +/** + * The room under the plot the x axis's names and title take as they stand: turned names by their + * measured reach, flat ones by their rows, and the title by its lines. + */ +function xFootDepth(figure: any, d: DesignDecisions): number { + const ax = figure.layout?.xaxis; + if (!ax || ax.visible === false) return 0; + const fontSize = Number(ax.tickfont?.size) || 12; + let labels = 0; + if (ax.showticklabels !== false) { + const angle = Math.abs(Number(ax.tickangle) || 0) * Math.PI / 180; + if (angle > 0) { + const widthOf = tableTextMeasurer(fontSize, ax.tickfont?.family ?? d.font ?? PLOTLY_FONT, 'normal', 'normal'); + const widest = Math.max(0, ...xTickNames(figure).flatMap((t) => t.split('
')).map(widthOf)); + labels = widest * Math.sin(angle) + fontSize * Math.cos(angle); + } else { + labels = plLabelDepth(Math.max(xLabelRows(figure.layout), plDateLabelRows(figure, 'x')), fontSize); + } + labels += plTickRun(ax); + } + // Measured as the frame reserves it (`reserveCartesianMargins`). + const titled = plAxisTitleRoom(ax); + return Math.ceil(labels + titled); +} + +/** + * The foot follows what the house did to the x axis: names it wrapped onto more lines take their + * room below the plot rather than out of it, and room kept for names it laid flat, or for a title it + * moved into the deck, is given back. The figure grows or shrinks with it; the plot keeps its size. + */ +function refitFoot(layout: any, change: number): void { + const margin = layout?.margin; + if (!change || !margin) return; + const before = margin.b ?? 0; + margin.b = Math.max(Math.min(before, 24), before + change); + if (Number(layout.height)) layout.height = Math.round(layout.height + margin.b - before); +} + +/** + * The room left of the plot the y axis takes as it stands: its widest label in its own font, the + * tick run before it, and its title. + */ +function yGutterWidth(figure: any, d: DesignDecisions): number { + const ax = figure.layout?.yaxis; + if (!ax || ax.visible === false || ax.side === 'right') return 0; + let width = 0; + if (ax.showticklabels !== false) { + const widthOf = tableTextMeasurer(Number(ax.tickfont?.size) || 12, ax.tickfont?.family ?? d.font ?? PLOTLY_FONT, 'normal', 'normal'); + width = Math.max(0, ...plYTickTexts(figure).map(widthOf)) + plTickRun(ax); + } + width += plAxisTitleRoom(ax); + return Math.ceil(width); +} + +/** + * The margins a frame-laid figure's axes take, as the house draws them: below the plot the x labels, + * their tick run and title, and a key at the foot; left of it the y gutter; the canvas's edge past + * both. The figure grows or shrinks with them; the plot keeps its size. Measured as the frame reserves + * them before the house (`reserveCartesianMargins`), so Plotly's automargin has nothing left to grow. + */ +function fitAxisMargins(figure: any, d: DesignDecisions): void { + const layout = figure.layout; + const margin = layout?.margin; + if (!margin) return; + const pad = PLOTLY_PROFILE.axisPad; + if (layout.xaxis) { + const before = margin.b ?? 0; + margin.b = pad + xFootDepth(figure, d) + (figure._legendRoom?.bottom ?? 0); + if (Number(layout.height)) layout.height = Math.round(layout.height + margin.b - before); + } + if (layout.yaxis && layout.yaxis.side !== 'right') { + const before = margin.l ?? 0; + margin.l = pad + yGutterWidth(figure, d); + if (Number(layout.width)) layout.width = Math.round(layout.width + margin.l - before); + } +} + + +/** + * A house that stands the value axis on the right (`axes.y.orient`) has it drawn there; the room its + * labels took on the left moves to the right with them, so the plot keeps its width. Not where a + * legend stands beside the plot on the right, which that side's room is kept for. + */ +function sideYAxis(layout: any, d: DesignDecisions): void { + const orient = (d.axes.y as { orient?: string } | undefined)?.orient; + const ax = layout?.yaxis; + if (orient !== 'right' || !ax || ax.side === 'right' || layout.yaxis2) return; + const legend = layout.legend; + if (layout.showlegend !== false && legend && legend.orientation !== 'h' && (legend.x ?? 1.02) >= 1) return; + ax.side = 'right'; + const m = layout.margin; + if (!m) return; + const left = m.l ?? 64; + const right = m.r ?? 32; + m.r = Math.max(right, left); + m.l = Math.max(16, left + right - m.r); +} + + +/** + * Where the chart's left edge stands, in px from the figure's: the left of the y axis's labels, or + * the plot's left edge where the axis stands on the right. A title and key set from the start stand + * there, as Vega-Lite anchors them to the chart's group, rather than at the figure's edge. + */ +function chartLeft(figure: any, d: DesignDecisions): number { + const layout = figure.layout; + const ax = layout?.yaxis; + let left = layout?.margin?.l ?? 0; + if (ax && ax.side !== 'right' && ax.showticklabels !== false) { + const widthOf = tableTextMeasurer(ax.tickfont?.size ?? 12, ax.tickfont?.family ?? d.font ?? PLOTLY_FONT, 'normal', 'normal'); + const labels = plYTickTexts(figure); + const run = labels.length ? Math.max(...labels.map(widthOf)) + (ax.ticklabelstandoff ?? 0) + (ax.ticklen ?? 0) : 0; + left -= run; + } + return Math.max(4, Math.round(left)); +} + +/** A key in a row above or below the plot, set from the start, stands where the title does. */ +function alignToChartLeft(figure: any, d: DesignDecisions): void { + const layout = figure.layout; + const width = Number(layout?.width); + if (!(width > 0) || !layout.margin || d.title.anchor !== 'start') return; + const legend = layout.legend; + if (legend && legend.orientation === 'h' && legend.xanchor === 'left' && legend.xref !== 'container') { + // In paper units, from the plot's left: a container-anchored row is wrapped by Plotly as a column. + const plotWidth = Math.max(1, width - (layout.margin.l ?? 0) - (layout.margin.r ?? 0)); + legend.x = (chartLeft(figure, d) - (layout.margin.l ?? 0)) / plotWidth; + } +} + /** * A map has its own canvas, land and borders, none of which are axes. * @@ -679,15 +914,18 @@ function thinDenseCategoryTicks(figure: any, d: DesignDecisions, say: ReportDepa const ax = layout[key]; const categories = Array.isArray(ax?.categoryarray) ? ax.categoryarray : []; if (ax?.type !== 'category' || categories.length < 2) continue; + // Names the house already set (wrapped, cut) were fitted to their band: none is dropped. + if (Array.isArray(ax.ticktext)) continue; const domain = Array.isArray(ax.domain) && ax.domain.length === 2 ? Math.abs(Number(ax.domain[1]) - Number(ax.domain[0])) : 1; const band = plotWidth * (Number.isFinite(domain) ? domain : 1); - const chars = Math.min(18, Math.max(3, ...categories.map((c: any) => String(c).length))); + const widthOf = tableTextMeasurer(fontSize, d.axes.x?.label.font ?? d.font ?? PLOTLY_FONT, 'normal', 'normal'); + const widest = Math.min(18 * fontSize * 0.58, Math.max(3 * fontSize * 0.58, ...categories.map((c: any) => widthOf(String(c))))); // A turned label takes its line height along the axis, not its length. const footprint = (degrees: number): number => degrees > 0 ? fontSize * 1.2 / Math.sin(degrees * Math.PI / 180) + 2 - : chars * fontSize * 0.58 + 8; + : widest + 8; const fitsAt = (degrees: number): number => Math.max(2, Math.floor(band / footprint(degrees))); let degrees = Math.abs(Number(ax.tickangle) || 0); if (categories.length <= fitsAt(degrees)) continue; @@ -743,6 +981,46 @@ function dedupeBoundaryZeroLines(figure: any, say: ReportDeparture): void { } } +/** + * The line along the index axis is a base only where the value scale starts at zero. Where the value + * scale floats (its floor is not zero) and the house rules its values with a grid rather than an axis + * line (`floating: 'omit'`, or unset with a gridded, unruled value axis), that line would claim a base + * the chart does not have: it is left off, and zero, where the data crosses it, carries the base — as + * Vega-Lite's realization decides. Run once the value axis's range is final. + */ +export function plFloatingFloor(figure: any, d: DesignDecisions): void { + const layout = figure?.layout; + if (!layout) return; + const index = (['x', 'y'] as const).find((channel) => d.axes[channel]?.indexing); + if (!index) return; + const valueAxis = d.axes[index === 'x' ? 'y' : 'x']; + const floating = d.floating ?? (valueAxis && !valueAxis.domain.show && valueAxis.grid.show ? 'omit' : 'keep'); + if (floating !== 'omit') return; + const valueKey = index === 'x' ? 'yaxis' : 'xaxis'; + const indexKey = `${index}axis`; + const ax = layout[valueKey]; + const line = layout[indexKey]; + if (!ax || !line?.showline || ax.type === 'category' || ax.type === 'log' || ax.type === 'date') return; + let floor: number | undefined; + if (Array.isArray(ax.range)) floor = Math.min(Number(ax.range[0]), Number(ax.range[1])); + else { + const channel = index === 'x' ? 'y' : 'x'; + const values: number[] = []; + for (const trace of figure.data ?? []) { + if ((trace?.[`${channel}axis`] ?? channel) !== channel) continue; + for (const v of trace?.[channel] ?? []) { const n = Number(v); if (v != null && Number.isFinite(n)) values.push(n); } + } + if (!values.length) return; + const lo = Math.min(...values); + floor = ax.rangemode === 'tozero' && lo >= 0 ? 0 : lo; + } + // A floor at zero is the base, and a floor over the data's own positive values is not one the + // reader takes for a base: only a floor below zero, under a zero the data crosses, claims a base + // the chart does not have — there zero carries it. + if (floor === undefined || !Number.isFinite(floor) || floor >= 0) return; + line.showline = false; +} + /** A rank-like run: every integer between the ends is present. */ function isContiguousIntegers(seen: Set): boolean { const nums = [...seen].map(Number); @@ -773,7 +1051,7 @@ function pinSparseTicks(figure: any, d: DesignDecisions): void { for (const key of axisKeys(layout, ch)) { const ax = layout[key]; if (!ax || ax.type === 'category' || ax.type === 'log') continue; - if (ax.tickvals != null || !ax.showticklabels) continue; + if (ax.tickvals != null || !ax.showticklabels || ax.dtick != null || figure._facetTicked) continue; const want = key.replace('axis', ''); const seen = new Set(); for (const trace of figure.data ?? []) { @@ -1003,7 +1281,16 @@ function axisCategories(figure: any, ax: any, key: string, ch: 'x' | 'y'): any[] * Only answerable for a banded axis, where the band width is the width divided * by the number of names. Anything else is left to the house. */ -function labelsFitStraight(ax: any, key: string, a: ResolvedAxis, width: number, cats: any[]): boolean { +/** How wide a tick label runs, measured in the face and size the house sets labels in. */ +function labelWidthOf(a: ResolvedAxis, d: DesignDecisions): (text: string) => number { + const label = a.label as ResolvedAxis['label'] & { fontWeight?: string | number }; + return tableTextMeasurer(label.fontSize ?? 11, label.font ?? d.font ?? PLOTLY_FONT, label.fontWeight ?? 'normal', 'normal'); +} + +/** The air kept between neighbouring names, so 'JanFebMar' does not read as one word. */ +const NAME_GAP = 5; + +function labelsFitStraight(ax: any, key: string, a: ResolvedAxis, width: number, cats: any[], widthOf: (text: string) => number): boolean { if (!key.startsWith('x')) return true; if ((a.label.angle ?? 0) !== 0) return true; if (!Array.isArray(cats) || !cats.length) return true; @@ -1013,9 +1300,7 @@ function labelsFitStraight(ax: any, key: string, a: ResolvedAxis, width: number, const band = (width * (Number.isFinite(span) ? span : 1)) / cats.length; // Wrapped names are as wide as their widest line. const printed = Array.isArray(ax.ticktext) ? ax.ticktext.flatMap((t: any) => String(t).split('
')) : cats; - const longest = Math.max(...printed.map((c: any) => String(c).length)); - // Names need air between them, or 'JanFebMar' reads as one word. - return longest * (a.label.fontSize ?? 11) * 0.58 + 5 <= band; + return Math.max(...printed.map((c: any) => widthOf(String(c)))) + NAME_GAP <= band; } /** @@ -1023,18 +1308,33 @@ function labelsFitStraight(ax: any, key: string, a: ResolvedAxis, width: number, * an ellipsis (`wrap`, which a panel cannot re-break), or on an ordered axis every nth label shown so * the rest stand clear (`skip`). Returns the step taken. */ -function fitOverflowingLabels(ax: any, a: ResolvedAxis, width: number, cats: any[]): LabelFitStep { +function fitOverflowingLabels(ax: any, a: ResolvedAxis, width: number, cats: any[], widthOf: (text: string) => number): LabelFitStep { const span = Array.isArray(ax.domain) && ax.domain.length === 2 ? Math.abs(Number(ax.domain[1]) - Number(ax.domain[0])) : 1; const band = (width * (Number.isFinite(span) ? span : 1)) / cats.length; const fontSize = a.label.fontSize ?? 11; - const em = fontSize * 0.58; const printed: string[] = Array.isArray(ax.ticktext) ? ax.ticktext.map(String) : cats.map(String); - const longest = Math.max(...printed.flatMap((t) => t.split('
')).map((t) => t.length)); + const widest = Math.max(...printed.flatMap((t) => t.split('
')).map(widthOf)); const named = ax.type === undefined || ax.type === 'category' || ax.type === '-'; - const { step } = chooseLabelStep(a.label.overflow ?? DEFAULT_LABEL_OVERFLOW, { - band, widest: longest * em, fontSize, + const path = a.label.overflow ?? DEFAULT_LABEL_OVERFLOW; + // Names that break at a space onto two lines, each within its band, stand flat and whole there, + // as Vega-Lite sets them: the house's first step, before any cut or turn. + if (named && path[0] === 'wrap') { + const names = printed.map((t) => t.replace(/
/g, ' ')); + const two = fitTwoLineLabels(names, fontSize, band - NAME_GAP, false, widthOf); + if (two && two.lines.every((lines) => lines.length <= 2)) { + if (!Array.isArray(ax.tickvals)) { + ax.tickmode = 'array'; + ax.tickvals = cats; + } + ax.ticktext = two.lines.map((lines) => lines.join('
')); + ax.tickangle = 0; + return 'wrap'; + } + } + const { step } = chooseLabelStep(path, { + band, widest, fontSize, turnLimit: a.label.limit === 0 ? Infinity : a.label.limit ?? TURNED_LABEL_LIMIT, noTrim: a.label.limit === 0 || !named, // Names left out can be read from their neighbours only on an ordered axis (dates, ranks). ordered: a.label.ordered === true || !named || ax.type === 'date', @@ -1044,8 +1344,7 @@ function fitOverflowingLabels(ax: any, a: ResolvedAxis, width: number, cats: any return step; } if (step === 'wrap') { - const room = Math.floor((band - 5) / em); - const cut = (t: string) => t.split('
').map((line) => (line.length > room ? `${line.slice(0, Math.max(1, room - 1))}…` : line)).join('
'); + const cut = (t: string) => t.split('
').map((line) => cutToWidth(line, band - NAME_GAP, widthOf)).join('
'); if (!Array.isArray(ax.tickvals)) { ax.tickmode = 'array'; ax.tickvals = cats; @@ -1053,7 +1352,7 @@ function fitOverflowingLabels(ax: any, a: ResolvedAxis, width: number, cats: any ax.ticktext = printed.map(cut); return step; } - ax.ticklabelstep = Math.max(2, Math.ceil((longest * em + 5) / band)); + ax.ticklabelstep = Math.max(2, Math.ceil((widest + NAME_GAP) / band)); return 'skip'; } @@ -1136,9 +1435,10 @@ function applyAxis( // measured again against the panel. if (a.label.angle != null) { ax.tickangle = a.label.angle; - if (!labelsFitStraight(ax, key, a, width, cats)) { + const widthOf = labelWidthOf(a, d); + if (!labelsFitStraight(ax, key, a, width, cats, widthOf)) { // Names too wide for the panel take the first workable step of the house's overflow. - const step = fitOverflowingLabels(ax, a, width, cats); + const step = fitOverflowingLabels(ax, a, width, cats, widthOf); say('axes.label.overflow', 'labels-overflow', `\`${key}\`'s labels do not fit the panel straight — overflow step \`${step}\``); } } @@ -1170,7 +1470,11 @@ function applyAxis( // last tick of one panel prints on top of the first tick of the next. // A log axis is ticked by decade. Asking it for a number of ticks makes // Plotly name every minor as well — 2, 3, 4 … 9 between each power. - if (a.tickCount != null && ax.type !== 'category' && ax.type !== 'log') { + // A facet grid's frame ticked its panels from their own size (`plLayoutFacetGrid`): the house's + // count, shared out over the panels, would leave each a tick or two. + const framed = ax._framedTicks === true; + delete ax._framedTicks; + if (!framed && a.tickCount != null && ax.type !== 'category' && ax.type !== 'log') { const dom = Array.isArray(ax.domain) && ax.domain.length === 2 ? Math.abs(Number(ax.domain[1]) - Number(ax.domain[0])) : 1; @@ -1188,7 +1492,7 @@ function applyAxis( // A budget in *numbers* is not a budget in *room*. Sixteen panels across // one page leave 50px each, which holds one year, not four — and Plotly // will print all four on top of each other rather than drop any. - if (key.startsWith('x') && ax.type !== 'category' && ax.type !== 'log' && ax.showticklabels) { + if (!framed && key.startsWith('x') && ax.type !== 'category' && ax.type !== 'log' && ax.showticklabels) { const dom = Array.isArray(ax.domain) && ax.domain.length === 2 ? Math.abs(Number(ax.domain[1]) - Number(ax.domain[0])) : 1; @@ -1642,6 +1946,12 @@ function applyMarks(figure: any, d: DesignDecisions, table: any[], say: ReportDe ...(trace.marker ?? {}), line: { color: m.point.haloColor, width: m.point.haloWidth }, }; + } else if (m.outline && !isContextTrace(trace) && trace.type !== 'bar') { + // A house that outlines every filled shape outlines its dots too, as Vega-Lite does. + trace.marker = { + ...(trace.marker ?? {}), + line: { color: m.outline.color, width: m.outline.width }, + }; } } @@ -1679,24 +1989,38 @@ function applyMarks(figure: any, d: DesignDecisions, table: any[], say: ReportDe // pixels as data and flatten the differences under its square root. if (m.sizeRange) { const [lo, hi] = m.sizeRange; - for (const trace of figure.data ?? []) { - const sizes = trace?.marker?.size; - if (!Array.isArray(sizes)) continue; - const areas = sizes.map((dm: any) => Math.PI * (Number(dm) / 2) ** 2); - const finite = areas.filter((a: number) => Number.isFinite(a) && a > 0); - if (!finite.length) continue; - const min = Math.min(...finite); - const max = Math.max(...finite); - const floor = m.minSize != null ? Math.max(lo, m.minSize) : lo; - // A bubble the house has scaled down to two pixels is a speck: it - // is neither a readable value nor visibly a mark. Four pixels is - // the floor at which a dot still reads as one. - const MIN_DIAMETER = 4; - trace.marker.size = areas.map((a: number) => { - if (!Number.isFinite(a)) return Math.max(MIN_DIAMETER, diameterOf(floor)); - const t = max > min ? (a - min) / (max - min) : 1; - return Math.max(MIN_DIAMETER, diameterOf(floor + t * (hi - floor))); - }); + const floor = m.minSize != null ? Math.max(lo, m.minSize) : lo; + // A bubble the house has scaled down to two pixels is a speck: it is neither a readable value + // nor visibly a mark. Four pixels is the floor at which a dot still reads as one. + const MIN_DIAMETER = 4; + const sized = (figure.data ?? []).filter((trace: any) => Array.isArray(trace?.marker?.size)); + // One scale over every trace, as Vega-Lite's size scale is one scale over the field: from zero + // to the largest value, onto the house's areas. Scaled trace by trace, each series' largest + // value would draw at the largest area, whatever it is. + const raw = sized.every((trace: any) => Array.isArray(trace._sizeValues)); + if (raw) { + const top = Math.max(0, ...sized.flatMap((trace: any) => trace._sizeValues.filter((v: number) => Number.isFinite(v)))); + for (const trace of sized) { + trace.marker.size = trace._sizeValues.map((v: number) => { + if (!Number.isFinite(v) || !(top > 0)) return Math.max(MIN_DIAMETER, diameterOf(floor)); + return Math.max(MIN_DIAMETER, diameterOf(floor + Math.max(0, v) / top * (hi - floor))); + }); + } + } else { + const areaOf = (dm: any) => Math.PI * (Number(dm) / 2) ** 2; + const finite = sized.flatMap((trace: any) => trace.marker.size.map(areaOf)).filter((a: number) => Number.isFinite(a) && a > 0); + if (finite.length) { + const min = Math.min(...finite); + const max = Math.max(...finite); + for (const trace of sized) { + trace.marker.size = trace.marker.size.map((dm: any) => { + const a = areaOf(dm); + if (!Number.isFinite(a)) return Math.max(MIN_DIAMETER, diameterOf(floor)); + const t = max > min ? (a - min) / (max - min) : 1; + return Math.max(MIN_DIAMETER, diameterOf(floor + t * (hi - floor))); + }); + } + } } } @@ -2109,7 +2433,7 @@ function addFactoredLineLegendProxies(figure: any, d: DesignDecisions): void { } } -function applyLegend(figure: any, d: DesignDecisions, say: ReportDeparture): number { +function applyLegend(figure: any, d: DesignDecisions, say: ReportDeparture): void { const layout = figure.layout; const l = d.legend; @@ -2120,7 +2444,7 @@ function applyLegend(figure: any, d: DesignDecisions, say: ReportDeparture): num if (trace?.colorbar) trace.showscale = false; if (trace?.showscale) trace.showscale = false; } - return 0; + return; } // Plotly draws each entry from its trace's own marker or line; it has no symbol of its own to set. @@ -2149,7 +2473,7 @@ function applyLegend(figure: any, d: DesignDecisions, say: ReportDeparture): num 'legend.show', 'legend-not-drawn', 'legend omitted — every pie slice is already named on the chart, so a second copy would compete with its callout', ); - return 0; + return; } // `seriesEnd` names each series at the end of its own line. Realized as @@ -2159,7 +2483,7 @@ function applyLegend(figure: any, d: DesignDecisions, say: ReportDeparture): num if (placement === 'seriesEnd') { if (labelSeriesEnds(figure, d)) { layout.showlegend = false; - return 0; + return; } placement = (l.fallbacks ?? []).find((p) => p !== 'seriesEnd') ?? 'right'; say('legend.placement', 'legend-placement-fallback', `no series with an end to name — fell back to \`${placement}\``); @@ -2199,77 +2523,40 @@ function applyLegend(figure: any, d: DesignDecisions, say: ReportDeparture): num }); } - // A key above the plot is chrome the figure has to pay for, however it is - // stacked. - if (layout.legend.y > 1) { - if (layout.legend.orientation === 'h') { - return horizontalLegendHeight(figure, l.label.fontSize ?? 11, needsMarkup(l.label).bold); - } - const rows = legendEntries(figure).length; - return rows ? rows * ((l.label.fontSize ?? 11) + 12) + 8 : 0; - } + // A key above the plot is chrome the figure has to pay for, however it is stacked: it is measured + // once the margins it wraps in are settled (see {@link layoutTopChrome}). + if (layout.legend.y > 1) return; // A key beside the plot is paid for in width, for the same reason. if (layout.legend.orientation === 'v' && layout.legend.x >= 1) { - const entries = legendEntries(figure); - if (entries.length) { - const size = l.label.fontSize ?? 11; - const need = Math.ceil(Math.max(...entries.map((e) => e.length)) * size * 0.6) + 40; + const block = plKeyBlock(figure, 'vertical'); + if (block) { const margin = (layout.margin ??= {}); + const plotWidth = Math.max(1, (Number(layout.width) || 0) - (margin.l ?? 0) - (margin.r ?? 0) - (figure._legendRoom?.right ?? 0)); + // The key hangs `x` past the plot's right edge, its box and a gap after its text, clear of the canvas edge. + const need = Math.ceil(plotWidth * (layout.legend.x - 1) + block.width + PLOTLY_PROFILE.key.gap + PLOTLY_PROFILE.edge); const before = margin.r ?? 0; + // The width already held the room the frame kept for the key; the margin now holds the key itself. + const held = figure._legendRoom?.right ?? 0; margin.r = Math.max(before, need); - const grew = margin.r - before; - if (grew > 0 && Number(layout.width)) layout.width = Math.round(layout.width + grew); + if (figure._legendRoom) figure._legendRoom = { ...figure._legendRoom, right: 0 }; + if (Number(layout.width)) layout.width = Math.round(layout.width + margin.r - before - held); } } // A column of keys taller than the plot is simply cut off at the bottom, // so the figure grows to hold it. if (layout.legend.orientation !== 'h') { - const entries = legendEntries(figure); - const need = entries.length * ((l.label.fontSize ?? 11) + 14) + 20; + const block = plKeyBlock(figure, 'vertical'); + const need = block ? block.height : 0; const have = (Number(layout.height) || 0) - (layout.margin?.t ?? 0) - (layout.margin?.b ?? 0); - if (entries.length && have > 0 && need > have) { + if (block && have > 0 && need > have) { layout.height = Math.round(Number(layout.height) + (need - have)); - say('legend.placement', 'legend-figure-grown', `the figure grew ${Math.round(need - have)}px to hold a column of ${entries.length} keys`); + say('legend.placement', 'legend-figure-grown', `the figure grew ${Math.round(need - have)}px to hold a column of ${block.rows} keys`); } } - return 0; } -/** The names a key will carry: one per trace, or one per slice of a pie. */ -function legendEntries(figure: any): string[] { - const out: string[] = []; - for (const t of figure.data ?? []) { - if (t?.showlegend === false) continue; - if (Array.isArray(t?.labels)) out.push(...t.labels.map(String)); - else if (t?.name) out.push(String(t.name)); - } - return out; -} -/** How tall a horizontal key stacks once its entries are packed into the width. */ -function horizontalLegendHeight(figure: any, fontSize: number, bold = false): number { - const entries = legendEntries(figure); - if (!entries.length) return 0; - // A key above the plot is laid out across the *plot area*, not the paper, - // so it wraps sooner than the figure width suggests. - const layout = figure.layout ?? {}; - const width = Math.max( - 120, - (Number(layout.width) || 400) - (layout.margin?.l ?? 0) - (layout.margin?.r ?? 0), - ); - const rowHeight = fontSize + 14; - let rows = 1; - let used = 0; - for (const e of entries) { - const w = e.length * fontSize * (bold ? 0.72 : 0.62) + 46; - if (used > 0 && used + w > width) { - rows++; - used = w; - } else used += w; - } - return rows * rowHeight + 8; -} /** * Where an annotation must sit to land on this value. @@ -2725,29 +3012,47 @@ export function fitPlotlyTitle(figure: any): void { const layout = figure?.layout; const title = layout?.title; const text = typeof title === 'string' ? title : title?.text; - if (!text) return; - const size = title?.font?.size ?? 17; - const width = Number(layout.width) || 400; - const lines = wrapToWidth(String(text).replace(/
/g, ' '), width - 16, size); const deck = title?._deck as string | undefined; - const all = deck ? [...lines, ...wrapToWidth(deck, width - 16, size * 0.75)] : lines; + if (!text && !deck) return; + const size = title?.font?.size ?? 17; + const width = Math.max(Number(layout.width) || 400, titleRoomOf(figure)); + // Plotly's own title: 17 px over the container's centre; the deck a second, smaller line. + const block = planTitleBlock({ title: text ? String(text).replace(/
/g, ' ') : undefined, subtitle: deck }, width - 16, { + headline: { fontSize: size, font: PLOTLY_FONT }, + deck: { fontSize: Math.round(size * 0.75), font: PLOTLY_FONT }, + gap: 0, + }); + if (!block) return; + widenForTitle(layout, block.width + 16, Number(layout.width) || 400); + const headSize = block.headline?.fontSize ?? size; + const headLines = block.headline?.lines ?? []; + const deckLines = block.deck?.lines ?? []; + const all = headLines.length + deckLines.length; + const deckHtml = deckLines.length ? `${deckLines.join('
')}
` : ''; layout.title = { ...(typeof title === 'object' ? title : {}), - text: deck - ? `${lines.join('
')}
${deck}` - : lines.join('
'), + text: [headLines.join('
'), deckHtml].filter(Boolean).join('
'), + ...(headSize !== size ? { font: { ...(title?.font ?? {}), size: headSize } } : {}), x: 0.5, xanchor: 'center', xref: 'container', - y: titleY(layout, all.length, size), + y: titleY(layout, all, headSize), yanchor: 'top', yref: 'container', }; - const need = 8 + titleBlockHeight(all.length, size) + 14; + delete layout.title._deck; + const need = 8 + titleBlockHeight(all, headSize) + 14; const margin = (layout.margin ??= {}); const before = margin.t ?? 0; margin.t = Math.max(before, need); - const grew = margin.t - before; + let grew = margin.t - before; + // The lines a broken title adds come out of a continuous plot, as they do in the plan; the + // canvas grows only by the one line each part takes. + const yaxis = layout.yaxis; + const plotHeight = Number(layout.height) - margin.t - (margin.b ?? 0); + if (grew > 0 && block.broken > 0 && yaxis && yaxis.type !== 'category' && plotHeight > 0) { + grew -= Math.min(block.broken, plotHeight + grew - plotHeightAfter(plotHeight + grew, block.broken)); + } if (grew > 0 && Number(layout.height)) layout.height = Math.round(layout.height + grew); - layout.title.y = titleY(layout, all.length, size); + layout.title.y = titleY(layout, all, headSize); } diff --git a/packages/flint-js/src/react/chart.ts b/packages/flint-js/src/react/chart.ts new file mode 100644 index 00000000..89f97cc9 --- /dev/null +++ b/packages/flint-js/src/react/chart.ts @@ -0,0 +1,727 @@ +import { + createElement, + forwardRef, + useCallback, + useEffect, + useImperativeHandle, + useLayoutEffect, + useMemo, + useRef, + useState, + type CSSProperties, + type ReactNode, +} from 'react'; +import type { ChartAssemblyInput, ChartWarning } from '../core/types'; +import { + conditionUpdates, + createLinkState, + isCanvasInteraction, + isFilterControls, + linkInput, + loadLinks, + resolveInteractionSpec, + type CanvasInteractionDef, + type ChartLink, + type LinkPart, + type LinkSnapshot, + type LinkSpec, + type LinkState, + type ChartChange, + type ChartUpdate, + type ChartUpdateApplyOptions, + type ChartUpdateResult, + type ChartState, + type ExternalInteractionDef, + type FlintInteractionEventDetail, + type InteractionDef, + type InteractiveBackend, + type InteractiveChartSurface, + type InteractiveRendererLoaders, + type InteractiveRenderers, +} from '../interactive/exports'; +import { mountChartWith } from '../interactive/mount'; + +export type { + AxisTargetValue, + CanvasInteractionEvent, + ChartChange, + ChartState, + ChartUpdate, + ChartUpdateApplyOptions, + ChartUpdateResult, + DomainCoordinate, + DomainGeometry, + DomainValue, + FlintInteractionEventDetail, + InteractionDef, + InteractiveBackend, + InteractiveChartSurface, + LegendDomain, + LegendTargetValue, + LinkCondition, + LinkPart, + SemanticElement, + SemanticTarget, +} from '../interactive'; +export type { ChartLink, LinkSnapshot, LinkSpec }; + +export type FlintChartInteractions = + | readonly InteractionDef[] + | ((fromSpec: readonly InteractionDef[]) => readonly InteractionDef[]); + +/** + * How the chart meets its box. `scale-down` scales it down to fit, never up. `crop` keeps + * its size and clips. `relayout` lays it out again for the box, which becomes the + * spec's `canvasSize` ceiling, and scales down whatever still overflows. + */ +export type FlintChartFit = 'scale-down' | 'crop' | 'relayout'; + +/** The spec's definitions; a malformed spec has none here, and the mount reports it. */ +function specInteractions(spec: ChartAssemblyInput): readonly InteractionDef[] | null { + try { + return resolveInteractionSpec(spec.interaction_spec).interactions; + } catch { + return null; + } +} + +export interface FlintChartProps { + /** The Flint spec, `interaction_spec` included. */ + spec: ChartAssemblyInput; + /** Default `'vegalite'`. */ + backend?: InteractiveBackend; + /** + * Renderer factories by backend, from `flint-chart//interactive`, used in place of + * the ones this entry loads: with `flint-chart/react/vegalite`, pass + * `{ echarts: createEChartsInteractiveRenderer }` to draw ECharts too. Read at mount. + */ + renderers?: InteractiveRenderers; + /** An array adds to the spec's interactions; a function receives them and returns the full list. */ + interactions?: FlintChartInteractions; + /** + * Host updates, applied by id: new or changed ids are applied, dropped ids are cleared. + * Passing it, even `[]`, keeps the update runtime on a chart with no interactions; + * without it such a chart renders static. + */ + updates?: readonly ChartUpdate[]; + renderer?: 'svg' | 'canvas'; + /** + * For hosts whose CSP forbids eval: a Vega expression interpreter such as `vega-interpreter`'s. + * Read at mount; a new value applies at the next remount. + */ + expressionInterpreter?: unknown; + /** Changing it re-renders the chart. */ + background?: string; + /** The box the chart sits in, in pixels or a CSS length. Omitted: the chart's natural size. */ + width?: number | string; + height?: number | string; + /** + * Default `'scale-down'`. Under `relayout` each box resize lays the chart out again once it + * settles, in place where only its layout values change, so a selection or zoom survives; a + * room that changes what the chart draws (marks, axes, keys) remounts it, and reader state + * does not survive that. + */ + fit?: FlintChartFit; + onChange?: (change: ChartChange) => void; + onInteraction?: (detail: FlintInteractionEventDetail) => void; + /** After each mount, each applied host update, and each relayout in place. */ + onRender?: (chart: InteractiveChartSurface) => void; + /** After each mount: that mount's warnings, possibly none. */ + onWarnings?: (warnings: readonly ChartWarning[]) => void; + /** + * The chart failed: a compile error, a malformed `interaction_spec`, or a code interaction + * the chart cannot honour. Nothing renders; the box shows a muted error instead. + */ + onError?: (error: Error) => void; + /** Shown until the chart mounts, including in server rendering. */ + fallback?: ReactNode; + className?: string; + style?: CSSProperties; + /** Applied in place. Default: the chart title. */ + ariaLabel?: string; + /** The chart's identity in interaction events; changing it remounts the chart. */ + chartId?: string; +} + +/** The mounted chart, reached through the component's ref; it follows remounts. */ +export interface FlintChartHandle { + readonly surface: InteractiveChartSurface | null; + applyUpdate(update: ChartUpdate, options?: ChartUpdateApplyOptions): Promise; + clearUpdate(id: string): Promise; + dispatch(interactionId: string, payload: unknown): Promise; + getState(): ChartState | undefined; + refresh(): void; +} + +const DEFAULT_SIZE = { width: 400, height: 320 }; +// A box resize re-lays out once it has settled, and only by more than scrollbar jitter. +const RELAYOUT_DELAY_MS = 150; +const RELAYOUT_TOLERANCE_PX = 4; +// A narrower reading is a transient layout pass, not room to lay out into. +const MIN_ROOM_PX = 40; + +const ERROR_STYLE: CSSProperties = { + boxSizing: 'border-box', width: '100%', height: '100%', overflow: 'auto', padding: 12, + display: 'flex', alignItems: 'center', justifyContent: 'center', textAlign: 'center', + border: '1px dashed rgba(0, 0, 0, 0.15)', borderRadius: 4, background: 'rgba(0, 0, 0, 0.02)', + color: 'rgba(0, 0, 0, 0.5)', font: '12px/1.5 system-ui, sans-serif', overflowWrap: 'anywhere', +}; + +// Server rendering has no layout; React warns on useLayoutEffect there. +const useBrowserLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect; + +const referenceIds = new WeakMap(); +let nextReferenceId = 0; + +function referenceId(value: object | undefined): string { + if (!value) return 'none'; + let id = referenceIds.get(value); + if (id === undefined) { + id = ++nextReferenceId; + referenceIds.set(value, id); + } + return `#${id}`; +} + +/** Spec content without its rows, plus the rows by reference: new rows remount, an equal spec does not. */ +export function flintSpecKey(spec: ChartAssemblyInput): string { + const { data, ...rest } = spec; + const { values, ...dataRest } = (data ?? {}) as { values?: unknown[] } & Record; + return `${JSON.stringify(rest)}|${JSON.stringify(dataRest)}|${referenceId(values)}`; +} + +/** An update's content, with `set-data` rows and DOM nodes by reference. */ +export function flintUpdateKey(update: ChartUpdate): string { + return JSON.stringify(update, (key, value) => { + if (key === 'rows' && Array.isArray(value)) return referenceId(value); + if (typeof Node !== 'undefined' && value instanceof Node) return referenceId(value); + return value; + }); +} + +export type UpdateOwner = 'host' | 'reader'; + +export interface UpdatePlan { + apply: ChartUpdate[]; + clear: string[]; +} + +/** + * What to do to move the chart from the updates last applied to the next ones. + * A dropped id is cleared only if the host wrote it last, so a reader's newer + * selection under that id survives the host's stale prop. + */ +export function planUpdates( + applied: ReadonlyMap, + owners: ReadonlyMap, + next: readonly ChartUpdate[], +): UpdatePlan { + const nextIds = new Set(next.map((update) => update.id)); + return { + apply: next.filter((update) => applied.get(update.id) !== flintUpdateKey(update)), + clear: [...applied.keys()].filter((id) => !nextIds.has(id) && owners.get(id) !== 'reader'), + }; +} + +/** + * What the mounted chart depends on in the definitions: ids, presets, and preset options. + * Function-valued options are left out, so they are read at mount. + */ +export function flintInteractionsKey(definitions: readonly InteractionDef[]): string { + return JSON.stringify(definitions.map((definition) => { + if (isFilterControls(definition)) return [definition.id, definition.preset, definition.filterControls.options]; + if (!isCanvasInteraction(definition)) return [definition.id, 'external']; + return [definition.id, definition.preset ?? 'canvas', definition.presetOptions ?? null]; + })); +} + +function cssLength(value: number | string | undefined): string | undefined { + return typeof value === 'number' ? `${value}px` : value; +} + +type Size = { width: number; height: number }; +type Room = { width?: number; height?: number }; + +/** The scale that fits a chart of `natural` size into the sides of `box` the host sized; never above 1. */ +export function fitScale(natural: Size, box: Room, fit: FlintChartFit): number { + if (fit === 'crop') return 1; + const ratios: number[] = []; + if (box.width !== undefined) ratios.push(box.width / natural.width); + if (box.height !== undefined) ratios.push(box.height / natural.height); + return Math.min(1, ...ratios); +} + +/** The room `relayout` lays out into next: unchanged under jitter or a reading too small to be real. */ +export function settleRoom(current: Room | null, measured: Room): Room | null { + const tooSmall = (side: number | undefined) => side !== undefined && side < MIN_ROOM_PX; + if (tooSmall(measured.width) || tooSmall(measured.height)) return current; + const near = (a: number | undefined, b: number | undefined) => + Math.abs((a ?? 0) - (b ?? 0)) < RELAYOUT_TOLERANCE_PX; + return current && near(current.width, measured.width) && near(current.height, measured.height) ? current : measured; +} + +// A replacement mounts out of flow and unseen, under the chart it replaces. +const STAGING_STYLE: Partial = { + position: 'absolute', top: '0', left: '0', visibility: 'hidden', pointerEvents: 'none', +}; + +/** + * A `FlintChart` that draws with the renderer factories `loaders` reach (and those its + * `renderers` prop gives). Each React entry makes its own: `flint-chart/react` loads every + * backend, `flint-chart/react/` only that one. + */ +export function createFlintChart(loaders: InteractiveRendererLoaders) { + return forwardRef(function FlintChart(props, ref) { + const { + spec, backend = 'vegalite', interactions, updates, renderer, background, + width, height, fit = 'scale-down', fallback, className, style, ariaLabel, chartId, + } = props; + const outerRef = useRef(null); + const scalerRef = useRef(null); + const hostRef = useRef(null); + const surfaceRef = useRef(null); + const propsRef = useRef(props); + propsRef.current = props; + const appliedRef = useRef(new Map()); + const ownersRef = useRef(new Map()); + // The chart on screen; a replacement takes its place once it is ready. + const [shown, setShown] = useState(null); + const ready = shown !== null; + // Charts a remount replaced, kept on screen until the new one is ready. + const retiringRef = useRef<{ surface: InteractiveChartSurface; stage: HTMLElement }[]>([]); + const [failure, setFailure] = useState(null); + // Set when the chart becomes ready; `onRender` fires once the ready layout has committed. + const renderedRef = useRef(null); + const [scale, setScale] = useState(1); + const [natural, setNatural] = useState<{ width: number; height: number } | null>(null); + const relayout = fit === 'relayout' && (width !== undefined || height !== undefined); + const [room, setRoom] = useState<{ width?: number; height?: number } | null>(null); + // Under `relayout` the chart mounts once the box is measured, not before and again after. + const waiting = relayout && room === null && typeof ResizeObserver !== 'undefined'; + const roomKey = relayout && room ? `${room.width ?? ''}x${room.height ?? ''}` : ''; + const roomRef = useRef(room); + roomRef.current = room; + // The room the chart on screen was laid out for, and a count that remounts it when a room cannot be laid out in place. + const laidOutRef = useRef(''); + const [remounts, setRemounts] = useState(0); + + const specKey = useMemo(() => flintSpecKey(spec), [spec]); + // Once per spec content, so an inline `interactions` function receives the same definitions each render. + const fromSpec = useMemo(() => specInteractions(spec), [specKey]); + + // A function receives the spec's definitions, so it owns the whole list and the spec's entries are not composed again. + const resolved = useMemo(() => { + if (typeof interactions !== 'function') { + return { input: spec, definitions: interactions ?? [] }; + } + return { + // A malformed spec stays as written, so the mount reports it. + input: spec.interaction_spec && fromSpec + ? { ...spec, interaction_spec: { ...spec.interaction_spec, interactions: [] } } + : spec, + definitions: interactions(fromSpec ?? []), + }; + }, [specKey, fromSpec, interactions]); + const latestDefinitions = useRef(new Map()); + latestDefinitions.current = new Map(resolved.definitions.map((definition) => [definition.id, definition])); + const definitionsKey = flintInteractionsKey(resolved.definitions); + // A chart with no interactions renders static unless the host passes `updates`, even `[]`, or the spec carries some. + const updatable = updates !== undefined || (spec.updates?.length ?? 0) > 0; + // A malformed spec counts as interactive, so the mount reports it. + const specCount = fromSpec === null ? 1 : typeof interactions === 'function' ? 0 : fromSpec.length; + const runtime = updatable || resolved.definitions.length > 0 || specCount > 0; + const runtimeRef = useRef(runtime); + runtimeRef.current = runtime; + + useEffect(() => { + const host = hostRef.current; + if (!host || waiting) return undefined; + let live = true; + setFailure(null); + // Custom handlers reach the latest definition by id, so a new closure needs no remount. + // Presets keep the mounted instance: they may hold private state between gestures. + const definitions = resolved.definitions.map((definition): InteractionDef => { + if (!isCanvasInteraction(definition)) { + // A preset's handler reads the state its controls and bound rows hold, so it stays the mounted one. + if (isFilterControls(definition)) return definition; + const external: ExternalInteractionDef = { ...definition, handle: (payload, context) => { + const latest = latestDefinitions.current.get(definition.id) ?? definition; + return isCanvasInteraction(latest) ? null : latest.handle(payload, context); + } }; + return external; + } + if (!definition.handle || definition.origin === 'spec' || definition.preset) return definition; + const canvas: CanvasInteractionDef = { ...definition, handle: (event, context) => { + const latest = latestDefinitions.current.get(definition.id); + return (latest && isCanvasInteraction(latest) ? latest : definition).handle?.(event, context) ?? null; + } }; + return canvas; + }); + const initialUpdates = propsRef.current.updates ?? []; + appliedRef.current = new Map(initialUpdates.map((update) => [update.id, flintUpdateKey(update)])); + ownersRef.current = new Map(initialUpdates.map((update) => [update.id, 'host' as const])); + let surface: InteractiveChartSurface; + const stage = document.createElement('div'); + if (retiringRef.current.length > 0) Object.assign(stage.style, STAGING_STYLE); + host.append(stage); + const settle = (): void => { + for (const old of retiringRef.current) { + old.surface.destroy(); + old.stage.remove(); + } + retiringRef.current = []; + stage.removeAttribute('style'); + }; + const fail = (error: unknown): void => { + const failed = error instanceof Error ? error : new Error(String(error)); + settle(); + setShown(null); + setFailure(failed.message); + propsRef.current.onError?.(failed); + }; + try { + surface = mountChartWith(loaders, stage, resolved.input, { + backend, renderer, background, chartId, + renderers: propsRef.current.renderers, + expressionInterpreter: propsRef.current.expressionInterpreter, + ariaLabel: propsRef.current.ariaLabel, + interactions: definitions, + updates: initialUpdates, + semanticUpdates: updatable, + availableSize: relayout && roomRef.current ? roomRef.current : undefined, + }); + laidOutRef.current = roomKey; + } catch (error) { + stage.remove(); + fail(error); + return undefined; + } + surfaceRef.current = surface; + const offChange = surface.onChange((change) => { + if (change.source === 'reader' && change.interactionId) ownersRef.current.set(change.interactionId, 'reader'); + propsRef.current.onChange?.(change); + }); + const offInteraction = surface.onInteraction((detail) => propsRef.current.onInteraction?.(detail)); + void surface.warnings.then((warnings) => { + if (live) propsRef.current.onWarnings?.(warnings); + }); + void surface.ready.then(() => { + if (!live) return; + settle(); + renderedRef.current = surface; + setShown(surface); + }, (error) => { + if (live) fail(error); + }); + return () => { + live = false; + renderedRef.current = null; + offChange(); + offInteraction(); + if (surfaceRef.current === surface) surfaceRef.current = null; + // Destroyed when the replacement is ready, or on unmount. + stage.style.pointerEvents = 'none'; + retiringRef.current.push({ surface, stage }); + }; + }, [specKey, definitionsKey, updatable, backend, renderer, background, chartId, waiting, relayout, remounts]); + + // A new room lays the chart out again in place, or remounts it when its layout changes in kind. + useEffect(() => { + const surface = surfaceRef.current; + if (!surface || !relayout || !roomKey || roomKey === laidOutRef.current) return; + laidOutRef.current = roomKey; + let live = true; + void surface.relayout(roomRef.current ?? {}).then((inPlace) => { + if (!live || surfaceRef.current !== surface) return; + if (!inPlace) setRemounts((count) => count + 1); + else propsRef.current.onRender?.(surface); + }); + return () => { + live = false; + }; + }, [roomKey, relayout]); + + // Declared after the mount effect, so on unmount it runs after that effect retires the last chart. + useEffect(() => () => { + for (const old of retiringRef.current) { + old.surface.destroy(); + old.stage.remove(); + } + retiringRef.current = []; + }, []); + + // The room `relayout` lays the chart out into: the sides of the box the host sized. + useBrowserLayoutEffect(() => { + const outer = outerRef.current; + if (!relayout || !outer || typeof ResizeObserver === 'undefined') { + setRoom(null); + return undefined; + } + const commit = (): void => { + setRoom((current) => settleRoom(current, { + width: width !== undefined ? Math.floor(outer.clientWidth) : undefined, + height: height !== undefined ? Math.floor(outer.clientHeight) : undefined, + })); + }; + commit(); + let timer: ReturnType | undefined; + const observer = new ResizeObserver(() => { + clearTimeout(timer); + timer = setTimeout(commit, RELAYOUT_DELAY_MS); + }); + observer.observe(outer); + return () => { + observer.disconnect(); + clearTimeout(timer); + }; + }, [relayout, width, height]); + + useEffect(() => { + for (const root of hostRef.current?.querySelectorAll('[data-flint-chart-id]') ?? []) { + root.setAttribute('aria-label', ariaLabel ?? resolved.input.chart_spec.title ?? 'Interactive chart'); + } + }, [ariaLabel]); + + useEffect(() => { + const surface = surfaceRef.current; + if (!surface) return; + const plan = planUpdates(appliedRef.current, ownersRef.current, updates ?? []); + if (plan.apply.length === 0 && plan.clear.length === 0) return; + for (const update of plan.apply) { + appliedRef.current.set(update.id, flintUpdateKey(update)); + ownersRef.current.set(update.id, 'host'); + } + for (const id of [...appliedRef.current.keys()]) { + if (!(updates ?? []).some((update) => update.id === id)) appliedRef.current.delete(id); + } + void (async () => { + for (const update of plan.apply) await surface.applyUpdate(update); + for (const id of plan.clear) await surface.clearUpdate(id); + if (surfaceRef.current === surface) propsRef.current.onRender?.(surface); + })(); + }, [updates]); + + // The chart keeps its compiled size; the box only scales it. + useBrowserLayoutEffect(() => { + const outer = outerRef.current; + const scaler = scalerRef.current; + if (!outer || !scaler || !ready || typeof ResizeObserver === 'undefined') return undefined; + const measure = (): void => { + const naturalWidth = scaler.offsetWidth; + const naturalHeight = scaler.offsetHeight; + if (naturalWidth === 0 || naturalHeight === 0) return; + const next = fitScale({ width: naturalWidth, height: naturalHeight }, { + width: width !== undefined ? outer.clientWidth : undefined, + height: height !== undefined ? outer.clientHeight : undefined, + }, fit); + setNatural((current) => current?.width === naturalWidth && current.height === naturalHeight + ? current + : { width: naturalWidth, height: naturalHeight }); + setScale((current) => Math.abs(current - next) < 1e-3 ? current : next); + }; + const observer = new ResizeObserver(measure); + observer.observe(outer); + observer.observe(scaler); + measure(); + return () => observer.disconnect(); + }, [shown, width, height, fit]); + + useEffect(() => { + surfaceRef.current?.refresh(); + }, [scale]); + + // After the placeholder size is gone, so the host measures the laid-out chart. + useBrowserLayoutEffect(() => { + const surface = renderedRef.current; + if (!surface || surface !== shown) return; + renderedRef.current = null; + propsRef.current.onRender?.(surface); + }, [shown]); + + useImperativeHandle(ref, () => ({ + get surface() { return surfaceRef.current; }, + applyUpdate: async (update, options) => { + const surface = surfaceRef.current; + if (!surface) return null; + if (!runtimeRef.current) { + console.warn('FlintChart: this chart has no interactions, so it renders static. Pass `updates` (even `[]`) to update it.'); + return null; + } + ownersRef.current.set(update.id, 'host'); + return surface.applyUpdate(update, options); + }, + clearUpdate: async (id) => { + await surfaceRef.current?.clearUpdate(id); + }, + dispatch: async (interactionId, payload) => surfaceRef.current?.dispatch(interactionId, payload) ?? null, + getState: () => surfaceRef.current?.getState(), + refresh: () => surfaceRef.current?.refresh(), + }), []); + + const base = spec.chart_spec.baseSize ?? DEFAULT_SIZE; + const placeholder = { + width: Math.min(base.width, room?.width ?? Infinity), + height: Math.min(base.height, room?.height ?? Infinity), + }; + const scaled = natural && scale !== 1 ? { width: natural.width * scale, height: natural.height * scale } : null; + const outerStyle: CSSProperties = { + position: 'relative', + width: cssLength(width) ?? (scaled ? scaled.width : undefined), + height: cssLength(height) ?? (scaled ? scaled.height : undefined), + // Without a box nothing needs clipping, and floating panels may extend past the chart. + overflow: width === undefined && height === undefined ? undefined : 'hidden', + ...(width !== undefined || height !== undefined ? { + display: 'flex', + // A cropped chart that overflows starts at the box's edge rather than losing it. + justifyContent: fit === 'crop' ? 'safe center' : 'center', + alignItems: fit === 'crop' ? 'safe center' : 'center', + // As a flex or grid item the box takes the host's size, not the chart's. + minWidth: 0, + minHeight: 0, + } : {}), + ...style, + }; + const scalerStyle: CSSProperties = { + width: 'max-content', + flex: 'none', + // The box centres the chart's layout size, which may spill evenly past it; scaling about + // the centre then lands the drawn chart centred inside the box, as `object-fit` does. + transformOrigin: 'center', + ...(scale !== 1 ? { transform: `scale(${scale})` } : {}), + }; + // Until the chart mounts, the box holds the spec's size so the page does not shift. + const hostStyle: CSSProperties = ready + ? { position: 'relative' } + : { position: 'relative', width: placeholder.width, height: placeholder.height }; + const overlay = failure !== null + ? createElement('div', { role: 'alert', 'data-flint-chart-error': '', style: ERROR_STYLE }, `Chart could not render: ${failure}`) + : fallback !== undefined ? fallback : null; + return createElement('div', { ref: outerRef, className, style: outerStyle }, + !ready && overlay !== null + ? createElement('div', { style: { position: 'absolute', inset: 0 } }, overlay) + : null, + createElement('div', { ref: scalerRef, style: scalerStyle }, + createElement('div', { ref: hostRef, style: hostStyle }))); + }); +} + +/** One chart's part in `useLinkedCharts`, merged into its own props: its `updates` go after the host's. */ +export interface LinkedChartProps { + onChange: (change: ChartChange) => void; + onRender: (chart: InteractiveChartSurface) => void; + updates: readonly ChartUpdate[]; +} + +export interface LinkedCharts { + /** + * The props a chart takes part with, by the id it has in `inputs`. Pass the chart's own + * `onChange`, `onRender` and `updates` here: props set after the spread replace the link's. + */ + chart(id: string, own?: Partial): LinkedChartProps; + /** The committed condition, the chart each part came from, and what the charts show. */ + condition: LinkSnapshot; + /** What each chart sends and receives, and why anything is left out; null until checked. */ + links: Record | null; + /** Selects from outside the charts, e.g. from a table row or a filter control; `null` lets a field go. */ + select(parts: Record, options?: { from?: string }): void; + clear(): void; +} + +const NO_LINK_UPDATES: readonly ChartUpdate[] = []; +const NO_SNAPSHOT: LinkSnapshot = { condition: {}, from: {}, shown: {} }; + +/** What decides a chart's part in a link: its encodings, interactions and columns, not its rows. */ +function linkKey(input: ChartAssemblyInput): string { + const rows = (input.data as { values?: Record[] } | undefined)?.values; + return JSON.stringify([input.chart_spec, input.interaction_spec ?? null, input.semantic_types ?? null, Object.keys(rows?.[0] ?? {})]); +} + +/** + * Links ``s on the fields they share, as `linkCharts` links mounted surfaces. The + * condition survives remounts, because each chart re-applies its `updates`, and new rows, so a + * host may filter by it. + */ +export function useLinkedCharts(inputs: Record, spec: LinkSpec): LinkedCharts { + const key = `${JSON.stringify(spec)}\n${Object.entries(inputs).map(([id, input]) => `${id}=${linkKey(input)}`).join('\n')}`; + const latest = useRef({ inputs, spec }); + latest.current = { inputs, spec }; + const [state, setState] = useState(null); + const [snapshot, setSnapshot] = useState(NO_SNAPSHOT); + const stateRef = useRef(state); + stateRef.current = state; + const surfaces = useRef(new Map()); + const handlers = useRef(new Map>()); + const owners = useRef(new Map>()); + // Presets a chart mounts from its `interactions` prop select too; the link checks again once a + // chart reports ones its spec does not list. + const [mountedKey, setMountedKey] = useState(''); + const mountedKeys = useRef(new Map()); + + useEffect(() => { + let stale = false; + const inputs = Object.fromEntries(Object.entries(latest.current.inputs).map(([id, input]) => { + const surface = surfaces.current.get(id); + return [id, surface ? linkInput({ input, surface }) : input]; + })); + void loadLinks(inputs, latest.current.spec).then((links) => { + if (stale) return; + const next = createLinkState(links, stateRef.current?.snapshot()); + setState(next); + setSnapshot(next.snapshot()); + }); + return () => { + stale = true; + }; + }, [key, mountedKey]); + + const updates = useMemo(() => { + const layers = state ? conditionUpdates(state.links, snapshot.shown) : new Map(); + return new Map([...layers].map(([id, layer]) => [id, [layer] as readonly ChartUpdate[]])); + }, [state, snapshot]); + + const chart = useCallback((id: string, own?: Partial): LinkedChartProps => { + owners.current.set(id, own ?? {}); + let handler = handlers.current.get(id); + if (!handler) { + handler = { + onChange: (change) => { + owners.current.get(id)?.onChange?.(change); + const current = stateRef.current; + if (!current) return; + const { changed, dropOwn } = current.read(id, change); + if (dropOwn) void surfaces.current.get(id)?.clearUpdate(dropOwn); + if (changed) setSnapshot(current.snapshot()); + }, + onRender: (surface) => { + surfaces.current.set(id, surface); + const input = latest.current.inputs[id]; + if (input) { + const mounted = JSON.stringify(linkInput({ input, surface }).interaction_spec ?? null); + if (mountedKeys.current.get(id) !== mounted) { + mountedKeys.current.set(id, mounted); + if (mounted !== JSON.stringify(input.interaction_spec ?? null)) setMountedKey([...mountedKeys.current].join('|')); + } + } + owners.current.get(id)?.onRender?.(surface); + }, + }; + handlers.current.set(id, handler); + } + const layer = updates.get(id) ?? NO_LINK_UPDATES; + return { ...handler, updates: own?.updates?.length ? [...own.updates, ...layer] : layer }; + }, [updates]); + + const select = useCallback((parts: Record, options?: { from?: string }) => { + const current = stateRef.current; + if (current?.select(parts, options?.from)) setSnapshot(current.snapshot()); + }, []); + + const clear = useCallback(() => { + const current = stateRef.current; + if (current?.clear()) setSnapshot(current.snapshot()); + }, []); + + return { chart, condition: snapshot, links: state?.links ?? null, select, clear }; +} + +export { FlintTable, MAX_TABLE_ROWS, emphasizedRows, nextSort, sortedRows, tableNotes, type FlintTableProps, type TableSort } from './table'; diff --git a/packages/flint-js/src/react/chartjs.ts b/packages/flint-js/src/react/chartjs.ts new file mode 100644 index 00000000..975d7f36 --- /dev/null +++ b/packages/flint-js/src/react/chartjs.ts @@ -0,0 +1,11 @@ +import { createFlintChart } from './chart'; + +export * from './chart'; + +/** + * `FlintChart` with Chart.js only, so a bundler resolves no other backend: the app installs + * chart.js and nothing else. Another backend draws where the `renderers` prop gives its factory. + */ +export const FlintChart = createFlintChart({ + chartjs: () => import('../chartjs/interactive').then((m) => m.createChartjsInteractiveRenderer), +}); diff --git a/packages/flint-js/src/react/echarts.ts b/packages/flint-js/src/react/echarts.ts new file mode 100644 index 00000000..ba0ce09d --- /dev/null +++ b/packages/flint-js/src/react/echarts.ts @@ -0,0 +1,11 @@ +import { createFlintChart } from './chart'; + +export * from './chart'; + +/** + * `FlintChart` with ECharts only, so a bundler resolves no other backend: the app installs + * echarts and nothing else. Another backend draws where the `renderers` prop gives its factory. + */ +export const FlintChart = createFlintChart({ + echarts: () => import('../echarts/interactive').then((m) => m.createEChartsInteractiveRenderer), +}); diff --git a/packages/flint-js/src/react/index.ts b/packages/flint-js/src/react/index.ts index 75467cac..93cea570 100644 --- a/packages/flint-js/src/react/index.ts +++ b/packages/flint-js/src/react/index.ts @@ -1,711 +1,14 @@ -import { - createElement, - forwardRef, - useCallback, - useEffect, - useImperativeHandle, - useLayoutEffect, - useMemo, - useRef, - useState, - type CSSProperties, - type ReactNode, -} from 'react'; -import type { ChartAssemblyInput, ChartWarning } from '../core/types'; -import { - conditionUpdates, - createLinkState, - isCanvasInteraction, - isFilterControls, - linkInput, - loadLinks, - mountChart, - resolveInteractionSpec, - type CanvasInteractionDef, - type ChartLink, - type LinkPart, - type LinkSnapshot, - type LinkSpec, - type LinkState, - type ChartChange, - type ChartUpdate, - type ChartUpdateApplyOptions, - type ChartUpdateResult, - type ChartState, - type ExternalInteractionDef, - type FlintInteractionEventDetail, - type InteractionDef, - type InteractiveBackend, - type InteractiveChartSurface, -} from '../interactive'; +import { createFlintChart } from './chart'; -export type { - AxisTargetValue, - CanvasInteractionEvent, - ChartChange, - ChartState, - ChartUpdate, - ChartUpdateApplyOptions, - ChartUpdateResult, - DomainCoordinate, - DomainGeometry, - DomainValue, - FlintInteractionEventDetail, - InteractionDef, - InteractiveBackend, - InteractiveChartSurface, - LegendDomain, - LegendTargetValue, - LinkCondition, - LinkPart, - SemanticElement, - SemanticTarget, -} from '../interactive'; -export type { ChartLink, LinkSnapshot, LinkSpec }; - -export type FlintChartInteractions = - | readonly InteractionDef[] - | ((fromSpec: readonly InteractionDef[]) => readonly InteractionDef[]); - -/** - * How the chart meets its box. `scale-down` scales it down to fit, never up. `crop` keeps - * its size and clips. `relayout` lays it out again for the box, which becomes the - * spec's `canvasSize` ceiling, and scales down whatever still overflows. - */ -export type FlintChartFit = 'scale-down' | 'crop' | 'relayout'; - -/** The spec's definitions; a malformed spec has none here, and the mount reports it. */ -function specInteractions(spec: ChartAssemblyInput): readonly InteractionDef[] | null { - try { - return resolveInteractionSpec(spec.interaction_spec).interactions; - } catch { - return null; - } -} - -export interface FlintChartProps { - /** The Flint spec, `interaction_spec` included. */ - spec: ChartAssemblyInput; - /** Default `'vegalite'`. */ - backend?: InteractiveBackend; - /** An array adds to the spec's interactions; a function receives them and returns the full list. */ - interactions?: FlintChartInteractions; - /** - * Host updates, applied by id: new or changed ids are applied, dropped ids are cleared. - * Passing it, even `[]`, keeps the update runtime on a chart with no interactions; - * without it such a chart renders static. - */ - updates?: readonly ChartUpdate[]; - renderer?: 'svg' | 'canvas'; - /** - * For hosts whose CSP forbids eval: a Vega expression interpreter such as `vega-interpreter`'s. - * Read at mount; a new value applies at the next remount. - */ - expressionInterpreter?: unknown; - /** Changing it re-renders the chart. */ - background?: string; - /** The box the chart sits in, in pixels or a CSS length. Omitted: the chart's natural size. */ - width?: number | string; - height?: number | string; - /** - * Default `'scale-down'`. Under `relayout` each box resize lays the chart out again once it - * settles, in place where only its layout values change, so a selection or zoom survives; a - * room that changes what the chart draws (marks, axes, keys) remounts it, and reader state - * does not survive that. - */ - fit?: FlintChartFit; - onChange?: (change: ChartChange) => void; - onInteraction?: (detail: FlintInteractionEventDetail) => void; - /** After each mount, each applied host update, and each relayout in place. */ - onRender?: (chart: InteractiveChartSurface) => void; - /** After each mount: that mount's warnings, possibly none. */ - onWarnings?: (warnings: readonly ChartWarning[]) => void; - /** - * The chart failed: a compile error, a malformed `interaction_spec`, or a code interaction - * the chart cannot honour. Nothing renders; the box shows a muted error instead. - */ - onError?: (error: Error) => void; - /** Shown until the chart mounts, including in server rendering. */ - fallback?: ReactNode; - className?: string; - style?: CSSProperties; - /** Applied in place. Default: the chart title. */ - ariaLabel?: string; - /** The chart's identity in interaction events; changing it remounts the chart. */ - chartId?: string; -} - -/** The mounted chart, reached through the component's ref; it follows remounts. */ -export interface FlintChartHandle { - readonly surface: InteractiveChartSurface | null; - applyUpdate(update: ChartUpdate, options?: ChartUpdateApplyOptions): Promise; - clearUpdate(id: string): Promise; - dispatch(interactionId: string, payload: unknown): Promise; - getState(): ChartState | undefined; - refresh(): void; -} - -const DEFAULT_SIZE = { width: 400, height: 320 }; -// A box resize re-lays out once it has settled, and only by more than scrollbar jitter. -const RELAYOUT_DELAY_MS = 150; -const RELAYOUT_TOLERANCE_PX = 4; -// A narrower reading is a transient layout pass, not room to lay out into. -const MIN_ROOM_PX = 40; - -const ERROR_STYLE: CSSProperties = { - boxSizing: 'border-box', width: '100%', height: '100%', overflow: 'auto', padding: 12, - display: 'flex', alignItems: 'center', justifyContent: 'center', textAlign: 'center', - border: '1px dashed rgba(0, 0, 0, 0.15)', borderRadius: 4, background: 'rgba(0, 0, 0, 0.02)', - color: 'rgba(0, 0, 0, 0.5)', font: '12px/1.5 system-ui, sans-serif', overflowWrap: 'anywhere', -}; - -// Server rendering has no layout; React warns on useLayoutEffect there. -const useBrowserLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect; - -const referenceIds = new WeakMap(); -let nextReferenceId = 0; - -function referenceId(value: object | undefined): string { - if (!value) return 'none'; - let id = referenceIds.get(value); - if (id === undefined) { - id = ++nextReferenceId; - referenceIds.set(value, id); - } - return `#${id}`; -} - -/** Spec content without its rows, plus the rows by reference: new rows remount, an equal spec does not. */ -export function flintSpecKey(spec: ChartAssemblyInput): string { - const { data, ...rest } = spec; - const { values, ...dataRest } = (data ?? {}) as { values?: unknown[] } & Record; - return `${JSON.stringify(rest)}|${JSON.stringify(dataRest)}|${referenceId(values)}`; -} - -/** An update's content, with `set-data` rows and DOM nodes by reference. */ -export function flintUpdateKey(update: ChartUpdate): string { - return JSON.stringify(update, (key, value) => { - if (key === 'rows' && Array.isArray(value)) return referenceId(value); - if (typeof Node !== 'undefined' && value instanceof Node) return referenceId(value); - return value; - }); -} - -export type UpdateOwner = 'host' | 'reader'; - -export interface UpdatePlan { - apply: ChartUpdate[]; - clear: string[]; -} +export * from './chart'; /** - * What to do to move the chart from the updates last applied to the next ones. - * A dropped id is cleared only if the host wrote it last, so a reader's newer - * selection under that id survives the host's stale prop. + * Draws a Flint spec on any backend, loading its renderer on first draw. A bundler resolves every + * backend this can load; an app that installs only some imports `flint-chart/react/`. */ -export function planUpdates( - applied: ReadonlyMap, - owners: ReadonlyMap, - next: readonly ChartUpdate[], -): UpdatePlan { - const nextIds = new Set(next.map((update) => update.id)); - return { - apply: next.filter((update) => applied.get(update.id) !== flintUpdateKey(update)), - clear: [...applied.keys()].filter((id) => !nextIds.has(id) && owners.get(id) !== 'reader'), - }; -} - -/** - * What the mounted chart depends on in the definitions: ids, presets, and preset options. - * Function-valued options are left out, so they are read at mount. - */ -export function flintInteractionsKey(definitions: readonly InteractionDef[]): string { - return JSON.stringify(definitions.map((definition) => { - if (isFilterControls(definition)) return [definition.id, definition.preset, definition.filterControls.options]; - if (!isCanvasInteraction(definition)) return [definition.id, 'external']; - return [definition.id, definition.preset ?? 'canvas', definition.presetOptions ?? null]; - })); -} - -function cssLength(value: number | string | undefined): string | undefined { - return typeof value === 'number' ? `${value}px` : value; -} - -type Size = { width: number; height: number }; -type Room = { width?: number; height?: number }; - -/** The scale that fits a chart of `natural` size into the sides of `box` the host sized; never above 1. */ -export function fitScale(natural: Size, box: Room, fit: FlintChartFit): number { - if (fit === 'crop') return 1; - const ratios: number[] = []; - if (box.width !== undefined) ratios.push(box.width / natural.width); - if (box.height !== undefined) ratios.push(box.height / natural.height); - return Math.min(1, ...ratios); -} - -/** The room `relayout` lays out into next: unchanged under jitter or a reading too small to be real. */ -export function settleRoom(current: Room | null, measured: Room): Room | null { - const tooSmall = (side: number | undefined) => side !== undefined && side < MIN_ROOM_PX; - if (tooSmall(measured.width) || tooSmall(measured.height)) return current; - const near = (a: number | undefined, b: number | undefined) => - Math.abs((a ?? 0) - (b ?? 0)) < RELAYOUT_TOLERANCE_PX; - return current && near(current.width, measured.width) && near(current.height, measured.height) ? current : measured; -} - -// A replacement mounts out of flow and unseen, under the chart it replaces. -const STAGING_STYLE: Partial = { - position: 'absolute', top: '0', left: '0', visibility: 'hidden', pointerEvents: 'none', -}; - -export const FlintChart = forwardRef(function FlintChart(props, ref) { - const { - spec, backend = 'vegalite', interactions, updates, renderer, background, - width, height, fit = 'scale-down', fallback, className, style, ariaLabel, chartId, - } = props; - const outerRef = useRef(null); - const scalerRef = useRef(null); - const hostRef = useRef(null); - const surfaceRef = useRef(null); - const propsRef = useRef(props); - propsRef.current = props; - const appliedRef = useRef(new Map()); - const ownersRef = useRef(new Map()); - // The chart on screen; a replacement takes its place once it is ready. - const [shown, setShown] = useState(null); - const ready = shown !== null; - // Charts a remount replaced, kept on screen until the new one is ready. - const retiringRef = useRef<{ surface: InteractiveChartSurface; stage: HTMLElement }[]>([]); - const [failure, setFailure] = useState(null); - // Set when the chart becomes ready; `onRender` fires once the ready layout has committed. - const renderedRef = useRef(null); - const [scale, setScale] = useState(1); - const [natural, setNatural] = useState<{ width: number; height: number } | null>(null); - const relayout = fit === 'relayout' && (width !== undefined || height !== undefined); - const [room, setRoom] = useState<{ width?: number; height?: number } | null>(null); - // Under `relayout` the chart mounts once the box is measured, not before and again after. - const waiting = relayout && room === null && typeof ResizeObserver !== 'undefined'; - const roomKey = relayout && room ? `${room.width ?? ''}x${room.height ?? ''}` : ''; - const roomRef = useRef(room); - roomRef.current = room; - // The room the chart on screen was laid out for, and a count that remounts it when a room cannot be laid out in place. - const laidOutRef = useRef(''); - const [remounts, setRemounts] = useState(0); - - const specKey = useMemo(() => flintSpecKey(spec), [spec]); - // Once per spec content, so an inline `interactions` function receives the same definitions each render. - const fromSpec = useMemo(() => specInteractions(spec), [specKey]); - - // A function receives the spec's definitions, so it owns the whole list and the spec's entries are not composed again. - const resolved = useMemo(() => { - if (typeof interactions !== 'function') { - return { input: spec, definitions: interactions ?? [] }; - } - return { - // A malformed spec stays as written, so the mount reports it. - input: spec.interaction_spec && fromSpec - ? { ...spec, interaction_spec: { ...spec.interaction_spec, interactions: [] } } - : spec, - definitions: interactions(fromSpec ?? []), - }; - }, [specKey, fromSpec, interactions]); - const latestDefinitions = useRef(new Map()); - latestDefinitions.current = new Map(resolved.definitions.map((definition) => [definition.id, definition])); - const definitionsKey = flintInteractionsKey(resolved.definitions); - // A chart with no interactions renders static unless the host passes `updates`, even `[]`. - const updatable = updates !== undefined; - // A malformed spec counts as interactive, so the mount reports it. - const specCount = fromSpec === null ? 1 : typeof interactions === 'function' ? 0 : fromSpec.length; - const runtime = updatable || resolved.definitions.length > 0 || specCount > 0; - const runtimeRef = useRef(runtime); - runtimeRef.current = runtime; - - useEffect(() => { - const host = hostRef.current; - if (!host || waiting) return undefined; - let live = true; - setFailure(null); - // Custom handlers reach the latest definition by id, so a new closure needs no remount. - // Presets keep the mounted instance: they may hold private state between gestures. - const definitions = resolved.definitions.map((definition): InteractionDef => { - if (!isCanvasInteraction(definition)) { - // A preset's handler reads the state its controls and bound rows hold, so it stays the mounted one. - if (isFilterControls(definition)) return definition; - const external: ExternalInteractionDef = { ...definition, handle: (payload, context) => { - const latest = latestDefinitions.current.get(definition.id) ?? definition; - return isCanvasInteraction(latest) ? null : latest.handle(payload, context); - } }; - return external; - } - if (!definition.handle || definition.origin === 'spec' || definition.preset) return definition; - const canvas: CanvasInteractionDef = { ...definition, handle: (event, context) => { - const latest = latestDefinitions.current.get(definition.id); - return (latest && isCanvasInteraction(latest) ? latest : definition).handle?.(event, context) ?? null; - } }; - return canvas; - }); - const initialUpdates = propsRef.current.updates ?? []; - appliedRef.current = new Map(initialUpdates.map((update) => [update.id, flintUpdateKey(update)])); - ownersRef.current = new Map(initialUpdates.map((update) => [update.id, 'host' as const])); - let surface: InteractiveChartSurface; - const stage = document.createElement('div'); - if (retiringRef.current.length > 0) Object.assign(stage.style, STAGING_STYLE); - host.append(stage); - const settle = (): void => { - for (const old of retiringRef.current) { - old.surface.destroy(); - old.stage.remove(); - } - retiringRef.current = []; - stage.removeAttribute('style'); - }; - const fail = (error: unknown): void => { - const failed = error instanceof Error ? error : new Error(String(error)); - settle(); - setShown(null); - setFailure(failed.message); - propsRef.current.onError?.(failed); - }; - try { - surface = mountChart(stage, resolved.input, { - backend, renderer, background, chartId, - expressionInterpreter: propsRef.current.expressionInterpreter, - ariaLabel: propsRef.current.ariaLabel, - interactions: definitions, - updates: initialUpdates, - semanticUpdates: updatable, - availableSize: relayout && roomRef.current ? roomRef.current : undefined, - }); - laidOutRef.current = roomKey; - } catch (error) { - stage.remove(); - fail(error); - return undefined; - } - surfaceRef.current = surface; - const offChange = surface.onChange((change) => { - if (change.source === 'reader' && change.interactionId) ownersRef.current.set(change.interactionId, 'reader'); - propsRef.current.onChange?.(change); - }); - const offInteraction = surface.onInteraction((detail) => propsRef.current.onInteraction?.(detail)); - void surface.warnings.then((warnings) => { - if (live) propsRef.current.onWarnings?.(warnings); - }); - void surface.ready.then(() => { - if (!live) return; - settle(); - renderedRef.current = surface; - setShown(surface); - }, (error) => { - if (live) fail(error); - }); - return () => { - live = false; - renderedRef.current = null; - offChange(); - offInteraction(); - if (surfaceRef.current === surface) surfaceRef.current = null; - // Destroyed when the replacement is ready, or on unmount. - stage.style.pointerEvents = 'none'; - retiringRef.current.push({ surface, stage }); - }; - }, [specKey, definitionsKey, updatable, backend, renderer, background, chartId, waiting, relayout, remounts]); - - // A new room lays the chart out again in place, or remounts it when its layout changes in kind. - useEffect(() => { - const surface = surfaceRef.current; - if (!surface || !relayout || !roomKey || roomKey === laidOutRef.current) return; - laidOutRef.current = roomKey; - let live = true; - void surface.relayout(roomRef.current ?? {}).then((inPlace) => { - if (!live || surfaceRef.current !== surface) return; - if (!inPlace) setRemounts((count) => count + 1); - else propsRef.current.onRender?.(surface); - }); - return () => { - live = false; - }; - }, [roomKey, relayout]); - - // Declared after the mount effect, so on unmount it runs after that effect retires the last chart. - useEffect(() => () => { - for (const old of retiringRef.current) { - old.surface.destroy(); - old.stage.remove(); - } - retiringRef.current = []; - }, []); - - // The room `relayout` lays the chart out into: the sides of the box the host sized. - useBrowserLayoutEffect(() => { - const outer = outerRef.current; - if (!relayout || !outer || typeof ResizeObserver === 'undefined') { - setRoom(null); - return undefined; - } - const commit = (): void => { - setRoom((current) => settleRoom(current, { - width: width !== undefined ? Math.floor(outer.clientWidth) : undefined, - height: height !== undefined ? Math.floor(outer.clientHeight) : undefined, - })); - }; - commit(); - let timer: ReturnType | undefined; - const observer = new ResizeObserver(() => { - clearTimeout(timer); - timer = setTimeout(commit, RELAYOUT_DELAY_MS); - }); - observer.observe(outer); - return () => { - observer.disconnect(); - clearTimeout(timer); - }; - }, [relayout, width, height]); - - useEffect(() => { - for (const root of hostRef.current?.querySelectorAll('[data-flint-chart-id]') ?? []) { - root.setAttribute('aria-label', ariaLabel ?? resolved.input.chart_spec.title ?? 'Interactive chart'); - } - }, [ariaLabel]); - - useEffect(() => { - const surface = surfaceRef.current; - if (!surface) return; - const plan = planUpdates(appliedRef.current, ownersRef.current, updates ?? []); - if (plan.apply.length === 0 && plan.clear.length === 0) return; - for (const update of plan.apply) { - appliedRef.current.set(update.id, flintUpdateKey(update)); - ownersRef.current.set(update.id, 'host'); - } - for (const id of [...appliedRef.current.keys()]) { - if (!(updates ?? []).some((update) => update.id === id)) appliedRef.current.delete(id); - } - void (async () => { - for (const update of plan.apply) await surface.applyUpdate(update); - for (const id of plan.clear) await surface.clearUpdate(id); - if (surfaceRef.current === surface) propsRef.current.onRender?.(surface); - })(); - }, [updates]); - - // The chart keeps its compiled size; the box only scales it. - useBrowserLayoutEffect(() => { - const outer = outerRef.current; - const scaler = scalerRef.current; - if (!outer || !scaler || !ready || typeof ResizeObserver === 'undefined') return undefined; - const measure = (): void => { - const naturalWidth = scaler.offsetWidth; - const naturalHeight = scaler.offsetHeight; - if (naturalWidth === 0 || naturalHeight === 0) return; - const next = fitScale({ width: naturalWidth, height: naturalHeight }, { - width: width !== undefined ? outer.clientWidth : undefined, - height: height !== undefined ? outer.clientHeight : undefined, - }, fit); - setNatural((current) => current?.width === naturalWidth && current.height === naturalHeight - ? current - : { width: naturalWidth, height: naturalHeight }); - setScale((current) => Math.abs(current - next) < 1e-3 ? current : next); - }; - const observer = new ResizeObserver(measure); - observer.observe(outer); - observer.observe(scaler); - measure(); - return () => observer.disconnect(); - }, [shown, width, height, fit]); - - useEffect(() => { - surfaceRef.current?.refresh(); - }, [scale]); - - // After the placeholder size is gone, so the host measures the laid-out chart. - useBrowserLayoutEffect(() => { - const surface = renderedRef.current; - if (!surface || surface !== shown) return; - renderedRef.current = null; - propsRef.current.onRender?.(surface); - }, [shown]); - - useImperativeHandle(ref, () => ({ - get surface() { return surfaceRef.current; }, - applyUpdate: async (update, options) => { - const surface = surfaceRef.current; - if (!surface) return null; - if (!runtimeRef.current) { - console.warn('FlintChart: this chart has no interactions, so it renders static. Pass `updates` (even `[]`) to update it.'); - return null; - } - ownersRef.current.set(update.id, 'host'); - return surface.applyUpdate(update, options); - }, - clearUpdate: async (id) => { - await surfaceRef.current?.clearUpdate(id); - }, - dispatch: async (interactionId, payload) => surfaceRef.current?.dispatch(interactionId, payload) ?? null, - getState: () => surfaceRef.current?.getState(), - refresh: () => surfaceRef.current?.refresh(), - }), []); - - const base = spec.chart_spec.baseSize ?? DEFAULT_SIZE; - const placeholder = { - width: Math.min(base.width, room?.width ?? Infinity), - height: Math.min(base.height, room?.height ?? Infinity), - }; - const scaled = natural && scale !== 1 ? { width: natural.width * scale, height: natural.height * scale } : null; - const outerStyle: CSSProperties = { - position: 'relative', - width: cssLength(width) ?? (scaled ? scaled.width : undefined), - height: cssLength(height) ?? (scaled ? scaled.height : undefined), - // Without a box nothing needs clipping, and floating panels may extend past the chart. - overflow: width === undefined && height === undefined ? undefined : 'hidden', - ...(width !== undefined || height !== undefined ? { - display: 'flex', - // A cropped chart that overflows starts at the box's edge rather than losing it. - justifyContent: fit === 'crop' ? 'safe center' : 'center', - alignItems: fit === 'crop' ? 'safe center' : 'center', - // As a flex or grid item the box takes the host's size, not the chart's. - minWidth: 0, - minHeight: 0, - } : {}), - ...style, - }; - const scalerStyle: CSSProperties = { - width: 'max-content', - flex: 'none', - // The box centres the chart's layout size, which may spill evenly past it; scaling about - // the centre then lands the drawn chart centred inside the box, as `object-fit` does. - transformOrigin: 'center', - ...(scale !== 1 ? { transform: `scale(${scale})` } : {}), - }; - // Until the chart mounts, the box holds the spec's size so the page does not shift. - const hostStyle: CSSProperties = ready - ? { position: 'relative' } - : { position: 'relative', width: placeholder.width, height: placeholder.height }; - const overlay = failure !== null - ? createElement('div', { role: 'alert', 'data-flint-chart-error': '', style: ERROR_STYLE }, `Chart could not render: ${failure}`) - : fallback !== undefined ? fallback : null; - return createElement('div', { ref: outerRef, className, style: outerStyle }, - !ready && overlay !== null - ? createElement('div', { style: { position: 'absolute', inset: 0 } }, overlay) - : null, - createElement('div', { ref: scalerRef, style: scalerStyle }, - createElement('div', { ref: hostRef, style: hostStyle }))); +export const FlintChart = createFlintChart({ + vegalite: () => import('../vegalite/interactive').then((m) => m.createVegaInteractiveRenderer), + echarts: () => import('../echarts/interactive').then((m) => m.createEChartsInteractiveRenderer), + chartjs: () => import('../chartjs/interactive').then((m) => m.createChartjsInteractiveRenderer), + plotly: () => import('../plotly/interactive').then((m) => m.createPlotlyInteractiveRenderer), }); - -/** One chart's part in `useLinkedCharts`, merged into its own props: its `updates` go after the host's. */ -export interface LinkedChartProps { - onChange: (change: ChartChange) => void; - onRender: (chart: InteractiveChartSurface) => void; - updates: readonly ChartUpdate[]; -} - -export interface LinkedCharts { - /** - * The props a chart takes part with, by the id it has in `inputs`. Pass the chart's own - * `onChange`, `onRender` and `updates` here: props set after the spread replace the link's. - */ - chart(id: string, own?: Partial): LinkedChartProps; - /** The committed condition, the chart each part came from, and what the charts show. */ - condition: LinkSnapshot; - /** What each chart sends and receives, and why anything is left out; null until checked. */ - links: Record | null; - /** Selects from outside the charts, e.g. from a table row or a filter control; `null` lets a field go. */ - select(parts: Record, options?: { from?: string }): void; - clear(): void; -} - -const NO_LINK_UPDATES: readonly ChartUpdate[] = []; -const NO_SNAPSHOT: LinkSnapshot = { condition: {}, from: {}, shown: {} }; - -/** What decides a chart's part in a link: its encodings, interactions and columns, not its rows. */ -function linkKey(input: ChartAssemblyInput): string { - const rows = (input.data as { values?: Record[] } | undefined)?.values; - return JSON.stringify([input.chart_spec, input.interaction_spec ?? null, input.semantic_types ?? null, Object.keys(rows?.[0] ?? {})]); -} - -/** - * Links ``s on the fields they share, as `linkCharts` links mounted surfaces. The - * condition survives remounts, because each chart re-applies its `updates`, and new rows, so a - * host may filter by it. - */ -export function useLinkedCharts(inputs: Record, spec: LinkSpec): LinkedCharts { - const key = `${JSON.stringify(spec)}\n${Object.entries(inputs).map(([id, input]) => `${id}=${linkKey(input)}`).join('\n')}`; - const latest = useRef({ inputs, spec }); - latest.current = { inputs, spec }; - const [state, setState] = useState(null); - const [snapshot, setSnapshot] = useState(NO_SNAPSHOT); - const stateRef = useRef(state); - stateRef.current = state; - const surfaces = useRef(new Map()); - const handlers = useRef(new Map>()); - const owners = useRef(new Map>()); - // Presets a chart mounts from its `interactions` prop select too; the link checks again once a - // chart reports ones its spec does not list. - const [mountedKey, setMountedKey] = useState(''); - const mountedKeys = useRef(new Map()); - - useEffect(() => { - let stale = false; - const inputs = Object.fromEntries(Object.entries(latest.current.inputs).map(([id, input]) => { - const surface = surfaces.current.get(id); - return [id, surface ? linkInput({ input, surface }) : input]; - })); - void loadLinks(inputs, latest.current.spec).then((links) => { - if (stale) return; - const next = createLinkState(links, stateRef.current?.snapshot()); - setState(next); - setSnapshot(next.snapshot()); - }); - return () => { - stale = true; - }; - }, [key, mountedKey]); - - const updates = useMemo(() => { - const layers = state ? conditionUpdates(state.links, snapshot.shown) : new Map(); - return new Map([...layers].map(([id, layer]) => [id, [layer] as readonly ChartUpdate[]])); - }, [state, snapshot]); - - const chart = useCallback((id: string, own?: Partial): LinkedChartProps => { - owners.current.set(id, own ?? {}); - let handler = handlers.current.get(id); - if (!handler) { - handler = { - onChange: (change) => { - owners.current.get(id)?.onChange?.(change); - const current = stateRef.current; - if (!current) return; - const { changed, dropOwn } = current.read(id, change); - if (dropOwn) void surfaces.current.get(id)?.clearUpdate(dropOwn); - if (changed) setSnapshot(current.snapshot()); - }, - onRender: (surface) => { - surfaces.current.set(id, surface); - const input = latest.current.inputs[id]; - if (input) { - const mounted = JSON.stringify(linkInput({ input, surface }).interaction_spec ?? null); - if (mountedKeys.current.get(id) !== mounted) { - mountedKeys.current.set(id, mounted); - if (mounted !== JSON.stringify(input.interaction_spec ?? null)) setMountedKey([...mountedKeys.current].join('|')); - } - } - owners.current.get(id)?.onRender?.(surface); - }, - }; - handlers.current.set(id, handler); - } - const layer = updates.get(id) ?? NO_LINK_UPDATES; - return { ...handler, updates: own?.updates?.length ? [...own.updates, ...layer] : layer }; - }, [updates]); - - const select = useCallback((parts: Record, options?: { from?: string }) => { - const current = stateRef.current; - if (current?.select(parts, options?.from)) setSnapshot(current.snapshot()); - }, []); - - const clear = useCallback(() => { - const current = stateRef.current; - if (current?.clear()) setSnapshot(current.snapshot()); - }, []); - - return { chart, condition: snapshot, links: state?.links ?? null, select, clear }; -} - -export { FlintTable, MAX_TABLE_ROWS, emphasizedRows, nextSort, sortedRows, tableNotes, type FlintTableProps, type TableSort } from './table'; diff --git a/packages/flint-js/src/react/plotly.ts b/packages/flint-js/src/react/plotly.ts new file mode 100644 index 00000000..f08859c8 --- /dev/null +++ b/packages/flint-js/src/react/plotly.ts @@ -0,0 +1,11 @@ +import { createFlintChart } from './chart'; + +export * from './chart'; + +/** + * `FlintChart` with Plotly only, so a bundler resolves no other backend: the app installs + * plotly.js-dist-min and nothing else. Another backend draws where the `renderers` prop gives its factory. + */ +export const FlintChart = createFlintChart({ + plotly: () => import('../plotly/interactive').then((m) => m.createPlotlyInteractiveRenderer), +}); diff --git a/packages/flint-js/src/react/table.ts b/packages/flint-js/src/react/table.ts index f036a74f..24c8abde 100644 --- a/packages/flint-js/src/react/table.ts +++ b/packages/flint-js/src/react/table.ts @@ -1,15 +1,28 @@ -import { createElement, useEffect, useMemo, useRef, useState, type CSSProperties } from 'react'; -import { chartTableRowTest, type ChartTable, type ChartTableText } from '../core/chart-table'; +import { createElement, useEffect, useMemo, useRef, useState, type CSSProperties, type RefObject } from 'react'; +import { chartTableRowTest, type ChartTable, type ChartTableFurniture, type ChartTableText } from '../core/chart-table'; +import type { ClosingRule } from '../core/rule-plan'; +import type { SourceLine, SourcePlan } from '../core/source-plan'; +import { canvasFurnitureMarkup, headerFurnitureItems } from '../vegalite/canvas-furniture'; import type { ChartUpdate, UpdateTarget } from '../core/interaction-contracts'; /** The most rows a table draws; the rest are counted below it. */ export const MAX_TABLE_ROWS = 500; +/** The table's inset from its edges, as its cells pad their text. */ +const INSET = 10; + /** The opacity of rows outside an emphasis, as charts mute their marks. */ const MUTED_ROW_OPACITY = 0.35; const TABLE_CSS = ` -.flint-table { overflow: auto; box-sizing: border-box; background: var(--flint-table-bg); } +.flint-table { position: relative; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; background: var(--flint-table-bg); } +.flint-table-heading, .flint-table-note, .flint-table-rule, .flint-table-source, .flint-table-room { flex: none; } +.flint-table-furniture { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; } +.flint-table-rule { margin: 0 10px; } +.flint-table-source { padding: 6px 10px 2px; } +.flint-table-source-line { display: flex; justify-content: space-between; gap: 12px; margin: 0; } +.flint-table-source-line a { color: inherit; } +.flint-table-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; } .flint-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; } .flint-table th { position: sticky; top: 0; z-index: 1; padding: 0; text-align: left; font-weight: inherit; white-space: nowrap; background: var(--flint-table-bg); box-shadow: inset 0 -1px 0 var(--flint-table-header-rule); } @@ -71,6 +84,62 @@ export function tableNotes(table: ChartTable, shown: number): string[] { ].filter(Boolean); } +/** A theme's closing rule across the table's width. */ +function ruleElement(rule: ClosingRule, key: number) { + return createElement('div', { + key, + className: 'flint-table-rule', + style: { height: rule.height, background: rule.color ?? 'currentColor', ...(rule.stated ? { width: rule.width } : {}) }, + }); +} + +/** The words of one source line, its runs in their weights. */ +function sourceRuns(line: SourceLine) { + const runs = line.runs.map((run, i) => createElement('span', { + key: i, + style: { fontWeight: run.fontWeight, fontStyle: run.fontStyle }, + }, (i > 0 ? ' ' : '') + run.text)); + return line.href ? createElement('a', { href: line.href, target: '_blank', rel: 'noopener' }, runs) : runs; +} + +/** The source line at the table's foot, as the chart sets it: the lines from the top, a credit at the other end. */ +function sourceElement(source: SourcePlan) { + const rows = [...new Set(source.lines.map((line) => line.bottom))].sort((a, b) => b - a); + const image = source.creditImage; + return createElement('div', { + className: 'flint-table-source', + style: { fontFamily: source.font, fontSize: source.fontSize, color: source.color, lineHeight: `${source.lineHeight}px` }, + }, + source.rule + ? createElement('div', { style: { borderTop: `${source.rule.width}px ${source.rule.dash ? 'dashed' : 'solid'} ${source.rule.color}`, marginBottom: 6 } }) + : null, + rows.map((bottom, row) => { + const at = source.lines.filter((line) => line.bottom === bottom); + const start = at.filter((line) => line.align === 'start'); + const end = at.filter((line) => line.align === 'end'); + const credit = row === 0 && image + ? createElement('img', { src: image.src, alt: image.alt, width: image.width, height: image.height, style: { verticalAlign: 'middle' } }) + : null; + return createElement('p', { key: bottom, className: 'flint-table-source-line' }, + createElement('span', null, start.map((line, i) => createElement('span', { key: i }, sourceRuns(line))), image?.align === 'start' ? credit : null), + createElement('span', { style: { textAlign: 'right' } }, end.map((line, i) => createElement('span', { key: i }, sourceRuns(line))), image?.align === 'end' ? credit : null)); + })); +} + +/** The width of an element as laid out, followed as it changes; 0 until measured. */ +function useWidth(watch: boolean): [RefObject, number] { + const ref = useRef(null); + const [width, setWidth] = useState(0); + useEffect(() => { + const element = ref.current; + if (!watch || !element || typeof ResizeObserver === 'undefined') return; + const observer = new ResizeObserver(([entry]) => setWidth(Math.round(entry.contentRect.width))); + observer.observe(element); + return () => observer.disconnect(); + }, [watch]); + return [ref, width]; +} + function textStyle(text: ChartTableText): CSSProperties { return { fontFamily: text.font, fontSize: text.fontSize, fontWeight: text.fontWeight, fontStyle: text.fontStyle, color: text.color }; } @@ -86,7 +155,10 @@ export interface FlintTableProps { const NO_UPDATES: readonly ChartUpdate[] = []; -/** A chart's table in the chart's theme: headings sort, rows an emphasis names stay in full ink. */ +/** + * A chart's table in the chart's theme: headings sort, rows an emphasis names stay in full ink. Only + * the rows scroll: the title, subtitle and notes stay in place, and the column headings stick. + */ export function FlintTable({ table, updates = NO_UPDATES, className, style }: FlintTableProps) { const [sort, setSort] = useState(null); const order = useMemo(() => sortedRows(table, sort), [table, sort]); @@ -104,6 +176,13 @@ export function FlintTable({ table, updates = NO_UPDATES, className, style }: Fl }, [emphasized, order]); const { style: look } = table; const notes = tableNotes(table, shown.length); + const furniture: ChartTableFurniture | undefined = table.furniture; + const headerPlan = furniture?.header; + const [root, width] = useWidth(!!headerPlan); + const headerItems = headerPlan && width > 0 ? headerFurnitureItems(headerPlan, { left: INSET, right: INSET, top: 0 }) : []; + const headerRoom = headerPlan ? headerPlan.edge + headerPlan.line : 0; + const topRules = furniture?.rules.filter((rule) => rule.edge === 'top') ?? []; + const footRules = furniture?.rules.filter((rule) => rule.edge === 'bottom') ?? []; const header = table.columns.map((column, i) => createElement('th', { key: column.field, scope: 'col', @@ -122,7 +201,7 @@ export function FlintTable({ table, updates = NO_UPDATES, className, style }: Fl className: table.columns[i].align === 'end' ? 'flint-table-end' : undefined, }, cell.text)))); return createElement('div', { - ref: scroller, + ref: root, className: className ? `flint-table ${className}` : 'flint-table', style: { '--flint-table-bg': look.background, @@ -132,15 +211,32 @@ export function FlintTable({ table, updates = NO_UPDATES, className, style }: Fl } as CSSProperties, }, createElement('style', null, TABLE_CSS), + headerItems.length > 0 + ? createElement('svg', { + className: 'flint-table-furniture', + width, + height: Math.max(...headerItems.map((item) => (item.y ?? 0) + item.height)), + 'aria-hidden': true, + dangerouslySetInnerHTML: { __html: canvasFurnitureMarkup(headerItems, width) }, + }) + : null, + headerPlan && !table.heading ? createElement('div', { className: 'flint-table-room', style: { height: headerRoom } }) : null, table.heading - ? createElement('div', { className: 'flint-table-heading' }, + ? createElement('div', { + className: 'flint-table-heading', + style: headerPlan ? { paddingTop: headerRoom + 2, paddingLeft: INSET + headerPlan.beside.start, paddingRight: INSET + headerPlan.beside.end } : undefined, + }, table.heading.title ? createElement('p', { className: 'flint-table-title', style: textStyle(table.heading.style.title) }, table.heading.title) : null, table.heading.subtitle ? createElement('p', { className: 'flint-table-subtitle', style: textStyle(table.heading.style.subtitle) }, table.heading.subtitle) : null) : null, - createElement('table', null, - createElement('thead', null, createElement('tr', null, header)), - createElement('tbody', { style: textStyle(look.body) }, body)), + ...topRules.map((rule, i) => ruleElement(rule, i)), + createElement('div', { ref: scroller, className: 'flint-table-scroll' }, + createElement('table', null, + createElement('thead', null, createElement('tr', null, header)), + createElement('tbody', { style: textStyle(look.body) }, body))), notes.length > 0 ? createElement('p', { className: 'flint-table-note', style: { ...textStyle(look.header), fontSize: Math.max(10, look.header.fontSize - 1) } }, notes.join(' · ')) - : null); + : null, + ...footRules.map((rule, i) => ruleElement(rule, i)), + furniture?.source ? sourceElement(furniture.source) : null); } diff --git a/packages/flint-js/src/react/vegalite.ts b/packages/flint-js/src/react/vegalite.ts new file mode 100644 index 00000000..e140499b --- /dev/null +++ b/packages/flint-js/src/react/vegalite.ts @@ -0,0 +1,11 @@ +import { createFlintChart } from './chart'; + +export * from './chart'; + +/** + * `FlintChart` with Vega-Lite only, so a bundler resolves no other backend: the app installs + * vega, vega-lite and vega-tooltip and nothing else. Another backend draws where the `renderers` prop gives its factory. + */ +export const FlintChart = createFlintChart({ + vegalite: () => import('../vegalite/interactive').then((m) => m.createVegaInteractiveRenderer), +}); diff --git a/packages/flint-js/src/render/index.ts b/packages/flint-js/src/render/index.ts index 5598ccec..d76bf69c 100644 --- a/packages/flint-js/src/render/index.ts +++ b/packages/flint-js/src/render/index.ts @@ -1,6 +1,7 @@ import type { ChartAssemblyInput } from '../core/types'; import { assembleECharts } from '../echarts/assemble'; import { assembleVegaLite } from '../vegalite/assemble'; +import { withBundledBoundaries } from '../vegalite/boundary-loader'; import { injectCanvasFurnitureSVG, readCanvasFurniture, readCanvasPatterns } from '../vegalite/canvas-furniture'; export type RenderSvgBackend = 'vegalite' | 'echarts'; @@ -39,7 +40,10 @@ export async function renderSvg(input: ChartAssemblyInput, options: RenderSvgOpt } } if (backend !== 'vegalite') throw new Error(`renderSvg does not support backend "${backend as string}".`); - const vlSpec = assembleVegaLite(input); + // The host's background is the chart's where no house sets a canvas of its own. + const vlSpec = assembleVegaLite(options.background !== undefined && input.options?.background === undefined + ? { ...input, options: { ...input.options, background: options.background } } + : input); const [{ compile }, vega] = await Promise.all([import('vega-lite'), import('vega')]); const interpreter = options.expressionInterpreter; const runtime = vega.parse( @@ -47,7 +51,11 @@ export async function renderSvg(input: ChartAssemblyInput, options: RenderSvgOpt (options.background ? { background: options.background } : {}) as any, (interpreter ? { ast: true } : undefined) as any, ); - const view = new vega.View(runtime, { renderer: 'none', ...(interpreter ? { expr: interpreter } : {}) } as any); + const view = new vega.View(runtime, { + renderer: 'none', + loader: withBundledBoundaries(vega.loader()), + ...(interpreter ? { expr: interpreter } : {}), + } as any); view.logLevel(vega.Error); try { await view.runAsync(); diff --git a/packages/flint-js/src/validate/index.ts b/packages/flint-js/src/validate/index.ts index 73fa7c8c..413a045e 100644 --- a/packages/flint-js/src/validate/index.ts +++ b/packages/flint-js/src/validate/index.ts @@ -395,11 +395,23 @@ function checkSpecUpdates( }; } const checks = checkUpdates(input, updates, assembled, admitted); - const warnings = checks.flatMap((check) => check.ops.flatMap((op): ChartWarning[] => (op.ok ? [] : [{ - severity: 'warning', - code: 'update_not_applied', - message: `Update "${check.id}" will not apply ${op.text}: ${op.reason}`, - }]))); + const warnings = checks.flatMap((check) => check.ops.flatMap((op): ChartWarning[] => [ + ...(op.ok ? [] : [{ + severity: 'warning' as const, + code: 'update_not_applied', + message: `Update "${check.id}" will not apply ${op.text}: ${op.reason}`, + }]), + ...(op.advice ? [{ + severity: 'info' as const, + code: 'note_repeats_chart', + message: `Update "${check.id}" ${op.text}: ${op.advice}`, + }] : []), + ...(op.deprecated ? [{ + severity: 'warning' as const, + code: 'deprecated_op', + message: `Update "${check.id}": op "${op.op}" is deprecated and will be removed in 2.0; write "${op.deprecated}", which it means.`, + }] : []), + ])); return { checks, warnings }; } @@ -414,8 +426,10 @@ export type { ChartLink, LinkCondition, LinkGesture, LinkPart, LinkSpec } from ' * `semantic_types` labels are included as warnings (see * {@link validateSemanticTypes}) and do not affect `valid`. An * `interaction_spec` is checked the way the mount checks it (see - * {@link validateInteractionSpec}). `options.updates` is checked for its shape - * and then op by op against the chart (see {@link ValidateResult.updates}). + * {@link validateInteractionSpec}). The spec's own `updates` and `options.updates` + * are checked for their shape, then together — the spec's first, an `options` update + * replacing a spec update of its id, as the mount applies them — op by op against the + * chart (see {@link ValidateResult.updates}). */ export function validateChart( input: ChartAssemblyInput, @@ -426,13 +440,19 @@ export function validateChart( ? input.chart_spec.chartType : '(unknown)'; const semanticTypeWarnings = validateSemanticTypes(input?.semantic_types); - const updateErrors = options.updates === undefined ? [] : updateShapeErrors(options.updates); + const specUpdates = input?.updates; + const updateErrors = [ + ...(specUpdates === undefined ? [] : updateShapeErrors(specUpdates, 'input.updates')), + ...(options.updates === undefined ? [] : updateShapeErrors(options.updates)), + ]; + // The spec's updates are the runtime's to apply: the chart is assembled, and checked, without them. + const { updates: _specUpdates, ...chart } = input ?? ({} as ChartAssemblyInput); try { - const { spec, warnings, width, height } = assembleForBackend(backend, input, options); + const { spec, warnings, width, height } = assembleForBackend(backend, chart, options); const interactions = admitSpecInteractions(input, backend, spec); - const updates: UpdatesOutcome = options.updates === undefined || updateErrors.length > 0 + const updates: UpdatesOutcome = (specUpdates === undefined && options.updates === undefined) || updateErrors.length > 0 ? { warnings: updateErrors } - : checkSpecUpdates(input, backend, spec, interactions.admitted, options.updates as ChartUpdate[]); + : checkSpecUpdates(chart, backend, spec, interactions.admitted, mergedUpdates(specUpdates, options.updates as ChartUpdate[] | undefined)); const all = [...warnings, ...semanticTypeWarnings, ...interactions.warnings, ...updates.warnings]; const errors = all.filter((w) => w.severity === 'error'); return { @@ -457,6 +477,12 @@ export function validateChart( } } +/** The spec's updates, then the host's: a host update replaces the spec's of its id, as the mount applies them. */ +function mergedUpdates(spec: readonly ChartUpdate[] | undefined, own: readonly ChartUpdate[] | undefined): ChartUpdate[] { + const host = own ?? []; + return [...(spec ?? []).filter((update) => !host.some((other) => other.id === update.id)), ...host]; +} + /** * Remove Flint's private `_`-prefixed annotation keys from a top-level spec * object so it is render-ready and safe to surface to callers. diff --git a/packages/flint-js/src/validate/updates.ts b/packages/flint-js/src/validate/updates.ts index 8d8ea04a..28eabf11 100644 --- a/packages/flint-js/src/validate/updates.ts +++ b/packages/flint-js/src/validate/updates.ts @@ -3,10 +3,10 @@ import type { ChartAssemblyInput, ChartWarning } from '../core/types'; import type { SemanticAnnotation } from '../core/field-semantics'; -import { CHART_UPDATE_OPS, type ChartOverlaySpec, type ChartUpdate, type ChartUpdateOp, type UpdateTarget } from '../core/interaction-contracts'; +import { CHART_UPDATE_OPS, DEPRECATED_UPDATE_OPS, isDeprecatedUpdateOp, type ChartOverlaySpec, type ChartUpdate, type ChartUpdateOp, type RegionAnnotationSpec, type UpdateTarget } from '../core/interaction-contracts'; import { temporalFieldValue } from '../core/resolve-semantics'; import { isWhereSelector, selectorConditions, selectorRowTest, selectorText, type RowComparison } from '../core/target-selector'; -import { overlayChannels } from '../vegalite/interactions/presentation/overlay-channels'; +import { geoOverlayChannels, isGeoOverlay, overlayChannels } from '../vegalite/interactions/presentation/overlay-channels'; import { navigationAxesFor } from '../interactive/spec/admission'; import type { CanvasInteractionDef } from '../interactive/interactions'; @@ -21,6 +21,10 @@ export interface UpdateOpCheck { ok: boolean; /** Why the op will not apply, with the fix when there is one. */ reason?: string; + /** What would make the op better though it applies: a note that repeats what the chart already prints. */ + advice?: string; + /** The op's name is an older one still read: the name to write instead. */ + deprecated?: string; } export interface UpdateCheck { @@ -45,7 +49,64 @@ interface Chart { semanticTypes: Record; navigation: readonly Axis[]; geoNavigation: boolean; + /** The chart is a map: overlays and regions are placed on it by longitude and latitude. */ + projected: boolean; reorderFields: readonly string[]; + /** The fields the chart prints as text on its marks: its value labels. */ + printedFields: readonly string[]; +} + +/** The fields text marks print in an assembled Vega-Lite spec, at any depth. */ +function printedFieldsOf(spec: unknown): string[] { + const fields = new Set(); + const visit = (node: unknown): void => { + if (!node || typeof node !== 'object') return; + const record = node as Record; + const mark = typeof record.mark === 'string' ? record.mark : record.mark?.type; + const field = record.encoding?.text?.field; + if (mark === 'text' && typeof field === 'string') fields.add(field); + for (const key of ['layer', 'vconcat', 'hconcat', 'concat'] as const) { + if (Array.isArray(record[key])) record[key].forEach(visit); + } + if (record.spec) visit(record.spec); + }; + visit(spec); + return [...fields]; +} + +/** The numbers a note's text states, read as written ("1,250", "61", "-3.5"). */ +function statedNumbers(text: string): { value: number; decimals: number }[] { + return [...text.matchAll(/-?\d[\d,]*(?:\.\d+)?/g)].map(([token]) => { + const plain = token.replace(/,/g, ''); + return { value: Number(plain), decimals: plain.split('.')[1]?.length ?? 0 }; + }).filter(({ value }) => Number.isFinite(value)); +} + +/** + * Advice for a note that restates a value the chart already prints on its mark — "Online leads: 61" + * over a bar labelled 61. A note is for what the chart does not say: why the mark stands out, what + * changed, how it compares. + */ +function repeatedValue(chart: Chart, op: Extract): string | undefined { + const text = op.value?.text; + if (!text || !('select' in op.target) || isWhereSelector(op.target) || chart.printedFields.length === 0) return undefined; + const matches = selectorRowTest(op.target, chart.semantics.fields ?? [], comparisonOf(chart)); + if (!matches) return undefined; + const rows = chart.rows.filter(matches); + if (rows.length === 0) return undefined; + const stated = statedNumbers(text); + for (const field of chart.printedFields) { + const values = rows.map((row) => row[field]).filter((value): value is number => typeof value === 'number' && Number.isFinite(value)); + if (values.length === 0) continue; + // The mark prints its row's value, or the rows' total where the chart sums them. + const printed = [...values, values.reduce((total, value) => total + value, 0)]; + const repeated = stated.find(({ value, decimals }) => printed.some((shown) => Math.abs(shown - value) < 0.5 * 10 ** -decimals)); + if (repeated) { + return `the note repeats ${field} ${cell(repeated.value)}, which the chart already prints on the mark. ` + + 'Say what the chart does not: why the mark stands out, what changed, how it compares.'; + } + } + return undefined; } function cell(value: unknown): string { @@ -79,7 +140,9 @@ function chartOf(input: ChartAssemblyInput, assembled: unknown, interactions: re semanticTypes: input.semantic_types ?? {}, navigation, geoNavigation: !!semantics.geoNavigation && navigation.length > 0, + projected: !!semantics.geoNavigation, reorderFields: elementDrag ? (semantics.reorderAxes ?? []).map((axis) => axis.field) : [], + printedFields: printedFieldsOf(assembled), }; } @@ -137,7 +200,34 @@ function onAxis(chart: Chart, axis: Axis, value: unknown): boolean { return chart.rows.some((row) => cell(row[field.field]) === cell(value)); } +/** Why a map overlay cannot be drawn: no map to draw it on, places missing or out of range. */ +function geoOverlayProblem(chart: Chart, spec: ChartOverlaySpec): string | undefined { + if (!chart.projected) return `${chart.semantics.chartType ?? 'This chart'} is no map: place its overlays by x and y.`; + const channels = geoOverlayChannels(spec); + if (!channels) { + return spec.mark === 'rule' || spec.mark === 'rect' + ? `a ${spec.mark} map overlay needs longitude, latitude, longitude2 and latitude2 encodings, and no x or y.` + : `a ${spec.mark} map overlay needs longitude and latitude encodings, and no x, y, longitude2 or latitude2.`; + } + const rows = spec.data?.values ?? []; + if (rows.length === 0) return 'the overlay has no rows.'; + for (const channel of channels) { + const field = spec.encodings[channel]!.field; + const limit = channel.startsWith('latitude') ? 90 : 360; + const off = rows.findIndex((row) => { + const value = row[field]; + return value === null || value === '' || !Number.isFinite(Number(value)) || Math.abs(Number(value)) > limit; + }); + if (off >= 0) return `overlay row ${off} has no ${channel} in degrees in "${field}" (${cell(rows[off][field])}).`; + } + return undefined; +} + function overlayProblem(chart: Chart, spec: ChartOverlaySpec): string | undefined { + for (const [channel, encoding] of Object.entries(spec.encodings ?? {})) { + if (typeof encoding === 'string') return `encodings.${channel} must be { "field": "${encoding}" }, not "${encoding}".`; + } + if (isGeoOverlay(spec)) return geoOverlayProblem(chart, spec); const axes = chart.semantics.axisFields ?? {}; if (!axes.x || !axes.y) return `${chart.semantics.chartType ?? 'This chart'} has no x and y axes to draw an overlay on.`; for (const [channel, encoding] of Object.entries(spec.encodings ?? {})) { @@ -177,19 +267,73 @@ const STATE_VERBS: Record = { normal: 'resets the style of', }; +function regionText(name: string, value: RegionAnnotationSpec): string { + const span = (['x', 'y', 'longitude', 'latitude'] as const).filter((axis) => value[axis]) + .map((axis) => `${axis} ${(value[axis] as readonly unknown[]).map(cell).join(' to ')}`); + return `region "${name}" over ${span.join(', ')}${value.text !== undefined ? `, captioned "${value.text}"` : ''}`; +} + +/** Why a region cannot be shaded: an axis the chart lacks, a bound off it, a stretch of the wrong length. */ +function regionProblem(chart: Chart, value: RegionAnnotationSpec): string | undefined { + if (value.longitude !== undefined || value.latitude !== undefined) { + if (!chart.projected) return `${chart.semantics.chartType ?? 'This chart'} is no map: shade its regions by x and y.`; + if (value.x !== undefined || value.y !== undefined) return 'a map region is a box of longitude and latitude, with no x or y.'; + for (const [axis, limit] of [['longitude', 360], ['latitude', 90]] as const) { + const bounds = value[axis]; + if (!Array.isArray(bounds) || bounds.length !== 2 || bounds.some((bound) => typeof bound !== 'number' || !Number.isFinite(bound) || Math.abs(bound) > limit)) { + return `a map region needs ${axis}: [${axis === 'longitude' ? 'west, east' : 'south, north'}], two numbers in degrees.`; + } + } + return undefined; + } + const axes = chart.semantics.axisFields ?? {}; + if (!axes.x && !axes.y) { + return `${chart.semantics.chartType ?? 'This chart'} has no x or y scale to shade; outline its marks with annotate-enclosure instead.`; + } + for (const axis of ['x', 'y'] as const) { + const bounds = value[axis]; + if (!bounds) continue; + const field = axes[axis]; + if (!field) return `the chart has no ${axis} axis; a region spans ${(['x', 'y'] as const).filter((other) => axes[other]).join(' or ')}.`; + const banded = field.type === 'nominal' || field.type === 'ordinal'; + if (!banded && bounds.length !== 2) return `${axis} is continuous (${field.field}): give exactly two bounds, [low, high], either of which may be null.`; + if (banded && bounds.length === 0) return `name the ${field.field} categories the region covers on ${axis}.`; + const off = bounds.find((bound) => bound !== null && !onAxis(chart, axis, bound)); + if (off !== undefined) return `${cell(off)} is not a value of the ${axis} axis (${field.field}, ${field.type}).`; + } + return undefined; +} + function checkOp(chart: Chart, op: ChartUpdateOp): UpdateOpCheck { const result = (text: string, reason?: string): UpdateOpCheck => reason ? { op: op.op, text, ok: false, reason } : { op: op.op, text, ok: true }; switch (op.op) { case 'set-style': { if (op.targets.length === 0) return result('clears the style'); - const verb = (op.value.state && STATE_VERBS[op.value.state]) ?? 'styles'; + const emphasizing = op.value.state === 'emphasized' || op.value.state === 'focused'; + const level = op.value.emphasis && emphasizing && op.value.mutedOpacity === undefined ? ` (${op.value.emphasis})` : ''; + const verb = ((op.value.state && STATE_VERBS[op.value.state]) ?? 'styles') + level; return result(`${verb} marks where ${op.targets.map(targetText).join('; ')}`, targetsCheck(chart, op.targets)); } + case 'annotate-text': case 'set-annotation': { - if (op.value === null) return result(`removes the note at ${targetText(op.target)}`); + const renamed = isDeprecatedUpdateOp(op.op) ? { deprecated: DEPRECATED_UPDATE_OPS[op.op] } : {}; + if (op.value === null) return { ...result(`removes the note at ${targetText(op.target)}`), ...renamed }; const text = op.value.text !== undefined ? `note "${op.value.text}"` : 'note'; - return result(`${text} at ${targetText(op.target)}`, targetProblem(chart, op.target)); + const checked = { ...result(`${text} at ${targetText(op.target)}`, targetProblem(chart, op.target)), ...renamed }; + const advice = checked.ok ? repeatedValue(chart, op) : undefined; + return advice ? { ...checked, advice } : checked; + } + case 'annotate-region': { + if (op.value === null) return result(`removes region "${op.name}"`); + return result(regionText(op.name, op.value), regionProblem(chart, op.value)); + } + case 'annotate-enclosure': { + if (op.value === null) return result(`removes enclosure "${op.name}"`); + const caption = op.value.text !== undefined ? ` "${op.value.text}"` : ''; + const text = `encloses${caption} ${op.value.targets.map(targetText).join('; ')}`; + if (op.value.targets.length === 0) return result(text, 'the enclosure names no targets; give each group of marks as a target.'); + return result(text, targetsCheck(chart, op.value.targets)); } case 'set-viewport': { if (op.value.region) { @@ -248,15 +392,38 @@ const isName = (value: unknown): boolean => typeof value === 'string' && value.l type OpShape = { shape: string; fields: Record boolean> }; +const TEXT_SHAPE = "{ op, target: UpdateTarget, value: { text, anchor?: 'segment' | 'point', highlight?: 'none' | 'light' | 'strong' | 'exclusive', style?: { fontSize?, fontWeight?, color? }, highlightStyle?: { color?, width? } } | null }"; + const OP_SHAPES = { 'set-style': { shape: '{ op, targets: UpdateTarget[], value: StyleSpec }', fields: { targets: (v: unknown) => Array.isArray(v) && v.every(isSetTarget), value: isObject }, }, + 'annotate-text': { + shape: TEXT_SHAPE, + fields: { target: isTarget, value: isObjectOrNull }, + }, 'set-annotation': { - shape: "{ op, target: UpdateTarget, value: { text, anchor?: 'segment' | 'point' } | null }", + shape: TEXT_SHAPE, fields: { target: isTarget, value: isObjectOrNull }, }, + 'annotate-region': { + shape: "{ op, name, value: { x?: [lo, hi] | categories[], y?: [lo, hi] | categories[], longitude?: [west, east], latitude?: [south, north], text?, color?, opacity?, layer?: 'under' | 'over', placement? } | null }", + fields: { + name: isName, + // An x or y stretch on a chart with axes; a box of longitude and latitude on a map. + value: (v: unknown) => v === null || (isObject(v) + && (Array.isArray(v.x) || Array.isArray(v.y) || Array.isArray(v.longitude) || Array.isArray(v.latitude)) + && (['x', 'y', 'longitude', 'latitude'] as const).every((axis) => v[axis] === undefined || Array.isArray(v[axis]))), + }, + }, + 'annotate-enclosure': { + shape: "{ op, name, value: { targets: UpdateTarget[], text?, shape?: 'hull' | 'rect' | 'ellipse' | 'circle', connect?: 'auto' | 'all' | 'none', color?, width? } | null }", + fields: { + name: isName, + value: (v: unknown) => v === null || (isObject(v) && Array.isArray(v.targets) && v.targets.every(isSetTarget)), + }, + }, 'set-viewport': { shape: "{ op, axes: 'x' | 'y' | 'xy', value: { x?: [lo, hi], y?: [lo, hi] } }", fields: { axes: (v: unknown) => v === 'x' || v === 'y' || v === 'xy', value: isObject }, @@ -266,7 +433,7 @@ const OP_SHAPES = { fields: { scope: isName, field: isName, values: Array.isArray }, }, 'set-overlay': { - shape: '{ op, name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2? }, role } | null }', + shape: '{ op, name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2? } | { longitude, latitude, longitude2?, latitude2? }, role } | null }', fields: { name: isName, value: isObjectOrNull }, }, 'set-freeform-overlay': { @@ -294,7 +461,7 @@ export function updateShapeErrors(updates: unknown, label = 'updates'): ChartWar if (!Array.isArray(ops)) return fail(`${entry} (${id}): "ops" must be an array.`); for (const [opIndex, op] of ops.entries()) { const name = (op as { op?: unknown } | null)?.op; - if (typeof name !== 'string' || !(CHART_UPDATE_OPS as readonly string[]).includes(name)) { + if (typeof name !== 'string' || !((CHART_UPDATE_OPS as readonly string[]).includes(name) || isDeprecatedUpdateOp(name))) { return fail( `${entry} (${id}).ops[${opIndex}]: unknown op "${String(name)}". Known ops: ${CHART_UPDATE_OPS.join(', ')}.`, ); diff --git a/packages/flint-js/src/vegalite/assemble.ts b/packages/flint-js/src/vegalite/assemble.ts index 5d4cc370..c7bbeee1 100644 --- a/packages/flint-js/src/vegalite/assemble.ts +++ b/packages/flint-js/src/vegalite/assemble.ts @@ -44,7 +44,8 @@ * This module has NO React, Redux, or UI framework dependencies. */ -import { authoredColorScale, schemeName, withEncodingColorAnnotations } from '../core/color-controls'; +import { noteSpecUpdates } from '../core/spec-updates'; +import { authoredColorScale, schemeName, withEncodingColorAnnotations, colorNeutralBand } from '../core/color-controls'; import { applyAuthoredColorScaleVL, restoreColorScales, snapshotColorScales } from './color-controls'; import { ChartEncoding, @@ -77,10 +78,11 @@ import { templateStatesAxisLabels, vlApplyLayoutToSpec, vlApplyTooltips, vlFinal import { normalizeChartProperties } from '../core/normalize-properties'; import { resolveChartDefaults, resolveCompileDefaults, resolveGeometry, resolveValueLabelChoice } from '../core/theme/ground'; import { resolveThemeSpec } from '../core/theme/presets'; -import { withChrome } from '../core/theme/chrome'; -import { applyHeaderFurniture, applySourceLine, realizeThemeVegaLite, realizeValueLabelsVegaLite, vegaLiteBuiltFacts } from './theme'; +import { chartChrome, withChrome } from '../core/theme/chrome'; +import { alignBandOrders, applyHeaderFurniture, applySourceLine, realizeThemeVegaLite, realizeValueLabelsVegaLite, sealDetailSegments, vegaLiteBuiltFacts } from './theme'; import { applyChartValueColors } from './value-colors'; import { vlCaseKeyLabels, vlWriteKeyLayout } from './key-layout'; +import { vlReserveEnclosureRoom, vlReserveNoteRoom } from './note-room'; import { familyMeasure, rendererTextMeasurer } from '../core/text-width'; import { themeBodyFamily } from '../core/theme/ground'; import { chartDisplayNames, encodingTitle, TIGHT_X_MARKS, titleText, type BuiltFacts, type ChartStructure } from '../core/structure'; @@ -267,7 +269,7 @@ function prepareVegaLite(input: ChartAssemblyInput): VegaLitePreparation { const semanticTypes = withEncodingColorAnnotations(input.semantic_types ?? {}, input.chart_spec.encodings as Record); // `theme_spec` may name a house Flint ships rather than spell one out. // A chart may turn off part of its house's chrome (a logo, the header, the footer). - const themeSpec = withChrome(resolveThemeSpec(input.theme_spec), input.chart_spec.chrome); + const themeSpec = withChrome(resolveThemeSpec(input.theme_spec), chartChrome(input.chart_spec.chartType, input.chart_spec.chrome)); // A house may prefer a size, a stretch budget, a facet gap. Those settle // before anything is measured, and in a fixed order: the chart spec first, // the theme's presets under it, flint's own defaults under that. @@ -583,7 +585,9 @@ function emitVegaLite(input: ChartAssemblyInput, prepared: VegaLitePreparation, // fits, so it must see the finished spec. Only realization is gated on a // named house, so an untheme'd chart gets its numbers without also getting // a house's ink, type and furniture. - const plannedPlotSize = plotSizeFields(vgObj, plan.title, plan.rules?.room, (plan.header ? plan.header.edge + plan.header.line : 0) + (plan.source?.room ?? 0)); + // A source line the plot was sized round takes nothing from it. + const sourceTakes = plan.source && !plan.source.reserved ? plan.source.room : 0; + const plannedPlotSize = plotSizeFields(vgObj, plan.title, plan.rules?.room, (plan.header ? plan.header.edge + plan.header.line : 0) + sourceTakes); // Some templates write their own text on the marks. Where they do, the // label layer stands down (it will not print a second number beside the // template's), so the toggle would be a control that changes nothing. @@ -596,7 +600,7 @@ function emitVegaLite(input: ChartAssemblyInput, prepared: VegaLitePreparation, const authoredColor = authoredColorScale(input.chart_spec.encodings as Record); if (themeSpec) { const authoredScales = authoredColor ? snapshotColorScales(vgObj, authoredColor) : undefined; - const realizeReport = realizeThemeVegaLite(vgObj, design, values, plan); + const realizeReport = realizeThemeVegaLite(vgObj, design, values, plan, colorNeutralBand(channelSemantics)); // A scheme the author named outranks the theme's ramp. if (authoredScales) restoreColorScales(authoredScales); themeDecisions = { @@ -613,7 +617,14 @@ function emitVegaLite(input: ChartAssemblyInput, prepared: VegaLitePreparation, if (plan.lineWidth !== undefined) { vgObj.config = { ...vgObj.config, line: { ...vgObj.config?.line, strokeWidth: plan.lineWidth } }; } + // With no house to set a canvas, the chart draws on the host's: Vega-Lite would state white. + if (typeof plan.options.background === 'string' && vgObj.background === undefined) { + vgObj.background = plan.options.background; + } } + sealDetailSegments(vgObj); + // Value labels and row names share the bars' band: a sort by value is stated once for every layer. + alignBandOrders(vgObj, values); // The header — a figure label, a rule on the canvas edge, a logo beside the headline — is the // chart's as much as the theme's: drawn with or without one. applyHeaderFurniture(vgObj, plan.header); @@ -643,12 +654,14 @@ function emitVegaLite(input: ChartAssemblyInput, prepared: VegaLitePreparation, } chartTemplate.postProcess?.(vgObj, instantiateContext); // The author's colour controls win over every default and the theme's ramp. - if (authoredColor) applyAuthoredColorScaleVL(vgObj, authoredColor, values); + if (authoredColor) applyAuthoredColorScaleVL(vgObj, authoredColor, values, colorNeutralBand(channelSemantics, authoredColor.field)); vlFinalizeTemporalAxes(vgObj, instantiateContext); vlWriteKeyLayout(vgObj, plan.legend, plan.plot, plan.layout, VEGA_LITE_LAYOUT.measureText!); vlWriteAxisTitles(vgObj, plan.axisTitleFit); vlCaseKeyLabels(vgObj, plan.legend); vlListTooltipFields(vgObj); + vlReserveNoteRoom(vgObj, { notes: plan.options.notes, regions: plan.options.regions, references: plan.options.references }, values, plan.plot, plan.axisLabels, VEGA_LITE_LAYOUT.measureText!); + vlReserveEnclosureRoom(vgObj, plan.options.enclosures, values, plan.plot, input.semantic_types); const plotAsPlanned = plotSizeFields(vgObj) === plannedPlotSize; // ═══════════════════════════════════════════════════════════════════════ @@ -781,6 +794,7 @@ function emitVegaLite(input: ChartAssemblyInput, prepared: VegaLitePreparation, reorderAxes, selectionBoundary: design.interaction.selectionBoundary, continuousColorFocus: design.interaction.continuousColorFocus, + annotationDesign: design.interaction.annotation, neutralizeContinuousColor: chartTemplate.chart === 'Map' || chartTemplate.chart === 'Choropleth', }; result._width = plan.plot.width; @@ -841,9 +855,9 @@ function emitVegaLite(input: ChartAssemblyInput, prepared: VegaLitePreparation, : ev ? ev.applicable : true; const recommended = layoutCoupledRecommendation[def.key] ?? ev?.recommendedValue; const value = chartProperties?.[def.key] ?? recommended ?? def.defaultValue; - // Strip the `check` rule — a ChartOption is the resolved, serializable - // answer (`applicable`/`value`), not the predicate that produced it. - const { check, ...rest } = def; + // Strip the rules — a ChartOption is the resolved, serializable + // answer (`applicable`/`value`), not the predicates that produced it. + const { check, accepts, ...rest } = def; return { ...rest, applicable, value }; }); // Layout-level facet-wrap control: offered whenever a column facet has @@ -932,7 +946,7 @@ export function assembleVegaLite(input: ChartAssemblyInput): any { const prepared = prepareVegaLite(input); const analysis = analyzeChart(input, prepared.template, prepared.chartProperties, vlGetTemplateDef); const plan = planLayout(analysis, vegaLitePlanContext(input, prepared, analysis)); - return emitVegaLite(input, prepared, analysis, plan).spec; + return noteSpecUpdates(emitVegaLite(input, prepared, analysis, plan).spec, input); } /** The rows a re-plan lays out: a subset of the analysis rows, the rows a window on x shows, or rows the host supplies. */ @@ -972,6 +986,11 @@ export interface VegaLiteSession { * the new room, title and furniture room included, and later changes of rows plan into that. */ replan(change: ReplanChange): Replanned; + /** + * Rows brought into the form the compiled data holds them: static series folded, aggregated as + * the encodings ask, temporal values converted. A change of rows swaps these into the chart. + */ + shapeRows(rows: readonly Record[]): Record[]; } /** @@ -1094,6 +1113,7 @@ export function openVegaLiteSession( } return planRows(change); }, + shapeRows: (rows) => analysis.shapeRows(rows), }; } diff --git a/packages/flint-js/src/vegalite/boundary-loader.ts b/packages/flint-js/src/vegalite/boundary-loader.ts new file mode 100644 index 00000000..3196b4f7 --- /dev/null +++ b/packages/flint-js/src/vegalite/boundary-loader.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * The named boundaries, served from the package rather than the network. + * + * A compiled map names a named set's boundaries by their URL on Flint's site + * (`chart-types/boundaries.ts`), so the spec renders anywhere online. Flint's renderers give Vega a + * loader that answers those URLs with the copies the package bundles, imported on a map's first + * draw: a bundler splits each into a chunk of the host's own, served from the host's own origin, and + * nothing is fetched from a third party. Where a copy cannot load, the URL is fetched as before. + */ + +import { BOUNDARY_URLS } from '../chart-types/boundaries'; + +type Importer = () => Promise<{ default: unknown }>; + +// Imported by the package's own name: each is an entry of the published package, which a host's +// bundler resolves and splits off, wherever this module is bundled from. +const worldBankCoarse: Importer = () => import('flint-chart/geo/lazy/world-bank-coarse'); +const worldBankMedium: Importer = () => import('flint-chart/geo/lazy/world-bank-medium'); +const world110m: Importer = () => import('flint-chart/geo/lazy/world-110m'); +const states10m: Importer = () => import('flint-chart/geo/lazy/states-10m'); +const countiesAlbers: Importer = () => import('flint-chart/geo/lazy/counties-albers-10m'); + +const BUNDLED: Record = { + [BOUNDARY_URLS.worldBank.coarse]: worldBankCoarse, + [BOUNDARY_URLS.worldBank.medium]: worldBankMedium, + [BOUNDARY_URLS.naturalEarth]: world110m, + [BOUNDARY_URLS.usStates]: states10m, + [BOUNDARY_URLS.usAlbers]: countiesAlbers, + // The URLs earlier releases compiled to, where the bundled copy is the same file byte for byte. + // (Vega's us-10m.json is not us-atlas's states-10m.json: its ids are numbers, so it is fetched.) + 'https://vega.github.io/vega-lite/data/world-110m.json': world110m, + 'https://cdn.jsdelivr.net/npm/us-atlas@3/counties-albers-10m.json': countiesAlbers, +}; + +const loaded = new Map>(); + +/** The bundled topology a named URL stands for, loaded once; undefined for any other URL. */ +export function bundledBoundaries(url: string): Promise | undefined { + const load = BUNDLED[url]; + if (!load) return undefined; + let topology = loaded.get(url); + if (!topology) { + topology = load().then((module) => module.default); + loaded.set(url, topology); + topology.catch(() => loaded.delete(url)); + } + return topology; +} + +/** A Vega loader as given, answering the named boundaries' URLs from the package. */ +export function withBundledBoundaries Promise }>(loader: L): L { + const load = loader.load.bind(loader); + loader.load = (async (uri: string, options?: any) => { + const bundled = typeof uri === 'string' ? bundledBoundaries(uri) : undefined; + if (bundled) { + try { + const topology = await bundled; + // A build that leaves the copies out (a one-file app) stands in null for each. + if (topology) return topology; + } catch { + // The package's copy did not load (a host whose bundler left it out): fetch the URL. + } + } + return load(uri, options); + }) as L['load']; + return loader; +} diff --git a/packages/flint-js/src/vegalite/canvas-furniture.ts b/packages/flint-js/src/vegalite/canvas-furniture.ts index 34428249..99e27561 100644 --- a/packages/flint-js/src/vegalite/canvas-furniture.ts +++ b/packages/flint-js/src/vegalite/canvas-furniture.ts @@ -57,6 +57,8 @@ export interface CanvasFurnitureItem { alt?: string; /** Where the item links to. */ href?: string; + /** Shown on hover. */ + title?: string; /** Centred between `left` and `right` rather than run between them. */ center?: boolean; } @@ -185,9 +187,9 @@ function itemMarkup(item: CanvasFurnitureItem, canvasWidth: number, canvasHeight } else { body = ``; } - return item.href - ? `${body}` - : body; + const title = item.title ? `${escapeAttr(item.title)}` : ''; + if (item.href) return `${title}${body}`; + return title ? `${title}${body}` : body; } /** The markup for a set of canvas-furniture items on a canvas `width` px wide. */ diff --git a/packages/flint-js/src/vegalite/color-classes.ts b/packages/flint-js/src/vegalite/color-classes.ts new file mode 100644 index 00000000..71a9b75d --- /dev/null +++ b/packages/flint-js/src/vegalite/color-classes.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { classColors, jenksColorClasses, quantileColorClasses, roundColorClasses, type NeutralBand } from '../core/color-controls'; +import { DIVERGING_SCHEME_STOPS } from '../core/diverging-schemes'; +import { exactLegendLabels } from './exact-labels'; + +/** Scale properties that describe a continuous or quantized domain, which a threshold scale states for itself. */ +const DOMAIN_KEYS = ['domain', 'domainMid', 'domainMin', 'domainMax', 'domainRaw', 'zero', 'nice', 'scheme', 'interpolate', 'bins']; + +/** + * A colour encoding stepped at round classes ({@link roundColorClasses}): a threshold scale at the + * breaks, a colour per class from the ramp ({@link classColors}), and a key that prints each break + * as it is. The ramp is its stops, or a named scheme: a diverging one Vega names takes its stops + * too, so each class can take the colour at its far edge; any other is sampled evenly by Vega. + * About `target` classes, exactly where `exact` and a round step allows; a field that crosses + * `pivot` has it as a break, or as the centre of a `neutral` class. False where the rows cannot say + * where the classes fall — an aggregated or binned measure, a column the rows do not hold, values + * that do not spread — and the encoding is left as it was. `method` places the breaks at the + * quantiles or natural breaks instead, each printed to two significant figures. + */ +export function stepColorScale( + enc: any, ramp: string[] | { scheme: string }, target: number, table: readonly any[], pivot?: number, + options: { exact?: boolean; neutral?: NeutralBand; method?: 'round' | 'quantile' | 'jenks' } = {}, +): boolean { + if (!enc?.field || enc.aggregate || enc.bin || enc.type !== 'quantitative') return false; + if (Array.isArray(ramp) && ramp.length < 2) return false; + const values: number[] = []; + for (const row of table) { + const value = row?.[enc.field]; + if (typeof value === 'number' && Number.isFinite(value)) values.push(value); + } + // Quantiles and natural breaks follow the values, not a pivot; a diverging field keeps round classes about it. + const classes = options.method === 'quantile' ? quantileColorClasses(values, target) + : options.method === 'jenks' ? jenksColorClasses(values, target) + : roundColorClasses(values, target, pivot, options); + if (!classes) return false; + const scale = { ...(enc.scale ?? {}) }; + for (const key of DOMAIN_KEYS) delete scale[key]; + delete scale.range; + const count = classes.breaks.length + 1; + const stops = Array.isArray(ramp) ? ramp : DIVERGING_SCHEME_STOPS[ramp.scheme.toLowerCase()]; + let colors: Record; + if (stops && (Array.isArray(ramp) || classes.below !== undefined)) colors = { range: classColors(stops, classes) }; + else { + // A scheme Flint holds no stops for, sampled evenly over the stretch the classes take. + const { below, above } = classes; + const side = below !== undefined && above !== undefined ? Math.max(below, above) : undefined; + const extent = side === undefined ? [0, 1] : [(side - below!) / (2 * side - 1), (side + above! - 1) / (2 * side - 1)]; + colors = { scheme: { name: (ramp as { scheme: string }).scheme, count, ...(extent[0] > 0 || extent[1] < 1 ? { extent } : {}) } }; + } + enc.scale = { ...scale, type: 'threshold', domain: classes.breaks, ...colors }; + if (enc.legend !== null && enc.legend !== false) { + enc.legend = { ...(enc.legend ?? {}), ...exactLegendLabels(enc.legend ?? {}, classes.breaks) }; + } + return true; +} diff --git a/packages/flint-js/src/vegalite/color-controls.ts b/packages/flint-js/src/vegalite/color-controls.ts index 4b3493d4..42ea7de0 100644 --- a/packages/flint-js/src/vegalite/color-controls.ts +++ b/packages/flint-js/src/vegalite/color-controls.ts @@ -1,4 +1,5 @@ -import { resampleStops, type AuthoredColorScale } from '../core/color-controls'; +import { resampleStops, type AuthoredColorScale, type NeutralBand } from '../core/color-controls'; +import { stepColorScale } from './color-classes'; import { fitBinnedKeyLength } from './theme'; const COLOR_CHANNELS = ['color', 'fill', 'stroke'] as const; @@ -57,23 +58,31 @@ export function restoreColorScales(snapshot: Map): void { /** * The author's colour controls, laid over whatever the defaults and the theme chose: they win. * A named scheme is the templates' to read (see {@link snapshotColorScales}); stops, bins, - * reverse and domain are laid here. Value-label text keeps its own ink scale, which reads the - * ramp rather than paints it. + * reverse and domain are laid here; bins break at a diverging field's pivot, or centre a `neutral` + * class on it. Value-label text keeps its own ink scale, which reads the ramp rather than paints it. */ -export function applyAuthoredColorScaleVL(spec: any, ctl: AuthoredColorScale, table: any[]): void { +export function applyAuthoredColorScaleVL(spec: any, ctl: AuthoredColorScale, table: any[], neutral?: NeutralBand): void { let binned = false; for (const enc of colorEncodings(spec, ctl.field)) { const scale: Record = { ...(enc.scale ?? {}) }; + // A diverging field's pivot, read before the bins clear it: stepped classes break there. + const pivot = typeof scale.domainMid === 'number' ? scale.domainMid : undefined; + // A threshold scale's domain is its breaks; a scale that is not stepped any more spans the data. + const unstep = () => { + if (scale.type === 'threshold') delete scale.domain; + delete scale.type; + }; if (ctl.stops) { delete scale.scheme; scale.range = ctl.stops; } if (ctl.bins === undefined) { // A ramp the author named runs continuously unless they asked for bins. - if (ctl.stops && BINNED.includes(scale.type)) delete scale.type; + if (ctl.stops && BINNED.includes(scale.type)) unstep(); } else if (ctl.bins === 0) { - if (BINNED.includes(scale.type)) delete scale.type; + if (BINNED.includes(scale.type)) unstep(); } else { + if (scale.type === 'threshold') delete scale.domain; scale.type = 'quantize'; delete scale.domainMid; if (!ctl.stops) { @@ -85,7 +94,12 @@ export function applyAuthoredColorScaleVL(spec: any, ctl: AuthoredColorScale, ta if (ctl.reverse !== undefined) scale.reverse = ctl.reverse; if (ctl.domain) scale.domain = ctl.domain; enc.scale = scale; - if (scale.type === 'quantize') binned = true; + // Bins over the data step at round values; over a domain the author stated, they cut it evenly. + if (ctl.bins && !ctl.domain) { + const ramp = Array.isArray(scale.range) ? scale.range : { scheme: scale.scheme?.name ?? 'viridis' }; + stepColorScale(enc, ramp, ctl.bins, table, pivot, { exact: true, neutral }); + } + if (BINNED.includes(enc.scale.type)) binned = true; } if (binned) { spec.config = spec.config ?? {}; diff --git a/packages/flint-js/src/vegalite/exact-labels.ts b/packages/flint-js/src/vegalite/exact-labels.ts new file mode 100644 index 00000000..e23d2b7e --- /dev/null +++ b/packages/flint-js/src/vegalite/exact-labels.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { exactPattern } from '../core/sample-format'; + +const FORMAT_CALL = /format\(datum\.value,\s*(['"])([^'"]*)\1\)/g; + +/** + * The format a key's values print in, precise enough for each: a size key's sampled values, a + * stepped colour key's breaks. Vega otherwise labels them with the scale's tick format, which rounds + * 0.5 and 2.5 to "1" and "3". The field's own format — a percentage, a currency's sign — is kept, + * its precision raised where needed. + */ +export function exactLegendLabels(legend: any, values: number[]): { format?: string; labelExpr?: string } { + if (legend.formatType !== undefined) return {}; + const out: { format?: string; labelExpr?: string } = {}; + const labelExpr = legend.labelExpr; + if (typeof labelExpr === 'string') { + out.labelExpr = labelExpr.replace(FORMAT_CALL, (_, quote: string, pattern: string) => + `format(datum.value, ${quote}${exactPattern(values, pattern)}${quote})`); + } + // A label expression that reads the label Vega formatted needs that format exact too. + if (labelExpr === undefined || /datum\.label\b/.test(labelExpr)) { + out.format = exactPattern(values, typeof legend.format === 'string' ? legend.format : undefined); + } + return out; +} diff --git a/packages/flint-js/src/vegalite/honour.ts b/packages/flint-js/src/vegalite/honour.ts index bc100bac..1fe9ff41 100644 --- a/packages/flint-js/src/vegalite/honour.ts +++ b/packages/flint-js/src/vegalite/honour.ts @@ -98,10 +98,17 @@ function axisDepartures(plan: LayoutPlan, spec: any, out: PlanDeparture[]): void const stated = statedDomains(encodings); const ruler = plan.rulers[channel]; if (ruler) { - const departs = !stated.length || stated.some(([min, max]) => (min !== undefined && min !== ruler.domain[0]) || (max !== undefined && max !== ruler.domain[1])); + // Room for value labels past horizontal bars runs the ruler on past its planned end, with + // its ticks at the same step: the planned ruler is the start of the drawn one. + const labelRoom = channel === 'x' && plan.valueLabels && !('refused' in plan.valueLabels) + && plan.valueLabels.channel === 'x' && (plan.valueLabels.inset ?? 0) > 0; + const departs = !stated.length || stated.some(([min, max]) => (min !== undefined && min !== ruler.domain[0]) + || (max !== undefined && max !== ruler.domain[1] && !(labelRoom && typeof max === 'number' && max > ruler.domain[1]))); if (departs) out.push({ decision: `rulers.${channel}.domain`, at, planned: ruler.domain, drawn: stated }); const values = encodings.map((encoding) => encoding.axis?.values).filter((list) => list !== undefined); - if (!values.length || values.some((list) => !sameDecision(ruler.values, list))) out.push({ decision: `rulers.${channel}.values`, at, planned: ruler.values, drawn: values }); + const matches = (list: unknown) => sameDecision(ruler.values, list) + || (labelRoom && Array.isArray(list) && sameDecision(ruler.values, list.slice(0, ruler.values.length))); + if (!values.length || values.some((list) => !matches(list))) out.push({ decision: `rulers.${channel}.values`, at, planned: ruler.values, drawn: values }); continue; } const planned = plan.domains[channel]; diff --git a/packages/flint-js/src/vegalite/index.ts b/packages/flint-js/src/vegalite/index.ts index 06940eb7..2d411cf4 100644 --- a/packages/flint-js/src/vegalite/index.ts +++ b/packages/flint-js/src/vegalite/index.ts @@ -33,6 +33,9 @@ export { canvasPatternDefs, } from './canvas-furniture'; +// The named map boundaries, served from the package to a Vega view of the host's own +export { bundledBoundaries, withBundledBoundaries } from './boundary-loader'; + // VL template registry export { vlTemplateDefs, diff --git a/packages/flint-js/src/vegalite/instantiate-spec.ts b/packages/flint-js/src/vegalite/instantiate-spec.ts index 9b6e8da1..bc73f3f8 100644 --- a/packages/flint-js/src/vegalite/instantiate-spec.ts +++ b/packages/flint-js/src/vegalite/instantiate-spec.ts @@ -28,6 +28,7 @@ import type { LayoutPlan } from '../core/plan'; import { AXIS_LABEL_LIMIT } from '../core/compute-layout'; import { planAxisLabels, type AxisLabelPlan } from '../core/axis-labels'; import { OWNED_AXIS_KEYS } from './owned-axis-keys'; +import { spansCalendarCells } from './templates/utils'; import { timeMillisecond, timeSecond, timeMinute, timeHour, timeDay, timeWeek, timeMonth, timeYear, utcMillisecond, utcSecond, utcMinute, utcHour, utcDay, utcWeek, utcMonth, utcYear, @@ -38,6 +39,25 @@ import { hostTextMeasurer } from '../core/text-width'; const DEFAULT_QUANTITATIVE_AXIS_FORMAT = ',.12~g'; const VEGA_AXIS_LABEL_LIMIT = AXIS_LABEL_LIMIT; +/** The label expression of a sequence axis thinned to round values: only `shown` print. */ +export function skipLabelExpr(shown: readonly string[]): string { + return `indexof(${JSON.stringify(shown)}, toString(datum.value)) >= 0 ? datum.label : ''`; +} + +/** The names a `skipLabelExpr` prints, or undefined where the expression is no such thinning. */ +export function skipLabelsOf(expr: unknown): string[] | undefined { + const match = typeof expr === 'string' + ? expr.match(/^indexof\((\[.*\]), toString\(datum\.value\)\) >= 0 \? datum\.label : ''$/) + : null; + if (!match) return undefined; + try { + const shown = JSON.parse(match[1]); + return Array.isArray(shown) ? shown.map(String) : undefined; + } catch { + return undefined; + } +} + /** Whether a template states its own labels for this axis, so the band labels are left as it wrote them. */ export function templateStatesAxisLabels(template: any, channel: 'x' | 'y'): boolean { return [template.encoding?.[channel], ...(template.layer ?? []).map((layer: any) => layer.encoding?.[channel])] @@ -200,6 +220,8 @@ export function vlApplyLayoutToSpec( // --- Write the planned spans of banded continuous axes, where no domain is stated --- // Labelled heatmaps move X/Y onto rect and text layers, so every matching target takes the span. for (const [axis, planned] of Object.entries(bandSpans) as Array<['x' | 'y', NonNullable]>) { + // Cells that span their periods reach from the first date to the last end on their own. + if (spansCalendarCells(vgObj, axis)) continue; for (const enc of collectEncodingTargets(axis)) { if (enc.bin || enc.scale?.domain) continue; if (enc.type !== (planned.temporal ? 'temporal' : 'quantitative')) continue; @@ -236,7 +258,7 @@ export function vlApplyLayoutToSpec( const fit = labels.overflowFit; if (fit?.step === 'skip' && fit.shown) { // The names on round values (16:45, 17:00 …), looked up by the value as written; each band keeps its tick. - config.labelExpr = `indexof(${JSON.stringify(fit.shown)}, toString(datum.value)) >= 0 ? datum.label : ''`; + config.labelExpr = skipLabelExpr(fit.shown); } } for (const channel of ['x', 'y'] as const) { @@ -1114,13 +1136,29 @@ const isWorkingColumn = (field: unknown): boolean => typeof field === 'string' & const NOT_LISTED = new Set(['tooltip', 'href', 'url', 'description', 'key']); const TOOLTIP_FIELD_KEYS = ['field', 'type', 'title', 'aggregate', 'timeUnit', 'bin', 'format', 'formatType'] as const; const COMPOSITE_MARKS = new Set(['boxplot', 'errorbar', 'errorband']); +const STACKED_MARKS = new Set(['bar', 'area', 'arc']); + +/** + * Whether Vega-Lite will stack a mark in the order of its colour domain: a discrete colour with a + * stated domain and no `order` makes it compute `__sort_index` and list it as the order. + */ +function ordersStackByColorDomain(mark: unknown, encoding: Record): boolean { + const color = encoding.fill ?? encoding.color; + if (!color?.field || color.type !== 'nominal' || !Array.isArray(color.scale?.domain)) return false; + if (encoding.order !== undefined || encoding.xOffset !== undefined || encoding.yOffset !== undefined) return false; + const type = typeof mark === 'object' && mark !== null ? (mark as any).type : mark; + const stacks = ['x', 'y', 'theta'].map((channel) => encoding[channel]).filter((def) => def && 'stack' in def).map((def) => def.stack); + if (stacks.some((stack) => stack === null || stack === false)) return false; + return STACKED_MARKS.has(type) || stacks.length > 0; +} /** * Keeps Flint's working columns out of the tooltips Vega-Lite builds from each mark's encoding. * A column that repacks the author's field — a folded colour key, a waterfall's step kind — carries * that field's name as its title and stays, under the name. One with no name of its own — a radar's * positions, a pie's order, a strip's jitter — names nothing a reader asked about, and is left out; - * a mark with nothing else to list shows no tooltip. A mark whose tooltip lists no working column + * a mark with nothing else to list shows no tooltip. A stack ordered by its colour's stated domain + * counts too: Vega-Lite would list the sort index it computes for it. A mark whose tooltip lists no working column * is left as it is, and so is a composite mark (a boxplot), whose summary a stated list would drop. */ export function vlListTooltipFields(spec: any): void { @@ -1138,7 +1176,7 @@ export function vlListTooltipFields(spec: any): void { if (node.mark && encoding.tooltip === null && markTooltip !== false && markTooltip !== null) silence(); else if (node.mark && !composite && markTooltip !== false && markTooltip !== null && encoding.tooltip === undefined) { const listed: any[] = []; - let working = false; + let working = ordersStackByColorDomain(node.mark, encoding); for (const [channel, def] of Object.entries(encoding)) { if (NOT_LISTED.has(channel) || !def || typeof def !== 'object' || Array.isArray(def)) continue; if (def.field === undefined && def.aggregate !== 'count') continue; diff --git a/packages/flint-js/src/vegalite/interactions/baseline.ts b/packages/flint-js/src/vegalite/interactions/baseline.ts new file mode 100644 index 00000000..32625245 --- /dev/null +++ b/packages/flint-js/src/vegalite/interactions/baseline.ts @@ -0,0 +1,19 @@ +import { baselineOn, type InteractionDefaults, type InteractionCapability } from '../../core/interaction-spec'; +import type { CanvasInteractionDef } from '../../interactive/interactions'; +import { createLegendDimInteraction } from '../../interactive/presets/legend-dim'; + +/** What the baseline reads from the compiled chart. */ +export interface BaselineChart { + capabilities: readonly InteractionCapability[]; +} + +/** + * The behaviour every mounted chart has without asking: a legend click that dims a group. It is + * tagged `origin: 'baseline'`, so admission drops it, silently, wherever the spec or the code asks + * for the same gesture. The nearest-mark tooltip is not an interaction: the runtime draws it. Pan + * and zoom are never baseline: an agent asks for them. + */ +export function baselineInteractions(chart: BaselineChart, defaults: InteractionDefaults | undefined): CanvasInteractionDef[] { + if (!baselineOn(defaults, 'legend') || !chart.capabilities.includes('legend')) return []; + return [{ ...createLegendDimInteraction({ id: 'flint-legend-dim' }), origin: 'baseline' }]; +} diff --git a/packages/flint-js/src/vegalite/interactions/compile.ts b/packages/flint-js/src/vegalite/interactions/compile.ts index 6a195d01..711ffc6e 100644 --- a/packages/flint-js/src/vegalite/interactions/compile.ts +++ b/packages/flint-js/src/vegalite/interactions/compile.ts @@ -1,3 +1,5 @@ +import { DISPUTED_FEATURE } from '../../chart-types/boundaries'; +import { ROUTE_DATUM } from '../templates/map-routes'; import type { ChartInteractionResolver } from '../../core/interaction-semantics'; import type { InteractionCapability } from '../../core/interaction-spec'; import { @@ -12,6 +14,7 @@ import { INTERACTION_ROW } from '../../core/interaction-semantics'; import { affordsTarget } from '../../interactive/affordances'; import { DEFAULT_DIM_OPACITY } from '../../interactive/presets/utils'; import { INTERACTION_PROVENANCE, type InteractionProvenance } from '../interaction-provenance'; +import type { AnnotationDesign } from '../../core/theme/types'; import type { HoverStyle, SelectionBoundaryStyle, @@ -35,7 +38,10 @@ import { AXIS_HOVER_STORE, LEGEND_SELECTION_STORE, STYLE_SIGNAL, + DIM_SIGNAL, + DIM_RELATIVE_SIGNAL, } from './stores'; +import { isDarkPage } from '../../core/annotation/color'; import type { TemporalAxisPlanInputs } from '../instantiate-spec'; import { bindTemporalAxisTicks, navigationDomainSignal, walkVegaGroups } from './live-layout'; import { @@ -81,6 +87,7 @@ interface TemplateInteractionSemantics { renderSelectionStyles?: Record; selectionBoundary?: SelectionBoundaryStyle; continuousColorFocus?: ContinuousColorFocusStyle; + annotationDesign?: AnnotationDesign; neutralizeContinuousColor?: boolean; resolve?: ChartInteractionResolver; presentUpdate?: ChartUpdatePresenter; @@ -105,7 +112,8 @@ function expandInteractiveLinePoints(spec: Record): void { if (type === 'line' && typeof spec.mark === 'object' && spec.mark.point) { const lineMark = { ...spec.mark }; const point = lineMark.point; - delete lineMark.point; + // The dots move to their own layer; `false` keeps a house's `config.line.point` from drawing them again. + lineMark.point = false; spec.layer = [ { mark: lineMark }, { mark: typeof point === 'object' ? { type: 'point', ...point } : { type: 'point', filled: true } }, @@ -179,6 +187,14 @@ function isSelectable(type: string, selectableMarks: ReadonlySet): boole return DOT_MARKS.has(type) && [...DOT_MARKS].some((dot) => selectableMarks.has(dot)); } +/** + * The opacity a mark recedes to outside an emphasis: an emphasis level scales the mark's own + * opacity (a dot drawn at 0.7 recedes from 0.7, not from 1), a stated opacity replaces it. + */ +function recededOpacity(authored: number): string { + return `${DIM_RELATIVE_SIGNAL} ? ${authored} * ${DIM_SIGNAL} : min(${DIM_SIGNAL}, ${authored})`; +} + function instrumentNode( node: Record, inherited: Record, @@ -187,6 +203,7 @@ function instrumentNode( continuousColorFocus: ContinuousColorFocusStyle | undefined, selectableMarks: ReadonlySet, config: Record | undefined, + pageInk?: string, ): boolean { const type = markType(node.mark); const selectable = !!type && SUPPORTED_SPEC_MARKS.has(type) && isSelectable(type, selectableMarks); @@ -215,14 +232,33 @@ function instrumentNode( ]; } const encoding = { ...inherited, ...(node.encoding ?? {}) }; - const encodedOpacity = encoding.opacity; + // Value conditions the template put on the opacity — a globe hiding what stands behind its + // horizon — are gates focus must not lift: they stay first, and focus manages the rest. + const opacityGates = opacityValueGates(encoding.opacity); + const encodedOpacity = opacityGates ? undefined : encoding.opacity; const encodedColor = encoding.color; const continuousColor = continuousColorFocus && encodedColor?.field && (encodedColor.type === 'quantitative' || encodedColor.type === 'temporal') && !encodedColor.condition; const dataDrivenOpacity = encodedOpacity?.field && !encodedOpacity.condition; - if ((textLabel || legendLabel) && provenance.presentation === 'on-mark') return true; + const receded = `length(data('${INTERACTION_STORE}')) && !indata('${INTERACTION_STORE}', 'key', datum.${INTERACTION_KEY})`; + if ((textLabel || legendLabel) && provenance.presentation === 'on-mark') { + // A label drawn on its mark was inked against the mark's fill; as the mark recedes toward + // the page, the label takes the page's ink so it stays readable. + if (textLabel && pageInk) { + const markColor = typeof node.mark === 'object' ? node.mark?.color ?? node.mark?.fill : undefined; + const existing = node.encoding?.color; + const recededInk = { test: receded, value: pageInk }; + node.encoding = { + ...(node.encoding ?? {}), + color: existing && typeof existing === 'object' + ? { ...existing, condition: [recededInk, ...(existing.condition ? (Array.isArray(existing.condition) ? existing.condition : [existing.condition]) : [])] } + : { condition: recededInk, ...(typeof markColor === 'string' ? { value: markColor } : {}) }, + }; + } + return true; + } if ((encodedOpacity && typeof encodedOpacity.value !== 'number' && !dataDrivenOpacity) || encoding.fillOpacity || encoding.strokeOpacity) return false; const authoredOpacity = typeof encodedOpacity?.value === 'number' @@ -238,6 +274,11 @@ function instrumentNode( const selectionTest = isPath ? `!length(data('${INTERACTION_STORE}'))` : `!length(data('${INTERACTION_STORE}')) || indata('${INTERACTION_STORE}', 'key', datum.${INTERACTION_KEY})`; + const gated = (opacity: Record): Record => { + if (!opacityGates) return opacity; + const own = opacity.condition === undefined ? [] : Array.isArray(opacity.condition) ? opacity.condition : [opacity.condition]; + return { ...opacity, condition: [...opacityGates, ...own] }; + }; node.encoding = { ...(node.encoding ?? {}), ...(isPath ? {} : { @@ -255,20 +296,40 @@ function instrumentNode( value: continuousColorFocus.mutedFill, }, } : {}), - opacity: continuousColor ? { value: authoredOpacity } : dataDrivenOpacity ? { + // The receded opacity follows the emphasis level each render (DIM_SIGNAL); a label recedes + // less than its mark, so the values of the marks set back can still be read. + opacity: gated(continuousColor ? { value: authoredOpacity } : dataDrivenOpacity ? { condition: { test: selectionTest, ...encodedOpacity }, - value: dimOpacity, + value: { expr: DIM_SIGNAL }, } : { condition: { test: `${selectionTest} || ${hoverTest}`, value: authoredOpacity, }, - value: Math.min(dimOpacity, authoredOpacity), - }, + value: { expr: textLabel ? `min(${authoredOpacity}, max(${recededOpacity(authoredOpacity)}, 0.5))` : recededOpacity(authoredOpacity) }, + }), }; return true; } +/** + * The value conditions of an opacity that states nothing else — no field, no value of its own — + * which a template set to hide marks under a test; undefined for any other opacity. + */ +function opacityValueGates(opacity: any): Record[] | undefined { + if (!opacity || typeof opacity !== 'object' || opacity.field !== undefined || opacity.value !== undefined) return undefined; + const conditions = Array.isArray(opacity.condition) ? opacity.condition : opacity.condition ? [opacity.condition] : []; + if (!conditions.length || !conditions.every((condition: any) => typeof condition?.test === 'string' && typeof condition.value === 'number')) return undefined; + return conditions; +} + +/** The ink text reads in on the chart's page, for a label whose mark recedes into it. */ +function pageTextInk(spec: Record): string { + const background = typeof spec.background === 'string' ? spec.background + : typeof spec.config?.background === 'string' ? spec.config.background : '#ffffff'; + return isDarkPage(background) ? '#e6e6e6' : '#333333'; +} + function instrumentMarks( spec: Record, inherited: Record, @@ -277,6 +338,7 @@ function instrumentMarks( continuousColorFocus: ContinuousColorFocusStyle | undefined, selectableMarks: ReadonlySet, config: Record | undefined, + pageInk?: string, ): boolean { const encoding = { ...inherited, ...(spec.encoding ?? {}) }; let instrumented = instrumentNode( @@ -287,6 +349,7 @@ function instrumentMarks( continuousColorFocus, selectableMarks, config, + pageInk, ); for (const property of ['layer', 'hconcat', 'vconcat', 'concat'] as const) { if (!Array.isArray(spec[property])) continue; @@ -299,6 +362,7 @@ function instrumentMarks( continuousColorFocus, selectableMarks, config, + pageInk, ) || instrumented; } } @@ -311,6 +375,7 @@ function instrumentMarks( continuousColorFocus, selectableMarks, config, + pageInk, ) || instrumented; } return instrumented; @@ -392,7 +457,8 @@ function pinChannelDomain( }; const direction = sort.order === 'ascending' ? 1 : -1; values.sort((left, right) => direction * (aggregate(left) - aggregate(right))); - } else { + } else if (sort !== null) { + // `sort: null` is the order the rows give, which `values` already holds. values.sort((left, right) => (left as any) < (right as any) ? -1 : (left as any) > (right as any) ? 1 : 0); if (sort === 'descending') values.reverse(); } @@ -423,7 +489,10 @@ function pinLegendDomains( if (channel === 'size' || channel === 'opacity') continue; const values = [...new Set(rows.map((row) => row?.[field]).filter((value) => value !== undefined))]; if (values.length === 0 || values.some((value) => typeof value !== 'string' && typeof value !== 'number')) continue; - pinChannelDomain(spec, channel === 'color' ? 'color' : channel, field, rows); + pinChannelDomain(spec, channel, field, rows); + // A theme can draw the same field again as a mark's edge or fill (a faint ink's darker + // outline): it must keep the colour's order, or each mark takes another series' edge. + if (channel === 'color') for (const twin of ['stroke', 'fill']) pinChannelDomain(spec, twin, field, rows); } } @@ -559,6 +628,7 @@ export function addVegaLiteInteractions( templateSemantics.neutralizeContinuousColor ? templateSemantics.continuousColorFocus : undefined, selectableMarks, spec.config, + pageTextInk(spec), ) : false; if (needsSemanticPresentation && !instrumented) return null; @@ -598,6 +668,7 @@ export function addVegaLiteInteractions( renderSelectionStyles: templateSemantics.renderSelectionStyles, selectionBoundary: templateSemantics.selectionBoundary, continuousColorFocus: templateSemantics.continuousColorFocus, + annotationDesign: templateSemantics.annotationDesign, navigationChannels: [...requestedNavigationAxes], geoNavigation: templateSemantics.geoNavigation ?? false, geoLevels: templateSemantics.geoLevels, @@ -733,7 +804,10 @@ export function injectVegaGeoNavigationSignals( // fit (the whole sphere) does not depend on the rotation, so it holds its size. if (isGlobeProjection(projection.type)) { const authored = Array.isArray(projection.rotate) ? projection.rotate : [0, 0, 0]; - vegaSpec.signals.push({ name: GEO_ROTATE_SIGNAL, value: authored }); + // A globe that hides its far side declares the signal itself, at the same rotation. + if (!vegaSpec.signals.some((signal: any) => signal?.name === GEO_ROTATE_SIGNAL)) { + vegaSpec.signals.push({ name: GEO_ROTATE_SIGNAL, value: authored }); + } projection.rotate = { signal: GEO_ROTATE_SIGNAL }; } const result: Partial> = {}; @@ -764,8 +838,20 @@ export function vegaGeoFocusSource(vegaSpec: Record): string | unde } return false; }; + // The lines a map draws over its regions (the disputed borders, its routes) are no region to focus. + const lines = (name: string | undefined): boolean => { + const seen = new Set(); + for (let dataset = name ? byName.get(name) : undefined; dataset && !seen.has(dataset.name); dataset = byName.get(dataset.source)) { + seen.add(dataset.name); + if (dataset.format?.feature === DISPUTED_FEATURE) return true; + // A mesh of borders is lines, not regions. + if (typeof dataset.format?.mesh === 'string') return true; + if (Array.isArray(dataset.values) && dataset.values[0]?.[ROUTE_DATUM] === true) return true; + } + return false; + }; const shapes = (Array.isArray(vegaSpec.marks) ? vegaSpec.marks : []) - .filter((mark: any) => mark?.type === 'shape' && typeof mark.from?.data === 'string'); + .filter((mark: any) => mark?.type === 'shape' && typeof mark.from?.data === 'string' && !lines(mark.from.data)); return (shapes.find((mark: any) => keyed(mark.from.data)) ?? shapes[shapes.length - 1])?.from.data; } @@ -918,8 +1004,11 @@ function applyCompiledHoverStyles( for (const [channel, value] of Object.entries(hoverStyle)) { if (channel === 'opacity' && (value === 'contrast' || value === 'spotlight')) { const currentOpacity = Array.isArray(update.opacity) ? update.opacity : [update.opacity]; + // A data-driven opacity is the author's; the receded level's signal is Flint's own. if (value === 'spotlight' && currentOpacity.some((entry: any) => - entry?.field !== undefined || entry?.signal !== undefined || entry?.condition?.field !== undefined + entry?.field !== undefined + || (entry?.signal !== undefined && !String(entry.signal).includes(DIM_SIGNAL)) + || entry?.condition?.field !== undefined )) continue; const numericValues = currentOpacity .map((entry: any) => entry?.value) @@ -1016,6 +1105,8 @@ export function injectVegaInteractionStore( vegaSpec.signals = [ ...(Array.isArray(vegaSpec.signals) ? vegaSpec.signals : []), { name: STYLE_SIGNAL, value: {} }, + { name: DIM_SIGNAL, value: plan?.dimOpacity ?? DEFAULT_DIM_OPACITY }, + { name: DIM_RELATIVE_SIGNAL, value: false }, ]; const instrumentLegends = (scope: Record): void => { for (const legend of scope.legends ?? []) { diff --git a/packages/flint-js/src/vegalite/interactions/contracts.ts b/packages/flint-js/src/vegalite/interactions/contracts.ts index 6521c52b..d102cabc 100644 --- a/packages/flint-js/src/vegalite/interactions/contracts.ts +++ b/packages/flint-js/src/vegalite/interactions/contracts.ts @@ -1,5 +1,6 @@ import type { ChartInteractionResolver } from '../../core/interaction-semantics'; import type { ChartWarning } from '../../core/types'; +import type { AnnotationDesign } from '../../core/theme/types'; import type { CanvasInteractionDef, ChartUpdatePresenter, InteractionContext } from '../../interactive/interactions'; import type { GeoLevelConfig, GeoPreProjection } from './navigation-geo'; @@ -80,6 +81,8 @@ export interface VegaInteractionPlan { renderSelectionStyles?: Readonly>; selectionBoundary?: Readonly; continuousColorFocus?: Readonly; + /** The house's accent and note text, for the annotation overlays. */ + annotationDesign?: Readonly; navigationChannels?: readonly ('x' | 'y')[]; /** Navigation moves a cartographic projection's extent rather than scale domains. */ geoNavigation?: boolean; @@ -89,15 +92,19 @@ export interface VegaInteractionPlan { geoPreProjection?: GeoPreProjection; /** The dataset a single-level map reads its focus and region viewports from (set once compiled). */ geoFocusSource?: string; + /** The map's World Bank boundaries follow the zoom from coarse to medium (set once compiled). */ + geoDetail?: boolean; /** Polar templates realize the primary X brush as an angular sector. */ angularXBrush?: boolean; navigationAxes?: Partial>; /** Unambiguous existing Cartesian scales available to external overlays. */ overlayScales?: Partial>; + /** On a map, the signal holding its live projection, through which overlays and regions placed by longitude and latitude are drawn. */ + overlayProjectionSignal?: string; /** Mutable compiled inline source used by `set-data`. */ mutableDataSource?: string; initialDataRows?: readonly Record[]; - /** Brings host rows into the compiled data's form (temporal values as the compiler writes them). */ + /** Brings host rows into the compiled data's form: folded and aggregated as the encodings ask, temporal values as the compiler writes them. */ prepareDataRows?: (rows: readonly Record[]) => readonly Record[]; /** A value of a temporal field as the compiled data holds it, read the way the input rows are. */ temporalValue?: (field: string, value: unknown) => unknown; diff --git a/packages/flint-js/src/vegalite/interactions/geo-detail.ts b/packages/flint-js/src/vegalite/interactions/geo-detail.ts new file mode 100644 index 00000000..a3ba55b8 --- /dev/null +++ b/packages/flint-js/src/vegalite/interactions/geo-detail.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * A world map's boundaries sharpen as it is zoomed: the coarse World Bank map draws the world, and + * once the view comes down to about a continent the medium one takes its place, coarse again on the + * way out — Data Formulator's thresholds. The map's datasets read their URL from a signal, so the + * swap is Vega's own reload; Flint's loader serves the finer file from the package. + */ + +import { BOUNDARY_URLS } from '../../chart-types/boundaries'; +import { GEO_PROJECTION_SIGNAL } from './navigation-geo'; + +export const GEO_DETAIL_SIGNAL = '__flint_geo_detail'; + +/** The projected width of 360° of longitude, in px, past which the medium detail draws, and under which the coarse returns. */ +const MEDIUM_ENTER = 3200; +const MEDIUM_EXIT = 2600; + +/** + * Bind the datasets that draw the default coarse World Bank map to the detail signal. A map the host + * gave its own boundaries, or one framed on a region (drawn at medium detail already), is left alone. + */ +export function injectVegaGeoDetail(vegaSpec: Record): boolean { + const { coarse, medium } = BOUNDARY_URLS.worldBank; + let bound = false; + for (const dataset of Array.isArray(vegaSpec.data) ? vegaSpec.data : []) { + if (dataset?.url !== coarse) continue; + dataset.url = { signal: `${GEO_DETAIL_SIGNAL} === 'medium' ? ${JSON.stringify(medium)} : ${JSON.stringify(coarse)}` }; + bound = true; + } + if (bound) vegaSpec.signals = [...(Array.isArray(vegaSpec.signals) ? vegaSpec.signals : []), { name: GEO_DETAIL_SIGNAL, value: 'coarse' }]; + return bound; +} + +/** The detail a projection draws at, from the detail shown now. */ +export function geoDetailFor(scale: number, current: 'coarse' | 'medium'): 'coarse' | 'medium' { + const worldWidth = scale * 2 * Math.PI; + if (worldWidth > MEDIUM_ENTER) return 'medium'; + if (worldWidth < MEDIUM_EXIT) return 'coarse'; + return current; +} + +/** Follow a mounted map's zoom with its detail; returns the unsubscribe. */ +export function followGeoDetail(view: any): () => void { + let detail: 'coarse' | 'medium' = view.signal(GEO_DETAIL_SIGNAL) === 'medium' ? 'medium' : 'coarse'; + const listener = (_name: string, projection: any): void => { + const scale = typeof projection?.scale === 'function' ? Number(projection.scale()) : Number.NaN; + if (!Number.isFinite(scale)) return; + const next = geoDetailFor(scale, detail); + if (next === detail) return; + detail = next; + // Not inside the dataflow's own pulse: the reload runs once it has settled. + queueMicrotask(() => { + view.signal(GEO_DETAIL_SIGNAL, next); + void view.runAsync(); + }); + }; + view.addSignalListener(GEO_PROJECTION_SIGNAL, listener); + return () => view.removeSignalListener(GEO_PROJECTION_SIGNAL, listener); +} diff --git a/packages/flint-js/src/vegalite/interactions/geo-levels.ts b/packages/flint-js/src/vegalite/interactions/geo-levels.ts index 2d0f6dca..1b6334d0 100644 --- a/packages/flint-js/src/vegalite/interactions/geo-levels.ts +++ b/packages/flint-js/src/vegalite/interactions/geo-levels.ts @@ -6,6 +6,12 @@ export function isGlobeProjection(type: unknown): boolean { return type === 'orthographic'; } +/** + * The rotation of a globe's projection, in degrees. Navigation turns it on a drag; a globe that + * hides what stands behind it reads it to tell the near side from the far one. + */ +export const GEO_ROTATE_SIGNAL = '__flint_geo_rotate'; + /** Names the detail level a multi-level projected chart currently draws. */ export const GEO_LEVEL_SIGNAL = '__flint_geo_level'; diff --git a/packages/flint-js/src/vegalite/interactions/hit-adapter.ts b/packages/flint-js/src/vegalite/interactions/hit-adapter.ts index e2778335..a6916500 100644 --- a/packages/flint-js/src/vegalite/interactions/hit-adapter.ts +++ b/packages/flint-js/src/vegalite/interactions/hit-adapter.ts @@ -16,6 +16,7 @@ import type { RegionOperation, } from '../../interactive/language/events'; import { angularSegments } from '../../interactive/geometry/angular'; +import { ROUTE_PART } from '../templates/map-routes'; import { constrainCartesianRegion, type CartesianRegionAxis, @@ -151,7 +152,55 @@ export function pathHoverPresentationKey(items: readonly any[], semanticKey: str return pathKey ? `${pathKey}${PATH_KEY_SUFFIX}` : semanticKey; } +/** Whether an item is a map route's leg: a shape that is a path, as a line's segment is. */ +export function isRouteLeg(item: any): boolean { + return item?.mark?.marktype === 'shape' && item?.datum?.[ROUTE_PART] === 'leg'; +} + +/** A route's casing or head: drawn with its leg and receding with it, but no target of its own. */ +function isRouteAccessory(item: any): boolean { + const part = item?.datum?.[ROUTE_PART]; + return part === 'casing' || part === 'head'; +} + +/** The polyline a leg is drawn as, replayed from its own shape, cached until its drawing moves. */ +const LEG_POINTS = new WeakMap(); + +/** + * A route leg's drawn line, as the projection draws it now: its shape replayed into a recorder. + * Where the projection cuts the line (at the antimeridian, a globe's horizon), the longest piece + * stands for it. + */ +export function legPoints(item: any): PlotPoint[] { + const bounds = item.bounds ? `${item.bounds.x1},${item.bounds.y1},${item.bounds.x2},${item.bounds.y2}` : ''; + const cached = LEG_POINTS.get(item); + if (cached && cached.bounds === bounds) return cached.points; + const pieces: PlotPoint[][] = []; + const shape = item.shape; + if (typeof shape?.context === 'function') { + const recorder = { + moveTo: (x: number, y: number) => { pieces.push([{ x, y }]); }, + lineTo: (x: number, y: number) => { (pieces[pieces.length - 1] ?? pieces[pieces.push([]) - 1]).push({ x, y }); }, + closePath: () => {}, beginPath: () => {}, arc: () => {}, rect: () => {}, + }; + try { + shape.context(recorder)(item); + } finally { + shape.context(null); + } + } + const length = (piece: PlotPoint[]) => piece.slice(1).reduce((sum, point, index) => sum + Math.hypot(point.x - piece[index].x, point.y - piece[index].y), 0); + const points = pieces.reduce((longest, piece) => (length(piece) > length(longest) ? piece : longest), []); + LEG_POINTS.set(item, { bounds, points }); + return points; +} + function pathGeometry(item: any, offsetX: number, offsetY: number, siblingIndex?: number): PathGeometry | null { + if (isRouteLeg(item)) { + const points = legPoints(item).map((point) => ({ x: point.x + offsetX, y: point.y + offsetY })); + if (points.length < 2) return null; + return { kind: 'segment', points, annotationPoints: points, offset: { x: offsetX, y: offsetY } }; + } const items = item?.mark?.items; if (!Array.isArray(items)) return null; const index = siblingIndex ?? items.indexOf(item); @@ -242,13 +291,13 @@ export function sceneItems(view: any): any[] { const pathDataByMark = new Map[]>(); const visit = (item: any, offsetX: number, offsetY: number, siblingIndex?: number, clip?: SelectionRect): void => { if (!item) return; - if (SUPPORTED_RENDER_MARKS.has(item.mark?.marktype) && keyOfDatum(item.datum) && item.bounds) { + if (SUPPORTED_RENDER_MARKS.has(item.mark?.marktype) && keyOfDatum(item.datum) && item.bounds && !isRouteAccessory(item)) { const interactionGeometry = pathGeometry(item, offsetX, offsetY, siblingIndex); - const isPath = item.mark.marktype === 'line' || item.mark.marktype === 'area'; + const isPath = item.mark.marktype === 'line' || item.mark.marktype === 'area' || isRouteLeg(item); if (isPath && !interactionGeometry) return; const points = interactionGeometry?.points; let interactionPathData: Record[] | undefined; - if (isPath) { + if (isPath && !isRouteLeg(item)) { interactionPathData = pathDataByMark.get(item.mark); if (!interactionPathData) { interactionPathData = pathDataOf(item.mark); @@ -401,10 +450,9 @@ export function pickBounds(item: any): SelectionRect { return item.visibleBounds ?? item.bounds; } -export function facetPlotFrameAt(view: any, point: PlotPoint, fallback: PlotFrame): PlotFrame | undefined { +/** Every Vega facet cell's plot frame, in plot px; empty on a chart that draws one plot. */ +export function facetPlotFrames(view: any): PlotFrame[] { const frames: PlotFrame[] = []; - const containsPoint = (frame: PlotFrame): boolean => point.x >= frame.x && point.x <= frame.x + frame.width - && point.y >= frame.y && point.y <= frame.y + frame.height; const visit = (item: any, offsetX: number, offsetY: number): void => { if (!item) return; const isGroup = item.mark?.marktype === 'group'; @@ -417,25 +465,20 @@ export function facetPlotFrameAt(view: any, point: PlotPoint, fallback: PlotFram if (Array.isArray(item.items)) item.items.forEach((child: any) => visit(child, x, y)); }; visit(view.scenegraph()?.root, 0, 0); + return frames; +} + +export function facetPlotFrameAt(view: any, point: PlotPoint, fallback: PlotFrame): PlotFrame | undefined { + const containsPoint = (frame: PlotFrame): boolean => point.x >= frame.x && point.x <= frame.x + frame.width + && point.y >= frame.y && point.y <= frame.y + frame.height; + const frames = facetPlotFrames(view); if (frames.length) return frames.filter(containsPoint).sort((left, right) => left.width * left.height - right.width * right.height)[0]; return containsPoint(fallback) ? fallback : undefined; } /** Bounding plot frame of all Vega facet cells, or the root plot for a unit chart. */ export function facetPlotBounds(view: any, fallback: PlotFrame): PlotFrame { - const frames: PlotFrame[] = []; - const visit = (item: any, offsetX: number, offsetY: number): void => { - if (!item) return; - const isGroup = item.mark?.marktype === 'group'; - const x = offsetX + (isGroup && typeof item.x === 'number' ? item.x : 0); - const y = offsetY + (isGroup && typeof item.y === 'number' ? item.y : 0); - if (isGroup && (item.mark?.role === 'cell' || item.mark?.name === 'cell') - && typeof item.width === 'number' && typeof item.height === 'number') { - frames.push({ x, y, width: item.width, height: item.height }); - } - if (Array.isArray(item.items)) item.items.forEach((child: any) => visit(child, x, y)); - }; - visit(view.scenegraph()?.root, 0, 0); + const frames = facetPlotFrames(view); if (frames.length === 0) return fallback; const x1 = Math.min(...frames.map((frame) => frame.x)); const y1 = Math.min(...frames.map((frame) => frame.y)); @@ -798,6 +841,23 @@ export function normalizeVegaAngularRegionEvent( }; } +/** + * The hits one mark is chosen from. A line or area drawn with points draws each row twice, as the + * point and as the segment that starts at it, so a key naming one row hits both. This keeps the + * point, or the segment when `preferPath`; hits on different rows are left for the caller to judge. + */ +export function oneMarkHits(hits: readonly RenderHit[], preferPath = false): RenderHit[] { + const isPath = (hit: RenderHit): boolean => hit.markType === 'line' || hit.markType === 'area' + || (hit.markType === 'shape' && hit.datum?.[ROUTE_PART] === 'leg'); + const rowKey = (hit: RenderHit): string => { + const key = String(hit.datum[INTERACTION_KEY]); + return isPath(hit) && key.endsWith(PATH_KEY_SUFFIX) ? key.slice(0, -PATH_KEY_SUFFIX.length) : key; + }; + const pathRows = new Set(hits.filter(isPath).map(rowKey)); + const drawnTwice = new Set(hits.filter((hit) => !isPath(hit)).map(rowKey).filter((key) => pathRows.has(key))); + return hits.filter((hit) => !drawnTwice.has(rowKey(hit)) || isPath(hit) === preferPath); +} + export function renderHit(item: any): RenderHit | null { const markType = item?.mark?.marktype; const taggedText = markType !== 'text' || item?.datum?.[INTERACTION_ROLE] === 'text-label'; @@ -1187,7 +1247,7 @@ export function normalizeVegaElementEvent( export function sceneItemsUnder(view: any, plotPoint: PlotPoint): any[] { return sceneItems(view).filter((item) => { if (!item?.bounds || !isPickable(item) || item.datum?.[INTERACTION_ROLE] === 'legend-label') return false; - const path = item.mark?.marktype === 'line' || item.mark?.marktype === 'area'; + const path = item.mark?.marktype === 'line' || item.mark?.marktype === 'area' || isRouteLeg(item); const reach = path ? Math.max(1, (typeof item.strokeWidth === 'number' ? item.strokeWidth : 1) / 2) : 0.5; return distanceToItem(plotPoint, item) <= reach; }); @@ -1259,6 +1319,28 @@ export function nearestSceneItem(view: any, point: PlotPoint, maxDistance: numbe return nearestItemByBounds(sceneItems(view), point, maxDistance); } +const THIN_MARKS = new Set(['line', 'trail', 'rule', 'symbol']); + +/** + * The nearest line, rule or point within `tolerance` px of its drawn edge (a stroke's half + * width counts as on it). Filled marks are left to Vega's exact pick. + */ +export function nearestThinItem(view: any, point: PlotPoint, tolerance: number): any | undefined { + let best: { item: any; distance: number } | undefined; + for (const item of sceneItems(view)) { + if (!THIN_MARKS.has(item.mark?.marktype) || !item.bounds || !isPickable(item)) continue; + if (item.datum?.[INTERACTION_ROLE] === 'legend-label') continue; + const stroke = item.mark.marktype === 'symbol' ? 0 : (typeof item.strokeWidth === 'number' ? item.strokeWidth : 1) / 2; + const distance = Math.max(0, distanceToItem(point, item) - stroke); + if (distance > tolerance) continue; + // A line's point markers win a tie with the line: the marker is what is read. + const closer = !best || distance < best.distance + || (distance === best.distance && item.mark.marktype === 'symbol' && best.item.mark?.marktype !== 'symbol'); + if (closer) best = { item, distance }; + } + return best?.item; +} + export type SpatialDirection = 'left' | 'right' | 'up' | 'down'; function itemCenter(item: any): PlotPoint { diff --git a/packages/flint-js/src/vegalite/interactions/navigation-geo.ts b/packages/flint-js/src/vegalite/interactions/navigation-geo.ts index b95b7795..cef269f8 100644 --- a/packages/flint-js/src/vegalite/interactions/navigation-geo.ts +++ b/packages/flint-js/src/vegalite/interactions/navigation-geo.ts @@ -21,9 +21,9 @@ */ import { projection as vegaProjection } from 'vega'; -import { GEO_LEVEL_SIGNAL, geoLevelGate, isGlobeProjection, type GeoLevel, type GeoPreProjection } from './geo-levels'; +import { GEO_LEVEL_SIGNAL, GEO_ROTATE_SIGNAL, geoLevelGate, isGlobeProjection, type GeoLevel, type GeoPreProjection } from './geo-levels'; -export { GEO_LEVEL_SIGNAL, geoLevelGate, isGlobeProjection, type GeoLevel, type GeoPreProjection }; +export { GEO_LEVEL_SIGNAL, GEO_ROTATE_SIGNAL, geoLevelGate, isGlobeProjection, type GeoLevel, type GeoPreProjection }; import type { UpdateRegionSelector } from '../../core/interaction-contracts'; import type { NavigationDomainGuard, NavigationUpdate } from '../../interactive/interactions'; import type { VegaNavigationAxis } from './contracts'; @@ -38,8 +38,6 @@ import { export const GEO_EXTENT_SIGNAL = '__flint_geo_extent'; export const GEO_PROJECTION_SIGNAL = '__flint_geo_projection'; -/** The rotation of a globe's projection, which a drag turns. Present only on a globe. */ -export const GEO_ROTATE_SIGNAL = '__flint_geo_rotate'; export const GEO_AXIS_SCALES = { x: '__flint_geo_x', y: '__flint_geo_y' } as const; @@ -269,21 +267,35 @@ export function remapExtentPoint(point: Point, from: GeoExtent, to: GeoExtent): return [to[0][0] + (point[0] - from[0][0]) * kx, to[0][1] + (point[1] - from[0][1]) * ky]; } +/** + * How far past its edges a flat map may be dragged, as a share of the plot on each side, in screen + * pixels at any zoom: a map that fits its plot still moves under the hand, and a corner a key + * covers can be brought into view, but the map is never dragged out of sight. Data Formulator's. + */ +export const MAP_PAN_SLACK = 0.5; + /** * Clamp a proposed extent with the navigation domain guard. The plot rectangle * is expressed as a fraction interval of the extent (the initial frame is * `[0, 1]` on both axes), which is exactly the shape the scale guard expects. * Both axes carry the same visible fraction, so the span clamp keeps the * extent uniform. + * + * Without `slack`, a map that fits its plot stays put (the guard's overscroll applies only once it + * is zoomed in); with it, the map may be dragged `slack` of the plot past each edge, at any zoom. */ export function guardGeoExtent( proposed: GeoExtent, size: { width: number; height: number }, guard: NavigationDomainGuard, + slack = 0, ): GeoExtent { const guardAxis = (origin: number, extentSize: number, plotSize: number): [number, number] => { const visible: [number, number] = [(0 - origin) / extentSize, (plotSize - origin) / extentSize]; - const axisGuard = extentSize <= plotSize * (1 + 1e-10) ? { ...guard, overscrollFraction: 0 } : guard; + // The overscroll is a share of the extent; the slack, of the plot. + const fits = extentSize <= plotSize * (1 + 1e-10); + const overscroll = Math.max(fits ? 0 : guard.overscrollFraction, slack * plotSize / extentSize); + const axisGuard = overscroll === guard.overscrollFraction ? guard : { ...guard, overscrollFraction: overscroll }; const [start, end] = guardNavigationDomain(visible, [0, 1], 'linear', axisGuard).map(Number); const guardedSize = plotSize / (end - start); // `-start * size` yields -0 at the frame edge; keep the origin a plain 0. @@ -295,6 +307,126 @@ export function guardGeoExtent( return [[x0, y0], [x0 + width, y0 + height]]; } +/** + * A tween across a flat map without re-projecting it: between two extents the fit is a scale and an + * offset (`fitExtent` is linear in the extent), so each frame moves the scene as drawn instead of + * running Vega. Paths (land, borders, a route's legs) are scaled and offset, their strokes kept at + * their width (`vector-effect`); a leg's dash, which leaves its stop's dot and ends its line at its + * head, is lengthened to its new length; symbols and text (dots, heads, labels) are moved to their new place at their size. + * Everything is set in inline styles, which Vega never reads, so its cache of the attributes it wrote + * stays true and its next render, the tween's last frame, draws the target and the styles are cleared. + * Only with the SVG renderer, whose items keep their element; elsewhere, undefined. + */ +interface SceneTransform { + /** Show the scene drawn at `from` as it would be drawn at `to`. */ + apply(from: GeoExtent, to: GeoExtent): void; + /** Clear every style the tween set. */ + restore(): void; +} + +/** + * A Flint route's dash: its first `D` px drawn, then a gap past any length — or, where its stops are + * drawn, a gap of `L` px first (the dot it leaves): `0 L D gap`. + */ +const ROUTE_DASH_GAP = 100_000; + +/** A route's dash as what it leaves out at its start (`lead`) and draws (`drawn`); undefined for any other dash. */ +function routeDashOf(dash: number[] | undefined): { lead: number; drawn: number } | undefined { + if (!dash || !dash.every(Number.isFinite) || dash[dash.length - 1] < ROUTE_DASH_GAP) return undefined; + if (dash.length === 2) return { lead: 0, drawn: dash[0] }; + if (dash.length === 4 && dash[0] === 0) return { lead: dash[1], drawn: dash[2] }; + return undefined; +} + +function cssTransformOf(attribute: string | null): string { + if (!attribute) return ''; + return attribute + .replace(/translate\(\s*([-+\d.eE]+)[\s,]+([-+\d.eE]+)\s*\)/g, 'translate($1px, $2px)') + .replace(/translate\(\s*([-+\d.eE]+)\s*\)/g, 'translate($1px)') + .replace(/rotate\(\s*([-+\d.eE]+)\s*\)/g, 'rotate($1deg)'); +} + +/** Whether the view is drawn by Vega's SVG renderer, whose scene items keep their element. */ +function drawnAsSvg(view: any): boolean { + const visit = (node: any, depth: number): boolean => { + if (!node || depth > 8) return false; + if (node._svg) return true; + return Array.isArray(node.items) && node.items.some((child: any) => visit(child, depth + 1)); + }; + return visit(view.scenegraph?.()?.root, 0); +} + +function sceneTransform(view: any): SceneTransform | undefined { + const paths: { element: SVGGeometryElement; transform: string; length?: number; lead?: number; drawn?: number }[] = []; + const placed: { element: SVGElement; x: number; y: number; rest: string }[] = []; + let anyElement = false; + const visitMark = (mark: any): void => { + if (!mark || !Array.isArray(mark.items)) return; + if (mark.marktype === 'group') { + // Legends, titles and axes stand beside the map; they do not move with it. + if (/legend|title|axis/.test(String(mark.role ?? ''))) return; + for (const item of mark.items) for (const child of item.items ?? []) visitMark(child); + return; + } + for (const item of mark.items) { + const element = item?._svg as SVGElement | undefined; + if (!element) continue; + anyElement = true; + if (mark.marktype === 'shape' || mark.marktype === 'path') { + const routeDash = routeDashOf(element.getAttribute('stroke-dasharray')?.split(/[\s,]+/).map(Number)); + const geometry = element as SVGGeometryElement; + paths.push({ + element: geometry, + transform: cssTransformOf(element.getAttribute('transform')), + ...(routeDash && typeof geometry.getTotalLength === 'function' ? { length: geometry.getTotalLength(), ...routeDash } : {}), + }); + } else if (mark.marktype === 'symbol' || mark.marktype === 'text') { + const transform = element.getAttribute('transform') ?? ''; + const at = /translate\(\s*([-+\d.eE]+)[\s,]+([-+\d.eE]+)\s*\)/.exec(transform); + if (!at) continue; + placed.push({ element, x: Number(at[1]), y: Number(at[2]), rest: cssTransformOf(transform.replace(at[0], '').trim()) }); + } + } + }; + visitMark(view.scenegraph?.()?.root); + if (!anyElement) return undefined; + let styled = false; + return { + apply(from, to) { + const k = (to[1][0] - to[0][0]) / ((from[1][0] - from[0][0]) || 1); + const ox = to[0][0] - k * from[0][0]; + const oy = to[0][1] - k * from[0][1]; + const matrix = `matrix(${k}, 0, 0, ${k}, ${ox}, ${oy})`; + for (const path of paths) { + path.element.style.transform = path.transform ? `${matrix} ${path.transform}` : matrix; + path.element.style.vectorEffect = 'non-scaling-stroke'; + // The line still leaves its stop's dot and meets its head where it did: dots and heads keep + // their size on screen, so what it leaves out at each end does too. + if (path.length !== undefined && path.drawn !== undefined) { + const drawn = Math.max(0, k * path.length - (path.length - path.drawn)); + path.element.style.strokeDasharray = path.lead + ? `0 ${path.lead} ${drawn} ${ROUTE_DASH_GAP * 10}` + : `${drawn} ${ROUTE_DASH_GAP * 10}`; + } + } + for (const item of placed) { + item.element.style.transform = `translate(${k * item.x + ox}px, ${k * item.y + oy}px)${item.rest ? ` ${item.rest}` : ''}`; + } + styled = true; + }, + restore() { + if (!styled) return; + for (const path of paths) { + path.element.style.transform = ''; + path.element.style.vectorEffect = ''; + path.element.style.strokeDasharray = ''; + } + for (const item of placed) item.element.style.transform = ''; + styled = false; + }, + }; +} + export function createVegaGeoNavigationController( view: any, axes: Partial>, @@ -698,6 +830,14 @@ export function createVegaGeoNavigationController( const startLevel = levelBeforeBaseline ?? currentLevel; levelBeforeBaseline = undefined; setLevel(startLevel); + // On a flat map the frames move the scene as drawn, and Vega runs once, for the last. Vega is held + // at `from` meanwhile — the runtime resets the view before it re-applies this tween's frame on a + // render — and the scene is read on the first frame, once any render this pass started has drawn. + const moving = !globe && !toRotation && transition.duration > 0 && drawnAsSvg(view); + if (moving) view.signal(GEO_EXTENT_SIGNAL, from); + let moved: SceneTransform | undefined; + // What is on screen: while moving, Vega's scene stays at `from` until the last frame. + let shown = from; let cancelled = false; let finish!: () => void; const done = new Promise((resolve) => { finish = resolve; }); @@ -708,13 +848,34 @@ export function createVegaGeoNavigationController( ...(toRotation ? { frameRotation: fromRotation } : {}), startLevel, done, - cancel: () => { cancelled = true; finish(); }, + cancel: () => { + cancelled = true; + if (moved) { + // Interrupted mid-tween: the scene is drawn where it stands on screen, so what follows + // starts there rather than back at the tween's start. + moved.restore(); + entry.frame = shown; + renderedExtent = shown; + view.signal(GEO_EXTENT_SIGNAL, shown); + // The frame drawn is reported as this tween's end, so what was hidden over it is placed again. + void Promise.resolve(view.runAsync()).then(() => transition.onFrame?.('commit', to === null ? 'reset' : 'zoom')); + } + finish(); + }, }; active = entry; const step = (): void => { if (cancelled) return; const t = transition.duration > 0 ? Math.min(1, (now() - startedAt) / transition.duration) : 1; const last = t >= 1; + if (moving && !moved && !last) moved = sceneTransform(view); + if (moved && !last) { + shown = extentOf(path(easeInOut(t))); + moved.apply(from, shown); + transition.onFrame?.('preview', to === null ? 'reset' : 'zoom', 'moved'); + nextFrame(step); + return; + } entry.frame = last ? target : extentOf(path(easeInOut(t))); view.signal(GEO_EXTENT_SIGNAL, last ? to : entry.frame); if (toRotation) { @@ -726,6 +887,8 @@ export function createVegaGeoNavigationController( setLevel(level); } void Promise.resolve(view.runAsync()).then(() => { + // Vega has drawn the target over the moved scene; the moving styles come off before the paint. + moved?.restore(); if (cancelled) return; transition.onFrame?.(last ? 'commit' : 'preview', to === null ? 'reset' : 'zoom'); if (last) finish(); @@ -791,7 +954,8 @@ export function createVegaGeoNavigationController( ]; } if (!proposed) return null; - const guarded = guardGeoExtent(proposed, { width, height }, guard); + // A drag may carry the map past its edges; a zoom settles it inside them, so zooming out comes home. + const guarded = guardGeoExtent(proposed, { width, height }, guard, event.operation === 'pan' ? MAP_PAN_SLACK : 0); const value = geographicBox(guarded); remember(value, guarded, levelForRange(value.x)); return { op: 'set-viewport', axes: event.axes, value }; diff --git a/packages/flint-js/src/vegalite/interactions/navigation-scale.ts b/packages/flint-js/src/vegalite/interactions/navigation-scale.ts index c41281fe..e3215900 100644 --- a/packages/flint-js/src/vegalite/interactions/navigation-scale.ts +++ b/packages/flint-js/src/vegalite/interactions/navigation-scale.ts @@ -102,7 +102,11 @@ export interface NavigationApplyOptions { */ transition?: { duration: number; - onFrame?: (phase: 'preview' | 'commit', operation: 'zoom' | 'reset') => void; + /** + * `moved`: the frame moved the scene as drawn instead of rendering it, so what is drawn over the + * chart (overlays, notes) does not yet stand where the scene shows; it is placed on the commit. + */ + onFrame?: (phase: 'preview' | 'commit', operation: 'zoom' | 'reset', moved?: 'moved') => void; }; /** The runtime's own reset before it re-applies retained viewports; must not end a running tween. */ baseline?: boolean; diff --git a/packages/flint-js/src/vegalite/interactions/presentation/annotation-overlay.ts b/packages/flint-js/src/vegalite/interactions/presentation/annotation-overlay.ts index 754df4ef..f19aa749 100644 --- a/packages/flint-js/src/vegalite/interactions/presentation/annotation-overlay.ts +++ b/packages/flint-js/src/vegalite/interactions/presentation/annotation-overlay.ts @@ -5,8 +5,9 @@ import type { AnnotationSpec, PlotPoint, } from '../../../interactive/interactions'; +import type { PresentedAnnotationSpec } from '../../../core/interaction-contracts'; -type RenderableAnnotation = AnnotationSpec & { +type RenderableAnnotation = PresentedAnnotationSpec & { text: string; candidates: readonly AnnotationCandidate[]; }; @@ -16,6 +17,7 @@ import { PATH_KEY_SUFFIX, clientToLayoutPoint, clippedBounds, + legPoints, pickBounds, plotToClientPoint, pointInClip, @@ -23,11 +25,24 @@ import { sceneItems, type RendererCoordinateSpace, } from '../hit-adapter'; +import { ROUTE_PART } from '../../templates/map-routes'; import { - routeAnnotationLeaders, - type AnnotationLeaderRoute, - type AnnotationPortEdge, -} from './annotation-leader-routing'; + NOTE_LINE_COST, + balanceNote, + noteSize, + noteStyle, + noteWrapWidths, + inkOn, + leaderSegments, + placeNote, + type ChartTextStyle, + type NoteObstacle, + type NotePlacement, + type NoteSegment, + type NoteTarget, +} from '../../../core/annotation'; +import { rendererTextMeasurer } from '../../../core/text-width'; +import type { AnnotationDesign } from '../../../core/theme/types'; function keyOfDatum(datum: unknown): string | undefined { if (!datum || typeof datum !== 'object') return undefined; @@ -35,54 +50,14 @@ function keyOfDatum(datum: unknown): string | undefined { return typeof key === 'string' ? key : undefined; } -interface LayoutRect { - left: number; - top: number; - width: number; - height: number; -} - -interface LayoutObstacle { - item: any; - rect: LayoutRect; - tier: 1 | 2 | 3; -} - interface ConnectionPoint { point: PlotPoint; preferredAngle?: number; } -interface AnnotationLayout { - candidate: AnnotationCandidate; - connection: ConnectionPoint; - angle: number; - distance: number; - align: 'left' | 'center' | 'right'; - maxWidth: number; - card: LayoutRect; - end: PlotPoint; - score: number; -} - const TAU = Math.PI * 2; -const ANGLE_STEP = Math.PI / 6; -const FREE_ANGLES = Array.from({ length: 12 }, (_, index) => index * ANGLE_STEP); -const OBSTACLE_WEIGHT = { 1: 1, 2: 20, 3: 1_000 } as const; -const PLOT_ESCAPE_WEIGHT = 10; -const CONNECTOR_CROSSING_AREA = 20; - -export function annotationObstacleOverlapCost(tier: 1 | 2 | 3, overlap: number): number { - if (overlap <= 0) return 0; - return overlap * OBSTACLE_WEIGHT[tier]; -} - -export function annotationObstacleTier(item: any): 1 | 2 | 3 { - const role = String(item?.mark?.role ?? ''); - if (role.startsWith('legend') || role.startsWith('axis')) return 3; - const opacity = typeof item?.opacity === 'number' ? item.opacity : 1; - return opacity < 0.5 ? 1 : 2; -} +/** The clear gap between a strongly highlighted dot and the ring round it, in px. */ +const RING_GAP = 2.5; export function isAnnotationObstacle(item: any): boolean { return !!item?.mark?.marktype && item.mark.role !== 'axis-grid'; @@ -110,139 +85,143 @@ export function annotationSourceBounds(items: readonly any[], source: any): { }), { ...sourceBounds }); } -/** The marks a note card avoids, cut to the part of each that its clip leaves on screen. */ -function sceneObstacles(view: any): any[] { - const obstacles: any[] = []; - const visit = (item: any, offsetX: number, offsetY: number, clip?: { x1: number; y1: number; x2: number; y2: number }): void => { - if (!item) return; - const isGroup = item.mark?.marktype === 'group'; - if (!isGroup && isAnnotationObstacle(item) && item.bounds && (item.opacity ?? 1) > 0) { - const bounds = clippedBounds({ - x1: item.bounds.x1 + offsetX, - x2: item.bounds.x2 + offsetX, - y1: item.bounds.y1 + offsetY, - y2: item.bounds.y2 + offsetY, - }, clip); - if (bounds) obstacles.push({ ...item, bounds }); +/** + * Which rect marks tile the plot, as a heatmap's cells do: their rects cover most of it (`plotArea`, in + * the scene's units) and do not stand on one baseline. Bars share their foot (or, run across, their + * start), however much of the plot a histogram's fill; cells in a grid share neither. + */ +export function tiledRects( + boxes: readonly { item: any; bounds: { x1: number; x2: number; y1: number; y2: number } }[], + plotArea: number, +): (mark: unknown) => boolean { + const marks = new Map; start: Map; count: number }>(); + for (const { item, bounds } of boxes) { + if (item.mark?.marktype !== 'rect') continue; + const entry = marks.get(item.mark) ?? { area: 0, foot: new Map(), start: new Map(), count: 0 }; + entry.area += Math.abs((bounds.x2 - bounds.x1) * (bounds.y2 - bounds.y1)); + const foot = Math.round(Math.max(bounds.y1, bounds.y2)); + const start = Math.round(Math.min(bounds.x1, bounds.x2)); + entry.foot.set(foot, (entry.foot.get(foot) ?? 0) + 1); + entry.start.set(start, (entry.start.get(start) ?? 0) + 1); + entry.count += 1; + marks.set(item.mark, entry); + } + const tiled = new Set(); + for (const [mark, entry] of marks) { + if (entry.area < plotArea * 0.6) continue; + const shared = Math.max(...entry.foot.values(), ...entry.start.values()); + if (entry.count >= 2 && shared >= entry.count * 0.8) continue; + tiled.add(mark); + } + return (mark) => tiled.has(mark); +} + +/** + * What a caption keeps clear of, cut to what each clip leaves on screen: marks and text as boxes, + * and thin ink — lines, rules, axis domains — as segments, since a line's box spans the whole plot. + * Gridlines and filled areas are left to the caption's halo. + */ +export function sceneInk(view: any): { boxes: { item: any; bounds: { x1: number; x2: number; y1: number; y2: number } }[]; segments: NoteSegment[] } { + const boxes: { item: any; bounds: { x1: number; x2: number; y1: number; y2: number } }[] = []; + const segments: NoteSegment[] = []; + const visit = (node: any, offsetX: number, offsetY: number, clip?: { x1: number; y1: number; x2: number; y2: number }): void => { + if (!node) return; + // A line mark's items are its points: the line runs between them. + if ((node.marktype === 'line' || node.marktype === 'trail') && node.role !== 'axis-grid' && Array.isArray(node.items)) { + const points = node.items.filter((point: any) => point.defined !== false && typeof point.x === 'number' && typeof point.y === 'number' + && (point.opacity ?? 1) > 0); + for (let index = 1; index < points.length; index++) { + segments.push({ + a: { x: points[index - 1].x + offsetX, y: points[index - 1].y + offsetY }, + b: { x: points[index].x + offsetX, y: points[index].y + offsetY }, + }); + } + return; + } + const type = node.mark?.marktype; + const isGroup = type === 'group'; + // A map route's leg is a line too, its casing the same line again: segments, not their boxes. + const routePart = type === 'shape' ? node.datum?.[ROUTE_PART] : undefined; + if (routePart === 'leg' && (node.opacity ?? 1) > 0) { + const points = legPoints(node); + for (let index = 1; index < points.length; index++) { + segments.push({ + a: { x: points[index - 1].x + offsetX, y: points[index - 1].y + offsetY }, + b: { x: points[index].x + offsetX, y: points[index].y + offsetY }, + }); + } + return; } - const childOffsetX = offsetX + (isGroup && typeof item.x === 'number' ? item.x : 0); - const childOffsetY = offsetY + (isGroup && typeof item.y === 'number' ? item.y : 0); - const childClip = sceneContentClip(item, childOffsetX, childOffsetY, clip); - if (Array.isArray(item.items)) { - for (const child of item.items) visit(child, childOffsetX, childOffsetY, childClip); + if (routePart === 'casing') return; + if (!isGroup && type && isAnnotationObstacle(node) && (node.opacity ?? 1) > 0) { + if (type === 'rule') { + if (typeof node.x === 'number' && typeof node.y === 'number') { + segments.push({ + a: { x: node.x + offsetX, y: node.y + offsetY }, + b: { x: (typeof node.x2 === 'number' ? node.x2 : node.x) + offsetX, y: (typeof node.y2 === 'number' ? node.y2 : node.y) + offsetY }, + }); + } + } else if (type !== 'area' && node.bounds) { + const bounds = clippedBounds({ + x1: node.bounds.x1 + offsetX, x2: node.bounds.x2 + offsetX, + y1: node.bounds.y1 + offsetY, y2: node.bounds.y2 + offsetY, + }, clip); + if (bounds) boxes.push({ item: node, bounds }); + } } + const childOffsetX = offsetX + (isGroup && typeof node.x === 'number' ? node.x : 0); + const childOffsetY = offsetY + (isGroup && typeof node.y === 'number' ? node.y : 0); + const childClip = sceneContentClip(node, childOffsetX, childOffsetY, clip); + if (Array.isArray(node.items)) for (const child of node.items) visit(child, childOffsetX, childOffsetY, childClip); }; visit(view.scenegraph()?.root, 0, 0); - return obstacles; + return { boxes, segments }; } -function connectorFor(candidate: AnnotationCandidate): 'line' | 'none' { - return candidate.connector ?? 'line'; -} - -function overlapArea(a: LayoutRect, b: LayoutRect): number { - const width = Math.max(0, Math.min(a.left + a.width, b.left + b.width) - Math.max(a.left, b.left)); - const height = Math.max(0, Math.min(a.top + a.height, b.top + b.height) - Math.max(a.top, b.top)); - return width * height; -} - -function rectDistance(a: LayoutRect, b: LayoutRect): number { - const deltaX = Math.max(a.left - b.left - b.width, b.left - a.left - a.width, 0); - const deltaY = Math.max(a.top - b.top - b.height, b.top - a.top - a.height, 0); - return Math.hypot(deltaX, deltaY); -} - -function overflowDistance(inner: LayoutRect, outer: LayoutRect, padding: number): number { - return Math.max(0, outer.left + padding - inner.left) - + Math.max(0, inner.left + inner.width + padding - outer.left - outer.width) - + Math.max(0, outer.top + padding - inner.top) - + Math.max(0, inner.top + inner.height + padding - outer.top - outer.height); +/** + * What Flint draws beside the chart rather than in it — the source line, a map's credit, a house's + * header and its rules — as boxes in the layout, read off the layer that draws them: no caption + * stands on them. + */ +export function canvasFurnitureBoxes( + container: HTMLElement, containerRect: DOMRect, layoutSize: { width: number; height: number }, +): { x: number; y: number; width: number; height: number }[] { + const layer = container.querySelector(':scope > .flint-canvas-furniture'); + const round = (value: number) => Math.round(value * 10) / 10; + // A chart overlay's words (a sea's name, a label set by `set-overlay`) are text a caption keeps + // off as it does the chart's own, though they are drawn outside Vega's scene. + const elements = [ + ...(layer ? layer.querySelectorAll('text, image, rect, line') : []), + ...container.querySelectorAll('text[data-flint-overlay]'), + ]; + return elements.flatMap((element) => { + if (element.closest('defs, pattern')) return []; + const rect = element.getBoundingClientRect(); + if (rect.width <= 0 && rect.height <= 0) return []; + const a = clientToLayoutPoint({ x: rect.left, y: rect.top }, containerRect, layoutSize); + const b = clientToLayoutPoint({ x: rect.right, y: rect.bottom }, containerRect, layoutSize); + return [{ x: round(Math.min(a.x, b.x)), y: round(Math.min(a.y, b.y)), width: round(Math.abs(b.x - a.x)), height: round(Math.abs(b.y - a.y)) }]; + }); } -function segmentIntersectsRect( - start: PlotPoint, - end: PlotPoint, - rect: LayoutRect, - ignoreStartTouch = false, -): boolean { - const deltaX = end.x - start.x; - const deltaY = end.y - start.y; - let entry = 0; - let exit = 1; - const clip = (direction: number, offset: number): boolean => { - if (direction === 0) return offset >= 0; - const ratio = offset / direction; - if (direction < 0) entry = Math.max(entry, ratio); - else exit = Math.min(exit, ratio); - return entry <= exit; +/** The chart's own label face and ink, read from its axis labels, and its background. */ +export function chartTextStyle(view: any, boxes: readonly { item: any }[]): ChartTextStyle { + const label = boxes.find(({ item }) => item.mark?.role === 'axis-label')?.item + ?? boxes.find(({ item }) => item.mark?.marktype === 'text')?.item; + const background = typeof view.background === 'function' ? view.background() : undefined; + return { + ...(typeof label?.font === 'string' ? { font: label.font } : {}), + ...(typeof label?.fontSize === 'number' ? { fontSize: label.fontSize } : {}), + ...(label?.fontWeight !== undefined ? { fontWeight: label.fontWeight } : {}), + ...(typeof label?.fill === 'string' ? { color: label.fill } : {}), + ...(typeof background === 'string' ? { background } : {}), }; - const intersects = clip(-deltaX, start.x - rect.left) - && clip(deltaX, rect.left + rect.width - start.x) - && clip(-deltaY, start.y - rect.top) - && clip(deltaY, rect.top + rect.height - start.y); - if (!intersects) return false; - return ignoreStartTouch ? exit > 0.02 && entry < 0.98 : exit >= 0 && entry <= 1; -} - -function textAlignForPort(edge: AnnotationPortEdge): 'left' | 'center' | 'right' { - if (edge === 'left') return 'left'; - if (edge === 'right') return 'right'; - return 'center'; -} - -export function sourceEdgeAttachment( - source: LayoutRect, - card: LayoutRect, - connection: AnnotationConnection, - fallback: PlotPoint, -): PlotPoint { - const cardCenterX = card.left + card.width / 2; - const cardCenterY = card.top + card.height / 2; - const sourceCenterX = source.left + source.width / 2; - const sourceCenterY = source.top + source.height / 2; - if (connection === 'top' || connection === 'bottom') { - return { - x: source.left + source.width * (cardCenterX < sourceCenterX ? 0.25 : 0.75), - y: connection === 'top' ? source.top : source.top + source.height, - }; - } - if (connection === 'left' || connection === 'right') { - return { - x: connection === 'left' ? source.left : source.left + source.width, - y: source.top + source.height * (cardCenterY < sourceCenterY ? 0.25 : 0.75), - }; - } - return fallback; -} - -export function annotationPrimaryAnchor( - item: any, - source: LayoutRect, - card: LayoutRect, - connection: AnnotationConnection, - fallback: PlotPoint, -): PlotPoint { - if (item?.interactionGeometry - && ['top', 'right', 'bottom', 'left', 'segment-midpoint'].includes(connection)) { - return fallback; - } - return sourceEdgeAttachment(source, card, connection, fallback); -} - -function routeIntersectsRect(route: AnnotationLeaderRoute, rect: LayoutRect, ignoreStartTouch = false): boolean { - return route.points.slice(1).some((point, index) => - segmentIntersectsRect(route.points[index], point, rect, ignoreStartTouch && index === 0)); } function vectorAngle(deltaX: number, deltaY: number): number { return (Math.atan2(deltaY, deltaX) + TAU) % TAU; } -function angularDistance(a: number, b: number): number { - const difference = Math.abs(a - b) % TAU; - return Math.min(difference, TAU - difference); -} - export function valueEndConnectionPoint( item: any, items: readonly any[], @@ -300,17 +279,6 @@ export function valueSideConnectionPoint( }; } -export function annotationCandidateAngles( - preferredAngle: number | undefined, - preference: AnnotationCandidate['anglePreference'] = 'normal', -): readonly number[] { - if (preferredAngle === undefined) return FREE_ANGLES; - const offsets = preference === 'oblique' - ? [-1, 1, -2, 2] - : [0, -1, 1, -2, 2, -3, 3, -4, 4, -5, 5, 6]; - return offsets.map((offset) => (preferredAngle + offset * ANGLE_STEP + TAU) % TAU); -} - export function annotationItem( items: readonly any[], key: string, @@ -345,8 +313,11 @@ export function annotationItem( candidate.datum?.[field] === undefined || Object.is(candidate.datum[field], value))) : []; const resolved = recordMatches.length > 0 ? recordMatches : available; - const preferRepresentativePath = pathTarget && recordMatches.length === 0 && resolved.length > 1; - return resolved + // A value label shares its mark's key, but the note is on the mark it labels. + const drawn = resolved.filter((candidate) => candidate.mark?.marktype !== 'text'); + const pool = drawn.length > 0 ? drawn : resolved; + const preferRepresentativePath = pathTarget && recordMatches.length === 0 && pool.length > 1; + return pool .sort((a, b) => { const aSpan = Math.max(a.bounds.x2 - a.bounds.x1, a.bounds.y2 - a.bounds.y1); const bSpan = Math.max(b.bounds.x2 - b.bounds.x1, b.bounds.y2 - b.bounds.y1); @@ -378,10 +349,34 @@ export function segmentRowPoint( if (fields.length === 0) return undefined; const drawn = (datum: any): boolean => fields.every(([field, value]) => Object.is(datum?.[field], value)); if (drawn(item.datum)) return points[0]; - if (drawn(item.interactionGeometry.endDatum)) return points[1]; + if (drawn(item.interactionGeometry.endDatum)) return points[points.length - 1]; return undefined; } +/** + * The point a fraction of the way along a path, by its length: a line's segment is two points, a + * map route's leg the many its curve is drawn through. + */ +export function pointAlongPath(points: readonly PlotPoint[], at: number): PlotPoint { + if (points.length < 2) return points[0]; + const lengths = points.slice(1).map((point, index) => Math.hypot(point.x - points[index].x, point.y - points[index].y)); + let remaining = Math.max(0, Math.min(1, at)) * lengths.reduce((sum, length) => sum + length, 0); + for (let index = 0; index < lengths.length; index++) { + if (remaining <= lengths[index] || index === lengths.length - 1) { + const t = lengths[index] === 0 ? 0 : Math.min(1, remaining / lengths[index]); + const [a, b] = [points[index], points[index + 1]]; + return { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t }; + } + remaining -= lengths[index]; + } + return points[points.length - 1]; +} + +/** A path's length, in the units its points are in. */ +function pathLength(points: readonly PlotPoint[]): number { + return points.slice(1).reduce((sum, point, index) => sum + Math.hypot(point.x - points[index].x, point.y - points[index].y), 0); +} + export function segmentMidpointConnectionPoint( item: any, plotCenter: PlotPoint, @@ -389,7 +384,8 @@ export function segmentMidpointConnectionPoint( const points = (item.interactionGeometry?.annotationPoints ?? item.interactionGeometry?.points) as readonly PlotPoint[] | undefined; if (!points || points.length < 2) return { point: plotCenter }; - const point = { + // Halfway along: on a curved path, on the curve rather than its chord. + const point = points.length > 2 ? pointAlongPath(points, 0.5) : { x: (points[0].x + points[1].x) / 2, y: (points[0].y + points[1].y) / 2, }; @@ -462,6 +458,149 @@ export function annotationConnectionPoint( return { point: center, preferredAngle: vectorAngle(center.x - plotCenter.x, center.y - plotCenter.y) }; } +/** + * The outline of the mark a caption points at, in the drawing: a dot, a line's point, a bar or a cell. + * A note at one end of a rect — a bar's value end, a named side — points at that edge, the rest of + * the rect its `body`. + */ +function noteTarget( + item: any, rowPoint: PlotPoint | undefined, toLayout: (point: PlotPoint) => PlotPoint, scale: number, + edgePoint?: PlotPoint, +): { target: NoteTarget; body?: NoteObstacle['box'] } { + if (rowPoint) { + const point = toLayout(rowPoint); + const radius = 3.5 * scale; + return { target: { shape: 'circle', x: point.x, y: point.y, rx: radius, ry: radius } }; + } + const leading = toLayout({ x: item.bounds.x1, y: item.bounds.y1 }); + const trailing = toLayout({ x: item.bounds.x2, y: item.bounds.y2 }); + const round = item.mark?.marktype === 'symbol' && (item.shape === undefined || item.shape === 'circle'); + const target: NoteTarget = { + shape: round ? 'circle' : 'rect', + x: (leading.x + trailing.x) / 2, + y: (leading.y + trailing.y) / 2, + rx: Math.abs(trailing.x - leading.x) / 2, + ry: Math.abs(trailing.y - leading.y) / 2, + }; + if (round || !edgePoint) return { target }; + const edge = toLayout(edgePoint); + const body = { x: target.x - target.rx, y: target.y - target.ry, width: target.rx * 2, height: target.ry * 2 }; + const near = (a: number, b: number) => Math.abs(a - b) <= 0.5; + if (near(edge.y, body.y) || near(edge.y, body.y + body.height)) { + return { target: { shape: 'rect', x: target.x, y: edge.y, rx: target.rx, ry: 0 }, body }; + } + if (near(edge.x, body.x) || near(edge.x, body.x + body.width)) { + return { target: { shape: 'rect', x: edge.x, y: target.y, rx: 0, ry: target.ry }, body }; + } + return { target }; +} + +/** + * A bar's value label printed past its value face, where a note on the bar continues it: the face + * moved out to the label's far edge, wide enough to take the label in, so the note reads as one + * with the printed value ("0.616 Down from 0.706 …") instead of a second annotation pointing past it. + */ +function valueLabelBeyondFace( + noted: { target: NoteTarget; body?: NoteObstacle['box'] }, + items: readonly any[], + item: any, + toBox: (bounds: { x1: number; x2: number; y1: number; y2: number }) => NoteObstacle['box'], +): { face: NoteTarget; items: any[] } | undefined { + const { target, body } = noted; + if (!body || target.shape !== 'rect' || (target.rx > 0 && target.ry > 0)) return undefined; + const key = keyOfDatum(item.datum); + if (!key) return undefined; + const labels = items.filter((candidate) => candidate !== item && candidate.mark?.marktype === 'text' && candidate.bounds + && keyOfDatum(candidate.datum) === key && (candidate.opacity ?? 1) > 0); + if (labels.length === 0) return undefined; + const boxes = labels.map((label) => toBox(label.bounds)); + const x1 = Math.min(...boxes.map((b) => b.x)); + const y1 = Math.min(...boxes.map((b) => b.y)); + const x2 = Math.max(...boxes.map((b) => b.x + b.width)); + const y2 = Math.max(...boxes.map((b) => b.y + b.height)); + // A face across x (a horizontal bar's end) has no width; one across y (a column's top) no height. + const along = target.rx === 0 ? 'x' : 'y'; + const centre = along === 'x' ? body.x + body.width / 2 : body.y + body.height / 2; + const face = along === 'x' ? target.x : target.y; + const outward = Math.sign(face - centre) || 1; + // The label must stand past the face, beside it, not printed inside the bar. + const beyond = outward > 0 ? (along === 'x' ? x1 : y1) >= face - 2 : (along === 'x' ? x2 : y2) <= face + 2; + const across = along === 'x' + ? y1 < target.y + target.ry && y2 > target.y - target.ry + : x1 < target.x + target.rx && x2 > target.x - target.rx; + if (!beyond || !across) return undefined; + const far = along === 'x' ? (outward > 0 ? x2 : x1) : (outward > 0 ? y2 : y1); + if (along === 'x') { + const top = Math.min(y1, target.y - target.ry); + const bottom = Math.max(y2, target.y + target.ry); + return { face: { shape: 'rect', x: far, y: (top + bottom) / 2, rx: 0, ry: (bottom - top) / 2 }, items: labels }; + } + const left = Math.min(x1, target.x - target.rx); + const right = Math.max(x2, target.x + target.rx); + return { face: { shape: 'rect', x: (left + right) / 2, y: far, rx: (right - left) / 2, ry: 0 }, items: labels }; +} + +/** The connections that point a note at one place on its mark: its centre, a side, a bar's value end. */ +const POINTING_CONNECTIONS = new Set(['center', 'top', 'right', 'bottom', 'left', 'value-end', 'value-side']); + +/** + * What a note names, which decides where its caption may stand and how the mark is cued: one `mark` + * (a dot, a bar, a cell, a line's point), a `stretch` of a line or area, a pie's `slice`, a whole + * `shape` (a violin), or a map's `region`. Every one is captioned the same way ({@link placeNote}). + */ +export type NoteSubjectKind = 'mark' | 'stretch' | 'slice' | 'shape' | 'region'; + +export function noteSubjectKind( + annotation: Pick, + item: any, + items: readonly any[], + rowPoint?: PlotPoint, +): NoteSubjectKind { + if (rowPoint) return 'mark'; + if (annotation.subject?.kind === 'region') return 'region'; + const marktype = item?.mark?.marktype; + if (marktype === 'arc') return 'slice'; + if (marktype === 'area' && item.orient === 'horizontal' + && items.filter((candidate) => isAnnotationSourceItem(candidate, item)).length > 1) return 'shape'; + if (item?.interactionGeometry) return 'stretch'; + return 'mark'; +} + +/** Where along a stretch a caption may name it, and what leaving the middle costs. */ +const STRETCH_SEATS = [{ at: 0.5, cost: 0 }, { at: 0.25, cost: 12 }, { at: 0.75, cost: 12 }] as const; +/** A stretch shorter than this, in px, is cued as a dot where the caption names it. */ +const SHORT_STRETCH = 12; +/** Where across a slice, from its inner to its outer radius, its caption's leader ends. */ +const SLICE_DEPTH = 0.72; + +type Box = NoteObstacle['box']; + +/** How the mark a caption names is cued: as the mark itself, a stretch of its path, or its outline. */ +type NoteCue = + | { kind: 'mark'; target: NoteTarget; body?: Box } + /** A line's stretch in its own ink, haloed; an area's edge in the note's ink, which reads on its fill. */ + | { kind: 'stretch'; points: readonly PlotPoint[]; color?: string; width?: number; dash?: readonly number[]; cap?: string } + /** A stretch too short to read as one: a dot where the caption names it. */ + | { kind: 'dot'; point: PlotPoint; color?: string } + | { kind: 'outline'; points: readonly PlotPoint[] } + | { kind: 'none' }; + +/** One place on the noted mark a caption may name it from, in the drawing's px. */ +interface NoteAnchor { + target: NoteTarget; + body?: Box; + preferredAngle?: number; + /** What naming the mark from here rather than its first anchor costs. */ + cost: number; + /** The mark's own ink near the anchor, which is not a neighbour the caption dodges. */ + own?: (inkItem: any, box: Box) => boolean; + /** Thin ink of the noted mark itself the caption should not cut, such as an area's edge. */ + segments?: readonly NoteSegment[]; + /** Seats on the mark itself; such an anchor offers only these (see `placeNote`'s `inside`). */ + inside?: readonly { point: PlotPoint; fits: (box: Box) => boolean; fill?: string }[]; + cue: NoteCue; +} + export interface AnnotationOverlayController { render(element: SemanticElement, annotation: RenderableAnnotation): void; /** @@ -481,6 +620,72 @@ export interface AnnotationOverlayOptions { containerLayoutSize(): { width: number; height: number }; /** Vega marktype the chart anchors annotations to when a key matches several marks. */ annotationMarkType?: string; + /** + * The captions the chart's notes stand in, shared by them: each note takes the next slot when it + * is made, keeps clear of the captions and leaders in the slots before it, and writes its own. + * Notes are placed one after another, not jointly. + */ + placedCaptions?: { slots: (PlacedCaption | undefined)[]; fixed?: PlacedCaption[] }; + /** The house's note text and ink. */ + design?: Readonly; + /** + * Keep captions within the plot. A map clips its marks to the plot and is panned and zoomed in + * it, so a caption out in the legend or past the title reads as detached from its place. + */ + containWithinPlot?: boolean; +} + +/** A caption already set on the chart: its box and the leader joining it to its mark. */ +export interface PlacedCaption { + box: NoteObstacle['box']; + leader?: NoteSegment; + /** Further lines drawn with it, such as an enclosure's outline. */ + segments?: readonly NoteSegment[]; +} + +/** A cheap fingerprint of the chart's ink, so a note is laid out again only when what it avoids moved. */ +function inkSignature(ink: ReturnType): string { + let hash = 0; + const add = (value: number): void => { + hash = (Math.imul(hash, 31) + Math.round(value * 10)) | 0; + }; + for (const { bounds } of ink.boxes) { + add(bounds.x1); add(bounds.y1); add(bounds.x2); add(bounds.y2); + } + for (const { a, b } of ink.segments) { + add(a.x); add(a.y); add(b.x); add(b.y); + } + return `${ink.boxes.length}:${ink.segments.length}:${hash}`; +} + +/** A pie or donut slice's outline, as points round its outer arc and back round its inner one. */ +function sliceOutline(item: any): PlotPoint[] { + const start = item.startAngle as number; + const end = item.endAngle as number; + const outer = item.outerRadius as number; + const inner = typeof item.innerRadius === 'number' ? item.innerRadius : 0; + const steps = Math.max(2, Math.ceil(Math.abs(end - start) / (Math.PI / 36))); + const at = (angle: number, radius: number): PlotPoint => ({ x: item.x + radius * Math.sin(angle), y: item.y - radius * Math.cos(angle) }); + const arc = (radius: number): PlotPoint[] => Array.from({ length: steps + 1 }, (_, index) => at(start + ((end - start) * index) / steps, radius)); + return inner > 0 ? [...arc(outer), ...arc(inner).reverse()] : [...arc(outer), { x: item.x, y: item.y }]; +} + +/** A band area's outline (a violin's), from the pieces its key draws, in draw order. */ +function shapeOutline(items: readonly any[], item: any): PlotPoint[] { + const parts = items.filter((candidate) => isAnnotationSourceItem(candidate, item) && candidate.interactionGeometry?.points?.length >= 4); + if (parts.length === 0) return []; + const last = parts[parts.length - 1].interactionGeometry.points; + const front = [...parts.map((part) => part.interactionGeometry.points[0]), last[1]]; + const back = [...parts.map((part) => part.interactionGeometry.points[3]), last[2]].reverse(); + return [...front, ...back]; +} + +/** The edge an area's stretch is read along: its value side, piece by piece, across the whole mark. */ +function areaEdge(items: readonly any[], item: any): NoteSegment[] { + if (item.mark?.marktype !== 'area') return []; + return items + .filter((candidate) => candidate.mark === item.mark && candidate.interactionGeometry?.annotationPoints?.length >= 2) + .map((candidate) => ({ a: candidate.interactionGeometry.annotationPoints[0], b: candidate.interactionGeometry.annotationPoints[1] })); } export function createAnnotationOverlay({ @@ -489,6 +694,9 @@ export function createAnnotationOverlay({ coordinateSpace, containerLayoutSize, annotationMarkType, + placedCaptions, + design, + containWithinPlot = false, }: AnnotationOverlayOptions): AnnotationOverlayController { const annotationLayer = document.createElement('div'); annotationLayer.dataset.flintAnnotation = ''; @@ -497,36 +705,425 @@ export function createAnnotationOverlay({ }); const annotationSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); Object.assign(annotationSvg.style, { position: 'absolute', inset: '0', width: '100%', height: '100%' }); + // The mark a caption names, drawn again above its neighbours: a ring, an outline, its stretch. + const annotationCue = document.createElementNS('http://www.w3.org/2000/svg', 'g'); + annotationCue.style.display = 'none'; + // A caption's leader is haloed like its words, so it reads over a filled mark. + const leaderHalo = document.createElementNS('http://www.w3.org/2000/svg', 'path'); + leaderHalo.setAttribute('fill', 'none'); + leaderHalo.setAttribute('stroke-linecap', 'round'); + leaderHalo.setAttribute('stroke-linejoin', 'round'); const annotationPath = document.createElementNS('http://www.w3.org/2000/svg', 'path'); annotationPath.setAttribute('fill', 'none'); - annotationPath.setAttribute('stroke', 'var(--flint-annotation-line-color, #808080)'); - annotationPath.setAttribute('stroke-width', '1.25'); annotationPath.setAttribute('stroke-linecap', 'round'); - annotationSvg.append(annotationPath); - const annotationCard = document.createElement('div'); - Object.assign(annotationCard.style, { - position: 'absolute', color: 'var(--flint-annotation-color, #000)', - fontFamily: 'var(--flint-annotation-font-family, sans-serif)', - fontSize: 'var(--flint-annotation-font-size, 11px)', - fontWeight: 'var(--flint-annotation-font-weight, 400)', lineHeight: 'normal', letterSpacing: '0', - whiteSpace: 'normal', width: 'max-content', overflowWrap: 'break-word', boxSizing: 'border-box', - padding: '8px', border: '1px solid var(--flint-annotation-border-color, #d9d9d9)', - borderRadius: 'var(--flint-annotation-border-radius, 3px)', - background: 'var(--flint-annotation-surface, rgba(255, 255, 255, 0.95))', - boxShadow: 'var(--flint-annotation-shadow, 2px 2px 4px rgba(0, 0, 0, 0.1))', - }); - annotationLayer.append(annotationSvg, annotationCard); + annotationPath.setAttribute('stroke-linejoin', 'round'); + // A note is set as words beside its mark, haloed in the background, never as a card. + const annotationText = document.createElementNS('http://www.w3.org/2000/svg', 'text'); + annotationText.setAttribute('paint-order', 'stroke'); + annotationText.setAttribute('stroke-linejoin', 'round'); + annotationSvg.append(annotationCue, leaderHalo, annotationPath, annotationText); + annotationLayer.append(annotationSvg); + + const svgShape = (tag: 'circle' | 'rect' | 'path', attributes: Record): SVGElement => { + const shape = document.createElementNS('http://www.w3.org/2000/svg', tag); + for (const [name, value] of Object.entries(attributes)) shape.setAttribute(name, String(value)); + return shape; + }; + const paintOf = (value: unknown): string | undefined => + typeof value === 'string' && value !== 'transparent' && value !== 'none' ? value : undefined; + const pathData = (points: readonly PlotPoint[], closed: boolean): string => + points.map((point, index) => `${index === 0 ? 'M' : 'L'} ${point.x} ${point.y}`).join(' ') + (closed ? ' Z' : ''); + + /** + * The places on the noted mark a caption may name it from, in the drawing. One mark is named at + * its outline (a bar at its value end); a stretch of a line or area at its middle or a quarter + * along, an area's from the side away from its fill; a slice inside its wedge, the caption + * preferring the side away from the pie's centre; a whole shape at the ellipse its box holds; a + * map's region at its middle. + */ + const noteAnchors = ({ annotation, kind, item, rowPoint, subject, items, plotCenter, toLayout, toBox, scale, clip }: { + annotation: RenderableAnnotation; kind: NoteSubjectKind; item: any; rowPoint: PlotPoint | undefined; subject: any; + items: readonly any[]; plotCenter: PlotPoint; toLayout: (point: PlotPoint) => PlotPoint; + toBox: (bounds: { x1: number; x2: number; y1: number; y2: number }) => Box; scale: number; clip: any; + }): NoteAnchor[] => { + const highlight = annotation.highlight ?? 'light'; + const point = (at: PlotPoint, radius = 2): NoteTarget => { + const { x, y } = toLayout(at); + return { shape: 'circle', x, y, rx: radius * scale, ry: radius * scale }; + }; + if (kind === 'stretch') { + const ends = (item.interactionGeometry.annotationPoints ?? item.interactionGeometry.points) as readonly PlotPoint[]; + const [a, b] = ends; + // An area's caption stands off the side away from its fill; a line's anywhere clear. + const preferredAngle = item.interactionGeometry.kind === 'slice' + ? segmentMidpointConnectionPoint(item, plotCenter).preferredAngle + : undefined; + // On an area the stretch's own colour is its fill's, which would not show on it. + const area = item.mark?.marktype === 'area'; + const color = area ? undefined : paintOf(item.stroke) ?? paintOf(item.mark?.items?.[0]?.stroke); + // A line drawn wide is cued at its own width, so the cue covers it rather than running down + // its middle as a thinner line, and with its own dashes and ends. + const markWidth = !area && typeof item.strokeWidth === 'number' ? item.strokeWidth * scale : undefined; + const markDash = markWidth && Array.isArray(item.strokeDash) ? item.strokeDash.map((length: number) => length * scale) : undefined; + const markCap = markWidth && typeof item.strokeCap === 'string' ? item.strokeCap : undefined; + // A map route's leg is already drawn whole, as an arrow in its own colour: a copy over it + // would cover the stops and heads it meets, so the note names it by its leader alone. + const routeLeg = item.datum?.[ROUTE_PART] === 'leg'; + const segments = areaEdge(items, item).map(({ a: from, b: to }) => ({ a: toLayout(from), b: toLayout(to) })); + // A curved path (a map route's leg) is cued and seated along its curve. + const drawnPath = ends.length > 2 ? ends.map(toLayout) : [toLayout(a), toLayout(b)]; + const short = pathLength(drawnPath) < SHORT_STRETCH * scale; + return STRETCH_SEATS.map(({ at, cost }) => { + const target = point(ends.length > 2 ? pointAlongPath(ends, at) : { x: a.x + (b.x - a.x) * at, y: a.y + (b.y - a.y) * at }, short ? 3.5 : 2); + const cue: NoteCue = highlight === 'none' || routeLeg ? { kind: 'none' } + : short ? { kind: 'dot', point: { x: target.x, y: target.y }, ...(color ? { color } : {}) } + : { kind: 'stretch', points: drawnPath, ...(color ? { color } : {}), ...(markWidth ? { width: markWidth } : {}), ...(markDash ? { dash: markDash } : {}), ...(markCap ? { cap: markCap } : {}) }; + return { target, ...(preferredAngle !== undefined ? { preferredAngle } : {}), cost, segments, cue }; + }); + } + if (kind === 'slice' && typeof item.startAngle === 'number' && typeof item.endAngle === 'number' && typeof item.outerRadius === 'number') { + const angle = (item.startAngle + item.endAngle) / 2; + const inner = typeof item.innerRadius === 'number' ? item.innerRadius : 0; + const radius = inner + (item.outerRadius - inner) * SLICE_DEPTH; + const outline = sliceOutline(item).map(toLayout); + // The whole pie is ink the caption keeps off, its own slice too: a slice is named from outside. + const slices = items.filter((candidate) => candidate.mark === item.mark && candidate.bounds); + const pie = toBox({ + x1: Math.min(...slices.map((slice) => slice.bounds.x1)), x2: Math.max(...slices.map((slice) => slice.bounds.x2)), + y1: Math.min(...slices.map((slice) => slice.bounds.y1)), y2: Math.max(...slices.map((slice) => slice.bounds.y2)), + }); + const cue: NoteCue = highlight === 'none' ? { kind: 'none' } : { kind: 'outline', points: outline }; + const outside: NoteAnchor = { + target: point({ x: item.x + radius * Math.sin(angle), y: item.y - radius * Math.cos(angle) }, 1.5), + body: pie, + preferredAngle: vectorAngle(Math.sin(angle), -Math.cos(angle)), + cost: 0, + cue, + }; + // On the pie itself: in the slice's band where the caption fits it, or in a donut's hole. + const centre = toLayout({ x: item.x, y: item.y }); + const pad = 2 * scale; + const outer = item.outerRadius * scale; + const innerPx = inner * scale; + const tau = Math.PI * 2; + const start = ((item.startAngle % tau) + tau) % tau; + const sweep = item.endAngle - item.startAngle; + const corners = (box: Box): PlotPoint[] => [ + { x: box.x, y: box.y }, { x: box.x + box.width, y: box.y }, { x: box.x, y: box.y + box.height }, + { x: box.x + box.width, y: box.y + box.height }, { x: box.x + box.width / 2, y: box.y }, + { x: box.x + box.width / 2, y: box.y + box.height }, { x: box.x, y: box.y + box.height / 2 }, + { x: box.x + box.width, y: box.y + box.height / 2 }, + ]; + const inWedge = (p: PlotPoint): boolean => { + const dx = p.x - centre.x; + const dy = p.y - centre.y; + const r = Math.hypot(dx, dy); + if (r < innerPx + pad || r > outer - pad) return false; + const at = ((Math.atan2(dx, -dy) - start) % tau + tau) % tau; + return at <= sweep; + }; + const along = (fraction: number): PlotPoint => { + const r = (innerPx + (outer - innerPx) * fraction); + return { x: centre.x + r * Math.sin(angle), y: centre.y - r * Math.cos(angle) }; + }; + const sliceFill = paintOf(item.fill); + const inside: { point: PlotPoint; fits: (box: Box) => boolean; fill?: string }[] = [0.5, 0.4, 0.62].map((fraction) => ({ + point: along(fraction), fits: (box: Box) => corners(box).every(inWedge), ...(sliceFill ? { fill: sliceFill } : {}), + })); + if (innerPx > 0) { + inside.push({ point: centre, fits: (box: Box) => corners(box).every((p) => Math.hypot(p.x - centre.x, p.y - centre.y) <= innerPx - pad) }); + } + return [outside, { + target: { shape: 'circle', x: centre.x, y: centre.y, rx: 1, ry: 1 }, + cost: 0, + // Placed on the pie, the slices are under the caption by design; the fit test keeps it off the rest. + own: (inkItem) => inkItem.mark === item.mark, + inside, + cue, + }]; + } + if (kind === 'shape') { + const box = toBox(clippedBounds(annotationSourceBounds(items, item), clip) ?? item.bounds); + return [{ + target: { shape: 'circle', x: box.x + box.width / 2, y: box.y + box.height / 2, rx: box.width / 2, ry: box.height / 2 }, + cost: 0, + cue: highlight === 'none' ? { kind: 'none' } : { kind: 'outline', points: shapeOutline(items, item).map(toLayout) }, + }]; + } + if (kind === 'region') { + const box = toBox(subject.bounds); + return [{ + target: { shape: 'circle', x: box.x + box.width / 2, y: box.y + box.height / 2, rx: 1.5 * scale, ry: 1.5 * scale }, + cost: 0, + cue: { kind: 'none' }, + }]; + } + const first = annotation.candidates[0]; + const connection = first && POINTING_CONNECTIONS.has(first.connection) ? first.connection : 'center'; + const { point: connectionPoint, preferredAngle } = annotationConnectionPoint( + subject, connection, items, plotCenter, first?.valueAxis, first?.crossSide, first?.valueInset, + ); + const noted = noteTarget(item, rowPoint, toLayout, scale, connection === 'center' ? undefined : connectionPoint); + const ownLabel = valueLabelBeyondFace(noted, items, item, toBox); + const { target: drawnTarget, body } = ownLabel ? { ...noted, target: ownLabel.face } : noted; + // A strong highlight rings a dot: the caption and its leader keep off the ring, not the dot. + const ringed = highlight === 'strong' || highlight === 'exclusive'; + const outset = highlight === 'none' || drawnTarget.shape !== 'circle' ? 0 + : ringed ? RING_GAP * scale + 0.5 * scale : rowPoint ? scale : 0.75 * scale; + const target = outset > 0 ? { ...drawnTarget, rx: drawnTarget.rx + outset, ry: drawnTarget.ry + outset } : drawnTarget; + const rect = !rowPoint && item.mark?.marktype === 'rect' && item.bounds ? toBox(item.bounds) : undefined; + const onRect: NoteAnchor[] = rect && highlight !== 'none' ? [{ + target: { shape: 'circle', x: rect.x + rect.width / 2, y: rect.y + rect.height / 2, rx: 1, ry: 1 }, + cost: 0, + own: (inkItem) => inkItem === item, + inside: [{ + point: { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 }, + fits: (box: Box) => box.x >= rect.x + 2 * scale && box.x + box.width <= rect.x + rect.width - 2 * scale + && box.y >= rect.y + scale && box.y + box.height <= rect.y + rect.height - scale, + ...(paintOf(item.fill) ? { fill: paintOf(item.fill)! } : {}), + }], + cue: { kind: 'mark', target: drawnTarget, ...(body ? { body } : {}) }, + }] : []; + return [{ + target, + ...(body ? { body } : {}), + ...(preferredAngle !== undefined ? { preferredAngle } : {}), + cost: 0, + // The mark's own value label, and its point drawn over its line, are the mark, not neighbours. + own: (inkItem, box) => !!ownLabel?.items.includes(inkItem) + || (box.x <= drawnTarget.x && drawnTarget.x <= box.x + box.width && box.y <= drawnTarget.y && drawnTarget.y <= box.y + box.height + && box.width <= drawnTarget.rx * 2 + 6 && box.height <= drawnTarget.ry * 2 + 6), + cue: { kind: 'mark', target: drawnTarget, ...(body ? { body } : {}) }, + }, ...onRect]; + }; + + const renderCaption = ({ annotation, kind, item, rowPoint, subject, items, ink, plotCenter, toLayout, plot, canvas, furniture }: { + annotation: RenderableAnnotation; kind: NoteSubjectKind; item: any; rowPoint: PlotPoint | undefined; subject: any; + items: readonly any[]; ink: ReturnType; plotCenter: PlotPoint; toLayout: (point: PlotPoint) => PlotPoint; + plot: Box; canvas: Box; furniture: readonly Box[]; + }): NotePlacement => { + const origin = toLayout({ x: 0, y: 0 }); + const unit = toLayout({ x: 1, y: 0 }); + const scale = Math.hypot(unit.x - origin.x, unit.y - origin.y) || 1; + // The halo is the page the plot is read on: the house's plot surface where it has one. + const textStyle = { ...chartTextStyle(view, ink.boxes), ...(design?.background ? { background: design.background } : {}) }; + // A note's own style sits over the house's annotation role. + const text = design?.text || annotation.style ? { ...design?.text, ...annotation.style } : undefined; + const base = noteStyle(textStyle, { ...(text ? { text } : {}), ...(design?.ink ? { ink: design.ink } : {}) }); + const style = { ...base, fontSize: base.fontSize * scale, lineHeight: base.lineHeight * scale, padding: base.padding * scale }; + const measure = rendererTextMeasurer(style.fontSize, style.font, style.fontWeight, 'normal'); + const toBox = (bounds: { x1: number; x2: number; y1: number; y2: number }): Box => { + const leading = toLayout({ x: bounds.x1, y: bounds.y1 }); + const trailing = toLayout({ x: bounds.x2, y: bounds.y2 }); + return { + x: Math.min(leading.x, trailing.x), y: Math.min(leading.y, trailing.y), + width: Math.abs(trailing.x - leading.x), height: Math.abs(trailing.y - leading.y), + }; + }; + const anchors = noteAnchors({ annotation, kind, item, rowPoint, subject, items, plotCenter, toLayout, toBox, scale, clip: item.interactionClip }); + if (annotation.text === '') { + // A note with no words is its cue alone: the mark's ring or outline, no caption, no leader. + annotationText.replaceChildren(); + annotationPath.style.display = 'none'; + leaderHalo.style.display = 'none'; + drawCue(annotation.highlight ?? 'light', anchors[0].cue, item, rowPoint, style, scale, annotation.highlightStyle); + return { box: { x: 0, y: 0, width: 0, height: 0 }, align: 'center', angle: 0, gap: 0, cost: 0 }; + } + // Rects that tile most of the plot — a heatmap's cells — and a map's regions are a ground the + // halo reads over, not marks to dodge. + const tiled = tiledRects(ink.boxes, Math.max(1, plot.width * plot.height) / (scale * scale)); + const inkBoxes = ink.boxes.flatMap(({ item: inkItem, bounds }) => { + if (isAnnotationSourceItem(inkItem, item)) return []; + // A map's land and sea are structure, not data (their shapes carry no key): a caption stands + // over them freely, as a region's does, so the marks near it decide where it goes. + if (inkItem.mark?.marktype === 'shape' && inkItem.datum?.[INTERACTION_KEY] == null) return []; + // So is the sea a map is drawn on: a rect under the whole plot, no row's. + if (containWithinPlot && inkItem.mark?.marktype === 'rect' && inkItem.datum?.[INTERACTION_KEY] == null) return []; + const box = toBox(bounds); + const kindOf: NoteObstacle['kind'] = inkItem.mark?.marktype === 'text' ? 'text' + : (typeof inkItem.opacity === 'number' ? inkItem.opacity : 1) < 0.5 || tiled(inkItem.mark) || inkItem.mark?.marktype === 'shape' ? 'faint' : 'mark'; + return [{ inkItem, obstacle: { box, kind: kindOf } as NoteObstacle }]; + }); + const earlier = earlierCaptions(); + const captionBoxes: NoteObstacle[] = [ + ...earlier.filter((caption) => caption.box.width > 0).map((caption) => ({ box: caption.box, kind: 'text' as const })), + // The source line, a map's credit, a house's header: drawn beside the chart, read as its text. + ...furniture.map((box) => ({ box, kind: 'text' as const })), + ]; + const sharedSegments = [ + ...ink.segments.map((segment) => ({ a: toLayout(segment.a), b: toLayout(segment.b) })), + ...earlier.flatMap((caption) => [...(caption.leader ? [caption.leader] : []), ...(caption.segments ?? [])]), + ]; + const first = annotation.candidates[0]; + // Wrap widths are in the chart's px; the measure is at the drawing's scale. + const widths = first?.maxWidth ? [first.maxWidth] : noteWrapWidths(annotation.text, (text) => measure(text) / scale); + const wrapped: string[][] = []; + for (const maxWidth of widths) { + const lines = balanceNote(annotation.text, maxWidth * scale, measure); + if (!wrapped.some((other) => other.join('\n') === lines.join('\n'))) wrapped.push(lines); + } + let best: { placed: NotePlacement; lines: string[]; cost: number; anchor: NoteAnchor } | undefined; + for (const anchor of anchors) { + const obstacles = [ + ...inkBoxes.filter(({ inkItem, obstacle }) => !anchor.own?.(inkItem, obstacle.box)).map(({ obstacle }) => obstacle), + ...captionBoxes, + ]; + const segments = anchor.segments?.length ? [...sharedSegments, ...anchor.segments] : sharedSegments; + for (const lines of wrapped) { + const placed = placeNote({ + target: anchor.target, ...(anchor.body ? { body: anchor.body } : {}), label: noteSize(lines, style, measure), + plot, canvas, obstacles, segments, + ...(anchor.preferredAngle !== undefined ? { preferredAngle: anchor.preferredAngle } : {}), + connector: first?.connector === 'none' ? 'none' : 'auto', + fontSize: style.fontSize, + ...(anchor.inside ? { inside: anchor.inside, insideOnly: true } : {}), + }); + const cost = placed.cost + NOTE_LINE_COST * (lines.length - 1) + anchor.cost; + if (!best || cost < best.cost) best = { placed, lines, cost, anchor }; + } + } + const { placed, lines, anchor } = best!; + // No seat that leaves the chart's text readable and stays on the canvas: point with the highlight alone. + const labelArea = placed.box.width * placed.box.height; + if (placed.covers && (placed.covers.offCanvas || placed.covers.text > labelArea * 0.15)) { + annotationText.replaceChildren(); + annotationPath.style.display = 'none'; + leaderHalo.style.display = 'none'; + drawCue(annotation.highlight ?? 'light', anchor.cue, item, rowPoint, style, scale, annotation.highlightStyle); + return { ...placed, box: { x: 0, y: 0, width: 0, height: 0 }, leader: undefined, unplaced: true }; + } + const { box, align, leader } = placed; + annotationText.setAttribute('font-family', style.font); + annotationText.setAttribute('font-size', String(style.fontSize)); + annotationText.setAttribute('font-weight', String(style.fontWeight)); + annotationText.setAttribute('text-anchor', align === 'left' ? 'start' : align === 'right' ? 'end' : 'middle'); + if (placed.insideFill) { + // On the mark's own paint, as a value label inside a bar: the ink that reads on it, no halo. + const { ink: onFill } = inkOn([placed.insideFill], [style.color, style.halo.color]); + annotationText.style.fill = onFill; + annotationText.style.stroke = 'none'; + annotationText.style.strokeWidth = '0'; + } else { + annotationText.style.fill = `var(--flint-annotation-color, ${style.color})`; + annotationText.style.stroke = `var(--flint-annotation-halo, ${style.halo.color})`; + annotationText.style.strokeWidth = String(style.halo.width * scale); + } + const x = align === 'left' ? box.x + style.padding : align === 'right' ? box.x + box.width - style.padding : box.x + box.width / 2; + const baseline = box.y + style.padding + style.fontSize * 0.82; + annotationText.replaceChildren(...lines.map((line, index) => { + const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + tspan.setAttribute('x', String(x)); + tspan.setAttribute('y', String(baseline + index * style.lineHeight)); + tspan.textContent = line; + return tspan; + })); + annotationPath.setAttribute('stroke', `var(--flint-annotation-line-color, ${style.leader.color})`); + annotationPath.setAttribute('stroke-width', String(style.leader.width * scale)); + const path = leader + ? [leader.from, ...(leader.elbows ?? []), leader.to].map((point, index) => `${index === 0 ? 'M' : 'L'} ${point.x} ${point.y}`).join(' ') + : ''; + annotationPath.setAttribute('d', path); + annotationPath.style.display = leader ? '' : 'none'; + leaderHalo.setAttribute('stroke', `var(--flint-annotation-halo, ${style.halo.color})`); + leaderHalo.setAttribute('stroke-width', String((style.leader.width + 2) * scale)); + leaderHalo.setAttribute('d', path); + leaderHalo.style.display = leader ? '' : 'none'; + drawCue(annotation.highlight ?? 'light', anchor.cue, item, rowPoint, style, scale, annotation.highlightStyle); + return placed; + }; + + /** + * The highlight on the mark a caption names, drawn above the chart so the mark stands over its + * neighbours. Light: a dot drawn again at full strength with a halo, a line's point as a dot in + * the line's ink, a bar or cell with a faint haloed outline, a stretch of a line or area drawn + * again in its ink with a halo, a slice or shape faintly outlined. Strong (and exclusive, whose + * receding of the rest the runtime does): a thin ring a little out from a dot, a full outline. + */ + const drawCue = ( + highlight: NonNullable, cue: NoteCue, item: any, rowPoint: PlotPoint | undefined, + style: ReturnType, scale: number, own?: AnnotationSpec['highlightStyle'], + ): void => { + if (highlight === 'none' || cue.kind === 'none') { + annotationCue.replaceChildren(); + annotationCue.style.display = 'none'; + return; + } + const strong = highlight !== 'light'; + // The ring's and outline's paint: the note's own, then the house's, then the leader's grey. + const house = design?.highlight; + const paintColor = own?.color ?? house?.color; + const ink = paintColor ?? `var(--flint-annotation-line-color, ${style.leader.color})`; + const halo = house?.haloColor ?? `var(--flint-annotation-halo, ${style.halo.color})`; + const lineWidth = own?.width ?? house?.width; + const strongWidth = lineWidth ?? 1.25; + const lightWidth = lineWidth !== undefined ? lineWidth * 0.8 : 1; + const haloExtra = house?.haloWidth ?? 1.75; + const ringWidth = lineWidth ?? 1; + const ringGap = RING_GAP * scale; + // A cue drawn on the mark's edge (an area's stretch, a dot on it) lies on the mark and the page + // at once: in whichever of the note's ink and the page's colour reads on both, haloed where neither does. + const onMark = inkOn([paintOf(item.fill) ?? paintOf(item.stroke), style.halo.color], [style.color, style.halo.color]); + const outlined = (d: string): SVGElement[] => [ + svgShape('path', { d, fill: 'none', stroke: halo, 'stroke-width': ((strong ? strongWidth : lightWidth) + haloExtra) * scale, 'stroke-linejoin': 'round' }), + svgShape('path', { d, fill: 'none', stroke: ink, 'stroke-width': (strong ? strongWidth : lightWidth) * scale, 'stroke-opacity': strong || paintColor ? 1 : 0.45, 'stroke-linejoin': 'round' }), + ]; + const shapes: SVGElement[] = []; + if (cue.kind === 'stretch') { + const d = pathData(cue.points, false); + const width = Math.max((strong ? 3.5 : 2.5) * scale, cue.width ?? 0); + const edgeHalo = cue.color ? halo : onMark.halo; + const ends = { 'stroke-linecap': cue.cap ?? 'round', ...(cue.dash ? { 'stroke-dasharray': cue.dash.join(' ') } : {}) }; + if (edgeHalo) shapes.push(svgShape('path', { d, fill: 'none', stroke: edgeHalo, 'stroke-width': width + (cue.color ? 3 : 2) * scale, ...ends })); + shapes.push(svgShape('path', { d, fill: 'none', stroke: cue.color ?? onMark.ink, 'stroke-width': width, ...ends })); + } else if (cue.kind === 'dot') { + const r = (strong ? 4 : 3.5) * scale; + shapes.push(svgShape('circle', { + cx: cue.point.x, cy: cue.point.y, r, fill: cue.color ?? onMark.ink, stroke: cue.color ? halo : onMark.halo ?? (onMark.ink === style.color ? style.halo.color : style.color), 'stroke-width': 1.5 * scale, + })); + if (strong) shapes.push(svgShape('circle', { cx: cue.point.x, cy: cue.point.y, r: r + ringGap, fill: 'none', stroke: ink, 'stroke-width': ringWidth * scale })); + } else if (cue.kind === 'outline') { + if (cue.points.length > 2) shapes.push(...outlined(pathData(cue.points, true))); + } else { + const { target, body } = cue; + if (rowPoint) { + const color = paintOf(item.stroke) ?? paintOf(item.mark?.items?.[0]?.stroke) ?? style.color; + shapes.push(svgShape('circle', { cx: target.x, cy: target.y, r: target.rx, fill: color, stroke: halo, 'stroke-width': 1.5 * scale })); + if (strong) shapes.push(svgShape('circle', { cx: target.x, cy: target.y, r: target.rx + ringGap, fill: 'none', stroke: ink, 'stroke-width': ringWidth * scale })); + } else if (target.shape === 'circle') { + const color = paintOf(item.fill) ?? paintOf(item.stroke) ?? style.color; + shapes.push(svgShape('circle', { cx: target.x, cy: target.y, r: target.rx, fill: color, stroke: halo, 'stroke-width': 1.5 * scale })); + if (strong) shapes.push(svgShape('circle', { cx: target.x, cy: target.y, r: target.rx + ringGap, fill: 'none', stroke: ink, 'stroke-width': ringWidth * scale })); + } else { + const box = body ?? { x: target.x - target.rx, y: target.y - target.ry, width: target.rx * 2, height: target.ry * 2 }; + const outline = { x: box.x, y: box.y, width: Math.max(0, box.width), height: Math.max(0, box.height), fill: 'none' }; + shapes.push( + svgShape('rect', { ...outline, stroke: halo, 'stroke-width': ((strong ? strongWidth : lightWidth) + haloExtra) * scale }), + svgShape('rect', { ...outline, stroke: ink, 'stroke-width': (strong ? strongWidth : lightWidth) * scale, 'stroke-opacity': strong || paintColor ? 1 : 0.45 }), + ); + } + } + annotationCue.replaceChildren(...shapes); + annotationCue.style.display = shapes.length > 0 ? '' : 'none'; + }; // Placement is derived from rendered geometry, so the runtime re-syncs it // whenever the renderer is resized or the host rescales the chart. let current: { element: SemanticElement; annotation: RenderableAnnotation } | undefined; let laidOut: string | undefined; let inView: boolean | undefined; + const slot = placedCaptions ? placedCaptions.slots.push(undefined) - 1 : -1; + // Regions' and enclosures' captions are drawn first; each note keeps clear of them and of the notes before it. + const earlierCaptions = (): PlacedCaption[] => [...(placedCaptions?.fixed ?? []), ...(placedCaptions?.slots.slice(0, slot) ?? [])] + .filter((caption): caption is PlacedCaption => caption !== undefined); + const holdCaption = (caption: PlacedCaption | undefined): void => { + if (placedCaptions && slot >= 0) placedCaptions.slots[slot] = caption; + }; const clear = (): void => { current = undefined; laidOut = undefined; inView = undefined; + holdCaption(undefined); annotationLayer.remove(); }; // A note whose target is out of view keeps its place in `current`, so it comes back on the @@ -534,6 +1131,7 @@ export function createAnnotationOverlay({ const hide = (): void => { laidOut = undefined; inView = false; + holdCaption(undefined); annotationLayer.remove(); }; const render = (element: SemanticElement, annotation: RenderableAnnotation): void => { @@ -574,239 +1172,48 @@ export function createAnnotationOverlay({ if (!annotationLayer.isConnected) container.append(annotationLayer); if (getComputedStyle(container).position === 'static') container.style.position = 'relative'; - annotationCard.textContent = annotation.text; - annotationCard.style.whiteSpace = annotation.text.includes('\n') ? 'pre-line' : 'normal'; - const directValue = annotation.text.length <= 18 && !annotation.text.includes('\n'); - const containerRect = container.getBoundingClientRect(); const space = coordinateSpace(); const layoutSize = containerLayoutSize(); - const width = layoutSize.width; - const height = layoutSize.height; + const { width, height } = layoutSize; const toLayout = (point: PlotPoint): PlotPoint => clientToLayoutPoint( plotToClientPoint(point, space), containerRect, layoutSize, ); - const obstacles: LayoutObstacle[] = sceneObstacles(view).flatMap((candidate) => { - if (isAnnotationSourceItem(candidate, item)) return []; - const leading = toLayout({ x: candidate.bounds.x1, y: candidate.bounds.y1 }); - const trailing = toLayout({ x: candidate.bounds.x2, y: candidate.bounds.y2 }); - return [{ - item: candidate, - rect: { - left: Math.min(leading.x, trailing.x), - top: Math.min(leading.y, trailing.y), - width: Math.abs(trailing.x - leading.x), - height: Math.abs(trailing.y - leading.y), - }, - tier: annotationObstacleTier(candidate), - }]; - }); const plotLeading = toLayout({ x: 0, y: 0 }); const plotTrailing = toLayout({ x: space.plotWidth, y: space.plotHeight }); - const plotRect: LayoutRect = { - left: Math.min(plotLeading.x, plotTrailing.x), - top: Math.min(plotLeading.y, plotTrailing.y), + const plot: Box = { + x: Math.min(plotLeading.x, plotTrailing.x), + y: Math.min(plotLeading.y, plotTrailing.y), width: Math.abs(plotTrailing.x - plotLeading.x), height: Math.abs(plotTrailing.y - plotLeading.y), }; const sourceBounds = rowPoint ? subject.bounds : clippedBounds(annotationSourceBounds(items, item), clip) ?? subject.bounds; - const sourceLeading = toLayout({ x: sourceBounds.x1, y: sourceBounds.y1 }); - const sourceTrailing = toLayout({ x: sourceBounds.x2, y: sourceBounds.y2 }); - const markSourceRect: LayoutRect = { - left: Math.min(sourceLeading.x, sourceTrailing.x), - top: Math.min(sourceLeading.y, sourceTrailing.y), - width: Math.abs(sourceTrailing.x - sourceLeading.x), - height: Math.abs(sourceTrailing.y - sourceLeading.y), - }; - const canvasRect = { left: 0, top: 0, width, height }; + const ink = sceneInk(view); + const kind = noteSubjectKind(annotation, item, items, rowPoint); + const furniture = canvasFurnitureBoxes(container, containerRect, layoutSize); const layoutInputs = JSON.stringify([ - annotation, markSourceRect, plotRect, canvasRect, obstacles.map((obstacle) => obstacle.rect), + annotation, kind, sourceBounds, plot, width, height, inkSignature(ink), earlierCaptions(), furniture, ]); if (layoutInputs === laidOut && annotationLayer.isConnected) return; - const plotCenter = { x: space.plotWidth / 2, y: space.plotHeight / 2 }; - const sourceGap = 10; - let best: AnnotationLayout | undefined; - let fallback: AnnotationLayout | undefined; - const cardSizes = new Map(); - const cardSize = (maxWidth: number): { width: number; height: number } => { - let size = cardSizes.get(maxWidth); - if (!size) { - annotationCard.style.maxWidth = `${maxWidth}px`; - size = { width: annotationCard.offsetWidth, height: annotationCard.offsetHeight }; - cardSizes.set(maxWidth, size); - } - return size; - }; - for (const candidate of annotation.candidates) { - const connection = annotationConnectionPoint( - subject, - candidate.connection, - items, - plotCenter, - candidate.valueAxis, - candidate.crossSide, - candidate.valueInset, - ); - const anchor = toLayout(connection.point); - const boundarySourceRect = { left: anchor.x - 0.5, top: anchor.y - 0.5, width: 1, height: 1 }; - const sourceRect = annotation.subject?.kind === 'region' - || (candidate.connection === 'segment-midpoint' - && !(item.mark?.marktype === 'area' && item.orient === 'horizontal')) - || candidate.connection === 'outer-radial' - || candidate.connection === 'radial-midpoint' - ? { left: anchor.x - 0.5, top: anchor.y - 0.5, width: 1, height: 1 } - : markSourceRect; - const connectorSourceRect = annotation.subject?.kind === 'region' - || candidate.connection === 'outer-radial' - || candidate.connection === 'radial-midpoint' - ? boundarySourceRect - : sourceRect; - const maxWidths = candidate.maxWidth ? [candidate.maxWidth] : directValue ? [120] : [200, 160, 120]; - const maxDistance = candidate.maxDistance ?? 72; - const distances = (directValue ? [12, 20, 32, 48, maxDistance] : [28, 44, 60, maxDistance]) - .filter((distance, index, values) => distance <= maxDistance && values.indexOf(distance) === index); - const angles = annotationCandidateAngles(connection.preferredAngle, candidate.anglePreference); - for (const angle of angles) { - for (const distance of distances) { - for (const maxWidth of maxWidths) { - const { width: cardWidth, height: cardHeight } = cardSize(maxWidth); - const center = { - x: anchor.x + Math.cos(angle) * distance, - y: anchor.y + Math.sin(angle) * distance, - }; - const card = { - left: center.x - cardWidth / 2, - top: center.y - cardHeight / 2, - width: cardWidth, - height: cardHeight, - }; - const route = routeAnnotationLeaders({ card, sources: [anchor] })[0]; - if (!route) continue; - const align = candidate.textAlign ?? textAlignForPort(route.port.edge); - const end = route.port; - const canvasOverflow = overflowDistance(card, canvasRect, 8); - const plotOverflow = overflowDistance(card, plotRect, 6); - const sourceCollision = overlapArea(card, sourceRect); - const sourceClearance = rectDistance(card, sourceRect); - const obstacleOverlapPenalty = obstacles.reduce((sum, obstacle) => sum - + annotationObstacleOverlapCost(obstacle.tier, overlapArea(card, obstacle.rect)), 0); - const connectorLength = route.points.slice(1).reduce((sum, point, index) => - sum + Math.hypot(point.x - route.points[index].x, point.y - route.points[index].y), 0); - const drawsConnector = connectorFor(candidate) === 'line'; - const leavesInward = connection.preferredAngle !== undefined - && angularDistance(angle, connection.preferredAngle) > Math.PI / 2 + 1e-6; - const crossesSource = drawsConnector - && annotation.subject?.kind !== 'region' - && candidate.connection !== 'outer-radial' - && candidate.connection !== 'radial-midpoint' - && routeIntersectsRect(route, connectorSourceRect, true); - const obstacleCrossingPenalty = drawsConnector - ? obstacles.reduce((sum, obstacle) => sum + ( - routeIntersectsRect(route, obstacle.rect) - ? annotationObstacleOverlapCost(obstacle.tier, CONNECTOR_CROSSING_AREA) - : 0 - ), 0) - : 0; - const directionPenalty = connection.preferredAngle === undefined - ? 0 - : angularDistance(angle, connection.preferredAngle); - const inwardPenalty = leavesInward ? 50 : 0; - const lineCount = Math.max(1, Math.round((cardHeight - 4) / 15)); - const wrappingPenalty = Math.max(0, lineCount - 1) * 10; - const score = plotOverflow * PLOT_ESCAPE_WEIGHT - + obstacleCrossingPenalty + obstacleOverlapPenalty - + sourceCollision * OBSTACLE_WEIGHT[2] + connectorLength / 100 - + directionPenalty + inwardPenalty + wrappingPenalty + (candidate.priority ?? 0) / 100; - const fallbackScore = score + canvasOverflow * 10_000 - + (crossesSource ? 100_000 : 0) - + Math.max(0, sourceGap - sourceClearance) * 1_000; - if (!fallback || fallbackScore < fallback.score) { - fallback = { - candidate, connection, angle, distance, align, maxWidth, card, end, - score: fallbackScore, - }; - } - if (canvasOverflow > 0 || crossesSource || sourceClearance < sourceGap) continue; - if (!best || score < best.score) { - best = { candidate, connection, angle, distance, align, maxWidth, card, end, score }; - } - } - } - } - } - if (!best && fallback) { - const card = { - ...fallback.card, - left: Math.min(width - fallback.card.width - 8, Math.max(8, fallback.card.left)), - top: Math.min(height - fallback.card.height - 8, Math.max(8, fallback.card.top)), - }; - const anchor = toLayout(fallback.connection.point); - const angle = vectorAngle( - card.left + card.width / 2 - anchor.x, - card.top + card.height / 2 - anchor.y, - ); - const route = routeAnnotationLeaders({ card, sources: [anchor] })[0]; - if (!route) { - clear(); - return; - } - best = { - ...fallback, - card, - angle, - align: fallback.candidate.textAlign ?? textAlignForPort(route.port.edge), - end: route.port, - }; - } - if (!best) { - clear(); - return; - } - annotationCard.style.maxWidth = `${best.maxWidth}px`; - annotationCard.style.textAlign = best.align; - annotationCard.style.left = `${best.card.left}px`; - annotationCard.style.top = `${best.card.top}px`; - const connector = connectorFor(best.candidate); - const connectorAnchors = best.candidate.connectorAnchors?.flatMap((connectorAnchor) => { - const connectorItem = typeof key === 'string' - ? annotationItem(items, key, annotation.subject, undefined, connectorAnchor.role) - : undefined; - if (!connectorItem) return []; - const connection = annotationConnectionPoint( - connectorItem, - connectorAnchor.connection, - items, - plotCenter, - connectorAnchor.valueAxis, - ); - return [toLayout(connection.point)]; + holdCaption(undefined); + const placed = renderCaption({ + annotation, kind, item, rowPoint, subject, items, ink, + plotCenter: { x: space.plotWidth / 2, y: space.plotHeight / 2 }, + toLayout, plot, canvas: containWithinPlot ? plot : { x: 0, y: 0, width, height }, furniture, }); - const fallbackAnchor = toLayout(best.connection.point); - const primaryAnchor = annotationPrimaryAnchor( - subject, - markSourceRect, - best.card, - best.candidate.connection, - fallbackAnchor, - ); - const anchors = connectorAnchors?.length ? connectorAnchors : [primaryAnchor]; - const showConnector = connector === 'line' && anchors.length > 0; - const routes = showConnector ? routeAnnotationLeaders({ card: best.card, sources: anchors }) : []; annotationSvg.setAttribute('viewBox', `0 0 ${width} ${height}`); - annotationPath.setAttribute('d', showConnector && routes.length === anchors.length - ? routes.map((route) => route.points - .map((point, index) => `${index === 0 ? 'M' : 'L'} ${point.x} ${point.y}`) - .join(' ')).join(' ') - : ''); - annotationPath.style.display = showConnector && routes.length === anchors.length ? '' : 'none'; - annotationLayer.dataset.connection = best.candidate.connection; - annotationLayer.dataset.angle = String(Math.round(best.angle * 180 / Math.PI)); - annotationLayer.dataset.distance = String(best.distance); - annotationLayer.dataset.align = best.align; - annotationLayer.dataset.connector = connector; - annotationLayer.dataset.score = String(Math.round(best.score)); + annotationLayer.dataset.style = 'caption'; + annotationLayer.dataset.subject = kind; + annotationLayer.dataset.angle = String(Math.round(((placed.angle * 180) / Math.PI + 360) % 360)); + annotationLayer.dataset.distance = String(placed.gap); + annotationLayer.dataset.align = placed.align; + annotationLayer.dataset.connector = placed.leader ? 'line' : 'none'; + annotationLayer.dataset.score = String(Math.round(placed.cost)); + annotationLayer.dataset.placed = placed.unplaced ? 'none' : placed.inside ? 'inside' : 'beside'; + const runs = placed.leader ? leaderSegments(placed.leader) : []; + holdCaption({ box: placed.box, ...(runs[0] ? { leader: runs[0] } : {}), ...(runs.length > 1 ? { segments: runs.slice(1) } : {}) }); laidOut = layoutInputs; }; diff --git a/packages/flint-js/src/vegalite/interactions/presentation/data-overlay.ts b/packages/flint-js/src/vegalite/interactions/presentation/data-overlay.ts index e95543ab..3cf3d501 100644 --- a/packages/flint-js/src/vegalite/interactions/presentation/data-overlay.ts +++ b/packages/flint-js/src/vegalite/interactions/presentation/data-overlay.ts @@ -3,10 +3,19 @@ import type { SemanticTarget } from '../../../core/interaction-semantics'; import type { PlotPoint } from '../../../interactive/language/geometry'; import type { PathProjection } from '../../../interactive/language/projections'; import { pointInClip, type RendererCoordinateSpace } from '../hit-adapter'; -import { overlayChannels } from './overlay-channels'; +import { geoDistance, geoPath } from 'd3-geo'; +import { geoOverlayChannels, isGeoOverlay, overlayChannels } from './overlay-channels'; +import { INTERACTION_KEY } from '../stores'; +import { ROUTE_PART } from '../../templates/map-routes'; export { overlayChannels }; +/** A map's live projection, as Vega holds it: longitude and latitude to the plot's pixels. */ +export type OverlayProjection = ((point: [number, number]) => [number, number] | null) & { + rotate?: () => number[]; + clipAngle?: () => number | null; +}; + export interface DataOverlayController { render(overlays: ReadonlyMap): void; targetForElement(element: EventTarget | null): { name: string; target: SemanticTarget } | null; @@ -22,11 +31,45 @@ export interface DataOverlayOptions { scales: Partial>; coordinateSpace(): RendererCoordinateSpace; containerLayoutSize(): { width: number; height: number }; - /** Whether the chart clips its marks to the plot, as a navigated chart does; overlays then follow. */ + /** Whether the chart clips its marks to the plot. Overlays on a cartesian chart are always cut at the plot. */ clipToPlot?: boolean; + /** On a map, its projection as drawn now: overlays placed by `longitude`/`latitude` go through it. */ + geoProjection?: () => OverlayProjection | undefined; +} + +/** A place in degrees, or undefined where a row gives none. */ +function lonLat(row: Record, longitude: string | undefined, latitude: string | undefined): [number, number] | undefined { + if (!longitude || !latitude) return undefined; + const lon = Number(row[longitude]); + const lat = Number(row[latitude]); + if (row[longitude] === null || row[latitude] === null || !Number.isFinite(lon) || !Number.isFinite(lat) || Math.abs(lat) > 90) return undefined; + return [lon, lat]; +} + +/** + * A box between two corners in degrees as a GeoJSON ring: up its west meridian, east along its + * north parallel, down its east meridian, west along its south parallel — clockwise, as d3-geo reads + * an outer ring — the parallels walked in short steps, since they are no great circles. A west edge + * east of the east edge runs across the antimeridian. + */ +export function lonLatBox(west: number, south: number, east: number, north: number): [number, number][] { + const [s, n] = south <= north ? [south, north] : [north, south]; + const e = east < west ? east + 360 : east; + const steps = Math.max(1, Math.ceil((e - west) / 2)); + const along = (lat: number, from: number, to: number) => Array.from({ length: steps + 1 }, (_, i) => [from + ((to - from) * i) / steps, lat] as [number, number]); + return [[west, s], ...along(n, west, e), ...along(s, e, west)]; } + +/** An overlay's dash as an SVG dash array: its lengths, or the pattern a word names; none for anything else. */ +function dashArray(dash: unknown): string | undefined { + if (Array.isArray(dash)) return dash.length && dash.every((length) => typeof length === 'number' && length >= 0) ? dash.join(' ') : undefined; + if (dash === 'dash' || dash === 'dashed') return '6 4'; + if (dash === 'dot' || dash === 'dotted') return '2 3'; + return undefined; +} + export function orderedOverlayRows(spec: ChartOverlaySpec): readonly Record[] { const rows = [...spec.data.values]; const field = spec.encodings.order?.field; @@ -86,11 +129,76 @@ export function createDataOverlay({ scales, coordinateSpace, containerLayoutSize, - clipToPlot = false, + geoProjection, }: DataOverlayOptions): DataOverlayController { const layer = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); const clipId = `flint-overlay-clip-${dataOverlayClipSequence += 1}`; let current = new Map(); + /** The groups of overlays drawn under the marks, masked once the layer is placed. */ + const underHolders: SVGGElement[] = []; + let underMaskSequence = 0; + + /** + * Cut each under-overlay away wherever the chart draws a mark over it: a mask of the page, with the + * chart's drawn marks — its route legs, their casings and heads, its keyed marks — cloned into it in + * black, mapped from their place on screen into the layer's. Map ground (land, sea, borders) carries no + * key and is left out. Vega's SVG renderer keeps each item's element; on canvas there is none, and the + * overlay stays over the marks. + */ + const cutUnderMarks = (): void => { + if (underHolders.length === 0) return; + const toLayer = layer.getScreenCTM()?.inverse(); + if (!toLayer) return; + const elements: SVGGraphicsElement[] = []; + const visit = (node: any): void => { + if (!node) return; + const element = node._svg as SVGGraphicsElement | undefined; + const marktype = node.mark?.marktype; + if (element && marktype && marktype !== 'group' && (node.opacity ?? 1) > 0) { + const datum = node.datum; + const keyed = datum && typeof datum === 'object' + && ((datum as Record)[ROUTE_PART] !== undefined || (datum as Record)[INTERACTION_KEY] != null); + if (keyed && element instanceof SVGGraphicsElement) elements.push(element); + } + if (Array.isArray(node.items)) for (const child of node.items) visit(child); + }; + visit(view.scenegraph?.()?.root); + if (elements.length === 0) return; + const width = Number(layer.getAttribute('viewBox')?.split(' ')[2]) || 0; + const height = Number(layer.getAttribute('viewBox')?.split(' ')[3]) || 0; + const defs = svgElement('g'); + for (const holder of underHolders) { + const id = `flint-overlay-under-${underMaskSequence += 1}`; + const mask = document.createElementNS('http://www.w3.org/2000/svg', 'mask'); + mask.setAttribute('id', id); + mask.setAttribute('maskUnits', 'userSpaceOnUse'); + mask.setAttribute('x', '0'); + mask.setAttribute('y', '0'); + mask.setAttribute('width', String(width)); + mask.setAttribute('height', String(height)); + const page = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); + page.setAttribute('width', String(width)); + page.setAttribute('height', String(height)); + page.setAttribute('fill', '#fff'); + mask.append(page); + for (const element of elements) { + const ctm = element.getScreenCTM(); + if (!ctm) continue; + const clone = element.cloneNode(false) as SVGGraphicsElement; + const m = toLayer.multiply(ctm); + clone.setAttribute('transform', `matrix(${m.a} ${m.b} ${m.c} ${m.d} ${m.e} ${m.f})`); + for (const attribute of ['opacity', 'fill-opacity', 'stroke-opacity', 'class', 'style', 'aria-label', 'role']) clone.removeAttribute(attribute); + const fill = element.getAttribute('fill'); + const stroke = element.getAttribute('stroke'); + clone.setAttribute('fill', fill && fill !== 'none' && fill !== 'transparent' ? '#000' : 'none'); + if (stroke && stroke !== 'none' && stroke !== 'transparent') clone.setAttribute('stroke', '#000'); + mask.append(clone); + } + defs.append(mask); + holder.setAttribute('mask', `url(#${id})`); + } + layer.prepend(defs); + }; const projectedVertices = new Map }[]>(); const targetFor = ( name: string, @@ -108,22 +216,156 @@ export function createDataOverlay({ pointerEvents: 'none', overflow: 'hidden', }); + const svgElement = (tag: K): SVGElementTagNameMap[K] => + document.createElementNS('http://www.w3.org/2000/svg', tag); + const identifyOverlay = (element: SVGElement, name: string, spec: ChartOverlaySpec, rowIndex?: number): void => { + element.setAttribute('data-flint-overlay', name); + element.setAttribute('data-flint-role', spec.role); + if (rowIndex !== undefined) element.setAttribute('data-flint-row', String(rowIndex)); + element.setAttribute('opacity', String(spec.style?.opacity ?? 1)); + element.style.pointerEvents = 'none'; + }; + + /** + * A map overlay through its projection: lines, rules and rects as GeoJSON the projection draws — + * great circles between places, cut at the antimeridian and a globe's horizon — points and text + * at their places, none past the horizon. All of it inside the plot. + */ + const drawGeo = ( + name: string, spec: ChartOverlaySpec, rows: readonly Record[], projection: OverlayProjection, + space: RendererCoordinateSpace, plot: { x1: number; y1: number; x2: number; y2: number } | undefined, + colorScale: any, chartBackground: string, + ): void => { + const channels = geoOverlayChannels(spec); + if (!channels) return; + const field = (channel: 'longitude' | 'latitude' | 'longitude2' | 'latitude2') => spec.encodings[channel]?.field; + const colourOf = (row: Record | undefined) => (spec.encodings.color && row ? colorScale?.(row[spec.encodings.color.field]) : undefined); + const shapes = geoPath(projection as any); + // A place past a globe's horizon is not drawn; Vega's orthographic clips at 90°. + const angle = typeof projection.clipAngle === 'function' ? projection.clipAngle() : null; + const rotate = typeof projection.rotate === 'function' ? projection.rotate() : [0, 0]; + const facing = (place: [number, number]) => !angle || geoDistance(place, [-rotate[0], -rotate[1]]) <= (angle * Math.PI) / 180; + // Paths are drawn in the projection's frame, the plot's, and cut at the plot by a group round them. + const holder = svgElement('g'); + if (plot) holder.setAttribute('clip-path', `url(#${clipId})`); + // Beneath the marks: cut away under them once the layer is on the page (see `cutUnderMarks`). + if (spec.layer === 'under' && (spec.mark === 'line' || spec.mark === 'rule')) underHolders.push(holder); + const frame = svgElement('g'); + frame.setAttribute('transform', `translate(${space.originX},${space.originY})`); + holder.append(frame); + const stroke = (path: SVGPathElement, row?: Record, width = 2) => { + path.setAttribute('stroke', spec.style?.stroke ?? colourOf(row) ?? '#4c78a8'); + path.setAttribute('stroke-width', String(spec.style?.strokeWidth ?? width)); + const dash = dashArray(spec.style?.strokeDash); + if (dash) path.setAttribute('stroke-dasharray', dash); + path.setAttribute('stroke-linecap', 'round'); + path.setAttribute('stroke-linejoin', 'round'); + }; + if (spec.mark === 'line') { + const placed = rows.flatMap((row) => { + const place = lonLat(row, field('longitude'), field('latitude')); + return place ? [{ place, row }] : []; + }); + const d = placed.length >= 2 ? shapes({ type: 'LineString', coordinates: placed.map(({ place }) => place) } as any) : null; + projectedVertices.set(name, placed.flatMap(({ place, row }) => { + const point = facing(place) ? projection(place) : null; + return point ? [{ point: { x: point[0], y: point[1] }, record: row }] : []; + })); + if (!d) return; + const path = svgElement('path'); + identifyOverlay(path, name, spec); + path.setAttribute('d', d); + path.setAttribute('fill', 'none'); + stroke(path, rows[0]); + frame.append(path); + } else if (spec.mark === 'rule' || spec.mark === 'rect') { + rows.forEach((row, rowIndex) => { + const from = lonLat(row, field('longitude'), field('latitude')); + const to = lonLat(row, field('longitude2'), field('latitude2')); + if (!from || !to) return; + const geometry = spec.mark === 'rule' + ? { type: 'LineString', coordinates: [from, to] } + : { type: 'Polygon', coordinates: [lonLatBox(from[0], from[1], to[0], to[1])] }; + const d = shapes(geometry as any); + if (!d) return; + const path = svgElement('path'); + identifyOverlay(path, name, spec, rowIndex); + path.setAttribute('d', d); + if (spec.mark === 'rule') { + path.setAttribute('fill', 'none'); + stroke(path, row, 1); + } else { + path.setAttribute('fill', spec.style?.fill ?? colourOf(row) ?? '#4c78a8'); + path.setAttribute('fill-opacity', String(spec.style?.fillOpacity ?? 0.2)); + if (spec.style?.stroke) path.setAttribute('stroke', spec.style.stroke); + if (spec.style?.strokeWidth !== undefined) path.setAttribute('stroke-width', String(spec.style.strokeWidth)); + } + frame.append(path); + }); + } else { + rows.forEach((row, rowIndex) => { + const place = lonLat(row, field('longitude'), field('latitude')); + const point = place && facing(place) ? projection(place) : null; + if (!point || !Number.isFinite(point[0]) || !Number.isFinite(point[1])) return; + const x = point[0] + space.originX; + const y = point[1] + space.originY; + if (!pointInClip({ x, y }, plot)) return; + if (spec.mark === 'point') { + const circle = svgElement('circle'); + identifyOverlay(circle, name, spec, rowIndex); + circle.setAttribute('cx', String(x)); + circle.setAttribute('cy', String(y)); + circle.setAttribute('r', String(spec.style?.pointRadius ?? 4)); + circle.setAttribute('fill', spec.style?.fill ?? colourOf(row) ?? '#4c78a8'); + circle.setAttribute('fill-opacity', String(spec.style?.fillOpacity ?? 1)); + if (spec.style?.stroke) circle.setAttribute('stroke', spec.style.stroke); + if (spec.style?.strokeWidth !== undefined) circle.setAttribute('stroke-width', String(spec.style.strokeWidth)); + // A map is a window on the world: a place by its edge is cut there, as the land is. + if (plot) circle.setAttribute('clip-path', `url(#${clipId})`); + layer.append(circle); + return; + } + const text = svgElement('text'); + identifyOverlay(text, name, spec, rowIndex); + if (plot) text.setAttribute('clip-path', `url(#${clipId})`); + text.setAttribute('x', String(x + (spec.style?.dx ?? 0))); + text.setAttribute('y', String(y + (spec.style?.dy ?? 0))); + text.setAttribute('text-anchor', spec.style?.textAlign ?? 'middle'); + const fontSize = spec.style?.fontSize ?? 11; + text.setAttribute('font-size', String(fontSize)); + text.setAttribute('font-weight', String(spec.style?.fontWeight ?? 'normal')); + if (spec.style?.fontStyle) text.setAttribute('font-style', spec.style.fontStyle); + text.setAttribute('fill', spec.style?.fill ?? colourOf(row) ?? '#333333'); + const halo = spec.style?.stroke ?? chartBackground; + if (halo !== 'none') { + text.setAttribute('stroke', halo); + text.setAttribute('stroke-width', String(spec.style?.strokeWidth ?? Math.min(4, Math.max(2, fontSize / 4)))); + text.setAttribute('stroke-linejoin', 'round'); + text.setAttribute('paint-order', 'stroke'); + } + text.textContent = String(spec.encodings.text ? row[spec.encodings.text.field] ?? '' : ''); + layer.append(text); + }); + } + if (frame.childElementCount > 0) layer.append(holder); + }; + const draw = (): void => { layer.replaceChildren(); projectedVertices.clear(); - if (current.size === 0 || !scales.x || !scales.y) { + underHolders.length = 0; + const xScale = scales.x ? view.scale(scales.x) : undefined; + const yScale = scales.y ? view.scale(scales.y) : undefined; + const cartesian = typeof xScale === 'function' && typeof yScale === 'function'; + const projection = geoProjection?.(); + const mapped = typeof projection === 'function'; + if (current.size === 0 || (!cartesian && !mapped)) { layer.remove(); return; } - const xScale = view.scale(scales.x); - const yScale = view.scale(scales.y); const colorScale = scales.color ? view.scale(scales.color) : undefined; const background = typeof view.background === 'function' ? view.background() : undefined; const chartBackground = typeof background === 'string' && background !== 'transparent' ? background : '#ffffff'; - if (typeof xScale !== 'function' || typeof yScale !== 'function') { - layer.remove(); - return; - } const space = coordinateSpace(); const containerRect = container.getBoundingClientRect(); const rendererRect = space.rect; @@ -141,16 +383,21 @@ export function createDataOverlay({ // Lines, rules, and rects are cut at the edge of the plot the scales draw into, like the // chart's own marks; a point or a label is drawn whole while its anchor is in the plot, // and not at all once it leaves. - const xRange = (xScale.range() as number[]).map(Number); - const yRange = (yScale.range() as number[]).map(Number); - const plot = clipToPlot && [...xRange, ...yRange].every(Number.isFinite) - ? { - x1: space.originX + Math.min(...xRange), - y1: space.originY + Math.min(...yRange), - x2: space.originX + Math.max(...xRange), - y2: space.originY + Math.max(...yRange), - } - : undefined; + const xRange = cartesian ? (xScale.range() as number[]).map(Number) : []; + const yRange = cartesian ? (yScale.range() as number[]).map(Number) : []; + // A map is a window on the world: what it places runs to the plot's edge and is cut there. + const plot = !cartesian + ? { x1: space.originX, y1: space.originY, x2: space.originX + space.plotWidth, y2: space.originY + space.plotHeight } + // Cut at the plot whether or not the chart navigates: a rule past the axis's end would + // otherwise be drawn over the title. + : [...xRange, ...yRange].every(Number.isFinite) + ? { + x1: space.originX + Math.min(...xRange), + y1: space.originY + Math.min(...yRange), + x2: space.originX + Math.max(...xRange), + y2: space.originY + Math.max(...yRange), + } + : undefined; const clipped = (element: SVGElement): void => { if (plot) element.setAttribute('clip-path', `url(#${clipId})`); }; @@ -161,6 +408,11 @@ export function createDataOverlay({ const bandCentre = (scale: any): number => (typeof scale.bandwidth === 'function' ? Number(scale.bandwidth()) || 0 : 0) / 2; for (const [name, spec] of current) { const rows = orderedOverlayRows(spec); + if (isGeoOverlay(spec)) { + if (typeof projection === 'function') drawGeo(name, spec, rows, projection, space, plot, colorScale, chartBackground); + continue; + } + if (!cartesian) continue; const centreX = spec.mark === 'rect' ? 0 : bandCentre(xScale); const centreY = spec.mark === 'rect' ? 0 : bandCentre(yScale); const identify = (element: SVGElement, rowIndex?: number): void => { @@ -203,7 +455,8 @@ export function createDataOverlay({ rule.setAttribute('y2', String(y2)); rule.setAttribute('stroke', spec.style?.stroke ?? '#4c78a8'); rule.setAttribute('stroke-width', String(spec.style?.strokeWidth ?? 1)); - if (spec.style?.strokeDash?.length) rule.setAttribute('stroke-dasharray', spec.style.strokeDash.join(' ')); + const dash = dashArray(spec.style?.strokeDash); + if (dash) rule.setAttribute('stroke-dasharray', dash); clipped(rule); layer.append(rule); return; @@ -255,8 +508,9 @@ export function createDataOverlay({ : undefined; path.setAttribute('stroke', spec.style?.stroke ?? colorValue ?? '#4c78a8'); path.setAttribute('stroke-width', String(spec.style?.strokeWidth ?? 2)); - if (spec.style?.strokeDash?.length) { - path.setAttribute('stroke-dasharray', spec.style.strokeDash.join(' ')); + const dash = dashArray(spec.style?.strokeDash); + if (dash) { + path.setAttribute('stroke-dasharray', dash); } path.setAttribute('stroke-linecap', 'round'); path.setAttribute('stroke-linejoin', 'round'); @@ -293,6 +547,7 @@ export function createDataOverlay({ text.setAttribute('text-anchor', spec.style?.textAlign ?? 'middle'); text.setAttribute('font-size', String(spec.style?.fontSize ?? 11)); text.setAttribute('font-weight', String(spec.style?.fontWeight ?? 'normal')); + if (spec.style?.fontStyle) text.setAttribute('font-style', spec.style.fontStyle); const colorValue = spec.encodings.color ? colorScale?.(row[spec.encodings.color.field]) : undefined; @@ -327,13 +582,20 @@ export function createDataOverlay({ } if (!layer.isConnected) container.append(layer); if (getComputedStyle(container).position === 'static') container.style.position = 'relative'; + cutUnderMarks(); } }; return { render(overlays) { current = new Map(overlays); - draw(); + try { + draw(); + } catch (error) { + // An overlay the drawing cannot read is left off; the chart's other updates still draw. + layer.replaceChildren(); + console.warn('[flint-chart] an overlay could not be drawn:', error); + } }, targetForElement(element) { if (!element || typeof (element as Element).getAttribute !== 'function') return null; diff --git a/packages/flint-js/src/vegalite/interactions/presentation/hover-dot-overlay.ts b/packages/flint-js/src/vegalite/interactions/presentation/hover-dot-overlay.ts new file mode 100644 index 00000000..35489e15 --- /dev/null +++ b/packages/flint-js/src/vegalite/interactions/presentation/hover-dot-overlay.ts @@ -0,0 +1,76 @@ +import { clientRectToLayoutRect, type RendererCoordinateSpace } from '../hit-adapter'; + +/** Where the baseline tooltip reads a line or a point: plot coordinates and a point's radius. */ +export interface HoverDot { + x: number; + y: number; + /** The mark's colour: a line's vertex dot, or a point redrawn larger, is drawn in it. */ + color?: string; + /** A line's stroke width: the dot is a little wider than the line. */ + lineWidth?: number; + /** A point's drawn radius: it is redrawn a little larger. Absent on a line: a slim dot marks the vertex. */ + radius?: number; + /** A point's outline, kept on the larger copy (a house that rings its points). */ + stroke?: string; + strokeWidth?: number; +} + +export interface HoverDotOverlayController { + render(dot: HoverDot): void; + clear(): void; + destroy(): void; +} + +const SVG = 'http://www.w3.org/2000/svg'; +/** How much larger, in px, a hovered point is redrawn. */ +const POINT_GROWTH = 1; +/** How far, in px, a line's vertex dot reaches past the line on each side. */ +const LINE_DOT_MARGIN = 1.5; + +/** A cue on the line vertex or point the baseline tooltip is reading. */ +export function createHoverDotOverlay(options: { + container: HTMLElement; + coordinateSpace(): RendererCoordinateSpace; + containerLayoutSize(): { width: number; height: number }; +}): HoverDotOverlayController { + const { container, coordinateSpace, containerLayoutSize } = options; + const document = container.ownerDocument; + const layer = document.createElementNS(SVG, 'svg'); + layer.dataset.flintHoverDot = ''; + layer.setAttribute('aria-hidden', 'true'); + Object.assign(layer.style, { + position: 'absolute', left: '0', top: '0', width: '100%', height: '100%', + zIndex: '3', pointerEvents: 'none', overflow: 'visible', + }); + const circle = document.createElementNS(SVG, 'circle'); + layer.append(circle); + + const clear = (): void => layer.remove(); + const render = (dot: HoverDot): void => { + if (!layer.isConnected) container.append(layer); + if (getComputedStyle(container).position === 'static') container.style.position = 'relative'; + const space = coordinateSpace(); + const layout = clientRectToLayoutRect(space.rect, container.getBoundingClientRect(), containerLayoutSize()); + const scaleX = layout.width / space.logicalWidth; + const scaleY = layout.height / space.logicalHeight; + circle.setAttribute('cx', String(layout.left + (dot.x + space.originX) * scaleX)); + circle.setAttribute('cy', String(layout.top + (dot.y + space.originY) * scaleY)); + // A line's vertex shows as a dot a little wider than the line, in its colour; a point is redrawn + // a little larger as it is drawn, outline and all. + const scale = Math.max(scaleX, scaleY); + const radius = dot.radius === undefined + ? Math.max(2, ((dot.lineWidth ?? 2) * scale) / 2 + LINE_DOT_MARGIN) + : dot.radius * scale + POINT_GROWTH; + circle.style.display = dot.color ? '' : 'none'; + circle.setAttribute('r', String(radius)); + circle.setAttribute('fill', dot.color ?? 'none'); + if (dot.radius !== undefined && dot.stroke && dot.strokeWidth) { + circle.setAttribute('stroke', dot.stroke); + circle.setAttribute('stroke-width', String(dot.strokeWidth * scale)); + } else { + circle.removeAttribute('stroke'); + circle.removeAttribute('stroke-width'); + } + }; + return { render, clear, destroy: clear }; +} diff --git a/packages/flint-js/src/vegalite/interactions/presentation/inspect-guide-overlay.ts b/packages/flint-js/src/vegalite/interactions/presentation/inspect-guide-overlay.ts index 082cfdb7..d55d12ab 100644 --- a/packages/flint-js/src/vegalite/interactions/presentation/inspect-guide-overlay.ts +++ b/packages/flint-js/src/vegalite/interactions/presentation/inspect-guide-overlay.ts @@ -1,4 +1,5 @@ -import { facetPlotBounds, type RendererCoordinateSpace } from '../hit-adapter'; +import { facetPlotFrames, type RendererCoordinateSpace } from '../hit-adapter'; +import type { PlotFrame } from '../../../interactive/gestures/cartesian-region'; import { clientToLayoutPoint, plotToClientPoint } from '../../../interactive/geometry/coordinate-space'; import type { GestureGuideController, InspectGestureGuideStyle } from '../../../interactive/guides'; @@ -71,6 +72,36 @@ export function inspectGuideValueLabelPosition( return { left, top }; } +const holds = (panel: PlotFrame, axis: 'x' | 'y', coordinate: number): boolean => axis === 'x' + ? coordinate >= panel.x - 0.5 && coordinate <= panel.x + panel.width + 0.5 + : coordinate >= panel.y - 0.5 && coordinate <= panel.y + panel.height + 0.5; + +/** + * The plot panels a guide at `coordinate` on `mode` runs through, each drawn on its own so the + * guide never crosses the headers and gaps between facets; the nearest one where it crosses none. + */ +export function inspectGuidePanels(panels: readonly PlotFrame[], mode: 'x' | 'y', coordinate: number): PlotFrame[] { + const crossed = panels.filter((panel) => holds(panel, mode, coordinate)); + if (crossed.length || panels.length === 0) return crossed; + const distance = (panel: PlotFrame) => { + const [start, size] = mode === 'x' ? [panel.x, panel.width] : [panel.y, panel.height]; + return Math.max(start - coordinate, coordinate - start - size, 0); + }; + return [panels.reduce((best, panel) => distance(panel) < distance(best) ? panel : best)]; +} + +/** The panel a value read at `index` on the index axis stands in: the one holding both, else one holding the value. */ +export function inspectValuePanel( + panels: readonly PlotFrame[], + indexAxis: 'x' | 'y', + index: number | undefined, + value: number, +): PlotFrame | undefined { + const valueAxis = indexAxis === 'x' ? 'y' : 'x'; + return panels.find((panel) => (index === undefined || holds(panel, indexAxis, index)) && holds(panel, valueAxis, value)) + ?? panels.find((panel) => holds(panel, valueAxis, value)); +} + export function createInspectGuideOverlay({ view, container, @@ -78,23 +109,37 @@ export function createInspectGuideOverlay({ containerLayoutSize, }: InspectGuideOverlayOptions): InspectGuideOverlay { const previousPosition = container.style.position; - const line = document.createElement('div'); + // One guide segment per facet panel the guide crosses. + const guideLines: HTMLDivElement[] = []; const crossLine = document.createElement('div'); const valueLines: HTMLDivElement[] = []; const valueLabels: HTMLDivElement[] = []; const indexLabel = document.createElement('div'); let indexLabelBox: { left: number; top: number; width: number; height: number } | null = null; + // Where the index guide stands, so each value rule is drawn in the panel it was read in. + let indexAt: { axis: 'x' | 'y'; coordinate: number } | null = null; const baseStyle = { position: 'absolute', display: 'none', zIndex: '4', pointerEvents: 'none', } as const; - Object.assign(line.style, baseStyle); Object.assign(crossLine.style, baseStyle); Object.assign(indexLabel.style, baseStyle); indexLabel.setAttribute('data-flint-inspect-index', ''); indexLabel.setAttribute('aria-hidden', 'true'); if (getComputedStyle(container).position === 'static') container.style.position = 'relative'; - container.append(line, crossLine, indexLabel); + container.append(crossLine, indexLabel); + const guideLine = (index: number): HTMLDivElement => { + while (guideLines.length <= index) { + const element = document.createElement('div'); + Object.assign(element.style, baseStyle); + guideLines.push(element); + container.append(element); + } + return guideLines[index]; + }; + const hideGuideLines = (from = 0): void => { + guideLines.forEach((element, index) => { if (index >= from) element.style.display = 'none'; }); + }; const hideValueGuides = (): void => { valueLines.forEach((valueLine) => { valueLine.style.display = 'none'; }); valueLabels.forEach((valueLabel) => { valueLabel.style.display = 'none'; }); @@ -104,9 +149,16 @@ export function createInspectGuideOverlay({ indexLabelBox = null; }; - const plotBoundsInContainer = () => { + /** The chart's plot panels in plot px: its facet cells, or the one plot. */ + const plotPanels = (): PlotFrame[] => { + const frames = facetPlotFrames(view); + if (frames.length) return frames; + const space = coordinateSpace(); + return [{ x: 0, y: 0, width: space.plotWidth, height: space.plotHeight }]; + }; + + const frameInContainer = (frame: PlotFrame) => { const space = coordinateSpace(); - const frame = facetPlotBounds(view, { x: 0, y: 0, width: space.plotWidth, height: space.plotHeight }); const containerRect = container.getBoundingClientRect(); const layoutSize = containerLayoutSize(); const start = clientToLayoutPoint(plotToClientPoint({ x: frame.x, y: frame.y }, space), containerRect, layoutSize); @@ -119,14 +171,15 @@ export function createInspectGuideOverlay({ ? `0 0 0 ${style.haloWidth}px color-mix(in srgb, ${style.haloColor} ${style.haloOpacity * 100}%, transparent)` : 'none'; + /** A guide across one plot panel at `coordinate` on `mode`, kept inside that panel. */ const renderLine = ( element: HTMLDivElement, mode: 'x' | 'y', coordinate: number, style: InspectGestureGuideStyle, + frame: PlotFrame, ): void => { const space = coordinateSpace(); - const frame = facetPlotBounds(view, { x: 0, y: 0, width: space.plotWidth, height: space.plotHeight }); const localCoordinate = coordinate - (mode === 'x' ? frame.x : frame.y); const localGuide = inspectGuideLine(mode, localCoordinate, frame); const guide = { @@ -159,10 +212,19 @@ export function createInspectGuideOverlay({ ): void => { hideValueGuides(); hideIndexLabel(); - renderLine(line, axes === 'y' ? 'y' : 'x', axes === 'y' ? point.y : point.x, style); - if (axes === 'xy') renderLine(crossLine, 'y', point.y, style); + const mode = axes === 'y' ? 'y' : 'x'; + const coordinate = mode === 'y' ? point.y : point.x; + const panels = plotPanels(); + // A crosshair stays in the panel under the pointer; an index guide reads the same position in + // every panel it crosses. + const own = panels.find((panel) => holds(panel, 'x', point.x) && holds(panel, 'y', point.y)); + const crossed = axes === 'xy' && own ? [own] : inspectGuidePanels(panels, mode, coordinate); + crossed.forEach((frame, index) => renderLine(guideLine(index), mode, coordinate, style, frame)); + hideGuideLines(crossed.length); + indexAt = axes === 'xy' ? null : { axis: mode, coordinate }; + if (axes === 'xy') renderLine(crossLine, 'y', point.y, style, own ?? crossed[0]); else crossLine.style.display = 'none'; - if (!label || axes === 'xy') return; + if (!label || axes === 'xy' || crossed.length === 0) return; indexLabel.textContent = label; Object.assign(indexLabel.style, { ...baseStyle, display: 'block', fontFamily: 'inherit', fontSize: '10px', @@ -170,10 +232,15 @@ export function createInspectGuideOverlay({ padding: '1px 4px', borderRadius: '2px', background: style.haloColor, color: style.color, boxShadow: haloShadow(style), }); - // On the axis the guide reads: centred at the plot's foot for x, at its left edge for y. - const plot = plotBoundsInContainer(); + // On the axis the guide reads: centred at the foot of the lowest panel for x, at the left + // edge of the leftmost for y. + const end = crossed.reduce((best, frame) => axes === 'x' + ? (frame.y + frame.height > best.y + best.height ? frame : best) + : (frame.x < best.x ? frame : best)); + const plot = frameInContainer(end); + const element = guideLines[crossed.indexOf(end)]; const size = { width: indexLabel.offsetWidth, height: indexLabel.offsetHeight }; - const along = axes === 'x' ? parseFloat(line.style.left) + style.width / 2 : parseFloat(line.style.top) + style.width / 2; + const along = axes === 'x' ? parseFloat(element.style.left) + style.width / 2 : parseFloat(element.style.top) + style.width / 2; const left = axes === 'x' ? Math.max(plot.left, Math.min(plot.left + plot.width - size.width, along - size.width / 2)) : plot.left + 2; @@ -191,7 +258,9 @@ export function createInspectGuideOverlay({ style: InspectGestureGuideStyle, ): void => { hideValueGuides(); + hideGuideLines(1); crossLine.style.display = 'none'; + indexAt = null; const space = coordinateSpace(); const containerRect = container.getBoundingClientRect(); const layoutSize = containerLayoutSize(); @@ -199,7 +268,7 @@ export function createInspectGuideOverlay({ const end = clientToLayoutPoint(plotToClientPoint(segmentEnd, space), containerRect, layoutSize); const length = Math.hypot(end.x - start.x, end.y - start.y); const angle = Math.atan2(end.y - start.y, end.x - start.x); - Object.assign(line.style, { + Object.assign(guideLine(0).style, { display: 'block', left: `${start.x}px`, top: `${start.y - style.width / 2}px`, width: `${length}px`, height: `${style.width}px`, transformOrigin: '0 50%', transform: `rotate(${angle}rad)`, background: style.color, opacity: `${style.opacity}`, @@ -216,31 +285,33 @@ export function createInspectGuideOverlay({ crossLine.style.display = 'none'; valueLabels.forEach((valueLabel) => { valueLabel.style.display = 'none'; }); const occupied: { left: number; top: number; width: number; height: number }[] = indexLabelBox ? [indexLabelBox] : []; - const plotBounds = plotBoundsInContainer(); + const panels = plotPanels(); + const index = indexAt?.axis === indexAxis ? indexAt.coordinate : undefined; while (valueLines.length < coordinates.length) { const valueLine = document.createElement('div'); Object.assign(valueLine.style, baseStyle); valueLines.push(valueLine); container.append(valueLine); } - valueLines.forEach((valueLine, index) => { - if (index >= coordinates.length) { + valueLines.forEach((valueLine, at) => { + if (at >= coordinates.length) { valueLine.style.display = 'none'; return; } - const label = labels?.[index]; + const panel = inspectValuePanel(panels, indexAxis, index, coordinates[at]) ?? panels[0]; + const label = labels?.[at]; const ruleStyle = label?.color ? { ...style, color: label.color } : style; - renderLine(valueLine, indexAxis === 'x' ? 'y' : 'x', coordinates[index], ruleStyle); + renderLine(valueLine, indexAxis === 'x' ? 'y' : 'x', coordinates[at], ruleStyle, panel); const text = label?.text; if (!text) return; - if (coordinates.some((coordinate, previous) => previous < index - && Math.abs(coordinate - coordinates[index]) < 0.5 && labels?.[previous]?.text === text)) return; - let valueLabel = valueLabels[index]; + if (coordinates.some((coordinate, previous) => previous < at + && Math.abs(coordinate - coordinates[at]) < 0.5 && labels?.[previous]?.text === text)) return; + let valueLabel = valueLabels[at]; if (!valueLabel) { valueLabel = document.createElement('div'); valueLabel.setAttribute('data-flint-inspect-value', ''); valueLabel.setAttribute('aria-hidden', 'true'); - valueLabels[index] = valueLabel; + valueLabels[at] = valueLabel; container.append(valueLabel); } valueLabel.textContent = text; @@ -257,7 +328,7 @@ export function createInspectGuideOverlay({ y: parseFloat(valueLine.style.top) + parseFloat(valueLine.style.height), }; const labelSize = { width: valueLabel.offsetWidth, height: valueLabel.offsetHeight }; - const position = inspectGuideValueLabelPosition(indexAxis, intercept, labelSize, plotBounds, occupied); + const position = inspectGuideValueLabelPosition(indexAxis, intercept, labelSize, frameInContainer(panel), occupied); occupied.push({ ...position, ...labelSize }); valueLabel.style.left = `${position.left}px`; valueLabel.style.top = `${position.top}px`; @@ -269,13 +340,14 @@ export function createInspectGuideOverlay({ renderSegment, renderValueRules, clear(): void { - line.style.display = 'none'; + hideGuideLines(); crossLine.style.display = 'none'; hideValueGuides(); hideIndexLabel(); + indexAt = null; }, destroy(): void { - line.remove(); + guideLines.forEach((element) => element.remove()); crossLine.remove(); indexLabel.remove(); valueLines.forEach((valueLine) => valueLine.remove()); diff --git a/packages/flint-js/src/vegalite/interactions/presentation/markup-overlay.ts b/packages/flint-js/src/vegalite/interactions/presentation/markup-overlay.ts new file mode 100644 index 00000000..f447e6a6 --- /dev/null +++ b/packages/flint-js/src/vegalite/interactions/presentation/markup-overlay.ts @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ENCLOSURE_STROKE, + balanceNote, + clusterColor, + neutralInk, + defaultEnclosureShape, + regionColor, + enclosureOutline, + noteSize, + noteStyle, + noteWrapWidths, + over, + overlapArea, + placeEnclosureCaption, + placeRegionCaption, + readableShade, + regionSpan, + segmentCrossesBox, + type Box, + type CaptionLayout, + type CaptionPlacement, + type EnclosedMark, + type EnclosureOutline, + type NoteObstacle, + type NoteSegment, + type Point, +} from '../../../core/annotation'; +import type { EnclosureAnnotationSpec, RegionAnnotationSpec, SemanticTargetRef } from '../../../core/interaction-contracts'; +import { semanticElementRenderKeys } from '../../../core/interaction-semantics'; +import { rendererTextMeasurer } from '../../../core/text-width'; +import type { AnnotationDesign } from '../../../core/theme/types'; +import type { PlotPoint } from '../../../interactive/interactions'; +import { PATH_KEY_SUFFIX, clientToLayoutPoint, facetPlotFrames, plotToClientPoint, sceneItems, type RendererCoordinateSpace } from '../hit-adapter'; +import { INTERACTION_KEY } from '../stores'; +import { canvasFurnitureBoxes, chartTextStyle, sceneInk, tiledRects, type PlacedCaption } from './annotation-overlay'; +import { lonLatBox, type OverlayProjection } from './data-overlay'; +import { geoPath } from 'd3-geo'; + +/** + * Regions and enclosures on a mounted Vega-Lite chart (`annotate-region`, `annotate-enclosure`), after + * Blabber's `region` and `enclose`. A wash under the marks is drawn above the chart but cut away + * wherever a filled mark or a line stands, so they read over it; a wash over them is drawn plainly. + * Outlines, captions and leaders are drawn in a layer above. Everything is placed in the plot's own coordinates from the chart's scales and scene, + * and placed again whenever the chart is resized or navigated. + */ + +/** An enclosure whose targets the runtime has resolved to the chart's marks. */ +export type ResolvedEnclosure = Omit & { targets: readonly SemanticTargetRef[] }; + +export interface MarkupOverlayOptions { + view: any; + container: HTMLElement; + coordinateSpace(): RendererCoordinateSpace; + containerLayoutSize(): { width: number; height: number }; + /** The chart's x and y scales, by name. */ + scales: Partial>; + /** A value as the axis's scale reads it (a date on a time axis). */ + axisValue(axis: 'x' | 'y', value: unknown): unknown; + /** Where the captions drawn here are recorded, for the notes placed after them to keep clear of. */ + placedCaptions?: { fixed?: PlacedCaption[] }; + /** The house's accent, for a region's wash, and its note text. */ + design?: Readonly; + /** On a map, its projection as drawn now: a region given in longitude and latitude is drawn through it. */ + geoProjection?: () => OverlayProjection | undefined; +} + +export interface MarkupOverlayController { + render(regions: ReadonlyMap, enclosures: ReadonlyMap): void; + /** Why each region named could not be shaded, by name. */ + problems(): ReadonlyMap; + /** Why a region cannot be shaded on the chart as drawn now, or undefined where it can. */ + check(region: RegionAnnotationSpec): string | undefined; + sync(): void; + destroy(): void; +} + +const SVG = 'http://www.w3.org/2000/svg'; +let maskSequence = 0; + +function segmentTouches(line: NoteSegment, box: Box): boolean { + return segmentCrossesBox(line.a, line.b, box); +} + +function svg(tag: K, attributes: Record = {}): SVGElementTagNameMap[K] { + const element = document.createElementNS(SVG, tag); + for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, String(value)); + return element; +} + +function layer(zIndex: string): { root: HTMLDivElement; svg: SVGSVGElement } { + const root = document.createElement('div'); + root.dataset.flintMarkup = ''; + Object.assign(root.style, { position: 'absolute', inset: '0', zIndex, pointerEvents: 'none', overflow: 'hidden' }); + const drawing = svg('svg'); + Object.assign(drawing.style, { position: 'absolute', inset: '0', width: '100%', height: '100%', overflow: 'visible' }); + root.append(drawing); + return { root, svg: drawing }; +} + +function keyOf(datum: unknown): string | undefined { + const key = datum && typeof datum === 'object' ? (datum as Record)[INTERACTION_KEY] : undefined; + return typeof key === 'string' ? key : undefined; +} + +function boxOf(bounds: { x1: number; x2: number; y1: number; y2: number }): Box { + return { x: Math.min(bounds.x1, bounds.x2), y: Math.min(bounds.y1, bounds.y2), width: Math.abs(bounds.x2 - bounds.x1), height: Math.abs(bounds.y2 - bounds.y1) }; +} + +/** The part of one box inside another; empty where they do not meet. */ +function intersectBox(a: Box, b: Box): Box { + const x = Math.max(a.x, b.x); + const y = Math.max(a.y, b.y); + return { x, y, width: Math.max(0, Math.min(a.x + a.width, b.x + b.width) - x), height: Math.max(0, Math.min(a.y + a.height, b.y + b.height) - y) }; +} + +/** + * Where a region is shaded in each plot panel, in plot px: its spans (read in a panel's own px, as + * the shared scales give them) laid from that panel's corner and cut at it. A span the region does + * not name runs the panel's full length. + */ +export function regionPanelBoxes(spans: Partial>, panels: readonly Box[]): { shaded: Box; panel: Box }[] { + return panels.flatMap((panel) => { + const shaded = intersectBox({ + x: spans.x ? panel.x + spans.x[0] : panel.x, width: spans.x ? spans.x[1] - spans.x[0] : panel.width, + y: spans.y ? panel.y + spans.y[0] : panel.y, height: spans.y ? spans.y[1] - spans.y[0] : panel.height, + }, panel); + return shaded.width > 0 && shaded.height > 0 ? [{ shaded, panel }] : []; + }); +} + +function paint(value: unknown): string | undefined { + return typeof value === 'string' && value !== 'transparent' && value !== 'none' ? value : undefined; +} + +export function createMarkupOverlay(options: MarkupOverlayOptions): MarkupOverlayController { + const { view, container, coordinateSpace, containerLayoutSize, scales, axisValue, placedCaptions, geoProjection } = options; + const wash = layer('3'); + const ink = layer('4'); + wash.root.dataset.flintMarkup = 'wash'; + ink.root.dataset.flintMarkup = 'ink'; + let regions: ReadonlyMap = new Map(); + let enclosures: ReadonlyMap = new Map(); + let problems = new Map(); + + /** A region's stretch on each axis it names, in plot px, or why it cannot be shaded. */ + const spansOf = (region: RegionAnnotationSpec): { spans?: Partial>; problem?: string } => { + const spans: Partial> = {}; + for (const axis of ['x', 'y'] as const) { + const bounds = region[axis]; + if (!bounds) continue; + const axisScale = scales[axis] ? view.scale(scales[axis]) : undefined; + if (typeof axisScale !== 'function') return { problem: `the chart has no ${axis} scale to shade.` }; + const range = (axisScale.range() as number[]).map(Number) as unknown as [number, number]; + const banded = typeof axisScale.bandwidth === 'function'; + const domain = axisScale.domain() as unknown[]; + const reading = (value: unknown) => banded ? value : axisValue(axis, value); + const position = (value: unknown): number | undefined => { + if (value === undefined) return undefined; + const pixel = Number(axisScale(reading(value))); + return Number.isFinite(pixel) ? pixel + (banded ? Number(axisScale.bandwidth()) / 2 : 0) : undefined; + }; + const result = regionSpan(bounds, banded + ? { + position, range, + index: (value) => domain.findIndex((entry) => String(entry) === String(value)), + step: typeof axisScale.step === 'function' ? Number(axisScale.step()) : Number(axisScale.bandwidth()), + } + : { position, range, ends: [domain[0], domain[domain.length - 1]] as [unknown, unknown] }); + if (!result.span) return { problem: `${axis}: ${result.problem}` }; + spans[axis] = result.span; + } + return spans.x || spans.y ? { spans } : { problem: 'the region names no x or y stretch.' }; + }; + + /** + * A map region, its box of longitude and latitude as the projection draws it now — edges along + * meridians and parallels — as a path and its bounds in plot px; or why it cannot be shaded. + */ + const geoRegionOf = (region: RegionAnnotationSpec): { d: string; bounds: Box } | { problem: string } | undefined => { + if (region.longitude === undefined && region.latitude === undefined) return undefined; + const projection = geoProjection?.(); + if (typeof projection !== 'function') return { problem: 'the chart is no map: a region in longitude and latitude needs one.' }; + const [west, east] = region.longitude ?? []; + const [south, north] = region.latitude ?? []; + if (![west, east, south, north].every((value) => typeof value === 'number' && Number.isFinite(value))) { + return { problem: 'a map region needs longitude: [west, east] and latitude: [south, north], in degrees.' }; + } + const shape = geoPath(projection as any); + const polygon = { type: 'Polygon', coordinates: [lonLatBox(west!, south!, east!, north!)] } as any; + const d = shape(polygon); + const [[x1, y1], [x2, y2]] = shape.bounds(polygon); + if (!d || ![x1, y1, x2, y2].every(Number.isFinite)) return { problem: 'the region is not on the map as drawn.' }; + return { d, bounds: { x: x1, y: y1, width: x2 - x1, height: y2 - y1 } }; + }; + + const detach = (): void => { + wash.root.remove(); + ink.root.remove(); + if (placedCaptions) placedCaptions.fixed = []; + }; + + const draw = (): void => { + wash.svg.replaceChildren(); + ink.svg.replaceChildren(); + problems = new Map(); + if (regions.size === 0 && enclosures.size === 0) { + detach(); + return; + } + const space = coordinateSpace(); + const containerRect = container.getBoundingClientRect(); + const layoutSize = containerLayoutSize(); + if (!(containerRect.width > 0) || !(containerRect.height > 0)) return; + const toLayout = (point: PlotPoint): Point => clientToLayoutPoint(plotToClientPoint(point, space), containerRect, layoutSize); + const origin = toLayout({ x: 0, y: 0 }); + const unit = toLayout({ x: 1, y: 0 }); + const scale = Math.hypot(unit.x - origin.x, unit.y - origin.y) || 1; + const toBox = (box: Box): Box => { + const a = toLayout({ x: box.x, y: box.y }); + const b = toLayout({ x: box.x + box.width, y: box.y + box.height }); + return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) }; + }; + for (const target of [wash.svg, ink.svg]) target.setAttribute('viewBox', `0 0 ${layoutSize.width} ${layoutSize.height}`); + + // The chart as drawn: its plot, its ink, its text face and its page. + const scene = sceneInk(view); + const items = sceneItems(view); + const design = options.design; + const style = noteStyle(chartTextStyle(view, scene.boxes), { ...(design?.text ? { text: design.text } : {}), ...(design?.ink ? { ink: design.ink } : {}) }); + const fontSize = style.fontSize * scale; + const measure = rendererTextMeasurer(fontSize, style.font, style.fontWeight, 'normal'); + // The page the plot is read on: the house's plot surface where it has one, else the canvas. + const background = (design?.background ? paint(design.background) : undefined) + ?? paint(typeof view.background === 'function' ? view.background() : undefined) ?? '#ffffff'; + const plot = toBox({ x: 0, y: 0, width: space.plotWidth, height: space.plotHeight }); + // A map keeps its captions inside the plot it is panned and zoomed in, as its notes do. + const canvas = geoProjection ? plot : { x: 0, y: 0, width: layoutSize.width, height: layoutSize.height }; + const plotArea = Math.max(1, space.plotWidth * space.plotHeight); + const tiled = tiledRects(scene.boxes, plotArea); + // A legend's swatches and an axis's ticks are furniture a caption keeps off, as it does their words. + const furniture = (item: any) => /^(legend|axis)/.test(String(item.mark?.role ?? '')); + // A map's land is structure, not data (its shapes carry no key): a caption stands over it freely. + const sceneObstacles = scene.boxes + .filter(({ item }) => !(item.mark?.marktype === 'shape' && item.datum?.[INTERACTION_KEY] == null)) + .map(({ item, bounds }) => ({ + item, + obstacle: { + box: toBox(boxOf(bounds)), + kind: item.mark?.marktype === 'text' || furniture(item) ? 'text' + : (typeof item.opacity === 'number' ? item.opacity : 1) < 0.5 || tiled(item.mark) ? 'faint' : 'mark', + } as NoteObstacle, + })); + const obstacles: NoteObstacle[] = sceneObstacles.map(({ obstacle }) => obstacle); + const segments: NoteSegment[] = scene.segments.map((segment) => ({ a: toLayout(segment.a), b: toLayout(segment.b) })); + // An area's edge is data a region's or an enclosure's caption must not cut, as a line's is. + for (const item of items) { + if (item.mark?.marktype !== 'area') continue; + // A slice of an area: its top edge, then its bottom edge back. + const points = (item.interactionGeometry?.points as PlotPoint[] | undefined)?.map(toLayout) ?? []; + if (points.length >= 2) segments.push({ a: points[0], b: points[1] }); + if (points.length >= 4) segments.push({ a: points[2], b: points[3] }); + // A slice is narrow, so its box is close to the fill a caption would cover. + if (points.length >= 4) { + const xs = points.map((point) => point.x); + const ys = points.map((point) => point.y); + obstacles.push({ + kind: 'mark', + box: { x: Math.min(...xs), y: Math.min(...ys), width: Math.max(...xs) - Math.min(...xs), height: Math.max(...ys) - Math.min(...ys) }, + }); + } + } + // The source line, a map's credit, a house's header: drawn beside the chart, read as its text. + for (const box of canvasFurnitureBoxes(container, containerRect, layoutSize)) obstacles.push({ box, kind: 'text' }); + const captions: PlacedCaption[] = []; + const outlineLines: NoteSegment[] = []; + const layoutsFor = (text: string, widths: readonly number[]): CaptionLayout[] => { + const seen = new Set(); + const layouts: CaptionLayout[] = []; + for (const width of widths) { + const lines = balanceNote(text, width * scale, measure); + const key = lines.join('\n'); + if (seen.has(key)) continue; + seen.add(key); + const size = noteSize(lines, { ...style, fontSize, lineHeight: style.lineHeight * scale, padding: style.padding * scale }, measure); + layouts.push({ lines, ...size }); + } + return layouts; + }; + /** A caption and its leaders; `halo`, the page's colour, is left out where the caption stands on a wash. */ + const drawCaption = (placed: CaptionPlacement, layouts: readonly CaptionLayout[], colour: string, halo: string | undefined, leaderColour: string): void => { + const { box, align, leaders } = placed; + const group = svg('g', { 'data-flint-markup-caption': '' }); + for (const leader of leaders) { + const d = `M ${leader.from.x} ${leader.from.y} L ${leader.to.x} ${leader.to.y}`; + group.append( + svg('path', { d, fill: 'none', stroke: halo ?? background, 'stroke-width': 3 * scale, 'stroke-linecap': 'round' }), + svg('path', { d, fill: 'none', stroke: leaderColour, 'stroke-width': scale, 'stroke-linecap': 'round' }), + ); + } + const padding = style.padding * scale; + const x = align === 'left' ? box.x + padding : align === 'right' ? box.x + box.width - padding : box.x + box.width / 2; + const text = svg('text', { + 'font-family': style.font, 'font-size': fontSize, 'font-weight': String(style.fontWeight), + 'text-anchor': align === 'left' ? 'start' : align === 'right' ? 'end' : 'middle', + fill: colour, ...(halo ? { stroke: halo, 'stroke-width': style.halo.width * scale, 'stroke-linejoin': 'round', 'paint-order': 'stroke' } : {}), + }); + const lineHeight = style.lineHeight * scale; + layouts[placed.layout].lines.forEach((line, index) => { + const tspan = svg('tspan', { x, y: box.y + padding + fontSize * 0.82 + index * lineHeight }); + tspan.textContent = line; + text.append(tspan); + }); + group.append(text); + ink.svg.append(group); + captions.push({ box, ...(leaders[0] ? { leader: { a: leaders[0].from, b: leaders[0].to } } : {}) }); + obstacles.push({ box, kind: 'text' }); + for (const leader of leaders) segments.push({ a: leader.from, b: leader.to }); + }; + + // Regions first: an enclosure's caption keeps clear of a region's. + const regionColours: string[] = []; + const backdrop = [...new Set(items.filter((item) => item.mark?.marktype === 'rect' || item.mark?.marktype === 'area') + .map((item) => paint(item.fill)).filter((fill): fill is string => fill !== undefined))].slice(0, 32); + // Every ink the data is drawn in, which the house's accent must stand apart from to wash a region. + const markInks = [...new Set(items.flatMap((item) => ['symbol', 'line', 'rule', 'arc', 'trail'].includes(item.mark?.marktype) + ? [paint(item.fill), paint(item.stroke)] : []).filter((ink): ink is string => ink !== undefined))].slice(0, 32); + const overArea = items.some((item) => item.mark?.marktype === 'area'); + const overTiles = items.some((item) => item.mark?.marktype === 'rect' && tiled(item.mark)); + // The filled marks and the lines an under-wash is cut away beneath: drawn in black in its mask. + const markShapes: { box: Box; line?: NoteSegment; cut(): SVGElement }[] = regions.size === 0 ? [] : [ + ...scene.boxes.flatMap(({ item, bounds }) => { + const type = item.mark?.marktype; + if (type !== 'rect' && type !== 'symbol' && type !== 'arc' && type !== 'shape' && type !== 'path') return []; + if ((typeof item.opacity === 'number' ? item.opacity : 1) < 0.5 || !paint(item.fill)) return []; + // Structure (a map's water, its land) is the ground a wash lies on, not a mark it is cut from. + if (item.datum?.[INTERACTION_KEY] === null) return []; + const box = toBox(boxOf(bounds)); + return [{ + box, + cut: () => type === 'symbol' + ? svg('ellipse', { cx: box.x + box.width / 2, cy: box.y + box.height / 2, rx: box.width / 2, ry: box.height / 2, fill: '#000' }) + : svg('rect', { x: box.x, y: box.y, width: box.width, height: box.height, fill: '#000' }), + }]; + }), + ...segments.map((line) => ({ + box: { x: Math.min(line.a.x, line.b.x), y: Math.min(line.a.y, line.b.y), width: Math.abs(line.b.x - line.a.x), height: Math.abs(line.b.y - line.a.y) }, + line, + cut: () => svg('line', { x1: line.a.x, y1: line.a.y, x2: line.b.x, y2: line.b.y, stroke: '#000', 'stroke-width': 2.5 * scale, 'stroke-linecap': 'round' }), + })), + ]; + // The series a period's caption keeps clear of: the vertices of its lines and areas. + const vertices = items.flatMap((item) => (item.interactionGeometry?.points as PlotPoint[] | undefined)?.map(toLayout) ?? []); + const plotBox = { x: 0, y: 0, width: space.plotWidth, height: space.plotHeight }; + const facets = facetPlotFrames(view); + const panels: Box[] = facets.length ? facets : [plotBox]; + for (const [name, region] of regions) { + // On a map the region is its box as the projection draws it, cut at the plot. + const geo = geoRegionOf(region); + if (geo && 'problem' in geo) { + problems.set(name, geo.problem); + continue; + } + const { spans, problem } = geo ? { spans: { x: [0, 0], y: [0, 0] } as Partial>, problem: undefined } : spansOf(region); + if (problem || !spans) { + problems.set(name, problem ?? 'the region names no x or y stretch.'); + continue; + } + // Anywhere else it is shaded in every plot panel (one, or each facet's), cut at that panel. + const placed = geo + ? [{ shaded: intersectBox(geo.bounds, plotBox), panel: plotBox }].filter(({ shaded }) => shaded.width > 0 && shaded.height > 0) + : regionPanelBoxes(spans, panels); + if (placed.length === 0) continue; + const colour = region.color ?? regionColor(regionColours, [...backdrop, ...markInks], background, design?.accent, design?.palette); + if (!region.color) regionColours.push(colour); + // Over an area, or cells that tile the plot, a wash under the marks would not be seen. + const layerOver = region.layer ? region.layer === 'over' : overArea || overTiles; + const opacity = region.opacity ?? (overArea || overTiles ? 0.18 : 0.16); + for (const { shaded: inPlot } of placed) { + const shaded = toBox(inPlot); + // A map region's path is drawn in the plot's px, scaled into the layout inside a group, so + // the mask set on the group is read in the layout as the rect's is. + const rect = geo + ? svg('g', { 'data-flint-region': name }) + : svg('rect', { x: shaded.x, y: shaded.y, width: shaded.width, height: shaded.height, fill: colour, 'fill-opacity': opacity, 'data-flint-region': name }); + if (geo) rect.append(svg('path', { d: geo.d, transform: `translate(${origin.x},${origin.y}) scale(${scale})`, fill: colour, 'fill-opacity': opacity })); + if (layerOver && geo) { + // Over the marks, a map region is still cut at the plot. + const id = `flint-region-mask-${maskSequence += 1}`; + const mask = svg('mask', { id, maskUnits: 'userSpaceOnUse', x: shaded.x, y: shaded.y, width: shaded.width, height: shaded.height }); + mask.append(svg('rect', { x: shaded.x, y: shaded.y, width: shaded.width, height: shaded.height, fill: '#fff' })); + rect.setAttribute('mask', `url(#${id})`); + ink.svg.prepend(mask, rect); + } else if (layerOver) ink.svg.prepend(rect); + else { + // Under the marks: the wash is cut away wherever a mark or a line is drawn, so they read over it. + const id = `flint-region-mask-${maskSequence += 1}`; + const mask = svg('mask', { id, maskUnits: 'userSpaceOnUse', x: shaded.x, y: shaded.y, width: shaded.width, height: shaded.height }); + mask.append(svg('rect', { x: shaded.x, y: shaded.y, width: shaded.width, height: shaded.height, fill: '#fff' })); + for (const shape of markShapes) { + if (overlapArea(shape.box, shaded) <= 0 && !(shape.line && segmentTouches(shape.line, shaded))) continue; + mask.append(shape.cut()); + } + rect.setAttribute('mask', `url(#${id})`); + wash.svg.append(mask, rect); + } + } + if (!region.text) continue; + // One caption, on the first panel's wash. + const shaded = toBox(placed[0].shaded); + const widths = [...noteWrapWidths(region.text, (text) => measure(text) / scale), + Math.max(60, shaded.width / scale * 0.65), Math.max(fontSize * 3, shaded.width / scale - 12)]; + const layouts = layoutsFor(region.text, widths); + const caption = placeRegionCaption({ + region: shaded, axes: { x: !!spans.x, y: !!spans.y }, layouts, plot: toBox(placed[0].panel), canvas, obstacles, segments, vertices, + ...(region.placement ? { placement: region.placement } : {}), + }); + if (!caption) continue; + const within = overlapArea(caption.box, shaded) >= caption.box.width * caption.box.height * 0.5; + const tint = within ? over(colour, background, opacity) : background; + // A caption on the wash reads on it as it is: a halo would be a coloured smudge where it leaves the wash. + const halo = overlapArea(caption.box, shaded) > 0 ? undefined : background; + drawCaption(caption, layouts, readableShade(colour, tint, 4.5), halo, neutralInk(background)); + } + + // Enclosures: each target a group, one outline each, their caption shared. + const index = new Map(); + for (const item of items) { + if (item.mark?.marktype === 'text') continue; + const key = keyOf(item.datum); + if (!key) continue; + const list = index.get(key); + if (list) list.push(item); + else index.set(key, [item]); + } + for (const [name, enclosure] of enclosures) { + const groups = enclosure.targets.map((target) => { + const found = new Set(); + for (const element of target.elements) { + for (const key of semanticElementRenderKeys(element)) { + const plain = key.endsWith(PATH_KEY_SUFFIX) ? key.slice(0, -PATH_KEY_SUFFIX.length) : key; + for (const item of index.get(plain) ?? []) found.add(item); + } + } + // The data marks, not the furniture drawn with them: a waterfall's connectors, a value label. + const drawn = [...found]; + const data = drawn.filter((item) => !['rule', 'text'].includes(item.mark?.marktype)); + return data.length > 0 ? data : drawn; + }).filter((group) => group.length > 0); + if (groups.length === 0) { + problems.set(name, 'the enclosure\'s targets match no drawn mark.'); + continue; + } + const marksOf = (group: readonly any[]): EnclosedMark[] => group.map((item) => { + const type = item.mark?.marktype; + const box = toBox(boxOf(item.bounds)); + // A line's stretch is enclosed along its vertices; an area band by its box, as Blabber's are. + const points = type === 'line' || type === 'trail' ? item.interactionGeometry?.points as PlotPoint[] | undefined : undefined; + if (points && points.length >= 2) return { role: 'other', box, points: points.map(toLayout) }; + if (type === 'symbol') return { role: 'point', box, radius: Math.max(box.width, box.height) / 2 }; + if (type === 'rect') return { role: tiled(item.mark) ? 'cell' : 'bar', box }; + if (type === 'arc' && [item.x, item.y, item.outerRadius, item.startAngle, item.endAngle].every((value) => typeof value === 'number')) { + const centre = toLayout({ x: item.x, y: item.y }); + return { + role: 'other', box, + sector: { + cx: centre.x, cy: centre.y, inner: (item.innerRadius ?? 0) * scale, outer: item.outerRadius * scale, + start: item.startAngle, end: item.endAngle, + }, + }; + } + return { role: 'other', box }; + }); + const groupMarks = groups.map(marksOf); + const all = groupMarks.flat(); + const shape = enclosure.shape ?? defaultEnclosureShape(all); + const members = new Set(groups.flat()); + const siblings = items.filter((item) => item.mark?.marktype === 'rect' && !members.has(item) + && groups.some((group) => group.some((member) => member.mark === item.mark))).map((item) => toBox(boxOf(item.bounds))); + const outlines = groupMarks.map((marks) => enclosureOutline(marks, shape, plot, siblings)) + .filter((outline): outline is EnclosureOutline => outline !== undefined); + if (outlines.length === 0) continue; + const flat = groups.flat(); + // A cluster that shares a colour is outlined in it; any other group in the neutral annotation + // ink. A halo of the page under the outline lets it read on dark bars and cells without a loud hue. + const house = design?.highlight; + const strokeWidth = enclosure.width ?? house?.width ?? ENCLOSURE_STROKE; + const colour = enclosure.color ?? house?.color ?? (all.every((mark) => mark.role === 'point') + ? clusterColor(flat.map((item) => ({ fill: paint(item.fill), stroke: paint(item.stroke) })), background) + : neutralInk(background)); + const drawnLines: NoteSegment[] = []; + for (const outline of outlines) { + ink.svg.append( + svg('path', { + d: outline.d, fill: 'none', stroke: house?.haloColor ?? background, 'stroke-width': (strokeWidth + (house?.haloWidth ?? 2)) * scale, + 'stroke-linejoin': 'round', 'stroke-opacity': 0.85, 'data-flint-enclosure-halo': name, + }), + svg('path', { + d: outline.d, fill: 'none', stroke: colour, 'stroke-width': strokeWidth * scale, + 'stroke-linejoin': 'round', 'data-flint-enclosure': name, + }), + ); + for (let at = 0; at < outline.ring.length; at++) drawnLines.push({ a: outline.ring[at], b: outline.ring[(at + 1) % outline.ring.length] }); + } + segments.push(...drawnLines); + outlineLines.push(...drawnLines); + if (!enclosure.text) continue; + const layouts = layoutsFor(enclosure.text, noteWrapWidths(enclosure.text, (text) => measure(text) / scale)); + // The enclosed marks themselves are the outline's business, not obstacles to its caption. + const enclosed = new Set(flat); + const captionObstacles = obstacles.filter((_, at) => at >= sceneObstacles.length || !enclosed.has(sceneObstacles[at].item)); + const sectors = all.flatMap((mark) => mark.sector ? [mark.sector] : []); + const pie = sectors.length === all.length && sectors.length > 0 + ? { cx: sectors[0].cx, cy: sectors[0].cy, outer: Math.max(...sectors.map((sector) => sector.outer)), angles: sectors.map((sector) => (sector.start + sector.end) / 2) } + : undefined; + const placed = placeEnclosureCaption({ + outlines, layouts, plot, canvas, obstacles: captionObstacles, segments: segments.slice(), ...(pie ? { pie } : {}), + ...(enclosure.connect ? { connect: enclosure.connect } : {}), + }); + if (!placed) continue; + drawCaption(placed, layouts, readableShade(colour, background, 4.5), background, colour); + } + + if (placedCaptions) { + placedCaptions.fixed = outlineLines.length > 0 ? [...captions, { box: { x: 0, y: 0, width: 0, height: 0 }, segments: outlineLines }] : captions; + } + if (wash.svg.childElementCount > 0) { + if (!wash.root.isConnected) container.append(wash.root); + } else wash.root.remove(); + if (ink.svg.childElementCount > 0) { + if (!ink.root.isConnected) container.append(ink.root); + } else ink.root.remove(); + if (getComputedStyle(container).position === 'static') container.style.position = 'relative'; + }; + + return { + render(nextRegions, nextEnclosures) { + regions = nextRegions; + enclosures = nextEnclosures; + draw(); + }, + problems: () => problems, + check: (region) => { + const geo = geoRegionOf(region); + return geo ? ('problem' in geo ? geo.problem : undefined) : spansOf(region).problem; + }, + sync: () => { + if (regions.size > 0 || enclosures.size > 0) draw(); + }, + destroy: () => { + regions = new Map(); + enclosures = new Map(); + detach(); + }, + }; +} + diff --git a/packages/flint-js/src/vegalite/interactions/presentation/overlay-channels.ts b/packages/flint-js/src/vegalite/interactions/presentation/overlay-channels.ts index e82fef55..6825eb3b 100644 --- a/packages/flint-js/src/vegalite/interactions/presentation/overlay-channels.ts +++ b/packages/flint-js/src/vegalite/interactions/presentation/overlay-channels.ts @@ -2,9 +2,32 @@ import type { ChartOverlaySpec } from '../../../core/interaction-contracts'; export type OverlayChannel = 'x' | 'x2' | 'y' | 'y2'; +export type GeoOverlayChannel = 'longitude' | 'latitude' | 'longitude2' | 'latitude2'; + +/** Whether an overlay is placed by longitude and latitude, through a map's projection. */ +export function isGeoOverlay(spec: ChartOverlaySpec): boolean { + const encodings = spec.encodings ?? {}; + return !!(encodings.longitude || encodings.latitude || encodings.longitude2 || encodings.latitude2); +} + +/** + * The places a map overlay reads, or undefined when its mark cannot be drawn from them: a point, a + * text or a line at `longitude`/`latitude`; a rule or a rect between that place and + * `longitude2`/`latitude2`. A map overlay takes no `x` or `y`. + */ +export function geoOverlayChannels(spec: ChartOverlaySpec): readonly GeoOverlayChannel[] | undefined { + const encodings = spec.encodings ?? {}; + if (encodings.x || encodings.y || encodings.x2 || encodings.y2) return undefined; + if (!encodings.longitude || !encodings.latitude) return undefined; + if (spec.mark === 'rule' || spec.mark === 'rect') { + return encodings.longitude2 && encodings.latitude2 ? ['longitude', 'latitude', 'longitude2', 'latitude2'] : undefined; + } + return encodings.longitude2 || encodings.latitude2 ? undefined : ['longitude', 'latitude']; +} /** The channels an overlay projects, or undefined when its mark cannot be drawn from them. */ export function overlayChannels(spec: ChartOverlaySpec): readonly OverlayChannel[] | undefined { + if (isGeoOverlay(spec)) return undefined; const has = (channel: OverlayChannel): boolean => !!spec.encodings[channel]; if (spec.mark !== 'rule' && spec.mark !== 'rect') return has('x') && has('y') ? ['x', 'y'] : undefined; if (has('x') && has('y') && has('x2') && has('y2')) return ['x', 'y', 'x2', 'y2']; diff --git a/packages/flint-js/src/vegalite/interactions/runtime.ts b/packages/flint-js/src/vegalite/interactions/runtime.ts index 3ff15079..07724e74 100644 --- a/packages/flint-js/src/vegalite/interactions/runtime.ts +++ b/packages/flint-js/src/vegalite/interactions/runtime.ts @@ -12,6 +12,7 @@ import { import type { CanvasInteractionDef, ChartOverlaySpec, + RegionAnnotationSpec, ChartUpdate, ChartUpdateOp, ChartUpdatePresenter, @@ -44,7 +45,9 @@ import { keyboardTrigger } from '../../interactive/triggers'; import { normalizeInspectGuideOptions } from '../../interactive/guides'; import { wheelZoomFactor } from '../../interactive/gestures/navigation'; import type { CanvasInteractionEvent, DomainGeometry } from '../../interactive/language/events'; -import type { ChartAnnotation, ChartHiddenValue, ChartStateEntry, DomainValue } from '../../core/interaction-contracts'; +import type { ChartAnnotation, ChartHiddenValue, ChartStateEntry, DomainValue, PresentedAnnotationSpec } from '../../core/interaction-contracts'; +import { EMPHASIS_OPACITY, canonicalUpdateOp, isTextAnnotationOp } from '../../core/interaction-contracts'; +import { DEFAULT_DIM_OPACITY } from '../../interactive/presets/utils'; import type { ChartChangeReport, ChartUpdateApplyOptions } from '../../interactive/types'; import { INTERACTION_KEY, @@ -60,6 +63,7 @@ import { nearestInteractiveSceneItem, sceneItemsUnder, nearestSceneItem, + nearestThinItem, pathHoverPresentationKey, pickBounds, polarFrameFromItems, @@ -68,9 +72,11 @@ import { tolerantInspectHits, indexInspectAcquisition, legendSemanticTarget, + oneMarkHits, renderHit, rendererElement, rendererPlotOrigin, + facetPlotFrames, sceneItems, shapeReadingBounds, vegaRendererOrigin, @@ -82,7 +88,8 @@ import { isInteractiveControlTarget, mountVegaRegionGesture } from './gestures/r import { mountVegaNavigationGesture, resolvedNavigationAxes } from './gestures/navigation'; import { createVegaNavigationController, type NavigationApplyOptions } from './navigation-scale'; import { createVegaGeoNavigationController } from './navigation-geo'; -import { createAnnotationOverlay } from './presentation/annotation-overlay'; +import { createAnnotationOverlay, type PlacedCaption } from './presentation/annotation-overlay'; +import { createMarkupOverlay, type ResolvedEnclosure } from './presentation/markup-overlay'; import { createDragReorderOverlay, eligibleReorderAxesForAxis, @@ -90,12 +97,14 @@ import { } from './presentation/drag-reorder-overlay'; import { createFocusOverlay } from './presentation/focus-overlay'; import { createFreeformOverlay } from './presentation/freeform-overlay'; +import { createHoverDotOverlay, type HoverDot } from './presentation/hover-dot-overlay'; import { createTargetFeedbackOverlay } from './presentation/target-feedback-overlay'; import { createLegendRangeOverlay } from './presentation/legend-range-overlay'; import { createReorderResetControls } from './presentation/reorder-reset-controls'; import { createViewportResetControl } from './presentation/viewport-reset-control'; -import { createInspectGuideOverlay } from './presentation/inspect-guide-overlay'; -import { createDataOverlay, overlayChannels } from './presentation/data-overlay'; +import { createInspectGuideOverlay, inspectValuePanel } from './presentation/inspect-guide-overlay'; +import { createDataOverlay, overlayChannels, type OverlayProjection } from './presentation/data-overlay'; +import { geoOverlayChannels, isGeoOverlay } from './presentation/overlay-channels'; import { buildAccessibleTree, type AccessibleNode } from './accessible-navigation/model'; import { mountAccessibleNavigation } from './accessible-navigation/controller'; import { @@ -107,6 +116,8 @@ import { AXIS_HOVER_STORE, LEGEND_SELECTION_STORE, STYLE_SIGNAL, + DIM_SIGNAL, + DIM_RELATIVE_SIGNAL, } from './stores'; const EMPTY_SEMANTIC_SELECTION_KEY = '__flint_empty_semantic_selection'; @@ -433,12 +444,11 @@ export function longPressMovedBeyond( return Math.hypot(current.x - start.x, current.y - start.y) > tolerance; } -type AnnotationUpdate = Extract; - export interface EffectiveAnnotationEntry { key: string; element: SemanticTarget['elements'][number]; - value: NonNullable; + /** The note as its template presented it: where on the mark it may connect. */ + value: PresentedAnnotationSpec; } function annotationEntryKey(id: string, element: SemanticTarget['elements'][number]): string { @@ -453,7 +463,7 @@ export function effectiveAnnotationEntries(updates: readonly ChartUpdate[]): Eff const entries = new Map(); for (const update of updates) { for (const op of update.ops) { - if (op.op !== 'set-annotation' || 'select' in op.target) continue; + if (!isTextAnnotationOp(op) || 'select' in op.target) continue; const element = op.target.elements[0]; if (!element) continue; const key = annotationEntryKey(update.id, element); @@ -595,6 +605,69 @@ export function supersedeRetainedViewports(retained: Map, e } } +/** + * The baseline tooltip: Vega's own tooltip element. Near a line, rule or point it shows that + * mark's values; elsewhere it `release`s to Vega's exact hover. + */ +export interface ProximityReadout { + show(event: PointerEvent, value: unknown): void; + release(): void; + hide(): void; +} + +/** How far, in renderer px past a line's stroke or a point's edge, the baseline tooltip still reads it. */ +export const PROXIMITY_READOUT_DISTANCE = 6; + +/** + * What the baseline tooltip reads from a line, rule or point near the pointer: the values and + * where they sit. A line's segment reads at the vertex nearer along it: the series' value at that x. + */ +export function proximityTooltip(item: any, point: { x: number; y: number }): { value: unknown; dot?: HoverDot } { + const ends = item.interactionGeometry?.points as readonly { x: number; y: number }[] | undefined; + const marktype = item.mark?.marktype; + if ((marktype === 'line' || marktype === 'area' || marktype === 'trail') && ends && ends.length >= 2) { + const items: any[] = item.mark?.items ?? []; + const index = items.findIndex((candidate) => candidate.datum === item.datum); + const [a, b] = [ends[0], ends[ends.length - 1]]; + const dx = b.x - a.x; + const dy = b.y - a.y; + const along = dx * dx + dy * dy === 0 ? 0 : ((point.x - a.x) * dx + (point.y - a.y) * dy) / (dx * dx + dy * dy); + const nearerEnd = along > 0.5 && index >= 0 && items[index + 1] !== undefined; + const vertex = nearerEnd ? items[index + 1] : items[index] ?? item; + const at = nearerEnd ? b : a; + const color = [item.stroke, vertex?.stroke, item.fill].find((paint) => typeof paint === 'string' && paint !== 'transparent'); + return { value: vertex?.tooltip ?? item.tooltip, dot: { x: at.x, y: at.y, color, lineWidth: typeof item.strokeWidth === 'number' ? item.strokeWidth : undefined } }; + } + if (marktype === 'symbol' && typeof item.x === 'number' && typeof item.y === 'number') { + // Vega draws a circle symbol of `size` with radius √size / 2, its stroke centred on that edge. + const radius = Math.sqrt(typeof item.size === 'number' ? item.size : 64) / 2; + const paint = (value: unknown): string | undefined => + typeof value === 'string' && value !== 'transparent' && value !== 'none' ? value : undefined; + const stroke = paint(item.stroke) && typeof item.strokeWidth === 'number' && item.strokeWidth > 0 + ? { stroke: paint(item.stroke), strokeWidth: item.strokeWidth } : {}; + return { value: item.tooltip, dot: { x: item.x, y: item.y, radius, color: paint(item.fill) ?? paint(item.stroke), ...stroke } }; + } + return { value: item.tooltip }; +} + +/** + * A tooltip value with an overlong raw decimal trimmed to about four significant digits + * (1.34216696571 → 1.342); anything Vega-Lite formatted, and every other value, is left as it is. + */ +export function readableTooltip(value: unknown): unknown { + const trim = (text: unknown): unknown => { + if (typeof text !== 'string' || !/^-?\d+\.\d{5,}$/.test(text)) return text; + const number = Number(text); + const whole = Math.max(1, Math.floor(Math.log10(Math.abs(number) || 1)) + 1); + const fixed = number.toFixed(Math.max(0, 4 - whole)); + return fixed.includes('.') ? fixed.replace(/\.?0+$/, '') : fixed; + }; + if (value && typeof value === 'object' && !Array.isArray(value)) { + return Object.fromEntries(Object.entries(value as Record).map(([key, entry]) => [key, trim(entry)])); + } + return trim(value); +} + export function mountVegaInteractions( view: any, container: HTMLElement, @@ -610,6 +683,7 @@ export function mountVegaInteractions( assisted: import('../../interactive/types').TargetFeedbackOptions | false; keyboard: import('../../interactive/types').TargetFeedbackOptions | false; } | undefined = undefined, + readout: ProximityReadout | undefined = undefined, ): VegaInteractionController { const canvasInteractions = interactions.filter(isCanvasInteraction); const clickInteractions = resolve @@ -664,7 +738,7 @@ export function mountVegaInteractions( resolveAssistDistance(eligible, assistDistance); const retainedUpdates = new Map(); const previewUpdates = new Map(); - const hiddenLegendDomains = new Map(); + const hiddenLegendDomains = new Map(); const changeListeners = new Set<(change: ChartChangeReport) => void>(); let lastPreviewKey: string | undefined; let hoverCueActive = false; @@ -748,15 +822,38 @@ export function mountVegaInteractions( coordinateSpace, containerLayoutSize, }); + const hoverDot = createHoverDotOverlay({ container, coordinateSpace, containerLayoutSize }); const legendRangeOverlay = createLegendRangeOverlay({ container, coordinateSpace, containerLayoutSize }); + // The captions the chart's notes stand in, one slot per note in the order they came: each + // keeps clear of those before it. + const placedCaptions: { slots: (PlacedCaption | undefined)[]; fixed?: PlacedCaption[] } = { slots: [] }; const annotationOverlayOptions = { view, container, coordinateSpace, containerLayoutSize, annotationMarkType: plan.annotationMarkType, + placedCaptions, + ...(plan.annotationDesign ? { design: plan.annotationDesign } : {}), + // A map (it has a projection) keeps its notes inside the plot it is panned and zoomed in. + containWithinPlot: Boolean(plan.overlayProjectionSignal), }; const annotationOverlays = new Map>(); + // Regions and enclosures: drawn before the notes, which keep clear of their captions. + // A map's projection as drawn now, through which overlays and regions placed by longitude and latitude go. + const overlayProjection = plan.overlayProjectionSignal + ? (): OverlayProjection | undefined => { + const projection = view.signal(plan.overlayProjectionSignal!); + return typeof projection === 'function' ? projection : undefined; + } + : undefined; + const markupOverlay = createMarkupOverlay({ + view, container, coordinateSpace, containerLayoutSize, placedCaptions, + ...(overlayProjection ? { geoProjection: overlayProjection } : {}), + ...(plan.annotationDesign ? { design: plan.annotationDesign } : {}), + scales: { ...(plan.overlayScales?.x ? { x: plan.overlayScales.x } : {}), ...(plan.overlayScales?.y ? { y: plan.overlayScales.y } : {}) }, + axisValue: (axis, value) => axisValue(axis, value), + }); const clearAnnotations = (): void => { for (const overlay of annotationOverlays.values()) overlay.clear(); }; @@ -788,6 +885,7 @@ export function mountVegaInteractions( const dataOverlay = createDataOverlay({ view, container, scales: plan.overlayScales ?? {}, coordinateSpace, containerLayoutSize, clipToPlot: Object.keys(plan.navigationAxes ?? {}).length > 0, + ...(overlayProjection ? { geoProjection: overlayProjection } : {}), }); const initialDataRows = plan.initialDataRows ?? plan.sourceRecords; // Cached by identity: a retained update re-rendered must not swap in a fresh copy of the same rows. @@ -895,8 +993,9 @@ export function mountVegaInteractions( } return entries; }; + // A dimmed legend value is still drawn: it is not reported as hidden. const hiddenValues = (): ChartHiddenValue[] => [...hiddenLegendDomains.values()] - .filter(({ legend }) => legend.domain.kind === 'value') + .filter(({ legend, dimmed }) => !dimmed && legend.domain.kind === 'value') .map(({ legend }) => ({ channel: legend.channel ?? legend.field ?? '', value: legend.domain.kind === 'value' ? legend.domain.value : undefined, @@ -906,7 +1005,7 @@ export function mountVegaInteractions( for (const id of new Set([...retainedUpdates.keys(), ...previewUpdates.keys()])) { const update = mergeRetainedPreview(retainedUpdates.get(id), previewUpdates.get(id)); for (const op of update?.ops ?? []) { - if (op.op !== 'set-annotation' || !op.value) continue; + if (op.op !== 'annotate-text' || !op.value) continue; const element = 'select' in op.target ? undefined : op.target.elements[0]; const inView = element ? annotationOverlays.get(annotationEntryKey(id, element))?.inView() : undefined; annotations.push({ @@ -995,7 +1094,7 @@ export function mountVegaInteractions( }; /** Targets resolved through a line's last point, which a note marks at its point. */ const lastPointTargets = new WeakSet(); - const resolveUpdateTarget = (target: UpdateTarget): SemanticTargetRef | null => { + const resolveUpdateTarget = (target: UpdateTarget, oneMark = false): SemanticTargetRef | null => { if (!('select' in target)) { if (target.visual.kind === 'axis') { const elements = target.elements.filter((element) => { @@ -1040,6 +1139,8 @@ export function mountVegaInteractions( if (!matches) return null; const all = allHits(); let hits = all.filter((hit) => matches(hit.datum)); + // A note anchors to one mark: on a line drawn with points, the point, not the segment from it. + if (oneMark) hits = oneMarkHits(hits, target.select.visual?.kind === 'path'); // The final point of a line or area starts no segment, so it is found as the end of the segment before it. const startKeys = new Set(all.map((hit) => hit.datum[INTERACTION_KEY])); const lastPoints = (): RenderHit[] => all.flatMap((hit): RenderHit[] => { @@ -1065,6 +1166,17 @@ export function mountVegaInteractions( return resolved; }; + /** Whether a map overlay's rows each name a place for every channel its mark reads. */ + const geoOverlayProjects = (spec: ChartOverlaySpec): boolean => { + const channels = geoOverlayChannels(spec); + if (!channels || spec.data.values.length === 0) return false; + return spec.data.values.every((row) => channels.every((channel) => { + const value = row[spec.encodings[channel]!.field]; + const number = Number(value); + return value !== null && value !== '' && Number.isFinite(number) && (!channel.startsWith('latitude') || Math.abs(number) <= 90); + })); + }; + const overlayProjects = (spec: ChartOverlaySpec | null): boolean => { if (spec === null) return true; const channels = overlayChannels(spec); @@ -1086,7 +1198,7 @@ export function mountVegaInteractions( const unsupportedOps: ChartUpdateOp['op'][] = []; let resolvedTargets = 0; const ops: ChartUpdateOp[] = []; - for (const op of update.ops) { + for (const op of update.ops.map(canonicalUpdateOp)) { if (op.op === 'set-style') { const targets = op.targets.flatMap((target) => { const resolved = resolveUpdateTarget(target); @@ -1098,14 +1210,30 @@ export function mountVegaInteractions( return [resolved]; }); if (targets.length > 0 || op.targets.length === 0) ops.push({ ...op, targets }); - } else if (op.op === 'set-annotation' && op.value !== null) { + } else if (op.op === 'annotate-text' && op.value !== null) { // A note anchors to one mark, which a set does not name. - const target = 'select' in op.target && isWhereSelector(op.target) ? null : resolveUpdateTarget(op.target); + const target = 'select' in op.target && isWhereSelector(op.target) ? null : resolveUpdateTarget(op.target, true); if (!target || target.elements.length !== 1) unresolvedTargets.push(op.target); else { resolvedTargets += 1; ops.push({ ...op, target, value: lastPointTargets.has(target) ? { ...op.value, anchor: 'point' } : op.value }); } + } else if (op.op === 'annotate-region' && op.value !== null) { + // A region is read off the chart's scales: it shades only where they name its stretch. + const problem = markupOverlay.check(op.value); + if (problem) unsupportedOps.push(op.op); + else ops.push(op); + } else if (op.op === 'annotate-enclosure' && op.value !== null) { + const targets = op.value.targets.flatMap((target) => { + const resolved = resolveUpdateTarget(target); + if (!resolved || resolved.elements.length === 0) { + unresolvedTargets.push(target); + return []; + } + resolvedTargets += resolved.elements.length; + return [resolved]; + }); + if (targets.length > 0) ops.push({ ...op, value: { ...op.value, targets } }); } else if (op.op === 'set-viewport') { const bound = (axis: 'x' | 'y') => { const domain = op.value[axis]; @@ -1119,6 +1247,12 @@ export function mountVegaInteractions( if (supported.unsupported) unsupportedOps.push(op.op); if (supported.op) ops.push(supported.op); } else if (op.op === 'set-overlay') { + // A map's overlay is placed by longitude and latitude through its projection. + if (op.value !== null && isGeoOverlay(op.value)) { + if (!overlayProjection || !geoOverlayProjects(op.value)) unsupportedOps.push(op.op); + else ops.push(op); + continue; + } const overlay = { ...op, value: withTemporalOverlayRows(op.value) }; if (!plan.overlayScales?.x || !plan.overlayScales?.y || !overlayProjects(overlay.value)) unsupportedOps.push(op.op); else ops.push(overlay); @@ -1188,11 +1322,21 @@ export function mountVegaInteractions( const activeHiddenLegendDomains = new Set(); const stylesByKey: Record> = {}; + // A muted legend value's marks: its rows carry no legend element's render keys, so they are + // found by value once every update is read. + const mutedLegendValues = new Map>(); + let mutedLegendOpacity: number | undefined; const overlays = new Map(); const axisStyles: { value: AxisTargetValue; style: import('../../core/interaction-contracts').StyleSpec }[] = []; let dataRows = initialDataRows; let hostRows: readonly Record[] | undefined; let emptyEmphasisActive = false; + // How far the marks outside an emphasis recede: the deepest level any active emphasis asks for. + let recedeTo: number | undefined; + let recedeRelative = true; + const recede = (opacity: number, relative: boolean) => { + if (recedeTo === undefined || opacity < recedeTo) { recedeTo = opacity; recedeRelative = relative; } + }; const freeformOverlays = new Map(); selectedElements.clear(); emphasizedRenderKeys.clear(); @@ -1219,6 +1363,27 @@ export function mountVegaInteractions( dataRows = preparedRows(op.value.rows); continue; } + if (op.op === 'set-style' && op.value.state === 'muted' && op.value.visible !== false) { + // A muted legend value fades its legend entry as a hidden one does; its marks take the style's opacity. + for (const target of op.targets) { + if ('select' in target || target.visual.kind !== 'legend') continue; + for (const element of target.elements) { + const legend = element.value as LegendTargetValue; + if (legend.domain?.kind !== 'value' || !legend.channel) continue; + activeHiddenLegendDomains.add(legendDomainIdentity(legend)); + hiddenLegendDomains.set(`${legend.channel}:${String(legend.domain.value)}`, { + legend, opacity: op.value.mutedOpacity ?? 0.35, dimmed: true, + }); + const field = legend.field ?? plan.legendFields?.[legend.channel]; + if (field && op.value.opacity !== undefined) { + const values = mutedLegendValues.get(field) ?? new Set(); + values.add(String(legend.domain.value)); + mutedLegendValues.set(field, values); + mutedLegendOpacity = Math.min(mutedLegendOpacity ?? 1, op.value.opacity); + } + } + } + } if (op.op === 'set-style' && op.value.visible === false) { for (const target of op.targets) { if ('select' in target) continue; @@ -1244,7 +1409,21 @@ export function mountVegaInteractions( } } } + if (op.op === 'annotate-text' && op.value?.highlight === 'exclusive' && !('select' in op.target)) { + // An exclusive note recedes every other mark, as an exclusive emphasis does. + recede(EMPHASIS_OPACITY.exclusive, true); + for (const element of op.target.elements) { + for (const key of semanticElementRenderKeys(element)) { + selectedElements.set(key, element); + emphasizedRenderKeys.add(key); + } + } + } if (op.op === 'set-style') { + if (op.value.state === 'emphasized' || op.value.state === 'focused') { + if (op.value.mutedOpacity !== undefined) recede(op.value.mutedOpacity, false); + else recede(EMPHASIS_OPACITY[op.value.emphasis ?? 'light'] ?? EMPHASIS_OPACITY.light, true); + } if (op.targets.length === 0 && (op.value.state === 'emphasized' || op.value.state === 'focused')) { emptyEmphasisActive = true; @@ -1343,8 +1522,22 @@ export function mountVegaInteractions( } if (keys.length === 0) selectedLegend = null; // A navigation-only chart compiles without the selection stores. + if (mutedLegendOpacity !== undefined) { + for (const item of sceneItems(view)) { + const datum = item.datum as Record | undefined; + const key = datum?.[INTERACTION_KEY]; + if (key === undefined || key === null) continue; + const muted = [...mutedLegendValues].some(([field, values]) => + datum![field] !== undefined && values.has(String(datum![field]))); + if (!muted) continue; + const styleKey = String(key); + stylesByKey[styleKey] = { ...stylesByKey[styleKey], opacity: mutedLegendOpacity }; + } + } if (plan.semanticStores !== false) { view.signal(STYLE_SIGNAL, stylesByKey); + view.signal(DIM_SIGNAL, recedeTo ?? plan.dimOpacity ?? DEFAULT_DIM_OPACITY); + view.signal(DIM_RELATIVE_SIGNAL, recedeTo !== undefined && recedeRelative); view.change( INTERACTION_STORE, changeset().remove(() => true).insert(emptyEmphasisActive && keys.length === 0 @@ -1410,8 +1603,22 @@ export function mountVegaInteractions( renderLegendRange(); reorderResetControls.layout(); viewportResetControl.layout(); + const regions = new Map(); + const enclosures = new Map(); + for (const update of displayUpdates) { + for (const op of update.ops) { + if (op.op === 'annotate-region') { + if (op.value === null) regions.delete(op.name); + else regions.set(op.name, op.value); + } else if (op.op === 'annotate-enclosure') { + if (op.value === null) enclosures.delete(op.name); + else enclosures.set(op.name, op.value as ResolvedEnclosure); + } + } + } + markupOverlay.render(regions, enclosures); const annotations = effectiveAnnotationEntries(displayUpdates) - .filter((entry) => entry.value.text && entry.value.candidates); + .filter((entry) => entry.value.text !== undefined && entry.value.candidates); const annotationKeys = new Set(annotations.map((entry) => entry.key)); for (const [key, overlay] of annotationOverlays) { if (annotationKeys.has(key)) continue; @@ -1593,10 +1800,34 @@ export function mountVegaInteractions( return domain ? { ...base, geometry: { ...base.geometry, domain } } : base; }; /** A frame of a host-requested viewport tween reports like a zoom or reset gesture. */ - const emitTransitionFrame = (phase: 'preview' | 'commit', operation: 'zoom' | 'reset'): void => { + // While a tween moves the scene as drawn, what is drawn over the chart stands where the scene was: + // it is hidden, and shown again once the last frame has placed it. + let hiddenOverlays: Map | undefined; + const hideOverlays = (): void => { + hiddenOverlays ??= new Map(); + const renderer = rendererElement(container); + for (const child of Array.from(container.children) as (HTMLElement | SVGElement)[]) { + if (hiddenOverlays.has(child) || (renderer && (child === renderer || child.contains(renderer)))) continue; + hiddenOverlays.set(child, child.style.visibility); + child.style.visibility = 'hidden'; + } + }; + const showOverlays = (): void => { + if (!hiddenOverlays) return; + for (const [element, visibility] of hiddenOverlays) element.style.visibility = visibility; + hiddenOverlays = undefined; + }; + const emitTransitionFrame = (phase: 'preview' | 'commit', operation: 'zoom' | 'reset', moved?: 'moved'): void => { + if (moved) { + // The scene was moved, not drawn: no overlay or reading follows it until the commit. + hideOverlays(); + return; + } // A tween moves the scales without a render pass, so overlays re-project on each frame. - if (phase === 'commit') syncOverlays(); - else projectOverlays(); + if (phase === 'commit') { + syncOverlays(); + showOverlays(); + } else projectOverlays(); if (!navigationInteraction) return; const base = toCanvasInteractionEvent( { type: 'navigation', phase, operation, axes: 'xy' }, @@ -2119,9 +2350,30 @@ export function mountVegaInteractions( } return formatter; }; + // Hover reads only over the plot (a facet's panels when faceted): never from the legend, the + // axes or the padding. The plot point `localPoint` gives is clamped to the plot, so this reads + // the pointer unclamped. + const overPlotArea = (event: PointerEvent): boolean => { + const space = coordinateSpace(); + const root = clientToRendererPoint({ x: event.clientX, y: event.clientY }, space); + const point = { x: root.x - space.originX, y: root.y - space.originY }; + const panels = facetPlotFrames(view); + if (panels.length > 0) { + return panels.some((panel) => point.x >= panel.x && point.x <= panel.x + panel.width + && point.y >= panel.y && point.y <= panel.y + panel.height); + } + return point.x >= 0 && point.x <= space.plotWidth && point.y >= 0 && point.y <= space.plotHeight; + }; + let inspectOutside = false; const inspectHandler = (event: MouseEvent): void => { if (inspectInteractions.length === 0) return; const point = localPoint(event as unknown as PointerEvent); + if (!overPlotArea(event as unknown as PointerEvent)) { + if (!inspectOutside) inspectLeave(); + inspectOutside = true; + return; + } + inspectOutside = false; const space = coordinateSpace(); const items = sceneItems(view); const polarFrame = polarFrameFromItems(items, point); @@ -2159,9 +2411,14 @@ export function mountVegaInteractions( ?? plan.overlayScales?.[indexAxis] : undefined; const indexScale = indexScaleName ? view.scale(indexScaleName) : undefined; + // Scales read a facet panel's own px: a position in the chart is read less its panel's corner. + const panels = facetPlotFrames(view); + const pointerPanel = panels.find((panel) => point.x >= panel.x && point.x <= panel.x + panel.width + && point.y >= panel.y && point.y <= panel.y + panel.height); + const indexOffset = pointerPanel?.[indexAxis] ?? 0; const discreteCoordinates = !continuousIndex && indexScale?.domain ? indexScale.domain().map((value: unknown) => - Number(indexScale(value)) + (Number(indexScale.bandwidth?.()) || 0) / 2) + indexOffset + Number(indexScale(value)) + (Number(indexScale.bandwidth?.()) || 0) / 2) : undefined; const indexAcquisition = indexPolicy && !polarFrame ? indexInspectAcquisition( @@ -2208,14 +2465,20 @@ export function mountVegaInteractions( return ''; }; const valueLabels = indexPolicy!.displayValue && valueScale?.invert - ? indexAcquisition.valueCoordinates.map((coordinate, index) => ({ - text: `${inspectValueText(valueScale.invert(coordinate))}${outOfView(coordinate)}`, - color: indexAcquisition.valueColors?.[index], - })) + ? indexAcquisition.valueCoordinates.map((coordinate, index) => { + const panel = panels.length + ? inspectValuePanel(panels, indexAxis, indexAcquisition.coordinate, coordinate) + : undefined; + const local = coordinate - (panel?.[valueAxis] ?? 0); + return { + text: `${inspectValueText(valueScale.invert(local))}${outOfView(local)}`, + color: indexAcquisition.valueColors?.[index], + }; + }) : undefined; const indexLabel = indexPolicy!.displayValue && indexField && indexAcquisition.valueCoordinates.length > 0 ? inspectIndexText( - indexScale, indexAcquisition.coordinate, continuousIndex, indexAcquisition.snapped, indexField.field, + indexScale, indexAcquisition.coordinate - indexOffset, continuousIndex, indexAcquisition.snapped, indexField.field, ) : undefined; inspectGuideOverlay.renderAxes(guidePoint, indexAxis, guide.style, indexLabel); @@ -2306,6 +2569,38 @@ export function mountVegaInteractions( container.addEventListener('contextmenu', inspectContext); } } + // The baseline tooltip: the nearest mark's values, whether or not the pointer is exactly on it. + const readoutMove = (event: PointerEvent): void => { + if (!readout) return; + if (event.buttons !== 0) return readoutLeave(); + const point = localPoint(event); + if (!overPlotArea(event)) { + hoverDot.clear(); + readout.release(); + return; + } + const item = nearestThinItem(view, point, PROXIMITY_READOUT_DISTANCE); + const read = item ? proximityTooltip(item, point) : undefined; + const value = read?.value; + if (value === undefined || value === null || value === '') { + hoverDot.clear(); + readout.release(); + return; + } + readout.show(event, readableTooltip(value)); + if (read?.dot) hoverDot.render(read.dot); + else hoverDot.clear(); + }; + const readoutLeave = (): void => { + hoverDot.clear(); + readout?.hide(); + }; + const readoutDown = readoutLeave; + if (readout) { + container.addEventListener('pointermove', readoutMove); + container.addEventListener('pointerleave', readoutLeave); + container.addEventListener('pointerdown', readoutDown); + } const pointerTarget = (event: MouseEvent, eligible: readonly CanvasInteractionDef[]) => { const point = localPoint(event as unknown as PointerEvent); const item = nearestSceneItem(view, point, assistDistanceFor(eligible)); @@ -3108,8 +3403,10 @@ export function mountVegaInteractions( const projectOverlays = (): void => { renderPathFocus(); renderLegendRange(); - for (const overlay of annotationOverlays.values()) overlay.sync(); + // The data overlay first: captions keep off its words where they now stand. dataOverlay.sync(); + markupOverlay.sync(); + for (const overlay of annotationOverlays.values()) overlay.sync(); regionGesture?.sync(); reorderResetControls.layout(); }; @@ -3178,6 +3475,13 @@ export function mountVegaInteractions( cancelPendingDismiss(); if (clickNoneResets) view.removeEventListener('click', resetOnClick); if (doubleClickResets) container.removeEventListener('dblclick', resetOnDoubleClick); + if (readout) { + container.removeEventListener('pointermove', readoutMove); + container.removeEventListener('pointerleave', readoutLeave); + container.removeEventListener('pointerdown', readoutDown); + hoverDot.destroy(); + readout.hide(); + } if (inspectInteractions.length > 0) { container.removeEventListener('pointermove', inspectHandler); container.removeEventListener('pointerleave', inspectLeave); @@ -3199,6 +3503,7 @@ export function mountVegaInteractions( legendRangeOverlay.destroy(); for (const overlay of annotationOverlays.values()) overlay.destroy(); annotationOverlays.clear(); + markupOverlay.destroy(); inspectGuideOverlay.destroy(); dragPreviewOverlay.destroy(); freeformOverlay.destroy(); diff --git a/packages/flint-js/src/vegalite/interactions/stores.ts b/packages/flint-js/src/vegalite/interactions/stores.ts index 220a13fc..d7c73bb9 100644 --- a/packages/flint-js/src/vegalite/interactions/stores.ts +++ b/packages/flint-js/src/vegalite/interactions/stores.ts @@ -12,6 +12,10 @@ export const LEGEND_HOVER_STORE = '__flint_legend_hover_store'; export const AXIS_HOVER_STORE = '__flint_axis_hover_store'; export const LEGEND_SELECTION_STORE = '__flint_legend_selection_store'; export const STYLE_SIGNAL = '__flint_style_by_key'; +/** The opacity the marks outside an emphasis recede to, set each render from the emphasis level. */ +export const DIM_SIGNAL = '__flint_dim_opacity'; +/** Whether DIM_SIGNAL scales each mark's own opacity (an emphasis level) or replaces it (a stated `mutedOpacity`). */ +export const DIM_RELATIVE_SIGNAL = '__flint_dim_relative'; export const INTERACTION_STORES: readonly string[] = [ INTERACTION_STORE, diff --git a/packages/flint-js/src/vegalite/interactive.ts b/packages/flint-js/src/vegalite/interactive.ts index 6ce99473..68d04633 100644 --- a/packages/flint-js/src/vegalite/interactive.ts +++ b/packages/flint-js/src/vegalite/interactive.ts @@ -1,7 +1,9 @@ import type { ViewNode } from '../core/views'; import { applyCategoryViewports, resolveCategoryViewport } from '../core/filter-overflow'; -import type { CategoryViewport, ChartAssemblyInput } from '../core/types'; -import { convertTemporalData, temporalFieldValue } from '../core/resolve-semantics'; +import type { AssembleOptions, CategoryViewport, ChartAssemblyInput } from '../core/types'; +import { baselineOn, type InteractionDefaults } from '../core/interaction-spec'; +import { baselineInteractions } from './interactions/baseline'; +import { temporalFieldValue } from '../core/resolve-semantics'; import { createChangeFilter } from '../interactive/chart-state'; import { currentFilters, isFilterControls } from '../interactive/filter-controls'; import { createFloatingPanel } from '../interactive/floating-panel'; @@ -9,7 +11,10 @@ import { isCanvasInteraction, type ChartState, type InteractionContext, type Int import type { InteractiveRendererAdapter, TargetFeedbackOptions, ViewportState } from '../interactive/types'; import { openVegaLiteSession, type Replanned } from './assemble'; import { canvasFurnitureMarkup, readCanvasFurniture, readCanvasPatterns, type CanvasPattern } from './canvas-furniture'; -import { enableGuideLabelTooltips, planTemporalTickValues } from './instantiate-spec'; +import { enableGuideLabelTooltips, planTemporalTickValues, skipLabelExpr, skipLabelsOf, vlListTooltipFields } from './instantiate-spec'; +import { onRoundInterval, sequenceKindOf } from '../core/label-sequence'; +import { RAIL_ROW_GAP, RAIL_THICKNESS } from '../interactive/viewport-rail'; +import { growPadding } from './theme'; import { addVegaLiteInteractions, collectVegaAxisTargets, @@ -32,7 +37,7 @@ import { vegaLiteTemporalAxisPlans, type LiveLayoutPlanner, } from './interactions/live-layout'; -import { mountVegaInteractions } from './interactions/runtime'; +import { mountVegaInteractions, readableTooltip } from './interactions/runtime'; import { advanceLiveValues, bindLiveValues, LIVE_VALUES_SIGNAL, liveValuesChange } from './live-values'; import { readDrawnLayout } from './drawn-layout'; import { vegaRendererOrigin } from './interactions/hit-adapter'; @@ -53,17 +58,41 @@ export function mountedInteractionList( return kept ? [kept] : []; }); } -import { INTERACTION_STORES } from './interactions/stores'; +import { INTERACTION_KEY, INTERACTION_STORES } from './interactions/stores'; import { compile } from 'vega-lite'; -import { Error as VegaError, expressionFunction, parse, View } from 'vega'; +import { Error as VegaError, expressionFunction, loader as vegaLoader, parse, View } from 'vega'; +import { withBundledBoundaries } from './boundary-loader'; +import { followGeoDetail, injectVegaGeoDetail } from './interactions/geo-detail'; +import { GEO_PROJECTION_SIGNAL } from './interactions/navigation-geo'; import { createDefaultStyle, DEFAULT_OPTIONS, Handler } from 'vega-tooltip'; let tooltipSerial = 0; -function createTooltip(container: HTMLElement) { +/** The house's type for the tooltip: its label face, at its label size kept between 11 and 13 px. */ +export function tooltipType(vlSpec: { config?: Record }): { family: string; size: number } | undefined { + const config = vlSpec.config ?? {}; + const family = config.legend?.labelFont ?? config.axis?.labelFont ?? config.font; + if (typeof family !== 'string' || family === '') return undefined; + // The layout sizes each guide's labels for its own room; the largest is the house's reading size. + const sizes = [config.legend, config.axis, config.axisX, config.axisY] + .map((guide) => guide?.labelFontSize).filter((value): value is number => typeof value === 'number'); + const size = sizes.length > 0 ? Math.max(...sizes) : 11; + return { family, size: Math.min(13, Math.max(11, size)) }; +} + +function createTooltip(container: HTMLElement, type?: { family: string; size: number }) { + // Every chart on a page shares Vega's one tooltip element: each shows it in its own house's type. + const styled = (call: Handler['call'], element: () => HTMLElement | null): Handler['call'] => + function (this: unknown, handler, event, item, value) { + call.call(this, handler, event, item, value); + const shown = element(); + if (!shown || value == null || value === '') return; + shown.style.fontFamily = type?.family ?? ''; + shown.style.fontSize = type ? `${type.size}px` : ''; + }; if (container.ownerDocument === document) { const handler = new Handler(); - return { call: handler.call, destroy: () => undefined }; + return { call: styled(handler.call.bind(handler), () => document.getElementById(DEFAULT_OPTIONS.id)), destroy: () => undefined }; } const owner = container.ownerDocument; const element = owner.createElement('div'); @@ -90,7 +119,7 @@ function createTooltip(container: HTMLElement) { element.classList.add('visible'); panel.show(); }; - return { call, destroy() { panel.destroy(); style.remove(); } }; + return { call: styled(call, () => element), destroy() { panel.destroy(); style.remove(); } }; } export interface VegaInteractiveRendererOptions { @@ -99,6 +128,16 @@ export interface VegaInteractiveRendererOptions { enableSemanticUpdates?: boolean; expressionInterpreter?: unknown; background?: string; + /** The notes the chart mounts with, so the compile makes room for them (`AssembleOptions.notes`). */ + notes?: AssembleOptions['notes']; + /** The regions the chart mounts with, so the compile makes room for their captions (`AssembleOptions.regions`). */ + regions?: AssembleOptions['regions']; + /** The baseline behaviours (`interaction_spec.defaults`); on unless turned off. */ + defaults?: InteractionDefaults; + /** The measure values the chart's updates mark, so the compile keeps them in the axis (`AssembleOptions.references`). */ + references?: AssembleOptions['references']; + /** The enclosures the chart mounts with, so the compile pads an axis their outlines would cross (`AssembleOptions.enclosures`). */ + enclosures?: AssembleOptions['enclosures']; assistDistance?: number; hoverTolerance?: number; keyboardTargeting?: boolean; @@ -137,6 +176,31 @@ function pinColorDomains(spec: any): void { visit(spec); } +/** + * A windowed chart is compiled from its first window's rows, which would fit a continuous colour + * scale to that window alone: later windows would run past the legend's ends. Each continuous + * colour keeps the domain the chart stated over all its rows. + */ +function carryColorDomains(from: any, to: any): void { + const domains = new Map>(); + const visit = (node: any, act: (color: any) => void): void => { + if (!node || typeof node !== 'object') return; + const color = node.encoding?.color; + if (color && typeof color.field === 'string' && color.type === 'quantitative') act(color); + for (const child of [...(node.layer ?? []), ...(node.concat ?? []), ...(node.hconcat ?? []), ...(node.vconcat ?? [])]) visit(child, act); + if (node.spec) visit(node.spec, act); + }; + visit(from, (color) => { + if (Array.isArray(color.scale?.domain)) { + domains.set(color.field, { domain: color.scale.domain, ...(color.scale.domainMid !== undefined ? { domainMid: color.scale.domainMid } : {}) }); + } + }); + visit(to, (color) => { + const stated = domains.get(color.field); + if (stated) color.scale = { ...(color.scale ?? {}), ...stated }; + }); +} + function windowedInput( input: ChartAssemblyInput, viewports: CategoryViewport[], @@ -260,8 +324,8 @@ export function layoutSignals(vegaSpec: any): LayoutSignal[] { /** The windows over a subset of the rows: their categories in the same order, the window no larger than they are. */ function viewportsOver(viewports: CategoryViewport[], rows: readonly Record[]): CategoryViewport[] { return viewports.map((viewport) => { - const present = new Set(rows.map((row) => row[viewport.field])); - const orderedValues = viewport.orderedValues.filter((value) => present.has(value)); + const present = new Set(rows.map((row) => String(row[viewport.field]))); + const orderedValues = viewport.orderedValues.filter((value) => present.has(String(value))); return { ...viewport, orderedValues, @@ -281,6 +345,23 @@ function applyViewportSorts(node: unknown, viewports: CategoryViewport[]): void for (const value of Object.values(record)) applyViewportSorts(value, viewports); } +/** + * A rail's axis thinned to round values (every fifth year) prints the round values of every + * category it scrolls through, not only those of the first window it was laid out for. + */ +function widenSkipLabels(spec: any, viewports: CategoryViewport[], semanticTypes: ChartAssemblyInput['semantic_types']): void { + for (const viewport of viewports) { + const config = spec.config?.[viewport.channel === 'x' ? 'axisX' : 'axisY']; + const shown = skipLabelsOf(config?.labelExpr); + const declared: unknown = semanticTypes?.[viewport.field]; + const kind = sequenceKindOf(typeof declared === 'string' ? declared + : (declared as { semanticType?: string } | undefined)?.semanticType); + if (!shown || !kind) continue; + const all = onRoundInterval(kind, shown, viewport.orderedValues.map(String)); + if (all?.length) config.labelExpr = skipLabelExpr(all); + } +} + expressionFunction(TEMPORAL_TICKS_FUNCTION, planTemporalTickValues); export function createVegaInteractiveRenderer( @@ -288,8 +369,30 @@ export function createVegaInteractiveRenderer( ): InteractiveRendererAdapter { return { async mount(container, input) { - // Tooltips are presentation, so the spec decides: off unless `options.addTooltips` is set. - const interactiveInput: ChartAssemblyInput = input; + // The baseline tooltip reads the nearest mark, so every mark carries its values (Vega-Lite's own + // tooltip, formatted as it formats them), unless the spec turns tooltips off. Whether an inspect + // preset reads values on hover instead is known only once the chart admits it (below). + const baselineTooltip = baselineOn(options.defaults, 'tooltip') && input.options?.addTooltips !== false; + const tipped: ChartAssemblyInput = baselineTooltip && input.options?.addTooltips === undefined + ? { ...input, options: { ...input.options, addTooltips: true } } + : input; + // The host's background is the chart's where no house sets a canvas of its own. + const backed: ChartAssemblyInput = options.background !== undefined && tipped.options?.background === undefined + ? { ...tipped, options: { ...tipped.options, background: options.background } } + : tipped; + // The notes and regions the chart mounts with get room at their marks; a spec that names its own keeps them. + const withNotes: ChartAssemblyInput = options.notes?.length && backed.options?.notes === undefined + ? { ...backed, options: { ...backed.options, notes: options.notes } } + : backed; + const withRegions: ChartAssemblyInput = options.regions?.length && withNotes.options?.regions === undefined + ? { ...withNotes, options: { ...withNotes.options, regions: options.regions } } + : withNotes; + const withReferences: ChartAssemblyInput = options.references?.length && withRegions.options?.references === undefined + ? { ...withRegions, options: { ...withRegions.options, references: options.references } } + : withRegions; + const interactiveInput: ChartAssemblyInput = options.enclosures?.length && withReferences.options?.enclosures === undefined + ? { ...withReferences, options: { ...withReferences.options, enclosures: options.enclosures } } + : withReferences; // A viewport on x changes the rows in view, so the compile leaves room for a live layout. const navigatesX = (options.interactions ?? []).some((interaction) => isCanvasInteraction(interaction) && interaction.eventSource.type === 'navigation' && interaction.eventSource.axes !== 'y'); @@ -333,7 +436,22 @@ export function createVegaInteractiveRenderer( return windowed.shown; }; applyViewportSorts(vlSpec, viewports); - const interactions = options.interactions ?? []; + widenSkipLabels(vlSpec, viewports, mountedInput.semantic_types); + if (viewports.length > 0) carryColorDomains(assembled, vlSpec); + // A rail across x belongs under its axis: above a source line at the foot, the chart keeps it room there. + const railRoom = viewports.some((viewport) => viewport.channel === 'x') + && readCanvasFurniture(vlSpec).some((item) => item.bottom !== undefined); + if (railRoom) growPadding(vlSpec, 'bottom', RAIL_ROW_GAP + RAIL_THICKNESS); + // What every chart has without asking (a legend dim, a dense chart's zoom); each gives way to what was asked. + // Anything asked for that acts on legend items (a toggle, a click highlight, a single-series + // inspect) owns the legend, whatever its gesture: the baseline dim stays off it. + const legendClaimed = (options.interactions ?? []).some((interaction) => + isCanvasInteraction(interaction) && 'legend-item' in interaction.affordances); + const baseline = vlSpec._interactionSemantics + ? baselineInteractions(vlSpec._interactionSemantics, options.defaults) + .filter((interaction) => !(legendClaimed && 'legend-item' in interaction.affordances)) + : []; + const interactions = [...(options.interactions ?? []), ...baseline]; const canvasInteractions = interactions.filter(isCanvasInteraction); const filtersRows = interactions.some((interaction) => isFilterControls(interaction) && (interaction.filterControls.options.mode ?? 'filter') === 'filter'); @@ -343,9 +461,12 @@ export function createVegaInteractiveRenderer( const interactionPlan = addVegaLiteInteractions( shapedSpec, interactions, - options.enableSemanticUpdates, + options.enableSemanticUpdates || baselineTooltip, ); if (viewports.length === 0 && filtersRows) pinColorDomains(shapedSpec); + // A domain pinned here (the legend's, or the colours a filter keeps) orders a stack by a + // sort index Vega-Lite would list in the tooltip: the tooltip's fields are listed again. + vlListTooltipFields(shapedSpec); const vegaSpec = enableGuideLabelTooltips(compile(shapedSpec).spec as any); const relaidSignals = filtersRows ? layoutSignals(vegaSpec) : []; let livePlanner: LiveLayoutPlanner | undefined; @@ -385,6 +506,7 @@ export function createVegaInteractiveRenderer( } else if (interactionPlan.geoNavigation) { interactionPlan.geoFocusSource = vegaGeoFocusSource(vegaSpec); } + if (interactionPlan.geoNavigation) interactionPlan.geoDetail = injectVegaGeoDetail(vegaSpec); interactionPlan.reorderAxes = (interactionPlan.reorderAxes ?? []) .map((axis) => injectVegaReorderSignal(vegaSpec, axis)) .filter((axis): axis is NonNullable => !!axis); @@ -416,8 +538,20 @@ export function createVegaInteractiveRenderer( return matches.length === 1 ? matches[0].name : undefined; })(), }; + // A map's overlays and regions are placed through its projection as drawn: a signal + // copies it (navigation declares the same one), so they follow a pan, a zoom or a turn. + const projections: any[] = Array.isArray(vegaSpec.projections) ? vegaSpec.projections : []; + const projection = projections.find((entry) => entry?.name === 'projection') ?? projections[0]; + if (projection?.name) { + vegaSpec.signals = vegaSpec.signals ?? []; + if (!vegaSpec.signals.some((signal: any) => signal?.name === GEO_PROJECTION_SIGNAL)) { + vegaSpec.signals.push({ name: GEO_PROJECTION_SIGNAL, update: `copy(${JSON.stringify(projection.name)})` }); + } + interactionPlan.overlayProjectionSignal = GEO_PROJECTION_SIGNAL; + } interactionPlan.mutableDataSource = source; - interactionPlan.prepareDataRows = (rows) => convertTemporalData([...rows], firstInput.semantic_types ?? {}); + // The compiled data holds the rows as Flint shaped them (an aggregate collapses them), so swapped-in rows are shaped alike. + interactionPlan.prepareDataRows = (rows) => drawn.shapeRows(rows); interactionPlan.initialDataRows = interactionPlan.prepareDataRows(firstInput.data.values ?? []); interactionPlan.temporalValue = (field, value) => temporalFieldValue(field, value, firstInput.semantic_types ?? {}); if (viewports.length > 0) interactionPlan.windowDataRows = (rows) => windowRows(rows ?? inputRows); @@ -469,18 +603,54 @@ export function createVegaInteractiveRenderer( // A pattern fill is an SVG reference a canvas cannot draw. renderer: readCanvasPatterns(vlSpec).length ? 'svg' : options.renderer ?? 'canvas', container, + loader: withBundledBoundaries(vegaLoader()), ...(options.expressionInterpreter ? { expr: options.expressionInterpreter } : {}), } as any, ); view.logLevel(VegaError); - const tooltip = createTooltip(container); + const tooltip = createTooltip(container, tooltipType(vlSpec)); + // Vega's exact hover drives the tooltip; with the baseline, a line or point a few px away + // takes it over (the readout), and gives it back when the pointer moves off. + // An inspect preset the chart admitted reads values on hover itself: the tooltip stays out of its way. + const readsOnHover = (interactionPlan?.interactions ?? []).some((interaction) => + isCanvasInteraction(interaction) && interaction.eventSource.gesture === 'inspect'); + const proximity = baselineTooltip && !readsOnHover && interactionPlan; + let nearby = false; + let exact: [any, any, unknown] | undefined; + const showTip = (handler: any, event: any, item: any, value: unknown): void => + tooltip.call(handler, event, item, value == null ? value : readableTooltip(withoutSemanticInteractionField(value))); + // Text and rules that no data row stands behind (a ridge's label, a mean line, a sparkline's + // average) are the chart's furniture: under the baseline they say nothing on hover. + const furniture = (item: any): boolean => proximity !== undefined && proximity !== false + && (item?.mark?.marktype === 'text' || item?.mark?.marktype === 'rule') + && item?.datum?.[INTERACTION_KEY] == null; view.tooltip((handler, event, item, value) => { - tooltip.call(handler, event, item, withoutSemanticInteractionField(value)); + if (furniture(item) || (readsOnHover && input.options?.addTooltips === undefined)) value = null; + exact = value == null ? undefined : [event, item, value]; + if (!nearby) showTip(handler, event, item, value); }); + const hideTip = (): void => tooltip.call(undefined as any, new MouseEvent('mousemove') as any, undefined as any, null); + const readout = proximity ? { + show: (event: PointerEvent, value: unknown) => { + nearby = true; + showTip(undefined, event, undefined, value); + }, + release: () => { + if (!nearby) return; + nearby = false; + if (exact) showTip(undefined, ...exact); + else hideTip(); + }, + hide: () => { + nearby = false; + hideTip(); + }, + } : undefined; // After the tooltip: setting it re-initializes the view's event handler. scaleAwareCanvasPicking((view as any)._handler); await view.runAsync(); mountCanvasFurniture(container, readCanvasFurniture(vlSpec), readCanvasPatterns(vlSpec)); + const stopGeoDetail = interactionPlan?.geoDetail ? followGeoDetail(view) : undefined; const mountedInteractions = mountedInteractionList(interactions, interactionPlan?.interactions ?? canvasInteractions); const interactionController = interactionPlan ? mountVegaInteractions( @@ -495,6 +665,7 @@ export function createVegaInteractiveRenderer( options.hoverTolerance ?? 0, options.keyboardTargeting ?? false, options.targetFeedback, + readout, ) : undefined; @@ -607,9 +778,13 @@ export function createVegaInteractiveRenderer( }, getViewportGeometry(channel) { const { x: left, y: top } = vegaRendererOrigin(view); - return channel === 'x' - ? { offset: left, extent: view.width() } - : { offset: top, extent: view.height() }; + if (channel === 'y') return { offset: top, extent: view.height() }; + // Under everything Vega draws (axes, a legend below), in the room kept above the source line. + const drawnBottom = Number((view.scenegraph() as any)?.root?.items?.[0]?.bounds?.y2); + return { + offset: left, extent: view.width(), + ...(railRoom && Number.isFinite(drawnBottom) ? { railTop: top + drawnBottom + RAIL_ROW_GAP } : {}), + }; }, getViewports: () => currentViewports, setViewports(starts) { @@ -664,6 +839,7 @@ export function createVegaInteractiveRenderer( destroyed = true; if (updateTimer !== undefined) window.clearTimeout(updateTimer); interactionController?.destroy(); + stopGeoDetail?.(); view.finalize(); tooltip.destroy(); container.replaceChildren(); diff --git a/packages/flint-js/src/vegalite/key-layout.ts b/packages/flint-js/src/vegalite/key-layout.ts index 55318a41..359f14b7 100644 --- a/packages/flint-js/src/vegalite/key-layout.ts +++ b/packages/flint-js/src/vegalite/key-layout.ts @@ -4,6 +4,7 @@ import type { LegendPlan } from '../core/legend-plan'; import { KEY_CHANNELS } from '../core/structure'; import { rendererTextMeasurer } from '../core/text-width'; import { caseLabelExpr } from '../core/text-case'; +import { exactLegendLabels } from './exact-labels'; import { plannedKeyFor } from './theme'; @@ -20,7 +21,10 @@ function keyLegend(legend: any, layout: KeyLayout, labels: string[] | undefined, const out = { ...(legend ?? {}) }; // The key's air to the plot, as planned; an author's offset stands. if (offset !== undefined && out.offset === undefined) out.offset = offset; - if (layout.moved) { + // A key moved off its edge, or pinned to one by its author (`legend.orient` on a Flint encoding, + // which the encoding Vega-Lite reads does not carry), stands on the edge planned for it; Vega-Lite + // would otherwise draw it on the right. + if (layout.moved || (out.orient === undefined && layout.orient !== 'right')) { out.orient = layout.orient; if (out.direction === undefined) out.direction = ['top', 'bottom'].includes(layout.orient) ? 'horizontal' : 'vertical'; if (out.titleOrient === undefined) out.titleOrient = 'top'; @@ -70,6 +74,42 @@ function keyLegend(legend: any, layout: KeyLayout, labels: string[] | undefined, return out; } +/** Colour scales whose key Vega-Lite draws as a stepped ramp, dropping the key's own `gradientLength`. */ +const BINNED_SCALES = new Set(['quantize', 'quantile', 'threshold', 'bin-ordinal']); + +/** + * A stepped ramp standing up beside the plot runs the length the plan gave it, or where the plan + * gave none — it lays a stepped key out as a list of swatches — no longer than the plot is tall. Vega-Lite drops a + * binned key's own `gradientLength` and reads the config's, which a theme sizes for a row of bins + * above the plot ({@link fitBinnedKeyLength}): a ramp twice the height of a short plot, running past + * it. Only an upright one is held here, never shorter than a line of label per bin. + */ +function holdBinnedKeyLength(spec: any, encoding: any, layout: KeyLayout, plot: { width: number; height: number }): void { + if (!BINNED_SCALES.has(encoding.scale?.type)) return; + const config = (spec.config ??= {}); + const legendConfig = (config.legend ??= {}); + const direction = encoding.legend?.direction ?? legendConfig.direction ?? (['top', 'bottom'].includes(layout.orient) ? 'horizontal' : 'vertical'); + if (direction !== 'vertical') return; + const bins = Array.isArray(encoding.scale.range) ? encoding.scale.range.length + : encoding.scale.type === 'threshold' && Array.isArray(encoding.scale.domain) ? encoding.scale.domain.length + 1 + : encoding.scale.scheme?.count ?? 0; + const fontSize = encoding.legend?.labelFontSize ?? legendConfig.labelFontSize ?? 10; + const planned = encoding.legend?.gradientLength; + let length: number; + if (typeof planned === 'number') length = planned; + else { + // The plot's height, less the key's title above the ramp. + const titled = encoding.legend?.title !== null; + const titleSize = encoding.legend?.titleFontSize ?? legendConfig.titleFontSize ?? 11; + const lines = Array.isArray(encoding.legend?.title) ? encoding.legend.title.length : 1; + const title = titled ? lines * Math.ceil(titleSize * 1.2) + (encoding.legend?.titlePadding ?? legendConfig.titlePadding ?? 5) : 0; + length = Math.min(legendConfig.gradientLength ?? 200, plot.height - title); + } + const held = Math.round(Math.max(length, bins * (fontSize + 2))); + // Keys share the config's length: an upright stepped ramp holds the shortest any of them asks for. + legendConfig.gradientLength = Math.min(legendConfig.gradientLength ?? Infinity, held); +} + /** Stack keys that share an edge as the plan says: one row each, or side by side. */ function writeEdges(spec: any, edges: LegendLayoutPlan['edges']): void { if (!edges.length) return; @@ -123,8 +163,17 @@ export function vlWriteKeyLayout( const keyLayout = index >= 0 ? layout.keys[index] : undefined; if (!key || !keyLayout) continue; encoding.legend = keyLegend(encoding.legend, keyLayout, key.entries, layout.offsets?.[keyLayout.orient as 'top']); + // Vega-Lite labels a continuous ramp given a length under 200 px at its two raw ends + // (−53,901 and 43,635); a ramp shortened to the plot keeps round values, one per 40 px. + if (keyLayout.gradientLength !== undefined && !BINNED_SCALES.has(encoding.scale?.type) + && encoding.legend.values === undefined && encoding.legend.tickCount === undefined) { + encoding.legend = { ...encoding.legend, tickCount: Math.max(2, Math.round(keyLayout.gradientLength / 40)) }; + } // A key to values lists the round values the plan sampled, with or without a theme. - if (key.samples && encoding.legend.values === undefined) encoding.legend = { ...encoding.legend, values: key.samples }; + if (key.samples && encoding.legend.values === undefined) { + encoding.legend = { ...encoding.legend, values: key.samples, ...exactLegendLabels(encoding.legend, key.samples) }; + } + holdBinnedKeyLength(spec, encoding, keyLayout, layout.plot); } }); writeEdges(spec, layout.edges); diff --git a/packages/flint-js/src/vegalite/nice.ts b/packages/flint-js/src/vegalite/nice.ts new file mode 100644 index 00000000..72f4ef88 --- /dev/null +++ b/packages/flint-js/src/vegalite/nice.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** The tick step d3 (and so Vega) takes for `count` ticks over a span. */ +export function tickStep(span: number, count: number): number { + const raw = span / count; + let step = 10 ** Math.floor(Math.log10(raw)); + const error = raw / step; + if (error >= Math.sqrt(50)) step *= 10; + else if (error >= Math.sqrt(10)) step *= 5; + else if (error >= Math.sqrt(2)) step *= 2; + return step; +} + +/** A linear domain rounded out as Vega's `nice: true` rounds it: to ten ticks, until the step settles. */ +export function niceExtent(lo: number, hi: number): [number, number] { + let start = lo; + let stop = hi; + let previous: number | undefined; + for (let pass = 0; pass < 10 && stop > start; pass++) { + const step = tickStep(stop - start, 10); + if (step === previous) break; + start = Math.floor(start / step) * step; + stop = Math.ceil(stop / step) * step; + previous = step; + } + return [start, stop]; +} diff --git a/packages/flint-js/src/vegalite/note-room.ts b/packages/flint-js/src/vegalite/note-room.ts new file mode 100644 index 00000000..52b677d8 --- /dev/null +++ b/packages/flint-js/src/vegalite/note-room.ts @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { noteRoomNeed, regionRoomNeed, roomPast } from '../core/annotation'; +import type { AxisLabelPlan } from '../core/axis-labels'; +import type { TextMeasurer } from '../core/legend-layout'; +import type { AssembleOptions } from '../core/types'; +import type { SemanticAnnotation } from '../core/field-semantics'; +import { comparableValue, selectorRowTest } from '../core/target-selector'; +import { markTypeOf } from './theme'; +import { niceExtent, tickStep } from './nice'; + +type Notes = NonNullable; +type Regions = NonNullable; +type Row = Record; + +const AGGREGATES = new Set(['sum', 'mean', 'average', 'min', 'max']); + +function sameValue(a: unknown, b: unknown): boolean { + if (a === b) return true; + if (a instanceof Date || b instanceof Date) return new Date(a as any).getTime() === new Date(b as any).getTime(); + return a !== null && b !== null && a !== undefined && b !== undefined && String(a) === String(b); +} + + +const finite = (value: unknown): value is number => typeof value === 'number' && Number.isFinite(value); + +/** + * The bins Vega cuts an extent into (its `bin` transform): a step from 1, 2 or 5 times a power of + * ten that gives at most `maxbins` bins, the ends rounded out to it. Undefined for the options this + * does not follow (an anchor or a list of steps). + */ +function vegaBins(options: any, extent: readonly [number, number]): { start: number; stop: number; step: number } | undefined { + if (options.anchor !== undefined || options.steps !== undefined || options.span !== undefined) return undefined; + const maxbins = options.maxbins ?? 10; + const base = options.base ?? 10; + const logb = Math.log(base); + const divide: number[] = options.divide ?? [5, 2]; + let [min, max] = extent; + const span = max - min || Math.abs(min) || 1; + let step: number; + if (finite(options.step)) step = options.step; + else { + const level = Math.ceil(Math.log(maxbins) / logb); + const minstep = options.minstep ?? 0; + step = Math.max(minstep, base ** (Math.round(Math.log(span) / logb) - level)); + while (Math.ceil(span / step) > maxbins) step *= base; + for (const div of divide) { + const v = step / div; + if (v >= minstep && span / v <= maxbins) step = v; + } + } + const v = Math.log(step); + const precision = v >= 0 ? 0 : Math.floor(-v / logb) + 1; + const eps = base ** (-precision - 1); + if (options.nice ?? true) { + const floor = Math.floor(min / step + eps) * step; + min = min < floor ? floor - step : floor; + max = Math.ceil(max / step) * step; + } + return { start: min, stop: max === min ? min + step : max, step }; +} + +function aggregate(op: string | undefined, values: readonly number[]): number { + if (op === 'sum') return values.reduce((total, value) => total + value, 0); + if (op === 'mean' || op === 'average') return values.reduce((total, value) => total + value, 0) / values.length; + if (op === 'min') return Math.min(...values); + return Math.max(...values); +} + +/** + * The rows the marks are drawn from, where the spec computes them by binning and aggregating (a + * histogram's counts): its `bin` and `aggregate` transforms run over the data as Vega runs them. + * Undefined where it computes them any other way. + */ +function computedRows(transforms: readonly any[], rows: readonly Row[]): Row[] | undefined { + let out = rows.slice(); + for (const transform of transforms) { + if (transform.bin && typeof transform.field === 'string' && transform.as) { + const [startAs, endAs]: string[] = Array.isArray(transform.as) ? transform.as : [transform.as, `${transform.as}_end`]; + const values = out.map((row) => row[transform.field]).filter(finite); + if (!values.length) return undefined; + const options = transform.bin === true ? {} : transform.bin; + const extent: [number, number] = Array.isArray(options.extent) ? options.extent : [Math.min(...values), Math.max(...values)]; + const bins = vegaBins(options, extent); + if (!bins) return undefined; + const { start, stop, step } = bins; + out = out.map((row) => { + const value = row[transform.field]; + if (!finite(value)) return { ...row, [startAs]: null, [endAs]: null }; + const at = start + step * Math.floor(1e-14 + (Math.max(start, Math.min(value, stop - step)) - start) / step); + return { ...row, [startAs]: at, [endAs]: at + step }; + }); + } else if (Array.isArray(transform.aggregate)) { + const groupby: string[] = transform.groupby ?? []; + const groups = new Map(); + for (const row of out) { + const key = JSON.stringify(groupby.map((name) => row[name])); + const list = groups.get(key); + if (list) list.push(row); + else groups.set(key, [row]); + } + const ops: { op: string; field?: string; as: string }[] = transform.aggregate; + if (ops.some(({ op }) => op !== 'count' && !AGGREGATES.has(op))) return undefined; + out = [...groups.values()].map((members) => { + const row: Row = Object.fromEntries(groupby.map((name) => [name, members[0][name]])); + for (const { op, field, as } of ops) { + if (op === 'count') row[as] = members.length; + else { + const values = members.map((member) => member[field!]).filter(finite); + row[as] = values.length ? aggregate(op, values) : null; + } + } + return row; + }); + } else return undefined; + } + return out; +} + +/** The rows a unit's marks are drawn from where its spec (or the view's) bins and aggregates the data. */ +function unitRows(spec: any, unit: any, data: readonly Row[]): Row[] | undefined { + const transforms = [...(spec.transform ?? []), ...(unit !== spec ? unit.transform ?? [] : [])]; + return transforms.length ? computedRows(transforms, data) : undefined; +} + +/** Whether a row's mark stands in a stretch of x: its value, or its span from x to x2, inside the bounds. */ +function stretchOf(encoding: any, bounds: readonly unknown[] | undefined): ((row: Row) => boolean) | undefined { + const enc = encoding.x; + if (!enc?.field || !bounds?.length) return undefined; + const field: string = enc.field; + if (enc.type === 'quantitative' || enc.type === 'temporal') { + if (bounds.length !== 2) return undefined; + const number = (value: unknown): number => finite(value) ? value + : value instanceof Date ? value.getTime() + : enc.type === 'temporal' && value !== null && value !== undefined ? Date.parse(String(value)) : NaN; + const ends = bounds.map((bound, at) => bound === null || bound === undefined ? (at === 0 ? -Infinity : Infinity) : number(bound)); + if (ends.some(Number.isNaN)) return undefined; + const lo = Math.min(ends[0], ends[1]); + const hi = Math.max(ends[0], ends[1]); + const end: string | undefined = encoding.x2?.field; + return (row) => { + const x = number(row[field]); + if (!Number.isFinite(x)) return false; + const x2 = end ? number(row[end]) : NaN; + // A bin stands in the stretch where any of its width does; touching an end is not standing in it. + if (Number.isFinite(x2)) return Math.max(x, x2) > lo && Math.min(x, x2) < hi; + return x >= lo && x <= hi; + }; + } + const names = new Set(bounds.map(String)); + return (row) => names.has(String(row[field])); +} + +/** + * Room for the chart's first notes past the marks they name, on a single view: a noted value at + * the top of a vertical measure axis extends that axis to a round tick far enough for the caption + * over it ({@link roomPast}). As in Blabber, only an upward value gets paper: a horizontal bar's + * caption stands past its end in the paper the chart has, and a negative bar's beneath it. + * A captioned stretch of x gets the same where its marks leave its caption no row clear of them, + * above or (for points and lines) below. The marks' values are the data's, or the bins and counts + * the spec computes from it (a histogram). Every layer that draws the measure gets the same end, as + * they share its scale. An axis with a stated domain, a stated end, a scale other than linear, or + * a stack is left as it is; Flint's own ticks are extended at their step, Vega-Lite's rounding is + * matched. + */ +export function vlReserveNoteRoom( + spec: any, + room: { notes?: Notes; regions?: Regions; references?: readonly number[] }, + data: readonly Record[], + plot: { width: number; height: number } | undefined, + axisLabels: Partial>, + measure: TextMeasurer, +): void { + const notes = room.notes ?? []; + // A stretch of x captioned at its top: by the placer's choice, or asked for. + const regions = (room.regions ?? []).filter((region) => region.text && region.x?.length && !region.y?.length + && (region.placement === undefined || region.placement === 'top')); + const references = room.references ?? []; + if ((!notes.length && !regions.length && !references.length) || !plot || !data.length) return; + if (spec.facet || spec.repeat || spec.vconcat || spec.hconcat || spec.concat) return; + const units: any[] = [spec, ...(Array.isArray(spec.layer) ? spec.layer : [])].filter((unit) => unit?.encoding || unit?.mark); + { + const channel = 'y' as const; + const other = 'x' as const; + const length = plot.height; + // The units that draw a measure on this channel, each with its own encodings merged over the view's. + const drawn = units.flatMap((unit) => { + const encoding = { ...(unit === spec ? {} : spec.encoding), ...unit.encoding }; + const enc = encoding[channel]; + if (!enc?.field || enc.type !== 'quantitative' || enc.bin) return []; + return [{ unit, enc, encoding, mark: markTypeOf(unit.mark ?? spec.mark) }]; + }); + const primary = drawn.find(({ unit }) => !unit.__themeSynthetic) ?? drawn[0]; + if (!primary) return; + const { enc, encoding, mark } = primary; + const field: string = enc.field; + // A measure the spec computes is read from the rows it computes, where it bins and counts. + const rows = data.some((row) => field in row) ? data : unitRows(spec, primary.unit, data); + if (!rows?.length) return; + const bars = mark === 'bar'; + if (!bars && mark !== 'point' && mark !== 'circle' && mark !== 'square' && mark !== 'line' && mark !== 'tick') return; + const stacked = bars && enc.stack !== null && enc.stack !== false + && (encoding.color?.field || encoding.detail) && !encoding[`${other}Offset`]; + if (stacked) return; + const encodings = drawn.filter((entry) => entry.enc.field === field).map((entry) => entry.enc); + const scale = enc.scale ?? {}; + if (encodings.some((e) => Array.isArray(e.scale?.domain) || e.scale?.domainRaw) || (scale.type && scale.type !== 'linear')) return; + if (scale.reverse) return; + + // The values the marks stand at, by the band they stand in where the measure is aggregated. + const op = typeof enc.aggregate === 'string' ? enc.aggregate : undefined; + if (op && !AGGREGATES.has(op)) return; + const group: string | undefined = op ? encoding[other]?.field : undefined; + if (op && !group) return; + const numeric = (row: Record) => typeof row[field] === 'number' && Number.isFinite(row[field] as number); + const markValues = (subset: readonly Record[]): number[] => { + if (!op) return subset.filter(numeric).map((row) => row[field] as number); + const groups = new Map(); + for (const row of subset) { + if (!numeric(row)) continue; + const key = String(row[group!]); + groups.set(key, [...(groups.get(key) ?? []), row[field] as number]); + } + return [...groups.values()].map((values) => aggregate(op, values)); + }; + const all = markValues(rows); + if (!all.length) return; + + // The domain the axis draws: Flint's ruler where it set one, else the data's rounded as Vega-Lite rounds. + const ruled = Array.isArray(enc.axis?.values) && scale.nice === false + && typeof scale.domainMin === 'number' && typeof scale.domainMax === 'number'; + const zero = scale.zero ?? true; + let lo = typeof scale.domainMin === 'number' ? scale.domainMin : zero ? Math.min(0, ...all) : Math.min(...all); + let hi = typeof scale.domainMax === 'number' ? scale.domainMax : zero ? Math.max(0, ...all) : Math.max(...all); + if (!ruled && scale.nice !== false) { + const [niceLo, niceHi] = niceExtent(lo, hi); + if (typeof scale.domainMin !== 'number') lo = niceLo; + if (typeof scale.domainMax !== 'number') hi = niceHi; + } + + const labels = axisLabels[channel]; + const chart = { ...(labels?.fontSize ? { fontSize: labels.fontSize } : {}), ...(labels?.font ? { font: labels.font } : {}) }; + const measureAt = (fontSize: number) => measure(fontSize, chart.font ?? 'sans-serif', 'normal', 'normal'); + let max: number | undefined; + for (const note of notes) { + const keyFields = Object.entries(note.key).filter(([name]) => rows.some((row) => name in row)); + if (!keyFields.length) continue; + const matched = rows.filter((row) => keyFields.every(([name, value]) => sameValue(row[name], value))); + // With the measure aggregated, the noted mark is the whole band its rows stand in. + const bands = op ? new Set(matched.map((row) => String(row[group!]))) : undefined; + const values = markValues(bands ? rows.filter((row) => bands.has(String(row[group!]))) : matched); + if (!values.length) continue; + const top = Math.max(...values); + const end = roomPast(top, [lo, hi], length, noteRoomNeed(note.text, chart, measureAt), 'max'); + if (end !== undefined && (!bars || top > 0)) max = Math.max(max ?? -Infinity, end); + } + for (const region of regions) { + const inStretch = stretchOf(encoding, region.x); + if (!inStretch) continue; + const values = markValues(rows.filter(inStretch)); + if (!values.length) continue; + const need = regionRoomNeed(region.text!, chart, measureAt); + const top = Math.max(...values); + // A series that leaves a row free beneath it takes its caption there. + const below = ((Math.min(...values) - lo) / (hi - lo)) * length; + if (!bars && below >= need) continue; + const end = roomPast(top, [lo, hi], length, need, 'max'); + if (end !== undefined && (!bars || top > 0)) max = Math.max(max ?? -Infinity, end); + } + // A value an update marks across the plot (a reference rule, a band) stays inside the axis. + for (const value of references) if (value > hi) max = Math.max(max ?? -Infinity, value); + // An end the spec states (a semantic bound) is kept; only Flint's own ruled ends move. + if (max === undefined || (!ruled && encodings.some((e) => e.scale?.domainMax !== undefined))) return; + if (encodings.some((e) => e !== enc && e.scale?.domainMax !== undefined && e.scale.domainMax !== scale.domainMax)) return; + + if (ruled) { + const values: number[] = enc.axis.values; + const step = values.length > 1 ? values[1] - values[0] : 0; + if (!(step > 0)) return; + const ticks = [...values]; + // The end rounds up at a fine step, not a whole tick step: an axis may end between ticks, + // and a whole step can double the room the caption needs. + const fine = Math.min(step / 2, tickStep(hi - lo, 20)); + const top = +(Math.ceil(max / fine - 1e-9) * fine).toPrecision(12); + while (ticks[ticks.length - 1] + step <= top + 1e-9) ticks.push(+(ticks[ticks.length - 1] + step).toPrecision(12)); + for (const e of encodings) { + e.scale = { ...e.scale, domainMax: top }; + if (e.axis && Array.isArray(e.axis.values)) e.axis = { ...e.axis, values: ticks, tickCount: ticks.length }; + } + } else { + // Rounded up at a fine step (a twentieth of the span, to a round number), not re-niced: a + // re-niced end can jump a whole major tick (70.2 → 80) and give the caption twice its room. + const step = tickStep(hi - lo, 20); + const top = +(Math.ceil(max / step - 1e-9) * step).toPrecision(12); + for (const e of encodings) e.scale = { ...e.scale, domainMax: top }; + } + } +} + +/** + * The px an outline needs past a dot it encloses: the hull's padding (6), half its stroke and halo, + * and the dot's own radius. + */ +const ENCLOSURE_EDGE_ROOM = 12; +const DOT_MARKS = new Set(['point', 'circle', 'square', 'line', 'trail', 'tick']); + +/** + * Room for the outlines of the enclosures a chart mounts with, where a dot they enclose sits at the + * edge of a continuous axis: the axis is padded by the px the outline needs, so the outline is drawn + * whole rather than cut at the plot's edge. Only dots and lines: a bar's outline is its own border. + */ +export function vlReserveEnclosureRoom( + spec: any, + enclosures: AssembleOptions['enclosures'], + data: readonly Row[], + plot: { width: number; height: number } | undefined, + semanticTypes: Record | undefined, +): void { + if (!enclosures?.length || !plot || !data.length) return; + if (spec.facet || spec.repeat || spec.vconcat || spec.hconcat || spec.concat) return; + const units: any[] = [spec, ...(Array.isArray(spec.layer) ? spec.layer : [])].filter((unit) => unit?.encoding || unit?.mark); + const drawn = units.flatMap((unit) => { + const encoding = { ...(unit === spec ? {} : spec.encoding), ...unit.encoding }; + const mark = markTypeOf(unit.mark ?? spec.mark); + return mark && DOT_MARKS.has(mark) ? [{ unit, encoding }] : []; + }); + if (!drawn.length) return; + const fields = [...new Set(data.flatMap((row) => Object.keys(row)))]; + const temporalFields = (['x', 'y'] as const).flatMap((channel) => { + const enc = drawn[0].encoding[channel]; + return enc?.field && enc.type === 'temporal' ? [enc.field as string] : []; + }); + const comparison = { temporalFields, semanticTypes: semanticTypes ?? {} }; + const tests = enclosures.flatMap((enclosure) => (enclosure.targets ?? []).flatMap((target: any) => + target && 'select' in target ? [selectorRowTest(target, fields, comparison)].filter((test): test is NonNullable => !!test) : [])); + if (!tests.length) return; + const enclosed = data.filter((row) => tests.some((test) => test(row))); + if (!enclosed.length) return; + for (const channel of ['x', 'y'] as const) { + const enc = drawn[0].encoding[channel]; + if (!enc?.field || (enc.type !== 'quantitative' && enc.type !== 'temporal') || enc.bin || enc.aggregate) continue; + const scale = enc.scale ?? {}; + if (Array.isArray(scale.domain) || (scale.type && !['linear', 'utc', 'time'].includes(scale.type))) continue; + const field: string = enc.field; + const value = (row: Row): number => { + const raw = comparableValue(comparison, field, row[field]); + return typeof raw === 'number' ? raw : raw instanceof Date ? raw.getTime() : Number(raw); + }; + const all = data.map(value).filter(Number.isFinite); + const inside = enclosed.map(value).filter(Number.isFinite); + if (!all.length || !inside.length) continue; + let lo = Math.min(...all); + let hi = Math.max(...all); + if (enc.type === 'quantitative') { + if (scale.zero ?? false) { lo = Math.min(0, lo); hi = Math.max(0, hi); } + if (scale.nice !== false && !(typeof scale.domainMin === 'number' && typeof scale.domainMax === 'number')) [lo, hi] = niceExtent(lo, hi); + } + if (typeof scale.domainMin === 'number') lo = scale.domainMin; + if (typeof scale.domainMax === 'number') hi = scale.domainMax; + if (!(hi > lo)) continue; + const length = channel === 'x' ? plot.width : plot.height; + // How near the plot's edge the nearest enclosed dot stands, in px, past the padding already kept. + const edge = Math.min(...inside.map((v) => Math.min(v - lo, hi - v))) / (hi - lo) * length + (scale.padding ?? 0); + if (edge >= ENCLOSURE_EDGE_ROOM) continue; + for (const { encoding } of drawn) { + const e = encoding[channel]; + if (e?.field !== field) continue; + e.scale = { ...(e.scale ?? {}), padding: Math.max(e.scale?.padding ?? 0, ENCLOSURE_EDGE_ROOM) }; + } + // The units carry their own copies of the encoding where they repeat it; the view's is shared. + for (const unit of units) { + const e = unit.encoding?.[channel]; + if (e?.field === field) e.scale = { ...(e.scale ?? {}), padding: Math.max(e.scale?.padding ?? 0, ENCLOSURE_EDGE_ROOM) }; + } + } +} diff --git a/packages/flint-js/src/vegalite/templates/bar-table.ts b/packages/flint-js/src/vegalite/templates/bar-table.ts index ca6b7762..efdcb1d0 100644 --- a/packages/flint-js/src/vegalite/templates/bar-table.ts +++ b/packages/flint-js/src/vegalite/templates/bar-table.ts @@ -6,7 +6,7 @@ import { facetViews, type ViewNode } from '../../core/views'; import { facetPanelLength, resolveStretchCaps } from '../../core/compute-layout'; import { getRegistryEntry } from '../../core/type-registry'; import { fitTwoLineLabels } from '../../core/decisions'; -import { resolveDisplayUnit, titleWithDisplayUnit, type FormatSpec } from '../../core/field-semantics'; +import { resolveDisplayAggregate, resolveDisplayUnit, titleWithDisplayUnit, type FormatSpec } from '../../core/field-semantics'; import { fieldsFromEncodingChannels, firstDiscreteEncodingField, @@ -124,7 +124,7 @@ function barTableLayout( // Used for both the Top-N trim decision and the panel-width // estimation. `aggValue` collapses one group's sum/count into // the single number the chart will display. - const useMeanForDisplay = xCS?.aggregationDefault === 'average'; + const useMeanForDisplay = resolveDisplayAggregate(xCS, ctx.encodings?.x?.aggregate) === 'average'; const aggValue = (g: { sum: number; n: number }) => useMeanForDisplay ? g.sum / Math.max(1, g.n) : g.sum; @@ -297,7 +297,7 @@ function barTableLayout( // share. Without this, each input row would render its own text // mark (overlapping) and each share would be value/grand-total // (~0% per row instead of the per-category percent). - const sortOp: 'sum' | 'mean' = (xCS?.aggregationDefault === 'average') ? 'mean' : 'sum'; + const sortOp: 'sum' | 'mean' = useMeanForDisplay ? 'mean' : 'sum'; const uniqueGroupby = (fields: string[]) => Array.from(new Set(fields)); const textGroupby = hasFacet ? uniqueGroupby([...facetFields, yField]) : [yField]; const textPanelTransform: any[] = [ @@ -1102,11 +1102,13 @@ export const barTableDef: ChartTemplateDef = { { key: 'showPercent', label: '% of total', type: 'binary', defaultValue: false, check: (ctx) => { - // A "% of total" share only reads sensibly for an additive, + // A "% of total" share only reads sensibly for a summed, // single-sign measure with a non-zero total — a share of a - // mixed-sign or intensive (mean-aggregated) measure is misleading. + // mixed-sign, intensive or not-additive (mean-aggregated) + // measure is misleading. const mcs = ctx.channelSemantics?.x; - if (!mcs?.field || mcs.type !== 'quantitative' || mcs.aggregationDefault === 'average') { + if (!mcs?.field || mcs.type !== 'quantitative' + || resolveDisplayAggregate(mcs, ctx.encodings?.x?.aggregate) !== 'sum') { return { applicable: false }; } let sum = 0, hasNeg = false, hasPos = false, count = 0; diff --git a/packages/flint-js/src/vegalite/templates/bar.ts b/packages/flint-js/src/vegalite/templates/bar.ts index b18a0418..91074217 100644 --- a/packages/flint-js/src/vegalite/templates/bar.ts +++ b/packages/flint-js/src/vegalite/templates/bar.ts @@ -31,7 +31,7 @@ import { detectBandedAxisFromSemantics, detectBandedAxisForceDiscrete, } from '../../core/axis-detection'; import { - defaultBuildEncodings, setMarkProp, adjustBarMarks, adjustRectTiling, + defaultBuildEncodings, setMarkProp, adjustBarMarks, adjustRectTiling, spanCalendarCells, resolveAsDiscrete, alignStackOrderToColorOrder, } from './utils'; @@ -173,7 +173,7 @@ function getSafeHeatmapIntrinsicDomain(ctx: any, colorField: string | undefined) export const barChartDef: ChartTemplateDef = { chart: "Bar Chart", template: { mark: "bar", encoding: {} }, - channels: ["x", "y", "color", "opacity", "column", "row"], + channels: ["x", "y", "color", "detail", "opacity", "column", "row"], interactionSupport: { elements: true, region: ['cartesian'], @@ -184,7 +184,7 @@ export const barChartDef: ChartTemplateDef = { }, markCognitiveChannel: 'length', semanticInteractions: ({ resolvedEncodings }) => { - const fields = ['x', 'y', 'color'] + const fields = ['x', 'y', 'color', 'detail'] .map((channel) => resolvedEncodings[channel]?.field) .filter((field): field is string => !!field); const categoryField = discreteField(resolvedEncodings, ['x', 'y']); @@ -434,7 +434,7 @@ export const pyramidChartDef: ChartTemplateDef = { export const groupedBarChartDef: ChartTemplateDef = { chart: "Grouped Bar Chart", template: { mark: "bar", encoding: {} }, - channels: ["x", "y", "group", "color", "column", "row"], + channels: ["x", "y", "group", "color", "detail", "column", "row"], interactionSupport: { elements: true, region: ['cartesian'], @@ -445,7 +445,7 @@ export const groupedBarChartDef: ChartTemplateDef = { }, markCognitiveChannel: 'length', semanticInteractions: ({ resolvedEncodings }) => { - const fields = ['x', 'y', 'color'] + const fields = ['x', 'y', 'color', 'detail'] .map((channel) => resolvedEncodings[channel]?.field) .filter((field): field is string => !!field); const categoryField = discreteField(resolvedEncodings, ['x', 'y']); @@ -568,7 +568,7 @@ export const groupedBarChartDef: ChartTemplateDef = { export const stackedBarChartDef: ChartTemplateDef = { chart: "Stacked Bar Chart", template: { mark: "bar", encoding: {} }, - channels: ["x", "y", "color", "column", "row"], + channels: ["x", "y", "color", "detail", "column", "row"], structure: (ctx) => { // The stack mode the author picks stacks the series, side by side when layered. const structure = skeletonStructure(stackedBarChartDef.template, ctx); @@ -586,7 +586,7 @@ export const stackedBarChartDef: ChartTemplateDef = { }, markCognitiveChannel: 'length', semanticInteractions: ({ resolvedEncodings }) => { - const fields = ['x', 'y', 'color'] + const fields = ['x', 'y', 'color', 'detail'] .map((channel) => resolvedEncodings[channel]?.field) .filter((field): field is string => !!field); const categoryField = discreteField(resolvedEncodings, ['x', 'y']); @@ -617,7 +617,7 @@ export const stackedBarChartDef: ChartTemplateDef = { }, instantiate: (spec, ctx) => { defaultBuildEncodings(spec, ctx.resolvedEncodings); - spec.encoding.tooltip = tooltipForChannels(spec.encoding, ['x', 'y', 'color']); + spec.encoding.tooltip = tooltipForChannels(spec.encoding, ['x', 'y', 'color', 'detail']); // Apply stack mode const config = ctx.chartProperties; const hasStackSeries = !!ctx.channelSemantics.color?.field; @@ -850,15 +850,18 @@ export const heatmapDef: ChartTemplateDef = { const config = ctx.chartProperties; const showTextLabels = !!config?.showTextLabels; const colorField = spec.encoding?.color?.field; + // The colour scale reads every row: a grid whose columns overflow its canvas scrolls through + // the rest, and they must not run past the legend's ends. + const colorRows = ctx.fullTable ?? ctx.table; const colorVals = colorField - ? ctx.table + ? colorRows .map((r: any) => r[colorField]) .filter((v: any) => v != null && v !== '') .map((v: any) => Number(v)) .filter((v: number) => Number.isFinite(v)) : []; const hasMissingValues = colorField - ? ctx.table.some((r: any) => { + ? colorRows.some((r: any) => { const value = r[colorField]; return value == null || value === '' || !Number.isFinite(Number(value)); }) @@ -1036,6 +1039,7 @@ export const heatmapDef: ChartTemplateDef = { else delete spec.encoding; } } + spanCalendarCells(spec, ctx); }, properties: [ { key: 'showValueLabels', label: 'Values', type: 'binary', defaultValue: false }, diff --git a/packages/flint-js/src/vegalite/templates/bullet.ts b/packages/flint-js/src/vegalite/templates/bullet.ts index 6bb1cda4..08afbc32 100644 --- a/packages/flint-js/src/vegalite/templates/bullet.ts +++ b/packages/flint-js/src/vegalite/templates/bullet.ts @@ -8,7 +8,7 @@ import { resolveSeriesTarget, } from '../../core/interaction-semantics'; import { - annotationCandidates, + valueEndAnnotationCandidates, comparisonAnnotationText, presentAnnotationUpdate, } from '../../interactive/presentation/annotation'; @@ -94,13 +94,7 @@ export const bulletChartDef: ChartTemplateDef = { }, resolve: (event, context) => resolveSeriesTarget(event, context, seriesField), presentUpdate: presentAnnotationUpdate( - () => annotationCandidates('right', 'left', 'top', 'bottom', 'center').map((candidate) => ({ - ...candidate, - connectorAnchors: [ - { role: 'bullet-actual', connection: 'value-end' as const, valueAxis: 'x' as const }, - { role: 'bullet-expected', connection: 'center' as const }, - ], - })), + () => valueEndAnnotationCandidates('x'), comparisonAnnotationText(actualField, expectedField), ), }; diff --git a/packages/flint-js/src/vegalite/templates/index.ts b/packages/flint-js/src/vegalite/templates/index.ts index d1941670..d4e99c59 100644 --- a/packages/flint-js/src/vegalite/templates/index.ts +++ b/packages/flint-js/src/vegalite/templates/index.ts @@ -180,10 +180,10 @@ function makeAxisDtypeCheck(axis: 'x' | 'y', banded: boolean) { return (ctx: OptionEvalContext): { applicable: boolean; recommendedValue?: any } => { const cs = ctx.channelSemantics?.[axis]; if (!cs?.field) return { applicable: false }; - // Dates read as snapshots along a banded chart are drawn discrete by default; a time - // scale stays one choice away. - const snapshots = Boolean(cs.snapshots) || (banded && cs.type === 'temporal' - && readsAsSnapshots((ctx.data ?? []).map(r => r[cs.field]))); + const values = (ctx.data ?? []).map(r => r[cs.field]); + // Dates read as snapshots along a banded chart are drawn discrete by default; a time scale + // stays one choice away. + const snapshots = Boolean(cs.snapshots) || (banded && cs.type === 'temporal' && readsAsSnapshots(values)); const recommendedValue = snapshots ? 'nominal' : 'temporal'; // Once the user picks a value the override flips cs.type, so keep // the control visible on any explicit choice. diff --git a/packages/flint-js/src/vegalite/templates/line.ts b/packages/flint-js/src/vegalite/templates/line.ts index bb3ebe7b..eec8280f 100644 --- a/packages/flint-js/src/vegalite/templates/line.ts +++ b/packages/flint-js/src/vegalite/templates/line.ts @@ -129,6 +129,40 @@ function buildContinuousColorLayers( } } +/** Rows a series stands on, for the lone-row test below. */ +const LONE_SERIES_ROWS = '__flint_series_rows'; + +/** + * A series with one row draws no line, so its value would not be on the chart at all, nor could a + * note find it. Such series are drawn as a point each, on a layer of their own over the lines; a + * chart that already draws its points, or is faceted, is left as it is. + */ +function drawLoneSeriesPoints(spec: any, ctx: InstantiateContext): void { + const mark = typeof spec.mark === 'string' ? { type: spec.mark } : spec.mark; + if (!mark || mark.type !== 'line' || mark.point) return; + const encoding = spec.encoding ?? {}; + if (encoding.column || encoding.row || encoding.facet) return; + const series = [encoding.color?.field, encoding.detail?.field, encoding.strokeDash?.field].filter((field): field is string => !!field); + if (series.length === 0) return; + const counts = new Map(); + for (const row of ctx.table ?? []) { + const key = JSON.stringify(series.map((field) => row[field])); + counts.set(key, (counts.get(key) ?? 0) + 1); + } + if (![...counts.values()].some((count) => count === 1)) return; + spec.layer = [ + { mark: spec.mark }, + { + transform: [ + { joinaggregate: [{ op: 'count', as: LONE_SERIES_ROWS }], groupby: series }, + { filter: `datum.${LONE_SERIES_ROWS} === 1` }, + ], + mark: { type: 'point', filled: true, size: 50, opacity: 1 }, + }, + ]; + delete spec.mark; +} + export const lineChartDef: ChartTemplateDef = { chart: "Line Chart", template: { mark: "line", encoding: {} }, @@ -187,6 +221,7 @@ export const lineChartDef: ChartTemplateDef = { defaultBuildEncodings(spec, ctx.resolvedEncodings); spec.mark = applyInterpolate(spec.mark, ctx.chartProperties); spec.mark = applyShowPoints(spec.mark, ctx); + drawLoneSeriesPoints(spec, ctx); }, properties: [interpolateConfigProperty, showPointsProperty], // No `transpose`: a line pins its domain to `x` (never a vertical line, for any diff --git a/packages/flint-js/src/vegalite/templates/map-labels.ts b/packages/flint-js/src/vegalite/templates/map-labels.ts new file mode 100644 index 00000000..790d00e9 --- /dev/null +++ b/packages/flint-js/src/vegalite/templates/map-labels.ts @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * A point map's labels: the `text` field written beside each point, as an atlas names its places. + * + * Where each point lands is worked out at compile time, through the projection Vega will draw (see + * `planProjection`), and each label is placed beside its point — right, left, above or below, + * whichever first clears every dot, every label placed before it and the plot's edge, and on a route + * map its lines too where it can (a label crosses a line rather than go unplaced). A point whose label + * fits nowhere keeps its dot unnamed. Labels are placed in priority — the largest dots first where + * `size` sizes them, else those at the ends of a quantity's colour scale, else the rows in order — + * one per `LABEL_ROOM` square px of the plot at most, each with a little room kept round it, so a + * dense map names its most salient places and leaves the rest to their tooltips. + * + * A placed label keeps its point and its offset from it in px: drawn at the point through the live + * projection (as a route's heads are), it stays beside its point through a pan, a zoom or a globe's + * turn. A zoom only parts the points, so labels placed apart stay apart. + */ + +import { measureIn } from '../../core/backend-frame'; +import { frontFacingExpr, planProjection } from '../../chart-types/geo-frame'; +import { stopRadii, type Route } from '../../chart-types/map-routes'; +import { GEO_ROTATE_SIGNAL } from '../interactions/geo-levels'; +import { MAP_ROLE } from './map-style'; +import { ROUTE_PROJECTION_TOKEN, rowFields } from './map-routes'; + +/** The labels' type size in px. */ +export const LABEL_SIZE = 10; +/** One label per this many square px of the plot, at most (and at least a dozen). */ +const LABEL_ROOM = 36000; +/** Room kept round each label, in px, so a dense map's names do not run together. */ +const LABEL_PAD = { x: 6, y: 3 }; +/** The gap between a dot's edge and its label, in px. */ +const LABEL_GAP = 2; +/** The width of the halo round a label's letters, in px. */ +const LABEL_HALO = 2.5; +/** How far apart a route's line is traced for labels to keep off, and how far either side it reaches, in px. */ +const LINE_STEP = 5; +const LINE_REACH = 3; +/** A dot's area where `size` does not set it (Vega-Lite's own point size). */ +const DOT_AREA = 30; +/** A sized dot's area range on a point map, smallest to largest. */ +const SIZED_AREA: readonly [number, number] = [9, 361]; + +/** The fields a label's datum carries: the point it names, and where its text starts from the point in px. */ +export const LABEL_AT = 'flintLabelAt'; +export const LABEL_DX = 'flintLabelDx'; +export const LABEL_DY = 'flintLabelDy'; +const LABEL_X = 'flintLabelX'; +const LABEL_Y = 'flintLabelY'; + +interface Box { x0: number; y0: number; x1: number; y1: number } + +const overlaps = (a: Box, b: Box) => a.x0 < b.x1 && b.x0 < a.x1 && a.y0 < b.y1 && b.y0 < a.y1; + +/** Boxes on a coarse grid, so a box finds the few it might overlap without testing every one. */ +class BoxGrid { + private cells = new Map(); + constructor(private readonly cell = 40) {} + private keys(box: Box): string[] { + const keys: string[] = []; + for (let i = Math.floor(box.x0 / this.cell); i <= Math.floor(box.x1 / this.cell); i++) { + for (let j = Math.floor(box.y0 / this.cell); j <= Math.floor(box.y1 / this.cell); j++) keys.push(`${i},${j}`); + } + return keys; + } + add(box: Box): void { + for (const key of this.keys(box)) this.cells.set(key, [...(this.cells.get(key) ?? []), box]); + } + hits(box: Box, except?: Box): boolean { + return this.keys(box).some((key) => (this.cells.get(key) ?? []).some((other) => other !== except && overlaps(box, other))); + } +} + +/** + * Each row's dot radius in px as the map will draw it, near enough to keep labels off the dots: a + * route's stops as `stopRadii` sizes them (a label anchors a dot at every stop), else a bubble's. + */ +function dotRadii(rows: readonly Record[], resolved: Record, routes: boolean): (row: number) => number { + const sizeField = resolved.size?.field; + if (routes) return stopRadii(sizeField, rows, []).radius; + if (!sizeField) return () => Math.sqrt(DOT_AREA) / 2; + const max = Math.max(0, ...rows.map((row) => Math.abs(Number(row?.[sizeField]))).filter(Number.isFinite)) || 1; + return (row) => { + const value = Math.abs(Number(rows[row]?.[sizeField])); + const share = Number.isFinite(value) ? Math.sqrt(Math.min(1, value / max)) : 0; + return Math.sqrt(SIZED_AREA[0] + (SIZED_AREA[1] - SIZED_AREA[0]) * share) / 2; + }; +} + +/** + * Label a point map's points by its `text` field (see the module's note). Adds a halo layer and a + * text layer over every other, and returns how many labels it placed and left out. + */ +export function addPointLabels( + spec: any, + options: { rows: readonly Record[]; resolved: Record; routes: readonly Route[]; globe: boolean }, +): { placed: number; dropped: number } | undefined { + const { rows, resolved, routes, globe } = options; + const textField = resolved.text?.field; + const lonField = resolved.longitude?.field; + const latField = resolved.latitude?.field; + if (!textField || !lonField || !latField || !Array.isArray(spec.layer)) return undefined; + const width = Number(spec.width); + const height = Number(spec.height); + const at = (row: Record): [number, number] | undefined => { + const lon = Number(row?.[lonField]); + const lat = Number(row?.[latField]); + return Number.isFinite(lon) && Number.isFinite(lat) && Math.abs(lat) <= 90 && Math.abs(lon) <= 180 ? [lon, lat] : undefined; + }; + const places = rows.map(at); + const project = planProjection(spec.projection, [width, height], places.filter((place): place is [number, number] => place !== undefined)); + const radius = dotRadii(rows, resolved, routes.length > 0); + const measure = measureIn({ fontSize: LABEL_SIZE, fontWeight: 500 }); + const lineHeight = LABEL_SIZE * 1.2; + + // Every dot is an obstacle, whether or not it is named. + const grid = new BoxGrid(); + const points = rows.map((row, index) => { + const place = places[index]; + const xy = place && project?.(place); + if (!xy) return undefined; + const r = radius(index); + const dot = { x0: xy[0] - r, y0: xy[1] - r, x1: xy[0] + r, y1: xy[1] + r }; + grid.add(dot); + return { index, place, x: xy[0], y: xy[1], r, dot }; + }); + // A route's lines, traced every few px: a label keeps off them where it can. + const lines = new BoxGrid(); + for (const route of routes) { + for (const leg of route.legs) { + const drawn = leg.path.map((place) => project?.(place)); + for (let i = 1; i < drawn.length; i++) { + const [a, b] = [drawn[i - 1], drawn[i]]; + if (!a || !b) continue; + const steps = Math.max(1, Math.ceil(Math.hypot(b[0] - a[0], b[1] - a[1]) / LINE_STEP)); + for (let k = 0; k <= steps; k++) { + const [x, y] = [a[0] + ((b[0] - a[0]) * k) / steps, a[1] + ((b[1] - a[1]) * k) / steps]; + lines.add({ x0: x - LINE_REACH, y0: y - LINE_REACH, x1: x + LINE_REACH, y1: y + LINE_REACH }); + } + } + } + } + // The largest dots are named first, where `size` sizes them; else the ends of a quantity's colour scale; else the rows in their order. + const sizeField = resolved.size?.field; + const colorField = resolved.color?.type === 'quantitative' ? resolved.color.field : undefined; + const order = points.filter((point): point is NonNullable => point !== undefined) + .filter((point) => rows[point.index]?.[textField] != null && String(rows[point.index][textField]).trim() !== ''); + if (sizeField) order.sort((a, b) => (Math.abs(Number(rows[b.index][sizeField])) || 0) - (Math.abs(Number(rows[a.index][sizeField])) || 0)); + else if (colorField) { + const valued = order.map((point) => Number(rows[point.index][colorField])).filter(Number.isFinite).sort((a, b) => a - b); + const rank = (value: number) => (valued.length > 1 ? Math.abs(valued.indexOf(value) / (valued.length - 1) - 0.5) : -1); + const extremity = (point: (typeof order)[number]) => { + const value = Number(rows[point.index][colorField]); + return Number.isFinite(value) ? rank(value) : -1; + }; + order.sort((a, b) => extremity(b) - extremity(a)); + } + const budget = Math.max(12, Math.round((width * height) / LABEL_ROOM)); + + const values: Record[] = []; + for (const point of order) { + if (values.length >= budget) break; + const text = String(rows[point.index][textField]); + const w = measure(text); + const reach = point.r + LABEL_GAP; + // Where its text starts (its left edge, its middle line) from the point: right, left, above, below. + const spots: [number, number][] = [[reach, 0], [-reach - w, 0], [-w / 2, -reach - lineHeight / 2], [-w / 2, reach + lineHeight / 2]]; + const boxes = spots.map(([dx, dy]) => ({ dx, dy, box: { x0: point.x + dx, x1: point.x + dx + w, y0: point.y + dy - lineHeight / 2, y1: point.y + dy + lineHeight / 2 } })) + .filter(({ box }) => box.x0 >= 0 && box.y0 >= 0 && box.x1 <= width && box.y1 <= height && !grid.hits(box, point.dot)); + const padded = (box: (typeof boxes)[number]['box']) => ({ x0: box.x0 - LABEL_PAD.x, x1: box.x1 + LABEL_PAD.x, y0: box.y0 - LABEL_PAD.y, y1: box.y1 + LABEL_PAD.y }); + // Clear of the lines first; else across one. + const spot = boxes.find(({ box }) => !lines.hits(box)) ?? boxes[0]; + if (!spot) continue; + grid.add(padded(spot.box)); + values.push({ + ...rowFields(rows[point.index]), + [LABEL_AT]: { type: 'Point', coordinates: point.place }, + [LABEL_DX]: Math.round(spot.dx * 10) / 10, + [LABEL_DY]: Math.round(spot.dy * 10) / 10, + }); + } + if (!values.length) return { placed: 0, dropped: order.length }; + + const projected = `geoCentroid(${JSON.stringify(ROUTE_PROJECTION_TOKEN)}, datum.${LABEL_AT})`; + const transform = [ + { calculate: `${projected}[0] + datum.${LABEL_DX}`, as: LABEL_X }, + { calculate: `${projected}[1] + datum.${LABEL_DY}`, as: LABEL_Y }, + ]; + const encoding = { + x: { field: LABEL_X, type: 'quantitative', scale: null, axis: null }, + y: { field: LABEL_Y, type: 'quantitative', scale: null, axis: null }, + text: { field: textField, type: 'nominal' }, + // A label past a globe's horizon would show through it: it is hidden there. + ...(globe ? { opacity: { condition: [{ test: `!(${frontFacingExpr(`datum.${LABEL_AT}.coordinates[0]`, `datum.${LABEL_AT}.coordinates[1]`, GEO_ROTATE_SIGNAL)})`, value: 0 }] } } : {}), + tooltip: null, + }; + const mark = { type: 'text', align: 'left', baseline: 'middle', fontSize: LABEL_SIZE, fontWeight: 500, clip: true }; + spec.layer.push( + { [MAP_ROLE]: 'labelHalo', data: { values }, transform, mark: { ...mark, strokeWidth: LABEL_HALO, strokeJoin: 'round' }, encoding }, + { [MAP_ROLE]: 'label', data: { values }, transform, mark, encoding }, + ); + return { placed: values.length, dropped: order.length - values.length }; +} + +/** A region label's width in px, carried on its row so the map can tell whether its region holds it. */ +export const LABEL_W = 'flintLabelW'; +const LABEL_BOUNDS = 'flintLabelBounds'; +const LABEL_CENTRE = 'flintLabelCentre'; + +/** The width of a label's text in px, as the map sets it. */ +export function labelWidth(text: unknown): number { + return text == null ? 0 : Math.round(measureIn({ fontSize: LABEL_SIZE, fontWeight: 500 })(String(text)) * 10) / 10; +} + +/** The ink a region's label takes where white would not read better on its fill. */ +export const REGION_LABEL_INK = '#2b2f33'; + +/** + * Label a choropleth's regions by its `text` field (`textField`): each at its middle on screen, + * through the live projection, shown only while the region is wider and taller there than its label + * — so a small region's label appears as a zoom brings it close. A label is drawn from its region's + * own shape: every layer that joins the rows (each level of a US map, gated as its level is) is + * labelled by a copy of its data and its join. `spec` is layered. + * + * A label sits on its region's one flat colour: it takes whichever of white and a dark ink reads + * better on that fill — the colour scale's own value for its row (`color`, the regions' colour + * encoding), so it follows the classes, ramps and schemes the regions do. Its halo is the region's + * own colour: unseen inside the region, it keeps the label readable where it runs past the region's + * edge (a coast, an archipelago). + */ +export function addRegionLabels(spec: any, textField: string, color?: Record): void { + const colorField: string | undefined = color?.field; + const joins = (layer: any) => (layer?.transform ?? []).some((step: any) => step?.lookup && step.from?.fields?.includes(textField)); + const regions = spec.layer.filter((layer: any) => layer?.mark && joins(layer)); + const proj = JSON.stringify(ROUTE_PROJECTION_TOKEN); + for (const region of regions) { + const transform = [ + ...region.transform, + { filter: `isValid(datum[${JSON.stringify(textField)}]) && datum[${JSON.stringify(textField)}] !== ''` }, + { calculate: `geoCentroid(${proj}, datum)`, as: LABEL_CENTRE }, + { calculate: `geoBounds(${proj}, datum)`, as: LABEL_BOUNDS }, + { calculate: `datum.${LABEL_CENTRE}[0]`, as: LABEL_X }, + { calculate: `datum.${LABEL_CENTRE}[1]`, as: LABEL_Y }, + ]; + const encoding = { + x: { field: LABEL_X, type: 'quantitative', scale: null, axis: null }, + y: { field: LABEL_Y, type: 'quantitative', scale: null, axis: null }, + text: { field: textField, type: 'nominal' }, + // Shown where the region on screen holds its label, with a little room round it. + opacity: { condition: [{ + test: `datum.${LABEL_BOUNDS}[1][0] - datum.${LABEL_BOUNDS}[0][0] < datum.${LABEL_W} + 4 || datum.${LABEL_BOUNDS}[1][1] - datum.${LABEL_BOUNDS}[0][1] < ${LABEL_SIZE * 1.4}`, + value: 0, + }] }, + ...(colorField ? { color: { condition: { test: whiteReads(colorField), value: '#ffffff' }, value: REGION_LABEL_INK } } : {}), + tooltip: null, + }; + const mark = { type: 'text', align: 'center', baseline: 'middle', fontSize: LABEL_SIZE, fontWeight: 500, clip: true }; + const data = region.data; + if (colorField) { + // The halo strokes the letters in the regions' own colour scale (a text mark not filled + // takes its colour as its stroke); the key stays the regions'. + const { color: _ink, ...plain } = encoding; + // One scale, so the halo takes the regions' colours; the key stays the regions' own. + spec.resolve = { ...(spec.resolve ?? {}), legend: { ...(spec.resolve?.legend ?? {}), color: 'independent' } }; + spec.layer.push({ + ...(data ? { data } : {}), transform, + mark: { ...mark, filled: false, strokeWidth: LABEL_HALO, strokeJoin: 'round' }, + encoding: { ...plain, color: { ...color, legend: null } }, + }); + } + spec.layer.push({ [MAP_ROLE]: 'label', ...(data ? { data } : {}), transform, mark, encoding }); + } +} + +/** Whether white contrasts more than the dark ink with the fill the colour scale gives a row's value. */ +function whiteReads(colorField: string): string { + const fill = `scale('color', datum[${JSON.stringify(colorField)}])`; + return `isValid(${fill}) && contrast('#ffffff', ${fill}) > contrast('${REGION_LABEL_INK}', ${fill})`; +} diff --git a/packages/flint-js/src/vegalite/templates/map-routes.ts b/packages/flint-js/src/vegalite/templates/map-routes.ts new file mode 100644 index 00000000..e6f16f14 --- /dev/null +++ b/packages/flint-js/src/vegalite/templates/map-routes.ts @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * A `Map`'s routes in Vega-Lite: lines and arrowheads, drawn between the stops' true places. + * + * - A casing: each line drawn first, wider, in the ground's own light (white, or the page on a dark + * map), so a route stands off the land, the borders and the routes it crosses. + * - The lines: GeoJSON LineStrings drawn as geoshapes, so the projection draws them — great circles + * between vertices, cut at the antimeridian, hidden past a globe's horizon — and they follow a + * pan, a zoom or a turn with no rebuild. A route takes its series' colour where the colour names + * the series; else it is drawn in a neutral ink and the points keep the colour. + * - Arrowheads (`chartProperties.arrows`, on by default): a triangle at the end of each leg, its + * tip on the stop. Its heading is read off the live projection by the spec itself (`geoCentroid` + * of the leg's end and of points just before it), so it turns with the map in any Vega renderer, + * Flint's or a host's. + * + * A route draws no dot of its own. The stops are the map's points, drawn as dots beneath the routes + * where the points carry something the routes do not (`size`, `shape`, `text`, a quantity's colour), + * else only at each route's start, where no head marks it (`routeDotsEverywhere`). An undrawn stop + * keeps its tooltip and hover. Layers go in two passes, every halo then every ink — the casings and + * heads' halos, then the dots (their rim their halo), the lines and the heads — so a halo parts a + * route from the ground but never cuts between a line, its dot and its head. Lines and heads know + * nothing of the dots. + * + * Each leg is a shape of its own and carries the fields of the row it leaves from, as a line chart's + * segment starts at its row: it takes that row's interaction key, so hover, emphasis, hiding and + * notes reach it (`kind: 'path'` names the leg, as it names a line's segment), and it recedes with + * the row. Its casing and head carry the same fields and recede with it, but are no target of their + * own. None takes a tooltip: the points carry them. + */ + +import { ROUTE_WIDTH, STOP_RADIUS_BY_VALUE, TAIL, buildRoutes, headSize, largestMagnitude, legWidths, routeArrows, widestLeg, routeDotsEverywhere, routeOpacity, routeStartRows, stopRadii, type Route } from '../../chart-types/map-routes'; +import { frontFacingExpr } from '../../chart-types/geo-frame'; +import { GEO_ROTATE_SIGNAL } from '../interactions/geo-levels'; +import { MAP_ROLE } from './map-style'; + +/** + * Marks a route dataset, so the map's focus regions are never read from its lines. The route data's + * own fields take no leading underscore: a host that strips Flint's private `_` keys keeps them. + */ +export const ROUTE_DATUM = 'flintRoute'; + +/** Which part of a route a datum draws: a leg's casing, the leg, or its head. */ +export const ROUTE_PART = 'flintRoutePart'; +export type RoutePart = 'casing' | 'leg' | 'head'; + +/** Fields a route datum's GeoJSON needs for itself, which a row's own fields of the same name do not overwrite. */ +const GEOJSON_FIELDS = new Set(['type', 'geometry', 'properties']); + +/** The projection the arrowheads' heading is read through; renamed where a wrapper renames the view's projection. */ +export const ROUTE_PROJECTION_TOKEN = 'projection'; + +/** The halo's reach past its line, both sides together, in px: a hairline each side, as Data Formulator draws one. */ +const CASING_GROWTH = 1.5; +/** Legs (and their heads) thinner than this, in px, take no halo. */ +const HALO_MIN_WIDTH = 1.5; +/** The width of the halo round a head, its stroke centred on the head's edge: a hairline outside it. */ +const HEAD_HALO = 1.5; + +/** How a route's ink is chosen when no series colour names it: the theme's mark colour, or a neutral one beside dots coloured by another field. */ +export const ROUTE_INK = '__flintRouteInk'; +/** The width of the halo round a drawn stop, its stroke centred on the dot's edge. */ +const STOP_HALO = 1; +/** A head is drawn as a path in px about its tip, at the size that makes a symbol's units px. */ +const HEAD_SYMBOL_SIZE = 4; +/** + * A head's full size wants its leg this many head lengths long on screen (tip to base); a shorter leg + * shrinks its head to fit, down to `MIN_HEAD` of its size, then to the leg's own length — a short leg + * keeps a small head rather than reading as dot–line–dot. Only a head under `MIN_HEAD_PX` is dropped. + */ +const SHORT_LEG = 1.6; +const MIN_HEAD = 0.6; +const MIN_HEAD_PX = 3; +/** A stop this many headed legs arrive at takes their heads on a ring round it, shrunk with their number. */ +const RING_ARRIVALS = 3; +/** At most this many legs arriving at one stop keep a head: the widest. */ +const HEAD_BUDGET = 12; +/** + * How far into its head a leg's line runs, in px: a hair, so no seam shows where they meet. The line + * ends at the head's base rather than inside it: a faded route is drawn translucent, and line and head + * overlapping would show the line's end through the head. + */ +const INTO_HEAD = 0.5; + +const TIP_LON = 'flintTipLon'; +const TIP_LAT = 'flintTipLat'; +/** The tail: points back along the line from the tip, nearest first (`Route` legs' and arrows' `tail`). */ +export const TAIL_FIELD = 'flintTail'; +/** A head's length on screen, tip to base, in px, at its full size. */ +const BACK = 'flintBack'; +/** Whether the head shrinks to fit its leg on screen (1) or keeps its size (0: a track's, a globe's, one across the antimeridian). */ +const FIT = 'flintFit'; +/** Whether a leg's line is cut short inside its head (1), or drawn whole (0). */ +const JOIN = 'flintJoin'; +/** How far short of its stop a head's tip stands, in px: 0, or a ring where many heads arrive at one stop. */ +const RING = 'flintRing'; +const HEAD_SHAPE = 'flintHeadShape'; +const CASING_WIDTH_FIELD = 'flintCasingWidth'; + +/** The field that splits rows into routes: `detail`, else a categorical colour. */ +export function routeSeriesField(resolved: Record): string | undefined { + if (resolved.detail?.field) return resolved.detail.field; + const color = resolved.color; + return color?.field && (color.type === 'nominal' || color.type === 'ordinal') ? color.field : undefined; +} + +/** The routes a point map's rows make, where an `order` field joins them. */ +export function mapRoutes(rows: readonly Record[], resolved: Record, chartProperties: Record | undefined, globe: boolean): Route[] { + const order = resolved.order?.field; + const longitude = resolved.longitude?.field; + const latitude = resolved.latitude?.field; + if (!order || !longitude || !latitude) return []; + return buildRoutes(rows, { longitude, latitude, order, series: routeSeriesField(resolved), curve: chartProperties?.curve, globe }); +} + +/** A row's own fields, for a route datum that stands for it: all but those its GeoJSON needs. */ +export function rowFields(row: Record | undefined): Record { + return Object.fromEntries(Object.entries(row ?? {}).filter(([field]) => !GEOJSON_FIELDS.has(field))); +} + +/** + * The length of a step in an expression: `sqrt` and `pow` rather than `hypot`, which a CSP-safe Vega + * (`vega-interpreter`) does not provide. + */ +function distance(dx: string, dy: string): string { + return `sqrt(pow(${dx}, 2) + pow(${dy}, 2))`; +} + +/** The k-th point of a datum's tail on screen, through the live projection. */ +const tailAt = (k: number) => `geoCentroid(${JSON.stringify(ROUTE_PROJECTION_TOKEN)}, datum.${TAIL_FIELD}[${k}])`; + +/** How far the k-th point of the tail lies from its tip on screen, in a straight line. */ +const fromTip = (k: number) => distance(`${tailAt(k)}[0] - ${tailAt(0)}[0]`, `${tailAt(k)}[1] - ${tailAt(0)}[1]`); + +/** A leg's length on screen: the chords along its tail. */ +function tailLengthExpr(): string { + return Array.from({ length: TAIL.length - 1 }, (_, k) => distance(`${tailAt(k + 1)}[0] - ${tailAt(k)}[0]`, `${tailAt(k + 1)}[1] - ${tailAt(k)}[1]`)).join(' + '); +} + +/** + * A head's size on screen as a share of its full size, from its leg's length on screen (`span`, tip to + * start, straight, which a leg's gentle bow barely shortens): 1 where the leg is at least `SHORT_LEG` + * head lengths long (its ring too), else the share that fits, down to `MIN_HEAD` — and never longer + * than the leg itself. Where it does not shrink (`flintFit` 0), 1. + */ +function scaleFor(span: string): string { + const fit = `max(${MIN_HEAD}, min(1, ${span} / (${SHORT_LEG} * (datum.${RING} + datum.${BACK}))))`; + return `(datum.${FIT} ? min(${fit}, (0.95 * ${span} - datum.${RING}) / datum.${BACK}) : 1)`; +} + +function headScaleExpr(): string { + return scaleFor(fromTip(TAIL.length - 1)); +} + +/** The fields a head's transforms compute: its tail on screen, its points' distances from the tip, its scale, and its heading. */ +const PTS = 'flintPts'; +const DIST = 'flintDist'; +const SCALE = 'flintScale'; +const ANGLE = 'flintAngle'; +const HEAD_X = 'flintX'; +const HEAD_Y = 'flintY'; +const HEAD_SIZE = 'flintSize'; +const BASE_X = 'flintBaseX'; +const BASE_Y = 'flintBaseY'; + +/** + * A head's geometry on screen, as transforms on its own data through the live projection, so each of + * its tail's points is projected once and the head follows a pan, zoom or turn: + * + * - its tail on screen, stop first, and each point's straight distance from the stop; + * - its scale (`scaleFor`): 1 where the leg is long enough, else the share that fits; + * - its tip: the stop, or a ring's width short of it where many heads arrive there; + * - its heading, from its base to its tip. The base is where the line lies the head's length beyond + * the tip — so the middle of the base is on the line however sharply the line turns there. + * + * A point that far along the line lies between the first point of the tail that far from the stop and + * the one before, at the share of the way that distance falls; a tail none of whose points lies that + * far: its last point. + * + * The head is placed by its tip's x and y rather than by longitude and latitude, so these transforms, + * which read the projection, never feed a fit of the projection to the data. + */ +function headTransforms(): Record[] { + const n = TAIL.length; + const pt = (k: number) => `datum.${PTS}[${k}]`; + const d = (k: number) => `datum.${DIST}[${k}]`; + const along = (reach: string, axis: 0 | 1): string => { + const share = (k: number) => `clamp((${reach} - ${d(k - 1)}) / max(0.000001, ${d(k)} - ${d(k - 1)}), 0, 1)`; + let chosen = `${pt(n - 1)}[${axis}]`; + for (let k = n - 1; k >= 1; k--) { + chosen = `(${d(k)} >= ${reach} ? (${pt(k - 1)}[${axis}] + ${share(k)} * (${pt(k)}[${axis}] - ${pt(k - 1)}[${axis}])) : ${chosen})`; + } + return chosen; + }; + const ring = `datum.${RING}`; + const base = `(${ring} + datum.${BACK} * datum.${SCALE})`; + return [ + { calculate: `[${Array.from({ length: n }, (_, k) => tailAt(k)).join(', ')}]`, as: PTS }, + { calculate: `[${Array.from({ length: n }, (_, k) => distance(`${pt(k)}[0] - ${pt(0)}[0]`, `${pt(k)}[1] - ${pt(0)}[1]`)).join(', ')}]`, as: DIST }, + { calculate: scaleFor(d(n - 1)), as: SCALE }, + { calculate: `${ring} > 0 ? ${along(ring, 0)} : ${pt(0)}[0]`, as: HEAD_X }, + { calculate: `${ring} > 0 ? ${along(ring, 1)} : ${pt(0)}[1]`, as: HEAD_Y }, + { calculate: along(base, 0), as: BASE_X }, + { calculate: along(base, 1), as: BASE_Y }, + { calculate: `atan2(datum.${HEAD_Y} - datum.${BASE_Y}, datum.${HEAD_X} - datum.${BASE_X}) * 180 / PI`, as: ANGLE }, + // A symbol's path scales with the square root of its size: a shrunk head keeps its shape. + { calculate: `${HEAD_SYMBOL_SIZE} * pow(datum.${SCALE}, 2)`, as: HEAD_SIZE }, + ]; +} + +/** + * A leg's dash: where it carries a head of at least `MIN_HEAD_PX`, its line up to the head's base and a + * hair past it (`INTO_HEAD`), so no seam shows and line and head barely overlap; else the whole line. + */ +function legDashExpr(): string { + const scale = headScaleExpr(); + const length = `(${tailLengthExpr()})`; + const cut = `max(0, datum.${RING} + datum.${BACK} * ${scale} - ${INTO_HEAD})`; + return `datum.${JOIN} && datum.${BACK} * ${scale} >= ${MIN_HEAD_PX} ? [max(0, ${length} - ${cut}), 1000000] : [1000000, 0]`; +} + +const area = (radius: number) => (2 * radius) ** 2; + +/** + * The size of a route's dots (`stopRadii`): one for all, a symbol's size (its diameter squared), or + * a scale from the `size` field, with a key of its own. + */ +function routeStopSize(resolved: Record, rows: readonly Record[], widths: readonly number[]): number | Record { + const field = resolved.size?.field; + const radii = stopRadii(field, rows, widths); + if (!radii.byValue) return area(radii.radius(0)); + // The chart's own key settings (its title, where it stands) carry over; the scale is the stops'. + const { scale: _scale, ...own } = resolved.size; + const [low, high] = [area(STOP_RADIUS_BY_VALUE.min), area(STOP_RADIUS_BY_VALUE.max)]; + return { ...own, field, type: 'quantitative', scale: { domain: [0, radii.byValue.max], range: [low, high], zero: true } }; +} + +/** + * A test for the rows not among `shown`, read off a dot's datum: by its route (`detail`, else its + * colour) and its place in the route's order, which a row of the table keeps in the dots' data. + */ +function unshownTest(rows: readonly Record[], resolved: Record, shown: readonly number[]): string | undefined { + const order = resolved.order?.field; + if (!order) return undefined; + const series = routeSeriesField(resolved); + const temporal = resolved.order?.type === 'temporal'; + const at = (field: string) => `datum[${JSON.stringify(field)}]`; + // A temporal order is parsed to a date in the dots' data: it is matched by its time. + const orderExpr = temporal ? `(isDate(${at(order)}) ? time(${at(order)}) : ${at(order)})` : at(order); + const orderKey = (value: unknown) => (temporal && !(value instanceof Date) && typeof value === 'string' ? Date.parse(value) : value instanceof Date ? value.getTime() : value); + const key = (row: number) => `${series ? `${String(rows[row]?.[series])}|` : ''}${String(orderKey(rows[row]?.[order]))}`; + const keys = [...new Set(shown.map(key))]; + return `indexof(${JSON.stringify(keys)}, ${series ? `'' + ${at(series)} + '|' + ` : ''}'' + ${orderExpr}) < 0`; +} + +/** + * Draw a route's stops — the map's own points, which carry its tooltips, hover, notes and colour key — + * as dots beneath the routes; those `hidden` names undrawn, but where the pointer finds them. The + * routes read nothing of this. + */ +function styleRouteStops(dots: any, size: number | Record, hidden?: string): void { + const base = typeof dots.mark === 'string' ? { type: dots.mark } : dots.mark; + // `strokeWidth` is the legs' width, and `size` is read here as the stops' own scale: neither reaches + // the dots as Vega-Lite's. + const { size: _size, strokeWidth: _strokeWidth, ...encoding } = dots.encoding ?? {}; + dots.encoding = encoding; + // Opaque and haloed, so a dot stands off the casing beneath it and the dots it overlaps. + dots[MAP_ROLE] = 'routeStop'; + dots.mark = { ...base, filled: true, opacity: 1, fillOpacity: 1, strokeWidth: STOP_HALO }; + if (typeof size === 'number') dots.mark.size = size; + else dots.encoding.size = size; + // An undrawn stop keeps its tooltip and hover. A gate only, no value of its own: interaction keeps + // it first and manages the rest. + if (hidden) dots.encoding.opacity = { condition: [{ test: hidden, value: 0 }, ...conditionsOf(dots.encoding.opacity)] }; +} + +const conditionsOf = (channel: any): any[] => (channel?.condition ? [channel.condition].flat() : []); + +/** + * Add the casing, line and arrowhead layers of a point map's routes, round its points: the casing + * beneath them, the lines and heads over them. + * + * A route's legs are as wide as `strokeWidth` says (from the row each leaves, zero-based to 8 px), else 1.75 + * px; a key reads the widths. Each head is sized to its line, Data Formulator's way, and set on it: + * its tip on the stop, the middle of its base on the line a head's length back, the line ending + * square at its base. A leg too short on screen for its head shrinks it to fit, and below 60% of its + * size keeps its line alone. Lines are square-ended and mitred; a hairline halo — white on a light + * map, the ground on a dark one — runs round line and head alike. + */ +export function addRouteLayers( + spec: any, + routes: readonly Route[], + options: { rows: readonly Record[]; resolved: Record; chartProperties?: Record; globe: boolean }, +): void { + if (!routes.length || !Array.isArray(spec.layer)) return; + const { rows, resolved, chartProperties, globe } = options; + const series = routeSeriesField(resolved); + const color = resolved.color; + // The line takes the colour where the colour names the route, or names a stretch of it (a leg of a + // voyage, a phase): a categorical colour paints each leg as the row it leaves. The shared scale + // keeps them one key. A quantity's colour stays on the dots, the line in a neutral ink. + const categorical = color?.type === 'nominal' || color?.type === 'ordinal'; + const colorEncoding = color?.field && (color.field === series || categorical) + ? { field: color.field, type: color.type, ...(color.scale ? { scale: color.scale } : {}), legend: null } + : undefined; + // One scale, so a route and its points share a colour; the key stays the points' own. + if (colorEncoding) spec.resolve = { ...(spec.resolve ?? {}), legend: { ...(spec.resolve?.legend ?? {}), color: 'independent' } }; + + // Widths: by the strokeWidth field, from the row each leg leaves; else every leg alike. + const size = resolved.strokeWidth?.field; + const allLegs = routes.flatMap((route) => route.legs); + // The key's domain is every row's, so a leg's width and the key agree. + const maxValue = size ? largestMagnitude(rows.map((row) => row[size])) : 0; + // The widest leg thins as long, widened legs crowd the plot. + const plotSide = Math.sqrt((Number(spec.width) || 400) * (Number(spec.height) || 300)); + const widest = size ? widestLeg(allLegs, allLegs.map((leg) => rows[leg.from]?.[size]), plotSide) : ROUTE_WIDTH.max; + const legValues = size ? legWidths(allLegs.map((leg) => rows[leg.from]?.[size]), maxValue, widest) : []; + const widths = new Map(allLegs.map((leg, index) => [leg, size ? legValues[index] : ROUTE_WIDTH.plain])); + const stopSize = routeStopSize(resolved, rows, allLegs.map((leg) => widths.get(leg)!)); + // A dot at every stop where the points carry what the routes do not; else at each route's start. + const everywhere = routeDotsEverywhere({ + size: Boolean(resolved.size?.field), shape: Boolean(resolved.shape?.field), text: Boolean(resolved.text?.field), + pointColor: Boolean(color?.field) && !colorEncoding, + }); + + // Heads arriving at one stop: from three on, on a ring round it, shrunk with their number; past a + // budget, only the widest legs keep theirs, the rest converging on the stop shows the way. + const allArrows = chartProperties?.arrows === false ? [] : routeArrows(routes, chartProperties?.curve, globe); + const stopKey = (point: readonly [number, number]) => `${point[0].toFixed(5)},${point[1].toFixed(5)}`; + const arriving = new Map(); + for (const arrow of allArrows) arriving.set(stopKey(arrow.tip), [...(arriving.get(stopKey(arrow.tip)) ?? []), arrow]); + const kept = new Set([...arriving.values()].flatMap((group) => [...group].sort((a, b) => widths.get(b.leg)! - widths.get(a.leg)!).slice(0, HEAD_BUDGET))); + const arrows = allArrows.filter((arrow) => kept.has(arrow)); + const headed = new Map(arrows.map((arrow) => [arrow.leg, arrow])); + const crowdAt = (leg: (typeof allLegs)[number]) => { + const arrow = headed.get(leg); + return arrow ? arriving.get(stopKey(arrow.tip))!.length : 0; + }; + const ringOf = (leg: (typeof allLegs)[number]) => (crowdAt(leg) >= RING_ARRIVALS ? Math.min(8, 2 + 1.5 * Math.sqrt(crowdAt(leg))) : 0); + const shrinkOf = (leg: (typeof allLegs)[number]) => (crowdAt(leg) >= RING_ARRIVALS ? Math.max(0.6, Math.sqrt(RING_ARRIVALS / crowdAt(leg))) : 1); + // On a globe, or across the antimeridian, a leg's measured length is not its drawn one: its line is + // drawn whole and its head keeps its size. A track's head keeps its size too: its line runs on + // through the fixes before. + const fits = (leg: (typeof allLegs)[number]) => !globe && !leg.cut && !headed.get(leg)?.track; + const tail = (points: readonly (readonly [number, number])[]) => points.map((point) => ({ type: 'Point', coordinates: point })); + const legData = (part: RoutePart) => allLegs.map((leg) => { + const arrow = headed.get(leg); + return { + ...rowFields(rows[leg.from]), + type: 'Feature', + [ROUTE_DATUM]: true, + [ROUTE_PART]: part, + [TAIL_FIELD]: tail(leg.tail), + [BACK]: headSize(widths.get(leg)!).length * shrinkOf(leg), + [RING]: ringOf(leg), + [FIT]: fits(leg) ? 1 : 0, + [JOIN]: arrow && fits(leg) ? 1 : 0, + ...(part === 'casing' ? { [CASING_WIDTH_FIELD]: widths.get(leg)! + CASING_GROWTH } : {}), + properties: {}, + geometry: { type: 'LineString', coordinates: leg.path }, + }; + }); + const opacity = routeOpacity(routes.length); + const widthEncoding = size + ? { + field: size, type: 'quantitative', scale: { domain: [0, maxValue || 1], range: [ROUTE_WIDTH.min, widest] }, + ...(resolved.strokeWidth.title !== undefined ? { title: resolved.strokeWidth.title } : {}), + legend: resolved.strokeWidth.legend === null ? null : { ...(resolved.strokeWidth.legend ?? {}), symbolType: 'stroke' }, + } + : undefined; + // The casing's widths are px of its own, not the key's: each layer keeps its own width scale and key. + spec.resolve = { + ...(spec.resolve ?? {}), + scale: { ...(spec.resolve?.scale ?? {}), strokeWidth: 'independent' }, + // The heads' size is px of their own: the stops' size key stays the dots' alone. + legend: { ...(spec.resolve?.legend ?? {}), strokeWidth: 'independent', size: 'independent' }, + }; + const dash = { value: { expr: legDashExpr() } }; + // Square ends and mitred corners: a route is drawn sharp, its line ending flush at its head's base. + const sharp = { strokeCap: 'butt', strokeJoin: 'miter' }; + const casing = { + [MAP_ROLE]: 'routeCasing', + // A thin leg takes no halo: round a hairline it outweighs the line and darkens the map under a crowd of them. + data: { values: legData('casing').filter((_, index) => widths.get(allLegs[index])! >= HALO_MIN_WIDTH) }, + // A long leg's great circle or bow can run past any frame, the world's too: drawn inside the plot only. + mark: { type: 'geoshape', filled: false, ...sharp, strokeOpacity: Math.min(0.9, opacity + 0.05), clip: true }, + encoding: { + strokeWidth: { field: CASING_WIDTH_FIELD, type: 'quantitative', scale: null, legend: null }, + strokeDash: dash, + tooltip: null, + }, + }; + // A route in no series' colour takes the theme's mark colour, as a plain dot does — or, beside dots + // coloured by another field, a neutral ink that does not read as one of their colours. + const ink = colorEncoding ? 'series' : color?.field ? 'neutral' : 'mark'; + const line = { + [MAP_ROLE]: 'route', + [ROUTE_INK]: ink, + data: { values: legData('leg') }, + mark: { type: 'geoshape', filled: false, ...sharp, strokeOpacity: opacity, clip: true, ...(widthEncoding ? {} : { strokeWidth: ROUTE_WIDTH.plain }) }, + encoding: { + ...(colorEncoding ? { color: colorEncoding } : {}), + ...(widthEncoding ? { strokeWidth: widthEncoding } : {}), + strokeDash: dash, + tooltip: null, + }, + }; + const heads: any[] = []; + const haloes: any[] = []; + if (arrows.length) { + const values = arrows.map((arrow) => { + const full = headSize(widths.get(arrow.leg)!); + const [length, halfWidth] = [full.length * shrinkOf(arrow.leg), full.halfWidth * shrinkOf(arrow.leg)]; + return { + ...rowFields(rows[arrow.from]), + [ROUTE_DATUM]: true, + [ROUTE_PART]: 'head', + [TIP_LON]: arrow.tip[0], + [TIP_LAT]: arrow.tip[1], + [TAIL_FIELD]: tail(arrow.tail), + [BACK]: length, + [RING]: ringOf(arrow.leg), + [FIT]: fits(arrow.leg) ? 1 : 0, + // Pointing along +x, its tip on the stop, in px at full size. + [HEAD_SHAPE]: `M0,0L${-length},${-halfWidth}L${-length},${halfWidth}Z`, + }; + }); + const hidden: { test: string; value: number }[] = [ + // A leg a few px long on screen keeps its line alone. + { test: `datum.${SCALE} * datum.${BACK} < ${MIN_HEAD_PX}`, value: 0 }, + ]; + // A head past a globe's horizon would show through it, mirrored: it fades out there. + if (globe) hidden.unshift({ test: `!(${frontFacingExpr(`datum.${TIP_LON}`, `datum.${TIP_LAT}`, GEO_ROTATE_SIGNAL)})`, value: 0 }); + const placed = { + x: { field: HEAD_X, type: 'quantitative', scale: null, axis: null }, + y: { field: HEAD_Y, type: 'quantitative', scale: null, axis: null }, + angle: { field: ANGLE, type: 'quantitative', scale: null, legend: null }, + shape: { field: HEAD_SHAPE, type: 'nominal', scale: null, legend: null }, + size: { field: HEAD_SIZE, type: 'quantitative', scale: null, legend: null }, + // Gates only, no value of its own: interaction keeps them first and manages the rest. + opacity: { condition: hidden }, + tooltip: null, + }; + // The head's halo: its own shape in the halo's colour, a hairline wider, in the halo pass beneath + // the dots and lines, so neither is cut where it meets the head. + haloes.push({ + [MAP_ROLE]: 'routeHeadCasing', + data: { values: values.filter((_, index) => widths.get(arrows[index].leg)! >= HALO_MIN_WIDTH) }, + transform: headTransforms(), + mark: { type: 'point', filled: true, opacity: 1, strokeWidth: HEAD_HALO, strokeJoin: 'miter', fillOpacity: Math.min(0.9, opacity + 0.05), strokeOpacity: Math.min(0.9, opacity + 0.05), clip: true }, + encoding: placed, + }); + heads.push({ + [MAP_ROLE]: 'routeArrow', + [ROUTE_INK]: ink, + data: { values }, + transform: headTransforms(), + // No stroke: the halo beneath is the head's rim, and a dark map's ring for its dots passes it by. + mark: { type: 'point', filled: true, opacity: 1, fillOpacity: opacity, stroke: null, strokeWidth: 0, clip: true }, + encoding: { ...placed, ...(colorEncoding ? { color: colorEncoding } : {}) }, + }); + } + // Two passes, as a road map draws its casings: every halo, then every ink. A halo parts a route from + // the ground, never a route's parts from each other, so a line, its dot and the head arriving at it + // read as one shape. The dots' own rim is their halo, drawn over the casings and under the lines. + // The points carry the data and its interaction wherever they are drawn. + const isDots = (layer: any) => (typeof layer?.mark === 'string' ? layer.mark : layer?.mark?.type) === 'circle'; + const points = spec.layer.findIndex(isDots); + if (points < 0) spec.layer.push(casing, ...haloes, line); + else spec.layer.splice(points, 1, casing, ...haloes, spec.layer[points], line); + spec.layer.push(...heads); + const dots = spec.layer.find(isDots); + if (!dots) return; + // The colour scale is shared: the route's encodings keep the dots' order, else Vega-Lite merges + // their domains sorted and the key loses the data's order. + if (colorEncoding && dots.encoding?.color && 'sort' in dots.encoding.color) { + for (const layer of [line, ...heads]) layer.encoding.color = { ...layer.encoding.color, sort: dots.encoding.color.sort }; + } + styleRouteStops(dots, stopSize, everywhere ? undefined : unshownTest(rows, resolved, routeStartRows(routes, rows.length))); + if (dots.encoding?.color && dots.encoding.color.legend !== null) { + dots.encoding.color = { ...dots.encoding.color, legend: { ...(dots.encoding.color.legend ?? {}), symbolOpacity: 1 } }; + } +} diff --git a/packages/flint-js/src/vegalite/templates/map-style.ts b/packages/flint-js/src/vegalite/templates/map-style.ts new file mode 100644 index 00000000..01a8a94a --- /dev/null +++ b/packages/flint-js/src/vegalite/templates/map-style.ts @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * How a map's ground is painted, and how a choropleth's colour is classed, after the theme has had + * its say. + * + * The ground — the sea behind a globe, the land a point map stands on, the land without data, the + * borders between regions, the graticule — is set by `chartProperties.mapStyle`. `auto` derives it + * from the theme's surface and text ink, so a dark house gets a dark ground; the named styles are + * Data Formulator's map styles, with their colours as that design settled them. Rules kept from it: + * a flat map has no sea oval (water is unpainted or fills the whole plot); a globe floats on the + * page with its own sea and rim; borders and coasts are hairlines. + * + * The templates tag each structural layer with its role ({@link MAP_ROLE}); the template's + * post-process paints the roles and removes the tags. + */ + +import { mixHex, parseColor, luminance } from '../../core/theme/presence'; +import { INTERACTION_PROVENANCE } from '../interaction-provenance'; +import { stepColorScale } from '../color-classes'; +import { resampleStops } from '../../core/color-controls'; + +/** The key a template tags a structural map layer with; read and removed by {@link paintMapGround}. */ +export const MAP_ROLE = '__flintMapRole'; + +/** The tag a template puts on a map cut from a larger one — a region, clipped to its plot — until its ground is painted. */ +export const MAP_REGIONAL = '__flintMapRegional'; + +export type MapRole = 'sea' | 'land' | 'borders' | 'noData' | 'regions' | 'graticule' | 'disputed' | 'disputedBase' + | 'routeCasing' | 'routeHeadCasing' | 'route' | 'routeArrow' | 'routeStop' | 'label' | 'labelHalo'; + +/** The fill a template draws land without data in until the ground is painted; also the colour a choropleth's no-data condition names. */ +export const NO_DATA_PLACEHOLDER = '#e3e3e3'; + +/** The colours a map's ground is painted in. */ +export interface MapGround { + /** The plot's own fill on a flat map; unset leaves the page showing (no sea oval). */ + frame?: string; + /** The sea behind a globe. */ + sea: string; + /** The rim round a globe, and the coast: the outline a point map draws its land in. */ + rim: string; + /** Land a point map stands on. */ + land: string; + /** A region the data gives no value. */ + noData: string; + /** The lines between regions. */ + border: string; + graticule: string; + /** The dotted borders of areas of non-determined legal status. */ + disputed: string; +} + +export const MAP_STYLES = ['auto', 'light', 'muted', 'atlas', 'dark', 'minimal'] as const; +export type MapStyle = typeof MAP_STYLES[number]; + +/** + * A map style of the caller's own: a named style (`base`, `auto` when unset) with any of its colours + * restated. `sea` is the water, behind a globe and filling a flat map's plot; `coast` outlines the + * land and rims a globe. + */ +export interface CustomMapStyle { + base?: MapStyle; + sea?: string; + land?: string; + coast?: string; + border?: string; + noData?: string; + graticule?: string; + disputed?: string; +} + +const CUSTOM_COLORS = ['sea', 'land', 'coast', 'border', 'noData', 'graticule', 'disputed'] as const; + +export const CUSTOM_MAP_STYLE_LABEL = `a style of your own { base? (${MAP_STYLES.join(', ')}), ${CUSTOM_COLORS.map((key) => `${key}?`).join(', ')} } in CSS colours`; + +export function isCustomMapStyle(value: unknown): value is CustomMapStyle { + if (!value || typeof value !== 'object' || Array.isArray(value)) return false; + const entries = Object.entries(value); + return entries.length > 0 && entries.every(([key, colour]) => key === 'base' + ? (MAP_STYLES as readonly unknown[]).includes(colour) + : (CUSTOM_COLORS as readonly string[]).includes(key) && typeof colour === 'string' && colour.trim() !== ''); +} + +/** The named style a map style stands on: itself, or a custom style's base. */ +export function baseMapStyle(style: unknown): unknown { + return isCustomMapStyle(style) ? style.base ?? 'auto' : style; +} + +/** A ground with a custom style's colours restated over it; stated water fills a flat map's plot. */ +export function withCustomColors(ground: MapGround, style: unknown): MapGround { + if (!isCustomMapStyle(style)) return ground; + const { sea, land, coast, border, noData, graticule, disputed } = style; + return { + ...ground, + ...(sea ? { sea, frame: sea } : {}), + ...(land ? { land } : {}), + ...(coast ? { rim: coast } : {}), + ...(border ? { border } : {}), + ...(noData ? { noData } : {}), + ...(graticule ? { graticule } : {}), + ...(disputed ? { disputed } : {}), + }; +} + +/** Data Formulator's map styles (`src/maps/styles.ts`), as that design settled their colours. */ +const STYLE_GROUNDS: Record, MapGround> = { + light: { sea: '#eef3f6', rim: '#d4d4d1', land: '#e6e6e4', noData: '#dededb', border: '#ffffff', graticule: '#e8ecef', disputed: '#888888' }, + muted: { sea: '#f4f6f7', rim: '#bdbdba', land: '#f6f6f4', noData: '#ebebe8', border: '#d6d6d3', graticule: '#efefef', disputed: '#888888' }, + // Water fills the whole frame; land is paper. + atlas: { frame: '#dbe9f2', sea: '#dbe9f2', rim: '#b8cbd8', land: '#f6f3eb', noData: '#ebe6db', border: '#dad2c4', graticule: '#c2d8e6', disputed: '#888888' }, + // Borders are gaps in the ground's own colour, as the light styles' are white: a lifted grey line + // all but vanishes between regions without data, and outlines coloured ones in grey. + // Land is lifted far enough off the water (about 1.7:1) that a small island still reads. + dark: { frame: '#1d2227', sea: '#1d2227', rim: '#4b545d', land: '#3c434a', noData: '#434b53', border: '#1d2227', graticule: '#262c32', disputed: '#8a939b' }, + minimal: { sea: '#ffffff', rim: '#9a9a9a', land: '#ffffff', noData: '#f0f0f0', border: '#c9c9c9', graticule: '#eeeeee', disputed: '#888888' }, +}; + +/** A cool grey-blue the sea is tinted toward from the page. */ +const WATER = '#5b8bb0'; + +/** + * The ground a point or route map stands on, when the theme decides it: a reference map's, where the + * geography is read rather than coloured. Water fills the frame in a cool tint, land lies on it near + * the page's own colour, the coast outlines the land in a deeper water tone, and the borders between + * countries are thin lines of the ink — a choropleth's borders are gaps between coloured regions, but + * gaps vanish between regions of one fill. On a dark page the water is darker than the land. + */ +export function derivedReferenceGround(surface: string, ink: string): MapGround { + const dark = isDark(surface); + const toward = (amount: number) => mixHex(surface, ink, amount); + const water = (amount: number) => mixHex(surface, WATER, amount); + return dark + ? { + frame: water(0.1), sea: water(0.1), rim: mixHex(water(0.1), ink, 0.3), land: toward(0.13), noData: toward(0.17), + border: mixHex(water(0.1), ink, 0.05), graticule: water(0.16), disputed: toward(0.55), + } + : { + frame: water(0.14), sea: water(0.14), rim: water(0.45), land: toward(0.015), noData: toward(0.12), + border: toward(0.2), graticule: water(0.24), disputed: toward(0.47), + }; +} + +/** + * The ground a page and its ink imply: land and land without data a little toward the ink, the + * sea a little toward blue, and borders as gaps in the page colour, light or dark — Data + * Formulator's light and dark styles, measured against their page and text. + */ +export function derivedGround(surface: string, ink: string): MapGround { + const dark = isDark(surface); + const toward = (amount: number) => mixHex(surface, ink, amount); + return dark + ? { sea: mixHex(surface, WATER, 0.12), rim: toward(0.3), land: toward(0.12), noData: toward(0.17), border: surface, graticule: toward(0.08), disputed: toward(0.55) } + : { sea: mixHex(surface, WATER, 0.1), rim: toward(0.2), land: toward(0.09), noData: toward(0.12), border: surface, graticule: toward(0.07), disputed: toward(0.47) }; +} + +export function isDark(color: string): boolean { + const rgb = parseColor(color); + return rgb ? luminance(rgb) < 0.35 : false; +} + +/** The page a map is drawn on, and the ink its text is set in, as the finished spec states them. */ +function pageOf(spec: any): { surface: string; ink: string } { + const config = spec.config ?? {}; + const fill = typeof config.view?.fill === 'string' ? config.view.fill : undefined; + const surface = fill ?? (typeof spec.background === 'string' ? spec.background : undefined) + ?? (typeof config.background === 'string' ? config.background : undefined) ?? '#ffffff'; + const stated = [config.title?.color, config.axis?.labelColor, config.legend?.labelColor, config.text?.color] + .find((color) => typeof color === 'string' && parseColor(color)); + return { surface, ink: stated ?? (isDark(surface) ? '#e8eaec' : '#2b2b2b') }; +} + +/** + * The ground for a style on this spec's page. A point or route map (`reference`) left to the theme + * takes a reference map's ground; a named style is the same for every map. + */ +export function groundFor(style: unknown, spec: any, reference = false): MapGround { + if (typeof style === 'string' && style in STYLE_GROUNDS) return STYLE_GROUNDS[style as Exclude]; + const { surface, ink } = pageOf(spec); + return reference ? derivedReferenceGround(surface, ink) : derivedGround(surface, ink); +} + +/** Every unit of a spec: itself and the units of its layers and concatenations. */ +function walkUnits(node: any, visit: (unit: any) => void): void { + if (!node || typeof node !== 'object') return; + visit(node); + for (const key of ['layer', 'vconcat', 'hconcat', 'concat'] as const) { + if (Array.isArray(node[key])) for (const child of node[key]) walkUnits(child, visit); + } + if (node.spec) walkUnits(node.spec, visit); +} + +const asMark = (mark: any) => (typeof mark === 'string' ? { type: mark } : { ...(mark ?? {}) }); + +/** The tag a route layer carries for how its ink is chosen (`ROUTE_INK` in `./map-routes`); read and removed here. */ +const ROUTE_INK_KEY = '__flintRouteInk'; + +/** The colour a theme draws a plain mark in: a circle's, a point's or any mark's, else Vega-Lite's own. */ +function markColorOf(spec: any): string { + const config = spec?.config ?? {}; + const stated = [config.circle?.color, config.point?.color, config.mark?.color, config.circle?.fill, config.mark?.fill] + .find((value) => typeof value === 'string' && parseColor(value)); + return stated ?? '#4c78a8'; +} + +/** How much wider a point map's borders are drawn than its coast outline, so they cover it along each shared edge. */ +export const BORDER_COVER = 0.15; + +/** A route drawn in no series' colour: a neutral ink that reads on the ground without taking the points' colour. */ +const ROUTE_INK = '#4a5058'; +const ROUTE_INK_ON_DARK = '#cfd5da'; + +/** A label's ink on a map: dark on a light ground, light on a dark one. */ +const LABEL_INK = '#2b2f33'; +const LABEL_INK_ON_DARK = '#e6e9ec'; + +/** The marks a point map draws its data in. */ +const POINT_MARKS = new Set(['circle', 'point', 'square']); + +/** + * Paint the tagged layers of a map in its ground, give a choropleth's land without data the + * ground's no-data colour, thin or thicken the borders where the caller asks, and remove the tags. + * A flat map's plot takes the style's frame where it has one; a globe keeps the page round it. + */ +export function paintMapGround(spec: any, ground: MapGround, options: { globe: boolean; borderWidth?: number }): void { + const width = typeof options.borderWidth === 'number' && options.borderWidth >= 0 ? options.borderWidth : undefined; + const darkGround = isDark(ground.frame ?? ground.sea); + // A route's halo, round its line and its head: white on a light map, the ground's own dark on a dark + // one, as Data Formulator draws it — a hairline that parts a route from the borders and the routes + // it crosses (a halo in the water's blue would trace a blue outline over the land). + const halo = darkGround ? ground.frame ?? ground.sea : '#ffffff'; + const neutralInk = darkGround ? ROUTE_INK_ON_DARK : ROUTE_INK; + // A route in no series' colour, and its stops, take the theme's mark colour, as a plain dot does. + const markInk = markColorOf(spec); + // Where a map draws its borders as a mesh of their own, its regions are outlined at the coast. + let meshed = false; + walkUnits(spec, (unit) => { if (unit[MAP_ROLE] === 'borders') meshed = true; }); + const outline = meshed ? ground.rim : ground.border; + walkUnits(spec, (unit) => { + const role: MapRole | undefined = unit[MAP_ROLE]; + delete unit[MAP_ROLE]; + // A label is written in the ground's ink, over a halo of the routes' own light that parts it + // from the borders, coasts and lines it crosses. + if (role === 'label' || role === 'labelHalo') { + const ink = darkGround ? LABEL_INK_ON_DARK : LABEL_INK; + // A region's label inks itself by its region's fill (its colour encoding): a mark's fill would override it. + unit.mark = role === 'label' + ? { ...asMark(unit.mark), ...(unit.encoding?.color ? {} : { fill: ink }) } + : { ...asMark(unit.mark), fill: halo, stroke: halo, strokeOpacity: 0.9, fillOpacity: 0.9 }; + return; + } + // A drawn stop is haloed as its route is: a hairline that parts it from the line it ends. + if (role === 'routeStop') { + unit.mark = { ...asMark(unit.mark), stroke: halo }; + return; + } + if (role === 'routeCasing' || role === 'routeHeadCasing' || role === 'route' || role === 'routeArrow') { + const mark = asMark(unit.mark); + const coloured = unit.encoding?.color !== undefined; + const ink = unit[ROUTE_INK_KEY] === 'neutral' ? neutralInk : markInk; + delete unit[ROUTE_INK_KEY]; + if (role === 'routeCasing') mark.stroke = halo; + else if (role === 'routeHeadCasing') Object.assign(mark, { fill: halo, stroke: halo }); + else if (role === 'route' && !coloured) mark.stroke = ink; + // A head is joined to its line: the line's own ink; its halo is drawn beneath the line. + else if (role === 'routeArrow' && !coloured) mark.fill = ink; + unit.mark = mark; + return; + } + // A role left on a node that became a layered spec names its layers' parent, not a mark. + if (role && unit.mark) { + const mark = asMark(unit.mark); + if (role === 'sea') Object.assign(mark, { fill: ground.sea, stroke: ground.rim }); + // A point map's land is outlined at its coast; the borders between its countries are drawn + // over that outline by a mesh of their own (`borders`), and where a border is in dispute the + // land's own colour first hides the solid line its dots stand on (`disputedBase`). + else if (role === 'land') Object.assign(mark, { fill: ground.land, stroke: ground.rim }); + else if (role === 'borders') mark.stroke = ground.border; + else if (role === 'disputedBase') mark.stroke = ground.land; + else if (role === 'noData') Object.assign(mark, { fill: ground.noData, stroke: outline }); + else if (role === 'graticule') Object.assign(mark, { stroke: ground.graticule }); + else if (role === 'disputed') Object.assign(mark, { stroke: ground.disputed }); + else if (role === 'regions') mark.stroke = outline; + if (width !== undefined && role !== 'sea' && role !== 'graticule' && role !== 'disputed' && role !== 'disputedBase') { + mark.strokeWidth = role === 'borders' ? width + BORDER_COVER : width; + } + unit.mark = mark; + // A stated colour would outrank the mark's own: it takes the ground's too. + const stated = role === 'noData' ? ground.noData : role === 'graticule' ? ground.graticule : role === 'disputed' ? ground.disputed : undefined; + if (stated && unit.encoding?.color?.value !== undefined) unit.encoding.color = { ...unit.encoding.color, value: stated }; + } + const color = unit.encoding?.color; + if (color?.condition) { + const conditions = Array.isArray(color.condition) ? color.condition : [color.condition]; + const painted = conditions.map((condition: any) => (condition?.value === NO_DATA_PLACEHOLDER ? { ...condition, value: ground.noData } : condition)); + unit.encoding.color = { ...color, condition: Array.isArray(color.condition) ? painted : painted[0] }; + } + }); + // On a dark ground, marks coloured for a light page sink into it: a fine light ring lifts them. + if (isDark(ground.frame ?? ground.sea)) { + walkUnits(spec, (unit) => { + const mark = unit.mark === undefined ? undefined : asMark(unit.mark); + if (!mark || !POINT_MARKS.has(mark.type) || mark.stroke !== undefined) return; + unit.mark = { ...mark, stroke: '#ffffff', strokeWidth: mark.strokeWidth ?? 1, strokeOpacity: mark.strokeOpacity ?? 0.85 }; + }); + } + const view = projectedView(spec); + const regional = view?.[MAP_REGIONAL] === true; + if (view) delete view[MAP_REGIONAL]; + if (options.globe) return; + // A region is a window on the world: water fills it, and a neatline closes the edges its land is cut at. + if (ground.frame || regional) addFrame(spec, ground.frame ?? ground.sea); + if (regional) addNeatline(spec, ground.rim); +} + +/** The view that draws the map: the one with a projection, the spec itself unless a theme wrapped it. */ +function projectedView(spec: any): any { + if (spec?.projection) return spec; + for (const key of ['vconcat', 'hconcat', 'concat'] as const) { + for (const child of spec?.[key] ?? []) { + const found = projectedView(child); + if (found) return found; + } + } + return undefined; +} + +/** + * Fill a flat map's plot with the style's water, as a rectangle beneath the map: Vega-Lite paints + * no plot background for a chart drawn only in geoshapes. A single-view map becomes layered to hold + * it. Structure: it takes no colour, tooltip or part in interaction from the regions. + */ +function addFrame(spec: any, fill: string): void { + const view = projectedView(spec); + if (!view) return; + if (!Array.isArray(view.layer)) { + const { data, transform, mark, encoding } = view; + for (const key of ['data', 'transform', 'mark', 'encoding'] as const) delete view[key]; + view.layer = [{ data, ...(transform ? { transform } : {}), mark, ...(encoding ? { encoding } : {}) }]; + } + view.layer.unshift({ + [INTERACTION_PROVENANCE]: { role: 'decorative', identity: 'inherit', presentation: 'independent' }, + data: { values: [{}] }, + mark: { type: 'rect', fill, strokeWidth: 0 }, + encoding: { + x: { value: 0 }, x2: { value: 'width' }, y: { value: 0 }, y2: { value: 'height' }, + color: { value: fill }, tooltip: null, + }, + }); +} + +/** Close a regional map's plot with a fine line over the edges its land is cut at. */ +function addNeatline(spec: any, stroke: string): void { + const view = projectedView(spec); + if (!view || !Array.isArray(view.layer)) return; + view.layer.push({ + [INTERACTION_PROVENANCE]: { role: 'decorative', identity: 'inherit', presentation: 'independent' }, + data: { values: [{}] }, + mark: { type: 'rect', fillOpacity: 0, stroke, strokeWidth: 1 }, + encoding: { x: { value: 0 }, x2: { value: 'width' }, y: { value: 0 }, y2: { value: 'height' }, tooltip: null }, + }); +} + +export const CLASS_METHODS = ['auto', 'quantile', 'equal', 'jenks', 'continuous'] as const; +export type ClassMethod = typeof CLASS_METHODS[number]; + +const BINNED = new Set(['quantize', 'quantile', 'threshold']); + +/** How far in from its end a classed one-way ramp starts, in twentieths of the ramp. */ +const RAMP_INSET = 3; + +/** + * Class a choropleth's colour. `auto` (the default) puts the breaks at the quantiles, so each class + * holds about as many regions — or, for a diverging field, at round steps about its midpoint; + * `quantile`, `equal` (round steps) and `jenks` (natural breaks) choose; `continuous` keeps a + * smooth ramp. `count` classes, 5 unless asked. The ramp is the one the theme and semantics chose: + * a scheme by name, or the theme's stops (or classes, resampled). An author's own `bins` or scheme + * on the encoding are laid after this and win. + */ +export function classChoropleth(spec: any, rows: readonly any[], method: unknown, count: unknown): void { + const how: ClassMethod = typeof method === 'string' && (CLASS_METHODS as readonly string[]).includes(method) ? method as ClassMethod : 'auto'; + const target = typeof count === 'number' && Number.isFinite(count) ? Math.max(2, Math.min(9, Math.round(count))) : 5; + walkUnits(spec, (unit) => { + if (unit[INTERACTION_PROVENANCE]?.role === 'decorative') return; + const enc = unit.encoding?.color; + if (!enc?.field || enc.type !== 'quantitative') return; + const scale = enc.scale ?? {}; + if (how === 'continuous') { + if (BINNED.has(scale.type)) { + const { type: _type, ...rest } = scale; + if (_type === 'threshold') delete rest.domain; + enc.scale = rest; + } + return; + } + const ramp = Array.isArray(scale.range) && scale.range.length >= 2 ? scale.range + : typeof scale.scheme === 'string' ? { scheme: scale.scheme } + : typeof scale.scheme?.name === 'string' ? { scheme: scale.scheme.name } + : { scheme: 'blues' }; + // A domain the field states (a margin's ±100) promises colours that compare across charts: + // classes cut from these rows would break it, so `auto` keeps the ramp as stated. + if (how === 'auto' && Array.isArray(scale.domain) && scale.type !== 'threshold') return; + const pivot = typeof scale.domainMid === 'number' ? scale.domainMid : undefined; + if (BINNED.has(scale.type)) { + const { type: _type, ...rest } = scale; + if (_type === 'threshold') delete rest.domain; + enc.scale = rest; + } + const methodFor = how === 'auto' ? (pivot !== undefined ? 'round' : 'quantile') : how === 'equal' ? 'round' : how; + // A one-way ramp's first class starts a little in from its end: the palest (or, on a dark + // ramp, the darkest) shade sits beside the no-data land and the page, and would read as either. + const sequential = pivot === undefined; + const inset = sequential && Array.isArray(ramp) ? resampleStops(ramp, 21).slice(RAMP_INSET) : ramp; + if (!stepColorScale(enc, inset, target, rows, pivot, { method: methodFor, ...(how !== 'auto' ? { exact: methodFor === 'round' } : {}) })) return; + const scheme = enc.scale?.scheme; + if (sequential && scheme && typeof scheme === 'object' && !scheme.extent) enc.scale.scheme = { ...scheme, extent: [RAMP_INSET / 20, 1] }; + }); +} diff --git a/packages/flint-js/src/vegalite/templates/map.ts b/packages/flint-js/src/vegalite/templates/map.ts index 430309e9..d1026a62 100644 --- a/packages/flint-js/src/vegalite/templates/map.ts +++ b/packages/flint-js/src/vegalite/templates/map.ts @@ -1,20 +1,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { ChartTemplateDef, ChartPropertyDef, InstantiateContext, OptionEvalContext, PlotPlanContext } from '../../core/types'; +import { BoundaryFile, BoundaryIds, ChartCredit, ChartTemplateDef, ChartPropertyDef, InstantiateContext, OptionEvalContext, PlotPlanContext } from '../../core/types'; import { - resolveUsState, resolveCountry, GeoResolver, + BOUNDARY_IDS, BOUNDARY_NAMES, BOUNDARY_URLS, DISPUTED_FEATURE, FILE_KEY_FIELD, NAMED_ATTRIBUTION, boundaryFile, fileAntarctica, fileAttribution, + fileCredit, fileData, fileIds, fileKeyExpr, fileKeyResolver, fileScope, isBoundaryFile, namedCredit, namedWorldUrl, + worldBoundaries, type WorldDetail, +} from '../../chart-types/boundaries'; +import { + resolveUsState, resolveCountry, GeoResolver, MAP_KEY_TYPES, isAggregateRegion, keyTypeResolver, type MapScope, inferBubbleScope, inferChoroplethScope, semanticScope, pickMapScope, } from '../../chart-types/geo'; -import { toTypeString } from '../../core/field-semantics'; +import { + ANTARCTICA_ID, US_FRAME_ASPECT, WORLD_ALL, boxTarget, countryBox, facingRotation, frameOf, frontFacingExpr, + isWorldFeature, mapPlotSize, projectedAspect, regionalProjection, shapedFrame, type FrameLevel, type FrameProjection, type GeoBox, +} from '../../chart-types/geo-frame'; +import { continentAt, continentOf, type Continent } from '../../chart-types/geo-continents'; +import { routeProperties } from '../../chart-types/map-routes'; +import { resolveAggregationDefault, toTypeString } from '../../core/field-semantics'; +import { getRegistryEntry } from '../../core/type-registry'; import { GEO_LEVEL_SIGNAL, + GEO_ROTATE_SIGNAL, geoLevelGate, isGlobeProjection, type GeoLevel, type GeoPreProjection, } from '../interactions/geo-levels'; -import { withInteractionDecorative } from '../interaction-provenance'; +import { INTERACTION_PROVENANCE, withInteractionDecorative } from '../interaction-provenance'; +import { + BORDER_COVER, CLASS_METHODS, CUSTOM_MAP_STYLE_LABEL, MAP_REGIONAL, MAP_ROLE, MAP_STYLES, NO_DATA_PLACEHOLDER, + baseMapStyle, classChoropleth, groundFor, isCustomMapStyle, isDark, paintMapGround, withCustomColors, type MapGround, +} from './map-style'; +import { mixHex } from '../../core/theme/presence'; +import { ROUTE_PART, addRouteLayers, mapRoutes } from './map-routes'; +import { LABEL_W, addPointLabels, addRegionLabels, labelWidth } from './map-labels'; import { fieldsFromEncodingChannels, firstDiscreteEncodingField, @@ -74,7 +94,6 @@ const projectionCenterPresets: { label: string; center: [number, number] }[] = [ // --------------------------------------------------------------------------- interface ScopeGeo { - url: string; feature: string; projection: string; width: number; @@ -84,7 +103,6 @@ interface ScopeGeo { const SCOPE_GEO: Record = { us: { - url: "https://vega.github.io/vega-lite/data/us-10m.json", feature: "states", projection: "albersUsa", width: 500, @@ -92,7 +110,6 @@ const SCOPE_GEO: Record = { strokeWidth: 0.5, }, world: { - url: "https://vega.github.io/vega-lite/data/world-110m.json", feature: "countries", projection: "equalEarth", width: 600, @@ -101,6 +118,73 @@ const SCOPE_GEO: Record = { }, }; +/** + * What a map draws its regions or land from: the chart's own boundary file, with what its ids are + * and how a feature's id is read; else a named world set, or the US Census Bureau's for a US map. + */ +interface MapBoundaries { + /** The map's region: the world, the US, or a file's own geography, fitted to its shapes. */ + scope: MapScope | 'own'; + file?: BoundaryFile; + ids?: BoundaryIds; + /** The Vega expression reading a file feature's id, in the form rows are matched to it. */ + keyExpr?: string; +} + +/** A map's boundaries for a scope the data put it on: a file decides its own region by what its ids are. */ +function mapBoundaries(chartProperties: Record | undefined, inferred: MapScope): MapBoundaries { + const file = boundaryFile(chartProperties); + if (!file) return { scope: inferred }; + const ids = fileIds(file, inferred); + return { scope: fileScope(file, inferred), file, ids, keyExpr: fileKeyExpr(file, ids) }; +} + +/** + * A map's regions or land as Vega-Lite data: the chart's file (inline, or by its URL); else the + * named world set, or the US states — projected for a choropleth, in longitude and latitude for + * points. Flint's renderers serve the named URLs from the package. + */ +function boundaryData( + b: MapBoundaries, chartProperties: Record | undefined, feature: string, detail: WorldDetail = 'coarse', projected = false, +): Record { + if (b.file) return fileData(b.file, b.file.feature, detail); + const url = b.scope === 'us' + ? (projected ? BOUNDARY_URLS.usAlbers : BOUNDARY_URLS.usStates) + : namedWorldUrl(worldBoundaries(chartProperties), detail); + return { url, format: { type: 'topojson', feature } }; +} + +/** The credit a map's boundaries ask for at its foot: the file's attribution, else the named set's. */ +function boundaryCredit(b: MapBoundaries, chartProperties: Record | undefined): ChartCredit | undefined { + if (b.file) return fileCredit(b.file); + return b.scope === 'world' ? namedCredit(worldBoundaries(chartProperties)) : undefined; +} + +/** Name who drew a map's boundaries, for the host to credit (`_attribution`); nothing for a file without one. */ +function attribute(spec: any, b: MapBoundaries, chartProperties: Record | undefined, projected = false): void { + const attribution = b.file + ? fileAttribution(b.file) + : b.scope === 'us' ? NAMED_ATTRIBUTION[projected ? 'usAlbers' : 'us'] : NAMED_ATTRIBUTION[worldBoundaries(chartProperties)]; + if (attribution) spec._attribution = attribution; + else delete spec._attribution; +} + +/** The TopoJSON object of borders a map dots over its regions: the World Bank's, or the one a file names. */ +function disputedFeature(b: MapBoundaries, chartProperties: Record | undefined): string | undefined { + if (b.file) return b.file.feature ? b.file.disputed : undefined; + return b.scope === 'world' && worldBoundaries(chartProperties) === 'world-bank' ? DISPUTED_FEATURE : undefined; +} + +/** Keep Antarctica off a world map whose frame leaves it out: by the feature's id, as the named sets or a file of country codes carry it. */ +function withoutAntarctica(b: MapBoundaries): Record | undefined { + if (!b.file) return WITHOUT_ANTARCTICA; + const id = b.ids ? fileAntarctica(b.ids) : undefined; + return id === undefined || !b.keyExpr ? undefined : { filter: `${b.keyExpr} !== ${JSON.stringify(id)}` }; +} + +/** How fine a world frame is drawn: a region's coastlines read at the medium detail. */ +const frameDetail = (frame: MapFrame): WorldDetail => (frame.regional ? 'medium' : 'coarse'); + /** Would this spec render as a world map? (Drives world-only property gating.) */ function wouldBeWorld(ctx: OptionEvalContext): boolean { const choice = ctx.chartProperties?.region; @@ -162,23 +246,208 @@ function projectionProperties(applicable: (ctx: OptionEvalContext) => boolean): ]; } -/** Point a world map's projection where the caller asked: its type, and the place at its centre. */ -function applyWorldProjection(projection: any, chartProperties: Record | undefined): void { - if (!projection || !chartProperties) return; - const type = chartProperties.projection; - const center = chartProperties.projectionCenter; - if (typeof type === 'string' && type !== 'default') projection.type = type; - if (Array.isArray(center) && center.length >= 2 && projection.type !== 'albersUsa') { - projection.rotate = [-Number(center[0]), -Number(center[1]), 0]; +/** The world map's projection: the caller's, else the scope's own. */ +function worldProjectionType(chartProperties: Record | undefined): string { + const type = chartProperties?.projection; + return typeof type === 'string' && type !== 'default' ? type : SCOPE_GEO.world.projection; +} + +/** The rotation that puts the caller's centre in the middle of a world map. */ +function worldRotate(chartProperties: Record | undefined): [number, number, number] | undefined { + const center = chartProperties?.projectionCenter; + if (!Array.isArray(center) || center.length < 2) return undefined; + const [lon, lat] = [Number(center[0]), Number(center[1])]; + return Number.isFinite(lon) && Number.isFinite(lat) ? [-lon || 0, -lat || 0, 0] : undefined; +} + +/** What a map frames, how it projects it, and the shape its plot takes. */ +interface MapFrame { + scope: MapScope; + /** The one projection every layer shares. */ + projection: FrameProjection & { fit?: unknown }; + /** Width over height of the plot; unset where the geography is the host's own and its shape unknown, so the plot takes the room's. */ + aspect?: number; + globe: boolean; + /** The data sits in one region and the base map runs past the plot, so its shapes are clipped. */ + regional: boolean; + /** The world map keeps Antarctica: the data names it, the frame is the whole base map, or the map is a globe. */ + antarctica: boolean; + /** What the frame takes in: one country, several, their continent, or the world. */ + level?: FrameLevel; +} + +/** + * The world framed for countries' or points' boxes: the region they share, else the world's land + * (Antarctica only where the data names it); the whole base map where the caller asks (`fit: + * 'whole'`); the whole sphere on a globe, turned to face the data unless the caller set a centre. + */ +function worldFrame( + chartProperties: Record | undefined, boxes: readonly GeoBox[], namesAntarctica: boolean, + continents: readonly (Continent | undefined)[] = [], +): MapFrame { + const type = worldProjectionType(chartProperties); + if (isGlobeProjection(type)) { + const centres = boxes.map(([w, s, e, n]): [number, number] => [w <= e ? (w + e) / 2 : ((w + e + 360) / 2 + 180) % 360 - 180, (s + n) / 2]); + const rotate = worldRotate(chartProperties) ?? facingRotation(centres); + return { scope: 'world', projection: { type, ...(rotate ? { rotate } : {}), fit: { type: 'Sphere' } }, aspect: 1, globe: true, regional: false, antarctica: true, level: 'world' }; + } + const rotate = worldRotate(chartProperties); + const whole = chartProperties?.fit === 'whole'; + const fit = chartProperties?.fit === 'data' || chartProperties?.fit === 'continent' ? chartProperties.fit : 'auto'; + const framed = whole ? { box: WORLD_ALL, world: true, level: 'world' as const } : frameOf(boxes, namesAntarctica, { continents, fit }); + // A region is drawn in a projection of its own, centred on it, unless the caller chose one or a centre. + const chosen = typeof chartProperties?.projection === 'string' && chartProperties.projection !== 'default'; + const projection: FrameProjection = !framed.world && !chosen && !rotate + ? regionalProjection(framed.box) + : { type, ...(rotate ? { rotate } : {}) }; + const box = framed.world ? framed.box : shapedFrame(framed.box, projection.type, projection.rotate, projection.parallels); + return { + scope: 'world', + projection: { ...projection, fit: boxTarget(box) }, + aspect: projectedAspect(box, projection.type, projection.rotate, projection.parallels), + globe: false, + regional: !framed.world, + antarctica: whole || namesAntarctica, + level: framed.level, + }; +} + +/** The least share of the canvas a map's plot keeps on each side, however much its furniture takes (the plan's 40% cap). */ +const PLOT_FLOOR = 0.6; + +/** + * The plot a map is drawn in: its frame's shape, as large as the canvas holds — the base stretched + * as far as the layout allows (the host's `canvasSize`) — once the title, keys and axes have the + * room the plan measured for them. + */ +function framePlot(ctx: PlotPlanContext, frame: MapFrame): { width: number; height: number } { + const stretch = ctx.assembleOptions?.maxStretch ?? 1.5; + const canvas = { + width: ctx.canvasSize.width * (ctx.assembleOptions?.maxStretchX ?? stretch), + height: ctx.canvasSize.height * (ctx.assembleOptions?.maxStretchY ?? stretch), + }; + const room = { + width: Math.max(canvas.width * PLOT_FLOOR, canvas.width - (ctx.reserve?.width ?? 0)), + height: Math.max(canvas.height * PLOT_FLOOR, canvas.height - (ctx.reserve?.height ?? 0)), + }; + if (!frame.aspect) return { width: Math.round(room.width), height: Math.round(room.height) }; + return mapPlotSize(room, frame.aspect); +} + +/** The point map's frame: its region (the caller's, else what the points span) and where in it the points sit. */ +function pointFrame(ctx: PlotPlanContext): MapFrame { + const lonField = ctx.channelSemantics.longitude?.field; + const latField = ctx.channelSemantics.latitude?.field; + const b = mapBoundaries(ctx.chartProperties, bubbleScope(ctx, lonField, latField)); + // Land of the caller's own — a GeoJSON base map, or a file keyed by FIPS or its own keys — is + // fitted to its shapes, whose extent is not known here. + const fitted = (typeof ctx.chartProperties?.baseMapUrl === 'string' && ctx.chartProperties.baseMapUrl !== '') + || (b.file !== undefined && b.scope !== 'world'); + if (b.scope === 'us') { + return { scope: 'us', projection: { type: SCOPE_GEO.us.projection }, ...(fitted ? {} : { aspect: US_FRAME_ASPECT }), globe: false, regional: false, antarctica: false }; + } + const boxes: GeoBox[] = []; + const continents: (Continent | undefined)[] = []; + let namesAntarctica = false; + if (lonField && latField) { + for (const row of ctx.fullTable ?? ctx.table ?? []) { + const lon = Number(row?.[lonField]); + const lat = Number(row?.[latField]); + if (!Number.isFinite(lon) || !Number.isFinite(lat) || Math.abs(lat) > 90 || Math.abs(lon) > 180) continue; + boxes.push([lon, lat, lon, lat]); + continents.push(continentAt(lon, lat)); + if (lat < -60) namesAntarctica = true; + } + // A route's legs bow off the line between its stops: the frame takes in the whole line. + for (const route of mapRoutes(ctx.fullTable ?? ctx.table ?? [], ctx.channelSemantics as Record, ctx.chartProperties, false)) { + for (const [lon, lat] of route.path) boxes.push([lon, lat, lon, lat]); + } + } + const frame = worldFrame(ctx.chartProperties, boxes, namesAntarctica, continents); + if (fitted && !frame.globe) { + const { fit: _fit, ...projection } = frame.projection; + return { ...frame, projection, aspect: undefined, regional: false }; + } + return frame; +} + +/** The world choropleth's frame: the countries its rows name. */ +function choroplethWorldFrame(ctx: PlotPlanContext): MapFrame { + const idField = ctx.channelSemantics.id?.field; + const resolve = keyTypeResolver(ctx.chartProperties?.keyType) ?? resolveCountry; + const boxes: GeoBox[] = []; + const continents: (Continent | undefined)[] = []; + let namesAntarctica = false; + if (idField) { + const seen = new Set(); + for (const row of ctx.fullTable ?? ctx.table ?? []) { + const id = resolve(row?.[idField]); + if (id === undefined || seen.has(id)) continue; + seen.add(id); + if (id === ANTARCTICA_ID) namesAntarctica = true; + const box = countryBox(id); + if (!box) continue; + boxes.push(box); + continents.push(continentOf(id)); + } } + return worldFrame(ctx.chartProperties, boxes, namesAntarctica, continents); +} + +/** Keep Antarctica off a world base map whose frame leaves it out. */ +const WITHOUT_ANTARCTICA = { filter: `datum.id !== ${ANTARCTICA_ID}` }; + +/** Draw a mark inside the plot only: a regional frame's base map runs past it. */ +function clipped(mark: any): any { + return typeof mark === 'string' ? { type: mark, clip: true } : { ...mark, clip: true }; } -/** The size a globe is drawn at: a disc wants a square plot. */ -const GLOBE_SIZE = 400; -/** The sea behind a globe, its rim, and the land a country without a value stands on. */ -const GLOBE_SEA = '#eef2f5'; -const GLOBE_RIM = '#c5ccd3'; -const GLOBE_NO_DATA = '#d9d9d9'; +/** How the world map frames its data — by its own judgement, the data's box, its continents, or the whole map — offered wherever the map is the world. */ +function fitProperty(applicable: (ctx: OptionEvalContext) => boolean): ChartPropertyDef { + return { + key: 'fit', + label: 'Frame', + type: 'discrete', + options: [ + { value: 'auto', label: 'Auto: the country, the region, or the continent the data covers' }, + { value: 'data', label: 'The data, padded' }, + { value: 'continent', label: 'The data’s continents' }, + { value: 'whole', label: 'Whole map' }, + ], + defaultValue: 'auto', + check: (ctx) => ({ applicable: applicable(ctx) }), + }; +} + +/** + * Whose borders a map draws: the World Bank's official boundaries (the default world map), which + * follow the UN-system depiction — areas of non-determined legal status on their own, their borders + * dotted — or Natural Earth's de facto ones; or a file of the chart's own (`{ url | values, feature, + * ids, key, disputed, attribution }`). The named sets are offered wherever the map is the world. + */ +function boundariesProperty(applicable: (ctx: OptionEvalContext) => boolean): ChartPropertyDef { + return { + key: 'boundaries', + label: 'Boundaries', + type: 'discrete', + options: [ + { value: 'world-bank', label: 'World Bank (official)' }, + { value: 'natural-earth', label: 'Natural Earth (de facto)' }, + ] satisfies { value: typeof BOUNDARY_NAMES[number]; label: string }[], + defaultValue: 'world-bank', + accepts: isBoundaryFile, + acceptsLabel: `a file { url | values, feature?, ids? (${BOUNDARY_IDS.join(', ')}), key?, disputed?, attribution? }`, + check: (ctx) => ({ applicable: applicable(ctx) || isBoundaryFile(ctx.chartProperties?.boundaries) }), + }; +} + +/** + * The colours a template draws the ground in until the post-process paints it in the map's style + * (`./map-style`): the sea behind a globe, its rim, and land the data gives no value. + */ +const GLOBE_SEA = '#eef3f6'; +const GLOBE_RIM = '#d4d4d1'; +const NO_DATA = NO_DATA_PLACEHOLDER; /** * Draw a world choropleth as a globe. The projection fits the whole sphere @@ -190,6 +459,7 @@ const GLOBE_NO_DATA = '#d9d9d9'; */ function configureGlobe(spec: any): void { spec.projection = { ...(spec.projection ?? {}), fit: { type: 'Sphere' } }; + delete spec[MAP_ROLE]; const { data, transform, mark, encoding } = spec; delete spec.data; delete spec.transform; @@ -198,14 +468,16 @@ function configureGlobe(spec: any): void { const strokeWidth = typeof mark === 'object' ? mark.strokeWidth : undefined; spec.layer = [ withInteractionDecorative({ + [MAP_ROLE]: 'sea', data: { sphere: true }, mark: { type: 'geoshape', fill: GLOBE_SEA, stroke: GLOBE_RIM, strokeWidth: 1 }, }), withInteractionDecorative({ + [MAP_ROLE]: 'noData', data, - mark: { type: 'geoshape', fill: GLOBE_NO_DATA, stroke: 'white', ...(strokeWidth != null ? { strokeWidth } : {}) }, + mark: { type: 'geoshape', fill: NO_DATA, stroke: 'white', ...(strokeWidth != null ? { strokeWidth } : {}) }, }), - { data, ...(transform ? { transform } : {}), mark, encoding }, + { [MAP_ROLE]: 'regions', data, ...(transform ? { transform } : {}), mark, encoding }, ]; } @@ -228,6 +500,11 @@ function applyPointEncodings(layer: any, resolved: Record): void { } } +/** A point map's data layer: its circles, wherever structure (land, borders, a globe's sea) puts them. */ +function pointLayer(spec: any): any { + return spec.layer.find((layer: any) => (typeof layer?.mark === 'string' ? layer.mark : layer?.mark?.type) === 'circle'); +} + /** * Runtime detail levels for a bubble map, read from two chart properties: * `levelField` names the column that tags each row with its level, and @@ -252,7 +529,7 @@ function configureBubbleLevels(spec: any, chartProperties: any, rows: readonly a }); if (levels.length < 2) return; spec.params = [...(spec.params ?? []), { name: GEO_LEVEL_SIGNAL, value: levels[0].name }]; - const points = spec.layer[1]; + const points = pointLayer(spec); points.transform = [ ...(points.transform ?? []), { filter: `datum[${JSON.stringify(levelField)}] === ${GEO_LEVEL_SIGNAL}` }, @@ -267,14 +544,80 @@ function configureBubbleLevels(spec: any, chartProperties: any, rows: readonly a spec._geoLevels = { signal: GEO_LEVEL_SIGNAL, levels }; } -/** Point the base + circle layers of a bubble map at the chosen geography. */ -function configureBubble(spec: any, scope: MapScope): void { - const g = SCOPE_GEO[scope]; +/** + * Draw a point map as a globe: the sea as a disc with a rim beneath the land, and every point on + * the far side hidden. Orthographic clips the land's paths at the horizon but projects a point + * behind it onto the front, mirrored, so each point's opacity reads the rotation and drops to + * nothing past the rim. Opacity rather than a filter keeps the scales and keys whole as the globe + * turns, and leaves the theme's own opacity where the point faces the viewer. The rotation is a + * signal navigation turns; without navigation it holds the authored rotation. + */ +function configurePointGlobe(spec: any, frame: MapFrame, lonField: string | undefined, latField: string | undefined): void { + spec.params = [...(spec.params ?? []), { name: GEO_ROTATE_SIGNAL, value: frame.projection.rotate ?? [0, 0, 0] }]; + const points = pointLayer(spec); + if (lonField && latField) { + const front = frontFacingExpr(`datum[${JSON.stringify(lonField)}]`, `datum[${JSON.stringify(latField)}]`, GEO_ROTATE_SIGNAL); + const behind = { test: `!(${front})`, value: 0 }; + const opacity = points.encoding?.opacity; + const existing = opacity?.condition; + points.encoding = { + ...(points.encoding ?? {}), + opacity: { + ...(opacity ?? {}), + condition: existing ? [behind, ...(Array.isArray(existing) ? existing : [existing])] : behind, + }, + }; + } + spec.layer.unshift(withInteractionDecorative({ + [MAP_ROLE]: 'sea', + data: { sphere: true }, + mark: { type: 'geoshape', fill: GLOBE_SEA, stroke: GLOBE_RIM, strokeWidth: 1 }, + })); +} + +/** + * Point the base and circle layers of a bubble map at their frame: the region's base map (or the + * chart's own), one projection both layers share, and, for a regional frame, both clipped to the plot. + */ +function configureBubble(spec: any, frame: MapFrame, chartProperties: Record | undefined, b: MapBoundaries): void { + const g = SCOPE_GEO[frame.scope]; + const baseMapUrl = chartProperties?.baseMapUrl; spec.width = g.width; spec.height = g.height; - spec.layer[0].data = { url: g.url, format: { type: "topojson", feature: g.feature } }; - spec.layer[0].projection = { type: g.projection }; - spec.layer[1].projection = { type: g.projection }; + // Structure: the land answers no pointer, whatever else on the map is a shape that does. + const base = spec.layer[0] = withInteractionDecorative(spec.layer[0]); + base[MAP_ROLE] = 'land'; + // The borders the choropleth draws at the same scope: a fixed hairline, whatever the frame or zoom. + base.mark = { ...(typeof base.mark === 'string' ? { type: base.mark } : base.mark), strokeWidth: g.strokeWidth }; + if (typeof baseMapUrl === 'string' && baseMapUrl) { + base.data = { url: baseMapUrl, format: { type: 'json', property: 'features' } }; + } else { + base.data = boundaryData(b, chartProperties, g.feature, frameDetail(frame)); + attribute(spec, b, chartProperties); + const without = b.scope === 'world' && !frame.antarctica ? withoutAntarctica(b) : undefined; + if (without) base.transform = [without]; + // The land is outlined at its coast; the borders between its regions are a mesh of their own, + // drawn over that outline, so a style can tell a coast from a border. + const format = base.data?.format; + if (format?.type === 'topojson' && typeof format.feature === 'string') { + spec.layer.splice(1, 0, withInteractionDecorative({ + [MAP_ROLE]: 'borders', + data: { ...base.data, format: { type: 'topojson', mesh: format.feature, filter: 'interior' } }, + mark: { type: 'geoshape', filled: false, strokeWidth: g.strokeWidth + BORDER_COVER, strokeJoin: 'round' }, + encoding: { tooltip: null }, + })); + } + } + spec.projection = { ...frame.projection }; + // Only the world's map holds every coast: a US map, or land of the caller's own, leaves its + // neighbours undrawn, and water round it would read them as sea. + if (frame.scope === 'world' && !(typeof baseMapUrl === 'string' && baseMapUrl) && !(b.file && b.scope !== 'world')) spec[MAP_WATER] = true; + if (frame.level) spec._mapFrame = { level: frame.level }; + if (frame.regional) spec[MAP_REGIONAL] = true; + for (const layer of spec.layer) { + delete layer.projection; + if (frame.regional) layer.mark = clipped(layer.mark); + } } export type ChoroplethLevel = 'state' | 'county' | 'auto'; @@ -289,7 +632,6 @@ export type ChoroplethLevel = 'state' | 'county' | 'auto'; * atlas documents, so viewports, levels, and focus keep their meaning. */ const US_ATLAS = { - url: 'https://cdn.jsdelivr.net/npm/us-atlas@3/counties-albers-10m.json', // The atlas is already in screen orientation (y down), so no reflection. projection: { type: 'identity' }, preProjection: { type: 'albersUsa', scale: 1300, translate: [487.5, 305] } as GeoPreProjection, @@ -326,11 +668,12 @@ const GEO_JOIN_DATASET = '__flint_geo_join'; * itself never rebuilds, and the projection extent carries the viewer's * place across the swap. */ -function configureChoropleth(spec: any, scope: MapScope, level: ChoroplethLevel = 'state'): void { +function configureChoropleth(spec: any, b: MapBoundaries & { scope: MapScope }, level: ChoroplethLevel = 'state', chartProperties?: Record, detail: WorldDetail = 'coarse'): void { + const scope = b.scope; const g = SCOPE_GEO[scope]; spec.width = g.width; spec.height = g.height; - const url = scope === 'us' ? US_ATLAS.url : g.url; + attribute(spec, b, chartProperties, true); spec.projection = scope === 'us' ? { ...US_ATLAS.projection } : { type: g.projection }; if (scope === 'us') spec._geoPreProjection = US_ATLAS.preProjection; if (scope === 'us' && level === 'auto') { @@ -338,9 +681,10 @@ function configureChoropleth(spec: any, scope: MapScope, level: ChoroplethLevel spec.data = { name: GEO_JOIN_DATASET }; spec.params = [{ name: GEO_LEVEL_SIGNAL, value: US_CHOROPLETH_LEVELS[0].name }]; spec.layer = US_CHOROPLETH_LEVELS.map(({ name, feature, strokeWidth }) => ({ - data: { url, format: { type: "topojson", feature } }, + data: boundaryData(b, chartProperties, feature, 'coarse', true), transform: [US_ATLAS_ID_TRANSFORM, { filter: geoLevelGate(GEO_LEVEL_SIGNAL, name) }], mark: { type: "geoshape", stroke: "white", strokeWidth }, + [MAP_ROLE]: 'regions', })); spec._geoLevels = { signal: GEO_LEVEL_SIGNAL, @@ -352,12 +696,53 @@ function configureChoropleth(spec: any, scope: MapScope, level: ChoroplethLevel }; return; } + spec[MAP_ROLE] = 'regions'; const county = scope === 'us' && level === 'county'; - spec.data = { url, format: { type: "topojson", feature: county ? 'counties' : g.feature } }; - if (scope === 'us') spec.transform = [US_ATLAS_ID_TRANSFORM]; + spec.data = boundaryData(b, chartProperties, county ? 'counties' : g.feature, detail, true); + // A file's ids are read into one form, which the rows are matched in. + if (b.file && b.keyExpr) spec.transform = [{ calculate: b.keyExpr, as: FILE_KEY_FIELD }]; + else if (scope === 'us') spec.transform = [US_ATLAS_ID_TRANSFORM]; if (spec.mark && typeof spec.mark === 'object') spec.mark.strokeWidth = county ? 0.2 : g.strokeWidth; } +/** The projection a fitted file is drawn in: the caller's, else albersUsa for US states, Mercator for any other. */ +function fittedProjection(b: MapBoundaries, chartProperties: Record | undefined): string { + const type = chartProperties?.projection; + if (typeof type === 'string' && type !== 'default') return type; + return b.scope === 'us' ? 'albersUsa' : 'mercator'; +} + +/** + * Point a choropleth at a file of the chart's own keyed by FIPS or by its own keys: one layer of its + * regions, the projection fitted to their shapes, each feature's id read into the form the rows + * are matched in. + */ +function configureFileChoropleth(spec: any, b: MapBoundaries & { file: BoundaryFile }, chartProperties: Record | undefined): void { + attribute(spec, b, chartProperties); + spec.projection = { type: fittedProjection(b, chartProperties) }; + spec[MAP_ROLE] = 'regions'; + spec.data = fileData(b.file, b.file.feature); + spec.transform = [{ calculate: b.keyExpr, as: FILE_KEY_FIELD }]; + if (spec.mark && typeof spec.mark === 'object') spec.mark.strokeWidth = 0.4; +} + +/** What the choropleth's region key holds, so it is read in that namespace only. */ +const keyTypeProperty: ChartPropertyDef = { + key: "keyType", + label: "Region key", + type: "discrete", + options: [ + { value: "auto", label: "Auto-detect" }, + { value: "iso3", label: "ISO 3166-1 alpha-3 (USA)" }, + { value: "iso2", label: "ISO 3166-1 alpha-2 (US)" }, + { value: "iso-numeric", label: "ISO 3166-1 numeric (840)" }, + { value: "country-name", label: "Country name" }, + { value: "us-state", label: "US state name or USPS code" }, + { value: "fips", label: "US FIPS code (state or county)" }, + ] satisfies { value: typeof MAP_KEY_TYPES[number]; label: string }[], + defaultValue: "auto", +}; + /** Choropleth granularity within the US base map; the world map has countries only. */ const levelProperty: ChartPropertyDef = { key: "level", @@ -378,6 +763,11 @@ function bubbleScope(ctx: PlotPlanContext, lonField: string | undefined, latFiel return pickMapScope(ctx.chartProperties, undefined, () => inferBubbleScope(rows, lonField, latField)); } +/** The boundaries a bubble map draws its land from. */ +function pointBoundaries(ctx: PlotPlanContext): MapBoundaries { + return mapBoundaries(ctx.chartProperties, bubbleScope(ctx, ctx.channelSemantics.longitude?.field, ctx.channelSemantics.latitude?.field)); +} + /** The region a choropleth shows: the caller's choice, else the id field's semantic type, else its values. */ function choroplethScope(ctx: PlotPlanContext, idField: string | undefined): MapScope { const rows = ctx.fullTable ?? ctx.table ?? []; @@ -385,10 +775,9 @@ function choroplethScope(ctx: PlotPlanContext, idField: string | undefined): Map return pickMapScope(ctx.chartProperties, semanticScope(semType), () => inferChoroplethScope(rows, idField)); } -/** A map is drawn at its region's size. */ -function scopeSize(scope: MapScope): { width: number; height: number } { - const g = SCOPE_GEO[scope]; - return { width: g.width, height: g.height }; +/** The boundaries a choropleth draws its regions from: a file decides its own region by its ids. */ +function choroplethBoundaries(ctx: PlotPlanContext): MapBoundaries { + return mapBoundaries(ctx.chartProperties, choroplethScope(ctx, ctx.channelSemantics.id?.field)); } function drawAtPlannedSize(spec: any, ctx: InstantiateContext): void { @@ -397,8 +786,179 @@ function drawAtPlannedSize(spec: any, ctx: InstantiateContext): void { spec.height = ctx.plot.height; } +/** The graticule's line colour until the ground is painted. */ +const GRATICULE = '#e8ecef'; +/** Disputed borders until the ground is painted: a grey that reads on any fill. */ +const DISPUTED = '#888888'; + +/** + * Lines of latitude and longitude every 30°, under the land and above a globe's sea, where the + * caller asks (`chartProperties.graticule`). A single-view map becomes layered to hold them. + * Structure, not data: no colour or tooltip reaches them from the regions. + */ +function addGraticule(spec: any): void { + asLayered(spec); + const graticule = withInteractionDecorative({ + [MAP_ROLE]: 'graticule', + data: { graticule: { step: [30, 30] } }, + // A graticule runs round the whole sphere; only the part inside the plot is drawn. + mark: { type: 'geoshape', filled: false, stroke: GRATICULE, strokeWidth: 0.5, clip: true }, + encoding: { color: { value: GRATICULE }, tooltip: null }, + }); + const seaAt = spec.layer.findIndex((layer: any) => layer?.data?.sphere); + spec.layer.splice(seaAt + 1, 0, graticule); +} + +/** A single-view map as a layered one, its view the first layer, so structure can be drawn round it. */ +function asLayered(spec: any): void { + if (Array.isArray(spec.layer)) return; + const { data, transform, mark, encoding } = spec; + const role = spec[MAP_ROLE]; + delete spec.data; + delete spec.transform; + delete spec.mark; + delete spec.encoding; + delete spec[MAP_ROLE]; + spec.layer = [{ ...(role ? { [MAP_ROLE]: role } : {}), data, ...(transform ? { transform } : {}), mark, ...(encoding ? { encoding } : {}) }]; +} + +/** + * Dot the borders in dispute over the regions: the World Bank's areas of non-determined legal + * status share them — Jammu and Kashmir, Aksai Chin, Western Sahara, Abyei, … — as the World Bank + * draws them, or a file names its own (`disputed`). The areas are regions of their own, which data + * keyed to a country does not colour. Structure, not data. + */ +function addDisputedBorders(spec: any, regions: Record, clip: boolean, feature: string, cover = false): void { + asLayered(spec); + // A point map draws its borders as lines on land of one colour: where they are in dispute, a line + // of that colour hides the solid border beneath the dots. A choropleth's regions are coloured + // apart, so its dots stand on the border. + const borders = cover ? spec.layer.find((layer: any) => layer?.[MAP_ROLE] === 'borders') : undefined; + const base = borders ? withInteractionDecorative({ + [MAP_ROLE]: 'disputedBase', + data: { ...regions, format: { type: 'topojson', feature } }, + mark: { type: 'geoshape', filled: false, strokeWidth: (borders.mark?.strokeWidth ?? 0.5) + 0.6, strokeCap: 'butt', ...(clip ? { clip: true } : {}) }, + encoding: { tooltip: null }, + }) : undefined; + const disputed = withInteractionDecorative({ + [MAP_ROLE]: 'disputed', + data: { ...regions, format: { type: 'topojson', feature } }, + mark: { type: 'geoshape', filled: false, stroke: DISPUTED, strokeWidth: 1.1, strokeDash: [0.5, 2.5], strokeCap: 'round', ...(clip ? { clip: true } : {}) }, + encoding: { color: { value: DISPUTED }, tooltip: null }, + }); + // Over the land, its borders and the regions, beneath the points. + const last = spec.layer.reduce((at: number, layer: any, i: number) => (['land', 'borders', 'regions', 'noData'].includes(layer?.[MAP_ROLE]) ? i : at), -1); + spec.layer.splice(last + 1, 0, ...(base ? [base] : []), disputed); +} + +/** + * The borders between a choropleth's regions as a mesh of their own, over the regions and their land + * without data: lines a style colours apart from the coast the regions are outlined at. + */ +function addBorderMesh(spec: any, regions: any, clip: boolean): void { + const format = regions?.format; + if (format?.type !== 'topojson' || typeof format.feature !== 'string') return; + asLayered(spec); + const shapes = spec.layer.filter((layer: any) => ['regions', 'noData'].includes(layer?.[MAP_ROLE])); + const widths = shapes.map((layer: any) => layer.mark?.strokeWidth).filter((width: unknown): width is number => typeof width === 'number'); + const width = widths.length ? Math.min(...widths) : 0.5; + const last = spec.layer.reduce((at: number, layer: any, i: number) => (['regions', 'noData'].includes(layer?.[MAP_ROLE]) ? i : at), -1); + spec.layer.splice(last + 1, 0, withInteractionDecorative({ + [MAP_ROLE]: 'borders', + data: { ...regions, format: { type: 'topojson', mesh: format.feature, filter: 'interior' } }, + mark: { type: 'geoshape', filled: false, strokeWidth: width + BORDER_COVER, strokeJoin: 'round', ...(clip ? { clip: true } : {}) }, + encoding: { tooltip: null }, + })); +} + +/** Whether a spec draws a globe: a layer holds the sphere. */ +function drawsGlobe(spec: any): boolean { + let found = false; + const visit = (node: any) => { + if (!node || typeof node !== 'object' || found) return; + if (node.data?.sphere) found = true; + for (const key of ['layer', 'vconcat', 'hconcat', 'concat']) if (Array.isArray(node[key])) node[key].forEach(visit); + }; + visit(spec); + return found; +} + +/** The rows a choropleth joined, one per region, kept for classing its colour after the theme. */ +const JOINED_ROWS = new WeakMap(); + +/** + * Paint a map's ground in its style, after the theme set the page it stands on. A point or route map + * (`reference`) is read for its geography, so its ground, when the theme decides it, is a reference map's. + */ +function styleMap(spec: any, ctx: InstantiateContext, reference = false): void { + const properties = ctx.chartProperties ?? {}; + const width = typeof properties.borderWidth === 'number' ? properties.borderWidth : undefined; + const style = baseMapStyle(properties.mapStyle); + const ground = groundFor(style, spec, reference); + const view = [spec, ...['vconcat', 'hconcat', 'concat'].flatMap((key) => spec[key] ?? [])].find((node: any) => node?.[MAP_WATER] !== undefined); + const water = view?.[MAP_WATER] === true; + if (view) delete view[MAP_WATER]; + // The reference ground's water fills a world map's frame only (a named style's frame is its own). + const painted = reference && !water && style !== undefined && style !== 'auto' ? ground + : reference && !water ? { ...ground, frame: undefined, land: landOnPage(spec, ground) } : ground; + paintMapGround(spec, withCustomColors(painted, properties.mapStyle), { globe: drawsGlobe(spec), ...(width !== undefined ? { borderWidth: width } : {}) }); +} + +/** Land with no water round it stands on the page: a light tone of the ink, so it reads as land. */ +function landOnPage(spec: any, ground: MapGround): string { + return isDark(ground.land) ? ground.land : mixHex(ground.land, ground.border, 0.35); +} + +/** The tag a point map of the world puts on its view, whose water may fill the frame. */ +const MAP_WATER = '__flintMapWater'; + +/** How a map's ground is painted and whether lines of latitude and longitude are drawn: offered on every map. */ +const groundProperties: ChartPropertyDef[] = [ + { + key: 'mapStyle', + label: 'Map style', + type: 'discrete', + options: [ + { value: 'auto', label: 'From the theme' }, + { value: 'light', label: 'Light' }, + { value: 'muted', label: 'Muted' }, + { value: 'atlas', label: 'Atlas (blue water, paper land)' }, + { value: 'dark', label: 'Dark' }, + { value: 'minimal', label: 'Minimal (outlines)' }, + ] satisfies { value: typeof MAP_STYLES[number]; label: string }[], + defaultValue: 'auto', + accepts: isCustomMapStyle, + acceptsLabel: CUSTOM_MAP_STYLE_LABEL, + }, + { key: 'graticule', label: 'Graticule', type: 'binary', defaultValue: false }, + { key: 'borderWidth', label: 'Border width', type: 'continuous', min: 0, max: 2, step: 0.1 }, +]; + +/** How a choropleth classes its colour, offered where the colour is a quantity. */ +const classProperties: ChartPropertyDef[] = [ + { + key: 'classes', + label: 'Classes', + type: 'discrete', + options: [ + { value: 'auto', label: 'Auto (quantiles; round steps when diverging)' }, + { value: 'quantile', label: 'Quantiles (equal counts)' }, + { value: 'equal', label: 'Equal round steps' }, + { value: 'jenks', label: 'Natural breaks (Jenks)' }, + { value: 'continuous', label: 'Continuous' }, + ] satisfies { value: typeof CLASS_METHODS[number]; label: string }[], + defaultValue: 'auto', + check: (ctx) => ({ applicable: Boolean(ctx.encodings?.color?.field) }), + }, + { + key: 'classCount', label: 'Class count', type: 'continuous', min: 3, max: 9, step: 1, defaultValue: 5, + check: (ctx) => ({ applicable: Boolean(ctx.encodings?.color?.field) && ctx.chartProperties?.classes !== 'continuous' }), + }, +]; + export const mapDef: ChartTemplateDef = { chart: "Map", + fillsCanvas: true, template: { layer: [ { @@ -410,7 +970,8 @@ export const mapDef: ChartTemplateDef = { }, ], }, - channels: ["longitude", "latitude", "color", "size", "opacity"], + // `size` is always the dots' area; `strokeWidth` the width of the legs `order` joins them by. + channels: ["longitude", "latitude", "color", "size", "shape", "opacity", "order", "detail", "strokeWidth", "text"], interactionSupport: { elements: true, region: ['cartesian'], @@ -422,13 +983,20 @@ export const mapDef: ChartTemplateDef = { const seriesField = firstDiscreteEncodingField(resolvedEncodings, ['color']); const colorField = resolvedEncodings.color?.field; const sizeField = resolvedEncodings.size?.field; + const widthField = resolvedEncodings.strokeWidth?.field; + const shapeField = resolvedEncodings.shape?.field; return { - fields: fieldsFromEncodingChannels(resolvedEncodings, ['longitude', 'latitude', 'color', 'size', 'opacity']), + fields: fieldsFromEncodingChannels(resolvedEncodings, ['longitude', 'latitude', 'color', 'size', 'shape', 'opacity', 'order', 'detail', 'strokeWidth', 'text']), seriesField, - legendFields: colorField || sizeField - ? { ...(colorField ? { color: colorField } : {}), ...(sizeField ? { size: sizeField } : {}) } + legendFields: colorField || sizeField || widthField || shapeField + ? { + ...(colorField ? { color: colorField } : {}), ...(sizeField ? { size: sizeField } : {}), + ...(shapeField ? { shape: shapeField } : {}), ...(widthField ? { strokeWidth: widthField } : {}), + } : undefined, - selectableMarks: ['circle'], + // The dots (points where a shape tells them apart), and a route's legs (geoshapes keyed to + // the row each leaves from); the land beneath is structure. + selectableMarks: [shapeField ? 'point' : 'circle', 'geoshape'], renderHoverStyles: { symbol: { stroke: MUTED_HOVER_STROKE, strokeWidth: 2 }, }, @@ -437,40 +1005,96 @@ export const mapDef: ChartTemplateDef = { const hits = event.role === 'legend-item' && legendField ? legendMatchedHits(event, context, legendField) : event.hits; - return targetFromHits(hits, context.keyField, { kind: 'mark', role: 'point' }); + // A leg is a path, as a line chart's segment is: it names the row it leaves from. A set + // of rows names their dots, unless it asks for their legs or holds nothing but legs. + const isLeg = (hit: { datum?: Record }) => hit.datum?.[ROUTE_PART] === 'leg'; + const legs = event.role === 'leg' + || (event.role !== 'legend-item' && hits.length > 0 && hits.every(isLeg)); + const own = hits.filter((hit) => isLeg(hit) === legs); + return targetFromHits(own.length > 0 ? own : hits, context.keyField, legs ? { kind: 'path', role: 'leg' } : { kind: 'mark', role: 'point' }); }, - presentUpdate: presentAnnotationUpdate(() => annotationCandidates( - 'center', 'top', 'right', 'bottom', 'left', - )), + presentUpdate: presentAnnotationUpdate((_element, _context, visual) => visual?.kind === 'path' + ? annotationCandidates('segment-midpoint', 'top', 'bottom', 'right', 'left') + : annotationCandidates('center', 'top', 'right', 'bottom', 'left')), }; }, - planPlot: (ctx) => scopeSize(bubbleScope(ctx, ctx.channelSemantics.longitude?.field, ctx.channelSemantics.latitude?.field)), + planPlot: (ctx) => framePlot(ctx, pointFrame(ctx)), + credit: (ctx) => { + if (typeof ctx.chartProperties?.baseMapUrl === 'string' && ctx.chartProperties.baseMapUrl) return undefined; + return boundaryCredit(pointBoundaries(ctx), ctx.chartProperties); + }, instantiate: (spec, ctx) => { const rows = ctx.fullTable ?? ctx.table ?? []; - const lonField = ctx.resolvedEncodings.longitude?.field; - const latField = ctx.resolvedEncodings.latitude?.field; - const scope = bubbleScope(ctx, lonField, latField); - - configureBubble(spec, scope); - drawAtPlannedSize(spec, ctx); // `baseMapUrl` swaps the region's base map for a GeoJSON // FeatureCollection of the host's own (a country's provinces, say); - // the projection still fits to it. - const baseMapUrl = ctx.chartProperties?.baseMapUrl; - if (typeof baseMapUrl === 'string' && baseMapUrl) { - spec.layer[0].data = { url: baseMapUrl, format: { type: 'json', property: 'features' } }; - } - applyPointEncodings(spec.layer[1], ctx.resolvedEncodings); + // the projection then fits to it. + const frame = pointFrame(ctx); + const b = pointBoundaries(ctx); + configureBubble(spec, frame, ctx.chartProperties, b); + drawAtPlannedSize(spec, ctx); + applyPointEncodings(pointLayer(spec), ctx.resolvedEncodings); configureBubbleLevels(spec, ctx.chartProperties, rows); - - // Projection controls only apply to the world map; the US map is fixed - // to albersUsa (which insets Alaska + Hawaii). - if (scope === 'world') { - for (const layer of spec.layer) applyWorldProjection(layer.projection, ctx.chartProperties); + if (frame.globe) configurePointGlobe(spec, frame, ctx.resolvedEncodings.longitude?.field, ctx.resolvedEncodings.latitude?.field); + if (ctx.chartProperties?.graticule === true) addGraticule(spec); + const base = spec.layer.find((layer: any) => layer?.[MAP_ROLE] === 'land'); + const disputed = disputedFeature(b, ctx.chartProperties); + if (disputed && base?.data && !ctx.chartProperties?.baseMapUrl) addDisputedBorders(spec, base.data, frame.regional, disputed, true); + const routes = mapRoutes(rows, ctx.resolvedEncodings, ctx.chartProperties, frame.globe); + addRouteLayers(spec, routes, { rows, resolved: ctx.resolvedEncodings, chartProperties: ctx.chartProperties, globe: frame.globe }); + // Without routes there are no legs for `strokeWidth` to widen. + const width = ctx.resolvedEncodings.strokeWidth?.field; + if (!routes.length && width) { + delete pointLayer(spec)?.encoding?.strokeWidth; + spec._warnings = [...(spec._warnings ?? []), { + severity: 'warning', code: 'map-width-without-routes', channel: 'strokeWidth', field: width, + message: `strokeWidth ('${width}') sets the width of a route's legs, and this map has none: add an order field to join its points. It was left out.`, + }]; + } + // `text` names the points, beside each, where it has room; the dots never draw it themselves. + delete pointLayer(spec)?.encoding?.text; + const labels = addPointLabels(spec, { rows, resolved: ctx.resolvedEncodings, routes, globe: frame.globe }); + if (labels?.dropped) { + spec._warnings = [...(spec._warnings ?? []), { + severity: 'info', code: 'map-labels-dropped', channel: 'text', field: ctx.resolvedEncodings.text.field, + message: `${labels.dropped} of ${labels.placed + labels.dropped} points are left unlabelled: their labels had no room beside them. Label fewer points, or give the map more room.`, + }]; + } + // Last, once every step has found the dots by their circle mark. A shape tells the dots apart: + // a circle mark draws only circles, a filled point any symbol. + if (ctx.resolvedEncodings.shape?.field) { + const dots = pointLayer(spec); + if (dots) dots.mark = { ...(typeof dots.mark === 'string' ? { type: dots.mark } : dots.mark), type: 'point', filled: true }; } }, - properties: [regionProperty, ...projectionProperties(wouldBeWorld)] as ChartPropertyDef[], + postProcess: (spec, ctx) => styleMap(spec, ctx, true), + properties: [ + regionProperty, boundariesProperty(wouldBeWorld), ...projectionProperties(wouldBeWorld), fitProperty(wouldBeWorld), ...groundProperties, + ...routeProperties, + ] as ChartPropertyDef[], +}; + +/** What a built-in map's join reports against: the map's name, and which features it draws. */ +interface JoinReport { + map: string; + drawn?: (id: number) => boolean; + /** Where another map can be chosen, for a region this one leaves out. */ + otherMaps?: string; +} + +/** Aggregations a region's rows can combine by, and what each makes of the values. */ +const COMBINE: Record number> = { + sum: (values) => values.reduce((total, value) => total + value, 0), + mean: (values) => values.reduce((total, value) => total + value, 0) / values.length, + min: (values) => Math.min(...values), + max: (values) => Math.max(...values), }; +COMBINE.average = COMBINE.mean; + +/** A few values, quoted, for a message: at most `limit`, with how many more there are. */ +function examples(values: readonly unknown[], limit = 5): string { + const shown = values.slice(0, limit).map((value) => JSON.stringify(String(value))).join(', '); + return values.length > limit ? `${shown} and ${values.length - limit} more` : shown; +} /** * Join the user's rows into a choropleth's geoshape. @@ -488,23 +1112,108 @@ export const mapDef: ChartTemplateDef = { * id, stash it on a synthetic `__geo_id` field, and join on that. A value that * is already the numeric id passes straight through. * + * A region takes one value. Rows that name the same region combine before the + * join, by the encoding's own aggregate, else by what the measure is: a total + * sums, a rate or a share averages; a category keeps its first row. On a + * built-in map (`report`), the keys that name no region, groups of countries + * ("World", "OECD") and a total coloured by area are reported as warnings. + * * Channels: `id` = region name/code/id, `color` = the measure, `detail` * (optional) = an explicit display name for tooltips (defaults to the `id` * field so the user always sees a readable label). */ function buildChoroplethJoin( - spec: any, ctx: any, resolver: (value: unknown) => unknown, featureKey = 'id', + spec: any, ctx: any, resolver: (value: unknown) => unknown, featureKey = 'id', report?: JoinReport, ): void { const idField: string | undefined = ctx.resolvedEncodings.id?.field; - const colorEnc = ctx.resolvedEncodings.color; + const colorEnc = ctx.resolvedEncodings.color ? { ...ctx.resolvedEncodings.color } : undefined; const valueField: string | undefined = colorEnc?.field; const labelField: string | undefined = ctx.resolvedEncodings.detail?.field ?? idField; + const semanticType = valueField + ? toTypeString(ctx.semanticTypes?.[valueField] ?? ctx.channelSemantics?.color?.semanticAnnotation?.semanticType) + : ''; + // A region is one shape: the encoding's aggregate is the rows' to combine by, not Vega-Lite's. + // The table arrives already aggregated per key, so two keys for one region (France, FRA) + // recombine as the author's aggregate does; counts add up. + const declared = ctx.encodings?.color?.aggregate ?? colorEnc?.aggregate; + const stated = declared === 'count' ? 'sum' : typeof declared === 'string' && COMBINE[declared] ? declared : undefined; + if (colorEnc && typeof colorEnc.aggregate === 'string' && COMBINE[colorEnc.aggregate]) delete colorEnc.aggregate; + const combineBy = colorEnc?.type === 'quantitative' + ? stated ?? (semanticType ? resolveAggregationDefault(semanticType) : undefined) + : undefined; const rows: any[] = ctx.fullTable ?? ctx.table ?? []; + const warn = (code: string, message: string, channel: string, field: string | undefined) => { + spec._warnings = [...(spec._warnings ?? []), { severity: 'warning', code, message, channel, ...(field ? { field } : {}) }]; + }; if (idField) { - const joined = rows.map((r) => ({ ...r, __geo_id: resolver(r[idField]) })); - const lookupFields = [idField, valueField, labelField].filter(Boolean) as string[]; + const regions = new Map(); + const unmatched = new Set(); + const aggregates = new Set(); + const undrawn = new Set(); + for (const row of rows) { + const key = row?.[idField]; + if (key == null || key === '') continue; + const id = resolver(key); + if (id === undefined) { + (isAggregateRegion(key) ? aggregates : unmatched).add(String(key)); + continue; + } + if (report?.drawn && typeof id === 'number' && !report.drawn(id)) undrawn.add(String(key)); + const group = regions.get(id); + if (group) group.push(row); + else regions.set(id, [row]); + } + let combined = 0; + const joined: any[] = [...regions].map(([id, group]) => { + const first = { ...group[0], __geo_id: id }; + if (group.length === 1) return first; + combined++; + if (valueField && combineBy && COMBINE[combineBy]) { + const values = group.map((row) => Number(row?.[valueField])).filter(Number.isFinite); + first[valueField] = values.length ? COMBINE[combineBy](values) : null; + } + return first; + }); + + if (report) { + if (unmatched.size > 0) { + warn('map-unmatched-keys', + `${unmatched.size} ${idField} value${unmatched.size === 1 ? '' : 's'} name${unmatched.size === 1 ? 's' : ''} no region on the ${report.map}: ${examples([...unmatched])}. ` + + `Check the spelling, or say what the key holds with chartProperties.keyType (${MAP_KEY_TYPES.filter((type) => type !== 'auto').join(', ')}).`, + 'id', idField); + } + if (aggregates.size > 0) { + warn('map-aggregate-rows', + `${examples([...aggregates])} ${aggregates.size === 1 ? 'is a group' : 'are groups'} of regions, not one: left off the map. Filter such rows out before charting.`, + 'id', idField); + } + if (undrawn.size > 0) { + warn('map-regions-not-drawn', + `${examples([...undrawn])} ${undrawn.size === 1 ? 'is' : 'are'} not in the ${report.map}.` + + (report.otherMaps ? ` Consider using another map via ${report.otherMaps}.` : ''), + 'id', idField); + } + if (combined > 0 && valueField) { + warn('map-rows-combined', + `${combined} region${combined === 1 ? ' has' : 's have'} more than one row; ${combineBy && COMBINE[combineBy] + ? `their ${valueField} is ${combineBy === 'sum' ? 'summed' : combineBy === 'min' || combineBy === 'max' ? `taken at its ${combineBy}` : 'averaged'}` + : 'the first row is shown'}. Aggregate the rows to one per region to choose how.`, + 'color', valueField); + } + if (semanticType && getRegistryEntry(semanticType).aggRole === 'additive' && colorEnc?.type === 'quantitative') { + warn('map-total-on-choropleth', + `${valueField} is a total (${semanticType}): coloured by area, large regions dominate whatever they hold. Map a rate or a share (per person, per km²), or show totals as sized bubbles.`, + 'color', valueField); + } + } + + JOINED_ROWS.set(ctx, joined); + // A region's label travels with its row: its text, and its width, measured once here. + const textField: string | undefined = ctx.resolvedEncodings.text?.field; + if (textField) for (const row of joined) row[LABEL_W] = labelWidth(row[textField]); + const lookupFields = [...new Set([idField, valueField, labelField, ...(textField ? [textField, LABEL_W] : [])].filter(Boolean))] as string[]; if (Array.isArray(spec.layer)) { // Every level joins the same table: state ids and county FIPS // codes share one numeric id space, so each layer matches its own. @@ -571,8 +1280,6 @@ function customChoroplethLevels(chartProperties: Record | undefined return levels.length === declared.length ? levels : undefined; } -/** The land a custom choropleth stands on, and the fill it gives a region without a value. */ -const CUSTOM_NO_DATA = '#e3e3e3'; /** * Draw a choropleth over the caller's geography. Each level is its own layer, @@ -606,6 +1313,7 @@ function configureCustomChoropleth(spec: any, levels: CustomChoroplethLevel[], c ...(gated ? { transform: [{ filter: geoLevelGate(GEO_LEVEL_SIGNAL, level.name) }] } : {}), // Finer levels draw thinner borders, so a county map is not all edges. mark: { ...mark, type: 'geoshape', stroke: 'white', strokeWidth: Math.max(0.15, 0.6 / (index + 1)) }, + [MAP_ROLE]: 'regions', })); } @@ -613,20 +1321,45 @@ function configureCustomChoropleth(spec: any, levels: CustomChoroplethLevel[], c function addCustomBaseMap(spec: any, url: unknown): void { if (typeof url !== 'string' || !url || !Array.isArray(spec.layer)) return; spec.layer.unshift(withInteractionDecorative({ + [MAP_ROLE]: 'noData', data: { url, format: { type: 'json', property: 'features' } }, mark: { type: 'geoshape', stroke: 'white', strokeWidth: 0.5 }, // The levels' colour and tooltip sit on the spec and reach every layer; the land states its own. - encoding: { color: { value: CUSTOM_NO_DATA }, tooltip: null }, + encoding: { color: { value: NO_DATA }, tooltip: null }, })); } +/** + * Keep every region on the map. A region the rows do not name, or name without a value, has no + * colour to take; Vega-Lite would drop its shape, and with it the outline of the country. It is + * drawn instead, in the no-data fill, under the same mark — one shape per region, so a county map + * draws no more than before. + */ +function keepRegionsWithoutData(spec: any): void { + const color = spec.encoding?.color; + if (!color?.field) return; + const value = `datum[${JSON.stringify(color.field)}]`; + const test = color.type === 'quantitative' ? `!isValid(${value}) || !isFinite(+${value})` : `!isValid(${value})`; + const noData = { test, value: NO_DATA }; + const existing = color.condition; + spec.encoding.color = { ...color, condition: existing ? [noData, ...(Array.isArray(existing) ? existing : [existing])] : noData }; + const keep = (node: any) => { + if (node?.[INTERACTION_PROVENANCE]?.role === 'decorative') return; + const mark = node?.mark; + if (mark && (mark === 'geoshape' || mark.type === 'geoshape')) node.mark = { ...(typeof mark === 'string' ? { type: mark } : mark), invalid: null }; + }; + keep(spec); + for (const layer of spec.layer ?? []) keep(layer); +} + export const choroplethDef: ChartTemplateDef = { chart: "Choropleth", + fillsCanvas: true, template: { mark: { type: "geoshape", stroke: "white", strokeWidth: 0.5 }, encoding: {}, }, - channels: ["id", "color", "detail"], + channels: ["id", "color", "detail", "text"], interactionSupport: { elements: true, region: ['cartesian'], @@ -638,7 +1371,7 @@ export const choroplethDef: ChartTemplateDef = { const idField = resolvedEncodings.id?.field; const colorField = resolvedEncodings.color?.field; return { - fields: fieldsFromEncodingChannels(resolvedEncodings, ['id', 'color', 'detail']), + fields: fieldsFromEncodingChannels(resolvedEncodings, ['id', 'color', 'detail', 'text']), categoryField: idField, selectableMarks: ['geoshape'], renderHoverStyles: { shape: { stroke: MUTED_HOVER_STROKE, strokeWidth: 2 } }, @@ -658,14 +1391,43 @@ export const choroplethDef: ChartTemplateDef = { legendFields: colorField ? { color: colorField } : undefined, }; }, + credit: (ctx) => { + if (customChoroplethLevels(ctx.chartProperties)) return undefined; + return boundaryCredit(choroplethBoundaries(ctx), ctx.chartProperties); + }, planPlot: (ctx) => { - const scope = choroplethScope(ctx, ctx.channelSemantics.id?.field); - return scope === 'world' && isGlobeProjection(ctx.chartProperties?.projection) - ? { width: GLOBE_SIZE, height: GLOBE_SIZE } - : scopeSize(scope); + if (customChoroplethLevels(ctx.chartProperties)) return framePlot(ctx, { scope: 'world', projection: { type: 'mercator' }, globe: false, regional: false, antarctica: true }); + const b = choroplethBoundaries(ctx); + // A file of the chart's own geography takes the room's shape: its shapes are fitted to it. + if (b.file && b.scope !== 'world') return framePlot(ctx, { scope: 'world', projection: { type: fittedProjection(b, ctx.chartProperties) }, globe: false, regional: false, antarctica: true }); + return b.scope === 'world' + ? framePlot(ctx, choroplethWorldFrame(ctx)) + : framePlot(ctx, { scope: 'us', projection: US_ATLAS.projection, aspect: US_FRAME_ASPECT, globe: false, regional: false, antarctica: false }); }, instantiate: (spec, ctx) => { - const idField = ctx.resolvedEncodings.id?.field; + instantiateChoropleth(spec, ctx); + // `text` names each region at its middle, where the region has room for it. + const textField = ctx.resolvedEncodings.text?.field; + if (textField) { + asLayered(spec); + const regions = spec.layer.find((layer: any) => layer.encoding?.color?.field); + addRegionLabels(spec, textField, regions?.encoding?.color); + } + }, + postProcess: (spec, ctx) => { + styleMap(spec, ctx, true); + classChoropleth(spec, JOINED_ROWS.get(ctx) ?? ctx.fullTable ?? ctx.table ?? [], ctx.chartProperties?.classes, ctx.chartProperties?.classCount); + }, + properties: [ + regionProperty, keyTypeProperty, levelProperty, boundariesProperty(wouldBeWorldChoropleth), + ...projectionProperties(wouldBeWorldChoropleth), fitProperty(wouldBeWorldChoropleth), + ...classProperties, ...groundProperties, + ] as ChartPropertyDef[], +}; + +/** A choropleth's regions, joined to its rows: the caller's own levels, a file of its own, or a built-in map. */ +function instantiateChoropleth(spec: any, ctx: InstantiateContext): void { + { const custom = customChoroplethLevels(ctx.chartProperties); if (custom) { configureCustomChoropleth(spec, custom, ctx.chartProperties); @@ -673,23 +1435,65 @@ export const choroplethDef: ChartTemplateDef = { const featureKey = typeof ctx.chartProperties?.featureKey === 'string' ? ctx.chartProperties.featureKey : 'id'; buildChoroplethJoin(spec, ctx, (value) => (value == null ? undefined : String(value)), featureKey); addCustomBaseMap(spec, ctx.chartProperties?.baseMapUrl); + keepRegionsWithoutData(spec); + if (ctx.chartProperties?.graticule === true) addGraticule(spec); + return; + } + const b = choroplethBoundaries(ctx); + const disputed = disputedFeature(b, ctx.chartProperties); + // The chart's own file keyed by FIPS or by its own keys: its regions, fitted to the plot. + if (b.file && b.scope !== 'world') { + configureFileChoropleth(spec, b as MapBoundaries & { file: BoundaryFile }, ctx.chartProperties); + const regions = spec.data; + drawAtPlannedSize(spec, ctx); + buildChoroplethJoin(spec, ctx, fileKeyResolver(b.ids!, ctx.chartProperties?.keyType), FILE_KEY_FIELD, { map: 'given boundaries' }); + keepRegionsWithoutData(spec); + if (ctx.chartProperties?.graticule === true) addGraticule(spec); + if (disputed) addDisputedBorders(spec, regions, false, disputed); return; } - const scope = choroplethScope(ctx, idField); + const mapped = b as MapBoundaries & { scope: MapScope }; + const scope = mapped.scope; const requestedLevel = ctx.chartProperties?.level; const level: ChoroplethLevel = requestedLevel === 'county' || requestedLevel === 'auto' ? requestedLevel : 'state'; - configureChoropleth(spec, scope, level); + const frame = scope === 'world' ? choroplethWorldFrame(ctx) : undefined; + configureChoropleth(spec, mapped, b.file ? 'state' : level, ctx.chartProperties, frame ? frameDetail(frame) : 'coarse'); + const regions = spec.data; drawAtPlannedSize(spec, ctx); - // County rows carry numeric FIPS ids, which the state resolver passes through. - const resolver: GeoResolver = scope === 'us' ? resolveUsState : resolveCountry; - buildChoroplethJoin(spec, ctx, resolver); - if (scope === 'world') { - applyWorldProjection(spec.projection, ctx.chartProperties); - if (isGlobeProjection(spec.projection?.type)) configureGlobe(spec); + const boundaries = worldBoundaries(ctx.chartProperties); + if (b.file) { + // A file of country codes: which countries it draws is the file's to know, not this package's. + buildChoroplethJoin(spec, ctx, fileKeyResolver(b.ids!, ctx.chartProperties?.keyType), FILE_KEY_FIELD, { map: 'given boundaries' }); + } else { + // County rows carry numeric FIPS ids, which the state resolver passes through. + const resolver: GeoResolver = keyTypeResolver(ctx.chartProperties?.keyType) ?? (scope === 'us' ? resolveUsState : resolveCountry); + buildChoroplethJoin(spec, ctx, resolver, 'id', scope === 'us' + ? { map: 'US map' } + : { + map: boundaries === 'world-bank' ? 'World Bank map' : 'Natural Earth map', + drawn: (id) => isWorldFeature(id, boundaries), + otherMaps: 'chartProperties.boundaries', + }); } - }, - properties: [regionProperty, levelProperty, ...projectionProperties(wouldBeWorldChoropleth)] as ChartPropertyDef[], -}; + if (frame) { + spec.projection = { ...frame.projection }; + const without = frame.antarctica ? undefined : withoutAntarctica(b); + if (without) spec.transform = [without, ...(spec.transform ?? [])]; + if (frame.regional && spec.mark) spec.mark = clipped(spec.mark); + if (frame.regional) spec[MAP_REGIONAL] = true; + if (frame.level) spec._mapFrame = { level: frame.level }; + if (frame.globe) configureGlobe(spec); + } + // A globe draws its land without data as a layer of its own, beneath the countries. + keepRegionsWithoutData(spec); + if (ctx.chartProperties?.graticule === true) addGraticule(spec); + // The regions are outlined at the coast; the borders between them are a mesh of their own, as a + // point map's are. A map of runtime levels keeps its outlines: a mesh per level would swap too. + if (regions && level !== 'auto') addBorderMesh(spec, regions, !!frame?.regional); + if (scope === 'world' && !b.file) spec[MAP_WATER] = true; + if (frame && disputed && regions) addDisputedBorders(spec, regions, frame.regional, disputed); + } +} diff --git a/packages/flint-js/src/vegalite/templates/utils.ts b/packages/flint-js/src/vegalite/templates/utils.ts index 8e461699..1bd5700b 100644 --- a/packages/flint-js/src/vegalite/templates/utils.ts +++ b/packages/flint-js/src/vegalite/templates/utils.ts @@ -8,6 +8,7 @@ import type { ChannelSemantics, InstantiateContext } from '../../core/types'; import { resolveDiscreteType } from '../../core/axis-detection'; +import { dateCells } from '../../core/decisions'; // --------------------------------------------------------------------------- // Discrete-dimension helpers @@ -302,6 +303,94 @@ export function adjustRectTiling(spec: any, ctx: InstantiateContext): void { } } +/** The working column holding where each cell along a time axis ends. */ +const cellEndField = (axis: 'x' | 'y') => `__cell_${axis}_end`; + +/** Whether the cells along this axis span their periods ({@link spanCalendarCells}): its scale takes the data's extent. */ +export function spansCalendarCells(spec: any, axis: 'x' | 'y'): boolean { + const units: any[] = [spec, spec.spec, ...(spec.layer ?? []), ...(spec.spec?.layer ?? [])]; + return units.some((unit) => unit?.encoding?.[`${axis}2`]?.field === cellEndField(axis)); +} + +/** + * Cells along a time axis span the period each date stands for ({@link dateCells}): its month, + * quarter or year where the dates step by months whatever their day (a quarter's end covers the + * quarter); the step from it where they keep an exact one (days, weeks, hours); until the next + * date where they keep about one (13 or 14 days). Neighbours meet whatever a month's length, and a + * missing period stays an empty gap. The fixed pixel + * width {@link adjustRectTiling} cuts can only fit the shortest month, leaving the rest of every + * other step open. The scale runs from the first date to the last cell's end, the data's own + * extent; value labels stand at each cell's middle. + */ +export function spanCalendarCells(spec: any, ctx: InstantiateContext): void { + const units: any[] = Array.isArray(spec.layer) ? spec.layer : [spec]; + const shared = spec.encoding ?? {}; + const markOf = (unit: any) => (typeof unit.mark === 'string' ? unit.mark : unit.mark?.type); + const cells = units.filter((unit) => markOf(unit) === 'rect'); + if (cells.length === 0) return; + for (const axis of ['x', 'y'] as const) { + const count = axis === 'x' ? ctx.layout.xContinuousAsDiscrete : ctx.layout.yContinuousAsDiscrete; + if (count <= 0) continue; + const enc = cells[0].encoding?.[axis] ?? shared[axis]; + if (enc?.type !== 'temporal' || !enc.field || enc.bin || enc.timeUnit || enc.aggregate) continue; + const values = ctx.table.map((row: any) => row[enc.field]); + const read = dateCells(values); + if (!read) continue; + const { cadence, cells: periods } = read; + const value = `datum[${JSON.stringify(enc.field)}]`; + // A date off its period's start (a quarter's end, the 5th of a month) moves to the start, so + // its cell covers the period it stands for. + const moved = [...periods].some(([time, [start]]) => start !== time); + const months = cadence.months; + const startExpr = months && 12 % months === 0 ? `utc(utcyear(${value}), floor(utcmonth(${value}) / ${months}) * ${months}, 1)` + : `utc(utcyear(${value}), utcmonth(${value}), 1)`; + let endExpr: string; + if (months) endExpr = `utcOffset('month', ${value}, ${months})`; + else if (cadence.exact) { + const days = cadence.ms! / 86_400_000; + endExpr = Number.isInteger(days) ? `utcOffset('day', ${value}, ${days})` : `time(${value}) + ${cadence.ms}`; + } + else { + // About one step: each date's cell runs to the next, looked up by the date. + const index = `indexof(${JSON.stringify([...periods.keys()])}, time(${value}))`; + endExpr = `${index} < 0 ? time(${value}) + ${cadence.ms} : ${JSON.stringify([...periods.values()].map(([, to]) => to))}[${index}]`; + } + const end = cellEndField(axis), mid = `__cell_${axis}_mid`; + const sizeKey = axis === 'x' ? 'width' : 'height'; + const labelled = units.some((unit) => unit.encoding?.[axis] && markOf(unit) !== 'rect'); + spec.transform = [ + ...(months && moved ? [{ calculate: startExpr, as: enc.field }] : []), + { calculate: endExpr, as: end }, + ...(labelled ? [{ calculate: `(time(${value}) + time(${endExpr})) / 2`, as: mid }] : []), + ...(spec.transform ?? []), + ]; + // No domain: the data's own extent, dates to period ends, is the first date to the last cell's + // end. A stated one would also stop the temporal ticks being planned. + const spanned = (target: any) => { + const { domain: _padded, ...scale } = target.scale ?? {}; + return { ...target, scale: { ...scale, nice: false } }; + }; + for (const unit of units) { + const own = unit.encoding?.[axis]; + if (markOf(unit) === 'rect') { + if (own) unit.encoding[axis] = spanned(own); + else shared[axis] = spanned(shared[axis]); + // Vega-Lite joins the end field's name into the axis title; this one is a working column. + const position = own ?? shared[axis]; + unit.encoding = { ...(unit.encoding ?? {}), [`${axis}2`]: { field: end, title: 'title' in position ? position.title : position.field } }; + if (unit.mark && typeof unit.mark === 'object') { + const { [sizeKey]: _cut, ...mark } = unit.mark; + unit.mark = mark; + } + } else if (own) { + // A label stands at its cell's middle, on the cells' scale and axis. It keeps the axis + // (dropping it in one layer drops the shared axis) and the cells' title, not its own field's. + unit.encoding[axis] = { ...spanned(own), field: mid, title: 'title' in own ? own.title : own.field }; + } + } + } +} + /** * Convert both positional axes to discrete types if they aren't already. * Returns resolvedTypes for layout declaration. diff --git a/packages/flint-js/src/vegalite/templates/violin.ts b/packages/flint-js/src/vegalite/templates/violin.ts index 342c52ab..fd647275 100644 --- a/packages/flint-js/src/vegalite/templates/violin.ts +++ b/packages/flint-js/src/vegalite/templates/violin.ts @@ -295,7 +295,7 @@ export const violinPlotDef: ChartTemplateDef = { renderHoverStyles: { area: { opacity: 'spotlight' } }, resolve: (event, context) => resolveSeriesTarget(event, context, seriesField), presentUpdate: presentAnnotationUpdate( - () => ({ connection: 'segment-midpoint', maxDistance: 120, maxWidth: 120 }), + () => ({ connection: 'segment-midpoint', maxWidth: 120 }), categoryValueAnnotationText(categoryField, measureField), ), }; @@ -329,7 +329,13 @@ export const violinPlotDef: ChartTemplateDef = { return { marks: ['area', ...extras], x: { type: 'quantitative', fields: [y.field], derived: 'density', rounded: true, ...(band ? { baseline: 'data' } : {}) }, - y: { type: 'quantitative', fields: [y.field], ...(config?.showPoints === true || config?.showMedian === true ? { baseline: 'data' } : {}) }, + // The value axis follows the measure's zero decision (a distribution fits its data); drawn + // points or a median fit it to the data whatever the decision. + y: { + type: 'quantitative', fields: [y.field], + ...(config?.showPoints === true || config?.showMedian === true ? { baseline: 'data' as const } + : y.zero ? { baseline: y.zero.zero ? 'zero' as const : 'data' as const } : {}), + }, series: color?.field ? { field: color.field, type: color.type } : { field: x.field, type: xType === 'nominal' || xType === 'ordinal' ? xType : 'nominal' }, // Panel headers name the categories, and a grid's row headers its sub-groups; only a @@ -357,6 +363,13 @@ export const violinPlotDef: ChartTemplateDef = { spec.transform[0].density = measureField; spec.transform[0].groupby = groupby; + // The value axis is the measure's, renamed by the density transform: it takes the measure's + // zero decision (a distribution reads its values as positions, so it fits the data). + // Drawn points or a median keep their own data-fitted axis (see structure). + const zero = ctx.channelSemantics?.y?.zero; + const evidence = ctx.chartProperties?.showPoints === true || ctx.chartProperties?.showMedian === true; + if (zero && !evidence && spec.encoding?.y) spec.encoding.y = { ...spec.encoding.y, scale: { ...(spec.encoding.y.scale ?? {}), zero: zero.zero } }; + // --- Bandwidth (mirrors density.ts) --- // `bandwidth` is a *relative* smoothing multiplier (1 ≈ the data-derived // default per group), NOT an absolute width in data units — an absolute diff --git a/packages/flint-js/src/vegalite/templates/waterfall.ts b/packages/flint-js/src/vegalite/templates/waterfall.ts index 2b16ce16..c2d96d00 100644 --- a/packages/flint-js/src/vegalite/templates/waterfall.ts +++ b/packages/flint-js/src/vegalite/templates/waterfall.ts @@ -16,9 +16,9 @@ import { resolveTotalsMode } from '../../chart-types/waterfall'; function waterfallAnnotationCandidates(): readonly AnnotationCandidate[] { return [ - { connection: 'value-end', valueAxis: 'y', priority: 0 }, - { connection: 'value-side', valueAxis: 'y', crossSide: 'start', valueInset: 1 / 2, priority: 1 }, - { connection: 'value-side', valueAxis: 'y', crossSide: 'end', valueInset: 1 / 2, priority: 1 }, + { connection: 'value-end', valueAxis: 'y' }, + { connection: 'value-side', valueAxis: 'y', crossSide: 'start', valueInset: 1 / 2 }, + { connection: 'value-side', valueAxis: 'y', crossSide: 'end', valueInset: 1 / 2 }, ]; } @@ -86,8 +86,9 @@ export const waterfallChartDef: ChartTemplateDef = { semanticInteractions: ({ resolvedEncodings }) => { const categoryField = firstDiscreteEncodingField(resolvedEncodings, ['x']); const seriesField = firstDiscreteEncodingField(resolvedEncodings, ['color']); - const colorField = resolvedEncodings.color?.field; - const legendField = colorField ?? '__wf_color'; + // The legend keys the derived step kind (total / increase / decrease), whatever the author's + // Type column says (start / delta / end), so a legend value is read from that column. + const legendField = '__wf_color'; return { fields: fieldsFromEncodingChannels(resolvedEncodings, ['x', 'color']), categoryField, diff --git a/packages/flint-js/src/vegalite/theme.ts b/packages/flint-js/src/vegalite/theme.ts index 6ba32541..17c5f78b 100644 --- a/packages/flint-js/src/vegalite/theme.ts +++ b/packages/flint-js/src/vegalite/theme.ts @@ -44,6 +44,9 @@ import { coupledPointOpacity, MIN_HALO_DOT, pointHaloWidth, pointOutlineWidth, t import type { FurniturePlan } from '../core/furniture-plan'; import type { SeriesEndLayout } from '../core/series-end'; import type { LegendPlan, PlannedKey } from '../core/legend-plan'; +import { stepColorScale } from './color-classes'; +import { niceExtent } from './nice'; +import type { NeutralBand } from '../core/color-controls'; /** Mark families that carry data values (as opposed to chrome). */ const DATA_MARKS = new Set([ @@ -257,6 +260,23 @@ export function vegaLiteBuiltFacts(spec: any, table: any[]): BuiltFacts { return { marks: collectMarkTypes(spec), fields, transformed, stacking: stacking ?? (implicit ? 'stacked' : 'none'), segmented, baselines, ownScales, fitted, rounded, reversed, keys: [...keys.values()] }; } +/** + * A bar whose `detail` field is not its colour is drawn as a stack of segments, one per value, so a + * selection or a link can pick a value's share out; it should still read as one bar. Read off the + * encodings, which survive a bar being wrapped into a layer. + */ +function detailSegments(node: any, encoding: any): boolean { + // A ranged bar (a Gantt task) spans its own interval and adjoins nothing. + if (markTypeOf(node.mark) !== 'bar' || encoding?.x2 || encoding?.y2) return false; + const detail = encoding?.detail?.field; + return Boolean(detail) && detail !== (encoding.color?.field ?? encoding.fill?.field); +} + +/** A node's encoding over its top-level parent's, for the passes that walk without carrying one. */ +function withSpecEncoding(spec: any, node: any): any { + return { ...(spec.spec?.encoding ?? {}), ...(spec.encoding ?? {}), ...(node.encoding ?? {}) }; +} + function walk(node: any, visit: (n: any) => void): void { if (!node || typeof node !== 'object') return; visit(node); @@ -358,6 +378,7 @@ function titleOf(enc: any): string | undefined { export function realizeThemeVegaLite( spec: any, d: DesignDecisions, table: any[] = [], planned: Partial> = {}, + colorNeutral?: NeutralBand, ): ThemeReport[] { const { axisLabels, title, valueLabels, furniture, legend, points, pointSize, lineWidth, rules, rowNames } = planned; const report: ThemeReport[] = []; @@ -372,7 +393,7 @@ export function realizeThemeVegaLite( moveAxisTitlesToSubtitle(spec, d, title?.deck); applyZeroRule(spec, d, table); applyMarks(spec, d, table, say, points, pointSize, lineWidth); - applySeriesInk(spec, d, table, say, legend); + applySeriesInk(spec, d, table, say, legend, colorNeutral); harmonizeLinePoints(spec, d, table, say, lineWidth); applyConnectors(spec, d); applyRedundantChannels(spec, d, say); @@ -392,6 +413,7 @@ export function realizeThemeVegaLite( applyReadableSeriesText(spec, d, say); applyTextures(spec, d); applyGradientFills(spec, d, table, say); + inkAreaEdges(spec); applyTypeCase(spec, config, d, table, say); applyDisplayType(spec, d); applyTableStyle(spec, d); @@ -409,6 +431,23 @@ export function realizeThemeVegaLite( return wrapped ? report : report; } +/** + * An area's edge (`areaEdge`) is Vega-Lite's line overlay, which follows a colour encoding but not + * an ink written on the area's own mark: a single series inked on the mark alone would get the + * renderer's default blue edge. The edge takes the area's ink, once every pass that sets it is done. + */ +function inkAreaEdges(spec: any): void { + walk(spec, (node) => { + if (markTypeOf(node.mark) !== 'area') return; + const mark = normalizeMark(node.mark); + const line = mark.line; + if (!line || typeof line !== 'object' || line.color != null || line.stroke != null) return; + const ink = typeof mark.color === 'string' ? mark.color + : typeof mark.fill === 'string' && !mark.fill.startsWith('url(') ? mark.fill : undefined; + if (ink) node.mark = { ...mark, line: { ...line, color: ink } }; + }); +} + /** * How opaque the house's dots are. Vega-Lite draws unaggregated dots at 0.7 unless told; the * config tells it, and a chart that set its own opacity on the mark keeps it. A fading house's dots @@ -544,10 +583,14 @@ const VEGA_SWATCH: Record, stri square: 'square', circle: 'circle', line: 'stroke', }; +/** Marks drawn in stroke alone, whose key symbols Vega-Lite leaves unfilled. */ +const STROKED_MARKS = new Set(['line', 'trail', 'rule']); + /** * The house's swatch for every key to categories. Written on the encoding, where Vega-Lite reads * it before the symbol it would infer from the mark. A key that is itself a shape or a size keeps - * its symbols: those *are* the entries. + * its symbols: those *are* the entries. A square or circle is a chip of fill, and a line is drawn + * in stroke alone, so its key would be a hollow outline: a stroked mark keeps its own short stroke. */ function applyLegendSwatch(spec: any, d: DesignDecisions): void { const swatch = d.legend.swatch; @@ -556,6 +599,7 @@ function applyLegendSwatch(spec: any, d: DesignDecisions): void { walk(spec, (node) => { const enc = node.encoding; if (!enc) return; + if (swatch !== 'line' && STROKED_MARKS.has(markTypeOf(node.mark) ?? '')) return; for (const channel of ['color', 'fill', 'stroke'] as const) { const def = enc[channel]; if (!def?.field || def.legend === null) continue; @@ -567,6 +611,72 @@ function applyLegendSwatch(spec: any, d: DesignDecisions): void { }); } +/** Vega-Lite's own sort ops, as far as a band's order needs them. */ +const BAND_ORDER_OPS: Record number> = { + count: (values) => values.length, + valid: (values) => values.length, + sum: (values) => values.reduce((total, value) => total + value, 0), + mean: (values) => values.reduce((total, value) => total + value, 0) / values.length, + average: (values) => values.reduce((total, value) => total + value, 0) / values.length, + min: (values) => Math.min(...values), + max: (values) => Math.max(...values), + median: (values) => { + const sorted = [...values].sort((a, b) => a - b); + const middle = sorted.length >> 1; + return sorted.length % 2 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2; + }, +}; + +/** The marks Vega-Lite stacks on their measure unless told not to. */ +const STACKED_BY_DEFAULT = new Set(['bar', 'area', 'arc']); +/** The channels besides position that split a stack into segments, as far as a band's order needs them. */ +const STACK_BY_CHANNELS = ['color', 'fill', 'stroke', 'opacity', 'size', 'shape', 'strokeDash', 'detail'] as const; + +/** + * A band's order that every layer on the band can share. Layers on one band union their domains, + * and a union can neither sort by a channel a layer does not encode, nor by a sum, nor by sorts + * that differ (a stacked bar sorts by its sum, its labels by their minimum). A sort by another + * channel or field becomes the list of names in the order the bars stand, computed as Vega-Lite + * would for the mark that sorts; any other sort is already one every layer can state. + */ +function bandOrder(sort: any, field: string, enc: any, table: any[], mark?: string): any { + let by: { field?: string; op: string; descending: boolean } | undefined; + const encodingSort = typeof sort === 'string' && /^-?[a-zA-Z]+$/.test(sort) && sort !== 'ascending' && sort !== 'descending' + ? { encoding: sort.replace(/^-/, ''), order: sort.startsWith('-') ? 'descending' : 'ascending' } + : sort && typeof sort === 'object' && !Array.isArray(sort) && sort.encoding ? sort : undefined; + if (encodingSort) { + const def = enc[encodingSort.encoding]; + if (!def?.field && def?.aggregate !== 'count') return undefined; + // Vega-Lite sums a stacked measure: a bar or an area stacks by default, split or not, unless + // its rows are aggregated with nothing to split them; another mark only where it says so. + const splitBy = STACK_BY_CHANNELS.some((channel) => enc[channel]?.field && enc[channel].field !== field && !enc[channel].aggregate); + const aggregated = Object.values(enc).some((channelDef) => channelDef?.aggregate); + const stacks = def.stack !== undefined ? def.stack !== null && def.stack !== false : mark ? STACKED_BY_DEFAULT.has(mark) : splitBy; + const measureStacked = stacks && def.type === 'quantitative' && enc[`${encodingSort.encoding}2`] === undefined && !(aggregated && !splitBy); + by = { field: def.field, op: def.aggregate ?? (measureStacked ? 'sum' : 'min'), descending: encodingSort.order === 'descending' }; + } else if (sort && typeof sort === 'object' && !Array.isArray(sort) && (sort.field || sort.op === 'count')) { + by = { field: sort.field, op: sort.op ?? 'min', descending: sort.order === 'descending' }; + } + if (!by) return sort; + const aggregate = BAND_ORDER_OPS[by.op]; + if (!aggregate) return sort; + const groups = new Map(); + for (const row of table) { + const name = row?.[field]; + if (name == null) continue; + if (!groups.has(name)) groups.set(name, []); + const value = by.op === 'count' ? 1 : Number(row?.[by.field!]); + if (by.op === 'count' || (row?.[by.field!] != null && Number.isFinite(value))) groups.get(name)!.push(value); + } + const keyed = [...groups].map(([name, values]) => ({ name, key: values.length ? aggregate(values) : undefined })); + // A field the rows do not hold — one a transform computes — is Vega-Lite's to sort by. + if (!keyed.some(({ key }) => key !== undefined)) return sort; + const direction = by.descending ? -1 : 1; + // Stable, so ties keep the order the rows first meet them; names with nothing to sort by go last. + keyed.sort((a, b) => a.key === undefined ? (b.key === undefined ? 0 : 1) : b.key === undefined ? -1 : direction * (a.key - b.key)); + return keyed.map(({ name }) => name); +} + /** * Names on their own line above each bar, as the plan set them: the band holds the name, a small gap * and the bar, so the bands carry no padding of their own; the bar is drawn at the thickness the @@ -585,6 +695,8 @@ function placeRowNamesAbove(spec: any, d: DesignDecisions, table: any[], plan: N if (!bar) return; const y = mergedEncoding(bar, spec.encoding).y; const field: string = y.field; + const stated = y.sort; + const sort = bandOrder(stated, field, mergedEncoding(bar, spec.encoding), table, markTypeOf(bar.mark)); const centre = plan.step / 2; // From the band's middle, where Vega-Lite stands what it draws on a band. const barShift = Math.round(plan.top + plan.line + plan.gap + plan.bar / 2 - centre); @@ -593,6 +705,7 @@ function placeRowNamesAbove(spec: any, d: DesignDecisions, table: any[], plan: N if (!banded(enc) || enc.y.field !== field) continue; const target = unit.encoding?.y ?? spec.encoding?.y; if (target) { + if (sort !== stated) target.sort = sort; target.scale = { ...(target.scale ?? {}), paddingInner: 0, paddingOuter: 0 }; target.axis = target.axis === null ? null : { ...(target.axis ?? {}), labels: false, ticks: false, domain: false }; } @@ -609,6 +722,8 @@ function placeRowNamesAbove(spec: any, d: DesignDecisions, table: any[], plan: N const label = d.axes.y?.label; const names = [...new Set(table.map((row) => row?.[field]).filter((value) => value != null))]; const textCase = label?.textCase; + // The names have no channel or measure of their own to sort by: they take an order they can state. + const namesSort = sort === null || Array.isArray(sort) || sort === 'ascending' || sort === 'descending' ? sort : undefined; spec.layer.push({ __themeSynthetic: true, name: 'row-names', @@ -624,13 +739,55 @@ function placeRowNamesAbove(spec: any, d: DesignDecisions, table: any[], plan: N limit: plan.width, }, encoding: { - y: { field, type: y.type, ...(y.sort !== undefined ? { sort: y.sort } : {}), axis: { title: null, labels: false, ticks: false, domain: false } }, + y: { field, type: y.type, ...(namesSort !== undefined ? { sort: namesSort } : {}), axis: { title: null, labels: false, ticks: false, domain: false } }, x: { value: 0 }, text: { field: '__rowName', type: 'nominal' }, }, }); } +/** + * Bars sorted by their value stay sorted however many layers draw on their band. A label layer + * shares the bars' band, and Vega-Lite unions the layers' domains: the bars sort by their sum, + * the labels by their minimum, and a union keeps neither — or a filtered layer's data drops a sum + * outright — so the bars came out in name order. Where several layers share a band sorted by a + * channel or a field, each states the names in the order the bars stand. A band each panel of a + * facet sorts for itself, and a sort the rows cannot reproduce, stay Vega-Lite's. + */ +export function alignBandOrders(spec: any, table: any[]): void { + // A column computed per row (a value label's printed text) leaves the rows, and so their order, as they are. + const keepsRows = (transform: any) => Object.keys(transform ?? {}).every((key) => key === 'calculate' || key === 'as'); + const visit = (node: any, transformed: boolean): void => { + if (!node || typeof node !== 'object') return; + // Rows a transform reshapes are not the table's: their order is Vega-Lite's to compute. + const reshaped = transformed || (node.transform ?? []).some((t: any) => !keepsRows(t)) || Boolean(node.data && node !== spec); + if (node.spec) visit(node.spec, reshaped); + if (!Array.isArray(node.layer) || reshaped) return; + for (const channel of ['x', 'y'] as const) { + if (node.resolve?.scale?.[channel] === 'independent') continue; + const units = node.layer.map((unit: any) => ({ unit, enc: mergedEncoding(unit, node.encoding) })) + .filter(({ enc }: any) => enc[channel]?.field && (enc[channel].type === 'nominal' || enc[channel].type === 'ordinal')); + if (units.length < 2) continue; + const field = units[0].enc[channel].field; + if (units.some(({ enc }: any) => enc[channel].field !== field)) continue; + // A computed column that rewrites the band's own field reorders it. + if ((node.transform ?? []).some((t: any) => t?.as === field)) continue; + const ordered = (sort: any) => sort != null && !Array.isArray(sort) && sort !== 'ascending' && sort !== 'descending'; + // The order is the drawn marks', not a label's: the first layer the theme did not add. + const source = units.find(({ unit, enc }: any) => !unit.__themeSynthetic && ordered(enc[channel].sort)) + ?? units.find(({ enc }: any) => ordered(enc[channel].sort)); + if (!source || source.unit.data || source.unit.transform?.length) continue; + const order = bandOrder(source.enc[channel].sort, field, source.enc, table, markTypeOf(source.unit.mark)); + if (!Array.isArray(order)) continue; + for (const { unit } of units) { + const target = unit.encoding?.[channel] ?? node.encoding?.[channel]; + if (target) target.sort = order; + } + } + }; + visit(spec, false); +} + /** * Print the value labels, and nothing else. * @@ -724,7 +881,7 @@ function applyTypography(config: any, d: DesignDecisions): void { * alone, because a graphic a little wider than its plot is normal and a break * there would be gratuitous; one that overhangs more is set down a size; only * a headline that still does not fit at the smaller size is broken, and then - * over even lines rather than one full line and an orphan. Broken lines are + * over full lines with no orphan at the end. Broken lines are * taken out of the plot rather than added to the canvas. */ /** Vega-Lite's offset between the plot and a key beside it, as the plan's profile measures it. */ @@ -870,7 +1027,7 @@ function applyDeckFit( spec.title = { ...spec.title, subtitle: fit.lines }; takeFromPlotHeight(spec, fit.taken); say('title.subtitle', 'deck-broken', - `the deck overhangs the ${Math.round(block)}px block, so it breaks over ${fit.lines.length} even lines` + `the deck overhangs the ${Math.round(block)}px block, so it breaks over ${fit.lines.length} lines` + ' — the height comes out of the plot, not out of the canvas the caller asked for'); } @@ -2391,12 +2548,17 @@ function applyMarks( const t = enc[channel]?.type; return enc[channel]?.field && (t === 'nominal' || t === 'ordinal'); }); - // A rect with a category on *both* axes is a cell in a grid, not a + // A rect with a category on an axis is a cell in a grid, not a // bar in a row: the cell is the band, and a house's bar thickness // says nothing about it. Thinning it here opens gaps in what should // read as a continuous surface, and how big the cell is was settled - // by the layout, which is the only pass that knows the room. - if (mark === 'rect' && discrete.length === 2) { + // by the layout, which is the only pass that knows the room. The + // other axis may be a category too, or dates the cells run along + // (each cell spans its period); only a measured range — a band of + // values from x to x2, as a bullet's zones — is a bar. + const measuredRange = (['x', 'y'] as const).some((channel) => + enc[channel]?.type === 'quantitative' && enc[`${channel}2`] != null); + if (mark === 'rect' && discrete.length > 0 && !measuredRange) { if (!saidCells) { say('marks.bandFraction', 'band-fraction-not-applied', 'the marks are cells in a grid, not bars in a row — band occupancy is a bar rule and does not apply'); @@ -2505,6 +2667,9 @@ function applyMarks( const enc = node.encoding ?? {}; const banded = Boolean(enc.color?.field ?? enc.fill?.field ?? spec.encoding?.color?.field); if (!banded || isLiteralMark(node)) return; + // An area that draws its own edge (`areaEdge`) is already parted from the band + // above by that line; a surface stroke round it would also cut the axes it meets. + if (normalizeMark(node.mark).line) return; node.mark = { ...normalizeMark(node.mark), stroke: m.separator!.color, @@ -2515,6 +2680,8 @@ function applyMarks( } if (mark !== 'bar' && mark !== 'rect') return; if (isLiteralMark(node)) return; + // Segments of one bar (`sealDetailSegments`) are not held apart. + if (detailSegments(node, withSpecEncoding(spec, node))) return; // A cell in a grid is not a bar in a row: it adjoins on both axes // and its fill is the reading, so how it is held apart is its own // decision, taken below. @@ -2564,6 +2731,8 @@ function applyMarks( walk(spec, (node) => { if (markTypeOf(node.mark) !== 'bar') return; if (isLiteralMark(node)) return; + // An outline round each segment of one bar would draw the segments, not the bar. + if (detailSegments(node, withSpecEncoding(spec, node))) return; const enc = node.encoding ?? {}; if (isGridCell(node, enc)) return; const mark = normalizeMark(node.mark); @@ -3631,7 +3800,7 @@ function boundPalette(values: unknown[], s: DesignDecisions['series']): string[] ?? s.categorical[next++] ?? s.overflow ?? s.categorical[(next - 1) % Math.max(1, s.categorical.length)] ?? s.single); } -function applySeriesInk(spec: any, d: DesignDecisions, table: any[], say: ReportDeparture, legend?: LegendPlan): void { +function applySeriesInk(spec: any, d: DesignDecisions, table: any[], say: ReportDeparture, legend?: LegendPlan, colorNeutral?: NeutralBand): void { const s = d.series; let sawColorField = false; let saidCollapse = false; @@ -3708,6 +3877,8 @@ function applySeriesInk(spec: any, d: DesignDecisions, table: any[], say: Report // on a one-way ramp that half-empty domain paints the data in the dark half only, so the // ramp spans the data's own range instead. const symmetric = s.mode === 'sequential' && isContinuousColor(enc) && enc.scale?.domainMid !== undefined; + // A diverging field's pivot, before the range clears it: the stepped classes break there. + const pivot = s.mode === 'diverging' && typeof enc.scale?.domainMid === 'number' ? enc.scale.domainMid : undefined; setColorRange(enc, range, quantize ? { type: 'quantize' } : undefined); if (symmetric) { delete enc.scale.domain; @@ -3717,6 +3888,8 @@ function applySeriesInk(spec: any, d: DesignDecisions, table: any[], say: Report saidSequentialDomain = true; } } + // The house's bins are about as many classes at round values, not its count of equal cuts. + if (quantize) stepColorScale(enc, range, s.quantize!, table, pivot, { neutral: s.mode === 'diverging' ? colorNeutral : undefined }); continue; } // Categorical: an ordered set consumed by index, with the overflow @@ -4494,6 +4667,23 @@ function labelOneBody( return; } const stackedSegments = planned.form === 'segments'; + // A bar split by `detail` reads as one bar, so its label prints the bar's total: the label drops + // `detail`, and sums its rows first unless Vega-Lite aggregates the measure already. + const segmentsOfOne = Boolean(primary) && detailSegments(primary, enc); + const labelRows: { transform: any[] } = { transform: [] }; + // What the labels print, they are measured by: each bar's total, not its segments. + if (segmentsOfOne && !measure.aggregate) { + const keys = [...new Set((['x', 'y', 'xOffset', 'yOffset', 'color', 'row', 'column', 'facet'] as const) + .map((ch) => enc[ch]?.field).filter((field): field is string => typeof field === 'string' && field !== measure.field))]; + const totals = new Map(); + for (const row of table) { + const key = JSON.stringify(keys.map((k) => row?.[k])); + const total = totals.get(key) ?? totals.set(key, { ...Object.fromEntries(keys.map((k) => [k, row?.[k]])), [measure.field]: 0 }).get(key); + const v = Number(row?.[measure.field]); + if (Number.isFinite(v)) total[measure.field] += v; + } + table = [...totals.values()]; + } const horizontal = measureChannel === 'x'; // The plan decides: a house's `atMark` can still print every label past the bar (`allOutside`). @@ -4709,13 +4899,14 @@ function labelOneBody( // A compacted label is a string computed per row: an aggregated one keeps its format. const compact = measure.aggregate ? undefined : d.dataLabels.compact; if (d.dataLabels.unit || compact) { - printWithUnit(body, { encoding: labelEncoding }, measure.field, d.dataLabels.format, d.dataLabels.unit, compact); + printWithUnit(segmentsOfOne && !measure.aggregate ? labelRows : body, { encoding: labelEncoding }, measure.field, d.dataLabels.format, d.dataLabels.unit, compact); } // `facet`, `row` and `column` split the data; Vega-Lite refuses them inside // a layer and `appendLayer` promotes them to a real facet operator that // covers every layer, the label included. Copied onto the label they are a // second, conflicting split — so they are left to the operator. for (const ch of ['x', 'y', 'xOffset', 'yOffset', 'detail', 'theta', 'radius'] as const) { + if (ch === 'detail' && segmentsOfOne) continue; if (enc[ch]) labelEncoding[ch] = stripAxis(enc[ch]); } // A label anchored at the base or the middle of its bar is placed at 0 or half its value, on the @@ -4899,7 +5090,15 @@ function labelOneBody( // in front of whatever else the label layer derives. // Under a live layout, labels the plan does not print leave the data rather than // the view; all of them leave together, so no stack is cut. + const segmentTotals = segmentsOfOne && !measure.aggregate ? [{ + aggregate: [{ op: 'sum', field: measure.field, as: measure.field }], + groupby: [...new Set((['x', 'y', 'xOffset', 'yOffset', 'detail'] as const) + .filter((ch) => ch !== measureChannel) + .flatMap((ch) => [].concat(labelEncoding[ch] ?? []).map((e: any) => e?.field)) + .filter((field): field is string => typeof field === 'string' && field !== '__flintLabelAt'))], + }, ...labelRows.transform] : []; const labelTransforms = [ + ...segmentTotals, ...(anchorTransform ? [anchorTransform] : []), ...(stackOrderTransform ? [stackOrderTransform] : []), ...(stackedTransform ?? []), @@ -4984,14 +5183,14 @@ function labelOneBody( const split = (threshold: number, comparison: '<' | '>', message: string) => { const v = `abs(datum[${JSON.stringify(measure.field)}])`; const flipped = !inside; - layer.transform = [...(anchorTransform ? [anchorTransform] : []), { filter: `${v} ${comparison === '<' ? '>=' : '<='} ${threshold}` }]; + layer.transform = [...segmentTotals, ...(anchorTransform ? [anchorTransform] : []), { filter: `${v} ${comparison === '<' ? '>=' : '<='} ${threshold}` }]; const { color: insideInk, ...rest } = labelEncoding; const keepsSeriesInk = d.dataLabels.inkMode === 'matchSeries' && insideInk?.field; const movedEncoding = { ...rest, ...(keepsSeriesInk ? { color: insideInk } : {}), [measureChannel]: valueAt }; const movedInk = flipped ? flipInk(true) : onPlot(flipInk(false) ?? d.text.primary); const other: any = withInteractionTextLabel({ __themeSynthetic: true, - transform: [{ filter: `${v} ${comparison} ${threshold}` }], + transform: [...segmentTotals, { filter: `${v} ${comparison} ${threshold}` }], mark: { ...markDef, ...geometry(flipped), ...(keepsSeriesInk ? {} : { color: movedInk }) }, encoding: movedEncoding, }, { presentation: flipped ? 'on-mark' : 'independent' }); @@ -5038,12 +5237,21 @@ function labelOneBody( if (typeof plotWidth === 'number' && plotWidth > inset * (hasNegative ? 2 : 1) && encodings.length && encodings.every(encoding => encoding.scale?.range == null && encoding.scale?.rangeMin == null && encoding.scale?.rangeMax == null)) { + // Where the bars grow one way, the room runs on the axis itself: the domain extends + // by the share of the plot the labels take, so every bar keeps its length and the + // axis, its ticks and its grid reach the plot's edge rather than stopping short. + const end = !reversed && !hasNegative ? labelRoomEnd(encodings, table, measure, enc, plotWidth, inset) : undefined; for (const encoding of encodings) { - encoding.scale = { - ...(encoding.scale ?? {}), - rangeMin: reversed || hasNegative ? inset : 0, - rangeMax: !reversed || hasNegative ? plotWidth - inset : plotWidth, - }; + encoding.scale = end + ? { ...(encoding.scale ?? {}), domainMax: end.max, nice: false, ...(end.min !== undefined ? { domainMin: end.min } : {}) } + : { + ...(encoding.scale ?? {}), + rangeMin: reversed || hasNegative ? inset : 0, + rangeMax: !reversed || hasNegative ? plotWidth - inset : plotWidth, + }; + if (end?.ticks && encoding.axis && Array.isArray(encoding.axis.values)) { + encoding.axis = { ...encoding.axis, values: end.ticks, tickCount: end.ticks.length }; + } } reserved = true; } @@ -5542,6 +5750,45 @@ function applyBarMinLength(spec: any, min: number, table: any[], plotWidth: numb } } +/** + * A bar split into segments by its `detail` field reads as one bar: each segment takes a hairline in + * its own ink, so no seam shows where segments meet, and no separator or outline is drawn between + * them. Run once the inks are final, themed or not. A segment's stroke mirrors a colour field's + * scale; a bar in one ink takes the ink its mark or the config states. + */ +export function sealDetailSegments(spec: any): void { + const config = spec.config ?? {}; + const visit = (node: any, from: any) => { + if (!node || typeof node !== 'object') return; + const seen = mergedEncoding(node, from); + if (detailSegments(node, seen)) { + const mark = normalizeMark(node.mark); + const colour = seen.fill?.field ? seen.fill : seen.color?.field ? seen.color : undefined; + const fill = typeof mark.fill === 'string' ? mark.fill : undefined; + const seal = { strokeWidth: 1, ...(mark.fillOpacity !== undefined ? { strokeOpacity: mark.fillOpacity } : {}) }; + if (fill?.startsWith('url(')) { + // A texture has its own seams; leave it. + } else if (seen.stroke) { + // A stroke the house already maps (a texture's darker edge) stays. + } else if (colour) { + const { title: _title, legend: _legend, ...rest } = colour; + void _title; void _legend; + node.encoding = { ...(node.encoding ?? {}), stroke: { ...rest, legend: null } }; + const { stroke: _stroke, ...unstroked } = mark; + void _stroke; + node.mark = { ...unstroked, ...seal }; + } else { + const ink = fill ?? (typeof mark.color === 'string' ? mark.color : undefined) + ?? config.bar?.color ?? config.mark?.color ?? config.range?.category?.[0] ?? '#4c78a8'; + node.mark = { ...mark, stroke: ink, ...seal }; + } + } + for (const key of ['layer', 'vconcat', 'hconcat', 'concat']) if (Array.isArray(node[key])) node[key].forEach((c: any) => visit(c, seen)); + if (node.spec) visit(node.spec, seen); + }; + visit(spec, undefined); +} + /** * An outline in each bar's own series ink (M2), drawn once the inks are final: a bar coloured by a * field takes a stroke scale mirroring its colour scale (no key of its own); a bar in one ink takes @@ -5679,11 +5926,9 @@ function applyReadableSeriesText(spec: any, d: DesignDecisions, say: ReportDepar } } -function growPadding(spec: any, side: 'left' | 'right' | 'top' | 'bottom', amount: number): void { - const base = typeof spec.padding === 'number' - ? { left: spec.padding, right: spec.padding, top: spec.padding, bottom: spec.padding } - : { left: 8, right: 8, top: 8, bottom: 8, ...(spec.padding ?? {}) }; - base[side] = (base[side] ?? 8) + Math.round(amount); +export function growPadding(spec: any, side: 'left' | 'right' | 'top' | 'bottom', amount: number): void { + const base = normalizePadding(spec.padding); + base[side] = (base[side] ?? VEGA_LITE_PADDING) + Math.round(amount); spec.padding = base; } @@ -5691,6 +5936,62 @@ function growPadding(spec: any, side: 'left' | 'right' | 'top' | 'bottom', amoun * Write the headroom the plan gives labels above (or below) bar ends to each * encoding of the measure whose scale leaves that end free. */ +/** + * The domain a horizontal measure takes so `inset` px past its end hold the value labels: the end the + * axis draws now (Flint's ruler, or the data's extent rounded as Vega rounds it) run on by the share + * of the plot the labels take, so each bar is drawn exactly as long as with the range cut short. + * Undefined where the end is not known here: a stated domain, a scale other than linear, a measure + * the spec computes (a bin, an aggregate other than sum, mean, min or max). + */ +function labelRoomEnd( + encodings: any[], table: any[], measure: any, enc: any, plotWidth: number, inset: number, +): { min?: number; max: number; ticks?: number[] } | undefined { + if (!(plotWidth > inset) || !Array.isArray(table) || table.length === 0) return undefined; + const scale = measure.scale ?? {}; + if (encodings.some((encoding) => Array.isArray(encoding.scale?.domain) || encoding.scale?.domainRaw)) return undefined; + if ((scale.type && scale.type !== 'linear') || measure.bin) return undefined; + const ruled = scale.nice === false && typeof scale.domainMin === 'number' && typeof scale.domainMax === 'number'; + let lo: number; + let hi: number; + if (ruled) { + lo = scale.domainMin; + hi = scale.domainMax; + } else { + if (scale.domainMax !== undefined) return undefined; + const op = typeof measure.aggregate === 'string' ? measure.aggregate : undefined; + if (op && !['sum', 'mean', 'average', 'min', 'max'].includes(op)) return undefined; + const band = op ? enc.y?.field : undefined; + if (op && !band) return undefined; + const field = measure.field as string; + const groups = new Map(); + for (const row of table) { + const value = row?.[field]; + if (typeof value !== 'number' || !Number.isFinite(value)) continue; + const key = op ? String(row[band]) : String(groups.size); + groups.set(key, [...(groups.get(key) ?? []), value]); + } + const totals = [...groups.values()].map((values) => op === 'sum' ? values.reduce((a, b) => a + b, 0) + : op === 'mean' || op === 'average' ? values.reduce((a, b) => a + b, 0) / values.length + : op === 'min' ? Math.min(...values) : Math.max(...values)); + if (!totals.length) return undefined; + const zero = scale.zero ?? true; + const low = typeof scale.domainMin === 'number' ? scale.domainMin : zero ? Math.min(0, ...totals) : Math.min(...totals); + const high = zero ? Math.max(0, ...totals) : Math.max(...totals); + [lo, hi] = scale.nice === false ? [low, high] : niceExtent(low, high); + if (typeof scale.domainMin === 'number') lo = scale.domainMin; + } + if (!(hi > lo)) return undefined; + const max = +(lo + (hi - lo) * plotWidth / (plotWidth - inset)).toPrecision(12); + const values: unknown = measure.axis?.values; + let ticks: number[] | undefined; + if (ruled && Array.isArray(values) && values.length > 1 && values.every((value) => typeof value === 'number')) { + const step = (values[1] as number) - (values[0] as number); + ticks = [...values as number[]]; + if (step > 0) while (ticks[ticks.length - 1] + step <= max + 1e-9) ticks.push(+(ticks[ticks.length - 1] + step).toPrecision(12)); + } + return { max, ...(ruled ? { min: lo } : {}), ...(ticks ? { ticks } : {}) }; +} + function addMeasureHeadroom( body: any, channel: 'x' | 'y' | 'theta' | 'color', field: string, headroom: { min?: number; max?: number }, ): void { @@ -6558,9 +6859,13 @@ function applyFurniture(spec: any, d: DesignDecisions, planned: LayoutPlan['rule } /** Normalise Vega-Lite's number|object padding into a full-sided object. */ +/** The padding Vega-Lite draws a spec with when it states none (an unthemed chart), as the canvas fit counts it. */ +const VEGA_LITE_PADDING = 5; + function normalizePadding(p: any): { left: number; right: number; top: number; bottom: number } { if (typeof p === 'number') return { left: p, right: p, top: p, bottom: p }; - return { left: 8, right: 8, top: 8, bottom: 8, ...(p ?? {}) }; + const d = VEGA_LITE_PADDING; + return { left: d, right: d, top: d, bottom: d, ...(p ?? {}) }; } /** @@ -6597,7 +6902,7 @@ function clamp(v: number, lo: number, hi: number): number { export function applySourceLine(spec: any, plan: SourcePlan | undefined): void { if (!plan?.lines.length) return; const base = normalizePadding(spec.padding); - takeFromPlotHeight(spec, plan.room); + if (!plan.reserved) takeFromPlotHeight(spec, plan.room); growPadding(spec, 'bottom', plan.room); const start = plan.frame === 'canvas' ? 0 : base.left; const end = plan.frame === 'canvas' ? 0 : base.right; @@ -6614,16 +6919,20 @@ export function applySourceLine(spec: any, plan: SourcePlan | undefined): void { }); } for (const line of plan.lines) { + // A line may be set smaller than the source (a map's credit). + const size = line.fontSize ?? plan.fontSize; + const height = line.lineHeight ?? plan.lineHeight; for (const run of line.runs) { items.push({ - kind: 'text', text: run.text, bottom: foot + line.bottom + (plan.lineHeight - plan.fontSize) / 2, height: plan.fontSize, + kind: 'text', text: run.text, bottom: foot + line.bottom + (height - size) / 2, height: size, ...(line.align === 'start' ? { left: start + run.offset } : { right: end + run.offset }), - fontSize: plan.fontSize, + fontSize: size, ...(plan.font ? { font: plan.font } : {}), ...(run.fontWeight != null ? { fontWeight: run.fontWeight } : {}), ...(run.fontStyle ? { fontStyle: run.fontStyle } : {}), ...(plan.color ? { color: plan.color } : {}), ...(line.href ? { href: line.href } : {}), + ...(line.title ? { title: line.title } : {}), }); } } @@ -6715,28 +7024,32 @@ export function fitBinnedKeyLength(spec: any, config: any, table: any[], block?: walk(spec, (node) => { const enc = node.encoding?.color; const scale = enc?.scale; - if (!enc || enc.legend === null || scale?.type !== 'quantize') return; + if (!enc || enc.legend === null || (scale?.type !== 'quantize' && scale?.type !== 'threshold')) return; if ((enc.legend?.direction ?? config.legend.direction ?? 'horizontal') !== 'horizontal') return; const domain = scale.domain; const bins = Array.isArray(scale.range) ? scale.range.length : scale.scheme?.count ?? 0; - if (!Array.isArray(domain) || domain.length !== 2 || typeof domain[0] !== 'number' || typeof domain[1] !== 'number' || bins < 2) return; + if (!Array.isArray(domain) || !domain.every((edge: unknown) => typeof edge === 'number') || bins < 2) return; + if (scale.type === 'quantize' && domain.length !== 2) return; + // A quantize ramp's edges cut its domain evenly; a threshold ramp's are its domain. + const edges: number[] = scale.type === 'threshold' + ? domain + : Array.from({ length: bins - 1 }, (_, i) => domain[0] + (domain[1] - domain[0]) * (i + 1) / bins); const fontSize = enc.legend?.labelFontSize ?? config.legend.labelFontSize ?? 10; const font = enc.legend?.labelFont ?? config.legend.labelFont; const need = (pattern: string): number => { let print: (n: number) => string; try { print = formatNumber(pattern); } catch { print = formatNumber(','); } let widest = 0; - for (let i = 1; i < bins; i++) { - const edge = domain[0] + (domain[1] - domain[0]) * i / bins; - widest = Math.max(widest, textWidth(print(edge).replace('-', '−'), fontSize, font)); - } + for (const edge of edges) widest = Math.max(widest, textWidth(print(edge).replace('-', '−'), fontSize, font)); return Math.ceil(bins * (widest + fontSize)); }; const current = config.legend.gradientLength ?? 200; // A key is a caption: it runs no further than a share of the block it keys. const room = block ?? blockWidth(spec, table); const cap = Math.max(current, room ? Math.round(room * 0.6) : current); - const stated = typeof enc.legend?.format === 'string' || enc.legend?.labelExpr !== undefined; + // A plain format that only prints the breaks in full says nothing a compact label cannot. + const plain = typeof enc.legend?.format === 'string' && /^,\.\d+~f$/.test(enc.legend.format); + const stated = (typeof enc.legend?.format === 'string' && !plain) || enc.legend?.labelExpr !== undefined; let wanted = need(stated ? enc.legend.format ?? ',' : ','); // Edges that do not fit at full precision print compactly: −38,501 becomes −39k. if (wanted > cap && !stated) { diff --git a/packages/flint-js/tests/accessible-navigation.test.ts b/packages/flint-js/tests/accessible-navigation.test.ts index 4b71cc7a..6099c177 100644 --- a/packages/flint-js/tests/accessible-navigation.test.ts +++ b/packages/flint-js/tests/accessible-navigation.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { parse, View } from 'vega'; +import { parse, View, loader } from 'vega'; import { compile } from 'vega-lite'; import { assembleVegaLite } from '../src/vegalite/assemble'; import { vlAllTemplateDefs } from '../src/vegalite/templates'; @@ -12,6 +12,7 @@ import { toCanvasInteractionEvent } from '../src/interactive/canvas-interaction' import { associateSemanticElementRenderKeys } from '../src/core/interaction-semantics'; import { addVegaLiteInteractions, injectVegaInteractionStore, injectVegaNavigationSignals } from '../src/vegalite/interactions/compile'; import { INTERACTION_KEY } from '../src/vegalite/interactions/hit-adapter'; +import { withBundledBoundaries } from '../src/vegalite/boundary-loader'; import { ACCESSIBLE_NAVIGATION_HELP, AccessibleNavigator, @@ -61,7 +62,8 @@ async function accessibleTree(input: ChartAssemblyInput): Promise<{ root: Access if (!plan) throw new Error(`No interaction plan for ${input.chart_spec.chartType}`); const compiled = compile(spec as any).spec as Record; injectVegaInteractionStore(compiled, plan); - const view = new View(parse(compiled), { renderer: 'none' }); + // Maps draw the package's boundaries, as in Flint's renderers, rather than fetching them. + const view = new View(parse(compiled), { renderer: 'none', loader: withBundledBoundaries(loader()) }); await view.runAsync(); const buildTree = () => buildAccessibleTree({ root: (view.scenegraph() as any).root, diff --git a/packages/flint-js/tests/annotation-pilot-fixes.test.ts b/packages/flint-js/tests/annotation-pilot-fixes.test.ts new file mode 100644 index 00000000..6d1eac78 --- /dev/null +++ b/packages/flint-js/tests/annotation-pilot-fixes.test.ts @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import { changeset, parse, View } from 'vega'; +import { compile } from 'vega-lite'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { clickHighlight } from '../src/interactive/interactions'; +import { addVegaLiteInteractions, injectVegaInteractionStore } from '../src/vegalite/interactions/compile'; +import { DIM_RELATIVE_SIGNAL, DIM_SIGNAL, INTERACTION_STORE } from '../src/vegalite/interactions/stores'; +import { INTERACTION_KEY } from '../src/vegalite/interactions/hit-adapter'; +import { selectorPredicate } from '../src/core/target-selector'; +import { clusterColor, placeRegionCaption } from '../src/core/annotation'; +import { EMPHASIS_OPACITY } from '../src/core/interaction-contracts'; +import { enclosuresOfUpdates } from '../src/interactive/presentation/annotation'; + +/** + * Fixes from the annotation experiment's pilot: emphasis levels that keep the rest readable, keys + * that match a field drawn as categories, a one-row series that is drawn, region captions that + * always find a seat, and enclosures that keep their cluster's hue under a theme that outlines dots. + */ + +const BARS = ['A', 'B', 'C', 'D'].map((c, i) => ({ c, v: [5, 9, 3, 7][i] })); + +function barView(theme?: string) { + const spec = assembleVegaLite({ + data: { values: BARS }, semantic_types: { c: 'Category', v: 'Quantity' }, ...(theme ? { theme_spec: theme } : {}), + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'c' }, y: { field: 'v' } }, chartProperties: { showValueLabels: true } }, + } as any) as any; + const plan = addVegaLiteInteractions(spec, [clickHighlight({ targets: ['mark'] })]); + const compiled = compile(spec).spec as any; + if (plan) injectVegaInteractionStore(compiled, plan); + return new View(parse(compiled), { renderer: 'none' }); +} + +function items(view: View, marktype: string): any[] { + const out: any[] = []; + const visit = (node: any): void => { + if (!node) return; + if (node.marktype === marktype && node.role === 'mark' && Array.isArray(node.items)) out.push(...node.items); + else if (Array.isArray(node.items)) node.items.forEach(visit); + }; + visit((view.scenegraph() as any).root); + return out; +} + +describe('emphasis levels', () => { + it('recede the other marks by the level asked for, and keep their labels readable', async () => { + const view = barView(); + await view.runAsync(); + const key = items(view, 'rect').find((item) => item.datum.c === 'B').datum[INTERACTION_KEY]; + view.change(INTERACTION_STORE, changeset().insert([{ key }])); + for (const level of ['light', 'strong', 'exclusive'] as const) { + view.signal(DIM_SIGNAL, EMPHASIS_OPACITY[level]); + await view.runAsync(); + const others = items(view, 'rect').filter((item) => item.datum?.c !== undefined && item.datum.c !== 'B'); + expect(others.every((item) => item.opacity === EMPHASIS_OPACITY[level])).toBe(true); + const labels = items(view, 'text').filter((item) => item.datum?.c && item.datum.c !== 'B'); + // A label recedes no further than half, so its value can still be read. + expect(labels.every((item) => (item.opacity ?? 1) >= 0.5)).toBe(true); + } + expect(EMPHASIS_OPACITY.light).toBeGreaterThan(EMPHASIS_OPACITY.strong); + expect(EMPHASIS_OPACITY.strong).toBeGreaterThan(EMPHASIS_OPACITY.exclusive); + }); + + it('scales a faded dot\'s own opacity by the level, and a stated opacity replaces it', async () => { + const values = Array.from({ length: 6 }, (_, i) => ({ x: i, y: i * 2 })); + const spec = assembleVegaLite({ + data: { values }, semantic_types: { x: 'Quantity', y: 'Quantity' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: { field: 'x' }, y: { field: 'y' } } }, + } as any) as any; + const plan = addVegaLiteInteractions(spec, [clickHighlight({ targets: ['mark'] })]); + const compiled = compile(spec).spec as any; + if (plan) injectVegaInteractionStore(compiled, plan); + const view = new View(parse(compiled), { renderer: 'none' }); + await view.runAsync(); + const dots = () => items(view, 'symbol').filter((item) => item.datum?.x !== undefined); + const idle = dots()[1].opacity; + view.change(INTERACTION_STORE, changeset().insert([{ key: dots()[0].datum[INTERACTION_KEY] }])); + view.signal(DIM_SIGNAL, EMPHASIS_OPACITY.light); + view.signal(DIM_RELATIVE_SIGNAL, true); + await view.runAsync(); + expect(dots()[1].opacity).toBeCloseTo(idle * EMPHASIS_OPACITY.light, 6); + view.signal(DIM_SIGNAL, 0.25); + view.signal(DIM_RELATIVE_SIGNAL, false); + await view.runAsync(); + expect(dots()[1].opacity).toBeCloseTo(Math.min(0.25, idle), 6); + }); + + it('turns a receded on-mark label to the page\'s ink', async () => { + const view = barView('powerbi'); + await view.runAsync(); + const key = items(view, 'rect').find((item) => item.datum.c === 'B').datum[INTERACTION_KEY]; + const before = items(view, 'text').find((item) => item.datum?.c === 'A')?.fill; + view.change(INTERACTION_STORE, changeset().insert([{ key }])); + await view.runAsync(); + const after = items(view, 'text').find((item) => item.datum?.c === 'A')?.fill; + const kept = items(view, 'text').find((item) => item.datum?.c === 'B')?.fill; + expect(after).not.toBe(before); + expect(kept).toBe(before); + // The page is dark, so the label takes a light ink. + expect(after).toBe('#e6e6e6'); + }); +}); + +describe('a key on a field drawn as categories', () => { + it('matches the field\'s text values by number', () => { + const test = selectorPredicate({ select: { key: { Year: 2016 } } } as any, ['Year'])!; + expect(test({ Year: '2016' })).toBe(true); + expect(test({ Year: 2016 })).toBe(true); + expect(test({ Year: '2017' })).toBe(false); + expect(test({ Year: '' })).toBe(false); + expect(selectorPredicate({ select: { key: { Year: '2016' } } } as any, ['Year'])!({ Year: 2016 })).toBe(true); + }); +}); + +describe('a series with one row', () => { + it('is drawn as a point on a line chart', async () => { + const values = [ + ...[1, 2, 3].map((x) => ({ x, y: x * 2, s: 'average' })), + { x: 2, y: 9, s: 'record' }, + ]; + const spec = assembleVegaLite({ + data: { values }, semantic_types: { x: 'Quantity', y: 'Quantity', s: 'Category' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: { field: 'x' }, y: { field: 'y' }, color: { field: 's' } } }, + } as any) as any; + const view = new View(parse(compile(spec).spec), { renderer: 'none' }); + await view.runAsync(); + const points = items(view, 'symbol'); + expect(points.map((item) => item.datum.s)).toEqual(['record']); + // A chart whose series all have several rows draws no extra layer. + const plain = assembleVegaLite({ + data: { values: values.slice(0, 3) }, semantic_types: { x: 'Quantity', y: 'Quantity', s: 'Category' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: { field: 'x' }, y: { field: 'y' }, color: { field: 's' } } }, + } as any) as any; + expect(plain.layer).toBeUndefined(); + }); +}); + +describe('a region caption', () => { + const plot = { x: 0, y: 0, width: 400, height: 300 }; + const layouts = [{ lines: ['No observations for 1982'], width: 130, height: 16 }]; + + it('finds a seat when the region is too narrow for the placement asked', () => { + const placed = placeRegionCaption({ + region: { x: 95, y: 0, width: 12, height: 300 }, axes: { x: true, y: false }, layouts, + plot, canvas: plot, placement: 'top', + }); + expect(placed).toBeDefined(); + expect(placed!.box.y).toBeGreaterThanOrEqual(0); + // Asked for the top, it stands in the upper part of the plot. + expect(placed!.box.y).toBeLessThan(150); + }); + + it('stands just past a band\'s edge when asked to stand above it, not past the plot', () => { + const placed = placeRegionCaption({ + region: { x: 20, y: 150, width: 300, height: 40 }, axes: { x: true, y: true }, layouts, + plot, canvas: { x: 0, y: -60, width: 400, height: 380 }, placement: 'above', + }); + expect(placed!.box.y + placed!.box.height).toBeLessThanOrEqual(150); + expect(placed!.box.y).toBeGreaterThan(100); + }); + + it('moves inside a full-height stretch when the header holds the seat above the plot', () => { + const header = { kind: 'text' as const, box: { x: 0, y: -40, width: 400, height: 36 } }; + const placed = placeRegionCaption({ + region: { x: 100, y: 0, width: 200, height: 300 }, axes: { x: true, y: false }, layouts, + plot, canvas: { x: 0, y: -60, width: 400, height: 380 }, placement: 'above', obstacles: [header], + }); + expect(placed!.box.y).toBeGreaterThanOrEqual(0); + }); +}); + +describe('an enclosure\'s colour', () => { + it('follows its cluster\'s fill, not the outline a theme draws round every dot', () => { + const dots = Array.from({ length: 5 }, () => ({ fill: '#1f77b4', stroke: '#000000' })); + expect(clusterColor(dots, '#fff200')).not.toBe('#000000'); + expect(clusterColor(dots, '#ffffff')).toBe('#1f77b4'); + // Without a fill, the stroke is the cluster's hue. + expect(clusterColor([{ stroke: '#d62728' }, { stroke: '#d62728' }], '#ffffff')).toBe('#d62728'); + }); +}); + +describe('an enclosure at the edge of the plot', () => { + const values = [1995, 2000, 2005, 2010, 2015, 2021, 2023].map((year, i) => ({ year, minutes: [81, 95, 115, 103, 95, 151, 155][i] })); + const chart = (enclosures?: unknown[]) => assembleVegaLite({ + data: { values }, semantic_types: { year: 'Year', minutes: 'Quantity' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: { field: 'year' }, y: { field: 'minutes' } } }, + options: enclosures ? { enclosures } : {}, + } as any) as any; + const xScale = (spec: any) => (spec.encoding?.x ?? spec.layer?.find((l: any) => l.encoding?.x)?.encoding.x).scale ?? {}; + + it('pads the axis its outline would cross, and no other', () => { + const enclosures = enclosuresOfUpdates([{ id: 'late', ops: [{ op: 'annotate-enclosure', name: 'late', value: { targets: [{ select: { where: { year: { range: [2021, 2023] } } } }] } }] }] as any); + expect(enclosures).toHaveLength(1); + expect(xScale(chart()).padding).toBeUndefined(); + expect(xScale(chart(enclosures)).padding).toBe(12); + const middle = enclosuresOfUpdates([{ id: 'mid', ops: [{ op: 'annotate-enclosure', name: 'mid', value: { targets: [{ select: { where: { year: { range: [2005, 2010] } } } }] } }] }] as any); + expect(xScale(chart(middle)).padding).toBeUndefined(); + }); +}); diff --git a/packages/flint-js/tests/annotation-placement.test.ts b/packages/flint-js/tests/annotation-placement.test.ts new file mode 100644 index 00000000..298680bd --- /dev/null +++ b/packages/flint-js/tests/annotation-placement.test.ts @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import { + balanceNote, + leaderSegments, + noteSize, + noteStyle, + overlapArea, + placeNote, + segmentCrossesBox, + segmentsCross, + targetGap, + wrapNote, + type NoteObstacle, + type NoteTarget, +} from '../src/core/annotation'; + +/** + * A note that names one mark stands beside it — no card — clear of the marks and text around it, + * and joined to it by a short leader to its visible outline only where it is not plainly beside it. + */ + +const PLOT = { x: 0, y: 0, width: 400, height: 300 }; +const CANVAS = { x: -60, y: -30, width: 500, height: 380 }; +const LABEL = { width: 70, height: 16 }; +const dot = (x: number, y: number, r = 5): NoteTarget => ({ shape: 'circle', x, y, rx: r, ry: r }); +const asObstacle = (target: NoteTarget): NoteObstacle => ({ + kind: 'mark', box: { x: target.x - target.rx, y: target.y - target.ry, width: target.rx * 2, height: target.ry * 2 }, +}); + +describe('a note on one mark', () => { + it('stands just beside a lone mark, with no leader', () => { + const target = dot(200, 150); + const placed = placeNote({ target, label: LABEL, plot: PLOT, canvas: CANVAS }); + expect(placed.leader).toBeUndefined(); + expect(targetGap(target, placed.box)).toBeLessThanOrEqual(10); + expect(overlapArea(placed.box, { x: 195, y: 145, width: 10, height: 10 })).toBe(0); + }); + + it('stays clear of its neighbours, and draws a leader to the outline where it must stand off', () => { + const target = dot(200, 150); + const neighbours = [dot(200, 128), dot(222, 150), dot(178, 150), dot(200, 172), dot(220, 130), dot(180, 130), dot(220, 170), dot(180, 170)]; + const placed = placeNote({ target, label: LABEL, plot: PLOT, canvas: CANVAS, obstacles: neighbours.map(asObstacle) }); + for (const neighbour of neighbours) expect(overlapArea(placed.box, asObstacle(neighbour).box)).toBe(0); + expect(placed.leader).toBeDefined(); + const tip = placed.leader!.to; + expect(Math.hypot(tip.x - target.x, tip.y - target.y)).toBeCloseTo(target.rx, 5); + }); + + it('turns inward at the plot\'s edge rather than running off it', () => { + const placed = placeNote({ target: dot(395, 10), label: LABEL, plot: PLOT, canvas: CANVAS }); + expect(placed.box.x + placed.box.width).toBeLessThanOrEqual(PLOT.x + PLOT.width); + expect(placed.box.y).toBeGreaterThanOrEqual(PLOT.y); + expect(placed.align).toBe('right'); + }); + + it('stands at a bar\'s value end, the side the bar suggests', () => { + const bar: NoteTarget = { shape: 'rect', x: 100, y: 200, rx: 15, ry: 100 }; + const placed = placeNote({ target: bar, label: LABEL, plot: PLOT, canvas: CANVAS, preferredAngle: -Math.PI / 2 }); + expect(placed.box.y + placed.box.height).toBeLessThanOrEqual(100); + expect(placed.align).toBe('center'); + }); + + it('centres a caption on a bar\'s value past its face, joined to the face\'s centre (Blabber\'s bar routes)', () => { + const body = { x: 180, y: 120, width: 40, height: 180 }; + const top: NoteTarget = { shape: 'rect', x: 200, y: 120, rx: 20, ry: 0 }; + const up = placeNote({ target: top, body, label: LABEL, plot: PLOT, canvas: CANVAS, preferredAngle: -Math.PI / 2, fontSize: 11 }); + expect(up.box.x + up.box.width / 2).toBeCloseTo(200, 6); + expect(up.box.y + up.box.height).toBeLessThan(120); + expect(up.align).toBe('center'); + expect(up.leader?.to).toEqual({ x: 200, y: 120 }); + // Across: past the end, level with the bar. + const row = { x: 0, y: 140, width: 220, height: 20 }; + const end: NoteTarget = { shape: 'rect', x: 220, y: 150, rx: 0, ry: 10 }; + const across = placeNote({ target: end, body: row, label: LABEL, plot: PLOT, canvas: CANVAS, preferredAngle: 0, fontSize: 11 }); + expect(across.box.x).toBeGreaterThan(220); + expect(across.box.y + across.box.height / 2).toBeCloseTo(150, 6); + expect(across.align).toBe('left'); + expect(across.leader?.to).toEqual({ x: 220, y: 150 }); + }); + + it('runs out along a bar from its value face and turns square there, never down the face, where the caption stands below', () => { + // A long bar across, its end against the canvas's right edge, with bars above and below it. + const row = { x: 0, y: 40, width: 430, height: 20 }; + const end: NoteTarget = { shape: 'rect', x: 430, y: 50, rx: 0, ry: 10 }; + const obstacles: NoteObstacle[] = [ + { kind: 'mark', box: { x: 0, y: 14, width: 425, height: 20 } }, + { kind: 'mark', box: { x: 0, y: 66, width: 420, height: 20 } }, + ]; + const placed = placeNote({ target: end, body: row, label: LABEL, plot: PLOT, canvas: CANVAS, obstacles, preferredAngle: 0, fontSize: 11 }); + const leader = placed.leader!; + expect(leader.to).toEqual({ x: 430, y: 50 }); + const runs = leaderSegments(leader); + // Out along the bar first, level with its end, at least a stub's length. + const first = runs[runs.length - 1]; + expect(first.a.y).toBeCloseTo(50, 6); + expect(first.a.x - 430).toBeGreaterThanOrEqual(6); + for (const run of runs) { + // No run is drawn down the face, and each is square: across or up and down. + expect(Math.abs(run.a.x - 430) < 0.5 && Math.abs(run.b.x - 430) < 0.5).toBe(false); + expect(Math.abs(run.a.x - run.b.x) < 1e-6 || Math.abs(run.a.y - run.b.y) < 1e-6).toBe(true); + } + }); + + it('meets a cell square to its side, running out from it before it turns', () => { + // A cell in a grid of its neighbours: the caption must stand off, and its leader meets the cell's side. + const cell: NoteTarget = { shape: 'rect', x: 200, y: 150, rx: 30, ry: 12 }; + const neighbours: NoteObstacle[] = [-1, 0, 1].flatMap((i) => [-1, 0, 1].flatMap((j) => (i === 0 && j === 0 ? [] : [{ + kind: 'mark' as const, box: { x: 170 + i * 62, y: 138 + j * 26, width: 60, height: 24 }, + }]))); + const placed = placeNote({ target: cell, label: LABEL, plot: PLOT, canvas: CANVAS, obstacles: neighbours }); + expect(placed.leader).toBeDefined(); + const runs = leaderSegments(placed.leader!); + const last = runs[runs.length - 1]; + const dx = last.a.x - last.b.x; + const dy = last.a.y - last.b.y; + const onSide = Math.abs(Math.abs(last.b.x - 200) - 30) < 0.5 ? Math.abs(dx) : Math.abs(dy); + expect(onSide / Math.hypot(dx, dy)).toBeGreaterThanOrEqual(0.5 - 1e-6); + }); + + it('stands in the paper above the plot rather than over the bar where the plot has no room left', () => { + const body = { x: 340, y: 2, width: 50, height: 298 }; + const end: NoteTarget = { shape: 'rect', x: 365, y: 2, rx: 25, ry: 0 }; + const placed = placeNote({ target: end, body, label: LABEL, plot: PLOT, canvas: CANVAS, preferredAngle: -Math.PI / 2, fontSize: 11 }); + expect(overlapArea(placed.box, body)).toBe(0); + expect(placed.box.y + placed.box.height).toBeLessThan(2); + expect(placed.box.y).toBeGreaterThanOrEqual(CANVAS.y); + }); + + it('does not cut a line where a clear seat stands as near', () => { + const target = dot(200, 150); + const segments = [{ a: { x: 0, y: 140 }, b: { x: 400, y: 140 } }, { a: { x: 0, y: 160 }, b: { x: 400, y: 160 } }]; + const placed = placeNote({ target, label: LABEL, plot: PLOT, canvas: CANVAS, segments }); + for (const segment of segments) expect(segmentCrossesBox(segment.a, segment.b, placed.box)).toBe(false); + }); + + it('never draws a leader when the note asks for none', () => { + const target = dot(200, 150); + const crowd = [dot(200, 128), dot(222, 150), dot(178, 150), dot(200, 172)].map(asObstacle); + expect(placeNote({ target, label: LABEL, plot: PLOT, canvas: CANVAS, obstacles: crowd, connector: 'none' }).leader).toBeUndefined(); + }); + + it('keeps its leader from crossing a leader drawn before it', () => { + const target = dot(200, 150); + const crowd = [dot(200, 128), dot(222, 150), dot(178, 150), dot(200, 172)].map(asObstacle); + // An earlier note's leader fences off every seat to the right and below. + const earlier = [{ a: { x: 206, y: 156 }, b: { x: 300, y: 156 } }, { a: { x: 206, y: 156 }, b: { x: 206, y: 260 } }]; + const placed = placeNote({ target, label: LABEL, plot: PLOT, canvas: CANVAS, obstacles: crowd, segments: earlier }); + expect(placed.leader).toBeDefined(); + for (const segment of earlier) { + for (const run of leaderSegments(placed.leader!)) expect(segmentsCross(run.a, run.b, segment.a, segment.b)).toBe(false); + } + }); + + it('stands haloed over tiled cells, with a leader, since the cell beside it could be read as the one named', () => { + const cell: NoteTarget = { shape: 'rect', x: 100, y: 100, rx: 20, ry: 20 }; + const tiles: NoteObstacle[] = []; + for (let x = 0; x < 400; x += 40) { + for (let y = 0; y < 300; y += 40) if (x !== 80 || y !== 80) tiles.push({ kind: 'faint', box: { x, y, width: 40, height: 40 } }); + } + const placed = placeNote({ target: cell, label: LABEL, plot: PLOT, canvas: CANVAS, obstacles: tiles }); + expect(placed.box.x).toBeGreaterThanOrEqual(PLOT.x); + expect(placed.box.y).toBeGreaterThanOrEqual(PLOT.y); + expect(placed.leader).toBeDefined(); + }); + + it('places among thousands of marks in milliseconds', () => { + const obstacles = Array.from({ length: 4000 }, (_, i) => asObstacle(dot((i * 37) % 400, (i * 91) % 300, 3))); + // The median of runs after a warm-up, so the JIT's first pass and a busy runner's stalls do not + // count. About 8 ms on a laptop and roughly twice that on a CI runner: the bound catches placement + // slowing several times over, not a slower machine. + const place = () => placeNote({ target: dot(200, 150), label: LABEL, plot: PLOT, canvas: CANVAS, obstacles }); + place(); + const runs = Array.from({ length: 21 }, () => { + const started = performance.now(); + place(); + return performance.now() - started; + }).sort((a, b) => a - b); + expect(runs[10]).toBeLessThan(40); + }); +}); + +describe('a note\'s type', () => { + it('takes the chart\'s label face a size up, in neutral ink, haloed in the background', () => { + const style = noteStyle({ font: 'Inter', fontSize: 10, color: '#000', background: '#fafafa' }); + expect(style).toMatchObject({ font: 'Inter', fontSize: 11, color: '#333333', halo: { color: '#fafafa' } }); + }); + + it('keeps the labels\' weight unless the house or the note sets one', () => { + expect(noteStyle({ fontSize: 10, fontWeight: 'normal' }).fontWeight).toBe(400); + expect(noteStyle({ fontSize: 10, fontWeight: 600 }).fontWeight).toBe(600); + expect(noteStyle({ fontSize: 10 }, { text: { fontWeight: 'bold', fontSize: 14, color: '#c00' } })) + .toMatchObject({ fontWeight: 'bold', fontSize: 14, color: '#c00' }); + }); +}); + +describe('a note with empty text', () => { + it('is kept as a cue with no caption, while a chart wording that comes out empty is dropped', async () => { + const { presentAnnotationUpdate } = await import('../src/interactive/presentation/annotation'); + const element = { value: { region: 'East', name: '' }, records: [{ region: 'East', name: '' }] } as never; + const target = { visual: { kind: 'mark' }, elements: [element] } as never; + const present = presentAnnotationUpdate(() => ({ kind: 'point' } as never), () => ''); + const context = {} as never; + const asked = present({ id: 'a', ops: [{ op: 'annotate-text', target, value: { text: '' } }] }, context); + const worded = present({ id: 'b', ops: [{ op: 'annotate-text', target, value: {} }] }, context); + expect(asked.ops).toHaveLength(1); + expect((asked.ops[0] as { value: { text: string } }).value.text).toBe(''); + expect(worded.ops).toHaveLength(0); + }); + + it('breaks between words at its width, keeping hard breaks', () => { + const measure = (text: string) => text.length * 6; + expect(wrapNote('fastest growth since the merger', 100, measure)).toEqual(['fastest growth', 'since the merger']); + expect(wrapNote('first\nsecond line', 200, measure)).toEqual(['first', 'second line']); + const size = noteSize(['fastest growth', 'since the merger'], noteStyle(), measure); + expect(size.width).toBe(16 * 6 + 4); + }); + + it('breaks evenly, at a phrase\'s end where there is one, and into no more lines than greedy wrapping', () => { + const measure = (text: string) => text.length * 6; + expect(wrapNote('ford galaxie 500: most power', 140, measure)).toEqual(['ford galaxie 500: most', 'power']); + expect(balanceNote('ford galaxie 500: most power', 140, measure)).toEqual(['ford galaxie 500:', 'most power']); + expect(balanceNote('the fastest growth of any region since the merger', 180, measure)) + .toEqual(['the fastest growth of any', 'region since the merger']); + expect(balanceNote('short', 140, measure)).toEqual(['short']); + expect(balanceNote('first line here\nand a second one that runs on and on', 120, measure)) + .toEqual(['first line here', 'and a second one', 'that runs on and on']); + }); +}); + +describe('a note with no room beside its mark', () => { + const PLOT = { x: 0, y: 0, width: 400, height: 300 }; + const label = { width: 60, height: 14 }; + // A mark ringed by text on every side, as a slice that faces the legend: only a 64×16 room is clear. + const room = { x: 168, y: 142, width: 64, height: 16 }; + const walls = [ + { box: { x: 0, y: 0, width: 400, height: room.y }, kind: 'text' as const }, + { box: { x: 0, y: room.y + room.height, width: 400, height: 300 - room.y - room.height }, kind: 'text' as const }, + { box: { x: 0, y: room.y, width: room.x, height: room.height }, kind: 'text' as const }, + { box: { x: room.x + room.width, y: room.y, width: 400 - room.x - room.width, height: room.height }, kind: 'text' as const }, + ]; + const target = { shape: 'circle' as const, x: 200, y: 150, rx: 2, ry: 2 }; + + it('sits on the mark where its room fits the caption, with no leader', () => { + const placed = placeNote({ + target, label, plot: PLOT, canvas: PLOT, obstacles: walls, + inside: [{ point: { x: 200, y: 150 }, fits: (box) => box.x >= room.x && box.x + box.width <= room.x + room.width && box.y >= room.y && box.y + box.height <= room.y + room.height }], + }); + expect(placed.inside).toBe(true); + expect(placed.leader).toBeUndefined(); + expect(placed.covers?.text).toBe(0); + }); + + it('reports the text it covers where nothing better fits, and an inside-only anchor with no room places nothing', () => { + const blocked = placeNote({ target, label, plot: PLOT, canvas: PLOT, obstacles: [...walls, { box: { x: 100, y: 120, width: 200, height: 60 }, kind: 'text' }] }); + expect(blocked.covers!.text).toBeGreaterThan(0); + const none = placeNote({ target, label, plot: PLOT, canvas: PLOT, inside: [{ point: { x: 200, y: 150 }, fits: () => false }], insideOnly: true }); + expect(none.cost).toBe(Infinity); + }); + + it('breaks a caption after a middle dot, not before it', () => { + const measure = (text: string) => text.length * 6; + expect(balanceNote('Sleep & bedrest · 9.1 hr (38%)', 120, measure)).toEqual(['Sleep & bedrest ·', '9.1 hr (38%)']); + }); +}); diff --git a/packages/flint-js/tests/annotation-point-target.test.ts b/packages/flint-js/tests/annotation-point-target.test.ts new file mode 100644 index 00000000..c22fea50 --- /dev/null +++ b/packages/flint-js/tests/annotation-point-target.test.ts @@ -0,0 +1,88 @@ +import { describe, expect, it } from 'vitest'; +import { parse, View } from 'vega'; +import { compile } from 'vega-lite'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { addVegaLiteInteractions, injectVegaInteractionStore } from '../src/vegalite/interactions/compile'; +import { INTERACTION_KEY, oneMarkHits, renderHit, sceneItems } from '../src/vegalite/interactions/hit-adapter'; +import { temporalFieldValue } from '../src/core/resolve-semantics'; +import { selectorPredicate } from '../src/core/target-selector'; +import type { ChartAssemblyInput } from '../src'; +import type { RenderHit, SemanticTargetSelector } from '../src/core/interaction-contracts'; + +const semanticTypes = { year: 'Year', value: 'Quantity', source: 'Category' }; + +async function energyLine(showPoints: boolean) { + const values: Record[] = []; + for (const source of ['Fossil fuels', 'Nuclear', 'Renewables']) { + for (let year = 1990; year <= 2020; year += 5) values.push({ year, source, value: year - 1900 + source.length * 3 }); + } + const input = { + semantic_types: semanticTypes, + chart_spec: { + chartType: 'Line Chart', + encodings: { x: { field: 'year' }, y: { field: 'value' }, color: { field: 'source' } }, + baseSize: { width: 400, height: 300 }, + chartProperties: { showPoints }, + }, + theme_spec: 'nyt', + data: { values }, + } as ChartAssemblyInput; + const spec = assembleVegaLite(input) as Record; + const plan = addVegaLiteInteractions(spec, [], true)!; + const compiled = compile(spec as any).spec as Record; + injectVegaInteractionStore(compiled, plan); + const view = new View(parse(compiled), { renderer: 'none' }); + await view.runAsync(); + const all = sceneItems(view).map(renderHit).filter((hit): hit is RenderHit => hit !== null); + const hitsFor = (target: SemanticTargetSelector): RenderHit[] => { + const matches = selectorPredicate(target, plan.fields, (field, value) => temporalFieldValue(field, value, semanticTypes))!; + return all.filter((hit) => matches(hit.datum)); + }; + const resolve = (hits: RenderHit[]) => plan.resolve!( + { gesture: 'rectangle', role: 'external-selection', hits } as any, + { allHits: hits, keyField: INTERACTION_KEY, categoryField: plan.categoryField, seriesField: plan.seriesField }, + ); + return { hitsFor, resolve }; +} + +const key = (year: number, source = 'Fossil fuels'): SemanticTargetSelector => ({ select: { key: { year, source } } }); + +describe('a note keyed to one point of a line drawn with points', () => { + it('resolves an interior point to the one point mark, not the point and its segment', async () => { + const { hitsFor, resolve } = await energyLine(true); + const hits = hitsFor(key(2000)); + expect(hits.map((hit) => hit.markType).sort()).toEqual(['line', 'symbol']); + expect(resolve(hits)?.elements).toHaveLength(2); + + const target = resolve(oneMarkHits(hits)); + expect(target?.visual).toEqual({ kind: 'mark', role: 'symbol' }); + expect(target?.elements).toHaveLength(1); + expect(target?.elements[0].value).toMatchObject({ year: Date.UTC(2000, 0, 1), source: 'Fossil fuels', value: 136 }); + }); + + it('keeps the segment when the selector names a path', async () => { + const { hitsFor, resolve } = await energyLine(true); + const target = resolve(oneMarkHits(hitsFor(key(2000)), true)); + expect(target?.visual).toEqual({ kind: 'path', role: 'line' }); + expect(target?.elements).toHaveLength(1); + }); + + it('leaves a series last point and a line without points as they were', async () => { + const withPoints = await energyLine(true); + const last = withPoints.hitsFor(key(2020)); + expect(oneMarkHits(last)).toEqual(last); + expect(withPoints.resolve(last)?.elements).toHaveLength(1); + + const plain = await energyLine(false); + const segment = plain.hitsFor(key(2000)); + expect(segment.map((hit) => hit.markType)).toEqual(['line']); + expect(oneMarkHits(segment)).toEqual(segment); + }); + + it('still reports a key that matches several rows as more than one mark', async () => { + const { hitsFor, resolve } = await energyLine(true); + const series = oneMarkHits(hitsFor({ select: { key: { source: 'Nuclear' } } })); + expect(new Set(series.map((hit) => hit.markType))).toEqual(new Set(['symbol'])); + expect(resolve(series)!.elements.length).toBeGreaterThan(1); + }); +}); diff --git a/packages/flint-js/tests/annotation-region-enclosure.test.ts b/packages/flint-js/tests/annotation-region-enclosure.test.ts new file mode 100644 index 00000000..ceed52c9 --- /dev/null +++ b/packages/flint-js/tests/annotation-region-enclosure.test.ts @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import { + clusterColor, + convexHull, + defaultEnclosureShape, + distinctRegionColor, + enclosureOutline, + inkOn, + neutralInk, + overlapArea, + placeEnclosureCaption, + placeRegionCaption, + readableShade, + regionColor, + regionSpan, + ringDistance, + type EnclosedMark, + type NoteObstacle, +} from '../src/core/annotation'; +import { contrastRatio } from '../src/core/theme/presence'; + +/** Regions and enclosures after Blabber's `region` and `enclose`, simplified for speed. */ + +const PLOT = { x: 0, y: 0, width: 400, height: 300 }; +const CANVAS = { x: -60, y: -40, width: 520, height: 380 }; +const LAYOUT = { lines: ['Recession'], width: 60, height: 18 }; +const dot = (x: number, y: number, r = 4): EnclosedMark => ({ role: 'point', box: { x: x - r, y: y - r, width: 2 * r, height: 2 * r }, radius: r }); +const inside = (ring: readonly { x: number; y: number }[], p: { x: number; y: number }) => { + let within = false; + for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) { + const a = ring[i]; + const b = ring[j]; + if ((a.y > p.y) !== (b.y > p.y) && p.x < (b.x - a.x) * (p.y - a.y) / (b.y - a.y) + a.x) within = !within; + } + return within; +}; + +describe('a region\'s stretch', () => { + const banded = { + position: (value: unknown) => ({ A: 20, B: 60, C: 100, D: 140 } as Record)[String(value)], + range: [0, 160] as const, + index: (value: unknown) => ['A', 'B', 'C', 'D'].indexOf(String(value)), + step: 40, + }; + it('covers whole bands of adjacent categories, and refuses ones with a gap', () => { + expect(regionSpan(['B', 'C'], banded).span).toEqual([40, 120]); + expect(regionSpan(['A', 'C'], banded).problem).toContain('not next to each other'); + expect(regionSpan(['E'], banded).problem).toContain('not a category'); + }); + it('reads a continuous stretch with open ends at the axis\'s ends, cut to the plot', () => { + const axis = { position: (value: unknown) => 300 - Number(value) * 3, range: [300, 0] as const, ends: [0, 100] as const }; + expect(regionSpan([20, 50], axis).span).toEqual([150, 240]); + expect(regionSpan([null, 50], axis).span).toEqual([150, 300]); + expect(regionSpan([80, 200], axis).span).toEqual([0, 60]); + expect(regionSpan([20], axis).problem).toContain('two bounds'); + }); +}); + +describe('a region\'s caption', () => { + it('centres a period\'s caption in the stretch where no series crosses it', () => { + const region = { x: 100, y: 0, width: 100, height: 300 }; + const placed = placeRegionCaption({ region, axes: { x: true, y: false }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS })!; + expect(placed.box.x + placed.box.width / 2).toBeCloseTo(150, 6); + expect(placed.box.y + placed.box.height / 2).toBeCloseTo(150, 6); + expect(placed.leaders).toEqual([]); + }); + it('sets a period\'s caption on the roomier side of the series it crosses, clear of the line', () => { + const region = { x: 100, y: 0, width: 100, height: 300 }; + const vertices = [{ x: 90, y: 60 }, { x: 150, y: 80 }, { x: 210, y: 70 }]; + const segments = [{ a: vertices[0], b: vertices[1] }, { a: vertices[1], b: vertices[2] }]; + const placed = placeRegionCaption({ region, axes: { x: true, y: false }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, vertices, segments })!; + expect(placed.box.y).toBeGreaterThan(80); + }); + it('keeps a box\'s caption inside it where it is clear, and stands outside on a leader where it is not', () => { + const region = { x: 100, y: 100, width: 120, height: 80 }; + const clear = placeRegionCaption({ region, axes: { x: true, y: true }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS })!; + expect(overlapArea(clear.box, region)).toBe(clear.box.width * clear.box.height); + const crowd: NoteObstacle[] = []; + for (let x = 100; x < 220; x += 8) for (let y = 100; y < 180; y += 8) crowd.push({ kind: 'mark', box: { x, y, width: 6, height: 6 } }); + const crowded = placeRegionCaption({ region, axes: { x: true, y: true }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, obstacles: crowd })!; + expect(overlapArea(crowded.box, region)).toBe(0); + expect(crowded.leaders).toHaveLength(1); + }); +}); + +describe('an enclosure\'s outline', () => { + it('defaults to a rectangle round bars and cells, a hull round other marks', () => { + expect(defaultEnclosureShape([{ role: 'bar', box: { x: 0, y: 0, width: 10, height: 50 } }])).toBe('rect'); + expect(defaultEnclosureShape([dot(10, 10), { role: 'bar', box: { x: 0, y: 0, width: 10, height: 50 } }])).toBe('hull'); + }); + it('hulls points 6 px out, every point inside, the stroke kept in the plot', () => { + const marks = [dot(50, 50), dot(80, 40), dot(70, 90), dot(60, 70)]; + const outline = enclosureOutline(marks, 'hull', PLOT)!; + for (const mark of marks) expect(inside(outline.ring, { x: mark.box.x + 4, y: mark.box.y + 4 })).toBe(true); + const edge = enclosureOutline([dot(2, 2), dot(30, 30)], 'hull', PLOT)!; + // Half the stroke in from the plot's edge, so the whole stroke is drawn. + expect(edge.bounds.x).toBeGreaterThanOrEqual(0.75); + expect(edge.bounds.y).toBeGreaterThanOrEqual(0.75); + }); + it('follows a stretch of line along its own vertices', () => { + const stretch: EnclosedMark = { role: 'other', box: { x: 50, y: 50, width: 100, height: 100 }, points: [{ x: 50, y: 150 }, { x: 150, y: 50 }] }; + const outline = enclosureOutline([stretch], 'hull', PLOT)!; + expect(inside(outline.ring, { x: 60, y: 60 })).toBe(false); + expect(inside(outline.ring, { x: 100, y: 100 })).toBe(true); + }); + it('outlines one bar by its border, several by their union, taking in a bar between them', () => { + const a: EnclosedMark = { role: 'bar', box: { x: 10, y: 100, width: 20, height: 200 } }; + const c: EnclosedMark = { role: 'bar', box: { x: 70, y: 150, width: 20, height: 150 } }; + const between = { x: 40, y: 50, width: 20, height: 250 }; + expect(enclosureOutline([a], 'rect', PLOT)!.bounds).toEqual(a.box); + const group = enclosureOutline([a, c], 'rect', PLOT, [between])!; + expect(group.bounds.y).toBeLessThanOrEqual(51); + }); + it('keeps a cell outline\'s stroke inside the cells', () => { + const cells: EnclosedMark[] = [{ role: 'cell', box: { x: 0, y: 0, width: 40, height: 40 } }, { role: 'cell', box: { x: 40, y: 0, width: 40, height: 40 } }]; + expect(enclosureOutline(cells, 'rect', PLOT)!.bounds).toEqual({ x: 0.75, y: 0.75, width: 78.5, height: 38.5 }); + }); + it('rings one point 2 px clear, and fits an ellipse round a cloud', () => { + const one = enclosureOutline([dot(100, 100, 5)], 'circle', PLOT)!; + expect(one.bounds.width / 2).toBeCloseTo(5 + 2 + 0.75, 6); + const cloud = [dot(100, 100), dot(140, 120), dot(180, 140), dot(120, 115)]; + const ellipse = enclosureOutline(cloud, 'ellipse', PLOT)!; + for (const mark of cloud) expect(inside(ellipse.ring, { x: mark.box.x + 4, y: mark.box.y + 4 })).toBe(true); + }); + it('follows a slice\'s own wedge, whichever way its angles run', () => { + const slice = (start: number, end: number) => ({ + role: 'other' as const, box: { x: 160, y: 0, width: 80, height: 160 }, + sector: { cx: 160, cy: 160, inner: 50, outer: 156, start, end }, + }); + const forward = enclosureOutline([slice(0, Math.PI / 6)], 'hull', PLOT)!; + const reversed = enclosureOutline([slice(Math.PI / 6, 0)], 'hull', PLOT)!; + expect(reversed.d).toBe(forward.d); + // The outer arc bows outward: its middle sits on the outer radius, past the chord. + expect(forward.d).toMatch(/A 156 156 0 0 1/); + expect(inside(forward.ring, { x: 160 + 100 * Math.sin(Math.PI / 12), y: 160 - 100 * Math.cos(Math.PI / 12) })).toBe(true); + }); +}); + +describe('an enclosure\'s caption', () => { + it('stands beside one outline with no leader, clear of its line', () => { + const outline = enclosureOutline([dot(150, 150), dot(180, 170)], 'hull', PLOT)!; + const placed = placeEnclosureCaption({ outlines: [outline], layouts: [LAYOUT], plot: PLOT, canvas: CANVAS })!; + expect(placed.leaders).toEqual([]); + expect(ringDistance(outline.ring, placed.box)).toBeGreaterThan(4); + }); + it('leads to each of two or three outlines, to all with connect "all", and to none with "none"', () => { + const groups = [[dot(60, 200), dot(80, 210)], [dot(300, 220), dot(320, 200)]].map((marks) => enclosureOutline(marks, 'hull', PLOT)!); + expect(placeEnclosureCaption({ outlines: groups, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS })!.leaders).toHaveLength(2); + expect(placeEnclosureCaption({ outlines: groups, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, connect: 'none' })!.leaders).toHaveLength(0); + const four = [50, 130, 210, 290].map((x) => enclosureOutline([dot(x, 200)], 'hull', PLOT)!); + expect(placeEnclosureCaption({ outlines: four, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS })!.leaders).toHaveLength(0); + expect(placeEnclosureCaption({ outlines: four, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, connect: 'all' })!.leaders).toHaveLength(4); + }); +}); + +describe('annotation colours', () => { + it('picks a region wash far from the marks\' colours, and a caption shade that reads', () => { + expect(distinctRegionColor(['#4c78a8'])).not.toBe('#4c78a8'); + const second = distinctRegionColor(['#4c78a8', distinctRegionColor(['#4c78a8'])]); + expect(second).not.toBe(distinctRegionColor(['#4c78a8'])); + expect(contrastRatio(readableShade('#f58518'), '#ffffff')).toBeGreaterThanOrEqual(4.5); + expect(contrastRatio(readableShade('#f58518', '#1a1a1a'), '#1a1a1a')).toBeGreaterThanOrEqual(4.5); + }); + it('outlines a cluster in its shared colour, any other group in a neutral grey that reads on the page', () => { + expect(clusterColor([{ fill: '#e45756' }, { fill: '#e45756' }, { fill: '#4c78a8' }])).toBe(readableShade('#e45756')); + expect(clusterColor([{ fill: '#e45756' }, { fill: '#4c78a8' }])).toBe(neutralInk()); + expect(neutralInk()).toBe('#5a5a5a'); + expect(contrastRatio(neutralInk('#1a1a1a'), '#1a1a1a')).toBeGreaterThanOrEqual(4.5); + }); + it('washes a region in the house\'s accent only where it stands apart from the data and the page', () => { + // The accent is the data's own ink: the wash comes from the house's other hues, never a grey. + const swiss = regionColor([], ['#e2231a'], '#f4f1ea', '#e2231a', ['#e2231a', '#1a1a1a', '#0067a5']); + expect(swiss).toBe('#0067a5'); + expect(regionColor([], ['#4c78a8'], '#ffffff', '#e3120b')).toBe('#e3120b'); + // An orange wash would vanish on an orange-tinted page. + expect(regionColor([], ['#4c78a8'], '#fbd9b0', undefined, ['#f2a35e', '#2a7f4f'])).toBe('#2a7f4f'); + }); + it('draws a cue on a mark\'s edge in an ink that reads on the mark and the page alike', () => { + // A mid-blue area on white: the dark ink, not white, which would vanish where it leaves the area. + expect(inkOn(['#4c78a8', '#ffffff'], ['#1a1a1a', '#ffffff'])).toEqual({ ink: '#1a1a1a' }); + // A navy area: no ink reads on both, so the dark ink is haloed in the page's white. + expect(inkOn(['#051c2c', '#ffffff'], ['#1a1a1a', '#ffffff'])).toEqual({ ink: '#1a1a1a', halo: '#ffffff' }); + expect(inkOn(['#118dff', '#1b1a19'], ['#f3f2f1', '#1b1a19']).ink).toBe('#f3f2f1'); + }); +}); + +describe('cost', () => { + const time = (run: () => void, repeat = 10) => { + run(); + const started = performance.now(); + for (let index = 0; index < repeat; index++) run(); + return (performance.now() - started) / repeat; + }; + const cloud = (count: number) => Array.from({ length: count }, (_, index) => dot((index * 37) % 400, (index * 91) % 300, 3)); + const obstacles = (count: number): NoteObstacle[] => cloud(count).map((mark) => ({ kind: 'mark', box: mark.box })); + it('hulls and captions 5,000 points among 20,000 marks in a few milliseconds', () => { + const marks = cloud(5_000); + const ink = obstacles(20_000); + const ms = time(() => { + const outline = enclosureOutline(marks, 'hull', PLOT)!; + placeEnclosureCaption({ outlines: [outline], layouts: [LAYOUT, { lines: ['Recession', 'era'], width: 40, height: 32 }], plot: PLOT, canvas: CANVAS, obstacles: ink }); + }); + expect(ms).toBeLessThan(40); + }); + it('fits an ellipse round 5,000 points and outlines 20 groups quickly', () => { + const marks = cloud(5_000); + expect(time(() => enclosureOutline(marks, 'ellipse', PLOT))).toBeLessThan(40); + const groups = Array.from({ length: 20 }, (_, index) => cloud(250).map((mark) => ({ ...mark, box: { ...mark.box, x: mark.box.x / 20 + index * 20 } }))); + expect(time(() => { + const outlines = groups.map((group) => enclosureOutline(group, 'hull', PLOT)!); + placeEnclosureCaption({ outlines, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, connect: 'all', obstacles: obstacles(5_000) }); + })).toBeLessThan(60); + }); + it('seats a region caption among 20,000 marks and lines quickly', () => { + const ink = obstacles(20_000); + const segments = Array.from({ length: 5_000 }, (_, index) => ({ a: { x: index * 0.08, y: 150 + Math.sin(index) * 40 }, b: { x: (index + 1) * 0.08, y: 150 + Math.sin(index + 1) * 40 } })); + const vertices = segments.map((segment) => segment.a); + const region = { x: 100, y: 100, width: 120, height: 80 }; + expect(time(() => { + placeRegionCaption({ region, axes: { x: true, y: true }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, obstacles: ink, segments }); + placeRegionCaption({ region: { x: 100, y: 0, width: 80, height: 300 }, axes: { x: true, y: false }, layouts: [LAYOUT], plot: PLOT, canvas: CANVAS, obstacles: ink, segments, vertices }); + })).toBeLessThan(60); + }); + it('keeps a convex hull of a million points under a second', () => { + const points = Array.from({ length: 1_000_000 }, (_, index) => ({ x: (index * 7919) % 1000, y: (index * 104729) % 777 })); + expect(time(() => convexHull(points), 1)).toBeLessThan(1_000); + }); +}); diff --git a/packages/flint-js/tests/annotation-room.test.ts b/packages/flint-js/tests/annotation-room.test.ts new file mode 100644 index 00000000..71cc9b5e --- /dev/null +++ b/packages/flint-js/tests/annotation-room.test.ts @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import * as vl from 'vega-lite'; +import * as vega from 'vega'; +import { noteRoomNeed, roomPast } from '../src/core/annotation'; +import { notesOfUpdates, referencesOfUpdates, regionsOfUpdates } from '../src/interactive/presentation/annotation'; +import { annotationItem } from '../src/vegalite/interactions/presentation/annotation-overlay'; +import { assembleVegaLite } from '../src/vegalite/assemble'; + +/** + * The chart makes room for the notes it is drawn with: a noted mark at the end of a measure axis gets + * the axis run on to a round tick, far enough for its caption, and never more than a third of the axis. + */ + +const SALES = [ + { region: 'North', revenue: 42 }, { region: 'East', revenue: 55 }, { region: 'South', revenue: 31 }, + { region: 'West', revenue: 28 }, { region: 'Central', revenue: 37 }, { region: 'Online', revenue: 61 }, +]; + +const bars = (options: Record = {}, extra: Record = {}) => assembleVegaLite({ + data: { values: SALES }, + semantic_types: { region: 'Category', revenue: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'region' }, y: { field: 'revenue' } }, canvasSize: { width: 640, height: 400 } }, + options, + ...extra, +} as any); + +const yEncoding = (spec: any) => spec.encoding?.y ?? spec.layer?.find((layer: any) => layer.encoding?.y?.field === 'revenue')?.encoding.y; + +async function drawnDomain(spec: any): Promise { + const view = new vega.View(vega.parse(vl.compile(spec).spec), { renderer: 'none' }); + await view.runAsync(); + return view.scale('y').domain(); +} + +describe('room for a note', () => { + it('runs an axis on past a value at its end, by the share the caption needs', () => { + // 61 on [0, 65] over 300 px leaves 18 px; 30 px needs the end at 61 / 0.9. + expect(roomPast(61, [0, 65], 300, 30, 'max')).toBeCloseTo(61 / 0.9, 6); + expect(roomPast(-40, [-45, 60], 300, 30, 'min')).toBeCloseTo((-40 - 0.1 * 60) / 0.9, 6); + expect(roomPast(40, [0, 65], 300, 30, 'max')).toBeUndefined(); + expect(roomPast(61, [0, 65], 300, 120, 'max')).toBeUndefined(); + }); + + it('needs the caption\'s height and the nearest direct seat\'s reach, no more', () => { + const measureAt = (fontSize: number) => (text: string) => text.length * fontSize * 0.5; + const need = noteRoomNeed('Still growing', { fontSize: 10 }, measureAt); + // An 11 px caption on one line is 18 px tall with its halo; the nearest seat stands 0.9 of a font + // size past the face, and the leader leaves the caption 2.5 px out. + expect(need).toBeCloseTo(18 + 9.9 + 2.5, 6); + }); + + it('takes the notes a chart mounts with by their key or element row, not those the chart words', () => { + expect(notesOfUpdates([ + { id: 'a', ops: [{ op: 'annotate-text', target: { select: { key: { region: 'Online' } } }, value: { text: 'Online leads' } }] }, + { id: 'b', ops: [{ op: 'annotate-text', target: { select: { key: { region: 'West' } } }, value: {} }] }, + { id: 'c', ops: [{ op: 'annotate-text', target: { select: { key: { region: 'East' } } }, value: null }] }, + ] as any)).toEqual([{ key: { region: 'Online' }, text: 'Online leads' }]); + }); + it('names the bar a note is on, not the value label that shares its key', () => { + const datum = { __flint_interaction_key: 'online', region: 'Online' }; + const bar = { datum, mark: { marktype: 'rect' }, bounds: { x1: 300, x2: 340, y1: 20, y2: 300 } }; + const label = { datum, mark: { marktype: 'text' }, bounds: { x1: 312, x2: 328, y1: 24, y2: 36 } }; + expect(annotationItem([label, bar], 'online')).toBe(bar); + expect(annotationItem([label], 'online')).toBe(label); + }); +}); + +describe('a chart drawn with notes', () => { + it('runs its value axis on past the tallest bar a note names, just far enough, at a fine round step', async () => { + const plain = bars(); + const noted = bars({ notes: [{ key: { region: 'Online' }, text: 'Online leads: 61' }] }); + expect(await drawnDomain(plain)).toEqual([0, 65]); + expect(yEncoding(noted).scale.domainMax).toBe(70); + expect(await drawnDomain(noted)).toEqual([0, 70]); + }); + + it('leaves the axis where the noted bar already has room', () => { + const noted = bars({ notes: [{ key: { region: 'West' }, text: 'West lags' }] }); + expect(yEncoding(noted).scale.domainMax).toBeUndefined(); + }); + + it('runs Flint\'s own ticks on at their step', () => { + const plain = bars({}, { theme_spec: 'nyt' }); + const noted = bars({ notes: [{ key: { region: 'Online' }, text: 'Online leads: 61' }] }, { theme_spec: 'nyt' }); + expect(yEncoding(plain).axis.values).toEqual([0, 10, 20, 30, 40, 50, 60]); + expect(yEncoding(noted).scale.domainMax).toBe(70); + expect(yEncoding(noted).axis.values).toEqual([0, 10, 20, 30, 40, 50, 60, 70]); + }); + + it('keeps a domain the spec states', () => { + const noted = assembleVegaLite({ + data: { values: SALES }, + semantic_types: { region: 'Category', revenue: { semanticType: 'Percentage', intrinsicDomain: [0, 61] } }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'region' }, y: { field: 'revenue' } }, canvasSize: { width: 640, height: 400 } }, + options: { notes: [{ key: { region: 'Online' }, text: 'Online leads: 61' }] }, + } as any); + const scale = yEncoding(noted).scale ?? {}; + expect(scale.domainMax === undefined || scale.domainMax === 61 || Array.isArray(scale.domain)).toBe(true); + }); +}); + +describe('a chart drawn with regions', () => { + // Bins of 10 from 10 to 90: counts 4, 6, 13, 22, 25, 23, 6, 1 (Vega bins them so too). + const COUNTS = [4, 6, 13, 22, 25, 23, 6, 1]; + const SCORES = COUNTS.flatMap((count, bin) => Array.from({ length: count }, (_, at) => ({ value: 10 + bin * 10 + (at % 10) }))); + const histogram = (regions: unknown[]) => assembleVegaLite({ + data: { values: SCORES }, + semantic_types: { value: 'Quantity' }, + chart_spec: { chartType: 'Histogram', encodings: { x: { field: 'value' } }, canvasSize: { width: 400, height: 300 } }, + options: { regions }, + } as any); + const histogramY = (spec: any) => spec.encoding?.y ?? spec.layer?.find((layer: any) => layer.encoding?.y)?.encoding.y; + + it('runs a histogram\'s counts on past the tallest bin of a stretch, enough for its caption over it', async () => { + const plain = histogram([]); + expect(histogramY(plain).scale?.domainMax).toBeUndefined(); + const spec = histogram([{ x: [42, 58], text: 'A stretch' }]); + const end = histogramY(spec).scale.domainMax; + expect(end).toBeGreaterThan(25); + const view = new vega.View(vega.parse(vl.compile(spec).spec), { renderer: 'none' }); + await view.runAsync(); + const y = view.scale('y'); + // The stretch's tallest bin (25) stands at least the caption's room below the plot's top. + const need = 4 + 18 + 8; + expect(y(25) - y(end)).toBeGreaterThanOrEqual(need - 0.5); + expect(y(25) - y(end)).toBeLessThan(need + 20); + }); + + it('leaves the axis where the stretch\'s bins leave its caption room', () => { + expect(histogramY(histogram([{ x: [10, 30], text: 'A stretch' }])).scale?.domainMax).toBeUndefined(); + // Uncaptioned, or captioned elsewhere, it needs none. + expect(histogramY(histogram([{ x: [42, 58] }])).scale?.domainMax).toBeUndefined(); + expect(histogramY(histogram([{ x: [42, 58], text: 'A stretch', placement: 'bottom' }])).scale?.domainMax).toBeUndefined(); + }); + + it('leaves a line its free row beneath', () => { + const values = Array.from({ length: 12 }, (_, month) => ({ month: month + 1, level: 80 + (month % 3) })); + const line = (regions: unknown[]) => assembleVegaLite({ + data: { values }, + semantic_types: { month: 'Quantity', level: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: { field: 'month' }, y: { field: 'level' } }, canvasSize: { width: 400, height: 300 } }, + options: { regions }, + } as any); + const y = (spec: any) => spec.encoding?.y ?? spec.layer?.find((layer: any) => layer.encoding?.y?.field === 'level')?.encoding.y; + expect(y(line([{ x: [3, 6], text: 'A stretch' }])).scale?.domainMax).toBe(y(line([])).scale?.domainMax); + }); + + it('takes the regions a chart mounts with', () => { + expect(regionsOfUpdates([ + { id: 'a', ops: [{ op: 'annotate-region', name: 'r', value: { x: [1, 2], text: 'Stretch' } }] }, + { id: 'b', ops: [{ op: 'annotate-region', name: 's', value: null }] }, + ] as any)).toEqual([{ x: [1, 2], text: 'Stretch' }]); + }); +}); + +describe('a reference past the axis end', () => { + it('is read from a y rule or a y band, and the axis runs on to reach it', async () => { + const references = referencesOfUpdates([{ id: 'r', ops: [ + { op: 'set-overlay', name: 'goal', value: { mark: 'rule', role: 'reference', data: { values: [{ v: 100 }] }, encodings: { y: { field: 'v' } } } }, + { op: 'annotate-region', name: 'band', value: { y: [20, 30] } }, + { op: 'set-overlay', name: 'cut', value: { mark: 'rule', role: 'reference', data: { values: [{ d: 'East' }] }, encodings: { x: { field: 'd' } } } }, + ] }]); + expect(references).toEqual([100, 20, 30]); + const [, top] = await drawnDomain(bars({ references })); + expect(top).toBeGreaterThanOrEqual(100); + const [, plain] = await drawnDomain(bars()); + expect(plain).toBeLessThan(100); + }); +}); diff --git a/packages/flint-js/tests/backend-entries.test.ts b/packages/flint-js/tests/backend-entries.test.ts new file mode 100644 index 00000000..57c7072b --- /dev/null +++ b/packages/flint-js/tests/backend-entries.test.ts @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// An app that installs one backend's library builds with `flint-chart/react/` or +// `flint-chart/interactive/`: bundlers resolve every import, dynamic ones too, so those +// entries must reach no other backend's library (#155). + +import { readFileSync, existsSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { describe, expect, it } from 'vitest'; +import { rendererFactory } from '../src/interactive/mount'; +import type { InteractiveRendererAdapter } from '../src/interactive/types'; + +const SRC = resolve(dirname(fileURLToPath(import.meta.url)), '../src'); +const BACKEND_LIBRARIES: Record = { + vegalite: /^vega(-lite|-tooltip)?$/, + echarts: /^echarts(\/|$)/, + chartjs: /^chart\.js(\/|$)/, + plotly: /^plotly\.js/, +}; + +/** Every package a module reaches through static and dynamic imports, type-only imports aside. */ +function reachedPackages(entry: string): Set { + const packages = new Set(); + const seen = new Set(); + const visit = (file: string): void => { + if (seen.has(file)) return; + seen.add(file); + const text = readFileSync(file, 'utf8'); + const specifiers = [ + ...[...text.matchAll(/^\s*(?:import|export)\s+(?!type\b)[^'";]*?from\s+['"]([^'"]+)['"]/gm)].map((m) => m[1]), + ...[...text.matchAll(/^\s*import\s+['"]([^'"]+)['"]/gm)].map((m) => m[1]), + ...[...text.matchAll(/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g)].map((m) => m[1]), + ]; + for (const specifier of specifiers) { + if (!specifier.startsWith('.')) { + packages.add(specifier); + continue; + } + const base = resolve(dirname(file), specifier); + const target = [`${base}.ts`, `${base}.tsx`, join(base, 'index.ts'), base.replace(/\.js$/, '.ts')].find(existsSync); + if (target) visit(target); + } + }; + visit(join(SRC, entry)); + return packages; +} + +const reachedBackends = (entry: string): string[] => { + const packages = [...reachedPackages(entry)]; + return Object.keys(BACKEND_LIBRARIES).filter((backend) => packages.some((name) => BACKEND_LIBRARIES[backend].test(name))); +}; + +describe('backend entries', () => { + for (const backend of Object.keys(BACKEND_LIBRARIES)) { + it(`flint-chart/react/${backend} and flint-chart/interactive/${backend} reach ${backend} alone`, () => { + expect(reachedBackends(`react/${backend}.ts`)).toEqual([backend]); + expect(reachedBackends(`interactive/${backend}.ts`)).toEqual([backend]); + }); + } + + it('the default entries still reach every backend', () => { + const all = Object.keys(BACKEND_LIBRARIES); + expect(reachedBackends('react/index.ts')).toEqual(all); + expect(reachedBackends('interactive/index.ts')).toEqual(all); + }); +}); + +describe('renderer factories', () => { + const adapter = {} as InteractiveRendererAdapter; + const given = () => adapter; + + it('takes the host\'s factory over the entry\'s loader', async () => { + const loaded = () => adapter; + await expect(rendererFactory({ chartjs: async () => loaded }, { chartjs: given }, 'chartjs')).resolves.toBe(given); + await expect(rendererFactory({ chartjs: async () => loaded }, undefined, 'chartjs')).resolves.toBe(loaded); + }); + + it('names the import a missing backend needs', async () => { + await expect(rendererFactory({ vegalite: async () => given }, undefined, 'plotly')) + .rejects.toThrow(/createPlotlyInteractiveRenderer.*flint-chart\/plotly\/interactive.*flint-chart\/react\/plotly/); + }); +}); diff --git a/packages/flint-js/tests/backend-layout.test.ts b/packages/flint-js/tests/backend-layout.test.ts new file mode 100644 index 00000000..5f3b8595 --- /dev/null +++ b/packages/flint-js/tests/backend-layout.test.ts @@ -0,0 +1,839 @@ +import { describe, expect, it } from 'vitest'; +import { assembleECharts } from '../src/echarts/assemble'; +import { assembleChartjs } from '../src/chartjs/assemble'; +import { assemblePlotly } from '../src/plotly/assemble'; +import { planTitleBlock, onNiceTick, cutToWidth, judgeBackendCanvas, withTreatment, HOST_SCALE_TARGET, hostFitScale, treatedKeySide, treatedKeyFontSize, scaledTypeSize, LABEL_SCALE, TITLE_SCALE } from '../src/core/backend-frame'; +import { denseLineWidth } from '../src/core/line-density'; +import { tableTextMeasurer } from '../src/core/text-width'; +import { roundBinEdges } from '../src/core/color-controls'; +import { keyBlock } from '../src/core/backend-profile'; +import { PLOTLY_PROFILE } from '../src/plotly/profile'; +import { plXEndOverhang } from '../src/plotly/frame'; +import { ecKeyGeometry } from '../src/echarts/profile'; +import { cjsKeyGeometry } from '../src/chartjs/profile'; + +/** Paris 2024 medal counts, with official delegation names that run long. */ +const TEAMS: Array<[string, number]> = [ + ['United States of America', 126], ["People's Republic of China", 91], ['Islamic Republic of Iran', 12], + ["Democratic People's Republic of Korea", 6], ['Refugee Olympic Team', 1], +]; +const medals = (encodings: Record, extra: Record = {}): any => ({ + data: { values: TEAMS.map(([Team, Total], i) => ({ Team, Total, Gold: 40 - i * 7, Silver: 44 - i * 8 })) }, + semantic_types: { Team: 'Category', Total: 'Quantity', Gold: 'Quantity', Silver: 'Quantity' }, + field_display_names: { Total: 'Total medals', Gold: 'Gold medals', Silver: 'Silver medals' }, + chart_spec: { chartType: 'Bar Chart', encodings, baseSize: { width: 400, height: 300 }, ...extra }, +}); + +const HEADLINE = 'Paris 2024 medals by team, with the longest official delegation names'; +const DECK = 'GDP per capita (log scale) vs life expectancy, 2007; bubble size = population; X: GDP per capita ($, log scale); Y: Life expectancy (years)'; + +/** No line of a broken title is a widow: the last is at least a third of the widest. */ +function noWidow(lines: string[], widthOf: (text: string) => number): boolean { + if (lines.length < 2) return true; + const widest = Math.max(...lines.map(widthOf)); + return widthOf(lines[lines.length - 1]) >= widest / 3; +} + +/** Many series over years, for line-density checks. */ +const manyLines = (count: number): any => ({ + data: { values: Array.from({ length: count }, (_, s) => [2000, 2005, 2010, 2015, 2020].map((Year, i) => ({ Series: `S${s}`, Year, Value: s + i }))).flat() }, + semantic_types: { Series: 'Category', Year: 'Year', Value: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Year', y: 'Value', color: 'Series' }, baseSize: { width: 400, height: 300 } }, +}); + +describe('the shared title block', () => { + const measure = tableTextMeasurer; + const style = { + headline: { fontSize: 18, fontWeight: 'bold', font: 'sans-serif' }, + deck: { fontSize: 12, font: 'sans-serif' }, + gap: 10, + }; + + it('leaves a title that fits on one line', () => { + const block = planTitleBlock({ title: 'Medals' }, 400, style)!; + expect(block.headline!.lines).toEqual(['Medals']); + expect(block.broken).toBe(0); + }); + + it('sets a headline a size down where that brings it onto one line', () => { + const text = 'Paris 2024 medals by team and country'; + const full = measure(18, 'sans-serif', 'bold', 'normal')(text); + const block = planTitleBlock({ title: text }, full - 4, style)!; + expect(block.headline!.lines).toHaveLength(1); + expect(block.headline!.fontSize).toBeLessThan(18); + }); + + it('breaks a long deck to full lines with no widow, and counts the lines it adds', () => { + const block = planTitleBlock({ title: 'Life expectancy', subtitle: DECK }, 440, style)!; + const widthOf = measure(12, 'sans-serif', 'normal', 'normal'); + expect(block.deck!.lines.length).toBeGreaterThan(1); + expect(block.deck!.lines.every((line) => widthOf(line) <= 440)).toBe(true); + expect(noWidow(block.deck!.lines, widthOf)).toBe(true); + expect(block.broken).toBe((block.deck!.lines.length - 1) * block.deck!.lineHeight); + }); + + it('cuts to a measured width with an ellipsis', () => { + const widthOf = measure(12, 'sans-serif', 'normal', 'normal'); + const cut = cutToWidth("Democratic People's Republic of Korea", 80, widthOf); + expect(cut.endsWith('…')).toBe(true); + expect(widthOf(cut)).toBeLessThanOrEqual(80); + }); + + it('knows a round tick from a padded end', () => { + expect(onNiceTick(20, [0, 40])).toBe(true); + expect(onNiceTick(11.25, [11.25, 41.4])).toBe(false); + }); +}); + +describe('line density, shared by every backend', () => { + it('keeps a few lines at the backend weight and thins many, never below 0.75 px', () => { + expect(denseLineWidth(2, 7, 270)).toBeUndefined(); + expect(denseLineWidth(2, 30, 270)).toBeCloseTo(1.35, 2); + expect(denseLineWidth(3, 400, 270)).toBe(0.75); + }); +}); + +describe('ECharts frame', () => { + it('breaks a headline and deck in ECharts\u2019 own title, and makes room for it above the plot', () => { + // A box no wider than the chart, so the headline has only the drawing's width. + const option = assembleECharts(medals({ x: 'Team', y: 'Total' }, { title: HEADLINE, subtitle: 'Total medals won; five teams with long names', canvasSize: { width: 400, height: 300 } })); + expect(option.title.left).toBe('center'); + const lines = String(option.title.text).split('\n'); + expect(lines.length).toBe(2); + expect(noWidow(lines, tableTextMeasurer(option.title.textStyle.fontSize, 'sans-serif', 'bold', 'normal'))).toBe(true); + expect(option.title.subtext).toContain('Total medals won'); + // The plot starts under the title block. + const block = 15 + 10 + 2 * option.title.textStyle.lineHeight + 10 + option.title.subtextStyle.lineHeight; + expect(option.grid.top).toBeGreaterThanOrEqual(block); + }); + + it('wraps long row names and widens the gutter to them, the axis name clear of the labels', () => { + const option = assembleECharts(medals({ y: 'Team', x: 'Total' })); + const label = option.yAxis.axisLabel; + const texts = option.yAxis.data.map((v: string) => label.formatter(v)); + expect(texts.some((t: string) => t.includes('\n'))).toBe(true); + const widthOf = tableTextMeasurer(label.fontSize, 'sans-serif', 'normal', 'normal'); + const widest = Math.max(...texts.flatMap((t: string) => t.split('\n')).map(widthOf)); + expect(option.grid.left).toBeGreaterThanOrEqual(widest + 8); + expect(option.yAxis.nameGap).toBeGreaterThan(widest); + expect(label.interval).toBe(0); + }); + + it('wraps long key names beside the plot and keeps the plot clear of the key', () => { + // The frame's own layout, before any canvas-fit treatment. + const option = assembleECharts({ ...medals({ x: 'Gold', y: 'Silver', color: 'Team' }, { chartType: 'Scatter Plot', baseSize: { width: 280, height: 320 } }), options: { canvasFit: 'off' } }); + const names = option.legend.data.map((d: any) => (typeof d === 'string' ? d : d.name)); + const shown = names.map((n: string) => option.legend.formatter(n)); + expect(shown.some((t: string) => t.includes('\n'))).toBe(true); + const widthOf = tableTextMeasurer(option.legend.textStyle.fontSize, 'sans-serif', 'normal', 'normal'); + const widest = Math.max(...shown.flatMap((t: string) => t.split('\n')).map(widthOf)); + expect(option.grid.right).toBeGreaterThan(widest); + }); + + it('leaves a padded scatter domain\u2019s odd ends unlabelled', () => { + const option = assembleECharts(medals({ x: 'Gold', y: 'Silver' }, { chartType: 'Scatter Plot' })); + for (const axis of [option.xAxis, option.yAxis]) { + if (typeof axis.min === 'number' && !onNiceTick(axis.min, [axis.min, axis.max])) expect(axis.axisLabel.showMinLabel).toBe(false); + } + }); + + it('thins many lines from ECharts\u2019 2 px', () => { + const option = assembleECharts(manyLines(40)); + const widths = option.series.filter((s: any) => s.type === 'line').map((s: any) => s.lineStyle?.width); + expect(widths.every((w: number) => w < 2 && w >= 0.75)).toBe(true); + }); + + it('reports the canvas fit against the chart\u2019s box', () => { + const option = assembleECharts(medals({ x: 'Team', y: 'Total' })); + expect(option._canvasFit.box).toEqual({ width: 600, height: 450 }); + expect(option._canvasFit.drawing).toEqual({ width: option._width, height: option._height }); + }); +}); + +describe('Chart.js frame', () => { + it('sets a broken headline and deck in Chart.js\u2019 title and subtitle plugins, and grows the canvas for them', () => { + const plain = assembleChartjs(medals({ x: 'Team', y: 'Total' })); + const titled = assembleChartjs(medals({ x: 'Team', y: 'Total' }, { title: HEADLINE, subtitle: DECK })); + const title = titled.options.plugins.title; + expect(title.display).toBe(true); + expect(title.font.weight).toBe('bold'); + expect(Array.isArray(titled.options.plugins.subtitle.text)).toBe(true); + expect(titled._height).toBeGreaterThan(plain._height); + }); + + it('wraps long row names through the tick callback, every name shown', () => { + const config = assembleChartjs(medals({ y: 'Team', x: 'Total' })); + const ticks = config.options.scales.y.ticks; + const lines = config.data.labels.map((label: string) => ticks.callback.call({ getLabelForValue: () => label }, 0)); + expect(lines.some((l: unknown) => Array.isArray(l))).toBe(true); + expect(ticks.autoSkip).toBe(false); + }); + + it('fits a scale title longer than its axis onto two lines', () => { + const input = medals({ x: 'Team', y: 'Total' }); + input.field_display_names.Total = 'Total gold, silver and bronze medals won at the Paris 2024 Summer Olympics'; + const config = assembleChartjs(input); + expect(Array.isArray(config.options.scales.y.title.text)).toBe(true); + expect(config.options.scales.y.title.text).toHaveLength(2); + }); + + it('stays JSON where nothing is rewritten', () => { + const config = assembleChartjs({ + data: { values: [{ k: 'A', v: 1 }, { k: 'B', v: 2 }, { k: 'C', v: 3 }] }, + semantic_types: { k: 'Category', v: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'k', y: 'v' } }, + } as any); + expect(JSON.parse(JSON.stringify(config))).toEqual(config); + }); + + it('thins many lines from Chart.js\u2019 3 px', () => { + const config = assembleChartjs(manyLines(40)); + const widths = config.data.datasets.map((d: any) => d.borderWidth); + expect(widths.every((w: number) => w < 3 && w >= 0.75)).toBe(true); + }); +}); + +describe('Plotly frame', () => { + it('breaks a deck with no widow, measured in the face Plotly draws', () => { + const figure = assemblePlotly(medals({ x: 'Team', y: 'Total' }, { title: 'Medals', subtitle: DECK })); + const text = String(figure.layout.title.text); + const deck = text.slice(text.indexOf(']+>/g, '\n').split('\n').filter(Boolean); + expect(deck.length).toBeGreaterThan(1); + const widthOf = tableTextMeasurer(13, 'Verdana, sans-serif', 'normal', 'normal'); + expect(deck.every((line) => widthOf(line) <= figure.layout.width - 16)).toBe(true); + expect(noWidow(deck, widthOf)).toBe(true); + }); + + it('puts long key names on lines when the canvas fit holds them short, and keeps the full name in the hover', () => { + const input = medals({ x: 'Gold', y: 'Silver', color: 'Team' }, { chartType: 'Scatter Plot', baseSize: { width: 280, height: 320 } }); + const figure = assemblePlotly(withTreatment(input, { names: { keyWidth: 120 } }, { width: 420, height: 480 })); + const wrapped = figure.data.filter((t: any) => String(t.name).includes('
')); + expect(wrapped.length).toBeGreaterThan(0); + expect(wrapped.every((t: any) => t.hoverlabel?.namelength === -1)).toBe(true); + }); + + it('fits an axis title longer than its axis onto two lines', () => { + const input = medals({ x: 'Team', y: 'Total' }); + input.field_display_names.Total = 'Total gold, silver and bronze medals won at the Paris 2024 Summer Olympics'; + const figure = assemblePlotly(input); + expect(String(figure.layout.yaxis.title.text)).toContain('
'); + }); + + it('thins many lines from Plotly\u2019s 2 px', () => { + const figure = assemblePlotly(manyLines(40)); + const widths = figure.data.map((t: any) => t.line?.width); + expect(widths.every((w: number) => w < 2 && w >= 0.75)).toBe(true); + }); +}); + +describe('the backend canvas fit', () => { + it('takes a treatment only where it reads better than the chart as planned: fewer flags, less host shrink', () => { + const score = (fit: any) => fit.excess + Math.max(0, HOST_SCALE_TARGET - fit.scale); + const regions = ['Central and Southern Asia', 'Europe and Northern America', 'Northern Africa and Western Asia', 'Sub-Saharan Africa', 'Latin America and the Caribbean', 'Oceania', 'Eastern and South-Eastern Asia']; + const input: any = { + data: { values: regions.flatMap((region, r) => [2000, 2010, 2020].map((year, i) => ({ region, year, value: r * 10 + i }))) }, + semantic_types: { region: 'Category', year: 'Year', value: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'year', y: 'value', color: 'region' }, canvasSize: { width: 360, height: 270 } }, + }; + for (const assemble of [assembleECharts, assembleChartjs, assemblePlotly] as Array<(i: any) => any>) { + const fitted = assemble(input); + const planned = assemble({ ...input, options: { canvasFit: 'off' } }); + expect(score(fitted._canvasFit)).toBeLessThanOrEqual(score(planned._canvasFit) + 0.01); + if (fitted._canvasFit.treatment) expect(score(fitted._canvasFit)).toBeLessThan(score(planned._canvasFit)); + } + }); + + it('lays a backend\u2019s plot out smaller where its host would shrink the drawing past 90%', () => { + const box = { width: 450, height: 450 }; + const judge = (sideKeys: number) => judgeBackendCanvas({ plot: { width: 300, height: 300 }, parts: { yLabels: 60, xLabels: 60, title: 60, sideKeys }, padding: 0, box, base: { width: 300, height: 300 } }); + const wide = judge(150); + expect(wide.estimate.scale).toBeLessThan(HOST_SCALE_TARGET); + // Not past legibility, so the plan's own fit would leave it to the host. + expect(wide.plotScale).toBeUndefined(); + const share = hostFitScale(wide.estimate, box)!; + const furniture = wide.estimate.drawing.width - wide.estimate.area.width; + expect(wide.estimate.area.width * share + furniture).toBeLessThanOrEqual(450); + // A key too wide for any legible plot keeps the floor; a drawing that fits is left alone. + expect(hostFitScale(judge(260).estimate, box)).toBe(0.6); + expect(hostFitScale(judge(20).estimate, box)).toBeUndefined(); + }); + + it('steps the library\u2019s type down a size, to a floor, and takes it only where text reads larger on screen', () => { + expect(scaledTypeSize(12, LABEL_SCALE, 10)).toBe(10); + expect(scaledTypeSize(10, LABEL_SCALE, 10)).toBe(10); + expect(scaledTypeSize(17, TITLE_SCALE, 13)).toBe(14.5); + expect(scaledTypeSize(12, undefined, 10)).toBe(12); + // A plot and key whose labels a smaller size would leave smaller on screen keep their size. + const companies = assemblePlotly({ + data: { values: Array.from({ length: 12 }, (_, i) => ({ Sector: ['Information technology', 'Health care and life sciences', 'Industrials and manufacturing', 'Communication services'][i % 4], Revenue: 10 + i * 13, Margin: (i * 7) % 30, Staff: 1000 * (i + 1) })) }, + semantic_types: { Sector: 'Category', Revenue: 'Quantity', Margin: 'Percentage', Staff: 'Quantity' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'Revenue', y: 'Margin', color: 'Sector', size: 'Staff' }, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + } as any); + const t = companies._canvasFit.treatment; + if (t?.labelScale) expect(companies._canvasFit.scale * t.labelScale).toBeGreaterThanOrEqual(0.83); + // A Plotly key is set at its ticks' size, not over them. + expect(companies.layout.legend.font.size).toBeLessThanOrEqual(companies.layout.xaxis.tickfont?.size ?? 12); + }); + + it('asks for a smaller plot only where the host would shrink the drawing past legibility', () => { + const box = { width: 400, height: 300 }; + const roomy = judgeBackendCanvas({ plot: { width: 300, height: 200 }, parts: { yLabels: 50, xLabels: 40, title: 40 }, padding: 0, box, base: box }); + expect(roomy.plotScale).toBeUndefined(); + const squeezed = judgeBackendCanvas({ plot: { width: 400, height: 300 }, parts: { yLabels: 60, xLabels: 50, title: 160, sideKeys: 200 }, padding: 0, box, base: box }); + expect(squeezed.estimate.scale).toBeLessThan(0.7); + expect(squeezed.plotScale).toBeGreaterThanOrEqual(0.6); + }); +}); + +describe('ECharts fixes', () => { + it('places dates down y on a time axis, as epoch ms', () => { + const rows = ['2020-01-01', '2021-06-01', '2022-03-15'].map((date, i) => ({ date, value: 10 + i })); + const option = assembleECharts({ data: { values: rows }, semantic_types: { date: 'Date', value: 'Quantity' }, chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'value', y: 'date' } } } as any); + expect(option.yAxis.type).toBe('time'); + expect(typeof option.series[0].data[0][1]).toBe('number'); + }); + + it('keeps the x name clear of a heatmap\u2019s colour ramp at the foot', () => { + const rows = ['North', 'East', 'South'].flatMap((Region, r) => ['A', 'B'].map((Segment, s) => ({ Region, Segment, Load: 40 + r * 10 + s * 5 }))); + const option = assembleECharts({ data: { values: rows }, semantic_types: { Region: 'Category', Segment: 'Category', Load: 'Quantity' }, chart_spec: { chartType: 'Heatmap', encodings: { x: 'Region', y: 'Segment', color: 'Load' } } } as any); + const ramp = option.visualMap; + const rampTop = ramp.bottom + (ramp.itemWidth ?? 20) + 22; + // The x name's baseline sits above the ramp and its handle values. + expect(option.grid.bottom - option.xAxis.nameGap - 14).toBeGreaterThanOrEqual(rampTop - 4); + }); + + it('stands a size ramp\u2019s title over its bar, from the plot\u2019s top', () => { + // Twenty distinct sizes: a quantity, keyed by ECharts' continuous ramp. + const rows = Array.from({ length: 20 }, (_, i) => ({ x: i, y: (i * 7) % 13, pop: 0.2 + i * 66 })); + const option = assembleECharts({ data: { values: rows }, semantic_types: { x: 'Quantity', y: 'Quantity', pop: 'Quantity' }, + chart_spec: { chartType: 'Scatter Plot', title: HEADLINE, encodings: { x: 'x', y: 'y', size: 'pop' } } } as any); + const ramp = (Array.isArray(option.visualMap) ? option.visualMap : [option.visualMap]).find((m: any) => m.id === 'flint-ramp:size'); + const title = option.graphic.find((g: any) => g.id === 'flint-ramp-title:size'); + expect(ramp.show).not.toBe(false); + expect(title.top).toBe(option.grid.top); + expect(ramp.top).toBeGreaterThan(title.top); + }); + + it('edges colour bins at round values', () => { + const rows = ['a', 'b', 'c', 'd'].flatMap((k, i) => ['x', 'y'].map((j, n) => ({ k, j, v: -53901 + i * 30000 + n * 4000 }))); + const option = assembleECharts({ data: { values: rows }, semantic_types: { k: 'Category', j: 'Category', v: 'Quantity' }, chart_spec: { chartType: 'Heatmap', encodings: { x: 'k', y: 'j', color: { field: 'v', bins: 4 } } } } as any); + const vm = Array.isArray(option.visualMap) ? option.visualMap[0] : option.visualMap; + expect(vm.pieces).toHaveLength(4); + for (const piece of vm.pieces) for (const edge of [piece.lt, piece.gte]) if (edge !== undefined) expect(Math.abs(edge % 5000)).toBe(0); + }); +}); + +describe('roundBinEdges', () => { + it('puts count − 1 round edges inside the data', () => { + const edges = roundBinEdges(-53901, 43635, 4)!; + expect(edges).toEqual([-25000, 0, 25000]); + expect(roundBinEdges(1, 1, 4)).toBeUndefined(); + }); +}); + +describe('Plotly themed alignment', () => { + const MIX: Array<[string, string, number]> = [ + ['France', 'Nuclear', 65], ['France', 'Renewables', 27], ['France', 'Fossil', 8], + ['Germany', 'Nuclear', 3], ['Germany', 'Renewables', 52], ['Germany', 'Fossil', 45], + ['United States', 'Nuclear', 18], ['United States', 'Renewables', 22], ['United States', 'Fossil', 60], + ['China', 'Nuclear', 5], ['China', 'Renewables', 33], ['China', 'Fossil', 62], + ['Brazil', 'Nuclear', 2], ['Brazil', 'Renewables', 89], ['Brazil', 'Fossil', 9], + ]; + const stacked = (extra: Record = {}): any => ({ + data: { values: MIX.map(([Country, Source, Share]) => ({ Country, Source, Share })) }, + semantic_types: { Country: 'Country', Source: 'Category', Share: 'Percentage' }, + theme_spec: 'economist', + chart_spec: { + chartType: 'Stacked Bar Chart', encodings: { x: 'Country', y: 'Share', color: 'Source' }, + title: 'Electricity generation mix by country, 2023 (%)', subtitle: 'Share of electricity generation by source, %', + canvasSize: { width: 450, height: 450 }, ...extra, + }, + }); + + it('starts the header, headline, key and source at the chart\u2019s left, with the value axis on the right', () => { + const fig: any = assemblePlotly(stacked({ source: 'Ember' })); + const { layout } = fig; + const plotWidth = layout.width - layout.margin.l - layout.margin.r; + const chartLeft = layout.margin.l; + expect(layout.yaxis.side).toBe('right'); + expect(Math.abs(layout.title.x * layout.width - chartLeft)).toBeLessThan(2); + expect(Math.abs(layout.margin.l + layout.legend.x * plotWidth - chartLeft)).toBeLessThan(2); + const tab = layout.shapes.find((s: any) => s.type === 'rect'); + expect(Math.abs(tab.x0 * plotWidth + layout.margin.l - chartLeft)).toBeLessThan(2); + const source = layout.annotations.find((a: any) => /Ember/.test(a.text)); + expect(Math.abs(source.x * plotWidth + layout.margin.l - chartLeft)).toBeLessThan(2); + }); + + it('gives back the foot kept for names the house lays flat and a title it moves to the deck', () => { + const fig: any = assemblePlotly(stacked()); + expect(fig.layout.xaxis.tickangle).toBe(0); + expect(fig.layout.xaxis.ticktext).toContain('United
States'); + expect(fig.layout.xaxis.title?.text ?? '').toBe(''); + // Two rows of 11 px names and their standoff, not the room turned names and a title took. + expect(fig.layout.margin.b).toBeLessThan(64); + }); + + it('titles the key where the house does, and cuts names in the face they were planned in', () => { + const CPI: Array<[string, number]> = [ + ['Bananas, per lb.', 8.8], ['Bread, white, pan, per lb.', -5.6], ['Electricity per KWH', 7.3], + ['Gasoline, unleaded regular, per gallon', -6.4], ['Ground chuck, 100% beef, per lb.', 17.5], + ]; + const fig: any = assemblePlotly({ + data: { values: CPI.map(([Item, change]) => ({ Item, Change: change, Direction: change >= 0 ? 'Increase' : 'Decrease' })) }, + semantic_types: { Item: 'Category', Change: 'Percentage', Direction: 'Category' }, + theme_spec: 'nyt', + chart_spec: { chartType: 'Bar Chart', encodings: { y: 'Item', x: 'Change', color: 'Direction' }, title: 'Beef led a year of rising prices', canvasSize: { width: 450, height: 450 } }, + } as any); + expect(fig.layout.legend.title.text).toMatch(/Direction/); + const names: string[] = fig.layout.yaxis.ticktext; + expect(names).toContain('Electricity per KWH'); + expect(names.some((name) => name.includes('\u2026'))).toBe(false); + // An untheme'd chart keeps Plotly's untitled key. + const plain: any = assemblePlotly({ ...stacked(), theme_spec: undefined }); + expect(plain.layout.legend?.title?.text ?? '').toBe(''); + }); +}); + +describe('backend profiles', () => { + const widthOf = (text: string) => text.length * 6; + it('sets a Plotly key as the frame has Plotly draw it: rows that flow, each entry its own width', () => { + const entries = [['aaaaaaaaaa'], ['bb'], ['cc'], ['dd']]; + // 40 + 60 = 100 widest; one row needs 100 + 3·52 + 3·5 = 271 px. + const oneRow = keyBlock(PLOTLY_PROFILE.key, { entries, fontSize: 10, widthOf, orientation: 'horizontal', room: 300 }); + expect(oneRow.rows).toBe(1); + expect(oneRow.height).toBe(Math.ceil(Math.max(13, 16) + 3 + 10)); + const flow = keyBlock(PLOTLY_PROFILE.key, { entries, fontSize: 10, widthOf, orientation: 'horizontal', room: 250 }); + // 100 + 52 + 52 + 3·5 = 219 fits the first row; the last entry starts the second. + expect(flow.rows).toBe(2); + // As a grid at the widest entry (Plotly's own), the same row would hold two. + const grid = keyBlock({ ...PLOTLY_PROFILE.key, wrap: 'grid', breakAt: 'reach' }, { entries, fontSize: 10, widthOf, orientation: 'horizontal', room: 250 }); + expect(grid.rows).toBe(2); + // A two-line entry stands its lines tall; the box keeps 5 px at its top and bottom. + const column = keyBlock(PLOTLY_PROFILE.key, { entries: [['a', 'b'], ['c']], fontSize: 10, widthOf, orientation: 'vertical' }); + expect(column.height).toBe(Math.ceil((26 + 3) + (16 + 3) + 10)); + }); + + it('holds key names to the same width in every library, past each one\u2019s own symbol room', () => { + const options = { canvasTreatment: { names: { keyWidth: 120 } } }; + expect(treatedKeySide(options, PLOTLY_PROFILE.key)).toBe(120 + PLOTLY_PROFILE.key.lead); + expect(treatedKeySide(options, ecKeyGeometry({}))).toBe(120 + 30 + 10); + expect(treatedKeySide({}, PLOTLY_PROFILE.key)).toBeUndefined(); + // Key text steps down a size, never below the 10 px floor. + expect(treatedKeyFontSize(12, { canvasTreatment: { keyScale: 0.84 } })).toBe(10); + expect(treatedKeyFontSize(11, { canvasTreatment: { keyScale: 0.84 } })).toBe(10); + expect(treatedKeyFontSize(12, {})).toBe(12); + }); + + it('sets ECharts and Chart.js keys as their frames always measured them', () => { + const entries = [['alpha'], ['beta'], ['gamma']]; + const ec = keyBlock(ecKeyGeometry({}), { entries, fontSize: 12, widthOf, orientation: 'horizontal', room: 120 }); + // ECharts flows each entry at its own width: 30 + 30, 30 + 24, 30 + 30, 10 apart, in 110 px. + expect(ec.rows).toBe(3); + expect(ec.height).toBe(3 * 15 + 2 * 10 + 10); + const cjs = keyBlock(cjsKeyGeometry({}, 12), { entries, fontSize: 12, widthOf, orientation: 'horizontal', room: 400 }); + expect(cjs.rows).toBe(1); + expect(cjs.height).toBe(12 + 20); + }); +}); + +describe('a narrow chart\u2019s title', () => { + const twoBars = (extra: Record = {}): any => ({ + data: { values: [{ Group: 'Before', Score: 41 }, { Group: 'After', Score: 67 }] }, + semantic_types: { Group: 'Category', Score: 'Score' }, + chart_spec: { + chartType: 'Bar Chart', encodings: { x: 'Group', y: 'Score' }, + title: 'After the redesign, the share of first-time visitors who completed the sign-up flow rose from forty-one to sixty-seven per cent', + baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 }, ...extra, + }, + }); + + it('runs as wide as the box allows, the drawing growing wider rather than taller', () => { + for (const [name, assemble] of [['plotly', assemblePlotly], ['echarts', assembleECharts], ['chartjs', assembleChartjs]] as const) { + const fitted: any = (assemble as any)({ ...twoBars(), ...(name === 'plotly' ? { theme_spec: 'pop' } : {}) }); + const d = fitted._canvasFit.drawing; + expect(d.width, name).toBeGreaterThan(380); + expect(d.width, name).toBeLessThanOrEqual(450); + expect(d.height / d.width, name).toBeLessThan(1.2); + } + }); + + it('is measured in the case a house draws it, so no line runs past the figure', () => { + const fig: any = assemblePlotly({ ...twoBars(), theme_spec: 'pop' }); + const widthOf = tableTextMeasurer(fig.layout.title.font.size, fig.layout.title.font.family, 'bold', 'normal'); + const lines = String(fig.layout.title.text).split('/g, '').split('
').filter(Boolean); + const left = fig.layout.title.x * fig.layout.width; + for (const line of lines) expect(left + widthOf(line)).toBeLessThanOrEqual(fig.layout.width); + }); +}); + +describe('Plotly pie with long names', () => { + const names = ['Democratic Republic of the Congo', 'Bosnia and Herzegovina', 'Central African Republic', 'Trinidad and Tobago', 'Papua New Guinea']; + const pie = (labels: string[]): any => ({ + data: { values: labels.map((Country, i) => ({ Country, Share: 10 + i * 3 })) }, + semantic_types: { Country: 'Country', Share: 'Percentage' }, + chart_spec: { chartType: 'Pie Chart', encodings: { color: 'Country', size: 'Share' }, title: 'Shares', baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + theme_spec: 'economist', + }); + + it('names its slices in a key beside it, shares inside, rather than crowding a small disc with callouts', () => { + const fig: any = assemblePlotly(pie(names)); + const trace = fig.data[0]; + expect(fig.layout.showlegend).toBe(true); + expect(fig.layout.legend.x).toBeGreaterThanOrEqual(1); + expect(trace.textinfo).not.toContain('label'); + expect(trace.automargin).toBe(false); + expect(fig.layout.width).toBeLessThanOrEqual(450); + // The pie keeps a legible disc. + const m = fig.layout.margin; + expect(Math.min(fig.layout.width - m.l - m.r, fig.layout.height - m.t - m.b)).toBeGreaterThanOrEqual(200); + }); + + it('keys a themed pie whose callouts would stand outside it, so the house\u2019s tab stays over the headline', () => { + const fig: any = assemblePlotly({ + data: { values: [{ Fuel: 'Natural gas', Share: 58 }, { Fuel: 'Coal', Share: 34 }, { Fuel: 'Nuclear and hydroelectric', Share: 5 }, { Fuel: 'Oil and other liquid fuels', Share: 3 }] }, + semantic_types: { Fuel: 'Category', Share: 'Percentage' }, + chart_spec: { chartType: 'Pie Chart', encodings: { color: 'Fuel', size: 'Share' }, title: 'Power generation by fuel', baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + theme_spec: 'economist', + } as any); + const trace = fig.data[0]; + // No callout may grow the margins after the header is placed. + expect(trace.automargin).toBe(false); + expect(trace.textinfo).not.toContain('label'); + // The house keeps its key in a row, the names as written. + expect(fig.layout.legend.orientation).toBe('h'); + expect(trace.labels).toContain('Oil and other liquid fuels'); + const tab = fig.layout.shapes.find((s: any) => s.type === 'rect'); + const plotWidth = fig.layout.width - fig.layout.margin.l - fig.layout.margin.r; + expect(Math.abs(fig.layout.margin.l + tab.x0 * plotWidth - fig.layout.title.x * fig.layout.width)).toBeLessThan(2); + }); + + it('lets the chart, or the house, choose where the names stand (`sliceNames`)', () => { + const fuels = (props: Record | undefined, theme: unknown = 'economist'): any => assemblePlotly({ + data: { values: [{ Fuel: 'Natural gas', Share: 58 }, { Fuel: 'Coal', Share: 34 }, { Fuel: 'Nuclear and hydroelectric', Share: 5 }, { Fuel: 'Oil and other liquid fuels', Share: 3 }] }, + semantic_types: { Fuel: 'Category', Share: 'Percentage' }, + chart_spec: { chartType: 'Pie Chart', encodings: { color: 'Fuel', size: 'Share' }, ...(props ? { chartProperties: props } : {}), baseSize: { width: 300, height: 300 } }, + ...(theme ? { theme_spec: theme } : {}), + } as any); + const keyed = (fig: any) => fig.layout.showlegend === true && !String(fig.data[0].textinfo).includes('label'); + expect(keyed(fuels(undefined))).toBe(true); + expect(keyed(fuels({ sliceNames: 'onSlices' }))).toBe(false); + expect(keyed(fuels({ sliceNames: 'key' }, null))).toBe(true); + expect(keyed(fuels(undefined, null))).toBe(false); + // A house may prefer names on the slices; the chart's own setting stands over it. + const onSlices = { extends: 'economist', chartDefaults: { 'Pie Chart': { sliceNames: 'onSlices' } } }; + expect(keyed(fuels(undefined, onSlices))).toBe(false); + expect(keyed(fuels({ sliceNames: 'key' }, onSlices))).toBe(true); + }); + + it('leaves a pie of short names to name its own slices', () => { + const fig: any = assemblePlotly(pie(['A', 'B', 'C'])); + expect(String(fig.data[0].textinfo ?? fig.data[0].texttemplate ?? 'label')).toMatch(/label|%\{label\}/); + }); +}); + +describe('Plotly nice axes', () => { + it('starts and ends a scatter\u2019s axes on labelled ticks, and labels a short log axis within its decades', () => { + const rows = [[1865, 54.3], [4200, 66.2], [12400, 71.5], [39300, 84.2], [116900, 80.1]]; + const fig: any = assemblePlotly({ + data: { values: rows.map(([gdp, life]) => ({ gdp, life })) }, + semantic_types: { gdp: 'Quantity', life: 'Quantity' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'gdp', y: 'life' }, chartProperties: { logScale_x: true }, baseSize: { width: 300, height: 300 } }, + } as any); + const y = fig.layout.yaxis; + expect(y.range[0] % y.dtick).toBe(0); + expect(y.range[1] % y.dtick).toBe(0); + expect(y.range[0]).toBeLessThanOrEqual(54.3); + expect(y.range[1]).toBeGreaterThanOrEqual(84.2); + const x = fig.layout.xaxis; + expect(x.type).toBe('log'); + expect(x.tickvals.length).toBeGreaterThanOrEqual(4); + expect(x.tickvals[0]).toBeLessThanOrEqual(2000); + }); +}); + +describe('Plotly key in a row', () => { + it('sets its names for the row: whole where they stand one to a row, not broken for a column beside the plot', () => { + const segments = ['Residential customers on fixed tariffs', 'Small and medium-sized businesses', 'Large industrial and commercial accounts']; + const fig: any = assemblePlotly({ + data: { values: ['North', 'South', 'East'].flatMap((Region, r) => segments.map((Segment, k) => ({ Region, Segment, Revenue: 30 + r * 12 + k * 9 }))) }, + semantic_types: { Region: 'Category', Segment: 'Category', Revenue: 'Amount' }, + chart_spec: { chartType: 'Grouped Bar Chart', encodings: { x: 'Region', y: 'Revenue', group: 'Segment' }, title: 'Revenue by region and segment', baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + theme_spec: 'swiss', + } as any); + expect(fig.layout.legend.orientation).toBe('h'); + const names = [...new Set(fig.data.map((t: any) => t.name))]; + expect(names).toEqual(segments); + }); +}); + +describe('Plotly key in rows flows', () => { + it('sets each entry its own width, not a grid at the widest, so one long name does not leave one entry a row', () => { + const teams = ['UnitedStatesOlympicDelegationParis2024', 'China', 'Japan', 'France']; + const fig: any = assemblePlotly({ + data: { values: teams.map((Team, i) => ({ Team, Gold: 40 - i * 8, Silver: 44 - i * 9 })) }, + semantic_types: { Team: 'Category', Gold: 'Quantity', Silver: 'Quantity' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'Gold', y: 'Silver', color: 'Team' }, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 }, chartProperties: {} }, + options: { canvasTreatment: { keys: 'bottom' } }, + } as any); + expect(fig.layout.legend.orientation).toBe('h'); + expect(fig.layout.legend.traceorder).toBe('grouped'); + expect(fig.layout.legend.tracegroupgap).toBe(0); + const groups = fig.data.filter((t: any) => t.showlegend !== false).map((t: any) => t.legendgroup); + expect(new Set(groups).size).toBe(teams.length); + // The flow the frame measures: the short names share a row. + const block = keyBlock(PLOTLY_PROFILE.key, { entries: teams.map((t) => [t]), fontSize: 12, widthOf: tableTextMeasurer(12, 'Verdana', 'normal', 'normal'), orientation: 'horizontal', room: 400 }); + expect(block.rows).toBe(2); + }); +}); + +describe('Plotly size key', () => { + const bubbles = (theme?: string): any => assemblePlotly({ + data: { values: [['Europe', 64800, 82.3, 5.3], ['Americas', 62600, 78.6, 327], ['Asia', 16800, 76.7, 1393], ['Asia', 6900, 69.4, 1353], ['Africa', 5300, 54.3, 196], ['Europe', 50900, 81, 83]].map(([Continent, gdp, life, pop]) => ({ Continent, gdp, life, pop })) }, + semantic_types: { Continent: 'Category', gdp: 'Quantity', life: 'Quantity', pop: 'Quantity' }, + field_display_names: { pop: 'Population (M)' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'gdp', y: 'life', color: 'Continent', size: 'pop' }, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + ...(theme ? { theme_spec: theme } : {}), + } as any); + + it('draws a key to a size channel: round values as circles at the size the chart draws them, with its name', () => { + for (const theme of [undefined, 'swiss', 'cartoon']) { + const fig = bubbles(theme); + const circles = (fig.layout.shapes ?? []).filter((s: any) => s.type === 'circle'); + expect(circles.length, String(theme)).toBeGreaterThanOrEqual(2); + // Larger values, larger circles, in pixels so they stay round. + const d = circles.map((c: any) => c.x1 - c.x0); + expect([...d].sort((a, b) => a - b), String(theme)).toEqual(d); + expect(circles.every((c: any) => c.xsizemode === 'pixel' && c.ysizemode === 'pixel')).toBe(true); + expect(fig.layout.annotations.some((a: any) => /Population \(M\)/.test(a.text)), String(theme)).toBe(true); + // The figure carries no private size bookkeeping. + expect(fig.data.every((t: any) => t._sizeValues === undefined)).toBe(true); + } + }); + + it('stacks a size key under a colour key beside the plot, in the room kept for the keys, the plot keeping its size', () => { + const fig = bubbles(); + expect(fig.layout.legend.orientation ?? 'v').toBe('v'); + const plotWidth = fig.layout.width - fig.layout.margin.l - fig.layout.margin.r; + // The planned 300 px plot, not a plot narrowed by the room the keys took twice. + expect(plotWidth).toBeGreaterThanOrEqual(280); + const circles = fig.layout.shapes.filter((c: any) => c.type === 'circle'); + expect(new Set(circles.map((c: any) => c.xanchor.toFixed(4))).size).toBe(1); + expect(circles[0].xanchor).toBeGreaterThan(1); + }); + + it('keeps a size key beside the plot within the plot\u2019s height, or clear of the x axis\u2019s last label', () => { + const sectors = ['Information technology', 'Health care and life sciences', 'Financial services', 'Consumer discretionary', 'Industrials and manufacturing', 'Energy and utilities', 'Communication services']; + const fig: any = assemblePlotly({ + data: { values: Array.from({ length: 28 }, (_, i) => ({ Sector: sectors[i % 7], Revenue: 8 + i * 6, Margin: (i * 7) % 30 - 4, Staff: 2000 + (i * 3700) % 100000 })) }, + semantic_types: { Sector: 'Category', Revenue: 'Quantity', Margin: 'Percentage', Staff: 'Quantity' }, + field_display_names: { Staff: 'Employees' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'Revenue', y: 'Margin', color: 'Sector', size: 'Staff' }, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + } as any); + const circles = fig.layout.shapes.filter((c: any) => c.type === 'circle'); + expect(circles.length).toBeGreaterThanOrEqual(3); + const m = fig.layout.margin; + const plotWidth = fig.layout.width - m.l - m.r; + const lowest = Math.min(...circles.map((c: any) => c.yanchor * (fig.layout.height - m.t - m.b) + c.y0)); + const left = Math.min(...circles.map((c: any) => c.xanchor * plotWidth + c.x0)); + // Within the plot's height, or right of the last x label's overhang. + expect(lowest >= -2 || left >= plotWidth + plXEndOverhang(fig)).toBe(true); + }); + + it('sizes every series\u2019 bubbles on one scale from zero, as Vega-Lite does, and draws the largest first', () => { + for (const theme of [undefined, 'cartoon', 'swiss']) { + const fig = bubbles(theme); + const all = fig.data.filter((t: any) => Array.isArray(t.marker?.size)); + // The same value draws the same size in any series: Europe's 83 M stands well under Asia's 1,393 M. + const sizeOf = (name: string, i: number) => all.find((t: any) => t.name === name).marker.size[i]; + const europeLargest = Math.max(...all.find((t: any) => t.name === 'Europe').marker.size); + const asiaLargest = Math.max(...all.find((t: any) => t.name === 'Asia').marker.size); + expect(asiaLargest / europeLargest, String(theme)).toBeGreaterThan(2.5); + void sizeOf; + // Largest series drawn first; the key keeps the series' order. + expect(all[0].name, String(theme)).toBe('Asia'); + const ranks = Object.fromEntries(all.map((t: any) => [t.name, t.legendrank])); + expect(ranks.Europe, String(theme)).toBeLessThan(ranks.Asia); + // Each series' bubbles are drawn largest first. + for (const t of all) expect([...t.marker.size].sort((a: number, b: number) => b - a)).toEqual(t.marker.size); + } + }); + + it('sets a house\u2019s outlined dots solid with their outline, the same in Plotly and Vega-Lite (Cartoon)', () => { + const fig = bubbles('cartoon'); + const marker = fig.data[0].marker; + expect(marker.opacity ?? 1).toBe(1); + expect(marker.line.width).toBeGreaterThanOrEqual(2); + }); +}); + +describe('Plotly floors and calendar bands', () => { + it('leaves off the line along a floor that is not zero where the house grids its values (Economist)', () => { + const rows = Array.from({ length: 12 }, (_, i) => ({ income: 5 + i * 6, growth: 3.2 - i * 0.35 })); + const fig: any = assemblePlotly({ + data: { values: rows }, semantic_types: { income: 'Quantity', growth: 'Percentage' }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'income', y: 'growth' }, baseSize: { width: 300, height: 300 } }, + theme_spec: 'economist', + } as any); + // The y range reaches below zero, so the floor is not a base: zero carries it. + expect(Math.min(...fig.layout.yaxis.range)).toBeLessThan(0); + expect(fig.layout.xaxis.showline).toBe(false); + expect(fig.layout.yaxis.zeroline).toBe(true); + }); + + it('names a band of months as a calendar does, flat, rather than one turned date a band', () => { + const months = Array.from({ length: 12 }, (_, i) => `2025-${String(i + 1).padStart(2, '0')}`); + const fig: any = assemblePlotly({ + data: { values: months.flatMap((period) => ['A', 'B', 'C'].map((game, g) => ({ period, game, users: g * 10 + months.indexOf(period) }))) }, + semantic_types: { period: 'YearMonth', game: 'Category', users: 'Quantity' }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'period', y: 'game', color: 'users' }, baseSize: { width: 300, height: 200 } }, + } as any); + const x = fig.layout.xaxis; + expect(x.tickangle).toBe(0); + expect(x.ticktext[0]).toBe('Jan
2025'); + expect(x.ticktext.every((t: string) => !/^\d{4}-\d{2}$/.test(t))).toBe(true); + }); +}); + +describe('Plotly keys keep clear of the plot', () => { + const products = ['Productivity suite (enterprise)', 'Productivity suite (consumer)', 'Cloud storage', 'Video meetings', 'Team chat', 'Developer tools', 'Analytics workspace', 'Security center']; + const lines = (theme: string): any => assemblePlotly({ + data: { values: products.flatMap((Product, p) => [2021, 2022, 2023, 2024, 2025].map((Year, i) => ({ Year: String(Year), Product, Users: 40 + p * 15 + i * 6 }))) }, + semantic_types: { Year: 'Year', Product: 'Category', Users: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Year', y: 'Users', color: 'Product' }, title: 'Monthly active users by product line', baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + theme_spec: theme, + } as any); + + it('reserves the rows Plotly wraps a key on top into, so its last row does not run into the plot', () => { + const fig = lines('swiss'); + const legend = fig.layout.legend; + expect(legend.y).toBeGreaterThan(1); + const key = keyBlock(PLOTLY_PROFILE.key, { + entries: products.map((p) => [p]), fontSize: legend.font.size, + widthOf: tableTextMeasurer(legend.font.size, legend.font.family, 'normal', 'normal'), orientation: 'horizontal', + room: fig.layout.width - fig.layout.margin.r - fig.layout.margin.l * 0, + }); + const plotH = fig.layout.height - fig.layout.margin.t - fig.layout.margin.b; + // The key's foot stands at or above the plot's top. + expect((legend.y - 1) * plotH - key.height).toBeGreaterThanOrEqual(-2); + }); + + it('stands a key at the foot under the x labels, in room of its own', () => { + const fig = lines('apple'); + const legend = fig.layout.legend; + expect(legend.y).toBeLessThan(0); + expect(legend.yanchor).toBe('top'); + const plotH = fig.layout.height - fig.layout.margin.t - fig.layout.margin.b; + // Hung below the labels, and the margin holds it. + expect(-legend.y * plotH).toBeGreaterThanOrEqual(20); + expect(fig.layout.margin.b).toBeGreaterThan(-legend.y * plotH + 30); + }); +}); + +describe('Plotly margins and facets', () => { + it('stands bars over a run of months on Plotly\u2019s date axis, not one turned name a month', () => { + const values = Array.from({ length: 24 }, (_, i) => ({ month: `${2024 + Math.floor(i / 12)}-${String((i % 12) + 1).padStart(2, '0')}`, revenue: 100 + i })); + const fig: any = assemblePlotly({ + data: { values }, semantic_types: { month: 'YearMonth', revenue: 'Amount' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'month', y: 'revenue' } }, + } as any); + expect(fig.layout.xaxis.type).toBe('date'); + expect(fig.layout.xaxis.ticktext).toBeUndefined(); + }); + + const months = ['North', 'South'].flatMap((Region, r) => Array.from({ length: 6 }, (_, i) => ({ Month: `2024-0${i + 1}-01`, Region, Orders: 20 + r * 6 + i }))); + + it('keeps the y gutter to its labels, with no fixed floor', () => { + const fig: any = assemblePlotly({ + data: { values: months }, semantic_types: { Month: 'Date', Region: 'Category', Orders: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Month', y: 'Orders', color: 'Region' }, canvasSize: { width: 450, height: 450 } }, + theme_spec: 'nyt', + } as any); + // Two-figure labels, their 7 px standoff and Plotly's own 11 px: far under the old 64 px floor. + expect(fig.layout.margin.l).toBeLessThan(40); + expect(fig.layout.margin.l).toBeGreaterThan(20); + }); + + it('removes an axis title the house moved into the deck, so Plotly keeps no room for it', () => { + const fig: any = assemblePlotly({ + data: { values: months }, semantic_types: { Month: 'Date', Region: 'Category', Orders: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Month', y: 'Orders', color: 'Region' }, title: 'Orders' }, + theme_spec: 'economist', + } as any); + for (const key of ['xaxis', 'yaxis']) { + const title = fig.layout[key]?.title; + expect(title === undefined || String(title.text ?? '').trim() !== '').toBe(true); + } + }); + + it('stands a tall key of long names beside the plot when that fits the box', () => { + const names = ['Democratic Republic of the Congo', 'Bosnia and Herzegovina', 'Central African Republic', 'Trinidad and Tobago', 'Papua New Guinea', + 'Saint Vincent and the Grenadines', 'United Arab Emirates', 'Dominican Republic', 'Equatorial Guinea', 'Sao Tome and Principe']; + const fig: any = assemblePlotly({ + data: { values: names.flatMap((Country, i) => [0, 1, 2].map((k) => ({ Country, Spending: 2 + ((i * 3 + k * 5) % 14), Growth: ((i * 5 + k * 7) % 11) - 3 }))) }, + semantic_types: { Country: 'Country', Spending: 'Percentage', Growth: 'Percentage' }, + chart_spec: { + chartType: 'Scatter Plot', encodings: { x: 'Spending', y: 'Growth', color: 'Country' }, title: 'Spending and growth', subtitle: 'Three years per country', + baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 }, + }, + theme_spec: 'datawrapper', + } as any); + expect(fig._canvasFit?.treatment?.keys).toBe('side'); + expect(fig.layout.legend.orientation).toBe('v'); + expect(fig.layout.legend.x).toBeGreaterThanOrEqual(1); + }); + + it('ticks a facet panel\u2019s values from the panel\u2019s own height, not the house\u2019s count shared out over the grid', () => { + const countries = ['United States', 'Germany', 'Japan', 'Spain']; + const fig: any = assemblePlotly({ + data: { values: countries.flatMap((Country, c) => [2000, 2005, 2010, 2015, 2020].map((year, i) => ({ Year: `${year}-01-01`, Country, Rate: 3 + ((c * 5 + i * 3) % 20) }))) }, + semantic_types: { Year: 'Date', Country: 'Country', Rate: 'Percentage' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Year', y: 'Rate', column: 'Country' }, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + theme_spec: 'swiss', + } as any); + const y = fig.layout.yaxis; + // At least four labelled ticks, the range on round steps. + expect((y.range[1] - y.range[0]) / y.dtick).toBeGreaterThanOrEqual(4); + expect(y.range[0] % y.dtick).toBe(0); + expect(y.range[1] % y.dtick).toBe(0); + expect(y._framedTicks).toBeUndefined(); + }); + + it('ticks a panel\u2019s years by the width it is drawn at: the finest round step whose labels stand apart', () => { + const countries = ['United States', 'Germany', 'Japan', 'Spain']; + const rows = countries.flatMap((Country, c) => [2000, 2005, 2010, 2015, 2020, 2022].map((year, i) => ({ Year: `${year}-01-01`, Country, Rate: 3 + ((c + i) % 9) }))); + const years = (encodings: Record) => { + const fig: any = assemblePlotly({ + data: { values: rows }, semantic_types: { Year: 'Date', Country: 'Country', Rate: 'Percentage' }, + chart_spec: { chartType: 'Line Chart', encodings, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + } as any); + const keys = Object.keys(fig.layout).filter((k) => /^xaxis\d*$/.test(k)).sort(); + return fig.layout[keys[keys.length - 1]].ticktext as string[]; + }; + // Stacked rows: one wide panel, a label every five years. + expect(years({ x: 'Year', y: 'Rate', row: 'Country' })).toEqual(['2000', '2005', '2010', '2015', '2020']); + // Side by side: narrow panels, every ten. + expect(years({ x: 'Year', y: 'Rate', column: 'Country' })).toEqual(['2000', '2010', '2020']); + }); + + it('lays a facet grid out around its labels: one y title, x labels under each column only', () => { + const countries = Array.from({ length: 12 }, (_, i) => `Country ${i + 1}`); + const fig: any = assemblePlotly({ + data: { values: countries.flatMap((Country, c) => [2000, 2005, 2010, 2015, 2020].map((year) => ({ Year: `${year}-01-01`, Country, Rate: 3 + ((c + year) % 9) }))) }, + semantic_types: { Year: 'Date', Country: 'Country', Rate: 'Percentage' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Year', y: 'Rate', column: 'Country' }, baseSize: { width: 300, height: 300 }, canvasSize: { width: 450, height: 450 } }, + } as any); + expect(fig._facet).toBe(true); + const yAxes = Object.keys(fig.layout).filter((k) => /^yaxis\d*$/.test(k)); + expect(yAxes.every((k) => !fig.layout[k].title)).toBe(true); + const yTitle = fig.layout.annotations.filter((a: any) => a.textangle === -90); + expect(yTitle).toHaveLength(1); + // A panel with another below it leaves its x labels to that one. + const cols = fig._facetCols; + expect(fig.layout.xaxis.showticklabels).toBe(fig._facetRows > 1 ? false : undefined); + const last = `xaxis${fig._facetRows * cols > 1 ? countries.length : ''}`; + expect(fig.layout[last].showticklabels).not.toBe(false); + // Times along x stand flat, thinned to what the panel holds. + expect(fig.layout.xaxis.tickangle).toBe(0); + expect(fig.layout[last].ticktext.length).toBeGreaterThanOrEqual(2); + }); +}); diff --git a/packages/flint-js/tests/band-order-layers.test.ts b/packages/flint-js/tests/band-order-layers.test.ts new file mode 100644 index 00000000..54f15172 --- /dev/null +++ b/packages/flint-js/tests/band-order-layers.test.ts @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { compile } from 'vega-lite'; +import { parse, View } from 'vega'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { alignBandOrders } from '../src/vegalite/theme'; +import { THEME_PRESETS } from '../src/core/theme/presets'; + +/** + * Bars sorted by their value stand in that order under every house. A house's value labels and + * row names draw on the bars' band; Vega-Lite unions the layers' domains and drops a sort the + * union cannot keep, so the bars came out in name order — or, for row names above the bars, the + * chart did not compile at all. + */ + +const THEMES = ['datawrapper', 'nyt', 'economist', 'swiss', 'nature', 'mckinsey', 'powerbi', 'powerbi-light', + 'pop', 'cartoon', 'apple', 'de-stijl', 'bbc', 'material']; + +const LONG = [ + ['Only a complaint, summons and service', 49.4], + ['Government attorney appeared', 26.6], + ['Served', 33.1], + ['Default judgment entered against the defendant', 13.6], + ['Case dismissed for want of prosecution', 1.9], +] as const; + +/** The band's drawn order and the sort warnings Vega-Lite gave compiling it. */ +async function drawnOrder(spec: any, band: 'x' | 'y'): Promise<{ order: unknown[]; warnings: string[] }> { + const warnings: string[] = []; + const logger: any = { + level: () => logger, info: () => logger, debug: () => logger, error: () => logger, + warn: (...args: unknown[]) => { warnings.push(args.join(' ')); return logger; }, + }; + const view = new View(parse(compile(spec, { logger }).spec), { renderer: 'none' }); + await view.runAsync(); + return { order: view.scale(band).domain(), warnings: warnings.filter((warning) => /sort/i.test(warning)) }; +} + +const chart = (names: 'long' | 'short', horizontal: boolean, sortOrder: 'ascending' | 'descending', theme_spec?: string): any => { + const values = LONG.map(([k, v], index) => ({ k: names === 'long' ? k : 'ABCDE'[index], v })); + const encodings = horizontal + ? { x: { field: 'v' }, y: { field: 'k', sortBy: 'x', sortOrder } } + : { y: { field: 'v' }, x: { field: 'k', sortBy: 'y', sortOrder } }; + const spec: any = assembleVegaLite({ + data: { values }, semantic_types: { k: 'Category', v: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings, canvasSize: { width: 400, height: 300 } }, + ...(theme_spec ? { theme_spec } : {}), + } as any); + const expected = [...values].sort((a, b) => (sortOrder === 'descending' ? b.v - a.v : a.v - b.v)).map((row) => row.k); + return { spec, expected }; +}; + +describe('bars sorted by value under a house', () => { + it('stand in value order in every house, with no sort dropped', async () => { + for (const theme of THEMES) { + for (const names of ['long', 'short'] as const) { + for (const horizontal of [true, false]) { + const { spec, expected } = chart(names, horizontal, 'descending', theme); + const { order, warnings } = await drawnOrder(spec, horizontal ? 'y' : 'x'); + expect(order, `${theme} ${names} ${horizontal ? 'horizontal' : 'vertical'}`).toEqual(expected); + expect(warnings, theme).toEqual([]); + } + } + } + }); + + it('compile with names above the bars, sorted either way', async () => { + for (const sortOrder of ['ascending', 'descending'] as const) { + const { spec, expected } = chart('long', true, sortOrder, 'datawrapper'); + const names = spec.layer.find((layer: any) => layer.name === 'row-names'); + expect(names).toBeDefined(); + expect(names.encoding.y.sort).toEqual(expected); + expect((await drawnOrder(spec, 'y')).order).toEqual(expected); + } + }); + + it('sum a category’s rows, as Vega-Lite sorts a stacked bar', async () => { + const values = [ + { k: 'Alpha', v: 10 }, { k: 'Alpha', v: 10 }, { k: 'Alpha', v: 10 }, { k: 'Beta', v: 25 }, { k: 'Gamma', v: 5 }, + ]; + const spec = { + data: { values }, config: { mark: { tooltip: true } }, + layer: [ + { mark: 'bar', encoding: { y: { field: 'k', type: 'nominal', sort: '-x' }, x: { field: 'v', type: 'quantitative' } } }, + { mark: 'text', transform: [{ filter: 'datum.v > 5' }], encoding: { y: { field: 'k', type: 'nominal', sort: '-x' }, x: { field: 'v', type: 'quantitative' }, text: { field: 'v' } } }, + ], + }; + alignBandOrders(spec, values); + expect(spec.layer.map((layer) => layer.encoding.y.sort)).toEqual([['Alpha', 'Beta', 'Gamma'], ['Alpha', 'Beta', 'Gamma']]); + }); + + it('resolve a sort by a field or by an encoding the same way', () => { + const values = [{ k: 'P', v: 1 }, { k: 'Q', v: 3 }, { k: 'R', v: 2 }]; + for (const sort of [{ field: 'v', op: 'max', order: 'descending' }, { encoding: 'x', order: 'descending' }]) { + const spec = { layer: [ + { mark: 'bar', encoding: { y: { field: 'k', type: 'nominal', sort }, x: { field: 'v', type: 'quantitative' } } }, + { mark: 'text', encoding: { y: { field: 'k', type: 'nominal', sort }, x: { field: 'v', type: 'quantitative' } } }, + ] }; + alignBandOrders(spec, values); + for (const layer of spec.layer) expect(layer.encoding.y.sort).toEqual(['Q', 'R', 'P']); + } + }); + + it('leave alone a band one layer draws, a stated order, rows a transform reshapes, and panels sorted each for itself', () => { + const values = [{ k: 'P', v: 1 }, { k: 'Q', v: 3 }]; + const layer = (sort: any) => [ + { mark: 'bar', encoding: { y: { field: 'k', type: 'nominal', sort }, x: { field: 'v', type: 'quantitative' } } }, + { mark: 'text', encoding: { y: { field: 'k', type: 'nominal', sort }, x: { field: 'v', type: 'quantitative' } } }, + ]; + const cases: any[] = [ + { mark: 'bar', encoding: { y: { field: 'k', type: 'nominal', sort: '-x' }, x: { field: 'v', type: 'quantitative' } } }, + { layer: layer(['Q', 'P']) }, + { layer: layer('descending') }, + { transform: [{ filter: 'datum.v > 1' }], layer: layer('-x') }, + { resolve: { scale: { y: 'independent' } }, layer: layer('-x') }, + ]; + for (const spec of cases) { + const before = structuredClone(spec); + alignBandOrders(spec, values); + expect(spec).toEqual(before); + } + }); +}); + +/** + * Whether a house layers names or values on the band depends on the box: datawrapper sets row names + * above the bars only where they do not fit beside them (240 × 420 and 320 × 420 for these names), + * and a channel sort (`-x`) on a layer without that channel threw inside Vega-Lite. Every chart is + * compiled at every size, under every house, and Vega-Lite neither throws nor drops a sort. + */ +describe('bars sorted by value compile at every size under every house', () => { + const NAMES = ['Agriculture', 'Business services', 'Construction', 'Education and Health', 'Finance', 'Government', + 'Information', 'Leisure and hospitality', 'Manufacturing', 'Mining and Extraction', 'Other', 'Self-employed', + 'Transportation and Utilities', 'Wholesale and Retail Trade']; + const rows = NAMES.map((series, index) => ({ series, rate: 1 + index * 0.7, group: index % 3 ? 'Private' : 'Public' })); + const VARIANTS: Record> = { + 'sorted by x, descending': { x: { field: 'rate' }, y: { field: 'series', sortBy: 'x', sortOrder: 'descending' } }, + 'sorted by x, ascending': { x: { field: 'rate' }, y: { field: 'series', sortBy: 'x', sortOrder: 'ascending' } }, + 'columns sorted by y': { y: { field: 'rate' }, x: { field: 'series', sortBy: 'y', sortOrder: 'descending' } }, + 'sorted by its field': { x: { field: 'rate' }, y: { field: 'series', sortBy: 'rate', sortOrder: 'descending' } }, + 'stacked, sorted by x': { x: { field: 'rate' }, y: { field: 'series', sortBy: 'x', sortOrder: 'descending' }, color: { field: 'group' } }, + }; + const WIDTHS = [160, 240, 320, 400, 560, 800]; + const HEIGHTS = [180, 300, 420, 640]; + + const compileAt = (theme: string | undefined, encodings: Record, width: number, height: number) => { + const spec: any = assembleVegaLite({ + data: { values: rows }, + semantic_types: { rate: 'Number', series: 'Category', group: 'Category' }, + chart_spec: { + chartType: 'color' in encodings ? 'Stacked Bar Chart' : 'Bar Chart', encodings, + baseSize: { width, height }, canvasSize: { width, height }, + }, + options: { bandStepFit: 1, addTooltips: true }, + ...(theme ? { theme_spec: theme } : {}), + } as any); + const warnings: string[] = []; + const logger: any = { + level: () => logger, info: () => logger, debug: () => logger, error: () => logger, + warn: (...args: unknown[]) => { warnings.push(args.join(' ')); return logger; }, + }; + compile(JSON.parse(JSON.stringify(spec, (key, value) => (key.startsWith('_') ? undefined : value))), { logger }); + return { spec, sortWarnings: warnings.filter((warning) => /sort/i.test(warning)) }; + }; + + it.each([undefined, ...Object.keys(THEME_PRESETS)])('under %s', (theme) => { + const failures: string[] = []; + for (const [variant, encodings] of Object.entries(VARIANTS)) { + for (const width of WIDTHS) { + for (const height of HEIGHTS) { + try { + const { sortWarnings } = compileAt(theme, encodings, width, height); + if (sortWarnings.length) failures.push(`${variant} ${width}×${height}: ${sortWarnings[0]}`); + } catch (error) { + failures.push(`${variant} ${width}×${height}: ${String(error).slice(0, 120)}`); + } + } + } + } + expect(failures).toEqual([]); + }, 60_000); + + it('reaches the layout that threw: names above the bars in a narrow, tall box', () => { + for (const width of [240, 320]) { + const { spec } = compileAt('datawrapper', VARIANTS['sorted by x, descending']!, width, 420); + expect(spec.layer?.some((layer: any) => layer.name === 'row-names'), `${width}×420`).toBe(true); + } + }); +}); + diff --git a/packages/flint-js/tests/boxplot-label-fit.test.ts b/packages/flint-js/tests/boxplot-label-fit.test.ts index ef127191..5e0903fe 100644 --- a/packages/flint-js/tests/boxplot-label-fit.test.ts +++ b/packages/flint-js/tests/boxplot-label-fit.test.ts @@ -570,3 +570,29 @@ describe('band label pressure decisions', () => { expect(result!.lines[0]).toHaveLength(2); }); }); + +describe('a distribution reads its values as positions', () => { + const rows = [110, 111, 112, 113, 114, 115, 116, 118, 122].flatMap((age, i) => [{ group: i % 2 ? 'Men' : 'Women', age }]); + const valueScale = (chartType: string) => { + const spec: any = assembleVegaLite({ + data: { values: rows }, + semantic_types: { group: 'Category', age: 'Number' }, + chart_spec: { chartType, encodings: { x: { field: 'group' }, y: { field: 'age' } } }, + } as any); + // A violin's value axis is the measure renamed `value` by its density transform. + const find = (node: any): any => ['age', 'value'].includes(node?.encoding?.y?.field) && node.encoding.y.type === 'quantitative' + ? node.encoding.y : [...(node?.layer ?? []), ...(node?.spec ? [node.spec] : [])].map(find).find(Boolean); + return find(spec)?.scale ?? {}; + }; + + it('fits a boxplot\'s and a violin\'s value axis to the data, far from zero', () => { + for (const chartType of ['Boxplot', 'Violin Plot']) { + const scale = valueScale(chartType); + expect(scale.zero, chartType).toBe(false); + } + }); + + it('keeps zero under a bar of the same measure', () => { + expect(valueScale('Bar Chart').zero).not.toBe(false); + }); +}); diff --git a/packages/flint-js/tests/canvas-contain.test.ts b/packages/flint-js/tests/canvas-contain.test.ts new file mode 100644 index 00000000..b8dcbb14 --- /dev/null +++ b/packages/flint-js/tests/canvas-contain.test.ts @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { compile } from 'vega-lite'; +import { parse, View } from 'vega'; +import { openVegaLiteSession, vegaLiteStages } from '../src/vegalite/assemble'; + +/** + * A chart given a canvas is drawn within it. The canvas-fit pass left a chart that still read well + * drawn larger than its box — keys, labels and title stood past it — for the host to scale down; + * a host that draws the SVG at its own size cut them off. The chart is now laid out again for a + * smaller room, so the plot gives up the room and the drawing stands within the canvas. + */ + +const MONTHS = Array.from({ length: 12 }, (_, index) => `2024-${String(index + 1).padStart(2, '0')}`); +const CATEGORIES = ['Furniture', 'Office', 'Technology']; +const MONTHLY = MONTHS.flatMap((month, index) => CATEGORIES.map((category, at) => ({ month, category, revenue: 300000 + index * 10000 + at * 100000 }))); +const SOURCES = Array.from({ length: 20 }, (_, index) => ['Fossil fuels', 'Nuclear', 'Renewables'].map((source, at) => ({ + year: 2000 + index, source, share: 20 + at * 10 + Math.sin(index) * 3, +}))).flat(); + +/** The charts the issue showed, each with keys beside or above the plot. */ +const CHARTS: Record }> = { + stacked: { + values: MONTHLY, + chart_spec: { chartType: 'Stacked Bar Chart', encodings: { x: { field: 'month' }, y: { field: 'revenue' }, color: { field: 'category' } } }, + semantic_types: { month: 'YearMonth', revenue: 'Amount' }, + }, + line: { + values: SOURCES, + chart_spec: { chartType: 'Line Chart', encodings: { x: { field: 'year' }, y: { field: 'share' }, color: { field: 'source' } } }, + semantic_types: { year: 'Year', share: 'Number' }, + }, + donut: { + values: CATEGORIES.map((category, index) => ({ category, revenue: 1 + index })), + chart_spec: { chartType: 'Donut Chart', encodings: { size: { field: 'revenue' }, color: { field: 'category' } } }, + semantic_types: { revenue: 'Amount' }, + }, + bars: { + values: ['East', 'North', 'South', 'West'].map((region, index) => ({ region, revenue: 3000000 + index * 300000 })), + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'revenue' }, y: { field: 'region' } } }, + semantic_types: { revenue: 'Amount' }, + }, +}; + +const THEMES: Record = { none: undefined, 'keys on top': { legend: { placement: ['top'] } }, nyt: 'nyt', datawrapper: 'datawrapper' }; +const BOXES = [{ width: 600, height: 300 }, { width: 290, height: 300 }, { width: 290, height: 240 }]; + +function input(chart: string, theme: any, box: { width: number; height: number }, options: Record = {}, canvas = true): any { + const { values, chart_spec, semantic_types } = CHARTS[chart]!; + return { + data: { values }, + semantic_types, + chart_spec: { ...chart_spec, baseSize: box, ...(canvas ? { canvasSize: box } : {}) }, + options: { bandStepFit: 1, ...options }, + ...(theme ? { theme_spec: theme } : {}), + }; +} + +const quiet: any = { + level() { return this; }, warn() { return this; }, info() { return this; }, debug() { return this; }, error() { return this; }, +}; + +/** The size of the SVG Vega draws for a spec. */ +async function drawnSize(spec: any): Promise<{ width: number; height: number }> { + const clean = JSON.parse(JSON.stringify(spec, (key, value) => (key.startsWith('_') ? undefined : value))); + const view = new View(parse(compile(clean, { logger: quiet }).spec), { renderer: 'none', logLevel: 0 }); + const svg = await view.toSVG(); + view.finalize(); + const size = svg.match(/]*width="([\d.]+)"[^>]*height="([\d.]+)"/)!; + return { width: Number(size[1]), height: Number(size[2]) }; +} + +describe('a chart given a canvas is drawn within it', () => { + it('with its keys, under the default, keys-on-top and house themes', async () => { + const over: string[] = []; + for (const [themeName, theme] of Object.entries(THEMES)) { + for (const chart of Object.keys(CHARTS)) { + for (const box of BOXES) { + const drawn = await drawnSize(vegaLiteStages(input(chart, theme, box)).spec); + if (drawn.width > box.width + 0.5 || drawn.height > box.height + 0.5) { + over.push(`${chart} ${themeName} ${box.width}×${box.height}: drawn ${drawn.width}×${drawn.height}`); + } + } + } + } + expect(over).toEqual([]); + }, 120_000); + + it('says how, where it lays the chart out for less room', () => { + const { plan } = vegaLiteStages(input('stacked', undefined, { width: 600, height: 300 })); + const contain = plan.canvasFit?.treatment?.contain; + expect(contain).toBeDefined(); + expect(contain!.width).toBeLessThanOrEqual(600); + expect(contain!.height).toBeLessThanOrEqual(300); + expect(plan.report.some((note) => note.code === 'canvas-contain' && /600 × 300 canvas/.test(note.message))).toBe(true); + }); + + it('leaves a chart with no canvas, or with the canvas fit off, as it was', () => { + const box = { width: 600, height: 300 }; + const loose = vegaLiteStages(input('stacked', undefined, box, {}, false)).plan; + expect(loose.canvasFit?.treatment?.contain).toBeUndefined(); + expect(loose.report.some((note) => note.code === 'canvas-contain')).toBe(false); + const off = vegaLiteStages(input('stacked', undefined, box, { canvasFit: 'off' })).plan; + expect(off.canvasFit?.treatment?.contain).toBeUndefined(); + expect(off.report.some((note) => note.code === 'canvas-contain')).toBe(false); + }); + + it('a session replanned at its size draws what it drew', () => { + const box = { width: 600, height: 300 }; + const session = openVegaLiteSession(input('stacked', undefined, box)); + expect(session.plan.canvasFit?.treatment?.contain).toBeDefined(); + expect(JSON.stringify(session.replan({ size: box }).spec)).toBe(JSON.stringify(session.spec)); + }); +}); diff --git a/packages/flint-js/tests/canvas-fit-labels.test.ts b/packages/flint-js/tests/canvas-fit-labels.test.ts new file mode 100644 index 00000000..3e586ac1 --- /dev/null +++ b/packages/flint-js/tests/canvas-fit-labels.test.ts @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { vegaLiteStages } from '../src/vegalite/assemble'; + +/** + * A house whose type is large wraps long names down the y axis onto two lines, and two-line rows + * stand taller than the canvas holds. The canvas fit sets the labels a size or two down, never past + * the house's floor, so the chart enters its box with every name whole, rather than cut. + */ + +const TITLES = [ + ['Back in Action', 164.7, 'Movies'], ['Adolescence: Limited Series', 144.8, 'Shows'], + ['Squid Game: Season 2 // 오징어 게임: 시즌 2', 117.3, 'Shows'], ['STRAW', 102.9, 'Movies'], + ['The Life List', 95.5, 'Movies'], ['Exterritorial', 87.5, 'Movies'], ['Havoc', 86.9, 'Movies'], + ['Squid Game: Season 3 // 오징어 게임: 시즌 3', 71.5, 'Shows'], ['Zero Day: Limited Series', 61.3, 'Shows'], + ['Missing You: Limited Series', 58, 'Shows'], +].map(([title, views, format]) => ({ title, views: (views as number) * 1e6, format })); + +const bars = (theme: unknown, rows: any[] = TITLES) => ({ + data: { values: rows }, + semantic_types: { title: 'Name', views: 'Count', format: 'Category' }, + chart_spec: { + chartType: 'Bar Chart', + encodings: { x: { field: 'views', type: 'quantitative' }, y: { field: 'title', type: 'nominal', sortOrder: 'descending', sortBy: 'x' }, color: { field: 'format' } }, + title: 'Most-viewed movies and show seasons, January–June 2025', + subtitle: 'Top five per format; views are runtime-normalized viewing equivalents', + baseSize: { width: 400, height: 300 }, + canvasSize: { width: 800, height: 600 }, + }, + options: { maxStretch: 2 }, + theme_spec: theme, +}) as any; + +describe('axis labels a size down for wrapped row names', () => { + it('bring a chart whose two-line rows overrun its box inside it, every name whole, at no less than the floor', () => { + const { plan } = vegaLiteStages(bars('bbc')); + const fit = plan.canvasFit!; + expect(fit.before.drawing.height).toBeGreaterThan(600); + expect(fit.treatment?.labelScale).toBeDefined(); + expect(fit.after!.drawing.height).toBeLessThanOrEqual(600); + expect(fit.after!.drawing.width).toBeLessThanOrEqual(800); + + // Both axes share the smaller size, above the house's floor of three-quarters its own. + const { x, y } = plan.axisLabels; + expect(y.fontSize).toBeLessThan(14.5); + expect(y.fontSize).toBeGreaterThanOrEqual(14.5 * 0.75); + expect(x.fontSize).toBe(y.fontSize); + expect(plan.design.axes.y?.label.fontSize).toBe(y.fontSize); + + // The names still wrap, whole: none is cut short. + expect(plan.layout.yLabel.labelLines?.some((lines) => lines.length > 1)).toBe(true); + expect(plan.layout.yLabel.labelCut).toBeFalsy(); + expect(plan.report.some((note) => note.code === 'canvas-fit' && /axis labels at \d+%/.test(note.message))).toBe(true); + }); + + it('take the gentlest size that brings the chart inside, not the smallest it tried', () => { + const { plan } = vegaLiteStages(bars('bbc')); + const scales = plan.canvasFit!.tried.map((attempt) => attempt.treatment.labelScale).filter((scale): scale is number => scale !== undefined); + const chosen = plan.canvasFit!.treatment!.labelScale!; + expect(scales.length).toBeGreaterThan(1); + expect(chosen).toBeLessThan(Math.max(...scales)); + expect(chosen).toBeGreaterThan(Math.min(...scales)); + }); + + it('leave labels at the house size where the chart fits, or its names do not wrap', () => { + for (const theme of ['datawrapper', 'nyt', 'economist', undefined]) { + expect(vegaLiteStages(bars(theme)).plan.canvasFit?.treatment?.labelScale, String(theme)).toBeUndefined(); + } + const short = TITLES.map((row, index) => ({ ...row, title: `Title ${index + 1}` })); + const { plan } = vegaLiteStages(bars('bbc', short)); + expect(plan.canvasFit?.treatment?.labelScale).toBeUndefined(); + expect(plan.axisLabels.y.fontSize).toBe(plan.axisLabelFontSize); + }); +}); diff --git a/packages/flint-js/tests/categorical-temporal.test.ts b/packages/flint-js/tests/categorical-temporal.test.ts index b33ff397..8334b098 100644 --- a/packages/flint-js/tests/categorical-temporal.test.ts +++ b/packages/flint-js/tests/categorical-temporal.test.ts @@ -50,6 +50,20 @@ describe('dates read as snapshots', () => { expect(long.encoding.x.type).toBe('temporal'); }); + it('puts a heatmap over a whole run of months on a time scale, each cell its month', () => { + const input = { + data: { values: months('2025-01', 12).flatMap((when) => ['A', 'B', 'C'].map((k, i) => ({ when, k, v: i }))) }, + semantic_types: { when: 'YearMonth', k: 'Category', v: 'Quantity' }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'when', y: 'k', color: 'v' }, baseSize: { width: 400, height: 200 } }, + } as any; + const vl = assembleVegaLite(input); + expect(vl.encoding.x.type).toBe('temporal'); + expect(vl.transform).toEqual(expect.arrayContaining([{ calculate: `utcOffset('month', datum["when"], 1)`, as: '__cell_x_end' }])); + expect(assembleECharts(input).xAxis.type).toBe('category'); + // A bar chart over the same run stays a run of time. + expect(assembleVegaLite(bars(months('2025-01', 12), 'YearMonth')).encoding.x.type).toBe('temporal'); + }); + it('lets an explicit type win', () => { const pinned = assembleVegaLite(bars(['2025-07', '2025-12'], 'YearMonth', 'Bar Chart', { field: 'when', type: 'temporal' })); expect(pinned.encoding.x.type).toBe('temporal'); diff --git a/packages/flint-js/tests/chart-properties-validation.test.ts b/packages/flint-js/tests/chart-properties-validation.test.ts index 6f7eda47..c37574e9 100644 --- a/packages/flint-js/tests/chart-properties-validation.test.ts +++ b/packages/flint-js/tests/chart-properties-validation.test.ts @@ -86,7 +86,7 @@ describe('array-valued options', () => { chartProperties: JSON.parse('{"region":"world","projection":"orthographic","projectionCenter":[10,50]}'), }, } as any); - expect(spec.layer[0].projection.rotate).toEqual([-10, -50, 0]); + expect(spec.projection.rotate).toEqual([-10, -50, 0]); expect((spec._warnings ?? []).some((w: any) => w.code === 'invalid-option-value')).toBe(false); }); }); diff --git a/packages/flint-js/tests/color-classes.test.ts b/packages/flint-js/tests/color-classes.test.ts new file mode 100644 index 00000000..704e07a8 --- /dev/null +++ b/packages/flint-js/tests/color-classes.test.ts @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import { compile } from 'vega-lite'; +import { parse, View } from 'vega'; +import { assembleECharts, assembleVegaLite } from '../src'; +import { classColors, MAX_CLASSES_PER_SIDE, roundColorClasses } from '../src/core/color-controls'; + +/** + * A stepped colour scale is cut at round values: the step is round, a diverging field's pivot is a + * break, and each side of the pivot takes only the classes its data reaches. Equal cuts of a domain + * made symmetric about the pivot printed "−20, −7, 7, 20" for breaks at ±20.1 and ±6.7 and left the + * darkest cold classes empty. + */ + +const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +const WARM: Record = { + Singapore: [26.5, 27.1, 27.6, 28, 28.3, 28.3, 27.9, 27.9, 27.6, 27.6, 27, 26.4], + Delhi: [14.2, 17.4, 22.9, 29, 32.8, 33.5, 31.1, 30, 29.5, 26.3, 20.7, 15.9], + Cairo: [14, 15.1, 17.6, 21.3, 24.8, 27.2, 27.7, 27.7, 26, 23.4, 19.3, 15.6], + Sydney: [23.5, 23.4, 22.1, 19.5, 16.6, 14.2, 13.4, 14.5, 17.2, 19.2, 20.8, 22.4], + Seattle: [5.3, 6.2, 7.9, 10.2, 13.5, 16.2, 19.2, 19.4, 16.6, 11.7, 7.7, 5.1], + Moscow: [-6.5, -6.7, -1, 6.7, 13.2, 17, 19.2, 17, 11.3, 5.6, -1.2, -5.2], +}; +const ROWS = Object.entries(WARM).flatMap(([city, temps]) => temps.map((temp, i) => ({ city, month: MONTHS[i], temp }))); +const TEMPS = ROWS.map((row) => row.temp); + +const heatmap = (color: unknown, theme?: string): any => ({ + data: { values: ROWS }, + semantic_types: { city: 'Category', month: 'Month', temp: { semanticType: 'Temperature', unit: '°C' } }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'month', y: 'city', color }, canvasSize: { width: 600, height: 360 } }, + ...(theme ? { theme_spec: theme } : {}), +}); + +/** The labels the compiled key draws, and the warnings Vega-Lite gave compiling it. */ +async function drawnKey(spec: any): Promise<{ labels: string[]; warnings: string[] }> { + const warnings: string[] = []; + const logger: any = { + level: () => logger, info: () => logger, debug: () => logger, error: () => logger, + warn: (...args: unknown[]) => { warnings.push(args.join(' ')); return logger; }, + }; + const svg = await new View(parse(compile(spec, { logger }).spec), { renderer: 'none' }).toSVG(); + const key = svg.slice(svg.indexOf('role-legend'), svg.indexOf('role-legend-title')); + return { labels: [...key.matchAll(/]*>([^<]*)<\/text>/g)].map((m) => m[1].trim()).filter(Boolean), warnings }; +} + +describe('round colour classes', () => { + it('break at the pivot on a round step, each side taking only the classes its data reaches', () => { + expect(roundColorClasses(TEMPS, 5, 0)).toEqual({ breaks: [0, 10, 20, 30], lo: -10, hi: 40, below: 1, above: 4 }); + }); + + it('count from zero where there is no pivot', () => { + const sales = [40, 220, 515, 760, 980, 1201]; + expect(roundColorClasses(sales, 5)).toEqual({ breaks: [250, 500, 750, 1000], lo: 0, hi: 1250 }); + }); + + it('hold an author’s count: closed where a round step gives it, else the outer two open', () => { + const net = [-1400, -1100, -800, -400, -100, 200, 600, 900, 1200]; + expect(roundColorClasses(net, 4, 0, { exact: true })).toEqual({ breaks: [-1000, 0, 1000], lo: -2000, hi: 2000, below: 2, above: 2 }); + const wide = [-53901, -20000, 5000, 43635]; + expect(roundColorClasses(wide, 4, 0, { exact: true })).toEqual({ breaks: [-25000, 0, 25000], below: 2, above: 2 }); + }); + + it('do not step values that do not spread', () => { + expect(roundColorClasses([3, 3, 3], 5)).toBeUndefined(); + }); + + it('colour the short arm from its pale end, at the long arm’s steps', () => { + const ramp = ['#2166ac', '#f7f7f7', '#b2182b']; + const colors = classColors(ramp, { breaks: [0, 10, 20, 30], lo: -10, hi: 40, below: 1, above: 4 }); + expect(colors).toHaveLength(5); + expect(colors[4]).toBe('#b2182b'); + // The one cold class is the palest blue of an eight-step ramp, not its darkest. + expect(colors[0]).not.toBe('#2166ac'); + const blue = parseInt(colors[0].slice(5, 7), 16) - parseInt(colors[0].slice(1, 3), 16); + expect(blue).toBeGreaterThan(0); + }); +}); + +describe('a stepped key on a heatmap', () => { + it('prints round breaks under a binning house, with no warning', async () => { + for (const theme of ['pop', 'swiss', 'cartoon', 'de-stijl']) { + const spec: any = assembleVegaLite(heatmap('temp', theme)); + expect(spec.encoding.color.scale).toMatchObject({ type: 'threshold', domain: [0, 10, 20, 30] }); + const { labels, warnings } = await drawnKey(spec); + expect(labels.slice(0, 4), theme).toEqual(['0', '10', '20', '30']); + expect(warnings, theme).toEqual([]); + } + }); + + it('prints round breaks for an author’s bins, on a named scheme or on stops', async () => { + for (const color of [{ field: 'temp', bins: 5 }, { field: 'temp', bins: 5, scheme: ['#2166ac', '#f7f7f7', '#b2182b'] }]) { + const spec: any = assembleVegaLite(heatmap(color)); + expect(spec.encoding.color.scale.domain).toEqual([0, 10, 20, 30]); + expect((await drawnKey(spec)).labels.slice(0, 4)).toEqual(['0', '10', '20', '30']); + } + }); + + it('keeps the round classes in ECharts', () => { + const option: any = assembleECharts(heatmap({ field: 'temp', bins: 5 })); + const vm = Array.isArray(option.visualMap) ? option.visualMap[0] : option.visualMap; + expect(vm.pieces.map((piece: any) => piece.label)).toEqual(['\u221210 \u2013 0', '0 \u2013 10', '10 \u2013 20', '20 \u2013 30', '30 \u2013 40']); + expect([vm.min, vm.max]).toEqual([-10, 40]); + }); +}); + +describe('classes about a pivot', () => { + const ramp = ['#2166ac', '#f7f7f7', '#b2182b']; + + it('take no more than four a side where a coarser step holds the field', () => { + const lopsided = [-0.4, 1, 5, 12, 22, 35, 48, 61, 75]; + const classes = roundColorClasses(lopsided, 5, 0)!; + expect(Math.max(classes.below!, classes.above!)).toBeLessThanOrEqual(MAX_CLASSES_PER_SIDE); + expect(classes.breaks).toEqual([0, 20, 40, 60]); + }); + + it('show the sign beside a pivot that is a break: neither neighbour is the ramp\'s neutral', () => { + const colors = classColors(ramp, roundColorClasses([-14, -3, 4, 18, 27], 5, 0)!); + expect(colors).not.toContain('#f7f7f7'); + }); + + it('centre a neutral class on the pivot, a step wide or as wide as stated', () => { + const r = [-0.82, -0.4, -0.1, 0.05, 0.3, 0.6, 0.9]; + const auto = roundColorClasses(r, 5, 0, { neutral: 'auto' })!; + expect(auto.neutral).toBe(true); + const width = auto.breaks[1] - auto.breaks[0]; + const centre = auto.breaks.findIndex((edge) => edge > 0); + expect(auto.breaks[centre] + auto.breaks[centre - 1]).toBeCloseTo(0); + expect(auto.breaks[centre] - auto.breaks[centre - 1]).toBeCloseTo(width); + expect(classColors(ramp, auto)[auto.below!]).toBe('#f7f7f7'); + const stated = roundColorClasses(r, 5, 0, { neutral: 0.1 })!; + expect(stated.breaks).toContain(-0.1); + expect(stated.breaks).toContain(0.1); + }); +}); + +describe('the neutral class from semantics', () => { + const grid = (semantic: unknown) => ({ + data: { values: ['a', 'b', 'c', 'd'].flatMap((x, i) => ['p', 'q', 'r'].map((y, j) => ({ x, y, v: Number((-0.8 + 0.15 * i * 3 + 0.12 * j).toFixed(2)) }))) }, + semantic_types: { x: 'Category', y: 'Category', v: semantic }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'x', y: 'y', color: 'v' } }, + theme_spec: 'swiss', + }) as any; + const breaks = (input: any): number[] => { + let found: number[] | undefined; + const visit = (node: any) => { + const enc = node?.encoding?.color; + if (!found && enc?.legend !== null && enc?.scale?.type === 'threshold') found = enc.scale.domain; + for (const child of node?.layer ?? []) visit(child); + }; + visit(assembleVegaLite(input)); + if (!found) throw new Error("no stepped colour scale"); + return found; + }; + + it('centres one on a pivot the type always has, and breaks at one its values merely cross', () => { + expect(breaks(grid('Correlation'))).not.toContain(0); + expect(breaks(grid({ semanticType: 'PercentageChange', percentScale: 'fraction' }))).toContain(0); + }); + + it('follows the annotation: a width, or false for a break', () => { + expect(breaks(grid({ semanticType: 'PercentageChange', percentScale: 'fraction', divergingNeutral: 0.05 }))).toEqual(expect.arrayContaining([-0.05, 0.05])); + expect(breaks(grid({ semanticType: 'Correlation', divergingNeutral: false }))).toContain(0); + }); +}); + +describe('a diverging ramp\'s balance', () => { + it('is reported where its arms differ in lightness at mirrored points', () => { + const report = (theme: string) => ((assembleVegaLite({ ...heatmap('temp', theme) }) as any)._theme?.report ?? []) + .filter((entry: any) => entry.code === 'diverging-ramp-unbalanced'); + const pop = report('pop'); + expect(pop).toHaveLength(1); + expect(pop[0].message).toMatch(/L\*/); + }); +}); + +describe('an upright stepped key', () => { + it('runs no longer than the plot beside it, as a continuous ramp does', async () => { + const height = async (color: unknown) => { + const spec: any = assembleVegaLite({ ...heatmap(color), chart_spec: { ...heatmap(color).chart_spec, canvasSize: undefined } }); + const svg = await new View(parse(compile(spec).spec), { renderer: 'none' }).toSVG(); + return { spec, height: Number(/]*height="([\d.]+)"/.exec(svg)![1]) }; + }; + const stepped = await height({ field: 'temp', bins: 5 }); + const ramp = await height('temp'); + // Vega-Lite drops a binned key's own length; the config carries the one the plan gave it. + expect(stepped.spec.config.legend.gradientLength).toBe(stepped.spec.encoding.color.legend.gradientLength); + expect(stepped.height).toBeLessThanOrEqual(ramp.height + 2); + }); +}); diff --git a/packages/flint-js/tests/color-controls.test.ts b/packages/flint-js/tests/color-controls.test.ts index d3b7c9a0..37aef913 100644 --- a/packages/flint-js/tests/color-controls.test.ts +++ b/packages/flint-js/tests/color-controls.test.ts @@ -73,16 +73,21 @@ describe('colour controls on the encoding (Vega-Lite)', () => { expect(scale.domain[0]).toBe(-scale.domain[1]); }); - it('quantizes into the requested bins', () => { + it('steps into the requested bins at round values, breaking at the pivot', () => { const vl = assembleVegaLite(heatmap({ scheme: ['#c0392b', '#f2f2f2', '#2e75b6'], bins: 4 })) as any; - expect(vl.encoding.color.scale.type).toBe('quantize'); + expect(vl.encoding.color.scale.type).toBe('threshold'); expect(vl.encoding.color.scale.range).toHaveLength(4); + // Net runs −1,400 … 1,200 about 0: four classes a round 1,000 wide, closed at ±2,000. + expect(vl.encoding.color.scale.domain).toEqual([-1000, 0, 1000]); + expect(vl.encoding.color.legend.format).toBe(',.0~f'); }); it('keeps a theme ramp but binned or continuous on request', () => { const binned = cellScale(assembleVegaLite(heatmap({ bins: 7 }, { theme: 'economist' }))); - expect(binned.type).toBe('quantize'); + expect(binned.type).toBe('threshold'); expect(binned.range).toHaveLength(7); + // No round step closes seven classes over this field, so the outer two are open; every edge is round. + for (const edge of binned.domain) expect(Math.abs(edge % 250)).toBe(0); const smooth = cellScale(assembleVegaLite(heatmap({ bins: 0 }, { theme: 'economist' }))); expect(smooth.type).toBeUndefined(); }); @@ -116,7 +121,9 @@ describe('colour controls on the other backends', () => { const ec = assembleECharts(heatmap({ scheme: ['#c0392b', '#f2f2f2', '#2e75b6'], bins: 4, domain: [-2000, 2000], reverse: true })) as any; const vm = Array.isArray(ec.visualMap) ? ec.visualMap[0] : ec.visualMap; expect(vm.type).toBe('piecewise'); - expect(vm.splitNumber).toBe(4); + // Four bins edged at round values, the outer two open. + expect(vm.pieces.map((p: any) => p.label)).toEqual(['< \u22121,000', '\u22121,000 \u2013 0', '0 \u2013 1,000', '\u2265 1,000']); + expect(vm.pieces[0].color).toBe('#2e75b6'); expect(vm.inRange.color).toHaveLength(4); expect(vm.inRange.color[0]).toBe('#2e75b6'); expect([vm.min, vm.max]).toEqual([-2000, 2000]); diff --git a/packages/flint-js/tests/connected-scatter.test.ts b/packages/flint-js/tests/connected-scatter.test.ts index cefababa..e0c28b9e 100644 --- a/packages/flint-js/tests/connected-scatter.test.ts +++ b/packages/flint-js/tests/connected-scatter.test.ts @@ -2,7 +2,9 @@ // Licensed under the MIT License. import { describe, it, expect } from 'vitest'; -import { assembleVegaLite, assembleECharts, assembleChartjs } from '../src'; +import { compile } from 'vega-lite'; +import { assembleVegaLite, assembleECharts, assembleChartjs, THEME_PRESETS } from '../src'; +import { addVegaLiteInteractions } from '../src/vegalite/interactions/compile'; import { genConnectedScatterTests, genEChartsConnectedScatterTests, @@ -105,6 +107,19 @@ describe('Vega-Lite Connected Scatter', () => { expect(dspec.encoding.order.field).toBe('Step'); expect(dspec.mark.interpolate).toBe('linear'); }); + + it('draws each reading once when the live view splits the dots off the line', () => { + // Cartoon sets the house's line dots in config.line.point; the split line must not draw them again. + const themed = assembleVegaLite({ ...toInput(byTitle(cases, BASIC)), theme_spec: THEME_PRESETS.cartoon.spec } as any) as any; + addVegaLiteInteractions(themed, [], true); + const symbols: unknown[] = []; + const walk = (marks: any[] = []) => marks.forEach((m) => { + if (m.type === 'symbol') symbols.push(m); + walk(m.marks); + }); + walk((compile(themed).spec as any).marks); + expect(symbols).toHaveLength(1); + }); }); describe('ECharts Connected Scatter', () => { diff --git a/packages/flint-js/tests/filter-aggregate.test.ts b/packages/flint-js/tests/filter-aggregate.test.ts new file mode 100644 index 00000000..7e35a361 --- /dev/null +++ b/packages/flint-js/tests/filter-aggregate.test.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import { compile } from 'vega-lite'; +import { changeset, parse, View } from 'vega'; +import { openVegaLiteSession } from '../src/vegalite/assemble'; +import { filterControls } from '../src/interactive/filter-controls'; +import type { ChartAssemblyInput } from '../src/core/types'; + +const weekly = ['Premium', 'Standard', 'Budget'].flatMap((grade, index) => + Array.from({ length: 8 }, (_, week) => ({ week: `2024-01-0${week + 1}`, grade, price: 10 + index * 5 + week }))); + +const averaged: ChartAssemblyInput = { + data: { values: weekly }, + semantic_types: { grade: 'Category', price: 'Price', week: 'Date' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'grade' }, y: { field: 'price', aggregate: 'average' } } }, +}; + +describe('rows a filter leaves on an aggregated chart', () => { + it('are shaped the way the compiled data holds them', () => { + const session = openVegaLiteSession(structuredClone(averaged)); + expect(session.shapeRows(weekly)).toEqual(session.spec.data!.values); + expect(session.shapeRows(weekly.filter((row) => row.grade === 'Premium'))) + .toEqual([expect.objectContaining({ grade: 'Premium', price_average: 13.5 })]); + // Rows the host already aggregated pass through. + const compiled = session.spec.data!.values as Record[]; + expect(session.shapeRows(compiled)).toEqual(compiled); + }); + + it('draw the average of the rows the filter keeps', { timeout: 30_000 }, async () => { + const session = openVegaLiteSession(structuredClone(averaged)); + const vegaSpec = compile(session.spec as any).spec as any; + const source = vegaSpec.data.find((entry: any) => Array.isArray(entry.values)).name; + const control = filterControls(); + control.filterControls.bindRows(weekly); + const [op] = control.handle!( + { filters: { grade: { in: ['Premium'] } } } as any, + { chartType: 'Bar Chart', selected: [], available: [] } as any, + )!.ops; + if (op?.op !== 'set-data') throw new Error('expected a set-data op'); + const view = new View(parse(vegaSpec), { renderer: 'none' }); + await view.runAsync(); + await view.change(source, changeset().remove(() => true).insert(session.shapeRows(op.value.rows))).runAsync(); + const bars = view.data(vegaSpec.marks.find((mark: any) => mark.type === 'rect').from.data); + expect(bars.map((bar: any) => [bar.grade, bar.price_average])).toEqual([['Premium', 13.5]]); + expect(view.scale('y').domain()[1]).toBeGreaterThan(0); + view.finalize(); + }); +}); diff --git a/packages/flint-js/tests/filter-overflow.test.ts b/packages/flint-js/tests/filter-overflow.test.ts index 94dbc5a9..1146035f 100644 --- a/packages/flint-js/tests/filter-overflow.test.ts +++ b/packages/flint-js/tests/filter-overflow.test.ts @@ -133,4 +133,35 @@ describe('overflow category selection', () => { expect(applyCategoryViewports(data, result.viewports, { x: 1 })) .toEqual([data[1], data[2], data[3]]); }); + it('keeps explicit order duplicates and drops missing values before truncation', () => { + const data = ['Delta', 'Alpha', 'Charlie', 'Bravo'].map(Category => ({ Category, Value: 1 })); + const sortBy = JSON.stringify(['Bravo', 'Missing', 'Delta', 'Bravo', 'Alpha', 'Charlie']); + const run = (sortOrder?: 'ascending' | 'descending') => filterOverflow( + { + x: { field: 'Category', type: 'nominal', semanticAnnotation: annotation }, + y: { field: 'Value', type: 'quantitative', semanticAnnotation: { semanticType: 'Quantity' } }, + }, + { axisFlags: { x: { banded: true } } }, + { x: { field: 'Category', sortBy, sortOrder }, y: { field: 'Value' } }, + data, + budgets, + marks, + ); + + const ascending = run(); + expect(ascending.viewports[0].orderedValues).toEqual(['Bravo', 'Delta', 'Bravo', 'Alpha', 'Charlie']); + expect(ascending.truncations[0].keptValues).toEqual(['Bravo', 'Delta', 'Bravo']); + expect(ascending.warnings[0].message).toBe("1 of 4 values in 'Category' were omitted (showing first 3 in sort order)."); + expect(ascending.filteredData).toEqual([data[0], data[3]]); + + const descending = run('descending'); + expect(descending.viewports[0].orderedValues).toEqual(['Charlie', 'Alpha', 'Bravo', 'Delta', 'Bravo']); + expect(descending.truncations[0].keptValues).toEqual(['Charlie', 'Alpha', 'Bravo']); + }); + + it('windows rows whose numeric categories the rail holds as text', () => { + const rows = [1880, 1881, 1882].map((Year) => ({ Year, Anomaly: 0 })); + const viewport = { channel: 'x' as const, field: 'Year', orderedValues: ['1880', '1881', '1882'], visibleCount: 2, totalCount: 3 }; + expect(applyCategoryViewports(rows, [viewport], { x: 1 })).toEqual([rows[1], rows[2]]); + }); }); diff --git a/packages/flint-js/tests/heatmap-colors.test.ts b/packages/flint-js/tests/heatmap-colors.test.ts index c70c20e3..cb82c55d 100644 --- a/packages/flint-js/tests/heatmap-colors.test.ts +++ b/packages/flint-js/tests/heatmap-colors.test.ts @@ -83,6 +83,23 @@ describe('heatmap color defaults', () => { expect(spec.encoding.color.scale.domainMid).toBe(0); }); + it('fits the colour domain to every row when the columns overflow the canvas', () => { + // 144 years cannot all fit 580px; the warmest years lie past the first window kept. + const rows = Array.from({ length: 144 }, (_, index) => ({ year: 1880 + index, month: 'Jan', delta: index < 100 ? -0.2 : 1.1 })); + const spec = assembleVegaLite({ + data: { values: rows }, + semantic_types: { year: 'Year', month: 'Month', delta: { semanticType: 'Temperature', unit: '°C', divergingMidpoint: 0 } }, + chart_spec: { + chartType: 'Heatmap', + encodings: { x: { field: 'year', type: 'ordinal' }, y: { field: 'month' }, color: { field: 'delta' } }, + baseSize: { width: 1100, height: 200 }, canvasSize: { width: 580, height: 200 }, + }, + } as ChartAssemblyInput) as any; + + expect(spec._viewports?.[0]?.channel).toBe('x'); + expect(spec.encoding.color.scale.domain).toEqual([-1.1, 1.1]); + }); + it('draws no grid through the cells, even on a banded temporal axis', () => { const input: ChartAssemblyInput = { data: { values: [ @@ -142,9 +159,12 @@ describe('heatmap color defaults', () => { const spec = assembleVegaLite(input) as any; expect(spec.layer[0].encoding.x).toMatchObject({ field: 'food', type: 'nominal' }); expect(spec.layer[0].encoding.y).toMatchObject({ field: 'month', type: 'temporal' }); - expect(spec.layer[0].encoding.y.scale.domain).toHaveLength(2); - expect(spec.layer[1].encoding.y.scale.domain) - .toEqual(spec.layer[0].encoding.y.scale.domain); + // Each cell spans its month on the transposed axis; its value label stands at the month's middle, + // and both take the data's own extent rather than a stated domain. + expect(spec.layer[0].encoding.y2).toEqual({ field: '__cell_y_end', title: 'month' }); + expect(spec.layer[1].encoding.y).toMatchObject({ field: '__cell_y_mid', type: 'temporal' }); + expect(spec.layer[0].encoding.y.scale.domain).toBeUndefined(); + expect(spec.layer[1].encoding.y.scale.domain).toBeUndefined(); }); it('infers a numeric year field as temporal when semantic types are missing', () => { @@ -242,8 +262,13 @@ describe('heatmap color defaults', () => { expect(spec.encoding.x.type).toBe('temporal'); expect(spec.encoding.y.type).toBe('temporal'); expect(spec.mark).toMatchObject({ type: 'rect' }); - expect(spec.mark.width).toBeGreaterThan(0); - expect(spec.mark.height).toBeGreaterThan(0); + // Dates 27 days apart: each cell spans its 27 days on both axes, so the cells tile. + expect(spec.encoding.x2).toEqual({ field: '__cell_x_end', title: 'xDate' }); + expect(spec.encoding.y2).toEqual({ field: '__cell_y_end', title: 'yDate' }); + expect(spec.transform).toEqual(expect.arrayContaining([ + { calculate: `utcOffset('day', datum["xDate"], 27)`, as: '__cell_x_end' }, + { calculate: `utcOffset('day', datum["yDate"], 27)`, as: '__cell_y_end' }, + ])); expect(spec._width).toBeLessThanOrEqual(500); expect(spec._height).toBeLessThanOrEqual(400); expect(spec.config.axisX.labelFontSize).toBeLessThanOrEqual(8); diff --git a/packages/flint-js/tests/heatmap-paper-data.test.ts b/packages/flint-js/tests/heatmap-paper-data.test.ts index d04a08d7..a8ae96f0 100644 --- a/packages/flint-js/tests/heatmap-paper-data.test.ts +++ b/packages/flint-js/tests/heatmap-paper-data.test.ts @@ -6,6 +6,7 @@ import { describe, expect, it } from 'vitest'; import { compile } from 'vega-lite'; +import { format } from 'd3-format'; import { assembleECharts, assembleVegaLite } from '../src'; import { OMNI_VIZ_GAME_ORDER, OMNI_VIZ_ROWS } from '../src/test-data'; @@ -75,8 +76,16 @@ describe('aggregated titles', () => { }); describe('calendar dates read as UTC', () => { - it('describes each cell on its own month, west of UTC too', () => { + it('draws a whole run of months on a time scale, each cell spanning its month', () => { const vl = assembleVegaLite(heatmap()) as any; + expect(vl.encoding.x.type).toBe('temporal'); + expect(vl.encoding.x2).toMatchObject({ field: '__cell_x_end' }); + }); + + it('describes each cell on its own month, west of UTC too', () => { + const input = heatmap(); + input.chart_spec.chartProperties = { xAxisType: 'temporal' }; + const vl = assembleVegaLite(input) as any; expect(vl.encoding.x.scale.type).toBe('utc'); const marks = JSON.stringify((compile(vl).spec as any).marks); const description = marks.slice(marks.indexOf('"description"'), marks.indexOf('"description"') + 300); @@ -88,10 +97,13 @@ describe('calendar dates read as UTC', () => { describe('quantized key under a theme', () => { it('runs long enough to print every bin edge', () => { const vl = assembleVegaLite(heatmap({ theme: 'economist' })) as any; - expect(vl.encoding.color.scale.type).toBe('quantize'); - const bins = vl.encoding.color.scale.range.length; - // Each of the edges needs room for a label like "−32,341" at the key's font. - const perLabel = 7 * 0.55 * vl.config.legend.labelFontSize; + const scale = vl.encoding.color.scale; + expect(scale.type).toBe('threshold'); + const bins = scale.range.length; + // Each class needs room for its edge's label, as the key prints it (compacted where full ones would not fit). + const print = format(vl.encoding.color.legend.format ?? ','); + const widest = Math.max(...scale.domain.map((edge: number) => print(edge).length)); + const perLabel = widest * 0.55 * vl.config.legend.labelFontSize; expect(vl.config.legend.gradientLength).toBeGreaterThanOrEqual(bins * perLabel); }); }); diff --git a/packages/flint-js/tests/heatmap-time-cells.test.ts b/packages/flint-js/tests/heatmap-time-cells.test.ts new file mode 100644 index 00000000..3a2aafdd --- /dev/null +++ b/packages/flint-js/tests/heatmap-time-cells.test.ts @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { parse, View } from 'vega'; +import { compile } from 'vega-lite'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { calendarStep, dateCadence } from '../src/core/decisions'; + +/** + * A heatmap's cells tile, however many months run along its side. Past the count a row of + * equal bands can name, the months stand on a time scale; there each cell spans its month, so + * neighbours meet whatever the month's length, and a house's bar thickness never thins the rows. + */ + +const months = (count: number, from = Date.UTC(2021, 6, 1)) => Array.from({ length: count }, (_, i) => { + const d = new Date(from); + d.setUTCMonth(d.getUTCMonth() + i); + return d.toISOString().slice(0, 7); +}); + +const heatmap = (periods: string[], extra: Record = {}) => assembleVegaLite({ + data: { values: periods.flatMap((period, m) => ['Alpha', 'Beta', 'Gamma'].map((game, g) => ({ period, game, net: ((m * 7 + g * 5) % 19) - 9 }))) }, + semantic_types: { period: 'YearMonth', game: 'Category', net: 'Profit' }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'period', y: 'game', color: { field: 'net', aggregate: 'sum' } }, ...extra }, + theme_spec: 'economist', +} as any); + +const silent = { warn() {}, info() {}, debug() {}, error() {}, level() { return this; } } as any; + +/** The cells as drawn: the rect mark with the most items. */ +async function drawn(spec: any) { + const view = new View(parse(compile(spec, { logger: silent }).spec), { renderer: 'none' }); + view.logger(silent); + await view.runAsync(); + const marks: any[] = []; + const walk = (node: any) => { + if (!node) return; + if (node.role === 'mark' && (node.marktype === 'rect' || node.marktype === 'text')) marks.push(node); + for (const item of node.items ?? []) walk(item); + }; + walk((view.scenegraph() as any).root); + const largest = (type: string) => marks.filter((m) => m.marktype === type).sort((a, b) => b.items.length - a.items.length)[0]?.items ?? []; + const cells = largest('rect'); + const top = Math.min(...cells.map((c: any) => c.y)); + const row = cells.filter((c: any) => Math.abs(c.y - top) < 0.01).sort((a: any, b: any) => a.x - b.x); + const rows = [...new Set(cells.map((c: any) => Math.round(c.y * 100) / 100))].sort((a: number, b: number) => a - b); + return { cells, row, rows, labels: largest('text'), width: view.signal('width') as number }; +} + +describe('a heatmap along a long run of months', () => { + it('puts more than fifty months on a time scale, the case the cells must tile on', () => { + const spec: any = heatmap(months(54)); + expect(spec.encoding.x.type).toBe('temporal'); + }); + + it('spans each cell to the end of its month, so neighbours meet', async () => { + const { row, width } = await drawn(heatmap(months(54))); + expect(row).toHaveLength(54); + for (let i = 1; i < row.length; i++) expect(row[i].x).toBeCloseTo(row[i - 1].x + row[i - 1].width, 6); + // The cells run the plot's whole width: the scale is the first month to the last month's end. + expect(row[row.length - 1].x + row[row.length - 1].width - row[0].x).toBeCloseTo(width, 6); + }); + + it('draws a month the length it is: February narrower than March', async () => { + const { row } = await drawn(heatmap(months(54))); + const feb = row[7], mar = row[8]; // July 2021 + 7 = February 2022 + expect(feb.width).toBeLessThan(mar.width); + }); + + it('leaves a missing month empty rather than stretching its neighbours over it', async () => { + const periods = months(54).filter((_, i) => i !== 20); + const { row } = await drawn(heatmap(periods)); + const gaps = row.slice(1).map((c: any, i: number) => c.x - (row[i].x + row[i].width)); + expect(gaps.filter((gap: number) => gap > 1)).toHaveLength(1); + }); + + it('keeps the house bar thickness off the rows: they fill their step', async () => { + const { cells, rows } = await drawn(heatmap(months(54))); + expect(cells[0].height).toBeCloseTo(rows[1] - rows[0], 6); + }); + + it('stands each value label at the middle of its cell', async () => { + const { row, labels } = await drawn(heatmap(months(54), { chartProperties: { showValueLabels: true } })); + for (const cell of row.slice(0, 12)) { + const label = labels.find((t: any) => Math.abs(t.y - (cell.y + cell.height / 2)) < 1 && Math.abs(t.x - (cell.x + cell.width / 2)) < cell.width / 2); + expect(label).toBeDefined(); + expect(label.x).toBeCloseTo(cell.x + cell.width / 2, 6); + } + }); + + it('still plans its time ticks on a UTC scale', () => { + const spec: any = heatmap(months(54)); + expect(spec.encoding.x.scale.type).toBe('utc'); + expect(spec.encoding.x.axis.values.length).toBeGreaterThan(0); + expect(spec.encoding.x.scale.domain).toBeUndefined(); + }); + + it('keeps a measured range a bar: a bullet chart\'s zones still take the house band', () => { + // The theme's band rule still thins rects that run a value range from x to x2. + const spec: any = assembleVegaLite({ + data: { values: [{ metric: 'Revenue', actual: 70, target: 80, poor: 40, ok: 70, good: 100 }] }, + semantic_types: { metric: 'Category', actual: 'Quantity', target: 'Quantity', poor: 'Quantity', ok: 'Quantity', good: 'Quantity' }, + chart_spec: { chartType: 'Bullet Chart', encodings: { y: 'metric', x: 'actual', goal: 'target' } }, + theme_spec: 'economist', + } as any); + const zones: any[] = []; + const walk = (node: any) => { + if (!node || typeof node !== 'object') return; + const mark = typeof node.mark === 'string' ? node.mark : node.mark?.type; + if (mark === 'rect' && node.encoding?.x2) zones.push(node); + for (const value of Object.values(node)) walk(value); + }; + walk(spec); + expect(zones.length).toBeGreaterThan(0); + for (const zone of zones) expect(zone.encoding.y?.scale?.paddingInner ?? spec.encoding?.y?.scale?.paddingInner).toBeGreaterThan(0); + }); +}); + +const DAY = 86_400_000; +/** Dates as the rows hold them, read as Date whatever their form (a field may hold timestamps). */ +const dated = (values: (string | number)[], type = 'Date') => assembleVegaLite({ + data: { values: values.flatMap((when, m) => ['Alpha', 'Beta', 'Gamma'].map((game, g) => ({ when, game, net: ((m * 7 + g * 5) % 19) - 9 }))) }, + semantic_types: { when: type, game: 'Category', net: 'Profit' }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'when', y: 'game', color: { field: 'net', aggregate: 'sum' } } }, +} as any); +const tiles = (row: any[]) => row.slice(1).every((cell: any, i: number) => Math.abs(cell.x - (row[i].x + row[i].width)) < 1e-6); +const monthEnds = (count: number) => Array.from({ length: count }, (_, i) => new Date(Date.UTC(2020, i + 1, 0)).toISOString().slice(0, 10)); +const fortnightly = Array.from({ length: 80 }, (_, i) => new Date(Date.UTC(2016, 0, 1) + Math.floor(i * (365 * 3 / 80)) * DAY).toISOString().slice(0, 10)); + +describe('the period each date on a heatmap stands for', () => { + const times = (values: string[]) => values.map((v) => Date.parse(v)); + + it('reads months whatever the day: month ends, the 5th, quarter ends', () => { + expect(dateCadence(times(monthEnds(24)))).toMatchObject({ months: 1, count: 24, periods: 24 }); + expect(dateCadence(times(Array.from({ length: 12 }, (_, i) => `2024-${String(i + 1).padStart(2, '0')}-05`)))).toMatchObject({ months: 1 }); + expect(dateCadence(times(['2023-03-31', '2023-06-30', '2023-09-30', '2023-12-31']))).toMatchObject({ months: 3 }); + // Days a month apart only across a month's turn are days, not months. + expect(dateCadence(times(['2024-01-31', '2024-02-01', '2024-03-02']))?.months).toBeUndefined(); + }); + + it('reads an exact step in days or hours, and about one where the days drift', () => { + expect(dateCadence(times(['2024-01-01', '2024-01-02', '2024-01-05']))).toMatchObject({ ms: DAY, exact: true }); + expect(dateCadence(times(['2024-03-01T00:00:00Z', '2024-03-01T01:00:00Z', '2024-03-01T03:00:00Z']))).toMatchObject({ ms: 3_600_000, exact: true }); + expect(dateCadence(times(fortnightly))).toMatchObject({ ms: 14 * DAY, exact: false }); + const twiceAMonth = Array.from({ length: 6 }, (_, i) => [`2024-0${i + 1}-01`, `2024-0${i + 1}-15`]).flat(); + expect(dateCadence(times(twiceAMonth))).toMatchObject({ exact: false }); + }); + + it('tiles month ends as months: each moves to its month\'s start and spans it', async () => { + const spec: any = dated(monthEnds(60)); + expect(spec.encoding.x.type).toBe('temporal'); + expect(spec.transform).toEqual(expect.arrayContaining([expect.objectContaining({ as: 'when' })])); + const { row } = await drawn(spec); + expect(row).toHaveLength(60); + expect(tiles(row)).toBe(true); + }); + + it('tiles dates 13 or 14 days apart: each cell runs to the next date', async () => { + const { row } = await drawn(dated(fortnightly)); + expect(row).toHaveLength(80); + expect(tiles(row)).toBe(true); + expect(Math.min(...row.map((c: any) => c.width))).toBeGreaterThan(1); + }); + + it('tiles timestamps a day apart at a time of day', async () => { + const stamps = Array.from({ length: 60 }, (_, i) => new Date(Date.UTC(2024, 0, 1) + i * DAY + 9.5 * 3_600_000).toISOString()); + const { row } = await drawn(dated(stamps, 'DateTime')); + expect(row).toHaveLength(60); + expect(tiles(row)).toBe(true); + }); + + it('names the cells\' end column after the axis, not as a working column', () => { + const spec: any = dated(monthEnds(60)); + expect(spec.encoding.x2.title).toBe('when'); + }); +}); + +describe('calendar steps', () => { + it('reads months, quarters and days, and nothing off the calendar', () => { + expect(calendarStep(months(6))).toEqual({ unit: 'month', step: 1 }); + expect(calendarStep(['2024-01', '2024-04', '2024-07', '2024-10'])).toEqual({ unit: 'month', step: 3 }); + expect(calendarStep(['2024-01-01', '2024-01-02', '2024-01-04'])).toEqual({ unit: 'day', step: 1 }); + expect(calendarStep(['2024-01-01T10:30:00Z', '2024-01-01T11:30:00Z'])).toBeUndefined(); + expect(calendarStep(['2024-01-31', '2024-02-29', '2024-03-31'])).toEqual({ unit: 'month', step: 1 }); + }); +}); diff --git a/packages/flint-js/tests/host-background.test.ts b/packages/flint-js/tests/host-background.test.ts new file mode 100644 index 00000000..c5fbdfe9 --- /dev/null +++ b/packages/flint-js/tests/host-background.test.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { renderSvg } from '../src/render'; + +/** + * A chart with no theme draws on the host's background: Vega-Lite states white in every spec it + * compiles, which outranked the background a host handed the renderer. A house keeps its canvas. + */ + +const input = (extra: Record = {}): any => ({ + data: { values: [{ x: 'A', y: 1 }, { x: 'B', y: 2 }] }, + semantic_types: { x: 'Category', y: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'x', y: 'y' } }, + ...extra, +}); + +/** The fill of the rectangle Vega paints the canvas with, or undefined where it paints none. */ +const canvasFill = (svg: string) => /^]*>\s*]*fill="([^"]+)"/.exec(svg)?.[1]; + +describe('the background a chart draws on', () => { + it('is the host’s where no theme sets one', async () => { + expect((assembleVegaLite(input({ options: { background: '#1e1e1e' } })) as any).background).toBe('#1e1e1e'); + expect((assembleVegaLite(input()) as any).background).toBeUndefined(); + expect(canvasFill(await renderSvg(input(), { background: '#1e1e1e' }))).toBe('#1e1e1e'); + // The input's own option outranks the renderer's. + expect(canvasFill(await renderSvg(input({ options: { background: '#abcdef' } }), { background: '#1e1e1e' }))).toBe('#abcdef'); + }); + + it('stays a house’s own canvas, and follows the host where the house defers to it', async () => { + const themed = assembleVegaLite(input({ theme_spec: 'bbc' })) as any; + const withHost = assembleVegaLite(input({ theme_spec: 'bbc', options: { background: '#1e1e1e' } })) as any; + expect(withHost.background).toBe(themed.background); + expect(canvasFill(await renderSvg(input({ theme_spec: 'bbc' }), { background: '#1e1e1e' }))).toBe(themed.background); + // nyt's surface is the host's (`ink.surface.source: 'host'`). + expect(canvasFill(await renderSvg(input({ theme_spec: 'nyt' }), { background: '#1e1e1e' }))).toBe('#1e1e1e'); + }); +}); diff --git a/packages/flint-js/tests/interaction-admission.test.ts b/packages/flint-js/tests/interaction-admission.test.ts index 2346eafd..608ea2f7 100644 --- a/packages/flint-js/tests/interaction-admission.test.ts +++ b/packages/flint-js/tests/interaction-admission.test.ts @@ -5,6 +5,7 @@ import { brushAngle, brushX, brushY, clickHighlight, dragReorder, isCanvasIntera import type { CanvasInteractionDef } from '../src/interactive/interactions'; import type { InteractionEntry } from '../src/core/interaction-spec'; import { addVegaLiteInteractions } from '../src/vegalite/interactions/compile'; +import { baselineInteractions } from '../src/vegalite/interactions/baseline'; import { assembleVegaLite } from '../src/vegalite/assemble'; /** A Cartesian chart with elements, a region, a legend, and one navigable axis. */ @@ -68,6 +69,20 @@ describe('admitInteractions', () => { expect(result.warnings[0]).toMatchObject({ code: 'unsupported_interaction' }); }); + it('the baseline legend dim gives way, silently, to a legend click the spec asks for', () => { + const baseline = baselineInteractions(CARTESIAN, undefined); + expect(ids(baseline)).toEqual(['flint-legend-dim']); + const result = admitInteractions(CARTESIAN, [...fromSpec([{ type: 'legend-toggle' }]), ...baseline]); + expect(ids(result.admitted)).toEqual(['legend-toggle']); + expect(result.warnings).toEqual([]); + }); + + it('has no baseline on a chart without a legend, or when the spec turns it off', () => { + expect(baselineInteractions(NO_SEMANTICS, undefined)).toEqual([]); + expect(baselineInteractions(CARTESIAN, false)).toEqual([]); + expect(baselineInteractions(CARTESIAN, { legend: false })).toEqual([]); + }); + it('keeps one navigation interaction: a second spec navigate yields, a second code navigate throws', () => { const spec = admitInteractions(CARTESIAN, fromSpec([{ type: 'navigate' }, { type: 'navigate', id: 'again' }])); expect(ids(spec.admitted)).toEqual(['navigate']); diff --git a/packages/flint-js/tests/interaction-spec.test.ts b/packages/flint-js/tests/interaction-spec.test.ts index a2c7a996..50774fce 100644 --- a/packages/flint-js/tests/interaction-spec.test.ts +++ b/packages/flint-js/tests/interaction-spec.test.ts @@ -53,6 +53,13 @@ describe('interaction preset registry', () => { }); describe('resolveInteractionSpec', () => { + it('reads defaults as a boolean or per behaviour, and refuses pan and zoom as a default', () => { + expect(resolveInteractionSpec({ interactions: [], defaults: false }).surface.defaults).toBe(false); + expect(resolveInteractionSpec({ interactions: [], defaults: { legend: false } }).surface.defaults).toEqual({ legend: false }); + expect(() => resolveInteractionSpec({ interactions: [], defaults: { navigate: false } } as never)) + .toThrow('interaction_spec.defaults must be true, false, or { tooltip?, legend? } of booleans.'); + }); + it('returns nothing for an absent spec', () => { const resolved = resolveInteractionSpec(undefined); expect(resolved.interactions).toEqual([]); diff --git a/packages/flint-js/tests/interactions.test.ts b/packages/flint-js/tests/interactions.test.ts index 68b38571..8b9fe01a 100644 --- a/packages/flint-js/tests/interactions.test.ts +++ b/packages/flint-js/tests/interactions.test.ts @@ -111,19 +111,16 @@ import { targetFeedbackEntries, targetFeedbackPoint, } from '../src/vegalite/interactions/presentation/target-feedback-overlay'; -import { inspectGuideLine, inspectGuideValueLabelPosition } from '../src/vegalite/interactions/presentation/inspect-guide-overlay'; +import { inspectGuideLine, inspectGuidePanels, inspectGuideValueLabelPosition, inspectValuePanel } from '../src/vegalite/interactions/presentation/inspect-guide-overlay'; +import { regionPanelBoxes } from '../src/vegalite/interactions/presentation/markup-overlay'; import { annotationFacingEdges, annotationLeaderPorts, routeAnnotationLeaders, } from '../src/vegalite/interactions/presentation/annotation-leader-routing'; import { - annotationCandidateAngles, annotationItem, - annotationObstacleOverlapCost, - annotationObstacleTier, annotationSourceBounds, - sourceEdgeAttachment, isAnnotationSourceItem, isAnnotationObstacle, segmentMidpointConnectionPoint, @@ -163,7 +160,7 @@ function annotationUpdate( return { id: 'test-annotation', ops: [{ - op: 'set-annotation' as const, + op: 'annotate-text' as const, target: { visual, elements: [element] }, value: text === undefined ? {} : { text }, }], @@ -462,7 +459,7 @@ describe('public chart updates', () => { targets: [target, { select: { key: { Country: 'Japan' } } }], value: { state: 'emphasized', mutedOpacity: 0.25 }, }, { - op: 'set-annotation', target, value: { text: 'Selected' }, + op: 'annotate-text', target, value: { text: 'Selected' }, }, { op: 'set-viewport', axes: 'x', value: { x: [0, 10] }, }, { @@ -473,7 +470,7 @@ describe('public chart updates', () => { targets: [target, { select: { key: { Country: 'Japan' } } }], value: { state: 'emphasized', mutedOpacity: 0.25 }, }, { - op: 'set-annotation', target, value: { text: 'Selected' }, + op: 'annotate-text', target, value: { text: 'Selected' }, }, { op: 'set-viewport', axes: 'x', value: { x: [0, 10] }, }, { @@ -908,7 +905,7 @@ describe('interaction definitions', () => { elements: [{ value: { axis: 'x', field: 'Category', value: 'A' } }], }, ], - value: { state: 'emphasized', opacity: 1 }, + value: { state: 'emphasized', opacity: 1, mutedOpacity: 0.25 }, }, { op: 'set-freeform-overlay', @@ -1812,7 +1809,7 @@ describe('interaction definitions', () => { id: 'click-annotate', ops: [ { - op: 'set-annotation', + op: 'annotate-text', target: { visual: target.visual, elements: target.elements }, value: {}, }, @@ -1825,7 +1822,7 @@ describe('interaction definitions', () => { expect(semanticUpdate(interaction, null, context)).toEqual({ id: 'click-annotate', ops: [ - { op: 'set-annotation', target: { select: { key: {} } }, value: null }, + { op: 'annotate-text', target: { select: { key: {} } }, value: null }, { op: 'set-style', targets: [], value: { state: 'normal' } }, ], }); @@ -1848,7 +1845,7 @@ describe('interaction definitions', () => { categoryField: 'task', seriesField: 'phase', })?.ops[0]).toMatchObject({ - op: 'set-annotation', + op: 'annotate-text', }); expect(semanticUpdate(interaction, target, { chartType: 'Gantt Chart', selected: [], categoryField: 'task', seriesField: 'phase', @@ -1870,7 +1867,7 @@ describe('interaction definitions', () => { )).toEqual({ id: 'test-annotation', ops: [{ - op: 'set-annotation', + op: 'annotate-text', target: { visual: { kind: 'mark', role: 'test' }, elements: [element] }, value: { text: '1.4', @@ -1894,7 +1891,7 @@ describe('interaction definitions', () => { annotationUpdate(element), { chartType: 'Strip Plot', selected: [], categoryField: 'Species' }, ).ops[0]).toMatchObject({ - op: 'set-annotation', + op: 'annotate-text', value: { text: '1.4' }, }); }); @@ -1932,7 +1929,7 @@ describe('interaction definitions', () => { annotationUpdate(element), { chartType: 'Histogram', selected: [] }, ).ops[0]).toMatchObject({ - op: 'set-annotation', + op: 'annotate-text', value: { text: '8', candidates: [{ connection: 'value-end' }] }, }); }); @@ -1950,29 +1947,17 @@ describe('interaction definitions', () => { annotationUpdate(element), { chartType: 'Histogram', selected: [] }, ).ops[0]).toEqual({ - op: 'set-annotation', + op: 'annotate-text', target: { visual: { kind: 'mark', role: 'test' }, elements: [element] }, value: { text: '9', subject: { kind: 'mark', role: 'test' }, candidates: [ - { connection: 'value-end', valueAxis: 'y', priority: 0 }, - { - connection: 'value-side', - valueAxis: 'y', - crossSide: 'start', - valueInset: 1 / 8, - priority: 1, - }, - { - connection: 'value-side', - valueAxis: 'y', - crossSide: 'end', - valueInset: 1 / 8, - priority: 1, - }, - { connection: 'top', priority: 2 }, - { connection: 'bottom', priority: 2 }, + { connection: 'value-end', valueAxis: 'y' }, + { connection: 'value-side', valueAxis: 'y', crossSide: 'start', valueInset: 1 / 8 }, + { connection: 'value-side', valueAxis: 'y', crossSide: 'end', valueInset: 1 / 8 }, + { connection: 'top' }, + { connection: 'bottom' }, ], }, }); @@ -2027,9 +2012,9 @@ describe('interaction definitions', () => { value: { text: '37', candidates: [ - { connection: 'value-end', valueAxis: 'y', anglePreference: 'oblique', priority: 0 }, - { connection: 'right', anglePreference: 'oblique', priority: 1 }, - { connection: 'left', anglePreference: 'oblique', priority: 2 }, + { connection: 'value-end', valueAxis: 'y' }, + { connection: 'right' }, + { connection: 'left' }, ], }, }); @@ -2054,9 +2039,9 @@ describe('interaction definitions', () => { value: { text: '2,536 → 5,773', candidates: [ - { connection: 'value-end', valueAxis: 'y', priority: 0 }, - { connection: 'value-side', valueAxis: 'y', crossSide: 'start', valueInset: 1 / 2, priority: 1 }, - { connection: 'value-side', valueAxis: 'y', crossSide: 'end', valueInset: 1 / 2, priority: 1 }, + { connection: 'value-end', valueAxis: 'y' }, + { connection: 'value-side', valueAxis: 'y', crossSide: 'start', valueInset: 1 / 2 }, + { connection: 'value-side', valueAxis: 'y', crossSide: 'end', valueInset: 1 / 2 }, ], }, }); @@ -2069,31 +2054,6 @@ describe('interaction definitions', () => { expect(isAnnotationObstacle({ mark: { role: 'mark', marktype: 'rule' } })).toBe(true); }); - it('excludes the stem direction from lollipop leader angles', () => { - const stemDirection = Math.PI * 1.5; - const angles = annotationCandidateAngles(stemDirection, 'oblique'); - - expect(angles).toHaveLength(4); - expect(angles.every((angle) => Math.abs(angle - stemDirection) > 0.001)).toBe(true); - }); - - it('searches the full circle for normal edge-target annotations', () => { - const preferred = Math.PI / 3; - const angles = annotationCandidateAngles(preferred); - - expect(angles).toHaveLength(12); - expect(angles.some((angle) => Math.abs(angle - (preferred + Math.PI)) < 1e-10)).toBe(true); - }); - - it('ranks legend, solid, and dimmed annotation obstacles', () => { - expect(annotationObstacleTier({ mark: { role: 'legend-label' }, opacity: 0.25 })).toBe(3); - expect(annotationObstacleTier({ mark: { role: 'axis-label' }, opacity: 1 })).toBe(3); - expect(annotationObstacleTier({ mark: { role: 'mark' }, opacity: 1 })).toBe(2); - expect(annotationObstacleTier({ mark: { role: 'mark' }, opacity: 0.25 })).toBe(1); - expect(annotationObstacleOverlapCost(1, 10)).toBeLessThan(annotationObstacleOverlapCost(2, 10)); - expect(annotationObstacleOverlapCost(2, 10)).toBeLessThan(annotationObstacleOverlapCost(3, 10)); - }); - describe('annotation leader routing', () => { const card = { left: 100, top: 100, width: 120, height: 80 }; @@ -2144,14 +2104,6 @@ describe('interaction definitions', () => { expect(first).toHaveLength(sources.length); expect(new Set(first.map((route) => `${route.port.x},${route.port.y}`)).size).toBe(sources.length); }); - - it('avoids the top-middle of a rectangular source mark', () => { - const source = { left: 240, top: 144, width: 32, height: 52 }; - const upperLeftCard = { left: 20, top: 40, width: 270, height: 66 }; - - expect(sourceEdgeAttachment(source, upperLeftCard, 'top', { x: 256, y: 144 })) - .toEqual({ x: 248, y: 144 }); - }); }); it('finds the point of the row a segment annotation names, only with anchor: point', () => { @@ -2231,7 +2183,7 @@ describe('interaction definitions', () => { expect((semantics.presentUpdate!( annotationUpdate(pathElement, { kind: 'path', role: 'line' }), { chartType: 'Line Chart', selected: [] }, - ).ops[0] as any).value.candidates[0]).toEqual({ connection: 'segment-midpoint', priority: 0 }); + ).ops[0] as any).value.candidates[0]).toEqual({ connection: 'segment-midpoint' }); expect(semantics.presentUpdate!( annotationUpdate(pointElement, { kind: 'mark', role: 'symbol' }), { chartType: 'Line Chart', selected: [] }, @@ -2239,7 +2191,7 @@ describe('interaction definitions', () => { expect((semantics.presentUpdate!( annotationUpdate(pointElement, { kind: 'mark', role: 'symbol' }), { chartType: 'Line Chart', selected: [] }, - ).ops[0] as any).value.candidates[0]).toEqual({ connection: 'center', priority: 0 }); + ).ops[0] as any).value.candidates[0]).toEqual({ connection: 'center' }); }); it('gives connected-scatter paths transitions and vertices single-value glyph presentation', () => { @@ -2268,9 +2220,9 @@ describe('interaction definitions', () => { ); expect(pathUpdate.ops[0]).toMatchObject({ value: { text: '2.14 → 2.53' } }); - expect((pathUpdate.ops[0] as any).value.candidates[0]).toEqual({ connection: 'segment-midpoint', priority: 0 }); + expect((pathUpdate.ops[0] as any).value.candidates[0]).toEqual({ connection: 'segment-midpoint' }); expect(pointUpdate.ops[0]).toMatchObject({ value: { text: '2.14' } }); - expect((pointUpdate.ops[0] as any).value.candidates[0]).toEqual({ connection: 'center', priority: 0 }); + expect((pointUpdate.ops[0] as any).value.candidates[0]).toEqual({ connection: 'center' }); }); it('resolves a path-suffixed annotation key to segment geometry instead of its point glyph', () => { @@ -2497,16 +2449,16 @@ describe('interaction definitions', () => { ); expect(update.ops[0]).toMatchObject({ - op: 'set-annotation', + op: 'annotate-text', value: { candidates: [{ connection }] }, }); }); it('lets a ChartDef offer an ordered space of annotation connections', () => { expect(annotationCandidates('value-end', 'center', 'top')).toEqual([ - { connection: 'value-end', priority: 0 }, - { connection: 'center', priority: 1 }, - { connection: 'top', priority: 2 }, + { connection: 'value-end' }, + { connection: 'center' }, + { connection: 'top' }, ]); }); }); @@ -2711,6 +2663,34 @@ describe('assisted, keyboard, and lasso acquisition', () => { }); }); + describe('overlays on facet panels', () => { + // Two rows stacked with a 30 px gap, and three columns side by side with 20 px gaps. + const rows = [{ x: 0, y: 0, width: 200, height: 100 }, { x: 0, y: 130, width: 200, height: 100 }]; + const columns = [0, 1, 2].map((index) => ({ x: index * 120, y: 0, width: 100, height: 150 })); + + it('draws an index guide in each panel it crosses, not through the gaps', () => { + expect(inspectGuidePanels(rows, 'x', 60)).toEqual(rows); + expect(inspectGuidePanels(columns, 'x', 150)).toEqual([columns[1]]); + // Snapped into a gap, it keeps to the nearest panel. + expect(inspectGuidePanels(columns, 'x', 104)).toEqual([columns[0]]); + }); + + it('draws a value rule in the panel it was read in', () => { + expect(inspectValuePanel(rows, 'x', 60, 170)).toEqual(rows[1]); + expect(inspectValuePanel(columns, 'x', 150, 40)).toEqual(columns[1]); + }); + + it('shades a region in every panel, from each panel corner and cut at it', () => { + expect(regionPanelBoxes({ x: [20, 500] }, rows).map(({ shaded }) => shaded)).toEqual([ + { x: 20, y: 0, width: 180, height: 100 }, + { x: 20, y: 130, width: 180, height: 100 }, + ]); + expect(regionPanelBoxes({ y: [50, 80] }, columns).map(({ shaded }) => shaded)).toEqual( + columns.map((panel) => ({ x: panel.x, y: 50, width: 100, height: 30 })), + ); + }); + }); + it('draws a polar inspection guide from center to outer radius', () => { const frame = { center: { x: 100, y: 80 }, outerRadius: 60 }; @@ -2823,7 +2803,7 @@ describe('assisted, keyboard, and lasso acquisition', () => { op: 'set-style', }); expect(clickAnnotate().handle!(activation, context)?.ops[0]).toMatchObject({ - op: 'set-annotation', + op: 'annotate-text', }); }); }); @@ -2990,7 +2970,7 @@ describe('effective annotation composition', () => { const annotation = (id: string, category: string) => ({ id, ops: [{ - op: 'set-annotation' as const, + op: 'annotate-text' as const, target: target(category), value: { text: category, candidates: [{ connection: 'top' as const }] }, }], @@ -3011,7 +2991,7 @@ describe('effective annotation composition', () => { expect(effectiveAnnotationEntries([{ id: retained.id, ops: [...retained.ops, { - op: 'set-annotation' as const, + op: 'annotate-text' as const, target: target('A'), value: null, }], @@ -3702,13 +3682,13 @@ describe('retained viewport precedence', () => { { op: 'set-viewport', axes: 'x', value: { x: [2, 3] } }, { op: 'set-style', targets: [], value: { state: 'emphasized' } }, ] }], - ['note', { id: 'note', ops: [{ op: 'set-annotation', target: { select: { key: { a: 1 } } }, value: { text: 'x' } }] }], + ['note', { id: 'note', ops: [{ op: 'annotate-text', target: { select: { key: { a: 1 } } }, value: { text: 'x' } }] }], ]); supersedeRetainedViewports(retained, 'host-reset'); // The viewport-only update goes; the mixed one keeps its other ops. expect(retained.has('navigate')).toBe(false); expect(retained.get('report')?.ops.map((op) => op.op)).toEqual(['set-style']); - expect(retained.get('note')?.ops.map((op) => op.op)).toEqual(['set-annotation']); + expect(retained.get('note')?.ops.map((op) => op.op)).toEqual(['annotate-text']); // The update being stored is left alone. retained.set('host-reset', { id: 'host-reset', ops: [{ op: 'set-viewport', axes: 'xy', value: {} }] }); supersedeRetainedViewports(retained, 'host-reset'); diff --git a/packages/flint-js/tests/key-preferences.test.ts b/packages/flint-js/tests/key-preferences.test.ts index 17e37337..c1789d54 100644 --- a/packages/flint-js/tests/key-preferences.test.ts +++ b/packages/flint-js/tests/key-preferences.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import { planKeyLayout, type KeyToLayout } from '../src/core/legend-layout'; import { tableTextMeasurer } from '../src/core/text-width'; +import { assembleVegaLite } from '../src/vegalite/assemble'; const style = { labelFont: 'Helvetica', labelFontSize: 10, labelFontWeight: 'normal', labelFontStyle: 'normal', @@ -54,3 +55,30 @@ describe('keys sharing an edge, counted in the room they take', () => { expect(large.keys[1]?.orient).toBe('right'); }); }); + +describe('a key its author pins to an edge', () => { + it('stands on that edge in the Vega-Lite it compiles to, not on the right', () => { + const rows = [600, 528, 46, 45, 1].map((Crew, i) => ({ Stop: i + 1, Crew, Leg: ['A', 'A', 'B', 'C', 'C'][i], longitude: 10 + i * 3, latitude: 35 + i })); + const spec: any = assembleVegaLite({ + data: { values: rows }, + semantic_types: { Stop: 'Rank', Crew: 'Count', Leg: 'Category', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { + chartType: 'Map', + encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', + color: { field: 'Leg', legend: { orient: 'bottom' } }, size: { field: 'Crew', legend: { orient: 'bottom' } } }, + canvasSize: { width: 600, height: 540 }, + }, + } as any); + const orients: string[] = []; + const walk = (node: any) => { + for (const channel of ['color', 'size', 'strokeWidth']) { + const legend = node?.encoding?.[channel]?.legend; + if (legend && node.encoding[channel].field) orients.push(legend.orient); + } + (node?.layer ?? []).forEach(walk); + }; + walk(spec); + expect(orients.length).toBeGreaterThan(0); + expect(new Set(orients)).toEqual(new Set(['bottom'])); + }); +}); diff --git a/packages/flint-js/tests/label-sequence.test.ts b/packages/flint-js/tests/label-sequence.test.ts new file mode 100644 index 00000000..f7a5316a --- /dev/null +++ b/packages/flint-js/tests/label-sequence.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, it } from 'vitest'; +import { onRoundInterval } from '../src/core/label-sequence'; + +describe('onRoundInterval', () => { + it('carries a thinning read on a window to every name on the same interval', () => { + const years = Array.from({ length: 30 }, (_, index) => String(1880 + index)); + expect(onRoundInterval('year', ['1880', '1885', '1890'], years)) + .toEqual(['1880', '1885', '1890', '1895', '1900', '1905']); + expect(onRoundInterval('year', ['1880'], years)).toBeUndefined(); + }); +}); diff --git a/packages/flint-js/tests/live-values.test.ts b/packages/flint-js/tests/live-values.test.ts index b07f85b1..12013f07 100644 --- a/packages/flint-js/tests/live-values.test.ts +++ b/packages/flint-js/tests/live-values.test.ts @@ -39,6 +39,22 @@ async function svgOf(view: View): Promise { (run.match(/<(?:line|path|text) [^>]*\/>|]*>[^<]*<\/text>/g) ?? []).sort().join('')); } +/** + * The SVG's root frame — its size and the origin of the chart in it — apart from what it frames. + * A pushed view lays out its origin by its guides' bounds before the pushed values re-encode some of + * them (Vega reruns that layout only on a size change), so where a guide shrinks the frame may stand a + * pixel wider than a fresh view's — the drawing within it the same. + */ +function framed(svg: string): { frame: number[]; within: string } { + const frame: number[] = []; + const within = svg.replace(/^(]*?)width="([\d.]+)" height="([\d.]+)" viewBox="0 0 [\d.]+ [\d.]+">]*\/>)(]*?)transform="translate\((-?[\d.]+),(-?[\d.]+)\)"/, + (_, svgOpen, width, height, rect, group, x, y) => { + frame.push(Number(width), Number(height), Number(x), Number(y)); + return `${svgOpen} { @@ -64,11 +80,16 @@ describe('live values', () => { // Vega's typings omit runAsync's optional encode-set argument. await (view as View & { runAsync(encode?: string): Promise }).runAsync('enter'); const fresh = new View(parse(structuredClone(next)), { renderer: 'none' }); - const drawn = await svgOf(view); - const expected = await svgOf(fresh); + const pushedSvg = framed(await svgOf(view)); + const freshSvg = framed(await svgOf(fresh)); + const label = `${type} ${testCase.title ?? ''} ${theme ?? ''}`; + expect(pushedSvg.frame.length, label).toBe(4); + pushedSvg.frame.forEach((value, index) => expect(Math.abs(value - freshSvg.frame[index]!), label).toBeLessThanOrEqual(1)); + const drawn = pushedSvg.within; + const expected = freshSvg.within; let at = 0; while (at < drawn.length && drawn[at] === expected[at]) at += 1; - expect(drawn.slice(at - 120, at + 120), `${type} ${testCase.title ?? ''} ${theme ?? ''}`) + expect(drawn.slice(at - 120, at + 120), label) .toBe(expected.slice(at - 120, at + 120)); view.finalize(); fresh.finalize(); diff --git a/packages/flint-js/tests/map-boundaries.test.ts b/packages/flint-js/tests/map-boundaries.test.ts new file mode 100644 index 00000000..b02b6c5d --- /dev/null +++ b/packages/flint-js/tests/map-boundaries.test.ts @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect, vi } from 'vitest'; +import { existsSync } from 'node:fs'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { renderSvg } from '../src/render'; +import { inlineBoundaries, naturalEarthTopology, usAlbersTopology, worldBankTopology } from '../src/geo'; +import { BOUNDARY_URLS, GEO_VERSION, SITE_GEO, WORLD_BANK_CREDIT } from '../src/chart-types/boundaries'; +import { withBundledBoundaries } from '../src/vegalite/boundary-loader'; +import { readCanvasFurniture } from '../src/vegalite/canvas-furniture'; + +/** + * A map draws the boundaries `chartProperties.boundaries` names: the World Bank's (the default) or + * Natural Earth's, which Flint's renderers serve from the package and `inlineBoundaries` writes into + * a compiled spec; or a file of the chart's own, by URL or inline, read by the ids it says it has + * and credited as it says. + */ + +const choropleth = (rows: Record[], options: Record = {}, properties: Record = {}) => ({ + data: { values: rows }, + semantic_types: { Country: 'Country', State: 'State', Value: 'Percentage' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: { field: Object.keys(rows[0])[0] }, color: { field: 'Value' } }, chartProperties: properties }, + options, +}) as any; +const pointMap = (options: Record = {}, properties: Record = {}) => ({ + data: { values: [{ Lon: -122.3, Lat: 47.6 }, { Lon: -74, Lat: 40.7 }] }, + semantic_types: { Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' }, chartProperties: properties }, + options, +}) as any; + +const urls = (spec: any): string[] => { + const found: string[] = []; + const visit = (node: any) => { + if (!node || typeof node !== 'object') return; + if (typeof node.url === 'string') found.push(node.url); + for (const [key, value] of Object.entries(node)) if (key !== 'values') visit(value); + }; + visit(spec); + return found; +}; + +/** The unit that draws the regions: the one whose colour comes from a field. */ +const regionsOf = (spec: any): any => { + let found: any; + const visit = (node: any) => { + if (!node || typeof node !== 'object' || found) return; + if (node.encoding?.color?.field && node.data) found = node; + for (const key of ['layer', 'vconcat', 'hconcat', 'concat']) if (Array.isArray(node[key])) node[key].forEach(visit); + }; + visit(spec); + return found; +}; +const layerOf = (spec: any, feature: string): any => (spec.layer ?? []).find((layer: any) => layer.data?.format?.feature === feature); +const credit = (spec: any) => readCanvasFurniture(spec).find((item) => item.text?.includes('World Bank')); + +describe('the world’s boundaries', () => { + it('are the World Bank’s by default, coarse for the world and medium for a region, its disputed borders dotted over the regions', () => { + const world: any = assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Brazil', Value: 0.1 }, { Country: 'Japan', Value: 0.2 }])); + expect(regionsOf(world).data.url).toBe(BOUNDARY_URLS.worldBank.coarse); + const disputed = layerOf(world, 'disputed'); + expect(disputed.data.url).toBe(BOUNDARY_URLS.worldBank.coarse); + expect(disputed.mark.strokeDash).toBeDefined(); + expect(world.layer.indexOf(disputed)).toBeGreaterThan(world.layer.indexOf(regionsOf(world))); + const europe: any = assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Germany', Value: 0.1 }])); + expect(regionsOf(europe).data.url).toBe(BOUNDARY_URLS.worldBank.medium); + const points: any = assembleVegaLite({ ...pointMap(), data: { values: [{ Lon: 2.35, Lat: 48.86 }, { Lon: 13.4, Lat: 52.52 }] } }); + expect(points.layer.find((layer: any) => layer.data?.format?.feature === 'countries').data.url).toBe(BOUNDARY_URLS.worldBank.medium); + expect(layerOf(points, 'disputed')).toBeDefined(); + }); + + it('are Natural Earth’s where the chart asks, without disputed borders or a credit', () => { + const spec: any = assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Brazil', Value: 0.1 }], {}, { boundaries: 'natural-earth' })); + expect(regionsOf(spec).data.url).toBe(BOUNDARY_URLS.naturalEarth); + expect(layerOf(spec, 'disputed')).toBeUndefined(); + expect(credit(spec)).toBeUndefined(); + expect(spec._attribution).toBe('Natural Earth'); + }); + + it('credit the World Bank at the map’s foot, linked, with its disclaimer on hover', () => { + const spec: any = assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Brazil', Value: 0.1 }])); + expect(credit(spec)).toEqual(expect.objectContaining({ text: WORLD_BANK_CREDIT.text, href: WORLD_BANK_CREDIT.href, title: WORLD_BANK_CREDIT.title })); + // At the foot's start, the bottom left. + expect(credit(spec)!.left).toBeDefined(); + expect(credit(spec)!.right).toBeUndefined(); + expect(spec._attribution).toMatch(/World Bank/); + // Under the chart's own source line, which keeps its words. + const sourced: any = assembleVegaLite({ ...choropleth([{ Country: 'France', Value: 0.4 }]), chart_spec: { ...choropleth([{ Country: 'France', Value: 0.4 }]).chart_spec, source: 'Eurostat' } }); + const texts = readCanvasFurniture(sourced).map((item) => item.text ?? ''); + expect(texts.some((text) => text.includes('Eurostat'))).toBe(true); + expect(credit(sourced)).toBeDefined(); + // The US maps draw public-domain boundaries: nothing to credit. + expect(credit(assembleVegaLite(choropleth([{ State: 'Texas', Value: 0.4 }])))).toBeUndefined(); + }); + + it('key France’s overseas departments as France', () => { + const countries = (worldBankTopology.coarse as any).objects.countries.geometries; + expect(countries.filter((g: any) => g.id === 250).length).toBeGreaterThan(1); + }); + + it('render to SVG from the package, without the network', async () => { + const fetchSpy = vi.spyOn(globalThis, 'fetch').mockRejectedValue(new Error('offline')); + try { + const svg = await renderSvg(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Brazil', Value: 0.1 }])); + expect(fetchSpy).not.toHaveBeenCalled(); + expect((svg.match(/ { + const all = [BOUNDARY_URLS.worldBank.coarse, BOUNDARY_URLS.worldBank.medium, BOUNDARY_URLS.naturalEarth, BOUNDARY_URLS.usStates, BOUNDARY_URLS.usAlbers]; + + it('name the package’s own files under the current version on Flint’s site', () => { + for (const url of all) { + expect(url.startsWith(`${SITE_GEO}/${GEO_VERSION}/`)).toBe(true); + const file = url.slice(`${SITE_GEO}/${GEO_VERSION}/`.length); + expect(existsSync(new URL(`../src/geo/${file}`, import.meta.url))).toBe(true); + } + }); + + it('are answered from the package, as are the identical files earlier releases named', async () => { + const fetched: string[] = []; + const loader = withBundledBoundaries({ load: async (uri: string) => { fetched.push(uri); throw new Error('offline'); } }); + for (const url of all) await expect(loader.load(url)).resolves.toBeTypeOf('object'); + await expect(loader.load('https://vega.github.io/vega-lite/data/world-110m.json')).resolves.toBe(naturalEarthTopology); + await expect(loader.load('https://cdn.jsdelivr.net/npm/us-atlas@3/counties-albers-10m.json')).resolves.toBe(usAlbersTopology); + expect(fetched).toEqual([]); + // Vega's us-10m.json keys its states by number, unlike the bundled us-atlas file: fetched as named. + await expect(loader.load('https://vega.github.io/vega-lite/data/us-10m.json')).rejects.toThrow('offline'); + }); +}); + +describe('the named boundaries, offline', () => { + it('are written into a compiled spec by inlineBoundaries, which leaves the spec given as it was', () => { + const world: any = assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Brazil', Value: 0.1 }, { Country: 'Japan', Value: 0.2 }])); + const inlined: any = inlineBoundaries(world); + expect(urls(inlined)).toEqual([]); + expect(regionsOf(inlined).data.values === worldBankTopology.coarse).toBe(true); + expect(regionsOf(inlined).data.format).toEqual({ type: 'topojson', feature: 'countries' }); + expect(urls(world)).toContain(BOUNDARY_URLS.worldBank.coarse); + for (const spec of [ + assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }], {}, { boundaries: 'natural-earth' })), + assembleVegaLite(choropleth([{ State: 'Texas', Value: 0.4 }], {}, { level: 'auto' })), + assembleVegaLite(pointMap()), + ] as any[]) { + expect(urls(inlineBoundaries(spec))).toEqual([]); + } + // A file of the chart's own keeps its URL. + const own: any = inlineBoundaries(assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }], {}, { boundaries: { url: '/maps/world.json', feature: 'countries' } }))); + expect(new Set(urls(own))).toEqual(new Set(['/maps/world.json'])); + }); +}); + +describe('a file of the chart’s own', () => { + const joined = (spec: any): any[] => { + const find = (node: any): any => { + for (const transform of node?.transform ?? []) if (transform.lookup) return transform; + for (const layer of node?.layer ?? []) { const found = find(layer); if (found) return found; } + return undefined; + }; + return find(spec)?.from.data.values ?? []; + }; + const rows = [{ Country: 'France', Value: 0.4 }, { Country: 'Brazil', Value: 0.1 }, { Country: 'Japan', Value: 0.2 }]; + + it('is drawn from its URL, or inline, with no named set’s credit or dotted borders', () => { + const byUrl: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { url: '/maps/world.json', feature: 'countries' } })); + expect(regionsOf(byUrl).data).toMatchObject({ url: '/maps/world.json', format: { type: 'topojson', feature: 'countries' } }); + expect(layerOf(byUrl, 'disputed')).toBeUndefined(); + expect(credit(byUrl)).toBeUndefined(); + expect(byUrl._attribution).toBeUndefined(); + const inline: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { values: naturalEarthTopology, feature: 'countries' } })); + expect(urls(inline)).toEqual([]); + expect(regionsOf(inline).data.values === naturalEarthTopology).toBe(true); + const detailed: any = assembleVegaLite(choropleth([{ Country: 'France', Value: 0.4 }, { Country: 'Germany', Value: 0.1 }], {}, { boundaries: { url: { coarse: '/c.json', medium: '/m.json' }, feature: 'countries' } })); + expect(regionsOf(detailed).data.url).toBe('/m.json'); + }); + + it('is credited as its attribution says, and dots the borders it names', () => { + const spec: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { url: '/maps/world.json', feature: 'countries', disputed: 'lines', attribution: 'Survey of India' } })); + expect(spec._attribution).toBe('Survey of India'); + expect(readCanvasFurniture(spec).some((item) => item.text === 'Boundaries: Survey of India')).toBe(true); + expect(layerOf(spec, 'lines').data.url).toBe('/maps/world.json'); + const linked: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { url: '/w.json', feature: 'countries', attribution: { text: 'Map: Ordnance Survey', href: 'https://example.org' } } })); + expect(readCanvasFurniture(linked).find((item) => item.text === 'Map: Ordnance Survey')?.href).toBe('https://example.org'); + }); + + it('joins the rows by the ids it says it has, read from its key', () => { + const numeric: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { url: '/w.json', feature: 'countries' } })); + expect(regionsOf(numeric).transform).toContainEqual({ calculate: 'toNumber(datum["id"])', as: '__geo_key' }); + expect(joined(numeric).map((row) => row.__geo_id).sort((a, b) => a - b)).toEqual([76, 250, 392]); + const alpha3: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { url: '/w.json', feature: 'countries', ids: 'iso3', key: 'properties.iso' } })); + expect(regionsOf(alpha3).transform).toContainEqual({ calculate: 'upper(toString(datum["properties"]["iso"]))', as: '__geo_key' }); + expect(joined(alpha3).map((row) => row.__geo_id).sort()).toEqual(['BRA', 'FRA', 'JPN']); + const alpha2: any = assembleVegaLite(choropleth(rows, {}, { boundaries: { url: '/w.json', feature: 'countries', ids: 'iso2' } })); + expect(joined(alpha2).map((row) => row.__geo_id).sort()).toEqual(['BR', 'FR', 'JP']); + }); + + it('keyed by FIPS draws the US in longitude and latitude, fitted to its shapes', () => { + const spec: any = assembleVegaLite(choropleth([{ State: 'California', Value: 0.4 }, { State: 'Texas', Value: 0.1 }], {}, { boundaries: { url: '/us.json', feature: 'states' } })); + expect(spec.projection).toEqual({ type: 'albersUsa' }); + expect(spec._geoPreProjection).toBeUndefined(); + expect(joined(spec).map((row) => row.__geo_id).sort((a, b) => a - b)).toEqual([6, 48]); + }); + + it('keyed by its own keys joins the rows as given, fitted to its shapes', () => { + const spec: any = assembleVegaLite({ + data: { values: [{ Province: 'GD', Growth: 0.4 }, { Province: 'ZJ', Growth: 0.1 }] }, + semantic_types: { Province: 'Category', Growth: 'Percentage' }, + chart_spec: { + chartType: 'Choropleth', encodings: { id: 'Province', color: 'Growth' }, + chartProperties: { boundaries: { url: '/cn.json', feature: 'provinces', ids: 'as-is', key: 'properties.code' } }, + }, + } as any); + expect(spec.projection).toEqual({ type: 'mercator' }); + expect(spec.data.url).toBe('/cn.json'); + expect(spec.transform).toContainEqual({ calculate: 'toString(datum["properties"]["code"])', as: '__geo_key' }); + expect(joined(spec).map((row) => row.__geo_id).sort()).toEqual(['GD', 'ZJ']); + }); + + it('draws a point map’s land', () => { + const spec: any = assembleVegaLite(pointMap({}, { boundaries: { url: '/w.json', feature: 'countries', attribution: 'Survey of India' } })); + expect(spec.layer.find((layer: any) => layer.data?.url === '/w.json')).toBeDefined(); + expect(spec._attribution).toBe('Survey of India'); + }); + + it('that is malformed, or a name Flint does not ship, falls back to the World Bank’s with a warning', () => { + for (const boundaries of ['ordnance-survey', { feature: 'countries' }, { url: '/w.json', ids: 'iso9' }]) { + const spec: any = assembleVegaLite(choropleth(rows, {}, { boundaries })); + expect(regionsOf(spec).data.url).toBe(BOUNDARY_URLS.worldBank.coarse); + expect((spec._warnings ?? []).some((w: any) => w.code === 'invalid-option-value' && /boundaries/.test(w.message))).toBe(true); + } + }); +}); diff --git a/packages/flint-js/tests/map-frame.test.ts b/packages/flint-js/tests/map-frame.test.ts new file mode 100644 index 00000000..4215b78a --- /dev/null +++ b/packages/flint-js/tests/map-frame.test.ts @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { WORLD_LAND, countryBox, frameOf, longitudeSpan, mapPlotSize, projectedAspect, shapedFrame } from '../src/chart-types/geo-frame'; +import { continentAt, continentOf } from '../src/chart-types/geo-continents'; + +/** + * A map is planned like any other plot: it frames its data, takes the shape that frame projects + * to, and stands inside the box the host gives it. + */ + +const choropleth = (rows: Record[], extra: Record = {}) => assembleVegaLite({ + data: { values: rows }, + semantic_types: { Country: 'Country', State: 'State', Value: 'Percentage' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: { field: Object.keys(rows[0])[0] }, color: { field: 'Value' } }, ...extra }, +} as any) as any; + +const world = ['United States', 'China', 'Brazil', 'Nigeria', 'India', 'Australia'].map((Country, i) => ({ Country, Value: i / 10 })); +const europe = ['France', 'Germany', 'Italy', 'Spain', 'Poland'].map((Country, i) => ({ Country, Value: i / 10 })); + +const fitPoints = (spec: any): [number, number][] => spec.projection.fit.geometry.coordinates; +const geoLayers = (spec: any) => spec.layer.filter((layer: any) => (layer.mark?.type ?? layer.mark) !== 'rect'); +/** The unit drawing the countries: the map itself, or its first layer once it is layered round the regions. */ +const regionsOf = (spec: any): any => (Array.isArray(spec.layer) ? spec.layer.find((layer: any) => layer.encoding?.color?.field) : spec); + +describe('a map in its box', () => { + it('takes the shape of the world’s land, as large as the canvas holds once its key has its room', () => { + const small = choropleth(world, { baseSize: { width: 400, height: 300 }, canvasSize: { width: 600, height: 450 } }); + const large = choropleth(world, { baseSize: { width: 1000, height: 700 }, canvasSize: { width: 1000, height: 700 } }); + const land = projectedAspect(WORLD_LAND, 'equalEarth'); + for (const [spec, canvas] of [[small, 600], [large, 1000]] as const) { + expect(spec.width / spec.height).toBeCloseTo(land, 1); + // The key beside the map takes its room; the map takes the rest of the width. + expect(spec.width).toBeLessThan(canvas); + expect(spec.width).toBeGreaterThan(canvas * 0.8); + } + }); + + it('fills a canvas given alone, with no base size', () => { + const spec = choropleth(world, { canvasSize: { width: 800, height: 500 } }); + expect(spec.width).toBeGreaterThan(640); + expect(spec.width).toBeLessThanOrEqual(800); + }); + + it('stays inside a box smaller than its natural size', () => { + const spec = choropleth(world, { canvasSize: { width: 320, height: 240 } }); + expect(spec.width).toBeLessThanOrEqual(320); + expect(spec.height).toBeLessThanOrEqual(240); + }); + + it('draws the US at its atlas’s shape', () => { + const spec = choropleth([{ State: 'California', Value: 1 }, { State: 'Texas', Value: 2 }]); + expect(spec.width / spec.height).toBeCloseTo(975 / 610, 1); + }); + + it('draws a globe square', () => { + const spec = choropleth(world, { chartProperties: { projection: 'orthographic' } }); + expect(spec.width).toBe(spec.height); + expect(spec.projection.fit).toEqual({ type: 'Sphere' }); + }); +}); + +describe('what a world map frames', () => { + it('frames the region its countries share, and clips the rest of the world to the plot', () => { + const spec = choropleth(europe); + const lons = fitPoints(spec).map(([lon]) => lon); + const lats = fitPoints(spec).map(([, lat]) => lat); + expect(Math.min(...lons)).toBeGreaterThan(-30); + expect(Math.max(...lons)).toBeLessThan(45); + expect(Math.min(...lats)).toBeGreaterThan(20); + expect(regionsOf(spec).mark.clip).toBe(true); + // The dotted borders are clipped with the countries; a frame of water and a neatline close the cut. + expect(geoLayers(spec).every((layer: any) => layer.mark.clip === true)).toBe(true); + const rects = spec.layer.filter((layer: any) => layer.mark?.type === 'rect'); + expect(rects).toHaveLength(2); + expect(spec.layer[0]).toBe(rects[0]); + expect(spec.layer[spec.layer.length - 1].mark.stroke).toBeDefined(); + // Drawn in a projection of its own, centred on Europe. + expect(spec.projection.type).toBe('conicEqualArea'); + expect(spec.projection.rotate[0]).toBeLessThan(0); + expect(spec.projection.parallels).toHaveLength(2); + }); + + it('frames the world’s land, without Antarctica, where the countries span the world', () => { + const spec = choropleth(world); + const lats = fitPoints(spec).map(([, lat]) => lat); + expect(Math.min(...lats)).toBe(WORLD_LAND[1]); + expect(regionsOf(spec).transform[0]).toEqual({ filter: 'datum.id !== 10' }); + expect(regionsOf(spec).mark.clip).toBeUndefined(); + }); + + it('keeps Antarctica where the data names it, or the caller asks for the whole base map', () => { + const named = choropleth([...world, { Country: 'Antarctica', Value: 0 }]); + const whole = choropleth(world, { chartProperties: { fit: 'whole' } }); + for (const spec of [named, whole]) { + expect(regionsOf(spec).transform.some((step: any) => step.filter === 'datum.id !== 10')).toBe(false); + expect(Math.min(...fitPoints(spec).map(([, lat]) => lat))).toBe(-90); + } + }); + + it('gives a point map one projection both layers share, framed on its points', () => { + const spec: any = assembleVegaLite({ + data: { values: [{ City: 'Paris', Lon: 2.35, Lat: 48.86 }, { City: 'Berlin', Lon: 13.4, Lat: 52.5 }, { City: 'Rome', Lon: 12.5, Lat: 41.9 }] }, + semantic_types: { City: 'City', Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' } }, + } as any); + expect(spec.projection.type).toBe('conicEqualArea'); + expect(spec.layer.every((layer: any) => layer.projection === undefined)).toBe(true); + expect(geoLayers(spec).every((layer: any) => layer.mark.clip === true)).toBe(true); + expect(geoLayers(spec)[0].transform).toEqual([{ filter: 'datum.id !== 10' }]); + }); +}); + +describe('how much of the world a map frames', () => { + const framed = (countries: string[], properties: Record = {}) => + choropleth(countries.map((Country, i) => ({ Country, Value: i / 10 })), { chartProperties: properties }); + const level = (spec: any) => spec._mapFrame?.level; + + it('frames one country whole, its large islands with it, centred, with its neighbours round it', () => { + expect(countryBox(392)![3]).toBeGreaterThan(45); // Hokkaido is Japan's + expect(countryBox(250)![0]).toBeGreaterThan(-10); // French Guiana is not part of France's frame + const japan = framed(['Japan']); + expect(level(japan)).toBe('country'); + const lons = fitPoints(japan).map(([lon]) => lon); + const lats = fitPoints(japan).map(([, lat]) => lat); + expect(Math.min(...lons)).toBeLessThan(129.4); + expect(Math.max(...lons)).toBeGreaterThan(145.5); + expect(Math.max(...lats)).toBeGreaterThan(45.6); + expect(-japan.projection.rotate[0]).toBeCloseTo(137.5, 0); + }); + + it('frames several countries by the region they share, and their continent once they cover much of it', () => { + expect(level(framed(['France', 'Germany', 'Belgium', 'Netherlands']))).toBe('region'); + expect(level(framed(['Norway', 'Sweden', 'Finland', 'Denmark']))).toBe('region'); + expect(level(framed(['France', 'Germany', 'Italy', 'Spain', 'Poland', 'Sweden']))).toBe('continent'); + expect(level(framed(['Nigeria', 'Kenya', 'South Africa', 'Egypt', 'Morocco', 'Ethiopia']))).toBe('continent'); + expect(level(framed(['United States', 'China', 'Brazil']))).toBe('world'); + }); + + it('keeps to the data, or takes in the continent, where the chart asks', () => { + expect(level(framed(['France', 'Germany', 'Italy', 'Spain', 'Poland', 'Sweden'], { fit: 'data' }))).toBe('region'); + const asia = framed(['Japan'], { fit: 'continent' }); + expect(level(asia)).toBe('continent'); + expect(Math.min(...fitPoints(asia).map(([lon]) => lon))).toBeLessThan(30); + }); + + it('frames countries and places across the antimeridian as one region, centred on it', () => { + const pacific = framed(['Fiji', 'New Zealand', 'Samoa']); + expect(level(pacific)).toBe('region'); + const lons = fitPoints(pacific).map(([lon]) => lon); + expect(Math.min(...lons)).toBeGreaterThan(150); + expect(Math.max(...lons)).toBeGreaterThan(180); + expect(-pacific.projection.rotate[0]).toBeGreaterThan(170); + expect(longitudeSpan([[166, -47, 179, -34], [-172.8, -14, -171.4, -13.4]])).toEqual([166, 188.6]); + expect(longitudeSpan([[-10, 40, 20, 50], [100, 20, 120, 40]])).toEqual([-10, 120]); + expect(continentAt(-171.8, -13.8)).toBe('oceania'); // Apia + }); + + it('places points in their continent, the nearer one where two frames meet', () => { + expect(continentAt(28.98, 41.01)).toBe('europe'); // Istanbul + expect(continentAt(31.24, 30.04)).toBe('africa'); // Cairo + expect(continentAt(55.27, 25.2)).toBe('asia'); // Dubai + expect(continentAt(-150, -30)).toBeUndefined(); + expect(continentOf(643)).toBe('europe'); + expect(continentOf(792)).toBe('asia'); + }); +}); + +describe('regions without data', () => { + const blocks = [ + { type: 'Feature', id: 250, properties: {}, geometry: { type: 'Polygon', coordinates: [[[0, 40], [8, 40], [8, 50], [0, 50], [0, 40]]] } }, + { type: 'Feature', id: 276, properties: {}, geometry: { type: 'Polygon', coordinates: [[[8, 46], [15, 46], [15, 55], [8, 55], [8, 46]]] } }, + ]; + const fills = async (spec: any) => { + const { compile } = await import('vega-lite'); + const { parse, View } = await import('vega'); + // The regions alone, on two blocks of land. + const regions = regionsOf(spec); + regions.data = { values: blocks }; + if (spec.layer) spec.layer = [regions]; + const view = new View(parse(compile(spec).spec as any), { renderer: 'none' }); + await view.runAsync(); + const out: Record = {}; + const visit = (item: any) => { + if (item.mark?.marktype === 'shape' && item.datum?.id != null) out[item.datum.id] = item.fill; + for (const child of item.items ?? []) visit(child); + }; + visit((view.scenegraph() as any).root); + view.finalize(); + return out; + }; + + it('draws a region the rows do not name, in the no-data fill, on a flat world map', async () => { + const spec = choropleth([{ Country: 'France', Value: 0.4 }]); + expect(regionsOf(spec).mark.invalid).toBeNull(); + const noData = regionsOf(spec).encoding.color.condition.value; + const drawn = await fills(spec); + expect(Object.keys(drawn).sort()).toEqual(['250', '276']); + expect(drawn['276']).toBe(noData); + expect(drawn['250']).not.toBe(noData); + }); + + it('keeps states and counties without a value on the US map', () => { + for (const level of ['state', 'county', 'auto']) { + const spec = choropleth([{ State: 'California', Value: 1 }], { chartProperties: { level } }); + // Every layer of regions keeps them; the borders' mesh draws lines, not regions. + const layers = spec.layer ? spec.layer.filter((layer: any) => !layer.data?.format?.mesh) : [spec]; + expect(layers.every((layer: any) => layer.mark.invalid === null), level).toBe(true); + expect((regionsOf(spec) ?? spec).encoding.color.condition.test).toMatch(/isValid/); + } + }); +}); + +describe('frame shapes', () => { + it('frames a region its countries or points share, padded, and the world where they span it', () => { + expect(frameOf([[-5, 42, 8, 51]]).world).toBe(false); + expect(frameOf([[-120, 30, -70, 45], [100, 20, 140, 40]]).world).toBe(true); + // A body that crosses the antimeridian frames its region, running east past 180°, not a strip the wrong way round. + const crossing = frameOf([[170, -45, -175, -35]]); + expect(crossing.world).toBe(false); + expect(crossing.box[0]).toBeGreaterThan(160); + expect(crossing.box[2]).toBeGreaterThan(185); + }); + + it('widens a frame two points far apart would make a strip', () => { + const strip = frameOf([[-74, 40.7, -74, 40.7], [2.35, 48.86, 2.35, 48.86]]).box; + expect(projectedAspect(strip, 'mercator')).toBeGreaterThan(3); + expect(projectedAspect(shapedFrame(strip, 'mercator'), 'mercator')).toBeLessThanOrEqual(2.05); + }); + + it('sizes the plot as the largest of its frame’s shape the room holds', () => { + expect(mapPlotSize({ width: 600, height: 450 }, 2)).toEqual({ width: 600, height: 300 }); + expect(mapPlotSize({ width: 600, height: 450 }, 1)).toEqual({ width: 450, height: 450 }); + }); +}); diff --git a/packages/flint-js/tests/map-join.test.ts b/packages/flint-js/tests/map-join.test.ts new file mode 100644 index 00000000..4b1e21b2 --- /dev/null +++ b/packages/flint-js/tests/map-join.test.ts @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { validateChart } from '../src/validate'; +import { isAggregateRegion, keyTypeResolver } from '../src/chart-types/geo'; + +/** + * A choropleth gives each region one value, joined from the rows by a key the gazetteer reads. + * Rows that share a region combine as the measure does; keys that name no region are reported. + */ + +const input = (rows: Record[], semantic: Record, properties: Record = {}, color: Record = {}) => ({ + data: { values: rows }, + semantic_types: semantic, + chart_spec: { chartType: 'Choropleth', encodings: { id: { field: Object.keys(rows[0])[0] }, color: { field: 'Value', ...color } }, chartProperties: properties }, +}) as any; + +/** The unit drawing the regions: the map itself, or the layer whose colour comes from a field. */ +const regionsOf = (spec: any): any => (Array.isArray(spec.layer) ? spec.layer.find((layer: any) => layer.encoding?.color?.field) : spec); +const joined = (spec: any): any[] => { + const lookup = (regionsOf(spec).transform ?? []).find((step: any) => step.lookup); + return lookup.from.data.values; +}; +const codes = (spec: any): string[] => (spec._warnings ?? []).map((warning: any) => warning.code); + +describe('rows that share a region', () => { + const rows = [{ Country: 'France', Value: 10 }, { Country: 'FRA', Value: 30 }, { Country: 'Germany', Value: 5 }]; + + it('sum where the measure is a total', () => { + const spec: any = assembleVegaLite(input(rows, { Country: 'Country', Value: 'Count' })); + expect(joined(spec).find((row) => row.__geo_id === 250).Value).toBe(40); + expect(joined(spec)).toHaveLength(2); + expect(codes(spec)).toContain('map-rows-combined'); + }); + + it('average where it is a rate or a share', () => { + const spec: any = assembleVegaLite(input(rows, { Country: 'Country', Value: 'Percentage' })); + expect(joined(spec).find((row) => row.__geo_id === 250).Value).toBe(20); + }); + + it('combine by the encoding’s own aggregate where it states one', () => { + const spec: any = assembleVegaLite(input(rows, { Country: 'Country', Value: 'Count' }, {}, { aggregate: 'max' })); + const field = regionsOf(spec).encoding.color.field; + expect(joined(spec).find((row) => row.__geo_id === 250)[field]).toBe(30); + expect(regionsOf(spec).encoding.color.aggregate).toBeUndefined(); + }); +}); + +describe('the join report', () => { + const rows = [ + { Country: 'France', Value: 0.4 }, { Country: 'Narnia', Value: 0.1 }, { Country: 'World', Value: 0.3 }, + { Country: 'OECD', Value: 0.2 }, + ]; + + it('names keys that match no region, and groups of countries', () => { + const spec: any = assembleVegaLite(input(rows, { Country: 'Country', Value: 'Percentage' })); + const byCode = Object.fromEntries((spec._warnings ?? []).map((warning: any) => [warning.code, warning.message])); + expect(byCode['map-unmatched-keys']).toMatch(/"Narnia"/); + expect(byCode['map-unmatched-keys']).not.toMatch(/"World"|"OECD"/); + expect(byCode['map-unmatched-keys']).toMatch(/keyType/); + expect(byCode['map-aggregate-rows']).toMatch(/"World", "OECD"/); + expect(joined(spec).map((row) => row.Country)).toEqual(['France']); + }); + + it('warns that a total coloured by area lets large regions dominate', () => { + const spec: any = assembleVegaLite(input([{ Country: 'France', Value: 68e6 }], { Country: 'Country', Value: 'Count' })); + expect(codes(spec)).toContain('map-total-on-choropleth'); + const rate: any = assembleVegaLite(input([{ Country: 'France', Value: 0.4 }], { Country: 'Country', Value: 'Percentage' })); + expect(codes(rate)).not.toContain('map-total-on-choropleth'); + }); + + it('reaches validate_chart', () => { + const result = validateChart(input(rows, { Country: 'Country', Value: 'Percentage' }), 'vegalite'); + expect(result.warnings.map((warning) => warning.code)).toEqual(expect.arrayContaining(['map-unmatched-keys', 'map-aggregate-rows'])); + }); + + it('stays quiet when every key names a region', () => { + const spec: any = assembleVegaLite(input([{ Country: 'France', Value: 0.4 }, { Country: 'Germany', Value: 0.2 }], { Country: 'Country', Value: 'Percentage' })); + expect(spec._warnings ?? []).toEqual([]); + }); +}); + +describe('declared key types', () => { + it('read the key in one namespace: CA is Canada as ISO 2, California as a US state', () => { + expect(keyTypeResolver('iso2')!('CA')).toBe(124); + expect(keyTypeResolver('us-state')!('CA')).toBe(6); + expect(keyTypeResolver('iso3')!('ca')).toBeUndefined(); + expect(keyTypeResolver('iso-numeric')!('076')).toBe(76); + expect(keyTypeResolver('iso-numeric')!('999')).toBeUndefined(); + expect(keyTypeResolver('country-name')!('840')).toBeUndefined(); + expect(keyTypeResolver('auto')).toBeUndefined(); + }); + + it('pick the map without guessing', () => { + const rows = [{ Code: 'CA', Value: 1 }, { Code: 'IN', Value: 2 }]; + const world: any = assembleVegaLite(input(rows, { Code: 'Category', Value: 'Percentage' }, { keyType: 'iso2' })); + const us: any = assembleVegaLite(input(rows, { Code: 'Category', Value: 'Percentage' }, { keyType: 'us-state' })); + expect(regionsOf(world).data.url).toMatch(/world-bank/); + expect(joined(world).map((row) => row.__geo_id).sort((a, b) => a - b)).toEqual([124, 356]); + expect(regionsOf(us).data.url).toMatch(/counties-albers/); + expect(joined(us).map((row) => row.__geo_id).sort((a, b) => a - b)).toEqual([6, 18]); + }); + + it('know a group of countries by name or code', () => { + for (const value of ['World', 'OECD members', 'Sub-Saharan Africa', 'WLD', 'High income', 'European Union']) { + expect(isAggregateRegion(value), value).toBe(true); + } + for (const value of ['France', 'South Africa', 'United States']) expect(isAggregateRegion(value), value).toBe(false); + }); +}); diff --git a/packages/flint-js/tests/map-labels.test.ts b/packages/flint-js/tests/map-labels.test.ts new file mode 100644 index 00000000..63487606 --- /dev/null +++ b/packages/flint-js/tests/map-labels.test.ts @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * A map's names and symbols: `text` labels a point map's points beside them, where each has room, and + * a choropleth's regions at their middles, where each region holds its label; `shape` tells a point + * map's points apart. + */ + +import { compile } from 'vega-lite'; +import { loader, parse, View } from 'vega'; +import { expressionInterpreter } from 'vega-interpreter'; +import { describe, expect, it } from 'vitest'; +import { assembleVegaLite } from '../src'; +import { assemblePlotly } from '../src/plotly'; +import { planProjection } from '../src/chart-types/geo-frame'; +import { withBundledBoundaries } from '../src/vegalite/boundary-loader'; +import { LABEL_AT, LABEL_DX, LABEL_DY } from '../src/vegalite/templates/map-labels'; + +// The assembled spec's own notes (`_warnings`, …) are not Vega-Lite's; a join's key (`__geo_id`) is. +const strip = (spec: any) => JSON.parse(JSON.stringify(spec, (key, value) => (/^_[^_]/.test(key) ? undefined : value))); +const markType = (layer: any) => (typeof layer?.mark === 'string' ? layer.mark : layer?.mark?.type); + +const CITIES = ([ + ['Paris', 2.35, 48.86, 2.1], ['London', -0.13, 51.51, 8.9], ['Berlin', 13.4, 52.52, 3.6], ['Madrid', -3.7, 40.42, 3.2], + ['Rome', 12.5, 41.9, 2.8], ['Brussels', 4.35, 50.85, 1.2], ['Amsterdam', 4.9, 52.37, 0.9], ['Vienna', 16.37, 48.21, 1.9], + ['Prague', 14.42, 50.08, 1.3], ['Warsaw', 21.0, 52.23, 1.8], ['Lisbon', -9.14, 38.72, 0.5], ['Dublin', -6.26, 53.35, 0.6], +] as const).map(([City, longitude, latitude, Pop]) => ({ City, Kind: Pop > 2 ? 'large' : 'small', longitude, latitude, Pop })); +const US_CITIES = ([ + ['Seattle', -122.33, 47.61], ['San Francisco', -122.42, 37.77], ['Chicago', -87.63, 41.88], ['New York', -74.0, 40.71], + ['Miami', -80.19, 25.76], ['Anchorage', -149.9, 61.22], ['Honolulu', -157.86, 21.31], ['Dallas', -96.8, 32.78], +] as const).map(([City, longitude, latitude]) => ({ City, longitude, latitude })); + +function pointMap(rows: any[], encodings: Record, chartProperties: Record = {}): any { + return assembleVegaLite({ + data: { values: rows }, + semantic_types: { City: 'Name', Kind: 'Category', Pop: 'Quantity', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', ...encodings }, chartProperties, canvasSize: { width: 520, height: 420 } }, + } as any); +} + +async function scene(spec: any, interpreter = false): Promise<{ root: any; errors: unknown[] }> { + const errors: unknown[] = []; + const vega = compile(strip(spec)).spec as any; + const view = new View(interpreter ? parse(vega, undefined, { ast: true }) : parse(vega), { + renderer: 'none', loader: withBundledBoundaries(loader()), ...(interpreter ? { expr: expressionInterpreter } : {}), + } as any); + view.logger({ level: () => 0, error: (...args: unknown[]) => errors.push(args), warn: () => {}, info: () => {}, debug: () => {} } as any); + await view.runAsync(); + return { root: (view.scenegraph() as any).root, errors }; +} + +function items(root: any, keep: (mark: any) => boolean): any[] { + const found: any[] = []; + const visit = (node: any) => { + if (node?.marktype && keep(node)) found.push(...node.items); + for (const item of node?.items ?? []) visit(item); + }; + visit(root); + return found; +} + +describe('shape on a point map', () => { + it('draws its points as filled symbols told apart by shape, in Vega-Lite and Plotly', () => { + const spec = pointMap(CITIES, { shape: 'Kind', size: 'Pop' }); + const dots = spec.layer.find((layer: any) => layer.encoding?.shape); + expect(dots.mark).toMatchObject({ type: 'point', filled: true }); + expect(dots.encoding.shape.field).toBe('Kind'); + const markers = assemblePlotly({ + data: { values: CITIES }, semantic_types: { City: 'Name', Kind: 'Category', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', shape: 'Kind' } }, + } as any).data.find((trace: any) => trace.mode === 'markers'); + expect(new Set(markers.marker.symbol)).toEqual(new Set(['circle', 'square'])); + }); +}); + +describe('labels on a point map', () => { + it('places each label beside its point, clear of every dot and label, and keeps it there through the live projection', async () => { + const spec = pointMap(CITIES, { text: 'City', size: 'Pop' }); + const labelLayers = spec.layer.filter((layer: any) => layer.data?.values?.[0]?.[LABEL_AT]); + expect(labelLayers).toHaveLength(2); + expect(labelLayers[1].mark).toMatchObject({ type: 'text', align: 'left', baseline: 'middle' }); + // The dots draw no text of their own. + expect(spec.layer.find((layer: any) => markType(layer) === 'circle').encoding.text).toBeUndefined(); + const { root } = await scene(spec); + const texts = items(root, (mark) => mark.marktype === 'text' && mark.items?.[0]?.datum?.[LABEL_AT] && mark.items[0].fill !== '#ffffff'); + const dots = items(root, (mark) => mark.marktype === 'symbol' && mark.items?.[0]?.datum?.City !== undefined && !mark.items[0].datum[LABEL_AT]); + expect(texts).toHaveLength(CITIES.length); + for (const text of texts) { + const dot = dots.find((each) => each.datum.City === text.datum.City); + expect(text.x).toBeCloseTo(dot.x + text.datum[LABEL_DX], 3); + expect(text.y).toBeCloseTo(dot.y + text.datum[LABEL_DY], 3); + } + // No two labels' boxes overlap (their widths as placed: from each text's start). + const boxes = texts.map((text) => ({ x0: text.x, x1: text.x + String(text.text).length * 5, y0: text.y - 6, y1: text.y + 6 })); + for (let i = 0; i < boxes.length; i++) for (let j = i + 1; j < boxes.length; j++) { + const [a, b] = [boxes[i], boxes[j]]; + expect(a.x0 < b.x1 && b.x0 < a.x1 && a.y0 < b.y1 && b.y0 < a.y1).toBe(false); + } + }); + + it('works out where points land as Vega will, on a US map as on the world’s', async () => { + for (const [rows, chartProperties] of [[US_CITIES, {}], [CITIES, {}], [CITIES, { projection: 'orthographic' }]] as const) { + const spec = pointMap(rows as any, { text: 'City' }, chartProperties); + const plan = planProjection(spec.projection, [spec.width, spec.height], rows.map((row: any) => [row.longitude, row.latitude]))!; + const { root } = await scene(spec); + const dots = items(root, (mark) => mark.marktype === 'symbol' && mark.items?.[0]?.datum?.City !== undefined && !mark.items[0].datum[LABEL_AT]); + for (const dot of dots) { + const at = plan([dot.datum.longitude, dot.datum.latitude]); + if (!at) continue; + expect(Math.hypot(at[0] - dot.x, at[1] - dot.y)).toBeLessThan(0.5); + } + } + }); + + it('leaves a crowded point unlabelled and says how many, and hides a label past a globe’s horizon', () => { + const crowd = Array.from({ length: 40 }, (_, i) => ({ City: `Place ${i}`, longitude: 2 + (i % 8) * 0.05, latitude: 48 + Math.floor(i / 8) * 0.05 })); + const spec = pointMap([...crowd, ...CITIES], { text: 'City' }); + const warning = spec._warnings.find((each: any) => each.code === 'map-labels-dropped'); + expect(warning).toMatchObject({ severity: 'info', channel: 'text', field: 'City' }); + const globe = pointMap(CITIES, { text: 'City' }, { projection: 'orthographic' }); + const label = globe.layer.find((layer: any) => layer.data?.values?.[0]?.[LABEL_AT]); + expect(label.encoding.opacity.condition[0].value).toBe(0); + }); + + it('writes a Plotly label beside each point', () => { + const trace = assemblePlotly({ + data: { values: CITIES }, semantic_types: { City: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', text: 'City' } }, + } as any).data.find((each: any) => each.type === 'scattergeo' && each.text); + expect(trace).toMatchObject({ mode: 'markers+text', textposition: 'middle right' }); + expect(trace.text).toContain('Paris'); + }); +}); + +describe('labels on a choropleth', () => { + const states = [['CA', 39], ['TX', 30], ['MT', 1.1], ['RI', 1.1], ['DE', 1]].map(([State, Pop]) => ({ State, Pop })); + const choropleth = (rows: any[], encodings: Record) => assembleVegaLite({ + data: { values: rows }, semantic_types: { State: 'State', Pop: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings, canvasSize: { width: 560, height: 380 } }, + } as any); + + it('names each region at its middle, where it holds the label, and only regions with a row', async () => { + const spec: any = choropleth(states, { id: 'State', color: 'Pop', text: 'State' }); + const labels = spec.layer.filter((layer: any) => markType(layer) === 'text'); + // A halo in the regions' own colours (unseen inside a region), then the label. + expect(labels).toHaveLength(2); + expect(labels[0].mark).toMatchObject({ filled: false }); + expect(labels[0].encoding.color).toMatchObject({ field: 'Pop', legend: null }); + expect(spec.resolve.legend.color).toBe('independent'); + // The label's text and width travel with the join. + const lookup = labels[1].transform.find((step: any) => step.lookup); + expect(lookup.from.fields).toEqual(expect.arrayContaining(['State', 'flintLabelW'])); + const { root, errors } = await scene(spec, true); + expect(errors).toEqual([]); + const drawn = items(root, (mark) => mark.marktype === 'text' && mark.items?.[0]?.datum?.flintLabelW !== undefined && !mark.items[0].stroke); + const shown = (state: string) => drawn.find((item) => item.datum.State === state)?.opacity !== 0; + expect(drawn.map((item) => item.datum.State).sort()).toEqual(['CA', 'DE', 'MT', 'RI', 'TX']); + // White on the darkest fills, the dark ink on the lightest: whichever reads better on each. + const ink = (state: string) => drawn.find((item) => item.datum.State === state)?.fill; + expect(ink('CA')).toBe('#ffffff'); + expect(ink('MT')).toBe('#2b2f33'); + // A big state holds its label; Rhode Island and Delaware are too small at this size. + expect(['CA', 'TX', 'MT'].every(shown)).toBe(true); + expect(shown('RI') || shown('DE')).toBe(false); + }); + + it('writes a Plotly label at each region’s middle', () => { + const traces = assemblePlotly({ + data: { values: states }, semantic_types: { State: 'State', Pop: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'State', color: 'Pop', text: 'State' } }, + } as any).data; + const text = traces.find((trace: any) => trace.type === 'scattergeo'); + expect(text).toMatchObject({ mode: 'text', locationmode: 'USA-states' }); + expect(text.text).toEqual(['CA', 'TX', 'MT', 'RI', 'DE']); + }); +}); + +describe('a dense point map’s labels', () => { + // 60 places spread over the world, valued 0–59. + const places = Array.from({ length: 60 }, (_, i) => ({ City: `P${i}`, longitude: -170 + (i % 12) * 30, latitude: -50 + Math.floor(i / 12) * 25, Pop: i })); + const labels = (spec: any) => spec.layer.find((layer: any) => markType(layer) === 'text' && layer.encoding?.text?.field === 'City')?.data.values ?? []; + + it('names at most one place per 36,000 px² of the plot', () => { + const spec = pointMap(places, { text: 'City' }); + expect(labels(spec).length).toBeLessThanOrEqual(Math.max(12, Math.round((spec.width * spec.height) / 36000))); + expect(labels(spec).length).toBeGreaterThan(0); + }); + + it('names the ends of a quantity’s colour scale first', () => { + const named = labels(pointMap(places, { text: 'City', color: 'Pop' })).map((row: any) => row.City); + expect(named).toContain('P0'); + expect(named).toContain('P59'); + }); +}); diff --git a/packages/flint-js/tests/map-levels.test.ts b/packages/flint-js/tests/map-levels.test.ts index f1ea3780..ada6e708 100644 --- a/packages/flint-js/tests/map-levels.test.ts +++ b/packages/flint-js/tests/map-levels.test.ts @@ -134,10 +134,10 @@ describe('choropleth auto level assembly', () => { semantic_types: { Region: 'State', Place: 'Category', Value: 'Quantity' }, chart_spec: { chartType: 'Choropleth', encodings: { id: 'Region', color: 'Value' } }, } as any) as any; - expect(spec.layer).toBeUndefined(); + // The states and the mesh of borders between them: no level gates, no level signal. + expect(spec.layer.map((layer: any) => layer.data.format.feature ?? `mesh:${layer.data.format.mesh}`)).toEqual(['states', 'mesh:states']); expect(spec.params).toBeUndefined(); expect(spec._interactionSemantics.geoLevels).toBeUndefined(); - expect(spec.data.format.feature).toBe('states'); }); }); @@ -337,10 +337,12 @@ describe('bubble map levels', () => { it('leaves a plain bubble map alone', () => { const spec = bubble({}); - expect(spec.layer[0].data.url).toContain('world-110m'); + const land = spec.layer.find((layer: any) => layer.data?.format?.feature === 'countries'); + const points = spec.layer.find((layer: any) => (layer.mark?.type ?? layer.mark) === 'circle'); + expect(land.data.url).toContain('world-bank'); expect(spec.params).toBeUndefined(); - expect(spec.layer[1].transform).toBeUndefined(); - expect(spec.layer[1].encoding.color.scale?.domain).toBeUndefined(); + expect(points.transform).toBeUndefined(); + expect(points.encoding.color.scale?.domain).toBeUndefined(); expect(spec._interactionSemantics.geoLevels).toBeUndefined(); // Levels need a level column and at least two levels. expect(bubble({ levelField: 'Level', levels: [{ value: 'province' }] }).params).toBeUndefined(); diff --git a/packages/flint-js/tests/map-navigation.test.ts b/packages/flint-js/tests/map-navigation.test.ts index f147da0b..65fe8978 100644 --- a/packages/flint-js/tests/map-navigation.test.ts +++ b/packages/flint-js/tests/map-navigation.test.ts @@ -11,7 +11,7 @@ */ import { compile } from 'vega-lite'; -import { parse, View } from 'vega'; +import { loader as vegaLoader, parse, View } from 'vega'; import { describe, expect, it } from 'vitest'; import { assembleVegaLite } from '../src'; import { navigate } from '../src/interactive/interactions'; @@ -27,6 +27,7 @@ import { GEO_PROJECTION_SIGNAL, GEO_ROTATE_SIGNAL, guardGeoExtent, + MAP_PAN_SLACK, eastwardSpan, interpolateRotation, sphericalCentroid, @@ -36,6 +37,8 @@ import { type GeoExtent, } from '../src/vegalite/interactions/navigation-geo'; import { domainForPlotGeometry, resolveSupportedOperation } from '../src/vegalite/interactions/runtime'; +import { followGeoDetail, GEO_DETAIL_SIGNAL, injectVegaGeoDetail } from '../src/vegalite/interactions/geo-detail'; +import { withBundledBoundaries } from '../src/vegalite/boundary-loader'; const GUARD = { minVisibleFraction: 0.02, maxVisibleFraction: 1, overscrollFraction: 0 }; @@ -65,7 +68,7 @@ function worldBubbleMap(): any { chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat', size: 'Pop' }, - chartProperties: { region: 'world', projection: 'mercator' }, + chartProperties: { region: 'world', projection: 'mercator', fit: 'whole' }, }, } as any) as any; // Replace the remote TopoJSON base with inline features. @@ -157,6 +160,16 @@ describe('geo extent helpers', () => { extent.flat().forEach((value, index) => expect(value).toBeCloseTo([0, 0, 100, 50][index], 10)); }); + it('lets a flat map be dragged half its plot past each edge, at any zoom, and no further', () => { + const size = { width: 100, height: 50 }; + const near = (actual: GeoExtent, expected: GeoExtent) => actual.flat().forEach((value, i) => expect(value).toBeCloseTo(expected.flat()[i], 6)); + // At the full frame, a drag moves the map up to half the plot. + near(guardGeoExtent([[30, 10], [130, 60]], size, GUARD, MAP_PAN_SLACK), [[30, 10], [130, 60]]); + near(guardGeoExtent([[90, -40], [190, 10]], size, GUARD, MAP_PAN_SLACK), [[50, -25], [150, 25]]); + // Zoomed in four times, the slack is still half the plot in pixels past the map's edge. + near(guardGeoExtent([[80, 0], [480, 200]], size, GUARD, MAP_PAN_SLACK), [[50, 0], [450, 200]]); + }); + it('remaps a pixel between extents by the fit\'s scale and offset', () => { const base: GeoExtent = [[0, 0], [100, 50]]; const zoomed: GeoExtent = [[-50, -25], [150, 75]]; @@ -340,6 +353,8 @@ async function mountedGlobe(center: [number, number] = [0, 0]) { chartProperties: { region: 'world', projection: 'orthographic', projectionCenter: center }, }, } as any) as any; + // The inline blocks stand in for the countries; the disputed borders and the mesh of borders have none to draw. + spec.layer = spec.layer.filter((layer: any) => layer.data?.format?.feature !== 'disputed' && !layer.data?.format?.mesh); for (const layer of spec.layer) { if (layer.data?.url) layer.data = { values: BASE_FEATURES }; } @@ -358,6 +373,118 @@ function facing(view: any): [number, number] { return view.signal(GEO_PROJECTION_SIGNAL).invert([view.width() / 2, view.height() / 2]); } +/** A point map drawn as a globe over the inline land blocks: a near point at (10°, 0) and a far one at (170°, 0). */ +function pointGlobe(chartProperties: Record = { projection: 'orthographic', projectionCenter: [0, 0] }): any { + const spec = assembleVegaLite({ + data: { values: [{ Site: 'near', Lon: 10, Lat: 0, Kind: 'a' }, { Site: 'far', Lon: 170, Lat: 0, Kind: 'b' }] }, + semantic_types: { Site: 'Name', Lon: 'Longitude', Lat: 'Latitude', Kind: 'Category' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat', color: 'Kind' }, chartProperties: { region: 'world', ...chartProperties } }, + } as any) as any; + for (const layer of spec.layer) { + if (layer.data?.url) layer.data = layer.data.format?.feature === 'disputed' ? { values: [] } : { values: BASE_FEATURES }; + } + return spec; +} + +/** The opacity each point is drawn at, by its site. */ +function pointOpacities(view: any): Record { + const out: Record = {}; + const visit = (item: any) => { + if (item.mark?.marktype === 'symbol' && item.datum?.Site) out[item.datum.Site] = item.opacity; + for (const child of item.items ?? []) visit(child); + }; + visit(view.scenegraph().root); + return out; +} + +describe('point map as a globe', () => { + it('is square, shares one sphere-fitted projection, and puts the sea under the land and the points', () => { + const spec = pointGlobe(); + expect(spec.width).toBe(spec.height); + expect(spec.projection).toEqual(expect.objectContaining({ type: 'orthographic', fit: { type: 'Sphere' } })); + expect(spec.layer.every((layer: any) => layer.projection === undefined)).toBe(true); + expect(spec.layer[0].data).toEqual({ sphere: true }); + // The sea under all, then the land and its borders, the dotted disputed borders, and the points over them. + const circle = spec.layer.findIndex((layer: any) => (layer.mark?.type ?? layer.mark) === 'circle'); + expect(circle).toBe(spec.layer.length - 1); + expect(spec.layer[circle - 1].mark.strokeDash).toBeDefined(); + expect(spec.layer.slice(1, circle - 1).every((layer: any) => (layer.mark?.type ?? layer.mark) === 'geoshape')).toBe(true); + expect(spec.layer[circle].encoding.opacity.condition.value).toBe(0); + expect(spec.params).toContainEqual({ name: GEO_ROTATE_SIGNAL, value: [0, 0, 0] }); + }); + + it('faces its data where no centre is given, never tipped onto a pole', () => { + const spec = assembleVegaLite({ + data: { values: [{ Lon: 100, Lat: 10 }, { Lon: 120, Lat: 30 }] }, + semantic_types: { Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' }, chartProperties: { projection: 'orthographic' } }, + } as any) as any; + expect(spec.projection.rotate).toEqual([-110, -20, 0]); + const spread = assembleVegaLite({ + data: { values: [[-6, 53], [104, 1], [-96, 41], [-71, -33], [27, 61], [121, 24]].map(([Lon, Lat]) => ({ Lon, Lat })) }, + semantic_types: { Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' }, chartProperties: { projection: 'orthographic' } }, + } as any) as any; + expect(Math.abs(spread.projection.rotate[1])).toBeLessThanOrEqual(60); + const across = assembleVegaLite({ + data: { values: [{ Lon: 170, Lat: 0 }, { Lon: -170, Lat: 0 }] }, + semantic_types: { Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' }, chartProperties: { projection: 'orthographic' } }, + } as any) as any; + expect(Math.abs(across.projection.rotate[0])).toBeCloseTo(180, 5); + }); + + it('hides a point behind the horizon, statically', async () => { + const view = new View(parse(compile(pointGlobe()).spec as any), { renderer: 'none' }); + await view.runAsync(); + const opacity = pointOpacities(view); + expect(opacity.near).toBeGreaterThan(0); + expect(opacity.far).toBe(0); + view.finalize(); + }); + + it('shows the far point once a drag turns it to the front', async () => { + const spec = pointGlobe(); + const plan = addVegaLiteInteractions(spec, [navigate()])!; + const compiled = compile(spec).spec as any; + const axes = injectVegaGeoNavigationSignals(compiled, plan.navigationChannels); + expect(compiled.signals.filter((signal: any) => signal.name === GEO_ROTATE_SIGNAL)).toHaveLength(1); + const view = new View(parse(compiled), { renderer: 'none' }); + await view.runAsync(); + const controller = createVegaGeoNavigationController(view, axes); + expect(controller.apply({ op: 'set-viewport', axes: 'xy', value: { x: [150, 190] } })).toBe(true); + await view.runAsync(); + const opacity = pointOpacities(view); + expect(opacity.far).toBeGreaterThan(0); + expect(opacity.near).toBe(0); + view.finalize(); + }); + + it('mounts its interactions as an interactive chart does, the far side still hidden under focus and hover', () => { + // Semantic updates on, as mounts every chart: the points take focus and hover, + // and the plan must not fall back to a static chart because their opacity is the template's. + const spec = pointGlobe(); + const plan = addVegaLiteInteractions(spec, [navigate()], true); + expect(plan).not.toBeNull(); + expect(plan!.geoNavigation).toBe(true); + const points = spec.layer.find((layer: any) => (layer.mark?.type ?? layer.mark) === 'circle'); + const conditions = points.encoding.opacity.condition; + expect(Array.isArray(conditions)).toBe(true); + expect(conditions[0]).toEqual(expect.objectContaining({ value: 0 })); + expect(conditions[0].test).toMatch(/cos/); + expect(conditions.length).toBeGreaterThan(1); + }); + + it('leaves a flat point map without a sea, a rotation signal, or hidden points', () => { + const flat = pointGlobe({ projection: 'equalEarth' }); + // The water's frame, the land, its borders, the disputed borders on the land's colour, the points: no sphere. + expect(flat.layer.some((layer: any) => layer.data?.sphere)).toBe(false); + expect(flat.params ?? []).not.toContainEqual(expect.objectContaining({ name: GEO_ROTATE_SIGNAL })); + const points = flat.layer.find((layer: any) => (layer.mark?.type ?? layer.mark) === 'circle'); + expect(points.encoding.opacity).toBeUndefined(); + }); +}); + describe('globe navigation', () => { it('draws a world choropleth as a globe: a square plot, the sea, no-data land, and a sphere fit', () => { const { spec } = { spec: assembleVegaLite({ @@ -372,19 +499,22 @@ describe('globe navigation', () => { type: 'orthographic', rotate: [-10, -50, 0], fit: { type: 'Sphere' }, })); expect(spec.width).toBe(spec.height); - expect(spec.layer).toHaveLength(3); + // The sea, the land without data, the countries, the borders between them, the disputed borders. + expect(spec.layer).toHaveLength(5); expect(spec.layer[0].data).toEqual({ sphere: true }); expect(spec.layer[1].mark.fill).toBeDefined(); expect(spec.layer[2].encoding.color.field).toBe('Warming'); + expect(spec.layer[3].data.format).toMatchObject({ mesh: 'countries', filter: 'interior' }); + expect(spec.layer[4].data.format.feature).toBe('disputed'); }); - it('keeps a flat world choropleth one layer, and offers the projection only on the world map', () => { + it('keeps a flat world choropleth to its regions and their disputed borders, and offers the projection only on the world map', () => { const flat = assembleVegaLite({ data: { values: [{ Country: 'Norway', Warming: 2.8 }] }, semantic_types: { Country: 'Country', Warming: 'Quantity' }, chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Warming' }, chartProperties: { region: 'world', projection: 'mercator' } }, } as any) as any; - expect(flat.layer).toBeUndefined(); + expect(flat.layer.filter((layer: any) => layer.data?.format).map((layer: any) => layer.data.format.feature ?? 'mesh')).toEqual(['countries', 'mesh', 'disputed']); expect(flat.projection.type).toBe('mercator'); }); @@ -522,3 +652,62 @@ describe('globe maths', () => { expect(turnGlobe([0, 0, 0], 0, -1e6, 100)[1]).toBe(90); }); }); + +describe('boundaries that sharpen with the zoom', () => { + it('swap the coarse World Bank map for the medium one near a continent, from the package, and back on the way out', async () => { + const spec = assembleVegaLite({ + data: { values: ['United States', 'China', 'Brazil', 'Nigeria', 'India'].map((Country, i) => ({ Country, Value: i })) }, + semantic_types: { Country: 'Country', Value: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Value' } }, + } as any) as any; + const plan = addVegaLiteInteractions(spec, [navigate()])!; + const compiled = compile(spec).spec as any; + const axes = injectVegaGeoNavigationSignals(compiled, plan.navigationChannels); + expect(injectVegaGeoDetail(compiled)).toBe(true); + const requested: string[] = []; + const base = vegaLoader(); + const load = base.load.bind(base); + base.load = ((uri: string, options?: any) => { + requested.push(uri); + return load(uri, options); + }) as typeof base.load; + const view = new View(parse(compiled), { renderer: 'none', loader: withBundledBoundaries(base) } as any); + await view.runAsync(); + const stop = followGeoDetail(view); + const controller = createVegaGeoNavigationController(view, axes, undefined, undefined, { focusSource: vegaGeoFocusSource(compiled) }); + const settle = async () => { + await view.runAsync(); + await new Promise((resolve) => setTimeout(resolve, 0)); + await view.runAsync(); + }; + const zoom = async (factor: number) => { + const update = controller.resolve({ type: 'navigation', phase: 'commit', operation: 'zoom', axes: 'xy', factor, anchor: { x: 0.5, y: 0.5 } }, GUARD)!; + controller.apply(update); + await settle(); + }; + expect(view.signal(GEO_DETAIL_SIGNAL)).toBe('coarse'); + await zoom(8); + expect(view.signal(GEO_DETAIL_SIGNAL)).toBe('medium'); + // The bundled copy answered: the medium file was asked for, and nothing was fetched. + expect(requested).toEqual([]); + expect(view.data(vegaGeoFocusSource(compiled)!).length).toBeGreaterThan(200); + await zoom(1 / 8); + expect(view.signal(GEO_DETAIL_SIGNAL)).toBe('coarse'); + stop(); + view.finalize(); + }); + + it('leave a map framed on a region, or drawn from a file of its own, as it is', () => { + const compiledOf = (rows: string[], chartProperties: Record = {}) => { + const spec = assembleVegaLite({ + data: { values: rows.map((Country, i) => ({ Country, Value: i })) }, + semantic_types: { Country: 'Country', Value: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Value' }, chartProperties }, + } as any) as any; + addVegaLiteInteractions(spec, [navigate()]); + return compile(spec).spec as any; + }; + expect(injectVegaGeoDetail(compiledOf(['France', 'Germany']))).toBe(false); + expect(injectVegaGeoDetail(compiledOf(['United States', 'China', 'Brazil'], { boundaries: { url: '/maps/world.json', feature: 'countries' } }))).toBe(false); + }); +}); diff --git a/packages/flint-js/tests/map-routes.test.ts b/packages/flint-js/tests/map-routes.test.ts new file mode 100644 index 00000000..2d08df43 --- /dev/null +++ b/packages/flint-js/tests/map-routes.test.ts @@ -0,0 +1,763 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Routes on a map: a `Map` whose points an `order` field joins into lines, with arrowheads that + * read their heading off the live projection. + */ + +import { compile } from 'vega-lite'; +import { loader, parse, View } from 'vega'; +import { expressionInterpreter } from 'vega-interpreter'; +import { describe, expect, it } from 'vitest'; +import { assembleVegaLite, type ChartAssemblyInput } from '../src'; +import { assemblePlotly } from '../src/plotly'; +import { validateChart } from '../src/validate'; +import { geoOverlayChannels, overlayChannels } from '../src/vegalite/interactions/presentation/overlay-channels'; +import { lonLatBox } from '../src/vegalite/interactions/presentation/data-overlay'; +import { geoArea } from 'd3-geo'; +import { bearing, buildRoutes, headSize, legPoint, legWidths, widestLeg, routeArrows, routeCurve, ROUTE_WIDTH, STOP_LEGS_MAX } from '../src/chart-types/map-routes'; +import { addVegaLiteInteractions, injectVegaInteractionStore, vegaGeoFocusSource } from '../src/vegalite/interactions/compile'; +import { oneMarkHits, sceneItems } from '../src/vegalite/interactions/hit-adapter'; +import { INTERACTION_KEY } from '../src/vegalite/interactions/stores'; +import { pointAlongPath, segmentRowPoint, segmentMidpointConnectionPoint } from '../src/vegalite/interactions/presentation/annotation-overlay'; +import { mapDef } from '../src/vegalite/templates/map'; +import { ROUTE_DATUM, ROUTE_PART } from '../src/vegalite/templates/map-routes'; +import { withBundledBoundaries } from '../src/vegalite/boundary-loader'; + +const STOPS = [ + { Stop: 3, Place: 'C', longitude: 20, latitude: 10 }, + { Stop: 1, Place: 'A', longitude: 0, latitude: 10 }, + { Stop: 2, Place: 'B', longitude: 10, latitude: 10 }, +]; + +function routeMap(rows: any[], encodings: Record, chartProperties: Record = {}): any { + return assembleVegaLite({ + data: { values: rows }, + semantic_types: { Stop: 'Rank', Place: 'Name', longitude: 'Longitude', latitude: 'Latitude', Ship: 'Category', Speed: 'Quantity' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', ...encodings }, chartProperties, canvasSize: { width: 480, height: 320 } }, + } as any); +} + +const markType = (layer: any) => (typeof layer?.mark === 'string' ? layer.mark : layer?.mark?.type); +/** A route's layers by what they draw: its casing, its line, its heads, then the heads' halo (absent ones left out). */ +const routeLayers = (spec: any) => { + const layers = spec.layer.filter((layer: any) => layer?.data?.values?.[0]?.[ROUTE_DATUM]); + const part = (layer: any) => layer.data.values[0][ROUTE_PART]; + const line = layers.find((layer: any) => part(layer) === 'leg'); + const lineAt = spec.layer.indexOf(line); + const heads = layers.filter((layer: any) => part(layer) === 'head'); + return [ + layers.find((layer: any) => part(layer) === 'casing'), + line, + heads.find((layer: any) => spec.layer.indexOf(layer) > lineAt), + heads.find((layer: any) => spec.layer.indexOf(layer) < lineAt), + ].filter(Boolean); +}; +const strip = (spec: any) => JSON.parse(JSON.stringify(spec, (key, value) => (key.startsWith('_') ? undefined : value))); + +describe('route geometry', () => { + it('joins each series in its order: numbers by value, dates by time, text with its numbers read', () => { + const rows = [ + { s: 'x', o: 10, lon: 2, lat: 0 }, { s: 'x', o: 9, lon: 1, lat: 0 }, { s: 'y', o: 'stop 10', lon: 9, lat: 0 }, + { s: 'y', o: 'stop 2', lon: 8, lat: 0 }, { s: 'z', o: '2024-03-01', lon: 5, lat: 5 }, { s: 'z', o: '2024-01-15', lon: 4, lat: 4 }, + ]; + const routes = buildRoutes(rows, { longitude: 'lon', latitude: 'lat', order: 'o', series: 's', curve: 'great-circle' }); + expect(routes.map((route) => [route.series, route.stops.map(([lon]) => lon)])).toEqual([['x', [1, 2]], ['y', [8, 9]], ['z', [4, 5]]]); + }); + + it('leaves out rows without a place or an order, and a series of one stop', () => { + const rows = [ + { o: 1, lon: 0, lat: 0 }, { o: null, lon: 5, lat: 5 }, { o: 2, lon: 'x', lat: 0 }, { o: 3, lon: 3, lat: 0 }, { o: 4, lon: 0, lat: 95 }, + ]; + expect(buildRoutes(rows, { longitude: 'lon', latitude: 'lat', order: 'o' })[0].stops).toEqual([[0, 0], [3, 0]]); + expect(buildRoutes([{ o: 1, lon: 0, lat: 0 }], { longitude: 'lon', latitude: 'lat', order: 'o' })).toEqual([]); + }); + + it('bows stops into arcs on a flat map, follows great circles on a globe or along a track', () => { + expect(routeCurve('auto', false, 3)).toBe('arc'); + expect(routeCurve(undefined, true, 3)).toBe('great-circle'); + expect(routeCurve('auto', false, STOP_LEGS_MAX + 1)).toBe('great-circle'); + expect(routeCurve('straight', true, 3)).toBe('straight'); + }); + + it('bows a leg to the left of travel, so a leg out and the leg back part ways', () => { + const east = legPoint([0, 0], [20, 0], 'arc')(0.5); + const west = legPoint([20, 0], [0, 0], 'arc')(0.5); + expect(east[1]).toBeGreaterThan(1); + expect(west[1]).toBeLessThan(-1); + expect(legPoint([0, 0], [20, 0], 'arc')(0)).toEqual([0, 0]); + }); + + it('runs a straight leg the short way across the antimeridian', () => { + const [lon] = legPoint([170, 0], [-170, 0], 'straight')(0.5); + expect(Math.abs(lon)).toBeCloseTo(180, 6); + }); + + it('puts a head on every leg of a route of stops, and only on the end of a track', () => { + const stops = buildRoutes(STOPS, { longitude: 'longitude', latitude: 'latitude', order: 'Stop' }); + expect(routeArrows(stops, 'auto', false).map((arrow) => arrow.tip)).toEqual([[10, 10], [20, 10]]); + const track = Array.from({ length: STOP_LEGS_MAX + 2 }, (_, i) => ({ o: i, lon: i, lat: 0 })); + const arrows = routeArrows(buildRoutes(track, { longitude: 'lon', latitude: 'lat', order: 'o' }), 'auto', false); + expect(arrows.map((arrow) => arrow.tip)).toEqual([[STOP_LEGS_MAX + 1, 0]]); + }); + + it('gives a leg that comes back to its start no head', () => { + const rows = [{ o: 1, lon: 0, lat: 0 }, { o: 2, lon: 0, lat: 0 }, { o: 3, lon: 4, lat: 0 }]; + expect(routeArrows(buildRoutes(rows, { longitude: 'lon', latitude: 'lat', order: 'o' }), 'auto', false)).toHaveLength(1); + }); +}); + +describe('Map routes in Vega-Lite', () => { + it('draws nothing more without an order field', () => { + expect(routeLayers(routeMap(STOPS, {}))).toHaveLength(0); + }); + + it('draws every halo, then the points, the line and the heads', () => { + const spec = routeMap(STOPS, { order: 'Stop' }); + const types = spec.layer.map((layer: any) => (layer?.data?.values?.[0]?.[ROUTE_DATUM] ? `route:${markType(layer)}` : markType(layer))); + const circle = types.indexOf('circle'); + // The casing and the heads' halo, the stops, the line, then the heads over all. + expect(types.slice(circle - 2, circle + 2)).toEqual(['route:geoshape', 'route:point', 'circle', 'route:geoshape']); + expect(types.lastIndexOf('route:point')).toBeGreaterThan(circle + 1); + const [casing, line, , halo] = routeLayers(spec); + // The halo is white on a light map, round the line and its head alike, a hairline each side. + expect(casing.mark.stroke).toBe('#ffffff'); + expect(halo.mark).toMatchObject({ fill: '#ffffff', stroke: '#ffffff', strokeJoin: 'miter' }); + expect(casing.data.values.every((leg: any) => leg.flintCasingWidth === line.mark.strokeWidth + 1.5)).toBe(true); + // Drawn sharp: square ends, mitred corners. + expect(line.mark).toMatchObject({ strokeCap: 'butt', strokeJoin: 'miter' }); + expect(casing.mark).toMatchObject({ strokeCap: 'butt', strokeJoin: 'miter' }); + expect(line.mark.stroke).toMatch(/^#/); + expect(line.data.values[0].geometry.type).toBe('LineString'); + expect(line.encoding.tooltip).toBeNull(); + // A long leg can run past even a world frame: every route layer stays inside the plot. + expect(routeLayers(spec).every((layer: any) => layer.mark.clip === true)).toBe(true); + }); + + it('leaves the heads off when arrows is false', () => { + const spec = routeMap(STOPS, { order: 'Stop' }, { arrows: false }); + expect(routeLayers(spec).map(markType)).toEqual(['geoshape', 'geoshape']); + expect(spec.layer.some((layer: any) => layer?.data?.values?.[0]?.[ROUTE_PART] === 'head')).toBe(false); + }); + + it('colours each route as its series and keeps the points’ own key', () => { + const rows = [...STOPS.map((row) => ({ ...row, Ship: 'a' })), ...STOPS.map((row) => ({ ...row, Ship: 'b', latitude: 20 }))]; + const spec = routeMap(rows, { order: 'Stop', color: 'Ship' }); + const [, line, heads] = routeLayers(spec); + // One shape per leg, carrying the row it leaves from. + expect(line.data.values.map((feature: any) => [feature.Ship, feature.Stop])).toEqual([['a', 1], ['a', 2], ['b', 1], ['b', 2]]); + expect(line.encoding.color.field).toBe('Ship'); + expect(heads.encoding.color.field).toBe('Ship'); + const vega: any = compile(strip(spec)).spec; + expect(vega.legends ?? []).toHaveLength(1); + expect(vega.scales.filter((scale: any) => scale.name === 'color')).toHaveLength(1); + }); + + it('draws a route in a neutral ink where the colour is a quantity, not its series', () => { + const spec = routeMap(STOPS.map((row) => ({ ...row, Speed: row.Stop * 3 })), { order: 'Stop', color: 'Speed' }); + const [, line] = routeLayers(spec); + expect(line.encoding.color).toBeUndefined(); + expect(line.data.values).toHaveLength(2); + }); + + it('rims its casing in the ground on a dark map, and gives its heads no rim', () => { + const spec = routeMap(STOPS, { order: 'Stop' }, { mapStyle: 'dark' }); + const [casing, , heads] = routeLayers(spec); + expect(casing.mark.stroke).toBe('#1d2227'); + // A head has no rim: it is joined to its line, and the dark map's ring for dots passes it by. + expect(heads.mark.stroke).toBeNull(); + }); + + it('hides the heads past a globe’s horizon', () => { + const spec = routeMap(STOPS, { order: 'Stop' }, { projection: 'orthographic' }); + const heads = routeLayers(spec).find((layer: any) => markType(layer) === 'point'); + expect(heads.encoding.opacity.condition[0]).toMatchObject({ value: 0 }); + expect(heads.encoding.opacity.condition[0].test).toContain('__flint_geo_rotate'); + }); + + it('points each head along its leg on screen', async () => { + const rows = [ + { Stop: 1, longitude: 0, latitude: 0 }, { Stop: 2, longitude: 10, latitude: 0 }, { Stop: 3, longitude: 0, latitude: 0.001 }, + ]; + const view = new View(parse(compile(strip(routeMap(rows, { order: 'Stop' }, { curve: 'great-circle' }))).spec as any), { + renderer: 'none', loader: withBundledBoundaries(loader()), + } as any); + await view.runAsync(); + const angles: number[] = []; + const visit = (node: any) => { + // The heads, not their halo beneath the line, which turns with them. + if (node?.marktype === 'symbol' && node.items?.[0]?.datum?.[ROUTE_DATUM] && node.items[0].strokeWidth === 0) angles.push(...node.items.map((item: any) => item.angle)); + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + expect(angles).toHaveLength(2); + expect(angles[0]).toBeCloseTo(0, 0); + expect(Math.abs(angles[1])).toBeCloseTo(180, 0); + }); + + it('takes the map’s focus regions from its land, never its routes', () => { + const vega: any = compile(strip(routeMap(STOPS, { order: 'Stop' }))).spec; + const source = vegaGeoFocusSource(vega); + const dataset = vega.data.find((entry: any) => entry.name === source); + expect(dataset?.values?.[0]?.[ROUTE_DATUM]).toBeUndefined(); + }); +}); + +describe('Map routes in Plotly', () => { + const plotlyMap = (chartProperties: Record = {}) => assemblePlotly({ + data: { values: STOPS }, + semantic_types: { Stop: 'Rank', Place: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop' }, chartProperties }, + } as any); + + it('draws the casing beneath the points, and the line and heads over them, turned to each leg', () => { + const traces = plotlyMap().data; + expect(traces.map((trace: any) => trace.mode)).toEqual(['lines', 'markers', 'lines', 'markers']); + expect(traces[0].line.color).toBe('#ffffff'); + expect(traces[2].line.color).not.toBe('#ffffff'); + const heads = traces[3]; + expect(heads.marker.angleref).toBe('up'); + // Both legs run east; mid-arc the bow turns them a little south of it. + for (const angle of heads.marker.angle) expect(Math.abs(angle - 90)).toBeLessThan(6); + expect(heads.hoverinfo).toBe('skip'); + }); + + it('paints each leg in the colour of the row it leaves where a category names stretches of one route', () => { + const rows = STOPS.map((row) => ({ ...row, Leg: row.Stop === 1 ? 'Out' : 'Back', Voyage: 'One' })); + const traces = assemblePlotly({ + data: { values: rows }, + semantic_types: { Stop: 'Rank', Place: 'Name', Leg: 'Category', Voyage: 'Category', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', color: 'Leg', detail: 'Voyage' } }, + } as any).data; + const lines = traces.filter((trace: any) => trace.mode === 'lines' && trace.line.color !== '#ffffff'); + // Two legs, Out then Back, each in its own colour, neither the neutral ink. + expect(lines).toHaveLength(2); + expect(new Set(lines.map((trace: any) => trace.line.color)).size).toBe(2); + expect(lines.map((trace: any) => trace.line.color)).not.toContain('#4a5058'); + }); + + it('leaves the heads off when arrows is false', () => { + expect(plotlyMap({ arrows: false }).data.map((trace: any) => trace.mode)).toEqual(['lines', 'markers', 'lines']); + }); + + it('reads a compass bearing clockwise from north', () => { + expect(bearing([0, 0], [0, 10])).toBeCloseTo(0, 6); + expect(bearing([0, 0], [10, 0])).toBeCloseTo(90, 6); + expect(bearing([0, 0], [-10, 0])).toBeCloseTo(270, 6); + }); +}); + +describe('Map routes as annotation targets', () => { + const odyssey = [ + { Stop: 1, Place: 'Troy', longitude: 26.24, latitude: 39.96 }, + { Stop: 2, Place: 'Ismarus', longitude: 25.52, latitude: 40.89 }, + { Stop: 3, Place: 'Djerba', longitude: 10.86, latitude: 33.81 }, + ]; + + it('draws a shape per leg carrying the row it leaves from, its casing and head too', () => { + const spec = routeMap(odyssey, { order: 'Stop' }); + const [casing, line, heads] = routeLayers(spec); + expect(line.data.values.map((leg: any) => [leg.Place, leg[ROUTE_PART]])).toEqual([['Troy', 'leg'], ['Ismarus', 'leg']]); + expect(casing.data.values.map((leg: any) => leg[ROUTE_PART])).toEqual(['casing', 'casing']); + expect(heads.data.values.map((head: any) => [head.Place, head[ROUTE_PART]])).toEqual([['Troy', 'head'], ['Ismarus', 'head']]); + }); + + async function instrumentedView() { + const spec = routeMap(odyssey, { order: 'Stop' }, { curve: 'arc' }); + const plan = addVegaLiteInteractions(spec, [], true)!; + const compiled = compile(strip(spec)).spec as any; + injectVegaInteractionStore(compiled, plan); + const view = new View(parse(compiled), { renderer: 'none', loader: withBundledBoundaries(loader()) } as any); + await view.runAsync(); + return view; + } + + it('keys each leg as its row, gives it its drawn curve, and leaves its casing and head out of the targets', async () => { + const view = await instrumentedView(); + const items = sceneItems(view); + const legs = items.filter((item) => item.datum?.[ROUTE_PART] === 'leg'); + const dots = items.filter((item) => item.mark?.marktype === 'symbol' && item.datum?.[ROUTE_PART] === undefined); + expect(legs).toHaveLength(2); + expect(items.some((item) => item.datum?.[ROUTE_PART] === 'casing' || item.datum?.[ROUTE_PART] === 'head')).toBe(false); + // The land is structure: none of its shapes is a target. + expect(items.filter((item) => item.mark?.marktype === 'shape' && item.datum?.[ROUTE_PART] === undefined)).toHaveLength(0); + const troy = dots.find((dot) => dot.datum.Place === 'Troy'); + expect(legs[0].datum[INTERACTION_KEY]).toBe(troy.datum[INTERACTION_KEY]); + // The bowed leg is drawn through many points, from Troy's dot. + const points = legs[0].interactionGeometry.points; + expect(legs[0].interactionGeometry.kind).toBe('segment'); + expect(points.length).toBeGreaterThan(10); + expect(Math.hypot(points[0].x - troy.x, points[0].y - troy.y)).toBeLessThan(1); + }); + + it('names the dot for a row, the leg only when the update asks for a path', () => { + const dot = { datum: { [INTERACTION_KEY]: 'k' }, markType: 'symbol', source: 'mark' } as any; + const leg = { datum: { [INTERACTION_KEY]: 'k', [ROUTE_PART]: 'leg' }, markType: 'shape', source: 'mark' } as any; + expect(oneMarkHits([leg, dot])).toEqual([dot]); + expect(oneMarkHits([leg, dot], true)).toEqual([leg]); + const semantics = mapDef.semanticInteractions!({ + resolvedEncodings: { longitude: { field: 'longitude', type: 'quantitative' }, latitude: { field: 'latitude', type: 'quantitative' }, order: { field: 'Stop', type: 'quantitative' } }, + } as any); + const context = { keyField: INTERACTION_KEY } as any; + const kind = (role: string, hits: any[]) => semantics.resolve!({ gesture: 'rectangle', role, hits } as any, context)?.visual.kind; + expect(kind('external-selection', [leg, dot])).toBe('mark'); + expect(kind('leg', [leg, dot])).toBe('path'); + expect(kind('mark', [leg])).toBe('path'); + }); + + it('reads a curved leg along its length: halfway on the curve, its ends at its stops', () => { + const curve = [{ x: 0, y: 0 }, { x: 10, y: -10 }, { x: 20, y: -10 }, { x: 30, y: 0 }]; + const middle = pointAlongPath(curve, 0.5); + expect(middle.y).toBeCloseTo(-10, 6); + expect(middle.x).toBeCloseTo(15, 6); + const item = { datum: { Stop: 1 }, interactionGeometry: { kind: 'segment', points: curve, annotationPoints: curve, endDatum: { Stop: 2 } } }; + expect(segmentMidpointConnectionPoint(item, { x: 15, y: 50 }).point.y).toBeCloseTo(-10, 6); + expect(segmentRowPoint(item, { Stop: 2 }, 'point')).toEqual({ x: 30, y: 0 }); + expect(segmentRowPoint(item, { Stop: 1 }, 'point')).toEqual({ x: 0, y: 0 }); + }); +}); + +describe('overlays and regions placed by longitude and latitude', () => { + const overlay = (mark: string, encodings: Record, values: Record[] = [{ lon: 20, lat: 38, lon2: 26, lat2: 40 }]) => ({ + mark, role: 'test', data: { values }, + encodings: Object.fromEntries(Object.entries(encodings).map(([channel, field]) => [channel, { field }])), + }) as any; + + it('reads a place for a point, text or line, and two for a rule or rect, never x or y beside them', () => { + expect(geoOverlayChannels(overlay('point', { longitude: 'lon', latitude: 'lat' }))).toEqual(['longitude', 'latitude']); + expect(geoOverlayChannels(overlay('rule', { longitude: 'lon', latitude: 'lat', longitude2: 'lon2', latitude2: 'lat2' }))).toHaveLength(4); + expect(geoOverlayChannels(overlay('rect', { longitude: 'lon', latitude: 'lat' }))).toBeUndefined(); + expect(geoOverlayChannels(overlay('point', { longitude: 'lon', latitude: 'lat', x: 'lon' }))).toBeUndefined(); + // A map overlay is no x/y overlay. + expect(overlayChannels(overlay('point', { longitude: 'lon', latitude: 'lat' }))).toBeUndefined(); + }); + + it('rings a box clockwise along its parallels, across the antimeridian where its west edge lies east', () => { + const small = (ring: [number, number][]) => geoArea({ type: 'Polygon', coordinates: [ring] } as any) < Math.PI; + const box = lonLatBox(9.5, 38, 16, 41.5); + expect(box[0]).toEqual([9.5, 38]); + expect(small(box)).toBe(true); + const pacific = lonLatBox(170, -20, -170, -10); + expect(small(pacific)).toBe(true); + expect(Math.max(...pacific.map(([lon]) => lon))).toBeCloseTo(190, 6); + }); + + const map: ChartAssemblyInput = { + data: { values: STOPS }, semantic_types: { Stop: 'Rank', Place: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop' } }, + } as any; + const bars: ChartAssemblyInput = { + data: { values: [{ c: 'a', v: 1 }] }, semantic_types: { c: 'Category', v: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'c' }, y: { field: 'v' } } }, + } as any; + const check = (input: ChartAssemblyInput, op: unknown) => validateChart(input, 'vegalite', { updates: [{ id: 'u', ops: [op as any] }] }).updates![0].ops[0]; + + it('takes a map overlay on a map, with places in degrees, and on no other chart', () => { + const line = { op: 'set-overlay', name: 'n', value: overlay('line', { longitude: 'lon', latitude: 'lat' }) }; + expect(check(map, line).ok).toBe(true); + expect(check(bars, line).reason).toContain('is no map'); + const off = { op: 'set-overlay', name: 'n', value: overlay('point', { longitude: 'lon', latitude: 'lat' }, [{ lon: 20, lat: 95 }]) }; + expect(check(map, off).reason).toContain('latitude in degrees'); + const rule = { op: 'set-overlay', name: 'n', value: overlay('rule', { longitude: 'lon', latitude: 'lat' }) }; + expect(check(map, rule).reason).toContain('longitude2 and latitude2'); + }); + + it('takes a map region as a box of longitude and latitude', () => { + const region = (value: unknown) => check(map, { op: 'annotate-region', name: 'r', value }); + expect(region({ longitude: [9.5, 16], latitude: [38, 41.5], text: 'Tyrrhenian Sea' })).toMatchObject({ + ok: true, text: 'region "r" over longitude 9.5 to 16, latitude 38 to 41.5, captioned "Tyrrhenian Sea"', + }); + expect(region({ longitude: [9.5, 16] }).reason).toContain('latitude: [south, north]'); + expect(region({ longitude: [9.5, 16], latitude: [38, 41.5], x: [0, 1] }).reason).toContain('no x or y'); + expect(check(bars, { op: 'annotate-region', name: 'r', value: { longitude: [0, 1], latitude: [0, 1] } }).reason).toContain('is no map'); + }); +}); + +describe('route widths and joined heads', () => { + const crew = [ + { Stop: 1, Crew: 600, longitude: 0, latitude: 10 }, + { Stop: 2, Crew: 300, longitude: 10, latitude: 10 }, + { Stop: 3, Crew: 0, longitude: 20, latitude: 10 }, + ]; + + it('widens a leg by the value of the row it leaves, from zero, and sizes its head to it', () => { + expect(legWidths([600, 300, 0, null])).toEqual([ROUTE_WIDTH.max, (ROUTE_WIDTH.min + ROUTE_WIDTH.max) / 2 + 0, ROUTE_WIDTH.min, ROUTE_WIDTH.min] + .map((width, index) => (index === 1 ? ROUTE_WIDTH.min + (ROUTE_WIDTH.max - ROUTE_WIDTH.min) / 2 : width))); + // A hairline's head is slim and small; a broad line's broad. + expect(headSize(1).length).toBeCloseTo(6.6, 6); + expect(headSize(1).halfWidth).toBeCloseTo(2.1, 6); + expect(headSize(8)).toEqual({ length: 22, halfWidth: 9.8 }); + expect(headSize(0.5).length / headSize(0.5).halfWidth).toBeGreaterThan(headSize(8).length / headSize(8).halfWidth); + }); + + it('keeps a small head on a short leg, no longer than the leg, on screen', async () => { + const rows = [{ Stop: 1, longitude: 0, latitude: 0 }, { Stop: 2, longitude: 0.4, latitude: 0 }, { Stop: 3, longitude: 30, latitude: 10 }]; + const view = new View(parse(compile(strip(routeMap(rows, { order: 'Stop' }, { curve: 'straight' }))).spec as any), { renderer: 'none', loader: withBundledBoundaries(loader()) } as any); + await view.runAsync(); + const heads: any[] = []; + const visit = (node: any) => { + if (node?.marktype === 'symbol' && node.items?.[0]?.datum?.[ROUTE_PART] === 'head' && node.items[0].strokeWidth === 0) heads.push(...node.items); + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + const short = heads.find((head) => head.datum.Stop === 1); + // Shown, at no less than 3 px and no longer than its leg. + expect(short.opacity).not.toBe(0); + expect(short.datum.flintScale * short.datum.flintBack).toBeGreaterThanOrEqual(3); + expect(short.datum.flintScale * short.datum.flintBack).toBeLessThanOrEqual(short.datum.flintDist[short.datum.flintDist.length - 1]); + }); + + it('rings and shrinks the heads of many legs arriving at one stop, and keeps the widest twelve', () => { + const rows = Array.from({ length: 16 }, (_, i) => [ + { Trip: i, Stop: 1, Crew: i + 1, longitude: 30 * Math.cos(i), latitude: 20 * Math.sin(i) }, + { Trip: i, Stop: 2, Crew: i + 1, longitude: 0, latitude: 0 }, + ]).flat(); + const [, line, heads] = routeLayers(routeMap(rows, { order: 'Stop', detail: 'Trip', strokeWidth: 'Crew' } as any)); + expect(heads.data.values).toHaveLength(12); + expect(heads.data.values.every((head: any) => head.flintRing > 0)).toBe(true); + // The four narrowest legs keep no head, and run whole to the stop. + const headless = line.data.values.filter((leg: any) => leg.flintJoin === 0).map((leg: any) => leg.Crew).sort((a: number, b: number) => a - b); + expect(headless).toEqual([1, 2, 3, 4]); + // Shrunk: shorter than a head of the same width alone. + const widest = heads.data.values.find((head: any) => head.Crew === 16); + const alone = routeLayers(routeMap(rows.filter((row) => row.Trip === 15), { order: 'Stop', detail: 'Trip', strokeWidth: 'Crew' } as any))[2].data.values[0]; + expect(widest.flintBack).toBeLessThan(alone.flintBack); + expect(alone.flintRing).toBe(0); + }); + + it('draws no halo round a leg, or its head, thinner than 1.5 px', () => { + const rows = [{ Stop: 1, Crew: 600, longitude: 0, latitude: 10 }, { Stop: 2, Crew: 0, longitude: 10, latitude: 10 }, { Stop: 3, Crew: 0, longitude: 20, latitude: 10 }]; + const [casing, line, , halo] = routeLayers(routeMap(rows, { order: 'Stop', strokeWidth: 'Crew' } as any)); + expect(line.data.values).toHaveLength(2); + // The 8 px leg keeps its halo; the 1 px leg takes none. + expect(casing.data.values.map((leg: any) => leg.Stop)).toEqual([1]); + expect(halo.data.values.map((head: any) => head.Stop)).toEqual([1]); + }); + + it('thins the widest leg as long, widened legs crowd the plot, down to 40% of its width', () => { + const legsOf = (rows: { o: number; s: number; lon: number; lat: number }[]) => buildRoutes(rows, { longitude: 'lon', latitude: 'lat', order: 'o', series: 's' }).flatMap((route) => route.legs); + const few = legsOf([{ s: 1, o: 1, lon: 0, lat: 0 }, { s: 1, o: 2, lon: 20, lat: 5 }, { s: 1, o: 3, lon: 40, lat: 0 }]); + expect(widestLeg(few, [5, 5], 480)).toBe(ROUTE_WIDTH.max); + const many = legsOf(Array.from({ length: 80 }, (_, i) => [{ s: i, o: 1, lon: -60, lat: i % 20 }, { s: i, o: 2, lon: 60, lat: (i * 7) % 20 }]).flat()); + const crowded = widestLeg(many, many.map(() => 10), 480); + expect(crowded).toBeLessThan(ROUTE_WIDTH.max); + expect(crowded).toBeGreaterThanOrEqual(0.4 * ROUTE_WIDTH.max); + expect(legWidths([10, 5], 10, crowded)[0]).toBe(crowded); + }); + + it('reads strokeWidth as the route’s width, with a key of its own, and draws only the route’s start', () => { + const spec = routeMap(crew, { order: 'Stop', strokeWidth: 'Crew' } as any); + const [casing, line, heads] = routeLayers(spec); + expect(line.encoding.strokeWidth).toMatchObject({ field: 'Crew', scale: { domain: [0, 600], range: [ROUTE_WIDTH.min, ROUTE_WIDTH.max] }, legend: { symbolType: 'stroke' } }); + expect(casing.data.values.map((leg: any) => leg.flintCasingWidth)).toEqual([ROUTE_WIDTH.max + 1.5, ROUTE_WIDTH.min + 3.5 + 1.5]); + expect(spec.resolve.scale.strokeWidth).toBe('independent'); + const dots = spec.layer.find((layer: any) => markType(layer) === 'circle'); + expect(dots.encoding.size).toBeUndefined(); + // The arrows mark every stop but the first: the rest stay undrawn, where the pointer finds their rows. + expect(dots.encoding.opacity.condition[0]).toMatchObject({ value: 0 }); + // The wider leg's head is the longer. + const reach = (shape: string) => Math.abs(Number(shape.match(/L(-[\d.]+),/)![1])); + expect(reach(heads.data.values[0].flintHeadShape)).toBeGreaterThan(reach(heads.data.values[1].flintHeadShape)); + }); + + it('ends a headed leg’s line at its head’s base, drops the head where the leg is too short on screen, and draws a leg without a head whole', () => { + const spec = routeMap(crew, { order: 'Stop' }); + const [casing, line, heads] = routeLayers(spec); + const [leg] = line.data.values; + // A headed leg is cut at its head's base, and its halo with it: the head's own halo carries it on. + expect(leg).toMatchObject({ flintJoin: 1, flintFit: 1 }); + expect(casing.encoding.strokeDash).toEqual(line.encoding.strokeDash); + expect(line.encoding.strokeDash.value.expr).toContain('datum.flintJoin'); + // Only a head a few px long is dropped; the scale is computed on the head's own data. + expect(heads.encoding.opacity.condition[0].test).toBe('datum.flintScale * datum.flintBack < 3'); + expect(heads.transform.map((step: any) => step.as)).toEqual(['flintPts', 'flintDist', 'flintScale', 'flintX', 'flintY', 'flintBaseX', 'flintBaseY', 'flintAngle', 'flintSize']); + expect(heads.mark).toMatchObject({ fillOpacity: line.mark.strokeOpacity }); + const plain = routeLayers(routeMap(crew, { order: 'Stop' }, { arrows: false }))[1]; + expect(plain.data.values.every((each: any) => each.flintJoin === 0)).toBe(true); + }); + + it('draws every stop where a label anchors it, else only each route’s start; the routes read nothing of the dots', () => { + const spec = routeMap(crew, { order: 'Stop', strokeWidth: 'Crew', text: 'Stop' } as any); + const dots = spec.layer.find((layer: any) => markType(layer) === 'circle'); + expect(dots.mark).toMatchObject({ opacity: 1, fillOpacity: 1, stroke: '#ffffff', strokeWidth: 1 }); + expect(dots.encoding.opacity?.condition?.[0]?.value).not.toBe(0); + // Uniform: half the median leg width (8 and 4.5 px legs: 4.5) and a pixel, kept within 2.5–4 px. + expect(dots.mark.size).toBeCloseTo((2 * 3.25) ** 2, 6); + expect(dots.encoding.size).toBeUndefined(); + // Every dot or only the start, the routes are the same. + const plain = routeMap(crew, { order: 'Stop', strokeWidth: 'Crew' } as any); + const [, line, heads] = routeLayers(spec); + const [, plainLine, plainHeads] = routeLayers(plain); + const unlabelled = (values: any[]) => values.map(({ flintRoutePart, flintTail, flintBack, flintFit, flintJoin }) => ({ flintRoutePart, flintTail, flintBack, flintFit, flintJoin })); + expect(unlabelled(line.data.values)).toEqual(unlabelled(plainLine.data.values)); + expect(unlabelled(heads.data.values)).toEqual(unlabelled(plainHeads.data.values)); + expect(plain.layer.find((layer: any) => markType(layer) === 'circle').encoding.opacity.condition[0].value).toBe(0); + }); + + it('sizes stops by size, zero-based by area, drawn without asking, beside legs widened by strokeWidth', () => { + const rows = crew.map((row, index) => ({ ...row, Days: [10, 0, 40][index] })); + const spec = routeMap(rows, { order: 'Stop', size: 'Days', strokeWidth: 'Crew' } as any); + const dots = spec.layer.find((layer: any) => markType(layer) === 'circle'); + // `size` draws every stop. + expect(dots.mark.opacity).toBe(1); + expect(dots.encoding.opacity?.condition?.[0]?.value).not.toBe(0); + expect(dots.encoding.size).toMatchObject({ field: 'Days', scale: { domain: [0, 40], range: [25, 196] } }); + expect(dots.encoding.strokeWidth).toBeUndefined(); + expect(routeLayers(spec)[1].encoding.strokeWidth).toMatchObject({ field: 'Crew', legend: { symbolType: 'stroke' } }); + // Its key is the dots' own, not merged away with the heads' sizes. + const vega: any = compile(strip(spec)).spec; + expect((vega.legends ?? []).some((legend: any) => legend.size && legend.title === 'Days')).toBe(true); + // Its keys are two: the dots' sizes and the legs' widths. + expect((vega.legends ?? []).some((legend: any) => legend.strokeWidth && legend.title === 'Crew')).toBe(true); + // On a map without routes, size is the bubbles' own, and strokeWidth, with no legs to widen, is left out. + const points = routeMap(rows, { size: 'Days', strokeWidth: 'Crew' } as any); + const bubbles = points.layer.find((layer: any) => markType(layer) === 'circle'); + expect(bubbles.encoding.size.field).toBe('Days'); + expect(bubbles.encoding.strokeWidth).toBeUndefined(); + expect(points._warnings.map((warning: any) => warning.code)).toContain('map-width-without-routes'); + }); + + it('draws only each route’s start where the routes carry the colour, and every stop where the dots do', async () => { + const rows = [1, 2, 3, 4, 5].map((Stop) => ({ Stop, Trip: 'x', Ship: Stop <= 2 ? 'A' : 'B', Speed: Stop * 3, longitude: Stop * 8, latitude: Stop % 2 ? 0 : 6 })); + const drawn = async (encodings: Record) => { + const spec = routeMap(rows, { order: 'Stop', detail: 'Trip', ...encodings } as any); + const view = new View(parse(compile(strip(spec)).spec as any), { renderer: 'none', loader: withBundledBoundaries(loader()) } as any); + await view.runAsync(); + const dots: any[] = []; + const visit = (node: any) => { + if (node?.marktype === 'symbol' && !node.items?.[0]?.datum?.[ROUTE_PART] && node.items?.[0]?.datum?.Stop !== undefined) dots.push(...node.items); + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + return dots.filter((dot) => dot.opacity !== 0).map((dot) => dot.datum.Stop).sort(); + }; + // A colour naming stretches of the route is the lines': the heads mark every stop but the first. + expect(await drawn({ color: 'Ship' })).toEqual([1]); + // A quantity's colour is the dots'. + expect(await drawn({ color: 'Speed' })).toEqual([1, 2, 3, 4, 5]); + }); + + it('sets each head’s tip on its stop and draws each line from its first', async () => { + const spec = routeMap(crew, { order: 'Stop', text: 'Stop' } as any, { curve: 'straight' }); + const view = new View(parse(compile(strip(spec)).spec as any), { renderer: 'none', loader: withBundledBoundaries(loader()) } as any); + await view.runAsync(); + const legs: any[] = []; + const heads: any[] = []; + const stops: any[] = []; + const visit = (node: any) => { + const part = node?.items?.[0]?.datum?.[ROUTE_PART]; + if (node?.marktype === 'shape' && part === 'leg') legs.push(...node.items); + if (node?.marktype === 'symbol' && part === 'head' && node.items[0].fill !== '#ffffff') heads.push(...node.items); + if (node?.marktype === 'symbol' && !part && node.items?.[0]?.datum?.Stop !== undefined) stops.push(...node.items); + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + expect(legs).toHaveLength(2); + // Drawn from its first stop, through the dot, to its head. + for (const leg of legs) expect(leg.strokeDash).toHaveLength(2); + const at = (stop: number) => stops.find((item) => item.datum.Stop === stop); + // The head's tip stands on the next stop's middle, its dot beneath. + expect(heads).toHaveLength(2); + for (const head of heads) { + const next = at(head.datum.Stop + 1); + expect(Math.hypot(head.x - next.x, head.y - next.y)).toBeCloseTo(0, 1); + } + }); + + it('cuts no line on a globe, where a leg’s length on screen is not measured', () => { + const [, line, heads] = routeLayers(routeMap(crew, { order: 'Stop' }, { projection: 'orthographic' })); + expect(line.data.values.every((each: any) => each.flintJoin === 0)).toBe(true); + // Its heads keep their size. + expect(heads.data.values.every((each: any) => each.flintFit === 0)).toBe(true); + }); + + it('stops each leg’s line at the head on screen, through the live projection', async () => { + const spec = routeMap(crew, { order: 'Stop' }, { curve: 'great-circle' }); + const view = new View(parse(compile(strip(spec)).spec as any), { renderer: 'none', loader: withBundledBoundaries(loader()) } as any); + await view.runAsync(); + const items: any[] = []; + const visit = (node: any) => { + if (node?.marktype === 'shape' && node.items?.[0]?.datum?.[ROUTE_PART] === 'leg') items.push(...node.items); + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + expect(items).toHaveLength(2); + for (const item of items) { + const [drawn, gap] = item.strokeDash; + expect(gap).toBe(1000000); + expect(drawn).toBeGreaterThan(20); + } + }); + + it('draws a widened route in Plotly a leg at a time, each as wide as its row says, its stops as the Vega-Lite map does', () => { + const plotly = (encodings: Record, chartProperties: Record = {}) => assemblePlotly({ + data: { values: crew.map((row, index) => ({ ...row, Days: [10, 0, 40][index] })) }, + semantic_types: { Stop: 'Rank', Crew: 'Count', Days: 'Count', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', ...encodings }, chartProperties }, + } as any).data; + const traces = plotly({ strokeWidth: 'Crew' }); + const lines = traces.filter((trace: any) => trace.mode === 'lines' && trace.line.color !== '#ffffff'); + expect(lines.map((trace: any) => trace.line.width)).toEqual([ROUTE_WIDTH.max, ROUTE_WIDTH.min + (ROUTE_WIDTH.max - ROUTE_WIDTH.min) / 2]); + const dots = (encodings: Record, chartProperties?: Record) => + plotly(encodings, chartProperties).find((trace: any) => trace.mode.startsWith('markers') && !trace.hoverinfo).marker; + // Only the route's start by default; the rest undrawn, but still hovered. + expect(dots({ strokeWidth: 'Crew' }).opacity).toEqual([1, 0, 0]); + // Every stop where a label anchors it, one size (8 and 4.5 px legs: radius 3.25), or by size, zero-based by area (2.5 to 7 px). + expect(dots({ strokeWidth: 'Crew', text: 'Stop' }).size).toEqual([6.5, 6.5, 6.5]); + const sized = dots({ size: 'Days' }); + expect(sized.opacity).toBe(1); + expect(sized.size.map((d: number) => Number(d.toFixed(3)))).toEqual([Math.sqrt(25 + 171 / 4), 5, 14].map((d) => Number(d.toFixed(3)))); + }); +}); + +describe('the ground a point or route map stands on', () => { + const points = (chartProperties: Record = {}, values = STOPS) => routeMap(values, {}, chartProperties); + + it('fills a world map’s frame with water, outlines its land at the coast, and draws its borders as a mesh over it', () => { + const spec = points(); + const land = spec.layer.find((layer: any) => layer.data?.format?.feature === 'countries'); + const borders = spec.layer.find((layer: any) => layer.data?.format?.mesh); + expect(borders.data.format).toEqual({ type: 'topojson', mesh: 'countries', filter: 'interior' }); + expect(land.mark.stroke).not.toBe(borders.mark.stroke); + expect(borders.mark.strokeWidth).toBeGreaterThan(land.mark.strokeWidth); + const frame = spec.layer.find((layer: any) => markType(layer) === 'rect'); + expect(frame?.mark.fill).toBeDefined(); + expect(frame.mark.fill).not.toBe('#ffffff'); + // The land lies light on the water. + expect(land.mark.fill.toLowerCase() > frame.mark.fill.toLowerCase()).toBe(true); + }); + + it('lays the land’s own colour under a disputed border, so the dots are not drawn over a solid line', () => { + const spec = points({}, [{ Stop: 1, Place: 'Srinagar', longitude: 74.8, latitude: 34.1 }, { Stop: 2, Place: 'Delhi', longitude: 77.2, latitude: 28.6 }]); + const roles = spec.layer.map((layer: any) => (layer.data?.format?.feature === 'disputed' ? (layer.mark.strokeDash ? 'dots' : 'base') : null)).filter(Boolean); + expect(roles).toEqual(['base', 'dots']); + const land = spec.layer.find((layer: any) => layer.data?.format?.feature === 'countries'); + const base = spec.layer.find((layer: any) => layer.data?.format?.feature === 'disputed' && !layer.mark.strokeDash); + expect(base.mark.stroke).toBe(land.mark.fill); + }); + + it('leaves a US map on the page, its land toned, with no water round it', () => { + const spec = points({ region: 'us' }, [{ Stop: 1, Place: 'St Louis', longitude: -90.2, latitude: 38.6 }, { Stop: 2, Place: 'Astoria', longitude: -123.8, latitude: 46.2 }]); + expect(spec.layer.some((layer: any) => markType(layer) === 'rect')).toBe(false); + const land = spec.layer.find((layer: any) => layer.data?.format?.feature === 'states'); + expect(land.mark.fill).not.toBe('#ffffff'); + expect(land.mark.fill).not.toBe('#fcfcfc'); + }); + + it('draws a choropleth’s borders as lines too, outlines its regions at the coast, and fills a world map’s frame with water', () => { + const spec = assembleVegaLite({ + data: { values: [{ Country: 'France', Share: 0.5 }] }, semantic_types: { Country: 'Country', Share: 'Percentage' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Share' } }, + } as any) as any; + const regions = spec.layer.find((layer: any) => layer.encoding?.color?.field); + const borders = spec.layer.find((layer: any) => layer.data?.format?.mesh); + expect(borders.data.format).toMatchObject({ mesh: 'countries', filter: 'interior' }); + expect(regions.mark.stroke).not.toBe(borders.mark.stroke); + expect(spec.layer.some((layer: any) => markType(layer) === 'rect')).toBe(true); + // On a choropleth the dots of a disputed border stand on its line: no land-coloured cover across coloured regions. + expect(spec.layer.filter((layer: any) => layer.data?.format?.feature === 'disputed')).toHaveLength(1); + }); +}); + +describe('route ink, stops and track heads', () => { + const line = (spec: any) => routeLayers(spec)[1]; + + it('draws a route in the theme’s mark colour, and in a neutral ink beside dots coloured by another field', () => { + expect(line(routeMap(STOPS, { order: 'Stop' })).mark.stroke).toBe('#4c78a8'); + const quantity = routeMap(STOPS.map((row) => ({ ...row, Speed: row.Stop })), { order: 'Stop', color: 'Speed' }); + expect(line(quantity).mark.stroke).not.toBe('#4c78a8'); + expect(line(quantity).encoding.color).toBeUndefined(); + }); + + it('keeps a track’s head at its end however short its last leg, reading its fixes before', () => { + const track = Array.from({ length: STOP_LEGS_MAX + 6 }, (_, i) => ({ Stop: i, longitude: i * 0.3, latitude: Math.sin(i / 4) })); + const spec = routeMap(track, { order: 'Stop' }); + const dots = spec.layer.find((layer: any) => markType(layer) === 'circle'); + // A dot at its start; its fixes undrawn. + expect(dots.encoding.opacity.condition[0]).toMatchObject({ value: 0 }); + const [, , heads] = routeLayers(spec); + expect(heads.data.values).toHaveLength(1); + expect(heads.data.values[0].flintFit).toBe(0); + // Its tail runs back through the fixes before its end. + const tail = heads.data.values[0].flintTail.map((point: any) => point.coordinates); + expect(tail.slice(0, 2)).toEqual([[track.at(-1)!.longitude, track.at(-1)!.latitude], [track.at(-2)!.longitude, track.at(-2)!.latitude]]); + }); + + it('sets each head on its line: its tip at the stop, the middle of its base on the line a head’s length back', async () => { + const rows = [{ Stop: 1, longitude: 0, latitude: 0 }, { Stop: 2, longitude: 3, latitude: 0 }, { Stop: 3, longitude: 40, latitude: 30 }, { Stop: 4, longitude: 38, latitude: 34 }]; + const view = new View(parse(compile(strip(routeMap(rows, { order: 'Stop' }, { curve: 'arc' }))).spec as any), { + renderer: 'none', loader: withBundledBoundaries(loader()), + } as any); + await view.runAsync(); + const heads: any[] = []; + const legs = new Map(); + const visit = (node: any) => { + const part = node?.items?.[0]?.datum?.[ROUTE_PART]; + if (node?.marktype === 'symbol' && part === 'head' && node.items[0].strokeWidth === 0) heads.push(...node.items); + if (node?.marktype === 'shape' && part === 'leg') { + for (const item of node.items) { + const points: number[][] = []; + item.shape.context({ moveTo: (x: number, y: number) => points.push([x, y]), lineTo: (x: number, y: number) => points.push([x, y]), closePath() {}, beginPath() {} })(item); + item.shape.context(null); + legs.set(item.datum.Stop, points); + } + } + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + const shown = heads.filter((head) => head.opacity !== 0); + expect(shown.length).toBeGreaterThan(0); + for (const head of shown) { + const line = legs.get(head.datum.Stop)!; + const end = line.at(-1)!; + expect(Math.hypot(head.x - end[0], head.y - end[1])).toBeLessThan(0.01); + const length = head.datum.flintBack * Math.sqrt(head.size / 4); + const angle = (head.angle * Math.PI) / 180; + const base = [end[0] - Math.cos(angle) * length, end[1] - Math.sin(angle) * length]; + const off = Math.min(...line.slice(1).map((b, index) => { + const a = line[index]; + const [dx, dy] = [b[0] - a[0], b[1] - a[1]]; + const t = Math.max(0, Math.min(1, ((base[0] - a[0]) * dx + (base[1] - a[1]) * dy) / (dx * dx + dy * dy || 1))); + return Math.hypot(base[0] - a[0] - t * dx, base[1] - a[1] - t * dy); + })); + expect(off).toBeLessThan(0.5); + } + }); +}); + +describe('route expressions under a CSP-safe Vega', () => { + it('draws its heads and cuts its lines with the functions vega-interpreter provides', async () => { + const rows = [{ Stop: 1, longitude: 0, latitude: 0 }, { Stop: 2, longitude: 10, latitude: 0 }, { Stop: 3, longitude: 12, latitude: 8 }]; + const errors: unknown[] = []; + const view = new View(parse(compile(strip(routeMap(rows, { order: 'Stop' }))).spec as any, undefined, { ast: true }), { + renderer: 'none', loader: withBundledBoundaries(loader()), expr: expressionInterpreter, + } as any); + view.logger({ level: () => 0, error: (...args: unknown[]) => errors.push(args), warn: () => {}, info: () => {}, debug: () => {} } as any); + await view.runAsync(); + expect(errors).toEqual([]); + const heads: any[] = []; + const visit = (node: any) => { + if (node?.marktype === 'symbol' && node.items?.[0]?.datum?.[ROUTE_PART] === 'head' && node.items[0].strokeWidth === 0) heads.push(...node.items); + for (const item of node?.items ?? []) visit(item); + }; + visit((view.scenegraph() as any).root); + expect(heads.length).toBeGreaterThan(0); + expect(heads.every((head) => Number.isFinite(head.angle))).toBe(true); + }); +}); + +describe('route colour by stretch', () => { + it('paints each leg and its head in the colour of the row it leaves where a category names stretches of one route', () => { + const rows = STOPS.map((row, index) => ({ ...row, Leg: index < 2 ? 'Out' : 'Back', Voyage: 'One' })); + const spec = routeMap(rows, { order: 'Stop', color: 'Leg', detail: 'Voyage' }); + const [, line, heads] = routeLayers(spec); + expect(line.encoding.color).toMatchObject({ field: 'Leg', legend: null }); + expect(heads.encoding.color).toMatchObject({ field: 'Leg' }); + // Each leg takes the row it leaves, in stop order. + const byStop = [...rows].sort((a, b) => a.Stop - b.Stop); + expect(line.data.values.map((value: any) => value.Leg)).toEqual(byStop.slice(0, -1).map((row) => row.Leg)); + const vega: any = compile(strip(spec)).spec; + expect(vega.legends.filter((legend: any) => legend.fill === 'color' || legend.stroke === 'color')).toHaveLength(1); + }); +}); diff --git a/packages/flint-js/tests/map-style.test.ts b/packages/flint-js/tests/map-style.test.ts new file mode 100644 index 00000000..bb97d8f5 --- /dev/null +++ b/packages/flint-js/tests/map-style.test.ts @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { parseColor, luminance } from '../src/core/theme/presence'; +import { jenksColorClasses, quantileColorClasses } from '../src/core/color-controls'; +import { MAP_ROLE } from '../src/vegalite/templates/map-style'; +import { readCanvasFurniture } from '../src/vegalite/canvas-furniture'; + +/** + * A map's ground follows the theme's page, or one of the named map styles; a choropleth's colour + * is classed — quantiles unless asked otherwise — and both are chart properties a host can offer. + */ + +const GDP = [ + ['United States', 25000], ['China', 18000], ['Japan', 4200], ['Germany', 4100], ['India', 3400], ['France', 2800], + ['Brazil', 1900], ['Canada', 2100], ['Mexico', 1400], ['Nigeria', 480], ['Kenya', 110], ['Peru', 240], ['Chile', 300], + ['Egypt', 470], ['Vietnam', 410], ['Poland', 690], ['Norway', 580], ['Argentina', 630], ['Australia', 1700], ['Spain', 1400], +].map(([Country, Rate]) => ({ Country, Rate })); + +const choropleth = (properties: Record = {}, extra: Record = {}, color: Record = {}) => assembleVegaLite({ + data: { values: GDP }, + semantic_types: { Country: 'Country', Rate: 'Rate' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: { field: 'Rate', ...color } }, chartProperties: properties }, + ...extra, +} as any) as any; + +const units = (spec: any): any[] => { + const out: any[] = []; + const visit = (node: any) => { + if (!node || typeof node !== 'object') return; + out.push(node); + for (const key of ['layer', 'vconcat', 'hconcat', 'concat']) if (Array.isArray(node[key])) node[key].forEach(visit); + }; + visit(spec); + return out; +}; +const noDataOf = (spec: any): string => { + const color = units(spec).map((unit) => unit.encoding?.color).find((enc) => enc?.condition); + return (Array.isArray(color.condition) ? color.condition[0] : color.condition).value; +}; +const dark = (color: string) => luminance(parseColor(color)!) < 0.35; +/** The unit drawing the regions: the one whose colour comes from a field. */ +const regionsOf = (spec: any): any => units(spec).find((unit) => unit.encoding?.color?.field && unit.data); +const roleOf = (layer: any) => (layer.data?.graticule ? 'graticule' : layer.data?.format?.feature === 'disputed' ? 'disputed' + : layer.data?.format?.mesh ? 'borders' : (layer.mark?.type ?? layer.mark) === 'rect' ? 'water' : 'regions'); + +describe('the ground of a map', () => { + it('follows a dark theme’s page: land without data, borders and sea are dark, not light grey and white', () => { + const spec = choropleth({}, { theme_spec: 'powerbi' }); + expect(dark(spec.background ?? spec.config.background)).toBe(true); + expect(dark(noDataOf(spec))).toBe(true); + const regions = units(spec).find((unit) => unit.mark?.type === 'geoshape' && unit.encoding?.color?.field); + expect(regions.mark.stroke).not.toBe('white'); + expect(dark(regions.mark.stroke)).toBe(true); + const globe = choropleth({ projection: 'orthographic' }, { theme_spec: 'powerbi' }); + const sea = units(globe).find((unit) => unit.data?.sphere); + expect(dark(sea.mark.fill)).toBe(true); + }); + + it('takes a named style’s colours, the sea filling a flat map’s plot only where the style paints water', () => { + const frameOf = (spec: any) => units(spec).find((unit) => unit.mark?.type === 'rect' && unit.encoding?.x2?.value === 'width'); + const atlas = choropleth({ mapStyle: 'atlas' }); + // The water fills the plot as a rectangle beneath the map: Vega-Lite paints no plot background under geoshapes. + expect(frameOf(atlas).mark.fill).toBe('#dbe9f2'); + expect(atlas.layer[0]).toBe(frameOf(atlas)); + expect(noDataOf(atlas)).toBe('#ebe6db'); + const light = choropleth({ mapStyle: 'light' }); + expect(frameOf(light)).toBeUndefined(); + expect(noDataOf(light)).toBe('#dededb'); + const darkGlobe: any = assembleVegaLite({ + data: { values: [{ Lon: 2, Lat: 48 }] }, semantic_types: { Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' }, chartProperties: { projection: 'orthographic', mapStyle: 'dark' } }, + } as any); + expect(units(darkGlobe).find((unit) => unit.data?.sphere).mark.fill).toBe('#1d2227'); + const land = units(darkGlobe).find((unit) => unit.mark?.type === 'geoshape' && !unit.data?.sphere); + expect(land.mark.fill).toBe('#3c434a'); + // Points on the dark ground carry a light ring. + const point = units(darkGlobe).find((unit) => (typeof unit.mark === 'string' ? unit.mark : unit.mark?.type) === 'circle'); + expect(point.mark.stroke).toBe('#ffffff'); + // A globe floats on the page: no frame round it. + expect(units(darkGlobe).some((unit) => unit.mark?.type === 'rect')).toBe(false); + }); + + it('takes a style of the caller’s own: a base style with any colour restated, the sea filling the plot', () => { + const frameOf = (spec: any) => units(spec).find((unit) => unit.mark?.type === 'rect' && unit.encoding?.x2?.value === 'width'); + const custom = choropleth({ mapStyle: { base: 'light', sea: '#1f3b4d', noData: '#e8dcc0', border: '#7a6a4f' }, graticule: true }); + expect(frameOf(custom).mark.fill).toBe('#1f3b4d'); + expect(noDataOf(custom)).toBe('#e8dcc0'); + expect(custom.layer.find((layer: any) => roleOf(layer) === 'borders').mark.stroke).toBe('#7a6a4f'); + // Unstated colours are the base style's. + expect(custom.layer.find((layer: any) => roleOf(layer) === 'graticule').mark.stroke).toBe('#e8ecef'); + const point: any = assembleVegaLite({ + data: { values: [{ Lon: 23, Lat: 38 }, { Lon: 20, Lat: 39 }] }, semantic_types: { Lon: 'Longitude', Lat: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'Lon', latitude: 'Lat' }, chartProperties: { mapStyle: { land: '#efe2c4', coast: '#5b4a33', sea: '#24485a' } } }, + } as any); + const land = units(point).find((unit) => unit.mark?.type === 'geoshape' && unit.mark.fill === '#efe2c4'); + expect(land?.mark.stroke).toBe('#5b4a33'); + expect(frameOf(point).mark.fill).toBe('#24485a'); + // On a dark sea, a route's halo and the points' ring are drawn for a dark ground. + expect(units(point).find((unit) => (unit.mark?.type ?? unit.mark) === 'circle').mark.stroke).toBe('#ffffff'); + }); + + it('drops a custom style it cannot read, with a warning, for the theme’s ground', () => { + const spec = choropleth({ mapStyle: { sea: '#123456', glow: 'gold' } }, { theme_spec: 'nyt' }); + expect(units(spec).some((unit) => unit.mark?.fill === '#123456')).toBe(false); + const warning = spec._warnings.find((w: any) => w.code === 'invalid-option-value'); + expect(warning.message).toMatch(/mapStyle.*a style of your own \{ base\?/); + }); + + it('draws a graticule under the land, and borders as wide as asked', () => { + const spec = choropleth({ graticule: true, borderWidth: 0 }); + // The water, the graticule on it, the regions, the borders between them, the disputed borders. + expect(spec.layer.map(roleOf)).toEqual(['water', 'graticule', 'regions', 'borders', 'disputed']); + expect(spec.layer[2].mark.strokeWidth).toBe(0); + // The borders a hair wider than asked, to cover the regions' outline; the disputed keep their own width. + expect(spec.layer[3].mark.strokeWidth).toBeCloseTo(0.15, 6); + expect(spec.layer[4].mark.strokeWidth).toBeGreaterThan(0); + expect(choropleth({ mapStyle: 'dark' }).layer.find((layer: any) => roleOf(layer) === 'disputed').mark.stroke).toBe('#8a939b'); + const globe = choropleth({ graticule: true, projection: 'orthographic' }); + expect(globe.layer.findIndex((layer: any) => layer.data?.graticule)).toBe(1); + }); + + it('leaves no role tag in the spec', () => { + for (const spec of [choropleth(), choropleth({ projection: 'orthographic', graticule: true }), choropleth({}, { theme_spec: 'nyt' })]) { + expect(units(spec).some((unit) => MAP_ROLE in unit)).toBe(false); + } + }); +}); + +describe('a map without house chrome', () => { + // The boundaries' credit is the map's own, not the house's. + const furniture = (spec: any) => [ + ...readCanvasFurniture(spec).filter((item) => !item.text?.includes('World Bank Official Boundaries')), + ...units(spec).filter((unit) => unit.__themeSynthetic), + ]; + it('draws no header bar, tab, rule or footer credit, unless it asks for them', () => { + const map = choropleth({}, { theme_spec: 'economist' }); + expect(furniture(map)).toEqual([]); + const bars: any = assembleVegaLite({ + data: { values: GDP.slice(0, 5) }, semantic_types: { Country: 'Country', Rate: 'Rate' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'Country', y: 'Rate' } }, theme_spec: 'economist', + } as any); + expect(furniture(bars).length).toBeGreaterThan(0); + const asked: any = assembleVegaLite({ + data: { values: GDP }, semantic_types: { Country: 'Country', Rate: 'Rate' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Rate' }, chrome: { header: true, footer: true } }, theme_spec: 'economist', + } as any); + expect(furniture(asked).length).toBeGreaterThan(0); + }); + + it('keeps the source line the chart gives, without the house’s credit beside it', () => { + const spec: any = assembleVegaLite({ + data: { values: GDP }, semantic_types: { Country: 'Country', Rate: 'Rate' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Rate' }, source: 'World Bank' }, theme_spec: 'bbc', + } as any); + const text = JSON.stringify(spec); + expect(text).toContain('World Bank'); + expect(text).not.toMatch(/"text":\s*"BBC"/); + }); +}); + +describe('classing a choropleth', () => { + const breaks = (spec: any) => regionsOf(spec).encoding.color.scale.domain; + + it('puts five classes at the quantiles by default, so each holds about as many countries', () => { + const spec = choropleth(); + expect(regionsOf(spec).encoding.color.scale.type).toBe('threshold'); + const cuts: number[] = breaks(spec); + expect(cuts).toHaveLength(4); + const counts = [0, 0, 0, 0, 0]; + for (const { Rate } of GDP) counts[cuts.filter((cut) => (Rate as number) >= cut).length]++; + expect(Math.max(...counts) - Math.min(...counts)).toBeLessThanOrEqual(2); + }); + + it('steps at round values, at natural breaks, or runs continuously, as asked, in as many classes as asked', () => { + expect(breaks(choropleth({ classes: 'equal', classCount: 4 }))).toEqual([10000, 15000, 20000]); + expect(breaks(choropleth({ classes: 'jenks', classCount: 3 }))).toHaveLength(2); + expect(breaks(choropleth({ classCount: 3 }))).toHaveLength(2); + const smooth = choropleth({ classes: 'continuous' }); + expect(regionsOf(smooth).encoding.color.scale.type).toBeUndefined(); + }); + + it('starts a one-way ramp a little in from its end, so the first class does not read as no data', () => { + const scheme = regionsOf(choropleth()).encoding.color.scale.scheme; + expect(scheme.extent[0]).toBeGreaterThan(0.1); + }); + + it('classes a themed ramp too, keeping the theme’s colours', () => { + const spec = choropleth({}, { theme_spec: 'economist' }); + expect(regionsOf(spec).encoding.color.scale.type).toBe('threshold'); + expect(regionsOf(spec).encoding.color.scale.range).toHaveLength(5); + }); + + it('yields to the author’s own bins', () => { + const spec = choropleth({}, {}, { bins: 0 }); + expect(regionsOf(spec).encoding.color.scale.type).toBeUndefined(); + }); + + it('prints breaks short, and drops a break rounding merges', () => { + expect(quantileColorClasses([1, 2, 3, 4, 1000], 2)!.breaks).toEqual([3]); + // Values that do not spread give no classes: the ramp stays continuous. + expect(quantileColorClasses([5, 5, 5, 5, 6], 4)).toBeUndefined(); + expect(jenksColorClasses([1, 2, 3, 100, 101, 102, 1000], 3)!.breaks).toEqual([100, 1000]); + }); +}); diff --git a/packages/flint-js/tests/maps.test.ts b/packages/flint-js/tests/maps.test.ts index 9dd0e02c..e7e3d5b4 100644 --- a/packages/flint-js/tests/maps.test.ts +++ b/packages/flint-js/tests/maps.test.ts @@ -3,7 +3,7 @@ import { describe, it, expect } from 'vitest'; import { assembleVegaLite } from '../src'; -import { resolveCountry, resolveCountryCode } from '../src/chart-types/geo'; +import { resolveCountry, resolveCountryCode, resolveUsState } from '../src/chart-types/geo'; /** * Name-based map creation. @@ -27,6 +27,9 @@ interface ChoroplethResult { joined: Map; } +/** The unit drawing the regions: the map itself, or the layer whose colour comes from a field (a world map dots its disputed borders over it). */ +const regionsOf = (spec: any): any => (Array.isArray(spec?.layer) ? spec.layer.find((layer: any) => layer.encoding?.color?.field) : spec); + function buildChoropleth( rows: Row[], idField: string, @@ -47,12 +50,12 @@ function buildChoropleth( }) as any; const joined = new Map(); - const values = spec?.transform?.find((transform: any) => transform.lookup)?.from?.data?.values ?? []; + const values = regionsOf(spec)?.transform?.find((transform: any) => transform.lookup)?.from?.data?.values ?? []; for (const r of values) joined.set(r[idField], r.__geo_id); return { spec, - feature: spec?.data?.format?.feature, + feature: regionsOf(spec)?.data?.format?.feature, projection: spec?.projection?.type, joined, }; @@ -145,13 +148,13 @@ describe('choropleth maps from names', () => { { state: 'California', pop: 39.5 }, { state: 'Texas', pop: 29.1 }, ]; - const { spec } = buildChoropleth(rows, 'state', 'pop', 'State'); + const regions = regionsOf(buildChoropleth(rows, 'state', 'pop', 'State').spec); - expect(spec.data?.url).toContain('us-atlas'); - expect(spec.mark?.type).toBe('geoshape'); - expect(spec.encoding?.color?.field).toBe('pop'); - expect(spec.transform?.find((transform: any) => transform.lookup)?.lookup).toBe('id'); - expect(spec.transform?.find((transform: any) => transform.lookup)?.from?.key).toBe('__geo_id'); + expect(regions.data?.url).toContain('counties-albers-10m'); + expect(regions.mark?.type).toBe('geoshape'); + expect(regions.encoding?.color?.field).toBe('pop'); + expect(regions.transform?.find((transform: any) => transform.lookup)?.lookup).toBe('id'); + expect(regions.transform?.find((transform: any) => transform.lookup)?.from?.key).toBe('__geo_id'); }); it('keeps a declared quantitative color domain stable and centered', () => { @@ -167,7 +170,7 @@ describe('choropleth maps from names', () => { }, }) as any; - expect(spec.encoding.color.scale).toMatchObject({ + expect(regionsOf(spec).encoding.color.scale).toMatchObject({ domain: [-100, 100], clamp: true, scheme: 'redblue', @@ -219,12 +222,14 @@ describe('choropleth lookup robustness', () => { ]; const r = buildChoropleth(rows, 's', 'v', 'State'); expect(r.feature).toBe('states'); - expect(r.joined.get('Calif.')).toBe(6); - expect(r.joined.get('Wash.')).toBe(53); - expect(r.joined.get('N. Carolina')).toBe(37); - expect(r.joined.get('S. Dakota')).toBe(46); - expect(r.joined.get('California, USA')).toBe(6); - expect(r.joined.get('Washington State')).toBe(53); + expect(resolveUsState('Calif.')).toBe(6); + expect(resolveUsState('Wash.')).toBe(53); + expect(resolveUsState('N. Carolina')).toBe(37); + expect(resolveUsState('S. Dakota')).toBe(46); + expect(resolveUsState('California, USA')).toBe(6); + expect(resolveUsState('Washington State')).toBe(53); + // Two spellings of one state join as one region. + expect([...r.joined.values()].sort((a, b) => a - b)).toEqual([6, 37, 46, 53]); }); it('resolves country aliases, alternate forms and accented names', () => { @@ -237,11 +242,13 @@ describe('choropleth lookup robustness', () => { ]; const r = buildChoropleth(rows, 'c', 'v', 'Country'); expect(r.feature).toBe('countries'); - expect(r.joined.get('Holland')).toBe(528); - expect(r.joined.get('S. Korea')).toBe(410); - expect(r.joined.get('Korea, Rep.')).toBe(410); - expect(r.joined.get('Côte d’Ivoire')).toBe(384); - expect(r.joined.get('Türkiye')).toBe(792); + expect(resolveCountry('Holland')).toBe(528); + expect(resolveCountry('S. Korea')).toBe(410); + expect(resolveCountry('Korea, Rep.')).toBe(410); + expect(resolveCountry('Côte d’Ivoire')).toBe(384); + expect(resolveCountry('Türkiye')).toBe(792); + // Two spellings of one country join as one region. + expect([...r.joined.values()].sort((a, b) => a - b)).toEqual([384, 410, 528, 792]); }); it('resolves the expanded set of countries verified against world-110m', () => { @@ -276,17 +283,18 @@ describe('Choropleth level', () => { it('draws counties from the same pre-projected US atlas and passes numeric FIPS ids through', () => { const spec = build({ region: 'us', level: 'county' }); - expect(spec.data.url).toContain('counties-albers-10m'); - expect(spec.data.format.feature).toBe('counties'); + const regions = regionsOf(spec); + expect(regions.data.url).toContain('counties-albers-10m'); + expect(regions.data.format.feature).toBe('counties'); expect(spec.projection.type).toBe('identity'); - expect(spec.mark.strokeWidth).toBe(0.2); - const joined = spec.transform.find((transform: any) => transform.lookup).from.data.values; + expect(regions.mark.strokeWidth).toBe(0.2); + const joined = regions.transform.find((transform: any) => transform.lookup).from.data.values; expect(joined.map((row: any) => row.__geo_id)).toEqual([1079, 6037]); }); it('keeps the state layer by default and on the world map', () => { - expect(build({ region: 'us' }).data.format.feature).toBe('states'); - expect(build({ region: 'world', level: 'county' }).data.format.feature).toBe('countries'); + expect(regionsOf(build({ region: 'us' })).data.format.feature).toBe('states'); + expect(regionsOf(build({ region: 'world', level: 'county' })).data.format.feature).toBe('countries'); }); }); @@ -328,6 +336,14 @@ describe('the country gazetteer covers the world map', () => { for (const [name, id] of Object.entries(cases)) expect(resolveCountry(name), name).toBe(id); }); + it('keeps state data on the US map despite a total or a stray foreign row', () => { + const rows = ['California', 'Texas', 'New York', 'United States'].map((name, v) => ({ name, v })); + expect(buildChoropleth(rows, 'name', 'v').feature).toBe('states'); + expect(buildChoropleth([...rows, { name: 'Canada', v: 9 }], 'name', 'v').feature).toBe('states'); + // Mostly countries stay on the world map. + expect(buildChoropleth(['France', 'Germany', 'Georgia'].map((name, v) => ({ name, v })), 'name', 'v').feature).toBe('countries'); + }); + it('still keeps colliding US state codes on the US map', () => { const rows = ['AL', 'GA', 'MD', 'ME', 'NC', 'SC'].map((st, v) => ({ st, v })); expect(buildChoropleth(rows, 'st', 'v').feature).toBe('states'); @@ -342,7 +358,7 @@ describe('a colour key formats its numbers like an axis would', () => { semantic_types: { Country: 'Country', Change: { semanticType: 'PercentageChange', intrinsicDomain: [-1, 1] } }, chart_spec: { chartType: 'Choropleth', encodings: { id: 'Country', color: 'Change' }, chartProperties: { region: 'world' } }, } as any); - const legend = spec.encoding.color.legend; + const legend = regionsOf(spec).encoding.color.legend; expect(legend.format ?? legend.labelExpr).toMatch(/%/); }); @@ -352,6 +368,6 @@ describe('a colour key formats its numbers like an axis would', () => { semantic_types: { State: 'State', N: 'Count' }, chart_spec: { chartType: 'Choropleth', encodings: { id: 'State', color: 'N' } }, } as any); - expect(spec.encoding.color.legend?.format ?? '').not.toMatch(/%/); + expect(regionsOf(spec).encoding.color.legend?.format ?? '').not.toMatch(/%/); }); }); diff --git a/packages/flint-js/tests/number-aggregation.test.ts b/packages/flint-js/tests/number-aggregation.test.ts new file mode 100644 index 00000000..d2ffc8e3 --- /dev/null +++ b/packages/flint-js/tests/number-aggregation.test.ts @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, expect, it } from 'vitest'; +import { compile } from 'vega-lite'; +import { parse, View } from 'vega'; +import { assembleExcel, assembleImageCharts, assembleVegaLite, getChartOptions } from '../src'; +import { isMeasureType, resolveFieldSemantics, resolveStackable } from '../src/core'; +import type { ChartEncoding } from '../src/core/types'; + +// Two rows for A (10, 20), one for B (5). +const ROWS = [ + { name: 'A', value: 10 }, + { name: 'A', value: 20 }, + { name: 'B', value: 5 }, +]; + +describe('Number carries no default aggregation', () => { + it('has no aggregationDefault, while Count, Amount and Quantity still sum', () => { + expect(resolveFieldSemantics('Number', 'value', [1, 2]).aggregationDefault).toBeUndefined(); + for (const type of ['Count', 'Amount', 'Quantity']) { + expect(resolveFieldSemantics(type, 'value', [1, 2]).aggregationDefault).toBe('sum'); + } + expect(resolveStackable('Number')).toBe(false); + }); + + it('stays a quantitative measure', () => { + const fs = resolveFieldSemantics('Number', 'value', [1.5, 20, 300]); + expect(isMeasureType('Number')).toBe(true); + expect(fs.defaultVisType).toBe('quantitative'); + expect(fs.zeroClass).toBe('meaningful'); + expect(fs.binningSuggested).toBe(true); + }); +}); + +async function barTableLabels(type: string, x: ChartEncoding = { field: 'value' }): Promise> { + const spec: any = assembleVegaLite({ + data: { values: ROWS }, + semantic_types: { name: 'Category', value: type }, + chart_spec: { chartType: 'Bar Table', encodings: { y: { field: 'name' }, x } }, + }); + const view = new View(parse(compile(spec).spec), { renderer: 'none' }); + try { + await view.runAsync(); + const labels: Record = {}; + const visit = (item: any): void => { + if (item.mark?.marktype === 'text' && item.mark?.role === 'mark' && item.datum?.__bt_val !== undefined) { + labels[item.datum.name] = String(item.text); + } + for (const child of item.items ?? []) visit(child); + }; + visit((view.scenegraph() as any).root); + return labels; + } finally { + view.finalize(); + } +} + +describe('Bar Table value labels', () => { + it('show the mean of a Number category with several rows, and a single row as is', async () => { + expect(await barTableLabels('Number')).toEqual({ A: '15', B: '5' }); + }); + + it("use a Number's explicit aggregate", async () => { + expect(await barTableLabels('Number', { field: 'value', aggregate: 'sum' })).toEqual({ A: '30', B: '5' }); + }); + + it('still sum an additive type', async () => { + expect(await barTableLabels('Quantity')).toEqual({ A: '30', B: '5' }); + }); +}); + +describe('"% of total" option', () => { + const applicable = (type: string, x: ChartEncoding = { field: 'value' }) => getChartOptions({ + data: { values: ROWS }, + semantic_types: { name: 'Category', value: type }, + chart_spec: { chartType: 'Bar Table', encodings: { y: { field: 'name' }, x } }, + }).find((option) => option.key === 'showPercent')?.applicable; + + it('is offered only for a summed measure', () => { + expect(applicable('Number')).toBe(false); + expect(applicable('Amount')).toBe(true); + expect(applicable('Number', { field: 'value', aggregate: 'sum' })).toBe(true); + }); +}); + +describe('export pivots', () => { + const input = (type: string, y: ChartEncoding = { field: 'value' }) => ({ + data: { values: ROWS }, + semantic_types: { name: 'Category', value: type }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'name' }, y } }, + }); + const excelValues = (type: string, y?: ChartEncoding) => assembleExcel(input(type, y)).data.slice(1).map((row) => row[1]); + const imageValues = (type: string, y?: ChartEncoding) => /chd=a:([^&]*)/.exec(assembleImageCharts(input(type, y)).url)?.[1]; + + it('average a Number with no explicit aggregate', () => { + expect(excelValues('Number')).toEqual([15, 5]); + expect(imageValues('Number')).toBe('15,5'); + }); + + it('use the explicit aggregate when set', () => { + expect(excelValues('Number', { field: 'value', aggregate: 'sum' })).toEqual([30, 5]); + expect(imageValues('Number', { field: 'value', aggregate: 'sum' })).toBe('30,5'); + }); + + it('sum an additive default', () => { + expect(excelValues('Quantity')).toEqual([30, 5]); + expect(imageValues('Quantity')).toBe('30,5'); + }); +}); diff --git a/packages/flint-js/tests/percent-scale.test.ts b/packages/flint-js/tests/percent-scale.test.ts new file mode 100644 index 00000000..e93588ce --- /dev/null +++ b/packages/flint-js/tests/percent-scale.test.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// A percentage field's storage — fractions or percent points — is taken from what the annotation +// states before what the values suggest (#154). + +import { describe, expect, it } from 'vitest'; +import { assembleVegaLite, resolveFormat } from '../src'; +import { percentRepresentation } from '../src/core/field-semantics'; +import { kpiNumberFormat } from '../src/core/kpi-format'; + +const MOSTLY_PAST_ONE = [0.5, 1.8, 2.4, 3.0, 1.2]; +const MOSTLY_UNDER_ONE = [0.5, 0.8, 0.4, 3.0, 0.2]; + +describe('percentage representation', () => { + it('takes a stated scale over the values', () => { + expect(percentRepresentation({ percentScale: 'fraction' }, MOSTLY_PAST_ONE)).toBe('0-1'); + expect(percentRepresentation({ percentScale: 'percent' }, [0.2, 0.4])).toBe('0-100'); + }); + + it('reads a decisive intrinsic domain, and the values where the domain does not settle it', () => { + expect(percentRepresentation({ intrinsicDomain: [0, 1] }, [5, 40, 80])).toBe('0-1'); + expect(percentRepresentation({ intrinsicDomain: [-1, 1] }, [5, 40, 80])).toBe('0-1'); + expect(percentRepresentation({ intrinsicDomain: [0, 100] }, [0.2, 0.4])).toBe('0-100'); + expect(percentRepresentation({ intrinsicDomain: [0, 3] }, MOSTLY_PAST_ONE)).toBe('0-100'); + expect(percentRepresentation({ intrinsicDomain: [0, 3] }, MOSTLY_UNDER_ONE)).toBe('0-1'); + expect(percentRepresentation(undefined, MOSTLY_UNDER_ONE)).toBe('0-1'); + }); + + it('formats one column one way whichever rows a query returns, once its scale is stated', () => { + const growth = { semanticType: 'PercentageChange', intrinsicDomain: [0, 3] as [number, number], percentScale: 'fraction' as const }; + const a = resolveFormat('PercentageChange', growth, MOSTLY_PAST_ONE); + const b = resolveFormat('PercentageChange', growth, MOSTLY_UNDER_ONE); + expect(a.format?.pattern).toMatch(/%$/); + expect(a.tooltipFormat?.suffix).toBeUndefined(); + expect(a).toEqual(b); + // A stated scale alone, with no domain, is enough. + const bare = resolveFormat('PercentageChange', { semanticType: 'PercentageChange', percentScale: 'fraction' }, MOSTLY_PAST_ONE); + expect(bare.format?.pattern).toMatch(/%$/); + const points = resolveFormat('Percentage', { semanticType: 'Percentage', percentScale: 'percent' }, [0.2, 0.5]); + expect(points.format).toBeUndefined(); + expect(points.tooltipFormat?.suffix).toBe('%'); + }); + + it('scales the axis and the KPI number by the stated scale', () => { + const rows = ['A', 'B', 'C', 'D'].map((k, i) => ({ k, growth: [1.8, 2.4, 3.0, 1.2][i] })); + const vl = assembleVegaLite({ + data: { values: rows }, + semantic_types: { k: 'Category', growth: { semanticType: 'PercentageChange', percentScale: 'fraction' } }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'k', y: 'growth' } }, + } as any) as any; + expect(JSON.stringify(vl.encoding.y.axis ?? {})).toMatch(/%/); + const kpi = kpiNumberFormat({ field: 'growth', semanticAnnotation: { semanticType: 'PercentageChange', percentScale: 'fraction' } } as any, [1.8, 2.4]); + expect(kpi.print(2.4)).toBe('240%'); + }); + + it('reads fractions from the values where nothing is stated, as the domain does', async () => { + const { compile } = await import('vega-lite'); + const { parse, View } = await import('vega'); + const shares = [0.164, 0.42, 0.087, 0.3]; + expect(resolveFormat('Percentage', { semanticType: 'Percentage' }, shares).format?.pattern).toMatch(/%$/); + const rows = ['A', 'B', 'C', 'D'].map((k, i) => ({ k, m: shares[i] })); + const vl = assembleVegaLite({ + data: { values: rows }, semantic_types: { k: 'Category', m: 'Percentage' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'k', y: 'm' } }, + } as any) as any; + const svg = await new View(parse(compile(vl).spec), { renderer: 'none' }).toSVG(); + const ticks = [...svg.matchAll(/]*>([^<]*)<\/text>/g)].map((m) => m[1]).filter((t) => /\d/.test(t)); + expect(ticks.length).toBeGreaterThan(0); + expect(ticks.every((t) => t.endsWith('%')), ticks.join(', ')).toBe(true); + // Percent points with nothing stated are left as they print. + const points = resolveFormat('Percentage', { semanticType: 'Percentage' }, [16.4, 42, 8.7]); + expect(points.format).toBeUndefined(); + }); +}); diff --git a/packages/flint-js/tests/react-table.test.ts b/packages/flint-js/tests/react-table.test.ts index ecd78e07..cd0be6fc 100644 --- a/packages/flint-js/tests/react-table.test.ts +++ b/packages/flint-js/tests/react-table.test.ts @@ -24,6 +24,26 @@ describe('FlintTable', () => { expect(html).toContain('Americas'); }); + it('scrolls only the rows: the heading and the notes sit outside the scrolling box', () => { + const titled = { ...table, heading: { title: 'Countries', style: { title: table.style.header, subtitle: table.style.body } } }; + const html = renderToStaticMarkup(createElement(FlintTable, { table: titled })); + expect(html).toMatch(/
.*<\/div>
.*<\/table><\/div>/); + }); + + it('carries the chart\'s theme furniture and source, and draws the source at the foot', () => { + const economist = vegaLiteTable({ + data: { values: [{ region: 'Europe', revenue: 27 }, { region: 'Asia', revenue: 17 }] }, + theme_spec: 'economist', + chart_spec: { chartType: 'Table', title: 'Revenue', source: 'Source: Company ledger', encodings: {} }, + } as ChartAssemblyInput); + expect(economist.furniture?.header?.pieces.length).toBeGreaterThan(0); + expect(economist.furniture?.source?.lines.length).toBeGreaterThan(0); + const html = renderToStaticMarkup(createElement(FlintTable, { table: economist })); + expect(html).toMatch(/<\/div>
]*>.*Company ledger/); + expect(html).not.toMatch(/Source:.*Source:/); + expect(table.furniture?.header).toBeUndefined(); + }); + it('mutes the rows an emphasis leaves out', () => { const html = renderToStaticMarkup(createElement(FlintTable, { table, updates: [emphasize('Asia')] })); expect(html.match(/opacity:0\.35/g)).toHaveLength(2); diff --git a/packages/flint-js/tests/row-names-above.test.ts b/packages/flint-js/tests/row-names-above.test.ts index 6bb23599..20c54716 100644 --- a/packages/flint-js/tests/row-names-above.test.ts +++ b/packages/flint-js/tests/row-names-above.test.ts @@ -97,6 +97,43 @@ describe('names above their bars', () => { expect(vegaLiteStages(bars(always, undefined, 1.5, grouped, 'Grouped Bar Chart', { x: 'Deaths', y: 'Cause', color: 'Group' })).plan.rowNames).toBeUndefined(); expect(vegaLiteStages(bars(always, undefined, 1.5, CAUSES.slice(0, 5), 'Bar Chart', { x: 'Cause', y: 'Deaths' })).plan.rowNames).toBeUndefined(); }); + + it('keep the order of bars sorted by their measure, coloured or not', async () => { + const kinds = CAUSES.map((row, index) => ({ ...row, Group: index % 2 ? 'Injury' : 'Disease' })); + const ascending = [...CAUSES].sort((a, b) => (a.Deaths as number) - (b.Deaths as number)).map((row) => row.Cause); + for (const color of [undefined, { field: 'Group' }]) { + const encodings = { x: { field: 'Deaths' }, y: { field: 'Cause', sortBy: 'x', sortOrder: 'ascending' }, ...(color ? { color } : {}) }; + const { plan, spec } = vegaLiteStages(bars('datawrapper', undefined, 1.5, kinds, 'Bar Chart', encodings)); + expect(plan.rowNames, String(color)).toBeDefined(); + const { names, rects } = await drawn(spec); + names.sort((a, b) => a.y1 - b.y1); + rects.sort((a, b) => a.y1 - b.y1); + expect(names.map((name) => name.text)).toEqual(ascending); + expect(rects.map((rect) => rect.cause)).toEqual(ascending); + } + }); + + it('stand beside where, above them, the title and keys would push the drawing past its canvas', () => { + const titled = (canvas: { width: number; height: number }) => ({ + ...bars('datawrapper', { width: 400, height: 300 }, 1.5, CAUSES.map((row, index) => ({ ...row, Group: index % 2 ? 'Injury' : 'Disease' })), 'Bar Chart', + { x: 'Deaths', y: 'Cause', color: 'Group' }), + chart_spec: { + chartType: 'Bar Chart', encodings: { x: 'Deaths', y: 'Cause', color: 'Group' }, + title: 'The leading causes of death in the United States, by the number of deaths', + subtitle: 'Deaths per 100,000 people, all ages, the most recent year reported', + baseSize: { width: 400, height: 300 }, canvasSize: canvas, + }, + }) as any; + // In a 600 × 450 canvas the bands fit the stretch, but the header leaves them no room. The + // drawing still runs past it, so it is laid out for a smaller room within the canvas: the + // names are judged by that room. + const tight = vegaLiteStages(titled({ width: 600, height: 450 })).plan; + expect(tight.rowNames).toBeUndefined(); + expect(tight.report.some((note) => note.code === 'row-names-beside' && /larger than its 600 × \d+ canvas/.test(note.message))).toBe(true); + expect(tight.report.some((note) => note.code === 'canvas-contain')).toBe(true); + // In 800 × 600 the whole drawing fits: the names stand above. + expect(vegaLiteStages(titled({ width: 800, height: 600 })).plan.rowNames).toBeDefined(); + }); }); describe('a band holding a name over its bar', () => { diff --git a/packages/flint-js/tests/semantic-interactions.test.ts b/packages/flint-js/tests/semantic-interactions.test.ts index 63edac0c..e2fd550a 100644 --- a/packages/flint-js/tests/semantic-interactions.test.ts +++ b/packages/flint-js/tests/semantic-interactions.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'; import { changeset, parse, View, type GroupMark } from 'vega'; import { expressionInterpreter } from 'vega-interpreter'; import { compile } from 'vega-lite'; -import { scaleAwareCanvasPicking } from '../src/vegalite/interactive'; +import { scaleAwareCanvasPicking, tooltipType } from '../src/vegalite/interactive'; import { rendererElement, vegaRendererOrigin } from '../src/vegalite/interactions/hit-adapter'; import { assembleVegaLite, indexAxisOf } from '../src/vegalite/assemble'; import { axisHighlight, brushAngle, brushX, brushZoom, clickAnnotate, clickHighlight, dragReorder, externalInteraction, inspect, legendToggle, navigate, select } from '../src/interactive/interactions'; @@ -71,6 +71,7 @@ import { rendererPlotOrigin, renderHit, sceneItems, + nearestThinItem, tolerantInspectHits, continuousLegendSegmentCount, clippedBounds, @@ -99,9 +100,9 @@ import { import { annotationBounds, annotationConnectionPoint, - annotationPrimaryAnchor, } from '../src/vegalite/interactions/presentation/annotation-overlay'; import { createVegaNavigationController } from '../src/vegalite/interactions/navigation-scale'; +import { PROXIMITY_READOUT_DISTANCE, proximityTooltip } from '../src/vegalite/interactions/runtime'; import { INTERACTION_PROVENANCE } from '../src/vegalite/interaction-provenance'; import { THEME_PRESETS } from '../src/core/theme/presets'; import { INTERACTION_CAPABILITIES } from '../src/core/interaction-spec'; @@ -150,7 +151,7 @@ function annotationUpdate( return { id: 'test-annotation', ops: [{ - op: 'set-annotation' as const, + op: 'annotate-text' as const, target: { visual, elements: [element] }, value: {}, }], @@ -265,7 +266,7 @@ describe('Vega-Lite semantic interactions', () => { value: { text: '2' }, }); expect((update.ops[0] as any).value.candidates[0]).toEqual({ - connection: 'value-end', valueAxis: 'y', priority: 0, + connection: 'value-end', valueAxis: 'y', }); }); @@ -309,7 +310,7 @@ describe('Vega-Lite semantic interactions', () => { text: 'Median: 5,000\nIQR: 4,700 → 5,400', }, }); - expect((update.ops[0] as any).value.candidates[0]).toEqual({ connection: 'center', priority: 0 }); + expect((update.ops[0] as any).value.candidates[0]).toEqual({ connection: 'center' }); }); it('keeps a Regression\u2019s dots selectable when a house redraws its circles as squares', async () => { @@ -637,13 +638,6 @@ describe('Vega-Lite semantic interactions', () => { expect(midpoint.point).toEqual({ x: 126, y: 136 }); expect(rightFallback.point).toEqual(midpoint.point); expect(rightFallback.preferredAngle).toBe(0); - expect(annotationPrimaryAnchor( - item, - { left: 56, top: 52, width: 140, height: 168 }, - { left: 220, top: 120, width: 30, height: 20 }, - 'right', - rightFallback.point, - )).toEqual(midpoint.point); }); it('uses a borderless spotlight for area hover', () => { @@ -1312,6 +1306,18 @@ describe('Vega-Lite semantic interactions', () => { }); }); + it('carries the theme\'s highlight paint to annotations, and leaves it unset by default', () => { + const makeSpec = (theme_spec: any) => assembleVegaLite({ + data: { values: [{ Year: '2020', Value: 10 }, { Year: '2021', Value: 14 }] }, + semantic_types: { Year: 'Category', Value: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'Year', y: 'Value' } }, + theme_spec, + } as any) as any; + expect(makeSpec('economist')._interactionSemantics.annotationDesign.highlight).toBeUndefined(); + expect(makeSpec({ extends: 'economist', interaction: { highlight: { color: '#b54a20', width: 2 } } }) + ._interactionSemantics.annotationDesign.highlight).toEqual({ color: '#b54a20', width: 2 }); + }); + it('merges selected heatmap cells by contiguous region without bridging gaps', () => { expect(mergeContiguousSelectionBounds([ { x1: 0, y1: 0, x2: 10, y2: 10 }, @@ -1712,7 +1718,7 @@ describe('Vega-Lite semantic interactions', () => { expect(update.ops[0]).toMatchObject({ value: { text: '140' } }); expect((update.ops[0] as any).value.candidates).toEqual([ - { connection: 'outer-radial', priority: 0 }, + { connection: 'outer-radial' }, ]); }); @@ -1750,12 +1756,7 @@ describe('Vega-Lite semantic interactions', () => { expect(bulletUpdate.ops[0]).toMatchObject({ value: { text: 'Actual: 51.6\nExpected: 80', - candidates: expect.arrayContaining([expect.objectContaining({ - connectorAnchors: [ - { role: 'bullet-actual', connection: 'value-end', valueAxis: 'x' }, - { role: 'bullet-expected', connection: 'center' }, - ], - })]), + candidates: [{ connection: 'value-end', valueAxis: 'x' }], }, }); @@ -2128,7 +2129,7 @@ describe('Vega-Lite semantic interactions', () => { ).ops[0]).toMatchObject({ value: { text: '60 → 67', - candidates: [{ connection: 'segment-midpoint', priority: 0 }], + candidates: [{ connection: 'segment-midpoint' }], }, }); }); @@ -3000,7 +3001,7 @@ describe('Vega-Lite semantic interactions', () => { ).ops[0]).toMatchObject({ value: { text: 'Male: 81.5, Female: 87.6', - candidates: [{ connection: 'segment-midpoint', priority: 0 }], + candidates: [{ connection: 'segment-midpoint' }], }, }); }); @@ -3024,8 +3025,8 @@ describe('Vega-Lite semantic interactions', () => { expect(update.ops[0]).toMatchObject({ value: { text: 'Chrome: 65' } }); expect((update.ops[0] as any).value.candidates).toEqual([ - { connection: 'radial-midpoint', priority: 0 }, - { connection: 'outer-radial', priority: 1 }, + { connection: 'radial-midpoint' }, + { connection: 'outer-radial' }, ]); }); @@ -4220,7 +4221,7 @@ describe('Vega-Lite semantic interactions', () => { }, }); expect((update.ops[0] as any).value.candidates[0]).toEqual({ - connection: 'segment-midpoint', priority: 0, + connection: 'segment-midpoint', }); }); @@ -4278,7 +4279,7 @@ describe('Vega-Lite semantic interactions', () => { ['Slope Chart', slopeChartDef, ['line', 'point'], 'X'], ['Regression', regressionDef, ['circle'], 'X'], ['Streamgraph', streamgraphDef, ['area'], 'X'], - ['Map', mapDef, ['circle'], 'Longitude'], + ['Map', mapDef, ['circle', 'geoshape'], 'Longitude'], ['Density Plot', densityPlotDef, ['area'], 'value'], ['ECDF Plot', ecdfPlotDef, ['line', 'point'], 'X'], ['Calendar Heatmap', vlCalendarHeatmapDef, ['rect'], '__flintCalendarWeek'], @@ -4745,6 +4746,37 @@ describe('set-style visibility', () => { expect(spec.encoding.color.scale.domain).toEqual(['Female', 'Male']); }); + it('pins a legend in the order of the rows when the colour is unsorted, and its edge in the same order', () => { + const spec: Record = { + _interactionSemantics: { + capabilities: ALL_CAPABILITIES, + fields: ['Team', 'Gold'], + legendFields: { color: 'Team' }, + selectableMarks: ['circle'], + }, + data: { + values: [ + { Team: 'United States', Gold: 40, Silver: 44 }, + { Team: 'China', Gold: 40, Silver: 27 }, + { Team: 'Australia', Gold: 18, Silver: 19 }, + ], + }, + mark: { type: 'circle', strokeWidth: 1 }, + encoding: { + x: { field: 'Gold', type: 'quantitative' }, + y: { field: 'Silver', type: 'quantitative' }, + color: { field: 'Team', type: 'nominal', sort: null, scale: { range: ['#4e79a7', '#f28e2c', '#ffffb3'] } }, + // A faint ink's darker edge, as the theme draws it: the same field on a second scale. + stroke: { field: 'Team', type: 'nominal', sort: null, scale: { range: ['#4e79a7', '#f28e2c', '#b3b37d'] }, legend: null }, + }, + }; + + addVegaLiteInteractions(spec, [legendToggle()]); + + expect(spec.encoding.color.scale.domain).toEqual(['United States', 'China', 'Australia']); + expect(spec.encoding.stroke.scale.domain).toEqual(spec.encoding.color.scale.domain); + }); + it('pins an aggregate-sorted donut legend so hidden slices keep their keys', () => { const spec: Record = { _interactionSemantics: { @@ -4926,3 +4958,56 @@ describe('elementsFromHits', () => { expect(elements.map((element) => semanticElementRenderKeys(element))).toEqual([['a'], ['b'], ['z']]); }); }); + +describe('baseline tooltip reach', () => { + const series = ['a', 'b'].flatMap((g, s) => [0, 1, 2, 3].map((x) => ({ x, y: x * 10 + s * 40, g }))); + async function viewOf(chartType: string) { + const spec = assembleVegaLite({ + data: { values: series }, + semantic_types: { x: 'Quantity', y: 'Quantity', g: 'Category' }, + chart_spec: { chartType, encodings: { x: 'x', y: 'y', color: 'g' } }, + options: { addTooltips: true }, + } as never) as any; + const { compiled } = instrument(spec); + const view = new View(parse(compiled), { renderer: 'none' }); + await view.runAsync(); + return view; + } + + it('reads a line a few px off its stroke, at the vertex nearer along it, and nothing farther off', async () => { + const view = await viewOf('Line Chart'); + const segment = sceneItems(view).find((item) => item.mark.marktype === 'line' && item.interactionGeometry?.points?.length >= 2); + const [start, end] = segment.interactionGeometry.points; + const nearEnd = { x: start.x + (end.x - start.x) * 0.8, y: start.y + (end.y - start.y) * 0.8 - 4 }; + const read = nearestThinItem(view, nearEnd, PROXIMITY_READOUT_DISTANCE); + expect(read?.datum?.g).toBe(segment.datum.g); + const { value, dot } = proximityTooltip(read, nearEnd); + expect(dot).toMatchObject({ x: end.x, y: end.y }); + expect(value).toMatchObject({ x: '1' }); + expect(nearestThinItem(view, { x: nearEnd.x, y: nearEnd.y - 20 }, PROXIMITY_READOUT_DISTANCE)).toBeUndefined(); + }); + + it('leaves a bar to the exact hit: no reach from beside it, none from inside it', async () => { + const view = await viewOf('Stacked Bar Chart'); + const bar = sceneItems(view).find((item) => item.mark.marktype === 'rect'); + const inside = { x: (bar.bounds.x1 + bar.bounds.x2) / 2, y: (bar.bounds.y1 + bar.bounds.y2) / 2 }; + expect(nearestThinItem(view, inside, PROXIMITY_READOUT_DISTANCE)).toBeUndefined(); + }); +}); + +describe('waterfall legend', () => { + it('reads legend values from the derived step kind the legend shows, not the author\'s Type column', () => { + const semantics = waterfallChartDef.semanticInteractions!(semanticContext({ + resolvedEncodings: { x: { field: 'Step', type: 'nominal' }, y: { field: 'Value', type: 'quantitative' }, color: { field: 'Type', type: 'nominal' } } as never, + })); + expect(semantics.legendFields).toEqual({ color: '__wf_color' }); + }); +}); + +describe('tooltip type', () => { + it('takes the house\'s label face at its largest label size, kept to 11–13 px, and nothing with no house', () => { + expect(tooltipType({ config: { legend: { labelFont: 'Reith', labelFontSize: 9 }, axisX: { labelFontSize: 16 } } })).toEqual({ family: 'Reith', size: 13 }); + expect(tooltipType({ config: { font: 'Futura', axisY: { labelFontSize: 8 } } })).toEqual({ family: 'Futura', size: 11 }); + expect(tooltipType({ config: { axis: { labelFontSize: 12 } } })).toBeUndefined(); + }); +}); diff --git a/packages/flint-js/tests/side-ramp.test.ts b/packages/flint-js/tests/side-ramp.test.ts index 45fb0c1c..504253da 100644 --- a/packages/flint-js/tests/side-ramp.test.ts +++ b/packages/flint-js/tests/side-ramp.test.ts @@ -29,4 +29,22 @@ describe('a ramp beside a short plot', () => { expect(legend.y2 - legend.y1).toBeLessThanOrEqual(view.height() + 1); view.finalize(); }); + + it('labels the shortened ramp at round values, not at its two raw ends', async () => { + const { spec } = vegaLiteStages({ + data: { values: ROWS.map((row, i) => ({ ...row, Sales: row.Sales + (i % 7) * 13 })) }, + semantic_types: { Month: 'Month', Product: 'Category', Sales: 'Quantity' }, + chart_spec: { chartType: 'Heatmap', encodings: { x: 'Month', y: 'Product', color: 'Sales' }, canvasSize: { width: 800, height: 800 } }, + } as any); + const { _theme, _canvasFit, _legendLayout, ...vl } = spec; + expect(vl.encoding.color.legend.gradientLength).toBeLessThan(200); + const view = new View(parse(compile(vl).spec), { renderer: 'none' }); + await view.runAsync(); + const labels: string[] = []; + const walk = (item: any) => { if (!item) return; for (const child of item.items ?? []) walk(child); if (item.role === 'legend-label') labels.push(...(item.items ?? []).map((t: any) => t.text)); }; + walk((view as any).scenegraph().root); + view.finalize(); + expect(labels.length).toBeGreaterThan(2); + for (const label of labels) expect(Number(String(label).replace(/,/g, '')) % 100).toBe(0); + }); }); diff --git a/packages/flint-js/tests/size-key-samples.test.ts b/packages/flint-js/tests/size-key-samples.test.ts index f0b21967..267a2e85 100644 --- a/packages/flint-js/tests/size-key-samples.test.ts +++ b/packages/flint-js/tests/size-key-samples.test.ts @@ -2,8 +2,13 @@ // Licensed under the MIT License. import { describe, it, expect } from 'vitest'; +import { compile } from 'vega-lite'; +import { parse, View } from 'vega'; import { roundSample, sizeKeySwatches } from '../src/core/legend-plan'; +import { exactPattern } from '../src/core/sample-format'; import { assembleVegaLite } from '../src/vegalite/assemble'; +import { assembleECharts } from '../src/echarts/assemble'; +import { assemblePlotly } from '../src/plotly/assemble'; /** * A size key lists round values, as many as the edge it stands on has room for — three on a small @@ -43,6 +48,24 @@ describe('the values a size key lists', () => { for (let i = 1; i < values.length; i++) expect(Math.sqrt(values[i]) - Math.sqrt(values[i - 1])).toBeGreaterThan(Math.sqrt(1350) * 0.1); }); + it('are whole numbers where the field counts: no 2.5 people', () => { + const crew = [600, 528, 522, 46, 45, 39, 3, 3].map((v) => ({ v })); + expect(roundSample(crew, 'v', 5)).toContain(2.5); + expect(roundSample(crew, 'v', 5, true)).toEqual([2, 25, 100, 250, 500]); + // A small count is keyed at whole numbers too, never a fraction below one. + expect(roundSample([1, 2, 3, 4, 6].map((v) => ({ v })), 'v', 5, true)).toEqual([1, 2, 5]); + }); + + it('key the data’s least where it is round and the smallest value lands just off it', () => { + // A crew that dwindles to one man keys 1, not 2: the least is what the reader meets. + const crew = [600, 528, 522, 46, 45, 39, 1, 1].map((v) => ({ v })); + expect(roundSample(crew, 'v', 5, true)).toEqual([1, 25, 100, 250, 500]); + expect(roundSample(crew, 'v', 5)![0]).toBe(1); + // A least that is not round, or far below the smallest value, is left alone. + expect(roundSample([600, 46, 3].map((v) => ({ v })), 'v', 5, true)![0]).not.toBe(3); + expect(roundSample([{ v: 1 }, { v: 400 }, { v: 1000 }], 'v', 3)![0]).toBeGreaterThan(3); + }); + it('never list zero', () => { expect(roundSample([{ v: 0 }, { v: 40 }, { v: 90 }], 'v', 5)!.every((v) => v > 0)).toBe(true); }); @@ -62,3 +85,94 @@ describe('a size key without a theme', () => { expect(values).not.toContain(0); }); }); + +/** The labels a Vega-Lite spec's legend draws, title last. */ +async function legendLabels(spec: any): Promise { + const svg = await new View(parse(compile(spec).spec), { renderer: 'none' }).toSVG(); + return [...svg.slice(svg.indexOf('role-legend')).matchAll(/]*>([^<]*)<\/text>/g)].map((m) => m[1]); +} + +const sizedBy = (scale: number, v: any = 'Quantity') => ({ + data: { values: [3.74, 3.29, 2.26, 1.59, 1.12, 0.11].map((n, i) => ({ x: i, y: i * 2, lon: -100 + i * 5, lat: 35 + i, v: +(n * scale).toPrecision(4) })) }, + semantic_types: { x: 'Quantity', y: 'Quantity', lon: 'Longitude', lat: 'Latitude', v }, +}); +const scatter = { chartType: 'Scatter Plot', encodings: { x: { field: 'x' }, y: { field: 'y' }, size: { field: 'v' } }, canvasSize: { width: 400, height: 300 } }; + +describe('the labels a size key prints', () => { + it('print each sampled value as it is, not rounded to the scale’s ticks', async () => { + for (const [scale, expected] of [ + [1, ['0.5', '1', '2.5']], + [0.3, ['0.2', '0.5', '1']], + [0.01, ['0.005', '0.01', '0.025']], + [10, ['5', '10', '25']], + [1000, ['500', '1,000', '2,500']], + ] as const) { + const spec: any = assembleVegaLite({ ...sizedBy(scale), chart_spec: scatter } as any); + expect(spec.encoding.size.legend.values.length).toBe(expected.length); + expect((await legendLabels(spec)).slice(0, -1)).toEqual(expected); + } + }); + + it('do so on a map’s bubbles too', async () => { + const spec: any = assembleVegaLite({ ...sizedBy(1), chart_spec: { + chartType: 'Map', encodings: { longitude: { field: 'lon' }, latitude: { field: 'lat' }, size: { field: 'v' } }, canvasSize: { width: 500, height: 400 }, + } } as any); + // The map is planned inside its box at its frame's shape — its keys above it, where that shows it + // larger — so its bubbles size to that plot. + expect((await legendLabels(spec)).slice(0, -1)).toEqual(['0.2', '0.5', '1', '2.5']); + }); + + it('keep the field’s own format — a share, a currency — at the precision the samples need', async () => { + const share: any = assembleVegaLite({ ...sizedBy(0.01, { semanticType: 'Percentage', intrinsicDomain: [0, 1] }), chart_spec: scatter } as any); + expect((await legendLabels(share)).slice(0, -1)).toEqual(['0.5%', '1%', '2.5%']); + const money: any = assembleVegaLite({ ...sizedBy(1, { semanticType: 'Amount', unit: 'USD' }), chart_spec: scatter } as any); + expect((await legendLabels(money)).slice(0, -1)).toEqual(['$0.5', '$1', '$2.5']); + }); + + it('raise a format’s precision only where it would round a value away', () => { + expect(exactPattern([0.5, 1, 2.5])).toBe(',.1~f'); + expect(exactPattern([500, 1000, 2500])).toBe(',.0~f'); + expect(exactPattern([0.0005, 0.001, 0.0025])).toBe(',.4~f'); + expect(exactPattern([0.5, 1, 2.5], ',d')).toBe(',.1~f'); + expect(exactPattern([5, 10, 25], ',d')).toBe(',d'); + expect(exactPattern([0.005, 0.01, 0.025], '.0~%')).toBe('.1~%'); + expect(exactPattern([0.05, 0.1, 0.25], '.0~%')).toBe('.0~%'); + expect(exactPattern([0.5, 1, 2.5], ',.2f')).toBe(',.2f'); + expect(exactPattern([0.005, 0.01, 0.025], ',.2f')).toBe(',.3~f'); + expect(exactPattern([2500, 5000], '.1~s')).toBe('.2~s'); + expect(exactPattern([2500, 5000], '~s')).toBe('~s'); + }); + + it('print exactly in Plotly’s key and ECharts’ size map, however small the values', () => { + const input = (scale: number): any => ({ + data: { values: Array.from({ length: 20 }, (_, i) => ({ x: i, y: i * 2, v: +((0.11 + 3.63 * i / 19) * scale).toPrecision(4) })) }, + semantic_types: { x: 'Quantity', y: 'Quantity', v: 'Quantity' }, + chart_spec: scatter, + }); + const plotly: any = assemblePlotly(input(0.0001)); + const notes = ((plotly.figure ?? plotly).layout.annotations ?? []).map((a: any) => a.text).filter((t: string) => !t.startsWith('')); + expect(notes).toEqual(['0.00002', '0.00005', '0.0001', '0.00025']); + const echarts: any = assembleECharts(input(0.01)); + expect((echarts.option ?? echarts).visualMap[0].text).toEqual(['0.037', '0.0011']); + const big: any = assembleECharts(input(1)); + expect((big.option ?? big).visualMap[0].text).toEqual(['3.7', '0.11']); + }); +}); + +describe('a size key on a field that counts', () => { + it('lists whole numbers where the semantic type is a count, and may list fractions for a quantity', () => { + const legendValues = (sizeType: string): number[] => { + const spec: any = assembleVegaLite({ + data: { values: [600, 528, 522, 46, 45, 39, 3, 3].map((v, i) => ({ v, x: i, y: i * 2 })) }, + semantic_types: { x: 'Quantity', y: 'Quantity', v: sizeType }, + chart_spec: { chartType: 'Scatter Plot', encodings: { x: 'x', y: 'y', size: 'v' }, canvasSize: { width: 400, height: 600 } }, + } as any); + const sized = [spec, ...(spec.layer ?? [])].find((node: any) => node.encoding?.size?.legend?.values); + return sized?.encoding.size.legend.values ?? []; + }; + const counted = legendValues('Count'); + expect(counted.length).toBeGreaterThan(1); + expect(counted.every((value) => Number.isInteger(value))).toBe(true); + expect(legendValues('Quantity')).toContain(2.5); + }); +}); diff --git a/packages/flint-js/tests/slope.test.ts b/packages/flint-js/tests/slope.test.ts index 375fd83d..94b06e2a 100644 --- a/packages/flint-js/tests/slope.test.ts +++ b/packages/flint-js/tests/slope.test.ts @@ -155,7 +155,8 @@ describe('ECharts Slope chart', () => { (g: { type?: string; style?: { fontWeight?: string } }) => g.type === 'text' && g.style?.fontWeight === 'bold', ); - expect(title?.right).toBe(16); + // Pinned from the right too, where its text starts over the entries. + expect(title?.right).toBeGreaterThanOrEqual(16); expect(title?.left).toBeUndefined(); }); diff --git a/packages/flint-js/tests/sort-curve-widgets.test.ts b/packages/flint-js/tests/sort-curve-widgets.test.ts index ede8b227..90e59742 100644 --- a/packages/flint-js/tests/sort-curve-widgets.test.ts +++ b/packages/flint-js/tests/sort-curve-widgets.test.ts @@ -9,12 +9,57 @@ import { describe, it, expect } from 'vitest'; import { assembleECharts, assembleChartjs, assemblePlotly, assembleVegaLite } from '../src'; import { validateChart, validateChartInput } from '../src/validate'; +import { repairEncodingSorts } from '../src/core/resolve-semantics'; import { compile } from 'vega-lite'; import { parse, View } from 'vega'; const CATS = [{ Cat: 'A', Val: 30 }, { Cat: 'B', Val: 90 }, { Cat: 'C', Val: 50 }]; const CAT_TYPES = { Cat: 'Category', Val: 'Quantity' } as const; +describe('lazy sort-repair field discovery', () => { + it('does not enumerate rows for absent, channel, or invalid non-field sorts', () => { + const row = new Proxy({}, { ownKeys() { throw new Error('unexpected row enumeration'); } }); + const encodings = { + x: { field: 'Cat', sortBy: 'y' }, + y: { field: 'Val' }, + color: { field: 'Cat', sortBy: 42, sortOrder: 'descending' }, + size: { field: 'Val', sortOrder: 'sideways' }, + }; + const result = repairEncodingSorts(encodings, [row]); + expect(result.encodings).toEqual({ + x: encodings.x, + y: encodings.y, + color: { field: 'Cat' }, + size: { field: 'Val' }, + }); + expect(result.warnings.map(warning => warning.channel)).toEqual(['color', 'size']); + }); + + it('discovers fields on later rows once, including static-series sorts', () => { + let enumerations = 0; + const later = new Proxy({ rank: 1 }, { + ownKeys(target) { enumerations++; return Reflect.ownKeys(target); }, + }); + const encodings = { + x: { field: 'Cat', sortBy: 'rank' }, + y: [{ field: 'Val', sortBy: 'rank' }, { field: 'Other', sortBy: 'missing' }], + }; + const result = repairEncodingSorts(encodings, [null, 42, { Cat: 'A' }, later]); + expect(enumerations).toBe(1); + expect(result.encodings.x).toBe(encodings.x); + expect(result.encodings.y).toEqual([encodings.y[0], { field: 'Other' }]); + expect(result.warnings).toEqual([expect.objectContaining({ channel: 'y', code: 'invalid_sort' })]); + }); + + it('keeps actual JSON-looking fields ahead of explicit category arrays', () => { + const encodings = { x: { field: 'Cat', sortBy: '["B","A"]' } }; + const result = repairEncodingSorts(encodings, [{ Cat: 'A' }, { '["B","A"]': 2 }], { fieldSort: false }); + expect(result.encodings.x).toEqual({ field: 'Cat' }); + expect(result.warnings[0].message).toContain('raw data field'); + expect(repairEncodingSorts(encodings, [{ Cat: 'A' }], { fieldSort: false }).warnings).toEqual([]); + }); +}); + describe('Vega-Lite explicit category sorting', () => { const input = (sort: Record) => ({ data: { values: [ diff --git a/packages/flint-js/tests/spec-updates.test.ts b/packages/flint-js/tests/spec-updates.test.ts new file mode 100644 index 00000000..7957dfb1 --- /dev/null +++ b/packages/flint-js/tests/spec-updates.test.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * A spec's own `updates`: applied by the interactive runtime once the chart is drawn, before and + * under a host's updates of the same id; left out of static outputs, which say so. + */ + +import { describe, expect, it } from 'vitest'; +import { assembleVegaLite, type ChartAssemblyInput } from '../src'; +import { assemblePlotly } from '../src/plotly'; +import { assembleECharts } from '../src/echarts'; +import { assembleChartjs } from '../src/chartjs'; +import { validateChart } from '../src/validate'; +import { composeInteractiveOptions } from '../src/interactive/spec/compose'; + +const NOTE = { id: 'note', ops: [{ op: 'annotate-text', target: { select: { key: { Region: 'East' } } }, value: { text: 'Best quarter' } }] } as const; +const SHADE = { id: 'shade', ops: [{ op: 'set-style', targets: [{ select: { where: { Region: { in: ['West'] } } } }], value: { state: 'muted' } }] } as const; + +const chart = (updates?: unknown[]): ChartAssemblyInput => ({ + data: { values: [{ Region: 'East', Sales: 4 }, { Region: 'West', Sales: 3 }] }, + semantic_types: { Region: 'Category', Sales: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'Region', y: 'Sales' } }, + ...(updates ? { updates } : {}), +} as ChartAssemblyInput); + +describe('a spec’s updates', () => { + it('are applied before the host’s, a host update replacing the spec’s of its id', () => { + const composed = composeInteractiveOptions(chart([NOTE, SHADE]), { backend: 'vegalite', updates: [{ id: 'note', ops: [] }] }); + expect(composed.updates.map((update) => [update.id, update.ops.length])).toEqual([['shade', 1], ['note', 0]]); + expect(composeInteractiveOptions(chart([NOTE]), { backend: 'vegalite' }).updates.map((update) => update.id)).toEqual(['note']); + }); + + it('are left out of a static output, which says so; a spec without them says nothing', () => { + for (const assemble of [assembleVegaLite, assemblePlotly, assembleECharts, assembleChartjs]) { + const warning = (assemble(chart([NOTE, SHADE])) as any)._warnings?.find((each: any) => each.code === 'updates-not-compiled'); + expect(warning).toMatchObject({ severity: 'info' }); + expect(warning.message).toContain('"note", "shade"'); + expect(((assemble(chart()) as any)._warnings ?? []).some((each: any) => each.code === 'updates-not-compiled')).toBe(false); + } + }); + + it('are validated with the host’s, op by op against the chart, and named where malformed', () => { + const result = validateChart(chart([NOTE]), 'vegalite', { updates: [SHADE] as any }); + expect(result.valid).toBe(true); + expect(result.updates?.map((check) => check.id)).toEqual(['note', 'shade']); + // Validation assembles the chart without them: no note that the output lacks them. + expect(result.warnings.some((each) => each.code === 'updates-not-compiled')).toBe(false); + const bad = validateChart(chart([{ id: 'x', ops: [{ op: 'no-such-op' }] }]), 'vegalite'); + expect(bad.valid).toBe(false); + expect(bad.errors[0].message).toContain('input.updates[0]'); + }); +}); diff --git a/packages/flint-js/tests/stepped-key-layout.test.ts b/packages/flint-js/tests/stepped-key-layout.test.ts new file mode 100644 index 00000000..93e87cd0 --- /dev/null +++ b/packages/flint-js/tests/stepped-key-layout.test.ts @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { describe, it, expect } from 'vitest'; +import { parse, View } from 'vega'; +import { compile } from 'vega-lite'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { OMNI_VIZ_GAME_ORDER, OMNI_VIZ_ROWS } from '../src/test-data'; + +/** + * A stepped colour key beside a short plot runs about the plot's height. Vega-Lite draws a binned + * ramp as one bar, reading its length from the config, which a theme sizes for a row of bins above + * the plot; a key the canvas fit moves beside a short plot would otherwise hang far below it. Drawn + * upright, the bar is held to the plot's height, down to a line of label a bin. + */ + +const years = [2023, 2024, 2025]; +const ROWS = years.flatMap((year) => OMNI_VIZ_ROWS.map(({ period, game, newUsers }: any) => ({ period: `${year}${period.slice(4)}`, game, newUsers }))); +const PERIODS = [...new Set(ROWS.map((row) => row.period))].sort(); + +const input = (games: number, months: number) => { + const keep = new Set((OMNI_VIZ_GAME_ORDER as readonly string[]).slice(0, games)); + const from = PERIODS[PERIODS.length - months]; + return { + data: { values: ROWS.filter((row) => keep.has(row.game) && row.period >= from) }, + semantic_types: { period: 'YearMonth', game: 'Category', newUsers: 'Profit' }, + field_display_names: { newUsers: 'Net new users' }, + chart_spec: { + chartType: 'Heatmap', title: 'Net new users by game', subtitle: 'Monthly net change in active users', + encodings: { x: 'period', y: 'game', color: { field: 'newUsers', aggregate: 'sum' } }, + baseSize: { width: 480, height: 330 }, canvasSize: { width: 700, height: 500 }, + // Months as bands: the layout a short plot moves its key beside. + chartProperties: { xAxisType: 'nominal' }, + }, + theme_spec: 'economist', + } as any; +}; + +const silent = { warn() {}, info() {}, debug() {}, error() {}, level() { return this; } } as any; + +/** The key and the plot as Vega draws them. */ +async function drawn(spec: any) { + const view = new View(parse(compile(spec, { logger: silent }).spec), { renderer: 'none' }); + view.logger(silent); + await view.runAsync(); + let legend: any; + const rects: any[] = []; + const walk = (node: any) => { + if (!node) return; + if (node.role === 'legend' && node.bounds && !legend) legend = node.bounds; + if (node.marktype === 'rect' && node.role === 'mark') rects.push(node); + for (const item of node.items ?? []) walk(item); + }; + walk((view.scenegraph() as any).root); + const cells = rects.sort((a, b) => b.items.length - a.items.length)[0].items; + const top = Math.min(...cells.map((cell: any) => cell.y)); + return { legend: { height: legend.y2 - legend.y1 }, plotHeight: Math.max(...cells.map((cell: any) => cell.y + cell.height)) - top }; +} + +const SIZES: Array<[number, number]> = [[2, 18], [3, 18], [4, 22], [8, 24]]; + +describe('a stepped colour key', () => { + it('beside a short plot, reaches no further below it than a line of label a bin needs', async () => { + let beside = 0; + for (const [games, months] of SIZES) { + const spec: any = assembleVegaLite(input(games, months)); + const legend = spec.encoding.color.legend; + if (legend.orient !== 'right') continue; + beside++; + const { legend: drawnKey, plotHeight } = await drawn(spec); + const bins = spec.encoding.color.scale.range.length; + const fontSize = legend.labelFontSize ?? spec.config.legend.labelFontSize ?? 10; + const floor = bins * (fontSize + 2); + expect(spec.config.legend.gradientLength, `${games} × ${months}`).toBeLessThanOrEqual(Math.max(plotHeight, Math.round(floor))); + // The bar, its title above and its end labels: no more than a title's line past the floor's bar. + expect(drawnKey.height, `${games} × ${months}`).toBeLessThanOrEqual(Math.max(plotHeight, floor) + 32); + } + // Short plots move the key beside them: the case is covered. + expect(beside).toBeGreaterThan(0); + }); + + it('above a taller plot, keeps the row the theme sized for its labels', () => { + const spec: any = assembleVegaLite(input(8, 24)); + expect(spec.encoding.color.legend.orient).toBe('top'); + expect(spec.config.legend.gradientLength).toBeGreaterThan(200); + }); +}); diff --git a/packages/flint-js/tests/target-where.test.ts b/packages/flint-js/tests/target-where.test.ts index 2fddf95f..8c042a23 100644 --- a/packages/flint-js/tests/target-where.test.ts +++ b/packages/flint-js/tests/target-where.test.ts @@ -76,7 +76,7 @@ describe('validateChart: where targets', () => { }); it('takes a set only where an op acts on many marks', () => { - const note = check({ op: 'set-annotation', target: where({ region: { in: ['Asia'] } }), value: { text: 'x' } } as ChartUpdateOp); + const note = check({ op: 'annotate-text', target: where({ region: { in: ['Asia'] } }), value: { text: 'x' } } as ChartUpdateOp); expect(note.valid).toBe(false); expect(note.errors[0].message).toContain('this op acts on one mark, so it takes a key, not a where'); const both = check(style({ select: { key: { region: 'Asia' }, where: { region: { in: ['Asia'] } } } })); diff --git a/packages/flint-js/tests/temporal-midnight.test.ts b/packages/flint-js/tests/temporal-midnight.test.ts new file mode 100644 index 00000000..5e34ebc7 --- /dev/null +++ b/packages/flint-js/tests/temporal-midnight.test.ts @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { afterAll, describe, expect, it } from 'vitest'; +import { parse, View } from 'vega'; +import { compile } from 'vega-lite'; +import { assembleVegaLite } from '../src/vegalite/assemble'; +import { convertTemporalData } from '../src/core/resolve-semantics'; +import { readIsoTimestamp } from '../src/core/temporal-parse'; + +/** + * Dates that arrive as ISO timestamps (a database DATE column serialised to JSON, an API, a CSV + * export) read as the dates they are: the same axis labels and mark positions as a date-only value, + * on a machine in any time zone. + */ + +const zone = process.env.TZ; +afterAll(() => { + if (zone === undefined) delete process.env.TZ; + else process.env.TZ = zone; +}); + +const MONTHS = ['2005-05', '2005-06', '2005-07', '2005-08', '2006-02']; +const FORMS: Record unknown> = { + 'date only': (m) => `${m}-01`, + 'timestamp, no zone': (m) => `${m}-01T00:00:00.000`, + 'timestamp, UTC': (m) => `${m}-01T00:00:00.000Z`, + 'timestamp, space': (m) => `${m}-01 00:00:00`, + 'local Date': (m) => new Date(Number(m.slice(0, 4)), Number(m.slice(5)) - 1, 1), +}; + +async function drawn(chartType: string, semanticType: string, value: (month: string) => unknown, width: number) { + const spec: any = assembleVegaLite({ + data: { values: MONTHS.map((m, i) => ({ month: value(m), revenue: 5000 + i * 5000 })) }, + semantic_types: { month: semanticType, revenue: 'Amount' }, + chart_spec: { chartType, encodings: { x: { field: 'month' }, y: { field: 'revenue' } }, canvasSize: { width, height: 300 } }, + } as any); + const clean = JSON.parse(JSON.stringify(spec, (key, v) => (key.startsWith('_') ? undefined : v))); + const view = new View(parse(compile(clean).spec), { renderer: 'none' }); + await view.runAsync(); + const labels: string[] = []; + const xs: number[] = []; + const visit = (node: any): void => { + if (!node) return; + if (node.marktype === 'text' && node.role === 'axis-label') labels.push(...node.items.map((item: any) => String(item.text))); + if (['rect', 'symbol', 'line'].includes(node.marktype) && node.role === 'mark') xs.push(...node.items.map((item: any) => Math.round(item.x * 10) / 10)); + (node.items ?? []).forEach(visit); + }; + visit((view.scenegraph() as any).root); + view.finalize(); + return { labels: labels.filter((text) => !/^[\d,.$]+[kKM]?$/.test(text)), xs }; +} + +describe('a midnight timestamp under a date type', () => { + it('reads as its date, and keeps a zoneless time of day as a wall-clock time', () => { + expect(readIsoTimestamp('2005-05-01T00:00:00.000', true)).toBe('2005-05-01'); + expect(readIsoTimestamp('2005-05-01T00:00:00Z', true)).toBe('2005-05-01'); + expect(readIsoTimestamp('2005-05-01 00:00', true)).toBe('2005-05-01'); + expect(readIsoTimestamp('2005-05-01T00:00:00.000', false)).toBe('2005-05-01T00:00:00.000'); + expect(readIsoTimestamp('2005-05-01T13:30:00', true)).toBe('2005-05-01T13:30:00'); + expect(readIsoTimestamp('2005-05-01 13:30', false)).toBe('2005-05-01T13:30:00'); + expect(readIsoTimestamp('2005-05-01T13:30:00+02:00', true)).toBeNull(); + expect(readIsoTimestamp('2005-05-01', true)).toBeNull(); + expect(convertTemporalData([{ m: '2005-05-01T00:00:00.000' }], { m: 'YearMonth' })[0].m).toBe('2005-05-01'); + expect(convertTemporalData([{ m: '2005-05-01T09:15:00' }], { m: 'DateTime' })[0].m).toBe('2005-05-01T09:15:00'); + }); + + for (const tz of ['UTC', 'America/Los_Angeles']) { + it(`draws every form alike, in ${tz}`, async () => { + process.env.TZ = tz; + for (const [chartType, semanticType, width] of [['Bar Chart', 'YearMonth', 300], ['Bar Chart', 'YearMonth', 600], ['Line Chart', 'YearMonth', 600], ['Scatter Plot', 'Date', 600]] as const) { + const base = await drawn(chartType, semanticType, FORMS['date only'], width); + for (const [name, value] of Object.entries(FORMS)) { + const other = await drawn(chartType, semanticType, value, width); + expect(other.labels, `${chartType} ${width} ${name}`).toEqual(base.labels); + expect(other.xs, `${chartType} ${width} ${name}`).toEqual(base.xs); + } + } + }); + } +}); + +describe('a time of day with no zone', () => { + for (const tz of ['UTC', 'America/Los_Angeles']) { + it(`is labelled at the hour it says, in ${tz}`, async () => { + process.env.TZ = tz; + const spec: any = assembleVegaLite({ + data: { values: Array.from({ length: 24 }, (_, h) => ({ t: `2020-01-15T${String(h).padStart(2, '0')}:00:00`, v: 100 + h })) }, + semantic_types: { t: 'DateTime', v: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 't' }, y: { field: 'v' } }, canvasSize: { width: 600, height: 300 } }, + } as any); + const clean = JSON.parse(JSON.stringify(spec, (key, v) => (key.startsWith('_') ? undefined : v))); + const view = new View(parse(compile(clean).spec), { renderer: 'none' }); + await view.runAsync(); + const labels: string[] = []; + const visit = (node: any): void => { + if (!node) return; + if (node.marktype === 'text' && node.role === 'axis-label') labels.push(...node.items.map((item: any) => String(item.text))); + (node.items ?? []).forEach(visit); + }; + visit((view.scenegraph() as any).root); + view.finalize(); + const hours = labels.filter((text) => /AM|PM|Jan/.test(text)); + // The day starts at midnight on the 15th: no label falls on the 14th. + expect(hours[0]).toMatch(/^Jan 15/); + expect(hours.join(' ')).not.toMatch(/Jan 14/); + expect(hours).toContain('6 AM'); + }); + } +}); diff --git a/packages/flint-js/tests/theme-mark-rules.test.ts b/packages/flint-js/tests/theme-mark-rules.test.ts index e12e6dac..3e18aa87 100644 --- a/packages/flint-js/tests/theme-mark-rules.test.ts +++ b/packages/flint-js/tests/theme-mark-rules.test.ts @@ -46,6 +46,22 @@ describe('M1: an area’s edge is its own line', () => { const outlined = stackedBars({ id: 'o', geometry: { band: { outline: 'full', outlineWidth: 1 } } }); expect(nodes(outlined, 'bar').some((bar: any) => bar.mark.stroke)).toBe(true); }); + + it('draws a single series’ edge in the area’s own ink, not the renderer’s default', () => { + const spec = assembleVegaLite({ + data: { values: MIX.filter((r) => r.Source === 'Coal') }, semantic_types: { Year: 'Year', TWh: 'Quantity' }, + chart_spec: { chartType: 'Area Chart', encodings: { x: 'Year', y: 'TWh' } }, + theme_spec: { ...EDGE, ink: { series: { single: '#e2231a' } } }, + } as any) as any; + const [area] = nodes(spec, 'area'); + expect(area.mark.line.color).toBe(area.mark.color); + }); + + it('lets the edge part stacked bands in place of a surface separator', () => { + const [area] = nodes(stackedArea({ ...EDGE, marks: { separator: { presence: 'full', source: 'surface', width: 1.5 } } }), 'area'); + expect(area.mark.line).toBeDefined(); + expect(area.mark.stroke).toBeUndefined(); + }); }); describe('M2: a bar’s fill and its edge', () => { @@ -298,6 +314,15 @@ describe('a house’s key swatch (`legend.swatch`)', () => { expect(symbolTypes(stackedArea({ id: 'auto', legend: { swatch: 'auto' } }))).toEqual(symbolTypes(stackedArea({ id: 'none' }))); }); + it('keeps a line series’ stroke under a square swatch, which would draw it hollow', () => { + const lines = assembleVegaLite({ + data: { values: MIX }, semantic_types: { Year: 'Year', Source: 'Category', TWh: 'Quantity' }, + chart_spec: { chartType: 'Line Chart', encodings: { x: 'Year', y: 'TWh', color: 'Source' } }, + theme_spec: { id: 'sq', legend: { swatch: 'square' } }, + } as any) as any; + expect(symbolTypes(lines)).not.toContain('square'); + }); + it('reports that Plotly cannot draw it', () => { const fig = assemblePlotly({ data: { values: MIX }, semantic_types: { Year: 'Category', Source: 'Category', TWh: 'Quantity' }, diff --git a/packages/flint-js/tests/theme-number-compact.test.ts b/packages/flint-js/tests/theme-number-compact.test.ts index 53bc39e9..f37640e7 100644 --- a/packages/flint-js/tests/theme-number-compact.test.ts +++ b/packages/flint-js/tests/theme-number-compact.test.ts @@ -144,6 +144,34 @@ describe('number compaction: precision and collisions', () => { }); }); +describe('number compaction: a value that rounds up to the next unit (#172)', () => { + const each: CompactRule = { suffixes: COMPACT_SUFFIXES.short, per: 'value', threshold: 1000, on: ['labels'], types: DEFAULT_COMPACT_TYPES }; + const one: CompactRule = { ...each, per: 'scale' }; + const printed = (values: number[], rule: CompactRule) => values.map((v) => formatCompact(v, compactPrint(values, rule, 'significant')!, format)); + + it('rolls over to the next unit where rounding reaches a thousand', () => { + expect(printed([999600, -999600, 999600000, 999499], each)).toEqual(['1M', '−1M', '1B', '999k']); + expect(printed([999600, 420000, 150000], one)).toEqual(['1M', '0.42M', '0.15M']); + }); + + it('rolls over only where the stated precision rounds there', () => { + expect(printed([999960], { ...each, decimals: 2 })).toEqual(['999.96k']); + expect(printed([999960], { ...each, decimals: 0 })).toEqual(['1M']); + }); + + it('draws the same as it measures', async () => { + const chart = (values: number[], extra: Record) => drawn(assembleVegaLite({ + data: { values: values.map((revenue, i) => ({ region: 'NSEW'[i], revenue })) }, + semantic_types: { region: 'Category', revenue: 'Amount' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'region' }, y: { field: 'revenue' } }, chartProperties: { showValueLabels: true } }, + ...extra, + } as any) as any); + expect((await chart([999600, 420000, 150000], { theme_spec: 'nyt' })).labels).toEqual(expect.arrayContaining(['1M', '420k'])); + expect((await chart([1200000000, 999600000, 999600], {})).labels).toEqual(expect.arrayContaining(['1.2B', '1B', '1M'])); + expect((await chart([999600, 420000, 150000], { theme_spec: house({}) })).labels).toEqual(expect.arrayContaining(['1M', '0.42M'])); + }); +}); + describe('number compaction: a scale the chart already states', () => { it('leaves values the headline says are in millions whole', () => { expect(compactApplies({ semanticType: 'Quantity', said: 'Most populous countries, 2023 (millions)' }, DEFAULT_COMPACT_TYPES)).toBe(false); diff --git a/packages/flint-js/tests/theme-plotly.test.ts b/packages/flint-js/tests/theme-plotly.test.ts index fc776e3b..f3c3dba9 100644 --- a/packages/flint-js/tests/theme-plotly.test.ts +++ b/packages/flint-js/tests/theme-plotly.test.ts @@ -104,7 +104,7 @@ describe('omitted axis titles', () => { }); const text = plainTitle(figure.layout.title.text); expect(text).toContain('Consumer price changes; yoy_year_change'); - expect(figure.layout.xaxis.title.text).toBe(''); + expect(figure.layout.xaxis.title?.text ?? '').toBe(''); }); it.each([ @@ -124,7 +124,7 @@ describe('omitted axis titles', () => { const text = plainTitle(figure.layout.title.text); expect(text).toContain(subtitle ? `${subtitle}; Mass (kg)` : 'Mass (kg)'); if (title) expect(text).toContain(title); - expect(figure.layout.xaxis.title.text).toBe(''); + expect(figure.layout.xaxis.title?.text ?? '').toBe(''); }); }); @@ -475,9 +475,10 @@ describe('an outlined house on bars too thin to hold the outline', () => { describe('a banded axis measured against the room it has', () => { it('takes the house\'s overflow where straight labels will not fit, and never thins a row of names', () => { - const narrow = monthlyLine(theme({}), 260); - // Twelve month names (as plain categories) across 260px: too narrow a band to cut, and a row - // of names never drops some, so they stand upright. + const narrow = monthlyLine(theme({}), 160); + // Twelve month names (as plain categories) across 160px: measured in the face Plotly draws + // them in, too narrow a band to stand straight or cut, and a row of names never drops some, + // so they stand upright. expect(narrow.layout.xaxis.tickangle).toBe(-90); expect(narrow.layout.xaxis.ticklabelstep).toBeUndefined(); }); diff --git a/packages/flint-js/tests/theme-presets.test.ts b/packages/flint-js/tests/theme-presets.test.ts index 08b37b7b..58138ac0 100644 --- a/packages/flint-js/tests/theme-presets.test.ts +++ b/packages/flint-js/tests/theme-presets.test.ts @@ -130,6 +130,21 @@ describe('naming a house Flint ships', () => { expect(inherited?.ink?.series?.categorical).toEqual(categorical); }); + it('carries the type set in the house’s text ink over to the ink it is recoloured in', () => { + const night = resolveThemeSpec({ + extends: 'nyt', + ink: { surface: { source: 'house', canvas: '#141a24' }, text: { primary: '#f1e6cc', secondary: '#c9bc9c' } }, + }); + // The NYT states its headline in its primary ink and its deck in grey: both follow onto the dark page. + expect(night?.type?.headline?.color).toBe('#f1e6cc'); + expect(night?.type?.deck?.color).not.toBe('#6b6b6b'); + // A colour the extension states itself is kept. + const stated = resolveThemeSpec({ extends: 'nyt', ink: { text: { primary: '#222222' } }, type: { headline: { color: '#8a3b12' } } }); + expect(stated?.type?.headline?.color).toBe('#8a3b12'); + // An extension that leaves the ink alone leaves the type alone. + expect(resolveThemeSpec({ extends: 'nyt', accent: '#000000' } as any)?.type).toEqual(resolveThemeSpec('nyt')?.type); + }); + it('rejects an unknown inherited house', () => { expect(() => resolveThemeSpec({ extends: 'the-guardian' })).toThrow(/Unknown theme/); }); @@ -1980,3 +1995,57 @@ describe('status ink needs categories that carry a sign', () => { expect(new Set(range.slice(0, rows.length)).size).toBe(rows.length); }); }); + +describe('a bar split by detail reads as one bar', () => { + const rows = ['F0', 'F1', 'F2'].flatMap((magnitude, i) => ['TX', 'OK', 'KS', 'NE'].map((state, j) => ({ magnitude, state, count: (3 - i) * 400 + j * 50 }))); + const input = (theme_spec?: string) => ({ + data: { values: rows }, + semantic_types: { magnitude: 'Category', state: 'State', count: 'Count' }, + chart_spec: { chartType: 'Bar Chart', encodings: { y: { field: 'magnitude' }, x: { field: 'count' }, detail: { field: 'state' } } }, + ...(theme_spec ? { theme_spec } : {}), + }); + const bars = (spec: any) => (spec.layer ?? [spec]).filter((unit: any) => markTypeOf(unit.mark) === 'bar'); + const texts = (spec: any) => (spec.layer ?? [spec]).filter((unit: any) => markTypeOf(unit.mark) === 'text'); + + it('seals its segments in their own ink, with no house outline between them', () => { + for (const house of [undefined, 'pop']) { + const spec: any = assembleVegaLite(input(house) as any); + const [bar] = bars(spec); + expect(bar.encoding?.detail?.field ?? spec.encoding?.detail?.field).toBe('state'); + const mark = typeof bar.mark === 'string' ? { type: bar.mark } : bar.mark; + expect(mark.stroke, house).toBe(mark.fill ?? mark.color ?? '#4c78a8'); + } + }); + + it('prints and makes room for each bar total, not a segment', () => { + const spec: any = assembleVegaLite(input('mckinsey') as any); + const labels = texts(spec); + expect(labels.length).toBeGreaterThan(0); + for (const label of labels) { + expect(label.encoding.detail).toBeUndefined(); + expect(label.transform?.[0]).toEqual({ aggregate: [{ op: 'sum', field: 'count', as: 'count' }], groupby: ['magnitude'] }); + } + const domainMax = bars(spec)[0].encoding.x.scale?.domainMax; + if (domainMax !== undefined) expect(domainMax).toBeGreaterThan(1350); + }); +}); + +describe('a value-sorted bar chart keeps its order when the house prints the values', () => { + it('orders the bars and their labels by value, with a printed unit', () => { + const values = [ + { Category: 'Candy', Change: 7.3 }, { Category: 'Clothing', Change: 10.5 }, { Category: 'Flowers', Change: 4.4 }, + { Category: 'Jewelry', Change: 24.2 }, { Category: 'Greeting cards', Change: 1.6 }, + ]; + const spec: any = assembleVegaLite({ + data: { values }, + semantic_types: { Category: 'Category', Change: { semanticType: 'Amount', unit: 'USD' } }, + chart_spec: { chartType: 'Bar Chart', encodings: { y: { field: 'Category', sortBy: 'x', sortOrder: 'descending' }, x: { field: 'Change' } } }, + theme_spec: 'economist', + } as any); + const layers = (spec.layer ?? [spec]).filter((unit: any) => unit.encoding?.y?.field === 'Category'); + expect(layers.length).toBeGreaterThan(1); + for (const layer of layers) { + expect(layer.encoding.y.sort).toEqual(['Jewelry', 'Clothing', 'Candy', 'Flowers', 'Greeting cards']); + } + }); +}); diff --git a/packages/flint-js/tests/theme-source-rules.test.ts b/packages/flint-js/tests/theme-source-rules.test.ts index fe3cbc13..226a7efb 100644 --- a/packages/flint-js/tests/theme-source-rules.test.ts +++ b/packages/flint-js/tests/theme-source-rules.test.ts @@ -104,3 +104,15 @@ describe('S1: a logo credit at the line’s other end', () => { expect(spec._theme.report.map((r: any) => r.code)).toContain('credit-image-not-drawn'); }); }); + +describe('S1: a lead-in the author already wrote', () => { + it('is said once', async () => { + const { withoutLeadIn } = await import('../src/core/source-plan'); + expect(withoutLeadIn('Source: Gapminder', 'Source:')).toBe('Gapminder'); + expect(withoutLeadIn('sources: UN, World Bank', 'Source:')).toBe('UN, World Bank'); + expect(withoutLeadIn('Gapminder', 'Source:')).toBe('Gapminder'); + expect(withoutLeadIn('Source of truth: the ledger', 'Source:')).toBe('Source of truth: the ledger'); + expect(withoutLeadIn('Source: Gapminder', undefined)).toBe('Source: Gapminder'); + expect(withoutLeadIn('Source:', 'Source:')).toBe('Source:'); + }); +}); diff --git a/packages/flint-js/tests/theme-titles.test.ts b/packages/flint-js/tests/theme-titles.test.ts index 53bcf367..16794ea8 100644 --- a/packages/flint-js/tests/theme-titles.test.ts +++ b/packages/flint-js/tests/theme-titles.test.ts @@ -785,11 +785,11 @@ describe('a headline wider than its block', () => { expect(spec.title.text.join(' ')).toBe(LONG); }); - it('breaks over even lines, not one full line and an orphan', () => { + it('breaks over full lines, with no orphan at the end', () => { const lines: string[] = scattered(LONG, 'economist').title.text; expect(lines.length).toBeGreaterThan(1); const lengths = lines.map((l) => l.length); - expect(Math.min(...lengths)).toBeGreaterThan(Math.max(...lengths) * 0.6); + expect(lengths[lengths.length - 1]).toBeGreaterThan(Math.max(...lengths) / 4); }); it('takes the lines it gains out of the plot, not out of the canvas', () => { diff --git a/packages/flint-js/tests/title-fit.test.ts b/packages/flint-js/tests/title-fit.test.ts new file mode 100644 index 00000000..8a2455d5 --- /dev/null +++ b/packages/flint-js/tests/title-fit.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from 'vitest'; +import { filledLines, fullestLines, textPx } from '../src/core/title-fit'; + +const DECK = 'GDP per capita (log scale) vs life expectancy, 2007; bubble size = population; X: GDP per capita ($, log scale); Y: Life expectancy (years)'; +const width = (line: string) => textPx(line, 14); + +describe('filledLines', () => { + it('leaves text that fits the block on one line', () => { + expect(filledLines('Wealthier countries live longer', 600, 14, textPx)).toEqual(['Wealthier countries live longer']); + }); + + it('fills each line to the block where no widow is left', () => { + const lines = filledLines('one two three four five six seven eight nine ten', textPx('one two three four five six', 14), 14, textPx); + expect(lines).toEqual(['one two three four five six', 'seven eight nine ten']); + }); + + it('breaks a deck that would end in a widow over the same lines, as full as they can be', () => { + const block = 470; + const lines = filledLines(DECK, block, 14, textPx); + expect(lines).toHaveLength(3); + expect(lines.join(' ')).toBe(DECK); + for (const line of lines) expect(width(line)).toBeLessThanOrEqual(block); + expect(width(lines[2])).toBeGreaterThanOrEqual(block / 3); + // The block keeps its measure: the first line stays as full as greedy fill set it. + expect(width(lines[0])).toBeGreaterThan(block * 0.9); + }); +}); + +describe('fullestLines', () => { + it('takes the room a short last line needs across the lines above it', () => { + const block = 470; + const lines = fullestLines(DECK, 3, block, block / 3, 14, textPx)!; + const room = lines.slice(0, -1).map((line) => block - width(line)); + expect(Math.max(...room)).toBeLessThan(block / 3); + }); + + it('is undefined where no breaks keep every line within the block', () => { + expect(fullestLines('Supercalifragilistic word', 2, 20, 0, 14, textPx)).toBeUndefined(); + }); + + it('is undefined where the last line cannot reach its shortest', () => { + expect(fullestLines('a b', 2, 100, 90, 14, textPx)).toBeUndefined(); + }); +}); diff --git a/packages/flint-js/tests/tooltip-working-columns.test.ts b/packages/flint-js/tests/tooltip-working-columns.test.ts index fc520ee2..5aeecd77 100644 --- a/packages/flint-js/tests/tooltip-working-columns.test.ts +++ b/packages/flint-js/tests/tooltip-working-columns.test.ts @@ -68,4 +68,34 @@ describe('tooltips and Flint\'s working columns', () => { vlListTooltipFields(on); expect((on as any).encoding.tooltip).toEqual([{ field: 'Value', type: 'quantitative' }]); }); + + it('lists no sort index Vega-Lite computes to stack in a colour domain\'s order', () => { + // Interactive filtering pins the colour domain after assembly, then lists the tooltip again. + const spec: any = assembleVegaLite({ + data: { values: ['Drama', 'Comedy', 'Action'].map((Genre, index) => ({ Genre, Movies: 100 - index })) }, + semantic_types: { Genre: 'Category', Movies: 'Count' }, + chart_spec: { chartType: 'Bar Chart', encodings: { y: 'Genre', x: 'Movies', color: 'Genre' } }, + options: { addTooltips: true }, + } as any); + const { _theme, _canvasFit, _legendLayout, ...vl } = spec; + vl.encoding.color.scale = { ...vl.encoding.color.scale, domain: ['Action', 'Comedy', 'Drama'] }; + vlListTooltipFields(vl); + const signals: string[] = []; + JSON.stringify(compile(vl).spec, (key, value) => { + if (key === 'tooltip' && typeof value?.signal === 'string' && value.signal.startsWith('{')) signals.push(value.signal); + return value; + }); + expect(signals.length).toBeGreaterThan(0); + for (const signal of signals) { + expect(signal).not.toContain('sort_index'); + expect(signal).toContain('"Genre"'); + expect(signal).toContain('"Movies"'); + } + // A stack its author unstacked computes no index, and its tooltip is left to Vega-Lite. + const unstacked = { mark: 'bar', config: { mark: { tooltip: true } }, encoding: { + x: { field: 'Movies', type: 'quantitative', stack: null }, y: { field: 'Genre', type: 'nominal' }, + color: { field: 'Genre', type: 'nominal', scale: { domain: ['Action'] } } } }; + vlListTooltipFields(unstacked); + expect((unstacked.encoding as any).tooltip).toBeUndefined(); + }); }); diff --git a/packages/flint-js/tests/unit-display.test.ts b/packages/flint-js/tests/unit-display.test.ts index d2fd4cd8..1fc509a1 100644 --- a/packages/flint-js/tests/unit-display.test.ts +++ b/packages/flint-js/tests/unit-display.test.ts @@ -54,6 +54,12 @@ describe('explicit unit display policy', () => { .toEqual({ text: '$', placement: 'value', position: 'prefix' }); }); + it('keeps the case of a one-letter unit: `M` is millions, not metres', () => { + expect(resolveDisplayUnit({ semanticType: 'Count', unit: 'M' })) + .toEqual({ text: 'M', placement: 'field', position: 'suffix' }); + expect(resolveDisplayUnit({ semanticType: 'Distance', unit: 'KM' })?.text).toBe('km'); + }); + it('places a declared lexical unit beside the field name', () => { const axis = bars('years')._theme.decisions.axes.y; expect(axis.unit).toBeUndefined(); diff --git a/packages/flint-js/tests/validate-updates.test.ts b/packages/flint-js/tests/validate-updates.test.ts index 8d99315d..09fa5677 100644 --- a/packages/flint-js/tests/validate-updates.test.ts +++ b/packages/flint-js/tests/validate-updates.test.ts @@ -23,15 +23,26 @@ describe('validateChart updates: shape', () => { expect(errorsOf([])).toEqual([]); expect(errorsOf([ { id: 'agent', ops: [{ op: 'set-style', targets: [], value: { state: 'normal' } }] }, - { id: 'note', ops: [{ op: 'set-annotation', target: { select: { key: { a: 1 } } }, value: { text: 'x' } }] }, + { id: 'note', ops: [{ op: 'annotate-text', target: { select: { key: { a: 1 } } }, value: { text: 'x' } }] }, ])).toEqual([]); }); + it('still reads the deprecated set-annotation, with a warning to write annotate-text', () => { + const op = { op: 'set-annotation', target: { select: { key: { a: 1 } } }, value: { text: 'x' } }; + const result = validateChart(anyChart, 'vegalite', { updates: [{ id: 'note', ops: [op] }] }); + expect(result.errors).toEqual([]); + expect(result.updates![0].ops[0]).toMatchObject({ op: 'set-annotation', deprecated: 'annotate-text' }); + expect(result.warnings).toContainEqual(expect.objectContaining({ severity: 'warning', code: 'deprecated_op' })); + expect(CHART_UPDATE_OPS).not.toContain('set-annotation'); + }); + it('accepts a well-formed op of every name the contract lists', () => { const target = { select: { key: { a: 1 } } }; const ops = [ { op: 'set-style', targets: [target], value: { state: 'emphasized' } }, - { op: 'set-annotation', target, value: null }, + { op: 'annotate-text', target, value: null }, + { op: 'annotate-region', name: 'r', value: { x: [0, 1], text: 'Recovery' } }, + { op: 'annotate-enclosure', name: 'e', value: { targets: [target], shape: 'hull' } }, { op: 'set-viewport', axes: 'x', value: { x: [0, 1] } }, { op: 'set-order', scope: 'category', field: 'a', values: [2, 1] }, { op: 'set-overlay', name: 'line', value: null }, @@ -43,10 +54,10 @@ describe('validateChart updates: shape', () => { }); it('names the first missing or malformed field of an op, with its shape', () => { - expect(message([{ id: 'a', ops: [{ op: 'set-annotation', foo: 1 }] }])).toBe( - 'updates[0] (a).ops[0]: set-annotation has a missing or malformed "target". Shape: { op, target: UpdateTarget, value: { text, anchor?: \'segment\' | \'point\' } | null }. A target is { select: { key: { field: value } } }: this op acts on one mark, so it takes a key, not a where.', + expect(message([{ id: 'a', ops: [{ op: 'annotate-text', foo: 1 }] }])).toBe( + 'updates[0] (a).ops[0]: annotate-text has a missing or malformed "target". Shape: { op, target: UpdateTarget, value: { text, anchor?: \'segment\' | \'point\', highlight?: \'none\' | \'light\' | \'strong\' | \'exclusive\', style?: { fontSize?, fontWeight?, color? }, highlightStyle?: { color?, width? } } | null }. A target is { select: { key: { field: value } } }: this op acts on one mark, so it takes a key, not a where.', ); - expect(message([{ id: 'a', ops: [{ op: 'set-annotation', annotations: [{ kind: 'rule', x: '2022-12-01' }] }] }])) + expect(message([{ id: 'a', ops: [{ op: 'annotate-text', annotations: [{ kind: 'rule', x: '2022-12-01' }] }] }])) .toContain('missing or malformed "target"'); expect(message([{ id: 'a', ops: [{ op: 'set-style', targets: [{ region: 'East' }], value: {} }] }])) .toContain('set-style has a missing or malformed "targets"'); @@ -137,7 +148,7 @@ describe('validateChart updates: each op on the chart', () => { it('matches a note key against the rows, temporal values as dates', () => { const note = (key: Record) => only(line(), { - op: 'set-annotation', target: { select: { key } }, value: { text: 'Launch' }, + op: 'annotate-text', target: { select: { key } }, value: { text: 'Launch' }, } as ChartUpdateOp); expect(note({ month: '2022-12-01' })).toMatchObject({ ok: true, text: 'note "Launch" at month = 2022-12-01' }); expect(note({ month: '2022-12' }).ok).toBe(true); @@ -150,4 +161,39 @@ describe('validateChart updates: each op on the chart', () => { expect(only(line(), viewport).reason).toContain('add a navigate or brush-zoom interaction'); expect(only(line([{ type: 'navigate' }]), viewport).ok).toBe(true); }); + + it('checks a region\'s bounds against the chart\'s axes, and an enclosure\'s targets against its rows', () => { + const region = (value: unknown) => only(line(), { op: 'annotate-region', name: 'r', value } as ChartUpdateOp); + expect(region({ x: ['2022-11-01', '2022-12-01'], text: 'Holidays' })).toMatchObject({ ok: true, text: 'region "r" over x 2022-11-01 to 2022-12-01, captioned "Holidays"' }); + expect(region({ x: ['2022-11-01', null] }).ok).toBe(true); + expect(region({ x: ['2022-11-01'] }).reason).toContain('exactly two bounds'); + expect(region({ y: [0.8, 'high'] }).reason).toContain('is not a value of the y axis'); + const enclosure = (targets: unknown[]) => only(line(), { op: 'annotate-enclosure', name: 'e', value: { targets, text: 'Late year' } } as ChartUpdateOp); + expect(enclosure([{ select: { where: { month: { in: ['2022-11-01', '2022-12-01'] } } } }]).ok).toBe(true); + expect(enclosure([{ select: { key: { month: '2021-01-01' } } }]).reason).toContain('no row has'); + expect(enclosure([]).reason).toContain('names no targets'); + // set-annotation, the deprecated name of annotate-text, is checked alike. + const note = (op: string) => only(line(), { op, target: { select: { key: { month: '2022-12-01' } } }, value: { text: 'Launch' } } as ChartUpdateOp); + expect(note('annotate-text')).toMatchObject({ ok: true, text: note('set-annotation').text }); + expect(note('annotate-text').deprecated).toBeUndefined(); + }); + + it('advises against a note that repeats a value the chart prints on its mark', () => { + const bars = (theme?: string): ChartAssemblyInput => ({ + data: { values: [{ region: 'East', revenue: 55 }, { region: 'Online', revenue: 61 }] }, + semantic_types: { region: 'Category', revenue: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: { field: 'region' }, y: { field: 'revenue' } } }, + ...(theme ? { theme_spec: theme } : {}), + } as ChartAssemblyInput); + const note = (text: string, theme?: string) => validateChart(bars(theme), 'vegalite', { + updates: [{ id: 'n', ops: [{ op: 'annotate-text', target: { select: { key: { region: 'Online' } } }, value: { text } }] }], + }); + const repeated = note('Online leads: 61', 'nyt'); + expect(repeated.updates![0].ops[0]).toMatchObject({ ok: true }); + expect(repeated.updates![0].ops[0].advice).toContain('repeats revenue 61'); + expect(repeated.warnings).toContainEqual(expect.objectContaining({ severity: 'info', code: 'note_repeats_chart' })); + expect(note('Overtook East in March', 'nyt').updates![0].ops[0].advice).toBeUndefined(); + // Without value labels the value is read off the axis, not printed. + expect(note('Online leads: 61').updates![0].ops[0].advice).toBeUndefined(); + }); }); diff --git a/packages/flint-js/tests/value-label-format.test.ts b/packages/flint-js/tests/value-label-format.test.ts index a37d7af9..06468fed 100644 --- a/packages/flint-js/tests/value-label-format.test.ts +++ b/packages/flint-js/tests/value-label-format.test.ts @@ -55,6 +55,7 @@ describe('value label precision', () => { it('reaches for a k/M suffix once the numbers get long', () => { expect(inferValueLabelFormat([1234567, 2345678], undefined)).toBe('.3~s'); expect(formatValueApprox(1234567, '.3~s')).toBe('1.23M'); + expect(formatValueApprox(999600, '.3~s')).toBe('1M'); }); it('never uses an SI suffix on values below one', () => { diff --git a/packages/flint-js/tests/value-label-rules.test.ts b/packages/flint-js/tests/value-label-rules.test.ts index 1c84baf7..3f37227d 100644 --- a/packages/flint-js/tests/value-label-rules.test.ts +++ b/packages/flint-js/tests/value-label-rules.test.ts @@ -104,8 +104,11 @@ describe('L2: the room past a bar’s end, in px', () => { } as any); const bar = [spec, ...(spec.layer ?? [])].find((n: any) => (n.mark?.type ?? n.mark) === 'bar'); const scale = bar.encoding.x.scale; - expect(scale.rangeMax).toBeDefined(); - const inset = spec._width - scale.rangeMax; + // The room runs on the axis: the domain extends past the longest bar's rounded end (1,500) + // by the share of the plot the labels take, the range left whole. + expect(scale.rangeMax).toBeUndefined(); + expect(scale.domainMax).toBeGreaterThan(1500); + const inset = spec._width * (1 - 1500 / scale.domainMax); const widest = measureValueLabels([1429], { format: ',', text: { font: 'Arial', fontSize: 13 } }).widest; expect(inset).toBeGreaterThan(widest); // The old 0.8em a character kept 60px for "1,429" at 13px, and grew the canvas instead. diff --git a/packages/flint-js/tsup.config.ts b/packages/flint-js/tsup.config.ts index a676e7f4..e7adffaf 100644 --- a/packages/flint-js/tsup.config.ts +++ b/packages/flint-js/tsup.config.ts @@ -1,6 +1,9 @@ import { defineConfig } from 'tsup'; -export default defineConfig({ +/** The boundaries the renderers import on a map's first draw: one ES module each, split off by the host's bundler. */ +const LAZY_TOPOLOGIES = ['world-bank-coarse', 'world-bank-medium', 'world-110m', 'states-10m', 'counties-albers-10m']; + +export default defineConfig([{ entry: { index: 'src/index.ts', 'core/index': 'src/core/index.ts', @@ -14,7 +17,16 @@ export default defineConfig({ 'validate/links': 'src/validate/links.ts', 'interactive/index': 'src/interactive/index.ts', 'render/index': 'src/render/index.ts', + 'geo/index': 'src/geo/index.ts', 'react/index': 'src/react/index.ts', + 'react/vegalite': 'src/react/vegalite.ts', + 'react/echarts': 'src/react/echarts.ts', + 'react/chartjs': 'src/react/chartjs.ts', + 'react/plotly': 'src/react/plotly.ts', + 'interactive/vegalite': 'src/interactive/vegalite.ts', + 'interactive/echarts': 'src/interactive/echarts.ts', + 'interactive/chartjs': 'src/interactive/chartjs.ts', + 'interactive/plotly': 'src/interactive/plotly.ts', 'vegalite/interactive': 'src/vegalite/interactive.ts', 'echarts/interactive': 'src/echarts/interactive.ts', 'chartjs/interactive': 'src/chartjs/interactive.ts', @@ -33,5 +45,15 @@ export default defineConfig({ 'vega', 'vega-lite', 'vega-tooltip', 'echarts', 'chart.js', 'plotly.js', 'plotly.js-dist-min', 'react', '../vegalite/interactive', '../echarts/interactive', '../chartjs/interactive', '../plotly/interactive', '../validate/links', + // The bundled boundaries, imported by the package's own name (see src/vegalite/boundary-loader.ts). + /^flint-chart\/geo\/lazy\//, ], -}); +}, { + entry: Object.fromEntries(LAZY_TOPOLOGIES.map((name) => [`geo/lazy/${name}`, `src/geo/lazy/${name}.js`])), + format: ['esm'], + dts: false, + sourcemap: false, + clean: false, + splitting: false, + target: 'es2020', +}]); diff --git a/packages/flint-js/vitest.config.ts b/packages/flint-js/vitest.config.ts index e88a36c2..ff872567 100644 --- a/packages/flint-js/vitest.config.ts +++ b/packages/flint-js/vitest.config.ts @@ -1,6 +1,13 @@ +import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vitest/config'; export default defineConfig({ + resolve: { + alias: [ + // The renderers import the bundled boundaries by the package's own name; read them from source. + { find: /^flint-chart\/geo\/lazy\/([\w-]+)$/, replacement: fileURLToPath(new URL('./src/geo/lazy/$1.js', import.meta.url)) }, + ], + }, test: { globals: true, environment: 'node', diff --git a/packages/flint-mcp/assets/flint-app-author.SKILL.md b/packages/flint-mcp/assets/flint-app-author.SKILL.md new file mode 100644 index 00000000..8ab3ac87 --- /dev/null +++ b/packages/flint-mcp/assets/flint-app-author.SKILL.md @@ -0,0 +1,628 @@ +--- +name: flint-app-author +description: "Use when: the user asks for code that uses flint-chart: add Flint to a JS/TS app, a React component, a notebook or a script; mount a chart with interactions; read selections with onChange; apply updates from code; link charts in an app; or build a gesture no preset gives. Not for chart specs shown through the MCP tools." +--- + +# flint-chart: Flint in an application + +The chart input is the same `ChartAssemblyInput` the `flint-chart-author` +skill writes, and the `interaction_spec` and update ops are the +`flint-interaction-author` skill's. This skill is the code around them: +install, compile, mount, read the chart, link charts, and bespoke gestures. +Write code only when the user asks for it. + +In code, data is a runtime value: load it with normal code (a real CSV +parser, never `line.split(',')`) and pass `data: { values: rows }`. Keep the +values as the data has them; `semantic_types` reads them. + +## Install and compile + +For MCP clients, the server can run with `npx`: + +```bash +npx -y flint-chart-mcp +``` + +For JavaScript or TypeScript projects: + +```bash +npm install flint-chart +``` + +- `npm install flint-chart` is the whole install: it comes with every backend + (Vega-Lite, ECharts, Chart.js, Plotly). React is an optional peer, needed only + for `flint-chart/react`. +- Draw with `` from `flint-chart/react`, or `mountChart` + from `flint-chart/interactive`; presets, update helpers and types come from + `flint-chart/interactive` too. +- Compile with `assembleVegaLite`, `assembleECharts`, `assembleChartjs` or + `assemblePlotly` from `flint-chart`; `renderSvg` from `flint-chart/render` + draws a static SVG (Vega-Lite or ECharts). +- Only for an app bundled into one file (no code splitting): import + `flint-chart/react/` or `flint-chart/interactive/` + (`vegalite`, `echarts`, `chartjs`, `plotly`), which reaches no other backend, + so the file carries one library. + +Then compile with the requested backend: + +```ts +import { assembleChartjs, assembleECharts, assembleVegaLite } from 'flint-chart'; + +const vegaLiteSpec = assembleVegaLite(input); +const echartsOption = assembleECharts(input); +const chartjsConfig = assembleChartjs(input); +``` + +Python support is planned for a later release. Until the PyPI package is +published, use the npm package or MCP server for released workflows. + +## Mount + +```ts +import { mountChart, navigate, legendToggle } from 'flint-chart/interactive'; + +const surface = mountChart(container, input, { + backend: 'vegalite', + renderer: 'svg', + interactions: [navigate({ axes: 'x' }), legendToggle()], + chartId: 'sales', +}); +await surface.ready; +const warnings = await surface.warnings; // interactions the chart could not honour +// … +surface.destroy(); +``` + +| Member | What it does | +| --- | --- | +| `ready`, `warnings` | Promises: the first render; the dropped or yielded interactions. Every call below waits for `ready` itself. | +| `applyUpdate(update, options?)` | Retains one update by id; replaces the layer with the same id. `options.transition.duration` animates a viewport. | +| `setUpdates(updates)` | Replaces every retained update. | +| `clearUpdate(id)` | Removes one layer. | +| `dispatch(id, payload)` | Runs an `externalInteraction` handler and applies what it returns. | +| `getState()` | What the chart shows now; `undefined` before `ready`. | +| `onChange(callback)` | Every change to that state, after the render; returns the unsubscribe. | +| `layout` | Once ready: `plot`, the plot box `{ width, height }` on a chart that draws one plot; `views`, each drawn view as `{ role, box: { x, y, width, height } }` (role `plot`, `text`, `tile` or `rule`; facet panels row by row); `block`, the box the views take with their axes and headers, without title and keys. Boxes are in pixels from the drawn chart's top left, read from what it drew, so they follow filters and resizes. `undefined` on charts with a category rail and on non-Vega-Lite backends. | +| `refresh()` | Re-projects overlays after the host rescales the chart. | +| `element`, `chartId` | The mount's root and the stable chart id. | +| `destroy()` | Removes listeners, the renderer, and the DOM. | + +- `input` is a `ChartAssemblyInput`. Presets go in `input.interaction_spec` as + JSON or in `options.interactions` as factory calls. Both may appear; spec + entries mount first, and a code definition with a spec entry's `id` + replaces it with an `interaction_overridden` info warning. +- A malformed `interaction_spec`, a repeated code `id`, or a code definition + the chart cannot honour fails the mount with an error that names it. A spec + entry the chart cannot honour is dropped with a warning instead. +- `options.availableSize: { width?, height? }` is the room the host gives the + chart. It becomes the `canvasSize` ceiling on the sides given, so the chart + lays out for that room rather than being scaled into it. +- `options.updates` holds retained updates present at the first render, for a + chart that starts with a part hidden or framed. +- `renderer: 'svg'` for charts whose marks a host reads from the DOM, or under + a few thousand marks; `'canvas'` for maps and dense charts. +- A `Year` or `Date` field makes a temporal axis whose rows hold `Date`s or + ISO strings; a bare number such as `2013` reads as milliseconds after 1970. + A `semantic_types` entry may be an object, + `{ semanticType, intrinsicDomain: [lo, hi] }`; the intrinsic domain holds an + axis still while the rows change. +- `options: { addTooltips: false }` on the input is the switch for the + tooltip, for a chart whose hidden values it would give away. +- Build with a bundler. The interactive entry reaches every backend through + lazy imports with no file extension; when `echarts`, `chart.js`, and + `plotly.js-dist-min` are not installed, mark them external (esbuild + `--splitting --external:echarts --external:chart.js --external:plotly.js-dist-min`; + Vite `build.rollupOptions.external`). +- In React, use `` from `flint-chart/react` rather than mounting + in an effect; see "In React" below. + +## In React + +```tsx +import { FlintChart, type FlintChartHandle } from 'flint-chart/react'; +import { clickHighlight } from 'flint-chart/interactive'; + +const chartRef = useRef(null); + + setSelected(change.state.selected)} + onError={(error) => report(error)} +/>; +``` + +| Prop | What it does | +| --- | --- | +| `spec` | The `ChartAssemblyInput`, `interaction_spec` included. A change of content remounts; rows compare by reference. | +| `interactions` | Factory calls added to the spec's entries, or `(fromSpec) => definitions` for the full list. A factory rebuilt with the same id and options keeps the chart; a changed option remounts it. | +| `updates` | Host updates, diffed by id. Passing even `[]` mounts the runtime on a chart with no interactions. | +| `width`, `height`, `fit` | The box. `fit` is `scale-down` (default; never scales up), `crop` (natural size, clipped), or `relayout` (the box becomes the layout room; a resize remounts once it settles, so a selection does not survive it). | +| `onChange`, `onInteraction` | The state after a change, and the raw gesture record. | +| `onRender`, `onWarnings`, `onError` | Each mount's render and warnings; a failed mount, shown in the box as a muted error. | +| `fallback` | Shown until the chart mounts. | +| `ariaLabel`, `chartId` | `ariaLabel` applies in place; a new `chartId` remounts. | + +The ref's `FlintChartHandle` holds `surface` (the mounted surface or `null`), +`applyUpdate`, `clearUpdate`, `dispatch`, `getState`, and `refresh`. A remount +keeps the old chart on screen until the new one is ready. + +## Read the chart + +| `getState()` field | Holds | +| --- | --- | +| `selected` | The marks the chart emphasizes now, previews included. | +| `entries` | The same marks per update id, with `layer: 'retained' \| 'preview'`. | +| `hidden` | Legend values a `legend-toggle` hides, as `{ channel, value }`. | +| `viewport` | The domain on view after a pan or zoom; absent on a chart that does not navigate. | +| `categoryOrder` | The order of the reorderable axis now. | +| `windows` | Category rail windows, `{ start, count, total }` per channel. | + +Each element's `value` is the mark in field terms: a bar's category and +measure, a legend item's `{ channel, field, domain }`, a histogram bar's +`{ field, range }`. The host owns the rows and queries them from the value and +the geometry. + +`onChange` fires after every render with a `ChartChange`: `phase` (`preview` +while a gesture runs, `commit` for a committed change or a host call, `cancel` +when a gesture ends with nothing), `interactionId` and `action` (absent for a +host call and for a reset), the gesture's own `target` and `geometry`, and the +`state` after. An overlay or a data swap leaves no trace in the state, so the +host keeps that model itself. + +```ts +const valuesOf = (elements: readonly SemanticElement[]) => elements.map((element) => element.value); + +// A panel follows the gesture live, else shows what the chart shows. +surface.onChange(({ phase, target, state }) => { + const hit = valuesOf(target?.elements ?? []); + panel.show(phase === 'preview' && hit.length > 0 ? hit : valuesOf(state.selected)); +}); + +// An agent context reads committed state only: values and ranges, never rows. +surface.onChange(({ phase, state, geometry }) => { + if (phase !== 'commit') return; + sendContext({ selected: valuesOf(state.selected), range: geometry?.domain, hidden: state.hidden, viewport: state.viewport }); +}); +``` + +The container also emits a bubbling DOM event, `flint-interaction`, for every +canvas interaction, before the chart reacts: `detail.chartId`, +`detail.interactionId`, and `detail.event`, the same `CanvasInteractionEvent` +a handler gets. It fires for a definition whose `handle` returns `null`, so it +is the path for a host that draws its own response to a gesture. + +Things the surface holds fixed: no preset changes the layout, so a zoom never +recomputes the bar step, the ticks, or the domain (filter the rows and mount +again for that); the mute level is set at mount; Escape reaches a chart after +a press on it, and only that chart; a preset's toggle (`select`, +`click-highlight`) needs Shift, Ctrl, or Meta, and a plain second click +replaces; a press on an overlay path resolves to no mark, so a `click-none` +reset on the definition that drew the overlay clears it at that press. + +## Apply updates and read the result + +`applyUpdate`, `setUpdates` and `dispatch` take the same `{ id, ops }` layers +as the interaction skill's "Update the chart", and return what applied. +**The result.** `applyUpdate`, `setUpdates`, and `dispatch` return a +`ChartUpdateResult`: `{ status: 'applied' | 'partially-applied' | +'unsupported', resolvedTargets, unresolvedTargets, unsupportedOps }`. An +unresolved target has a wrong field or value; an unsupported op needs a +preset the chart does not mount. What the chart shows is what the result says +it shows: fix an unresolved key or drop an unsupported op before describing +the chart. + +## Link charts + +`linkCharts` links mounted charts on the fields they share. A selection on one +chart (a click, a brush, a group focus, a hover) becomes one condition, a part +per field; every chart emphasizes the marks that meet it, the source included, +through one `linked-selection` layer; a reset on any chart clears it everywhere. + +```ts +import { linkCharts, mountChart, clickHighlight, brushX } from 'flint-chart/interactive'; + +const link = linkCharts({ + bars: { input: barsInput, surface: mountChart(barsEl, barsInput, { backend: 'vegalite', interactions: [clickHighlight()] }) }, + trend: { input: trendInput, surface: mountChart(trendEl, trendInput, { backend: 'vegalite', interactions: [brushX()] }) }, +}, { fields: ['region', 'month'] }); +for (const [id, chart] of Object.entries(await link.links)) console.log(id, chart.notes); // what each chart left out +link.onCondition(({ condition }) => table.filter(condition)); // { region: { in: ['Asia'] }, month: { range: [start, end] } } +// link.clear(); link.destroy(); +``` + +**A table, a filter or any control beside linked charts** joins the same +condition: `link.select(parts)` sets parts as if a chart had selected them, and +`onCondition` gives the table what to show. One condition, so a row click, a +region picker and a brush combine (AND) and a reset on any chart clears them all. + +```ts +row.addEventListener('click', () => link.select({ country: { in: [row.dataset.country] } })); +regionPicker.addEventListener('change', (e) => link.select({ region: e.target.value ? { in: [e.target.value] } : null })); // null lets go +link.onCondition(({ condition }) => renderTable(rows.filter((r) => meets(r, condition)))); +``` + +- `select` only takes fields in `fields`; a chart shows a part when its marks + carry the field (encode it, or put it on `detail`). +- The link emphasizes the matching marks; to drop rows instead (a filter), give + the charts filtered data as below. + +```tsx +import { FlintChart, useLinkedCharts } from 'flint-chart/react'; + +const link = useLinkedCharts({ bars: barsInput, trend: trendInput }, { fields: ['region', 'month'] }); +; +// link.select({ region: { in: ["Asia"] } }) from a table or control; link.clear() +; +// the chart's own onChange, onRender and updates go through chart(id, own); a prop after the spread replaces the link's +// link.condition.condition is the same condition; filtered rows in `spec` keep it +``` + +- A chart receives a field when its marks carry it (encode it, on `detail` if + nothing else shows it), and sends through each selecting interaction whose + subject includes a connected field. `{ charts: { trend: { receive: false } } }` + keeps a chart as drawn; `send: false` keeps its selections to itself. +- The link emphasizes; it never filters or re-aggregates. To filter, read the + condition (`onCondition`, `link.condition`) and give each chart its rows: + beside `linkCharts`, a `set-data` update (a new spec remounts the chart, and + the link holds the old surface); beside `useLinkedCharts`, a `spec` with the + filtered rows. +- `setUpdates` replaces every layer, the link's included, until the condition + next changes; use `applyUpdate` and `clearUpdate` beside a link. +- `linkCharts` checks the charts with the validator, loaded on first use; pass + `{ links }` from `validateLinks` (`flint-chart/validate`) to skip that load. + +For a link `linkCharts` does not express (a payload each chart reads its own +way), wire `onChange` to an `externalInteraction` on the other charts: + +```ts +const linked = externalInteraction<{ countries: string[] }>({ + id: 'linked', + handle: ({ countries }) => ({ + id: 'linked', + ops: [{ op: 'set-style', targets: [{ select: { where: { Country: { in: countries } } } }], value: { state: 'emphasized' } }], + }), +}); +source.onChange(({ phase, interactionId, state }) => { + if (phase !== 'commit' || !interactionId) return; // host writes carry no id: no loop + void other.dispatch('linked', { countries: state.selected.map((element) => String(element.value.Country)) }); +}); +``` + +Linked charts share one `theme_spec` so a value has one colour everywhere. + +The same `dispatch` drives a chart over time: a playback loop dispatches one +frame per animation frame, and the handler returns the whole layer for that +frame. + +## When no preset fits + +A host that runs code mounts a `CanvasInteractionDef` in `options.interactions` +beside presets: a trigger, what it affords, and a handler that returns the +layer for its id. + +```ts +import { rectangleTrigger, type CanvasInteractionDef } from 'flint-chart/interactive'; + +const timebox: CanvasInteractionDef = { + id: 'timebox', + eventSource: rectangleTrigger('contain'), + affordances: { plot: { cursor: 'region' } }, + reset: ['click-none', 'escape'], + handle(event) { + if (event.action !== 'select-region' || event.phase !== 'commit') return null; + const x = event.geometry.domain?.x; + const y = event.geometry.domain?.y; + if (x?.kind !== 'interval' || y?.kind !== 'interval') return null; + const keep = seriesInsideBox(x.start, x.end, Number(y.start), Number(y.end)); // host logic over host rows + return { + id: 'timebox', + ops: [{ op: 'set-style', + targets: keep.map((series) => ({ select: { key: { Series: series } } })), + value: { state: 'emphasized' } }], + }; + }, +}; +``` + +| Field | Role | +| --- | --- | +| `id` | Names the interaction in events and the layer it retains. | +| `eventSource` | The trigger: what to capture and how to read it. | +| `affordances` | The kinds of hit the handler receives, each with its cursor and hover; a hit of a kind not listed never reaches it. Keys: `mark`, `legend-item`, `axis-label`, `plot`. Cursors: `activate`, `drag`, `region`, `navigate`, `inspect`, `draw`. Hovers: `target` (the mark), `cohort` (its group). | +| `handle(event, context)` | Returns the whole layer for this id, or `null` for no change. | +| `reset` | Gestures that clear the layer: `click-none`, `double-click`, `escape`. A reset reports as a commit with no `interactionId`. It suits a layer of styles the state shows; an overlay or a data layer is cleared by the host. | + +**Triggers.** + +| Trigger | The reader does | `action` | `geometry.plot` | `geometry.domain` | Affordance key | +| --- | --- | --- | --- | --- | --- | +| `clickTrigger` | Clicks a mark, legend item, or axis label. | `click-element`, `click-legend`, `click-axis` | `point` | — | `mark`, `legend-item`, `axis-label` | +| `hoverTrigger` | Moves over a mark. | `hover-element`, `hover-legend`, `hover-axis` | `point` | — | same | +| `dragTrigger(tolerance?)` | Presses a mark, or a projectable overlay path, within `tolerance` px (12) and drags. | `drag` | `drag { start, current, delta }` | the pointer's values; `geometry.projection` while over a projectable overlay | `mark` | +| `rectangleTrigger(match?, guide?)` | Drags a rectangle. | `select-region` | `rect` | `x`, `y` intervals | `plot` | +| `xBrushTrigger(match?, mode?, guide?)`, `yBrushTrigger(…)` | Drags an interval along one axis. | `brush-x`, `brush-y` | `rect` | that axis's interval | `plot` | +| `lassoTrigger(match?, guide?)` | Draws a freehand region; previews begin at the third point. | `select-lasso` | `polygon` | `points`: the stroke so far, in data values | `plot` | +| `angularBrushTrigger(match?, mode?, guide?)` | Drags a sector on a polar chart. | `brush-angle` | `angular-sector` | — | `plot` | +| `inspectTrigger(mode?)` | Moves over the plot. | `inspect-x`, `inspect-y`, `inspect-xy` | `point` | `x`, `y` values | `plot` | +| `inspectIndexTrigger(axis?, show?, seriesBy?)` | Moves along the index axis. | `inspect-x`, `inspect-y` | `point` | the index value | `plot` | +| `navigationTrigger({ axes?, pan?, zoom?, reset? })` | Drags, wheels, pinches. | `pan-viewport`, `zoom-viewport`, `reset-viewport` | `viewport { delta, factor, anchor }` | the viewport after the move | `plot` | +| `contextTrigger`, `longPressTrigger(ms?)`, `doubleActivateTrigger` | Right-clicks, holds (500 ms), double-clicks a mark. | `context-element`, `long-press-element`, `double-activate-element` | `point` | — | `mark` | + +`match` is `'intersect'` (default) or `'contain'` and decides which marks the +region's `target` lists. `guide` styles the drawn shape; `false` hides it. A +region is ephemeral: its guide and its preview end at the commit. A brush or +`select` with `mode: 'stateful'` keeps its region on screen and editable, and +`event.operation` reads `create`, `move`, `resize-leading`, `resize-trailing`, +or `clear`. Spread a trigger to tune it: +`{ ...hoverTrigger, defaultAssistDistance: 28 }` acquires the nearest mark +within 28 px. A chart admits a trigger when it offers what the trigger needs, +per what `list_interaction_presets` says each preset requires; a code definition the chart cannot honour throws at +mount with a message that names what it needed. + +**The event.** + +```ts +interface CanvasInteractionEvent { + action: string; // from the table + phase: 'start' | 'preview' | 'commit' | 'cancel'; // clicks and hovers skip start + operation?: string; // a stateful brush's edit, or pan | zoom | reset + geometry: { plot?, domain?, projection? }; + target: { visual: { kind, role }, elements: [{ value, records? }] } | null; + modifiers?: { shift, ctrl, meta }; + description?: { kind, type, content, text }; // on focus-element from accessible-navigation +} +``` + +- `target.elements[i].value` holds the mark's encoded values, derived fields + included; `records` holds the source rows when the runtime can prove them. A + region target lists every mark inside. A legend hit's `value` is a + `LegendTargetValue`: `{ channel, field, domain: { kind: 'value', value } }`, + or `{ kind: 'interval', start, end }` on a continuous legend. An axis-label + hit's `value` is an `AxisTargetValue`: `{ axis, field, value }`. +- `geometry.domain` is inverted through the plot's scales: a brush on a time + axis gives `domain.x = { kind: 'interval', start: Date, end: Date }`, a linear + axis gives numbers, a discrete axis gives the category. +- `description` arrives on `focus-element` while `accessible-navigation` walks + the chart: what the focused element is (`type`, such as "Bar") and what it + represents (`content`), with the spoken `text`. The walk's emphasis reports + through `onChange` as a `preview`. +- `geometry.projection.kind === 'path'` during a drag over an overlay with + `projectable: true`: `segment.start.value` and `segment.end.value` are the + overlay rows on each side of the pointer and `segment.t` the fraction between + them. + +**The types.** `flint-chart/interactive` exports these, and `flint-chart/react` +re-exports them. `onChange` receives a `ChartChange`: the gesture's own +`target` and `geometry`, and the chart's `state` after it. Generated from the +source by `npm run gen:reference`: + + +```ts +interface ChartChange { + // `preview` while a gesture runs, `commit` for a committed change, `cancel` when a gesture ends with none. + phase: ChartChangePhase; + // `host` for `updates`, `applyUpdate`, `clearUpdate` and `dispatch`; always `commit`. + source: ChartChangeSource; + changed: ChartStateFacet[]; + // The interaction behind the change: a reader's gesture, or an external interaction run by `dispatch`. + interactionId?: string; + action?: CanvasInteractionAction; + // The gesture's own hit: the hovered point, or the marks at an inspected index. + target?: SemanticTarget | null; + // The gesture's geometry: a brushed range, an index value, or the viewport after a move. + geometry?: CanvasInteractionEvent['geometry']; + // The reset gesture a reader made: a click on nothing, Escape, or a double-click. Reported even when the chart held nothing to reset, so a host that shows a selection of its own can let it go. + reset?: InteractionResetGesture; + state: ChartState; + previous: ChartState; +} + +interface ChartState { + chartType: string; + // The marks the chart emphasizes or focuses now, previews included. + selected: SemanticElement[]; + // The emphasized marks of each update, by update id; `selected` is their union. + entries?: ReadonlyMap; + // The legend values a toggle hides now. + hidden?: ChartHiddenValue[]; + // The domain the plot shows now, when the chart navigates. + viewport?: DomainGeometry; + // The category window of each rail. + windows?: Partial>; + categoryOrder?: unknown[]; + // The notes the chart holds now, previews included; `inView` tells which ones it draws. + annotations?: ChartAnnotation[]; + // The active filter of each field, set by filter controls; absent fields show every value. + filters?: Readonly>; +} + +interface SemanticTarget { + visual: { + kind: 'mark' | 'path' | 'region' | 'widget' | 'handle' | 'legend' | 'axis' | 'chart' | 'title' | 'header'; + role: string; + }; + elements: SemanticElement[]; +} + +interface SemanticElement { + // Values represented by the mark's channels, or by a semantic control such as a legend item. + value: Record; + // Contributing input records when provenance is available; zero or many may support one value. + records?: Record[]; +} + +interface LegendTargetValue { + channel?: string; + field?: string; + // The entry's value on a reader's hit; read `domain`, which every legend target carries. + value?: unknown; + domain: LegendDomain; +} + +type LegendDomain = + | { kind: 'value'; value: unknown } + | { kind: 'interval'; start?: number; end?: number }; + +interface AxisTargetValue { + axis: 'x' | 'y'; + field: string; + value: unknown; +} + +interface DomainGeometry { + x?: DomainCoordinate; + y?: DomainCoordinate; + points?: DomainPoint[]; + // The detail level a multi-level projected chart draws for this viewport. + level?: string; + // On a multi-level projected chart, the coarsest-level region under the plot centre: its feature id and properties plus the joined row fields. + focus?: Record; +} + +type DomainCoordinate = + | { kind: 'value'; value: DomainValue } + | { kind: 'interval'; start: DomainValue; end: DomainValue }; + +type DomainValue = number | Date | string; + +interface DomainPoint { + x?: DomainValue; + y?: DomainValue; +} + +interface ChartHiddenValue { + channel: string; + value: unknown; +} + +type FilterValue = + | { in: unknown[] } + | { range: [unknown, unknown] }; +``` + +- `context` is the chart state plus `available`, every drawn mark, for + building refs, and `selected`, the current emphasis, for a toggle rule. + +**The handler.** + +- It returns the complete layer for the id on every `preview` and `commit`; + the runtime drops the preview on `cancel`. A `null` on a `preview` shows + nothing until the commit, which is how a rule applies to the committed box + only. A region gesture keeps a preview layer under the interaction's id + while the drag runs, so a commit after previews restates the layer; a + `null` there lets the last preview stand. +- It maps geometry to the host's model and the model to ops. Host side + effects (state, panels, overlays the host draws) come from + `flint-interaction` or `onChange`, which carry the same event; the handler + itself returns ops and leaves the DOM to the runtime. +- Triggers have one owner for code definitions as for presets; two code + definitions on one trigger throw at mount. `navigate({ pan: false })` goes + beside a region trigger. +- An element drag owns the press on the marks it affords. A press there is a + `drag` with phase `start`; `target` is the pressed mark through every phase. + The layer returned at `start` is kept as the gesture's preview, and a release + without movement commits that preview with no further call. No click + definition fires on those marks, so the definition that drags a mark also + answers its press. +- A click definition that affords `hover` on marks receives `preview` events + for the hover cue. Return `null` or an emphasis for them, and the layer on + `commit`. + +**Patterns.** + +| Pattern | Flow | Pieces | +| --- | --- | --- | +| Gesture rule | Flint in, Flint out | A region trigger reads `geometry.domain`; the host rule picks rows; `set-style` by key (the timebox above). | +| Host-drawn detail | Flint in, custom out | `hoverTrigger` or `inspectTrigger` with a `null` handle; the host listens to `flint-interaction` for the resolved element and draws a lens, a cursor, or a badge over the mount. | +| Application drives the chart | external in, Flint out | `externalInteraction` plus `dispatch` per frame: a playback year, a reveal progress. | +| Drag along a path | press, then drag | One `dragTrigger()` definition and one layer. At `start` on a mark it returns the mark's path as a `set-overlay` `line` with `interactive: true, projectable: true` and `order`, plus `set-data` for the current position. On `preview` and `commit` with `geometry.projection` it returns the same two ops for the pointer's position. `intrinsicDomain` on the x and y fields holds the axes still across the swaps. | +| Freehand stroke | draw | The rows to guess form their own series, and a mount update sets `opacity: 0` on that series, which keeps the axis. `lassoTrigger('contain', false)` with `plot: { cursor: 'draw' }` is the pen: `geometry.domain.points` become the rows of a `set-overlay` line. An `externalInteraction` reveals the truth as an overlay, then the host clears the hide. | +| Chart-level zoom | wheel | When the layout itself must change (bar step, ticks, domain), filter the rows and `mountChart` again in a hidden layer; swap on `ready`. No preset re-lays out. | +| Semantic zoom on a map | navigate | A Choropleth with `level: 'auto'` (US states, then counties) or with your own `levels: [{ value, url, feature?, enter?, exit? }]` (one GeoJSON or TopoJSON object per level, rows joined on the feature `id` or `featureKey`, `baseMapUrl` drawn beneath as land without data), or a Map with `levelField` and `levels`; `navigate()`, and `set-viewport { region: { key } }` with a `transition` to fly into a region. Navigation events carry `geometry.domain.level` and `focus` (the coarsest region under the centre). A hover reaches the host through a hover affordance (`hover: 'target'`); a handler that returns `null` leaves the map as drawn. | + +Host-drawn detail, the shape of it: + +```ts +const probe: CanvasInteractionDef = { + id: 'probe', + eventSource: { ...hoverTrigger, defaultAssistDistance: 28 }, + affordances: { mark: { hover: 'target' } }, + handle() { return null; }, +}; +container.addEventListener('flint-interaction', (e) => { + const { interactionId, event } = (e as CustomEvent).detail; + if (interactionId !== 'probe' || event.phase !== 'preview') return; + const row = event.target?.elements[0]?.records?.[0]; + if (row) lens.show(row); // the host draws; the chart is unchanged +}); +``` + +## Worked examples + +### A chart that drives the app + +User: "In my dashboard, a click selects the country and a double-click opens +its page. Zooming the y axis would help too." A scatter of `gdp` by `life` +with `color: continent` and `detail: country`. + +`navigate` holds the double-click by default for its reset, and +`double-activate` needs it; `reset: ["escape"]` frees it. `click-highlight` +takes `targets: ["mark"]` so the app's selection comes from marks only. + +```json +{ + "interactions": [ + { "type": "click-highlight", "options": { "targets": ["mark"] } }, + { "type": "double-activate" }, + { "type": "navigate", "options": { "axes": "y", "reset": ["escape"] } } + ] +} +``` + +The app reads the selection from `onChange` on a `commit` whose `action` is +`click-element`, and the activation from one whose `action` is +`double-activate-element`. + +### Code: two linked charts + +Two bar charts share a `Country` field: GDP per country, and population per +country. A click on one emphasizes the same country on both. + +```ts +import { mountChart, clickHighlight, linkCharts } from 'flint-chart/interactive'; + +const mount = (el: HTMLElement, input: ChartAssemblyInput) => + ({ input, surface: mountChart(el, input, { backend: 'vegalite', interactions: [clickHighlight({ targets: ['mark'] })] }) }); +const link = linkCharts({ gdp: mount(gdpEl, gdpInput), population: mount(popEl, popInput) }, { fields: ['Country'] }); +``` + +The clicked chart drops its own emphasis once the link shows the condition, so +both charts show one selection. A `click-none`, Escape, or double-click on +either chart clears it on both; the link's own writes are host changes, so no +chart echoes them back. + +### Bespoke: a rule over the brushed box + +A line chart of `Series` by `Month`. The reader drags a box; the series whose +every point in that month range lies inside the y range stay emphasized. No +preset applies a rule over series, so the definition is the `timebox` above: +`rectangleTrigger('contain')`, a `plot` affordance with the `region` cursor, +a handler that acts on `select-region` at `commit`, and `reset: +['click-none', 'escape']` so a click on empty plot clears it. It mounts beside +`navigate({ pan: false })` when the chart also zooms, since both ask for the +plot drag otherwise. + +## Validation checklist + +1. Every trigger, cursor, and field name is one from this skill or the + installed `flint-chart/interactive` types. +2. Every definition declares `affordances` for the hits its trigger yields. +3. No two definitions, and no definition and spec entry, share a trigger or + an `id`. +4. The surface is destroyed on unmount, and every `applyUpdate` or `dispatch` + result is read. + diff --git a/packages/flint-mcp/assets/flint-board-author.SKILL.md b/packages/flint-mcp/assets/flint-board-author.SKILL.md index 0c92b01e..a3be97f6 100644 --- a/packages/flint-mcp/assets/flint-board-author.SKILL.md +++ b/packages/flint-mcp/assets/flint-board-author.SKILL.md @@ -1,24 +1,31 @@ --- name: flint-board-author -description: "Use when: several Flint charts should be read together in one view: a dashboard, KPI tiles over a trend, a side-by-side comparison, an overview with its detail; or a board on screen should change (add, retitle, resize, reconnect a chart). Produce one board spec whose headline, chart choice, layout and connected fields are decided, check and refine it with validate_board, then put it on screen once with show." +description: "Use when: several Flint charts should be read together in one view: a dashboard, KPI tiles over a trend, a side-by-side comparison, an overview with its detail; or a board on screen should change (add, retitle, resize, reconnect a chart). Produce one board spec whose headline, chart choice, layout and connected fields are decided, and put it on screen with show, which checks it and returns any fixes before drawing." --- # flint-board: several charts, one view A board holds several Flint charts under one headline. The agent writes it as -one board spec, checks it with `validate_board`, which draws nothing, and puts -it on screen with `show({ "board": … })`, which opens a new card below the -conversation's latest message. The server keeps nothing between calls: the spec -in the conversation is the board. So call `show` once a turn, after the board -is right; to change it later, change the spec and call `show` again. +one board spec and puts it on screen with `show({ "board": … })`, which opens a +new card below the conversation's latest message. `show` checks the spec +first: when something must be fixed it draws nothing and returns the fixes, so +there is no need to validate first. The server keeps nothing between calls: +the spec in the conversation is the board; to change it later, change the +spec and call `show` again. + +A board is for when the user asks for several views read together: a +dashboard, an overview, KPI tiles, linked charts, or several charts named in +one turn. An open question is not a request for a board: it gets one chart +(the `flint-chart-author` skill), and the reply offers the next views. One view split by a category +(a panel per region, same measure) is one chart with `column` or `row`, not a +board. Two charts side by side need only a title; the headline, deck, KPI +tiles and links below are for a fuller board, used as far as it helps. Each chart on a board is a full chart spec (`flint-chart-author`), plus an `id` and a `layout`. This skill covers what a board adds: the headline, which charts, where they sit, how they connect, and how they look as one piece. -Work through the steps in order. A board is ready to show when its latest -report shows no `✗` and its `Review:` section is empty or says only that a -colour field is shared. +Work through the steps in order, then call `show` once. ## Step 1 — write the headline @@ -42,6 +49,18 @@ Start from the questions the reader brings, one chart per question, and keep the board to the charts that answer them: three to five KPI tiles and up to six charts. More than that is two boards. +Each card has to answer something no other card on the board answers: + +- Two charts of the same fields (the same measure by the same category, in + another form or sort) are one chart. +- A KPI tile is for a number the reader steers by and no chart prints. A + count of the rows ("12 albums") or a number a chart already shows at a + glance is not a tile. +- Small data holds few questions. A table of a few dozen rows or less makes + one or two charts, and tiles only where the user asked for them. +- An open request ("an overview", "a dashboard on …") takes the three or four + questions the data answers best, not every one it can. + | The reader asks | Chart | |---|---| | How are we doing on the numbers we steer by? | `KPI Card` per number, with `goal` when there is a target | @@ -104,20 +123,32 @@ not KPI tiles). Charts fill rows in the order given: | Many small series | one `Sparkline` chart, `height: compact` or `standard` | On a narrow card each chart takes its own row; the layout needs no second version. +`layout` is the only size a board chart takes: leave `baseSize` and `canvasSize` +out of its `chart_spec`, which the board does not use. **`view: "table"`** on a chart opens its cell on the table of the rows the chart draws; the reader can switch it back. Use it when the numbers matter more than the shape. A `Table` is a table either way. -## Step 5 — connect them +## Step 5 — connect them, where it helps -Connect the charts by the fields they share, not chart by chart: +Link charts when a selection in one should show up in the others: the user +asks to filter or explore across them, or the board is a dashboard on shared +dimensions. Charts that only sit side by side need no `link_spec`, and no +interactions either: on a board, a chart's `interaction_spec` is what sends a +selection, so add one only to a linked chart, or where the user asked for that +behaviour on that chart. Connect by the fields they share, not chart by chart: ```json "link_spec": { "fields": ["product", "region"] } ``` +A link emphasises; it never filters. The matching marks stay at full ink and +the rest recede, while every total, axis and KPI tile stays as drawn. When the +user asks for a click to filter the other charts, link them and say in the +reply that the other charts highlight the selection rather than recompute. + The board holds one selection that every chart shares, a part per field: a click on Asia sets `region` to Asia, a brush over March to June then adds `month` from March to June, and every chart shows the marks that meet both @@ -139,14 +170,18 @@ far as it can: - **It receives a field** when its marks carry it. Marks carry the fields the chart encodes; when a chart shows the field nowhere else, encode it on - `detail` (`encodings.detail: "product"`). + `detail` (`encodings.detail: "product"`). A bar chart of another category + then splits each bar into segments of its colour, one per value, so a + selection lights up that value's share of every bar; never move the field to + `color` for this. Titles and subtitles say what a chart shows, never how it + links. - **It sends** when it also has an interaction that selects, in its `interaction_spec`; pick the one whose subject is what the reader will ask about: | Chart | Interaction | |---|---| - | Bar, Stacked Bar, Pie, Heatmap | `click-highlight` | + | Bar, Stacked Bar, Pie, Heatmap, Choropleth, Map | `click-highlight` | | Line | `click-group-focus` (a series), `brush-x` (a period), `hover-group-focus` (a series, on hover) | | Scatter Plot | `select` (drag a region) | @@ -159,10 +194,11 @@ why a field is left out. Colour does the quiet linking: charts that colour by the same field (on `color`, or `group` on a grouped bar chart) get one value order, so a value -keeps one colour across the board. Colour each chart -by the same field as the others when it shows the same categories, and give -it the same set of values, since a chart missing a value shifts the colours -after it. +keeps one colour across the board. To fix the colours themselves, set `colors` +on the board, per field: `"colors": { "Category": { "Jewelry": "#c0392b" } }`. +Every chart that colours by the field takes them, whatever theme the board or +the reader picks; values left out take the palette. Pass the same map again in +a later turn so the next card keeps them. ## Step 6 — theme the board once @@ -171,21 +207,25 @@ draws its own furniture (the Economist's red tab); the board's headline and footer take its paper, ink and fonts, with the furniture above the headline. Pick it with `list_themes` as for one chart. -## Step 7 — read the report and refine +## Step 7 — read the report -`validate_board` returns the board as the model must judge it, and `show` -returns the same report: +`show` returns the layout in one line, then at most two sections. It does not +repeat the spec. -- `Layout:` the rows as the card draws them. Check that the lead chart sits - where the headline points and no row holds an orphan. -- `## ` per chart: its encodings and each update op, `✓` or `✗`. -- `Links:` what each chart sends and receives, `✓`, or `✗` when it joins no field, with the fix. -- `Review:` what the board should still fix: a missing headline, deck or chart - title, too many tiles or charts, themes set per chart. +- **Fix before it draws.** Nothing is on screen: errors (a chart that does + not compile), rows drawn as slices (sum them first), a chart that has a + linked field in its data but does not carry it, a link field fewer than two + charts carry. Fix each in the spec and call `show` again with the whole + spec. An item you cannot fix, such as an interaction a chart cannot take, is + something to tell the user. +- **Noted.** The board is on screen and draws with these: warnings, update + ops that will not apply, what linked charts leave out, and a review (a + missing deck or chart title, more tiles or charts than a board reads well + with). Change nothing now unless the user asks; mention what matters in the + reply, and fix the rest the next time the spec changes. -Fix each `✗` and each review note in the spec, check it again if the fix was -large, then call `show` once with the same spec. A chart with errors is left -off the report's board, and `show` draws nothing until every chart is valid. +`validate_board` gives the same report without drawing, for a host with no +card UI. What the reader then does on the card reaches the model with their next message: selections and link emphasis, one section per chart. The reader's @@ -196,7 +236,7 @@ the next `show`: `theme_spec` on the board and leave it out of the charts. - **An arrangement** made with **Edit layout** (moving, swapping, resizing charts on a 12-column grid). To keep it, pass the `grid` the context gives. - `Layout:` then reads "Arranged on a 12-column grid". A chart added to the + `Layout:` then reads "the reader's grid". A chart added to the spec takes a place below the rest and a chart left out drops its place; leave `grid` out to lay the board out in rows again, only when the user asks for a new layout. @@ -206,7 +246,7 @@ them gives the reader back the agent's theme and rows. ## Worked example -The board spec, passed as it is to `validate_board`, then as `board` to `show`: +The board spec, passed as it is as `board` to `show`: ```json { @@ -248,9 +288,9 @@ on a region's line lights that region on the bars and the scatter. - [ ] `title` says the finding or the purpose; `subtitle` says data, scope, period, units; `source` is set. - [ ] Three to five KPI tiles at most, up to six charts, the lead chart first after the tiles. -- [ ] Every chart but a KPI tile has a one-line `title` and a units `subtitle`. +- [ ] On a board of three or more charts or with KPI tiles, every chart but a tile has a one-line `title` and a units `subtitle`. - [ ] `layout` set where the default is wrong: the lead chart wide, a comparison at equal spans and heights. -- [ ] `link_spec.fields` names the shared dimensions; each chart that should take part encodes them and, to send, has the interaction whose subject the reader asks about. +- [ ] If the charts are linked: `link_spec.fields` names the shared dimensions; each chart that should take part encodes them and, to send, has the interaction whose subject the reader asks about. - [ ] `theme_spec` on the board only. -- [ ] `validate_board` reports no `✗` and no review note left but the shared colour field. +- [ ] `show` drew the board; what it noted is in the reply where it matters. - [ ] In a later turn: the reader's theme and `grid` from the context are kept unless the user asked to change them. diff --git a/packages/flint-mcp/assets/flint-chart-author.SKILL.md b/packages/flint-mcp/assets/flint-chart-author.SKILL.md index 295f40c7..7400c696 100644 --- a/packages/flint-mcp/assets/flint-chart-author.SKILL.md +++ b/packages/flint-mcp/assets/flint-chart-author.SKILL.md @@ -3,7 +3,12 @@ name: flint-chart-author description: "Use when: the user asks to make or render charts with flint-chart, visualize tabular data, generate a ChartAssemblyInput, validate/render through MCP, or add Flint to a JS/TS project. Author the semantic spec, transform data before Flint when needed, install/import Flint only when executable code is needed, and reserve backend-specific style tweaks for after compiling from Flint." --- -# flint-chart: authoring and using a chart spec +# flint-chart: authoring a chart spec + +You write a `ChartAssemblyInput`: the data, the `semantic_types` of its +fields, and a `chart_spec` naming the chart type and which field goes on +which channel. Flint compiles it to Vega-Lite, ECharts, Chart.js or Plotly and +decides the rest (scales, formats, layout, colours) from the semantic types. ## What you produce (and what you do NOT) @@ -16,11 +21,8 @@ or `assembleChartjs` to get a backend spec. - **DO** emit `chart_spec` (chart type, channel→field mapping, properties) and `semantic_types` (field → semantic type). -- **DO** add `interaction_spec` when the user asks for behaviour (highlight, - legend toggle, pan and zoom, brush), asks for an interactive chart, or the - session's goal is to explore the data. List presets by name; see - "Interactions", and load the `flint-interaction-author` skill for an intent, - an interactive chart with nothing named, or a combination. +- **DO** add `interaction_spec` or `updates` only for a reason (see + "Interactions and updates"). - **Reference columns by name.** How `data` itself gets bound depends on the situation — a URL, a host-side variable, or embedded rows (see "How data gets bound"). Embedding is fine for small tables; just don't @@ -30,93 +32,62 @@ or `assembleChartjs` to get a backend spec. filtering, joins, pivots, derived columns, or long/wide reshaping beyond Flint's built-in static-series fold, use a coding, notebook, SQL, or data tool first. Then author the Flint spec against the transformed table. -- **Style after Flint, only when needed.** Author structure in Flint. For a - presentation tweak Flint does not express (a reference line, annotation, or - shaded band), use the Vega-Lite escape hatch — see "Post-Flint style - customization". Never feed edited Vega-Lite JSON back to `render_chart`. - -## When the user wants more than a spec - -First decide which workflow the user is asking for: - -- **Spec authoring only:** return a `ChartAssemblyInput` or its - `semantic_types` + `chart_spec` pieces. Do not install packages or write - renderer code unless asked. -- **MCP chart output:** if Flint MCP tools are available, **default to - `validate_chart` then `show`** whenever the user asks to see a chart. - `validate_chart` checks the spec and returns a report without drawing; fix - what it asks in the spec, then call `show({ "chart": … })` once with the - whole spec, which opens an interactive, live-rendered card with a - customization panel. The server keeps nothing between calls: the spec in - the conversation is the chart. Only fall back to `render_chart` (PNG/SVG) - when the host has no App UI support or the user explicitly wants a static - image. Use `compile_chart` when the user wants backend-native JSON, and - `list_chart_types` when you need the supported chart catalog. -- **DO** pass `updates` beside the input to `validate_chart` and `show` when the user - asks the chart to open in a state: rows to stand out, a note on a mark, a - framed range. It is a list of ChartUpdate layers, state not behaviour; the - shapes are in `flint://interaction-skill` under "Update the chart". To change a - chart in a later turn, change its spec or `updates` and call `show` again: a - new card shows it, earlier cards stay as they were. The reader's edits in the - card's panel live on that card; its context gives the `chart_spec` that keeps - them, so pass it unless the user asked for something else. -- **DO** pass `view: "table"` to `show` when the user wants to see - a chart's numbers: the card opens on the table of the rows the chart draws, - and the reader can switch to the chart. When the user wants records listed and - no chart at all, use `chartType: "Table"` instead. -- **Project integration, only when the user asks for code:** add Flint to an - app, notebook, script, or agentic product, install/import the library, and - call an assembler in code. Keep the same `ChartAssemblyInput` contract, then - let the host render the backend result. - -For MCP clients, the server can run with `npx`: - -```bash -npx -y flint-chart-mcp -``` - -For JavaScript or TypeScript projects, install Flint first and add only the -renderer peer dependencies needed by the backend you will render: - -```bash -npm install flint-chart -npm install vega vega-lite vega-embed # browser Vega-Lite rendering -npm install echarts # ECharts rendering -npm install chart.js # Chart.js rendering -``` - -Then compile with the requested backend: +- **Style after Flint, only when needed** (see "Post-Flint style + customization"). Notes, shaded regions, emphasis and reference lines are + Flint `updates`, not style edits. + +## On the Flint MCP server + +- **Show it.** When the user asks to see a chart, pass the whole spec to + `show({ "chart": … })`: a live card with an editing panel. There is no + need to validate first: `show` checks the spec, and one with errors draws + nothing and returns them, so fix and call `show` again. What it notes + (warnings, update ops that will not apply) is drawn with; change nothing + now unless the user asks, and fix it the next time the spec changes. + `validate_chart` gives the same report without a card, for a host with no + card UI. +- **The lightest view that answers.** One question is one chart. An open + question ("how did X do", "what does this data say", "tell me something + interesting") gets the one chart that answers it best, or two side by side + only when it has two halves; name in your reply what else you could show, + and draw it when the user asks. One view split by a category (a panel per + region, same measure) is still one chart: put the category on `column` or + `row`. A board is for when the user asks for one (a dashboard, an overview, + KPI tiles, linked views, or several charts named in one turn): load the + `flint-board-author` skill (`get_flint_skill` with `board`). +- **Nothing is kept.** The spec in the conversation is the chart. To change + it, change the spec and call `show` again: a new card opens and earlier ones + stay. A card's context gives the `chart_spec` with the reader's panel edits; + pass it on unless the user asked for something else. +- **Numbers.** `view: "table"` on `show` opens the card on the rows the chart + draws. Records with no chart are `chartType: "Table"`. +- **Other tools.** `render_chart` (PNG/SVG) only when the host has no app UI or + the user wants a static image; `compile_chart` for backend JSON. +- **Code.** Adding Flint to an app, a notebook or a script is the + `flint-app-author` skill. -```ts -import { assembleChartjs, assembleECharts, assembleVegaLite } from 'flint-chart'; +## Data transformation before charting -const vegaLiteSpec = assembleVegaLite(input); -const echartsOption = assembleECharts(input); -const chartjsConfig = assembleChartjs(input); -``` +Flint is a chart compiler, not a data-wrangling layer. If the chart needs grouped +totals, time buckets, filters, joins, pivots, derived ratios, or a long-form +table, transform the data first with a host tool, then bind the prepared table +(see "How data gets bound"). Pick semantic types and channels for the transformed +columns, not for columns that no longer exist. -Python support is planned for a later release. Until the PyPI package is -published, use the npm package or MCP server for released workflows. +**Sanity-read the values first — don't chart blind.** Inspect the actual data +with your data tool (distinct values per category column, min/max per measure), +not just the column names, and watch for: -```ts -interface ChartAssemblyInput { - // Bound by the HOST or by you, depending on the situation (see below). - data: { values: any[] } | { url: string }; - semantic_types?: Record; // field → type ( ← you write this) - chart_spec: { // ← you write this - chartType: string; // e.g. "Scatter Plot" - title?: string; // the headline — write one - subtitle?: string; // what is measured, of whom, when, in what units - encodings: Record; // channel → { field, ... } (or array) - baseSize?: { width: number; height: number }; // target layout size, default 400×320 - canvasSize?: { width: number; height: number }; // optional hard ceiling on stretch - chartProperties?: Record; // per-chart tuning (optional) - }; - options?: Record; // global layout options (rarely needed) - field_display_names?: Record; // field → readable axis/legend title - theme_spec?: string | { extends: string; [key: string]: any }; // preset or preset override (Vega-Lite only) -} -``` +- **Embedded totals.** A category column may mix an aggregate level with its + parts (e.g. `all` alongside `cage-free`/`caged`, or a `Total` region). Charting + the total with its parts double-counts and flattens the parts — keep one or the + other on a stacked/grouped/colored channel, not both. +- **Units.** `Percentage` accepts either a fraction (0–1) or a percent (0–100): + Flint reads which from the values and formats both as `%`. Don't rescale a + column for Flint, and don't scale it twice. +- **One real entity.** If your breakdown column has a single distinct value, the + per-group chart collapses to one mark — the intended breakdown is likely a + different column. ## How data gets bound @@ -155,276 +126,64 @@ state how the host should bind data. In the worked examples below, `data` is shown as `{ values: [] }` to signal "host binds this" — focus on `chart_spec` and `semantic_types`. -## Data transformation before charting - -Flint is a chart compiler, not a data-wrangling layer. If the chart needs grouped -totals, time buckets, filters, joins, pivots, derived ratios, or a long-form -table, transform the data first with a host tool, then bind the prepared table -(see "How data gets bound"). Pick semantic types and channels for the transformed -columns, not for columns that no longer exist. - -**Sanity-read the values first — don't chart blind.** Inspect the actual data -with your data tool (distinct values per category column, min/max per measure), -not just the column names, and watch for: - -- **Embedded totals.** A category column may mix an aggregate level with its - parts (e.g. `all` alongside `cage-free`/`caged`, or a `Total` region). Charting - the total with its parts double-counts and flattens the parts — keep one or the - other on a stacked/grouped/colored channel, not both. -- **Units.** `Percentage` accepts either a fraction (0–1) or a percent (0–100): - Flint reads which from the values and formats both as `%`. Don't rescale a - column for Flint, and don't scale it twice. -- **One real entity.** If your breakdown column has a single distinct value, the - per-group chart collapses to one mark — the intended breakdown is likely a - different column. - -## Post-Flint style customization +## Choose the chart type -Stay at the Flint level for structure (data, chart type, channels, transforms, -sizing, properties) — Flint specs stay portable and regenerate safely. Drop to -backend JSON only after a valid Flint chart exists, and only for a narrow -presentation change Flint does not expose (exact axis/legend/mark styling, -titles, annotations, reference lines, layout polish). Never use it to change the -data, chart type, field mappings, or transforms — fix those upstream. - -For a Vega-Lite-specific style tweak: - -1. Author and validate the Flint `ChartAssemblyInput`. -2. Render or inspect the Flint chart first, when possible. -3. Call `compile_chart` with `backend: "vegalite"`. -4. Make the smallest necessary style/presentation edit to the returned - Vega-Lite spec. -5. Render the edited spec in the host environment with a Vega-Lite renderer. +`list_chart_types` lists every chart type with its channels and a one-line +note on what it is for. Pick the type that answers the question, then call +`list_chart_types` with that `chartType` before writing its encodings: it +returns the type's guidance (what a map's `id` accepts, which bar chart takes +a second category, a waterfall's Type column), its `chartProperties` with +values and defaults, and the interaction presets it supports. Use names +exactly as listed. Vega-Lite draws every type; the other backends draw a +subset. -This edited Vega-Lite spec is no longer a portable Flint spec. Do not send it to -`render_chart`; use `render_chart` only for Flint `ChartAssemblyInput`. - -## Write a headline - -Set `chart_spec.title` to the finding, in a sentence, and `chart_spec.subtitle` -to the reading of it — what is measured, of whom, when, in what units: +Without the tool, these are the Vega-Lite types and their channels; each +type's properties and guidance are in the chart reference, +https://microsoft.github.io/flint-chart/#/documentation/reference-vegalite: ``` -title: "A pyramid that is no longer a pyramid" -subtitle: "United States population by age and sex, 2020, millions" +"Area Chart": x, y, color, opacity, column, row +"Bar Chart": x, y, color, detail, opacity, column, row +"Bar Table": y, x, color, column, row +"Boxplot": x, y, color, opacity, column, row +"Bullet Chart": y, x, goal, color, column, row +"Bump Chart": x, y, color, detail, column, row +"Calendar Heatmap": x, color +"Candlestick Chart": x, open, high, low, close, column, row +"Choropleth": id, color, detail, text +"Connected Scatter Plot": x, y, order, color, detail, column, row +"Density Plot": x, color, column, row +"Donut Chart": size, color, column, row +"ECDF Plot": x, color, detail, column, row +"Gantt Chart": y, x, x2, color, detail, column, row +"Grouped Bar Chart": x, y, group, color, detail, column, row +"Heatmap": x, y, color, column, row +"Histogram": x, color, column, row +"KPI Card": metric, value, goal +"Line Chart": x, y, color, strokeDash, detail, opacity, column, row +"Lollipop Chart": x, y, color, column, row +"Map": longitude, latitude, color, size, shape, opacity, order, detail, strokeWidth, text +"Marginal Plot": x, y, color, size, shape, opacity +"Pie Chart": size, color, column, row +"Pyramid Chart": x, y, color +"Radar Chart": x, y, color, column, row +"Range Area Chart": x, y, y2, color, column, row +"Ranged Dot Plot": x, y, color +"Regression": x, y, size, color, column, row +"Ridgeline Plot": x, y, color +"Rose Chart": x, y, color, column, row +"Scatter Plot": x, y, color, size, shape, detail, opacity, column, row +"Slope Chart": x, y, color, detail, column, row +"Sparkline": x, y, color, detail, row, column +"Stacked Bar Chart": x, y, color, detail, column, row +"Streamgraph": x, y, color, column, row +"Strip Plot": x, y, color, size, column, row +"Table": none (`encodings: {}`) +"Violin Plot": x, y, color, row +"Waterfall Chart": x, y, color, column, row ``` -Add `chart_spec.label` only when the chart sits in a numbered sequence or -under a section name: `label: "Figure 2"`. It is drawn above the headline in -the theme's kicker style. - -`chart_spec.source` is optional. Add it only when the user names the source or -asks for a source line, or the data itself states where it comes from: -`source: "UN World Population Prospects 2024"` (or `{ text, href }` to link -it). Never invent or guess one. The theme decides how it reads ("Source:", -side, rule, credit); a chart without one draws no footer. - -`chart_spec.chrome` is the house decoration the theme draws around the chart: -header rules, tabs, wordmarks, logos, the footer rule and the house credit. It is -not the chart's own title, label or source. The theme draws it by default; leave -`chrome` out unless the user asks to drop it: `chrome: false` -drops all of it; `chrome: { logos: false }` (or `header`, `footer: false`) drops -one part. Without logos a credit keeps its words. - -`Jan`, `Cairo`, `Chrome` name their own kind; `26`, `5,300`, `0.42` do not, and -the headline is where they get named. Leave it out only where the chart is not -read on its own — a sparkline in a cell, a tile under its own caption. Nothing -breaks: with no headline to lean on, the compiler keeps the axis titles instead. - -## Visual themes (`theme_spec`) - -Use one of two forms. Prefer a preset unless the user asks for a specific -brand adjustment. - -### 1. Use a preset - -Call `list_themes` to choose an id, then place it beside `chart_spec`: - -```json -{ "chart_spec": { ... }, "theme_spec": "economist" } -``` - -| id | what it is for | -| --- | --- | -| `nyt` | Newsroom graphics: headline states the finding, values on the marks, series named at their ends. | -| `economist` | Print weekly: compact, flat headline over a deck, units repeated down the ruler. | -| `swiss` | International Typographic Style: strong grid structure, black typography, and a focused red accent. | -| `nature` | Journal figure: small panel, axis titles with units, statistics beside the fit. | -| `mckinsey` | Consulting deck: wide bands, every value printed, headline states the takeaway. | -| `datawrapper` | Embedded web chart: narrow column, plain headline and deck, rule under the footer. | -| `powerbi` | Dashboard tile: compact, legend to the right, latest point emphasised. | -| `powerbi-light` | Light dashboard tile: white canvas, fine gridlines, and bright categorical color. | -| `cartoon` | Playful illustration: warm paper, rounded type, bold outlines, and bright color. | -| `apple` | App-interface chart: light labels, trailing value axis, symbols beside color. | -| `de-stijl` | De Stijl composition: primary planes in heavy black lines, steps not slopes, title under the picture. | -| `bbc` | BBC News graphic: big bold headline, gridlines only, heavy zero rule, footer rule with the source. | -| `material` | Material Design 3 product chart: purple-led tonal palette, Roboto type, light gridlines, rounded bars. | - -### 2. Override a preset - -Keep overrides narrow and state only what the user wants to change: - -```json -{ - "theme_spec": { - "extends": "economist", - "id": "our-brand", - "ink": { - "series": { - "single": "#6b3fa0" - } - } - } -} -``` - -Common simple overrides are `ink.surface.canvas`, `ink.series.single`, -`ink.series.categorical`, `type.headline.family`, and `layout.density` -(`"compact"`, `"normal"`, or `"airy"`). If replacing -`ink.series.categorical`, also replace `categoricalExtended` so charts with -many series keep the requested brand palette. - -Do not copy an entire preset or invent theme keys. A theme controls -presentation; fields, aggregation, filtering, and sorting still belong in the -chart input. ThemeSpec applies to Vega-Lite and Plotly; ECharts, Chart.js, and Excel ignore it. - -Full reference: -https://microsoft.github.io/flint-chart/#/documentation/theme-spec - -## Interactions (`interaction_spec`) - -Add `interaction_spec` beside `chart_spec` when the user asks for behaviour, -or when the goal of the session is to explore or analyse the data. A static -image never needs it. - -```json -{ - "chart_spec": { "chartType": "Line Chart", "encodings": { "x": "date", "y": "value", "color": "series" } }, - "interaction_spec": { "interactions": [ { "type": "brush-x" } ] } -} -``` - -Every entry is `{ "type": , "options": { ... } }`, one per behaviour. -Take the presets and their options for the chart type from -`list_interaction_presets` with `chartType`; never invent one. Options nest under -`options`; `id` sits on the entry. - -Which presets answer a request, how they combine, and what the warnings mean -is the `flint-interaction-author` skill (`flint://interaction-skill` on the -MCP server). Load it for anything beyond a single named gesture: an intent -(explore, compare, analyse, find outliers), "make it interactive" with -nothing named, several presets together, behaviour on a chart that already -exists, or an update to a chart on screen. - -Full reference: -https://microsoft.github.io/flint-chart/#/documentation/interaction-spec - -## Step 1 — pick `chartType` - -Use one of the registered names **exactly**. Vega-Lite is the default and -broadest backend; the table below lists each Vega-Lite chart type, the -channels it accepts, and its tuning properties (see "Chart-level -properties"). Required channels are noted. - -| chartType | Channels | Notes / required | -|---|---|---| -| `"Scatter Plot"` | x, y, color, size, shape, detail, opacity, column, row | x + y required; `detail` carries a field (e.g. `country`) on each point without a visual channel, for tooltips and linking | -| `"Regression"` | x, y, size, color, column, row | scatter + fit line; props `regressionMethod`, `polyOrder` | -| `"Connected Scatter Plot"` | x, y, order, color, detail, column, row | x + y required; `order` = connection sequence (time/index), so the line traces a trajectory and may self-cross | -| `"Ranged Dot Plot"` | x, y, color | dumbbell of two x per category | -| `"Strip Plot"` | x, y, color, size, column, row | jittered points; props `stepWidth`, `pointSize`, `opacity` | -| `"Bar Chart"` | x, y, color, opacity, column, row | one discrete + one measure; prop `cornerRadius` | -| `"Grouped Bar Chart"` | x, y, group, column, row | `group` = the clustering category; prop `dodge` | -| `"Stacked Bar Chart"` | x, y, color, column, row | prop `stackMode` | -| `"Pyramid Chart"` | x, y, color | diverging horizontal bars | -| `"Lollipop Chart"` | x, y, color, column, row | prop `dotSize` | -| `"Waterfall Chart"` | x, y, color, column, row | `color` = Type column, values `start`/`delta`/`end` only; omit it for auto sign coloring; props `cornerRadius`, `totals` | -| `"Gantt Chart"` | y, x, x2, color, detail, column, row | x = start, x2 = end | -| `"Bullet Chart"` | y, x, goal, color, column, row | `goal` required (target) | -| `"Histogram"` | x, color, column, row | x = measure to bin; prop `binCount` | -| `"Boxplot"` | x, y, color, opacity, column, row | category + measure; props `whiskerMethod`, `showOutliers`, `dodge` | -| `"ECDF Plot"` | x, color, detail, column, row | x = measure; cumulative distribution (step line); prop `showPoints` | -| `"Heatmap"` | x, y, color, column, row | color = the measure | -| `"Calendar Heatmap"` | x, color | x = date; color = daily value (summed per day); GitHub-style week × weekday grid | -| `"Line Chart"` | x, y, color, strokeDash, detail, opacity, column, row | props `interpolate`, `showPoints` | -| `"Sparkline"` | x, y, color, detail, row, column | x + y required; small-multiple mini trend lines, one per series (series from `color` or `detail`); props `interpolate`, `baseline`, `trendWidth` | -| `"Bump Chart"` | x, y, color, detail, column, row | rank-over-time lines | -| `"Slope Chart"` | x, y, color, detail, column, row | two-period value change; straight segments + end points, one line per category | -| `"Area Chart"` | x, y, color, opacity, column, row | props `interpolate`, `opacity`, `stackMode` | -| `"Range Area Chart"` | x, y, y2, color, column, row | x + y + y2 required; translucent band from `y` (low) to `y2` (high), value axis fits the band (not zero) | -| `"Violin Plot"` | x, y, color, row | x (category) + y (measure) required; mirrored KDE density per category, prop `bandwidth`; **Vega-Lite only**; a genuine `color` subgroup splits two groups or grids 3+ groups | -| `"Streamgraph"` | x, y, color, column, row | centre-stacked areas | -| `"Density Plot"` | x, color, column, row | props `bandwidth`, `stackMode` (series stack; `layered` overlaps them), `opacity` | -| `"Ridgeline Plot"` | x, y, color | x = measure; `color` (or a discrete `y`) names the ridges, each the KDE of x on its own baseline; a measure `y` draws each series' curve instead; props `overlap`, `order`, `tailCut`, `colorBy`, `perspective` (plans unset `skew`, `tilt`, `overlap` from the ridge count so the depth takes about 40% of the plot), `skew`, `tilt`, `valueMax`, `markAt` (`true` marks the x ticks, or a list of x values; each ridge's value is dotted and labelled, joined across ridges), `opacity`, `interpolate`, `bandwidth`; named ridges share one ink unless `colorBy` asks otherwise; a numeric `color` keeps a gradient key; **Vega-Lite only** | -| `"Marginal Plot"` | x, y, color, size, shape, opacity | the plot follows the axis types (measure × measure = scatter, category × measure = strip, category × category = heatmap of counts) with each axis's distribution along it (density, histogram or boxplot on a measure axis, a bar of counts on a category axis, split by `color`; density margins layer by default); props `marginal`, `stackMode`, `bandwidth`, `binCount`, `whiskerMethod`, `showOutliers`; **Vega-Lite only** | -| `"Pie Chart"` | size, color, column, row | `size` = slice value (→ angle), `color` = category; props `innerRadius`, `sortSlices` | -| `"Rose Chart"` | x, y, color, column, row | polar bars; props `alignment`, `padAngle`, `sortSlices` | -| `"Radar Chart"` | x, y, color, column, row | props `filled`, `fillOpacity`, `strokeWidth` | -| `"Candlestick Chart"` | x, open, high, low, close, column, row | OHLC all required | -| `"Bar Table"` | y, x, color, column, row | compact bars + value labels | -| `"KPI Card"` | metric, value, goal | big-number tile; prop `behindThreshold` | -| `"Table"` | none (`encodings: {}`) | the rows as given, one column per field in row order; shape `data.values` to the rows and fields to list, name columns with `field_display_names`; numbers and dates print by `semantic_types`; receives links and `updates`, sends no selection | -| `"Map"` | longitude, latitude, color, size, opacity | bubble map; props `region`, `projection` | -| `"Choropleth"` | id, color, detail | `id` = region key (see **Maps** below); props `region` (`"world"`/`"us"`), `level` (US: `"state"`/`"county"`/`"auto"`), `projection` (world) | - -**Maps: what `id` accepts.** Flint joins the key to its own base map; you never -supply geometry or a lookup. A **world** map takes country names ("India", -"DR Congo", "United Kingdom"), ISO 3166 alpha-2 / alpha-3 codes ("IN", "IND"), -or ISO numeric codes (356), all in one column. A **US** map takes state names, -USPS codes ("CA") or FIPS codes (6), and county FIPS (6037) with -`level: "county"`. Declare the key `Country` or `State` in `semantic_types` -(or set `chartProperties.region`) whenever codes could collide: "CA", "IN", -"Georgia", or small numbers. A key that matches no region is not drawn. Map -marks carry only `id`, `color` and `detail`: to link a map with charts keyed by -a name column, encode that column as `id` (names resolve too) or put it on -`detail` (e.g. `id: "map_id", detail: "country"`), which also labels the tooltip. - -**Donut chart:** use `"Pie Chart"` with `chartProperties.innerRadius > 0`. - -**Choosing a bar chart (most common mix-up).** All three take one discrete -category on `x` (or `y`) plus one measure. They differ in how a **second** -category is shown — and each reads that second category from a **different -channel**: - -- `"Bar Chart"` — use for a single series. When multiple rows share an `x`, a - second category on `color` produces stacked segments. For side-by-side bars, - use `"Grouped Bar Chart"` with the second category on `group`. -- `"Stacked Bar Chart"` — second category on `color`, drawn as **stacked** - segments within each bar (totals matter). Tune with `stackMode` - (`stacked` / `normalize` / `layered`). -- `"Grouped Bar Chart"` — second category on the **`group`** channel, drawn as - **side-by-side (dodged)** bars within each `x` cluster (compare values - directly). Put the clustering category on `group`, *not* `color`. - -Rule of thumb: comparing parts-to-whole → Stacked; comparing values -side-by-side → Grouped (use `group`); single series → Bar. - -**Waterfall color is a special "Type" column, not a free category.** On a -`"Waterfall Chart"` the `color` channel is reserved for a *type* field whose -values are literally `start`, `delta`, and `end` — it drives which bars anchor -to zero, not an arbitrary grouping. Do **not** bind `color` to an -`Increase`/`Decrease` (or up/down, gain/loss) category: the up/down direction is -already derived from the **sign** of the `y` value and colored automatically -(green up / red down). For the common case, **omit `color` entirely** and let -Flint infer the start/delta/end and per-bar sign coloring. To force which bars -are anchored totals, use the `totals` property (`first`/`last`/`both`), not a -color field. Only bind `color` when you genuinely have a `start`/`delta`/`end` -type column. - -**Backend coverage.** Vega-Lite supports all of the above. Other backends -support a subset (verify if targeting a non-VL backend): - -- **ECharts** adds: `"Gauge"`, - `"Funnel"`, `"Treemap"`, `"Sunburst"`, `"Sankey"`, - `"Parallel Coordinates"`, `"Graph"`, `"Tree"`. -- **Chart.js** supports: Scatter, Bubble, Bar, Grouped Bar, Stacked Bar, - Lollipop, Bump, Combo, Line, Area, Range Area, Pie, Doughnut, Histogram, - Radar, Rose, Slope, Connected Scatter. - -You do not need to call the library or inspect its source to author the -input — pick from this table. - -## Step 2 — map fields to channels +## Map fields to channels Each channel maps to an **encoding object** `{ field, ... }` (or a bare string shorthand, expanded to `{ field: "" }`): @@ -495,9 +254,9 @@ Arquero/`Array.map`/SQL, or a data/MCP tool — and pass the result as `data.values`. If you have no way to transform, surface the gap to the developer rather than inventing a transform property that does not exist. -## Step 3 — annotate with semantic types +## Semantic types -**This is the most important step.** Semantic types drive all downstream +**This matters most.** Semantic types drive all downstream decisions — formatting, zero baseline, color scheme, scale direction, and more. Pick the most specific type for each field. Full registered set: @@ -506,7 +265,8 @@ more. Pick the most specific type for each field. Full registered set: | Temporal (point) | `DateTime`, `Date`, `Time`, `Timestamp` | | Temporal (granule) | `Year`, `Quarter`, `Month`, `Week`, `Day`, `Hour`, `YearMonth`, `YearQuarter`, `YearWeek`, `Decade` | | Temporal (span) | `Duration` | -| Measure (amount) | `Amount`, `Price`, `Quantity`, `Count`, `Number` | +| Measure (amount) | `Amount`, `Price`, `Quantity`, `Count` | +| Measure (generic) | `Number` — a measure whose values should not be added up (or whose additivity is unknown); use `Count`, `Amount`, `Quantity` or `Profit` for totals | | Measure (proportion) | `Percentage` | | Measure (signed/diverging) | `Profit`, `PercentageChange`, `Sentiment`, `Correlation` | | Measure (physical) | `Temperature` | @@ -527,7 +287,8 @@ What choosing well gets you (automatically): - `Date` / `DateTime` → temporal axis with auto-granularity formatting - `Percentage` → percent formatting, 0–100 domain awareness -If you don't know, use `Quantity` for numbers, `Category` for strings, +If you don't know, use `Quantity` for numbers that add up to a total and +`Number` for ones that don't, `Category` for strings, `Date`/`DateTime` for date-shaped values. Do **not** invent type names. ### Saying more than the type name @@ -559,9 +320,19 @@ understates what you know: - `intrinsicDomain` — the field's own bounds, for bounded scales only: `[1, 5]` for a five-star rating, `[0, 100]` for a percentage score. Not for open-ended measures. +- `percentScale` — `"fraction"` or `"percent"`: how a `Percentage` or + `PercentageChange` field is stored (0.45 or 45 for 45%). Set it when you know; + otherwise Flint guesses from the values, which misreads fractions mostly past + 1 (growth of 2.4 meaning 240%). - `divergingMidpoint` — where the middle colour of a diverging scale sits. Set it if you can tell what the reader is comparing against; leave it out if you can't. +- `divergingNeutral` — for a colour stepped into classes, how far either side + of the midpoint still reads as neither side: `0.1` makes correlations within + ±0.1 one neutral class; `false` makes the midpoint a break, so a small gain + never looks like a small loss. Leave it out and the type decides + (`Correlation`, `Sentiment`: a neutral class; `Profit`, `PercentageChange`: + a break). - `sortOrder` — the order the categories should appear in, when the order in the data is not the one you want and it isn't alphabetical either: `["Low", "Medium", "High"]`. For a handful of categories, not a long list. @@ -576,10 +347,42 @@ understates what you know: `"lower-is-better"` for costs, errors, churn or delays, so their highs, not their lows, take the warm end, under any theme. -## Step 4 — write the spec +## Write a headline + +Set `chart_spec.title` to the finding, in a sentence, and `chart_spec.subtitle` +to the reading of it — what is measured, of whom, when, in what units: + +``` +title: "A pyramid that is no longer a pyramid" +subtitle: "United States population by age and sex, 2020, millions" +``` + +Add `chart_spec.label` only when the chart sits in a numbered sequence or +under a section name: `label: "Figure 2"`. It is drawn above the headline in +the theme's kicker style. + +`chart_spec.source` is optional. Add it only when the user names the source or +asks for a source line, or the data itself states where it comes from: +`source: "UN World Population Prospects 2024"` (or `{ text, href }` to link +it). Never invent or guess one. The theme decides how it reads ("Source:", +side, rule, credit); a chart without one draws no footer. -Put the three steps into one `ChartAssemblyInput`, with the data bound as in -"How data gets bound" and a headline as in "Write a headline": +`chart_spec.chrome` is the house decoration the theme draws around the chart: +header rules, tabs, wordmarks, logos, the footer rule and the house credit. It is +not the chart's own title, label or source. The theme draws it by default; leave +`chrome` out unless the user asks to drop it: `chrome: false` +drops all of it; `chrome: { logos: false }` (or `header`, `footer: false`) drops +one part. Without logos a credit keeps its words. + +`Jan`, `Cairo`, `Chrome` name their own kind; `26`, `5,300`, `0.42` do not, and +the headline is where they get named. Leave it out only where the chart is not +read on its own — a sparkline in a cell, a tile under its own caption. Nothing +breaks: with no headline to lean on, the compiler keeps the axis titles instead. + +## Write the spec + +One `ChartAssemblyInput`, with the data bound as in "How data gets bound" and +a headline as in "Write a headline": ```json { @@ -590,89 +393,66 @@ Put the three steps into one `ChartAssemblyInput`, with the data bound as in "title": "Europe climbed every month after the April dip", "subtitle": "Revenue by region, $m", "encodings": { "x": { "field": "month" }, "y": { "field": "revenue" }, "color": { "field": "region" } } - }, - "theme_spec": "economist" + } +} +``` + +The full shape: + +```ts +interface ChartAssemblyInput { + // Bound by the HOST or by you, as in "How data gets bound". + data: { values: any[] } | { url: string }; + semantic_types?: Record; // field → type ( ← you write this) + chart_spec: { // ← you write this + chartType: string; // e.g. "Scatter Plot" + title?: string; // the headline — write one + subtitle?: string; // what is measured, of whom, when, in what units + label?: string; // a figure number or kicker, above the headline + source?: string | { text: string; href?: string }; // only when known; never invented + chrome?: false | { header?: false; footer?: false; logos?: false }; // drop the house's decoration + encodings: Record; // channel → { field, ... } (or array) + baseSize?: { width: number; height: number }; // target layout size, default 400×320 + canvasSize?: { width: number; height: number }; // optional hard ceiling on stretch + chartProperties?: Record; // per-chart tuning (optional) + }; + options?: Record; // global layout options (rarely needed) + field_display_names?: Record; // field → readable axis/legend title + theme_spec?: string | { extends: string; [key: string]: any }; // preset or preset override (Vega-Lite, Plotly) + interaction_spec?: { interactions: { type: string; id?: string; options?: Record }[] }; // behaviour (interaction skill) + updates?: { id: string; ops: any[] }[]; // the agent's marks on the chart (interaction skill) } ``` -Add `theme_spec`, `chartProperties`, `interaction_spec` or `updates` only when -the request asks for them. With the MCP tools, check it with `validate_chart`, -fix what the report asks in the spec, then pass the whole spec to `show` as -`chart`. Without them, run the "Validation checklist". - -## Chart-level properties (`chartProperties`) - -`chartProperties` is an optional per-chart tuning map. Set a property only -when the user asks for that behavior — defaults are sensible. These are -**design choices**, not styling overrides (colors/fonts/ticks are still -derived). Values are clamped to the ranges shown. - -| Chart type | Property | Type / range (default) | Effect | -|---|---|---|---| -| Bar Chart | `cornerRadius` | 0–15 (0) | Round bar corners (px) | -| Area / Stacked Bar | `stackMode` | `stacked` \| `normalize` \| `center` \| `layered` (unset) | Stacking behavior; `normalize` = 100%, `center` = streamgraph | -| Density Plot | `stackMode` | `normalize` \| `layered` (unset = stacked) | `layered` overlaps the series, translucent | -| Density Plot | `opacity` | 0.1–1 (0.7) | Layered series opacity | -| Marginal Plot | `stackMode` | `stacked` (unset = layered) | Stack the density margins instead of layering them | -| Grouped Bar / Boxplot | `dodge` | `auto` \| `local` \| `global` (`auto`) | `local` compacts sparse groups per category; `global` preserves aligned group lanes; leave `auto` unless the user requests one | -| Line / Area / Sparkline | `interpolate` | `linear` \| `monotone` \| `step` \| `step-before` \| `step-after` \| `basis` \| `cardinal` \| `catmull-rom` (`linear`) | Curve shape | -| Line / ECDF Plot | `showPoints` | boolean (false) | Draw point markers on the line | -| Sparkline | `baseline` | `mean` \| `zero` \| `median` \| `none` (`mean`) | Reference line per spark row | -| Sparkline | `trendWidth` | 80–600 (240) | Mini line-plot width (px) | -| Boxplot | `whiskerMethod` | `iqr` \| `minmax` (`iqr`) | Whisker rule (Tukey 1.5×IQR vs min–max) | -| Boxplot | `showOutliers` | boolean (true) | Show outlier points (Tukey only) | -| Area | `opacity` | 0.1–1 (0.7) | Fill opacity | -| Scatter | `opacity` | 0.1–1 (1) | Point opacity | -| Strip Plot | `stepWidth` | 10–100 (20) | Jitter spread | -| Strip Plot | `pointSize` | 0–150 (0=auto) | Point size | -| Strip Plot | `opacity` | 0–1 (0=auto) | Point opacity | -| Histogram | `binCount` | 5–50 (10) | Number of bins | -| Density Plot / Ridgeline / Marginal Plot | `bandwidth` | 0.05–2 (0=auto) | Kernel bandwidth | -| Ridgeline | `overlap` | 0.5–4 (1.8) | How many baselines up the tallest ridge reaches | -| Ridgeline | `order` | `mean`, `reverse` (unset = as given; a quantitative series lowest at the front) | Highest mean on top, or reversed | -| Ridgeline | `tailCut` | 0–0.2 (0) | Trim each ridge to where its density is at least this share of its peak | -| Ridgeline | `colorBy` | `series`, `x` (unset = one colour) | Named ridges share one ink by default; `series` colours each ridge, `x` fills each with a ramp along x | -| Ridgeline | `perspective` | boolean (false) | Stand the ridges on a floor seen in perspective: `skew`, `tilt`, `overlap` left unset are planned so the depth takes about 40% of the plot's width and more of its height as ridges are added; the depth names, edge and value ticks give way (along the axis, then level, then every n-th) before they touch | -| Ridgeline | `skew` | 0–0.4 (0) | Perspective: shift the back ridges left by this share of the x range | -| Ridgeline | `tilt` | 0–6 (0) | Perspective: the x axis rises this many baselines across its range, labels following its edge | -| Ridgeline | `opacity` | 0.1–1 (0.5) | Ridge opacity, as the Range Area Chart; solid in perspective unless set | -| Ridgeline | `valueMax` | number (0 = tallest peak) | Perspective: the value the full ridge height stands for, read on the back-left value axis | -| Ridgeline | `markAt` | boolean \| number[] | Mark and label every ridge's value at the x ticks inside the range (`true`) or at these x; a dashed line joins the marks at one x across the ridges | -| Marginal Plot | `marginal` | `density` \| `histogram` \| `boxplot` (`density`) | What each margin draws along a measure axis; a category axis gets a bar of counts | -| Pie Chart | `innerRadius` | 0–100 (0) | Donut hole size (>0 → donut) | -| Pie / Rose | `sortSlices` | `none` \| `descending` \| `ascending` (`none`) | Order wedges and their legend by slice value | -| Rose Chart | `alignment` | `left` \| `center` (`left`) | Wedge alignment | -| Rose Chart | `padAngle` | 0–0.1 (0) | Gap between slices | -| Lollipop | `dotSize` | 20–300 (80) | Circle size (px) | -| Waterfall | `cornerRadius` | 0–8 (0) | Round bar corners | -| Waterfall | `totals` | `auto` \| `none` \| `first` \| `last` \| `both` (`auto`) | Which bars anchor to zero as totals (only when no Type column) | -| Waterfall | `showTextLabels` | boolean (false) | Legacy spelling of `showValueLabels`; still accepted | -| Bar / Grouped Bar / Stacked Bar / Lollipop / Pyramid / Pie / Donut / Heatmap / Waterfall | `showValueLabels` | boolean | Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks. | -| Regression | `regressionMethod` | `linear` \| `log` \| `exp` \| `pow` \| `quad` \| `poly` (`linear`) | Fit method | -| Regression | `polyOrder` | 1–5 (3) | Polynomial order (when `poly`) | -| Radar | `filled` | boolean (true) | Fill the polygon | -| Radar | `fillOpacity` | 0–0.5 (0.15) | Polygon fill opacity | -| Radar | `strokeWidth` | 0.5–4 (1.5) | Line width | -| KPI Card | `behindThreshold` | 0–1 (0.5) | Value/goal ratio cutoff for color | -| Map | `region` | `us` \| `world` \| `auto` (`auto`) | Geographic scope | -| Map | `projection` | `mercator` \| `equalEarth` \| `orthographic` \| `stereographic` \| `conic` \| `mollweide` | Map projection | - -**Cross-cutting properties** (apply to position/faceted charts when -relevant; set only to force non-default behavior): - -- `independentYAxis` (boolean) — faceted charts: give each panel its own - y-scale. -- `logScale_x` / `logScale_y` (boolean) — force a logarithmic axis. -- `includeZero_x` / `includeZero_y` (boolean) — force the axis to include 0. -- `xAxisType` / `yAxisType` (`temporal` | `nominal`) — force a temporal - field to render as discrete bands (or vice-versa). -- `labelOverflow` (list of steps) — the path x category names that do not - fit their band take. Leave it out: names wrap, then stand upright (trimmed - if need be), every name printed; a run of times, dates, years or ranks - wraps, then prints only round values (16:45, 17:00) flat. Set it only when - the user asks, e.g. `["wrap", "rotate90"]` to label every year, or - `["wrap", "rotate45", "rotate90"]` for 45° labels. Steps: `wrap`, `skip` - (sequences only), `rotate45`, `rotate90`. +Set `chartProperties` only when the user asks for that behaviour; defaults +are sensible. Global layout `options` are rarely needed. + +## Interactions and updates + +A mounted chart already shows a tooltip and lets a legend click dim a group. +Add more only for a reason: + +- `interaction_spec` (behaviour): the user asks for a gesture or describes + what the chart should do, the chart is linked to others on a board, or the + data has more detail than the chart can show at its size. +- `updates` (marks the agent leaves: a note, emphasis, a shaded range, a + reference line): the user asks for marks on the chart, asks about a chart + on screen, or asks a concrete question the chart can point at lightly. + +Otherwise the chart stays clean and your reply carries the answer. Both are +the `flint-interaction-author` skill (`get_flint_skill` with `interaction`). + +## Visual themes (`theme_spec`) + +Add `theme_spec` only when the user names a look, a house or a brand; without +one the chart draws in the host's style. Pick a preset id from `list_themes` +(`list_themes` with an `id` gives that house's authoring advice) and place it +beside `chart_spec`: `"theme_spec": "economist"`. For a brand adjustment, +extend a preset with only what changes: +`{ "extends": "economist", "id": "our-brand", "ink": { "series": { "single": "#6b3fa0" } } }`. +Do not copy a whole preset or invent theme keys; a new or substantially +customised theme is the `flint-theme-author` skill. ThemeSpec applies to +Vega-Lite and Plotly. ## Parameter overrides — when to reach for them @@ -687,19 +467,45 @@ default: - **Override an inferred type:** `encodings.x = { field: "year", type: "ordinal" }` (e.g. treat a year as discrete bands). - **Use readable field titles:** `field_display_names = { percentageOfCountries: "Percentage of countries" }`. Keep encodings bound to the real column name; Flint uses the display name for axis titles and legend headers. -- **Resize the chart:** Flint sizes from two numbers — `baseSize` (the *target* +- **Resize the chart:** set `baseSize` to suit where the chart is shown when + you know it (a wide panel or page, a narrow side bar, a size the user asked + for); otherwise leave it out and the MCP card starts at 300×300. The card + lets a dense chart grow up to 1.5× and always fits it to the host's width. + Flint sizes from two numbers — `baseSize` (the *target* it aims for, default 400×320) and `canvasSize` (a *hard ceiling* it may never exceed). With dense data the chart stretches from base toward the ceiling. - Want a comfortable size that may grow for dense data → set `chart_spec.baseSize = { width, height }`. - - Want a fixed slot it must fit inside → set `chart_spec.canvasSize = { width, height }` alone; the chart fills it and shrinks to fit, never overflowing. *What you ask for is what you get.* + - Want a fixed slot it must fit inside → set `chart_spec.canvasSize = { width, height }` alone; the chart fills it and shrinks to fit (a host narrower than the slot lays the chart out again for the room it has). - Both → aims for `baseSize`, grows toward `canvasSize`, never beyond. - **Force log / zero baseline:** the `logScale_*` / `includeZero_*` chart - properties above. + properties (`list_chart_types` with a `chartType` lists them). Global layout tuning lives in the top-level `options` object (e.g. `addTooltips`, band padding, facet sizing). It is rarely needed for authoring — omit it unless asked. +## Post-Flint style customization + +Stay at the Flint level for structure (data, chart type, channels, transforms, +sizing, properties) — Flint specs stay portable and regenerate safely. Drop to +backend JSON only after a valid Flint chart exists, and only for a narrow +presentation change Flint does not expose (exact axis/legend/mark styling, +layout polish). Titles are `chart_spec.title`; notes, regions and reference +lines are `updates`. Never use it to change the +data, chart type, field mappings, or transforms — fix those upstream. + +For a Vega-Lite-specific style tweak: + +1. Author and validate the Flint `ChartAssemblyInput`. +2. Render or inspect the Flint chart first, when possible. +3. Call `compile_chart` with `backend: "vegalite"`. +4. Make the smallest necessary style/presentation edit to the returned + Vega-Lite spec. +5. Render the edited spec in the host environment with a Vega-Lite renderer. + +This edited Vega-Lite spec is no longer a portable Flint spec. Do not send it to +`render_chart`; use `render_chart` only for Flint `ChartAssemblyInput`. + ## Worked examples In each example `data` is a placeholder — the host binds real rows or a @@ -723,8 +529,7 @@ User: "Plot car weight vs fuel economy, colored by origin." "x": { "field": "weight" }, "y": { "field": "mpg" }, "color": { "field": "origin" } - }, - "baseSize": { "width": 400, "height": 300 } + } } } ``` @@ -775,12 +580,13 @@ User: "Line chart of monthly sales and profit." } ``` -### Donut chart (Pie + innerRadius), value on `size` +### Donut chart, value on `size` User: "Show market share by vendor as a donut." -Pie/donut maps the slice value to `size` (rendered as angle) and the +Pie and Donut map the slice value to `size` (rendered as angle) and the category to `color`. Data is already long (one row per vendor). +`innerRadius` sizes the hole (a Pie with `innerRadius` is a donut too). ```json { @@ -790,7 +596,7 @@ category to `color`. Data is already long (one row per vendor). "share": "Percentage" }, "chart_spec": { - "chartType": "Pie Chart", + "chartType": "Donut Chart", "encodings": { "size": { "field": "share" }, "color": { "field": "vendor" } @@ -843,8 +649,8 @@ User: "Show each rep's sales against their quota." `color` encoding's `scheme`, `reverse`, `mid`, `domain`, `bins` and `colors`. - **Don't invent semantic type names.** If none fit, use the family default (`Quantity`, `Category`, `Date`). -- **Don't call the library to discover channels/types** — this document is - the authoring reference. +- **Don't read the library's source** to find channels or properties: + `list_chart_types` lists them. ## Validation checklist @@ -855,7 +661,7 @@ Before returning, verify: 3. Every encoded field has an entry in `semantic_types` (specific type). 4. Required channels for the chart type are present (e.g. Bullet→`goal`, Candlestick→`open/high/low/close`, Pie→`size`+`color`). -5. Any `chartProperties` keys are valid for that chart type and in range. +5. Any `chartProperties` keys are ones `list_chart_types` lists for the type. 6. You did **not** inline large data or hand-tune derived styling. 7. The data carries no embedded total/subtotal level (e.g. an `all` / `total` row) mixed with its components on a stacked, grouped, or colored channel. diff --git a/packages/flint-mcp/assets/flint-interaction-author.SKILL.md b/packages/flint-mcp/assets/flint-interaction-author.SKILL.md index 8091af3a..e8be3b33 100644 --- a/packages/flint-mcp/assets/flint-interaction-author.SKILL.md +++ b/packages/flint-mcp/assets/flint-interaction-author.SKILL.md @@ -1,129 +1,93 @@ --- name: flint-interaction-author -description: "Use when: a Flint chart should respond to the reader (highlight, zoom, brush, legend toggle, reorder, annotate, explore, link charts); an application or an agent changes a mounted chart from outside or reads what it shows; or a gesture no preset gives must be built. Produce one valid interaction_spec, one ChartUpdate, or code against flint-chart/interactive, with no invented names." +description: "Use when: a chart should carry notes, shaded regions, outlines, emphasis or reference lines (updates); a Flint chart should respond to the reader (highlight, zoom, brush, legend toggle, reorder, filter); or an agent changes a chart on screen. Produce one valid interaction_spec or ChartUpdate, with no invented names. Code against flint-chart/interactive (mounting, linking in an app, a bespoke gesture) is the flint-app-author skill." --- # flint-chart: interactions and updates on a chart -A Flint chart is shared state. A reader's gesture becomes an event, a handler -turns the event into an update `{ id, ops }`, updates compose as layers, and -the layers render into a state the host and the agent read back. An -application and an agent write the same kind of update directly. The full -model is in the documentation: -https://microsoft.github.io/flint-chart/#/documentation/interaction-introduction - -The chart itself (`chart_spec`, `semantic_types`) is the `flint-chart-author` -skill. Everything here runs on the Vega-Lite backend; a static render and the -other backends leave `interaction_spec` and updates untouched. - -## What you produce (and what you do NOT) - -| The request says | You produce | Section | +Two things go beside a chart input, and both are optional: + +- `interaction_spec`: behaviour, what the reader can do. `{ "interactions": [ { "type": , "options"?: { … } } ] }`. +- `updates`: state, marks the agent leaves on the chart (notes, emphasis, a + shaded range, a reference line). A list of `{ "id", "ops": [ … ] }` layers. + +A gesture's handler and an agent write the same layers, so when the request +is for something the reader can do themselves, give them the gesture; when it +is a point the agent makes, write the update. The chart itself is the +`flint-chart-author` skill. Everything here runs on the Vega-Lite backend; a +static render and the other backends ignore both. Code (mounting, `onChange`, +linking charts in an app, a gesture no preset gives) is the `flint-app-author` +skill; on an MCP board, charts connect through `link_spec` (the +`flint-board-author` skill). + +Use only the names in this skill and in `list_interaction_presets`. When the +request asks for a behaviour no preset gives, say which preset comes closest +and what it leaves out. + +## Add interactions + +### When + +A mounted chart already shows each mark's values in a tooltip, and a click on +a legend item dims the other groups. Add behaviour only for a reason: + +1. **The user asks for it**, by naming a gesture ("brush a period", "zoom", + "toggle the legend") or by describing what the chart should do ("click a + line so it stands out", "slide along the years", "let me pick the year"). + "Make it interactive" is an ask with nothing named: one or two presets + that fit the chart. +2. **The chart works with other charts** on a board: behaviour is what + connects the views. +3. **The data needs it to be read**: more detail than the chart can show at + its size (a long dense series, a crowded cluster, a map) that the reader + will want to see closer. Shape the chart first (an aggregate, a scale, a + filter); behaviour is a way to move closer (`navigate`, `brush-zoom`). Many + series is not this reason: fewer series is a shaping choice, and picking + them apart waits for the user to ask. + +Otherwise add nothing. A question about the data is answered by the chart and +the reply, and a chart shown in a live view has asked for nothing. + +### Pick presets + +Take the preset whose gesture the user named, or whose purpose meets what +they described, one per job and as few jobs as the reason holds: one or two +entries for most charts, none added to round out a set. +`list_interaction_presets` with `chartType` lists the presets the type +supports, what each needs, its reset and every option. + +| Preset | Gesture | What it is for | | --- | --- | --- | -| A gesture or a behaviour on the chart: "highlight on click", "zoom", "brush a period", "make it interactive", "add behaviour to this chart". | One `interaction_spec`: `{ "interactions": [ ... ] }`, presets only. | Add interactions to the chart | -| A change to a chart that is already on screen, from outside: "point out Japan", "frame 2010 to 2020", "note this value", "reorder by value", an agent answering a user with the chart. | One `ChartUpdate`: `{ "id", "ops": [ ... ] }`. | Update the chart | -| Code around a chart: "in my app", "on click open the record", "a panel that follows the hover". | TypeScript against `flint-chart/interactive`: mount, presets as factories, `onChange`, `dispatch`. | Use Flint in an application | -| Code across charts or over time: "link these two charts", "a table that follows the selection", "play the years". | `linkCharts` or `useLinkedCharts`; `dispatch` on a timer. On an MCP board, `link_spec` instead (board skill, "Step 5 — connect them"). | Link charts | -| A gesture no preset gives: "drag along the path", "draw a guess", "a rule for the box", "a lens the app draws". | A `CanvasInteractionDef`: a trigger, affordances, a handler. | When no preset fits | - -- **DO** use only the names in this skill: preset types, options, ops, states, - triggers, cursors, event actions. Every name here is one the library ships. - When the request asks for a behaviour no preset gives, say which preset - comes closest and what it leaves out, then offer a bespoke definition if the - host runs code. -- **DO** add behaviour only when the request or the session asks for it. A - static image or a bare spec gets no `interaction_spec`. - -## Which workflow the user is asking for - -- **Presets through the MCP tools:** put the object beside `chart_spec` as - `interaction_spec` in the chart input; `validate_chart` reports its warnings - without drawing, and `show` draws it with the same report. `list_interaction_presets` - with `chartType` lists the presets that chart type supports, what each - does, and its options. -- **An update through the MCP tools:** there is no handle on the chart. Pass - the layers as the `updates` argument beside the input, to `validate_chart` - and `show`; see "Step 4 — send the layer and read the result". -- **Code, only when the user asks for code:** mount with `mountChart`, or - `` in React; presets as factory calls, updates with - `applyUpdate`, state with `getState` and `onChange`. The programming API - is documented at - https://microsoft.github.io/flint-chart/#/documentation/interaction-api -- **A bespoke interaction** needs a host that runs code. In the MCP view, the - answer is the closest preset and what it leaves out. - -## Add interactions to the chart - -### Step 1 — read the request and the chart - -Three things in the request decide the entries, read in this order: - -1. **What the user named.** A gesture or a preset in their words: "brush a - period", "zoom", "toggle the legend", "highlight on click". Each is one job. -2. **The goal they stated.** "Explore", "compare the regions", "find - outliers", "present this", "a control in my app". A goal is the set of - questions the reader will ask of this chart; each question is one job. -3. **Nothing named**, only "interactive", a live view, a dashboard. The chart - and the data say what the reader can do with it. - -Then read the chart spec: the chart type, the field on each channel, and the -shape of the data. What a chart invites a reader to do: - -| The chart | Invites | -| --- | --- | -| A time series, one or many series | Comparing the series at one x; focusing a period; hiding a series when a colour field is bound; moving along the series when it is long. | -| A scatter or a dense point chart | Focusing a cluster; moving closer; hiding a series when a colour field is bound. | -| A bar, lollipop, or other category chart | Singling out a category; ranking by hand; hiding a series when a colour field is bound. | -| A pie, donut, rose, or radar | Singling out a sector; focusing adjacent sectors. | -| A heatmap or a calendar | Singling out a cell; reading a whole row or column. | -| A map | Singling out a region; moving closer. | -| A chart that is a control in an app | A click the app reads as a selection; a stronger gesture the app reads as an activation. | -| A chart read without a pointer | Walking the chart from the keyboard. | - -### Step 2 — pick presets - -Before any entry, a mounted chart already shows a tooltip with the mark's -values on hover and nothing else. An entry adds one behaviour. - -Take one row of the map per job. A named gesture takes the row whose -"Gesture" is that gesture. A question takes the row whose "Answers" is that -question, on a chart whose "Needs" it offers; a broad goal takes two or three -rows, the ones the chart invites most. When nothing is named, the rows the -chart invites, two or three. A row that answers no job on the request stays -out. - -| Preset | Gesture | Answers | Needs | Default reset | -| --- | --- | --- | --- | --- | -| **Single one thing out** | | | | | -| `click-highlight` | Clicks a mark, a legend item, or an axis label; it stays emphasised and the rest mute. Shift-click adds. | Which mark, series, or category is this one? | elements | click-none, escape | -| `click-group-focus` | Clicks a mark; every mark in its group stays emphasised. `groupBy` names the group field. | Which marks belong with this one? | elements | click-none, escape | -| `hover-group-focus` | Hovers a mark; its group stands out until the pointer leaves. `groupBy` names the group field; `emphasis` is `"auto"` (a line widens and the rest stay as drawn; points, bars, and slices dim the rest), `"highlight"`, or `"spotlight"`. | Which marks belong with this one, at a glance? | elements | none | -| `axis-highlight` | Clicks (or with `event: "hover"`, hovers) a discrete axis label; that category's marks emphasise. | Which marks share this row or column? | discrete axis | click-none, escape | -| **Read values** | | | | | -| `inspect` | Moves over the plot; a guide follows the pointer and the nearest mark on the chosen axes reads out. `mode` picks the axes and a comparison (`"x>"` reads every mark past the pointer). | What is at this x, this y, or beyond it? | elements | none | -| `inspect-index` | Moves along the index axis; every series reads out at that position on one guide, each value labelled in its series colour and the position named at the axis. `show: "single"` reads one series and switches it through the legend; `seriesBy` names the series field when the chart draws one series at a time; `displayValue: false` keeps the guides and drops the labels. | What does each series hold at this point? | index axis | escape | -| **Focus a region** | | | | | -| `select` | Drags a rectangle; the marks inside emphasise. `mode: "stateful"` keeps the rectangle on screen to move and resize. | Which marks lie in this area? | elements, cartesian region | click-none, escape | -| `lasso-select` | Draws a freehand region; the marks inside emphasise. | Which marks lie in this irregular cluster? | elements, cartesian region | click-none, escape | -| `brush-x`, `brush-y` | Drags an interval along one axis; the marks in it emphasise. `mode: "stateful"` keeps the interval on screen to move and resize. On a polar chart the x brush is a sector. | Which marks fall in this period or this range? | elements, cartesian region | click-none, escape | -| `brush-angle` | Drags an angular sector on a pie, donut, rose, or radar; the slices in it emphasise. | Which adjacent slices make up this share? | elements, angular region | click-none, escape | -| `linked-brush` | Drags a region; the groups inside emphasise in every chart that mounts the same preset. `groupBy` names the shared field; `mode: 'stateful'` keeps the rectangle on screen to move or resize. | Where are these groups in the other charts? | elements, cartesian region | click-none, escape | -| **Move the view** | | | | | -| `navigate` | Drags to pan; wheels or pinches to zoom a continuous axis. `axes` limits it; `pan: false` leaves the plot drag free. On a map it moves the projection; on a globe (a world Choropleth with `projection: "orthographic"`) a drag turns the sphere and the zoom stays centred. On a map, `geometry.domain.focus` names the region at the centre. | What is in this part of the range, closer? | navigation | double-click | -| `brush-zoom` | Drags a rectangle; the chart flies into it. | What is in this box, closer? | navigation | double-click, escape | -| **Reduce or rearrange** | | | | | -| `legend-toggle` | Clicks a legend item; its series hides or returns. Hidden series are a setting and survive every reset. | What does the chart look like without this series? | discrete legend | none | -| `drag-reorder` | Drags a discrete axis label to a new place; the categories reorder. | How do these rank in the order I choose? | reorderable axis | none | -| `filter-controls` | Picks values in controls beside the chart; the rows that fail are removed, or muted with `mode: "highlight"`. One control per listed field. | What does the chart show for this subset of a field it does not draw? | inline data | none | -| **Mark for the reader** | | | | | -| `click-annotate` | Clicks a mark; a note with its value pins to it. | What is this value, left on the chart? | elements | click-none, escape | -| **Hand a gesture to the app** | | | | | -| `double-activate` | Double-clicks a mark; the mark activates and the host reads it. | Which record should the app open? | elements | click-none, escape | -| `long-press` | Holds a mark (500 ms); the mark activates. The touch spelling of the same activation. | Which record should the app open, on touch? | elements | click-none, escape | -| `context-activate` | Right-clicks or long-presses a mark; the host receives a context target and draws its own menu. | What can the app do with this mark? | elements | none | -| `context-menu` | The reader picks marks and a menu of the app's actions opens beside them; picking one emits `menu-select` with the item's id and the marks. `gesture` picks how: `rectangle` (default), `lasso`, `brush-x`, `brush-y`, `click`, `right-click`, `long-press`. `items` is required: `[{ "id", "label" }]`. One entry; it brings its own selection. | What can the app do with these marks? | elements, cartesian region | click-none, escape | -| **Read without a pointer** | | | | | -| `accessible-navigation` | Tabs into the chart and walks titles, axes, legends, facet headers, series, and marks with the arrow keys; Enter goes a level in, and inside a level Tab steps through it before moving on. Each step says what the element is and emphasises its data. Space on a focused element runs the click presets. | What is on this chart, from the keyboard or a screen reader? | elements | none | +| **Single one thing out** | | | +| `click-highlight` | Clicks a mark, a legend item, or an axis label; it stays emphasised and the rest mute. Shift-click adds. | Keeps one mark, series, or category in focus against the rest while the reader looks at it; in an app, the selection the app reads. | +| `click-group-focus` | Clicks a mark; every mark in its group stays emphasised. `groupBy` names the group field. | Follows one group (a country's line, a species' points) across the chart from any of its marks. | +| `hover-group-focus` | Hovers a mark; its group stands out until the pointer leaves. `groupBy` names the group field; `emphasis` is `"auto"` (a line widens and the rest stay as drawn; points, bars, and slices dim the rest), `"highlight"`, or `"spotlight"`. | Picks one group out of many overlapping ones at a glance, without a click. | +| `axis-highlight` | Clicks (or with `event: "hover"`, hovers) a discrete axis label; that category's marks emphasise. | Picks a whole row or column, a category or a month, through its axis label. | +| **Read values** | | | +| `inspect` | Moves over the plot; a guide follows the pointer and the nearest mark on the chosen axes reads out. `mode` picks the axes and a comparison (`"x>"` reads every mark past the pointer). | Reads exact positions on guides: a crosshair on one or both axes, or every mark past a threshold. One mark's values are already in the tooltip. | +| `inspect-index` | Moves along the index axis; every series reads out at that position on one guide, each value labelled in its series colour and the position named at the axis. `show: "single"` reads one series and switches it through the legend; `seriesBy` names the series field when the chart draws one series at a time; `displayValue: false` keeps the guides and drops the labels. | Reads several series at the same position side by side, on one guide. With one series it repeats the tooltip. | +| **Focus a region** | | | +| `select` | Drags a rectangle; the marks inside emphasise. `mode: "stateful"` keeps the rectangle on screen to move and resize. | Picks out the marks in an area of a two-dimensional spread, to see which they are. | +| `lasso-select` | Draws a freehand region; the marks inside emphasise. | Picks out an irregular cluster that a rectangle would not fit. | +| `brush-x`, `brush-y` | Drags an interval along one axis; the marks in it emphasise. `mode: "stateful"` keeps the interval on screen to move and resize. On a polar chart the x brush is a sector. | Marks a period or a value range, to see what falls in it. | +| `brush-angle` | Drags an angular sector on a pie, donut, rose, or radar; the slices in it emphasise. | Takes adjacent slices of a part-to-whole chart together. | +| `linked-brush` | Drags a region; the groups inside emphasise in every chart that mounts the same preset. `groupBy` names the shared field; `mode: 'stateful'` keeps the rectangle on screen to move or resize. | Connects charts: groups picked in one show in every chart that shares the field. | +| **Move the view** | | | +| `navigate` | Drags to pan; wheels or pinches to zoom a continuous axis. `axes` limits it; `pan: false` leaves the plot drag free. On a map it moves the projection; on a globe (a world Choropleth with `projection: "orthographic"`) a drag turns the sphere and the zoom stays centred. On a map, `geometry.domain.focus` names the region at the centre. | Moves through a chart that holds more detail than fits at its size: a long series, a dense cluster, a map. | +| `brush-zoom` | Drags a rectangle; the chart flies into it. | Jumps into one stretch or box of a dense chart, and back out. | +| **Reduce or rearrange** | | | +| `legend-toggle` | Clicks a legend item; its series hides or returns. Hidden series are a setting and survive every reset. | Takes series out of view and brings them back, so the rest read without them. | +| `drag-reorder` | Drags a discrete axis label to a new place; the categories reorder. | Lets the reader set the order of the categories. | +| `filter-controls` | Picks values in controls beside the chart; the rows that fail are removed, or muted with `mode: "highlight"`. One control per listed field. | Switches the chart between subsets of a field it does not draw: a year, a group, a scenario. | +| **Mark for the reader** | | | +| `click-annotate` | Clicks a mark; a note with its value pins to it. | Leaves the values of chosen marks written on the chart, where there is room beside them for a note. | +| **Hand a gesture to the app** | | | +| `double-activate` | Double-clicks a mark; the mark activates and the host reads it. | Hands a mark to the app as an action, apart from selecting it. | +| `long-press` | Holds a mark (500 ms); the mark activates. The touch spelling of the same activation. | The same hand-off, on touch. | +| `context-activate` | Right-clicks or long-presses a mark; the host receives a context target and draws its own menu. | Hands a mark to a menu the app draws. | +| `context-menu` | The reader picks marks and a menu of the app's actions opens beside them; picking one emits `menu-select` with the item's id and the marks. `gesture` picks how: `rectangle` (default), `lasso`, `brush-x`, `brush-y`, `click`, `right-click`, `long-press`. `items` is required: `[{ "id", "label" }]`. One entry; it brings its own selection. | Offers the app's actions on the marks the reader picks, in a menu Flint draws. | +| **Read without a pointer** | | | +| `accessible-navigation` | Tabs into the chart and walks titles, axes, legends, facet headers, series, and marks with the arrow keys; Enter goes a level in, and inside a level Tab steps through it before moving on. Each step says what the element is and emphasises its data. Space on a focused element runs the click presets. | Makes the chart readable from the keyboard and a screen reader. | Within a family the rows answer neighbouring questions, so one chart takes one of them: `inspect` reads the marks near the pointer, `inspect-index` reads @@ -132,12 +96,6 @@ a shape; `navigate` moves continuously, `brush-zoom` jumps into a box; `double-activate`, `long-press`, and `context-activate` are three spellings of "hand this mark to the app" for a mouse, a finger, and a menu. -"Needs" is what the chart type offers; `list_chart_types` has already applied -it to the list it returns. The data confirms a few at mount, in Step 3. A -viewport a gesture commits, and a reset, fly over 400 ms; -`"transition": { "duration": 0 }` or `"resetTransition": { "duration": 0 }` -jumps. Panning and wheel zooming follow the pointer. - **`filter-controls`.** It draws real controls beside the chart and changes the rows the chart shows, so it answers a request that names a field to filter by ("filter by region", "one year at a time", "let me pick the group"), or a data @@ -151,13 +109,11 @@ categorical and temporal fields itself. One entry per chart. A fixed subset belongs in the data, and slices side by side are a facet in the `flint-chart-author` skill. -### Step 3 — resolve conflicts +### Conflicts -Each trigger has one owner. At mount, admission gives a trigger to the first -entry that asks for it; a later entry that asks for the same trigger yields -it with an `info` warning when it can keep the rest, or is dropped with a -warning when it cannot. The chart still renders. Four triggers are asked for -by more than one preset: +Each trigger has one owner; a later entry that asks for a taken trigger +yields it with an `info` warning, or is dropped with a warning when it +cannot work without it. Four triggers are shared: | Trigger | Asked for by | Free it with | | --- | --- | --- | @@ -166,11 +122,8 @@ by more than one preset: | The legend click | `legend-toggle`, `click-highlight`, `inspect-index` with `show: "single"` | `"targets": ["mark"]` on `click-highlight` | | The retained mark focus | `click-highlight`, `click-group-focus` | one of them | -`click-highlight` yields a legend or an axis click on its own, with an `info` -warning; `targets` keeps the spec silent. `accessible-navigation` takes no -pointer trigger, so it sits beside any entry. - -The data confirms what the chart type cannot promise. An entry that fails one +`accessible-navigation` takes no pointer trigger, so it sits beside any +entry. The data confirms what the chart type cannot promise. An entry that fails one of these at mount is dropped with a warning: - `legend-toggle` needs a colour field bound to a discrete legend. @@ -183,371 +136,122 @@ of these at mount is dropped with a warning: - `click-group-focus`, `hover-group-focus`, and `linked-brush` need `groupBy`, a bound field. -### Step 4 — write and validate +### Write and validate -The object is `{ "interactions": [ ... ] }`, beside `chart_spec` as -`interaction_spec`. Every entry is -`{ "type": , "id"?: , "options"?: { ... } }`: - -- `type` is a preset from the map, supported by the chart type per - `list_chart_types`. -- `options` holds the preset's own options; `list_interaction_presets` lists - every one with its type (see "Preset options"). `reset` is one of them: omit it for the default list in the map, set it to - free a trigger. A preset that keeps nothing (`hover-group-focus`, `inspect`, - `context-activate`) accepts no `reset`. -- `id` sits on the entry and is needed only when one preset appears twice. -- In code, the same entry is a factory call with the same options: - `clickHighlight({ targets: ['mark'] })`, `brushX()`, `navigate({ axes: 'x' })`. +Every entry is `{ "type": , "id"?: , "options"?: { ... } }`: +options nest under `options` (`reset` is one of them, set only to free a +trigger), and `id` sits on the entry, needed only when one preset appears +twice. ```json { "interactions": [ { "type": "click-highlight", "options": { "targets": ["mark"] } }, - { "type": "navigate", "options": { "axes": "x" } }, { "type": "legend-toggle" } ] } ``` -`validate_chart` checks the object without drawing, and `show` runs the same -check when it draws. A malformed entry -is an error: an unknown `type`, an option beside `type`, an `id` inside -`options`, a bare string entry, a missing required option, an unsupported -`reset` gesture, a duplicate `id`. A dropped or yielded entry is a warning -that names the entry, what it needed, and the chart type: +`show` checks it as it draws (`validate_chart` without a card). +An unknown `type`, an option beside `type`, an `id` inside `options` or a +missing required option is an error. A dropped or yielded entry is a warning +that names the entry and what it needed: ``` Interaction "legend-toggle" requires a discrete legend; Bar Chart has none. The interaction was dropped. -Interaction "click-highlight" yields legend clicks to "legend-toggle". -``` - -Fix or drop what it warns about. Return the bare object, strict JSON, unless -the user asks for commentary. - -### When no preset fits - -A host that runs code mounts a `CanvasInteractionDef` in `options.interactions` -beside presets: a trigger, what it affords, and a handler that returns the -layer for its id. - -```ts -import { rectangleTrigger, type CanvasInteractionDef } from 'flint-chart/interactive'; - -const timebox: CanvasInteractionDef = { - id: 'timebox', - eventSource: rectangleTrigger('contain'), - affordances: { plot: { cursor: 'region' } }, - reset: ['click-none', 'escape'], - handle(event) { - if (event.action !== 'select-region' || event.phase !== 'commit') return null; - const x = event.geometry.domain?.x; - const y = event.geometry.domain?.y; - if (x?.kind !== 'interval' || y?.kind !== 'interval') return null; - const keep = seriesInsideBox(x.start, x.end, Number(y.start), Number(y.end)); // host logic over host rows - return { - id: 'timebox', - ops: [{ op: 'set-style', - targets: keep.map((series) => ({ select: { key: { Series: series } } })), - value: { state: 'emphasized' } }], - }; - }, -}; -``` - -| Field | Role | -| --- | --- | -| `id` | Names the interaction in events and the layer it retains. | -| `eventSource` | The trigger: what to capture and how to read it. | -| `affordances` | The kinds of hit the handler receives, each with its cursor and hover; a hit of a kind not listed never reaches it. Keys: `mark`, `legend-item`, `axis-label`, `plot`. Cursors: `activate`, `drag`, `region`, `navigate`, `inspect`, `draw`. Hovers: `target` (the mark), `cohort` (its group). | -| `handle(event, context)` | Returns the whole layer for this id, or `null` for no change. | -| `reset` | Gestures that clear the layer: `click-none`, `double-click`, `escape`. A reset reports as a commit with no `interactionId`. It suits a layer of styles the state shows; an overlay or a data layer is cleared by the host. | - -**Triggers.** - -| Trigger | The reader does | `action` | `geometry.plot` | `geometry.domain` | Affordance key | -| --- | --- | --- | --- | --- | --- | -| `clickTrigger` | Clicks a mark, legend item, or axis label. | `click-element`, `click-legend`, `click-axis` | `point` | — | `mark`, `legend-item`, `axis-label` | -| `hoverTrigger` | Moves over a mark. | `hover-element`, `hover-legend`, `hover-axis` | `point` | — | same | -| `dragTrigger(tolerance?)` | Presses a mark, or a projectable overlay path, within `tolerance` px (12) and drags. | `drag` | `drag { start, current, delta }` | the pointer's values; `geometry.projection` while over a projectable overlay | `mark` | -| `rectangleTrigger(match?, guide?)` | Drags a rectangle. | `select-region` | `rect` | `x`, `y` intervals | `plot` | -| `xBrushTrigger(match?, mode?, guide?)`, `yBrushTrigger(…)` | Drags an interval along one axis. | `brush-x`, `brush-y` | `rect` | that axis's interval | `plot` | -| `lassoTrigger(match?, guide?)` | Draws a freehand region; previews begin at the third point. | `select-lasso` | `polygon` | `points`: the stroke so far, in data values | `plot` | -| `angularBrushTrigger(match?, mode?, guide?)` | Drags a sector on a polar chart. | `brush-angle` | `angular-sector` | — | `plot` | -| `inspectTrigger(mode?)` | Moves over the plot. | `inspect-x`, `inspect-y`, `inspect-xy` | `point` | `x`, `y` values | `plot` | -| `inspectIndexTrigger(axis?, show?, seriesBy?)` | Moves along the index axis. | `inspect-x`, `inspect-y` | `point` | the index value | `plot` | -| `navigationTrigger({ axes?, pan?, zoom?, reset? })` | Drags, wheels, pinches. | `pan-viewport`, `zoom-viewport`, `reset-viewport` | `viewport { delta, factor, anchor }` | the viewport after the move | `plot` | -| `contextTrigger`, `longPressTrigger(ms?)`, `doubleActivateTrigger` | Right-clicks, holds (500 ms), double-clicks a mark. | `context-element`, `long-press-element`, `double-activate-element` | `point` | — | `mark` | - -`match` is `'intersect'` (default) or `'contain'` and decides which marks the -region's `target` lists. `guide` styles the drawn shape; `false` hides it. A -region is ephemeral: its guide and its preview end at the commit. A brush or -`select` with `mode: 'stateful'` keeps its region on screen and editable, and -`event.operation` reads `create`, `move`, `resize-leading`, `resize-trailing`, -or `clear`. Spread a trigger to tune it: -`{ ...hoverTrigger, defaultAssistDistance: 28 }` acquires the nearest mark -within 28 px. A chart admits a trigger when it offers what the trigger needs, -per the map's "Needs"; a code definition the chart cannot honour throws at -mount with a message that names what it needed. - -**The event.** - -```ts -interface CanvasInteractionEvent { - action: string; // from the table - phase: 'start' | 'preview' | 'commit' | 'cancel'; // clicks and hovers skip start - operation?: string; // a stateful brush's edit, or pan | zoom | reset - geometry: { plot?, domain?, projection? }; - target: { visual: { kind, role }, elements: [{ value, records? }] } | null; - modifiers?: { shift, ctrl, meta }; - description?: { kind, type, content, text }; // on focus-element from accessible-navigation -} -``` - -- `target.elements[i].value` holds the mark's encoded values, derived fields - included; `records` holds the source rows when the runtime can prove them. A - region target lists every mark inside. A legend hit's `value` is a - `LegendTargetValue`: `{ channel, field, domain: { kind: 'value', value } }`, - or `{ kind: 'interval', start, end }` on a continuous legend. An axis-label - hit's `value` is an `AxisTargetValue`: `{ axis, field, value }`. -- `geometry.domain` is inverted through the plot's scales: a brush on a time - axis gives `domain.x = { kind: 'interval', start: Date, end: Date }`, a linear - axis gives numbers, a discrete axis gives the category. -- `description` arrives on `focus-element` while `accessible-navigation` walks - the chart: what the focused element is (`type`, such as "Bar") and what it - represents (`content`), with the spoken `text`. The walk's emphasis reports - through `onChange` as a `preview`. -- `geometry.projection.kind === 'path'` during a drag over an overlay with - `projectable: true`: `segment.start.value` and `segment.end.value` are the - overlay rows on each side of the pointer and `segment.t` the fraction between - them. - -**The types.** `flint-chart/interactive` exports these, and `flint-chart/react` -re-exports them. `onChange` receives a `ChartChange`: the gesture's own -`target` and `geometry`, and the chart's `state` after it. Generated from the -source by `npm run gen:reference`: - - -```ts -interface ChartChange { - // `preview` while a gesture runs, `commit` for a committed change, `cancel` when a gesture ends with none. - phase: ChartChangePhase; - // `host` for `updates`, `applyUpdate`, `clearUpdate` and `dispatch`; always `commit`. - source: ChartChangeSource; - changed: ChartStateFacet[]; - // The interaction behind the change: a reader's gesture, or an external interaction run by `dispatch`. - interactionId?: string; - action?: CanvasInteractionAction; - // The gesture's own hit: the hovered point, or the marks at an inspected index. - target?: SemanticTarget | null; - // The gesture's geometry: a brushed range, an index value, or the viewport after a move. - geometry?: CanvasInteractionEvent['geometry']; - // The reset gesture a reader made: a click on nothing, Escape, or a double-click. Reported even when the chart held nothing to reset, so a host that shows a selection of its own can let it go. - reset?: InteractionResetGesture; - state: ChartState; - previous: ChartState; -} - -interface ChartState { - chartType: string; - // The marks the chart emphasizes or focuses now, previews included. - selected: SemanticElement[]; - // The emphasized marks of each update, by update id; `selected` is their union. - entries?: ReadonlyMap; - // The legend values a toggle hides now. - hidden?: ChartHiddenValue[]; - // The domain the plot shows now, when the chart navigates. - viewport?: DomainGeometry; - // The category window of each rail. - windows?: Partial>; - categoryOrder?: unknown[]; - // The notes the chart holds now, previews included; `inView` tells which ones it draws. - annotations?: ChartAnnotation[]; - // The active filter of each field, set by filter controls; absent fields show every value. - filters?: Readonly>; -} - -interface SemanticTarget { - visual: { - kind: 'mark' | 'path' | 'region' | 'widget' | 'handle' | 'legend' | 'axis' | 'chart' | 'title' | 'header'; - role: string; - }; - elements: SemanticElement[]; -} - -interface SemanticElement { - // Values represented by the mark's channels, or by a semantic control such as a legend item. - value: Record; - // Contributing input records when provenance is available; zero or many may support one value. - records?: Record[]; -} - -interface LegendTargetValue { - channel?: string; - field?: string; - // The entry's value on a reader's hit; read `domain`, which every legend target carries. - value?: unknown; - domain: LegendDomain; -} - -type LegendDomain = - | { kind: 'value'; value: unknown } - | { kind: 'interval'; start?: number; end?: number }; - -interface AxisTargetValue { - axis: 'x' | 'y'; - field: string; - value: unknown; -} - -interface DomainGeometry { - x?: DomainCoordinate; - y?: DomainCoordinate; - points?: DomainPoint[]; - // The detail level a multi-level projected chart draws for this viewport. - level?: string; - // On a multi-level projected chart, the coarsest-level region under the plot centre: its feature id and properties plus the joined row fields. - focus?: Record; -} - -type DomainCoordinate = - | { kind: 'value'; value: DomainValue } - | { kind: 'interval'; start: DomainValue; end: DomainValue }; - -type DomainValue = number | Date | string; - -interface DomainPoint { - x?: DomainValue; - y?: DomainValue; -} - -interface ChartHiddenValue { - channel: string; - value: unknown; -} - -type FilterValue = - | { in: unknown[] } - | { range: [unknown, unknown] }; ``` - -- `context` is the chart state plus `available`, every drawn mark, for - building refs, and `selected`, the current emphasis, for a toggle rule. - -**The handler.** - -- It returns the complete layer for the id on every `preview` and `commit`; - the runtime drops the preview on `cancel`. A `null` on a `preview` shows - nothing until the commit, which is how a rule applies to the committed box - only. A region gesture keeps a preview layer under the interaction's id - while the drag runs, so a commit after previews restates the layer; a - `null` there lets the last preview stand. -- It maps geometry to the host's model and the model to ops. Host side - effects (state, panels, overlays the host draws) come from - `flint-interaction` or `onChange`, which carry the same event; the handler - itself returns ops and leaves the DOM to the runtime. -- Triggers have one owner for code definitions as for presets; two code - definitions on one trigger throw at mount. `navigate({ pan: false })` goes - beside a region trigger. -- An element drag owns the press on the marks it affords. A press there is a - `drag` with phase `start`; `target` is the pressed mark through every phase. - The layer returned at `start` is kept as the gesture's preview, and a release - without movement commits that preview with no further call. No click - definition fires on those marks, so the definition that drags a mark also - answers its press. -- A click definition that affords `hover` on marks receives `preview` events - for the hover cue. Return `null` or an emphasis for them, and the layer on - `commit`. - -**Patterns.** - -| Pattern | Flow | Pieces | -| --- | --- | --- | -| Gesture rule | Flint in, Flint out | A region trigger reads `geometry.domain`; the host rule picks rows; `set-style` by key (the timebox above). | -| Host-drawn detail | Flint in, custom out | `hoverTrigger` or `inspectTrigger` with a `null` handle; the host listens to `flint-interaction` for the resolved element and draws a lens, a cursor, or a badge over the mount. | -| Application drives the chart | external in, Flint out | `externalInteraction` plus `dispatch` per frame: a playback year, a reveal progress. | -| Drag along a path | press, then drag | One `dragTrigger()` definition and one layer. At `start` on a mark it returns the mark's path as a `set-overlay` `line` with `interactive: true, projectable: true` and `order`, plus `set-data` for the current position. On `preview` and `commit` with `geometry.projection` it returns the same two ops for the pointer's position. `intrinsicDomain` on the x and y fields holds the axes still across the swaps. | -| Freehand stroke | draw | The rows to guess form their own series, and a mount update sets `opacity: 0` on that series, which keeps the axis. `lassoTrigger('contain', false)` with `plot: { cursor: 'draw' }` is the pen: `geometry.domain.points` become the rows of a `set-overlay` line. An `externalInteraction` reveals the truth as an overlay, then the host clears the hide. | -| Chart-level zoom | wheel | When the layout itself must change (bar step, ticks, domain), filter the rows and `mountChart` again in a hidden layer; swap on `ready`. No preset re-lays out. | -| Semantic zoom on a map | navigate | A Choropleth with `level: 'auto'` (US states, then counties) or with your own `levels: [{ value, url, feature?, enter?, exit? }]` (one GeoJSON or TopoJSON object per level, rows joined on the feature `id` or `featureKey`, `baseMapUrl` drawn beneath as land without data), or a Map with `levelField` and `levels`; `navigate()`, and `set-viewport { region: { key } }` with a `transition` to fly into a region. Navigation events carry `geometry.domain.level` and `focus` (the coarsest region under the centre). A hover reaches the host through a hover affordance (`hover: 'target'`); a handler that returns `null` leaves the map as drawn. | - -Host-drawn detail, the shape of it: -```ts -const probe: CanvasInteractionDef = { - id: 'probe', - eventSource: { ...hoverTrigger, defaultAssistDistance: 28 }, - affordances: { mark: { hover: 'target' } }, - handle() { return null; }, -}; -container.addEventListener('flint-interaction', (e) => { - const { interactionId, event } = (e as CustomEvent).detail; - if (interactionId !== 'probe' || event.phase !== 'preview') return; - const row = event.target?.elements[0]?.records?.[0]; - if (row) lens.show(row); // the host draws; the chart is unchanged -}); -``` +Fix or drop what it warns about. ## Update the chart -### Step 1 — read the state - -A host hands the model the chart input and the state, as text or as data. The -MCP chart view does this after every build (first mount, new `updates`, a -panel edit) and every committed gesture, and each send replaces the last: - -``` -Chart "Life expectancy": Line Chart, theme economist. -Edited in panel: theme default → economist. -Encodings: x = year, y = life, color = continent. -Interactions: legend-toggle, navigate. -Agent updates (yours): -- asia: - ✓ emphasizes 3 marks where continent = Asia -- oceania: - ✗ emphasizes marks where continent = Oceania: no row has continent = Oceania. -User interactions: -- Hidden: Africa. -The y axis shows life from 70 to 86. -``` - -The state is in field terms: what the chart is after the reader's panel edits, -each op of your updates as applied (✓) or not and why (✗), what the reader -selected, hid or filtered, and the viewport on view when the chart navigates. -`validate_chart` and `show` return the same report before the -reader touches the chart, with `User interactions: none.` From it, decide what the -reader should see next: which rows stand out, what one note says, which range -frames them. The rows you were given are the source of every value; the chart -hands over no copy of the data, and nothing is computed that the chart cannot -verify. - -### Step 2 — choose ops - -Every change from outside is one update, `{ id, ops }`. Each op does one kind -of thing: +A chart opens clean. `updates` add the agent's own marks to it only for one +of these reasons; without one, what the agent wants to say goes in its reply. + +1. **The user asks for marks on the chart.** They name one ("label the peak", + "highlight Japan", "a line at $3", "shade the recession"), or describe a + chart that has to tell its point on its own ("for a slide"). +2. **The user asks about a chart already on screen.** The answer points at + the chart: emphasise the rows, note the value, frame the range. +3. **A requested interaction needs a starting state.** "Look at one year, + then slide along" opens on that year with `set-viewport`. +4. **A concrete question, pointed at lightly**, as below. + +### Muted annotations + +A question about particular values (a peak, a value at a date, a difference, +a crossing, a threshold, which items pass one) may point at its answer +without being asked. An overview question ("how did it move", "is there a +relationship") gets none. + +- **The title says it; the annotation points.** The answer is in the title + (and the reply). On the chart, only what directly answers the question: one + mark, two for a difference or a crossing, one span, or one small set. +- **A label names what it points at.** A few words that still mean something + on their own: the value and what identifies it ("$5.01 · Jun 13, 2022", + "China 26, Russia 23"). Not a bare tag ("Peak", "Max"), not a sentence, not + a repeat of the title or of a value label the chart already prints. +- **Room decides the form, not the chart type.** Where there is open space + beside the answer, a short label. Where marks fill the space round it (a + full grid of cells, a dense cluster, a bar that already prints its value), + the highlight alone: `annotate-text` with `text: ""` draws the ring or + outline and no caption. Many answers (more than three or four) get emphasis + with no labels, and the list goes in the reply. +- **Light forms.** A mark: `annotate-text` with the default `highlight: + 'light'`, or `'strong'` for an outline. A span or band: one + `annotate-region` under the marks, low opacity, a caption only when the + title does not give the range and the plot has room above it. A small set: + `set-style` with `state: 'emphasized'`, `emphasis: 'light'`, or an outline + per member. A clear cluster: one `annotate-enclosure`, no caption when the + legend names it. A value the question names: a plain `set-overlay` rule. +- **The answer is in view.** A pointer on a mark the reader cannot see is + nothing. On a chart that scrolls or opens zoomed (a long heatmap, a wide + calendar), narrow the data to the stretch that holds the answer, or open + the viewport on it. +- **Not muted:** notes that tell a story, several shaded episodes, context the + question did not ask about, `strong` or `exclusive` emphasis. Those need an + ask (reason 1). + +Text and paint come from the theme: notes take its annotation type, rings, +outlines and enclosures its `interaction.highlight`. Set them per update +(`value.style`, `value.highlightStyle`) only when the user asks. + +### The state + +After every build and every committed gesture, the MCP chart view sends the +agent the card's state in field terms: the chart after the reader's panel +edits, each op of your updates as applied (✓) or not and why (✗), what the +reader selected, hid or filtered, and the viewport. Read it before writing, +so an update does not undo what the reader set. The rows you were given are +the source of every value; nothing is computed that the chart cannot verify. + +### Ops | Op | It is for | Effect | Shape | Needs | | --- | --- | --- | --- | --- | -| `set-style` | The marks the chart already draws: emphasize some, fade some, hide some, recolour some. A highlight is this op with `state: 'emphasized'`. | Emphasize the targets and mute the rest; recolour; fade; hide. | `{ op, targets: UpdateTarget[], value: StyleSpec }` | marks | -| `set-annotation` | One mark that should carry a note. | Pin a note on one mark; `null` clears it. | `{ op, target: UpdateTarget, value: { text, anchor?: 'segment' \| 'point' } \| null }` | one resolved element | +| `set-style` | The marks the chart already draws: emphasize some, fade some, hide some, recolour some. A highlight is this op with `state: 'emphasized'`. | Emphasize the targets and recede the rest; recolour; fade; hide. `emphasis` sets how far the rest recede: `'light'` (default; they stay readable), `'strong'`, `'exclusive'` (only the targets read). | `{ op, targets: UpdateTarget[], value: StyleSpec }` | marks | +| `annotate-text` | One mark, a stretch of a line or area, a leg of a map route (`visual: { kind: 'path' }` on the row it leaves from), a slice or a region that should carry a note. | Set a caption beside it: plain words haloed in the page, a leader only where needed, never a card; `null` clears it. `highlight` marks what it names: `'none'`, `'light'` (default), `'strong'`, `'exclusive'` (the rest recede, so no separate `set-style` emphasis is needed). The caption takes the theme's annotation type (else the axis labels' face a size up); `style` sets one note's `fontSize`, `fontWeight` or `color`; `highlightStyle: { color, width }` its ring or outline, over the theme's `interaction.highlight`. `text: ""` draws the highlight alone (an outline or ring, no caption); with `text` omitted the chart words the note itself. For a boxed callout use `set-overlay` or `set-freeform-overlay`. `set-annotation` is its deprecated name; do not write it. | `{ op, target: UpdateTarget, value: { text, anchor?: 'segment' \| 'point', highlight?, style?: { fontSize?, fontWeight?, color? }, highlightStyle?: { color?, width? } } \| null }` | one resolved element | +| `annotate-region` | A stretch of the plot: a period, a band of values, a box, a run of categories. | Shade it, with an optional caption set on it; `null` clears it. | `{ op, name, value: { x?: [lo, hi] \| categories, y?: [lo, hi] \| categories, text?, color?, opacity?, layer?: 'under' \| 'over', placement?: 'top' \| 'bottom' \| 'left' \| 'right' \| 'center' \| 'above' \| 'below' } \| null }`; on a map `longitude: [west, east], latitude: [south, north]` in place of x and y | x or y scales, or a map (not a pie or radar) | +| `annotate-enclosure` | A group of marks that belong together: a cluster, a run of bars, a block of cells. | Outline each target group; one optional caption shared by them, with leaders to two or three outlines; `null` clears it. | `{ op, name, value: { targets: UpdateTarget[], text?, shape?: 'hull' \| 'rect' \| 'ellipse' \| 'circle', connect?: 'auto' \| 'all' \| 'none', color?, width? } \| null }` | marks | | `set-viewport` | The range or region the chart should frame. | Frame a continuous domain. | `{ op, axes: 'x' \| 'y' \| 'xy', value: { x?: [lo, hi], y?: [lo, hi] } }`; on a multi-level map `value: { region: { key } }` | `navigate` or `brush-zoom` mounted on that axis | | `set-order` | The order of the categories on a discrete axis. | Reorder the axis; list every category in the order wanted. | `{ op, scope: 'category', field, values: unknown[] }` | `drag-reorder` mounted on that axis | -| `set-overlay` | Marks the chart does not draw: a reference line, a threshold band, a forecast, a sketch of rows. | Draw new rows through the plot's own scales. | `{ op, name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2?, order?, color?, text? }, role, interactive?, projectable?, style? } \| null }` | x and y scales | +| `set-overlay` | Marks the chart does not draw: a reference line, a threshold band, a forecast, a sketch of rows. | Draw new rows through the plot's own scales. | `{ op, name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2?, order?, color?, text? }, role, interactive?, projectable?, style? } \| null }`; on a map `longitude`, `latitude` (and `longitude2`, `latitude2` for a rule or rect) in place of x and y | x and y scales, or a map | | `set-freeform-overlay` | A custom shape with no data behind it. | Draw SVG, or a clone of marks, over the plot. | `{ op, name, value: { coordinateSpace: 'plot' \| 'renderer', body: [{ type: 'svg', content } \| { type: 'clone', targets, transform?, opacity? }] } \| null }` | — | | `set-data` | The rows the chart draws, for playback or a swap. | Replace every row; the rows carry every encoded field. | `{ op, source: 'main', value: { rows } }` | inline data | -`StyleSpec` is `{ state?, opacity?, visible?, fill?, stroke?, strokeWidth?, -mutedOpacity? }`. Two states matter from outside: `emphasized` keeps the -targets at full ink and mutes every other mark; `normal` with `targets: []` -clears the layer. `opacity` on the targets fades a subset and leaves the rest -alone; `opacity: 0` hides marks and keeps the axes, where `visible: false` -removes the rows and shrinks the scales. The mute level is one per chart, -fixed at mount from the lowest `mutedOpacity` the mounted interactions carry -(0.25 when none). +`StyleSpec` is `{ state?, emphasis?, opacity?, visible?, fill?, stroke?, +strokeWidth?, mutedOpacity? }`. Two states matter from outside: `emphasized` +keeps the targets at full ink and recedes every other mark by `emphasis` +(`'light'` by default, `'strong'`, `'exclusive'`; `mutedOpacity` sets the level +outright); `normal` with `targets: []` clears the layer. `opacity` on the +targets fades a subset and leaves the rest alone; `opacity: 0` hides marks and +keeps the axes, where `visible: false` removes the rows and shrinks the scales. Overlay marks are `line`, `point`, `rule`, `rect`, `text`. `encodings` name fields of the overlay's own rows, projected through the chart's x, y, and -colour scales. `style` takes `stroke`, `strokeWidth`, `strokeDash`, `fill`, -`fillOpacity`, `opacity`, `pointRadius`, `fontSize`, `fontWeight`, `textAlign` +colour scales. `style` takes `stroke`, `strokeWidth`, `strokeDash` (lengths, or +`'dash'` / `'dot'`), `fill`, +`fillOpacity`, `opacity`, `pointRadius`, `fontSize`, `fontWeight`, `fontStyle` (`italic`), `textAlign` (`start`, `middle`, `end`), `dx`, `dy`. A `line` takes its stroke and a `text` its fill from the `color` encoding; a `point` takes `style.fill`. A `text` sits on the data, so it draws a halo in the chart's background; `stroke` sets another @@ -562,7 +266,7 @@ what the chart shows and is not a frame. Legend values belong to `legend-toggle`: no update hides or restores one, and a series fades with `opacity` instead. -### Step 3 — name targets and values +### Targets and values A target is one of three forms: @@ -575,8 +279,18 @@ A target is one of three forms: - A `where` describes a set, in the words filters use: each field `in` a list or within a `range` (ends included; `null` leaves an end open), and every field must hold. Use it for a period, a band of values, or several categories - at once, where a key would need one target per row. Only `set-style` takes a - `where`; a note or an order names one mark, so it takes a key. + at once, where a key would need one target per row. `set-style` and an + enclosure's targets take a `where`; a note or an order names one mark, so it + takes a key. +- Use the annotation ops to put a message on the chart: a note + (`annotate-text`) on a mark, a shaded region (`annotate-region`) over a + stretch of the plot (two bounds on a continuous axis, `null` for the plot's + end, or adjacent categories on a banded one), or an outline + (`annotate-enclosure`) round a group of marks, each with optional text. + Leave colour, shape and placement to the chart unless the request names + them. A note marks its own target through `highlight`; do not pair it with + a `set-style` emphasis to make the mark stand out. A stretch of a line or + area that spans a period is a region, not a note on one segment. - A selector key names fields the chart encodes (`x`, `y`, `color`, `detail`, `size`, …) and matches rows by equality, so `'2007'` and `2007` differ. One @@ -589,6 +303,10 @@ A target is one of three forms: a change from one row to the next ("2019 → 2020: +4%"); `anchor: "point"` marks the row's own point, for its value ("Dec 2022: $0.87B"). A note on the last row is always at its point. +- Annotation text says what the chart does not ("Promotion launched", "Lowest + in Q3"), not a value or label it already prints (`note_repeats_chart`). The + title states the finding; a note puts its specifics on the mark, and names + the mark where the chart does not (a dot on a scatter). - A field the chart does not encode resolves to nothing. Encode the identity field (`detail` on a scatter), or pass elements from `event.target`, `state.selected`, or `context.available` through as `{ visual, elements }`, @@ -622,7 +340,7 @@ reported as unsupported. ] } ``` -### Step 4 — send the layer and read the result +### Layers **Ids are layers.** One id holds one concern: the agent's update, a story step, a linked selection. Use one stable id, such as `agent`, and send the @@ -644,17 +362,11 @@ whole layer each time: - After `set-data` the marks are new; a style layer is sent again with the data. -**The result.** `applyUpdate`, `setUpdates`, and `dispatch` return a -`ChartUpdateResult`: `{ status: 'applied' | 'partially-applied' | -'unsupported', resolvedTargets, unresolvedTargets, unsupportedOps }`. An -unresolved target has a wrong field or value; an unsupported op needs a -preset the chart does not mount. What the chart shows is what the result says -it shows: fix an unresolved key or drop an unsupported op before describing -the chart. +### Send it -**From the MCP view.** There is no `applyUpdate` to call. Pass the same layers -as the `updates` argument beside the chart input, not inside it, to -`validate_chart` and then to `show` as part of `chart`: +Pass the layers as `updates`, a key of the chart input beside `data` and +`chart_spec` (not inside `chart_spec`), to `show` as part of `chart`, or to +`validate_chart` for the report without a card: ```json { @@ -663,7 +375,7 @@ as the `updates` argument beside the chart input, not inside it, to "updates": [ { "id": "agent", "ops": [ { "op": "set-style", "targets": [{ "select": { "key": { "region": "East" } } }], "value": { "state": "emphasized" } }, - { "op": "set-annotation", "target": { "select": { "key": { "region": "West" } } }, "value": { "text": "Lowest in Q3" } } + { "op": "annotate-text", "target": { "select": { "key": { "region": "West" } } }, "value": { "text": "Lowest in Q3" } } ] } ] } @@ -677,252 +389,15 @@ each stays where it is. The reader's own brush or selection does not survive the new view; the context message reports it in field terms, and it is carried as a layer when it still serves the reader. -Check the input and `updates` with `validate_chart` first. A malformed layer -or an invalid spec is an error, and `show` draws nothing for it. Otherwise the -result is the report above, one line per op, led by a count when an op did not -apply. The chart draws without a ✗ op: fix it in the layer (a key no row has, +A malformed layer or an invalid spec is an error, and `show` draws nothing +for it. Otherwise the report lists each op that will not apply, and why, led +by a count. The chart draws without a ✗ op: fix it in the layer (a key no row has, an overlay encoding written as `"x": "start"` instead of `{ "field": "start" }`, a viewport with no navigation preset) before you call `show`, or tell the reader what is missing. The reader's later brushes and clicks reach you with their next message, not in the same turn. -## Use Flint in an application - -### Mount - -```bash -npm install flint-chart vega vega-lite vega-tooltip -``` - -```ts -import { mountChart, navigate, legendToggle } from 'flint-chart/interactive'; - -const surface = mountChart(container, input, { - backend: 'vegalite', - renderer: 'svg', - interactions: [navigate({ axes: 'x' }), legendToggle()], - chartId: 'sales', -}); -await surface.ready; -const warnings = await surface.warnings; // interactions the chart could not honour -// … -surface.destroy(); -``` - -| Member | What it does | -| --- | --- | -| `ready`, `warnings` | Promises: the first render; the dropped or yielded interactions. Every call below waits for `ready` itself. | -| `applyUpdate(update, options?)` | Retains one update by id; replaces the layer with the same id. `options.transition.duration` animates a viewport. | -| `setUpdates(updates)` | Replaces every retained update. | -| `clearUpdate(id)` | Removes one layer. | -| `dispatch(id, payload)` | Runs an `externalInteraction` handler and applies what it returns. | -| `getState()` | What the chart shows now; `undefined` before `ready`. | -| `onChange(callback)` | Every change to that state, after the render; returns the unsubscribe. | -| `layout` | Once ready: `plot`, the plot box `{ width, height }` on a chart that draws one plot; `views`, each drawn view as `{ role, box: { x, y, width, height } }` (role `plot`, `text`, `tile` or `rule`; facet panels row by row); `block`, the box the views take with their axes and headers, without title and keys. Boxes are in pixels from the drawn chart's top left, read from what it drew, so they follow filters and resizes. `undefined` on charts with a category rail and on non-Vega-Lite backends. | -| `refresh()` | Re-projects overlays after the host rescales the chart. | -| `element`, `chartId` | The mount's root and the stable chart id. | -| `destroy()` | Removes listeners, the renderer, and the DOM. | - -- `input` is a `ChartAssemblyInput`. Presets go in `input.interaction_spec` as - JSON or in `options.interactions` as factory calls. Both may appear; spec - entries mount first, and a code definition with a spec entry's `id` - replaces it with an `interaction_overridden` info warning. -- A malformed `interaction_spec`, a repeated code `id`, or a code definition - the chart cannot honour fails the mount with an error that names it. A spec - entry the chart cannot honour is dropped with a warning instead. -- `options.availableSize: { width?, height? }` is the room the host gives the - chart. It becomes the `canvasSize` ceiling on the sides given, so the chart - lays out for that room rather than being scaled into it. -- `options.updates` holds retained updates present at the first render, for a - chart that starts with a part hidden or framed. -- `renderer: 'svg'` for charts whose marks a host reads from the DOM, or under - a few thousand marks; `'canvas'` for maps and dense charts. -- A `Year` or `Date` field makes a temporal axis whose rows hold `Date`s or - ISO strings; a bare number such as `2013` reads as milliseconds after 1970. - A `semantic_types` entry may be an object, - `{ semanticType, intrinsicDomain: [lo, hi] }`; the intrinsic domain holds an - axis still while the rows change. -- `options: { addTooltips: false }` on the input is the switch for the - tooltip, for a chart whose hidden values it would give away. -- Build with a bundler. The interactive entry reaches every backend through - lazy imports with no file extension; when `echarts`, `chart.js`, and - `plotly.js-dist-min` are not installed, mark them external (esbuild - `--splitting --external:echarts --external:chart.js --external:plotly.js-dist-min`; - Vite `build.rollupOptions.external`). -- In React, use `` from `flint-chart/react` rather than mounting - in an effect; see "In React" below. - -### In React - -```tsx -import { FlintChart, type FlintChartHandle } from 'flint-chart/react'; -import { clickHighlight } from 'flint-chart/interactive'; - -const chartRef = useRef(null); - - setSelected(change.state.selected)} - onError={(error) => report(error)} -/>; -``` - -| Prop | What it does | -| --- | --- | -| `spec` | The `ChartAssemblyInput`, `interaction_spec` included. A change of content remounts; rows compare by reference. | -| `interactions` | Factory calls added to the spec's entries, or `(fromSpec) => definitions` for the full list. A factory rebuilt with the same id and options keeps the chart; a changed option remounts it. | -| `updates` | Host updates, diffed by id. Passing even `[]` mounts the runtime on a chart with no interactions. | -| `width`, `height`, `fit` | The box. `fit` is `scale-down` (default; never scales up), `crop` (natural size, clipped), or `relayout` (the box becomes the layout room; a resize remounts once it settles, so a selection does not survive it). | -| `onChange`, `onInteraction` | The state after a change, and the raw gesture record. | -| `onRender`, `onWarnings`, `onError` | Each mount's render and warnings; a failed mount, shown in the box as a muted error. | -| `fallback` | Shown until the chart mounts. | -| `ariaLabel`, `chartId` | `ariaLabel` applies in place; a new `chartId` remounts. | - -The ref's `FlintChartHandle` holds `surface` (the mounted surface or `null`), -`applyUpdate`, `clearUpdate`, `dispatch`, `getState`, and `refresh`. A remount -keeps the old chart on screen until the new one is ready. - -### Read the chart - -| `getState()` field | Holds | -| --- | --- | -| `selected` | The marks the chart emphasizes now, previews included. | -| `entries` | The same marks per update id, with `layer: 'retained' \| 'preview'`. | -| `hidden` | Legend values a `legend-toggle` hides, as `{ channel, value }`. | -| `viewport` | The domain on view after a pan or zoom; absent on a chart that does not navigate. | -| `categoryOrder` | The order of the reorderable axis now. | -| `windows` | Category rail windows, `{ start, count, total }` per channel. | - -Each element's `value` is the mark in field terms: a bar's category and -measure, a legend item's `{ channel, field, domain }`, a histogram bar's -`{ field, range }`. The host owns the rows and queries them from the value and -the geometry. - -`onChange` fires after every render with a `ChartChange`: `phase` (`preview` -while a gesture runs, `commit` for a committed change or a host call, `cancel` -when a gesture ends with nothing), `interactionId` and `action` (absent for a -host call and for a reset), the gesture's own `target` and `geometry`, and the -`state` after. An overlay or a data swap leaves no trace in the state, so the -host keeps that model itself. - -```ts -const valuesOf = (elements: readonly SemanticElement[]) => elements.map((element) => element.value); - -// A panel follows the gesture live, else shows what the chart shows. -surface.onChange(({ phase, target, state }) => { - const hit = valuesOf(target?.elements ?? []); - panel.show(phase === 'preview' && hit.length > 0 ? hit : valuesOf(state.selected)); -}); - -// An agent context reads committed state only: values and ranges, never rows. -surface.onChange(({ phase, state, geometry }) => { - if (phase !== 'commit') return; - sendContext({ selected: valuesOf(state.selected), range: geometry?.domain, hidden: state.hidden, viewport: state.viewport }); -}); -``` - -The container also emits a bubbling DOM event, `flint-interaction`, for every -canvas interaction, before the chart reacts: `detail.chartId`, -`detail.interactionId`, and `detail.event`, the same `CanvasInteractionEvent` -a handler gets. It fires for a definition whose `handle` returns `null`, so it -is the path for a host that draws its own response to a gesture. - -Things the surface holds fixed: no preset changes the layout, so a zoom never -recomputes the bar step, the ticks, or the domain (filter the rows and mount -again for that); the mute level is set at mount; Escape reaches a chart after -a press on it, and only that chart; a preset's toggle (`select`, -`click-highlight`) needs Shift, Ctrl, or Meta, and a plain second click -replaces; a press on an overlay path resolves to no mark, so a `click-none` -reset on the definition that drew the overlay clears it at that press. - -## Link charts - -`linkCharts` links mounted charts on the fields they share. A selection on one -chart (a click, a brush, a group focus, a hover) becomes one condition, a part -per field; every chart emphasizes the marks that meet it, the source included, -through one `linked-selection` layer; a reset on any chart clears it everywhere. - -```ts -import { linkCharts, mountChart, clickHighlight, brushX } from 'flint-chart/interactive'; - -const link = linkCharts({ - bars: { input: barsInput, surface: mountChart(barsEl, barsInput, { backend: 'vegalite', interactions: [clickHighlight()] }) }, - trend: { input: trendInput, surface: mountChart(trendEl, trendInput, { backend: 'vegalite', interactions: [brushX()] }) }, -}, { fields: ['region', 'month'] }); -for (const [id, chart] of Object.entries(await link.links)) console.log(id, chart.notes); // what each chart left out -link.onCondition(({ condition }) => table.filter(condition)); // { region: { in: ['Asia'] }, month: { range: [start, end] } } -// link.clear(); link.destroy(); -``` - -**A table, a filter or any control beside linked charts** joins the same -condition: `link.select(parts)` sets parts as if a chart had selected them, and -`onCondition` gives the table what to show. One condition, so a row click, a -region picker and a brush combine (AND) and a reset on any chart clears them all. - -```ts -row.addEventListener('click', () => link.select({ country: { in: [row.dataset.country] } })); -regionPicker.addEventListener('change', (e) => link.select({ region: e.target.value ? { in: [e.target.value] } : null })); // null lets go -link.onCondition(({ condition }) => renderTable(rows.filter((r) => meets(r, condition)))); -``` - -- `select` only takes fields in `fields`; a chart shows a part when its marks - carry the field (encode it, or put it on `detail`). -- The link emphasizes the matching marks; to drop rows instead (a filter), give - the charts filtered data as below. - -```tsx -import { FlintChart, useLinkedCharts } from 'flint-chart/react'; - -const link = useLinkedCharts({ bars: barsInput, trend: trendInput }, { fields: ['region', 'month'] }); -; -// link.select({ region: { in: ["Asia"] } }) from a table or control; link.clear() -; -// the chart's own onChange, onRender and updates go through chart(id, own); a prop after the spread replaces the link's -// link.condition.condition is the same condition; filtered rows in `spec` keep it -``` - -- A chart receives a field when its marks carry it (encode it, on `detail` if - nothing else shows it), and sends through each selecting interaction whose - subject includes a connected field. `{ charts: { trend: { receive: false } } }` - keeps a chart as drawn; `send: false` keeps its selections to itself. -- The link emphasizes; it never filters or re-aggregates. To filter, read the - condition (`onCondition`, `link.condition`) and give each chart its rows: - beside `linkCharts`, a `set-data` update (a new spec remounts the chart, and - the link holds the old surface); beside `useLinkedCharts`, a `spec` with the - filtered rows. -- `setUpdates` replaces every layer, the link's included, until the condition - next changes; use `applyUpdate` and `clearUpdate` beside a link. -- `linkCharts` checks the charts with the validator, loaded on first use; pass - `{ links }` from `validateLinks` (`flint-chart/validate`) to skip that load. - -For a link `linkCharts` does not express (a payload each chart reads its own -way), wire `onChange` to an `externalInteraction` on the other charts: - -```ts -const linked = externalInteraction<{ countries: string[] }>({ - id: 'linked', - handle: ({ countries }) => ({ - id: 'linked', - ops: [{ op: 'set-style', targets: [{ select: { where: { Country: { in: countries } } } }], value: { state: 'emphasized' } }], - }), -}); -source.onChange(({ phase, interactionId, state }) => { - if (phase !== 'commit' || !interactionId) return; // host writes carry no id: no loop - void other.dispatch('linked', { countries: state.selected.map((element) => String(element.value.Country)) }); -}); -``` - -Linked charts share one `theme_spec` so a value has one colour everywhere. - -The same `dispatch` drives a chart over time: a playback loop dispatches one -frame per animation frame, and the handler returns the whole layer for that -frame. - ## Worked examples In each example `data` is a placeholder; the host binds real rows. @@ -958,61 +433,24 @@ different trigger, a click on a bar and a drag on an axis label. } ``` -### Presets: a multi-series line chart in an explore session - -User: "Help me understand how these three regions moved." The chart: - -```json -{ - "data": { "values": [] }, - "semantic_types": { "month": "YearMonth", "sales": "Amount", "region": "Region" }, - "chart_spec": { "chartType": "Line Chart", "encodings": { "x": { "field": "month" }, "y": { "field": "sales" }, "color": { "field": "region" } } } -} -``` - -The reader compares the series at one month, hides a region, and points at a -period. `inspect-index` reads every series at one month; `legend-toggle` has a -colour field to work with; `brush-x` focuses a period. `inspect-index` with -`show: "all"` asks for no legend click, so it sits beside `legend-toggle`. - -```json -{ - "interactions": [ - { "type": "inspect-index" }, - { "type": "legend-toggle" }, - { "type": "brush-x" } - ] -} -``` - -### Presets: a chart that drives the app +### Presets: comparing a few series -User: "In my dashboard, a click selects the country and a double-click opens -its page. Zooming the y axis would help too." A scatter of `gdp` by `life` -with `color: continent` and `detail: country`. +User: "Make this interactive so I can compare the three regions month by +month." A line chart of `sales` by `month`, `color: region`. -`navigate` holds the double-click by default for its reset, and -`double-activate` needs it; `reset: ["escape"]` frees it. `click-highlight` -takes `targets: ["mark"]` so the app's selection comes from marks only. +The user asks for behaviour and names the job: comparing the series at one +month. `inspect-index` reads all three at the month under the pointer, which +the tooltip (one line at a time) does not. Nothing else was asked for. ```json -{ - "interactions": [ - { "type": "click-highlight", "options": { "targets": ["mark"] } }, - { "type": "double-activate" }, - { "type": "navigate", "options": { "axes": "y", "reset": ["escape"] } } - ] -} +{ "interactions": [ { "type": "inspect-index" } ] } ``` -The app reads the selection from `onChange` on a `commit` whose `action` is -`click-element`, and the activation from one whose `action` is -`double-activate-element`. - ### ChartUpdate: an agent points out rows -User: "Which Asian countries are past 80 years? Point them out." The chart is -the scatter above, with `navigate` on `y`, and the state says nothing is +User: "Which Asian countries are past 80 years? Point them out." The chart on +screen is a scatter of `gdp` by `life` with `color: continent`, +`detail: country` and `navigate` on `y`, and the state says nothing is emphasized. The agent finds Japan and Singapore in its rows and answers: ```json @@ -1025,7 +463,7 @@ emphasized. The agent finds Japan and Singapore in its rows and answers: { "select": { "key": { "country": "Singapore" } } } ], "value": { "state": "emphasized" } }, - { "op": "set-annotation", + { "op": "annotate-text", "target": { "select": { "key": { "country": "Japan" } } }, "value": { "text": "Japan, 82.6 years" } }, { "op": "set-viewport", "axes": "y", "value": { "y": [70, 86] } } @@ -1037,50 +475,21 @@ emphasized. The agent finds Japan and Singapore in its rows and answers: `applied` with two resolved targets; a key with `"Country"` would come back unresolved, and the agent fixes the spelling before it describes the chart. -### Code: two linked charts - -Two bar charts share a `Country` field: GDP per country, and population per -country. A click on one emphasizes the same country on both. - -```ts -import { mountChart, clickHighlight, linkCharts } from 'flint-chart/interactive'; - -const mount = (el: HTMLElement, input: ChartAssemblyInput) => - ({ input, surface: mountChart(el, input, { backend: 'vegalite', interactions: [clickHighlight({ targets: ['mark'] })] }) }); -const link = linkCharts({ gdp: mount(gdpEl, gdpInput), population: mount(popEl, popInput) }, { fields: ['Country'] }); -``` - -The clicked chart drops its own emphasis once the link shows the condition, so -both charts show one selection. A `click-none`, Escape, or double-click on -either chart clears it on both; the link's own writes are host changes, so no -chart echoes them back. - -### Bespoke: a rule over the brushed box - -A line chart of `Series` by `Month`. The reader drags a box; the series whose -every point in that month range lies inside the y range stay emphasized. No -preset applies a rule over series, so the definition is the `timebox` above: -`rectangleTrigger('contain')`, a `plot` affordance with the `region` cursor, -a handler that acts on `select-region` at `commit`, and `reset: -['click-none', 'escape']` so a click on empty plot clears it. It mounts beside -`navigate({ pan: false })` when the chart also zooms, since both ask for the -plot drag otherwise. - ## Validation checklist For an `interaction_spec`: 1. It parses as strict JSON and is a bare object with `interactions`. -2. Every entry answers a job from Step 1: a gesture the user named, a - question their goal raises, or something the chart invites. +2. Every entry has a reason (the user asked, the chart is linked, or the data + needs it to be read) and a job the tooltip and legend do not do. 3. Every `type` is in the chart type's list from `list_chart_types`, and every option is under `options` with `id` on the entry. 4. `groupBy` and `seriesBy` are present where required, and name bound fields. 5. At most one entry owns the plot drag, the double-click, the legend click, and the retained mark focus. -6. `validate_chart` returns no warning. +6. The report notes no dropped or yielded entry. -For a `ChartUpdate`: +For `updates` or a `ChartUpdate`: 1. Every `op` and `state` is one from the op table. 2. Every selector key names encoded fields with values that exist in the rows. @@ -1090,16 +499,6 @@ For a `ChartUpdate`: and acted on. 5. The result came back `applied` before you said what the chart shows. -For code: - -1. Every trigger, cursor, and field name is one from this skill or the - installed `flint-chart/interactive` types. -2. Every definition declares `affordances` for the hits its trigger yields. -3. No two definitions, and no definition and spec entry, share a trigger or - an `id`. -4. The surface is destroyed on unmount, and every `applyUpdate` or `dispatch` - result is read. - ## Preset options `list_interaction_presets` returns every preset with what it needs from the @@ -1111,3 +510,4 @@ option: it sits on the entry. A `ResetGesture` is `click-none`, `double-click`, or `escape`. `dimOpacity` is the opacity of the muted marks, 0.25 by default. A `guide` is `{ visible?, style? }`, or `false` to draw nothing while the gesture runs. + diff --git a/packages/flint-mcp/assets/flint-theme-author.SKILL.md b/packages/flint-mcp/assets/flint-theme-author.SKILL.md index 8a4df70c..51a98737 100644 --- a/packages/flint-mcp/assets/flint-theme-author.SKILL.md +++ b/packages/flint-mcp/assets/flint-theme-author.SKILL.md @@ -219,6 +219,8 @@ the authored blocks and their jobs: `interaction.selectionBoundary` accepts `color`, `width`, `opacity`, `haloColor`, `haloWidth`, and `haloOpacity`. Omitted paint is grounded from the theme: foreground from `ink.accent` then primary text, and halo from the plot or canvas surface. Use explicit values only when the house has a distinct interaction treatment. +`interaction.highlight` accepts `color`, `width`, `haloColor`, and `haloWidth`: the paint of the ring round a dot, the outline round a bar, cell, slice or region an annotation names, and an enclosure's outline. Unset, they take the neutral annotation grey; an update's own `highlightStyle` (or an enclosure's `color` and `width`) overrides it. + This is a shape example, not a palette recommendation. Derive actual values from the user's references. diff --git a/packages/flint-mcp/package.json b/packages/flint-mcp/package.json index 19aff417..53bec49d 100644 --- a/packages/flint-mcp/package.json +++ b/packages/flint-mcp/package.json @@ -1,6 +1,6 @@ { "name": "flint-chart-mcp", - "version": "1.0.1", + "version": "1.1.0", "description": "Model Context Protocol server for Flint — compile, validate, and render semantic chart specs across supported backends.", "keywords": [ "mcp", @@ -69,7 +69,7 @@ "@resvg/resvg-js": "^2.6.2", "chart.js": "^4.4.0", "echarts": "^6.0.0", - "flint-chart": "^1.0.1", + "flint-chart": "^1.1.0", "vega": "^6.0.0", "vega-interpreter": "^2.2.1", "vega-lite": "^6.0.0", diff --git a/packages/flint-mcp/src/board.ts b/packages/flint-mcp/src/board.ts index 284a5582..063f2752 100644 --- a/packages/flint-mcp/src/board.ts +++ b/packages/flint-mcp/src/board.ts @@ -4,13 +4,12 @@ import { randomBytes } from 'node:crypto'; import { z } from 'zod'; import type { ChartAssemblyInput, ChartLink, ChartUpdate, LinkSpec, ValidateResult } from 'flint-chart'; -import { drawsAsTable, validateLinks } from 'flint-chart'; +import { drawsAsTable, isMeasureType, validateLinks } from 'flint-chart'; -import { ROW_UNITS, boardColumns, boardRows, colorField, gridItemFor, gridLines, gridProblem, isKpi, layoutLines, sharedColorOrders, type ChartLayout, type GridItem } from './board-layout.js'; +import { ROW_UNITS, boardColumns, boardRows, gridItemFor, gridProblem, isKpi, type ChartLayout, type GridItem } from './board-layout.js'; /** The characters of a chart title that fit on one line per row unit, at the card's heading size. */ const TITLE_CHARS_PER_UNIT = 7.5; -import { OPENS_AS_TABLE, chartContext } from './chart-context.js'; import { toAssemblyInput, updatesShape, viewShape, type AssemblyInputArgs, type ChartView } from './tools/schemas.js'; /** One chart on a board: the spec with its data inline, and the agent's update layers. */ @@ -37,6 +36,8 @@ export interface Board { source?: string; /** The theme of every chart that does not set its own. */ theme_spec?: ChartAssemblyInput['theme_spec']; + /** Colours bound to values, per field, on every chart that colours by the field; a chart's own win. */ + colors?: Record>; /** Board columns; two once the board holds two charts that are not KPI tiles. */ columns?: number; /** Where each chart sits, as the reader arranged it on a card; the rows of `columns` and `layout` without it. */ @@ -52,7 +53,7 @@ export interface Board { export type BoardChartArgs = AssemblyInputArgs & { id: string; updates?: ChartUpdate[]; layout?: ChartLayout; view?: ChartView }; /** The board fields a board spec sets around its charts. */ -export type BoardFields = Pick; +export type BoardFields = Pick; export const layoutShape = z .object({ @@ -67,6 +68,10 @@ export function boardFieldsShape(themeShape: z.ZodTypeAny) { subtitle: z.string().optional().describe('The deck: the data, its scope and period, e.g. "Monthly revenue by region and product, Jan–Sep 2025, $m".'), source: z.string().optional().describe('The footer: where the data comes from and when, e.g. "Source: company ledger, as of 30 Sep 2025".'), theme_spec: themeShape.describe('The theme of every chart that does not set its own; the card takes its fonts and colours. Prefer setting it here, once, over per chart.'), + colors: z + .record(z.string(), z.record(z.string(), z.string())) + .optional() + .describe('Colours bound to values, per field: { "Category": { "Jewelry": "#c0392b" } }. Every chart that colours by the field takes them (its own colors win); values left out take the palette. For one colour per value across the board, and across later turns: pass the same map again.'), columns: z.number().int().min(1).max(4).optional().describe('Board columns. Default: 2 once the board holds two charts that are not KPI tiles, else 1.'), }; } @@ -97,21 +102,26 @@ export const linkSpecShape = z }) .describe('How the charts on the board connect: by the fields they share. One selection holds at a time; a new one replaces the last.'); -/** The chart as the model reads it before it is drawn: the same report the drawn chart sends as its context. */ -export function chartReport(input: ChartAssemblyInput, updates: readonly ChartUpdate[] | undefined, result: ValidateResult): string { - const report = chartContext({ agent: input, shown: input, updates, checks: result.updates, warnings: result.warnings }).text; +/** What one checked chart has to say: its warnings and the update ops that do not apply. */ +export function chartFindings(updates: readonly ChartUpdate[] | undefined, result: ValidateResult): string[] { const ops = (result.updates ?? []).flatMap((check) => check.ops); const failed = ops.filter((op) => !op.ok).length; - if (failed === 0) return report; - return `${failed} of ${ops.length} update ops do not apply (✗ below); the chart draws without them. ` + - `Fix each one, or tell the user what is missing.\n${report}`; + const lines: string[] = []; + if (failed > 0) { + lines.push(`${failed} of ${ops.length} update ops do not apply; the chart draws without them. Fix each one, or tell the user what is missing.`); + } else if ((updates?.length ?? 0) > 0) { + lines.push(`All ${ops.length} update ops apply.`); + } + lines.push(...result.warnings.map((warning) => warning.message)); + return lines; } /** The outcome of one chart write: the chart drawn, or why it was not. */ export interface ChartOutcome { id: string; drawn: boolean; - text: string; + /** What the model should act on or tell the user; empty when there is nothing to say. */ + findings: string[]; } /** The chart input as the card draws it: the board's theme where the chart sets none. */ @@ -119,22 +129,42 @@ export function withBoardTheme(input: ChartAssemblyInput, board: Pick): ChartAssemblyInput { + if (!board.colors) return input; + const types = { ...(input.semantic_types ?? {}) } as Record; + let changed = false; + const encoded = new Set(Object.values(input.chart_spec.encodings ?? {}).flatMap((value) => [value].flat()) + .map((value) => (typeof value === 'string' ? value : (value as { field?: string } | undefined)?.field))); + for (const [field, colors] of Object.entries(board.colors)) { + if (!encoded.has(field)) continue; + const current = types[field]; + const annotation: Record = typeof current === 'string' ? { semanticType: current } : { ...((current as Record) ?? {}) }; + annotation.colors = { ...colors, ...((annotation.colors as Record | undefined) ?? {}) }; + types[field] = annotation; + changed = true; + } + return changed ? { ...input, semantic_types: types as ChartAssemblyInput['semantic_types'] } : input; +} + export async function prepareChart( args: BoardChartArgs, validate: Validate, - board: Pick, + board: Pick, ): Promise<{ chart?: BoardChart; outcome: ChartOutcome; errors?: string }> { const { id, updates, layout, view, fromFile: keptFromFile, ...rest } = args as BoardChartArgs & { fromFile?: true }; - const own = toAssemblyInput(rest as AssemblyInputArgs); + const own = withBoardColors(toAssemblyInput(rest as AssemblyInputArgs), board); // An update that leaves the data alone rebuilds from rows already read, so the file origin carries over. const fromFile = typeof own.data?.url === 'string' || keptFromFile === true; const { result, input } = await validate(withBoardTheme(own, board), updates); if (!result.valid) { const errors = result.errors.map((e) => e.message).join('; '); - return { errors, outcome: { id, drawn: false, text: `✗ not drawn: ${errors}` } }; + return { errors, outcome: { id, drawn: false, findings: [`✗ not drawn: ${errors}`] } }; } const opensAsTable = view === 'table' && !drawsAsTable(input.chart_spec.chartType); - const report = chartReport(input, updates, result) + (opensAsTable ? `\n${OPENS_AS_TABLE}` : ''); // The board's theme stays the board's, so the card's theme switch reaches every chart that set none. const stored = { ...input, theme_spec: own.theme_spec }; return { @@ -142,7 +172,7 @@ export async function prepareChart( id, input: stored, ...(updates ? { updates } : {}), ...(layout ? { layout } : {}), ...(opensAsTable ? { view } : {}), ...(fromFile ? { fromFile: true as const } : {}), }, - outcome: { id, drawn: true, text: report }, + outcome: { id, drawn: true, findings: chartFindings(updates, result) }, }; } @@ -157,18 +187,6 @@ function layoutCharts(board: Board) { return board.charts.map((chart) => ({ id: chart.id, chartType: chart.input.chart_spec.chartType, layout: chart.layout })); } -/** The board's layout as the card draws it on a wide card. */ -export function boardLayoutLines(board: Board): string[] { - if (board.grid) { - return [ - 'Arranged on a 12-column grid (grid), as the reader left it; keep passing it. Leave grid out to lay the charts out in rows again.', - ...gridLines(board.grid), - ]; - } - const charts = layoutCharts(board); - return layoutLines(boardRows(charts, boardColumns(charts, board.columns))); -} - /** * The arrangement a board spec passes, fitted to its charts: places of charts no longer on the board * are dropped and new charts take a place below the rest. An arrangement that still does not fit is @@ -206,9 +224,22 @@ function stackedRepeats(input: ChartAssemblyInput): string | undefined { const aggregated = Object.values(encodings).some((value) => typeof value === 'object' && value !== null && 'aggregate' in (value as object)); if (aggregated) return undefined; const rows = (input.data.values ?? []) as Record[]; - const fields = Object.values(encodings).map(fieldOf).filter((field): field is string => !!field); - const categories = fields.filter((field) => rows.some((row) => typeof row?.[field] === 'string')); - const measure = fields.find((field) => !categories.includes(field) && rows.some((row) => typeof row?.[field] === 'number')); + const fields = [...new Set(Object.values(encodings).map(fieldOf).filter((field): field is string => !!field))]; + // The measure is the one field typed as one; every other encoded field splits the marks, numbers + // included (a year, an edition). Untyped, text fields are the categories and a number the measure. + const typeOf = (field: string) => { + const annotation = input.semantic_types?.[field]; + return typeof annotation === 'string' ? annotation : annotation?.semanticType; + }; + // A heatmap's measure is its colour, whatever the colour field is typed as (match points, a score). + const heatColor = chartType === 'Heatmap' ? fieldOf(encodings.color) : undefined; + const typed = heatColor ? [heatColor] : fields.filter((field) => isMeasureType(typeOf(field) ?? '')); + const categories = typed.length === 1 + ? fields.filter((field) => field !== typed[0]) + : fields.filter((field) => rows.some((row) => typeof row?.[field] === 'string')); + const measure = typed.length === 1 + ? typed[0] + : fields.find((field) => !categories.includes(field) && rows.some((row) => typeof row?.[field] === 'number')); if (categories.length === 0 || !measure) return undefined; const keys = new Set(rows.map((row) => JSON.stringify(categories.map((field) => row?.[field])))); if (keys.size === rows.length) return undefined; @@ -216,14 +247,22 @@ function stackedRepeats(input: ChartAssemblyInput): string | undefined { return `draws ${rows.length} rows as ${keys.size} ${categories.join(' × ')} groups, so each mark is a stack of slices, one per row: sum the rows first, or set encodings.${channel}.aggregate to "sum".`; } -/** What the board should still fix to read well; each note says the fix. */ -export function boardReview(board: Board): string[] { +/** + * What the board should still change to read well, each note with its fix. `fix` holds what a board + * must not be drawn with (repeated rows drawn as slices); `noted` what the agent may change next time or + * tell the user, which the card draws with. + */ +export function boardReview(board: Board): { fix: string[]; noted: string[] } { + const fix: string[] = []; const notes: string[] = []; if (!board.title) notes.push('No board title: set title to what the board shows or is for, in words.'); if (board.title && board.title.length > 90) notes.push('The board title is long; keep it to one line and move the detail to subtitle.'); - if (!board.subtitle && board.charts.length > 0) notes.push('No subtitle: say the data, its scope, period and units.'); + const kpis = board.charts.filter((chart) => isKpi(chart.input.chart_spec.chartType)).length; + // Two charts side by side read from the board's title alone; a dashboard needs its deck and chart headings. + const dashboard = kpis > 0 || board.charts.length >= 3; + if (dashboard && !board.subtitle) notes.push('No subtitle: say the data, its scope, period and units.'); const untitled = board.charts.filter((chart) => !isKpi(chart.input.chart_spec.chartType) && !chart.input.chart_spec.title).map((chart) => chart.id); - if (untitled.length > 0) notes.push(`No title on ${untitled.join(', ')}: each chart draws its title as its heading; name what the chart shows.`); + if (dashboard && untitled.length > 0) notes.push(`No title on ${untitled.join(', ')}: each chart draws its title as its heading; name what the chart shows.`); const charts = layoutCharts(board); const units = new Map(boardRows(charts, boardColumns(charts, board.columns)).flatMap((row) => row.charts.map((cell) => [cell.id, cell.units] as const))); const long = board.charts.flatMap((chart) => { @@ -234,20 +273,17 @@ export function boardReview(board: Board): string[] { if (long.length > 0) notes.push(`Chart titles that wrap at their width: ${long.join(', ')}; shorten each to one line and move detail to its subtitle.`); for (const chart of board.charts) { const stacked = stackedRepeats(chart.input); - if (stacked) notes.push(`${chart.id} ${stacked}`); + if (stacked) fix.push(`${chart.id} ${stacked}`); } - const kpis = board.charts.filter((chart) => isKpi(chart.input.chart_spec.chartType)).length; - if (kpis > 6) notes.push(`${kpis} KPI tiles: keep the three to five numbers the reader acts on.`); - if (board.charts.length - kpis > 8) notes.push(`${board.charts.length - kpis} charts: a board reads best with up to six; split it or remove the least used.`); + const sized = board.charts.filter((chart) => chart.input.chart_spec.baseSize || chart.input.chart_spec.canvasSize).map((chart) => chart.id); + if (sized.length > 0) notes.push(`${sized.join(', ')} set baseSize or canvasSize: on a board each chart takes its cell's size, set by layout.span and layout.height, so these are not used.`); + if (kpis > 5) notes.push(`${kpis} KPI tiles: unless the user asked for them, keep the three to five numbers the reader acts on.`); + if (board.charts.length - kpis > 6) notes.push(`${board.charts.length - kpis} charts: unless the user asked for them, a board reads best with up to six.`); const themes = new Set(board.charts.map((chart) => JSON.stringify(chart.input.theme_spec ?? null)).filter((theme) => theme !== 'null')); if (themes.size > 1 || (themes.size === 1 && board.theme_spec !== undefined)) { notes.push('Charts set their own themes; set theme_spec once on the board and drop it from the charts so the board reads as one piece.'); } - for (const [field, values] of sharedColorOrders(board.charts.map((chart) => chart.input))) { - const users = board.charts.filter((chart) => colorField(chart.input) === field).map((chart) => chart.id); - notes.push(`${users.join(', ')} colour by ${field}; the card gives its ${values.length} values one order, so each keeps one colour across the board.`); - } - return notes; + return { fix, noted: notes }; } /** A theme as the model reads it: its preset id, a custom theme's label, or Flint's default. */ @@ -258,37 +294,6 @@ export function themeName(theme: ChartAssemblyInput['theme_spec'] | null): strin return custom.label ?? custom.id ?? (custom.extends ? `custom (${custom.extends})` : 'custom'); } -/** What the model reads once a chart or board is on screen. */ -export function shownText(board: Board): string { - return `The ${board.kind === 'chart' ? 'chart' : 'board'} is on screen in a new card. What the reader does on it reaches you with their next message. ` + - 'To change it, change the spec and call show again: a new card shows it, and earlier cards stay as they were.'; -} - -/** A chart or board as the model reads it: the checks of validate_chart or validate_board, or of show. */ -export function viewReport(board: Board, outcomes: readonly ChartOutcome[], notes: readonly string[] = [], shown = false): string { - const next = shown ? shownText(board) : 'Nothing is on screen: fix what this report asks in the spec, then call show with it.'; - if (board.kind === 'board') return boardReport(board, outcomes, notes, next); - return [next, ...notes, ...outcomes.map((outcome) => outcome.text)].join('\n'); -} - -function boardReport(board: Board, outcomes: readonly ChartOutcome[], notes: readonly string[], next: string): string { - const lines = [ - `Board${board.title ? ` "${board.title}"` : ''}: ${board.charts.length} chart${board.charts.length === 1 ? '' : 's'} (${board.charts.map((chart) => chart.id).join(', ') || 'none'}).`, - next, - ]; - if (notes.length > 0) lines.push('', ...notes); - if (board.charts.length > 0) lines.push('', 'Layout:', ...boardLayoutLines(board)); - for (const outcome of outcomes) { - lines.push('', `## ${outcome.id}`, outcome.text); - } - if (board.link_spec && board.linked) { - lines.push('', `Links (fields: ${board.link_spec.fields.join(', ')}; one selection the whole board shares):`, ...linkLines(board.linked)); - } - const review = boardReview(board); - if (review.length > 0) lines.push('', 'Review:', ...review.map((note) => `- ${note}`)); - return lines.join('\n'); -} - /** The board as the card reads it. */ /** * The largest board `show` also returns in structuredContent, in bytes of JSON. VS Code's agent @@ -334,6 +339,7 @@ export async function assembleBoard( ...(spec.subtitle !== undefined ? { subtitle: spec.subtitle } : {}), ...(spec.source !== undefined ? { source: spec.source } : {}), ...(spec.theme_spec !== undefined ? { theme_spec: spec.theme_spec } : {}), + ...(spec.colors !== undefined ? { colors: spec.colors } : {}), ...(spec.columns !== undefined ? { columns: spec.columns } : {}), ...(spec.grid ? { grid: spec.grid } : {}), charts: [], @@ -356,16 +362,3 @@ export type BoardSpec = BoardFields & { charts: BoardChartArgs[]; link_spec?: Li export const gridShape = z .array(z.object({ id: z.string(), x: z.number(), y: z.number(), w: z.number(), h: z.number() })) .describe('Where each chart sits on a 12-column grid, as the reader arranged it on a card; the card\'s context gives it. Leave it out for rows.'); - -/** The link as the model reads it: what each chart sends, by which interaction, and receives, and what is left out. */ -function linkLines(links: Record): string[] { - return Object.entries(links).map(([id, link]) => { - const sends = Object.entries(link.gestures).map(([gesture, info]) => `${info.fields.join(' + ')} by ${gesture}${info.hover ? ' (hover)' : ''}`); - const parts = [ - sends.length > 0 ? `sends ${sends.join(', ')}` : '', - link.receives.length > 0 ? `receives ${link.receives.join(', ')}` : '', - ].filter(Boolean); - const mark = link.sends.length === 0 && link.receives.length === 0 ? '✗' : '✓'; - return `${mark} ${id}: ${parts.join('; ') || 'not linked'}${link.notes.length > 0 ? `; ${link.notes.join('; ')}` : ''}`; - }); -} diff --git a/packages/flint-mcp/src/chart-context.ts b/packages/flint-mcp/src/chart-context.ts index 9e1e7bcd..ed1b524d 100644 --- a/packages/flint-mcp/src/chart-context.ts +++ b/packages/flint-mcp/src/chart-context.ts @@ -251,8 +251,11 @@ function opTargets(op: ChartUpdateOp): readonly unknown[] { switch (op.op) { case 'set-style': return op.targets; - case 'set-annotation': + case 'annotate-text': + case 'set-annotation': // deprecated name of annotate-text return [op.target]; + case 'annotate-enclosure': + return op.value?.targets ?? []; case 'set-freeform-overlay': return op.value?.body.flatMap((body) => (body.type === 'clone' ? body.targets : [])) ?? []; default: @@ -295,7 +298,7 @@ function updateLines( [text, ...more] = emphasisLines(values, undefined); } } - if (outcome.ok && op.op === 'set-annotation' && op.value) { + if (outcome.ok && (op.op === 'annotate-text' || op.op === 'set-annotation') && op.value) { const note = state?.annotations?.find((annotation) => annotation.id === update.id && JSON.stringify(annotation.target) === JSON.stringify(op.target)); if (note?.inView === false) text += OUT_OF_VIEW; diff --git a/packages/flint-mcp/src/cli.ts b/packages/flint-mcp/src/cli.ts index dade65fc..7b3ff436 100644 --- a/packages/flint-mcp/src/cli.ts +++ b/packages/flint-mcp/src/cli.ts @@ -48,7 +48,7 @@ Tools: Resources: flint://agent-skill, flint://theme-skill, flint://interaction-skill, - flint://board-skill, flint://chart-types, ui://flint-chart/view.html + flint://board-skill, flint://app-skill, flint://chart-types, ui://flint-chart/view.html Prompts: author_flint_chart, author_flint_theme, author_flint_interaction diff --git a/packages/flint-mcp/src/render/chartjs.ts b/packages/flint-mcp/src/render/chartjs.ts index 40f84308..1d8d0000 100644 --- a/packages/flint-mcp/src/render/chartjs.ts +++ b/packages/flint-mcp/src/render/chartjs.ts @@ -56,9 +56,13 @@ export async function renderChartjs( }; const chart = new Chart(canvas, merged); - chart.draw(); - const buffer = Buffer.from(canvas.toBuffer('image/png')); - chart.destroy(); + let buffer: Buffer; + try { + chart.draw(); + buffer = Buffer.from(canvas.toBuffer('image/png')); + } finally { + chart.destroy(); + } return { backend: 'chartjs', diff --git a/packages/flint-mcp/src/render/echarts.ts b/packages/flint-mcp/src/render/echarts.ts index 62b49045..6ceb31d3 100644 --- a/packages/flint-mcp/src/render/echarts.ts +++ b/packages/flint-mcp/src/render/echarts.ts @@ -36,9 +36,13 @@ export async function renderECharts( width, height, }); - chart.setOption(opt); - const svg = chart.renderToSVGString(); - chart.dispose(); + let svg: string; + try { + chart.setOption(opt); + svg = chart.renderToSVGString(); + } finally { + chart.dispose(); + } return svgToResult(svg, { backend: 'echarts', diff --git a/packages/flint-mcp/src/render/vegalite.ts b/packages/flint-mcp/src/render/vegalite.ts index 3cb6f532..5bcd3252 100644 --- a/packages/flint-mcp/src/render/vegalite.ts +++ b/packages/flint-mcp/src/render/vegalite.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { injectCanvasFurnitureSVG, readCanvasFurniture } from 'flint-chart'; +import { injectCanvasFurnitureSVG, readCanvasFurniture, withBundledBoundaries } from 'flint-chart'; import { CHART_FONT_FAMILY, installVegaTextMetrics } from './fonts.js'; import { svgToResult } from './svg.js'; import type { RenderResult, RenderFormat } from './types.js'; @@ -50,15 +50,20 @@ export async function renderVegaLite( const compiled = vegaLite.compile(vlSpec as any).spec; const runtime = vega.parse(compiled as any, { background: args.background } as any); - const view = new vega.View(runtime, { renderer: 'none' }); + // A map's boundaries come from the package's own copies, as the live card's do: nothing is fetched. + const view = new vega.View(runtime, { renderer: 'none', loader: withBundledBoundaries(vega.loader()) } as any); view.logLevel(vega.Error); - await view.runAsync(); - // A house may anchor branding to the graphic frame rather than the plot — - // the Economist's red masthead tab. Vega-Lite cannot express that, so the - // theme records the coordinates and the renderer paints it on afterwards. - // Done before rasterising, so the PNG carries it too. - const svg = injectCanvasFurnitureSVG(await view.toSVG(), readCanvasFurniture(spec)); - view.finalize(); + let svg: string; + try { + await view.runAsync(); + // A house may anchor branding to the graphic frame rather than the plot — + // the Economist's red masthead tab. Vega-Lite cannot express that, so the + // theme records the coordinates and the renderer paints it on afterwards. + // Done before rasterising, so the PNG carries it too. + svg = injectCanvasFurnitureSVG(await view.toSVG(), readCanvasFurniture(spec)); + } finally { + view.finalize(); + } // Vega's View width/height report the content box, excluding axes/legends. // The root SVG dimensions are the actual artifact dimensions used by resvg. diff --git a/packages/flint-mcp/src/report.ts b/packages/flint-mcp/src/report.ts new file mode 100644 index 00000000..2f111f61 --- /dev/null +++ b/packages/flint-mcp/src/report.ts @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { ChartLink } from 'flint-chart'; +import { boardColumns, boardRows, gridLines, layoutLines } from './board-layout.js'; +import { boardReview, type Board, type ChartOutcome } from './board.js'; +import { isKpi } from './board-layout.js'; + +/** + * What validate_chart, validate_board and show tell the model about a spec: only what it should act + * on or tell the user. The spec itself is not repeated; the drawn card's context reports what is on screen. + */ + +/** What the model reads once a chart or board is on screen. */ +export function shownText(board: Pick): string { + return `The ${board.kind === 'chart' ? 'chart' : 'board'} is on screen in a new card. What the reader does on it reaches you with their next message. ` + + 'To change it, change the spec and call show again: a new card shows it, and earlier cards stay as they were.'; +} + +const TO_FIX = 'Nothing is on screen: fix what this report lists, then call show with the whole spec.'; +const CLEAN = 'Nothing to fix: call show with this spec.'; +/** The head of a report held back by show: the card says it is being revised, and the model gets the fixes. */ +export const HELD = 'Not drawn yet: fix what this report lists, then call show again with the whole spec.'; +const FIX_HEAD = 'Fix before it draws:'; +const NOTED_HEAD = 'Noted (the card draws with these; change nothing now unless the user asks, and mention what matters in your reply):'; + +/** What a report says, split: what keeps a chart or board from being drawn, and what it draws with. */ +export interface ReportBody { + fix: string[]; + noted: string[]; +} + +/** The findings of a chart or board, split into what holds it back and what it draws with. */ +export function reportBody(board: Board, outcomes: readonly ChartOutcome[], notes: readonly string[] = []): ReportBody { + if (board.kind === 'chart') { + const findings = outcomes.flatMap((outcome) => outcome.findings); + return { + fix: findings.filter(isError).map(bullet), + noted: [...notes, ...findings.filter((finding) => !isError(finding))].map(bullet), + }; + } + return boardBody(board, outcomes, notes); +} + +/** A chart or board as the model reads it after validate_chart, validate_board or show. */ +export function viewReport(board: Board, outcomes: readonly ChartOutcome[], notes: readonly string[] = [], shown: 'shown' | 'held' | false = false): string { + const { fix, noted } = reportBody(board, outcomes, notes); + const next = shown === 'shown' ? shownText(board) : shown === 'held' ? HELD : fix.length > 0 ? TO_FIX : CLEAN; + // A chart that draws needs no "noted" heading for one or two warnings; a board groups them. + const sections = [ + ...(fix.length > 0 ? [FIX_HEAD, ...fix] : []), + ...(noted.length > 0 ? [NOTED_HEAD, ...noted] : []), + ]; + if (board.kind === 'chart') return [next, ...sections].join('\n'); + const head = `Board${board.title ? ` "${board.title}"` : ''}: ${board.charts.length} chart${board.charts.length === 1 ? '' : 's'} (${board.charts.map((chart) => chart.id).join(', ') || 'none'}).`; + return [head, next, ...(board.charts.length > 0 ? [layoutLine(board)] : []), ...(sections.length > 0 ? ['', ...sections] : [])].join('\n'); +} + +function isError(finding: string): boolean { + return finding.startsWith('✗'); +} + +/** Findings that several charts share, said once under all their ids. */ +function grouped(outcomes: readonly ChartOutcome[], keep: (finding: string) => boolean): string[] { + const charts = new Map(); + for (const outcome of outcomes) { + for (const finding of outcome.findings.filter(keep)) charts.set(finding, [...(charts.get(finding) ?? []), outcome.id]); + } + const groups = new Map(); + for (const [finding, ids] of charts) groups.set(ids.join(', '), [...(groups.get(ids.join(', ')) ?? []), finding]); + return [...groups].flatMap(([ids, findings]) => [`${ids}:`, ...findings.map(bullet)]); +} + +/** The board's findings: each chart's, a finding several charts share said once, then links and review. */ +function boardBody(board: Board, outcomes: readonly ChartOutcome[], notes: readonly string[]): ReportBody { + const links = linkFindings(board); + const review = boardReview(board); + const fields = board.link_spec?.fields.join(', '); + return { + fix: [ + ...grouped(outcomes, isError), + ...(links.fix.length > 0 ? [`Links (${fields}):`, ...links.fix.map(bullet)] : []), + ...(review.fix.length > 0 ? ['Review:', ...review.fix.map(bullet)] : []), + ], + noted: [ + ...notes.map(bullet), + ...grouped(outcomes, (finding) => !isError(finding)), + ...(links.noted.length > 0 ? [`Link notes (${fields}); change nothing unless the user asked for that connection:`, ...links.noted.map(bullet)] : []), + ...(review.noted.length > 0 ? ['Review:', ...review.noted.map(bullet)] : []), + ], + }; +} + +function bullet(text: string): string { + return `- ${text}`; +} + +/** The board's layout in one line: its rows as the card draws them, or the reader's grid. */ +function layoutLine(board: Board): string { + if (board.grid) return `Layout: the reader's grid; keep passing it, or leave it out for rows. ${gridLines(board.grid).map(unbullet).join('; ')}.`; + const charts = board.charts.map((chart) => ({ id: chart.id, chartType: chart.input.chart_spec.chartType, layout: chart.layout })); + return `Layout: ${layoutLines(boardRows(charts, boardColumns(charts, board.columns))).map(unbullet).join('; ')}.`; +} + +function unbullet(line: string): string { + return line.replace(/^- /, ''); +} + +function isUnlinked(link: ChartLink): boolean { + return link.sends.length === 0 && link.receives.length === 0; +} + +/** + * What the link leaves out. To fix: a chart whose data has a linked field its marks do not carry, an + * unknown chart id, a field fewer than two charts carry (it joins nothing). Noted: what linked charts + * leave out. Silent: a chart taken out of the link (send and receive false), and a KPI tile that has + * none of the fields. + */ +function linkFindings(board: Board): ReportBody { + const fix: string[] = []; + const noted: string[] = []; + if (!board.link_spec || !board.linked) return { fix, noted }; + const roles = board.link_spec.charts ?? {}; + const types = new Map(board.charts.map((chart) => [chart.id, chart.input.chart_spec.chartType])); + for (const [id, link] of Object.entries(board.linked)) { + if (roles[id]?.send === false && roles[id]?.receive === false) continue; + if (isUnlinked(link)) { + const fixable = link.notes.some((note) => note.includes('its marks do not carry') || note.startsWith('no chart "')); + if (fixable) fix.push(`✗ ${id}: not linked; ${link.notes.join('; ')}`); + else if (!isKpi(types.get(id) ?? '')) noted.push(`${id}: not linked; ${link.notes.join('; ')}`); + } else if (link.notes.length > 0) { + noted.push(`${id}: ${link.notes.join('; ')}`); + } + } + for (const field of board.link_spec.fields) { + const carriers = board.charts.map((chart) => chart.id) + .filter((id) => board.linked![id] && !board.linked![id].notes.some((note) => note.startsWith(`leaves out ${field}:`))); + // A chart told to carry the field already says how to join it. + if (carriers.length < 2 && !fix.some((line) => line.includes(`its marks do not carry ${field};`))) { + fix.push(`✗ ${field} joins nothing: ${carriers.length === 0 ? 'no chart carries it' : `only ${carriers[0]} carries it`}; drop it from link_spec.fields, or encode it on another chart.`); + } + } + return { fix, noted }; +} diff --git a/packages/flint-mcp/src/server.ts b/packages/flint-mcp/src/server.ts index d59f2023..81c585e6 100644 --- a/packages/flint-mcp/src/server.ts +++ b/packages/flint-mcp/src/server.ts @@ -23,6 +23,8 @@ import { toAssemblyInput, updatesShape, viewShape, + referencedShape, + checkArgs, SUPPORTED_BACKENDS, type SupportedBackend, type AssemblyInputArgs, @@ -34,8 +36,7 @@ import { assembleBoard, boardChartShape, boardFieldsShape, - chartReport, - viewReport, + chartFindings, boardSnapshot, fitsInResult, gridShape, @@ -43,16 +44,19 @@ import { type BoardChartArgs, type BoardSpec, } from './board.js'; +import { HELD, reportBody, viewReport } from './report.js'; export { VERSION }; export const AGENT_SKILL_RESOURCE_URI = 'flint://agent-skill'; export const THEME_SKILL_RESOURCE_URI = 'flint://theme-skill'; export const INTERACTION_SKILL_RESOURCE_URI = 'flint://interaction-skill'; export const BOARD_SKILL_RESOURCE_URI = 'flint://board-skill'; +export const APP_SKILL_RESOURCE_URI = 'flint://app-skill'; const AGENT_SKILL_ASSET = new URL('../assets/flint-chart-author.SKILL.md', import.meta.url); const THEME_SKILL_ASSET = new URL('../assets/flint-theme-author.SKILL.md', import.meta.url); const INTERACTION_SKILL_ASSET = new URL('../assets/flint-interaction-author.SKILL.md', import.meta.url); const BOARD_SKILL_ASSET = new URL('../assets/flint-board-author.SKILL.md', import.meta.url); +const APP_SKILL_ASSET = new URL('../assets/flint-app-author.SKILL.md', import.meta.url); /** URI linking show to its bundled UI resource, the card that draws a chart or a board. */ export const VIEW_RESOURCE_URI = 'ui://flint-chart/view.html'; @@ -69,6 +73,7 @@ const SKILL_ASSETS = { theme: THEME_SKILL_ASSET, interaction: INTERACTION_SKILL_ASSET, board: BOARD_SKILL_ASSET, + app: APP_SKILL_ASSET, } as const; export type SkillName = keyof typeof SKILL_ASSETS; const SKILL_NAMES = Object.keys(SKILL_ASSETS) as [SkillName, ...SkillName[]]; @@ -81,14 +86,17 @@ const readAgentSkill = () => readSkill('chart'); const readThemeSkill = () => readSkill('theme'); const readInteractionSkill = () => readSkill('interaction'); -/** Top-level `## ` headings of a skill, skipping fenced code blocks. */ -function skillSections(text: string): { heading: string; start: number }[] { - const sections: { heading: string; start: number }[] = []; +/** The `## ` and `### ` headings of a skill, skipping fenced code blocks. */ +function skillSections(text: string): { heading: string; level: number; start: number }[] { + const sections: { heading: string; level: number; start: number }[] = []; let fenced = false; let offset = 0; for (const line of text.split('\n')) { if (line.startsWith('```')) fenced = !fenced; - else if (!fenced && line.startsWith('## ')) sections.push({ heading: line.slice(3).trim(), start: offset }); + else if (!fenced && /^#{2,3} /.test(line)) { + const level = line.startsWith('### ') ? 3 : 2; + sections.push({ heading: line.slice(level + 1).trim(), level, start: offset }); + } offset += line.length + 1; } return sections; @@ -100,23 +108,31 @@ function headingKey(heading: string): string { } /** - * One `## ` section of a skill, from its heading up to the next `## ` heading. The heading matches - * exactly, or else as the start of one heading only, so a shortened name ("Link charts") finds it. + * One section of a skill, from its `## ` or `### ` heading up to the next heading of the same or a + * higher level. The heading matches exactly; else as the start of one heading only, so a shortened + * name ("Link charts") finds it; else as the one heading that holds every word asked for. */ export function skillSection(text: string, heading: string): string { const sections = skillSections(text); const wanted = headingKey(heading); + const only = (test: (key: string) => boolean) => { + const found = sections.flatMap((section, at) => (test(headingKey(section.heading)) ? [at] : [])); + return found.length === 1 ? found[0] : -1; + }; let index = sections.findIndex((section) => headingKey(section.heading) === wanted); + if (index < 0 && wanted) index = only((key) => `${key} `.startsWith(`${wanted} `)); if (index < 0 && wanted) { - const starting = sections.flatMap((section, at) => (`${headingKey(section.heading)} `.startsWith(`${wanted} `) ? [at] : [])); - if (starting.length === 1) index = starting[0]; + const words = wanted.split(' '); + index = only((key) => words.every((word) => key.split(' ').includes(word))); } if (index < 0) { throw new Error( `No section "${heading}". Sections: ${sections.map((section) => `"${section.heading}"`).join(', ')}.`, ); } - return text.slice(sections[index].start, sections[index + 1]?.start ?? text.length).trimEnd() + '\n'; + const { level, start } = sections[index]; + const end = sections.slice(index + 1).find((section) => section.level <= level)?.start ?? text.length; + return text.slice(start, end).trimEnd() + '\n'; } /** Read the bundled view HTML, tolerating a not-yet-built asset. */ @@ -209,35 +225,24 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { instructions: 'Flint compiles one semantic chart spec (ChartAssemblyInput) into ' + - 'Vega-Lite, ECharts, or Chart.js. By DEFAULT, show a chart whenever the host ' + - 'supports MCP App UIs: check the spec with validate_chart, fix what its report asks, then call ' + - 'show with the spec once; the card draws the chart live with an editing panel. ' + - 'For several charts shown together (a dashboard, a comparison, an overview with its detail), ' + - 'call get_flint_skill with skill "board", check the board with validate_board, then call show with it once. ' + - 'The server keeps nothing between calls: to change a chart, change its spec and call show again. ' + - 'The editing panel is not ' + - 'interactivity: when the user asks for an interactive chart (hover, ' + - 'click, brush, zoom), add an interaction_spec. Fall back to render_chart for a static PNG/SVG artifact only ' + - 'when the host has no App UI support or the user explicitly wants a ' + - 'static image. Use compile_chart for the backend spec JSON, ' + - 'validate_chart to check a spec, and list_chart_types to discover chart ' + - 'types, their channels, and the interaction presets each supports for ' + - 'interaction_spec. Use list_interaction_presets for what each preset does, ' + - 'what it needs from the chart, and the options it accepts. ' + - 'Use list_themes to discover visual themes; ' + - 'prefer a preset id, and use an `extends` override only when the user ' + - 'asks to customize it. Before authoring chart specs, call ' + - 'get_flint_skill with skill "chart" (also the flint://agent-skill ' + - 'resource and the author_flint_chart prompt). ' + - 'When the user asks to create, translate, or substantially customize a ' + - 'ThemeSpec, call get_flint_skill with skill "theme". ' + - 'When the user asks for behaviour on a chart, names an intent such as ' + - 'explore or compare, adds behaviour to a chart that already exists, ' + - 'changes or reads a mounted chart from code or as an agent, passes ' + - 'updates to a tool, links charts, ' + - 'or needs an interaction no preset gives, call get_flint_skill with ' + - 'skill "interaction". Pass `section` with one "## " heading when you ' + - 'need only that part of a skill.' + + 'Vega-Lite, ECharts, Chart.js or Plotly. Before your first chart, call get_flint_skill with skill ' + + '"chart" once and keep it for the conversation. By DEFAULT, show a chart whenever the host supports ' + + 'MCP App UIs, with the lightest view that answers: one question is one chart, passed to show as chart; ' + + 'the card draws it live with an editing panel, and its report says what to fix. An open question ("how ' + + 'did X do", "what does this data say", "tell me something interesting") gets the one chart that answers ' + + 'it best, or two side by side only when it has two halves; name in your reply what else you could show, ' + + 'and draw it when the user asks. One view split by a category (a panel per region, same measure) is ' + + 'still one chart, with column or row encodings. A board is for when the user asks for one: a dashboard, ' + + 'an overview, KPI tiles, linked views, or several charts named in one turn: load skill "board", then ' + + 'call show with it. show checks the ' + + 'spec itself: no need to validate first; when it returns fixes, nothing was drawn, so fix and call show again. The server keeps nothing between calls: to change a chart, change its spec ' + + 'and call show again. list_chart_types lists the chart types; pass chartType for one type\'s ' + + 'guidance, properties and presets. The editing panel is not interactivity: when the user asks for ' + + 'behaviour on a chart (hover, click, brush, zoom, filter) or for marks on it (notes, emphasis, a ' + + 'reference line), load skill "interaction". Load skill "theme" to create or substantially customize ' + + 'a ThemeSpec (list_themes for presets), and skill "app" only when the user asks for code. Use ' + + 'render_chart for a static PNG/SVG only when the host has no App UI or the user wants an image, and ' + + 'compile_chart for backend JSON. Pass `section` with a heading to get only part of a skill.' + dataAccessNote(options), }, ); @@ -264,11 +269,11 @@ export function createServer(options: CreateServerOptions = {}): McpServer { description: 'Compile a Flint chart spec for a backend and render it to a STATIC image ' + '(PNG) or vector (SVG), returned inline. Rendering is local/in-process. ' + - 'The chartjs backend supports PNG only. Prefer validate_chart and show instead ' + + 'The chartjs backend supports PNG only. Prefer show instead ' + 'when the host supports MCP App UIs; use render_chart for a static ' + 'artifact or when no App UI is available.', inputSchema: { - ...assemblyInputShape, + ...referencedShape(assemblyInputShape, 'chart'), backend: backendEnum, format: z .enum(['png', 'svg']) @@ -288,7 +293,7 @@ export function createServer(options: CreateServerOptions = {}): McpServer { }, async (args: any) => { try { - const input = toAssemblyInput(args as AssemblyInputArgs); + const input = toAssemblyInput({ ...args, ...checkArgs(assemblyInputShape, args) } as AssemblyInputArgs); const res = await renderChart(input, args.backend as RenderBackend, { format: args.format, scale: args.scale, @@ -328,11 +333,11 @@ export function createServer(options: CreateServerOptions = {}): McpServer { 'Compile a Flint chart spec to a backend-native spec object ' + '(Vega-Lite / ECharts / Chart.js) without rendering. Returns the spec ' + 'JSON, assembly warnings, and the computed layout size.', - inputSchema: { ...assemblyInputShape, backend: backendEnum }, + inputSchema: { ...referencedShape(assemblyInputShape, 'chart'), backend: backendEnum }, }, async (args: any) => { try { - const input = toAssemblyInput(args as AssemblyInputArgs); + const input = toAssemblyInput({ ...args, ...checkArgs(assemblyInputShape, args) } as AssemblyInputArgs); await installFlintTextMeasurer(); return jsonResult(compileChart(input, args.backend as RenderBackend, { ...dataSourceOptions, roots: await clientRoots() })); } catch (err) { @@ -347,24 +352,25 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { title: 'Validate chart spec', description: - 'Validate a Flint chart spec for a backend without rendering. Reports ' + - 'whether it is valid, all warnings/errors, and the computed layout size. ' + - 'With an interaction_spec it also reports the entries the chart would drop. ' + - 'With updates it rejects a malformed layer and reports, op by op, whether ' + - 'each will apply (✓) or why not (✗), in the same report show returns. ' + - 'Call it before show and fix what it reports; nothing is kept between calls.', - inputSchema: { ...assemblyInputShape, ...updatesShape, backend: backendEnum }, + 'Validate a Flint chart spec for a backend without rendering. For vegalite, the report lists only ' + + 'what to act on: errors, warnings, interaction_spec entries the chart drops, and update ops that ' + + 'will not apply (✗), the same report show returns; "Nothing to fix" when it is clean. Other ' + + 'backends return the validation result as JSON. For a host with no card UI; with a card, call show ' + + 'directly, which runs the same check. Nothing is kept between calls.', + inputSchema: { ...referencedShape({ ...assemblyInputShape, ...updatesShape }, 'chart'), backend: backendEnum }, }, async (args: any) => { try { - const { result, input } = validateChart(toAssemblyInput(args as AssemblyInputArgs), args.backend as RenderBackend, { + args = { ...args, ...checkArgs({ ...assemblyInputShape, ...updatesShape }, args) }; + const { result } = validateChart(toAssemblyInput(args as AssemblyInputArgs), args.backend as RenderBackend, { ...dataSourceOptions, roots: await clientRoots(), updates: args.updates, }); - if (!result.valid || args.backend !== 'vegalite') return jsonResult(result); - const report = chartReport(input, args.updates, result); - return { content: [...jsonResult(result).content, { type: 'text' as const, text: report }] }; + if (args.backend !== 'vegalite') return jsonResult(result); + const findings = result.valid ? chartFindings(args.updates, result) : result.errors.map((error) => `✗ ${error.message}`); + const chart = { id: 'chart', kind: 'chart' as const, charts: [] }; + return { content: [{ type: 'text' as const, text: viewReport(chart, [{ id: 'chart', drawn: result.valid, findings }]) }] }; } catch (err) { return errorResult(err); } @@ -377,16 +383,18 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { title: 'List chart types', description: - 'List the available chart types, their encoding channels, and the ' + - 'interaction presets each supports in interaction_spec (Vega-Lite only), ' + - 'for a backend, or for all backends when none is given.', + 'The chart types, each with its channels and a one-line note on what it is for, for a backend ' + + '(or all). Pass `chartType` for one type in full: its guidance (map keys, which bar chart), its ' + + 'chartProperties with values, defaults and effects, and the interaction presets it supports in ' + + 'interaction_spec (Vega-Lite).', inputSchema: { backend: backendEnum.optional(), + chartType: z.string().optional().describe('One chart type name, for its guidance, properties and presets.'), }, }, async (args: any) => { try { - return jsonResult(listChartTypes(args?.backend as RenderBackend | undefined)); + return jsonResult(listChartTypes(args?.backend as RenderBackend | undefined, args?.chartType)); } catch (err) { return errorResult(err); } @@ -404,7 +412,7 @@ export function createServer(options: CreateServerOptions = {}): McpServer { 'accepts under `options`. Pass `chartType` for the presets a Vega-Lite ' + 'chart type supports, or `type` for one preset. Which presets answer a ' + 'request and how they combine is in get_flint_skill with skill ' + - '"interaction", section "Add interactions to the chart".', + '"interaction", section "Add interactions".', inputSchema: { chartType: z.string().optional().describe('A Vega-Lite chart type name from list_chart_types.'), type: z.string().optional().describe('One preset type, for its options alone.'), @@ -425,20 +433,20 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { title: 'Get Flint skill', description: - 'Return a bundled Flint skill as markdown. Read it before you write the ' + + 'Return a bundled Flint skill as markdown. Read it once before you write the ' + 'matching spec: `chart` for a ChartAssemblyInput, `theme` for a ThemeSpec, ' + - '`interaction` for an interaction_spec, ChartUpdate layers, reading a ' + - 'mounted chart, linking charts, or a bespoke interaction; `board` for a ' + - 'board spec: headline, chart choice, layout, links. Pass `section` ' + - 'with one "## " heading to get only that part; an unknown section lists ' + - 'the headings. The same text is served as the flint://agent-skill, ' + - 'flint://theme-skill, flint://interaction-skill, and flint://board-skill resources.', + '`interaction` for an interaction_spec or ChartUpdate layers (updates), ' + + '`board` for a board spec, `app` for code that uses flint-chart in an ' + + 'application. Pass `section` with a heading to get only that part; an ' + + 'unknown section lists the headings. The same text is served as the ' + + 'flint://agent-skill, flint://theme-skill, flint://interaction-skill, ' + + 'flint://board-skill and flint://app-skill resources.', inputSchema: { - skill: z.enum(SKILL_NAMES).describe('Which skill: chart, theme, interaction, or board.'), + skill: z.enum(SKILL_NAMES).describe('Which skill: chart, theme, interaction, board, or app.'), section: z .string() .optional() - .describe('One "## " heading of the skill, e.g. "Update the chart".'), + .describe('One heading of the skill, e.g. "Update the chart" or "Muted annotations".'), }, annotations: { readOnlyHint: true }, }, @@ -503,14 +511,15 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { title: 'Validate board', description: - 'Check a board of several Flint charts without drawing it: the report gives the layout, each chart ' + - '(✓/✗ per update op), what each chart sends and receives under link_spec, and a review of what the ' + - 'board should still fix. Nothing is kept: fix the spec, check it again if needed, then pass the same ' + - 'board to show. Before the first board, call get_flint_skill with skill "board".', - inputSchema: boardSpec.shape, + 'Check a board of several Flint charts without drawing it, for a host with no card UI or a static ' + + 'image; with a card, call show directly, which runs the same check. The report gives the layout in one ' + + 'line, what to fix before it draws, and what it would draw with. Before the first board, call ' + + 'get_flint_skill with skill "board".', + inputSchema: referencedShape(boardSpec.shape, 'board'), }, async (args: any) => { try { + args = checkArgs(boardSpec.shape, args); const { board, outcomes, notes } = await assemble({ board: args }); return { content: [{ type: 'text' as const, text: viewReport(board, outcomes, notes) }] }; } catch (err) { @@ -525,10 +534,12 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { title: 'Show chart or board', description: - 'Put a chart or a board on screen: pass the full spec as chart or as board, after validate_chart or ' + - 'validate_board report nothing left to fix. The card draws it live with an editing panel; the result ' + - 'is the same report. A spec with errors draws nothing. Nothing is kept: to change what is on screen, ' + - 'change the spec and call show again; a new card shows it and earlier cards stay as they were.', + 'Put a chart or a board on screen: pass the full spec as chart or as board; there is no need to ' + + 'validate first. show checks the spec: one with errors, or with something it must not be drawn with ' + + '(rows drawn as slices, a link that joins nothing), draws nothing and returns what to fix, so call show ' + + 'again with the fixed spec. Otherwise the card draws it live with an editing panel, and the result notes ' + + 'what it drew with; change nothing for those unless the user asks. Nothing is kept: to change what is on ' + + 'screen, change the spec and call show again; a new card shows it and earlier cards stay as they were.', inputSchema: { chart: chartSpec.optional(), board: boardSpec.optional(), @@ -540,12 +551,17 @@ export function createServer(options: CreateServerOptions = {}): McpServer { const { board, outcomes, notes } = await assemble(args); const failed = outcomes.filter((outcome) => !outcome.drawn); if (failed.length > 0) { - const text = `Nothing was drawn: ${failed.map((outcome) => `${outcome.id} ${outcome.text}`).join('; ')}. Fix the spec and call show again.`; + const text = `Nothing was drawn: ${failed.map((outcome) => `${outcome.id} ${outcome.findings.join('; ')}`).join('; ')}. Fix the spec and call show again.`; return { content: [{ type: 'text' as const, text }], _meta: { flint: { error: text } }, isError: true }; } + // What the board must not be drawn with comes back to the agent; the card says it is being revised. + if (reportBody(board, outcomes, notes).fix.length > 0) { + const text = viewReport(board, outcomes, notes, 'held'); + return { content: [{ type: 'text' as const, text }], _meta: { flint: { held: HELD } }, isError: true }; + } const snapshot = boardSnapshot(board); return { - content: [{ type: 'text' as const, text: viewReport(board, outcomes, notes, true) }], + content: [{ type: 'text' as const, text: viewReport(board, outcomes, notes, 'shown') }], // A small board also rides in structuredContent, which a host keeps when it draws the card again. ...(fitsInResult(snapshot) ? { structuredContent: { flint: { board: snapshot } } } : {}), _meta: { flint: { board: snapshot } }, @@ -567,7 +583,8 @@ export function createServer(options: CreateServerOptions = {}): McpServer { uri: VIEW_RESOURCE_URI, mimeType: RESOURCE_MIME_TYPE, text: readViewHtml(), - _meta: { ui: { permissions: { clipboardWrite: {} } } }, + // Maps fetch their named boundaries from Flint's site: the view carries none of them. + _meta: { ui: { permissions: { clipboardWrite: {} }, csp: { connectDomains: ['https://microsoft.github.io'] } } }, }, ], }), @@ -711,7 +728,7 @@ export function createServer(options: CreateServerOptions = {}): McpServer { { title: 'Flint interaction-author skill', description: - 'Bundled instructions for behaviour on a chart: how an interaction works, presets as one valid interaction_spec, the ChartUpdate an application or an agent applies to a mounted chart, reading the chart state, linking charts, and bespoke interactions.', + 'Bundled instructions for behaviour and state on a chart: when to add interactions, presets as one valid interaction_spec, and the ChartUpdate layers (updates) an agent leaves on a chart.', mimeType: 'text/markdown', annotations: { audience: ['assistant'], priority: 1 }, }, @@ -741,15 +758,30 @@ export function createServer(options: CreateServerOptions = {}): McpServer { }), ); + server.registerResource( + 'app-skill', + APP_SKILL_RESOURCE_URI, + { + title: 'Flint app-author skill', + description: + 'Bundled instructions for code that uses flint-chart: install, compile, mount with interactions, read the chart, apply updates, link charts, and bespoke interactions.', + mimeType: 'text/markdown', + annotations: { audience: ['assistant'], priority: 1 }, + }, + async (uri) => ({ + contents: [{ uri: uri.href, mimeType: 'text/markdown', text: readSkill('app') }], + }), + ); + server.registerPrompt( 'author_flint_interaction', { title: 'Author Flint interactions', description: - 'Load the Flint interaction-author skill before adding behaviour to a chart, changing or reading a mounted chart from outside, linking charts, or building a bespoke interaction.', + 'Load the Flint interaction-author skill before adding behaviour to a chart, or marks and emphasis (updates) on it.', }, async () => ({ - description: 'Use the bundled Flint interaction-author skill to produce a valid interaction_spec, a ChartUpdate, or code against flint-chart/interactive.', + description: 'Use the bundled Flint interaction-author skill to produce a valid interaction_spec or ChartUpdate.', messages: [ { role: 'user' as const, @@ -768,9 +800,9 @@ export function createServer(options: CreateServerOptions = {}): McpServer { type: 'text' as const, text: 'Use these Flint instructions for behaviour on a chart. ' + - 'For presets, use list_chart_types to confirm the ones the chart type supports, ' + + 'For presets, use list_interaction_presets with chartType to confirm the ones the chart type supports, ' + 'and return the bare interaction_spec without changing the chart spec. ' + - 'For a mounted chart, return one ChartUpdate; for code, write against flint-chart/interactive.', + 'For a chart on screen, return one ChartUpdate.', }, }, ], diff --git a/packages/flint-mcp/src/tools/chart-guide.ts b/packages/flint-mcp/src/tools/chart-guide.ts new file mode 100644 index 00000000..94d4ab35 --- /dev/null +++ b/packages/flint-mcp/src/tools/chart-guide.ts @@ -0,0 +1,595 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * What each Vega-Lite chart type is for, how its channels read, and what its `chartProperties` do: + * the reference `list_chart_types` serves, so the authoring skill need not carry it. + */ +export interface ChartGuideProperty { key: string; values: string; effect: string } +export interface ChartGuide { note: string; properties: ChartGuideProperty[]; guidance?: string[] } + +export const CHART_GUIDE: Record = { + "Scatter Plot": { + "note": "x + y required; `detail` carries a field (e.g. `country`) on each point without a visual channel, for tooltips and linking", + "properties": [ + { + "key": "opacity", + "values": "0.1–1 (1)", + "effect": "Point opacity" + } + ] + }, + "Regression": { + "note": "scatter + fit line; props `regressionMethod`, `polyOrder`", + "properties": [ + { + "key": "regressionMethod", + "values": "`linear` | `log` | `exp` | `pow` | `quad` | `poly` (`linear`)", + "effect": "Fit method" + }, + { + "key": "polyOrder", + "values": "1–5 (3)", + "effect": "Polynomial order (when `poly`)" + } + ] + }, + "Connected Scatter Plot": { + "note": "x + y required; `order` = connection sequence (time/index), so the line traces a trajectory and may self-cross", + "properties": [] + }, + "Ranged Dot Plot": { + "note": "dumbbell of two x per category", + "properties": [] + }, + "Strip Plot": { + "note": "jittered points; props `stepWidth`, `pointSize`, `opacity`", + "properties": [ + { + "key": "stepWidth", + "values": "10–100 (20)", + "effect": "Jitter spread" + }, + { + "key": "pointSize", + "values": "0–150 (0=auto)", + "effect": "Point size" + }, + { + "key": "opacity", + "values": "0–1 (0=auto)", + "effect": "Point opacity" + } + ] + }, + "Bar Chart": { + "note": "one discrete + one measure; prop `cornerRadius`; `detail` carries a finer field (e.g. `state` under `magnitude`) by splitting each bar into segments of its colour, for tooltips and linking", + "properties": [ + { + "key": "cornerRadius", + "values": "0–15 (0)", + "effect": "Round bar corners (px)" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ], + "guidance": [ + "Bar Chart is one series (a second category on color stacks). Stacked Bar Chart puts a second category on color, stacked (parts of a total). Grouped Bar Chart puts the second category on group, side by side (compare values); not on color." + ] + }, + "Grouped Bar Chart": { + "note": "`group` = the clustering category; prop `dodge`; `detail` carries a finer field (e.g. `state` under `magnitude`) by splitting each bar into segments of its colour, for tooltips and linking", + "properties": [ + { + "key": "dodge", + "values": "`auto` | `local` | `global` (`auto`)", + "effect": "`local` compacts sparse groups per category; `global` preserves aligned group lanes; leave `auto` unless the user requests one" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ], + "guidance": [ + "Bar Chart is one series (a second category on color stacks). Stacked Bar Chart puts a second category on color, stacked (parts of a total). Grouped Bar Chart puts the second category on group, side by side (compare values); not on color." + ] + }, + "Stacked Bar Chart": { + "note": "prop `stackMode`; `detail` carries a finer field (e.g. `state` under `magnitude`) by splitting each bar into segments of its colour, for tooltips and linking", + "properties": [ + { + "key": "stackMode", + "values": "`stacked` | `normalize` | `center` | `layered` (unset)", + "effect": "Stacking behavior; `normalize` = 100%, `center` = streamgraph" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ], + "guidance": [ + "Bar Chart is one series (a second category on color stacks). Stacked Bar Chart puts a second category on color, stacked (parts of a total). Grouped Bar Chart puts the second category on group, side by side (compare values); not on color." + ] + }, + "Pyramid Chart": { + "note": "diverging horizontal bars", + "properties": [ + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ] + }, + "Lollipop Chart": { + "note": "prop `dotSize`", + "properties": [ + { + "key": "dotSize", + "values": "20–300 (80)", + "effect": "Circle size (px)" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ] + }, + "Waterfall Chart": { + "note": "`color` = Type column, values `start`/`delta`/`end` only; omit it for auto sign coloring; props `cornerRadius`, `totals`", + "properties": [ + { + "key": "cornerRadius", + "values": "0–8 (0)", + "effect": "Round bar corners" + }, + { + "key": "totals", + "values": "`auto` | `none` | `first` | `last` | `both` (`auto`)", + "effect": "Which bars anchor to zero as totals (only when no Type column)" + }, + { + "key": "showTextLabels", + "values": "boolean (false)", + "effect": "Legacy spelling of `showValueLabels`; still accepted" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ], + "guidance": [ + "**Waterfall color is a special \"Type\" column, not a free category.** On a `\"Waterfall Chart\"` the `color` channel is reserved for a *type* field whose values are literally `start`, `delta`, and `end` — it drives which bars anchor to zero, not an arbitrary grouping. Do **not** bind `color` to an `Increase`/`Decrease` (or up/down, gain/loss) category: the up/down direction is already derived from the **sign** of the `y` value and colored automatically (green up / red down). For the common case, **omit `color` entirely** and let Flint infer the start/delta/end and per-bar sign coloring. To force which bars are anchored totals, use the `totals` property (`first`/`last`/`both`), not a color field. Only bind `color` when you genuinely have a `start`/`delta`/`end` type column." + ] + }, + "Gantt Chart": { + "note": "x = start, x2 = end", + "properties": [] + }, + "Bullet Chart": { + "note": "`goal` required (target)", + "properties": [] + }, + "Histogram": { + "note": "x = measure to bin; prop `binCount`", + "properties": [ + { + "key": "binCount", + "values": "5–50 (10)", + "effect": "Number of bins" + } + ] + }, + "Boxplot": { + "note": "category + measure; props `whiskerMethod`, `showOutliers`, `dodge`", + "properties": [ + { + "key": "dodge", + "values": "`auto` | `local` | `global` (`auto`)", + "effect": "`local` compacts sparse groups per category; `global` preserves aligned group lanes; leave `auto` unless the user requests one" + }, + { + "key": "whiskerMethod", + "values": "`iqr` | `minmax` (`iqr`)", + "effect": "Whisker rule (Tukey 1.5×IQR vs min–max)" + }, + { + "key": "showOutliers", + "values": "boolean (true)", + "effect": "Show outlier points (Tukey only)" + } + ] + }, + "ECDF Plot": { + "note": "x = measure; cumulative distribution (step line); prop `showPoints`", + "properties": [ + { + "key": "showPoints", + "values": "boolean (false)", + "effect": "Draw point markers on the line" + } + ] + }, + "Heatmap": { + "note": "color = the measure", + "properties": [ + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ] + }, + "Calendar Heatmap": { + "note": "x = date; color = daily value (summed per day); GitHub-style week × weekday grid", + "properties": [] + }, + "Line Chart": { + "note": "props `interpolate`, `showPoints`", + "properties": [ + { + "key": "interpolate", + "values": "`linear` | `monotone` | `step` | `step-before` | `step-after` | `basis` | `cardinal` | `catmull-rom` (`linear`)", + "effect": "Curve shape" + }, + { + "key": "showPoints", + "values": "boolean (false)", + "effect": "Draw point markers on the line" + } + ] + }, + "Sparkline": { + "note": "x + y required; small-multiple mini trend lines, one per series (series from `color` or `detail`); props `interpolate`, `baseline`, `trendWidth`", + "properties": [ + { + "key": "interpolate", + "values": "`linear` | `monotone` | `step` | `step-before` | `step-after` | `basis` | `cardinal` | `catmull-rom` (`linear`)", + "effect": "Curve shape" + }, + { + "key": "baseline", + "values": "`mean` | `zero` | `median` | `none` (`mean`)", + "effect": "Reference line per spark row" + }, + { + "key": "trendWidth", + "values": "80–600 (240)", + "effect": "Mini line-plot width (px)" + } + ] + }, + "Bump Chart": { + "note": "rank-over-time lines", + "properties": [] + }, + "Slope Chart": { + "note": "two-period value change; straight segments + end points, one line per category", + "properties": [] + }, + "Area Chart": { + "note": "props `interpolate`, `opacity`, `stackMode`", + "properties": [ + { + "key": "stackMode", + "values": "`stacked` | `normalize` | `center` | `layered` (unset)", + "effect": "Stacking behavior; `normalize` = 100%, `center` = streamgraph" + }, + { + "key": "interpolate", + "values": "`linear` | `monotone` | `step` | `step-before` | `step-after` | `basis` | `cardinal` | `catmull-rom` (`linear`)", + "effect": "Curve shape" + }, + { + "key": "opacity", + "values": "0.1–1 (0.7)", + "effect": "Fill opacity" + } + ] + }, + "Range Area Chart": { + "note": "x + y + y2 required; translucent band from `y` (low) to `y2` (high), value axis fits the band (not zero)", + "properties": [] + }, + "Violin Plot": { + "note": "x (category) + y (measure) required; mirrored KDE density per category, prop `bandwidth`; **Vega-Lite only**; a genuine `color` subgroup splits two groups or grids 3+ groups", + "properties": [] + }, + "Streamgraph": { + "note": "centre-stacked areas", + "properties": [] + }, + "Density Plot": { + "note": "props `bandwidth`, `stackMode` (series stack; `layered` overlaps them), `opacity`", + "properties": [ + { + "key": "stackMode", + "values": "`normalize` | `layered` (unset = stacked)", + "effect": "`layered` overlaps the series, translucent" + }, + { + "key": "opacity", + "values": "0.1–1 (0.7)", + "effect": "Layered series opacity" + }, + { + "key": "bandwidth", + "values": "0.05–2 (0=auto)", + "effect": "Kernel bandwidth" + } + ] + }, + "Ridgeline Plot": { + "note": "x = measure; `color` (or a discrete `y`) names the ridges, each the KDE of x on its own baseline; a measure `y` draws each series' curve instead; props `overlap`, `order`, `tailCut`, `colorBy`, `perspective` (plans unset `skew`, `tilt`, `overlap` from the ridge count so the depth takes about 40% of the plot), `skew`, `tilt`, `valueMax`, `markAt` (`true` marks the x ticks, or a list of x values; each ridge's value is dotted and labelled, joined across ridges), `opacity`, `interpolate`, `bandwidth`; named ridges share one ink unless `colorBy` asks otherwise; a numeric `color` keeps a gradient key; **Vega-Lite only**", + "properties": [ + { + "key": "bandwidth", + "values": "0.05–2 (0=auto)", + "effect": "Kernel bandwidth" + }, + { + "key": "overlap", + "values": "0.5–4 (1.8)", + "effect": "How many baselines up the tallest ridge reaches" + }, + { + "key": "order", + "values": "`mean`, `reverse` (unset = as given; a quantitative series lowest at the front)", + "effect": "Highest mean on top, or reversed" + }, + { + "key": "tailCut", + "values": "0–0.2 (0)", + "effect": "Trim each ridge to where its density is at least this share of its peak" + }, + { + "key": "colorBy", + "values": "`series`, `x` (unset = one colour)", + "effect": "Named ridges share one ink by default; `series` colours each ridge, `x` fills each with a ramp along x" + }, + { + "key": "perspective", + "values": "boolean (false)", + "effect": "Stand the ridges on a floor seen in perspective: `skew`, `tilt`, `overlap` left unset are planned so the depth takes about 40% of the plot's width and more of its height as ridges are added; the depth names, edge and value ticks give way (along the axis, then level, then every n-th) before they touch" + }, + { + "key": "skew", + "values": "0–0.4 (0)", + "effect": "Perspective: shift the back ridges left by this share of the x range" + }, + { + "key": "tilt", + "values": "0–6 (0)", + "effect": "Perspective: the x axis rises this many baselines across its range, labels following its edge" + }, + { + "key": "opacity", + "values": "0.1–1 (0.5)", + "effect": "Ridge opacity, as the Range Area Chart; solid in perspective unless set" + }, + { + "key": "valueMax", + "values": "number (0 = tallest peak)", + "effect": "Perspective: the value the full ridge height stands for, read on the back-left value axis" + }, + { + "key": "markAt", + "values": "boolean | number[]", + "effect": "Mark and label every ridge's value at the x ticks inside the range (`true`) or at these x; a dashed line joins the marks at one x across the ridges" + } + ] + }, + "Marginal Plot": { + "note": "the plot follows the axis types (measure × measure = scatter, category × measure = strip, category × category = heatmap of counts) with each axis's distribution along it (density, histogram or boxplot on a measure axis, a bar of counts on a category axis, split by `color`; density margins layer by default); props `marginal`, `stackMode`, `bandwidth`, `binCount`, `whiskerMethod`, `showOutliers`; **Vega-Lite only**", + "properties": [ + { + "key": "stackMode", + "values": "`stacked` (unset = layered)", + "effect": "Stack the density margins instead of layering them" + }, + { + "key": "bandwidth", + "values": "0.05–2 (0=auto)", + "effect": "Kernel bandwidth" + }, + { + "key": "marginal", + "values": "`density` | `histogram` | `boxplot` (`density`)", + "effect": "What each margin draws along a measure axis; a category axis gets a bar of counts" + } + ] + }, + "Pie Chart": { + "note": "`size` = slice value (→ angle), `color` = category; props `innerRadius`, `sortSlices`", + "properties": [ + { + "key": "innerRadius", + "values": "0–100 (0)", + "effect": "Donut hole size (>0 → donut)" + }, + { + "key": "sortSlices", + "values": "`none` | `descending` | `ascending` (`none`)", + "effect": "Order wedges and their legend by slice value" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ], + "guidance": [ + "A donut is the Donut Chart type, or a Pie Chart with chartProperties.innerRadius > 0." + ] + }, + "Donut Chart": { + "note": "`size` = slice value (→ angle), `color` = category; props `innerRadius`, `sortSlices`", + "properties": [ + { + "key": "innerRadius", + "values": "0–100 (50)", + "effect": "Donut hole size" + }, + { + "key": "sortSlices", + "values": "`none` | `descending` | `ascending` (`none`)", + "effect": "Order wedges and their legend by slice value" + }, + { + "key": "showValueLabels", + "values": "boolean", + "effect": "Print the numbers on the marks. Works with or without a theme: unset, it follows the house's own habit at this density (and with no house named, stays off), so the default the compiler reports is always the honest one. Set it to overrule that for one chart. Reported inapplicable (and ignored) where the marks are too dense to carry readable numbers, or where the template already writes its own text, so it is never a control that does nothing. On a stacked bar each segment prints its own value in the middle of the segment (at the edge it would read as the running total); segments too thin to hold a line of text go unlabelled, and a normalized stack prints each segment's share rather than its raw value, since the share is what the length shows. The printed number is rounded to roughly three significant figures — with a k/M suffix once the values get long, and enough decimals that the smallest value in the series still says something — so a raw `3.14159265` lands as `3.14` and a series of `0.001` to `5000` reads at both ends. Rounding never goes so far that two marks of different size print the same number, or that a non-zero value prints as `0`; where a house asked for a coarser precision than that, the digits are raised until the labels agree with the marks." + } + ], + "guidance": [ + "A Pie Chart with a hole: the same channels and properties, with `innerRadius` 50 unless set." + ] + }, + "Rose Chart": { + "note": "polar bars; props `alignment`, `padAngle`, `sortSlices`", + "properties": [ + { + "key": "sortSlices", + "values": "`none` | `descending` | `ascending` (`none`)", + "effect": "Order wedges and their legend by slice value" + }, + { + "key": "alignment", + "values": "`left` | `center` (`left`)", + "effect": "Wedge alignment" + }, + { + "key": "padAngle", + "values": "0–0.1 (0)", + "effect": "Gap between slices" + } + ] + }, + "Radar Chart": { + "note": "props `filled`, `fillOpacity`, `strokeWidth`", + "properties": [ + { + "key": "filled", + "values": "boolean (true)", + "effect": "Fill the polygon" + }, + { + "key": "fillOpacity", + "values": "0–0.5 (0.15)", + "effect": "Polygon fill opacity" + }, + { + "key": "strokeWidth", + "values": "0.5–4 (1.5)", + "effect": "Line width" + } + ] + }, + "Candlestick Chart": { + "note": "OHLC all required", + "properties": [] + }, + "Bar Table": { + "note": "compact bars + value labels", + "properties": [] + }, + "KPI Card": { + "note": "big-number tile; prop `behindThreshold`", + "properties": [ + { + "key": "behindThreshold", + "values": "0–1 (0.5)", + "effect": "Value/goal ratio cutoff for color" + } + ] + }, + "Table": { + "note": "the rows as given, one column per field in row order; shape `data.values` to the rows and fields to list, name columns with `field_display_names`; numbers and dates print by `semantic_types`; receives links and `updates`, sends no selection", + "properties": [] + }, + "Map": { + "note": "bubble map; `text` names points beside them (placed clear of each other, the most salient first — largest by `size`, else the ends of a quantity's `color` — at most one per 36,000 px² of plot; the rest keep their tooltips); `shape` tells points apart; `order` joins the points into routes (one per `detail`, else per categorical `color`); `size` is always the dots' area, `strokeWidth` each leg's width; props `region`, `projection`, `boundaries`, `arrows`, `curve`; with routes, a dot at every stop only where `size`, `shape`, `text` or a quantity's `color` asks for one, else at each route's start", + "properties": [ + { + "key": "region", + "values": "`us` | `world` | `auto` (`auto`)", + "effect": "Geographic scope" + }, + { + "key": "projection", + "values": "`mercator` | `equalEarth` | `orthographic` | `stereographic` | `conic` | `mollweide`", + "effect": "Map projection" + }, + { + "key": "arrows", + "values": "boolean (true)", + "effect": "Arrowheads on routes (with `order`)" + }, + { + "key": "curve", + "values": "`auto` | `arc` | `great-circle` | `straight` (`auto`)", + "effect": "Route legs: arcs between stops, great circles on a globe or along a long track" + } + ], + "guidance": [ + "**Maps: `boundaries`.** Leave it unset: world maps draw the World Bank's official boundaries, US maps the Census Bureau's. `\"natural-earth\"` draws de facto borders instead. Only when the user gives a boundary file, pass it: `{ \"url\": \"...\", \"feature\": \"\", \"ids\": \"iso-numeric\" | \"iso3\" | \"iso2\" | \"fips\" | \"as-is\", \"key\": \"properties.code\", \"attribution\": \"...\" }` (`ids` says what the file's feature ids are; `as-is` matches the rows exactly).", + "**Maps: the user's region.** Where borders are drawn differs by country, and\nsome require their own official map. Never hold the chart for it:\n- Frame what the data covers: the map already fits the rows' countries or\n region; set `region` (or the US `level`) when the data is one country's.\n- Always draw with the default borders; never wait on an answer about them.\n- Only where the user, their audience or their data is in a country whose\n borders the World Bank draws differently (a disputed area, a line of\n control, a claimed territory), add one line after the chart, once per\n conversation: e.g. \"Borders follow the World Bank's map; if this is for an\n audience in India, send your official boundary file and I'll switch to it.\"\n- If they send a file, pass it as `boundaries`. Flint ships no per-country\n official sets: do not invent a URL or swap in `\"natural-earth\"` for one.\n- Otherwise say nothing about borders." + ] + }, + "Choropleth": { + "note": "`text` names each region at its middle where it fits (small ones on zoom); `id` = region key (see guidance); props `region` (`\"world\"`/`\"us\"`), `level` (US: `\"state\"`/`\"county\"`/`\"auto\"`), `projection` (world), `boundaries`", + "properties": [ + { + "key": "region", + "values": "`us` | `world` | `auto` (`auto`)", + "effect": "Geographic scope" + }, + { + "key": "projection", + "values": "`mercator` | `equalEarth` | `orthographic` | `stereographic` | `conic` | `mollweide`", + "effect": "Map projection" + } + ], + "guidance": [ + "**Maps: what `id` accepts.** Flint joins the key to its own boundaries; you supply no geometry or lookup. A **world** map takes country names (\"India\", \"DR Congo\", \"United Kingdom\"), ISO 3166 alpha-2 / alpha-3 codes (\"IN\", \"IND\"), or ISO numeric codes (356), all in one column. A **US** map takes state names, USPS codes (\"CA\") or FIPS codes (6), and county FIPS (6037) with `level: \"county\"`. Declare the key `Country` or `State` in `semantic_types` (or set `chartProperties.region`) whenever codes could collide: \"CA\", \"IN\", \"Georgia\", or small numbers. A key that matches no region is not drawn. Map marks carry only `id`, `color` and `detail`: to link a map with charts keyed by a name column, encode that column as `id` (names resolve too) or put it on `detail` (e.g. `id: \"map_id\", detail: \"country\"`), which also labels the tooltip.", + "**Maps: `boundaries`.** Leave it unset: world maps draw the World Bank's official boundaries, US maps the Census Bureau's. `\"natural-earth\"` draws de facto borders instead. Only when the user gives a boundary file, pass it: `{ \"url\": \"...\", \"feature\": \"\", \"ids\": \"iso-numeric\" | \"iso3\" | \"iso2\" | \"fips\" | \"as-is\", \"key\": \"properties.code\", \"attribution\": \"...\" }` (`ids` says what the file's feature ids are; `as-is` matches the rows exactly).", + "**Maps: the user's region.** Where borders are drawn differs by country, and\nsome require their own official map. Never hold the chart for it:\n- Frame what the data covers: the map already fits the rows' countries or\n region; set `region` (or the US `level`) when the data is one country's.\n- Always draw with the default borders; never wait on an answer about them.\n- Only where the user, their audience or their data is in a country whose\n borders the World Bank draws differently (a disputed area, a line of\n control, a claimed territory), add one line after the chart, once per\n conversation: e.g. \"Borders follow the World Bank's map; if this is for an\n audience in India, send your official boundary file and I'll switch to it.\"\n- If they send a file, pass it as `boundaries`. Flint ships no per-country\n official sets: do not invent a URL or swap in `\"natural-earth\"` for one.\n- Otherwise say nothing about borders." + ] + } +}; + +/** Properties every positional or faceted chart takes; set only to force a non-default. */ +export const CROSS_CUTTING_PROPERTIES: ChartGuideProperty[] = [ + { + "key": "independentYAxis", + "values": "boolean", + "effect": "Faceted charts: give each panel its own y-scale." + }, + { + "key": "logScale_x / logScale_y", + "values": "boolean", + "effect": "Force a logarithmic axis." + }, + { + "key": "includeZero_x / includeZero_y", + "values": "boolean", + "effect": "Force the axis to include 0." + }, + { + "key": "xAxisType / yAxisType", + "values": "temporal | nominal", + "effect": "Force a temporal field to render as discrete bands, or the reverse." + }, + { + "key": "labelOverflow", + "values": "list of wrap | skip | rotate45 | rotate90", + "effect": "How x category names that do not fit take their band. Leave it out (names wrap, then stand upright; sequences print round values); set only when the user asks, e.g. [\"wrap\",\"rotate90\"] to label every year." + } +]; diff --git a/packages/flint-mcp/src/tools/list.ts b/packages/flint-mcp/src/tools/list.ts index c25f1111..02d19307 100644 --- a/packages/flint-mcp/src/tools/list.ts +++ b/packages/flint-mcp/src/tools/list.ts @@ -14,6 +14,7 @@ import { type InteractionPresetType, } from 'flint-chart'; import type { RenderBackend } from '../render/types.js'; +import { CHART_GUIDE, CROSS_CUTTING_PROPERTIES, type ChartGuideProperty } from './chart-guide.js'; const REGISTRY: Record = { vegalite: vlAllTemplateDefs, @@ -21,15 +22,24 @@ const REGISTRY: Record = { chartjs: cjsAllTemplateDefs, }; -export interface ChartTypeInfo { +export interface ChartTypeSummary { chartType: string; /** Encoding channels this chart type accepts (e.g. x, y, color, size). */ channels: string[]; + /** What the chart is for and how its channels read; Vega-Lite types only. */ + note?: string; +} + +export interface ChartTypeDetail extends ChartTypeSummary { + /** Advice that applies whenever this type is used (map keys, which bar chart). */ + guidance?: string[]; + /** Its chartProperties: values, default and effect. Set one only when the user asks. */ + properties: ChartGuideProperty[]; + /** Properties every positional or faceted chart takes. */ + crossCutting: ChartGuideProperty[]; /** * Interaction presets the chart type supports in `interaction_spec`, by - * declaration. The data can still remove one at mount: a legend needs a - * bound discrete legend channel, navigation needs a continuous axis. Empty - * for backends that run no interactions. + * declaration. The data can still remove one at mount. Empty for backends that run no interactions. */ interactions: InteractionPresetType[]; } @@ -37,14 +47,35 @@ export interface ChartTypeInfo { export interface BackendCatalog { backend: RenderBackend; count: number; - chartTypes: ChartTypeInfo[]; + chartTypes: ChartTypeSummary[]; } /** - * Enumerate the chart-type catalog (chart type + accepted channels) for one - * backend, or for all supported backends when `backend` is omitted. + * The chart-type catalog: each type, its channels and a one-line note, for one backend or all. + * With `chartType`, that one type in full: its guidance, chartProperties and interaction presets. */ -export function listChartTypes(backend?: RenderBackend): BackendCatalog[] { +export function listChartTypes(backend?: RenderBackend, chartType?: string): BackendCatalog[] | ChartTypeDetail { + if (chartType) { + const on = backend ?? 'vegalite'; + const defs = REGISTRY[on] ?? []; + // A near name ("choropleth map", "scatter") resolves when it points at one type. + const loose = (name: string) => name.toLowerCase().replace(/\s+(chart|map|plot)$/, '').trim(); + const near = defs.filter((d) => loose(d.chart) === loose(chartType)); + const def = defs.find((d) => d.chart === chartType) ?? (near.length === 1 ? near[0] : undefined); + if (!def) { + throw new Error(`Unknown chart type "${chartType}" for ${on}. Chart types: ${defs.map((d) => d.chart).sort().join(', ')}.`); + } + const guide = on === 'vegalite' ? CHART_GUIDE[def.chart] : undefined; + return { + chartType: def.chart, + channels: def.channels ?? [], + ...(guide?.note ? { note: guide.note } : {}), + ...(guide?.guidance ? { guidance: guide.guidance } : {}), + properties: guide?.properties ?? [], + crossCutting: CROSS_CUTTING_PROPERTIES, + interactions: supportedInteractionPresets(def.interactionSupport), + }; + } const backends: RenderBackend[] = backend ? [backend] : (Object.keys(REGISTRY) as RenderBackend[]); @@ -54,7 +85,7 @@ export function listChartTypes(backend?: RenderBackend): BackendCatalog[] { .map((d) => ({ chartType: d.chart, channels: d.channels ?? [], - interactions: supportedInteractionPresets(d.interactionSupport), + ...(b === 'vegalite' && CHART_GUIDE[d.chart] ? { note: CHART_GUIDE[d.chart].note } : {}), })) .sort((a, b2) => a.chartType.localeCompare(b2.chartType)); return { backend: b, count: chartTypes.length, chartTypes }; diff --git a/packages/flint-mcp/src/tools/schemas.ts b/packages/flint-mcp/src/tools/schemas.ts index ff3686d0..15ddd1be 100644 --- a/packages/flint-mcp/src/tools/schemas.ts +++ b/packages/flint-mcp/src/tools/schemas.ts @@ -4,6 +4,7 @@ import { z } from 'zod'; import { CHART_UPDATE_OPS, + DEPRECATED_UPDATE_OPS, INTERACTION_PRESET_TYPES, type ChartAssemblyInput, type InteractionPresetType, @@ -94,7 +95,7 @@ export const chartSpecSchema = z .object({ width: z.number(), height: z.number() }) .optional() .describe( - 'Target canvas size in px (default 400×320). Flint\'s layout model stretches around this base up to the ceiling.', + 'Target canvas size in px (default 400×320). Flint\'s layout model stretches around this base up to the ceiling. Set it to suit where the chart is shown when you know; when omitted the MCP card starts at 300×300, grows up to 1.5× for dense data, and fits the host\'s width.', ), canvasSize: z .object({ width: z.number(), height: z.number() }) @@ -120,7 +121,7 @@ export function buildAssemblyInputShape(disableFileReference = false) { .record(z.string(), z.any()) .optional() .describe( - 'Field name → semantic type, e.g. { revenue: "Quantity", country: "Country" }. A value may instead be an annotation object when the type alone understates what you know, e.g. { rating: { semanticType: "Score", intrinsicDomain: [1, 5] } } — see get_flint_skill with skill "chart", section "Step 3 — annotate with semantic types".', + 'Field name → semantic type, e.g. { revenue: "Quantity", country: "Country" }. A value may instead be an annotation object when the type alone understates what you know, e.g. { rating: { semanticType: "Score", intrinsicDomain: [1, 5] } } — see get_flint_skill with skill "chart", section "Semantic types".', ), chart_spec: chartSpecSchema, theme_spec: z @@ -150,7 +151,7 @@ export function buildAssemblyInputShape(disableFileReference = false) { }) .optional() .describe( - 'How the chart behaves on screen (Vega-Lite only). Lists interaction presets by type with their options nested under `options`. An entry the chart type cannot honour is dropped with a warning and the chart still renders; validate_chart reports the same warnings. Call get_flint_skill with skill "interaction", section "Add interactions to the chart", before you write one.', + 'How the chart behaves on screen (Vega-Lite only). Lists interaction presets by type with their options nested under `options`. An entry the chart type cannot honour is dropped with a warning and the chart still renders; validate_chart reports the same warnings. Call get_flint_skill with skill "interaction", section "Add interactions", before you write one.', ), options: z .record(z.string(), z.any()) @@ -186,18 +187,24 @@ export const updatesShape = { ops: z .array( z - .object({ op: z.enum(CHART_UPDATE_OPS) }) + .object({ + op: z + .enum([...CHART_UPDATE_OPS, ...(Object.keys(DEPRECATED_UPDATE_OPS) as Extract[])]) + .describe('The op. set-annotation is deprecated, still read until 2.0: it means annotate-text. Write annotate-text.'), + }) .passthrough() .describe( 'One ChartUpdate op, by op: ' + - 'set-style { targets: UpdateTarget[], value: { state?, opacity?, visible?, fill?, stroke? } }; ' + - "set-annotation { target: UpdateTarget, value: { text, anchor?: 'segment' | 'point' } | null }; " + + 'set-style { targets: UpdateTarget[], value: { state?, emphasis?: "light" | "strong" | "exclusive" (how far the rest recede when state is "emphasized"; default "light"), opacity?, visible?, fill?, stroke? } }; ' + + "annotate-text { target: UpdateTarget, value: { text, anchor?: 'segment' | 'point', highlight?: 'none' | 'light' | 'strong' | 'exclusive' } | null }: words beside one mark, never a card (draw a card or callout with set-overlay or set-freeform-overlay); " + + "annotate-region { name, value: { x?: [lo, hi] | categories, y?: [lo, hi] | categories, text?, color?, opacity?, layer?: 'under' | 'over', placement? } | null }; " + + "annotate-enclosure { name, value: { targets: UpdateTarget[], text?, shape?: 'hull' | 'rect' | 'ellipse' | 'circle', connect?: 'auto' | 'all' | 'none', color? } | null }; " + "set-viewport { axes: 'x' | 'y' | 'xy', value: { x?: [lo, hi], y?: [lo, hi] } }; " + "set-order { scope: 'category', field, values }; " + 'set-overlay { name, value: { mark, data: { values }, encodings: { x?, y?, x2?, y2? }, role, style? } | null }; ' + "set-freeform-overlay { name, value: { coordinateSpace: 'plot' | 'renderer', body } | null }; " + "set-data { source: 'main', value: { rows } }. " + - 'UpdateTarget is { select: { key: { field: value } } } for marks with those values, or, in set-style only, { select: { where: { field: { in: [...] } | { range: [low, high] } } } } for a set: a period, a band, several categories.', + "UpdateTarget is { select: { key: { field: value } } } for marks with those values, or, in set-style and an enclosure's targets, { select: { where: { field: { in: [...] } | { range: [low, high] } } } } for a set: a period, a band, several categories.", ), ) .describe('The ops of this layer, applied in order.'), @@ -242,3 +249,24 @@ export function toAssemblyInput(args: AssemblyInputArgs): ChartAssemblyInput { field_display_names: args.field_display_names, } as ChartAssemblyInput; } + +/** + * A tool's arguments that take the same fields as another tool's full schema, written as references + * to it: every tool definition rides in the model's prompt, so one full copy (on `show`) serves them + * all. Fields keep their names and whether they are required; the full schema checks them in the + * handler ({@link checkArgs}). + */ +export function referencedShape(shape: z.ZodRawShape, where: string): z.ZodRawShape { + return Object.fromEntries(Object.entries(shape).map(([key, schema]) => { + const loose = z.any().describe(`As \`${where}.${key}\` on the show tool.`); + return [key, schema.isOptional() ? loose.optional() : loose.refine((value) => value !== undefined, { message: 'Required' })]; + })); +} + +/** Arguments checked against a full schema, with every problem named by its path. */ +export function checkArgs(shape: T, args: unknown): z.infer> { + const parsed = z.object(shape).safeParse(args); + if (parsed.success) return parsed.data; + const problems = parsed.error.issues.map((issue) => `${issue.path.join('.') || '(arguments)'}: ${issue.message}`); + throw new Error(`Invalid arguments: ${problems.join('; ')}.`); +} diff --git a/packages/flint-mcp/tests/board.test.ts b/packages/flint-mcp/tests/board.test.ts index 1bdcf66d..ccd4a674 100644 --- a/packages/flint-mcp/tests/board.test.ts +++ b/packages/flint-mcp/tests/board.test.ts @@ -52,21 +52,22 @@ const showBoard = (board: Record): Promise => client.callT describe('board tools', () => { it('validate_board reports every chart and what each links, and opens no card; show draws the same board', async () => { - const spec = { title: 'Countries', charts: [scatter, bars], link_spec: { fields: ['country', 'region'] } }; + const spec = { title: 'Countries', charts: [{ ...scatter, chart_spec: { ...scatter.chart_spec, encodings: { ...scatter.chart_spec.encodings, detail: 'country' } } }, bars], link_spec: { fields: ['country'] } }; const result: any = await check(spec); expect(result.isError).toBeFalsy(); expect(text(result)).toContain('2 charts (countries, by-country)'); - expect(text(result)).toContain('Nothing is on screen: fix what this report asks in the spec, then call show with it.'); - expect(text(result)).toContain('## countries'); - expect(text(result)).toContain('Links (fields: country, region; one selection the whole board shares):'); - expect(text(result)).toContain('✓ countries: sends region by select; receives region; leaves out country: its marks do not carry country'); - expect(text(result)).toContain('✓ by-country: receives country; leaves out region: its marks do not carry region'); - expect(text(result)).toContain('sends nothing: no interaction that selects'); + // Two charts under a title ask for no deck or chart headings; link notes are not to fix. + expect(text(result)).toContain('Nothing to fix: call show with this spec.'); + expect(text(result)).toContain('Layout: row 1 (standard): countries (half), by-country (half).'); + expect(text(result)).toContain('Link notes (country); change nothing unless the user asked for that connection:'); + expect(text(result)).toContain('- by-country: sends nothing: no interaction that selects'); + expect(text(result)).not.toContain('Encodings:'); + expect(text(result)).not.toContain('User interactions'); expect(result._meta).toBeUndefined(); const shown: any = await showBoard(spec); expect(text(shown)).toContain('The board is on screen in a new card.'); - expect(text(shown)).toContain('✓ countries: sends region by select'); + expect(text(shown)).toContain('- by-country: sends nothing'); const board = shown._meta.flint.board; expect(board.charts.map((chart: any) => chart.id)).toEqual(['countries', 'by-country']); expect(board.linked['by-country']).toMatchObject({ sends: [], receives: ['country'] }); @@ -80,9 +81,10 @@ describe('board tools', () => { it('marks a chart that joins no field, honours receive: false, and names an unknown chart', async () => { const result: any = await check({ charts: [scatter, bars], link_spec: { fields: ['continent', 'region'], charts: { countries: { receive: false }, ghost: {} } } }); - expect(text(result)).toContain('✓ countries: sends region by select; leaves out continent: no field continent in its data; receives nothing (receive: false)'); + expect(text(result)).toContain('- countries: leaves out continent: no field continent in its data'); expect(text(result)).toContain('✗ by-country: not linked; leaves out continent'); expect(text(result)).toContain('✗ ghost: not linked; no chart "ghost" among the linked charts'); + expect(text(result)).toContain('✗ continent joins nothing: no chart carries it'); }); it('links a chart once its marks carry the field', async () => { @@ -91,20 +93,24 @@ describe('board tools', () => { expect(text(result)).toContain('✗ countries: not linked; leaves out country: its marks do not carry country; encode it, on detail'); const detailed = { ...scatter, chart_spec: { ...scatter.chart_spec, encodings: { ...scatter.chart_spec.encodings, detail: 'country' } } }; const fixed: any = await check({ charts: [detailed, clickable], link_spec: { fields: ['country'] } }); - expect(text(fixed)).toContain('✓ countries: sends country by select; receives country'); - expect(text(fixed)).toContain('✓ by-country: sends country by click-highlight; receives country'); + expect(text(fixed)).not.toContain('Links'); + // A bar chart of another category carries the linked field on detail, one segment per value. + const byRegion = { ...bars, id: 'by-region', semantic_types: { ...bars.semantic_types, region: 'Category' }, chart_spec: { ...bars.chart_spec, encodings: { x: 'region', y: 'gdp', detail: 'country' } } }; const hovering = { ...detailed, interaction_spec: { interactions: [{ type: 'select' }, { type: 'hover-group-focus', options: { groupBy: 'region' } }] } }; - const both: any = await showBoard({ charts: [hovering, clickable], link_spec: { fields: ['country', 'region'] } }); - expect(text(both)).toContain('✓ countries: sends country + region by select, region by hover-group-focus (hover); receives country, region'); + const both: any = await showBoard({ charts: [hovering, clickable, byRegion], link_spec: { fields: ['country', 'region'] } }); expect(both._meta.flint.board.linked.countries.gestures['hover-group-focus']).toEqual({ preset: 'hover-group-focus', fields: ['region'], hover: true }); + + const viaDetail: any = await showBoard({ charts: [detailed, byRegion], link_spec: { fields: ['country'] } }); + expect(text(viaDetail)).not.toContain('by-region: not linked'); + expect(viaDetail._meta.flint.board.linked['by-region']).toMatchObject({ receives: ['country'] }); }); it('validate_board leaves a chart with errors off and says why; show draws nothing for it', async () => { const spec = { charts: [scatter, { ...bars, chart_spec: { ...bars.chart_spec, chartType: 'Not A Chart' } }] }; const result: any = await check(spec); expect(text(result)).toContain('1 chart (countries)'); - expect(text(result)).toMatch(/## by-country\n✗ not drawn: /); + expect(text(result)).toMatch(/by-country:\n- ✗ not drawn: /); const shown: any = await showBoard(spec); expect(shown.isError).toBe(true); expect(text(shown)).toMatch(/^Nothing was drawn: by-country ✗ not drawn: .*Fix the spec and call show again\.$/); @@ -148,17 +154,15 @@ describe('board tools', () => { }; const charts = [kpi('k1', 'Sales'), kpi('k2', 'Margin'), kpi('k3', 'Churn'), trend, scatter, { ...bars, theme_spec: 'nyt' }]; const report = text(await check({ charts })); - expect(report).toContain('- row 1, KPI tiles (compact): k1 (a third), k2 (a third), k3 (a third)'); - expect(report).toContain('- row 2 (tall): trend (full width)'); - expect(report).toContain('- row 3 (standard): countries (half), by-country (half)'); + expect(report).toContain('Layout: row 1, KPI tiles (compact): k1 (a third), k2 (a third), k3 (a third); row 2 (tall): trend (full width); row 3 (standard): countries (half), by-country (half).'); expect(report).toContain('- No board title'); expect(report).toContain('- No title on trend:'); - expect(report).toContain('- trend, countries colour by region'); + expect(report).not.toContain('colour by region'); const themed = text(await check({ title: 'Countries', subtitle: 'GDP and life expectancy', theme_spec: 'economist', charts })); expect(themed).toContain('Charts set their own themes'); const narrowed = text(await check({ charts: [kpi('k1', 'Sales'), { ...trend, layout: { span: 1, height: 'compact' } }, scatter] })); - expect(narrowed).toContain('- row 2 (standard): trend (half), countries (half)'); + expect(narrowed).toContain('row 2 (standard): trend (half), countries (half)'); }); it('splits five KPI tiles three and two, and leaves a measure on colour alone', async () => { @@ -169,8 +173,7 @@ describe('board tools', () => { chart_spec: { chartType: 'Heatmap', title: id, encodings: { x: 'year', y: 'country', color: 'gdp' } }, }); const report = text(await check({ title: 'T', subtitle: 'S', charts: [kpi('a'), kpi('b'), kpi('c'), kpi('d'), kpi('e'), heat('h1'), heat('h2')] })); - expect(report).toContain('- row 1, KPI tiles (compact): a (a third), b (a third), c (a third)'); - expect(report).toContain('- row 2, KPI tiles (compact): d (half), e (half)'); + expect(report).toContain('row 1, KPI tiles (compact): a (a third), b (a third), c (a third); row 2, KPI tiles (compact): d (half), e (half)'); expect(report).not.toContain('colour by gdp'); }); @@ -178,37 +181,99 @@ describe('board tools', () => { const grid = [{ id: 'by-country', x: 0, y: 0, w: 12, h: 17 }, { id: 'countries', x: 0, y: 17, w: 6, h: 17 }]; const kept: any = await showBoard({ title: 'T', subtitle: 'S', charts: [scatter, bars], grid }); expect(kept._meta.flint.board.grid).toEqual(grid); - expect(text(kept)).toContain('Arranged on a 12-column grid (grid), as the reader left it; keep passing it.'); - expect(text(kept)).toContain('- by-country: columns 1–12, rows 1–17 (full width, 340px tall)'); + expect(text(kept)).toContain("Layout: the reader's grid; keep passing it, or leave it out for rows. by-country: columns 1–12, rows 1–17 (full width, 340px tall)"); const added: any = await check({ title: 'T', subtitle: 'S', charts: [scatter, bars, { ...bars, id: 'more' }], grid }); - expect(text(added)).toContain('- more: columns 1–6, rows 35–51'); + expect(text(added)).toContain('more: columns 1–6, rows 35–51'); const fewer: any = await check({ title: 'T', subtitle: 'S', charts: [scatter], grid }); expect(text(fewer)).not.toContain('by-country'); - expect(text(fewer)).toContain('- countries: columns 1–6, rows 18–34'); + expect(text(fewer)).toContain('countries: columns 1–6, rows 18–34'); const clash: any = await check({ title: 'T', subtitle: 'S', charts: [scatter, bars], grid: [grid[0], { ...grid[1], y: 5 }] }); expect(text(clash)).toContain('The grid was dropped for the rows: by-country overlaps another chart.'); - expect(text(clash)).toContain('- row 1 (standard): countries (half), by-country (half)'); + expect(text(clash)).toContain('Layout: row 1 (standard): countries (half), by-country (half).'); }); it('holds a Table of rows and a chart opened as its table', async () => { const table = { id: 'list', data: { values: rows }, chart_spec: { chartType: 'Table', title: 'Countries', encodings: {} } }; const shown: any = await showBoard({ title: 'T', subtitle: 'S', charts: [table, { ...bars, view: 'table' }], link_spec: { fields: ['country'] } }); - expect(text(shown)).toContain('Opens as the table of the rows it draws'); - expect(text(shown)).toContain('list: receives country'); + expect(text(shown)).toContain('- list: sends nothing: a Table does not send selections'); expect(shown._meta.flint.board.charts.map((chart: any) => chart.view)).toEqual([undefined, 'table']); const encoded: any = await check({ charts: [{ ...table, id: 'bad', chart_spec: { chartType: 'Table', encodings: { x: 'country' } } }] }); expect(text(encoded)).toContain('Table takes no encodings'); }); + it('says a finding several charts share once, and that a clean board has nothing to fix', async () => { + const odd = { gdp: 'Wealth', life: 'Quantity', country: 'Country', region: 'Category' }; + const report = text(await check({ title: 'T', subtitle: 'S', charts: [{ ...scatter, semantic_types: odd }, { ...bars, semantic_types: odd }] })); + expect(report).toContain('countries, by-country:\n- semantic_types.gdp "Wealth" is not a registered semantic type'); + expect(report.match(/"Wealth"/g)).toHaveLength(1); + + const carried = { ...scatter, chart_spec: { ...scatter.chart_spec, encodings: { ...scatter.chart_spec.encodings, detail: 'country' } } }; + const byRegion = { ...bars, id: 'by-region', semantic_types: { ...bars.semantic_types, region: 'Category' }, chart_spec: { ...bars.chart_spec, encodings: { x: 'region', y: 'gdp', detail: 'country' } } }; + const noted = text(await check({ title: 'T', subtitle: 'S', charts: [carried, { ...bars, interaction_spec: { interactions: [{ type: 'click-highlight' }] } }, byRegion], link_spec: { fields: ['country', 'region'] } })); + expect(noted).toContain('Nothing to fix: call show with this spec.'); + expect(noted).toContain('- by-country: leaves out region'); + + const clean = text(await check({ title: 'T', subtitle: 'S', charts: [scatter, bars] })); + expect(clean).toBe('Board "T": 2 charts (countries, by-country).\nNothing to fix: call show with this spec.\nLayout: row 1 (standard): countries (half), by-country (half).'); + }); + it('flags a chart that stacks repeated rows as slices, and not once it sums them', async () => { const monthly = [1, 2, 3].flatMap((month) => rows.map((row) => ({ ...row, month }))); const sliced = { id: 'sliced', data: { values: monthly }, chart_spec: { chartType: 'Bar Chart', title: 'GDP', encodings: { y: 'country', x: 'gdp', color: 'region' } } }; expect(text(await check({ title: 'T', subtitle: 'S', charts: [sliced] }))).toContain('sliced draws 12 rows as 4 country × region groups, so each mark is a stack of slices, one per row: sum the rows first, or set encodings.x.aggregate to "sum"'); const summed = { ...sliced, chart_spec: { ...sliced.chart_spec, encodings: { y: 'country', x: { field: 'gdp', aggregate: 'sum' }, color: 'region' } } }; expect(text(await check({ title: 'T', subtitle: 'S', charts: [summed] }))).not.toContain('stack of slices'); + // A number that splits the marks (a year on a heatmap's axis) is a category, not the measure. + const cells = { id: 'cells', data: { values: monthly }, semantic_types: { month: 'Month', country: 'Country', gdp: 'Amount' }, chart_spec: { chartType: 'Heatmap', title: 'GDP', encodings: { x: 'month', y: 'country', color: 'gdp' } } }; + expect(text(await check({ title: 'T', subtitle: 'S', charts: [cells] }))).not.toContain('stack of slices'); + // A heatmap coloured by a field not typed as a measure (match points) still reads its colour as the measure. + const games = [1, 2, 3, 4, 5, 6].flatMap((game) => rows.map((row) => ({ country: row.country, game, points: game % 2 ? 3 : 0 }))); + const results = { id: 'results', data: { values: games }, semantic_types: { game: 'Number', country: 'Country', points: 'Category' }, chart_spec: { chartType: 'Heatmap', title: 'Results', encodings: { x: 'game', y: 'country', color: 'points' } } }; + expect(text(await check({ title: 'T', subtitle: 'S', charts: [results] }))).not.toContain('stack of slices'); + }); + + it('show holds a board it must not draw and returns the fixes; the fixed board draws', async () => { + const monthly = [1, 2, 3].flatMap((month) => rows.map((row) => ({ ...row, month }))); + const sliced = { id: 'sliced', data: { values: monthly }, chart_spec: { chartType: 'Bar Chart', title: 'GDP', encodings: { y: 'country', x: 'gdp' } } }; + const held: any = await showBoard({ title: 'T', charts: [sliced, scatter] }); + expect(held.isError).toBe(true); + expect(held._meta.flint.held).toBeTruthy(); + expect(held._meta.flint.board).toBeUndefined(); + expect(text(held)).toContain('Not drawn yet: fix what this report lists'); + expect(text(held)).toContain('Fix before it draws:\nReview:\n- sliced draws 12 rows as 4 country groups'); + const summed = { ...sliced, chart_spec: { ...sliced.chart_spec, encodings: { y: 'country', x: { field: 'gdp', aggregate: 'sum' } } } }; + const drawn: any = await showBoard({ title: 'T', charts: [summed, scatter] }); + expect(drawn.isError).toBeFalsy(); + expect(text(drawn)).toContain('The board is on screen in a new card.'); + }); + + it('says nothing of a KPI tile or a chart taken out of the link', async () => { + const tile = { id: 'tile', data: { values: [{ metric: 'GDP', value: 13 }] }, chart_spec: { chartType: 'KPI Card', encodings: { metric: 'metric', value: 'value' } } }; + const carried = { ...scatter, chart_spec: { ...scatter.chart_spec, encodings: { ...scatter.chart_spec.encodings, detail: 'country' } } }; + const clickable = { ...bars, interaction_spec: { interactions: [{ type: 'click-highlight' }] } }; + const out = { ...bars, id: 'aside', chart_spec: { ...bars.chart_spec, encodings: { x: 'region', y: 'gdp', detail: 'country' } } }; + const report = text(await check({ title: 'T', subtitle: 'S', charts: [tile, carried, clickable, out], link_spec: { fields: ['country'], charts: { aside: { send: false, receive: false } } } })); + expect(report).toContain('Nothing to fix'); + expect(report).not.toMatch(/^- (✗ )?(tile|aside)\b/m); + }); + + it('binds the board\'s colours to every chart that colours by the field, under a chart\'s own', async () => { + const byRegion = { ...bars, id: 'by-region', semantic_types: { region: 'Category', gdp: 'Quantity' }, chart_spec: { chartType: 'Bar Chart', title: 'G', encodings: { x: 'region', y: 'gdp', color: 'region', detail: 'country' } } }; + const own = { ...scatter, semantic_types: { ...scatter.semantic_types, region: { semanticType: 'Category', colors: { Asia: '#000000' } } } }; + const shown: any = await showBoard({ title: 'T', colors: { region: { Asia: '#c0392b', Europe: '#2e75b6' } }, charts: [own, byRegion, bars] }); + const [countries, regions, plain] = shown._meta.flint.board.charts; + expect(regions.input.semantic_types.region.colors).toEqual({ Asia: '#c0392b', Europe: '#2e75b6' }); + expect(countries.input.semantic_types.region.colors).toEqual({ Asia: '#000000', Europe: '#2e75b6' }); + expect(plain.input.semantic_types.region).toBeUndefined(); + expect(shown._meta.flint.board.colors).toEqual({ region: { Asia: '#c0392b', Europe: '#2e75b6' } }); + }); + + it('notes a chart that sizes itself on a board: the layout sizes it', async () => { + const sized = { ...bars, chart_spec: { ...bars.chart_spec, baseSize: { width: 1000, height: 400 } } }; + expect(text(await check({ title: 'T', charts: [scatter, sized] }))).toContain('by-country set baseSize or canvasSize: on a board each chart takes its cell\'s size'); }); it('show also puts a small inline chart in structuredContent, for a host that drops _meta', async () => { diff --git a/packages/flint-mcp/tests/chart-context.test.ts b/packages/flint-mcp/tests/chart-context.test.ts index 6607f8e2..51c23af4 100644 --- a/packages/flint-mcp/tests/chart-context.test.ts +++ b/packages/flint-mcp/tests/chart-context.test.ts @@ -112,14 +112,14 @@ describe('chartContext agent updates', () => { }); it('reports each note once, at its key', () => { - const note = (weight: number, label: string) => ({ op: 'set-annotation' as const, target: { select: { key: { weight } } }, value: { text: label } }); + const note = (weight: number, label: string) => ({ op: 'annotate-text' as const, target: { select: { key: { weight } } }, value: { text: label } }); const updates: ChartUpdate[] = [{ id: 'best', ops: [note(2000, 'Best mileage'), note(3200, 'Heaviest')] }]; const lines = text({ state: state({}), updates }).split('\n'); expect(lines.slice(3, 6)).toEqual(['- best:', ' ✓ note "Best mileage" at weight = 2000', ' ✓ note "Heaviest" at weight = 3200']); }); it('says which notes a zoom has left out of view', () => { - const note = (weight: number, label: string) => ({ op: 'set-annotation' as const, target: { select: { key: { weight } } }, value: { text: label } }); + const note = (weight: number, label: string) => ({ op: 'annotate-text' as const, target: { select: { key: { weight } } }, value: { text: label } }); const updates: ChartUpdate[] = [{ id: 'best', ops: [note(2000, 'Best mileage'), note(3200, 'Heaviest')] }]; const annotations = [ { id: 'best', target: note(2000, '').target, text: 'Best mileage', inView: false }, diff --git a/packages/flint-mcp/tests/http.test.ts b/packages/flint-mcp/tests/http.test.ts index a6ae4b66..53287c49 100644 --- a/packages/flint-mcp/tests/http.test.ts +++ b/packages/flint-mcp/tests/http.test.ts @@ -91,11 +91,13 @@ describe('MCP server over HTTP (stateless streamable transport)', () => { expect(text).toMatch(/disabled/i); }); - it('documents data.url as disabled in the render_chart input schema', async () => { + it('documents data.url as disabled in show, the schema every chart tool refers to', async () => { const { tools } = await client.listTools(); - const render = tools.find((t) => t.name === 'render_chart'); - const urlSchema: any = (render?.inputSchema as any)?.properties?.data?.properties?.url; + const show = tools.find((t) => t.name === 'show'); + const urlSchema: any = (show?.inputSchema as any)?.properties?.chart?.properties?.data?.properties?.url; expect(urlSchema?.description).toMatch(/disabled/i); + const render = tools.find((t) => t.name === 'render_chart'); + expect((render?.inputSchema as any)?.properties?.data?.description).toBe('As `chart.data` on the show tool.'); }); it('serves a health endpoint', async () => { diff --git a/packages/flint-mcp/tests/preview-size.test.ts b/packages/flint-mcp/tests/preview-size.test.ts index c233f0c1..9b0f1e4d 100644 --- a/packages/flint-mcp/tests/preview-size.test.ts +++ b/packages/flint-mcp/tests/preview-size.test.ts @@ -15,7 +15,7 @@ import { compile } from 'vega-lite'; import { parse, View } from 'vega'; import type { ChartAssemblyInput } from 'flint-chart'; import { THEME_PRESETS } from 'flint-chart'; -import { assemblePreviewSpec, APP_PREVIEW_CANVAS_SIZE, usesAutoPreviewSize, withAppPreviewDefaults } from '../ui/src/render.js'; +import { assemblePreviewSpec, APP_PREVIEW_CANVAS_SIZE, withAppPreviewDefaults } from '../ui/src/render.js'; /** A titled, decked, banded bar chart — the shape a real tool call produces. */ function bars(themeId?: string): ChartAssemblyInput { @@ -77,9 +77,10 @@ describe('the preview renders into the room it is given', () => { }); it('lets a sparse band chart spend the frame in the layout, not after it', async () => { + // The room is wider than the chart may grow, so the bands spend the 1.5x ceiling. const sparse = await renderedSize(assemblePreviewSpec(bars(), { width: 584 })); - expect(sparse.width).toBeGreaterThan(584 * 0.75); - expect(sparse.width).toBeLessThanOrEqual(584 * 1.08); + expect(sparse.width).toBeGreaterThan(450 * 0.75); + expect(sparse.width).toBeLessThanOrEqual(450 * 1.08); // The bands are wide enough for the labels, so the layout lays them flat. const spec = assemblePreviewSpec(bars(), { width: 584 }) as any; expect(spec.encoding?.x?.axis?.labelAngle ?? 0).toBe(0); @@ -92,39 +93,62 @@ describe('the preview renders into the room it is given', () => { expect(collapsed).toEqual(absent); }); - it('still lets a caller state its own size', async () => { - // A stated size opts out of the preview's sizing entirely, so the measured - // frame must make no difference at all. + it('keeps a stated canvasSize where it fits, and lays it out again where it does not', async () => { const stated = () => { const input = bars('swiss'); - input.chart_spec.baseSize = { width: 700, height: 300 }; - input.chart_spec.canvasSize = { width: 700, height: 300 }; + input.chart_spec.baseSize = { width: 400, height: 300 }; + input.chart_spec.canvasSize = { width: 400, height: 300 }; return input; }; - const narrowFrame = await renderedSize(assemblePreviewSpec(stated(), { width: 320 })); const wideFrame = await renderedSize(assemblePreviewSpec(stated(), { width: 584 })); const noFrame = await renderedSize(assemblePreviewSpec(stated())); - expect(narrowFrame).toEqual(wideFrame); - expect(narrowFrame).toEqual(noFrame); + expect(wideFrame).toEqual(noFrame); + // A host narrower than the stated size is the safeguard: the chart is laid out for it, not shrunk. + const narrowFrame = await renderedSize(assemblePreviewSpec(stated(), { width: 320 })); + expect(narrowFrame.width).toBeLessThanOrEqual(320 * 1.08); }); it('fits sparse bands to the room unless the caller chose otherwise', () => { expect(withAppPreviewDefaults(bars()).options?.bandStepFit).toBe(1); const chosen = { ...bars(), options: { bandStepFit: 0 } }; expect(withAppPreviewDefaults(chosen).options?.bandStepFit).toBe(0); - const stated = bars(); - stated.chart_spec.baseSize = { width: 700, height: 300 }; - expect(withAppPreviewDefaults(stated)).toBe(stated); }); - it('lays the live chart out for the frame only when the preview picks the size', () => { - // The live chart relays out to the frame under the same rule the export uses. - expect(usesAutoPreviewSize(bars())).toBe(true); + it('grows a chart up to 1.5x its footprint, and never past the room', () => { + const plain = withAppPreviewDefaults(bars(), { width: 900 }); + expect(plain.chart_spec.baseSize).toEqual({ width: 300, height: 300 }); + expect(plain.chart_spec.canvasSize).toEqual({ width: 450, height: 450 }); + // The agent knows where it is shown: its footprint leads, under the same rule. const stated = bars(); - stated.chart_spec.canvasSize = { width: 700, height: 300 }; - expect(usesAutoPreviewSize(stated)).toBe(false); + stated.chart_spec.baseSize = { width: 760, height: 480 }; + const fitted = withAppPreviewDefaults(stated, { width: 640 }); + expect(fitted.chart_spec.baseSize).toEqual({ width: 640, height: 468 }); + expect(fitted.chart_spec.canvasSize).toEqual({ width: 640, height: 468 }); }); + it('keeps a stated baseSize inside the room, so dense data does not shrink the type', async () => { + // Weekly closes over a decade: left uncapped, the layout stretches well past the frame. + const values = []; + for (let week = 0; week < 520; week += 1) { + for (const symbol of ['A', 'B', 'C']) { + values.push({ symbol, date: new Date(Date.UTC(2013, 0, 4 + week * 7)).toISOString().slice(0, 10), close: 100 + week + symbol.charCodeAt(0) }); + } + } + const input: ChartAssemblyInput = { + data: { values }, + semantic_types: { symbol: 'Category', date: 'Date', close: 'Price' }, + chart_spec: { + chartType: 'Line Chart', + encodings: { x: { field: 'date' }, y: { field: 'close' }, color: { field: 'symbol' } }, + title: 'Closes', + baseSize: { width: 760, height: 480 }, + }, + }; + const size = await renderedSize(assemblePreviewSpec(input, { width: 640 })); + expect(size.width).toBeLessThanOrEqual(640 * 1.08); + }); + + it('leaves the house in charge of the type', async () => { // The frame decides how much room there is, not how big the type is: the // same house must read the same at any frame width it fits in. diff --git a/packages/flint-mcp/tests/render.test.ts b/packages/flint-mcp/tests/render.test.ts index c30d5384..bbc21cb6 100644 --- a/packages/flint-mcp/tests/render.test.ts +++ b/packages/flint-mcp/tests/render.test.ts @@ -147,3 +147,15 @@ describe('house styling survives the render', () => { expect(themed.buffer!.length).toBeGreaterThan(1000); }); }); + +describe('static maps', () => { + it('draws a choropleth\'s regions from the bundled boundaries, fetching nothing', async () => { + const res = await renderChart({ + data: { values: [{ state: 'TX', count: 9 }, { state: 'CA', count: 3 }] }, + semantic_types: { state: 'State', count: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'state', color: 'count' }, chartProperties: { region: 'us' } }, + } as ChartAssemblyInput, 'vegalite', { format: 'svg' }); + // Fifty states and DC, not just the legend. + expect((res.svg as string).match(/ { chart_spec: { chartType: 'Bar Chart', encodings: { x: 'region', y: 'revenue' } }, }, }); - expect(JSON.parse(result.content[0].text).valid).toBe(true); + expect(result.content[0].text).toBe('Nothing to fix: call show with this spec.'); } finally { await rootsClient.close(); await rootsServer.close(); @@ -109,6 +109,7 @@ describe('MCP server', () => { ['theme', 'flint://theme-skill'], ['interaction', 'flint://interaction-skill'], ['board', 'flint://board-skill'], + ['app', 'flint://app-skill'], ]) { const res: any = await client.callTool({ name: 'get_flint_skill', arguments: { skill } }); const resource: any = await client.readResource({ uri }); @@ -124,8 +125,15 @@ describe('MCP server', () => { }); const text: string = res.content[0].text; expect(text.startsWith('## Update the chart\n')).toBe(true); - expect(text).toContain('### Step 2 — choose ops'); - expect(text).not.toContain('## Use Flint in an application'); + expect(text).toContain('### Ops'); + expect(text).not.toContain('## Worked examples'); + + const sub: any = await client.callTool({ + name: 'get_flint_skill', + arguments: { skill: 'interaction', section: 'muted annotations' }, + }); + expect(sub.content[0].text.startsWith('### Muted annotations\n')).toBe(true); + expect(sub.content[0].text).not.toContain('### The state'); const bad: any = await client.callTool({ name: 'get_flint_skill', @@ -142,6 +150,7 @@ describe('MCP server', () => { expect(() => skillSection(text, 'Update')).toThrow('No section "Update"'); expect(() => skillSection(text, 'Upd')).toThrow('No section "Upd"'); expect(skillSection(text, 'Update the board')).toBe('## Update the board\nD\n'); + expect(skillSection(text, 'write spec')).toBe('## Step 4 — write the spec\nA\n'); }); it('render_chart returns inline PNG image content', async () => { @@ -180,6 +189,15 @@ describe('MCP server', () => { expect(Array.isArray(payload.warnings)).toBe(true); }); + it('checks the arguments of a tool that refers to show\'s schema against the full schema', async () => { + const { tools } = await client.listTools(); + const compile = tools.find((t) => t.name === 'compile_chart') as any; + expect(compile.inputSchema.properties.chart_spec).toEqual({ description: 'As `chart.chart_spec` on the show tool.' }); + const res: any = await client.callTool({ name: 'compile_chart', arguments: { backend: 'vegalite', data: { values: [] }, chart_spec: { encodings: {} } } }); + expect(res.isError).toBe(true); + expect(res.content[0].text).toContain('Invalid arguments: chart_spec.chartType: Required.'); + }); + it('validate_chart flags an unknown chart type as invalid', async () => { const res: any = await client.callTool({ name: 'validate_chart', @@ -189,18 +207,19 @@ describe('MCP server', () => { backend: 'vegalite', }, }); - const payload = JSON.parse(res.content[0].text); - expect(payload.valid).toBe(false); - expect(payload.errors.length).toBeGreaterThan(0); + expect(res.content).toHaveLength(1); + expect(res.content[0].text).toMatch(/^Nothing is on screen: fix what this report lists, then call show with the whole spec\.\nFix before it draws:\n- ✗ .*Not A Real Chart/); }); - it('validate_chart accepts a valid spec', async () => { + it('validate_chart accepts a valid spec, and keeps the JSON result for other backends', async () => { const res: any = await client.callTool({ name: 'validate_chart', arguments: { ...barChart, backend: 'vegalite' }, }); - const payload = JSON.parse(res.content[0].text); - expect(payload.valid).toBe(true); + expect(res.content).toHaveLength(1); + expect(res.content[0].text).toBe('Nothing to fix: call show with this spec.'); + const echarts: any = await client.callTool({ name: 'validate_chart', arguments: { ...barChart, backend: 'echarts' } }); + expect(JSON.parse(echarts.content[0].text).valid).toBe(true); }); it('validate_chart rejects malformed specs before assembly', async () => { @@ -216,9 +235,7 @@ describe('MCP server', () => { name: 'validate_chart', arguments: { ...barChart, chart_spec, backend: 'vegalite' }, }); - const payload = JSON.parse(res.content[0].text); - expect(payload.valid).toBe(false); - expect(payload.errors.length).toBeGreaterThan(0); + expect(res.content[0].text).toContain('- ✗ '); } }); @@ -255,13 +272,22 @@ describe('MCP server', () => { expect(payload[0].count).toBeGreaterThan(10); expect(payload[0].chartTypes[0]).toHaveProperty('chartType'); expect(payload[0].chartTypes[0]).toHaveProperty('channels'); - expect(payload[0].chartTypes[0]).toHaveProperty('interactions'); - const bar = payload[0].chartTypes.find((entry: any) => entry.chartType === 'Bar Chart'); + expect(payload[0].chartTypes[0]).toHaveProperty('note'); + expect(payload[0].chartTypes[0]).not.toHaveProperty('interactions'); + // Every Vega-Lite type carries its guide: a type without one leaves the agent no properties. + expect(payload[0].chartTypes.filter((entry: any) => !entry.note).map((entry: any) => entry.chartType)).toEqual([]); + + const detail = async (chartType: string) => JSON.parse((await client.callTool({ + name: 'list_chart_types', + arguments: { backend: 'vegalite', chartType }, + }) as any).content[0].text); + const bar = await detail('Bar Chart'); expect(bar.interactions).toContain('click-highlight'); expect(bar.interactions).toContain('drag-reorder'); expect(bar.interactions).not.toContain('brush-angle'); - const kpi = payload[0].chartTypes.find((entry: any) => entry.chartType === 'KPI Card'); - expect(kpi.interactions).not.toContain('legend-toggle'); + expect(bar.channels).toContain('detail'); + expect((await detail('KPI Card')).interactions).not.toContain('legend-toggle'); + expect((await detail('choropleth map')).chartType).toBe('Choropleth'); }); it('validate_chart reports the interaction_spec entries the chart would drop', async () => { @@ -275,11 +301,10 @@ describe('MCP server', () => { interaction_spec: { interactions: [{ type: 'click-highlight' }, { type: 'legend-toggle' }] }, }, }); - const payload = JSON.parse(res.content[0].text); - expect(payload.valid).toBe(true); - const dropped = payload.warnings.filter((warning: any) => warning.code === 'unsupported_interaction'); - expect(dropped).toHaveLength(1); - expect(dropped[0].message).toContain('"legend-toggle" requires a discrete legend; Bar Chart has none'); + const report = res.content[0].text; + expect(report).not.toContain('✗'); + expect(report.match(/requires/g)).toHaveLength(1); + expect(report).toContain('"legend-toggle" requires a discrete legend; Bar Chart has none'); }); it('validate_chart and show take updates beside the input, and reject a malformed layer', async () => { @@ -290,23 +315,20 @@ describe('MCP server', () => { }; const layer = { id: 'agent', ops: [{ op: 'set-style', targets: [{ select: { key: { region: 'East' } } }], value: { state: 'emphasized' } }] }; const ok: any = await client.callTool({ name: 'validate_chart', arguments: { ...base, backend: 'vegalite', updates: [layer] } }); - expect(JSON.parse(ok.content[0].text).valid).toBe(true); - expect(ok.content[1].text).toContain('- agent:\n ✓ emphasizes marks where region = East'); + expect(ok.content[0].text).toContain('- All 1 update ops apply.'); const shorthand = { id: 'goal', ops: [{ op: 'set-overlay', name: 'goal', value: { mark: 'rule', role: 'reference', data: { values: [{ v: 100 }] }, encodings: { y: 'v' } } }], }; const off: any = await client.callTool({ name: 'validate_chart', arguments: { ...base, backend: 'vegalite', updates: [shorthand] } }); - expect(off.content[1].text).toContain('✗ overlay "goal" (rule, 1 row): encodings.y must be { "field": "v" }, not "v".'); + expect(off.content[0].text).toContain('- 1 of 1 update ops do not apply; the chart draws without them.'); + expect(off.content[0].text).toContain('overlay "goal" (rule, 1 row): encodings.y must be { "field": "v" }, not "v".'); const bad: any = await client.callTool({ name: 'validate_chart', arguments: { ...base, backend: 'vegalite', updates: [layer, { id: 'agent', ops: [] }] }, }); expect(bad.isError).toBeFalsy(); - const payload = JSON.parse(bad.content[0].text); - expect(payload.valid).toBe(false); - expect(payload.errors[0]).toMatchObject({ code: 'invalid_updates' }); - expect(payload.errors[0].message).toContain('updates[1]: duplicate id "agent"'); + expect(bad.content[0].text).toContain('- ✗ updates[1]: duplicate id "agent"'); // An unknown op name never reaches the handler: the schema enum rejects it. const unknownOp: any = await client.callTool({ name: 'validate_chart', @@ -316,7 +338,7 @@ describe('MCP server', () => { expect(unknownOp.content[0].text).toContain('set-style'); const view = await drawChart({ ...base, updates: [layer] }); expect(view.created.isError).toBeFalsy(); - expect(view.created.content[0].text).toContain('Agent updates (yours):\n- agent:\n ✓ emphasizes marks where region = East'); + expect(view.created.content[0].text).toContain('- All 1 update ops apply.'); expect(view.chart.updates).toEqual([layer]); const viewBad = await drawChart({ ...base, updates: [{ id: '', ops: [] }] }); expect(viewBad.created.isError).toBe(true); @@ -325,15 +347,14 @@ describe('MCP server', () => { const viewOff = await drawChart({ ...base, updates: [layer, shorthand] }); expect(viewOff.created.isError).toBeFalsy(); expect(viewOff.chart.updates).toEqual([layer, shorthand]); - expect(viewOff.created.content[0].text).toContain('1 of 2 update ops do not apply (✗ below); the chart draws without them.'); - expect(viewOff.created.content[0].text).toContain('✗ overlay "goal"'); + expect(viewOff.created.content[0].text).toContain('1 of 2 update ops do not apply; the chart draws without them.'); + expect(viewOff.created.content[0].text).toContain('Update "goal" will not apply overlay "goal"'); }); it('show opens a chart as its table when asked, and draws a Table chart type as a table', async () => { const data = { values: [{ region: 'East', revenue: 120 }, { region: 'West', revenue: 90 }] }; const bars = { data, chart_spec: { chartType: 'Bar Chart', encodings: { x: 'region', y: 'revenue' } } }; const asTable = await drawChart({ ...bars, view: 'table' }); - expect(asTable.created.content[0].text).toContain('Opens as the table of the rows it draws'); expect(asTable.chart.view).toBe('table'); const asChart = await drawChart(bars); expect(asChart.chart.view).toBeUndefined(); @@ -356,7 +377,7 @@ describe('MCP server', () => { it('validate_chart checks a chart and keeps nothing; show draws the spec it is given, each in a new card', async () => { const checked: any = await client.callTool({ name: 'validate_chart', arguments: { ...barChart, backend: 'vegalite' } }); - expect(checked.content[1].text).toContain('Bar Chart'); + expect(checked.content[0].text).toBe('Nothing to fix: call show with this spec.'); const first: any = await client.callTool({ name: 'show', arguments: { chart: barChart } }); expect(first.content[0].text).toContain('The chart is on screen in a new card.'); expect(first._meta.flint.board).toMatchObject({ kind: 'chart', charts: [{ id: 'chart' }] }); @@ -370,27 +391,36 @@ describe('MCP server', () => { data: { values: [{ region: 'East', revenue: 120 }, { region: 'West', revenue: 90 }] }, chart_spec: { chartType: 'Bar Chart', encodings: { x: 'region', y: 'revenue' } }, }; - const note = { op: 'set-annotation', target: { select: { key: { region: 'West' } } }, value: { text: 'Lowest' } }; + const note = { op: 'annotate-text', target: { select: { key: { region: 'West' } } }, value: { text: 'Lowest' } }; const ok: any = await client.callTool({ name: 'validate_chart', arguments: { ...base, backend: 'vegalite', updates: [{ id: 'agent', ops: [note] }] }, }); - expect(JSON.parse(ok.content[0].text).valid).toBe(true); + expect(ok.content[0].text).toContain('- All 1 update ops apply.'); + const old: any = await client.callTool({ + name: 'validate_chart', + arguments: { ...base, backend: 'vegalite', updates: [{ id: 'agent', ops: [{ ...note, op: 'set-annotation' }] }] }, + }); + expect(old.isError).toBeFalsy(); + expect(old.content[0].text).toContain('op "set-annotation" is deprecated'); for (const op of [ - { op: 'set-annotation', foo: 1 }, - { op: 'set-annotation', annotations: [{ kind: 'rule', x: '2022-12-01', label: 'ChatGPT launch' }] }, + { op: 'annotate-text', foo: 1 }, + { op: 'annotate-text', annotations: [{ kind: 'rule', x: '2022-12-01', label: 'ChatGPT launch' }] }, ]) { const bad: any = await client.callTool({ name: 'show', arguments: { chart: { ...base, updates: [{ id: 'agent', ops: [op] }] } }, }); expect(bad.isError).toBe(true); - expect(bad.content[0].text).toContain('set-annotation has a missing or malformed "target". Shape:'); + expect(bad.content[0].text).toContain('annotate-text has a missing or malformed "target". Shape:'); } const { tools } = await client.listTools(); const view = tools.find((tool) => tool.name === 'show')!; const schemaText = JSON.stringify(view.inputSchema); - expect(schemaText).toContain("set-annotation { target: UpdateTarget, value: { text, anchor?: 'segment' | 'point' } | null }"); + expect(schemaText).toContain("annotate-text { target: UpdateTarget, value: { text, anchor?: 'segment' | 'point', highlight?: 'none' | 'light' | 'strong' | 'exclusive' } | null }: words beside one mark, never a card"); + expect(schemaText).toContain('set-annotation is deprecated, still read until 2.0: it means annotate-text.'); + expect(schemaText).toContain('annotate-region { name, value: { x?: [lo, hi] | categories'); + expect(schemaText).toContain('annotate-enclosure { name, value: { targets: UpdateTarget[]'); }); it('render_chart surfaces assembly errors as isError', async () => { @@ -424,7 +454,7 @@ describe('MCP server', () => { const read = await client.readResource({ uri: 'flint://agent-skill' }); expect(read.contents[0].mimeType).toBe('text/markdown'); const skillText = resourceText(read.contents[0]); - expect(skillText).toContain('# flint-chart: authoring and using a chart spec'); + expect(skillText).toContain('# flint-chart: authoring a chart spec'); expect(skillText).toContain('validate_chart'); }); @@ -449,7 +479,7 @@ describe('MCP server', () => { const read = await client.readResource({ uri: 'flint://interaction-skill' }); const skillText = resourceText(read.contents[0]); expect(skillText).toContain('# flint-chart: interactions and updates on a chart'); - expect(skillText).toContain('Return the bare object'); + expect(skillText).toContain('Fix or drop what it warns about.'); }); it('opens a card only from show, linked to the one UI resource', async () => { @@ -461,7 +491,7 @@ describe('MCP server', () => { const { created, chart } = await drawChart({ ...barChart }); expect(created.isError).toBeFalsy(); expect(chart.input.chart_spec.chartType).toBe('Bar Chart'); - expect(created.content[0].text).toContain('Bar Chart'); + expect(created.content[0].text).toContain('The chart is on screen in a new card.'); }); it('serves the view UI resource', async () => { diff --git a/packages/flint-mcp/tests/skills.test.ts b/packages/flint-mcp/tests/skills.test.ts index c32a9a6f..392e9692 100644 --- a/packages/flint-mcp/tests/skills.test.ts +++ b/packages/flint-mcp/tests/skills.test.ts @@ -6,7 +6,7 @@ import { INTERACTION_PRESET_REQUIREMENTS } from 'flint-chart'; const root = new URL('../../../', import.meta.url); const read = (path: string) => readFileSync(fileURLToPath(new URL(path, root)), 'utf8'); -const SKILLS = ['flint-chart-author', 'flint-theme-author', 'flint-interaction-author', 'flint-board-author']; +const SKILLS = ['flint-chart-author', 'flint-theme-author', 'flint-interaction-author', 'flint-board-author', 'flint-app-author']; const interactionSkill = read('agent-skills/flint-interaction-author/SKILL.md'); describe('agent skills', () => { @@ -25,7 +25,7 @@ describe('agent skills', () => { } expect([...named].sort()).toEqual([...presets].sort()); - const table = interactionSkill.slice(interactionSkill.indexOf('### Step 2 — pick presets'), interactionSkill.indexOf('### Step 3 — resolve conflicts')); + const table = interactionSkill.slice(interactionSkill.indexOf('### Pick presets'), interactionSkill.indexOf('### Conflicts')); const listed = [...table.matchAll(/^\| `([a-z-]+)`(?:, `([a-z-]+)`)? \|/gm)].flatMap((m) => [m[1], m[2]].filter(Boolean)); expect(listed.sort()).toEqual([...presets].sort()); }); diff --git a/packages/flint-mcp/ui/src/BoardView.tsx b/packages/flint-mcp/ui/src/BoardView.tsx index 627da14b..3d9beeab 100644 --- a/packages/flint-mcp/ui/src/BoardView.tsx +++ b/packages/flint-mcp/ui/src/BoardView.tsx @@ -14,8 +14,8 @@ import type { App, McpUiHostContext } from '@modelcontextprotocol/ext-apps'; import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type PointerEvent as ReactPointerEvent } from 'react'; import type { ChartAssemblyInput, ChartTable, ChartUpdate, ChartWarning, ClosingRule, UpdateCheck } from 'flint-chart'; import { assembleVegaLite, canvasFurnitureMarkup, drawsAsTable, headerFurnitureItems, planFrameFurniture, validateChart } from 'flint-chart'; -import type { ChartChange, ChartState, InteractiveChartSurface } from 'flint-chart/interactive'; -import { FlintChart, FlintTable } from 'flint-chart/react'; +import type { ChartChange, ChartState, InteractiveChartSurface } from 'flint-chart/interactive/vegalite'; +import { FlintChart, FlintTable } from 'flint-chart/react/vegalite'; import { expressionInterpreter } from 'vega-interpreter'; import { @@ -39,13 +39,13 @@ import { type ChartLayout, } from '../../src/board-layout'; import { chartContext, type ChartGesture } from '../../src/chart-context'; -import { APP_PREVIEW_CANVAS_SIZE, usesAutoPreviewSize, withAppPreviewDefaults } from './render'; +import { APP_PREVIEW_CANVAS_SIZE, withAppPreviewDefaults } from './render'; import { boardPng } from './board-export'; import { SelectionChips, chipText, impliedParts, partText } from './selection-chips'; import { ViewSwitch, useCellViews, useChartTable, type CellView } from './chart-table-view'; import { ActionButton, ThemeControl } from './controls'; import { usePageScroll } from './page-scroll'; -import { LINK_LAYER, conditionUpdates, gestureParts, shownFields, type ChartLink, type LinkCondition, type LinkSpec } from 'flint-chart/interactive'; +import { LINK_LAYER, conditionUpdates, gestureParts, shownFields, type ChartLink, type LinkCondition, type LinkSpec } from 'flint-chart/interactive/vegalite'; export interface BoardChart { id: string; @@ -183,9 +183,17 @@ function ruleStyle(rule: ClosingRule, ink: string): CSSProperties { return { height: rule.height, background: rule.color ?? ink, ...(rule.stated ? { width: rule.width } : {}) }; } +/** A chart on a board takes its size from the board's layout (span and height), not its own. */ +function laidOut(input: ChartAssemblyInput): ChartAssemblyInput { + const { baseSize: _base, canvasSize: _canvas, ...chartSpec } = input.chart_spec; + void _base; + void _canvas; + return _base === undefined && _canvas === undefined ? input : { ...input, chart_spec: chartSpec }; +} + /** The chart as the chart card plans it for a room up to `height` tall. */ function roomSpec(input: ChartAssemblyInput, height: number): ChartAssemblyInput { - return withAppPreviewDefaults(input, { width: APP_PREVIEW_CANVAS_SIZE.width, height }); + return withAppPreviewDefaults(laidOut(input), { width: APP_PREVIEW_CANVAS_SIZE.width, height }); } /** The widest a KPI tile is planned, so a tile alone in a wide cell stays a tile. */ @@ -196,10 +204,7 @@ function cellSpec(input: ChartAssemblyInput, width: number, height: number): Cha const size = { width: isKpi(input.chart_spec.chartType) ? Math.min(width, MAX_TILE_WIDTH) : width, height }; return { ...input, - chart_spec: { - ...input.chart_spec, - ...(input.chart_spec.baseSize ? {} : { baseSize: size, canvasSize: size }), - }, + chart_spec: { ...input.chart_spec, baseSize: size, canvasSize: size }, options: { ...input.options, bandStepFit: input.options?.bandStepFit ?? 1 }, }; } @@ -300,7 +305,7 @@ function BoardCell({ expressionInterpreter={expressionInterpreter} chartId={`flint-board-${chart.id}`} width="100%" - fit={!kpi && usesAutoPreviewSize(input) ? 'relayout' : 'scale-down'} + fit={kpi ? 'scale-down' : 'relayout'} fallback={Rendering…} onRender={handleRender} onChange={handleChange} diff --git a/packages/flint-mcp/ui/src/ChartView.tsx b/packages/flint-mcp/ui/src/ChartView.tsx index 80107d9a..e66e71d6 100644 --- a/packages/flint-mcp/ui/src/ChartView.tsx +++ b/packages/flint-mcp/ui/src/ChartView.tsx @@ -14,19 +14,19 @@ import type { App, McpUiHostContext } from '@modelcontextprotocol/ext-apps'; import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import type { ChartAssemblyInput, ChartOption, ChartUpdate, ChartWarning } from 'flint-chart'; import { drawsAsTable, getChartTransform, validateChart, validateLinks } from 'flint-chart'; -import type { ChartChange, ChartState, InteractiveChartSurface } from 'flint-chart/interactive'; -import { FlintChart, FlintTable } from 'flint-chart/react'; +import type { ChartChange, ChartState, InteractiveChartSurface } from 'flint-chart/interactive/vegalite'; +import { FlintChart, FlintTable } from 'flint-chart/react/vegalite'; import { expressionInterpreter } from 'vega-interpreter'; import { ActionButton, ThemeControl } from './controls'; import type { Board } from './BoardView'; -import { APP_PREVIEW_CANVAS_SIZE, assemblePreviewSpec, renderFlintSvg, usesAutoPreviewSize, withAppPreviewDefaults } from './render'; +import { APP_PREVIEW_CANVAS_SIZE, assemblePreviewSpec, previewMaxWidth, renderFlintSvg, withAppPreviewDefaults } from './render'; import { chartIconFor } from './chart-icons'; import { SelectionChips, chipText, impliedParts, partText, type SelectionChip } from './selection-chips'; import { VIEW_SWITCH_LABEL, ViewSwitchIcon, useChartTable, type CellView } from './chart-table-view'; import { tablePng } from './table-export'; import { usePageScroll } from './page-scroll'; -import { conditionUpdates, selectionParts, type LinkCondition } from 'flint-chart/interactive'; +import { conditionUpdates, selectionParts, type LinkCondition } from 'flint-chart/interactive/vegalite'; import { chartContext, chartView, type ChartGesture } from '../../src/chart-context'; import { buildPanelModel, @@ -723,9 +723,7 @@ export function ChartView({ app, shown, hostContext }: { app: App; shown: Board; } }, [app, current, chartWidth, table]); - // The live chart takes the frame width itself: as the ceiling when the preview - // picks the size, scaled down when the spec states its own. - const autoSize = usesAutoPreviewSize(current); + const maxWidth = previewMaxWidth(current); // Each send replaces the model context, so every send carries the whole chart: // after each build (mount, new updates, panel edit) and each committed gesture. const lastContext = useRef(null); @@ -884,7 +882,9 @@ export function ChartView({ app, shown, hostContext }: { app: App; shown: Board; chartId="flint-chart-view" width="100%" height={paned ? '100%' : overCeiling ? APP_PREVIEW_CANVAS_SIZE.height : undefined} - fit={autoSize ? 'relayout' : 'scale-down'} + fit="relayout" + // The room the chart lays out into is the frame, up to 1.5x its footprint. + style={!paned ? { maxWidth, marginInline: 'auto' } : undefined} fallback={Rendering…} onWarnings={setSurfaceWarnings} onRender={handleRender} diff --git a/packages/flint-mcp/ui/src/FlintApp.tsx b/packages/flint-mcp/ui/src/FlintApp.tsx index 5455d2f8..eaba6141 100644 --- a/packages/flint-mcp/ui/src/FlintApp.tsx +++ b/packages/flint-mcp/ui/src/FlintApp.tsx @@ -27,6 +27,8 @@ function boardOf(result: { _meta?: unknown; structuredContent?: unknown }): Boar return meta?.flint?.board ?? structured?.flint?.board; } +const HELD_TEXT = 'The assistant is revising this spec; the fixed chart follows in a new card.'; + export function FlintApp() { const [shown, setShown] = useState(null); const [failed, setFailed] = useState(null); @@ -50,7 +52,9 @@ export function FlintApp() { app.ontoolresult = (result) => { const { content } = result as { content?: { type: string; text?: string }[] }; if (result.isError) { - setFailed(content?.find((part) => part.type === 'text')?.text ?? ''); + // A spec held back for fixes is the agent's to revise: the card says so rather than list them. + const held = (result._meta as { flint?: { held?: string } } | undefined)?.flint?.held; + setFailed(held ? HELD_TEXT : content?.find((part) => part.type === 'text')?.text ?? ''); return; } const next = boardOf(result); diff --git a/packages/flint-mcp/ui/src/no-bundled-boundaries.ts b/packages/flint-mcp/ui/src/no-bundled-boundaries.ts new file mode 100644 index 00000000..01ed87db --- /dev/null +++ b/packages/flint-mcp/ui/src/no-bundled-boundaries.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Stands in for each of flint-chart's bundled boundary files in the view's one-file build, which +// would otherwise carry all of them (about 1.9 MB) in every chart card: a map fetches its named +// boundaries from Flint's site instead (the resource declares the domain). +export default null; diff --git a/packages/flint-mcp/ui/src/render.ts b/packages/flint-mcp/ui/src/render.ts index 6ce0b89a..71d57371 100644 --- a/packages/flint-mcp/ui/src/render.ts +++ b/packages/flint-mcp/ui/src/render.ts @@ -27,7 +27,7 @@ export interface FlintRenderResult { } const DEFAULT_BACKGROUND = '#ffffff'; -const APP_PREVIEW_BASE_SIZE = { width: 360, height: 270 } as const; +const APP_PREVIEW_BASE_SIZE = { width: 300, height: 300 } as const; /** * The room the preview has when nobody has measured it. * @@ -57,10 +57,6 @@ function copyPngScale(width: number, height: number): number { return Math.min(COPY_PNG_MAX_SCALE, Math.max(1, COPY_PNG_TARGET_LONG_EDGE / longEdge)); } -export function usesAutoPreviewSize(input: ChartAssemblyInput): boolean { - return !input.chart_spec.baseSize && !input.chart_spec.canvasSize; -} - /** * The footprint the chosen house draws at, if it states one. * @@ -97,26 +93,48 @@ function previewCanvasSize(viewport?: { width: number; height?: number }): { wid return { width, height }; } +/** + * How far past its footprint a chart in the card may grow: a dense chart takes + * up to half again its size, and no more, so a sparse one is not blown up to + * fill a wide column and a busy one is not drawn too tall. + */ +export const APP_PREVIEW_STRETCH = 1.5; + +/** + * The footprint the chart aims for: the agent's `baseSize` when it states one + * (it knows where it is shown), else the house's, else the card's default. + */ +function previewBase(input: ChartAssemblyInput): { width: number; height: number } { + return input.chart_spec.baseSize ?? houseBaseSize(input) ?? APP_PREVIEW_BASE_SIZE; +} + +/** The size the chart may grow to: a stated `canvasSize`, else 1.5x its footprint. */ +function previewCeiling(input: ChartAssemblyInput): { width: number; height: number } { + const base = previewBase(input); + return input.chart_spec.canvasSize + ?? { width: Math.round(base.width * APP_PREVIEW_STRETCH), height: Math.round(base.height * APP_PREVIEW_STRETCH) }; +} + +/** The widest the card lays the chart out, before the room has a say. */ +export function previewMaxWidth(input: ChartAssemblyInput): number { + return previewCeiling(input).width; +} + export function withAppPreviewDefaults( input: ChartAssemblyInput, viewport?: { width: number; height?: number }, ): ChartAssemblyInput { - if (!usesAutoPreviewSize(input)) return input; - // The ceiling is the widget's business — it is how much room there is. The - // footprint is the house's, and the app's preview size only stands in where - // no house has spoken. - const base = houseBaseSize(input) ?? APP_PREVIEW_BASE_SIZE; - const ceiling = previewCanvasSize(viewport); + const base = previewBase(input); + const room = previewCanvasSize(viewport); + // The stated or default size leads; a host narrower than it lays the chart out + // again for the room it has, so every chart stays readable rather than shrunk. + const stated = previewCeiling(input); + const ceiling = { width: Math.min(stated.width, room.width), height: Math.min(stated.height, room.height) }; return { ...input, chart_spec: { ...input.chart_spec, - // A footprint larger than the room available is not a footprint; clamp - // it so the house still leads but cannot overflow the frame. - baseSize: { - width: Math.min(base.width, ceiling.width), - height: Math.min(base.height, ceiling.height), - }, + baseSize: { width: Math.min(base.width, ceiling.width), height: Math.min(base.height, ceiling.height) }, canvasSize: ceiling, }, // A sparse band chart spends the room it has: the layout widens its bands diff --git a/packages/flint-mcp/ui/src/table-export.ts b/packages/flint-mcp/ui/src/table-export.ts index 9474aa8b..3f63eabf 100644 --- a/packages/flint-mcp/ui/src/table-export.ts +++ b/packages/flint-mcp/ui/src/table-export.ts @@ -50,7 +50,31 @@ export function drawTable(ctx: CanvasRenderingContext2D, table: HTMLElement, ori ctx.fillText(text, end ? left + rect.width - inset : left + inset, top + rect.height / 2); } ctx.globalAlpha = 1; + // The theme's furniture: the tab or band above the title and the rules, drawn as the blocks they are. + for (const piece of table.querySelectorAll('.flint-table-furniture rect, .flint-table-rule')) { + const rect = piece.getBoundingClientRect(); + const fill = piece instanceof HTMLElement ? getComputedStyle(piece).backgroundColor : piece.getAttribute('fill'); + if (!fill || rect.width === 0 || rect.height === 0) continue; + ctx.fillStyle = fill; + ctx.fillRect(rect.left - origin.left, rect.top - origin.top, rect.width, rect.height); + } ctx.textAlign = 'left'; + for (const line of table.querySelectorAll('.flint-table-source-line')) { + const rect = line.getBoundingClientRect(); + if (rect.bottom < view.top || rect.top > view.bottom) continue; + const lineStyle = getComputedStyle(line); + ctx.font = `${lineStyle.fontStyle} ${lineStyle.fontWeight} ${lineStyle.fontSize} ${lineStyle.fontFamily}`; + ctx.fillStyle = lineStyle.color; + ctx.textBaseline = 'middle'; + const [start, end] = [...line.children] as HTMLElement[]; + const middle = rect.top - origin.top + rect.height / 2; + if (start?.textContent?.trim()) ctx.fillText(start.textContent.trim(), rect.left - origin.left, middle); + if (end?.textContent?.trim()) { + ctx.textAlign = 'right'; + ctx.fillText(end.textContent.trim(), rect.right - origin.left, middle); + ctx.textAlign = 'left'; + } + } for (const line of table.querySelectorAll('.flint-table-title, .flint-table-subtitle, .flint-table-note')) { const text = line.textContent?.trim(); if (!text) continue; diff --git a/packages/flint-mcp/ui/vite.config.ts b/packages/flint-mcp/ui/vite.config.ts index 2443c67a..6b39c5c5 100644 --- a/packages/flint-mcp/ui/vite.config.ts +++ b/packages/flint-mcp/ui/vite.config.ts @@ -7,47 +7,21 @@ import { fileURLToPath } from 'node:url'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { viteSingleFile } from 'vite-plugin-singlefile'; -import type { Plugin } from 'vite'; const root = dirname(fileURLToPath(import.meta.url)); const packageJson = JSON.parse(readFileSync(resolve(root, '../package.json'), 'utf8')) as { version: string; }; -/** - * The view mounts every chart on Vega-Lite, but flint-chart's mount loads each backend's interactive - * surface on demand, and a single-file build inlines all of them: Plotly alone is 4.7 MB. The view is - * sent as one MCP message, which stdio clients cap at 10 MB, so the surfaces it never mounts are - * replaced with stubs that say so if they are ever reached. - */ -const UNUSED_SURFACES: Record = { - plotly: 'createPlotlyInteractiveRenderer', - echarts: 'createEChartsInteractiveRenderer', - chartjs: 'createChartjsInteractiveRenderer', -}; -function vegaLiteOnly(): Plugin { - const prefix = '\0flint-unused-surface:'; - return { - name: 'flint-vega-lite-only', - enforce: 'pre', - resolveId(source, importer) { - const match = /^\.\.\/(plotly|echarts|chartjs)\/interactive(?:\.js)?$/.exec(source); - if (!match || !importer || !/flint-js[\\/](dist|src)[\\/]/.test(importer)) return null; - return prefix + match[1]; - }, - load(id) { - if (!id.startsWith(prefix)) return null; - const backend = id.slice(prefix.length); - return `export function ${UNUSED_SURFACES[backend]}() { throw new Error('The Flint MCP view renders charts with Vega-Lite; the ${backend} surface is not bundled.'); }`; - }, - }; -} +// The view mounts every chart on Vega-Lite and imports flint-chart's Vega-Lite entries +// (`flint-chart/react/vegalite`, `flint-chart/interactive/vegalite`), so no other backend's +// surface is bundled: the view is sent as one MCP message, which stdio clients cap at 10 MB. // Bundle the entire app (React + Flint + Vega) into one self-contained HTML so // the MCP App resource needs no network access and renders fully client-side. export default defineConfig({ root, - plugins: [vegaLiteOnly(), react(), viteSingleFile()], + plugins: [react(), viteSingleFile()], define: { __FLINT_MCP_VERSION__: JSON.stringify(packageJson.version), }, @@ -56,6 +30,9 @@ export default defineConfig({ // dispatcher is never set, so useState() throws at runtime. resolve: { dedupe: ['react', 'react-dom', 'react/jsx-runtime'], + // A one-file build inlines every dynamic import: the bundled boundaries stay out, and a map + // fetches its named boundaries from Flint's site (declared in the view resource's CSP). + alias: [{ find: /^flint-chart\/geo\/lazy\/[\w-]+$/, replacement: resolve(root, 'src/no-bundled-boundaries.ts') }], }, build: { outDir: resolve(root, '../assets'), diff --git a/packages/flint-mcp/vitest.config.ts b/packages/flint-mcp/vitest.config.ts index a41003a8..afa77d02 100644 --- a/packages/flint-mcp/vitest.config.ts +++ b/packages/flint-mcp/vitest.config.ts @@ -6,6 +6,11 @@ export default defineConfig({ // Resolve the library from source so tests don't depend on a prior build. // The longer alias comes first, so the bare name does not swallow it. alias: [ + { + find: /^flint-chart\/(react|interactive)\/(vegalite|echarts|chartjs|plotly)$/, + replacement: fileURLToPath(new URL('../flint-js/src/', import.meta.url)) + '$1/$2.ts', + }, + { find: /^flint-chart\/geo\/lazy\/([\w-]+)$/, replacement: fileURLToPath(new URL('../flint-js/src/geo/lazy/', import.meta.url)) + '$1.js' }, { find: 'flint-chart/interactive', replacement: fileURLToPath(new URL('../flint-js/src/interactive/index.ts', import.meta.url)) }, { find: 'flint-chart', replacement: fileURLToPath(new URL('../flint-js/src/index.ts', import.meta.url)) }, ], diff --git a/packages/flint-py/flint/core/field_semantics.py b/packages/flint-py/flint/core/field_semantics.py index 9897165e..ae545381 100644 --- a/packages/flint-py/flint/core/field_semantics.py +++ b/packages/flint-py/flint/core/field_semantics.py @@ -9,6 +9,7 @@ get_zero_class, infer_ordinal_sort_order, infer_vis_category, + is_measure_type, ) from .type_registry import get_registry_entry, is_registered @@ -219,6 +220,20 @@ def resolve_aggregation_default(semantic_type: str) -> Optional[str]: return None +def resolve_display_aggregate(cs: Optional[dict], aggregate: Optional[str] = None) -> Optional[str]: + """Port of resolveDisplayAggregate: how a chart combines a measure's rows per category. + + Types with a default keep it; a measure with none (``Number``) takes the + encoding's own aggregate, else the mean. + """ + if not cs or cs.get("aggregationDefault"): + return (cs or {}).get("aggregationDefault") + semantic_type = (cs.get("semanticAnnotation") or {}).get("semanticType") + if not semantic_type or not is_measure_type(semantic_type): + return None + return "sum" if aggregate in ("sum", "count") else "average" + + # --------------------------------------------------------------------------- # Zero baseline # --------------------------------------------------------------------------- diff --git a/packages/flint-py/flint/core/filter_overflow.py b/packages/flint-py/flint/core/filter_overflow.py index 8ce82461..ee326930 100644 --- a/packages/flint-py/flint/core/filter_overflow.py +++ b/packages/flint-py/flint/core/filter_overflow.py @@ -190,7 +190,16 @@ def _default_overflow_strategy( sorted_list = json.loads(sort_by) if isinstance(sorted_list, list): ordered_values = list(reversed(sorted_list)) if sort_order == "descending" else sorted_list - return [v for v in ordered_values if v in unique_values][:max_to_keep] + present = set(unique_values) + + def is_present(v: Any) -> bool: + try: + return v in present + except TypeError: + # Unhashable JSON values keep list-membership semantics. + return v in unique_values + + return [v for v in ordered_values if is_present(v)][:max_to_keep] except Exception: pass is_descending = sort_order == "descending" diff --git a/packages/flint-py/flint/core/resolve_semantics.py b/packages/flint-py/flint/core/resolve_semantics.py index cb1fed30..e424f7fb 100644 --- a/packages/flint-py/flint/core/resolve_semantics.py +++ b/packages/flint-py/flint/core/resolve_semantics.py @@ -246,19 +246,18 @@ def convert_temporal_data( return data keys = list(data[0].keys()) - field_values = {key: [row.get(key) for row in data] for key in keys} - effective_semantic_types = { - key: to_type_string(semantic_types.get(key)) - or infer_implicit_semantic_type(key, field_values[key]) - for key in keys - } + effective_semantic_types: dict[str, str] = {} temporal_keys: list[str] = [] for k in keys: - st = effective_semantic_types[k] - vc = infer_vis_category(field_values[k]) + field_values = [row.get(k) for row in data] + st = to_type_string(semantic_types.get(k)) or infer_implicit_semantic_type(k, field_values) + effective_semantic_types[k] = st + vc = infer_vis_category(field_values) st_category = get_vis_category(st) if st else None if vc == "temporal" or st_category == "temporal" or st == "Decade": temporal_keys.append(k) + if keys: + del field_values if not temporal_keys: return data @@ -309,6 +308,53 @@ def _js_number_to_string(v: float) -> str: # Public API: resolve_channel_semantics # --------------------------------------------------------------------------- +def _semantic_type(raw_annotation: Any, field_name: str, field_values: list[Any]) -> str: + if isinstance(raw_annotation, str): + supplied = raw_annotation or "" + elif isinstance(raw_annotation, dict): + supplied = raw_annotation.get("semanticType") or "" + else: + supplied = "" + return supplied or infer_implicit_semantic_type(field_name, field_values) + + +def _channel_type( + encoding: dict, channel: str, data: list, field_name: str, + field_values: list, semantic_type: str, +) -> str: + resolved = resolve_encoding_type(semantic_type, field_values, channel, data, field_name)["vlType"] + if encoding.get("type"): + resolved = encoding["type"] + elif channel in ("column", "row") and resolved not in ("nominal", "ordinal"): + resolved = "nominal" + + if resolved == "quantitative": + sample_values = [r.get(field_name) for r in data[:15] if r.get(field_name) is not None] + iso_re = re.compile(r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$") + if sample_values and all(iso_re.match(str(v).strip()) for v in sample_values): + resolved = "temporal" + return resolved + + +def _resolve_channel_types( + encodings: dict[str, dict[str, Any]], data: list[dict[str, Any]], + semantic_types: dict[str, Any], +) -> dict[str, str]: + """Resolve only types needed before encoding actions are applied.""" + result = {} + for channel, encoding in encodings.items(): + if encoding.get("type"): + continue + field_name = encoding.get("field") + if encoding.get("aggregate") and (field_name or encoding["aggregate"] == "count"): + result[channel] = "quantitative" + elif field_name: + values = [row.get(field_name) for row in data] + semantic_type = _semantic_type(semantic_types.get(field_name), field_name, values) + result[channel] = _channel_type(encoding, channel, data, field_name, values, semantic_type) + return result + + def resolve_channel_semantics( encodings: dict[str, dict[str, Any]], data: list[dict[str, Any]], @@ -336,33 +382,9 @@ def resolve_channel_semantics( continue raw_annotation = semantic_types.get(field_name) - if isinstance(raw_annotation, str): - supplied_semantic_type = raw_annotation or "" - elif isinstance(raw_annotation, dict): - supplied_semantic_type = raw_annotation.get("semanticType") or "" - else: - supplied_semantic_type = "" field_values = [r.get(field_name) for r in data] - semantic_type = supplied_semantic_type or infer_implicit_semantic_type(field_name, field_values) - - type_decision = resolve_encoding_type( - semantic_type, field_values, channel, data, field_name, - ) - - resolved_type = type_decision["vlType"] - if encoding.get("type"): - resolved_type = encoding["type"] - elif channel in ("column", "row"): - if resolved_type not in ("nominal", "ordinal"): - resolved_type = "nominal" - - if resolved_type == "quantitative": - sample_values = [ - r.get(field_name) for r in data[:15] if r.get(field_name) is not None - ] - iso_re = re.compile(r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$") - if sample_values and all(iso_re.match(str(v).strip()) for v in sample_values): - resolved_type = "temporal" + semantic_type = _semantic_type(raw_annotation, field_name, field_values) + resolved_type = _channel_type(encoding, channel, data, field_name, field_values, semantic_type) fc = resolve_field_semantics(raw_annotation or semantic_type, field_name, field_values) annotation = fc["semanticAnnotation"] diff --git a/packages/flint-py/flint/core/semantic_types.py b/packages/flint-py/flint/core/semantic_types.py index c126d98a..a36474e7 100644 --- a/packages/flint-py/flint/core/semantic_types.py +++ b/packages/flint-py/flint/core/semantic_types.py @@ -56,7 +56,7 @@ measureTypes: set[str] = { t for t in get_registered_types() - if get_registry_entry(t)["aggRole"] in ("additive", "intensive", "signed-additive") + if get_registry_entry(t)["aggRole"] in ("additive", "intensive", "signed-additive", "measure") and get_registry_entry(t)["t1"] != "Score" } diff --git a/packages/flint-py/flint/core/type_registry.py b/packages/flint-py/flint/core/type_registry.py index 972eb0e8..1baf720a 100644 --- a/packages/flint-py/flint/core/type_registry.py +++ b/packages/flint-py/flint/core/type_registry.py @@ -60,7 +60,8 @@ # --- Measure: GenericMeasure --- "Count": {"t0": "Measure", "t1": "GenericMeasure", "visEncodings": ["quantitative"], "aggRole": "additive", "domainShape": "open", "diverging": "none", "formatClass": "integer", "zeroBaseline": "meaningful", "zeroPad": 0}, - "Number": {"t0": "Measure", "t1": "GenericMeasure", "visEncodings": ["quantitative"], "aggRole": "additive", "domainShape": "open", "diverging": "none", "formatClass": "decimal", "zeroBaseline": "meaningful", "zeroPad": 0}, + # A measure whose values should not be added up (or whose additivity is unknown); use Count, Amount, Quantity or Profit for totals. + "Number": {"t0": "Measure", "t1": "GenericMeasure", "visEncodings": ["quantitative"], "aggRole": "measure", "domainShape": "open", "diverging": "none", "formatClass": "decimal", "zeroBaseline": "meaningful", "zeroPad": 0}, # --- Discrete --- "Rank": {"t0": "Discrete", "t1": "Rank", "visEncodings": ["ordinal"], "aggRole": "dimension", "domainShape": "open", "diverging": "none", "formatClass": "integer", "zeroBaseline": "arbitrary", "zeroPad": 0.08}, diff --git a/packages/flint-py/flint/vegalite/assemble.py b/packages/flint-py/flint/vegalite/assemble.py index da6b4a42..90772f2c 100644 --- a/packages/flint-py/flint/vegalite/assemble.py +++ b/packages/flint-py/flint/vegalite/assemble.py @@ -8,7 +8,7 @@ from typing import Any, Optional from ..core.semantic_types import infer_vis_category, compute_zero_decision -from ..core.resolve_semantics import resolve_channel_semantics, convert_temporal_data +from ..core.resolve_semantics import _resolve_channel_types, resolve_channel_semantics, convert_temporal_data from ..core.field_semantics import to_type_string from ..core.filter_overflow import filter_overflow from ..core.encoding_overrides import apply_encoding_overrides @@ -135,20 +135,18 @@ def assemble_vegalite(input_doc: dict) -> dict: # Some actions (e.g. Sort) must know each channel's resolved encoding TYPE # to decide which position axis is the discrete category and which is the # measure. The host leaves `type` unset ("auto") for most encodings, so we - # run a preliminary semantics pass to fill in the inferred types, compose + # resolve preliminary types, compose # the overrides onto the type-enriched encodings, then re-resolve semantics # on the result below (so that, e.g., a value-sort correctly suppresses the # field's canonical ordinal ordering). converted_data = convert_temporal_data(data, semantic_types) - prelim_semantics = resolve_channel_semantics( - raw_encodings, data, semantic_types, converted_data, - ) + prelim_types = _resolve_channel_types(raw_encodings, data, semantic_types) typed_raw_encodings: dict = {} for ch, enc in raw_encodings.items(): if enc.get("type"): typed_raw_encodings[ch] = enc else: - typed_raw_encodings[ch] = {**enc, "type": (prelim_semantics.get(ch) or {}).get("type")} + typed_raw_encodings[ch] = {**enc, "type": prelim_types.get(ch)} # Axis dtype override (`xAxisType` / `yAxisType` properties): the user can # force a position channel's interpretation between a continuous time scale diff --git a/packages/flint-py/flint/vegalite/templates/bar_table.py b/packages/flint-py/flint/vegalite/templates/bar_table.py index 636b8e6a..5be75849 100644 --- a/packages/flint-py/flint/vegalite/templates/bar_table.py +++ b/packages/flint-py/flint/vegalite/templates/bar_table.py @@ -5,6 +5,7 @@ import re from ...core import js_round +from ...core.field_semantics import resolve_display_aggregate from ...core.type_registry import get_registry_entry @@ -176,7 +177,8 @@ def scope_values_of(r): show_percent = config.get("showPercent") is True - use_mean_for_display = (x_cs or {}).get("aggregationDefault") == "average" + x_aggregate = ((ctx.get("encodings") or {}).get("x") or {}).get("aggregate") + use_mean_for_display = resolve_display_aggregate(x_cs, x_aggregate) == "average" def agg_value(g): return g["sum"] / max(1, g["n"]) if use_mean_for_display else g["sum"] @@ -325,7 +327,7 @@ def sort_rows_by_value(items): value_fmt = (x_cs or {}).get("format") pct_pattern = ".1%" - sort_op = "mean" if (x_cs or {}).get("aggregationDefault") == "average" else "sum" + sort_op = "mean" if use_mean_for_display else "sum" def unique_groupby(fields): return _unique_preserve(fields) @@ -744,7 +746,7 @@ def _bar_table_show_percent_check(ctx: dict) -> dict: if (not cs or not cs.get("field") or cs.get("type") != "quantitative" - or cs.get("aggregationDefault") == "average" + or resolve_display_aggregate(cs, ((ctx.get("encodings") or {}).get("x") or {}).get("aggregate")) != "sum" ): return {"applicable": False} total = 0.0 diff --git a/packages/flint-py/tests/unit/test_convert_temporal_data.py b/packages/flint-py/tests/unit/test_convert_temporal_data.py new file mode 100644 index 00000000..3503db1c --- /dev/null +++ b/packages/flint-py/tests/unit/test_convert_temporal_data.py @@ -0,0 +1,59 @@ +from datetime import datetime, timezone + +from flint.core.resolve_semantics import convert_temporal_data + + +def test_no_conversion_returns_original_and_ignores_later_keys(): + rows = [{"value": 1}, {"value": 2, "later_date": "2024-01-01"}] + assert convert_temporal_data(rows, {"later_date": "Date"}) is rows + no_first_row_keys = [{}, {"year": 2020}] + assert convert_temporal_data(no_first_row_keys, {"year": "Year"}) is no_first_row_keys + empty = [] + assert convert_temporal_data(empty, {}) is empty + + +def test_explicit_year_and_non_temporal_year_name(): + rows = [{"period": " 49 ", "year": 2020}, {"period": "50", "year": 2020}] + assert convert_temporal_data(rows, {"period": "Year"}) == [ + {"period": "2049", "year": 2020}, + {"period": "1950", "year": 2020}, + ] + + +def test_explicit_datetime_and_temporal_booleans(): + rows = [{"date": datetime(2020, 1, 1, tzinfo=timezone.utc), "stamp": True}] + assert convert_temporal_data(rows, {"date": "Date", "stamp": "Timestamp"}) == [ + {"date": "2020-01-01T00:00:00.000Z", "stamp": "true"} + ] + assert rows[0]["stamp"] is True + + +def test_conversion_covers_all_first_row_fields_and_missing_values(): + rows = [ + {"calendar_year": 2020, "decade": " 99 ", "stamp": 1_700_000_000, "date": "2020-01-01"}, + {"calendar_year": 2021, "decade": 2000, "stamp": 1_700_000_000_000, "date": None}, + {"calendar_year": None, "stamp": None}, + ] + result = convert_temporal_data(rows, {"decade": "Decade", "stamp": "Timestamp"}) + assert result == [ + {"calendar_year": "2020", "decade": "1999", "stamp": "2023-11-14T22:13:20.000Z", "date": "2020-01-01"}, + {"calendar_year": "2021", "decade": "2000", "stamp": "2023-11-14T22:13:20.000Z", "date": "null"}, + {"calendar_year": "null", "decade": "null", "stamp": "null", "date": "null"}, + ] + assert rows[0]["calendar_year"] == 2020 + assert "decade" not in rows[2] + + +def test_deepcopy_preserves_shared_nested_values_and_repeated_rows(): + shared = {"children": [1]} + first = {"year": 2020, "left": shared, "right": shared} + second = {"year": 2021, "left": shared} + rows = [first, second, first] + result = convert_temporal_data(rows, {}) + assert result is not rows + assert result[0] is result[2] + assert result[0]["left"] is result[0]["right"] is result[1]["left"] + assert result[0]["left"] is not shared + result[0]["left"]["children"].append(2) + assert shared == {"children": [1]} + assert first["year"] == 2020 diff --git a/packages/flint-py/tests/unit/test_filter_overflow.py b/packages/flint-py/tests/unit/test_filter_overflow.py index 1469d5f4..7cc72564 100644 --- a/packages/flint-py/tests/unit/test_filter_overflow.py +++ b/packages/flint-py/tests/unit/test_filter_overflow.py @@ -72,3 +72,46 @@ def test_uses_selected_value_sort(): {"type": "nominal"}, {"sortBy": "y", "sortOrder": "descending"}, ) == ["Delta", "Charlie", "Bravo"] + + +def _explicit_order_result(data, sort_by, sort_order=None): + encoding = {"field": "Category", "sortBy": sort_by} + if sort_order: + encoding["sortOrder"] = sort_order + return filter_overflow( + { + "x": {"field": "Category", "type": "nominal", "semanticAnnotation": {"semanticType": "Category"}}, + "y": {"field": "Value", "type": "quantitative", "semanticAnnotation": {"semanticType": "Quantity"}}, + }, + {"axisFlags": {"x": {"banded": True}}}, + {"x": encoding, "y": {"field": "Value"}}, + data, + BUDGETS, + MARKS, + ) + + +def test_explicit_order_keeps_duplicates_and_drops_missing_values(): + data = [{"Category": c, "Value": 1} for c in ["Delta", "Alpha", "Charlie", "Bravo"]] + sort_by = '["Bravo", "Missing", "Delta", "Bravo", "Alpha", "Charlie"]' + + ascending = _explicit_order_result(data, sort_by) + # The default strategy is capped at the distinct-value count, so duplicates shorten the tail. + assert ascending["viewports"][0]["orderedValues"] == ["Bravo", "Delta", "Bravo", "Alpha"] + assert ascending["truncations"][0]["keptValues"] == ["Bravo", "Delta", "Bravo"] + assert ascending["warnings"][0]["message"] == ( + "1 of 4 values in 'Category' were omitted (showing first 3 in sort order)." + ) + assert ascending["filteredData"] == [data[0], data[3]] + + descending = _explicit_order_result(data, sort_by, "descending") + assert descending["viewports"][0]["orderedValues"] == ["Charlie", "Alpha", "Bravo", "Delta"] + assert descending["truncations"][0]["keptValues"] == ["Charlie", "Alpha", "Bravo"] + + +def test_explicit_order_uses_python_equality_and_skips_unhashable_entries(): + data = [{"Category": c, "Value": 1} for c in [1, 2, 3, 4]] + + result = _explicit_order_result(data, '[["nested"], true, 2.0, 9, 3, 4]') + assert result["viewports"][0]["orderedValues"] == [True, 2.0, 3, 4] + assert result["truncations"][0]["keptValues"] == [True, 2.0, 3] diff --git a/packages/flint-py/tests/unit/test_preliminary_types.py b/packages/flint-py/tests/unit/test_preliminary_types.py new file mode 100644 index 00000000..42ae2750 --- /dev/null +++ b/packages/flint-py/tests/unit/test_preliminary_types.py @@ -0,0 +1,83 @@ +import copy +import importlib + +import pytest + +from flint.core.resolve_semantics import _resolve_channel_types, resolve_channel_semantics + + +assemble = importlib.import_module("flint.vegalite.assemble") + +ROWS = [ + {"category": "B", "value": 2, "year": 2020, "when": "2020-01-01T00:00:00Z"}, + {"category": "A", "value": 5, "year": 2021, "when": "2021-01-01T00:00:00Z"}, +] +TYPES = {"category": {"semanticType": "Category", "sortOrder": ["B", "A"]}, "value": "Quantity"} + + +def test_preliminary_types_match_full_semantics(): + encodings = { + "x": {"field": "year"}, + "y": {"field": "value", "aggregate": "sum"}, + "color": {"field": "category"}, + "column": {"field": "value"}, + "row": {"field": "when", "type": "quantitative"}, + "size": {"aggregate": "count"}, + "shape": {"value": "circle"}, + } + full = resolve_channel_semantics(encodings, ROWS, TYPES) + types = _resolve_channel_types(encodings, ROWS, TYPES) + for channel, encoding in encodings.items(): + if not encoding.get("type"): + assert types.get(channel) == (full.get(channel) or {}).get("type") + assert types["column"] == "nominal" + assert types["size"] == "quantitative" + + +def test_iso_dates_and_missing_fields_match_full_semantics(): + encodings = { + "x": {"field": "when"}, + "y": {"field": "value"}, + "column": {"field": "when"}, + "size": {"aggregate": "count"}, + "shape": {}, + } + full = resolve_channel_semantics(encodings, ROWS, {"when": "Quantity", "value": "Quantity"}) + types = _resolve_channel_types(encodings, ROWS, {"when": "Quantity", "value": "Quantity"}) + assert types == {ch: cs["type"] for ch, cs in full.items()} + assert types["x"] == "temporal" + assert types["column"] == "nominal" + + +@pytest.mark.parametrize( + "encodings,properties", + [ + ({"x": "category", "y": "value", "color": "category"}, {"sort": "value-desc"}), + ({"y": "category", "x": {"aggregate": "count"}}, {"sort": "value-desc"}), + ({"x": {"field": "category", "type": "ordinal"}, "y": "value"}, {"sort": "value-desc"}), + ({"x": "year", "y": "value", "column": "year"}, {"xAxisType": "nominal", "sort": "value-desc"}), + ({"y": "year", "x": "value"}, {"yAxisType": "nominal", "sort": "value-desc"}), + ({"x": "when", "y": "value", "color": "category"}, {"sort": "value-desc"}), + ], +) +def test_assembly_matches_full_preliminary_pass(monkeypatch, encodings, properties): + doc = { + "data": {"values": ROWS}, + "semantic_types": TYPES, + "chart_spec": { + "chartType": "Bar Chart", "encodings": encodings, + "chartProperties": properties, "baseSize": {"width": 600, "height": 400}, + }, + } + optimized = assemble.assemble_vegalite(copy.deepcopy(doc)) + + def full_types(raw, data, semantic_types): + full = resolve_channel_semantics(raw, data, semantic_types) + return {ch: cs["type"] for ch, cs in full.items()} + + monkeypatch.setattr(assemble, "_resolve_channel_types", full_types) + assert optimized == assemble.assemble_vegalite(copy.deepcopy(doc)) + if properties.get("xAxisType") == "nominal": + assert optimized["encoding"]["x"]["sort"] == "-y" + if properties.get("yAxisType") == "nominal": + assert optimized["encoding"]["y"]["sort"] == "-x" diff --git a/packages/flint-py/tools/benchmark_preliminary_types.py b/packages/flint-py/tools/benchmark_preliminary_types.py new file mode 100755 index 00000000..cce58f7a --- /dev/null +++ b/packages/flint-py/tools/benchmark_preliminary_types.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python3 +"""Benchmark preliminary type resolution; run under the shared perf-measure flock. + +Run from the repository root with the Python package installed. --compare-fixtures +compares all shared fixture outputs against the baseline instead of benchmarking. +The baseline sources are loaded directly from git, without changing the checkout. +""" +import argparse +import copy +import gc +import hashlib +import importlib.metadata +import json +import platform +import statistics +import subprocess +import sys +import time +import tracemalloc +import types +from pathlib import Path + +import flint.core.resolve_semantics as current_semantics +from flint.vegalite.assemble import assemble_vegalite + + +BASELINE = "a794557384adcc3293a77043f6b9aff1c33d152c" +ROOT = Path(__file__).resolve().parents[3] + + +def baseline_module(name, path): + source = subprocess.check_output( + ["git", "show", f"{BASELINE}:{path}"], cwd=ROOT, + ) + module = types.ModuleType(name) + module.__package__ = name.rpartition(".")[0] + exec(compile(source, f"{BASELINE}:{path}", "exec"), module.__dict__) + return module, hashlib.sha256(source).hexdigest() + + +baseline, baseline_assemble_hash = baseline_module( + "flint.vegalite._baseline_assemble", "packages/flint-py/flint/vegalite/assemble.py", +) +semantics, baseline_semantics_hash = baseline_module( + "flint.core._baseline_resolve_semantics", "packages/flint-py/flint/core/resolve_semantics.py", +) +baseline.resolve_channel_semantics = semantics.resolve_channel_semantics +baseline.convert_temporal_data = semantics.convert_temporal_data +functions = {"baseline": baseline.assemble_vegalite, "change": assemble_vegalite} + + +def fixture(n): + return { + "data": {"values": [ + {"x": i % 997 + 0.25, "y": (i * 13) % 991 + 0.5, + "group": f"group-{i % 20}", "unusedYear": 2000 + i % 24} + for i in range(n) + ]}, + "semantic_types": {"x": "Quantity", "y": "Quantity", "group": "Category", "unusedYear": "Year"}, + "chart_spec": { + "chartType": "Scatter Plot", + "encodings": {"x": "x", "y": "y", "color": "group"}, + "baseSize": {"width": 600, "height": 400}, + }, + } + + +def digest(value): + return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + + +def compare_fixtures(): + def result(fn, doc): + try: + return ("value", fn(copy.deepcopy(doc))) + except Exception as exc: + return ("exception", type(exc).__name__, str(exc)) + + different = [] + count = 0 + for path in sorted((ROOT / "shared/test-data").glob("*/input.json")): + if not (path.parent / "expected.json").exists(): + continue + doc = json.loads(path.read_text())["input"] + if result(functions["baseline"], doc) != result(functions["change"], doc): + different.append(path.parent.name) + count += 1 + print(json.dumps({"fixtures": count, "different": different}, indent=2)) + if different or not count: + raise SystemExit(1) + + +def benchmark(): + results = { + "python": sys.version, "platform": platform.platform(), + "python_dateutil": importlib.metadata.version("python-dateutil"), + "baseline_revision": BASELINE, + "change_revision": subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip(), + "baseline_assemble_sha256": baseline_assemble_hash, + "baseline_semantics_sha256": baseline_semantics_hash, + "change_assemble_sha256": hashlib.sha256(Path(assemble_vegalite.__code__.co_filename).read_bytes()).hexdigest(), + "change_semantics_sha256": hashlib.sha256(Path(current_semantics.__file__).read_bytes()).hexdigest(), + "fixtures": {}, + } + for n in (1000, 10000): + doc = fixture(n) + fixture_hash = digest(doc) + expected = functions["baseline"](doc) + assert expected == functions["change"](doc) + samples = [] + for round_no in range(3): + order = ("baseline", "change") if round_no % 2 == 0 else ("change", "baseline") + for label in order: + func = functions[label] + gc.collect() + started = time.perf_counter() + result = func(doc) + elapsed = time.perf_counter() - started + assert result == expected + del result + gc.collect() + tracemalloc.start() + result = func(doc) + _, peak = tracemalloc.get_traced_memory() + tracemalloc.stop() + assert result == expected + samples.append({"round": round_no + 1, "version": label, "seconds": elapsed, "peak_bytes": peak}) + results["fixtures"][str(n)] = { + "fixture_sha256": fixture_hash, "output_sha256": digest(expected), "samples": samples, + "median_seconds": { + label: statistics.median(s["seconds"] for s in samples if s["version"] == label) + for label in functions + }, + "median_peak_bytes": { + label: statistics.median(s["peak_bytes"] for s in samples if s["version"] == label) + for label in functions + }, + } + print(json.dumps(results, indent=2)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--compare-fixtures", action="store_true") + args = parser.parse_args() + compare_fixtures() if args.compare_fixtures else benchmark() diff --git a/packages/flint-py/tools/benchmark_temporal_columns.py b/packages/flint-py/tools/benchmark_temporal_columns.py new file mode 100644 index 00000000..acd346a5 --- /dev/null +++ b/packages/flint-py/tools/benchmark_temporal_columns.py @@ -0,0 +1,133 @@ +"""Compare a git-show baseline with the current converter. + +Run from the repository root: + mkdir -p loops + git show BASE:packages/flint-py/flint/core/resolve_semantics.py > loops/temporal-baseline.py + flock LOCK env PYTHONPATH=packages/flint-py python packages/flint-py/tools/benchmark_temporal_columns.py loops/temporal-baseline.py --baseline-ref BASE + +Each sample times one call without tracemalloc, then measures a separate call's +peak allocations. Validation and fixture construction happen outside samples. +""" + +import argparse +import copy +import gc +import hashlib +import importlib.util +import json +import platform +import sys +import time +import tracemalloc +from pathlib import Path + +from flint.core import resolve_semantics + + +def load_baseline(path): + spec = importlib.util.spec_from_file_location("flint.core._temporal_baseline", path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module.convert_temporal_data + + +def fixtures(): + numeric = [{f"column_{j}": i + j for j in range(20)} for i in range(10_000)] + shared = {"children": [1, 2]} + mixed = [ + { + **{f"column_{j}": i + j for j in range(16)}, + "calendar_year": 2000 + i % 20, + "decade": 1990 + 10 * (i % 3), + "timestamp": 1_700_000_000 + i, + "date": f"2020-01-{i % 28 + 1:02d}", + "nested": shared, + "alias": shared, + } + for i in range(10_000) + ] + mixed[-1] = mixed[0] + return { + "wide_numeric": (numeric, {}), + "mixed_temporal": (mixed, {"decade": "Decade", "timestamp": "Timestamp"}), + } + + +def validate(baseline, changed, name, data, semantics): + original = copy.deepcopy(data) + before = baseline(data, semantics) + after = changed(data, semantics) + assert before == after and data == original + if name == "wide_numeric": + assert before is data and after is data + else: + for result in (before, after): + assert result is not data and result[0] is result[-1] + assert result[0]["nested"] is result[0]["alias"] is result[1]["nested"] + assert result[0]["nested"] is not data[0]["nested"] + assert data[0]["calendar_year"] == 2000 + + +def sample(fn, data, semantics): + gc.collect() + start = time.perf_counter_ns() + result = fn(data, semantics) + elapsed_ns = time.perf_counter_ns() - start + del result + gc.collect() + tracemalloc.start() + result = fn(data, semantics) + _, peak = tracemalloc.get_traced_memory() + tracemalloc.stop() + del result + return {"elapsed_ns": elapsed_ns, "peak_bytes": peak} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("baseline", type=Path) + parser.add_argument("--baseline-ref", required=True, help="Git commit used to extract baseline") + parser.add_argument("--rounds", type=int, default=3) + args = parser.parse_args() + if args.rounds < 3: + parser.error("at least three interleaved rounds are required") + baseline = load_baseline(args.baseline) + changed = resolve_semantics.convert_temporal_data + cases = fixtures() + report = { + "python": sys.version, + "platform": platform.platform(), + "baseline_ref": args.baseline_ref, + "baseline_sha256": hashlib.sha256(args.baseline.read_bytes()).hexdigest(), + "changed_sha256": hashlib.sha256(Path(resolve_semantics.__file__).read_bytes()).hexdigest(), + "fixtures": {}, + "rounds": [], + } + for name, (data, semantics) in cases.items(): + validate(baseline, changed, name, data, semantics) + payload = json.dumps([data, semantics], sort_keys=True, separators=(",", ":")).encode() + report["fixtures"][name] = { + "rows": len(data), + "first_row_keys": list(data[0]), + "json_sha256": hashlib.sha256(payload).hexdigest(), + "semantics": semantics, + "aliases": "last row is first; nested and alias share one object across rows" + if name == "mixed_temporal" else "none", + } + for round_index in range(args.rounds): + order = (("baseline", baseline), ("changed", changed)) + if round_index % 2: + order = tuple(reversed(order)) + for name, (data, semantics) in cases.items(): + for label, fn in order: + report["rounds"].append({ + "round": round_index + 1, + "fixture": name, + "implementation": label, + **sample(fn, data, semantics), + }) + print(json.dumps(report, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/scripts/bench-overflow-order/README.md b/scripts/bench-overflow-order/README.md new file mode 100644 index 00000000..ebca65ef --- /dev/null +++ b/scripts/bench-overflow-order/README.md @@ -0,0 +1,45 @@ +# Explicit-order overflow benchmark (#161) + +Measures exported `filterOverflow` (JS) and `filter_overflow` (Python) when an +explicit JSON `sortBy` category order is used with `maxValues.x = 25`. + +Fixture (generated in `bench.mjs` / `bench.py`): N distinct categories `cat-000000…`, +one row each; `sortBy` lists them reversed, with one duplicate entry and two +missing categories. Sizes 1k / 5k / 10k. + +## Reproduce + +```bash +npm ci +scripts/bench-overflow-order/run.sh a794557384adcc3293a77043f6b9aff1c33d152c 3 +# quick smoke: SIZES=1000 scripts/bench-overflow-order/run.sh a794557 1 +``` + +`run.sh` extracts the baseline sources with `git archive`, bundles both sides of +`filter-overflow.ts` with esbuild, and alternates baseline/change order every +round. Each case runs in its own process; JS takes 15 timed calls after warm-up and +Python takes 7. Output is written to the git-ignored `experiments/bench-overflow-order/`. + +## Metrics + +- `medianMs`: median wall time of one call (`process.hrtime.bigint` / + `time.perf_counter_ns`), with a forced GC before each call. +- `digest`: SHA-256 of the JSON-serialized result (rows, warnings, truncations, + viewports). Baseline and change must match. +- `medianAllocBytes` (JS): delta of `v8.getHeapStatistics().total_allocated_bytes` + around one call. Node documents this as "total allocated bytes since the Isolate + creation" (Node ≥ 24; V8 14.6 in Node 26). It is a cumulative counter, not + sampling and not a used-heap delta. It is **approximate**: it is updated at + allocation-buffer granularity, excludes ArrayBuffer backing stores, and shows + ~0.3–0.6 MB of offset on a no-op after `gc()` (see `alloc-probe.mjs`). + Compare only the baseline/change difference. +- `tracemallocPeakBytes` (Python): `tracemalloc` peak traced allocation above the + starting point during one call, from a separate untimed call. +- `maxRssKiB`: process peak RSS from `getrusage`; this includes runtime startup. + +## Results + +A run writes `env.txt`, the raw rows in `results.jsonl` and `summary.txt` to +`experiments/bench-overflow-order/`; nothing is committed. The figures measured +for the change (Node v26.12.1, Python 3.12.3, Linux x86_64, 2 vCPU, 3 rounds) are +in [#167](https://github.com/microsoft/flint-chart/pull/167). diff --git a/scripts/bench-overflow-order/alloc-probe.mjs b/scripts/bench-overflow-order/alloc-probe.mjs new file mode 100644 index 00000000..4dfbb9e4 --- /dev/null +++ b/scripts/bench-overflow-order/alloc-probe.mjs @@ -0,0 +1,11 @@ +import v8 from 'node:v8'; +const tab = () => v8.getHeapStatistics().total_allocated_bytes; +const keep = []; +const probe = (name, fn) => { globalThis.gc(); const u0 = v8.getHeapStatistics().used_heap_size; const a0 = tab(); keep.push(fn()); const a1 = tab(); const u1 = v8.getHeapStatistics().used_heap_size; console.log(name.padEnd(36), 'tab_delta', a1 - a0, 'used_delta', u1 - u0); }; +probe('nothing', () => 0); +probe('1 small object', () => ({ a: 1 })); +probe('1000 small objects', () => Array.from({ length: 1000 }, (_, i) => ({ i }))); +probe('Float64Array 1e6 (8MB off-heap)', () => new Float64Array(1e6)); +probe('Array 1e6 doubles (~8MB)', () => { const a = new Array(1e6); for (let i = 0; i < 1e6; i++) a[i] = i + 0.5; return a; }); +probe('Set of 10k strings', () => new Set(Array.from({ length: 10000 }, (_, i) => 'k' + i))); +console.log('node', process.version, 'v8', process.versions.v8, 'typeof', typeof v8.getHeapStatistics().total_allocated_bytes); diff --git a/scripts/bench-overflow-order/bench.mjs b/scripts/bench-overflow-order/bench.mjs new file mode 100644 index 00000000..7702621c --- /dev/null +++ b/scripts/bench-overflow-order/bench.mjs @@ -0,0 +1,46 @@ +// Usage: node --expose-gc bench.mjs
- - )} - - - {rows.map((r) => ( - - - {cols.map(([key]) => )} - - ))} - -
{cols.map(([, label]) => {label}
{r.approach}{r[key] as string}
- ); -} - -export function AgentComparison() { - return ( -
-
-

Agent comparison: building and revising a dashboard with D3 or Flint

-

- A coding agent builds an interactive dashboard from a data file, then revises it. One run writes D3; the - other uses the flint-chart library with the Flint skills. We compare time, tokens, cost and how much code - each turn writes, and look at the rendered dashboards side by side. The runs are not kept here; the harness - that reproduces them is in talk/demo. -

-
- -
-

Findings

-
    -
  • - Authoring from the skills, Flint was faster and cheaper on both models. Opus: 4m 6s and 171 AIU - against 9m 53s and 243 AIU for D3, with 25.6k output tokens against 66.0k. Haiku: 2m 11s and 4.4 AIU - against 5m 41s and 6.2 AIU, with 25.0k output tokens against 72.5k. -
  • -
  • - Revising is where Flint is smallest. The adapt turn (Economist style and a box-select interaction) - took +109 −87 lines (Opus) and +24 −22 (Haiku) with Flint, against +338 −168 and +154 −79 with D3. The - final files were about a third smaller (Opus) to half the size (Haiku). -
  • -
  • - All four dashboards worked. After the adapt turn, clicking a country highlights it across the - charts, the Economist style applies, and a box drawn on the scatter highlights the map and lines and - filters the table to the selected countries. -
  • -
  • - Left free to look things up, Opus verified Flint against its source, and that cost more than D3.{' '} - With no shell or browser, "double-check" became reading the vendored bundle and searching Flint's GitHub - source (62 model calls against 22). It finished sooner than D3 but cost 385 AIU against 243. About half of - what it looked up the skills already state; the rest were real gaps (below). Haiku did not explore and - stayed cheap either way. -
  • -
  • - The skills are a fixed cost. Even authoring from the skills, Flint's context ends the build turn - near 85k tokens against D3's 48k; the chart and interaction skills are about 27k tokens of it. Flint wins - back that cost in fewer calls and less output. -
  • -
  • - The longer four-turn sessions (below) agree on time and code: Flint was faster on every run, wrote - 14–47% fewer output tokens and ended with smaller files. Cost was mixed: about even on Haiku, higher for - Flint on Opus (322 vs 223 and 237 vs 214 AIU), where lookups were allowed. -
  • -
-
- -
-

Main result: build, then adapt

-

- UNESCO school completion, 164 countries, 2000–2025. Fresh session per row; Flint authored from the skills - only. Bold: the better of D3 and Flint on the same model. One run per row. -

- -
- -
-

Same task, Flint free to look things up

-

- The Flint prompt said "Use the Flint skills." instead of the skills-only line, and web search, web fetch and - GitHub code search were available. Compare with the rows above; D3 is unchanged. -

- -

What Opus looked up

-
    -
  • Already in the skills: overlay style keys and roles, how a numeric Year is read, linking a map through detail.
  • -
  • Partly there: which presets linkCharts sends from. The skill says "each selecting interaction" without listing them.
  • -
  • Missing from the chart skill: which presets a Choropleth supports; that the world map geometry is fetched at run time; what a theme does with more categories than its palette (only in the theme skill).
  • -
-
- -
-

Earlier: four requests in one session

-

- Build, Economist style, box select, then a fourth change, in one session. Flint used the library and skills - with lookups allowed. Lines are the whole session's +/−. -

- {FOUR_TURNS.map(({ dataset, rows }) => ( -
-

{dataset}

- -
- ))} -
- -
-

Method

-

Setup

-
    -
  • Agent: GitHub Copilot CLI in non-interactive mode, one fresh session per approach and model, both turns in that session. Models: Claude Opus 5.5 and Claude Haiku 5.5.
  • -
  • Sandbox: a new folder with only the data file (and for Flint, the vendored flint-chart 1.0.0 bundle, a 23-line starter.html showing the import map, and the chart, interaction and theme author skills under .github/skills, loaded on demand). No custom instructions, no MCP servers.
  • -
  • Tools: file view, search and edit for both; no shell and no sub-agents, so neither agent can run or open its page. The Flint arm also had web search, web fetch and GitHub code search switched off, matching its prompt.
  • -
  • Verification asked of the agent: only "read over your code and double-check it" at the end of each turn.
  • -
  • Data: UNESCO Institute for Statistics, SDG 4 bulk release (February 2026, CC BY-SA 3.0 IGO), modelled upper secondary completion rates for 164 countries, 2000–2025, both sexes and by sex, with ISO numeric map ids and SDG regions.
  • -
- -

Prompts (verbatim)

-

Turn 1 · build

-
{BUILD_PROMPT}
-

{'{HOW}'} for D3

-
{HOW_D3}
-

{'{HOW}'} for Flint

-
{HOW_FLINT}
-

Turn 2 · adapt

-
{ADAPT_PROMPT}
- -

Measures

-
    -
  • Time: wall clock per turn. Tokens, model calls and cost: the session's usage events. Cost is Copilot's AIU, which follows the price-weighted tokens (cache reads about 0.1× input, cache writes 1.25×, output 5×).
  • -
  • Code: the sandbox is a git repository committed after each turn; lines are that turn's diff of dashboard.html.
  • -
  • Quality is not scored. Each turn's page is opened in headless Chrome, screenshotted, then screenshotted again after the turn's gesture (click a country's table row; after the adapt turn, drag a box over the scatter's lower-left points) for a person to compare.
  • -
- -

Caveats

-
    -
  • One run per cell. Across our runs the same cell's cost varied by about ±30%; the time and token gaps in the main result are larger than that, the cost gaps are not by much.
  • -
  • The skills-only instruction is given to Flint alone. D3 needs no reference, as it is in the models' training; Flint is not. Skills-only measures the language and its docs; the open-lookup run shows an agent left alone with a new library.
  • -
  • Flint was built from this repository, including fixes made while running these comparisons (links from presets mounted in code, world maps keyed by ISO numbers, currency axis labels, diverging theme ramps) and skill corrections.
  • -
- -

Reproduce

-
{`npm run build
-talk/demo/prepare.sh            # data, vendored flint-chart bundle, skills
-PROMPTS=talk/demo/prompts-uis3.json talk/demo/run.sh d3  claude-opus-5.5  uis3-d3-opus
-PROMPTS=talk/demo/prompts-uis3.json talk/demo/run.sh lib claude-opus-5.5  uis3-lib-opus
-node talk/demo/render-d3.mjs    # screenshots, before and after each turn's gesture
-python3 talk/demo/metrics.py    # time, tokens, cost and lines per turn`}
-
-
- ); -} diff --git a/site/src/playground/AnnotationCaptionLab.tsx b/site/src/playground/AnnotationCaptionLab.tsx new file mode 100644 index 00000000..5542a7de --- /dev/null +++ b/site/src/playground/AnnotationCaptionLab.tsx @@ -0,0 +1,275 @@ +import { useMemo } from 'react'; +import { FlintChart } from 'flint-chart/react'; +import type { ChartAssemblyInput } from 'flint-chart'; +import AGENT_EXAMPLES from './annotation-agent-examples.json'; +import './annotation-lab.css'; + +/** + * Notes that name one mark, set as captions beside it: the words in the chart's label face with a + * halo, a short leader to the mark's outline only where the caption is not plainly beside it, each + * note placed one after another clear of the marks, the text and the notes before it. + */ + +type Update = { id: string; ops: unknown[] }; + +const CARS: { name: string; horsepower: number; mpg: number; origin: string }[] = [ + { name: 'datsun 1200', horsepower: 69, mpg: 35, origin: 'Japan' }, + { name: 'toyota corolla 1200', horsepower: 65, mpg: 31, origin: 'Japan' }, + { name: 'opel 1900', horsepower: 90, mpg: 28, origin: 'Europe' }, + { name: 'datsun pl510', horsepower: 88, mpg: 27, origin: 'Japan' }, + { name: 'volkswagen 1131 deluxe sedan', horsepower: 46, mpg: 26, origin: 'Europe' }, + { name: 'bmw 2002', horsepower: 113, mpg: 26, origin: 'Europe' }, + { name: 'saab 99e', horsepower: 95, mpg: 25, origin: 'Europe' }, + { name: 'peugeot 504', horsepower: 87, mpg: 25, origin: 'Europe' }, + { name: 'toyota corona', horsepower: 95, mpg: 25.2, origin: 'Japan' }, + { name: 'audi 100 ls', horsepower: 90, mpg: 24, origin: 'Europe' }, + { name: 'toyota corona hardtop', horsepower: 95, mpg: 24, origin: 'Japan' }, + { name: 'toyota corona mark ii', horsepower: 97, mpg: 24, origin: 'Japan' }, + { name: 'chevrolet chevelle malibu', horsepower: 130, mpg: 18, origin: 'USA' }, + { name: 'plymouth satellite', horsepower: 150, mpg: 18, origin: 'USA' }, + { name: 'ford torino', horsepower: 140, mpg: 17, origin: 'USA' }, + { name: 'amc rebel sst', horsepower: 150, mpg: 16, origin: 'USA' }, + { name: 'buick skylark 320', horsepower: 165, mpg: 15, origin: 'USA' }, + { name: 'ford galaxie 500', horsepower: 198, mpg: 15, origin: 'USA' }, +]; + +const SIZE = { width: 640, height: 400 }; + +const cars = (theme?: string): ChartAssemblyInput => ({ + data: { values: CARS }, + semantic_types: { name: 'Name', horsepower: 'Quantity', mpg: 'Quantity', origin: 'Category' }, + chart_spec: { + chartType: 'Scatter Plot', + title: 'Horsepower and fuel economy', + encodings: { x: 'horsepower', y: 'mpg', color: 'origin', detail: 'name' }, + canvasSize: SIZE, + }, + ...(theme ? { theme_spec: theme } : {}), +}) as unknown as ChartAssemblyInput; + +const note = (id: string, key: Record, text: string, extra: Record = {}): Update => ({ + id, + ops: [{ op: 'annotate-text', target: { select: { key } }, value: { text, ...extra } }], +}); + +const FEW = [ + note('datsun', { name: 'datsun 1200' }, 'datsun 1200: best mileage'), + note('bmw', { name: 'bmw 2002' }, 'bmw 2002'), + note('corona', { name: 'toyota corona' }, 'toyota corona'), + note('galaxie', { name: 'ford galaxie 500' }, 'ford galaxie 500: most power'), +]; +const EVERY = CARS.map((car) => note(car.name, { name: car.name }, car.name)); + +const SALES = ['North', 'South', 'East', 'West', 'Central', 'Online'].map((region, i) => ({ region, revenue: [42, 31, 55, 28, 37, 61][i] })); +const bars: ChartAssemblyInput = { + data: { values: SALES }, + semantic_types: { region: 'Category', revenue: 'Amount' }, + chart_spec: { chartType: 'Bar Chart', title: 'Revenue by region', encodings: { x: 'region', y: 'revenue' }, canvasSize: SIZE }, +} as unknown as ChartAssemblyInput; + +const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +const SERIES = MONTHS.flatMap((month, i) => [ + { month: `2024-${String(i + 1).padStart(2, '0')}`, product: 'Hardware', units: 120 + i * 9 + (i === 6 ? 40 : 0) }, + { month: `2024-${String(i + 1).padStart(2, '0')}`, product: 'Software', units: 90 + i * 5 }, +]); +const lines: ChartAssemblyInput = { + data: { values: SERIES }, + semantic_types: { month: 'YearMonth', product: 'Category', units: 'Count' }, + chart_spec: { chartType: 'Line Chart', title: 'Units sold', encodings: { x: 'month', y: 'units', color: 'product' }, canvasSize: SIZE }, +} as unknown as ChartAssemblyInput; + +const CITIES = ['Oslo', 'Paris', 'Rome', 'Cairo']; +const TEMPS = CITIES.flatMap((city, j) => MONTHS.map((month, i) => ({ city, month, temp: Math.round(-4 + j * 7 + 12 * Math.sin((i - 3) / 12 * Math.PI * 2)) }))); +const heat: ChartAssemblyInput = { + data: { values: TEMPS }, + semantic_types: { city: 'Category', month: 'Month', temp: { semanticType: 'Temperature', unit: '°C' } }, + chart_spec: { chartType: 'Heatmap', title: 'Monthly temperature', encodings: { x: 'month', y: 'city', color: 'temp' }, canvasSize: SIZE }, +} as unknown as ChartAssemblyInput; + +const CASES: { key: string; title: string; why: string; spec: ChartAssemblyInput; updates: Update[] }[] = [ + { key: 'few', title: 'A few notes on a scatter', why: 'Four notes, each beside its dot; a leader only where the dot is crowded.', spec: cars(), updates: FEW }, + { key: 'every', title: 'Every car named, one after another', why: 'Eighteen notes placed in turn, each clear of the notes before it — sequential, not a joint search.', spec: cars(), updates: EVERY }, + { key: 'themed', title: 'Under a theme', why: 'The caption takes the house\'s label face and background.', spec: cars('economist'), updates: FEW }, + { key: 'bar', title: 'A bar\'s value', why: 'Stands at the value end, the side the bar suggests.', spec: bars, updates: [note('online', { region: 'Online' }, 'Only channel still growing')] }, + { key: 'line', title: 'A point on a line', why: 'The July spike, beside its point, clear of both lines.', spec: lines, updates: [note('july', { month: '2024-07', product: 'Hardware' }, 'July promotion', { anchor: 'point' })] }, + { key: 'cell', title: 'A heatmap cell', why: 'Beside its cell, haloed over the neighbours.', spec: heat, updates: [note('cairo', { city: 'Cairo', month: 'Jul' }, 'hottest month')] }, +]; + +/** The chart as it was before it took part: no room made for its notes, and no highlight on the marks they name. */ +const uncoordinated = (spec: ChartAssemblyInput, updates: Update[]): { spec: ChartAssemblyInput; updates: Update[] } => ({ + spec: { ...spec, options: { ...(spec as { options?: object }).options, notes: [] } } as ChartAssemblyInput, + updates: updates.map((update) => ({ + ...update, + ops: update.ops.map((op) => ({ ...(op as object), value: { ...(op as { value: object }).value, highlight: 'none' } })), + })), +}); + +const hbars: ChartAssemblyInput = { + ...bars, + chart_spec: { ...bars.chart_spec, encodings: { y: 'region', x: 'revenue' } }, +} as unknown as ChartAssemblyInput; +const nytBars: ChartAssemblyInput = { ...bars, theme_spec: 'nyt' } as unknown as ChartAssemblyInput; + +const PAIRS: { key: string; title: string; why: string; spec: ChartAssemblyInput; updates: Update[] }[] = [ + { key: 'bar', title: 'The tallest bar', why: 'The axis runs on to the next round tick, so the caption stands at the bar\'s end; the bar is faintly outlined.', spec: bars, updates: [note('online', { region: 'Online' }, 'Only channel still growing')] }, + { key: 'nyt', title: 'The tallest bar, on a ruled axis', why: 'Flint\'s own ticks run on at their step: 60 → 70.', spec: nytBars, updates: [note('online', { region: 'Online' }, 'Only channel still growing')] }, + { key: 'hbar', title: 'The longest bar, across', why: 'A caption across needs its width past the bar: at most a third of the axis is given.', spec: hbars, updates: [note('online', { region: 'Online' }, 'Only channel still growing')] }, + { key: 'peak', title: 'A peak at the top', why: 'The July spike gets a dot in its line\'s ink and room above it.', spec: lines, updates: [note('july', { month: '2024-07', product: 'Hardware' }, 'July promotion', { anchor: 'point' })] }, + { key: 'dots', title: 'Dots in a crowd', why: 'Each named dot is drawn again above its neighbours with a halo.', spec: cars(), updates: FEW }, +]; + +const LEVELS = (['none', 'light', 'strong', 'exclusive'] as const).map((highlight) => ({ + key: `level-${highlight}`, + title: `highlight: '${highlight}'`, + why: { + none: 'The mark as drawn: only the caption and its leader say which.', + light: 'The default. Lifted above its neighbours with a halo; a bar or cell faintly outlined.', + strong: 'A thin ring round the dot, a full outline round a bar or cell.', + exclusive: 'Strong, and every other mark recedes, as an emphasis does.', + }[highlight], + spec: cars(), + updates: [note('corona', { name: 'toyota corona' }, 'Best-selling import of 1972', { highlight })], +})); + +const region = (id: string, name: string, value: Record): Update => ({ id, ops: [{ op: 'annotate-region', name, value }] }); +const enclosure = (id: string, name: string, value: Record): Update => ({ id, ops: [{ op: 'annotate-enclosure', name, value }] }); +const where = (fields: Record) => ({ select: { where: Object.fromEntries(Object.entries(fields).map(([field, values]) => [field, Array.isArray(values) ? { in: values } : values])) } }); +const themed = (spec: ChartAssemblyInput, theme: string): ChartAssemblyInput => ({ ...spec, theme_spec: theme }) as unknown as ChartAssemblyInput; + +const MARKUP: { key: string; title: string; why: string; spec: ChartAssemblyInput; updates: Update[] }[] = [ + { key: 'region-period', title: 'A period on a line', why: 'An x stretch: the wash under the lines, its caption centred on it, clear of the series.', spec: lines, + updates: [region('summer', 'summer', { x: ['2024-06', '2024-08'], text: 'Summer promotion' })] }, + { key: 'region-band', title: 'A band of values', why: 'A y stretch: across it, inside where clear.', spec: lines, + updates: [region('target', 'target', { y: [100, 140], text: 'Target range' })] }, + { key: 'region-box', title: 'A box on a scatter', why: 'Both axes: inside the box where clear, else outside on a leader.', spec: cars(), + updates: [region('sweet', 'sweet', { x: [80, 120], y: [23, 29], text: 'Mid-power, efficient' })] }, + { key: 'region-categories', title: 'Adjacent categories', why: 'Whole bands of the named categories; two regions take distinct muted washes.', spec: bars, + updates: [region('weak', 'weak', { x: ['West', 'Central'], text: 'Below forty' }), region('strong', 'strong', { x: ['Online'] })] }, + { key: 'region-themed', title: 'A period, under a theme', why: 'The house\'s face and page; the caption in a readable shade of the wash.', spec: themed(lines, 'economist'), + updates: [region('summer', 'summer', { x: ['2024-06', '2024-08'], text: 'Summer promotion' })] }, + { key: 'enclose-hull', title: 'A cluster on a scatter', why: 'A padded hull round the US cars, in their own colour, its caption beside it.', spec: cars(), + updates: [enclosure('usa', 'usa', { targets: [where({ origin: ['USA'] })], text: 'American V8s' })] }, + { key: 'enclose-shared', title: 'Two groups, one caption', why: 'Ellipses round two clusters with one shared caption and a leader to each.', spec: cars(), + updates: [enclosure('imports', 'imports', { targets: [where({ name: ['datsun 1200', 'toyota corolla 1200'] }), where({ name: ['bmw 2002', 'opel 1900'] })], shape: 'ellipse', text: 'Imports at both ends' })] }, + { key: 'enclose-bars', title: 'A run of bars', why: 'A rectangle tight round the bars, in a keyline that reads on them and the page.', spec: bars, + updates: [enclosure('legacy', 'legacy', { targets: [where({ region: ['North', 'South'] })], text: 'Legacy regions' })] }, + { key: 'enclose-cells', title: 'Heatmap cells', why: 'Cells outlined inside their edges, in a hue apart from the ramp.', spec: heat, + updates: [enclosure('hot', 'hot', { targets: [where({ city: ['Cairo'], month: ['Jun', 'Jul', 'Aug'] })], text: 'Hottest stretch' })] }, + { key: 'enclose-themed', title: 'A cluster, under a theme', why: 'The same hull on the economist house.', spec: cars('economist'), + updates: [enclosure('usa', 'usa', { targets: [where({ origin: ['USA'] })], text: 'American V8s' })] }, + { key: 'together', title: 'Region, enclosure and a note', why: 'Drawn in order: the region\'s and enclosure\'s captions first, the note clear of them.', spec: cars(), + updates: [ + region('sweet', 'sweet', { x: [80, 120], y: [23, 29], text: 'Mid-power, efficient' }), + enclosure('usa', 'usa', { targets: [where({ origin: ['USA'] })], text: 'American V8s' }), + note('datsun', { name: 'datsun 1200' }, 'Best mileage of the set'), + ] }, +]; + +export function AnnotationCaptionLab() { + const cases = useMemo(() => CASES, []); + const pairs = useMemo(() => PAIRS.flatMap((pair) => { + const before = uncoordinated(pair.spec, pair.updates); + return [ + { key: `${pair.key}-before`, title: `${pair.title} — before`, why: 'No room made, no highlight: the chart as drawn, the caption on its own.', ...before }, + { key: `${pair.key}-after`, title: `${pair.title} — after`, why: pair.why, spec: pair.spec, updates: pair.updates }, + ]; + }), []); + return ( +
+
+

Annotation captions

+

+ A note on one mark — a dot, a bar's value, a line's point, a cell — is set as words beside the mark, not a card: the + chart's label face a size up, haloed in its background, joined by a short leader to the mark's outline only where it + is not plainly beside it (core/annotation). Notes on a stretch of a line, a slice or a region keep their card. +

+
+
+

From agent runs

+

+ Charts agents made in the annotation experiment (experiments/annotation): given a dataset and a + question, each chose the chart and its annotations. One per dataset, as the agent wrote it. +

+
+
+ {(AGENT_EXAMPLES as { key: string; question: string; spec: unknown; updates: unknown[] }[]).map((item) => ( +
+

{item.question}

+
+ +
+
+ ))} +
+
+

Hand-made cases

+
+
+ {cases.map((item) => ( +
+

{item.title}

{item.why}

+
+ +
+
+ ))} +
+
+

The chart helps the note

+

+ Unlike a labeller working over a finished chart, Flint draws the chart too, so it can make the note's job easier + rather than ask more of the caption. The mark a note names is highlighted — lifted above its neighbours with a + halo by default (highlight: 'none', 'light', 'strong', + 'exclusive'). The notes a chart mounts with get room: where the noted + mark sits at the end of a measure axis, the axis runs on to the next round tick, at most a third of its length + (AssembleOptions.notes). Each pair shows the chart without, then with. +

+
+
+ {pairs.map((item) => ( +
+

{item.title}

{item.why}

+
+ +
+
+ ))} +
+
+

How much the mark stands out

+

+ One note on a dot in the crowd, at each highlight level. A note says what the chart does not — not the + value a label already prints (validateChart flags that as note_repeats_chart). +

+
+
+ {LEVELS.map((item) => ( +
+

{item.title}

{item.why}

+
+ +
+
+ ))} +
+
+

Regions and enclosures

+

+ annotate-region shades a stretch of the plot and annotate-enclosure outlines groups of marks, + after Blabber's region and enclose, each with an optional caption, shape, connectors and colour. + annotate-text is the caption on one mark (set-annotation, its older name, is deprecated). +

+
+
+ {MARKUP.map((item) => ( +
+

{item.title}

{item.why}

+
+ +
+
+ ))} +
+
+ ); +} diff --git a/site/src/playground/AnnotationLab.tsx b/site/src/playground/AnnotationLab.tsx index c2385821..34e7e5e4 100644 --- a/site/src/playground/AnnotationLab.tsx +++ b/site/src/playground/AnnotationLab.tsx @@ -2,6 +2,8 @@ import { useEffect, useMemo, useRef, useState } from 'react'; import { RotateCcw } from 'lucide-react'; import { assembleVegaLite, + type ChartUpdateOp, + type RegionAnnotationSpec, } from 'flint-chart'; import { externalInteraction, @@ -17,20 +19,26 @@ import './click-focus-lab.css'; import './annotation-lab.css'; type StaticStatus = 'loading' | 'applied' | 'unsupported' | 'error'; -type AnnotationFixture = { - label: string; - key: string; - visual: { kind: 'mark' | 'path' | 'region'; role: string }; - text: string; -}; +type ChartOverlaySpec = NonNullable['value']>; +type Visual = { kind: 'mark' | 'path' | 'region'; role?: string }; +/** + * One annotation a case shows: a caption on one mark, a stretch, a slice or a region (`annotate-text`), + * a shaded stretch of the plot (`annotate-region`), or an outline round a group of marks + * (`annotate-enclosure`, its group the marks the keys name). + */ +type AnnotationFixture = + | { label: string; key: string; visual?: Visual; text: string; anchor?: 'point' } + | { label: string; region: RegionAnnotationSpec } + | { label: string; enclose: readonly string[]; visual: Visual; text: string } + | { label: string; overlays: Readonly> }; -function fixtureSelector( +function keySelector( input: InteractionCase['input'], - fixture: AnnotationFixture, + key: string, ): Record { const spec = assembleVegaLite(input) as any; const fields = spec._interactionSemantics?.fields as string[] | undefined; - const parts = fixture.key.replace(/\|__flint_path$/, '').split('|'); + const parts = key.replace(/\|__flint_path$/, '').split('|'); const sourceRows = input.data.values as readonly Record[]; return Object.fromEntries((fields ?? []).slice(0, parts.length).map((field, index) => { const part = parts[index]; @@ -43,16 +51,95 @@ function fixtureSelector( })); } +/** The marks several keys name, as one set: each field `in` the values the keys give it. */ +function groupSelector(input: InteractionCase['input'], keys: readonly string[]): Record { + const where: Record = {}; + for (const key of keys) { + for (const [field, value] of Object.entries(keySelector(input, key))) { + const values = (where[field] ??= { in: [] }).in; + if (!values.includes(value)) values.push(value); + } + } + return where; +} + +/** The ops one fixture applies: an annotation op alone, the note marking what it names itself. */ +function fixtureOps(input: InteractionCase['input'], fixture: AnnotationFixture, name: string): ChartUpdate['ops'] { + if ('region' in fixture) return [{ op: 'annotate-region', name, value: fixture.region }]; + if ('overlays' in fixture) { + return Object.entries(fixture.overlays).map(([overlay, value]) => ({ op: 'set-overlay' as const, name: `${name}-${overlay}`, value })); + } + if ('enclose' in fixture) { + return [{ + op: 'annotate-enclosure', + name, + value: { targets: [{ select: { where: groupSelector(input, fixture.enclose), visual: fixture.visual } }], text: fixture.text }, + }]; + } + return [{ + op: 'annotate-text', + target: { select: { key: keySelector(input, fixture.key), ...(fixture.visual ? { visual: fixture.visual } : {}) } }, + value: { text: fixture.text, ...(fixture.anchor ? { anchor: fixture.anchor } : {}) }, + }]; +} + +/** A map whose points an `order` joins into a route: its stops are marks, its legs paths. */ +const ROUTE_CASE: InteractionCase = { + id: 'map-route', + chartType: 'Map', + title: 'The wanderings of Odysseus', + expectation: 'Notes on a stop and on a leg; an outline round the Sicilian stops.', + input: { + data: { + values: ([ + [1, 'Troy', 26.24, 39.96], [2, 'Ismarus', 25.52, 40.89], [3, 'Lotus-Eaters', 10.86, 33.81], [4, 'Cyclops', 15.16, 37.56], + [5, 'Aeolia', 14.95, 38.47], [6, 'Laestrygonians', 9.16, 41.39], [7, 'Aeaea', 13.05, 41.23], [8, 'Underworld', 14.07, 40.84], + [9, 'Sirens', 14.43, 40.58], [10, 'Scylla and Charybdis', 15.63, 38.25], [11, 'Thrinacia', 15.0, 37.08], [12, 'Ogygia', 14.25, 36.05], + [13, 'Scheria', 19.92, 39.62], [14, 'Ithaca', 20.71, 38.37], + ] as const).map(([Stop, Place, longitude, latitude]) => ({ Stop, Place, longitude, latitude })), + }, + semantic_types: { Stop: 'Rank', Place: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { + chartType: 'Map', title: 'The wanderings of Odysseus', + encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop' }, chartProperties: { mapStyle: 'atlas' }, + }, + }, +}; + const ANNOTATION_FIXTURES: Record = { + Map: [ + { label: 'Ithaca (stop)', key: '20.71|38.37|14', visual: { kind: 'mark', role: 'point' }, text: 'Ithaca, home at last' }, + { label: 'Troy → Ismarus (leg)', key: '26.24|39.96|1', visual: { kind: 'path', role: 'leg' }, text: 'Sets sail from Troy' }, + { label: 'Ismarus → Lotus-Eaters (leg)', key: '25.52|40.89|2', visual: { kind: 'path', role: 'leg' }, text: 'Nine days blown off course' }, + { label: 'Sicily', enclose: ['15.16|37.56|4', '15.63|38.25|10', '15|37.08|11'], visual: { kind: 'mark', role: 'point' }, text: 'Sicily’s monsters' }, + { label: 'Tyrrhenian Sea (lon/lat)', region: { longitude: [9.5, 16.2], latitude: [38.2, 41.6], text: 'The Tyrrhenian Sea' } }, + { + label: 'The direct way home (lon/lat)', + overlays: { + line: { + mark: 'line', role: 'direct-route', + data: { values: [{ order: 1, longitude: 26.24, latitude: 39.96 }, { order: 2, longitude: 20.71, latitude: 38.37 }] }, + encodings: { longitude: { field: 'longitude' }, latitude: { field: 'latitude' }, order: { field: 'order' } }, + style: { stroke: '#b5562a', strokeWidth: 2, strokeDash: 'dash' }, + }, + label: { + mark: 'text', role: 'direct-route-label', + data: { values: [{ longitude: 23.6, latitude: 39.75, text: 'Troy to Ithaca: about 500 km' }] }, + encodings: { longitude: { field: 'longitude' }, latitude: { field: 'latitude' }, text: { field: 'text' } }, + style: { fill: '#b5562a', fontSize: 11, fontWeight: 'bold' }, + }, + }, + }, + ], 'Area Chart': [ - { label: '1995–2000', key: '788918400000|1|__flint_path', visual: { kind: 'path', role: 'area' }, text: '1995–2000: 1% → 7%' }, - { label: '2010–2015', key: '1262304000000|29|__flint_path', visual: { kind: 'path', role: 'area' }, text: '2010–2015: 29% → 43%' }, - { label: '2020–2023', key: '1577836800000|60|__flint_path', visual: { kind: 'path', role: 'area' }, text: '2020–2023: 60% → 67%' }, + { label: '1995–2000', key: '788918400000|1|__flint_path', visual: { kind: 'path', role: 'area' }, text: 'Dial-up years: 1% → 7%' }, + { label: '2010–2015', key: '1262304000000|29|__flint_path', visual: { kind: 'path', role: 'area' }, text: 'Smartphones: 29% → 43%' }, + { label: '2020–2023', region: { x: ['2020-01-01', null], text: 'Pandemic and after' } }, ], 'Bar Chart': [ - { label: '1880s', key: '1880s|-0.17', visual: { kind: 'mark', role: 'mark' }, text: '1880s: -0.17 °C' }, - { label: '1960s', key: '1960s|-0.03', visual: { kind: 'mark', role: 'mark' }, text: '1960s: -0.03 °C' }, - { label: '2020s', key: '2020s|1.02', visual: { kind: 'mark', role: 'mark' }, text: '2020s: +1.02 °C' }, + { label: 'India', key: '1428.6|India', visual: { kind: 'mark', role: 'mark' }, text: 'Overtook China in 2023' }, + { label: 'United States', key: '339.9|United States', visual: { kind: 'mark', role: 'mark' }, text: 'A quarter of either leader' }, + { label: 'Mexico', key: '128.5|Mexico', visual: { kind: 'mark', role: 'mark' }, text: 'Last of the ten' }, ], 'Bar Table': [ { label: 'Brazil', key: 'Brazil', visual: { kind: 'mark', role: 'bar-table-row' }, text: 'Brazil: $2.2T GDP' }, @@ -60,9 +147,9 @@ const ANNOTATION_FIXTURES: Record = { { label: 'United States', key: 'United States', visual: { kind: 'mark', role: 'bar-table-row' }, text: 'United States: $27.4T GDP' }, ], 'Bullet Chart': [ - { label: 'United States', key: 'United States|22.7|50', visual: { kind: 'mark', role: 'bullet-actual' }, text: 'United States: 22.7% vs 50% target' }, - { label: 'Germany', key: 'Germany|51.6|80', visual: { kind: 'mark', role: 'bullet-actual' }, text: 'Germany: 51.6% vs 80% target' }, - { label: 'Norway', key: 'Norway|98.6|100', visual: { kind: 'mark', role: 'bullet-actual' }, text: 'Norway: 98.6% vs 100% target' }, + { label: 'Norway', key: 'Norway', text: 'Almost at target' }, + { label: 'Germany', key: 'Germany', text: 'Past half-way' }, + { label: 'United States', key: 'United States', text: 'Under half its target' }, ], 'Calendar Heatmap': [ { label: 'Jan 1', key: '1704067200000|Mon|1704067200000', visual: { kind: 'mark', role: 'calendar-day' }, text: 'Jan 1: 60 activities' }, @@ -80,19 +167,19 @@ const ANNOTATION_FIXTURES: Record = { { label: 'Maine', key: 'Maine|1.36', visual: { kind: 'region', role: 'geographic-region' }, text: 'Maine: 1.36' }, ], 'Connected Scatter Plot': [ - { label: '1956 point', key: '3675|2.38|1956', visual: { kind: 'mark', role: 'symbol' }, text: '1956: 3,675 miles/person; gas $2.38' }, - { label: '1982–1983 path', key: '6835|2.92|1982|__flint_path', visual: { kind: 'path', role: 'line' }, text: '1982 → 1983: gas $2.92 → $2.66' }, - { label: '2005 point', key: '10067|2.53|2005', visual: { kind: 'mark', role: 'symbol' }, text: '2005: 10,067 miles/person; gas $2.53' }, + { label: '1956 point', key: '3675|2.38', text: '1956: where the record starts' }, + { label: '1982–1983 path', key: '6835|2.92|__flint_path', visual: { kind: 'path' }, text: 'Prices fall after the oil shock' }, + { label: '2005 point', key: '10067|2.53', text: 'Driving peaks' }, ], 'Density Plot': [ - { label: 'Low duration', key: '1.9040000000000001|0.23092429172368195|__flint_path', visual: { kind: 'path', role: 'area' }, text: '1.904 min: density 0.231' }, - { label: 'Middle duration', key: '3.184|0.21760927780507272|__flint_path', visual: { kind: 'path', role: 'area' }, text: '3.184 min: density 0.218' }, - { label: 'High duration', key: '4.464|0.2959686144815777|__flint_path', visual: { kind: 'path', role: 'area' }, text: '4.464 min: density 0.296' }, + { label: 'Short eruptions', region: { x: [1.5, 2.5], text: 'Short eruptions' } }, + { label: 'First peak', key: '1.9040000000000001|0.23092429172368195|__flint_path', visual: { kind: 'path', role: 'area' }, text: 'First peak near 1.9 min' }, + { label: 'Long eruptions', region: { x: [3.5, null], text: 'Long eruptions' } }, ], Heatmap: [ - { label: 'Singapore · Jan', key: 'Jan|Singapore', visual: { kind: 'mark', role: 'mark' }, text: 'Singapore · Jan: 26 °C' }, - { label: 'Seattle · Jun', key: 'Jun|Seattle', visual: { kind: 'mark', role: 'mark' }, text: 'Seattle · Jun: 16 °C' }, - { label: 'Seattle · Dec', key: 'Dec|Seattle', visual: { kind: 'mark', role: 'mark' }, text: 'Seattle · Dec: 4 °C' }, + { label: 'Singapore · Jan', key: 'Jan|Singapore', visual: { kind: 'mark', role: 'mark' }, text: 'Warm all year' }, + { label: 'Seattle · Jun', key: 'Jun|Seattle', visual: { kind: 'mark', role: 'mark' }, text: 'Mild summer' }, + { label: 'Seattle summer', enclose: ['Jun|Seattle', 'Jul|Seattle', 'Aug|Seattle'], visual: { kind: 'mark', role: 'mark' }, text: 'Seattle summer' }, ], 'Pie Chart': [ { label: 'Edge', key: 'Edge', visual: { kind: 'mark', role: 'slice' }, text: 'Edge: 12%' }, @@ -105,9 +192,9 @@ const ANNOTATION_FIXTURES: Record = { { label: 'Japan range', key: '81.5|Japan|Male|__flint_path', visual: { kind: 'path', role: 'line' }, text: 'Japan: Male 81.5, Female 87.6' }, ], 'Scatter Plot': [ - { label: 'Ethiopia', key: '2000|66.2|Africa|109', visual: { kind: 'mark', role: 'point' }, text: 'Ethiopia: GDP/person 2,000; 66.2 years' }, - { label: 'China', key: '16800|76.7|Asia|1393', visual: { kind: 'mark', role: 'point' }, text: 'China: GDP/person 16,800; 76.7 years' }, - { label: 'Qatar', key: '116900|80.1|Asia|2.8', visual: { kind: 'mark', role: 'point' }, text: 'Qatar: GDP/person 116,900; 80.1 years' }, + { label: 'Short flippers', key: '178|3300|Chinstrap', visual: { kind: 'mark', role: 'point' }, text: 'Shortest flippers' }, + { label: 'Heavy Adelie', key: '195|4675|Adelie', visual: { kind: 'mark', role: 'point' }, text: 'Heaviest Adelie' }, + { label: 'Large Chinstrap', key: '207|4800|Chinstrap', visual: { kind: 'mark', role: 'point' }, text: 'Largest Chinstrap' }, ], 'Slope Chart': [ { label: 'Tablet 2019 point', key: '2019|69|Tablet', visual: { kind: 'mark', role: 'symbol' }, text: 'Tablet · 2019: 69 revenue' }, @@ -126,10 +213,6 @@ const ANNOTATION_FIXTURES: Record = { ], }; -const coverage = [ - 'mark', 'path', 'area', 'distribution', 'composite', 'polar', 'region', -]; - function nextLayoutTurn(): Promise { return new Promise((resolve) => setTimeout(resolve, 50)); } @@ -147,153 +230,233 @@ async function waitForStableChartLayout(container: HTMLElement): Promise { } } - function StaticAnnotationChart({ - item, - fixture, - themeId, - resetVersion, - onStatus, - }: { - item: InteractionCase; - fixture: AnnotationFixture; - themeId: string | undefined; - resetVersion: number; - onStatus: (status: StaticStatus, result?: ChartUpdateResult | Error) => void; - }) { - const containerRef = useRef(null); - const chartRef = useRef(null); - const statusRef = useRef(onStatus); - statusRef.current = onStatus; - const themedInput = useMemo( - () => (themeId ? { ...item.input, theme_spec: themeId } : item.input), - [item, themeId], - ); - const interactions = useMemo(() => [externalInteraction({ - id: 'static-annotation-policy', - handle: (update) => update, - })], []); +/** What a fixture annotates, the filter the page offers. */ +type AnnotationKind = 'mark' | 'stretch' | 'route leg' | 'slice' | 'shape' | 'map region' | 'annotate-region' | 'annotate-enclosure' | 'set-overlay'; +const KIND_CHOICES: readonly { value: AnnotationKind | 'all'; label: string; title: string }[] = [ + { value: 'all', label: 'All', title: 'Every case' }, + { value: 'mark', label: 'Mark', title: 'annotate-text on one mark: a dot, a bar, a cell, a point' }, + { value: 'stretch', label: 'Stretch', title: 'annotate-text on a stretch of a line or area' }, + { value: 'route leg', label: 'Route leg', title: 'annotate-text on a leg of a map route (visual kind: path)' }, + { value: 'slice', label: 'Slice', title: 'annotate-text on a pie slice' }, + { value: 'shape', label: 'Shape', title: 'annotate-text on a whole shape (a violin)' }, + { value: 'map region', label: 'Map region', title: 'annotate-text on a map region' }, + { value: 'annotate-region', label: 'Region', title: 'annotate-region: a shaded stretch of the plot' }, + { value: 'annotate-enclosure', label: 'Enclosure', title: 'annotate-enclosure: an outline round a group' }, + { value: 'set-overlay', label: 'Overlay', title: 'set-overlay: marks drawn through the chart’s scales, or a map’s projection' }, +]; - useEffect(() => statusRef.current('loading'), [fixture, item, resetVersion, themeId]); +function fixtureKind(item: InteractionCase, fixture: AnnotationFixture): AnnotationKind { + if ('overlays' in fixture) return 'set-overlay'; + if ('region' in fixture) return 'annotate-region'; + if ('enclose' in fixture) return 'annotate-enclosure'; + if (fixture.visual?.kind === 'region') return 'map region'; + if (fixture.visual?.role === 'slice') return 'slice'; + if (item.chartType === 'Violin Plot') return 'shape'; + if (fixture.visual?.kind === 'path') return item.chartType === 'Map' ? 'route leg' : 'stretch'; + return 'mark'; +} - // Each mount annotates once its layout settles; a newer mount makes an older run stale. - const annotate = async (surface: InteractiveChartSurface): Promise => { - const container = containerRef.current; - if (!container) return; - await waitForStableChartLayout(container); - if (chartRef.current?.surface !== surface) return; - const target = { - select: { - key: fixtureSelector(themedInput, fixture), - visual: fixture.visual, - }, - }; - const result = await surface.dispatch('static-annotation-policy', { - id: `annotation-lab-${item.id}-${fixture.label}`, - ops: [ - { op: 'set-annotation', target, value: { text: fixture.text } }, - { - op: 'set-style', - targets: [target], - value: { state: 'emphasized', mutedOpacity: 0.25 }, - }, - ], - }); - if (chartRef.current?.surface !== surface) return; - statusRef.current(result?.status === 'applied' ? 'applied' : 'unsupported', result ?? undefined); - }; +/** The width a card's stage offers, in steps, so a chart is compiled to fit it rather than scrolled. */ +function useStageWidth(ref: React.RefObject): number | undefined { + const [width, setWidth] = useState(); + useEffect(() => { + const element = ref.current; + if (!element) return; + const measure = () => { + const style = getComputedStyle(element); + const inner = element.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight); + const stepped = Math.max(280, Math.floor(inner / 20) * 20); + setWidth((now) => (now === stepped ? now : stepped)); + }; + measure(); + const observer = new ResizeObserver(measure); + observer.observe(element); + return () => observer.disconnect(); + }, [ref]); + return width; +} - return ( -
- void annotate(surface)} - onError={(error) => statusRef.current('error', error)} - /> -
- ); - } +/** + * A chart that draws wider than its card (a faceted chart sizes its own panels) is scaled down to the + * card rather than scrolled. The annotation overlay reads the drawing's rect, so it follows the scale. + */ +function fitToStage(container: HTMLElement): void { + container.style.transform = ''; + container.style.marginBottom = ''; + const stage = container.parentElement; + const drawing = container.firstElementChild as HTMLElement | null; + if (!stage || !drawing) return; + const style = getComputedStyle(stage); + const available = stage.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight); + const { width, height } = drawing.getBoundingClientRect(); + if (width <= available + 0.5) return; + const scale = available / width; + container.style.transformOrigin = '0 0'; + container.style.transform = `scale(${scale})`; + container.style.marginBottom = `${-height * (1 - scale)}px`; +} - function StaticAnnotationCard({ - item, - fixture, - themeId, - resetVersion, - }: { - item: InteractionCase; - fixture: AnnotationFixture; - themeId: string | undefined; - resetVersion: number; - }) { - const [status, setStatus] = useState('loading'); - const [detail, setDetail] = useState('Applying annotation update'); - return ( -
-
-
-

{item.chartType}

-

{fixture.label} {fixture.visual.role}

-
- - {status === 'applied' ? 'Applied' : status} - -
-
- { - setStatus(nextStatus); - setDetail(result instanceof Error - ? result.message - : result ? `${result.status}: ${result.resolvedTargets} target` : 'Applying annotation update'); - }} - /> -
-
- ); - } +function StaticAnnotationChart({ + item, + fixture, + themeId, + width, + resetVersion, + onStatus, +}: { + item: InteractionCase; + fixture: AnnotationFixture; + themeId: string | undefined; + width: number; + resetVersion: number; + onStatus: (status: StaticStatus, result?: ChartUpdateResult | Error) => void; +}) { + const containerRef = useRef(null); + const chartRef = useRef(null); + const statusRef = useRef(onStatus); + statusRef.current = onStatus; + // The chart is compiled to the card's width, so it is drawn whole without a scrollbar. + const sizedInput = useMemo(() => { + const size = { width, height: Math.round(Math.min(460, Math.max(300, width * 0.62))) }; + const input = { ...item.input, chart_spec: { ...item.input.chart_spec, baseSize: size, canvasSize: size } }; + return themeId ? { ...input, theme_spec: themeId } : input; + }, [item, themeId, width]); + const interactions = useMemo(() => [externalInteraction({ + id: 'static-annotation-policy', + handle: (update) => update, + })], []); + + useEffect(() => statusRef.current('loading'), [fixture, item, resetVersion, themeId, width]); + + // Each mount annotates once its layout settles; a newer mount makes an older run stale. + const annotate = async (surface: InteractiveChartSurface): Promise => { + const container = containerRef.current; + if (!container) return; + await waitForStableChartLayout(container); + if (chartRef.current?.surface !== surface) return; + fitToStage(container); + await waitForStableChartLayout(container); + if (chartRef.current?.surface !== surface) return; + const id = `annotation-lab-${item.id}-${fixture.label}`; + const result = await surface.dispatch('static-annotation-policy', { id, ops: fixtureOps(sizedInput, fixture, id) }); + if (chartRef.current?.surface !== surface) return; + statusRef.current(result?.status === 'applied' ? 'applied' : 'unsupported', result ?? undefined); + }; - export function AnnotationLab() { - const [themeId, setThemeId] = useState(); - const [resetVersion, setResetVersion] = useState(0); - const staticCases = annotationCases.flatMap((item) => - (ANNOTATION_FIXTURES[item.chartType] ?? []).map((fixture) => ({ item, fixture }))); + return ( +
+ void annotate(surface)} + onError={(error) => statusRef.current('error', error)} + /> +
+ ); +} + +function StaticAnnotationCard({ + item, + fixture, + themeId, + resetVersion, +}: { + item: InteractionCase; + fixture: AnnotationFixture; + themeId: string | undefined; + resetVersion: number; +}) { + const [status, setStatus] = useState('loading'); + const [detail, setDetail] = useState('Applying annotation update'); + const stageRef = useRef(null); + const width = useStageWidth(stageRef); + return ( +
+
+
+

{item.chartType}

+

{fixture.label} {fixtureKind(item, fixture)}

+
+ + {status === 'applied' ? 'Applied' : status} + +
+
+ {width ? ( + { + setStatus(nextStatus); + setDetail(result instanceof Error + ? result.message + : result ? `${result.status}: ${result.resolvedTargets} target` : 'Applying annotation update'); + }} + /> + ) : null} +
+
+ ); +} + +export function AnnotationLab() { + const [themeId, setThemeId] = useState(); + const [kind, setKind] = useState('all'); + const [resetVersion, setResetVersion] = useState(0); + const allCases = [...annotationCases, ROUTE_CASE].flatMap((item) => + (ANNOTATION_FIXTURES[item.chartType] ?? []).map((fixture) => ({ item, fixture, kind: fixtureKind(item, fixture) }))); + const counts = new Map(); + for (const entry of allCases) counts.set(entry.kind, (counts.get(entry.kind) ?? 0) + 1); + const shown = kind === 'all' ? allCases : allCases.filter((entry) => entry.kind === kind); - return ( -
-
-
-
-

Annotation lab

-

Static charts with annotation update specs applied directly after render.

-
- -
-
-
- {coverage.map((item) => {item})} -
- -
-
{staticCases.length} exact-target cases · {annotationCases.length} chart types
-
-
- {staticCases.map(({ item, fixture }) => ( - - ))} + return ( +
+
+

Annotation lab

+

+ Static charts annotated after render, after Blabber: annotate-text captions what one + mark, stretch, slice or region names and marks it by its highlight; + {' '}annotate-region shades a stretch; annotate-enclosure outlines a group. +

+
+
+
+ Annotation +
+ {KIND_CHOICES.map((choice) => { + const count = choice.value === 'all' ? allCases.length : counts.get(choice.value) ?? 0; + return ( + + ); + })}
- ); - } \ No newline at end of file +
+ Theme + +
+ +
+
+ {shown.map(({ item, fixture }) => ( + + ))} +
+
+ ); +} diff --git a/site/src/playground/BaselineLab.tsx b/site/src/playground/BaselineLab.tsx new file mode 100644 index 00000000..314a9624 --- /dev/null +++ b/site/src/playground/BaselineLab.tsx @@ -0,0 +1,81 @@ +import { FlintChart } from 'flint-chart/react'; +import type { ChartAssemblyInput } from 'flint-chart'; + +// The behaviour every mounted chart has without an interaction_spec entry: a tooltip that reads the +// nearest line or point, and a legend click that dims a group. Pan and zoom are the agent's call. + +const days = Array.from({ length: 1500 }, (_, i) => { + const date = new Date(Date.UTC(2020, 0, 1) + i * 86400000).toISOString().slice(0, 10); + return { date, value: Math.round((100 + 20 * Math.sin(i / 40) + 8 * Math.sin(i / 3) + i / 30) * 10) / 10 }; +}); + +const series = ['North', 'South', 'East', 'West', 'Central'].flatMap((region, r) => + Array.from({ length: 24 }, (_, m) => ({ + month: `${2022 + Math.floor(m / 12)}-${String((m % 12) + 1).padStart(2, '0')}-01`, + region, + sales: Math.round(40 + r * 8 + 12 * Math.sin((m + r * 2) / 3) + m), + }))); + +let seed = 7; +const rand = () => ((seed = (seed * 16807) % 2147483647) / 2147483647); +const cloud = Array.from({ length: 4000 }, (_, i) => { + const group = i % 3 === 0 ? 'A' : i % 3 === 1 ? 'B' : 'C'; + const cx = group === 'A' ? 30 : group === 'B' ? 55 : 70; + return { x: Math.round((cx + (rand() - 0.5) * 30) * 100) / 100, y: Math.round((50 + (rand() - 0.5) * 60 + (group === 'C' ? 15 : 0)) * 100) / 100, group }; +}); + +const stacked = ['2019', '2020', '2021', '2022', '2023'].flatMap((year) => + ['Coal', 'Gas', 'Wind', 'Solar'].map((source, s) => ({ year, source, share: 10 + ((s * 7 + Number(year)) % 13) * 2 }))); + +interface Case { id: string; title: string; note: string; spec: ChartAssemblyInput } + +const CASES: Case[] = [ + { + id: 'dense-line', title: 'Long line (1,500 days)', note: 'Hover near the line: the tooltip reads the nearest day, and a slim dot marks it. No pan or zoom unless the spec asks.', + spec: { data: { values: days }, semantic_types: { date: 'Date', value: 'Quantity' }, chart_spec: { chartType: 'Line Chart', title: 'Daily value, 2020–2024', encodings: { x: { field: 'date' }, y: { field: 'value' } } } } as ChartAssemblyInput, + }, + { + id: 'multi-line', title: 'Five series, a legend', note: 'Click a legend item to dim its line; click another to dim it too; click again to bring it back; Escape clears.', + spec: { data: { values: series }, semantic_types: { month: 'YearMonth', region: 'Region', sales: 'Amount' }, chart_spec: { chartType: 'Line Chart', title: 'Monthly sales by region', encodings: { x: { field: 'month' }, y: { field: 'sales' }, color: { field: 'region' } } } } as ChartAssemblyInput, + }, + { + id: 'cloud', title: 'Crowded point cloud (4,000 points)', note: 'The tooltip reads the nearest point, with a muted halo; the legend dims a group. No pan or zoom unless the spec asks.', + spec: { data: { values: cloud }, semantic_types: { x: 'Quantity', y: 'Quantity', group: 'Category' }, chart_spec: { chartType: 'Scatter Plot', title: 'A crowded cloud', encodings: { x: { field: 'x' }, y: { field: 'y' }, color: { field: 'group' } } } } as ChartAssemblyInput, + }, + { + id: 'stacked', title: 'Stacked bars, a legend', note: 'The legend dims a source across every bar; a bar reads only under the pointer.', + spec: { data: { values: stacked }, semantic_types: { year: 'Year', source: 'Category', share: 'Percentage' }, chart_spec: { chartType: 'Stacked Bar Chart', title: 'Generation mix', encodings: { x: { field: 'year' }, y: { field: 'share' }, color: { field: 'source' } } } } as ChartAssemblyInput, + }, + { + id: 'asked', title: 'A spec that asks: legend-toggle and brush-x', note: 'What is asked for wins: the legend hides instead of dimming, and the drag brushes.', + spec: { data: { values: series }, semantic_types: { month: 'YearMonth', region: 'Region', sales: 'Amount' }, chart_spec: { chartType: 'Line Chart', title: 'Monthly sales by region', encodings: { x: { field: 'month' }, y: { field: 'sales' }, color: { field: 'region' } } }, interaction_spec: { interactions: [{ type: 'legend-toggle' }, { type: 'brush-x' }] } } as ChartAssemblyInput, + }, + { + id: 'off', title: 'defaults: false', note: 'interaction_spec.defaults: false turns the baseline off: no tooltip, no legend dim.', + spec: { data: { values: days }, semantic_types: { date: 'Date', value: 'Quantity' }, chart_spec: { chartType: 'Line Chart', title: 'Daily value, 2020–2024', encodings: { x: { field: 'date' }, y: { field: 'value' } } }, interaction_spec: { interactions: [], defaults: false } } as ChartAssemblyInput, + }, +]; + +export function BaselineLab() { + return ( +
+
+

Baseline behaviour

+

+ Every mounted chart has these without an interaction_spec entry, and each gives way to anything the spec + asks for: a tooltip that reads the nearest line or point (bars only under the pointer), and a legend + click that dims a group (several legends compose). Pan and zoom are never baseline. +

+
+ {CASES.map((item) => ( +
+

{item.title}

+

{item.note}

+
+ +
+
+ ))} +
+ ); +} diff --git a/site/src/playground/BaselineSweep.tsx b/site/src/playground/BaselineSweep.tsx new file mode 100644 index 00000000..8b4db7bd --- /dev/null +++ b/site/src/playground/BaselineSweep.tsx @@ -0,0 +1,65 @@ +import { useEffect, useMemo } from 'react'; +import { useSearchParams } from 'react-router-dom'; +import { FlintChart } from 'flint-chart/react'; +import { TEST_GENERATORS } from 'flint-chart/test-data'; +import { selectVariants } from '../shared/wall-variants'; +import { testCaseToAssemblyInput, thumbnailCanvasSize, withHouse } from '../shared/test-case-utils'; +import { getSupportedBackends } from '../shared/supported-backends'; + +// A test target for the baseline (nearest-mark tooltip, legend dim): the gallery's variants of one +// chart type at a time, drawn as SVG so a script can read plot frames, legends and mark opacity. + +// Only what Vega-Lite draws: the baseline lives in the Vega-Lite mount (Density Contour, say, is Plotly-only). +// A group is kept when any of its cases is a chart type Vega-Lite has a template for. +const THEMES = ['', 'bbc', 'economist', 'pop', 'powerbi', 'cartoon', 'de-stijl', 'nyt', 'swiss', 'apple', 'material', 'datawrapper', 'mckinsey', 'nature', 'powerbi-light']; +const drawsInVegaLite = (testCase: { chartType: string }): boolean => getSupportedBackends(testCase.chartType).includes('vegalite'); +const TYPES = Object.keys(TEST_GENERATORS).filter((type) => TEST_GENERATORS[type]().some(drawsInVegaLite)); + +export function BaselineSweep() { + const [params, setParams] = useSearchParams(); + const index = Math.min(Math.max(Number(params.get('type') ?? 0) || 0, 0), TYPES.length - 1); + // `?inspect=1` asks every case for `inspect-index`, to check the inspect presets the same way. + const inspect = params.get('inspect') === '1'; + const theme = params.get('theme') ?? ''; + const chartType = TYPES[index] ?? TYPES[0]; + const cases = useMemo(() => selectVariants(TEST_GENERATORS[chartType]().filter(drawsInVegaLite)), [chartType]); + + const go = (next: { type?: number; inspect?: boolean; theme?: string }): void => { + const type = next.type ?? index; + const withInspect = next.inspect ?? inspect; + const house = next.theme ?? theme; + setParams({ type: String(type), ...(withInspect ? { inspect: '1' } : {}), ...(house ? { theme: house } : {}) }); + window.scrollTo(0, 0); + }; + + useEffect(() => { + (window as any).__sweepTypes = TYPES; + }, []); + + return ( +
+
+

Baseline sweep

+ + + + + + {cases.length} variant{cases.length === 1 ? '' : 's'} +
+ {cases.map((testCase, i) => ( +
+
{testCase.title}
+ +
+ ))} +
+ ); +} diff --git a/site/src/playground/CalendarAxisLab.tsx b/site/src/playground/CalendarAxisLab.tsx index dbfb0386..56bf6832 100644 --- a/site/src/playground/CalendarAxisLab.tsx +++ b/site/src/playground/CalendarAxisLab.tsx @@ -3,7 +3,7 @@ import { assembleVegaLite, type ChartAssemblyInput } from 'flint-chart'; import { VegaLiteView } from '../components/VegaLiteView'; import './axis-label-lab.css'; -interface CalendarExample { +export interface CalendarExample { id: string; title: string; start: string; @@ -24,7 +24,7 @@ const UTC_RECORDED_AXIS = { labelFlush: false as const, }; -const INSPECTION_EXAMPLES: CalendarExample[] = [ +export const INSPECTION_EXAMPLES: CalendarExample[] = [ { id: 'inspection-cadence', title: '1. Daily detail / three months', start: '2024-01-05', end: '2024-04-05', stepHours: 24, planningWidth: 480 }, { id: 'inspection-resize', title: '2. Monthly detail / March to November', start: '2024-03-01', end: '2024-11-01', stepHours: 24, planningWidth: 900 }, { id: 'inspection-portability', title: '3a. Timezone / UTC plan, local renderer', start: '2024-12-31T18:00:00Z', end: '2025-01-01T12:00:00Z', stepHours: 0.5, planningWidth: 600, recordedAxis: UTC_RECORDED_AXIS }, @@ -32,7 +32,7 @@ const INSPECTION_EXAMPLES: CalendarExample[] = [ { id: 'inspection-single-date', title: '4. Single date / missing context', start: '2024-02-29', end: '2024-02-29', stepHours: 24, planningWidth: 480 }, ]; -const EXAMPLES: CalendarExample[] = [ +export const EXAMPLES: CalendarExample[] = [ { id: 'year-boundaries', title: 'January boundaries', start: '2020-01-01', end: '2022-01-01', stepHours: 168 }, { id: 'partial-years', title: 'Weekly series / partial years', start: '2020-04-06', end: '2024-12-30', stepHours: 168 }, { id: 'sparse-dates', title: 'Sparse observations', start: '2020-01-01', end: '2024-12-30', stepHours: 2160 }, @@ -45,7 +45,7 @@ const EXAMPLES: CalendarExample[] = [ { id: 'vertical', title: 'Vertical date axis', start: '2020-01-01', end: '2024-12-30', stepHours: 168, vertical: true }, ]; -function exampleInput(example: CalendarExample, width: number, height: number, theme: string): ChartAssemblyInput { +export function exampleInput(example: CalendarExample, width: number, height: number, theme: string): ChartAssemblyInput { const semanticType = example.semanticType ?? (example.stepHours < 24 ? 'DateTime' : 'Date'); const start = Date.parse(example.start); const end = Date.parse(example.end); diff --git a/site/src/playground/CategoricalTemporalLab.tsx b/site/src/playground/CategoricalTemporalLab.tsx index 88fd6252..431dc36d 100644 --- a/site/src/playground/CategoricalTemporalLab.tsx +++ b/site/src/playground/CategoricalTemporalLab.tsx @@ -4,7 +4,7 @@ import './categorical-temporal-lab.css'; type Row = Record; -interface TemporalCase { +export interface TemporalCase { id: string; group: string; note: string; @@ -96,7 +96,7 @@ const monthlyBars = (): ChartAssemblyInput => ({ chart_spec: { chartType: 'Bar Chart', title: 'Monthly revenue', encodings: { x: 'month', y: 'revenue' }, ...SIZE }, }); -const CASES: TemporalCase[] = [ +export const CASES: TemporalCase[] = [ // ── Few dates on a banded axis ──────────────────────────────────────── { id: 'ym-two', group: 'Few dates on a banded axis', note: 'YearMonth, 2 values (Jul vs Dec 2025)', input: twoMonths() }, { id: 'ym-two-economist', group: 'Few dates on a banded axis', theme: 'economist', note: 'Same, Economist', input: twoMonths() }, diff --git a/site/src/playground/ChartRedesignFigure.tsx b/site/src/playground/ChartRedesignFigure.tsx index a05ea051..30f46e62 100644 --- a/site/src/playground/ChartRedesignFigure.tsx +++ b/site/src/playground/ChartRedesignFigure.tsx @@ -1,6 +1,7 @@ import { useEffect, useRef } from 'react'; import type { ChartAssemblyInput } from 'flint-chart'; import { ChartView, shownChart } from '../../../packages/flint-mcp/ui/src/ChartView'; +import { useHostPage } from '../components/mcp-embed'; import foodPrices from '../data/cpi-food-prices.json'; import './chart-redesign-figure.css'; @@ -161,6 +162,7 @@ function McpView({ transformed: boolean; showInteraction?: boolean; }) { + useHostPage(); const rootRef = useRef(null); const menuOpenRequestedRef = useRef(false); diff --git a/site/src/playground/ColorLab.tsx b/site/src/playground/ColorLab.tsx index b9666991..17e8ae06 100644 --- a/site/src/playground/ColorLab.tsx +++ b/site/src/playground/ColorLab.tsx @@ -4,11 +4,11 @@ import { FlintView } from '../components/FlintView'; import './color-lab.css'; const GAMES = OMNI_VIZ_GAME_ORDER.slice(0, 8) as readonly string[]; -const ROWS = OMNI_VIZ_ROWS +export const ROWS = OMNI_VIZ_ROWS .filter((r) => GAMES.includes(r.game)) .map(({ period, game, gameType, newUsers }) => ({ period, game, gameType, newUsers })); -type Case = Omit; +export type Case = Omit; const heatmap = (color: Record = {}, extra: Partial = {}, newUsers: unknown = 'Profit'): Case => ({ semantic_types: { period: 'YearMonth', game: 'Category', newUsers } as Case['semantic_types'], @@ -19,7 +19,7 @@ const heatmap = (color: Record = {}, extra: Partial = {}, ...extra, }); -const CASES: Case[] = [ +export const CASES: Case[] = [ heatmap(), heatmap({}, { theme_spec: 'economist' }), heatmap({ scheme: 'viridis' }), diff --git a/site/src/playground/ColorRangeLab.tsx b/site/src/playground/ColorRangeLab.tsx new file mode 100644 index 00000000..515d11cb --- /dev/null +++ b/site/src/playground/ColorRangeLab.tsx @@ -0,0 +1,231 @@ +import { useMemo, type CSSProperties } from 'react'; +import { assembleVegaLite, type ChartAssemblyInput } from 'flint-chart'; +import { VegaLiteView } from '../components/VegaLiteView'; +import { siteTheme } from '../shared/theme'; +import { ANOMALY_MONTHS, anomalyInput, anomalyRows } from './anomaly-data'; + +/** The scheme Flint picks for a diverging temperature field, so every row reads the same ramp. */ +const SCHEME = 'blueorange'; +const RAMP_REACH = 1.3; +const FIRST_YEAR = 1880; +const LAST_YEAR = 2023; + +type Policy = { + id: string; + title: string; + note: string; + /** Two ends about the pivot, or three stops [low, pivot, high] for arms fitted apart. */ + domain: number[]; + clamp: boolean; + verdict: 'bug' | 'now' | 'option' | 'rejected'; +}; + +const values = anomalyRows.map((row) => row.Anomaly); +const reach = (rows: readonly { Anomaly: number }[]) => Math.max(...rows.map((row) => Math.abs(row.Anomaly))); + +function quantile(sorted: readonly number[], q: number): number { + const at = (sorted.length - 1) * q; + const low = Math.floor(at); + return sorted[low] + (sorted[Math.min(low + 1, sorted.length - 1)] - sorted[low]) * (at - low); +} + +/** The chart as the eval card mounts it, compiled now: the window it keeps and the colour range it states. */ +function flintToday() { + const sized = { ...anomalyInput, chart_spec: { ...anomalyInput.chart_spec, canvasSize: { width: 580, height: 400 } } } as ChartAssemblyInput; + const spec = assembleVegaLite(sized) as any; + const visible = spec._viewports?.[0]?.visibleCount ?? 65; + return { visible, scale: spec.encoding?.color?.scale ?? {} }; +} + +function buildPolicies(firstWindowEnd: number, flint: { domain?: number[]; clamp?: boolean }): Policy[] { + const windowReach = reach(anomalyRows.filter((row) => row.Year <= firstWindowEnd)); + const allReach = reach(anomalyRows); + const robust = quantile(values.map(Math.abs).sort((a, b) => a - b), 0.98); + const rounded = Math.ceil(allReach * 10) / 10; + const round2 = (value: number) => Math.round(value * 100) / 100; + return [ + { + id: 'window', verdict: 'bug', domain: [-round2(windowReach), round2(windowReach)], clamp: false, + title: 'Fitted to the first window, not clamped (the bug)', + note: `The scrolling chart was compiled from 1880–${firstWindowEnd} only. Every later value past the range's end is extrapolated off the ramp, into colours the legend never shows.`, + }, + { + id: 'window-clamped', verdict: 'option', domain: [-round2(windowReach), round2(windowReach)], clamp: true, + title: 'Same range, clamped', + note: 'Clamping alone stops the black: everything past the end takes the end colour. But half a century of warming then reads as one flat brown.', + }, + { + id: 'now', verdict: 'now', domain: (flint.domain ?? [-allReach, allReach]).map(round2), clamp: !!flint.clamp, + title: 'Fitted to every row (Flint now)', + note: 'Read from Flint\'s compile of the eval chart. Nothing falls past the ends, and the same colour means the same value in every window, but one hot decade sets the scale: the early years wash out.', + }, + { + id: 'rounded', verdict: 'option', domain: [-rounded, rounded], clamp: true, + title: 'Every row, ends rounded outward, clamped', + note: 'The same, with legend ends on round numbers. Clamping is a safety net here: should the range ever be fitted to fewer rows than the chart shows, nothing turns black.', + }, + { + id: 'robust', verdict: 'option', domain: [-round2(robust), round2(robust)], clamp: true, + title: 'Robust ends (98th percentile of the distance from 0), clamped', + note: 'The bulk of the data keeps its contrast; the hottest 2% of cells share the end colour, and the legend would mark that end "≥".', + }, + { + id: 'arms', verdict: 'rejected', domain: [round2(Math.min(...values)), 0, round2(Math.max(...values))], clamp: true, + title: 'Each arm fitted to its own extreme (rejected)', + note: 'Blue reaches its darkest at −0.45 while orange needs 1.08: the same 0.45° reads deep blue below zero and pale orange above it.', + }, + ]; +} + +function colorScale(policy: Policy) { + return policy.domain.length === 3 + ? { scheme: SCHEME, domain: policy.domain, clamp: policy.clamp } + : { scheme: SCHEME, domain: policy.domain, domainMid: 0, clamp: policy.clamp }; +} + +function heatmapSpec(policy: Policy, firstWindowEnd: number) { + return { + width: 720, height: 120, + config: { view: { stroke: null }, axis: { labelFontSize: 9, tickSize: 3 } }, + layer: [ + { + data: { values: anomalyRows }, + transform: [{ calculate: 'datum.Year + 1', as: 'YearEnd' }], + mark: { type: 'rect' }, + encoding: { + x: { + field: 'Year', type: 'quantitative', title: null, + scale: { domain: [FIRST_YEAR, LAST_YEAR + 1], nice: false, zero: false }, + axis: { format: 'd', values: Array.from({ length: 15 }, (_, index) => FIRST_YEAR + index * 10) }, + }, + x2: { field: 'YearEnd' }, + y: { field: 'Month', type: 'ordinal', sort: ANOMALY_MONTHS, title: null }, + color: { field: 'Anomaly', type: 'quantitative', scale: colorScale(policy), legend: { title: '°C', gradientLength: 110, direction: 'vertical' } }, + tooltip: [{ field: 'Year' }, { field: 'Month' }, { field: 'Anomaly' }], + }, + }, + { + data: { values: [{ from: FIRST_YEAR, to: firstWindowEnd + 1, label: 'first window' }] }, + mark: { type: 'rect', fill: null, stroke: '#111', strokeDash: [4, 3], strokeWidth: 1.5 }, + encoding: { x: { field: 'from', type: 'quantitative' }, x2: { field: 'to' } }, + }, + { + data: { values: [{ at: FIRST_YEAR + 1, label: `first window (1880–${firstWindowEnd})` }] }, + mark: { type: 'text', align: 'left', baseline: 'bottom', dy: -3, fontSize: 9, color: '#111' }, + encoding: { x: { field: 'at', type: 'quantitative' }, y: { value: 0 }, text: { field: 'label' } }, + }, + ], + }; +} + +/** Every value the scale could meet, coloured as it would draw it, over the data's own spread. */ +function rampSpec(policy: Policy) { + const step = 0.01; + const ramp = Array.from({ length: Math.round(RAMP_REACH * 2 / step) }, (_, index) => ({ v: -RAMP_REACH + index * step })); + const ends = [policy.domain[0], policy.domain[policy.domain.length - 1]]; + const x = { field: 'v', type: 'quantitative', title: null, scale: { domain: [-RAMP_REACH, RAMP_REACH], nice: false } }; + return { + config: { view: { stroke: null }, axis: { labelFontSize: 9, tickSize: 3 } }, + vconcat: [ + { + width: 720, height: 18, + layer: [ + { + data: { values: ramp }, + transform: [{ calculate: `datum.v + ${step}`, as: 'v2' }], + mark: { type: 'rect' }, + encoding: { x: { ...x, axis: null }, x2: { field: 'v2' }, color: { field: 'v', type: 'quantitative', scale: colorScale(policy), legend: null } }, + }, + { + data: { values: ends.map((v) => ({ v })) }, + mark: { type: 'rule', color: '#111', strokeWidth: 1.5, y: -4, y2: 22 }, + encoding: { x: { ...x, axis: null } }, + }, + ], + }, + { + width: 720, height: 46, + data: { values: anomalyRows }, + transform: [ + { bin: { step: 0.04 }, field: 'Anomaly', as: ['b0', 'b1'] }, + { aggregate: [{ op: 'count', as: 'cells' }], groupby: ['b0', 'b1'] }, + { calculate: '(datum.b0 + datum.b1) / 2', as: 'v' }, + ], + mark: { type: 'bar', binSpacing: 0 }, + encoding: { + x: { field: 'b0', type: 'quantitative', title: 'value (°C): the bar above draws every value as this scale would; bars below count the cells', scale: { domain: [-RAMP_REACH, RAMP_REACH], nice: false } }, + x2: { field: 'b1' }, + y: { field: 'cells', type: 'quantitative', title: null, axis: { tickCount: 2, labelFontSize: 8 } }, + color: { field: 'v', type: 'quantitative', scale: colorScale(policy), legend: null }, + }, + }, + ], + resolve: { scale: { color: 'independent' } }, + }; +} + +const VERDICT: Record = { + bug: { label: 'the bug', color: '#b42318' }, + now: { label: 'Flint now', color: '#1d4ed8' }, + option: { label: 'option', color: '#475467' }, + rejected: { label: 'rejected', color: '#9a6700' }, +}; + +const card: CSSProperties = { + border: `1px solid ${siteTheme.border}`, borderRadius: siteTheme.radius, background: siteTheme.surface, padding: 12, +}; + +function PolicyCard({ policy, firstWindowEnd }: { policy: Policy; firstWindowEnd: number }) { + const heatmap = useMemo(() => heatmapSpec(policy, firstWindowEnd), [policy, firstWindowEnd]); + const ramp = useMemo(() => rampSpec(policy), [policy]); + const [low, high] = [policy.domain[0], policy.domain[policy.domain.length - 1]]; + const past = values.filter((value) => value < low || value > high).length; + const verdict = VERDICT[policy.verdict]; + return ( +
+
+

{policy.title}

+ + {verdict.label} + +
+

{policy.note}

+
+ range {policy.domain.map((value) => value.toFixed(2)).join(' … ')} + clamped {policy.clamp ? 'yes' : 'no'} + + cells past the ends {past} of {values.length} + {past ? (policy.clamp ? ' (held at the end colour)' : ' (drawn off the ramp)') : ''} + +
+ + +
+ ); +} + +export function ColorRangeLab() { + const flint = useMemo(flintToday, []); + const firstWindowEnd = FIRST_YEAR + flint.visible - 1; + const policies = useMemo(() => buildPolicies(firstWindowEnd, flint.scale), [firstWindowEnd, flint.scale]); + return ( +
+
+

Color range

+

+ One diverging temperature heatmap (144 years, synthetic values shaped like NASA GISTEMP, scheme{' '} + {SCHEME} centred on 0) under each way of choosing its colour range. Three things decide what a + reader sees: which rows the range is fitted to, what happens to a value past its ends, and how far one + extreme may stretch the scale for everything else. Each card shows the whole chart with the first window the + scrolling chart keeps (dashed); a bar drawing every value from −{RAMP_REACH} to {RAMP_REACH} as the scale + would, with the range's ends as black ticks; and the data's spread coloured the same way. +

+
+ {policies.map((policy) => ( +
+ +
+ ))} +
+ ); +} diff --git a/site/src/playground/CompilationProcessIllustration.tsx b/site/src/playground/CompilationProcessIllustration.tsx index e3684a4a..96beab9c 100644 --- a/site/src/playground/CompilationProcessIllustration.tsx +++ b/site/src/playground/CompilationProcessIllustration.tsx @@ -53,7 +53,8 @@ function BackendSheet({ x, y, title }: { x: number; y: number; title: string }) ); } -export function CompilationProcessIllustration() { +/** `theme: false` draws the compiler alone: no ThemeSpec bar, its control lines, or the caption. */ +export function CompilationProcessIllustration({ theme = true }: { theme?: boolean } = {}) { const uid = useId().replace(/:/g, ''); const flowArrow = `${uid}-flow-arrow`; const controlArrow = `${uid}-control-arrow`; @@ -62,8 +63,8 @@ export function CompilationProcessIllustration() {
- - ThemeSpec controls the Flint compilation process + + {theme ? 'ThemeSpec controls the Flint compilation process' : 'The Flint compilation process'} @@ -73,6 +74,7 @@ export function CompilationProcessIllustration() { + {theme && (<> ThemeSpec @@ -84,6 +86,7 @@ export function CompilationProcessIllustration() { + )} compiler @@ -113,6 +116,7 @@ export function CompilationProcessIllustration() { + {theme && (<> @@ -121,6 +125,7 @@ export function CompilationProcessIllustration() { + )} @@ -128,9 +133,9 @@ export function CompilationProcessIllustration() { ...
-
+ {theme &&
A ThemeSpec in Flint is a formal specification that shapes compilation across three stages so every generated chart adheres to a coherent design system. Using resolved semantic information, it governs layout constraints and dynamics, conditionally resolves visual preferences, and supplies design fixtures for backend-specific code generation. -
+
}
); } diff --git a/site/src/playground/DebugGym.tsx b/site/src/playground/DebugGym.tsx index 6ed17e66..e2959e4b 100644 --- a/site/src/playground/DebugGym.tsx +++ b/site/src/playground/DebugGym.tsx @@ -10,6 +10,7 @@ import { ScaleToFit } from '../components/ScaleToFit'; import { FlintView } from '../components/FlintView'; import { testCaseToAssemblyInput, withHouse } from '../shared/test-case-utils'; import { siteTheme } from '../shared/theme'; +import { ReleaseBlockers } from './ReleaseBlockers'; const rows = [ ['惠普', 2025, 49933.56], ['惠普', 2026, 30973.54], @@ -675,6 +676,98 @@ function PlotlyCurveGym() { ); } +// ---------------------------------------------------------------- canvas box +const NETFLIX_TITLES = [ + ['Back in Action', 164.7, 'Movies'], ['Adolescence: Limited Series', 144.8, 'Shows'], + ['Squid Game: Season 2 // 오징어 게임: 시즌 2', 117.3, 'Shows'], ['STRAW', 102.9, 'Movies'], + ['The Life List', 95.5, 'Movies'], ['Exterritorial', 87.5, 'Movies'], ['Havoc', 86.9, 'Movies'], + ['Squid Game: Season 3 // 오징어 게임: 시즌 3', 71.5, 'Shows'], ['Zero Day: Limited Series', 61.3, 'Shows'], + ['Missing You: Limited Series', 58, 'Shows'], +].map(([title, views, format]) => ({ title, views: (views as number) * 1e6, format })); +const BOX_THEMES = [undefined, 'datawrapper', 'nyt', 'economist', 'bbc'] as const; +const BOX_STRETCHES = [1.5, 2] as const; + +function boxInput(theme: string | undefined, stretch: number): ChartAssemblyInput { + return { + data: { values: NETFLIX_TITLES }, + semantic_types: { title: 'Name', views: 'Count', format: 'Category' }, + chart_spec: { + chartType: 'Bar Chart', + encodings: { + x: { field: 'views', type: 'quantitative' }, + y: { field: 'title', type: 'nominal', sortOrder: 'descending', sortBy: 'x' }, + color: { field: 'format' }, + }, + title: 'Most-viewed movies and show seasons, January–June 2025', + subtitle: 'Top five per format; views are runtime-normalized viewing equivalents', + baseSize: { width: 400, height: 300 }, + canvasSize: { width: 400 * stretch, height: 300 * stretch }, + }, + options: { maxStretch: stretch }, + ...(theme ? { theme_spec: theme } : {}), + } as ChartAssemblyInput; +} + +function BoxCase({ theme, stretch }: { theme: string | undefined; stretch: number }) { + const input = useMemo(() => boxInput(theme, stretch), [theme, stretch]); + const fit = useMemo(() => ((assembleVegaLite(input) as any)._theme?.report ?? []).find((note: any) => note.code === 'canvas-fit') ?? null, [input]); + const box = { width: 400 * stretch, height: 300 * stretch }; + const host = useRef(null); + const [drawn, setDrawn] = useState<{ width: number; height: number } | null>(null); + useEffect(() => { + // The chart mounts its SVG a few frames after this card renders. + const timer = setInterval(() => { + const svg = host.current?.querySelector('svg'); + if (!svg) return; + const rect = svg.getBoundingClientRect(); + setDrawn((now) => (now && now.width === Math.round(rect.width) && now.height === Math.round(rect.height) ? now : { width: Math.round(rect.width), height: Math.round(rect.height) })); + }, 250); + return () => clearInterval(timer); + }, [input]); + // Judged as the canvas fit does: the host scales a drawing into its box, legibly down to 70%. + const scale = drawn ? Math.min(1, box.width / drawn.width, box.height / drawn.height) : undefined; + const verdict = scale === undefined ? undefined : scale >= 0.97 ? 'inside' : scale >= 0.7 ? 'scaled' : 'illegible'; + const ink = { inside: '#1a7f37', scaled: '#9a6700', illegible: '#b42318' } as const; + return ( +
+
+ {theme ?? 'no theme'} · box {box.width} × {box.height} · drawn{' '} + {drawn ? `${drawn.width} × ${drawn.height}` : '…'}{' '} + {verdict ? {verdict === 'inside' ? '✓ inside' : verdict === 'scaled' ? `host scales to ${Math.round(scale! * 100)}%` : `✗ ${Math.round(scale! * 100)}%, past legibility`} : null} + {fit ?
fit: {fit.message.replace(/^.*— laid out with /, '')}
: null} +
+ {/* Drawn at its own size: the dashed frame is the canvas the host asked for. */} +
+
+ +
+
+
+
+ ); +} + +function CanvasBoxGym() { + return ( +
+
+

Canvas box · long row names under each house

+

+ Ten long titles, sorted by views and coloured by format, at base 400 × 300. Rows: the stretch the host + allows (the canvas is base × stretch, the dashed frame); columns: the house. Each chart is drawn at its own + size, never scaled to fit, so a chart past its frame shows as a host that does not scale would show it. The + verdict is the canvas fit's: inside its box, or within what a host scales it to legibly (70%). +

+
+ {BOX_STRETCHES.map((stretch) => ( +
+ {BOX_THEMES.map((theme) => )} +
+ ))} +
+ ); +} + /** Mirrors RESULT_COPY_LIMIT and fitsInResult in packages/flint-mcp/src/board.ts (which needs Node). */ const RESULT_COPY_LIMIT = 4096; type CardCase = { id: string; label: string; rows: Record[]; fromFile?: boolean }; @@ -755,10 +848,12 @@ export function DebugGym() { 年度 remains quantitative.

+
+ diff --git a/site/src/playground/DenseMarks.tsx b/site/src/playground/DenseMarks.tsx index d2a66bc7..283241e0 100644 --- a/site/src/playground/DenseMarks.tsx +++ b/site/src/playground/DenseMarks.tsx @@ -1,5 +1,4 @@ import { useEffect, useMemo, useRef, useState } from 'react'; -import { Link } from 'react-router-dom'; import * as d3 from 'd3'; import type { ChartAssemblyInput } from 'flint-chart'; import { FlintView } from '../components/FlintView'; @@ -140,11 +139,7 @@ export function DenseMarks() {

Dense marks: D3 vs Flint

-

- 164 countries' upper secondary completion rates (UNESCO UIS, modelled, 2000–2025): one line per country, and - one dot per country for girls against boys in 2025. Left, styled by hand in D3; right, Flint from a plain - spec (the fields, their types, the chart type). Below the charts: where the difference comes from. -

+

164 countries, UNESCO UIS completion rates. Left: D3 by hand. Right: Flint from a plain spec.

); } diff --git a/site/src/playground/DensityLab.tsx b/site/src/playground/DensityLab.tsx index 77f83174..84a71b34 100644 --- a/site/src/playground/DensityLab.tsx +++ b/site/src/playground/DensityLab.tsx @@ -28,9 +28,9 @@ const CELL = { width: 360, height: 270 }; /* Lines: weight follows the number of series */ /* ---------------------------------------------------------------------------------------------- */ -const SERIES_COUNTS = [7, 30, SERIES.length]; +export const SERIES_COUNTS = [7, 30, SERIES.length]; -function lineInput(count: number, theme: Theme): ChartAssemblyInput { +export function lineInput(count: number, theme: Theme): ChartAssemblyInput { const rows = SERIES.slice(0, count).flatMap((s) => s.values.map(([year, completion]) => ({ country: s.country, region: s.region, year, completion }))); return { data: { values: rows }, @@ -84,13 +84,13 @@ function LineDensity() { /* Dots: size follows fullness; the theme picks one overlap treatment */ /* ---------------------------------------------------------------------------------------------- */ -interface DotData { key: string; label: string; rows: Row[]; x: string; y: string; color: string; type: string } -const DOT_DATA: DotData[] = [ +export interface DotData { key: string; label: string; rows: Row[]; x: string; y: string; color: string; type: string } +export const DOT_DATA: DotData[] = [ { key: 'cars', label: 'Cars: 392 dots filling the plot', rows: CARS, x: 'Horsepower', y: 'MPG', color: 'Origin', type: 'Quantity' }, { key: 'uis', label: 'UIS: 164 dots on a diagonal', rows: LATEST, x: 'girls', y: 'boys', color: 'region', type: 'Percentage' }, ]; -function dotInput(data: DotData, theme: Theme, opacity?: number): ChartAssemblyInput { +export function dotInput(data: DotData, theme: Theme, opacity?: number): ChartAssemblyInput { return { data: { values: data.rows }, semantic_types: { [data.x]: data.type, [data.y]: data.type, [data.color]: 'Category' }, diff --git a/site/src/playground/DiverseChartWallIllustration.tsx b/site/src/playground/DiverseChartWallIllustration.tsx index 9a03b7da..0c1d87c4 100644 --- a/site/src/playground/DiverseChartWallIllustration.tsx +++ b/site/src/playground/DiverseChartWallIllustration.tsx @@ -80,12 +80,13 @@ function IllustrationCard({ slot }: { slot: IllustrationSlot }) { ); } -export function DiverseChartWallIllustration() { +/** The wall of themed charts, eight to a row; `rows` takes the first one to three of its rows. */ +export function DiverseChartWallIllustration({ rows = 3 }: { rows?: number }) { return (
- {[0, 1, 2].map((row) => ( + {[0, 1, 2].slice(0, rows).map((row) => (
; +type Side = { field: string; type: string; values: (string | number)[] }; + +const REGIONS = ['North', 'South', 'East', 'West', 'Central']; +const CELL = { width: 520, height: 160 }; + +const iso = (time: number) => new Date(time).toISOString().slice(0, 10); +const day = (y: number, m: number, d: number) => Date.UTC(y, m, d); +const monthsFrom = (y: number, m: number, count: number, every = 1) => + Array.from({ length: count }, (_, i) => new Date(Date.UTC(y, m + i * every, 1)).toISOString().slice(0, 7)); +const dates = (n: number, from: number, stepDays: number) => Array.from({ length: n }, (_, i) => iso(from + i * stepDays * 864e5)); +const monthDays = (count: number, pick: (y: number, m: number) => number) => Array.from({ length: count }, (_, i) => iso(pick(2024, i))); + +/** A fixed pseudo-random stream, so the page draws the same holes every time. */ +function random(seed: number) { + let s = seed; + return () => ((s = (s * 16807) % 2147483647) - 1) / 2147483646; +} +const drop = (values: string[], share: number, seed: number) => { + const next = random(seed); + return values.filter((_, i) => i === 0 || i === values.length - 1 || next() > share); +}; + +const YEAR_MS = 365.25 * 864e5; + +/** A value as a time, where it reads as one: a bare year, epoch milliseconds, or a date string. */ +function timeOf(value: string | number): number | undefined { + if (typeof value === 'number') return value >= 1000 && value <= 2999 ? Date.UTC(value, 0, 1) : value; + const week = value.match(/^(\d{4})-W(\d{2})$/); + if (week) return Date.UTC(Number(week[1]), 0, 1) + (Number(week[2]) - 1) * 7 * 864e5; + const time = Date.parse(value); + return Number.isFinite(time) ? time : undefined; +} + +/** + * How each region's demand runs through time, so the cells show something: a seasonal swing that + * peaks at a different time of year in each region, a growth trend in the East over the dates' span, a weekend dip in + * daily data, a day and night cycle in hourly data, a few one-off spikes, and a little noise. + */ +const REGION_SHAPE = [ + { level: 52, swing: 30, peak: 0.55, trend: 0, weekend: -10 }, // North: hot summers + { level: 58, swing: 10, peak: 0.05, trend: 0, weekend: -6 }, // South: mild, a winter peak + { level: 34, swing: 12, peak: 0.6, trend: 14, weekend: -8 }, // East: growing + { level: 50, swing: 22, peak: 0.05, trend: -3, weekend: 6 }, // West: winter peak, busy weekends + { level: 46, swing: 16, peak: 0.35, trend: 2, weekend: -22 }, // Central: workdays +]; + +function demand(time: number | undefined, i: number, r: number, stepMs: number, first: number, span: number): number { + const shape = REGION_SHAPE[r]; + const noise = (((i * 7919 + r * 104729) % 1000) / 1000 - 0.5) * 8; + if (time === undefined) return Math.round(shape.level + 20 * Math.sin(i / 4 + r) + noise); + const d = new Date(time); + const ofYear = (time - Date.UTC(d.getUTCFullYear(), 0, 1)) / YEAR_MS; + let value = shape.level + shape.swing * Math.cos(2 * Math.PI * (ofYear - shape.peak)) + 2 * shape.trend * (time - first) / span; + if (stepMs < 2 * 864e5 && [0, 6].includes(d.getUTCDay())) value += shape.weekend; + if (stepMs < 864e5) value += 18 * Math.cos(2 * Math.PI * (d.getUTCHours() - 15) / 24) - 6; + if ((i * 13 + r * 5) % 23 === 0) value += 28; + return Math.max(0, Math.round(value + noise)); +} + +/** Five regions down y, the date field along x. */ +function heatmapInput(x: Side): ChartAssemblyInput { + const times = x.values.map(timeOf); + const known = times.filter((t): t is number => t !== undefined).sort((a, b) => a - b); + const gaps = known.slice(1).map((t, i) => t - known[i]).sort((a, b) => a - b); + const stepMs = gaps.length ? gaps[Math.floor(gaps.length / 2)] : YEAR_MS; + const rows: Row[] = x.values.flatMap((v, i) => REGIONS.map((region, r) => ({ + [x.field]: v, region, Demand: demand(times[i], i, r, stepMs, known[0] ?? 0, Math.max(1, (known[known.length - 1] ?? 0) - (known[0] ?? 0))), + }))); + return { + data: { values: rows }, + semantic_types: { [x.field]: x.type, region: 'Category', Demand: 'Quantity' }, + chart_spec: { chartType: 'Heatmap', encodings: { x: x.field, y: 'region', color: { field: 'Demand', aggregate: 'sum' } }, canvasSize: CELL }, + } as ChartAssemblyInput; +} + +interface Case { title: string; note: string; x: Side } + +/** A field of dates (open time), as Flint reads its semantic type: not a cycle, not a duration. */ +function isDateType(type: string): boolean { + if (!isRegistered(type)) return false; + const entry = getRegistryEntry(type); + return entry.t0 === 'Temporal' && entry.t1 !== 'Duration' && entry.domainShape !== 'cyclic'; +} + +/** What the compiled spec put along x, and whether the case is a date field on bands. */ +function readX(spec: ChartAssemblyInput, x: Side): { text: string; scope: 'dates on bands' | 'time scale' | 'not dates' } { + let compiled: any; + try { compiled = assembleVegaLite(spec); } catch (error) { return { text: `error: ${(error as Error).message}`, scope: 'not dates' }; } + const units: any[] = [compiled, ...(compiled.layer ?? [])]; + const enc = units.map((unit) => unit.encoding?.x).find((e) => e?.field === x.field) ?? units.map((unit) => unit.encoding?.x).find(Boolean); + if (!enc) return { text: 'no x encoding', scope: 'not dates' }; + const date = isDateType(x.type); + const count = new Set(x.values).size; + if (enc.type === 'ordinal' || enc.type === 'nominal') { + return { text: `bands (${enc.type}) · ${count} values`, scope: date ? 'dates on bands' : 'not dates' }; + } + const transforms: any[] = units.flatMap((unit) => unit.transform ?? []); + const end = transforms.find((t) => t.as === '__cell_x_end')?.calculate as string | undefined; + const months = end?.match(/utcOffset\('month', [^,]+, (\d+)\)/); + const days = end?.match(/utcOffset\('day', [^,]+, (\d+)\)/); + const ms = end?.match(/^time\([^)]*\) \+ (\d+)$/); + const span = !end ? '' : months ? ` · each cell spans ${months[1]} month(s)` : days ? ` · each cell spans ${days[1]} day(s)` + : ms ? ` · each cell spans ${Number(ms[1]) / 3_600_000} hour(s)` : ' · each cell runs to the next date'; + return { text: `time scale (${enc.scale?.type ?? 'time'})${span}`, scope: date ? 'time scale' : 'not dates' }; +} + +const SCOPE_INK = { 'dates on bands': '#9a6700', 'time scale': '#1a7f37', 'not dates': '#57606a' } as const; + +function Cell({ c }: { c: Case }) { + const spec = heatmapInput(c.x); + const read = readX(spec, c.x); + return ( +
+
+ {c.title} · {read.scope} +
{c.note} +
x is {c.x.type} → {read.text} +
+ +
+ ); +} + +/* ---------------------------------------------------------------------------------------------- */ +/* Cases */ +/* ---------------------------------------------------------------------------------------------- */ + +const FEW: Case[] = [ + { title: '6 months', note: 'YearMonth, 2025-01 … 2025-06: few enough to name each one.', x: { field: 'Month', type: 'YearMonth', values: monthsFrom(2025, 0, 6) } }, + { title: 'Two snapshots', note: 'YearMonth, 2025-07 and 2025-12.', x: { field: 'Month', type: 'YearMonth', values: ['2025-07', '2025-12'] } }, + { title: '5 years', note: 'Year, 2020 … 2024.', x: { field: 'Year', type: 'Year', values: [2020, 2021, 2022, 2023, 2024] } }, + { title: '8 quarter ends', note: 'Date, 2023-03-31 … 2024-12-31.', x: { field: 'Date', type: 'Date', values: Array.from({ length: 8 }, (_, i) => iso(day(2023, 3 * i + 3, 0))) } }, +]; + +const REGULAR: Case[] = [ + { title: '12 months', note: 'YearMonth, 2025-01 … 2025-12.', x: { field: 'Month', type: 'YearMonth', values: monthsFrom(2025, 0, 12) } }, + { title: '60 months', note: 'YearMonth, five years of months.', x: { field: 'Month', type: 'YearMonth', values: monthsFrom(2021, 0, 60) } }, + { title: 'Quarters, 6 years', note: 'Date, the first day of each quarter.', x: { field: 'Quarter', type: 'Date', values: monthsFrom(2019, 0, 24, 3).map((m) => `${m}-01`) } }, + { title: '26 weeks', note: 'Date, every Monday from 2024-01-01.', x: { field: 'Week', type: 'Date', values: dates(26, day(2024, 0, 1), 7) } }, + { title: '52 weeks, as dates', note: 'YearWeek, every Monday of 2024 written as a date.', x: { field: 'Week', type: 'YearWeek', values: dates(52, day(2024, 0, 1), 7) } }, + { title: '52 weeks, as week names', note: 'YearWeek, 2024-W01 … 2024-W52.', x: { field: 'Week', type: 'YearWeek', values: Array.from({ length: 52 }, (_, i) => `2024-W${String(i + 1).padStart(2, '0')}`) } }, + { title: '90 days', note: 'Date, every day from 2024-01-01.', x: { field: 'Day', type: 'Date', values: dates(90, day(2024, 0, 1), 1) } }, + { title: '25 years', note: 'Year, 2000 … 2024.', x: { field: 'Year', type: 'Year', values: Array.from({ length: 25 }, (_, i) => 2000 + i) } }, +]; + +const OFF_CALENDAR: Case[] = [ + { title: 'The 5th of each month', note: 'Date, 2024-01-05, 2024-02-05, …', x: { field: 'Date', type: 'Date', values: monthDays(24, (y, m) => day(y, m, 5)) } }, + { title: 'Month ends', note: 'Date, 2024-01-31, 2024-02-29, …: 28 to 31 days apart.', x: { field: 'Date', type: 'Date', values: monthDays(24, (y, m) => day(y, m + 1, 0)) } }, + { title: 'Twice a month', note: 'Date, the 1st and 15th: 14 to 17 days apart.', x: { field: 'Date', type: 'Date', values: monthDays(12, (y, m) => day(y, m, 1)).flatMap((d) => [d, `${d.slice(0, 8)}15`]) } }, + { + title: 'Every 13 or 14 days', note: 'Date, 80 dates over three years (gallery case "Temporal × Nominal, 80×5").', + x: { field: 'Date', type: 'Date', values: Array.from({ length: 80 }, (_, i) => iso(day(2016, 0, 1) + Math.floor(i * (365 * 3 / 80)) * 864e5)) }, + }, + { title: 'About every 45 days', note: 'Date, 24 dates: 2020-01-01, 02-15, 04-01, … (theme lab "Shipments over time").', x: { field: 'Date', type: 'Date', values: Array.from({ length: 24 }, (_, i) => iso(day(2020, 0, 1) + Math.floor(i * (1049 / 23)) * 864e5)) } }, + { title: 'Trading days', note: 'Date, weekdays only for 8 weeks.', x: { field: 'Date', type: 'Date', values: dates(56, day(2024, 0, 1), 1).filter((d) => ![0, 6].includes(new Date(d).getUTCDay())) } }, +]; + +const IRREGULAR: Case[] = [ + { title: '36 months, some missing', note: 'YearMonth, about one month in six missing.', x: { field: 'Month', type: 'YearMonth', values: drop(monthsFrom(2022, 0, 36), 0.18, 7) } }, + { title: '90 days, some missing', note: 'Date, about one day in four missing.', x: { field: 'Day', type: 'Date', values: drop(dates(90, day(2024, 0, 1), 1), 0.25, 11) } }, + { + title: '40 dates at random', note: 'Date, 40 days drawn at random from two years.', + x: { field: 'Date', type: 'Date', values: (() => { const next = random(23); return [...new Set(Array.from({ length: 40 }, () => iso(day(2023, 0, 1) + Math.floor(next() * 730) * 864e5)))].sort(); })() }, + }, + { + title: 'Clustered events', note: 'Date, bursts of a few days each, months apart.', + x: { field: 'Date', type: 'Date', values: [[2023, 1, 3], [2023, 1, 4], [2023, 1, 6], [2023, 4, 20], [2023, 4, 21], [2023, 8, 1], [2023, 8, 2], [2023, 8, 3], [2023, 8, 8], [2024, 0, 15], [2024, 0, 16], [2024, 5, 30]].map(([y, m, d]) => iso(day(y, m, d))) }, + }, +]; + +const TIMESTAMPS: Case[] = [ + { title: 'Hourly readings', note: 'DateTime, 2024-03-01T00:00:00Z … 47 hours on.', x: { field: 'Time', type: 'DateTime', values: Array.from({ length: 48 }, (_, i) => new Date(day(2024, 2, 1) + i * 36e5).toISOString()) } }, + { title: 'Daily at 09:30', note: 'DateTime, 2024-01-01T09:30:00Z, the next day at 09:30, …', x: { field: 'Time', type: 'DateTime', values: Array.from({ length: 60 }, (_, i) => new Date(day(2024, 0, 1) + i * 864e5 + 9.5 * 36e5).toISOString()) } }, + { title: 'Month ends as timestamps', note: 'DateTime, 2024-01-31T23:59:59Z, …', x: { field: 'Time', type: 'DateTime', values: Array.from({ length: 30 }, (_, i) => new Date(day(2024, i + 1, 1) - 1000).toISOString()) } }, + { title: 'Quarters as epoch milliseconds', note: 'Date, numbers: 1546300800000 (2019-01-01), …', x: { field: 'Time', type: 'Date', values: Array.from({ length: 24 }, (_, i) => day(2019, i * 3, 1)) } }, +]; + +const SECTIONS: { title: string; text: string; cases: Case[] }[] = [ + { title: '1. A few dates', text: 'Eight or fewer dates are named one cell each, whatever their step.', cases: FEW }, + { title: '2. Dates on a regular calendar step', text: 'Every month, quarter, week, day or year, none missing.', cases: REGULAR }, + { title: '3. Regular dates the calendar does not step evenly', text: 'One date per period off its first day, or a step in days that drifts against the calendar.', cases: OFF_CALENDAR }, + { title: '4. Irregular dates, with holes', text: 'Dates missing at random, or drawn at random.', cases: IRREGULAR }, + { title: '5. Timestamps', text: 'The same steps as times of day or epoch milliseconds: the period is read from the values, not the type.', cases: TIMESTAMPS }, +]; + +export function HeatmapLab() { + return ( +
+
+

Heatmaps along a date side

+

+ Five regions down y, a date field along x. The axis type follows the semantic type: a date field is drawn on a time + scale where its values keep a step, each cell spanning the period its date stands for, or as one cell per date where + they are few or keep none. Each caption names the semantic type and what the compiled Vega-Lite drew. +

+
+ {SECTIONS.map((section) => ( +
+

{section.title}

+

{section.text}

+
+ {section.cases.map((c) => )} +
+
+ ))} +
+ ); +} diff --git a/site/src/playground/InteractionArchitectureIllustration.tsx b/site/src/playground/InteractionArchitectureIllustration.tsx index 52b706ad..e87f4fe2 100644 --- a/site/src/playground/InteractionArchitectureIllustration.tsx +++ b/site/src/playground/InteractionArchitectureIllustration.tsx @@ -234,7 +234,7 @@ export function InteractionArchitectureIllustration() { lines={[ { text: '- Update target' }, { text: '- Ops (set-style,' }, - { text: 'set-annotation, set-viewport,', indent: true }, + { text: 'annotate-text, set-viewport,', indent: true }, { text: 'set-order)', indent: true }, ]} /> diff --git a/site/src/playground/InteractionGallery.tsx b/site/src/playground/InteractionGallery.tsx index bbc750a0..a8d1fb6c 100644 --- a/site/src/playground/InteractionGallery.tsx +++ b/site/src/playground/InteractionGallery.tsx @@ -907,7 +907,7 @@ function InteractiveChart({ void chart.applyUpdate({ id: 'select-context', ops: [{ - op: 'set-annotation', + op: 'annotate-text', target: { visual: menuTarget.visual, elements: [menuElement] }, value: { text }, }], diff --git a/site/src/playground/LabelExperimentLab.tsx b/site/src/playground/LabelExperimentLab.tsx deleted file mode 100644 index 3bf8b3cb..00000000 --- a/site/src/playground/LabelExperimentLab.tsx +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { useMemo } from 'react'; -import { assembleVegaLite, THEME_PRESETS, type ChartAssemblyInput } from 'flint-chart'; -import { ScaleToFit } from '../components/ScaleToFit'; -import { FlintView } from '../components/FlintView'; -import './label-experiment-lab.css'; - -type Outcome = 'direct' | 'dodge' | 'fallback'; - -interface ExperimentCase { - id: string; - title: string; - note: string; - expected: Outcome; - input: ChartAssemblyInput; -} - -const baseTheme = (THEME_PRESETS as any).datawrapper.spec; -const labelTheme = { - ...baseTheme, - id: 'label-experiment', - label: 'Label experiment', - legend: { - ...baseTheme.legend, - show: 'always', - placement: ['seriesEnd', 'right'], - }, -}; - -function lineRows(endValues: number[], endYears?: number[]): any[] { - return endValues.flatMap((endValue, seriesIndex) => { - const endYear = endYears?.[seriesIndex] ?? 2020; - return [1950, 1980, endYear].map((year, index) => ({ - year, - series: `S${seriesIndex + 1}`, - value: index === 2 ? endValue : 72 - seriesIndex * 4 - index * 5, - })); - }); -} - -function lineInput(endValues: number[], endYears?: number[]): ChartAssemblyInput { - return { - data: { values: lineRows(endValues, endYears) }, - semantic_types: { year: 'Year', series: 'Category', value: 'Quantity' }, - chart_spec: { - chartType: 'Line Chart', - encodings: { x: 'year', y: 'value', color: 'series' }, - baseSize: { width: 420, height: 280 }, - }, - theme_spec: labelTheme, - } as ChartAssemblyInput; -} - -const connectedRows = [ - ['0', 1955, 4.3, 37], ['0', 1980, 5.5, 55], ['0', 2005, 6.1, 58], - ['1', 1955, 1.8, 79], ['1', 1980, 2.8, 69], ['1', 2005, 6.5, 54], - ['2', 1955, 1.6, 77], ['2', 1980, 2.7, 68], ['2', 2005, 6.7, 55], - ['3', 1955, 1.9, 75], ['3', 1980, 3.2, 66], ['3', 2005, 4.9, 63], - ['4', 1955, 1.7, 73], ['4', 1980, 3.0, 67], ['4', 2005, 5.9, 60], - ['5', 1955, 2.8, 71], ['5', 1980, 4.1, 68], ['5', 2005, 6.7, 47], -].map(([cluster, year, fertility, longevity]) => ({ cluster, year, fertility, longevity })); - -const CASES: ExperimentCase[] = [ - { - id: 'separated', - title: 'Aligned and separated', - note: 'One endpoint column; labels already have enough vertical air.', - expected: 'direct', - input: lineInput([18, 38, 58]), - }, - { - id: 'small-dodge', - title: 'Two close endpoints', - note: 'A sub-line-height adjustment is accepted and connected back to each point.', - expected: 'dodge', - input: lineInput([50, 52]), - }, - { - id: 'dense', - title: 'Dense endpoint cluster', - note: 'The required movement exceeds one line of text, so the whole set returns to a legend.', - expected: 'fallback', - input: lineInput([50, 51, 52, 53]), - }, - { - id: 'staggered', - title: 'Staggered final x positions', - note: 'Different final years are harmless when the natural label rows do not overlap.', - expected: 'direct', - input: lineInput([20, 42, 64], [2020, 2010, 2000]), - }, - { - id: 'boundary', - title: 'Top boundary endpoint', - note: 'The highest label stays centred on its endpoint; the figure bounds carry the overhang.', - expected: 'direct', - input: lineInput([25, 48, 72]), - }, - { - id: 'connected', - title: 'Connected scatter trajectories', - note: 'Rightmost points occupy a broad x range, matching the difficult real-world pattern.', - expected: 'fallback', - input: { - data: { values: connectedRows }, - semantic_types: { - cluster: 'Category', - year: 'Year', - fertility: { semanticType: 'Quantity', unit: 'children per woman' }, - longevity: { semanticType: 'Duration', unit: 'years' }, - }, - chart_spec: { - chartType: 'Connected Scatter Plot', - title: 'Cluster development trajectories', - subtitle: 'Synthetic endpoints modeled after the reported collision', - encodings: { x: 'fertility', y: 'longevity', color: 'cluster', order: 'year' }, - baseSize: { width: 420, height: 280 }, - }, - theme_spec: labelTheme, - } as ChartAssemblyInput, - }, -]; - -function buildCase(testCase: ExperimentCase): { outcome: Outcome; message: string; error?: string } { - try { - // Compiled here only for the placement report; the chart compiles itself. - const spec = assembleVegaLite(testCase.input as any) as any; - const messages = (spec._theme?.report ?? []) - .filter((entry: any) => entry.path === 'legend.placement') - .map((entry: any) => entry.message); - const message = messages.find((entry: string) => - entry.includes('dodged by at most') - || entry.includes('key is drawn') - || entry.includes('do not form one readable label column') - || entry.includes('more than one line of text') - ) ?? messages.at(-1) ?? 'No placement report'; - const outcome: Outcome = messages.some((entry: string) => entry.includes('dodged by at most')) - ? 'dodge' - : messages.some((entry: string) => entry.includes('key is drawn')) - ? 'fallback' - : 'direct'; - return { outcome, message }; - } catch (error) { - return { outcome: 'fallback', message: 'Assembly failed', error: String((error as Error)?.message ?? error) }; - } -} - -function CaseTile({ testCase }: { testCase: ExperimentCase }) { - const built = useMemo(() => buildCase(testCase), [testCase]); - const matches = built.outcome === testCase.expected; - - return ( -
-
-
-

{testCase.title}

-

{testCase.note}

-
- - {built.outcome} - -
-
- {built.error - ?
{built.error}
- : ( - - - - )} -
-
- {built.message} - {!matches && Expected {testCase.expected}} -
-
- ); -} - -export function LabelExperimentLab() { - return ( -
-
-

Series-end label experiment

-

- Direct labels stay when no more than eight endpoints form one column and need at most one - line of vertical adjustment. Otherwise, the complete set falls back to a legend. -

-
-
- {CASES.map((testCase) => )} -
-
- ); -} diff --git a/site/src/playground/LegendLab.tsx b/site/src/playground/LegendLab.tsx index 3399fda2..37763cd3 100644 --- a/site/src/playground/LegendLab.tsx +++ b/site/src/playground/LegendLab.tsx @@ -13,9 +13,9 @@ import './legend-lab.css'; */ type Row = Record; -type Size = { key: string; label: string; width: number; height: number }; +export type Size = { key: string; label: string; width: number; height: number }; -const SIZES: Size[] = [ +export const SIZES: Size[] = [ { key: 's', label: 'Small 360×260', width: 360, height: 260 }, { key: 'm', label: 'Medium 560×380', width: 560, height: 380 }, { key: 'l', label: 'Wide 800×420', width: 800, height: 420 }, @@ -63,7 +63,7 @@ const GAP_TYPES = { }; const PENGUIN_TYPES = { Species: 'Category', Sex: 'Category', 'Flipper length (mm)': 'Quantity', 'Body mass (g)': 'Quantity' }; -interface LegendCase { +export interface LegendCase { key: string; label: string; why: string; @@ -81,7 +81,7 @@ const scatter = ( const GAP_XY = { x: 'GDP per capita', y: 'Life expectancy' }; const PENGUIN_XY = { x: 'Flipper length (mm)', y: 'Body mass (g)' }; -const SINGLE: LegendCase[] = [ +export const SINGLE: LegendCase[] = [ { key: 'colour-3', label: 'Colour, 3 short names', why: 'the simplest key', input: scatter('Penguins', PENGUINS, PENGUIN_TYPES, { ...PENGUIN_XY, color: 'Species' }) }, { key: 'colour-5', label: 'Colour, 5 names', why: 'a row that may wrap on a small canvas', @@ -98,7 +98,7 @@ const SINGLE: LegendCase[] = [ input: scatter('Income and life expectancy, 2007', G2007, GAP_TYPES, { ...GAP_XY, size: 'Population (M)', detail: 'Country' }, true) }, ]; -const MULTI: LegendCase[] = [ +export const MULTI: LegendCase[] = [ { key: 'colour-size', label: 'Colour + size', why: 'an untitled colour key beside a titled size key', input: scatter('Income and life expectancy, 2007', G2007, GAP_TYPES, { ...GAP_XY, color: 'Continent', size: 'Population (M)', detail: 'Country' }, true) }, { key: 'colour-shape', label: 'Colour + shape', why: 'two short category keys', diff --git a/site/src/playground/MapsLab.tsx b/site/src/playground/MapsLab.tsx new file mode 100644 index 00000000..609b5890 --- /dev/null +++ b/site/src/playground/MapsLab.tsx @@ -0,0 +1,767 @@ +import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react'; +import { THEME_PRESETS, assembleVegaLite, type ChartAssemblyInput } from 'flint-chart'; +import { FlintView } from '../components/FlintView'; +import { siteTheme } from '../shared/theme'; +import { countryAlpha } from '../../../packages/flint-js/src/chart-types/geo'; + +/** + * Maps lab: one card per behaviour of the map plan (framing in the box, the globe, regions without + * data, the join and its report, boundaries of the chart's own). Each card draws the chart at its own size + * against the box the host gives it, lists what to check, and shows what the compile decided. + */ + +// ---------------------------------------------------------------- data +const SHARES = [ + ['United States', 0.62], ['Canada', 0.58], ['Mexico', 0.33], ['Brazil', 0.41], ['Argentina', 0.36], ['France', 0.55], + ['Germany', 0.6], ['Nigeria', 0.12], ['Kenya', 0.18], ['South Africa', 0.29], ['India', 0.22], ['China', 0.38], + ['Japan', 0.71], ['Indonesia', 0.25], ['Australia', 0.66], +].map(([Country, Share]) => ({ Country, Share })); +const EUROPE = [['France', 0.55], ['Germany', 0.6], ['Italy', 0.48], ['Spain', 0.51], ['Poland', 0.37], ['Netherlands', 0.64], ['Sweden', 0.69]] + .map(([Country, Share]) => ({ Country, Share })); +/** Volcanoes of the Pacific Ring of Fire, either side of the antimeridian. */ +const VOLCANOES = [ + ['Mount Fuji', 138.73, 35.36, 'Asia'], ['Sakurajima', 130.66, 31.58, 'Asia'], ['Klyuchevskaya Sopka', 160.64, 56.06, 'Asia'], + ['Pinatubo', 120.35, 15.13, 'Asia'], ['Mayon', 123.69, 13.26, 'Asia'], ['Krakatoa', 105.42, -6.1, 'Asia'], ['Merapi', 110.45, -7.54, 'Asia'], + ['Ruapehu', 175.57, -39.28, 'Oceania'], ['Mount Redoubt', -152.74, 60.49, 'North America'], ['Mount St. Helens', -122.19, 46.19, 'North America'], + ['Popocatépetl', -98.62, 19.02, 'North America'], ['Cotopaxi', -78.44, -0.68, 'South America'], ['Villarrica', -71.93, -39.42, 'South America'], +].map(([location, longitude, latitude, continent]) => ({ location, longitude, latitude, continent })); +const STATES = [['California', 7.2], ['Texas', 6.1], ['New York', 8.3], ['Florida', 5.4], ['Washington', 6.6], ['Illinois', 7.7], ['Georgia', 5.9]] + .map(([State, Rate]) => ({ State, Rate })); +const COUNTIES = [[6037, 'Los Angeles', 9.1], [17031, 'Cook', 7.4], [48201, 'Harris', 6.8], [4013, 'Maricopa', 5.2], [53033, 'King', 4.1], [36061, 'New York', 8.8], [12086, 'Miami-Dade', 6.3]] + .map(([FIPS, County, Rate]) => ({ FIPS, County, Rate })); +const MESSY = [ + { Country: 'France', Population: 40e6 }, { Country: 'FRA', Population: 28e6 }, { Country: 'Germany', Population: 84e6 }, + { Country: 'Côte d’Ivoire', Population: 28e6 }, { Country: 'S. Korea', Population: 52e6 }, { Country: 'Tuvalu', Population: 11e3 }, + { Country: 'World', Population: 8.1e9 }, { Country: 'OECD members', Population: 1.38e9 }, { Country: 'Narnia', Population: 1e6 }, +]; +const CITIES = ([ + ['Paris', 2.35, 48.86, 2.1, 'Capital'], ['London', -0.13, 51.51, 8.9, 'Capital'], ['Berlin', 13.4, 52.52, 3.6, 'Capital'], ['Madrid', -3.7, 40.42, 3.2, 'Capital'], + ['Rome', 12.5, 41.9, 2.8, 'Capital'], ['Brussels', 4.35, 50.85, 1.2, 'Capital'], ['Amsterdam', 4.9, 52.37, 0.9, 'Capital'], ['Vienna', 16.37, 48.21, 1.9, 'Capital'], + ['Prague', 14.42, 50.08, 1.3, 'Capital'], ['Warsaw', 21.0, 52.23, 1.8, 'Capital'], ['Lisbon', -9.14, 38.72, 0.5, 'Capital'], ['Dublin', -6.26, 53.35, 0.6, 'Capital'], + ['Luxembourg', 6.13, 49.61, 0.1, 'Capital'], ['Bern', 7.45, 46.95, 0.13, 'Capital'], ['Zurich', 8.54, 47.37, 0.4, 'City'], ['Munich', 11.58, 48.14, 1.5, 'City'], + ['Milan', 9.19, 45.46, 1.4, 'City'], ['Barcelona', 2.17, 41.39, 1.6, 'City'], ['Hamburg', 9.99, 53.55, 1.8, 'City'], ['Lyon', 4.84, 45.76, 0.5, 'City'], + ['Antwerp', 4.4, 51.22, 0.5, 'City'], ['Rotterdam', 4.48, 51.92, 0.65, 'City'], ['Frankfurt', 8.68, 50.11, 0.75, 'City'], ['Cologne', 6.96, 50.94, 1.1, 'City'], +] as const).map(([City, longitude, latitude, Population, Kind]) => ({ City, longitude, latitude, Population, Kind })); +/** State populations in millions (2020 census, rounded). */ +const STATE_POPULATION = ([ + ['CA', 39.5], ['TX', 29.1], ['FL', 21.5], ['NY', 20.2], ['PA', 13], ['IL', 12.8], ['OH', 11.8], ['GA', 10.7], ['NC', 10.4], ['MI', 10.1], + ['NJ', 9.3], ['VA', 8.6], ['WA', 7.7], ['AZ', 7.2], ['MA', 7], ['TN', 6.9], ['IN', 6.8], ['MD', 6.2], ['MO', 6.2], ['WI', 5.9], + ['CO', 5.8], ['MN', 5.7], ['SC', 5.1], ['AL', 5], ['LA', 4.7], ['KY', 4.5], ['OR', 4.2], ['OK', 4], ['CT', 3.6], ['UT', 3.3], + ['IA', 3.2], ['NV', 3.1], ['AR', 3], ['MS', 3], ['KS', 2.9], ['NM', 2.1], ['NE', 2], ['ID', 1.8], ['WV', 1.8], ['HI', 1.5], + ['NH', 1.4], ['ME', 1.4], ['RI', 1.1], ['MT', 1.1], ['DE', 1], ['SD', 0.9], ['ND', 0.8], ['AK', 0.7], ['VT', 0.6], ['WY', 0.6], +] as const).map(([State, Population]) => ({ State, Population })); +/** Life expectancy at birth, years (rounded). */ +const LIFE = ([ + ['USA', 'United States', 76], ['CAN', 'Canada', 82], ['MEX', 'Mexico', 75], ['BRA', 'Brazil', 73], ['ARG', 'Argentina', 76], ['FRA', 'France', 82], + ['DEU', 'Germany', 81], ['GBR', 'United Kingdom', 81], ['RUS', 'Russia', 73], ['CHN', 'China', 78], ['IND', 'India', 70], ['AUS', 'Australia', 83], + ['ZAF', 'South Africa', 64], ['NGA', 'Nigeria', 53], ['EGY', 'Egypt', 72], ['JPN', 'Japan', 84], ['IDN', 'Indonesia', 71], ['SAU', 'Saudi Arabia', 77], + ['KAZ', 'Kazakhstan', 70], ['DZA', 'Algeria', 76], ['COD', 'DR Congo', 60], ['NLD', 'Netherlands', 82], ['BEL', 'Belgium', 82], ['CHE', 'Switzerland', 84], + ['SRB', 'Serbia', 75], ['HRV', 'Croatia', 78], ['BIH', 'Bosnia', 75], ['ALB', 'Albania', 77], ['MNE', 'Montenegro', 76], ['MKD', 'North Macedonia', 76], +] as const).map(([iso, Country, Life]) => ({ iso, Country, Life })); +const CODES = [['CA', 0.4], ['IN', 0.7], ['GE', 0.2], ['WA', 0.5]].map(([Code, Share]) => ({ Code, Share })); + +// ---------------------------------------------------------------- cases +interface MapCase { + id: string; + group: string; + title: string; + check: string[]; + input: Omit & { chart_spec: Record }; + /** Boundaries of the chart's own, loaded before the card draws (`chartProperties.boundaries`). */ + boundaries?: () => Promise>; +} + +/** The bundled boundaries, loaded only when a card that draws its own asks for them. */ +const geo = () => import('flint-chart/geo'); + +/** A countries topology with each feature keyed by its ISO alpha-3 code, as a file of the chart's own might be. */ +function keyedByAlpha3(topology: any): any { + const countries = topology.objects.countries; + return { + ...topology, + objects: { + ...topology.objects, + countries: { ...countries, geometries: countries.geometries.map((shape: any) => ({ ...shape, id: countryAlpha(Number(shape.id), 'iso3') ?? shape.id })) }, + }, + }; +} + +const PROVINCES = [[440000, 0.21], [330000, 0.17], [320000, 0.09], [510000, 0.04], [110000, 0.12], [650000, 0.06], [540000, 0.03]] + .map(([Adcode, Growth]) => ({ Adcode, Growth })); + +const choropleth = (values: Record[], semantic_types: Record, id: string, color: string, chartProperties: Record = {}) => ({ + data: { values }, semantic_types, chart_spec: { chartType: 'Choropleth', encodings: { id, color }, chartProperties }, +}); +const points = (chartProperties: Record = {}, values: Record[] = VOLCANOES) => ({ + data: { values }, + semantic_types: { location: 'Name', longitude: 'Longitude', latitude: 'Latitude', continent: 'Category' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', color: 'continent' }, chartProperties }, +}); + +// Routes: stops joined in order. Places after their usual identifications; the storm tracks are synthetic. +const ODYSSEY = ([ + [1, 'Troy', 26.24, 39.96], [2, 'Ismarus', 25.52, 40.89], [3, 'Lotus-Eaters', 10.86, 33.81], [4, 'Cyclops', 15.16, 37.56], + [5, 'Aeolia', 14.95, 38.47], [6, 'Laestrygonians', 9.16, 41.39], [7, 'Aeaea', 13.05, 41.23], [8, 'Underworld', 14.07, 40.84], + [9, 'Sirens', 14.43, 40.58], [10, 'Scylla and Charybdis', 15.63, 38.25], [11, 'Thrinacia', 15.0, 37.08], [12, 'Ogygia', 14.25, 36.05], + [13, 'Scheria', 19.92, 39.62], [14, 'Ithaca', 20.71, 38.37], +] as const).map(([Stop, Place, longitude, latitude]) => ({ Stop, Place, longitude, latitude })); +/** The crew aboard leaving each Odyssey stop, after a traditional reckoning (twelve ships at Troy, one after the Laestrygonians, none after Thrinacia). */ +const CREW = [600, 528, 528, 522, 522, 46, 45, 45, 45, 39, 1, 1, 1, 1]; +/** Days spent at each Odyssey stop, roughly as the poem tells it (a month with Aeolus, a year with Circe, seven years on Ogygia). */ +const DAYS = [0, 2, 1, 3, 30, 2, 365, 1, 1, 1, 30, 2555, 3, 0]; +const MAGELLAN = ([ + [1, 'Sanlúcar de Barrameda', -6.35, 36.78], [2, 'Canary Islands', -15.4, 28.1], [3, 'Rio de Janeiro', -43.2, -22.9], [4, 'Río de la Plata', -56.0, -35.0], + [5, 'Puerto San Julián', -67.7, -49.3], [6, 'Strait of Magellan', -70.9, -53.2], [7, 'Guam', 144.8, 13.4], [8, 'Cebu', 123.9, 10.3], + [9, 'Moluccas', 127.4, 0.8], [10, 'Timor', 124.5, -9.3], [11, 'Cape of Good Hope', 18.47, -34.36], [12, 'Sanlúcar de Barrameda', -6.35, 36.78], +] as const).map(([Stop, Place, longitude, latitude]) => ({ Stop, Place, longitude, latitude })); +const LEWIS_CLARK = ([ + [1, 'Camp Dubois', -90.12, 38.81], [2, 'Fort Mandan', -101.27, 47.3], [3, 'Great Falls', -111.3, 47.5], [4, 'Lemhi Pass', -113.45, 44.97], + [5, 'Traveler’s Rest', -114.08, 46.75], [6, 'Fort Clatsop', -123.88, 46.13], +] as const).map(([Stop, Place, longitude, latitude]) => ({ Stop, Place, longitude, latitude })); +const OUT_AND_BACK = ([[1, 'London', -0.13, 51.51], [2, 'New York', -74.0, 40.71], [3, 'London', -0.13, 51.51]] as const) + .map(([Stop, Place, longitude, latitude]) => ({ Stop, Place, longitude, latitude })); +const STORMS = (['Ana', 'Bill', 'Cleo'] as const).flatMap((Storm, s) => Array.from({ length: 40 }, (_, Fix) => ({ + Storm, Fix, + longitude: [-45, -60, -35][s] + [-1.1, -0.8, -0.7][s] * Fix + 6 * Math.sin(Fix / 7), + latitude: [12, 15, 18][s] + [0.35, 0.55, 0.75][s] * Fix + 0.006 * Fix * Fix, +}))); +const route = (values: Record[], chartProperties: Record = {}) => ({ + data: { values }, + semantic_types: { Stop: 'Rank', Place: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop' }, chartProperties }, +}); + +const CASES: MapCase[] = [ + { + id: 'world-span', group: 'Framing', title: 'Countries on every continent', + check: ['Frames the world’s land: Antarctica is not drawn and the frame stops near 58°S', 'Fills the canvas width at the land’s shape (≈2.3:1 in Equal Earth), the key beside it'], + input: choropleth(SHARES, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'europe', group: 'Framing', title: 'Europe only', + check: ['Region level: the countries’ box with a margin; continent level (all of Europe) once they cover 40% of it', 'Neighbours (UK, Norway, North Africa) drawn grey and clipped at the plot edge', 'Shape between 0.8:1 and 2:1'], + input: choropleth(EUROPE, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'two-points', group: 'Framing', title: 'Two points far apart east–west (New York, Paris)', + check: ['Frames the North Atlantic, widened north–south so it is not a strip', 'Both points inside, clipped base map'], + input: points({}, [{ location: 'New York', longitude: -74, latitude: 40.7, continent: 'North America' }, { location: 'Paris', longitude: 2.35, latitude: 48.86, continent: 'Europe' }]), + }, + { + id: 'one-country', group: 'Framing', title: 'One small country (Japan)', + check: [ + 'Country level: all of Japan, Hokkaido to Kyushu, centred, a margin round it (at least 16° × 10°) for Korea and the coast of China', + 'Drawn upright: a conic equal-area centred on Japan, not the world’s Equal Earth sheared at 138°E', + 'A window on the world: water fills the frame, a neatline closes the cut edges', + ], + input: choropleth([{ Country: 'Japan', Share: 0.71 }], { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'antarctica', group: 'Framing', title: 'A row names Antarctica', + check: [ + 'Frame runs to 90°S; no Antarctica filter in the transforms', + 'World Bank: “"Antarctica" is not in the World Bank map. Consider using another map via chartProperties.boundaries.”', + ], + input: choropleth([...SHARES, { Country: 'Antarctica', Share: 0.01 }], { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'whole', group: 'Framing', title: 'Europe, framed on the whole map (fit: whole)', + check: ['Whole world including Antarctica, although the data is European'], + input: choropleth(EUROPE, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share', { fit: 'whole' }), + }, + { + id: 'us', group: 'Framing', title: 'US states', + check: ['The atlas’s shape (975:610 ≈ 1.6:1)', 'Alaska and Hawaii inset', 'States without a value in grey'], + input: choropleth(STATES, { State: 'State', Rate: 'Percentage' }, 'State', 'Rate'), + }, + { + id: 'south-pacific', group: 'Framing', title: 'South Pacific countries (Fiji, New Zealand, Samoa)', + check: [ + 'Region level across the antimeridian: New Zealand to Samoa (166°E to 172°W) as one frame, centred near 177°E', + 'World Bank: Samoa coloured; natural-earth: Samoa reported not in the map', + ], + input: choropleth([['Fiji', 0.3], ['New Zealand', 0.6], ['Samoa', 0.2]].map(([Country, Share]) => ({ Country, Share })), { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'antimeridian', group: 'Framing', title: 'Points across the antimeridian (Honolulu, Suva, Auckland, Papeete)', + check: ['Points on both sides of 180° frame the Pacific between them, not the world', 'Projection centred on the Pacific, so no point sits at the map’s seam'], + input: points({}, [['Honolulu', -157.86, 21.31], ['Suva', 178.44, -18.14], ['Auckland', 174.76, -36.85], ['Papeete', -149.57, -17.54]] + .map(([location, longitude, latitude]) => ({ location, longitude, latitude, continent: 'Oceania' }))), + }, + { + id: 'globe-auto', group: 'Globe', title: 'Ring of Fire volcanoes on a globe, facing the data (drag to turn)', + check: ['Square plot, sea disc and rim under the land', 'Faces the data’s mean longitude, tilted ≤ 60° (no pole view)', 'Points behind the horizon hidden; drag to bring them round and watch them appear'], + input: points({ projection: 'orthographic' }), + }, + { + id: 'globe-china', group: 'Globe', title: 'Globe centred on China (projectionCenter preset)', + check: ['Asian volcanoes shown, American ones hidden', 'Rotation [-105, -35, 0]'], + input: points({ projection: 'orthographic', projectionCenter: [105, 35] }), + }, + { + id: 'globe-choropleth', group: 'Globe', title: 'Choropleth globe', + check: ['Square, sea and rim', 'Countries without data drawn as land, not holes', 'Faces the countries named'], + input: choropleth(SHARES, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share', { projection: 'orthographic' }), + }, + { + id: 'disputed', group: 'Boundaries', title: 'India, Pakistan and China: areas of non-determined status', + check: [ + 'World Bank boundaries (default): Jammu and Kashmir, Aksai Chin and Arunachal Pradesh are regions of their own, in the no-data fill, borders dotted', + 'Credit under the map, linked, its disclaimer on hover', + 'boundaries: natural-earth draws the de facto borders, no dotted lines, no credit', + ], + input: choropleth([{ Country: 'India', Share: 0.42 }, { Country: 'Pakistan', Share: 0.31 }, { Country: 'China', Share: 0.55 }, { Country: 'Nepal', Share: 0.2 }], { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'taiwan', group: 'Boundaries', title: 'A row names Taiwan', + check: [ + 'World Bank: “"Taiwan" is not in the World Bank map. Consider using another map via chartProperties.boundaries.”', + 'natural-earth: Taiwan coloured, no warning', + ], + input: choropleth([{ Country: 'Taiwan', Share: 0.6 }, { Country: 'Japan', Share: 0.3 }, { Country: 'South Korea', Share: 0.4 }], { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + }, + { + id: 'file-inline', group: 'Boundaries', title: 'A file of its own, inline: Natural Earth’s shapes, attributed', + check: [ + 'Boundaries: inline (nothing fetched) · credit: Natural Earth (inline)', + '“Boundaries: Natural Earth (inline)” at the foot; no dotted borders; no World Bank credit', + 'Framed and projected as the world map: country ids (iso-numeric, the default)', + ], + input: choropleth(SHARES, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + boundaries: async () => ({ values: (await geo()).naturalEarthTopology, feature: 'countries', attribution: 'Natural Earth (inline)' }), + }, + { + id: 'file-iso3', group: 'Boundaries', title: 'A file keyed by ISO alpha-3 (ids: iso3), the rows by name', + check: [ + 'Every named country coloured: “India” joins the feature keyed IND', + 'Spec: a calculate of upper(toString(datum["id"])) as __geo_key, the join on it', + 'No “not in the map” warning: only the file knows what it draws', + ], + input: choropleth(SHARES, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + boundaries: async () => ({ values: keyedByAlpha3((await geo()).naturalEarthTopology), feature: 'countries', ids: 'iso3', attribution: 'Natural Earth, keyed by alpha-3' }), + }, + { + id: 'file-disputed', group: 'Boundaries', title: 'A file that names its disputed borders, with a linked credit', + check: [ + 'Dotted borders from the object the file names (disputed: "disputed")', + 'Credit as given: its text, a link, and its note on hover', + ], + input: choropleth([{ Country: 'India', Share: 0.42 }, { Country: 'Pakistan', Share: 0.31 }, { Country: 'China', Share: 0.55 }, { Country: 'Nepal', Share: 0.2 }], { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share'), + boundaries: async () => ({ + values: (await geo()).worldBankTopology.medium, feature: 'countries', disputed: 'disputed', + attribution: { text: 'Boundaries: an example national view', href: 'https://example.org/boundaries', title: 'Shown to test a credit with a link and a note.' }, + }), + }, + { + id: 'file-fips', group: 'Boundaries', title: 'US states in longitude and latitude (ids: fips)', + check: [ + 'albersUsa fitted to the file’s shapes (no 975 × 610 pre-projection)', + 'States by name join the file’s zero-padded FIPS ids ("06" ← California)', + 'Plot takes the room’s shape', + ], + input: choropleth(STATES, { State: 'State', Rate: 'Percentage' }, 'State', 'Rate'), + boundaries: async () => ({ values: (await geo()).usStatesTopology, feature: 'states', attribution: 'US Census Bureau, via us-atlas' }), + }, + { + id: 'file-own-keys', group: 'Boundaries', title: 'Chinese provinces from a GeoJSON URL, keyed by adcode (ids: as-is)', + check: [ + 'Mercator fitted to the provinces; the rows match properties.adcode exactly', + 'Provinces without a value in the no-data fill', + 'Boundaries: fetched: china-provinces.geojson', + ], + input: choropleth(PROVINCES, { Adcode: 'Category', Growth: 'Percentage' }, 'Adcode', 'Growth', { + boundaries: { url: `${import.meta.env.BASE_URL}map-data/china-provinces.geojson`, ids: 'as-is', key: 'properties.adcode', attribution: 'DataV.GeoAtlas' }, + }), + }, + { + id: 'unknown-boundaries', group: 'Boundaries', title: 'A boundaries name Flint does not ship', + check: ['Draws the World Bank’s', 'Warning invalid-option-value, listing the names and the file form accepted'], + input: choropleth(SHARES, { Country: 'Country', Share: 'Percentage' }, 'Country', 'Share', { boundaries: 'ordnance-survey' }), + }, + { + id: 'counties', group: 'Regions without data', title: 'US counties (level: county), seven counties', + check: ['Every county drawn; the 3,000+ without a value in grey', 'Counties keyed by FIPS numbers'], + input: choropleth(COUNTIES, { FIPS: 'Integer', County: 'Name', Rate: 'Percentage' }, 'FIPS', 'Rate', { level: 'county' }), + }, + { + id: 'messy', group: 'Join and report', title: 'Messy country keys, a total measure', + check: [ + 'France + FRA combine into one region: Population summed (68M)', 'Côte d’Ivoire and S. Korea resolve', + 'Warnings: Narnia unmatched; World and OECD members are groups; rows combined; a total on a choropleth', + 'Tuvalu coloured on the World Bank map; under natural-earth it is reported not in the map', + ], + input: choropleth(MESSY, { Country: 'Country', Population: 'Count' }, 'Country', 'Population'), + }, + { + id: 'iso2', group: 'Join and report', title: 'keyType: iso2 — CA, IN, GE, WA as countries', + check: ['World map: Canada, India, Georgia (the country) coloured', 'WA (no ISO 2 code) reported unmatched'], + input: choropleth(CODES, { Code: 'Category', Share: 'Percentage' }, 'Code', 'Share', { keyType: 'iso2' }), + }, + { + id: 'us-state', group: 'Join and report', title: 'keyType: us-state — the same codes as states', + check: ['US map: California, Indiana and Washington coloured', 'GE reported unmatched: Georgia’s USPS code is GA'], + input: choropleth(CODES, { Code: 'Category', Share: 'Percentage' }, 'Code', 'Share', { keyType: 'us-state' }), + }, + { + id: 'route-stops', group: 'Routes', title: 'A route of stops: the Odyssey (order: Stop)', + check: [ + 'One line through the 14 stops in order, each leg bowed to the left of travel; a head at each leg’s end, its tip on the stop', + 'A dot at Troy only, where the route starts; the heads mark every other stop', 'White casing under the line', 'Frame takes in the bowed legs', + ], + input: route(ODYSSEY), + }, + { + id: 'route-out-back', group: 'Routes', title: 'Out and back: London → New York → London', + check: ['The leg out and the leg back part ways, each bowed to its left', 'Two heads, one at each city'], + input: route(OUT_AND_BACK), + }, + { + id: 'route-plain', group: 'Routes', title: 'Arrows off, straight legs (arrows: false, curve: straight)', + check: ['Plain lines between the stops, no heads', 'Straight on the map: each leg keeps one compass bearing'], + input: route(ODYSSEY, { arrows: false, curve: 'straight' }), + }, + { + id: 'route-antimeridian', group: 'Routes', title: 'Across the antimeridian: Magellan–Elcano, 1519–1522', + check: ['The Pacific leg leaves the map’s edge and comes back on the other side, not across the whole map', 'Heads on every leg'], + input: route(MAGELLAN), + }, + { + id: 'route-globe', group: 'Routes', title: 'On a globe (projection: orthographic)', + check: ['Legs follow great circles, unbowed', 'Lines and heads past the horizon hidden; drag the globe with navigate on and the heads turn with their legs'], + input: route(MAGELLAN, { projection: 'orthographic' }), + }, + { + id: 'route-us', group: 'Routes', title: 'On the US map: Lewis and Clark, 1804–1806', + check: ['Drawn in the US map’s projection', 'Arcs and heads as on the world map'], + input: route(LEWIS_CLARK, { region: 'us' }), + }, + { + id: 'route-tracks', group: 'Routes', title: 'Tracks: three storms of 40 fixes each, coloured by storm (synthetic)', + check: [ + 'More than 24 legs: great circles, unbowed, one head at each track’s end, over the dots', + 'Each line in its storm’s colour; one key, solid swatches', + ], + input: { + data: { values: STORMS }, + semantic_types: { Storm: 'Category', Fix: 'Rank', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Fix', color: 'Storm' }, chartProperties: {} }, + }, + }, + { + id: 'route-width', group: 'Routes', title: 'Width by a measure (strokeWidth: Crew)', + check: [ + 'Each leg as wide as the crew that sailed it, from zero (1 to 8 px); a key reads the widths; a dot at the start only', + 'Each head sized to its line and joined to it: the line ends inside the head, no rim', + 'A leg too short on screen for its head keeps its line alone; zoom in and the head returns', + ], + input: { + data: { values: ODYSSEY.map((row) => ({ ...row, Crew: CREW[row.Stop - 1] })) }, + semantic_types: { Stop: 'Rank', Place: 'Name', Crew: 'Count', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', strokeWidth: 'Crew' }, chartProperties: {} }, + }, + }, + { + id: 'route-width-and-size', group: 'Routes', title: 'Stops sized, legs widened (size: Days, strokeWidth: Crew)', + check: [ + 'Each stop a dot sized by the days spent there, from zero by area (2.5 to 7 px), with a key of its own; Ogygia the largest', + 'Each leg as wide as its crew, with its own line-width key: the two keys do not merge', + 'Size draws every stop as a dot, beneath the routes; each head’s tip sits on the next dot, halo and all merged', + ], + input: { + data: { values: ODYSSEY.map((row) => ({ ...row, Crew: CREW[row.Stop - 1], Days: DAYS[row.Stop - 1] })) }, + semantic_types: { Stop: 'Rank', Place: 'Name', Crew: 'Count', Days: 'Count', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', strokeWidth: 'Crew', size: 'Days' }, chartProperties: {} }, + }, + }, + { + id: 'route-detail', group: 'Routes', title: 'Routes split by detail, coloured by a quantity', + check: ['Two routes (detail: Voyage) in neutral ink', 'Points coloured by Stop on a ramp'], + input: { + data: { values: [...ODYSSEY.map((row) => ({ ...row, Voyage: 'Odysseus' })), ...OUT_AND_BACK.map((row) => ({ ...row, Voyage: 'Atlantic' }))] }, + semantic_types: { Stop: 'Rank', Place: 'Name', Voyage: 'Category', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', detail: 'Voyage', color: 'Stop' }, chartProperties: {} }, + }, + }, + { + id: 'point-labels', group: 'Labels and shapes', title: 'Points named beside them (text: City, size: Population)', + check: [ + 'Each city named beside its dot, right first, else left, above or below; no label over a dot or another label', + 'The largest cities named first: a crowded small one is left unnamed (an info warning says how many)', + 'Pan and zoom: every label stays beside its dot', + ], + input: { + data: { values: CITIES }, + semantic_types: { City: 'Name', Population: 'Quantity', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', text: 'City', size: 'Population' }, chartProperties: {} }, + }, + }, + { + id: 'point-shapes', group: 'Labels and shapes', title: 'Points told apart by shape (shape: Kind, color: Kind)', + check: ['Capitals and other cities as two symbols, filled, with one key for shape and colour'], + input: { + data: { values: CITIES }, + semantic_types: { City: 'Name', Kind: 'Category', Population: 'Quantity', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', shape: 'Kind', color: 'Kind', text: 'City' }, chartProperties: {} }, + }, + }, + { + id: 'route-labels', group: 'Labels and shapes', title: 'A route’s stops named (text: Place)', + check: ['Each stop named beside it, clear of the others; labels follow a pan or zoom', 'A label anchors a dot at every stop'], + input: { + data: { values: ODYSSEY }, + semantic_types: { Stop: 'Rank', Place: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { chartType: 'Map', encodings: { longitude: 'longitude', latitude: 'latitude', order: 'Stop', text: 'Place' }, chartProperties: {} }, + }, + }, + { + id: 'choropleth-labels', group: 'Labels and shapes', title: 'Regions named at their middles (text: State)', + check: [ + 'Each state that holds its label named at its middle; RI, DE, CT and the like unnamed', + 'Zoom into New England: their labels appear as the states grow', + ], + input: { + data: { values: STATE_POPULATION }, + semantic_types: { State: 'State', Population: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'State', color: 'Population', text: 'State' }, chartProperties: {} }, + }, + }, + { + id: 'world-labels', group: 'Labels and shapes', title: 'Countries named where they hold it (text: Country)', + check: ['Large countries named; small ones (Benelux, the Balkans) named only once zoomed in'], + input: { + data: { values: LIFE }, + semantic_types: { iso: 'Country', Country: 'Name', Life: 'Quantity' }, + chart_spec: { chartType: 'Choropleth', encodings: { id: 'iso', color: 'Life', text: 'Country' }, chartProperties: {} }, + }, + }, +]; + +// ---------------------------------------------------------------- inspection +interface Facts { + plot: string; + aspect: string; + projection: string; + frame: string; + clip: string; + antarctica: string; + layers: string; + source: string; + attribution: string; + colour: string; + ground: { label: string; color: string }[]; + warnings: { code: string; message: string }[]; +} + +const round = (value: number) => Math.round(value * 10) / 10; + +/** The data colour scale: classed (its breaks) or continuous. */ +function colourOf(units: any[]): string { + const enc = units.map((unit) => unit.encoding?.color).find((color) => color?.field && color.type === 'quantitative'); + if (!enc) return units.some((unit) => unit.encoding?.color?.field) ? 'categorical' : '—'; + const scale = enc.scale ?? {}; + const short = (value: number) => Intl.NumberFormat('en', { notation: 'compact', maximumSignificantDigits: 3 }).format(value); + if (scale.type === 'threshold') return `${(scale.domain ?? []).length + 1} classes at ${(scale.domain ?? []).map(short).join(' · ')}`; + if (scale.type) return `${scale.type}`; + return `continuous${Array.isArray(scale.domain) ? ` over ${scale.domain.map(short).join('…')}` : ''}`; +} + +/** The colours the ground was painted in. */ +function groundOf(spec: any, units: any[]): { label: string; color: string }[] { + const out: { label: string; color: string }[] = []; + const add = (label: string, color: unknown) => { if (typeof color === 'string' && !out.some((entry) => entry.label === label)) out.push({ label, color }); }; + add('page', spec.background ?? spec.config?.background ?? '#ffffff'); + add('frame', spec.config?.view?.fill); + for (const unit of units) { + if (unit.data?.sphere) { add('sea', unit.mark?.fill); add('rim', unit.mark?.stroke); } + if (unit.data?.graticule) add('graticule', unit.mark?.stroke); + const color = unit.encoding?.color; + const condition = Array.isArray(color?.condition) ? color.condition[0] : color?.condition; + if (condition?.test?.includes('isValid')) add('no data', condition.value); + if (unit.mark?.type === 'geoshape' && !unit.data?.sphere && !unit.data?.graticule) { + if (unit.mark.fill && !color?.field) add(unit.encoding?.color?.value ? 'no data' : 'land', unit.encoding?.color?.value ?? unit.mark.fill); + add('border', unit.mark.stroke); + } + } + return out; +} + +function inspect(spec: any): Facts { + const projection = spec.projection ?? {}; + const fit = projection.fit; + let frame = 'Vega-Lite fits the base map'; + if (fit?.type === 'Sphere') frame = 'the whole sphere'; + else if (fit?.geometry?.coordinates) { + const coordinates: [number, number][] = fit.geometry.coordinates; + const lons = coordinates.map(([lon]) => lon); + const lats = coordinates.map(([, lat]) => lat); + frame = `${round(Math.min(...lons))}°…${round(Math.max(...lons))}° lon, ${round(Math.min(...lats))}°…${round(Math.max(...lats))}° lat`; + } + if (spec._mapFrame?.level) frame = `${spec._mapFrame.level}: ${frame}`; + const units: any[] = spec.layer ?? [spec]; + const markType = (mark: any) => (typeof mark === 'string' ? mark : mark?.type); + const transforms = units.flatMap((unit) => unit.transform ?? []).concat(spec.layer ? spec.transform ?? [] : []); + const dataOf = (unit: any) => unit.data ?? spec.data; + const sources = units.map(dataOf).filter((data) => data && (data.url || data.values)); + return { + plot: `${spec.width} × ${spec.height}`, + aspect: `${(spec.width / spec.height).toFixed(2)} : 1`, + projection: `${projection.type ?? '—'}${projection.rotate ? `, rotate [${projection.rotate.join(', ')}]` : ''}`, + frame, + clip: units.some((unit) => unit.mark?.clip && !unit.data?.values?.[0]?.flintRoute) ? 'clipped to the plot' : 'not clipped', + antarctica: projection.type === 'identity' || projection.type === 'albersUsa' ? 'n/a (US map)' + : transforms.some((step: any) => typeof step.filter === 'string' && /!== (10|"ATA"|"AQ")$/.test(step.filter)) ? 'filtered out' : 'kept', + layers: units.map((unit) => { + const kind = markType(unit.mark); + if (unit.data?.sphere) return 'sea'; + if (unit.data?.values?.[0]?.flintRoute) return kind === 'point' ? 'route heads' : 'route'; + const noData = unit.mark?.invalid === null ? ' (no-data kept)' : ''; + const hidden = unit.encoding?.opacity?.condition ? ' (far side hidden)' : ''; + return `${kind}${noData}${hidden}`; + }).join(' → '), + source: sources.some((data) => typeof data.url === 'string') ? `fetched: ${[...new Set(sources.filter((data) => data.url).map((data) => data.url.split('/').pop()))].join(', ')}` : 'inline (nothing fetched)', + attribution: spec._attribution ?? '—', + colour: colourOf(units), + ground: groundOf(spec, units), + warnings: spec._warnings ?? [], + }; +} + +// ---------------------------------------------------------------- page +/** The canvas every map is laid out in; a map fills it. */ +const CANVAS = { width: 640, height: 440 }; + +interface Settings { + theme: string; navigate: boolean; boundaries: string; + mapStyle: string; classes: string; classCount: number; graticule: boolean; borderWidth: string; +} + +function withSettings(item: MapCase, settings: Settings): ChartAssemblyInput { + const { input } = item; + const styled = { + // A card that gives boundaries of its own keeps them. + ...(settings.boundaries !== 'world-bank' && input.chart_spec.chartProperties?.boundaries === undefined ? { boundaries: settings.boundaries } : {}), + ...(settings.mapStyle !== 'auto' ? { mapStyle: settings.mapStyle } : {}), + ...(settings.classes !== 'auto' ? { classes: settings.classes } : {}), + ...(settings.classCount !== 5 ? { classCount: settings.classCount } : {}), + ...(settings.graticule ? { graticule: true } : {}), + ...(settings.borderWidth !== '' ? { borderWidth: Number(settings.borderWidth) } : {}), + }; + return { + ...input, + chart_spec: { + ...input.chart_spec, + chartProperties: { ...(input.chart_spec.chartProperties ?? {}), ...styled }, + canvasSize: CANVAS, + }, + ...(settings.theme ? { theme_spec: settings.theme } : {}), + ...(settings.navigate ? { interaction_spec: { interactions: [{ type: 'navigate' }] } } : {}), + } as ChartAssemblyInput; +} + +function useDrawnSize(host: React.RefObject, key: unknown) { + const [drawn, setDrawn] = useState<{ width: number; height: number } | null>(null); + useEffect(() => { + setDrawn(null); + const timer = setInterval(() => { + const svg = host.current?.querySelector('svg'); + if (!svg) return; + const rect = svg.getBoundingClientRect(); + const next = { width: Math.round(rect.width), height: Math.round(rect.height) }; + setDrawn((now) => (now && now.width === next.width && now.height === next.height ? now : next)); + }, 300); + return () => clearInterval(timer); + }, [host, key]); + return drawn; +} + +const label: CSSProperties = { color: siteTheme.textMuted, paddingRight: 8, whiteSpace: 'nowrap', verticalAlign: 'top' }; + +/** A card whose boundaries load first: drawn once they have, with them in its chart properties. */ +function LoadedCaseCard({ item, settings }: { item: MapCase; settings: Settings }) { + const [loaded, setLoaded] = useState(item.boundaries ? null : item); + useEffect(() => { + if (!item.boundaries) return; + let live = true; + void item.boundaries().then((boundaries) => { + if (!live) return; + const { chart_spec } = item.input; + setLoaded({ ...item, input: { ...item.input, chart_spec: { ...chart_spec, chartProperties: { ...(chart_spec.chartProperties ?? {}), boundaries } } } }); + }); + return () => { live = false; }; + }, [item]); + if (!loaded) return
{item.title}: loading its boundaries…
; + return ; +} + +function CaseCard({ item, settings }: { item: MapCase; settings: Settings }) { + const input = useMemo(() => withSettings(item, settings), [item, settings]); + const facts = useMemo(() => { + try { + return inspect(assembleVegaLite(input)); + } catch (error) { + return { error: String((error as Error).message ?? error) }; + } + }, [input]); + const host = useRef(null); + const drawn = useDrawnSize(host, input); + const [showSpec, setShowSpec] = useState(false); + return ( +
+
+ +
+
+

{item.title}

+
What to check
+
    + {item.check.map((line) =>
  • {line}
  • )} +
+ {'error' in facts ? ( +
{facts.error}
+ ) : ( + <> + + + + + + + + + + + + +
Plot{facts.plot} · {facts.aspect}
Drawn{drawn ? `${drawn.width} × ${drawn.height}` : '…'} in a {CANVAS.width} × {CANVAS.height} canvas
Projection{facts.projection}
Frame{facts.frame}
Base map{facts.clip} · Antarctica {facts.antarctica}
Layers{facts.layers}
Boundaries{facts.source} · credit: {facts.attribution}
Colour{facts.colour}
Ground{facts.ground.map((entry) => ( + + {entry.label} {entry.color} + + ))}
+ {facts.warnings.length > 0 ? ( +
    + {facts.warnings.map((warning) =>
  • {warning.code} {warning.message}
  • )} +
+ ) :
No warnings
} + + )} + + {showSpec ? ( +
+            {JSON.stringify(input, null, 2)}
+          
+ ) : null} +
+
+ ); +} + +const THEMES = ['', ...Object.keys(THEME_PRESETS)]; + +/** One choice from a few, as a row of buttons: every option visible, one click to change. */ +function Segmented({ label, value, options, onChange, title }: { + label: string; value: T; options: readonly { value: T; label: string }[]; onChange: (value: T) => void; title?: string; +}) { + return ( +
+ {label} +
+ {options.map((option, index) => { + const active = option.value === value; + return ( + + ); + })} +
+
+ ); +} + +/** An on/off setting as a button that shows its state. */ +function Toggle({ label, checked, onChange, title }: { label: string; checked: boolean; onChange: (checked: boolean) => void; title?: string }) { + return ( + + ); +} + +const choices = (values: readonly T[], labels: Partial> = {}) => + values.map((value) => ({ value, label: labels[value] ?? value })); + +const DEFAULT_SETTINGS: Settings = { + theme: '', navigate: true, boundaries: 'world-bank', + mapStyle: 'auto', classes: 'auto', classCount: 5, graticule: false, borderWidth: '', +}; + +export function MapsLab() { + const [settings, setSettings] = useState(DEFAULT_SETTINGS); + const set = (key: K, value: Settings[K]) => setSettings((now) => ({ ...now, [key]: value })); + const groups = [...new Set(CASES.map((item) => item.group))]; + const changed = (Object.keys(DEFAULT_SETTINGS) as (keyof Settings)[]).some((key) => settings[key] !== DEFAULT_SETTINGS[key]); + return ( +
+
+

Maps

+

+ The map plan, case by case: a map frames its data and fills the canvas at that frame’s shape, its title + and key given their room first; a region is drawn in a projection centred on it, framed by a neatline; a + point map turns into a globe; every region stays on the map; the join combines and reports. The world is + the World Bank’s official boundaries unless a chart asks for Natural Earth’s, loaded from the package on + first draw; a chart can also give a boundary file of its own. Every map has a {CANVAS.width} × {CANVAS.height} canvas. +

+
+
+ + set('mapStyle', value)} + options={choices(['auto', 'light', 'muted', 'atlas', 'dark', 'minimal'] as const, { auto: 'from theme' })} title="chartProperties.mapStyle" /> + set('boundaries', value)} + options={choices(['world-bank', 'natural-earth'] as const, { 'world-bank': 'World Bank', 'natural-earth': 'Natural Earth' })} + title="chartProperties.boundaries (cards with a file of their own keep it)" /> + + set('classes', value)} + options={choices(['auto', 'quantile', 'equal', 'jenks', 'continuous'] as const)} title="chartProperties.classes" /> + + set('borderWidth', value)} + options={choices(['', '0', '0.25', '0.5', '1'] as const, { '': 'auto', '0': 'none' })} title="chartProperties.borderWidth" /> + set('graticule', value)} title="chartProperties.graticule" /> + set('navigate', value)} title="interaction_spec: navigate (drag, wheel)" /> + {changed ? ( + + ) : null} +
+ {groups.map((group) => ( +
+

{group}

+ {CASES.filter((item) => item.group === group).map((item) => )} +
+ ))} +
+ ); +} diff --git a/site/src/playground/MutedAnnotations.tsx b/site/src/playground/MutedAnnotations.tsx new file mode 100644 index 00000000..cb2f7875 --- /dev/null +++ b/site/src/playground/MutedAnnotations.tsx @@ -0,0 +1,119 @@ +import { FlintChart } from 'flint-chart/react'; +import type { ChartAssemblyInput } from 'flint-chart'; +import DATA from './muted-annotations/cases.json'; +import './muted-annotations/muted-annotations.css'; + +// Muted annotations: what an agent may put on a chart, unasked, to point at the answer to a +// concrete question. Built by experiments/interaction/code/build-muted-cases.py from charts agents +// made in the interaction runs. + +interface Case { + id: string; + group: string; + question: string; + technique: string; + verdict: 'muted' | 'opt-in' | 'avoid'; + why: string; + spec: { data: Record } & Record; + table: string; + updates: { id: string; ops: { op: string }[] }[]; +} + +const GROUPS: { id: string; title: string; text: string }[] = [ + { + id: 'one', + title: 'One mark: a point on a line, a bar, a scatter point', + text: 'The answer is one mark. A light highlight finds it and a label of a few words says what it is: the value, and the name or date where the axis does not already give it.', + }, + { + id: 'two', + title: 'Two marks: a difference, a crossing, A against B', + text: 'The title states the difference or the crossing. Each of the two marks gets its own short label so the reader can tell which is which.', + }, + { + id: 'threshold', + title: 'A value the question names', + text: 'A plain rule at the value the question names, and at most one point that answers it. The rule needs no caption when the title names the value.', + }, + { + id: 'span', + title: 'Spans and sets: the answer is a stretch or a group', + text: 'A period or a band of values gets one light shade under the marks; a caption only when the title does not give the range and there is open plot for it. A small set gets light emphasis or an outline per member, with labels only when there are a few and room round them. A clear cluster can take one light enclosure.', + }, + { + id: 'room', + title: 'Room decides: a label where there is open space, an outline where there is none', + text: 'What limits a label is the space around the answer, not the chart type. A pie slice or a map region with open canvas beside it takes a short label; a cell in a full grid, or a bar that already prints its value, takes an outline (a note with text "") and no label or leader.', + }, + { + id: 'style', + title: 'Text and highlight style', + text: 'A note takes the theme\'s annotation type; without one, the axis labels\' face and weight a size up, in the primary ink. Rings, outlines and enclosures take the theme\'s interaction.highlight; without one, the neutral annotation grey. One update can set its own: value.style for text, value.highlightStyle for the ring or outline, color and width on an enclosure.', + }, + { + id: 'outside', + title: 'Outside the muted tier', + text: 'Notes that tell a story are for a user who asks for an explaining chart. A bare tag says nothing; a sentence repeats the title and crowds the plot.', + }, +]; + +const VERDICT_LABEL: Record = { muted: 'Muted: allowed unasked', 'opt-in': 'Full: only when asked', avoid: 'Avoid' }; + +function CaseCard({ item }: { item: Case }) { + const tables = (DATA as { tables: Record }).tables; + const spec = { ...item.spec, data: { ...item.spec.data, values: tables[item.table] } } as unknown as ChartAssemblyInput; + const ops = item.updates.flatMap((u) => u.ops); + return ( +
+
+ {VERDICT_LABEL[item.verdict]} + {item.technique} +
+

“{item.question}”

+
+ +
+

{item.why}

+
+ {ops.map((o) => o.op).join(' + ')} +
{JSON.stringify(ops, null, 1)}
+
+
+ ); +} + +export function MutedAnnotations() { + const cases = (DATA as unknown as { cases: Case[] }).cases; + return ( +
+
+

Muted annotations

+

+ A chart opens clean. When the user asks a concrete question (a peak, a value at a date, a difference, a + crossing, a threshold), the agent may point at the answer without being asked, in a muted way. The message + goes in the title; the annotation only points. +

+

One rule for every form: annotate only what directly answers the question, and let the density around it decide how: a label where there is open space, a shorter label or none where it is tighter, an outline or a light shade where marks fill the space.

+
    +
  1. The question is concrete. It asks about particular values. An overview question (“how did prices move”) gets none.
  2. +
  3. It points only at the answer, and only when it directly answers the question: one mark, two for a difference or a crossing, one span, or one small set.
  4. +
  5. The title says it, the mark points at it. A label of a few words that still means something: the value and what identifies it (“$5.01 · Jun 13, 2022”), not a bare tag (“Peak”) and not a sentence.
  6. +
  7. There is room for it. A short label goes where there is open space beside the answer, on any chart. Where marks fill the space round it (a full grid, a dense cluster, a bar that already prints its value), the answer gets an outline and no text: annotate-text with text: "".
  8. +
+
+ {GROUPS.map((group) => { + const items = cases.filter((c) => c.group === group.id); + if (!items.length) return null; + return ( +
+

{group.title}

+

{group.text}

+
+ {items.map((item) => )} +
+
+ ); + })} +
+ ); +} diff --git a/site/src/playground/OdysseyStoryStage.tsx b/site/src/playground/OdysseyStoryStage.tsx new file mode 100644 index 00000000..5d6e8b9c --- /dev/null +++ b/site/src/playground/OdysseyStoryStage.tsx @@ -0,0 +1,394 @@ +import { useEffect, useMemo, useState } from 'react'; +import { assembleVegaLite, resolveThemeSpec, type ChartAssemblyInput, type ChartUpdateOp } from 'flint-chart'; +import type { ChartUpdate, InteractiveChartSurface } from 'flint-chart/interactive'; +import { FlintChart } from 'flint-chart/react'; +import { expressionInterpreter } from 'vega-interpreter'; +import { ScaleToFit } from '../components/ScaleToFit'; +import { StoryBoard, type BoardChapter } from './stories/StoryBoard'; +import { GREEK_WORLD } from './stories/boundaries'; + +/** + * A story told on a map, chapter by chapter: the wanderings of Odysseus, from Troy home to Ithaca. + * + * The chart is an ordinary point Map: `order` joins the stops into one route, `color` paints each leg + * of the voyage, `detail` keeps them one route, and `size` is each leg's width — the crew that sailed it. + * Every chapter is one chart update with one id, so the next replaces it whole: + * + * - `set-viewport` eases the map to the chapter's stops; + * - `set-style` recedes the rest of the route; + * - `annotate-text` notes the chapter's episodes; + * - a chapter may add an overlay of its own: the first draws the direct way home (`set-overlay`). + * + * The sea names are one more `set-overlay`, under their own id, so they stay from chapter to chapter. + * Notes keep clear of them, of the route and its heads, and stay inside the map. + * + * Places follow the traditional identifications; Homer's geography is a poet's. Crews follow a + * traditional reckoning: twelve ships of about fifty men leave Troy. + */ + +interface Stop { stop: number; leg: string; crew: number; episode: string; longitude: number; latitude: number } + +const STOPS: readonly Stop[] = [ + { stop: 1, leg: 'Leaving Troy', crew: 600, episode: 'Troy', longitude: 26.24, latitude: 39.96 }, + { stop: 2, leg: 'Leaving Troy', crew: 528, episode: 'Ismarus', longitude: 25.52, latitude: 40.89 }, + { stop: 3, leg: 'Leaving Troy', crew: 528, episode: 'The Lotus-Eaters', longitude: 10.86, latitude: 33.81 }, + { stop: 4, leg: 'Monsters and winds', crew: 522, episode: 'The Cyclops', longitude: 15.16, latitude: 37.56 }, + { stop: 5, leg: 'Monsters and winds', crew: 522, episode: 'Aeolia', longitude: 14.95, latitude: 38.47 }, + { stop: 6, leg: 'Monsters and winds', crew: 46, episode: 'The Laestrygonians', longitude: 9.16, latitude: 41.39 }, + { stop: 7, leg: 'Circe and the dead', crew: 45, episode: 'Aeaea', longitude: 13.05, latitude: 41.23 }, + { stop: 8, leg: 'Circe and the dead', crew: 45, episode: 'The Underworld', longitude: 14.07, latitude: 40.84 }, + { stop: 9, leg: 'Sirens to shipwreck', crew: 45, episode: 'The Sirens', longitude: 14.43, latitude: 40.58 }, + { stop: 10, leg: 'Sirens to shipwreck', crew: 39, episode: 'Scylla and Charybdis', longitude: 15.63, latitude: 38.25 }, + { stop: 11, leg: 'Sirens to shipwreck', crew: 1, episode: 'Thrinacia', longitude: 15.0, latitude: 37.08 }, + { stop: 12, leg: 'Homeward', crew: 1, episode: 'Ogygia', longitude: 14.25, latitude: 36.05 }, + { stop: 13, leg: 'Homeward', crew: 1, episode: 'Scheria', longitude: 19.92, latitude: 39.62 }, + { stop: 14, leg: 'Homeward', crew: 1, episode: 'Ithaca', longitude: 20.71, latitude: 38.37 }, +]; + +const ROWS = STOPS.map(({ stop, leg, crew, episode, longitude, latitude }) => + ({ Stop: stop, Leg: leg, Crew: crew, Episode: episode, Voyage: 'Odysseus', longitude, latitude })); + +/** What the Odyssey page lets a reader try: the map's ground, the legs' colours, the house, and how the route is drawn. */ +export interface OdysseyLook { + /** A named map style, or a style of its own. */ + mapStyle: string | Record; + /** The legs' colours, in voyage order; unset takes the house's palette. */ + legInks?: readonly string[]; + /** A house Flint ships; unset draws without one. */ + theme?: string; + curve: 'auto' | 'arc' | 'great-circle' | 'straight'; + arrows: boolean; + graticule: boolean; + borderWidth?: number; + /** The sea names' ink and the halo they stand in, to read on the ground's water. */ + seaLabel: { fill: string; halo: string }; +} + +// An atlas ground and a Swiss house, so the voyage carries the colour: it sets out from Troy in +// crimson and comes home in navy. +export const DEFAULT_LOOK: OdysseyLook = { + mapStyle: 'atlas', + legInks: ['#b2182b', '#e0622b', '#d9a320', '#2a9d8f', '#1d3557'], + theme: 'swiss', + curve: 'auto', + arrows: true, + graticule: false, + borderWidth: 0.5, + // The atlas's water, so a route crossing a sea's name does not cut it. + seaLabel: { fill: '#5f7d92', halo: '#dbe9f2' }, +}; + +/** + * The story drawn in a house (null: Flint's own): the house's ground and palette, the sea names in a + * halo of its page, which is the water a route map leaves to the theme. + */ +export function odysseyLookInHouse(theme: string | null): OdysseyLook { + const { theme: _swiss, ...rest } = DEFAULT_LOOK; + const ink = theme ? resolveThemeSpec(theme)?.ink : undefined; + const canvas = ink?.surface?.canvas; + const page = typeof canvas === 'string' && /^#[0-9a-f]{6}$/i.test(canvas) ? canvas : '#ffffff'; + const n = parseInt(page.slice(1), 16); + const dark = 0.2126 * ((n >> 16) & 255) + 0.7152 * ((n >> 8) & 255) + 0.0722 * (n & 255) < 110; + const palette = ink?.series?.categorical; + return { + ...rest, + ...(theme ? { theme } : {}), + ...(palette?.length ? { legInks: palette.slice(0, 5) } : {}), + mapStyle: 'auto', + seaLabel: { fill: dark ? '#b9c8d4' : '#6f7f8c', halo: page }, + }; +} + +/** The chart the story is told on: the stops as one route, before any chapter's notes. */ +/** `size` lays the map out wider or taller than its usual square-ish room (a slide's wide band, say). */ +export function odysseySpec(look: OdysseyLook = DEFAULT_LOOK, size?: { width: number; height: number }): ChartAssemblyInput { + return { + data: { values: ROWS }, + semantic_types: { Stop: 'Rank', Leg: 'Category', Crew: 'Count', Voyage: 'Category', Episode: 'Name', longitude: 'Longitude', latitude: 'Latitude' }, + chart_spec: { + chartType: 'Map', + title: 'The wanderings of Odysseus', + // The keys stand under the map, as a caption does, so the map starts right under its title. + encodings: { + longitude: 'longitude', latitude: 'latitude', order: 'Stop', detail: 'Voyage', + color: { field: 'Leg', ...(look.legInks ? { scheme: [...look.legInks] } : {}), legend: { orient: 'bottom' } }, + strokeWidth: { field: 'Crew', legend: { orient: 'bottom' } }, + }, + chartProperties: { + mapStyle: look.mapStyle, + // Natural Earth's finest coasts, cut to the Mediterranean: the world map's are too coarse for a chapter's close frame. + boundaries: GREEK_WORLD, + ...(look.curve !== 'auto' ? { curve: look.curve } : {}), + ...(look.arrows ? {} : { arrows: false }), + ...(look.graticule ? { graticule: true } : {}), + ...(look.borderWidth !== undefined ? { borderWidth: look.borderWidth } : {}), + }, + // Wider than tall, as the Mediterranean the voyage crosses is. + canvasSize: size ?? { width: 600, height: 600 }, + ...(size ? { baseSize: size } : {}), + }, + ...(look.theme ? { theme_spec: look.theme } : {}), + interaction_spec: { interactions: [{ type: 'navigate' }] }, + options: { addTooltips: true }, + } as ChartAssemblyInput; +} + +const ODYSSEY = odysseySpec(); + +type ChartOverlaySpec = NonNullable['value']>; + +// ── Geography ──────────────────────────────────────────────────────────── + +const stopAt = (stop: number) => STOPS.find((row) => row.stop === stop)!; + +/** Great-circle distance in km. */ +function kilometres(a: Stop, b: Stop): number { + const rad = Math.PI / 180; + const h = Math.sin(((b.latitude - a.latitude) * rad) / 2) ** 2 + + Math.cos(a.latitude * rad) * Math.cos(b.latitude * rad) * Math.sin(((b.longitude - a.longitude) * rad) / 2) ** 2; + return 2 * 6371 * Math.asin(Math.sqrt(h)); +} + +const roundTo = (value: number, step: number) => Math.round(value / step) * step; +const SAILED_KM = roundTo(STOPS.slice(1).reduce((total, row, index) => total + kilometres(STOPS[index], row), 0), 100); +const DIRECT_KM = roundTo(kilometres(stopAt(1), stopAt(14)), 10); + +/** The stops' box as a viewport (longitude on x, latitude on y), padded by a share of its span so notes fit. */ +function frameOf(stops: readonly number[], share = 0.22, min = 1.6): { x: [number, number]; y: [number, number] } { + const rows = stops.map(stopAt); + const pad = (values: number[]): [number, number] => { + const low = Math.min(...values); + const high = Math.max(...values); + const margin = Math.max(min, (high - low) * share); + return [low - margin, high + margin]; + }; + return { x: pad(rows.map((row) => row.longitude)), y: pad(rows.map((row) => row.latitude)) }; +} + +const textOverlay = (role: string, values: readonly Record[], style: ChartOverlaySpec['style']): ChartOverlaySpec => ({ + mark: 'text', role, data: { values }, + encodings: { longitude: { field: 'longitude' }, latitude: { field: 'latitude' }, text: { field: 'text' } }, + style, +}); + +const ROUTE_INK = '#5c6b77'; + +// ── Chapters ───────────────────────────────────────────────────────────── + +/** A note on one stop, or on the leg that sets out from it. */ +interface Note { stop: number; text: string; on?: 'leg' } + +interface Chapter { + title: string; + /** The leg of the voyage the chapter follows; the rest of the route recedes. */ + leg?: string; + /** The stops to frame; every stop when left out. */ + frame?: readonly number[]; + text: string; + notes: readonly Note[]; + /** Overlays of the chapter's own, gone with it. */ + extra?: readonly ChartUpdateOp[]; +} + +// The sea most of the wandering happens round: its box, for counting the episodes in it. +const TYRRHENIAN = { longitude: [8.6, 16.4] as [number, number], latitude: [37.9, 41.9] as [number, number] }; +const TYRRHENIAN_STOPS = STOPS.filter((row) => row.longitude >= TYRRHENIAN.longitude[0] && row.longitude <= TYRRHENIAN.longitude[1] + && row.latitude >= TYRRHENIAN.latitude[0] && row.latitude <= TYRRHENIAN.latitude[1]).length; + +const CHAPTERS: readonly Chapter[] = [ + { + title: 'Twenty years from home', + text: `Troy has fallen after ten years of war, and Odysseus sets out for Ithaca with twelve ships, about six hundred men. ` + + `Ithaca is ${DIRECT_KM} km away as the crow flies. He will sail about ${SAILED_KM.toLocaleString('en')} km, take ten more years, and come home alone.`, + notes: [{ stop: 1, text: 'Troy: the war is over' }, { stop: 14, text: 'Ithaca, ten years later' }], + extra: [ + { + op: 'set-overlay', name: 'direct-line', value: { + mark: 'line', role: 'direct-route', + data: { values: [stopAt(1), stopAt(14)].map(({ longitude, latitude }, index) => ({ order: index + 1, longitude, latitude })) }, + encodings: { longitude: { field: 'longitude' }, latitude: { field: 'latitude' }, order: { field: 'order' } }, + // Lighter and beneath the route: a reference, read in the background of the route taken. + style: { stroke: ROUTE_INK, strokeWidth: 1.5, strokeDash: 'dash', opacity: 0.55 }, + layer: 'under', + }, + }, + ], + }, + { + title: 'Leaving Troy', + leg: 'Leaving Troy', + frame: [1, 2, 3], + text: 'The fleet sacks Ismarus, city of the Cicones, but lingers; the Cicones return in force and kill six men from every ship. ' + + 'A north wind drives them nine days off course to the Lotus-Eaters, whose honeyed fruit makes men forget home.', + notes: [ + { stop: 2, text: 'Ismarus sacked; 72 men killed' }, + { stop: 2, on: 'leg', text: 'Nine days blown off course' }, + { stop: 3, text: 'The lotus: men forget home' }, + ], + }, + { + title: 'Monsters and winds', + leg: 'Monsters and winds', + frame: [3, 4, 5, 6], + text: 'In the Cyclops’ cave Polyphemus eats six men before Odysseus, “Nobody”, blinds him. Aeolus gives him the winds tied in a bag; ' + + 'within sight of Ithaca the crew opens it, and the gale blows them back. Then the giant Laestrygonians sink eleven of the twelve ships.', + notes: [ + { stop: 4, text: 'Polyphemus eats six men' }, + { stop: 5, text: 'A bag of winds, opened too soon' }, + { stop: 6, text: 'Eleven ships sunk; one escapes' }, + ], + }, + { + title: 'Circe and the dead', + leg: 'Circe and the dead', + frame: [6, 7, 8], + text: 'One ship and forty-six men reach Aeaea, where Circe turns the scouts into swine. Odysseus stays a year, then sails to the edge ' + + `of the world to ask the ghost of Tiresias the way home. ${TYRRHENIAN_STOPS} of the ${STOPS.length} episodes lie around this one sea.`, + notes: [ + { stop: 7, text: 'A year with Circe' }, + { stop: 8, text: 'The ghost of Tiresias' }, + ], + }, + { + title: 'Sirens to shipwreck', + leg: 'Sirens to shipwreck', + frame: [8, 9, 10, 11], + text: 'Bound to the mast, Odysseus hears the Sirens while his crew row on with wax in their ears. Scylla snatches six men from the deck. ' + + 'On Thrinacia, starving, the crew kill the cattle of the Sun; Zeus wrecks the ship, and only Odysseus survives.', + notes: [ + { stop: 9, text: 'Bound to the mast' }, + { stop: 10, text: 'Scylla takes six men' }, + { stop: 11, text: 'The Sun’s cattle: all but one drown' }, + ], + }, + { + title: 'Homeward', + leg: 'Homeward', + frame: [11, 12, 13, 14], + text: 'Clinging to wreckage, Odysseus washes up on Ogygia, where Calypso keeps him seven years. Shipwrecked once more on Scheria, ' + + 'he tells the Phaeacians his story, and they carry him home asleep. He wakes on Ithaca, twenty years after he left.', + notes: [ + { stop: 12, text: 'Seven years with Calypso' }, + { stop: 13, text: 'The Phaeacians carry him home' }, + { stop: 14, text: 'Home, after twenty years' }, + ], + }, + { + title: 'The whole voyage', + text: `Ithaca was ${DIRECT_KM} km from Troy. Odysseus sailed about ${SAILED_KM.toLocaleString('en')} km to get there, most of it lost in one sea, ` + + 'and took ten years. Twelve ships and some six hundred men set out; one man came home, in a stranger’s ship, to a house full of suitors.', + notes: [ + { stop: 1, text: 'Twelve ships, 600 men' }, + { stop: 6, text: 'Eleven ships lost' }, + { stop: 14, text: 'One man home' }, + ], + }, +]; + +// A note names one mark by the fields the chart keys its marks on. +const KEY_FIELDS: readonly string[] = (assembleVegaLite(ODYSSEY) as { _interactionSemantics?: { fields?: string[] } }) + ._interactionSemantics?.fields ?? ['longitude', 'latitude', 'Stop']; +const keyOf = (stop: number): Record => { + const row = ROWS.find((candidate) => candidate.Stop === stop) as Record; + return Object.fromEntries(KEY_FIELDS.map((field) => [field, row[field]])); +}; + +const noteOp = (note: Note): ChartUpdateOp => ({ + op: 'annotate-text', + target: { select: { key: keyOf(note.stop), visual: note.on === 'leg' ? { kind: 'path', role: 'leg' } : { kind: 'mark', role: 'point' } } }, + value: { text: note.text }, +}); + +const CHAPTER_UPDATE = 'odyssey-chapter'; +// A note on a stop and one on the leg leaving it name the same row: a note is keyed by its row within an +// update, so leg notes go in an update of their own. +const LEG_NOTES_UPDATE = 'odyssey-chapter-legs'; +const SEAS_UPDATE = 'odyssey-seas'; + +function chapterUpdate(chapter: Chapter): ChartUpdate { + const ops: ChartUpdateOp[] = [{ op: 'set-viewport', axes: 'xy', value: frameOf(chapter.frame ?? STOPS.map((row) => row.stop)) }]; + if (chapter.leg) { + ops.push({ op: 'set-style', targets: [{ select: { where: { Leg: { in: [chapter.leg] } } } }], value: { state: 'emphasized', emphasis: 'strong' } }); + } + ops.push(...chapter.notes.filter((note) => note.on !== 'leg').map(noteOp)); + ops.push(...(chapter.extra ?? [])); + return { id: CHAPTER_UPDATE, ops }; +} + +const seasUpdate = (label: OdysseyLook['seaLabel']): ChartUpdate => ({ + id: SEAS_UPDATE, + ops: [{ + op: 'set-overlay', name: 'seas', + value: textOverlay('sea-name', [ + { text: 'Aegean Sea', longitude: 25.2, latitude: 38.6 }, + { text: 'Ionian Sea', longitude: 18.6, latitude: 37.4 }, + { text: 'Tyrrhenian Sea', longitude: 12.0, latitude: 39.6 }, + { text: 'Mediterranean Sea', longitude: 18.5, latitude: 34.2 }, + ], { fill: label.fill, fontSize: 11, fontStyle: 'italic', stroke: label.halo }), + }], +}); + +/** The updates that open the story: the sea names and the first chapter, for a copy of the spec to carry. */ +export function odysseyOpeningUpdates(look: OdysseyLook = DEFAULT_LOOK): ChartUpdate[] { + const first = CHAPTERS[0]; + const legNotes = first.notes.filter((note) => note.on === 'leg').map(noteOp); + return [seasUpdate(look.seaLabel), chapterUpdate(first), ...(legNotes.length ? [{ id: LEG_NOTES_UPDATE, ops: legNotes }] : [])]; +} + +// ── Stage ──────────────────────────────────────────────────────────────── + +/** The story beside its map; a `look` redraws the map in other colours and keeps the chapter. */ +export function OdysseyStoryStage({ look = DEFAULT_LOOK, compact = false, size }: { look?: OdysseyLook; compact?: boolean; size?: { width: number; height: number } } = {}) { + const spec = useMemo(() => odysseySpec(look, size), [look, size]); + const [index, setIndex] = useState(0); + const [surface, setSurface] = useState(null); + const chapter = CHAPTERS[index]; + // Each chapter in its leg's colour, as the map draws the leg. + const board = useMemo(() => { + const legs = [...new Set(STOPS.map((row) => row.leg))]; + return CHAPTERS.map((item) => { + const ink = item.leg && look.legInks ? look.legInks[legs.indexOf(item.leg) % look.legInks.length] : undefined; + return { title: item.title, text: item.text, ...(ink ? { ink } : {}) }; + }); + }, [look.legInks]); + + useEffect(() => { + if (!surface) return; + void surface.applyUpdate(seasUpdate(look.seaLabel)); + }, [surface, spec, look.seaLabel]); + + // Each chapter replaces the last (one update id), easing the map to its frame. + useEffect(() => { + if (!surface) return; + void (async () => { + await surface.applyUpdate(chapterUpdate(chapter), { transition: { duration: 700 } }); + const legNotes = chapter.notes.filter((note) => note.on === 'leg').map(noteOp); + await (legNotes.length ? surface.applyUpdate({ id: LEG_NOTES_UPDATE, ops: legNotes }) : surface.clearUpdate(LEG_NOTES_UPDATE)); + })(); + }, [surface, spec, chapter]); + + return ( + +
+ console.error('Odyssey stage failed to build', error)} + /> +
+ + )} + /> + ); +} diff --git a/site/src/playground/OverflowViewportLab.tsx b/site/src/playground/OverflowViewportLab.tsx index 83f8d19b..a525773a 100644 --- a/site/src/playground/OverflowViewportLab.tsx +++ b/site/src/playground/OverflowViewportLab.tsx @@ -3,6 +3,7 @@ import type { ChartAssemblyInput } from 'flint-chart'; import { FlintChart } from 'flint-chart/react'; import { expressionInterpreter } from 'vega-interpreter'; import { BACKENDS, getSupportedBackends, type PreviewBackend } from '../shared/supported-backends'; +import { anomalyInput } from './anomaly-data'; import './overflow-viewport-lab.css'; const categoryRows = Array.from({ length: 160 }, (_, index) => ({ @@ -53,6 +54,35 @@ const heatmapInput: ChartAssemblyInput = { data: { values: heatmapRows }, }; +function RegressionDemo() { + return ( +
+
+
+

{anomalyInput.chart_spec.title}

+

+ 144 numeric years in a 600 px card, mounted as the interaction eval mounts it + (width="100%" height={400} fit="relayout"). Check three things: the cells + draw (the rail windows numeric years against its text categories), every window labels every fifth + year as you scroll, and the rail sits under the Year axis, above the source line. +

+
+
+
+ +
+
+ ); +} + function InteractiveBackendSurface({ input, backend, renderer = 'canvas' }: { input: ChartAssemblyInput; backend: PreviewBackend; @@ -157,6 +187,12 @@ export function OverflowViewportLab() {

Category capacity becomes a navigable viewport only after the chart reaches its stretch ceiling and bands reach their normal minimum step. Static output still uses the first window; interactive hosts retain the complete ordered domain.

+
+ Regressions + Charts that once broke on a viewport, kept here as they broke. +
+ +
Retained MCP App path One Vega compile; slider movement updates the existing dataflow. diff --git a/site/src/playground/OverlayContainmentLab.tsx b/site/src/playground/OverlayContainmentLab.tsx new file mode 100644 index 00000000..43314f63 --- /dev/null +++ b/site/src/playground/OverlayContainmentLab.tsx @@ -0,0 +1,591 @@ +import { useCallback, useEffect, useRef, useState, type CSSProperties } from 'react'; +import type { ChartAssemblyInput } from 'flint-chart'; +import { mountChart, type ChartUpdate } from 'flint-chart/interactive'; +import { expressionInterpreter } from 'vega-interpreter'; +import { siteTheme } from '../shared/theme'; + +// ---------------------------------------------------------------- data + +function seeded(seed: number): () => number { + let state = seed; + return () => (state = (state * 1664525 + 1013904223) % 4294967296) / 4294967296; +} + +/** Lead samples in two collections, numbered by rank as in the Flint water chart. */ +const SAMPLES = (() => { + const rand = seeded(7); + return ([['Virginia Tech', 140], ['MDEQ', 60]] as const).flatMap(([collection, count]) => { + const leads = Array.from({ length: count }, () => Math.round(rand() ** 4 * 160 * 10) / 10).sort((a, b) => a - b); + return leads.map((lead, index) => ({ + collection, sample: index + 1, lead, range: lead > 15 ? 'Above 15 ppb' : '15 ppb or below', + })); + }); +})(); + +const MONTHS = Array.from({ length: 24 }, (_, index) => `${2024 + Math.floor(index / 12)}-${String(index % 12 + 1).padStart(2, '0')}`); + +/** Monthly output by source, in three regions. */ +const OUTPUT = ['North', 'South', 'East'].flatMap((region, r) => ['Solar', 'Wind', 'Hydro'].flatMap((source, s) => + MONTHS.map((month, m) => ({ + month, region, source, + output: Math.round(40 + 12 * s + 8 * r + 18 * Math.sin((m + 3 * s) / 3.5) + m * 0.8), + })))); + +function scatterInput(facet: boolean, chartType = 'Scatter Plot'): ChartAssemblyInput { + return { + data: { values: SAMPLES }, + semantic_types: { lead: 'Quantity', sample: 'Rank', range: 'Category', collection: 'Category' }, + field_display_names: { lead: 'Lead (ppb)', sample: 'Sample number' }, + chart_spec: { + chartType, + title: `${SAMPLES.filter((row) => row.lead > 15).length} of ${SAMPLES.length} water samples exceed 15 ppb`, + subtitle: 'Each dot is one sample, ranked by lead', + encodings: { + x: { field: 'lead' }, y: { field: 'sample' }, color: { field: 'range' }, + ...(facet ? { row: { field: 'collection' } } : {}), + }, + baseSize: { width: 340, height: facet ? 300 : 230 }, + }, + } as ChartAssemblyInput; +} + +function lineInput(facet: 'none' | 'column' | 'row'): ChartAssemblyInput { + const regions = facet === 'row' ? ['North', 'South'] : facet === 'column' ? ['North', 'South', 'East'] : ['North']; + return { + data: { values: OUTPUT.filter((row) => regions.includes(row.region)) }, + semantic_types: { month: 'YearMonth', output: 'Quantity', source: 'Category', region: 'Category' }, + field_display_names: { output: 'Output (GWh)' }, + chart_spec: { + chartType: 'Line Chart', + title: 'Monthly output by source', + subtitle: facet === 'none' ? 'North region, 2024 to 2025' : 'By region, 2024 to 2025', + encodings: { + x: { field: 'month' }, y: { field: 'output' }, color: { field: 'source' }, + ...(facet === 'column' ? { column: { field: 'region' } } : facet === 'row' ? { row: { field: 'region' } } : {}), + }, + baseSize: { width: facet === 'column' ? 480 : 360, height: facet === 'row' ? 300 : 220 }, + }, + } as ChartAssemblyInput; +} + +function barsInput(): ChartAssemblyInput { + const rand = seeded(11); + const rows = Array.from({ length: 30 }, (_, index) => ({ + station: `Station ${String.fromCharCode(65 + (index % 26))}${index >= 26 ? 2 : ''}`, + samples: Math.round(20 + rand() * 180), + })); + return { + data: { values: rows }, + semantic_types: { station: 'Name', samples: 'Count' }, + chart_spec: { + chartType: 'Bar Chart', + title: 'Samples taken at each station', + encodings: { x: { field: 'samples' }, y: { field: 'station', sortBy: 'x', sortOrder: 'descending' } }, + baseSize: { width: 340, height: 300 }, + }, + } as ChartAssemblyInput; +} + +function withInteractions(input: ChartAssemblyInput, interactions: unknown[]): ChartAssemblyInput { + return { ...input, interaction_spec: { interactions } } as unknown as ChartAssemblyInput; +} + +function region(name: string, value: Record): ChartUpdate { + return { id: name, ops: [{ op: 'annotate-region', name, value }] } as unknown as ChartUpdate; +} + +// ---------------------------------------------------------------- geometry + +type Rect = { left: number; top: number; right: number; bottom: number }; +type Point = { x: number; y: number }; +/** Where the chart drew its plots and itself, in client px. */ +type Geometry = { views: Rect[]; chart: Rect }; +type Locate = (geometry: Geometry) => Point; + +const inView = (index: number, fx: number, fy: number): Locate => ({ views }) => { + const view = views[Math.min(index, views.length - 1)]; + return { x: view.left + (view.right - view.left) * fx, y: view.top + (view.bottom - view.top) * fy }; +}; +/** A point `dx`, `dy` px past the drawn chart's right or bottom edge (negative: past its left or top). */ +const pastChart = (dx: number, dy: number): Locate => ({ chart }) => ({ + x: dx > 0 ? chart.right + dx : dx < 0 ? chart.left + dx : (chart.left + chart.right) / 2, + y: dy > 0 ? chart.bottom + dy : dy < 0 ? chart.top + dy : (chart.top + chart.bottom) / 2, +}); + +const TOLERANCE = 1.5; + +function intersect(a: Rect, b: Rect): Rect | undefined { + const rect = { left: Math.max(a.left, b.left), top: Math.max(a.top, b.top), right: Math.min(a.right, b.right), bottom: Math.min(a.bottom, b.bottom) }; + return rect.right - rect.left > 0.5 && rect.bottom - rect.top > 0.5 ? rect : undefined; +} + +function rectOf(element: Element): Rect { + const { left, top, right, bottom } = element.getBoundingClientRect(); + return { left, top, right, bottom }; +} + +/** What of an element is on screen: its box cut by every clipping ancestor inside the host. */ +function visibleRect(element: Element, host: HTMLElement): Rect | undefined { + let rect: Rect | undefined = rectOf(element); + for (let node = element.parentElement; rect && node && node !== host.parentElement; node = node.parentElement) { + const style = getComputedStyle(node); + if (/hidden|clip/.test(style.overflow) || /hidden|clip/.test(style.overflowX)) rect = intersect(rect, rectOf(node)); + } + return rect; +} + +function readGeometry(host: HTMLElement, surface: ReturnType): Geometry | undefined { + const renderer = host.querySelector('svg.marks'); + const views = surface.layout?.views?.filter((view) => view.role === 'plot'); + if (!renderer || !views?.length) return undefined; + const chart = rectOf(renderer); + const viewBox = renderer.viewBox.baseVal; + const sx = viewBox?.width ? (chart.right - chart.left) / viewBox.width : 1; + const sy = viewBox?.height ? (chart.bottom - chart.top) / viewBox.height : 1; + return { + chart, + views: views.map(({ box }) => ({ + left: chart.left + box.x * sx, top: chart.top + box.y * sy, + right: chart.left + (box.x + box.width) * sx, bottom: chart.top + (box.y + box.height) * sy, + })), + }; +} + +type Verdict = 'inside' | 'overflow' | 'spans' | 'outside'; +type Measured = { kind: string; rect: Rect; verdict: Verdict; detail: string }; + +/** Every overlay Flint draws above the renderer: washes, guides, labels, brushes, lassos. */ +function overlayElements(host: HTMLElement): { kind: string; element: Element }[] { + const renderer = host.querySelector('svg.marks'); + const found: { kind: string; element: Element }[] = []; + host.querySelectorAll('[data-flint-region]').forEach((element) => found.push({ kind: 'region wash', element })); + host.querySelectorAll('*').forEach((element) => { + if (renderer?.contains(element) || element.closest('[data-flint-markup]')) return; + const style = getComputedStyle(element); + if (style.position !== 'absolute' || style.display === 'none' || style.visibility === 'hidden') return; + if (style.pointerEvents !== 'none' || style.clipPath !== 'none') return; + const box = element.getBoundingClientRect(); + if (box.width * box.height <= 1) return; + if (element instanceof SVGSVGElement) { + // The lasso and sector guides are drawn at z-index 5; other SVG layers (focus, data overlays) redraw marks. + if (style.zIndex !== '5') return; + element.querySelectorAll('path').forEach((path) => found.push({ kind: 'drawn region', element: path })); + return; + } + if (!(element instanceof HTMLElement) || element.children.length > 0) return; + const kind = element.hasAttribute('data-flint-inspect-index') ? 'index label' + : element.hasAttribute('data-flint-inspect-value') ? 'value label' + : box.width <= 4 || box.height <= 4 ? 'guide rule' : 'drag box'; + found.push({ kind, element }); + }); + return found; +} + +function judge(rect: Rect, views: Rect[]): Pick { + const touched = views.filter((view) => intersect(rect, view)); + if (touched.length === 0) return { verdict: 'outside', detail: 'outside every plot' }; + if (touched.length > 1) return { verdict: 'spans', detail: `spans ${touched.length} panels and the gaps between` }; + const [view] = touched; + const past = { + left: view.left - rect.left, right: rect.right - view.right, + top: view.top - rect.top, bottom: rect.bottom - view.bottom, + }; + const sides = Object.entries(past).filter(([, by]) => by > TOLERANCE).map(([side, by]) => `${side} ${Math.round(by)}px`); + return sides.length ? { verdict: 'overflow', detail: `past the plot: ${sides.join(', ')}` } : { verdict: 'inside', detail: 'inside its plot' }; +} + +function measure(host: HTMLElement, geometry: Geometry): Measured[] { + return overlayElements(host).flatMap(({ kind, element }) => { + const rect = visibleRect(element, host); + return rect ? [{ kind, rect, ...judge(rect, geometry.views) }] : []; + }); +} + +// ---------------------------------------------------------------- gestures + +function pointer(type: string, at: Point, buttons: number): PointerEvent { + return new PointerEvent(type, { + clientX: at.x, clientY: at.y, bubbles: true, pointerId: 1, pointerType: 'mouse', button: 0, buttons, + }); +} + +/** Two rendering frames, or half a second where frames don't come (a hidden tab). */ +function settle(ms = 120): Promise { + return Promise.race([ + new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))), + new Promise((resolve) => setTimeout(resolve, 500)), + ]).then(() => new Promise((resolve) => setTimeout(resolve, ms))); +} + +// ---------------------------------------------------------------- cases + +type Step = + | { kind: 'updates'; updates: ChartUpdate[] } + | { kind: 'hover'; at: Locate } + | { kind: 'drag'; path: Locate[] }; + +/** `steps` run in order; the overlays are judged after the last, and mid-drag when the last is a drag. */ +type OverlayCase = { id: string; title: string; note: string; input: ChartAssemblyInput; steps: Step[]; scale?: number }; + +const zoomX = (domain: [unknown, unknown]): ChartUpdate => + ({ id: 'zoom', ops: [{ op: 'set-viewport', axes: 'x', value: { x: domain } }] }) as unknown as ChartUpdate; + +const REGION_CASES: OverlayCase[] = [ + { + id: 'region-unit', title: 'Scatter · x [15, 160]', + note: 'Baseline: a band inside the x domain on a single plot.', + input: scatterInput(false), steps: [{ kind: 'updates', updates: [region('above', { x: [15, 160] })] }], + }, + { + id: 'region-past-domain', title: 'Scatter · x [15, 1000]', + note: 'The band runs past the domain\'s end; it should stop at the plot.', + input: scatterInput(false), steps: [{ kind: 'updates', updates: [region('above', { x: [15, 1000] })] }], + }, + { + id: 'region-row-facet', title: 'Row facets · x [15, 200]', + note: 'The reported chart: the band is shaded in each panel and stops at its edges.', + input: scatterInput(true), steps: [{ kind: 'updates', updates: [region('above', { x: [15, 200] })] }], + }, + { + id: 'region-column-facet-x', title: 'Column facets · Jun to Dec 2024', + note: 'A period on three panels side by side.', + input: lineInput('column'), steps: [{ kind: 'updates', updates: [region('period', { x: ['2024-06', '2024-12'] })] }], + }, + { + id: 'region-column-facet-y', title: 'Column facets · y [50, 70]', + note: 'A band of values: full width of each panel, and no wider.', + input: lineInput('column'), steps: [{ kind: 'updates', updates: [region('band', { y: [50, 70] })] }], + }, + { + id: 'region-zoomed', title: 'Line · Mar to Sep 2024, then zoomed to May to Jul', + note: 'Navigate then frames a narrower window: the band should stop at its edges.', + input: withInteractions(lineInput('none'), [{ type: 'navigate', options: { axes: 'x' } }]), + steps: [ + { kind: 'updates', updates: [region('period', { x: ['2024-03', '2024-09'] })] }, + { kind: 'updates', updates: [zoomX(['2024-05', '2024-07'])] }, + ], + }, + { + id: 'region-scaled', title: 'Scatter · x [15, 160], host scaled to 75%', + note: 'The chart drawn inside a CSS transform, as a scaled card or slide draws it.', + input: scatterInput(false), scale: 0.75, steps: [{ kind: 'updates', updates: [region('above', { x: [15, 160] })] }], + }, +]; + +const INDEX_CASES: OverlayCase[] = [ + { + id: 'index-unit', title: 'Line · single plot', + note: 'Baseline: the guide, value rules and labels on one plot.', + input: withInteractions(lineInput('none'), [{ type: 'inspect-index' }]), + steps: [{ kind: 'hover', at: inView(0, 0.62, 0.5) }], + }, + { + id: 'index-column-facet', title: 'Column facets · pointer in the middle panel', + note: 'Three panels side by side: the guide and each value rule stay in the panel the pointer reads.', + input: withInteractions(lineInput('column'), [{ type: 'inspect-index' }]), + steps: [{ kind: 'hover', at: inView(1, 0.5, 0.5) }], + }, + { + id: 'index-row-facet', title: 'Row facets · pointer in the top panel', + note: 'Two panels stacked: the guide reads the same month in each, without running through the gap.', + input: withInteractions(lineInput('row'), [{ type: 'inspect-index' }]), + steps: [{ kind: 'hover', at: inView(0, 0.4, 0.5) }], + }, + { + id: 'index-scaled', title: 'Line · host scaled to 75%', + note: 'The chart drawn inside a CSS transform.', + input: withInteractions(lineInput('none'), [{ type: 'inspect-index' }]), scale: 0.75, + steps: [{ kind: 'hover', at: inView(0, 0.62, 0.5) }], + }, +]; + +const DRAG_CASES: OverlayCase[] = [ + { + id: 'drag-select-unit', title: 'select · drag past the bottom right', + note: 'A rectangle from inside the plot to 60 px past the chart.', + input: withInteractions(scatterInput(false), [{ type: 'select', options: { mode: 'stateful' } }]), + steps: [{ kind: 'drag', path: [inView(0, 0.45, 0.35), inView(0, 0.9, 0.9), pastChart(60, 60)] }], + }, + { + id: 'drag-brush-x-unit', title: 'brush-x · drag past the right edge', + note: 'A period dragged out past the legend.', + input: withInteractions(lineInput('none'), [{ type: 'brush-x', options: { mode: 'stateful' } }]), + steps: [{ kind: 'drag', path: [inView(0, 0.3, 0.5), inView(0, 0.95, 0.5), pastChart(80, 0)] }], + }, + { + id: 'drag-select-row-facet', title: 'select · row facets, top panel into the bottom one', + note: 'The drag starts in one panel and ends in the next.', + input: withInteractions(scatterInput(true), [{ type: 'select', options: { mode: 'stateful' } }]), + steps: [{ kind: 'drag', path: [inView(0, 0.3, 0.3), inView(1, 0.6, 0.5), inView(1, 0.8, 0.8)] }], + }, + { + id: 'drag-brush-x-column-facet', title: 'brush-x · column facets, across panels', + note: 'A period dragged from the first panel into the third.', + input: withInteractions(lineInput('column'), [{ type: 'brush-x', options: { mode: 'stateful' } }]), + steps: [{ kind: 'drag', path: [inView(0, 0.5, 0.5), inView(1, 0.5, 0.5), inView(2, 0.5, 0.5)] }], + }, + { + id: 'drag-lasso-unit', title: 'lasso-select · stroke leaves the chart', + note: 'A freehand stroke that runs out past the top left and comes back.', + input: withInteractions(scatterInput(false), [{ type: 'lasso-select' }]), + steps: [{ + kind: 'drag', + path: [inView(0, 0.5, 0.5), inView(0, 0.2, 0.3), pastChart(-40, -40), inView(0, 0.05, 0.9), inView(0, 0.6, 0.8)], + }], + }, + { + id: 'drag-brush-y-bars', title: 'brush-y · horizontal bars, drag past the bottom', + note: 'Thirty rows on a band axis, brushed down past the last one.', + input: withInteractions(barsInput(), [{ type: 'brush-y', options: { mode: 'stateful' } }]), + steps: [{ kind: 'drag', path: [inView(0, 0.5, 0.4), inView(0, 0.5, 0.95), pastChart(0, 60)] }], + }, + { + id: 'drag-brush-x-zoomed', title: 'brush-x stateful, then zoomed in with navigate', + note: 'The brush keeps its period; the chart then frames a window inside it.', + input: withInteractions(lineInput('none'), [ + { type: 'brush-x', options: { mode: 'stateful' } }, { type: 'navigate', options: { axes: 'x', pan: false } }, + ]), + steps: [ + { kind: 'drag', path: [inView(0, 0.2, 0.5), inView(0, 0.8, 0.5)] }, + { kind: 'updates', updates: [zoomX(['2024-09', '2025-03'])] }, + ], + }, + { + id: 'drag-select-economist', title: 'select · Economist theme, drag past the top right', + note: 'A house that moves the plot: its axes, title and keys sit elsewhere.', + input: withInteractions({ ...scatterInput(false), theme_spec: 'economist' } as ChartAssemblyInput, [{ type: 'select', options: { mode: 'stateful' } }]), + steps: [{ kind: 'drag', path: [inView(0, 0.3, 0.6), inView(0, 0.9, 0.1), pastChart(60, -60)] }], + }, + { + id: 'drag-select-scaled', title: 'select · host scaled to 75%, drag past the bottom right', + note: 'The chart drawn inside a CSS transform.', + input: withInteractions(scatterInput(false), [{ type: 'select', options: { mode: 'stateful' } }]), scale: 0.75, + steps: [{ kind: 'drag', path: [inView(0, 0.45, 0.35), inView(0, 0.9, 0.9), pastChart(60, 60)] }], + }, +]; + +// ---------------------------------------------------------------- card + +type Report = { geometry: Geometry; items: Measured[]; when: string } | { error: string }; +type Status = 'pass' | 'fail' | 'pending'; + +const INK: Record = { inside: '#16794b', overflow: '#d92d20', spans: '#d92d20', outside: '#d92d20' }; + +function statusOf(report: Report | null): Status { + if (!report) return 'pending'; + if ('error' in report || report.items.length === 0) return 'fail'; + return report.items.some((item) => item.verdict !== 'inside') ? 'fail' : 'pass'; +} + +const cardStyle: CSSProperties = { + border: `1px solid ${siteTheme.border}`, borderRadius: siteTheme.radius, background: siteTheme.surface, + padding: 10, minWidth: 0, overflow: 'visible', +}; + +function ContainmentCase({ item, showBoxes, onStatus }: { + item: OverlayCase; showBoxes: boolean; onStatus: (id: string, status: Status) => void; +}) { + const stage = useRef(null); + const host = useRef(null); + const [report, setReport] = useState(null); + const [notes, setNotes] = useState([]); + const [origin, setOrigin] = useState({ x: 0, y: 0 }); + + useEffect(() => { + if (!host.current || !stage.current) return; + const container = host.current; + const frame = stage.current; + let cancelled = false; + const surface = mountChart(container, item.input, { backend: 'vegalite', renderer: 'svg', expressionInterpreter }); + const snapshot = (when: string): Geometry | undefined => { + const geometry = readGeometry(container, surface); + if (cancelled) return geometry; + const items = geometry ? measure(container, geometry) : []; + // A guide ends when the pointer leaves or a drag is released; the last thing drawn keeps its verdict. + if (when === 'live' && items.length === 0) return geometry; + const stageRect = frame.getBoundingClientRect(); + setOrigin({ x: stageRect.left, y: stageRect.top }); + setReport(geometry ? { geometry, items, when } : { error: 'No plot views reported by surface.layout' }); + return geometry; + }; + let pending = 0; + const live = () => { + cancelAnimationFrame(pending); + pending = requestAnimationFrame(() => snapshot('live')); + }; + const run = async () => { + await surface.ready; + await settle(); + if (cancelled) return; + const warnings = await surface.warnings; + if (cancelled) return; + setNotes(warnings.map((warning) => `${warning.code}: ${warning.message}`)); + const geometry = readGeometry(container, surface); + if (!geometry) { + snapshot('mount'); + return; + } + const target = container.querySelector('svg.marks')!; + for (const [index, step] of item.steps.entries()) { + const last = index === item.steps.length - 1; + if (step.kind === 'updates') { + // applyUpdate layers each step on the last; setUpdates would replace them. + const outcomes = await Promise.all(step.updates.map((update) => surface.applyUpdate(update))); + if (cancelled) return; + const missed = outcomes.flatMap((outcome, at) => outcome.status === 'applied' ? [] + : [`update "${step.updates[at].id}" ${outcome.status}${outcome.unsupportedOps.length ? ` (${outcome.unsupportedOps.join(', ')})` : ''}`]); + if (missed.length) setNotes((now) => [...now, ...missed]); + await settle(200); + } else if (step.kind === 'hover') { + target.dispatchEvent(pointer('pointermove', step.at(geometry), 0)); + await settle(); + } else { + const points = step.path.map((locate) => locate(geometry)); + target.dispatchEvent(pointer('pointerdown', points[0], 1)); + for (let leg = 1; leg < points.length; leg += 1) { + for (let move = 1; move <= 4; move += 1) { + const t = move / 4; + const from = points[leg - 1]; + const to = points[leg]; + target.dispatchEvent(pointer('pointermove', { x: from.x + (to.x - from.x) * t, y: from.y + (to.y - from.y) * t }, 1)); + } + } + await settle(); + if (cancelled) return; + // A drag that ends the script is judged mid-drag, where every guide is still drawn. + if (last) snapshot('scripted drag, before release'); + target.dispatchEvent(pointer('pointerup', points[points.length - 1], 0)); + await settle(); + } + if (cancelled) return; + } + const lastStep = item.steps[item.steps.length - 1]; + if (lastStep.kind !== 'drag') snapshot(lastStep.kind === 'hover' ? 'scripted hover' : 'after the updates'); + container.addEventListener('pointermove', live); + container.addEventListener('pointerup', live); + container.addEventListener('pointerleave', live); + }; + void run().catch((error) => { + if (!cancelled) setReport({ error: String((error as Error)?.message ?? error) }); + }); + return () => { + cancelled = true; + cancelAnimationFrame(pending); + container.removeEventListener('pointermove', live); + container.removeEventListener('pointerup', live); + container.removeEventListener('pointerleave', live); + surface.destroy(); + container.replaceChildren(); + }; + }, [item]); + + const status = statusOf(report); + useEffect(() => onStatus(item.id, status), [item.id, status, onStatus]); + + const scale = item.scale ?? 1; + const local = (rect: Rect) => ({ + x: (rect.left - origin.x) / scale, y: (rect.top - origin.y) / scale, + width: (rect.right - rect.left) / scale, height: (rect.bottom - rect.top) / scale, + }); + const failures = report && 'items' in report ? report.items.filter((entry) => entry.verdict !== 'inside') : []; + + return ( +
+

{item.title}

+

{item.note}

+ {/* Drawn at its own size unless the case scales its host, so an overlay past the chart shows as a reader sees it. */} +
+
+
+ {showBoxes && report && 'geometry' in report ? ( + + ) : null} +
+
+
+ {!report ? Running… + : 'error' in report ? Fail: {report.error} + : report.items.length === 0 ? Fail: no overlay drawn ({report.when}) + : ( + <> +
+ {status === 'pass' ? 'Pass' : 'Fail'}: {report.items.length - failures.length} of {report.items.length} overlay + {report.items.length === 1 ? '' : 's'} inside a plot ({report.when}) +
+ {failures.map((entry, index) => ( +
✗ {entry.kind}: {entry.detail}
+ ))} + + )} + {notes.map((note, index) => ( +
⚠ {note}
+ ))} +
+
+ ); +} + +// ---------------------------------------------------------------- page section + +const GROUPS = [ + { id: 'region', title: 'Background fill · annotate-region', cases: REGION_CASES }, + { id: 'index', title: 'Index guide · inspect-index', cases: INDEX_CASES }, + { id: 'drag', title: 'Selection drags · select, brush-x, brush-y, lasso-select', cases: DRAG_CASES }, +] as const; + +export function OverlayContainmentLab() { + const [showBoxes, setShowBoxes] = useState(true); + const [statuses, setStatuses] = useState>({}); + const onStatus = useCallback((id: string, status: Status) => { + setStatuses((now) => (now[id] === status ? now : { ...now, [id]: status })); + }, []); + const tally = (cases: readonly OverlayCase[]) => { + const failed = cases.filter((item) => statuses[item.id] === 'fail').length; + const done = cases.filter((item) => statuses[item.id] && statuses[item.id] !== 'pending').length; + return done < cases.length ? `${done}/${cases.length} run` : failed ? `${failed} of ${cases.length} overflow` : 'all inside'; + }; + + return ( +
+
+
+

Overlay containment

+

+ Background washes, index guides and selection drags, checked against the plot they belong to. Each chart + is mounted at its own size, the overlay is applied (an update, a scripted hover or a scripted drag), and + every element Flint draws over the renderer is checked against the plot panels the chart reports in{' '} + surface.layout.views. Green dashes: the plot panels; grey dots: the drawn chart; red: an + overlay past its panel, or one spanning several. Hover or drag on any chart to re-measure live. +

+
+ +
+ {GROUPS.map((group) => ( +
+

+ {group.title} · {tally(group.cases)} +

+
+ {group.cases.map((item) => ( + + ))} +
+
+ ))} +
+ ); +} diff --git a/site/src/playground/PlaygroundShell.tsx b/site/src/playground/PlaygroundShell.tsx index a850e9ed..28579844 100644 --- a/site/src/playground/PlaygroundShell.tsx +++ b/site/src/playground/PlaygroundShell.tsx @@ -3,7 +3,9 @@ import { siteTheme } from '../shared/theme'; import './playground.css'; type NavLeaf = { to: string; label: string; end?: boolean }; -type NavEntry = NavLeaf | { group: string; children: NavLeaf[] }; +/** A heading splits a long menu into topics; it is not a link. */ +type NavItem = NavLeaf | { heading: string }; +type NavEntry = NavLeaf | { group: string; children: NavItem[] }; const pages: NavEntry[] = [ { @@ -11,6 +13,7 @@ const pages: NavEntry[] = [ children: [ { to: 'illustrations', label: 'Gallery', end: true }, { to: 'illustrations/architecture', label: 'Architecture' }, + { to: '/dev/design', label: 'Design blueprint' }, { to: 'demo-wall', label: 'Demo wall' }, { to: 'full-test-cases', label: 'Full test cases' }, ], @@ -18,19 +21,31 @@ const pages: NavEntry[] = [ { group: 'Layout', children: [ - { to: 'labs', label: 'Overview' }, + { heading: 'Tools' }, { to: 'layout-inspector', label: 'Layout inspector' }, { to: 'layout-plan', label: 'Layout plan demos' }, - { to: 'overflow-viewport', label: 'Overflow viewport' }, - { to: 'zoom-clipping', label: 'Zoom clipping' }, - { to: 'band-stretching', label: 'Band stretching' }, + { to: 'labs', label: 'Figures: colour, bands, dodge' }, + { heading: 'Fit and overflow' }, + { to: 'canvas-fit', label: 'Canvas fit' }, + { to: 'viewport', label: 'Viewport and clipping' }, + { heading: 'Axes and titles' }, { to: 'axis-label', label: 'Axis labels' }, - { to: 'calendar-axis', label: 'Calendar axes' }, - { to: 'categorical-temporal', label: 'Categorical temporal' }, - { to: 'canvas-squeeze', label: 'Canvas squeeze' }, + { to: 'time-axes', label: 'Time axes' }, + { to: 'titles', label: 'Titles' }, + { heading: 'Marks, colour and maps' }, { to: 'density', label: 'Density' }, + { to: 'heatmaps', label: 'Heatmaps' }, { to: 'legend', label: 'Legend' }, - { to: 'color', label: 'Color' }, + { to: 'colour', label: 'Colour' }, + { to: 'maps', label: 'Maps' }, + ], + }, + { + group: 'Backend layout', + children: [ + { to: 'backend-layout/echarts', label: 'ECharts' }, + { to: 'backend-layout/chartjs', label: 'Chart.js' }, + { to: 'backend-layout/plotly', label: 'Plotly' }, ], }, { @@ -38,9 +53,14 @@ const pages: NavEntry[] = [ children: [ { to: 'interaction-test-cases', label: 'Test cases' }, { to: 'interaction-coverage', label: 'Coverage' }, + { to: 'baseline', label: 'Baseline behaviour' }, + { to: 'tooltip-compare', label: 'Tooltip: Vega-Lite vs baseline' }, + { to: 'baseline-sweep', label: 'Baseline sweep (all chart types)' }, { to: 'interaction-conflicts', label: 'Conflict cases' }, { to: 'chart-api-design', label: 'API design: FlintChart' }, { to: 'annotation-lab', label: 'Annotation lab' }, + { to: 'annotation-captions', label: 'Annotation captions' }, + { to: 'muted-annotations', label: 'Muted annotations' }, { to: 'interaction-dashboard', label: 'Demo: dashboard' }, { to: 'external-to-chart', label: 'Demo: external to chart' }, { to: 'chart-to-external', label: 'Demo: chart to external' }, @@ -51,22 +71,17 @@ const pages: NavEntry[] = [ group: 'Themes', children: [ { to: 'theme-labs', label: 'Theme lab' }, - { to: 'theme-lab-r2', label: 'R2 evaluation' }, - { to: 'theme-lab-real', label: 'Real-world evaluation' }, - { to: 'label-experiment', label: 'Label experiment' }, - { to: 'style-references', label: 'Style references' }, - { to: 'new-theme-test', label: 'New theme test' }, + { to: 'new-theme-test', label: 'Style guides' }, { to: 'theme-improvement', label: 'Theme improvement' }, - { to: 'label-angles', label: 'Label angles' }, { to: 'row-names', label: 'Names above bars' }, ], }, { group: 'Release examples', children: [ + { to: 'release-examples/1.1', label: '1.1' }, { to: 'release-examples/1.0.0', label: '1.0.0' }, - { to: 'release-examples/application-demos', label: 'Application demos' }, - { to: 'release-examples/test-examples', label: 'Test examples' }, + { to: 'fun/greek', label: 'Greek myths on maps' }, ], }, { @@ -75,18 +90,18 @@ const pages: NavEntry[] = [ { to: 'mcp-ui', label: 'MCP UI test' }, { to: 'mcp-stories', label: 'MCP chat stories' }, { to: 'debug-gym', label: 'Debug gym' }, - { to: 'agent-comparison', label: 'Agent comparison' }, - { to: 'dense-marks', label: 'Dense marks: D3 vs Flint' }, { to: 'interaction-coverage', label: 'Interaction coverage' }, ], }, + // Eval runs are local (site/public/eval is gitignored), so the tab exists only in dev builds. + ...(import.meta.env.DEV ? [{ to: 'eval', label: 'Eval' }] : []), ]; -function NavGroupMenu({ group, children }: { group: string; children: NavLeaf[] }) { +function NavGroupMenu({ group, children }: { group: string; children: NavItem[] }) { const { pathname } = useLocation(); - // A page may carry further segments (style-references/swiss), so match the - // page rather than the end of the path. - const active = children.some((c) => pathname.includes(`/${c.to}`)); + const leaves = children.filter((c): c is NavLeaf => 'to' in c); + // A page may carry further segments, so match the page rather than the end of the path. + const active = leaves.some((c) => pathname.includes(`/${c.to}`)); return (
-
- {children.map((page) => ( - isActive ? 'dev-nav-link dev-nav-link-active' : 'dev-nav-link'} - > - {page.label} - - ))} +
+
+ {children.map((page) => ('heading' in page ? ( +
{page.heading}
+ ) : ( + event.currentTarget.blur()} + className={({ isActive }) => isActive ? 'dev-nav-link dev-nav-link-active' : 'dev-nav-link'} + > + {page.label} + + )))} +
); diff --git a/site/src/playground/ReleaseBlockers.tsx b/site/src/playground/ReleaseBlockers.tsx new file mode 100644 index 00000000..a00ff1be --- /dev/null +++ b/site/src/playground/ReleaseBlockers.tsx @@ -0,0 +1,156 @@ +import type { ReactNode } from 'react'; +import { TEST_GENERATORS } from 'flint-chart/test-data'; +import { FlintView } from '../components/FlintView'; +import { ScaleToFit } from '../components/ScaleToFit'; +import { testCaseToAssemblyInput } from '../shared/test-case-utils'; +import { siteTheme } from '../shared/theme'; + +// What the 1.1 release check found, drawn live so each can be seen and its fix checked. + +const HOURS = Array.from({ length: 24 }, (_, hour) => ({ + Time: `2020-01-15T${String(hour).padStart(2, '0')}:00:00`, + Visits: 120 + Math.round(80 * Math.sin((hour / 24) * Math.PI * 2 - 1.2) + 40 * Math.sin(hour)), +})); + +const hourlyBars = { + data: { values: HOURS }, + semantic_types: { Time: 'DateTime', Visits: 'Quantity' }, + chart_spec: { chartType: 'Bar Chart', encodings: { x: 'Time', y: 'Visits' }, title: 'Visits by hour, 15 January 2020', canvasSize: { width: 460, height: 260 } }, +}; + +const heatmapCase = (generator: string, pattern: RegExp) => { + const found = TEST_GENERATORS[generator]?.().find((tc) => pattern.test(tc.title)); + if (!found) return null; + const input = testCaseToAssemblyInput(found, { width: 460, height: 260 }); + return { ...input, chart_spec: { ...input.chart_spec, title: found.title } }; +}; +const irregularHeatmap = heatmapCase('Heatmap', /80.5/); +const monthlyHeatmap = heatmapCase('Omni: Heatmap', /Heatmap/); + +// The theme lab's "Shipments over time": 24 dates about 45 days apart, on a bar chart. +const shipmentsCase = TEST_GENERATORS['Bar Chart']?.()[9]; +const shipments = shipmentsCase ? (() => { + const input = testCaseToAssemblyInput(shipmentsCase, { width: 460, height: 260 }); + return { ...input, chart_spec: { ...input.chart_spec, title: 'Shipments over time', subtitle: 'Units, 2020–2022' } }; +})() : null; +const shipmentsBefore = shipments + ? { ...shipments, chart_spec: { ...shipments.chart_spec, chartProperties: { ...(shipments.chart_spec as any).chartProperties, xAxisType: 'nominal' } } } + : null; +const shipmentDates = shipmentsCase ? [...new Set(shipmentsCase.data.map((row) => String(row[Object.keys(row).find((k) => /date/i.test(k)) ?? ''])))].slice(0, 6) : []; + +const zone = Intl.DateTimeFormat().resolvedOptions().timeZone; +const offset = -new Date('2020-01-15T00:00:00').getTimezoneOffset() / 60; + +function Figure({ caption, children }: { caption: string; children: ReactNode }) { + return ( +
+
{caption}
+ {children} +
+ ); +} + +const STATUS = { + open: { ink: '#cf222e', border: '#f4b4b0', badge: undefined, wash: undefined }, + fixed: { ink: '#1a7f37', border: '#aceebb', badge: 'fixed', wash: '#dafbe1' }, + decide: { ink: '#9a6700', border: '#f2d48a', badge: 'decide', wash: '#fff8c5' }, +} as const; + +function Blocker({ n, title, look, cause, fix, fixLabel, status = 'open', children }: { n: number; title: string; look: ReactNode; cause: ReactNode; fix: ReactNode; fixLabel?: string; status?: keyof typeof STATUS; children: ReactNode }) { + const { ink, border, badge, wash } = STATUS[status]; + return ( +
+

{n}. {title} {badge && {badge}}

+
+
Look at
{look}
+
Cause
{cause}
+
{fixLabel ?? (status === 'fixed' ? 'Fixed' : 'Fix')}
{fix}
+
+
{children}
+
+ ); +} + +export function ReleaseBlockers() { + return ( +
+
+

Release 1.1 blockers

+

+ Found by comparing every gallery case against the published 1.0.1, and every dev page before and after the fixes. Each is + drawn live below, by the current code. +

+
+ + The theme lab's “Shipments over time” (generated data): 24 dates, {shipmentDates.join(', ')}, … Left, as drawn + now: a time axis (2020, April, July, …), each bar at its date. Right, as before: one band per date, labelled with + every date turned upright.} + cause={<>The heatmap fix reads the step dates keep from the dates themselves, and that reading also decides whether dates + on a bar chart are a few snapshots (bands) or a run of time (a time scale). Before, these dates were measured in days + (a step of one day, filled by 24 of 1,050), so they read as snapshots; now they keep about one step of 45 days, a run.} + fixLabel="Decided" + fix={<>Keep the time scale: readable labels, bars placed at their dates. A few dates (eight or fewer) on a bar chart are + still named one band each, as before.} + > +
+ {shipments ? :

Test case not found.

} +
+
+ {shipmentsBefore ? :

Test case not found.

} +
+
+ + The data runs from 00:00 to 23:00 on 15 January, written without a time zone, so the first bar is labelled + {' '}Jan 15, 12 AM whatever the viewer's time zone (this browser: {zone}, UTC{offset >= 0 ? '+' : ''}{offset}). + Before the fix, outside UTC the axis was shifted by the viewer's offset: in Pacific time it started at Jan 14, 4 PM.} + cause={<>A timestamp with no zone was read as UTC (readIsoTimestamp in core/temporal-parse.ts added a + {' '}Z), but the time axis prints local time. For dates that is right (a midnight timestamp becomes its date); + for a time of day the reading and the labels disagreed.} + fix={<>A zoneless time of day stays a wall-clock time, as in 1.0.1: written in ISO form without a zone, so it is read and + labelled in the viewer's time. Midnight timestamps under a date type still become their dates. Tested in UTC and Los Angeles + {' '}(tests/temporal-midnight.test.ts).} + > +
+ +
+
+
The rows as written
+
+            {HOURS.slice(0, 6).map((row) => JSON.stringify(row)).join('\n')}{'\n'}…{'\n'}{JSON.stringify(HOURS[23])}
+          
+
+
+ + Left: dates 13 or 14 days apart, which drew every cell as a one-day sliver; now each cell runs to the next date and + the row tiles. Right: one row a month. Neither x-axis title shows the internal field any more (it read “Date, + __cell_x_end”). Every case is in Layout → Heatmaps.} + cause={<>A heatmap cell on a time axis spanned the finest common step in days (one day here), and only dates on the 1st + of a month counted as monthly. The end field (x2: __cell_x_end) had no title, so Vega-Lite joined its name + into the axis title.} + fix={<>Each date stands for the period it repeats at, read from the values (dateCadence / + {' '}dateCells in core/decisions.ts): its month, quarter or year whatever the day; an exact step + (days, weeks, hours); or until the next date where the gaps keep about one step. A whole run of months is now a time scale + too, not bands. x2 takes the axis's title. Tested in tests/heatmap-time-cells.test.ts.} + > +
+ {irregularHeatmap ? :

Test case not found.

} +
+
+ {monthlyHeatmap ? :

Test case not found.

} +
+
+
+ ); +} diff --git a/site/src/playground/StyleReferences.tsx b/site/src/playground/StyleReferences.tsx deleted file mode 100644 index 8a4e171c..00000000 --- a/site/src/playground/StyleReferences.tsx +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * Style references — the hand-authored look-and-feel targets, on one page. - * - * Every reference is the same thing seen from a different house: a grid of - * manual Vega-Lite mockups a preset is judged against by eye. That made two - * near-identical pages, so there is now one, and adding a house is a matter of - * adding it to the registry in `style-references.ts`. - * - * The house is in the URL rather than in state alone, so a reference can be - * linked to — which is what these pages are for. - */ - -import { NavLink, useParams } from 'react-router-dom'; -import { siteTheme } from '../shared/theme'; -import { VegaLiteView } from '../components/VegaLiteView'; -import { STYLE_REFERENCES, findStyleReference } from './style-references'; - -export function StyleReferences() { - const { house } = useParams<{ house?: string }>(); - const reference = findStyleReference(house); - - return ( -
-
-

- Style references · hand-authored mockups -

- -
- {STYLE_REFERENCES.map((r) => ( - ({ - padding: '4px 12px', - fontSize: 13, - fontWeight: 600, - textDecoration: 'none', - border: `1px solid ${isActive ? siteTheme.accent : siteTheme.border}`, - color: isActive ? siteTheme.accent : siteTheme.textMuted, - background: isActive ? `${siteTheme.accent}14` : 'transparent', - })} - > - {r.label} - - ))} -
- -
- -
- {reference.cases.map((c) => ( -
-
- -
-
-
- {c.title} - - {c.id} - -
-
{c.note}
-
-
- ))} -
-
- ); -} diff --git a/site/src/playground/TabbedLab.tsx b/site/src/playground/TabbedLab.tsx new file mode 100644 index 00000000..cd5f3871 --- /dev/null +++ b/site/src/playground/TabbedLab.tsx @@ -0,0 +1,32 @@ +import type { ReactNode } from 'react'; +import { useSearchParams } from 'react-router-dom'; + +export interface LabTab { + id: string; + label: string; + element: ReactNode; +} + +/** Several labs on one topic under one dev page: a tab bar (`?tab=`) over the lab it picks; the first tab opens. */ +export function TabbedLab({ tabs }: { tabs: LabTab[] }) { + const [params, setParams] = useSearchParams(); + const current = tabs.find((tab) => tab.id === params.get('tab')) ?? tabs[0]; + return ( + <> + +
{current.element}
+ + ); +} diff --git a/site/src/playground/ThemeLab.tsx b/site/src/playground/ThemeLab.tsx index 56f6b2df..ae9626a6 100644 --- a/site/src/playground/ThemeLab.tsx +++ b/site/src/playground/ThemeLab.tsx @@ -1,871 +1,216 @@ -import { useEffect, useMemo, useState } from 'react'; -import { VegaLiteView } from '../components/VegaLiteView'; -import { ScaleToFit } from '../components/ScaleToFit'; -import { siteTheme } from '../shared/theme'; -import { THEME_PRESETS, assembleVegaLite, vlGetTemplateDef } from 'flint-chart'; -import { PREVIEW_CASES } from '../shared/preview-cases'; -import THEME_META from './theme-lab-assets/_themes.json'; -import HEADLINES from './theme-lab-assets/_headlines.json'; -import THEME_SPECS from './theme-lab-assets/_themespecs.json'; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. /** - * Theme lab — Flint's default Vega-Lite output next to a hand-authored - * bespoke redesign of the same chart, plus the same chart compiled from the - * ThemeSpec the human read. + * Theme lab: one row per case, one column per house (Flint's default first), on either Vega-Lite or Plotly. * - * Columns 1 and 3 are compiled here, in the browser, by the same compiler the - * library ships: a change to a preset or to a realize pass shows up on this - * page as soon as the module reloads. Only column 2 is a file — a human wrote - * it once, by hand, and it is the reference the other two are judged against. + * - Real data: the real-world datasets in `shared/preview-cases.ts` (real category names, distributions, + * negatives, long labels), the browser twin of `scripts/theme-real.ts`. A house with a hand-made redesign of + * the case carries a "ref" badge that opens it beside the compiled chart. + * - Generated: the synthetic gallery cases of `theme-lab-r2-data.ts`, paged by family: does a house break, + * turn illegible, or stop being recognisable on a chart nobody tuned it against. */ -type ThemeId = keyof typeof THEME_META.themes; - -interface ThemeMeta { - label: string; - alias: string; - surface: string; - ink: string; - accent: string; - swatches: string[]; - intent: string; - signature: string[]; -} - -interface FlintIndexEntry { - id: string; - chartType: string; - title: string; - subtitle: string; - source: string; - rows: number; -} - -const THEMES = THEME_META.themes as unknown as Record; -const THEME_ORDER = THEME_META.order as ThemeId[]; -const HEADLINE_MAP = HEADLINES.headlines as Record; - -// Column 2, and only column 2. `..json` is the hand-authored -// redesign; nothing else in this folder is read by the page. -const MANUAL_MODULES = import.meta.glob('./theme-lab-assets/*.json', { eager: true }) as Record< - string, - { default: any } ->; - -interface ThemeReport { - stage: 'ground' | 'realize'; - path: string; - message: string; -} - -interface LabRow { - id: string; - chartType: string; - title: string; - source: string; - rows: number; - theme: ThemeId; - flintSpec: any; - themedSpec: any; - compiledSpec?: any; - compiledReport: ThemeReport[]; - design: string[]; -} +import { useMemo, useState, type ReactNode } from 'react'; +import { useSearchParams } from 'react-router-dom'; +import { plGetTemplateDef, vlGetTemplateDef, type ChartAssemblyInput } from 'flint-chart'; +import { siteTheme } from '../shared/theme'; +import { PREVIEW_CASES, type PreviewCase } from '../shared/preview-cases'; +import { R2_CASES, R2_FAMILY_ORDER, r2Input, type R2Family } from './theme-lab-r2-data'; +import { LAB_COLUMNS, LabCell, type LabBackend } from './ThemeLabCell'; +import { DetailModal, redesignsByCase, type LabRow } from './ThemeLabRedesign'; -/** - * Flint's `_`-prefixed bookkeeping (`_options`, `_width`, `_theme`) is not part - * of the Vega-Lite the reader is meant to see. A double underscore is - * load-bearing (`__geo_id` is a choropleth join key) and stays. - */ -function stripInternal(node: any): void { - if (!node || typeof node !== 'object') return; - if (Array.isArray(node)) { - node.forEach(stripInternal); - return; - } - for (const key of Object.keys(node)) { - if (/^_[^_]/.test(key)) delete node[key]; - else stripInternal(node[key]); - } -} +const PAGE_SIZE = 6; -/** - * The assembly input for a case, built the same way for both compiled columns — - * the only difference between them is whether a ThemeSpec is attached, which is - * the whole point of the comparison. - */ -function inputFor(c: (typeof PREVIEW_CASES)[number]): any { - const headline = HEADLINE_MAP[c.id] ?? { title: c.title }; +/** Assembly input for a real case — mirrors `scripts/theme-real.ts` `inputFor`. */ +function realInput(c: PreviewCase): ChartAssemblyInput { return { data: { values: c.data }, semantic_types: c.semantic_types, chart_spec: { chartType: c.chartType, - title: headline.title, - ...(headline.subtitle ? { subtitle: headline.subtitle } : {}), + title: c.title, encodings: c.encodings, - baseSize: { width: 340, height: 230 }, + baseSize: { width: 300, height: 300 }, ...(c.chartProperties ? { chartProperties: c.chartProperties } : {}), }, - }; -} - -const CASE_INDEX: FlintIndexEntry[] = PREVIEW_CASES - .filter((c) => vlGetTemplateDef(c.chartType)) - .map((c) => { - const headline = HEADLINE_MAP[c.id] ?? { title: c.title }; - return { - id: c.id, - chartType: c.chartType, - title: headline.title, - subtitle: headline.subtitle ?? '', - source: c.source, - rows: c.data.length, - }; - }); - -function computeRows(): LabRow[] { - // One row per (id, theme). A case may carry several hand-authored themes — - // replicating one chart across every language is the only way to tell what - // the language decided from what the chart forced. - const manualById = new Map(); - for (const [path, mod] of Object.entries(MANUAL_MODULES)) { - const file = path.split('/').pop()!; - if (file.startsWith('_')) continue; - const match = /^(.*)\.([a-z0-9-]+)\.json$/.exec(file); - if (!match || !(match[2] in THEMES)) continue; - manualById.set(match[1], [...(manualById.get(match[1]) ?? []), mod.default]); - } - - const caseById = new Map(PREVIEW_CASES.map((c) => [c.id, c])); - const meta = new Map(CASE_INDEX.map((e) => [e.id, e])); - const rows: LabRow[] = []; - - for (const [id, manualList] of manualById) { - const c = caseById.get(id); - if (!c || !vlGetTemplateDef(c.chartType)) continue; - const input = inputFor(c); - const info = meta.get(id); - - let flint: any; - try { - flint = assembleVegaLite(input) as any; - stripInternal(flint); - } catch (err) { - console.error(`theme lab: ${id} failed to compile —`, (err as Error).message); - continue; - } - - for (const manual of manualList) { - const theme = manual.__theme__ as ThemeId; - const preset = (THEME_PRESETS as any)[theme]; - let compiled: any; - let report: ThemeReport[] = []; - try { - compiled = assembleVegaLite({ ...input, theme_spec: preset?.spec }) as any; - report = compiled._theme?.report ?? []; - stripInternal(compiled); - } catch (err) { - console.error(`theme lab: ${id}.${theme} failed to compile —`, (err as Error).message); - compiled = undefined; - } - rows.push({ - id, - chartType: info?.chartType ?? '—', - title: info?.title ?? id, - source: info?.source ?? '', - rows: info?.rows ?? 0, - theme, - flintSpec: flint, - themedSpec: manual, - compiledSpec: compiled, - compiledReport: report, - design: (manual.__design__ as string[]) ?? [], - }); - } - } - // Group by case so a fully replicated set sits together on the wall. - return rows.sort( - (a, b) => a.id.localeCompare(b.id) || THEME_ORDER.indexOf(a.theme) - THEME_ORDER.indexOf(b.theme), - ); -} - -// Compiling every case twice is cheap, but not cheap enough to do it once per -// call site. One pass per module load. -let ROWS_CACHE: LabRow[] | null = null; -function buildRows(): LabRow[] { - if (!ROWS_CACHE) ROWS_CACHE = computeRows(); - return ROWS_CACHE; + } as ChartAssemblyInput; } -/** Vega-Lite ignores unknown top-level keys, but strip ours anyway. */ -function cleanSpec(spec: any): any { - const out: any = {}; - for (const [k, v] of Object.entries(spec)) { - if (!k.startsWith('__')) out[k] = v; - } - return out; +interface GridCase { + id: string; + title: string; + note?: string; + pills: string[]; + input: ChartAssemblyInput; } -function ThemeChip({ theme }: { theme: ThemeId }) { - const t = THEMES[theme]; +function Pill({ children }: { children: ReactNode }) { return ( - - {t.label} - {t.alias} + {children} ); } -function SpecCell({ spec, dark, label }: { spec: any; dark: boolean; label: string }) { - const cleaned = useMemo(() => cleanSpec(spec), [spec]); - return ( -
-
- {label} -
-
- - - -
-
- ); -} - -/** Small, uniform, shrink-to-fit chart tile used on the wall. */ -function Thumb({ spec, bg, height }: { spec: any; bg: string; height: number }) { - return ( -
- - - -
- ); -} - -/** - * One wall tile = one (chart, language) triple: baseline, the human's redesign, - * and the compiler's reading of the same ThemeSpec. Small enough to scan a whole - * language in one screen; the argument lives in the popup, not here. - */ -function WallTile({ row, showFlint, onOpen }: { row: LabRow; showFlint: boolean; onOpen: () => void }) { - const t = THEMES[row.theme]; - const flint = useMemo(() => cleanSpec(row.flintSpec), [row.flintSpec]); - const themed = useMemo(() => cleanSpec(row.themedSpec), [row.themedSpec]); - const compiled = useMemo( - () => (row.compiledSpec ? cleanSpec(row.compiledSpec) : null), - [row.compiledSpec], - ); - return ( - - ); -} - -type CoverageStatus = 'full' | 'partial' | 'blocked'; -interface CoverageEntry { - status: CoverageStatus; - notes: string[]; -} - -const THEMESPEC_BY_THEME = Object.fromEntries( - Object.entries(THEME_PRESETS).map(([id, preset]) => [id, preset.spec]), -) as Record; -const THEMESPEC_COVERAGE = THEME_SPECS.coverage as unknown as Record; - -/** How many charts each single ThemeSpec is on the hook for. */ -const ROWS_PER_THEME: Record = buildRows().reduce>((acc, r) => { - acc[r.theme as string] = (acc[r.theme as string] ?? 0) + 1; - return acc; -}, {}); - -const COVERAGE_INK: Record = { - full: '#2d8659', - partial: '#b7791f', - blocked: '#c0392b', -}; - -const COVERAGE_LABEL: Record = { - full: 'expressible', - partial: 'partly expressible', - blocked: 'not expressible', -}; - -/** Full-size pair, the design argument, and both raw specs. */ -function DetailModal({ row, onClose }: { row: LabRow; onClose: () => void }) { - const [showSpec, setShowSpec] = useState(false); - const [showThemeSpec, setShowThemeSpec] = useState(false); - const t = THEMES[row.theme]; - const themeSpec = THEMESPEC_BY_THEME[row.theme as string]; - const coverage: CoverageEntry = THEMESPEC_COVERAGE[row.id] ?? { status: 'full', notes: [] }; - const flint = useMemo(() => cleanSpec(row.flintSpec), [row.flintSpec]); - const themed = useMemo(() => cleanSpec(row.themedSpec), [row.themedSpec]); - const compiled = useMemo( - () => (row.compiledSpec ? cleanSpec(row.compiledSpec) : null), - [row.compiledSpec], - ); - - useEffect(() => { - const onKey = (e: KeyboardEvent) => { - if (e.key === 'Escape') onClose(); - }; - window.addEventListener('keydown', onKey); - return () => window.removeEventListener('keydown', onKey); - }, [onClose]); - +function Choice({ label, value, options, onChange }: { + label?: string; + value: T; + options: [T, string][]; + onChange: (value: T) => void; +}) { return ( -
-
e.stopPropagation()} - style={{ - width: 'min(100%, 1180px)', - background: siteTheme.surface, - border: `1px solid ${siteTheme.border}`, - borderRadius: 10, - padding: 20, - }} - > -
- - - {row.id} - - - {row.chartType} · {row.rows} rows - - - +
+ {label ? {label} : null} + {options.map(([key, text]) => { + const active = key === value; + return ( -
+ ); + })} +
+ ); +} -
- - - {compiled ? ( - - ) : ( -
- 3 · not compiled -
- )} +function Row({ c, backend, refs, onRef }: { + c: GridCase; + backend: LabBackend; + refs?: Map; + onRef: (row: LabRow) => void; +}) { + return ( +
+
+
+ {c.id} · {c.title} + {c.note ? — {c.note} : null}
- - {row.compiledReport.length > 0 && ( - <> -

- What the compiler had to give up ({row.compiledReport.length}) -

-
    - {row.compiledReport.map((r, i) => ( -
  • - - {r.stage} - {' '} - {r.path}{' '} - — {r.message} -
  • - ))} -
- - )} - -

- What had to change ({row.design.length}) -

-
    - {row.design.map((d, i) => ( -
  1. - {d} -
  2. - ))} -
- - {showThemeSpec && ( -
-

- ThemeSpec · {t.label} -

-

- One spec per design language, not one per chart. This is the whole of {t.label} — - the same object is what would have to produce all {' '} - {ROWS_PER_THEME[row.theme] ?? 0} of its charts in this lab. Written against{' '} - - themespec.v12 - - . -

-
- - {COVERAGE_LABEL[coverage.status]} - - - for {row.id} - -
- {coverage.notes.length > 0 && ( -
    - {coverage.notes.map((n, i) => ( -
  • - {n} -
  • - ))} -
- )} -
{JSON.stringify(themeSpec, null, 2)}
-
- )} - - {showSpec && ( -
-
{JSON.stringify(row.flintSpec, null, 2)}
-
{JSON.stringify(row.themedSpec, null, 2)}
-
- )} +
+ {c.pills.map((p) => {p})} +
+
+
+ {LAB_COLUMNS.map((col) => { + const ref = refs?.get(col); + return onRef(ref) : undefined} />; + })}
-
+
); } -const specPre: React.CSSProperties = { - margin: 0, - maxHeight: 340, - overflow: 'auto', - fontFamily: siteTheme.fontMono, - fontSize: 10.5, - lineHeight: 1.45, - background: '#fafafa', - border: `1px solid ${siteTheme.border}`, - borderRadius: 6, - padding: 10, - color: siteTheme.text, -}; - export function ThemeLab() { - const rows = useMemo(buildRows, []); - const [filter, setFilter] = useState('all'); - const [openKey, setOpenKey] = useState(null); - const shown = filter === 'all' ? rows : rows.filter((r) => r.theme === filter); - const open = rows.find((r) => `${r.id}-${r.theme}` === openKey) ?? null; - const counts = useMemo(() => { - const m = new Map(); - rows.forEach((r) => m.set(r.theme, (m.get(r.theme) ?? 0) + 1)); - return m; - }, [rows]); + const [params, setParams] = useSearchParams(); + const data = params.get('data') === 'generated' ? 'generated' : 'real'; + const [backend, setBackend] = useState('vegalite'); + const [family, setFamily] = useState(R2_FAMILY_ORDER[0]); + const [page, setPage] = useState(0); + const [onlyRefs, setOnlyRefs] = useState(false); + const [open, setOpen] = useState(null); + const redesigns = useMemo(redesignsByCase, []); + + const realCases = useMemo(() => { + const has = backend === 'plotly' ? plGetTemplateDef : vlGetTemplateDef; + return PREVIEW_CASES.filter((c) => has(c.chartType) && (!onlyRefs || redesigns.has(c.id))); + }, [backend, onlyRefs, redesigns]); + const pageCount = Math.max(1, Math.ceil(realCases.length / PAGE_SIZE)); + const safePage = Math.min(page, pageCount - 1); + + const cases: GridCase[] = data === 'real' + ? realCases.slice(safePage * PAGE_SIZE, (safePage + 1) * PAGE_SIZE).map((c) => ({ + id: c.id, + title: c.title, + note: c.blurb, + pills: [c.chartType, ...(c.source ? [`src: ${c.source}`] : [])], + input: realInput(c), + })) + : R2_CASES.filter((c) => c.family === family).map((c) => ({ + id: c.id, + title: c.title, + note: c.subtitle, + pills: [c.gen, `probe: ${c.probe}`], + input: r2Input(c) as ChartAssemblyInput, + })); + const refCount = [...redesigns.values()].reduce((n, m) => n + m.size, 0); return ( -
-
-
-

- Theme lab{' '} - - ({rows.length} redesigns) - -

-
- -
- - {THEME_ORDER.map((id) => ( - - ))} +
+

Theme lab

+
+ setParams(value === 'real' ? {} : { data: value })} + /> + + {data === 'real' ? ( + + ) : null}
-
- - Palettes - -
- {THEME_ORDER.filter((id) => filter === 'all' || filter === id).map((id) => { - const t = THEMES[id]; - return ( -
-
- {t.label} - {t.alias} -
-
- {t.swatches.map((c) => ( - - ))} - -
-
- ); - })} -
-
- -
- {shown.map((row, i) => ( - setOpenKey(`${row.id}-${row.theme}`)} + {data === 'real' ? ( + [ + String(i), + `${i * PAGE_SIZE + 1}–${Math.min((i + 1) * PAGE_SIZE, realCases.length)}`, + ])} + onChange={(value) => setPage(Number(value))} /> - ))} -
- - {open && setOpenKey(null)} />} + ) : ( + [f, `${f} (${R2_CASES.filter((c) => c.family === f).length})`])} + onChange={setFamily} + /> + )} + - {shown.length === 0 && ( -

- No hand-authored specs for this theme yet. -

- )} + {cases.map((c) => ( + + ))} -
+ {open && setOpen(null)} />}
); } - -function filterBtn(active: boolean): React.CSSProperties { - return { - fontSize: 12, - padding: '4px 12px', - borderRadius: 999, - border: `1px solid ${active ? siteTheme.accent : siteTheme.border}`, - background: active ? siteTheme.accentBg : 'transparent', - color: active ? siteTheme.accent : siteTheme.text, - cursor: 'pointer', - }; -} diff --git a/site/src/playground/ThemeLabR2Cell.tsx b/site/src/playground/ThemeLabCell.tsx similarity index 69% rename from site/src/playground/ThemeLabR2Cell.tsx rename to site/src/playground/ThemeLabCell.tsx index 06fffc58..de343baa 100644 --- a/site/src/playground/ThemeLabR2Cell.tsx +++ b/site/src/playground/ThemeLabCell.tsx @@ -2,10 +2,10 @@ // Licensed under the MIT License. /** - * A single (case × column) cell of the round-2 theme grid. It compiles its - * spec — Flint's default, or one house's ThemeSpec on top of it — the first - * time it scrolls into view, so a page of 80-odd cases across seven columns - * pays only for the panels a reader is actually looking at. + * A single (case × column) cell of the theme lab grid. It compiles its spec — + * Flint's default, or one house's ThemeSpec on top of it — the first time it + * scrolls into view, so a page of cases across every house pays only for the + * panels a reader is actually looking at. */ import { useEffect, useMemo, useRef, useState } from 'react'; @@ -13,17 +13,16 @@ import { THEME_PRESETS, assembleVegaLite, assemblePlotly, type ChartAssemblyInpu import { FlintView } from '../components/FlintView'; import { ScaleToFit } from '../components/ScaleToFit'; import { siteTheme } from '../shared/theme'; -import { r2Input, type R2Case } from './theme-lab-r2-data'; /** Which assembler a column is drawn with. Both read the same ThemeSpec. */ export type LabBackend = 'vegalite' | 'plotly'; -export const R2_COLUMNS = ['flint', ...Object.keys(THEME_PRESETS)] as const; -export type R2Column = (typeof R2_COLUMNS)[number]; +export const LAB_COLUMNS = ['flint', ...Object.keys(THEME_PRESETS)] as const; +export type LabColumn = (typeof LAB_COLUMNS)[number]; /** Tile geometry — fixed so a chart is never flex-shrunk below legibility. */ -export const R2_TILE_WIDTH = 320; -const R2_TILE_HEIGHT = 320; +const TILE_WIDTH = 320; +const TILE_HEIGHT = 320; interface Compiled { input?: ChartAssemblyInput; @@ -33,9 +32,8 @@ interface Compiled { } /** Compiled here only for the tile's paper colour and report count; the chart compiles itself. */ -function compileCell(c: R2Case, column: R2Column, backend: LabBackend): Compiled { +function compileCell(base: ChartAssemblyInput, column: LabColumn, backend: LabBackend): Compiled { try { - const base = r2Input(c); const themeId = column === 'flint' ? null : column; const input = themeId ? { ...base, theme_spec: (THEME_PRESETS as any)[themeId].spec } @@ -59,14 +57,18 @@ function compileCell(c: R2Case, column: R2Column, backend: LabBackend): Compiled } } -export function R2Cell({ - c, +export function LabCell({ + input, column, backend = 'vegalite', + onRef, }: { - c: R2Case; - column: R2Column; + /** The case's assembly input without a theme. */ + input: ChartAssemblyInput; + column: LabColumn; backend?: LabBackend; + /** Set when a hand-made redesign exists for this case and house: opens it. */ + onRef?: () => void; }) { const ref = useRef(null); const [visible, setVisible] = useState(false); @@ -88,16 +90,16 @@ export function R2Cell({ }, []); const built = useMemo( - () => (visible ? compileCell(c, column, backend) : null), - [visible, c, column, backend], + () => (visible ? compileCell(input, column, backend) : null), + [visible, input, column, backend], ); return (
- {column} + + {column} + {onRef ? ( + + ) : null} + {built && !built.error ? ( {built.reportCount} notes ) : null} @@ -121,7 +145,7 @@ export function R2Cell({
) : ( - + )} diff --git a/site/src/playground/ThemeLabR2.tsx b/site/src/playground/ThemeLabR2.tsx deleted file mode 100644 index c2c366ea..00000000 --- a/site/src/playground/ThemeLabR2.tsx +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * Theme lab — round 2 (coverage). - * - * One row per gallery case, seven columns: Flint's default plus every house. - * There is no hand-authored column here — at this corpus size there cannot be - * (doc 05). The page is an inspection surface: does the compiler produce - * anything broken, illegible or absurd on a chart nobody tuned it against, and - * is the house still recognisable. - * - * Cases are paged by family so the DOM never holds more than one family at a - * time, and each cell compiles only when it scrolls into view. - */ - -import { useState, type ReactNode } from 'react'; -import { siteTheme } from '../shared/theme'; -import { - R2_CASES, - R2_FAMILY_ORDER, - type R2Case, - type R2Family, -} from './theme-lab-r2-data'; -import { R2Cell, R2_COLUMNS, type LabBackend } from './ThemeLabR2Cell'; - -function byFamily(family: R2Family): R2Case[] { - return R2_CASES.filter((c) => c.family === family); -} - -function Pill({ children }: { children: ReactNode }) { - return ( - - {children} - - ); -} - -/** - * The same ThemeSpec is realized by two backends. Switching between them is - * the whole point of the lab: a house that only looks right in one of them is - * a gap in the shared decisions, not a rendering detail. - */ -export function BackendSwitch({ - value, - onChange, -}: { - value: LabBackend; - onChange: (b: LabBackend) => void; -}) { - return ( -
- backend - {(['vegalite', 'plotly'] as const).map((b) => { - const active = b === value; - return ( - - ); - })} -
- ); -} - -function Row({ c, backend }: { c: R2Case; backend: LabBackend }) { - return ( -
-
-
- {c.id} · {c.title} - {c.subtitle ? ( - — {c.subtitle} - ) : null} -
-
- {c.gen} - probe: {c.probe} -
-
-
- {R2_COLUMNS.map((col) => ( - - ))} -
-
- ); -} - -export function ThemeLabR2() { - const [family, setFamily] = useState(R2_FAMILY_ORDER[0]); - const [backend, setBackend] = useState('vegalite'); - const cases = byFamily(family); - - return ( -
-
-

- Theme lab · round 2 (coverage) -

- -
- - - - {cases.map((c) => ( - - ))} -
- ); -} diff --git a/site/src/playground/ThemeLabReal.tsx b/site/src/playground/ThemeLabReal.tsx deleted file mode 100644 index 6613ee5b..00000000 --- a/site/src/playground/ThemeLabReal.tsx +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * Theme lab — real data. - * - * The R2 page drives the houses with synthetic gallery generators (clean - * cardinalities, tidy labels). This page drives them with the *real-world* - * datasets in `shared/preview-cases.ts` (the r1 theme-lab set): real category - * names, real distributions, negatives and long labels. It is the browser twin - * of the `audit-out/real/` contact sheets (`scripts/theme-real.ts`). - * - * One row per case, eight columns: Flint's default plus every house. Only the - * cases the chosen backend has a template for are shown. The - * corpus is chunked into fixed-size pages so the DOM never holds more than a - * handful of rows, and each cell compiles only when it scrolls into view. - */ - -import { useState, type ReactNode } from 'react'; -import { vlGetTemplateDef, plGetTemplateDef } from 'flint-chart'; -import { siteTheme } from '../shared/theme'; -import { PREVIEW_CASES, type PreviewCase } from '../shared/preview-cases'; -import { RealCell, REAL_COLUMNS } from './ThemeLabRealCell'; -import { BackendSwitch } from './ThemeLabR2'; -import type { LabBackend } from './ThemeLabR2Cell'; - -/** The cases the chosen backend has a template for. */ -function casesFor(backend: LabBackend): PreviewCase[] { - const has = backend === 'plotly' ? plGetTemplateDef : vlGetTemplateDef; - return PREVIEW_CASES.filter((c) => has(c.chartType)); -} - -const PAGE_SIZE = 6; - -function Pill({ children }: { children: ReactNode }) { - return ( - - {children} - - ); -} - -function Row({ c, backend }: { c: PreviewCase; backend: LabBackend }) { - return ( -
-
-
- {c.id} · {c.title} -
- {c.blurb ? ( -
{c.blurb}
- ) : null} -
- {c.chartType} - {c.source ? src: {c.source} : null} -
-
-
- {REAL_COLUMNS.map((col) => ( - - ))} -
-
- ); -} - -export function ThemeLabReal() { - const [page, setPage] = useState(0); - const [backend, setBackend] = useState('vegalite'); - const realCases = casesFor(backend); - const pageCount = Math.ceil(realCases.length / PAGE_SIZE); - const safePage = Math.min(page, Math.max(0, pageCount - 1)); - const start = safePage * PAGE_SIZE; - const cases = realCases.slice(start, start + PAGE_SIZE); - - return ( -
-
-

- Theme lab · real data{' '} - - ({realCases.length} cases) - -

- -
- - - - {cases.map((c) => ( - - ))} -
- ); -} diff --git a/site/src/playground/ThemeLabRealCell.tsx b/site/src/playground/ThemeLabRealCell.tsx deleted file mode 100644 index 06a8e155..00000000 --- a/site/src/playground/ThemeLabRealCell.tsx +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * A single (real-dataset case × column) cell of the real-data theme grid. Same - * lazy-compile discipline as `ThemeLabR2Cell`: it assembles its spec — Flint's - * default, or one house's ThemeSpec on top — only the first time it scrolls - * into view, so a page of real-world cases across eight columns pays only for - * the panels a reader is actually looking at. - * - * The input mirrors `scripts/theme-real.ts` `inputFor` (and `ThemeLab.tsx`), so - * a cell here shows exactly what the `audit-out/real/` contact sheets show. - */ - -import { useEffect, useMemo, useRef, useState } from 'react'; -import { THEME_PRESETS, assembleVegaLite, assemblePlotly, type ChartAssemblyInput } from 'flint-chart'; -import { FlintView } from '../components/FlintView'; -import { ScaleToFit } from '../components/ScaleToFit'; -import { siteTheme } from '../shared/theme'; -import type { PreviewCase } from '../shared/preview-cases'; -import type { LabBackend } from './ThemeLabR2Cell'; - -export const REAL_COLUMNS = ['flint', ...Object.keys(THEME_PRESETS)] as const; -export type RealColumn = (typeof REAL_COLUMNS)[number]; - -/** Tile geometry — fixed so a chart is never flex-shrunk below legibility. */ -export const REAL_TILE_WIDTH = 320; -const REAL_TILE_HEIGHT = 320; - -/** Assembly input for a real case — mirrors `scripts/theme-real.ts` `inputFor`. */ -export function realInput(c: PreviewCase): any { - return { - data: { values: c.data }, - semantic_types: c.semantic_types, - chart_spec: { - chartType: c.chartType, - title: c.title, - encodings: c.encodings, - baseSize: { width: 300, height: 300 }, - ...(c.chartProperties ? { chartProperties: c.chartProperties } : {}), - }, - }; -} - -interface Compiled { - input?: ChartAssemblyInput; - background: string; - error?: string; - reportCount: number; -} - -/** Compiled here only for the tile's paper colour and report count; the chart compiles itself. */ -function compileCell(c: PreviewCase, column: RealColumn, backend: LabBackend): Compiled { - try { - const base = realInput(c); - const themeId = column === 'flint' ? null : column; - const input = themeId - ? { ...base, theme_spec: (THEME_PRESETS as any)[themeId].spec } - : base; - - if (backend === 'plotly') { - const figure = assemblePlotly(input as any) as any; - return { - input, - reportCount: figure._theme?.report?.length ?? 0, - background: typeof figure.layout?.paper_bgcolor === 'string' - ? figure.layout.paper_bgcolor - : '#ffffff', - }; - } - - const spec = assembleVegaLite(input as any) as any; - const reportCount = spec._theme?.report?.length ?? 0; - const background = typeof spec.background === 'string' ? spec.background : '#ffffff'; - return { input, background, reportCount }; - } catch (err) { - return { background: '#ffe8e8', error: (err as Error).message, reportCount: 0 }; - } -} - -export function RealCell({ - c, - column, - backend = 'vegalite', -}: { - c: PreviewCase; - column: RealColumn; - backend?: LabBackend; -}) { - const ref = useRef(null); - const [visible, setVisible] = useState(false); - - useEffect(() => { - const el = ref.current; - if (!el) return; - const observer = new IntersectionObserver( - ([entry]) => { - if (entry.isIntersecting) { - setVisible(true); - observer.disconnect(); - } - }, - { rootMargin: '300px' }, - ); - observer.observe(el); - return () => observer.disconnect(); - }, []); - - const built = useMemo( - () => (visible ? compileCell(c, column, backend) : null), - [visible, c, column, backend], - ); - - return ( -
-
- {column} - {built && !built.error ? ( - {built.reportCount} notes - ) : null} -
-
- {!built ? ( -
- … -
- ) : built.error ? ( -
- {built.error} -
- ) : ( - - - - )} -
-
- ); -} diff --git a/site/src/playground/ThemeLabRedesign.tsx b/site/src/playground/ThemeLabRedesign.tsx new file mode 100644 index 00000000..c886e4bc --- /dev/null +++ b/site/src/playground/ThemeLabRedesign.tsx @@ -0,0 +1,605 @@ +import { useEffect, useMemo, useState } from 'react'; +import { VegaLiteView } from '../components/VegaLiteView'; +import { ScaleToFit } from '../components/ScaleToFit'; +import { siteTheme } from '../shared/theme'; +import { THEME_PRESETS, assembleVegaLite, vlGetTemplateDef } from 'flint-chart'; +import { PREVIEW_CASES } from '../shared/preview-cases'; +import THEME_META from './theme-lab-assets/_themes.json'; +import HEADLINES from './theme-lab-assets/_headlines.json'; +import THEME_SPECS from './theme-lab-assets/_themespecs.json'; + +/** + * Hand-authored redesigns for the theme lab: for a real case and a house, Flint's default, the redesign a human + * wrote by hand (`theme-lab-assets/..json`, the reference), and the same chart compiled from the house's + * ThemeSpec. The lab's grid marks the cells that have one; `DetailModal` shows the three side by side with the + * design argument and the raw specs. + */ + +type ThemeId = keyof typeof THEME_META.themes; + +interface ThemeMeta { + label: string; + alias: string; + surface: string; + ink: string; + accent: string; + swatches: string[]; + intent: string; + signature: string[]; +} + +interface FlintIndexEntry { + id: string; + chartType: string; + title: string; + subtitle: string; + source: string; + rows: number; +} + +const THEMES = THEME_META.themes as unknown as Record; +const THEME_ORDER = THEME_META.order as ThemeId[]; +const HEADLINE_MAP = HEADLINES.headlines as Record; + +// Column 2, and only column 2. `..json` is the hand-authored +// redesign; nothing else in this folder is read by the page. +const MANUAL_MODULES = import.meta.glob('./theme-lab-assets/*.json', { eager: true }) as Record< + string, + { default: any } +>; + +interface ThemeReport { + stage: 'ground' | 'realize'; + path: string; + message: string; +} + +export interface LabRow { + id: string; + chartType: string; + title: string; + source: string; + rows: number; + theme: ThemeId; + flintSpec: any; + themedSpec: any; + compiledSpec?: any; + compiledReport: ThemeReport[]; + design: string[]; +} + +/** + * Flint's `_`-prefixed bookkeeping (`_options`, `_width`, `_theme`) is not part + * of the Vega-Lite the reader is meant to see. A double underscore is + * load-bearing (`__geo_id` is a choropleth join key) and stays. + */ +function stripInternal(node: any): void { + if (!node || typeof node !== 'object') return; + if (Array.isArray(node)) { + node.forEach(stripInternal); + return; + } + for (const key of Object.keys(node)) { + if (/^_[^_]/.test(key)) delete node[key]; + else stripInternal(node[key]); + } +} + +/** + * The assembly input for a case, built the same way for both compiled columns — + * the only difference between them is whether a ThemeSpec is attached, which is + * the whole point of the comparison. + */ +function inputFor(c: (typeof PREVIEW_CASES)[number]): any { + const headline = HEADLINE_MAP[c.id] ?? { title: c.title }; + return { + data: { values: c.data }, + semantic_types: c.semantic_types, + chart_spec: { + chartType: c.chartType, + title: headline.title, + ...(headline.subtitle ? { subtitle: headline.subtitle } : {}), + encodings: c.encodings, + baseSize: { width: 340, height: 230 }, + ...(c.chartProperties ? { chartProperties: c.chartProperties } : {}), + }, + }; +} + +const CASE_INDEX: FlintIndexEntry[] = PREVIEW_CASES + .filter((c) => vlGetTemplateDef(c.chartType)) + .map((c) => { + const headline = HEADLINE_MAP[c.id] ?? { title: c.title }; + return { + id: c.id, + chartType: c.chartType, + title: headline.title, + subtitle: headline.subtitle ?? '', + source: c.source, + rows: c.data.length, + }; + }); + +function computeRows(): LabRow[] { + // One row per (id, theme). A case may carry several hand-authored themes — + // replicating one chart across every language is the only way to tell what + // the language decided from what the chart forced. + const manualById = new Map(); + for (const [path, mod] of Object.entries(MANUAL_MODULES)) { + const file = path.split('/').pop()!; + if (file.startsWith('_')) continue; + const match = /^(.*)\.([a-z0-9-]+)\.json$/.exec(file); + if (!match || !(match[2] in THEMES)) continue; + manualById.set(match[1], [...(manualById.get(match[1]) ?? []), mod.default]); + } + + const caseById = new Map(PREVIEW_CASES.map((c) => [c.id, c])); + const meta = new Map(CASE_INDEX.map((e) => [e.id, e])); + const rows: LabRow[] = []; + + for (const [id, manualList] of manualById) { + const c = caseById.get(id); + if (!c || !vlGetTemplateDef(c.chartType)) continue; + const input = inputFor(c); + const info = meta.get(id); + + let flint: any; + try { + flint = assembleVegaLite(input) as any; + stripInternal(flint); + } catch (err) { + console.error(`theme lab: ${id} failed to compile —`, (err as Error).message); + continue; + } + + for (const manual of manualList) { + const theme = manual.__theme__ as ThemeId; + const preset = (THEME_PRESETS as any)[theme]; + let compiled: any; + let report: ThemeReport[] = []; + try { + compiled = assembleVegaLite({ ...input, theme_spec: preset?.spec }) as any; + report = compiled._theme?.report ?? []; + stripInternal(compiled); + } catch (err) { + console.error(`theme lab: ${id}.${theme} failed to compile —`, (err as Error).message); + compiled = undefined; + } + rows.push({ + id, + chartType: info?.chartType ?? '—', + title: info?.title ?? id, + source: info?.source ?? '', + rows: info?.rows ?? 0, + theme, + flintSpec: flint, + themedSpec: manual, + compiledSpec: compiled, + compiledReport: report, + design: (manual.__design__ as string[]) ?? [], + }); + } + } + // Group by case so a fully replicated set sits together on the wall. + return rows.sort( + (a, b) => a.id.localeCompare(b.id) || THEME_ORDER.indexOf(a.theme) - THEME_ORDER.indexOf(b.theme), + ); +} + +// Compiling every case twice is cheap, but not cheap enough to do it once per +// call site. One pass per module load. +let ROWS_CACHE: LabRow[] | null = null; +export function buildRows(): LabRow[] { + if (!ROWS_CACHE) ROWS_CACHE = computeRows(); + return ROWS_CACHE; +} + +/** Redesigns by case id, then by house. */ +export function redesignsByCase(): Map> { + const byCase = new Map>(); + for (const row of buildRows()) { + if (!byCase.has(row.id)) byCase.set(row.id, new Map()); + byCase.get(row.id)!.set(row.theme as string, row); + } + return byCase; +} + +/** Vega-Lite ignores unknown top-level keys, but strip ours anyway. */ +function cleanSpec(spec: any): any { + const out: any = {}; + for (const [k, v] of Object.entries(spec)) { + if (!k.startsWith('__')) out[k] = v; + } + return out; +} + +function ThemeChip({ theme }: { theme: ThemeId }) { + const t = THEMES[theme]; + return ( + + + {t.label} + {t.alias} + + ); +} + +function SpecCell({ spec, dark, label }: { spec: any; dark: boolean; label: string }) { + const cleaned = useMemo(() => cleanSpec(spec), [spec]); + return ( +
+
+ {label} +
+
+ + + +
+
+ ); +} + +type CoverageStatus = 'full' | 'partial' | 'blocked'; +interface CoverageEntry { + status: CoverageStatus; + notes: string[]; +} + +const THEMESPEC_BY_THEME = Object.fromEntries( + Object.entries(THEME_PRESETS).map(([id, preset]) => [id, preset.spec]), +) as Record; +const THEMESPEC_COVERAGE = THEME_SPECS.coverage as unknown as Record; + +/** How many charts each single ThemeSpec is on the hook for. */ +const ROWS_PER_THEME: Record = buildRows().reduce>((acc, r) => { + acc[r.theme as string] = (acc[r.theme as string] ?? 0) + 1; + return acc; +}, {}); + +const COVERAGE_INK: Record = { + full: '#2d8659', + partial: '#b7791f', + blocked: '#c0392b', +}; + +const COVERAGE_LABEL: Record = { + full: 'expressible', + partial: 'partly expressible', + blocked: 'not expressible', +}; + +/** Full-size pair, the design argument, and both raw specs. */ +export function DetailModal({ row, onClose }: { row: LabRow; onClose: () => void }) { + const [showSpec, setShowSpec] = useState(false); + const [showThemeSpec, setShowThemeSpec] = useState(false); + const t = THEMES[row.theme]; + const themeSpec = THEMESPEC_BY_THEME[row.theme as string]; + const coverage: CoverageEntry = THEMESPEC_COVERAGE[row.id] ?? { status: 'full', notes: [] }; + const flint = useMemo(() => cleanSpec(row.flintSpec), [row.flintSpec]); + const themed = useMemo(() => cleanSpec(row.themedSpec), [row.themedSpec]); + const compiled = useMemo( + () => (row.compiledSpec ? cleanSpec(row.compiledSpec) : null), + [row.compiledSpec], + ); + + useEffect(() => { + const onKey = (e: KeyboardEvent) => { + if (e.key === 'Escape') onClose(); + }; + window.addEventListener('keydown', onKey); + return () => window.removeEventListener('keydown', onKey); + }, [onClose]); + + return ( +
+
e.stopPropagation()} + style={{ + width: 'min(100%, 1180px)', + background: siteTheme.surface, + border: `1px solid ${siteTheme.border}`, + borderRadius: 10, + padding: 20, + }} + > +
+ + + {row.id} + + + {row.chartType} · {row.rows} rows + + + + +
+ +
+ + + {compiled ? ( + + ) : ( +
+ 3 · not compiled +
+ )} +
+ + {row.compiledReport.length > 0 && ( + <> +

+ What the compiler had to give up ({row.compiledReport.length}) +

+
    + {row.compiledReport.map((r, i) => ( +
  • + + {r.stage} + {' '} + {r.path}{' '} + — {r.message} +
  • + ))} +
+ + )} + +

+ What had to change ({row.design.length}) +

+
    + {row.design.map((d, i) => ( +
  1. + {d} +
  2. + ))} +
+ + {showThemeSpec && ( +
+

+ ThemeSpec · {t.label} +

+

+ One spec per design language, not one per chart. This is the whole of {t.label} — + the same object is what would have to produce all {' '} + {ROWS_PER_THEME[row.theme] ?? 0} of its charts in this lab. Written against{' '} + + themespec.v12 + + . +

+
+ + {COVERAGE_LABEL[coverage.status]} + + + for {row.id} + +
+ {coverage.notes.length > 0 && ( +
    + {coverage.notes.map((n, i) => ( +
  • + {n} +
  • + ))} +
+ )} +
{JSON.stringify(themeSpec, null, 2)}
+
+ )} + + {showSpec && ( +
+
{JSON.stringify(row.flintSpec, null, 2)}
+
{JSON.stringify(row.themedSpec, null, 2)}
+
+ )} +
+
+ ); +} + +const specPre: React.CSSProperties = { + margin: 0, + maxHeight: 340, + overflow: 'auto', + fontFamily: siteTheme.fontMono, + fontSize: 10.5, + lineHeight: 1.45, + background: '#fafafa', + border: `1px solid ${siteTheme.border}`, + borderRadius: 6, + padding: 10, + color: siteTheme.text, +}; diff --git a/site/src/playground/TitleBalanceLab.tsx b/site/src/playground/TitleBalanceLab.tsx new file mode 100644 index 00000000..65a8bf43 --- /dev/null +++ b/site/src/playground/TitleBalanceLab.tsx @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Debug lab for a chart of few x bands drawn much narrower than its title, after the fix: both +// levers on — `sparseFill` grows the bands until the plot fills a share of its room (capped per +// mark), and `titleWrap` wraps a themed title to the drawing instead of the canvas (with a floor). +// Each case renders at every chosen base size and stretch ratio, so tight bases can be read against +// roomy ones. Each tile reports the drawn title and chart widths, measured from the rendered SVG. + +import { useEffect, useMemo, useRef, useState } from 'react'; +import { THEME_PRESETS, assembleVegaLite, type ChartAssemblyInput } from 'flint-chart'; +import { FlintView } from '../components/FlintView'; +import { siteTheme } from '../shared/theme'; +import realCases from './title-balance-cases.json'; + +type Kind = 'bar' | 'strip' | 'grouped' | 'hbar'; + +interface Size { + width: number; + height: number; +} + +interface Settings { + theme: string; + kind: Kind; + sizes: string[]; + stretches: number[]; +} + +interface Case { + id: string; + label: string; + input: ChartAssemblyInput; +} + +const SIZES: Record = { + '240×180': { width: 240, height: 180 }, + '320×240': { width: 320, height: 240 }, + '400×300': { width: 400, height: 300 }, + '480×320': { width: 480, height: 320 }, + '560×360': { width: 560, height: 360 }, + '640×400': { width: 640, height: 400 }, +}; +const STRETCHES = [1.2, 1.5]; +const DEFAULTS: Settings = { theme: 'economist', kind: 'bar', sizes: ['320×240', '400×300', '560×360'], stretches: [1.2] }; +const THEMES = ['flint', ...Object.keys(THEME_PRESETS)]; +const TITLE = 'Nov 3, 2007 was deadliest; Christmas was safest on average'; +const SUBTITLE = 'US traffic fatalities per day: single-day maximum vs. calendar-date average, 1992–2016'; +const NAMES = ['Deadliest single day', 'Safest calendar date', 'Median weekday', 'New Year’s Day', 'Independence Day', 'Labor Day', 'Thanksgiving', 'Memorial Day', 'Halloween', 'Easter']; +const COUNTS = [1, 2, 3, 4, 6, 10]; + +function prepare(input: ChartAssemblyInput, settings: Settings): ChartAssemblyInput { + const preset = settings.theme === 'flint' ? undefined : (THEME_PRESETS as any)[settings.theme]; + const { theme_spec: _drop, ...rest } = input as any; + return { ...rest, ...(preset ? { theme_spec: preset.spec } : {}) }; +} + +function synthetic(settings: Settings, count: number): Case { + const names = NAMES.slice(0, count); + const chart_spec: any = { title: TITLE, subtitle: SUBTITLE }; + let values: any[]; + if (settings.kind === 'strip') { + values = names.flatMap((name, i) => Array.from({ length: 60 }, (_, k) => ({ Day: name, Deaths: 80 + ((k * 37 + i * 11) % 220) }))); + Object.assign(chart_spec, { chartType: 'Strip Plot', encodings: { x: { field: 'Day' }, y: { field: 'Deaths' } } }); + } else if (settings.kind === 'grouped') { + values = names.flatMap((name, i) => ['2015', '2016'].map((year, j) => ({ Day: name, Year: year, Deaths: 110 + ((i * 53 + j * 29) % 190) }))); + Object.assign(chart_spec, { chartType: 'Grouped Bar Chart', encodings: { x: { field: 'Day' }, y: { field: 'Deaths' }, group: { field: 'Year' } } }); + } else { + values = names.map((name, i) => ({ Day: name, Deaths: 112 + ((i * 61) % 187) })); + Object.assign(chart_spec, { + chartType: 'Bar Chart', + encodings: settings.kind === 'hbar' ? { y: { field: 'Day' }, x: { field: 'Deaths' } } : { x: { field: 'Day' }, y: { field: 'Deaths' } }, + chartProperties: { showValueLabels: true }, + }); + } + return { + id: `syn-${settings.kind}-${count}`, + label: `${settings.kind} · ${count} ${count === 1 ? 'band' : 'bands'}`, + input: { data: { values }, semantic_types: { Day: 'Category', Year: 'Category', Deaths: 'Count' }, chart_spec } as any, + }; +} + +/** The case at one base size and stretch ratio, with both levers on. */ +function variant(input: ChartAssemblyInput, size: Size, stretch: number): ChartAssemblyInput { + return { + ...input, + chart_spec: { ...(input as any).chart_spec, baseSize: size }, + options: { ...(input as any).options, maxStretch: stretch, sparseFill: true, titleWrap: true }, + } as ChartAssemblyInput; +} + +interface Measured { + title: number; + chart: number; + width: number; + height: number; +} + +/** Sizes as drawn, in the chart's own px: the title block, the axes, marks and keys under it, and the whole drawing. */ +function measure(root: HTMLElement): Measured | undefined { + const svg = root.querySelector('svg.marks') as SVGSVGElement | null; + if (!svg) return undefined; + const width = svg.width.baseVal.value || svg.getBoundingClientRect().width; + const height = svg.height.baseVal.value || svg.getBoundingClientRect().height; + const scale = svg.getBoundingClientRect().width / width || 1; + const span = (nodes: Element[]) => { + let lo = Infinity, hi = -Infinity; + for (const node of nodes) { + const box = node.getBoundingClientRect(); + if (box.width <= 0) continue; + lo = Math.min(lo, box.left); + hi = Math.max(hi, box.right); + } + return hi > lo ? (hi - lo) / scale : 0; + }; + const title = span([...svg.querySelectorAll('g.role-title-text, g.role-title-subtitle')]); + const chart = span([...svg.querySelectorAll('g.role-axis, g.role-legend, g.role-mark')].filter((node) => !node.closest('g.role-title'))); + return { title, chart, width, height }; +} + +function compiled(input: ChartAssemblyInput): { step?: number; lines?: number } { + try { + const spec: any = assembleVegaLite(input); + const width = spec?.width ?? spec?.spec?.width; + const text = spec?.title?.text; + return { step: typeof width === 'object' && width ? width.step : undefined, lines: Array.isArray(text) ? text.length : text ? 1 : 0 }; + } catch { + return {}; + } +} + +function Tile({ input, label, size, stretch }: { input: ChartAssemblyInput; label: string; size: Size; stretch: number }) { + const root = useRef(null); + const [measured, setMeasured] = useState(); + const facts = useMemo(() => compiled(input), [input]); + // Overlays settle and fonts load after mount; measure a few times after each change. + useEffect(() => { + setMeasured(undefined); + let ticks = 0; + const timer = window.setInterval(() => { + if (root.current) setMeasured(measure(root.current)); + if (++ticks >= 8) window.clearInterval(timer); + }, 400); + return () => window.clearInterval(timer); + }, [input]); + const ratio = measured && measured.title ? measured.chart / measured.title : undefined; + const ratioInk = ratio === undefined ? siteTheme.textMuted : ratio >= 0.8 ? '#1a7f37' : ratio >= 0.6 ? '#9a6700' : siteTheme.error; + // The drawing against its base, and against the most it may stretch to. + const grow = measured ? { w: measured.width / size.width, h: measured.height / size.height } : undefined; + const over = grow && (grow.w > stretch + 0.01 || grow.h > stretch + 0.01); + return ( +
+
{label}
+
+ {/* The base box and the stretch ceiling, for scale. */} +
+
+
+ +
+
+
+ step {facts.step ?? '—'} + headline lines {facts.lines ?? '—'} + title {measured ? Math.round(measured.title) : '—'} + chart {measured ? Math.round(measured.chart) : '—'} + chart/title {ratio ? ratio.toFixed(2) : '—'} + + drawn {measured ? `${Math.round(measured.width)}×${Math.round(measured.height)}` : '—'} + {grow ? ` (${grow.w.toFixed(2)}× · ${grow.h.toFixed(2)}×)` : ''} + +
+
+ ); +} + +function Row({ item, settings }: { item: Case; settings: Settings }) { + const { sizes, stretches } = settings; + const tiles = useMemo(() => sizes.flatMap((key) => stretches.map((stretch) => ({ + key: `${key}-${stretch}`, + label: `${key} · stretch ${stretch}`, + size: SIZES[key]!, + stretch, + input: variant(item.input, SIZES[key]!, stretch), + }))), [item, sizes, stretches]); + return ( +
+

{item.label}

+
+ {tiles.map((tile) => )} +
+
+ ); +} + +function Chip({ label, on, onClick }: { label: string; on: boolean; onClick: () => void }) { + return ( + + ); +} + +function Select({ label, value, options, onChange }: { label: string; value: T; options: readonly T[]; onChange: (value: T) => void }) { + return ( + + ); +} + +/** Toggle one value in a chip set, keeping the set's order and at least one value. */ +function toggled(all: readonly T[], chosen: T[], value: T): T[] { + const next = chosen.includes(value) ? chosen.filter((item) => item !== value) : [...chosen, value]; + return next.length ? all.filter((item) => next.includes(item)) : chosen; +} + +export function TitleBalanceLab() { + const [settings, setSettings] = useState(DEFAULTS); + const patch = (next: Partial) => setSettings((current) => ({ ...current, ...next })); + const real = useMemo(() => (realCases as any[]).map((item) => ({ id: item.id, label: item.label, input: prepare(item.input, settings) })), [settings.theme]); + const sweep = useMemo(() => COUNTS.map((count) => { + const item = synthetic(settings, count); + return { ...item, input: prepare(item.input, settings) }; + }), [settings.theme, settings.kind]); + + return ( +
+
+

Title balance lab

+

+ After the fix, with sparseFill (few x bands thicken until the drawing spans 85% of its room, at most 200px a band of bars or 360px of points) + and titleWrap (a themed title wraps to the drawing, overhanging it by at most 15%, never under 320px or 60% of the canvas) on. + Each case renders at every chosen base size and stretch ratio: the dashed box is the base, the dotted box the base × stretch; drawn turns red past the stretch ceiling. +

+
+ +
+
+ Base size + {Object.keys(SIZES).map((key) => ( + patch({ sizes: toggled(Object.keys(SIZES), settings.sizes, key) })} /> + ))} + + Stretch + {STRETCHES.map((stretch) => ( + patch({ stretches: toggled(STRETCHES, settings.stretches, stretch) })} /> + ))} +
+
+ patch({ kind })} /> +
+
+ +

Runs from the annotation review

+ {real.map((item) => )} + +

Sweep: band count

+ {sweep.map((item) => )} +
+ ); +} diff --git a/site/src/playground/TitleWrapLab.tsx b/site/src/playground/TitleWrapLab.tsx new file mode 100644 index 00000000..c0f6f3d8 --- /dev/null +++ b/site/src/playground/TitleWrapLab.tsx @@ -0,0 +1,333 @@ +import { useMemo, useState } from 'react'; +import type { ChartAssemblyInput } from 'flint-chart'; +import { filledLines, type TitleMeasure } from '../../../packages/flint-js/src/core/title-fit'; +import { ScaleToFit } from '../components/ScaleToFit'; +import { FlintView } from '../components/FlintView'; +import { gapminderRows } from './gapminder-dashboard-data'; +import './title-wrap-lab.css'; + +const WIDOW_SHARE = 1 / 3; + +/** Fill alone: each line filled to the block, the words that do not fit falling to the next. */ +function greedyLines(text: string, block: number, fontSize: number, measure: TitleMeasure): string[] { + const words = text.split(/\s+/).filter(Boolean); + if (words.length <= 1) return [text]; + const lines: string[] = []; + let line = ''; + for (const word of words) { + const candidate = line ? `${line} ${word}` : word; + if (line && measure(candidate, fontSize) > block) { + lines.push(line); + line = word; + } else { + line = candidate; + } + } + if (line) lines.push(line); + return lines; +} + +/** Pull words down: fill, then move words from the lines above into a widow until it is a third of the block. */ +function pulledLines(text: string, block: number, fontSize: number, measure: TitleMeasure): string[] { + const lines = greedyLines(text, block, fontSize, measure).map((line) => line.split(' ')); + const width = (words: string[]) => measure(words.join(' '), fontSize); + if (lines.length < 2 || width(lines[lines.length - 1]) >= block * WIDOW_SHARE) return lines.map((words) => words.join(' ')); + // From the bottom up: each line takes words from the one above until it is long enough. + for (let k = lines.length - 1; k > 0; k--) { + while (width(lines[k]) < block * WIDOW_SHARE && lines[k - 1].length > 1) { + const word = lines[k - 1][lines[k - 1].length - 1]; + if (width([word, ...lines[k]]) > block) break; + lines[k].unshift(lines[k - 1].pop()!); + } + if (width(lines[k - 1]) >= block * WIDOW_SHARE) break; + } + return lines.map((words) => words.join(' ')); +} + +/** The rule before: fill to the block, then even only the last two lines when the last is a widow. */ +function previousFilledLines(text: string, block: number, fontSize: number, measure: TitleMeasure): string[] { + const words = text.split(/\s+/).filter(Boolean); + if (words.length <= 1) return [text]; + const lines: string[] = []; + let line = ''; + for (const word of words) { + const candidate = line ? `${line} ${word}` : word; + if (line && measure(candidate, fontSize) > block) { + lines.push(line); + line = word; + } else { + line = candidate; + } + } + if (line) lines.push(line); + if (lines.length >= 2 && measure(lines[lines.length - 1], fontSize) < block * WIDOW_SHARE) { + const tail = previousBalanced(`${lines[lines.length - 2]} ${lines[lines.length - 1]}`, fontSize, measure); + lines.splice(lines.length - 2, 2, ...tail); + } + return lines; +} + +function previousBalanced(text: string, fontSize: number, measure: TitleMeasure): string[] { + const words = text.split(/\s+/).filter(Boolean); + const target = measure(text, fontSize) / 2; + const lines: string[] = []; + let line = ''; + for (const word of words) { + const candidate = line ? `${line} ${word}` : word; + if (line && lines.length < 1 && measure(candidate, fontSize) - target > target - measure(line, fontSize)) { + lines.push(line); + line = word; + } else { + line = candidate; + } + } + if (line) lines.push(line); + return lines; +} + +type Role = 'headline' | 'deck'; + +const FONT: Record = { + headline: { size: 22, weight: 700, family: "'Helvetica Neue', Helvetica, Arial, sans-serif" }, + deck: { size: 15, weight: 400, family: "'Helvetica Neue', Helvetica, Arial, sans-serif" }, +}; + +const canvas = typeof document !== 'undefined' ? document.createElement('canvas').getContext('2d') : null; + +function measureFor(role: Role): TitleMeasure { + const { weight, family } = FONT[role]; + return (text, fontSize) => { + if (!canvas) return text.length * fontSize * 0.55; + canvas.font = `${weight} ${fontSize}px ${family}`; + return canvas.measureText(text).width; + }; +} + +export interface TextCase { id: string; label: string; role: Role; text: string; note: string; block: number } + +const SNAPSHOT_DECK = 'GDP per capita (log scale) vs life expectancy, 2007; bubble size = population; X: GDP per capita ($, log scale); Y: Life expectancy (years)'; + +export const TEXT_CASES: TextCase[] = [ + { + id: 'snapshot-deck', label: 'Deck from the bubble chart', role: 'deck', text: SNAPSHOT_DECK, block: 440, + note: 'The reported case. Fill leaves a widow; the old rule evened the last two lines into one full line over two half lines. Now the room the last line needs is shared by the two lines above it.', + }, + { + id: 'long-deck', label: 'Long deck', role: 'deck', block: 260, + text: 'Share of adults who say they trust the national government to do what is right most of the time, by age group and country, 2010 to 2024; weighted survey responses, excluding don’t know', + note: 'The old fix only ever touched the last two lines; the room the last line needs is now taken across the lines above it.', + }, + { + id: 'headline-widow', label: 'Headline with a widow', role: 'headline', block: 320, + text: 'Wealthier countries live longer, but the gap is closing fast', + note: 'A headline follows the same rule as the deck.', + }, + { + id: 'headline-three', label: 'Three-line headline', role: 'headline', block: 480, + text: 'Electricity demand from data centres is set to double by the end of the decade, led by America', + note: 'Three lines at this width: the lines above the widow stay near the block edge rather than halving.', + }, + { + id: 'no-widow', label: 'Deck that fills without a widow', role: 'deck', block: 300, + text: 'Annual mean temperature anomaly relative to the 1951–1980 average, global land and ocean, degrees Celsius', + note: 'At this width the last line is long enough, so fill stands in every rule. Drag the width to find where a widow appears.', + }, + { + id: 'cjk', label: 'CJK deck', role: 'deck', block: 300, + text: '2007 年 各国 人均 GDP(对数刻度)与 预期寿命;气泡 大小 表示 人口;横轴:人均 GDP(美元);纵轴:预期寿命(岁)', + note: 'Breaks only fall at spaces, in every rule.', + }, +]; + +function widthsOf(lines: string[], role: Role): number[] { + const measure = measureFor(role); + return lines.map((line) => measure(line, FONT[role].size)); +} + +function Paragraph({ lines, role, block, label }: { lines: string[]; role: Role; block: number; label: string }) { + const widths = widthsOf(lines, role); + const spread = Math.max(...widths) - Math.min(...widths); + const font = FONT[role]; + return ( +
+
{label} · {lines.length} {lines.length === 1 ? 'line' : 'lines'} · spread {Math.round(spread)}px
+
+ {lines.map((line, index) => ( +
+ + {line} + {Math.round(widths[index])} +
+ ))} +
+
+ ); +} + +function TextComparison({ testCase }: { testCase: TextCase }) { + const [block, setBlock] = useState(testCase.block); + const measure = useMemo(() => measureFor(testCase.role), [testCase.role]); + const size = FONT[testCase.role].size; + const fill = greedyLines(testCase.text, block, size, measure); + const before = previousFilledLines(testCase.text, block, size, measure); + const pulled = pulledLines(testCase.text, block, size, measure); + const after = filledLines(testCase.text, block, size, measure); + const same = before.join('\n') === after.join('\n'); + return ( +
+
+

{testCase.label} {testCase.role}{same && unchanged}

+

{testCase.note}

+ +
+
+ + + + +
+
+ ); +} + +const bubbleRows = gapminderRows.filter((row) => row.Year === 2007); + +export function bubbleInput(width: number, subtitle: string): ChartAssemblyInput { + return { + data: { values: bubbleRows }, + semantic_types: { Country: 'Country', Continent: 'Category', Population: 'Quantity', 'Life expectancy': 'Quantity', 'GDP per capita': 'Quantity' }, + theme_spec: 'economist', + chart_spec: { + chartType: 'Scatter Plot', + title: 'Wealthier countries live longer', + subtitle, + encodings: { x: 'GDP per capita', y: 'Life expectancy', size: 'Population', color: 'Continent', detail: 'Country' }, + chartProperties: { logScale_x: true }, + baseSize: { width, height: 360 }, + }, + }; +} + +export const CHART_WIDTHS = [300, 380, 460]; +export const CHART_DECKS = [ + { id: 'snapshot', label: 'Deck as reported', text: SNAPSHOT_DECK }, + { id: 'long', label: 'Longer deck', text: 'GDP per capita in 2007 dollars (log scale) against life expectancy at birth, 142 countries, 2007; bubble size is population, colour is continent' }, +]; + +export function TitleWrapLab() { + const [deck, setDeck] = useState(CHART_DECKS[0].id); + const deckText = CHART_DECKS.find((d) => d.id === deck)!.text; + return ( +
+
+

Title wrap

+

How a headline and a deck that overhang their block are broken over lines: filledLines in flint-js/src/core/title-fit.ts.

+
+ +
+
+

Rule

+

+ Fill each line to the block. Where that leaves a widow, a last line under a third of the block, break the same number + of lines again as full as they can be with no widow. The block keeps its measure; only lines near the end give up room. +

+

+ One rule for the headline and the deck, from measured word widths and the block width alone. The line count is + fill’s, so the height taken from the plot does not change. +

+
+
+

How

+

+ A dynamic program over word boundaries: every line but the last is charged the square of the room it leaves on the + block; no line may pass the block and the last may not be a widow. Squaring spreads the room the last line needs over + the lines above it rather than emptying one of them. +

+

+ The established reference is the line-breaking cost TeX uses (Knuth–Plass). Later preferences, such as keeping + the parts of a deck Flint assembled whole, join as cost terms rather than branches. +

+
+
+ +
+

Approaches compared

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Problem it answersGoalApproachTradeoffReview
Before: even the last twoFill can leave a widowNo widowFill; on a widow, join the last two lines and split them near halfway, word by wordFrom three lines on, one full line over two half lines, split wherever halfway fallsA patch on fill’s output; each new case would be another branch
Tried: even them allThe jump the old fix leftNo widow, lines as even as possibleFill sets the line count; on a widow, a DP minimises each line’s squared distance from the averageThe paragraph turns narrower than the block, and a pixel of width flips it between full and evenSound mechanism, wrong goal: it works against fill
Considered: pull words downThe narrow paragraphNo widow, the most full linesFill; on a widow, move words down from the line above, then higher lines, until the last is long enoughThe line above takes the whole shortfall, so with long words it halves and repeats the old shape (see the long deck and the three-line headline); the result is defined by the loop, not an objectiveLocal repair; avoiding a bad break would need another rule in the loop
Now: fullest lines, no widowThe same, stated as one objectiveLines as full as possible, no widowFill sets the line count; on a widow, a DP minimises the squared room left on every line but the last, the last at least a thirdThe shortfall is shared over the lines near the end; a trace is needed to explain a breakOne objective with a reference; new preferences are cost terms
+
+
+ +
+

Line breaks, before and after

+

The grey bar under each line is its measured width; the dashed edge is the block. Each case opens at a width that shows its point.

+ {TEXT_CASES.map((testCase) => )} +
+ +
+
+

In a chart (after)

+ +
+

Economist theme. Charts compile with the new rule; the deck is broken to each chart’s block.

+
+ {CHART_WIDTHS.map((width) => ( +
+
{width}px plot
+ + + +
+ ))} +
+
+
+ ); +} diff --git a/site/src/playground/TooltipCompare.tsx b/site/src/playground/TooltipCompare.tsx new file mode 100644 index 00000000..9b04fa15 --- /dev/null +++ b/site/src/playground/TooltipCompare.tsx @@ -0,0 +1,138 @@ +import { useMemo, useState } from 'react'; +import { FlintChart } from 'flint-chart/react'; +import type { ChartAssemblyInput } from 'flint-chart'; + +// Vega-Lite's own tooltip (exact hit) beside Flint's baseline (Vega's tooltip, plus a few px of +// reach on lines and points), per mark type and density. + +type Density = 'sparse' | 'medium' | 'dense'; +type Mark = 'point' | 'bar' | 'line'; + +const SIZES: Record = { + sparse: { points: 40, bars: 5, months: 12, series: 3 }, + medium: { points: 400, bars: 15, months: 48, series: 5 }, + dense: { points: 4000, bars: 40, months: 240, series: 8 }, +}; + +const GROUPS = ['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta']; + +function random(seed: number): () => number { + let state = seed; + return () => ((state = (state * 16807) % 2147483647) / 2147483647); +} + +function data(mark: Mark, density: Density): Record[] { + const size = SIZES[density]; + const rand = random(11); + if (mark === 'point') { + return Array.from({ length: size.points }, (_, i) => { + const group = GROUPS[i % 3]; + const center = [30, 55, 70][i % 3]; + return { + x: Math.round((center + (rand() - 0.5) * 40) * 100) / 100, + y: Math.round((50 + (rand() - 0.5) * 60 + (i % 3) * 8) * 100) / 100, + group, + }; + }); + } + if (mark === 'bar') { + return Array.from({ length: size.bars }, (_, b) => `C${String(b + 1).padStart(2, '0')}`).flatMap((category) => + GROUPS.slice(0, 3).map((group) => ({ category, group, value: Math.round(5 + rand() * 30) }))); + } + return GROUPS.slice(0, size.series).flatMap((group, s) => + Array.from({ length: size.months }, (_, m) => ({ + month: `${2000 + Math.floor(m / 12)}-${String((m % 12) + 1).padStart(2, '0')}-01`, + group, + value: Math.round(40 + s * 6 + 12 * Math.sin((m + s * 2) / 4) + (rand() - 0.5) * 10 + m / 6), + }))); +} + +function spec(mark: Mark, density: Density): ChartAssemblyInput { + const values = data(mark, density); + if (mark === 'point') { + return { data: { values }, semantic_types: { x: 'Quantity', y: 'Quantity', group: 'Category' }, chart_spec: { chartType: 'Scatter Plot', title: `Points (${values.length})`, encodings: { x: { field: 'x' }, y: { field: 'y' }, color: { field: 'group' } } } } as ChartAssemblyInput; + } + if (mark === 'bar') { + return { data: { values }, semantic_types: { category: 'Category', group: 'Category', value: 'Quantity' }, chart_spec: { chartType: 'Stacked Bar Chart', title: `Stacked bars (${SIZES[density].bars} × 3)`, encodings: { x: { field: 'category' }, y: { field: 'value' }, color: { field: 'group' } } } } as ChartAssemblyInput; + } + return { data: { values }, semantic_types: { month: 'YearMonth', group: 'Category', value: 'Quantity' }, chart_spec: { chartType: 'Line Chart', title: `Lines (${SIZES[density].series} × ${SIZES[density].months})`, encodings: { x: { field: 'month' }, y: { field: 'value' }, color: { field: 'group' } } } } as ChartAssemblyInput; +} + +function withVegaTooltip(input: ChartAssemblyInput): ChartAssemblyInput { + return { ...input, options: { ...(input as any).options, addTooltips: true }, interaction_spec: { interactions: [], defaults: false } } as ChartAssemblyInput; +} + +function withBaseline(input: ChartAssemblyInput, tooltipOnly: boolean): ChartAssemblyInput { + return { ...input, interaction_spec: { interactions: [], defaults: tooltipOnly ? { tooltip: true, legend: false } : true } } as ChartAssemblyInput; +} + +const MARKS: Mark[] = ['point', 'bar', 'line']; + +function Segmented({ label, value, options, onChange }: { label: string; value: T; options: readonly T[]; onChange: (value: T) => void }) { + return ( + + ); +} + +function Pane({ heading, input, renderer, id }: { heading: string; input: ChartAssemblyInput; renderer: 'svg' | 'canvas'; id: string }) { + return ( +
+
{heading}
+
+ +
+
+ ); +} + +export function TooltipCompare() { + const [density, setDensity] = useState('medium'); + const [renderer, setRenderer] = useState<'svg' | 'canvas'>('canvas'); + const [tooltipOnly, setTooltipOnly] = useState(true); + const specs = useMemo(() => Object.fromEntries(MARKS.map((mark) => [mark, spec(mark, density)])) as Record, [density]); + + return ( +
+
+

Tooltip: Vega-Lite vs Flint baseline

+

+ Left: Vega-Lite's tooltip, shown only while the pointer is exactly on a mark. Right: Flint's baseline, the same + tooltip element and content, plus a few px of reach on lines and points so a thin stroke or a small dot is + readable without pixel hunting. Bars and other filled marks are read exactly as on the left. +

+
+
+ + + +
+ {MARKS.map((mark) => ( +
+

{mark}

+
+ + +
+
+ ))} +
+ ); +} diff --git a/site/src/playground/ZoomClippingLab.tsx b/site/src/playground/ZoomClippingLab.tsx index 77e13dab..80a8e651 100644 --- a/site/src/playground/ZoomClippingLab.tsx +++ b/site/src/playground/ZoomClippingLab.tsx @@ -56,7 +56,7 @@ const peakWeek = extremeWeek(1, 26, (a, b) => a > b); const lowWeek = extremeWeek(27, FORECAST_START, (a, b) => a < b); function note(week: number, text: string): ChartUpdateOp { - return { op: 'set-annotation', target: { select: { key: { Week: week } } }, value: { text } }; + return { op: 'annotate-text', target: { select: { key: { Week: week } } }, value: { text } }; } const forecastRows = [44, 46, 48, 50, 52].map((Week, index) => ({ diff --git a/site/src/playground/agent-comparison.css b/site/src/playground/agent-comparison.css deleted file mode 100644 index caf33fa5..00000000 --- a/site/src/playground/agent-comparison.css +++ /dev/null @@ -1,19 +0,0 @@ -.ac-page { gap: 28px; padding-bottom: 60px; } -.ac-heading { width: min(100%, 1100px); } -.ac-heading p { margin: 8px 0 0; color: #444; line-height: 1.55; max-width: 900px; } -.ac-block { width: min(100%, 1100px); } -.ac-block h2 { font-size: 17px; font-weight: 650; margin: 0 0 10px; } -.ac-sub { font-size: 14px; font-weight: 650; margin: 18px 0 6px; } -.ac-note { font-size: 13px; color: #666; margin: 0 0 10px; max-width: 900px; line-height: 1.5; } -.ac-findings ul, .ac-list { margin: 0; padding-left: 20px; line-height: 1.55; font-size: 14px; color: #333; max-width: 950px; } -.ac-findings li, .ac-list li { margin-bottom: 6px; } -.ac-block code { font-size: 12.5px; background: #f3f3f3; padding: 1px 4px; border-radius: 3px; } -.ac-totals { border-collapse: collapse; font-size: 14px; } -.ac-totals th, .ac-totals td { padding: 6px 14px; border-bottom: 1px solid #eee; text-align: right; white-space: nowrap; } -.ac-totals thead th { font-weight: 600; border-bottom: 2px solid #ddd; } -.ac-totals tbody th { text-align: left; font-weight: 500; color: #555; } -.ac-totals td.is-best { font-weight: 700; background: #f2f8f3; } -.ac-four { margin-bottom: 8px; } -.ac-label { font-size: 12px; color: #666; margin: 12px 0 4px; text-transform: uppercase; letter-spacing: 0.03em; } -.ac-prompt { margin: 0; padding: 10px 14px; background: #f6f8fa; border-left: 3px solid #1f6feb; font-size: 14px; line-height: 1.5; max-width: 950px; } -.ac-code-block { background: #f6f8fa; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; border-radius: 6px; max-width: 950px; overflow: auto; } diff --git a/site/src/playground/annotation-agent-examples.json b/site/src/playground/annotation-agent-examples.json new file mode 100644 index 00000000..2cfa0241 --- /dev/null +++ b/site/src/playground/annotation-agent-examples.json @@ -0,0 +1 @@ +[{"key": "gpt-6.1-sol__bl-funding-5__r1", "question": "Real income fell by about £42m between 2007 and 2023. Which sources account for the fall?", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"source": "Government grant-in-aid", "change": -24.302346620766386, "income_2007": 94.56858131540044, "income_2023": 70.26623469463405}, {"source": "Services", "change": -13.470265547570548, "income_2007": 20.507885297893832, "income_2023": 7.037619750323285}, {"source": "Voluntary contributions", "change": -4.191112695476651, "income_2007": 8.699587848027505, "income_2023": 4.508475152550854}, {"source": "Investment", "change": -0.01955633649919908, "income_2007": 1.668998465481219, "income_2023": 1.64944212898202}, {"source": "Other", "change": 0, "income_2007": 0, "income_2023": 0}]}, "semantic_types": {"source": "Category", "change": {"semanticType": "Quantity", "unit": "GBP"}, "income_2007": "Quantity", "income_2023": "Quantity"}, "chart_spec": {"chartType": "Bar Chart", "title": "Government funding and services drove the £42m real-income fall", "subtitle": "British Library: change from 2007/08 to 2023/24, £ millions at year-2000 prices", "source": {"text": "TidyTuesday · British Library annual reports", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-15"}, "encodings": {"y": {"field": "source", "sortBy": "x", "sortOrder": "ascending"}, "x": {"field": "change", "title": "Change in real income (£m)"}}, "baseSize": {"width": 700, "height": 380}, "chartProperties": {"showValueLabels": true}}, "field_display_names": {"source": "Income source", "change": "Change (£m, year-2000 prices)", "income_2007": "2007 income (£m)", "income_2023": "2023 income (£m)"}, "interaction_spec": {"interactions": [{"type": "click-highlight"}]}}, "updates": [{"id": "explanation", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"source": "Government grant-in-aid"}}}, "value": {"text": "58% of the overall decline", "highlight": "none"}}]}]}, {"key": "gpt-6.1-sol__cia-factbook-3__r1", "question": "Which countries don't fit the overall pattern?", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"country": "Russia", "infant_mortality_rate": 7.08, "life_exp_at_birth": 70.16}, {"country": "Canada", "infant_mortality_rate": 4.71, "life_exp_at_birth": 81.67}, {"country": "United States", "infant_mortality_rate": 6.17, "life_exp_at_birth": 79.56}, {"country": "China", "infant_mortality_rate": 14.79, "life_exp_at_birth": 75.15}, {"country": "Brazil", "infant_mortality_rate": 19.21, "life_exp_at_birth": 73.28}, {"country": "Australia", "infant_mortality_rate": 4.43, "life_exp_at_birth": 82.07}, {"country": "India", "infant_mortality_rate": 43.19, "life_exp_at_birth": 67.8}, {"country": "Argentina", "infant_mortality_rate": 9.96, "life_exp_at_birth": 77.51}, {"country": "Kazakhstan", "infant_mortality_rate": 21.61, "life_exp_at_birth": 70.24}, {"country": "Algeria", "infant_mortality_rate": 21.76, "life_exp_at_birth": 76.39}, {"country": "Congo, Democratic Republic of the", "infant_mortality_rate": 73.15, "life_exp_at_birth": 56.54}, {"country": "Greenland", "infant_mortality_rate": 9.42, "life_exp_at_birth": 71.82}, {"country": "Saudi Arabia", "infant_mortality_rate": 14.58, "life_exp_at_birth": 74.82}, {"country": "Mexico", "infant_mortality_rate": 12.58, "life_exp_at_birth": 75.43}, {"country": "Indonesia", "infant_mortality_rate": 25.16, "life_exp_at_birth": 72.17}, {"country": "Sudan", "infant_mortality_rate": 52.86, "life_exp_at_birth": 63.32}, {"country": "Libya", "infant_mortality_rate": 11.87, "life_exp_at_birth": 76.04}, {"country": "Iran", "infant_mortality_rate": 39, "life_exp_at_birth": 70.89}, {"country": "Mongolia", "infant_mortality_rate": 23.15, "life_exp_at_birth": 68.98}, {"country": "Peru", "infant_mortality_rate": 20.21, "life_exp_at_birth": 73.23}, {"country": "Chad", "infant_mortality_rate": 90.3, "life_exp_at_birth": 49.44}, {"country": "Niger", "infant_mortality_rate": 86.27, "life_exp_at_birth": 54.74}, {"country": "Angola", "infant_mortality_rate": 79.99, "life_exp_at_birth": 55.29}, {"country": "Mali", "infant_mortality_rate": 104.34, "life_exp_at_birth": 54.95}, {"country": "South Africa", "infant_mortality_rate": 41.61, "life_exp_at_birth": 49.56}, {"country": "Colombia", "infant_mortality_rate": 15.02, "life_exp_at_birth": 75.25}, {"country": "Ethiopia", "infant_mortality_rate": 55.77, "life_exp_at_birth": 60.75}, {"country": "Bolivia", "infant_mortality_rate": 38.61, "life_exp_at_birth": 68.55}, {"country": "Mauritania", "infant_mortality_rate": 56.06, "life_exp_at_birth": 62.28}, {"country": "Egypt", "infant_mortality_rate": 22.41, "life_exp_at_birth": 73.45}, {"country": "Tanzania", "infant_mortality_rate": 43.74, "life_exp_at_birth": 61.24}, {"country": "Nigeria", "infant_mortality_rate": 74.09, "life_exp_at_birth": 52.62}, {"country": "Venezuela", "infant_mortality_rate": 19.33, "life_exp_at_birth": 74.39}, {"country": "Namibia", "infant_mortality_rate": 45.64, "life_exp_at_birth": 51.85}, {"country": "Mozambique", "infant_mortality_rate": 72.42, "life_exp_at_birth": 52.6}, {"country": "Pakistan", "infant_mortality_rate": 57.48, "life_exp_at_birth": 67.05}, {"country": "Turkey", "infant_mortality_rate": 21.43, "life_exp_at_birth": 73.29}, {"country": "Chile", "infant_mortality_rate": 7.02, "life_exp_at_birth": 78.44}, {"country": "Zambia", "infant_mortality_rate": 66.62, "life_exp_at_birth": 51.83}, {"country": "Burma", "infant_mortality_rate": 44.91, "life_exp_at_birth": 65.94}, {"country": "Afghanistan", "infant_mortality_rate": 117.23, "life_exp_at_birth": 50.49}, {"country": "France", "infant_mortality_rate": 3.31, "life_exp_at_birth": 81.66}, {"country": "Somalia", "infant_mortality_rate": 100.14, "life_exp_at_birth": 51.58}, {"country": "Central African Republic", "infant_mortality_rate": 92.86, "life_exp_at_birth": 51.35}, {"country": "Ukraine", "infant_mortality_rate": 8.1, "life_exp_at_birth": 69.14}, {"country": "Madagascar", "infant_mortality_rate": 44.88, "life_exp_at_birth": 65.2}, {"country": "Botswana", "infant_mortality_rate": 9.38, "life_exp_at_birth": 54.06}, {"country": "Kenya", "infant_mortality_rate": 40.71, "life_exp_at_birth": 63.52}, {"country": "Yemen", "infant_mortality_rate": 50.41, "life_exp_at_birth": 64.83}, {"country": "Thailand", "infant_mortality_rate": 9.86, "life_exp_at_birth": 74.18}, {"country": "Spain", "infant_mortality_rate": 3.33, "life_exp_at_birth": 81.47}, {"country": "Turkmenistan", "infant_mortality_rate": 38.13, "life_exp_at_birth": 69.47}, {"country": "Cameroon", "infant_mortality_rate": 55.1, "life_exp_at_birth": 57.35}, {"country": "Papua New Guinea", "infant_mortality_rate": 39.67, "life_exp_at_birth": 66.85}, {"country": "Sweden", "infant_mortality_rate": 2.6, "life_exp_at_birth": 81.89}, {"country": "Uzbekistan", "infant_mortality_rate": 19.84, "life_exp_at_birth": 73.29}, {"country": "Morocco", "infant_mortality_rate": 24.52, "life_exp_at_birth": 76.51}, {"country": "Iraq", "infant_mortality_rate": 37.53, "life_exp_at_birth": 71.42}, {"country": "Paraguay", "infant_mortality_rate": 20.75, "life_exp_at_birth": 76.8}, {"country": "Zimbabwe", "infant_mortality_rate": 26.55, "life_exp_at_birth": 55.68}, {"country": "Japan", "infant_mortality_rate": 2.13, "life_exp_at_birth": 84.46}, {"country": "Germany", "infant_mortality_rate": 3.46, "life_exp_at_birth": 80.44}, {"country": "Congo, Republic of the", "infant_mortality_rate": 59.34, "life_exp_at_birth": 58.52}, {"country": "Finland", "infant_mortality_rate": 3.36, "life_exp_at_birth": 79.69}, {"country": "Vietnam", "infant_mortality_rate": 18.99, "life_exp_at_birth": 72.91}, {"country": "Malaysia", "infant_mortality_rate": 13.69, "life_exp_at_birth": 74.52}, {"country": "Norway", "infant_mortality_rate": 2.48, "life_exp_at_birth": 81.6}, {"country": "Cote d'Ivoire", "infant_mortality_rate": 60.16, "life_exp_at_birth": 58.01}, {"country": "Poland", "infant_mortality_rate": 6.19, "life_exp_at_birth": 76.65}, {"country": "Oman", "infant_mortality_rate": 14, "life_exp_at_birth": 74.97}, {"country": "Italy", "infant_mortality_rate": 3.31, "life_exp_at_birth": 82.03}, {"country": "Philippines", "infant_mortality_rate": 17.64, "life_exp_at_birth": 72.48}, {"country": "Ecuador", "infant_mortality_rate": 17.93, "life_exp_at_birth": 76.36}, {"country": "Burkina Faso", "infant_mortality_rate": 76.8, "life_exp_at_birth": 54.78}, {"country": "New Zealand", "infant_mortality_rate": 4.59, "life_exp_at_birth": 80.93}, {"country": "Gabon", "infant_mortality_rate": 47.03, "life_exp_at_birth": 52.06}, {"country": "Western Sahara", "infant_mortality_rate": 56.09, "life_exp_at_birth": 62.27}, {"country": "Guinea", "infant_mortality_rate": 55.24, "life_exp_at_birth": 59.6}, {"country": "United Kingdom", "infant_mortality_rate": 4.44, "life_exp_at_birth": 80.42}, {"country": "Uganda", "infant_mortality_rate": 60.82, "life_exp_at_birth": 54.46}, {"country": "Ghana", "infant_mortality_rate": 38.52, "life_exp_at_birth": 65.75}, {"country": "Romania", "infant_mortality_rate": 10.16, "life_exp_at_birth": 74.69}, {"country": "Laos", "infant_mortality_rate": 54.53, "life_exp_at_birth": 63.51}, {"country": "Guyana", "infant_mortality_rate": 33.56, "life_exp_at_birth": 67.81}, {"country": "Belarus", "infant_mortality_rate": 3.64, "life_exp_at_birth": 72.15}, {"country": "Kyrgyzstan", "infant_mortality_rate": 28.71, "life_exp_at_birth": 70.06}, {"country": "Senegal", "infant_mortality_rate": 52.72, "life_exp_at_birth": 60.95}, {"country": "Syria", "infant_mortality_rate": 15.79, "life_exp_at_birth": 68.41}, {"country": "Cambodia", "infant_mortality_rate": 51.36, "life_exp_at_birth": 63.78}, {"country": "Uruguay", "infant_mortality_rate": 8.97, "life_exp_at_birth": 76.81}, {"country": "Suriname", "infant_mortality_rate": 27.07, "life_exp_at_birth": 71.69}, {"country": "Tunisia", "infant_mortality_rate": 23.19, "life_exp_at_birth": 75.68}, {"country": "Nepal", "infant_mortality_rate": 40.43, "life_exp_at_birth": 67.19}, {"country": "Bangladesh", "infant_mortality_rate": 45.67, "life_exp_at_birth": 70.65}, {"country": "Tajikistan", "infant_mortality_rate": 35.03, "life_exp_at_birth": 67.06}, {"country": "Greece", "infant_mortality_rate": 4.78, "life_exp_at_birth": 80.3}, {"country": "Nicaragua", "infant_mortality_rate": 20.36, "life_exp_at_birth": 72.72}, {"country": "Korea, North", "infant_mortality_rate": 24.5, "life_exp_at_birth": 69.81}, {"country": "Malawi", "infant_mortality_rate": 48.01, "life_exp_at_birth": 59.99}, {"country": "Eritrea", "infant_mortality_rate": 38.44, "life_exp_at_birth": 63.51}, {"country": "Benin", "infant_mortality_rate": 57.09, "life_exp_at_birth": 61.07}, {"country": "Honduras", "infant_mortality_rate": 18.72, "life_exp_at_birth": 70.91}, {"country": "Liberia", "infant_mortality_rate": 69.19, "life_exp_at_birth": 58.21}, {"country": "Bulgaria", "infant_mortality_rate": 15.08, "life_exp_at_birth": 74.33}, {"country": "Cuba", "infant_mortality_rate": 4.7, "life_exp_at_birth": 78.22}, {"country": "Guatemala", "infant_mortality_rate": 23.51, "life_exp_at_birth": 71.74}, {"country": "Iceland", "infant_mortality_rate": 3.15, "life_exp_at_birth": 81.22}, {"country": "Korea, South", "infant_mortality_rate": 3.93, "life_exp_at_birth": 79.8}, {"country": "Hungary", "infant_mortality_rate": 5.09, "life_exp_at_birth": 75.46}, {"country": "Portugal", "infant_mortality_rate": 4.48, "life_exp_at_birth": 79.01}, {"country": "Jordan", "infant_mortality_rate": 15.73, "life_exp_at_birth": 74.1}, {"country": "Azerbaijan", "infant_mortality_rate": 26.67, "life_exp_at_birth": 71.91}, {"country": "Austria", "infant_mortality_rate": 4.16, "life_exp_at_birth": 80.17}, {"country": "United Arab Emirates", "infant_mortality_rate": 10.92, "life_exp_at_birth": 77.09}, {"country": "Czech Republic", "infant_mortality_rate": 2.63, "life_exp_at_birth": 78.31}, {"country": "Serbia", "infant_mortality_rate": 6.16, "life_exp_at_birth": 75.02}, {"country": "Panama", "infant_mortality_rate": 10.7, "life_exp_at_birth": 78.3}, {"country": "Sierra Leone", "infant_mortality_rate": 73.29, "life_exp_at_birth": 57.39}, {"country": "Ireland", "infant_mortality_rate": 3.74, "life_exp_at_birth": 80.56}, {"country": "Georgia", "infant_mortality_rate": 16.68, "life_exp_at_birth": 75.72}, {"country": "Sri Lanka", "infant_mortality_rate": 9.02, "life_exp_at_birth": 76.35}, {"country": "Lithuania", "infant_mortality_rate": 6, "life_exp_at_birth": 75.98}, {"country": "Latvia", "infant_mortality_rate": 7.91, "life_exp_at_birth": 73.44}, {"country": "Togo", "infant_mortality_rate": 46.73, "life_exp_at_birth": 64.06}, {"country": "Croatia", "infant_mortality_rate": 5.87, "life_exp_at_birth": 76.41}, {"country": "Bosnia and Herzegovina", "infant_mortality_rate": 5.84, "life_exp_at_birth": 76.33}, {"country": "Costa Rica", "infant_mortality_rate": 8.7, "life_exp_at_birth": 78.23}, {"country": "Slovakia", "infant_mortality_rate": 5.35, "life_exp_at_birth": 76.69}, {"country": "Dominican Republic", "infant_mortality_rate": 19.63, "life_exp_at_birth": 77.8}, {"country": "Estonia", "infant_mortality_rate": 6.7, "life_exp_at_birth": 74.07}, {"country": "Denmark", "infant_mortality_rate": 4.1, "life_exp_at_birth": 79.09}, {"country": "Netherlands", "infant_mortality_rate": 3.66, "life_exp_at_birth": 81.12}, {"country": "Switzerland", "infant_mortality_rate": 3.73, "life_exp_at_birth": 82.39}, {"country": "Bhutan", "infant_mortality_rate": 37.89, "life_exp_at_birth": 68.98}, {"country": "Guinea-Bissau", "infant_mortality_rate": 90.92, "life_exp_at_birth": 49.87}, {"country": "Taiwan", "infant_mortality_rate": 4.49, "life_exp_at_birth": 79.84}, {"country": "Moldova", "infant_mortality_rate": 12.93, "life_exp_at_birth": 70.12}, {"country": "Belgium", "infant_mortality_rate": 4.18, "life_exp_at_birth": 79.92}, {"country": "Lesotho", "infant_mortality_rate": 50.48, "life_exp_at_birth": 52.65}, {"country": "Armenia", "infant_mortality_rate": 13.97, "life_exp_at_birth": 74.12}, {"country": "Solomon Islands", "infant_mortality_rate": 16.17, "life_exp_at_birth": 74.89}, {"country": "Albania", "infant_mortality_rate": 13.19, "life_exp_at_birth": 77.96}, {"country": "Equatorial Guinea", "infant_mortality_rate": 71.12, "life_exp_at_birth": 63.49}, {"country": "Burundi", "infant_mortality_rate": 63.44, "life_exp_at_birth": 59.55}, {"country": "Haiti", "infant_mortality_rate": 49.43, "life_exp_at_birth": 63.18}, {"country": "Rwanda", "infant_mortality_rate": 59.59, "life_exp_at_birth": 59.26}, {"country": "Macedonia", "infant_mortality_rate": 7.9, "life_exp_at_birth": 75.8}, {"country": "Djibouti", "infant_mortality_rate": 50.2, "life_exp_at_birth": 62.4}, {"country": "Belize", "infant_mortality_rate": 20.31, "life_exp_at_birth": 68.49}, {"country": "El Salvador", "infant_mortality_rate": 18.44, "life_exp_at_birth": 74.18}, {"country": "Israel", "infant_mortality_rate": 3.98, "life_exp_at_birth": 81.28}, {"country": "Slovenia", "infant_mortality_rate": 4.04, "life_exp_at_birth": 77.83}, {"country": "New Caledonia", "infant_mortality_rate": 5.46, "life_exp_at_birth": 77.31}, {"country": "Fiji", "infant_mortality_rate": 10.2, "life_exp_at_birth": 72.15}, {"country": "Kuwait", "infant_mortality_rate": 7.51, "life_exp_at_birth": 77.64}, {"country": "Swaziland", "infant_mortality_rate": 54.82, "life_exp_at_birth": 50.54}, {"country": "Timor-Leste", "infant_mortality_rate": 38.79, "life_exp_at_birth": 67.39}, {"country": "Bahamas, The", "infant_mortality_rate": 12.5, "life_exp_at_birth": 71.93}, {"country": "Puerto Rico", "infant_mortality_rate": 7.73, "life_exp_at_birth": 79.09}, {"country": "Vanuatu", "infant_mortality_rate": 16.41, "life_exp_at_birth": 72.72}, {"country": "Qatar", "infant_mortality_rate": 6.42, "life_exp_at_birth": 78.38}, {"country": "Gambia, The", "infant_mortality_rate": 65.74, "life_exp_at_birth": 64.36}, {"country": "Jamaica", "infant_mortality_rate": 13.69, "life_exp_at_birth": 73.48}, {"country": "Lebanon", "infant_mortality_rate": 7.98, "life_exp_at_birth": 77.22}, {"country": "Cyprus", "infant_mortality_rate": 8.54, "life_exp_at_birth": 78.34}, {"country": "West Bank", "infant_mortality_rate": 13.49, "life_exp_at_birth": 75.69}, {"country": "Brunei", "infant_mortality_rate": 10.48, "life_exp_at_birth": 76.77}, {"country": "Trinidad and Tobago", "infant_mortality_rate": 24.82, "life_exp_at_birth": 72.29}, {"country": "French Polynesia", "infant_mortality_rate": 4.78, "life_exp_at_birth": 76.79}, {"country": "Cabo Verde", "infant_mortality_rate": 24.28, "life_exp_at_birth": 71.57}, {"country": "Samoa", "infant_mortality_rate": 20.5, "life_exp_at_birth": 73.21}, {"country": "Luxembourg", "infant_mortality_rate": 4.28, "life_exp_at_birth": 80.01}, {"country": "Comoros", "infant_mortality_rate": 65.31, "life_exp_at_birth": 63.48}, {"country": "Mauritius", "infant_mortality_rate": 10.59, "life_exp_at_birth": 75.17}, {"country": "Virgin Islands", "infant_mortality_rate": 6.79, "life_exp_at_birth": 79.75}, {"country": "Faroe Islands", "infant_mortality_rate": 5.71, "life_exp_at_birth": 80.11}, {"country": "Hong Kong", "infant_mortality_rate": 2.73, "life_exp_at_birth": 82.78}, {"country": "Sao Tome and Principe", "infant_mortality_rate": 49.16, "life_exp_at_birth": 64.22}, {"country": "Turks and Caicos Islands", "infant_mortality_rate": 10.97, "life_exp_at_birth": 79.55}, {"country": "Kiribati", "infant_mortality_rate": 35.37, "life_exp_at_birth": 65.47}, {"country": "Bahrain", "infant_mortality_rate": 9.68, "life_exp_at_birth": 78.58}, {"country": "Dominica", "infant_mortality_rate": 11.61, "life_exp_at_birth": 76.59}, {"country": "Tonga", "infant_mortality_rate": 12.36, "life_exp_at_birth": 75.82}, {"country": "Micronesia, Federated States of", "infant_mortality_rate": 21.93, "life_exp_at_birth": 72.35}, {"country": "Singapore", "infant_mortality_rate": 2.53, "life_exp_at_birth": 84.38}, {"country": "Saint Lucia", "infant_mortality_rate": 11.75, "life_exp_at_birth": 77.41}, {"country": "Isle of Man", "infant_mortality_rate": 4.17, "life_exp_at_birth": 80.98}, {"country": "Guam", "infant_mortality_rate": 5.51, "life_exp_at_birth": 78.82}, {"country": "Andorra", "infant_mortality_rate": 3.69, "life_exp_at_birth": 82.65}, {"country": "Northern Mariana Islands", "infant_mortality_rate": 5.5, "life_exp_at_birth": 77.64}, {"country": "Palau", "infant_mortality_rate": 11.46, "life_exp_at_birth": 72.6}, {"country": "Seychelles", "infant_mortality_rate": 10.77, "life_exp_at_birth": 74.25}, {"country": "Antigua and Barbuda", "infant_mortality_rate": 13.29, "life_exp_at_birth": 76.12}, {"country": "Barbados", "infant_mortality_rate": 10.93, "life_exp_at_birth": 74.99}, {"country": "Saint Vincent and the Grenadines", "infant_mortality_rate": 13.07, "life_exp_at_birth": 74.86}, {"country": "Gaza Strip", "infant_mortality_rate": 15.46, "life_exp_at_birth": 74.64}, {"country": "Grenada", "infant_mortality_rate": 10.5, "life_exp_at_birth": 73.8}, {"country": "Malta", "infant_mortality_rate": 3.59, "life_exp_at_birth": 80.11}, {"country": "Saint Helena, Ascension, and Tristan da Cunha", "infant_mortality_rate": 14.71, "life_exp_at_birth": 79.21}, {"country": "Maldives", "infant_mortality_rate": 24.59, "life_exp_at_birth": 75.15}, {"country": "Cayman Islands", "infant_mortality_rate": 6.21, "life_exp_at_birth": 81.02}, {"country": "Saint Kitts and Nevis", "infant_mortality_rate": 8.98, "life_exp_at_birth": 75.29}, {"country": "Saint Pierre and Miquelon", "infant_mortality_rate": 6.95, "life_exp_at_birth": 80.26}, {"country": "Cook Islands", "infant_mortality_rate": 14.33, "life_exp_at_birth": 75.38}, {"country": "American Samoa", "infant_mortality_rate": 8.92, "life_exp_at_birth": 74.91}, {"country": "Marshall Islands", "infant_mortality_rate": 21.39, "life_exp_at_birth": 72.58}, {"country": "Aruba", "infant_mortality_rate": 11.74, "life_exp_at_birth": 76.35}, {"country": "Liechtenstein", "infant_mortality_rate": 4.33, "life_exp_at_birth": 81.68}, {"country": "British Virgin Islands", "infant_mortality_rate": 13.45, "life_exp_at_birth": 78.29}, {"country": "Wallis and Futuna", "infant_mortality_rate": 4.49, "life_exp_at_birth": 79.42}, {"country": "Jersey", "infant_mortality_rate": 3.86, "life_exp_at_birth": 81.66}, {"country": "Montserrat", "infant_mortality_rate": 13.66, "life_exp_at_birth": 73.9}, {"country": "Anguilla", "infant_mortality_rate": 3.4, "life_exp_at_birth": 81.2}, {"country": "Guernsey", "infant_mortality_rate": 3.47, "life_exp_at_birth": 82.39}, {"country": "San Marino", "infant_mortality_rate": 4.52, "life_exp_at_birth": 83.18}, {"country": "Bermuda", "infant_mortality_rate": 2.48, "life_exp_at_birth": 81.04}, {"country": "Sint Maarten", "infant_mortality_rate": 9.05, "life_exp_at_birth": 77.61}, {"country": "Macau", "infant_mortality_rate": 3.13, "life_exp_at_birth": 84.48}, {"country": "Tuvalu", "infant_mortality_rate": 31.69, "life_exp_at_birth": 65.81}, {"country": "Nauru", "infant_mortality_rate": 8.21, "life_exp_at_birth": 66.4}, {"country": "Gibraltar", "infant_mortality_rate": 6.29, "life_exp_at_birth": 79.13}, {"country": "Monaco", "infant_mortality_rate": 1.81, "life_exp_at_birth": 89.57}, {"country": "European Union", "infant_mortality_rate": 4.33, "life_exp_at_birth": 80.02}]}, "semantic_types": {"country": "Country", "infant_mortality_rate": "Quantity", "life_exp_at_birth": {"semanticType": "Quantity", "unit": "years"}}, "chart_spec": {"chartType": "Scatter Plot", "title": "Botswana falls furthest below the mortality–longevity pattern", "subtitle": "CIA Factbook 2014 • 223 countries and territories with both measures\nLine: least-squares fit of life expectancy to log infant mortality; x-axis is logarithmic.", "source": {"text": "TidyTuesday • CIA World Factbook (2014)", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2024/2024-10-22"}, "encodings": {"x": {"field": "infant_mortality_rate", "title": "Infant deaths per 1,000 live births (log scale)"}, "y": {"field": "life_exp_at_birth", "title": "Life expectancy at birth (years)"}, "detail": {"field": "country"}}, "baseSize": {"width": 760, "height": 520}, "chartProperties": {"logScale_x": true, "includeZero_y": false}}, "interaction_spec": {"interactions": [{"type": "lasso-select"}, {"type": "navigate", "options": {"pan": false}}]}}, "updates": [{"id": "agent", "ops": [{"op": "set-overlay", "name": "overall-fit", "value": {"mark": "line", "role": "reference", "data": {"values": [{"mortality": 1.81, "life": 87.55933925929673}, {"mortality": 117.23, "life": 56.3198732230751}]}, "encodings": {"x": {"field": "mortality"}, "y": {"field": "life"}}, "style": {"strokeDash": [5, 4]}}}, {"op": "annotate-text", "target": {"select": {"key": {"country": "Botswana"}}}, "value": {"text": "Botswana: 21.2 years below fit", "highlight": "light"}}, {"op": "annotate-text", "target": {"select": {"key": {"country": "South Africa"}}}, "value": {"text": "South Africa: 14.5 years below fit", "highlight": "light"}}, {"op": "annotate-text", "target": {"select": {"key": {"country": "Zimbabwe"}}}, "value": {"text": "Zimbabwe: 11.8 years below fit", "highlight": "light"}}, {"op": "annotate-text", "target": {"select": {"key": {"country": "Morocco"}}}, "value": {"text": "Morocco: 8.5 years above fit", "highlight": "light"}}]}]}, {"key": "gpt-6.1-sol__cranes-1__r2", "question": "How has the number of cranes resting at the lake changed over 30 years?", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"year": 1994, "season": "Spring", "peak_cranes": 4992}, {"year": 1995, "season": "Spring", "peak_cranes": 5280}, {"year": 1996, "season": "Spring", "peak_cranes": 5880}, {"year": 1997, "season": "Spring", "peak_cranes": 6860}, {"year": 1998, "season": "Spring", "peak_cranes": 8625}, {"year": 1999, "season": "Spring", "peak_cranes": 7800}, {"year": 2000, "season": "Spring", "peak_cranes": 8920}, {"year": 2001, "season": "Spring", "peak_cranes": 6750}, {"year": 2002, "season": "Autumn", "peak_cranes": 5250}, {"year": 2002, "season": "Spring", "peak_cranes": 8760}, {"year": 2003, "season": "Autumn", "peak_cranes": 7550}, {"year": 2003, "season": "Spring", "peak_cranes": 11050}, {"year": 2004, "season": "Autumn", "peak_cranes": 4020}, {"year": 2004, "season": "Spring", "peak_cranes": 12700}, {"year": 2005, "season": "Autumn", "peak_cranes": 8260}, {"year": 2005, "season": "Spring", "peak_cranes": 12100}, {"year": 2006, "season": "Autumn", "peak_cranes": 9550}, {"year": 2006, "season": "Spring", "peak_cranes": 9920}, {"year": 2007, "season": "Autumn", "peak_cranes": 7340}, {"year": 2007, "season": "Spring", "peak_cranes": 13900}, {"year": 2008, "season": "Autumn", "peak_cranes": 4700}, {"year": 2008, "season": "Spring", "peak_cranes": 15300}, {"year": 2009, "season": "Autumn", "peak_cranes": 7320}, {"year": 2009, "season": "Spring", "peak_cranes": 18500}, {"year": 2010, "season": "Autumn", "peak_cranes": 7000}, {"year": 2010, "season": "Spring", "peak_cranes": 13800}, {"year": 2011, "season": "Autumn", "peak_cranes": 6900}, {"year": 2011, "season": "Spring", "peak_cranes": 15400}, {"year": 2012, "season": "Autumn", "peak_cranes": 10700}, {"year": 2012, "season": "Spring", "peak_cranes": 26500}, {"year": 2013, "season": "Autumn", "peak_cranes": 10680}, {"year": 2013, "season": "Spring", "peak_cranes": 13500}, {"year": 2014, "season": "Autumn", "peak_cranes": 15380}, {"year": 2014, "season": "Spring", "peak_cranes": 23000}, {"year": 2015, "season": "Autumn", "peak_cranes": 11200}, {"year": 2015, "season": "Spring", "peak_cranes": 19600}, {"year": 2016, "season": "Autumn", "peak_cranes": 12450}, {"year": 2016, "season": "Spring", "peak_cranes": 19400}, {"year": 2017, "season": "Autumn", "peak_cranes": 18550}, {"year": 2017, "season": "Spring", "peak_cranes": 19700}, {"year": 2018, "season": "Autumn", "peak_cranes": 15250}, {"year": 2018, "season": "Spring", "peak_cranes": 24500}, {"year": 2019, "season": "Autumn", "peak_cranes": 18950}, {"year": 2019, "season": "Spring", "peak_cranes": 27300}, {"year": 2020, "season": "Autumn", "peak_cranes": 18100}, {"year": 2020, "season": "Spring", "peak_cranes": 19200}, {"year": 2021, "season": "Autumn", "peak_cranes": 15770}, {"year": 2021, "season": "Spring", "peak_cranes": 17480}, {"year": 2022, "season": "Autumn", "peak_cranes": 16340}, {"year": 2022, "season": "Spring", "peak_cranes": 20900}, {"year": 2023, "season": "Autumn", "peak_cranes": 24300}, {"year": 2023, "season": "Spring", "peak_cranes": 12200}, {"year": 2024, "season": "Autumn", "peak_cranes": 18450}, {"year": 2024, "season": "Spring", "peak_cranes": 24600}]}, "semantic_types": {"year": "Year", "season": "Category", "peak_cranes": "Count"}, "chart_spec": {"chartType": "Line Chart", "title": "Spring crane peaks are nearly five times higher than in 1994", "subtitle": "Lake Hornborgasjön, 1994–2024 • Highest single-day count each season; autumn data begin in 2002", "source": {"text": "TidyTuesday 2025-09-30", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-09-30"}, "encodings": {"x": {"field": "year"}, "y": {"field": "peak_cranes"}, "color": {"field": "season"}}, "baseSize": {"width": 760, "height": 420}}, "field_display_names": {"peak_cranes": "Peak cranes", "year": "Year", "season": "Migration season"}, "interaction_spec": {"interactions": [{"type": "inspect-index"}, {"type": "legend-toggle"}]}}, "updates": [{"id": "agent", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"year": 2019, "season": "Spring"}}}, "value": {"text": "Highest count in the 30-year record", "anchor": "point", "highlight": "none"}}]}]}, {"key": "gpt-6.1-sol__daily-accidents-5__r2", "question": "Show the single deadliest day in the record and the safest day of the calendar year.", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"day": "Nov 3, 2007 — single-day total", "fatalities": 299}, {"day": "Dec 25 — calendar-day mean", "fatalities": 111.92}]}, "semantic_types": {"day": "Category", "fatalities": "Count"}, "chart_spec": {"chartType": "Bar Chart", "title": "A record 299 deaths on Nov 3, 2007; Christmas had the lowest average", "subtitle": "US road fatalities, 1992–2016. Single-day maximum versus lowest mean by month and day.", "source": {"text": "TidyTuesday, 2025-04-22", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-04-22"}, "encodings": {"y": {"field": "day", "sortBy": "x", "sortOrder": "descending"}, "x": {"field": "fatalities"}}, "baseSize": {"width": 760, "height": 340}, "chartProperties": {"showValueLabels": true}}, "field_display_names": {"fatalities": "Fatalities", "day": "Day and measure"}}, "updates": [{"id": "agent", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"day": "Nov 3, 2007 — single-day total"}}}, "value": {"text": "Highest of 9,132 recorded days", "highlight": "none"}}, {"op": "annotate-text", "target": {"select": {"key": {"day": "Dec 25 — calendar-day mean"}}}, "value": {"text": "Mean across 25 Christmas Days", "highlight": "none"}}]}]}, {"key": "gpt-6-luna__flint-lead-1__r1", "question": "Show the distribution of lead levels in the Virginia Tech samples and mark the EPA action level of 15 ppb.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"sample": 1, "lead": 0.344, "group": "Virginia Tech samples"}, {"sample": 2, "lead": 0.349, "group": "Virginia Tech samples"}, {"sample": 3, "lead": 0.4, "group": "Virginia Tech samples"}, {"sample": 4, "lead": 0.41, "group": "Virginia Tech samples"}, {"sample": 5, "lead": 0.438, "group": "Virginia Tech samples"}, {"sample": 6, "lead": 0.475, "group": "Virginia Tech samples"}, {"sample": 7, "lead": 0.5, "group": "Virginia Tech samples"}, {"sample": 8, "lead": 0.5, "group": "Virginia Tech samples"}, {"sample": 9, "lead": 0.501, "group": "Virginia Tech samples"}, {"sample": 10, "lead": 0.507, "group": "Virginia Tech samples"}, {"sample": 11, "lead": 0.543, "group": "Virginia Tech samples"}, {"sample": 12, "lead": 0.548, "group": "Virginia Tech samples"}, {"sample": 13, "lead": 0.552, "group": "Virginia Tech samples"}, {"sample": 14, "lead": 0.639, "group": "Virginia Tech samples"}, {"sample": 15, "lead": 0.64, "group": "Virginia Tech samples"}, {"sample": 16, "lead": 0.684, "group": "Virginia Tech samples"}, {"sample": 17, "lead": 0.7, "group": "Virginia Tech samples"}, {"sample": 18, "lead": 0.708, "group": "Virginia Tech samples"}, {"sample": 19, "lead": 0.719, "group": "Virginia Tech samples"}, {"sample": 20, "lead": 0.739, "group": "Virginia Tech samples"}, {"sample": 21, "lead": 0.753, "group": "Virginia Tech samples"}, {"sample": 22, "lead": 0.793, "group": "Virginia Tech samples"}, {"sample": 23, "lead": 0.8, "group": "Virginia Tech samples"}, {"sample": 24, "lead": 0.8, "group": "Virginia Tech samples"}, {"sample": 25, "lead": 0.8, "group": "Virginia Tech samples"}, {"sample": 26, "lead": 0.823, "group": "Virginia Tech samples"}, {"sample": 27, "lead": 0.828, "group": "Virginia Tech samples"}, {"sample": 28, "lead": 0.832, "group": "Virginia Tech samples"}, {"sample": 29, "lead": 0.846, "group": "Virginia Tech samples"}, {"sample": 30, "lead": 0.866, "group": "Virginia Tech samples"}, {"sample": 31, "lead": 0.9, "group": "Virginia Tech samples"}, {"sample": 32, "lead": 0.906, "group": "Virginia Tech samples"}, {"sample": 33, "lead": 0.915, "group": "Virginia Tech samples"}, {"sample": 34, "lead": 0.922, "group": "Virginia Tech samples"}, {"sample": 35, "lead": 0.948, "group": "Virginia Tech samples"}, {"sample": 36, "lead": 0.956, "group": "Virginia Tech samples"}, {"sample": 37, "lead": 0.965, "group": "Virginia Tech samples"}, {"sample": 38, "lead": 0.974, "group": "Virginia Tech samples"}, {"sample": 39, "lead": 0.977, "group": "Virginia Tech samples"}, {"sample": 40, "lead": 0.99, "group": "Virginia Tech samples"}, {"sample": 41, "lead": 1.032, "group": "Virginia Tech samples"}, {"sample": 42, "lead": 1.083, "group": "Virginia Tech samples"}, {"sample": 43, "lead": 1.1, "group": "Virginia Tech samples"}, {"sample": 44, "lead": 1.1, "group": "Virginia Tech samples"}, {"sample": 45, "lead": 1.1, "group": "Virginia Tech samples"}, {"sample": 46, "lead": 1.111, "group": "Virginia Tech samples"}, {"sample": 47, "lead": 1.114, "group": "Virginia Tech samples"}, {"sample": 48, "lead": 1.132, "group": "Virginia Tech samples"}, {"sample": 49, "lead": 1.152, "group": "Virginia Tech samples"}, {"sample": 50, "lead": 1.154, "group": "Virginia Tech samples"}, {"sample": 51, "lead": 1.166, "group": "Virginia Tech samples"}, {"sample": 52, "lead": 1.174, "group": "Virginia Tech samples"}, {"sample": 53, "lead": 1.183, "group": "Virginia Tech samples"}, {"sample": 54, "lead": 1.2, "group": "Virginia Tech samples"}, {"sample": 55, "lead": 1.203, "group": "Virginia Tech samples"}, {"sample": 56, "lead": 1.224, "group": "Virginia Tech samples"}, {"sample": 57, "lead": 1.229, "group": "Virginia Tech samples"}, {"sample": 58, "lead": 1.29, "group": "Virginia Tech samples"}, {"sample": 59, "lead": 1.293, "group": "Virginia Tech samples"}, {"sample": 60, "lead": 1.329, "group": "Virginia Tech samples"}, {"sample": 61, "lead": 1.344, "group": "Virginia Tech samples"}, {"sample": 62, "lead": 1.38, "group": "Virginia Tech samples"}, {"sample": 63, "lead": 1.386, "group": "Virginia Tech samples"}, {"sample": 64, "lead": 1.403, "group": "Virginia Tech samples"}, {"sample": 65, "lead": 1.467, "group": "Virginia Tech samples"}, {"sample": 66, "lead": 1.469, "group": "Virginia Tech samples"}, {"sample": 67, "lead": 1.492, "group": "Virginia Tech samples"}, {"sample": 68, "lead": 1.571, "group": "Virginia Tech samples"}, {"sample": 69, "lead": 1.585, "group": "Virginia Tech samples"}, {"sample": 70, "lead": 1.621, "group": "Virginia Tech samples"}, {"sample": 71, "lead": 1.626, "group": "Virginia Tech samples"}, {"sample": 72, "lead": 1.633, "group": "Virginia Tech samples"}, {"sample": 73, "lead": 1.668, "group": "Virginia Tech samples"}, {"sample": 74, "lead": 1.671, "group": "Virginia Tech samples"}, {"sample": 75, "lead": 1.701, "group": "Virginia Tech samples"}, {"sample": 76, "lead": 1.799, "group": "Virginia Tech samples"}, {"sample": 77, "lead": 1.8, "group": "Virginia Tech samples"}, {"sample": 78, "lead": 1.852, "group": "Virginia Tech samples"}, {"sample": 79, "lead": 1.861, "group": "Virginia Tech samples"}, {"sample": 80, "lead": 1.862, "group": "Virginia Tech samples"}, {"sample": 81, "lead": 1.867, "group": "Virginia Tech samples"}, {"sample": 82, "lead": 1.888, "group": "Virginia Tech samples"}, {"sample": 83, "lead": 1.934, "group": "Virginia Tech samples"}, {"sample": 84, "lead": 1.951, "group": "Virginia Tech samples"}, {"sample": 85, "lead": 1.959, "group": "Virginia Tech samples"}, {"sample": 86, "lead": 1.966, "group": "Virginia Tech samples"}, {"sample": 87, "lead": 1.984, "group": "Virginia Tech samples"}, {"sample": 88, "lead": 2.054, "group": "Virginia Tech samples"}, {"sample": 89, "lead": 2.1, "group": "Virginia Tech samples"}, {"sample": 90, "lead": 2.145, "group": "Virginia Tech samples"}, {"sample": 91, "lead": 2.149, "group": "Virginia Tech samples"}, {"sample": 92, "lead": 2.172, "group": "Virginia Tech samples"}, {"sample": 93, "lead": 2.229, "group": "Virginia Tech samples"}, {"sample": 94, "lead": 2.261, "group": "Virginia Tech samples"}, {"sample": 95, "lead": 2.267, "group": "Virginia Tech samples"}, {"sample": 96, "lead": 2.273, "group": "Virginia Tech samples"}, {"sample": 97, "lead": 2.325, "group": "Virginia Tech samples"}, {"sample": 98, "lead": 2.332, "group": "Virginia Tech samples"}, {"sample": 99, "lead": 2.362, "group": "Virginia Tech samples"}, {"sample": 100, "lead": 2.37, "group": "Virginia Tech samples"}, {"sample": 101, "lead": 2.423, "group": "Virginia Tech samples"}, {"sample": 102, "lead": 2.433, "group": "Virginia Tech samples"}, {"sample": 103, "lead": 2.435, "group": "Virginia Tech samples"}, {"sample": 104, "lead": 2.448, "group": "Virginia Tech samples"}, {"sample": 105, "lead": 2.481, "group": "Virginia Tech samples"}, {"sample": 106, "lead": 2.484, "group": "Virginia Tech samples"}, {"sample": 107, "lead": 2.525, "group": "Virginia Tech samples"}, {"sample": 108, "lead": 2.544, "group": "Virginia Tech samples"}, {"sample": 109, "lead": 2.576, "group": "Virginia Tech samples"}, {"sample": 110, "lead": 2.582, "group": "Virginia Tech samples"}, {"sample": 111, "lead": 2.672, "group": "Virginia Tech samples"}, {"sample": 112, "lead": 2.708, "group": "Virginia Tech samples"}, {"sample": 113, "lead": 2.774, "group": "Virginia Tech samples"}, {"sample": 114, "lead": 2.816, "group": "Virginia Tech samples"}, {"sample": 115, "lead": 2.822, "group": "Virginia Tech samples"}, {"sample": 116, "lead": 2.828, "group": "Virginia Tech samples"}, {"sample": 117, "lead": 2.85, "group": "Virginia Tech samples"}, {"sample": 118, "lead": 2.867, "group": "Virginia Tech samples"}, {"sample": 119, "lead": 2.9, "group": "Virginia Tech samples"}, {"sample": 120, "lead": 2.911, "group": "Virginia Tech samples"}, {"sample": 121, "lead": 2.997, "group": "Virginia Tech samples"}, {"sample": 122, "lead": 3.045, "group": "Virginia Tech samples"}, {"sample": 123, "lead": 3.058, "group": "Virginia Tech samples"}, {"sample": 124, "lead": 3.131, "group": "Virginia Tech samples"}, {"sample": 125, "lead": 3.158, "group": "Virginia Tech samples"}, {"sample": 126, "lead": 3.228, "group": "Virginia Tech samples"}, {"sample": 127, "lead": 3.232, "group": "Virginia Tech samples"}, {"sample": 128, "lead": 3.243, "group": "Virginia Tech samples"}, {"sample": 129, "lead": 3.262, "group": "Virginia Tech samples"}, {"sample": 130, "lead": 3.322, "group": "Virginia Tech samples"}, {"sample": 131, "lead": 3.341, "group": "Virginia Tech samples"}, {"sample": 132, "lead": 3.365, "group": "Virginia Tech samples"}, {"sample": 133, "lead": 3.4, "group": "Virginia Tech samples"}, {"sample": 134, "lead": 3.445, "group": "Virginia Tech samples"}, {"sample": 135, "lead": 3.484, "group": "Virginia Tech samples"}, {"sample": 136, "lead": 3.521, "group": "Virginia Tech samples"}, {"sample": 137, "lead": 3.564, "group": "Virginia Tech samples"}, {"sample": 138, "lead": 3.679, "group": "Virginia Tech samples"}, {"sample": 139, "lead": 3.741, "group": "Virginia Tech samples"}, {"sample": 140, "lead": 3.744, "group": "Virginia Tech samples"}, {"sample": 141, "lead": 3.784, "group": "Virginia Tech samples"}, {"sample": 142, "lead": 3.832, "group": "Virginia Tech samples"}, {"sample": 143, "lead": 3.9, "group": "Virginia Tech samples"}, {"sample": 144, "lead": 3.9, "group": "Virginia Tech samples"}, {"sample": 145, "lead": 4.056, "group": "Virginia Tech samples"}, {"sample": 146, "lead": 4.062, "group": "Virginia Tech samples"}, {"sample": 147, "lead": 4.066, "group": "Virginia Tech samples"}, {"sample": 148, "lead": 4.152, "group": "Virginia Tech samples"}, {"sample": 149, "lead": 4.287, "group": "Virginia Tech samples"}, {"sample": 150, "lead": 4.358, "group": "Virginia Tech samples"}, {"sample": 151, "lead": 4.401, "group": "Virginia Tech samples"}, {"sample": 152, "lead": 4.453, "group": "Virginia Tech samples"}, {"sample": 153, "lead": 4.47, "group": "Virginia Tech samples"}, {"sample": 154, "lead": 4.476, "group": "Virginia Tech samples"}, {"sample": 155, "lead": 4.563, "group": "Virginia Tech samples"}, {"sample": 156, "lead": 4.681, "group": "Virginia Tech samples"}, {"sample": 157, "lead": 4.69, "group": "Virginia Tech samples"}, {"sample": 158, "lead": 4.699, "group": "Virginia Tech samples"}, {"sample": 159, "lead": 4.764, "group": "Virginia Tech samples"}, {"sample": 160, "lead": 4.797, "group": "Virginia Tech samples"}, {"sample": 161, "lead": 4.808, "group": "Virginia Tech samples"}, {"sample": 162, "lead": 5.06, "group": "Virginia Tech samples"}, {"sample": 163, "lead": 5.068, "group": "Virginia Tech samples"}, {"sample": 164, "lead": 5.153, "group": "Virginia Tech samples"}, {"sample": 165, "lead": 5.218, "group": "Virginia Tech samples"}, {"sample": 166, "lead": 5.228, "group": "Virginia Tech samples"}, {"sample": 167, "lead": 5.3, "group": "Virginia Tech samples"}, {"sample": 168, "lead": 5.35, "group": "Virginia Tech samples"}, {"sample": 169, "lead": 5.367, "group": "Virginia Tech samples"}, {"sample": 170, "lead": 5.402, "group": "Virginia Tech samples"}, {"sample": 171, "lead": 5.5, "group": "Virginia Tech samples"}, {"sample": 172, "lead": 5.508, "group": "Virginia Tech samples"}, {"sample": 173, "lead": 5.59, "group": "Virginia Tech samples"}, {"sample": 174, "lead": 5.655, "group": "Virginia Tech samples"}, {"sample": 175, "lead": 5.667, "group": "Virginia Tech samples"}, {"sample": 176, "lead": 5.668, "group": "Virginia Tech samples"}, {"sample": 177, "lead": 6.054, "group": "Virginia Tech samples"}, {"sample": 178, "lead": 6.087, "group": "Virginia Tech samples"}, {"sample": 179, "lead": 6.093, "group": "Virginia Tech samples"}, {"sample": 180, "lead": 6.2, "group": "Virginia Tech samples"}, {"sample": 181, "lead": 6.2, "group": "Virginia Tech samples"}, {"sample": 182, "lead": 6.219, "group": "Virginia Tech samples"}, {"sample": 183, "lead": 6.261, "group": "Virginia Tech samples"}, {"sample": 184, "lead": 6.27, "group": "Virginia Tech samples"}, {"sample": 185, "lead": 6.3, "group": "Virginia Tech samples"}, {"sample": 186, "lead": 6.347, "group": "Virginia Tech samples"}, {"sample": 187, "lead": 6.557, "group": "Virginia Tech samples"}, {"sample": 188, "lead": 6.601, "group": "Virginia Tech samples"}, {"sample": 189, "lead": 6.609, "group": "Virginia Tech samples"}, {"sample": 190, "lead": 6.877, "group": "Virginia Tech samples"}, {"sample": 191, "lead": 7.087, "group": "Virginia Tech samples"}, {"sample": 192, "lead": 7.2, "group": "Virginia Tech samples"}, {"sample": 193, "lead": 7.244, "group": "Virginia Tech samples"}, {"sample": 194, "lead": 7.575, "group": "Virginia Tech samples"}, {"sample": 195, "lead": 7.636, "group": "Virginia Tech samples"}, {"sample": 196, "lead": 8.007, "group": "Virginia Tech samples"}, {"sample": 197, "lead": 8.071, "group": "Virginia Tech samples"}, {"sample": 198, "lead": 8.133, "group": "Virginia Tech samples"}, {"sample": 199, "lead": 8.2, "group": "Virginia Tech samples"}, {"sample": 200, "lead": 8.471, "group": "Virginia Tech samples"}, {"sample": 201, "lead": 8.561, "group": "Virginia Tech samples"}, {"sample": 202, "lead": 8.713, "group": "Virginia Tech samples"}, {"sample": 203, "lead": 8.8, "group": "Virginia Tech samples"}, {"sample": 204, "lead": 9.3, "group": "Virginia Tech samples"}, {"sample": 205, "lead": 9.408, "group": "Virginia Tech samples"}, {"sample": 206, "lead": 9.766, "group": "Virginia Tech samples"}, {"sample": 207, "lead": 9.997, "group": "Virginia Tech samples"}, {"sample": 208, "lead": 10.32, "group": "Virginia Tech samples"}, {"sample": 209, "lead": 10.56, "group": "Virginia Tech samples"}, {"sample": 210, "lead": 10.6, "group": "Virginia Tech samples"}, {"sample": 211, "lead": 10.74, "group": "Virginia Tech samples"}, {"sample": 212, "lead": 10.96, "group": "Virginia Tech samples"}, {"sample": 213, "lead": 11, "group": "Virginia Tech samples"}, {"sample": 214, "lead": 11.2, "group": "Virginia Tech samples"}, {"sample": 215, "lead": 11.47, "group": "Virginia Tech samples"}, {"sample": 216, "lead": 11.52, "group": "Virginia Tech samples"}, {"sample": 217, "lead": 11.57, "group": "Virginia Tech samples"}, {"sample": 218, "lead": 11.93, "group": "Virginia Tech samples"}, {"sample": 219, "lead": 12.3, "group": "Virginia Tech samples"}, {"sample": 220, "lead": 12.55, "group": "Virginia Tech samples"}, {"sample": 221, "lead": 12.81, "group": "Virginia Tech samples"}, {"sample": 222, "lead": 12.87, "group": "Virginia Tech samples"}, {"sample": 223, "lead": 12.9, "group": "Virginia Tech samples"}, {"sample": 224, "lead": 13.53, "group": "Virginia Tech samples"}, {"sample": 225, "lead": 13.95, "group": "Virginia Tech samples"}, {"sample": 226, "lead": 14.33, "group": "Virginia Tech samples"}, {"sample": 227, "lead": 15.55, "group": "Virginia Tech samples"}, {"sample": 228, "lead": 15.73, "group": "Virginia Tech samples"}, {"sample": 229, "lead": 15.9, "group": "Virginia Tech samples"}, {"sample": 230, "lead": 16.49, "group": "Virginia Tech samples"}, {"sample": 231, "lead": 16.51, "group": "Virginia Tech samples"}, {"sample": 232, "lead": 16.52, "group": "Virginia Tech samples"}, {"sample": 233, "lead": 16.99, "group": "Virginia Tech samples"}, {"sample": 234, "lead": 18.11, "group": "Virginia Tech samples"}, {"sample": 235, "lead": 18.86, "group": "Virginia Tech samples"}, {"sample": 236, "lead": 19.12, "group": "Virginia Tech samples"}, {"sample": 237, "lead": 19.16, "group": "Virginia Tech samples"}, {"sample": 238, "lead": 20.22, "group": "Virginia Tech samples"}, {"sample": 239, "lead": 20.41, "group": "Virginia Tech samples"}, {"sample": 240, "lead": 22.08, "group": "Virginia Tech samples"}, {"sample": 241, "lead": 23.85, "group": "Virginia Tech samples"}, {"sample": 242, "lead": 24.37, "group": "Virginia Tech samples"}, {"sample": 243, "lead": 25.21, "group": "Virginia Tech samples"}, {"sample": 244, "lead": 26.64, "group": "Virginia Tech samples"}, {"sample": 245, "lead": 27.02, "group": "Virginia Tech samples"}, {"sample": 246, "lead": 27.05, "group": "Virginia Tech samples"}, {"sample": 247, "lead": 27.45, "group": "Virginia Tech samples"}, {"sample": 248, "lead": 28.7, "group": "Virginia Tech samples"}, {"sample": 249, "lead": 28.91, "group": "Virginia Tech samples"}, {"sample": 250, "lead": 29.13, "group": "Virginia Tech samples"}, {"sample": 251, "lead": 29.59, "group": "Virginia Tech samples"}, {"sample": 252, "lead": 30.91, "group": "Virginia Tech samples"}, {"sample": 253, "lead": 31.06, "group": "Virginia Tech samples"}, {"sample": 254, "lead": 31.14, "group": "Virginia Tech samples"}, {"sample": 255, "lead": 32.85, "group": "Virginia Tech samples"}, {"sample": 256, "lead": 34.13, "group": "Virginia Tech samples"}, {"sample": 257, "lead": 38.02, "group": "Virginia Tech samples"}, {"sample": 258, "lead": 40.63, "group": "Virginia Tech samples"}, {"sample": 259, "lead": 43.19, "group": "Virginia Tech samples"}, {"sample": 260, "lead": 56.26, "group": "Virginia Tech samples"}, {"sample": 261, "lead": 59, "group": "Virginia Tech samples"}, {"sample": 262, "lead": 66.24, "group": "Virginia Tech samples"}, {"sample": 263, "lead": 66.88, "group": "Virginia Tech samples"}, {"sample": 264, "lead": 75.82, "group": "Virginia Tech samples"}, {"sample": 265, "lead": 102.7, "group": "Virginia Tech samples"}, {"sample": 266, "lead": 105.3, "group": "Virginia Tech samples"}, {"sample": 267, "lead": 109.6, "group": "Virginia Tech samples"}, {"sample": 268, "lead": 118.4, "group": "Virginia Tech samples"}, {"sample": 269, "lead": 120, "group": "Virginia Tech samples"}, {"sample": 270, "lead": 138.8, "group": "Virginia Tech samples"}, {"sample": 271, "lead": 158, "group": "Virginia Tech samples"}]}, "semantic_types": {"sample": "ID", "lead": {"semanticType": "Quantity", "unit": "ppb"}, "group": "Category"}, "chart_spec": {"chartType": "Strip Plot", "title": "45 of 271 Virginia Tech samples exceeded the EPA action level (15 ppb)", "subtitle": "Lead concentration, ppb; individual samples on a logarithmic scale, 2015", "source": "TidyTuesday 2025-11-04", "encodings": {"x": {"field": "group"}, "y": {"field": "lead"}}, "chartProperties": {"pointSize": 7, "opacity": 0.7, "logScale_y": true}, "baseSize": {"width": 500, "height": 400}}}, "updates": [{"id": "epa-reference", "ops": [{"op": "set-overlay", "name": "epa-action-level", "value": {"mark": "rule", "role": "reference", "data": {"values": [{"threshold": 15}]}, "encodings": {"y": {"field": "threshold"}}, "style": {"stroke": "#b33a3a", "strokeWidth": 2, "strokeDash": "dash"}}}]}]}, {"key": "gpt-6-luna__gas-prices-1__r1", "question": "Chart weekly regular gasoline prices and label the highest price on record.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"date": "1990-08-20", "fuel": "gasoline", "price": 1.191}, {"date": "1990-08-27", "fuel": "gasoline", "price": 1.245}, {"date": "1990-09-03", "fuel": "gasoline", "price": 1.242}, {"date": "1990-09-10", "fuel": "gasoline", "price": 1.252}, {"date": "1990-09-17", "fuel": "gasoline", "price": 1.266}, {"date": "1990-09-24", "fuel": "gasoline", "price": 1.272}, {"date": "1990-10-01", "fuel": "gasoline", "price": 1.321}, {"date": "1990-10-08", "fuel": "gasoline", "price": 1.333}, {"date": "1990-10-15", "fuel": "gasoline", "price": 1.339}, {"date": "1990-10-22", "fuel": "gasoline", "price": 1.345}, {"date": "1990-10-29", "fuel": "gasoline", "price": 1.339}, {"date": "1990-11-05", "fuel": "gasoline", "price": 1.334}, {"date": "1990-11-12", "fuel": "gasoline", "price": 1.328}, {"date": "1990-11-19", "fuel": "gasoline", "price": 1.323}, {"date": "1990-11-26", "fuel": "gasoline", "price": 1.311}, {"date": "1990-12-03", "fuel": "gasoline", "price": 1.341}, {"date": "1991-01-21", "fuel": "gasoline", "price": 1.192}, {"date": "1991-01-28", "fuel": "gasoline", "price": 1.168}, {"date": "1991-02-04", "fuel": "gasoline", "price": 1.139}, {"date": "1991-02-11", "fuel": "gasoline", "price": 1.106}, {"date": "1991-02-18", "fuel": "gasoline", "price": 1.078}, {"date": "1991-02-25", "fuel": "gasoline", "price": 1.054}, {"date": "1991-03-04", "fuel": "gasoline", "price": 1.025}, {"date": "1991-03-11", "fuel": "gasoline", "price": 1.045}, {"date": "1991-03-18", "fuel": "gasoline", "price": 1.043}, {"date": "1991-03-25", "fuel": "gasoline", "price": 1.047}, {"date": "1991-04-01", "fuel": "gasoline", "price": 1.052}, {"date": "1991-04-08", "fuel": "gasoline", "price": 1.066}, {"date": "1991-04-15", "fuel": "gasoline", "price": 1.069}, {"date": "1991-04-22", "fuel": "gasoline", "price": 1.09}, {"date": "1991-04-29", "fuel": "gasoline", "price": 1.104}, {"date": "1991-05-06", "fuel": "gasoline", "price": 1.113}, {"date": "1991-05-13", "fuel": "gasoline", "price": 1.121}, {"date": "1991-05-20", "fuel": "gasoline", "price": 1.129}, {"date": "1991-05-27", "fuel": "gasoline", "price": 1.14}, {"date": "1991-06-03", "fuel": "gasoline", "price": 1.138}, {"date": "1991-06-10", "fuel": "gasoline", "price": 1.135}, {"date": "1991-06-17", "fuel": "gasoline", "price": 1.126}, {"date": "1991-06-24", "fuel": "gasoline", "price": 1.114}, {"date": "1991-07-01", "fuel": "gasoline", "price": 1.104}, {"date": "1991-07-08", "fuel": "gasoline", "price": 1.098}, {"date": "1991-07-15", "fuel": "gasoline", "price": 1.094}, {"date": "1991-07-22", "fuel": "gasoline", "price": 1.091}, {"date": "1991-07-29", "fuel": "gasoline", "price": 1.091}, {"date": "1991-08-05", "fuel": "gasoline", "price": 1.099}, {"date": "1991-08-12", "fuel": "gasoline", "price": 1.112}, {"date": "1991-08-19", "fuel": "gasoline", "price": 1.124}, {"date": "1991-08-26", "fuel": "gasoline", "price": 1.124}, {"date": "1991-09-02", "fuel": "gasoline", "price": 1.127}, {"date": "1991-09-09", "fuel": "gasoline", "price": 1.12}, {"date": "1991-09-16", "fuel": "gasoline", "price": 1.11}, {"date": "1991-09-23", "fuel": "gasoline", "price": 1.097}, {"date": "1991-09-30", "fuel": "gasoline", "price": 1.092}, {"date": "1991-10-07", "fuel": "gasoline", "price": 1.089}, {"date": "1991-10-14", "fuel": "gasoline", "price": 1.084}, {"date": "1991-10-21", "fuel": "gasoline", "price": 1.088}, {"date": "1991-10-28", "fuel": "gasoline", "price": 1.091}, {"date": "1991-11-04", "fuel": "gasoline", "price": 1.091}, {"date": "1991-11-11", "fuel": "gasoline", "price": 1.102}, {"date": "1991-11-18", "fuel": "gasoline", "price": 1.104}, {"date": "1991-11-25", "fuel": "gasoline", "price": 1.099}, {"date": "1991-12-02", "fuel": "gasoline", "price": 1.099}, {"date": "1991-12-09", "fuel": "gasoline", "price": 1.091}, {"date": "1991-12-16", "fuel": "gasoline", "price": 1.075}, {"date": "1991-12-23", "fuel": "gasoline", "price": 1.063}, {"date": "1991-12-30", "fuel": "gasoline", "price": 1.053}, {"date": "1992-01-06", "fuel": "gasoline", "price": 1.042}, {"date": "1992-01-13", "fuel": "gasoline", "price": 1.026}, {"date": "1992-01-20", "fuel": "gasoline", "price": 1.014}, {"date": "1992-01-27", "fuel": "gasoline", "price": 1.006}, {"date": "1992-02-03", "fuel": "gasoline", "price": 0.995}, {"date": "1992-02-10", "fuel": "gasoline", "price": 1.004}, {"date": "1992-02-17", "fuel": "gasoline", "price": 1.011}, {"date": "1992-02-24", "fuel": "gasoline", "price": 1.014}, {"date": "1992-03-02", "fuel": "gasoline", "price": 1.012}, {"date": "1992-03-09", "fuel": "gasoline", "price": 1.013}, {"date": "1992-03-16", "fuel": "gasoline", "price": 1.01}, {"date": "1992-03-23", "fuel": "gasoline", "price": 1.015}, {"date": "1992-03-30", "fuel": "gasoline", "price": 1.013}, {"date": "1992-04-06", "fuel": "gasoline", "price": 1.026}, {"date": "1992-04-13", "fuel": "gasoline", "price": 1.051}, {"date": "1992-04-20", "fuel": "gasoline", "price": 1.058}, {"date": "1992-04-27", "fuel": "gasoline", "price": 1.072}, {"date": "1992-05-04", "fuel": "gasoline", "price": 1.089}, {"date": "1992-05-11", "fuel": "gasoline", "price": 1.102}, {"date": "1992-05-18", "fuel": "gasoline", "price": 1.118}, {"date": "1992-05-25", "fuel": "gasoline", "price": 1.12}, {"date": "1992-06-01", "fuel": "gasoline", "price": 1.128}, {"date": "1992-06-08", "fuel": "gasoline", "price": 1.143}, {"date": "1992-06-15", "fuel": "gasoline", "price": 1.151}, {"date": "1992-06-22", "fuel": "gasoline", "price": 1.153}, {"date": "1992-06-29", "fuel": "gasoline", "price": 1.149}, {"date": "1992-07-06", "fuel": "gasoline", "price": 1.147}, {"date": "1992-07-13", "fuel": "gasoline", "price": 1.139}, {"date": "1992-07-20", "fuel": "gasoline", "price": 1.132}, {"date": "1992-07-27", "fuel": "gasoline", "price": 1.128}, {"date": "1992-08-03", "fuel": "gasoline", "price": 1.126}, {"date": "1992-08-10", "fuel": "gasoline", "price": 1.123}, {"date": "1992-08-17", "fuel": "gasoline", "price": 1.116}, {"date": "1992-08-24", "fuel": "gasoline", "price": 1.123}, {"date": "1992-08-31", "fuel": "gasoline", "price": 1.121}, {"date": "1992-09-07", "fuel": "gasoline", "price": 1.121}, {"date": "1992-09-14", "fuel": "gasoline", "price": 1.124}, {"date": "1992-09-21", "fuel": "gasoline", "price": 1.123}, {"date": "1992-09-28", "fuel": "gasoline", "price": 1.118}, {"date": "1992-10-05", "fuel": "gasoline", "price": 1.115}, {"date": "1992-10-12", "fuel": "gasoline", "price": 1.115}, {"date": "1992-10-19", "fuel": "gasoline", "price": 1.113}, {"date": "1992-10-26", "fuel": "gasoline", "price": 1.113}, {"date": "1992-11-02", "fuel": "gasoline", "price": 1.12}, {"date": "1992-11-09", "fuel": "gasoline", "price": 1.12}, {"date": "1992-11-16", "fuel": "gasoline", "price": 1.112}, {"date": "1992-11-23", "fuel": "gasoline", "price": 1.106}, {"date": "1992-11-30", "fuel": "gasoline", "price": 1.098}, {"date": "1992-12-07", "fuel": "gasoline", "price": 1.089}, {"date": "1992-12-14", "fuel": "gasoline", "price": 1.078}, {"date": "1992-12-21", "fuel": "gasoline", "price": 1.074}, {"date": "1992-12-28", "fuel": "gasoline", "price": 1.069}, {"date": "1993-01-04", "fuel": "gasoline", "price": 1.065}, {"date": "1993-01-11", "fuel": "gasoline", "price": 1.066}, {"date": "1993-01-18", "fuel": "gasoline", "price": 1.061}, {"date": "1993-01-25", "fuel": "gasoline", "price": 1.055}, {"date": "1993-02-01", "fuel": "gasoline", "price": 1.055}, {"date": "1993-02-08", "fuel": "gasoline", "price": 1.062}, {"date": "1993-02-15", "fuel": "gasoline", "price": 1.053}, {"date": "1993-02-22", "fuel": "gasoline", "price": 1.047}, {"date": "1993-03-01", "fuel": "gasoline", "price": 1.042}, {"date": "1993-03-08", "fuel": "gasoline", "price": 1.048}, {"date": "1993-03-15", "fuel": "gasoline", "price": 1.058}, {"date": "1993-03-22", "fuel": "gasoline", "price": 1.056}, {"date": "1993-03-29", "fuel": "gasoline", "price": 1.057}, {"date": "1993-04-05", "fuel": "gasoline", "price": 1.068}, {"date": "1993-04-12", "fuel": "gasoline", "price": 1.079}, {"date": "1993-04-19", "fuel": "gasoline", "price": 1.079}, {"date": "1993-04-26", "fuel": "gasoline", "price": 1.086}, {"date": "1993-05-03", "fuel": "gasoline", "price": 1.086}, {"date": "1993-05-10", "fuel": "gasoline", "price": 1.097}, {"date": "1993-05-17", "fuel": "gasoline", "price": 1.106}, {"date": "1993-05-24", "fuel": "gasoline", "price": 1.106}, {"date": "1993-05-31", "fuel": "gasoline", "price": 1.107}, {"date": "1993-06-07", "fuel": "gasoline", "price": 1.104}, {"date": "1993-06-14", "fuel": "gasoline", "price": 1.101}, {"date": "1993-06-21", "fuel": "gasoline", "price": 1.095}, {"date": "1993-06-28", "fuel": "gasoline", "price": 1.089}, {"date": "1993-07-05", "fuel": "gasoline", "price": 1.086}, {"date": "1993-07-12", "fuel": "gasoline", "price": 1.081}, {"date": "1993-07-19", "fuel": "gasoline", "price": 1.075}, {"date": "1993-07-26", "fuel": "gasoline", "price": 1.069}, {"date": "1993-08-02", "fuel": "gasoline", "price": 1.062}, {"date": "1993-08-09", "fuel": "gasoline", "price": 1.06}, {"date": "1993-08-16", "fuel": "gasoline", "price": 1.059}, {"date": "1993-08-23", "fuel": "gasoline", "price": 1.065}, {"date": "1993-08-30", "fuel": "gasoline", "price": 1.062}, {"date": "1993-09-06", "fuel": "gasoline", "price": 1.055}, {"date": "1993-09-13", "fuel": "gasoline", "price": 1.051}, {"date": "1993-09-20", "fuel": "gasoline", "price": 1.045}, {"date": "1993-09-27", "fuel": "gasoline", "price": 1.047}, {"date": "1993-10-04", "fuel": "gasoline", "price": 1.092}, {"date": "1993-10-11", "fuel": "gasoline", "price": 1.09}, {"date": "1993-10-18", "fuel": "gasoline", "price": 1.093}, {"date": "1993-10-25", "fuel": "gasoline", "price": 1.092}, {"date": "1993-11-01", "fuel": "gasoline", "price": 1.084}, {"date": "1993-11-08", "fuel": "gasoline", "price": 1.075}, {"date": "1993-11-15", "fuel": "gasoline", "price": 1.064}, {"date": "1993-11-22", "fuel": "gasoline", "price": 1.058}, {"date": "1993-11-29", "fuel": "gasoline", "price": 1.051}, {"date": "1993-12-06", "fuel": "gasoline", "price": 1.036}, {"date": "1993-12-13", "fuel": "gasoline", "price": 1.018}, {"date": "1993-12-20", "fuel": "gasoline", "price": 1.003}, {"date": "1993-12-27", "fuel": "gasoline", "price": 0.999}, {"date": "1994-01-03", "fuel": "gasoline", "price": 0.992}, {"date": "1994-01-10", "fuel": "gasoline", "price": 0.995}, {"date": "1994-01-17", "fuel": "gasoline", "price": 1.001}, {"date": "1994-01-24", "fuel": "gasoline", "price": 0.999}, {"date": "1994-01-31", "fuel": "gasoline", "price": 1.005}, {"date": "1994-02-07", "fuel": "gasoline", "price": 1.007}, {"date": "1994-02-14", "fuel": "gasoline", "price": 1.016}, {"date": "1994-02-21", "fuel": "gasoline", "price": 1.009}, {"date": "1994-02-28", "fuel": "gasoline", "price": 1.004}, {"date": "1994-03-07", "fuel": "gasoline", "price": 1.007}, {"date": "1994-03-14", "fuel": "gasoline", "price": 1.005}, {"date": "1994-03-21", "fuel": "gasoline", "price": 1.007}, {"date": "1994-03-28", "fuel": "gasoline", "price": 1.012}, {"date": "1994-04-04", "fuel": "gasoline", "price": 1.011}, {"date": "1994-04-11", "fuel": "gasoline", "price": 1.028}, {"date": "1994-04-18", "fuel": "gasoline", "price": 1.033}, {"date": "1994-04-25", "fuel": "gasoline", "price": 1.037}, {"date": "1994-05-02", "fuel": "gasoline", "price": 1.04}, {"date": "1994-05-09", "fuel": "gasoline", "price": 1.045}, {"date": "1994-05-16", "fuel": "gasoline", "price": 1.046}, {"date": "1994-05-23", "fuel": "gasoline", "price": 1.05}, {"date": "1994-05-30", "fuel": "gasoline", "price": 1.056}, {"date": "1994-06-06", "fuel": "gasoline", "price": 1.065}, {"date": "1994-06-13", "fuel": "gasoline", "price": 1.073}, {"date": "1994-06-20", "fuel": "gasoline", "price": 1.079}, {"date": "1994-06-27", "fuel": "gasoline", "price": 1.095}, {"date": "1994-07-04", "fuel": "gasoline", "price": 1.097}, {"date": "1994-07-11", "fuel": "gasoline", "price": 1.103}, {"date": "1994-07-18", "fuel": "gasoline", "price": 1.109}, {"date": "1994-07-25", "fuel": "gasoline", "price": 1.114}, {"date": "1994-08-01", "fuel": "gasoline", "price": 1.13}, {"date": "1994-08-08", "fuel": "gasoline", "price": 1.157}, {"date": "1994-08-15", "fuel": "gasoline", "price": 1.161}, {"date": "1994-08-22", "fuel": "gasoline", "price": 1.165}, {"date": "1994-08-29", "fuel": "gasoline", "price": 1.161}, {"date": "1994-09-05", "fuel": "gasoline", "price": 1.156}, {"date": "1994-09-12", "fuel": "gasoline", "price": 1.15}, {"date": "1994-09-19", "fuel": "gasoline", "price": 1.14}, {"date": "1994-09-26", "fuel": "gasoline", "price": 1.129}, {"date": "1994-10-03", "fuel": "gasoline", "price": 1.12}, {"date": "1994-10-10", "fuel": "gasoline", "price": 1.114}, {"date": "1994-10-17", "fuel": "gasoline", "price": 1.106}, {"date": "1994-10-24", "fuel": "gasoline", "price": 1.107}, {"date": "1994-10-31", "fuel": "gasoline", "price": 1.121}, {"date": "1994-11-07", "fuel": "gasoline", "price": 1.123}, {"date": "1994-11-14", "fuel": "gasoline", "price": 1.122}, {"date": "1994-11-21", "fuel": "gasoline", "price": 1.113}, {"date": "1994-11-28", "fuel": "gasoline", "price": 1.105}, {"date": "1994-12-05", "fuel": "gasoline", "price": 1.103}, {"date": "1994-12-12", "fuel": "gasoline", "price": 1.095}, {"date": "1994-12-19", "fuel": "gasoline", "price": 1.087}, {"date": "1994-12-26", "fuel": "gasoline", "price": 1.077}, {"date": "1995-01-02", "fuel": "gasoline", "price": 1.079}, {"date": "1995-01-09", "fuel": "gasoline", "price": 1.086}, {"date": "1995-01-16", "fuel": "gasoline", "price": 1.078}, {"date": "1995-01-23", "fuel": "gasoline", "price": 1.083}, {"date": "1995-01-30", "fuel": "gasoline", "price": 1.083}, {"date": "1995-02-06", "fuel": "gasoline", "price": 1.076}, {"date": "1995-02-13", "fuel": "gasoline", "price": 1.074}, {"date": "1995-02-20", "fuel": "gasoline", "price": 1.067}, {"date": "1995-02-27", "fuel": "gasoline", "price": 1.073}, {"date": "1995-03-06", "fuel": "gasoline", "price": 1.076}, {"date": "1995-03-13", "fuel": "gasoline", "price": 1.069}, {"date": "1995-03-20", "fuel": "gasoline", "price": 1.068}, {"date": "1995-03-27", "fuel": "gasoline", "price": 1.075}, {"date": "1995-04-03", "fuel": "gasoline", "price": 1.087}, {"date": "1995-04-10", "fuel": "gasoline", "price": 1.103}, {"date": "1995-04-17", "fuel": "gasoline", "price": 1.117}, {"date": "1995-04-24", "fuel": "gasoline", "price": 1.138}, {"date": "1995-05-01", "fuel": "gasoline", "price": 1.148}, {"date": "1995-05-08", "fuel": "gasoline", "price": 1.169}, {"date": "1995-05-15", "fuel": "gasoline", "price": 1.179}, {"date": "1995-05-22", "fuel": "gasoline", "price": 1.197}, {"date": "1995-05-29", "fuel": "gasoline", "price": 1.199}, {"date": "1995-06-05", "fuel": "gasoline", "price": 1.199}, {"date": "1995-06-12", "fuel": "gasoline", "price": 1.196}, {"date": "1995-06-19", "fuel": "gasoline", "price": 1.189}, {"date": "1995-06-26", "fuel": "gasoline", "price": 1.182}, {"date": "1995-07-03", "fuel": "gasoline", "price": 1.175}, {"date": "1995-07-10", "fuel": "gasoline", "price": 1.165}, {"date": "1995-07-17", "fuel": "gasoline", "price": 1.153}, {"date": "1995-07-24", "fuel": "gasoline", "price": 1.144}, {"date": "1995-07-31", "fuel": "gasoline", "price": 1.132}, {"date": "1995-08-07", "fuel": "gasoline", "price": 1.127}, {"date": "1995-08-14", "fuel": "gasoline", "price": 1.125}, {"date": "1995-08-21", "fuel": "gasoline", "price": 1.124}, {"date": "1995-08-28", "fuel": "gasoline", "price": 1.117}, {"date": "1995-09-04", "fuel": "gasoline", "price": 1.113}, {"date": "1995-09-11", "fuel": "gasoline", "price": 1.111}, {"date": "1995-09-18", "fuel": "gasoline", "price": 1.11}, {"date": "1995-09-25", "fuel": "gasoline", "price": 1.109}, {"date": "1995-10-02", "fuel": "gasoline", "price": 1.105}, {"date": "1995-10-09", "fuel": "gasoline", "price": 1.097}, {"date": "1995-10-16", "fuel": "gasoline", "price": 1.087}, {"date": "1995-10-23", "fuel": "gasoline", "price": 1.079}, {"date": "1995-10-30", "fuel": "gasoline", "price": 1.068}, {"date": "1995-11-06", "fuel": "gasoline", "price": 1.065}, {"date": "1995-11-13", "fuel": "gasoline", "price": 1.063}, {"date": "1995-11-20", "fuel": "gasoline", "price": 1.06}, {"date": "1995-11-27", "fuel": "gasoline", "price": 1.061}, {"date": "1995-12-04", "fuel": "gasoline", "price": 1.062}, {"date": "1995-12-11", "fuel": "gasoline", "price": 1.063}, {"date": "1995-12-18", "fuel": "gasoline", "price": 1.078}, {"date": "1995-12-25", "fuel": "gasoline", "price": 1.082}, {"date": "1996-01-01", "fuel": "gasoline", "price": 1.083}, {"date": "1996-01-08", "fuel": "gasoline", "price": 1.093}, {"date": "1996-01-15", "fuel": "gasoline", "price": 1.098}, {"date": "1996-01-22", "fuel": "gasoline", "price": 1.091}, {"date": "1996-01-29", "fuel": "gasoline", "price": 1.087}, {"date": "1996-02-05", "fuel": "gasoline", "price": 1.083}, {"date": "1996-02-12", "fuel": "gasoline", "price": 1.08}, {"date": "1996-02-19", "fuel": "gasoline", "price": 1.087}, {"date": "1996-02-26", "fuel": "gasoline", "price": 1.107}, {"date": "1996-03-04", "fuel": "gasoline", "price": 1.124}, {"date": "1996-03-11", "fuel": "gasoline", "price": 1.125}, {"date": "1996-03-18", "fuel": "gasoline", "price": 1.135}, {"date": "1996-03-25", "fuel": "gasoline", "price": 1.164}, {"date": "1996-04-01", "fuel": "gasoline", "price": 1.178}, {"date": "1996-04-08", "fuel": "gasoline", "price": 1.204}, {"date": "1996-04-15", "fuel": "gasoline", "price": 1.242}, {"date": "1996-04-22", "fuel": "gasoline", "price": 1.256}, {"date": "1996-04-29", "fuel": "gasoline", "price": 1.273}, {"date": "1996-05-06", "fuel": "gasoline", "price": 1.275}, {"date": "1996-05-13", "fuel": "gasoline", "price": 1.277}, {"date": "1996-05-20", "fuel": "gasoline", "price": 1.285}, {"date": "1996-05-27", "fuel": "gasoline", "price": 1.275}, {"date": "1996-06-03", "fuel": "gasoline", "price": 1.269}, {"date": "1996-06-10", "fuel": "gasoline", "price": 1.262}, {"date": "1996-06-17", "fuel": "gasoline", "price": 1.258}, {"date": "1996-06-24", "fuel": "gasoline", "price": 1.245}, {"date": "1996-07-01", "fuel": "gasoline", "price": 1.234}, {"date": "1996-07-08", "fuel": "gasoline", "price": 1.231}, {"date": "1996-07-15", "fuel": "gasoline", "price": 1.228}, {"date": "1996-07-22", "fuel": "gasoline", "price": 1.227}, {"date": "1996-07-29", "fuel": "gasoline", "price": 1.218}, {"date": "1996-08-05", "fuel": "gasoline", "price": 1.207}, {"date": "1996-08-12", "fuel": "gasoline", "price": 1.203}, {"date": "1996-08-19", "fuel": "gasoline", "price": 1.205}, {"date": "1996-08-26", "fuel": "gasoline", "price": 1.209}, {"date": "1996-09-02", "fuel": "gasoline", "price": 1.197}, {"date": "1996-09-09", "fuel": "gasoline", "price": 1.203}, {"date": "1996-09-16", "fuel": "gasoline", "price": 1.206}, {"date": "1996-09-23", "fuel": "gasoline", "price": 1.206}, {"date": "1996-09-30", "fuel": "gasoline", "price": 1.2}, {"date": "1996-10-07", "fuel": "gasoline", "price": 1.194}, {"date": "1996-10-14", "fuel": "gasoline", "price": 1.203}, {"date": "1996-10-21", "fuel": "gasoline", "price": 1.204}, {"date": "1996-10-28", "fuel": "gasoline", "price": 1.215}, {"date": "1996-11-04", "fuel": "gasoline", "price": 1.223}, {"date": "1996-11-11", "fuel": "gasoline", "price": 1.226}, {"date": "1996-11-18", "fuel": "gasoline", "price": 1.236}, {"date": "1996-11-25", "fuel": "gasoline", "price": 1.244}, {"date": "1996-12-02", "fuel": "gasoline", "price": 1.241}, {"date": "1996-12-09", "fuel": "gasoline", "price": 1.241}, {"date": "1996-12-16", "fuel": "gasoline", "price": 1.236}, {"date": "1996-12-23", "fuel": "gasoline", "price": 1.231}, {"date": "1996-12-30", "fuel": "gasoline", "price": 1.227}, {"date": "1997-01-06", "fuel": "gasoline", "price": 1.225}, {"date": "1997-01-13", "fuel": "gasoline", "price": 1.241}, {"date": "1997-01-20", "fuel": "gasoline", "price": 1.241}, {"date": "1997-01-27", "fuel": "gasoline", "price": 1.238}, {"date": "1997-02-03", "fuel": "gasoline", "price": 1.236}, {"date": "1997-02-10", "fuel": "gasoline", "price": 1.234}, {"date": "1997-02-17", "fuel": "gasoline", "price": 1.227}, {"date": "1997-02-24", "fuel": "gasoline", "price": 1.223}, {"date": "1997-03-03", "fuel": "gasoline", "price": 1.215}, {"date": "1997-03-10", "fuel": "gasoline", "price": 1.206}, {"date": "1997-03-17", "fuel": "gasoline", "price": 1.2}, {"date": "1997-03-24", "fuel": "gasoline", "price": 1.204}, {"date": "1997-03-31", "fuel": "gasoline", "price": 1.2}, {"date": "1997-04-07", "fuel": "gasoline", "price": 1.203}, {"date": "1997-04-14", "fuel": "gasoline", "price": 1.199}, {"date": "1997-04-21", "fuel": "gasoline", "price": 1.199}, {"date": "1997-04-28", "fuel": "gasoline", "price": 1.195}, {"date": "1997-05-05", "fuel": "gasoline", "price": 1.193}, {"date": "1997-05-12", "fuel": "gasoline", "price": 1.193}, {"date": "1997-05-19", "fuel": "gasoline", "price": 1.203}, {"date": "1997-05-26", "fuel": "gasoline", "price": 1.212}, {"date": "1997-06-02", "fuel": "gasoline", "price": 1.215}, {"date": "1997-06-09", "fuel": "gasoline", "price": 1.207}, {"date": "1997-06-16", "fuel": "gasoline", "price": 1.198}, {"date": "1997-06-23", "fuel": "gasoline", "price": 1.187}, {"date": "1997-06-30", "fuel": "gasoline", "price": 1.181}, {"date": "1997-07-07", "fuel": "gasoline", "price": 1.177}, {"date": "1997-07-14", "fuel": "gasoline", "price": 1.173}, {"date": "1997-07-21", "fuel": "gasoline", "price": 1.177}, {"date": "1997-07-28", "fuel": "gasoline", "price": 1.17}, {"date": "1997-08-04", "fuel": "gasoline", "price": 1.193}, {"date": "1997-08-11", "fuel": "gasoline", "price": 1.228}, {"date": "1997-08-18", "fuel": "gasoline", "price": 1.229}, {"date": "1997-08-25", "fuel": "gasoline", "price": 1.244}, {"date": "1997-09-01", "fuel": "gasoline", "price": 1.243}, {"date": "1997-09-08", "fuel": "gasoline", "price": 1.243}, {"date": "1997-09-15", "fuel": "gasoline", "price": 1.236}, {"date": "1997-09-22", "fuel": "gasoline", "price": 1.225}, {"date": "1997-09-29", "fuel": "gasoline", "price": 1.21}, {"date": "1997-10-06", "fuel": "gasoline", "price": 1.209}, {"date": "1997-10-13", "fuel": "gasoline", "price": 1.203}, {"date": "1997-10-20", "fuel": "gasoline", "price": 1.193}, {"date": "1997-10-27", "fuel": "gasoline", "price": 1.182}, {"date": "1997-11-03", "fuel": "gasoline", "price": 1.176}, {"date": "1997-11-10", "fuel": "gasoline", "price": 1.177}, {"date": "1997-11-17", "fuel": "gasoline", "price": 1.168}, {"date": "1997-11-24", "fuel": "gasoline", "price": 1.162}, {"date": "1997-12-01", "fuel": "gasoline", "price": 1.152}, {"date": "1997-12-08", "fuel": "gasoline", "price": 1.141}, {"date": "1997-12-15", "fuel": "gasoline", "price": 1.131}, {"date": "1997-12-22", "fuel": "gasoline", "price": 1.121}, {"date": "1997-12-29", "fuel": "gasoline", "price": 1.112}, {"date": "1998-01-05", "fuel": "gasoline", "price": 1.102}, {"date": "1998-01-12", "fuel": "gasoline", "price": 1.094}, {"date": "1998-01-19", "fuel": "gasoline", "price": 1.083}, {"date": "1998-01-26", "fuel": "gasoline", "price": 1.066}, {"date": "1998-02-02", "fuel": "gasoline", "price": 1.061}, {"date": "1998-02-09", "fuel": "gasoline", "price": 1.053}, {"date": "1998-02-16", "fuel": "gasoline", "price": 1.038}, {"date": "1998-02-23", "fuel": "gasoline", "price": 1.044}, {"date": "1998-03-02", "fuel": "gasoline", "price": 1.028}, {"date": "1998-03-09", "fuel": "gasoline", "price": 1.018}, {"date": "1998-03-16", "fuel": "gasoline", "price": 1.008}, {"date": "1998-03-23", "fuel": "gasoline", "price": 1}, {"date": "1998-03-30", "fuel": "gasoline", "price": 1.03}, {"date": "1998-04-06", "fuel": "gasoline", "price": 1.028}, {"date": "1998-04-13", "fuel": "gasoline", "price": 1.025}, {"date": "1998-04-20", "fuel": "gasoline", "price": 1.028}, {"date": "1998-04-27", "fuel": "gasoline", "price": 1.04}, {"date": "1998-05-04", "fuel": "gasoline", "price": 1.049}, {"date": "1998-05-11", "fuel": "gasoline", "price": 1.063}, {"date": "1998-05-18", "fuel": "gasoline", "price": 1.072}, {"date": "1998-05-25", "fuel": "gasoline", "price": 1.07}, {"date": "1998-06-01", "fuel": "gasoline", "price": 1.066}, {"date": "1998-06-08", "fuel": "gasoline", "price": 1.075}, {"date": "1998-06-15", "fuel": "gasoline", "price": 1.066}, {"date": "1998-06-22", "fuel": "gasoline", "price": 1.058}, {"date": "1998-06-29", "fuel": "gasoline", "price": 1.057}, {"date": "1998-07-06", "fuel": "gasoline", "price": 1.058}, {"date": "1998-07-13", "fuel": "gasoline", "price": 1.054}, {"date": "1998-07-20", "fuel": "gasoline", "price": 1.059}, {"date": "1998-07-27", "fuel": "gasoline", "price": 1.05}, {"date": "1998-08-03", "fuel": "gasoline", "price": 1.039}, {"date": "1998-08-10", "fuel": "gasoline", "price": 1.033}, {"date": "1998-08-17", "fuel": "gasoline", "price": 1.026}, {"date": "1998-08-24", "fuel": "gasoline", "price": 1.019}, {"date": "1998-08-31", "fuel": "gasoline", "price": 1.013}, {"date": "1998-09-07", "fuel": "gasoline", "price": 1.007}, {"date": "1998-09-14", "fuel": "gasoline", "price": 1.002}, {"date": "1998-09-21", "fuel": "gasoline", "price": 1.014}, {"date": "1998-09-28", "fuel": "gasoline", "price": 1.014}, {"date": "1998-10-05", "fuel": "gasoline", "price": 1.019}, {"date": "1998-10-12", "fuel": "gasoline", "price": 1.022}, {"date": "1998-10-19", "fuel": "gasoline", "price": 1.019}, {"date": "1998-10-26", "fuel": "gasoline", "price": 1.015}, {"date": "1998-11-02", "fuel": "gasoline", "price": 1.01}, {"date": "1998-11-09", "fuel": "gasoline", "price": 1.008}, {"date": "1998-11-16", "fuel": "gasoline", "price": 0.996}, {"date": "1998-11-23", "fuel": "gasoline", "price": 0.989}, {"date": "1998-11-30", "fuel": "gasoline", "price": 0.974}, {"date": "1998-12-07", "fuel": "gasoline", "price": 0.954}, {"date": "1998-12-14", "fuel": "gasoline", "price": 0.945}, {"date": "1998-12-21", "fuel": "gasoline", "price": 0.944}, {"date": "1998-12-28", "fuel": "gasoline", "price": 0.937}, {"date": "1999-01-04", "fuel": "gasoline", "price": 0.935}, {"date": "1999-01-11", "fuel": "gasoline", "price": 0.941}, {"date": "1999-01-18", "fuel": "gasoline", "price": 0.944}, {"date": "1999-01-25", "fuel": "gasoline", "price": 0.936}, {"date": "1999-02-01", "fuel": "gasoline", "price": 0.929}, {"date": "1999-02-08", "fuel": "gasoline", "price": 0.927}, {"date": "1999-02-15", "fuel": "gasoline", "price": 0.919}, {"date": "1999-02-22", "fuel": "gasoline", "price": 0.907}, {"date": "1999-03-01", "fuel": "gasoline", "price": 0.913}, {"date": "1999-03-08", "fuel": "gasoline", "price": 0.921}, {"date": "1999-03-15", "fuel": "gasoline", "price": 0.977}, {"date": "1999-03-22", "fuel": "gasoline", "price": 1.017}, {"date": "1999-03-29", "fuel": "gasoline", "price": 1.082}, {"date": "1999-04-05", "fuel": "gasoline", "price": 1.118}, {"date": "1999-04-12", "fuel": "gasoline", "price": 1.14}, {"date": "1999-04-19", "fuel": "gasoline", "price": 1.135}, {"date": "1999-04-26", "fuel": "gasoline", "price": 1.131}, {"date": "1999-05-03", "fuel": "gasoline", "price": 1.136}, {"date": "1999-05-10", "fuel": "gasoline", "price": 1.14}, {"date": "1999-05-17", "fuel": "gasoline", "price": 1.14}, {"date": "1999-05-24", "fuel": "gasoline", "price": 1.126}, {"date": "1999-05-31", "fuel": "gasoline", "price": 1.111}, {"date": "1999-06-07", "fuel": "gasoline", "price": 1.112}, {"date": "1999-06-14", "fuel": "gasoline", "price": 1.108}, {"date": "1999-06-21", "fuel": "gasoline", "price": 1.124}, {"date": "1999-06-28", "fuel": "gasoline", "price": 1.113}, {"date": "1999-07-05", "fuel": "gasoline", "price": 1.125}, {"date": "1999-07-12", "fuel": "gasoline", "price": 1.143}, {"date": "1999-07-19", "fuel": "gasoline", "price": 1.169}, {"date": "1999-07-26", "fuel": "gasoline", "price": 1.193}, {"date": "1999-08-02", "fuel": "gasoline", "price": 1.195}, {"date": "1999-08-09", "fuel": "gasoline", "price": 1.206}, {"date": "1999-08-16", "fuel": "gasoline", "price": 1.236}, {"date": "1999-08-23", "fuel": "gasoline", "price": 1.234}, {"date": "1999-08-30", "fuel": "gasoline", "price": 1.233}, {"date": "1999-09-06", "fuel": "gasoline", "price": 1.242}, {"date": "1999-09-13", "fuel": "gasoline", "price": 1.25}, {"date": "1999-09-20", "fuel": "gasoline", "price": 1.268}, {"date": "1999-09-27", "fuel": "gasoline", "price": 1.262}, {"date": "1999-10-04", "fuel": "gasoline", "price": 1.255}, {"date": "1999-10-11", "fuel": "gasoline", "price": 1.249}, {"date": "1999-10-18", "fuel": "gasoline", "price": 1.236}, {"date": "1999-10-25", "fuel": "gasoline", "price": 1.237}, {"date": "1999-11-01", "fuel": "gasoline", "price": 1.23}, {"date": "1999-11-08", "fuel": "gasoline", "price": 1.233}, {"date": "1999-11-15", "fuel": "gasoline", "price": 1.251}, {"date": "1999-11-22", "fuel": "gasoline", "price": 1.269}, {"date": "1999-11-29", "fuel": "gasoline", "price": 1.274}, {"date": "1999-12-06", "fuel": "gasoline", "price": 1.273}, {"date": "1999-12-13", "fuel": "gasoline", "price": 1.275}, {"date": "1999-12-20", "fuel": "gasoline", "price": 1.269}, {"date": "1999-12-27", "fuel": "gasoline", "price": 1.273}, {"date": "2000-01-03", "fuel": "gasoline", "price": 1.272}, {"date": "2000-01-10", "fuel": "gasoline", "price": 1.264}, {"date": "2000-01-17", "fuel": "gasoline", "price": 1.277}, {"date": "2000-01-24", "fuel": "gasoline", "price": 1.315}, {"date": "2000-01-31", "fuel": "gasoline", "price": 1.316}, {"date": "2000-02-07", "fuel": "gasoline", "price": 1.325}, {"date": "2000-02-14", "fuel": "gasoline", "price": 1.356}, {"date": "2000-02-21", "fuel": "gasoline", "price": 1.406}, {"date": "2000-02-28", "fuel": "gasoline", "price": 1.421}, {"date": "2000-03-06", "fuel": "gasoline", "price": 1.501}, {"date": "2000-03-13", "fuel": "gasoline", "price": 1.527}, {"date": "2000-03-20", "fuel": "gasoline", "price": 1.529}, {"date": "2000-03-27", "fuel": "gasoline", "price": 1.508}, {"date": "2000-04-03", "fuel": "gasoline", "price": 1.503}, {"date": "2000-04-10", "fuel": "gasoline", "price": 1.475}, {"date": "2000-04-17", "fuel": "gasoline", "price": 1.444}, {"date": "2000-04-24", "fuel": "gasoline", "price": 1.437}, {"date": "2000-05-01", "fuel": "gasoline", "price": 1.42}, {"date": "2000-05-08", "fuel": "gasoline", "price": 1.455}, {"date": "2000-05-15", "fuel": "gasoline", "price": 1.492}, {"date": "2000-05-22", "fuel": "gasoline", "price": 1.527}, {"date": "2000-05-29", "fuel": "gasoline", "price": 1.54}, {"date": "2000-06-05", "fuel": "gasoline", "price": 1.563}, {"date": "2000-06-12", "fuel": "gasoline", "price": 1.631}, {"date": "2000-06-19", "fuel": "gasoline", "price": 1.681}, {"date": "2000-06-26", "fuel": "gasoline", "price": 1.658}, {"date": "2000-07-03", "fuel": "gasoline", "price": 1.625}, {"date": "2000-07-10", "fuel": "gasoline", "price": 1.593}, {"date": "2000-07-17", "fuel": "gasoline", "price": 1.546}, {"date": "2000-07-24", "fuel": "gasoline", "price": 1.52}, {"date": "2000-07-31", "fuel": "gasoline", "price": 1.471}, {"date": "2000-08-07", "fuel": "gasoline", "price": 1.462}, {"date": "2000-08-14", "fuel": "gasoline", "price": 1.447}, {"date": "2000-08-21", "fuel": "gasoline", "price": 1.468}, {"date": "2000-08-28", "fuel": "gasoline", "price": 1.481}, {"date": "2000-09-04", "fuel": "gasoline", "price": 1.53}, {"date": "2000-09-11", "fuel": "gasoline", "price": 1.561}, {"date": "2000-09-18", "fuel": "gasoline", "price": 1.562}, {"date": "2000-09-25", "fuel": "gasoline", "price": 1.548}, {"date": "2000-10-02", "fuel": "gasoline", "price": 1.524}, {"date": "2000-10-09", "fuel": "gasoline", "price": 1.502}, {"date": "2000-10-16", "fuel": "gasoline", "price": 1.539}, {"date": "2000-10-23", "fuel": "gasoline", "price": 1.551}, {"date": "2000-10-30", "fuel": "gasoline", "price": 1.545}, {"date": "2000-11-06", "fuel": "gasoline", "price": 1.526}, {"date": "2000-11-13", "fuel": "gasoline", "price": 1.523}, {"date": "2000-11-20", "fuel": "gasoline", "price": 1.51}, {"date": "2000-11-27", "fuel": "gasoline", "price": 1.51}, {"date": "2000-12-04", "fuel": "gasoline", "price": 1.486}, {"date": "2000-12-11", "fuel": "gasoline", "price": 1.449}, {"date": "2000-12-18", "fuel": "gasoline", "price": 1.422}, {"date": "2000-12-25", "fuel": "gasoline", "price": 1.414}, {"date": "2001-01-01", "fuel": "gasoline", "price": 1.406}, {"date": "2001-01-08", "fuel": "gasoline", "price": 1.425}, {"date": "2001-01-15", "fuel": "gasoline", "price": 1.474}, {"date": "2001-01-22", "fuel": "gasoline", "price": 1.471}, {"date": "2001-01-29", "fuel": "gasoline", "price": 1.46}, {"date": "2001-02-05", "fuel": "gasoline", "price": 1.443}, {"date": "2001-02-12", "fuel": "gasoline", "price": 1.476}, {"date": "2001-02-19", "fuel": "gasoline", "price": 1.449}, {"date": "2001-02-26", "fuel": "gasoline", "price": 1.431}, {"date": "2001-03-05", "fuel": "gasoline", "price": 1.417}, {"date": "2001-03-12", "fuel": "gasoline", "price": 1.412}, {"date": "2001-03-19", "fuel": "gasoline", "price": 1.404}, {"date": "2001-03-26", "fuel": "gasoline", "price": 1.404}, {"date": "2001-04-02", "fuel": "gasoline", "price": 1.442}, {"date": "2001-04-09", "fuel": "gasoline", "price": 1.5}, {"date": "2001-04-16", "fuel": "gasoline", "price": 1.571}, {"date": "2001-04-23", "fuel": "gasoline", "price": 1.619}, {"date": "2001-04-30", "fuel": "gasoline", "price": 1.626}, {"date": "2001-05-07", "fuel": "gasoline", "price": 1.703}, {"date": "2001-05-14", "fuel": "gasoline", "price": 1.713}, {"date": "2001-05-21", "fuel": "gasoline", "price": 1.687}, {"date": "2001-05-28", "fuel": "gasoline", "price": 1.704}, {"date": "2001-06-04", "fuel": "gasoline", "price": 1.679}, {"date": "2001-06-11", "fuel": "gasoline", "price": 1.647}, {"date": "2001-06-18", "fuel": "gasoline", "price": 1.601}, {"date": "2001-06-25", "fuel": "gasoline", "price": 1.538}, {"date": "2001-07-02", "fuel": "gasoline", "price": 1.474}, {"date": "2001-07-09", "fuel": "gasoline", "price": 1.437}, {"date": "2001-07-16", "fuel": "gasoline", "price": 1.413}, {"date": "2001-07-23", "fuel": "gasoline", "price": 1.395}, {"date": "2001-07-30", "fuel": "gasoline", "price": 1.384}, {"date": "2001-08-06", "fuel": "gasoline", "price": 1.376}, {"date": "2001-08-13", "fuel": "gasoline", "price": 1.392}, {"date": "2001-08-20", "fuel": "gasoline", "price": 1.427}, {"date": "2001-08-27", "fuel": "gasoline", "price": 1.488}, {"date": "2001-09-03", "fuel": "gasoline", "price": 1.545}, {"date": "2001-09-10", "fuel": "gasoline", "price": 1.527}, {"date": "2001-09-17", "fuel": "gasoline", "price": 1.529}, {"date": "2001-09-24", "fuel": "gasoline", "price": 1.485}, {"date": "2001-10-01", "fuel": "gasoline", "price": 1.416}, {"date": "2001-10-08", "fuel": "gasoline", "price": 1.352}, {"date": "2001-10-15", "fuel": "gasoline", "price": 1.309}, {"date": "2001-10-22", "fuel": "gasoline", "price": 1.265}, {"date": "2001-10-29", "fuel": "gasoline", "price": 1.235}, {"date": "2001-11-05", "fuel": "gasoline", "price": 1.206}, {"date": "2001-11-12", "fuel": "gasoline", "price": 1.182}, {"date": "2001-11-19", "fuel": "gasoline", "price": 1.167}, {"date": "2001-11-26", "fuel": "gasoline", "price": 1.127}, {"date": "2001-12-03", "fuel": "gasoline", "price": 1.108}, {"date": "2001-12-10", "fuel": "gasoline", "price": 1.095}, {"date": "2001-12-17", "fuel": "gasoline", "price": 1.059}, {"date": "2001-12-24", "fuel": "gasoline", "price": 1.072}, {"date": "2001-12-31", "fuel": "gasoline", "price": 1.096}, {"date": "2002-01-07", "fuel": "gasoline", "price": 1.112}, {"date": "2002-01-14", "fuel": "gasoline", "price": 1.111}, {"date": "2002-01-21", "fuel": "gasoline", "price": 1.105}, {"date": "2002-01-28", "fuel": "gasoline", "price": 1.101}, {"date": "2002-02-04", "fuel": "gasoline", "price": 1.116}, {"date": "2002-02-11", "fuel": "gasoline", "price": 1.107}, {"date": "2002-02-18", "fuel": "gasoline", "price": 1.116}, {"date": "2002-02-25", "fuel": "gasoline", "price": 1.116}, {"date": "2002-03-04", "fuel": "gasoline", "price": 1.144}, {"date": "2002-03-11", "fuel": "gasoline", "price": 1.223}, {"date": "2002-03-18", "fuel": "gasoline", "price": 1.288}, {"date": "2002-03-25", "fuel": "gasoline", "price": 1.342}, {"date": "2002-04-01", "fuel": "gasoline", "price": 1.371}, {"date": "2002-04-08", "fuel": "gasoline", "price": 1.413}, {"date": "2002-04-15", "fuel": "gasoline", "price": 1.404}, {"date": "2002-04-22", "fuel": "gasoline", "price": 1.404}, {"date": "2002-04-29", "fuel": "gasoline", "price": 1.393}, {"date": "2002-05-06", "fuel": "gasoline", "price": 1.395}, {"date": "2002-05-13", "fuel": "gasoline", "price": 1.388}, {"date": "2002-05-20", "fuel": "gasoline", "price": 1.397}, {"date": "2002-05-27", "fuel": "gasoline", "price": 1.387}, {"date": "2002-06-03", "fuel": "gasoline", "price": 1.392}, {"date": "2002-06-10", "fuel": "gasoline", "price": 1.375}, {"date": "2002-06-17", "fuel": "gasoline", "price": 1.378}, {"date": "2002-06-24", "fuel": "gasoline", "price": 1.384}, {"date": "2002-07-01", "fuel": "gasoline", "price": 1.392}, {"date": "2002-07-08", "fuel": "gasoline", "price": 1.382}, {"date": "2002-07-15", "fuel": "gasoline", "price": 1.394}, {"date": "2002-07-22", "fuel": "gasoline", "price": 1.41}, {"date": "2002-07-29", "fuel": "gasoline", "price": 1.407}, {"date": "2002-08-05", "fuel": "gasoline", "price": 1.395}, {"date": "2002-08-12", "fuel": "gasoline", "price": 1.393}, {"date": "2002-08-19", "fuel": "gasoline", "price": 1.392}, {"date": "2002-08-26", "fuel": "gasoline", "price": 1.403}, {"date": "2002-09-02", "fuel": "gasoline", "price": 1.394}, {"date": "2002-09-09", "fuel": "gasoline", "price": 1.395}, {"date": "2002-09-16", "fuel": "gasoline", "price": 1.401}, {"date": "2002-09-23", "fuel": "gasoline", "price": 1.395}, {"date": "2002-09-30", "fuel": "gasoline", "price": 1.413}, {"date": "2002-10-07", "fuel": "gasoline", "price": 1.439}, {"date": "2002-10-14", "fuel": "gasoline", "price": 1.44}, {"date": "2002-10-21", "fuel": "gasoline", "price": 1.458}, {"date": "2002-10-28", "fuel": "gasoline", "price": 1.444}, {"date": "2002-11-04", "fuel": "gasoline", "price": 1.448}, {"date": "2002-11-11", "fuel": "gasoline", "price": 1.439}, {"date": "2002-11-18", "fuel": "gasoline", "price": 1.409}, {"date": "2002-11-25", "fuel": "gasoline", "price": 1.38}, {"date": "2002-12-02", "fuel": "gasoline", "price": 1.364}, {"date": "2002-12-09", "fuel": "gasoline", "price": 1.36}, {"date": "2002-12-16", "fuel": "gasoline", "price": 1.363}, {"date": "2002-12-23", "fuel": "gasoline", "price": 1.401}, {"date": "2002-12-30", "fuel": "gasoline", "price": 1.441}, {"date": "2003-01-06", "fuel": "gasoline", "price": 1.444}, {"date": "2003-01-13", "fuel": "gasoline", "price": 1.454}, {"date": "2003-01-20", "fuel": "gasoline", "price": 1.459}, {"date": "2003-01-27", "fuel": "gasoline", "price": 1.473}, {"date": "2003-02-03", "fuel": "gasoline", "price": 1.527}, {"date": "2003-02-10", "fuel": "gasoline", "price": 1.607}, {"date": "2003-02-17", "fuel": "gasoline", "price": 1.66}, {"date": "2003-02-24", "fuel": "gasoline", "price": 1.658}, {"date": "2003-03-03", "fuel": "gasoline", "price": 1.686}, {"date": "2003-03-10", "fuel": "gasoline", "price": 1.712}, {"date": "2003-03-17", "fuel": "gasoline", "price": 1.728}, {"date": "2003-03-24", "fuel": "gasoline", "price": 1.69}, {"date": "2003-03-31", "fuel": "gasoline", "price": 1.649}, {"date": "2003-04-07", "fuel": "gasoline", "price": 1.63}, {"date": "2003-04-14", "fuel": "gasoline", "price": 1.595}, {"date": "2003-04-21", "fuel": "gasoline", "price": 1.574}, {"date": "2003-04-28", "fuel": "gasoline", "price": 1.557}, {"date": "2003-05-05", "fuel": "gasoline", "price": 1.513}, {"date": "2003-05-12", "fuel": "gasoline", "price": 1.491}, {"date": "2003-05-19", "fuel": "gasoline", "price": 1.498}, {"date": "2003-05-26", "fuel": "gasoline", "price": 1.487}, {"date": "2003-06-02", "fuel": "gasoline", "price": 1.473}, {"date": "2003-06-09", "fuel": "gasoline", "price": 1.49}, {"date": "2003-06-16", "fuel": "gasoline", "price": 1.518}, {"date": "2003-06-23", "fuel": "gasoline", "price": 1.496}, {"date": "2003-06-30", "fuel": "gasoline", "price": 1.487}, {"date": "2003-07-07", "fuel": "gasoline", "price": 1.489}, {"date": "2003-07-14", "fuel": "gasoline", "price": 1.521}, {"date": "2003-07-21", "fuel": "gasoline", "price": 1.524}, {"date": "2003-07-28", "fuel": "gasoline", "price": 1.516}, {"date": "2003-08-04", "fuel": "gasoline", "price": 1.536}, {"date": "2003-08-11", "fuel": "gasoline", "price": 1.571}, {"date": "2003-08-18", "fuel": "gasoline", "price": 1.627}, {"date": "2003-08-25", "fuel": "gasoline", "price": 1.747}, {"date": "2003-09-01", "fuel": "gasoline", "price": 1.746}, {"date": "2003-09-08", "fuel": "gasoline", "price": 1.717}, {"date": "2003-09-15", "fuel": "gasoline", "price": 1.697}, {"date": "2003-09-22", "fuel": "gasoline", "price": 1.643}, {"date": "2003-09-29", "fuel": "gasoline", "price": 1.591}, {"date": "2003-10-06", "fuel": "gasoline", "price": 1.573}, {"date": "2003-10-13", "fuel": "gasoline", "price": 1.568}, {"date": "2003-10-20", "fuel": "gasoline", "price": 1.571}, {"date": "2003-10-27", "fuel": "gasoline", "price": 1.542}, {"date": "2003-11-03", "fuel": "gasoline", "price": 1.535}, {"date": "2003-11-10", "fuel": "gasoline", "price": 1.504}, {"date": "2003-11-17", "fuel": "gasoline", "price": 1.497}, {"date": "2003-11-24", "fuel": "gasoline", "price": 1.512}, {"date": "2003-12-01", "fuel": "gasoline", "price": 1.49}, {"date": "2003-12-08", "fuel": "gasoline", "price": 1.476}, {"date": "2003-12-15", "fuel": "gasoline", "price": 1.465}, {"date": "2003-12-22", "fuel": "gasoline", "price": 1.485}, {"date": "2003-12-29", "fuel": "gasoline", "price": 1.478}, {"date": "2004-01-05", "fuel": "gasoline", "price": 1.51}, {"date": "2004-01-12", "fuel": "gasoline", "price": 1.56}, {"date": "2004-01-19", "fuel": "gasoline", "price": 1.595}, {"date": "2004-01-26", "fuel": "gasoline", "price": 1.622}, {"date": "2004-02-02", "fuel": "gasoline", "price": 1.616}, {"date": "2004-02-09", "fuel": "gasoline", "price": 1.638}, {"date": "2004-02-16", "fuel": "gasoline", "price": 1.648}, {"date": "2004-02-23", "fuel": "gasoline", "price": 1.688}, {"date": "2004-03-01", "fuel": "gasoline", "price": 1.717}, {"date": "2004-03-08", "fuel": "gasoline", "price": 1.738}, {"date": "2004-03-15", "fuel": "gasoline", "price": 1.724}, {"date": "2004-03-22", "fuel": "gasoline", "price": 1.743}, {"date": "2004-03-29", "fuel": "gasoline", "price": 1.758}, {"date": "2004-04-05", "fuel": "gasoline", "price": 1.78}, {"date": "2004-04-12", "fuel": "gasoline", "price": 1.786}, {"date": "2004-04-19", "fuel": "gasoline", "price": 1.813}, {"date": "2004-04-26", "fuel": "gasoline", "price": 1.812}, {"date": "2004-05-03", "fuel": "gasoline", "price": 1.844}, {"date": "2004-05-10", "fuel": "gasoline", "price": 1.941}, {"date": "2004-05-17", "fuel": "gasoline", "price": 2.017}, {"date": "2004-05-24", "fuel": "gasoline", "price": 2.064}, {"date": "2004-05-31", "fuel": "gasoline", "price": 2.051}, {"date": "2004-06-07", "fuel": "gasoline", "price": 2.034}, {"date": "2004-06-14", "fuel": "gasoline", "price": 1.985}, {"date": "2004-06-21", "fuel": "gasoline", "price": 1.937}, {"date": "2004-06-28", "fuel": "gasoline", "price": 1.921}, {"date": "2004-07-05", "fuel": "gasoline", "price": 1.895}, {"date": "2004-07-12", "fuel": "gasoline", "price": 1.917}, {"date": "2004-07-19", "fuel": "gasoline", "price": 1.928}, {"date": "2004-07-26", "fuel": "gasoline", "price": 1.905}, {"date": "2004-08-02", "fuel": "gasoline", "price": 1.888}, {"date": "2004-08-09", "fuel": "gasoline", "price": 1.877}, {"date": "2004-08-16", "fuel": "gasoline", "price": 1.875}, {"date": "2004-08-23", "fuel": "gasoline", "price": 1.884}, {"date": "2004-08-30", "fuel": "gasoline", "price": 1.866}, {"date": "2004-09-06", "fuel": "gasoline", "price": 1.85}, {"date": "2004-09-13", "fuel": "gasoline", "price": 1.846}, {"date": "2004-09-20", "fuel": "gasoline", "price": 1.866}, {"date": "2004-09-27", "fuel": "gasoline", "price": 1.917}, {"date": "2004-10-04", "fuel": "gasoline", "price": 1.938}, {"date": "2004-10-11", "fuel": "gasoline", "price": 1.993}, {"date": "2004-10-18", "fuel": "gasoline", "price": 2.035}, {"date": "2004-10-25", "fuel": "gasoline", "price": 2.032}, {"date": "2004-11-01", "fuel": "gasoline", "price": 2.034}, {"date": "2004-11-08", "fuel": "gasoline", "price": 2.001}, {"date": "2004-11-15", "fuel": "gasoline", "price": 1.969}, {"date": "2004-11-22", "fuel": "gasoline", "price": 1.948}, {"date": "2004-11-29", "fuel": "gasoline", "price": 1.945}, {"date": "2004-12-06", "fuel": "gasoline", "price": 1.911}, {"date": "2004-12-13", "fuel": "gasoline", "price": 1.847}, {"date": "2004-12-20", "fuel": "gasoline", "price": 1.815}, {"date": "2004-12-27", "fuel": "gasoline", "price": 1.791}, {"date": "2005-01-03", "fuel": "gasoline", "price": 1.778}, {"date": "2005-01-10", "fuel": "gasoline", "price": 1.793}, {"date": "2005-01-17", "fuel": "gasoline", "price": 1.819}, {"date": "2005-01-24", "fuel": "gasoline", "price": 1.853}, {"date": "2005-01-31", "fuel": "gasoline", "price": 1.911}, {"date": "2005-02-07", "fuel": "gasoline", "price": 1.909}, {"date": "2005-02-14", "fuel": "gasoline", "price": 1.898}, {"date": "2005-02-21", "fuel": "gasoline", "price": 1.905}, {"date": "2005-02-28", "fuel": "gasoline", "price": 1.928}, {"date": "2005-03-07", "fuel": "gasoline", "price": 1.999}, {"date": "2005-03-14", "fuel": "gasoline", "price": 2.056}, {"date": "2005-03-21", "fuel": "gasoline", "price": 2.109}, {"date": "2005-03-28", "fuel": "gasoline", "price": 2.153}, {"date": "2005-04-04", "fuel": "gasoline", "price": 2.217}, {"date": "2005-04-11", "fuel": "gasoline", "price": 2.28}, {"date": "2005-04-18", "fuel": "gasoline", "price": 2.237}, {"date": "2005-04-25", "fuel": "gasoline", "price": 2.236}, {"date": "2005-05-02", "fuel": "gasoline", "price": 2.235}, {"date": "2005-05-09", "fuel": "gasoline", "price": 2.186}, {"date": "2005-05-16", "fuel": "gasoline", "price": 2.163}, {"date": "2005-05-23", "fuel": "gasoline", "price": 2.125}, {"date": "2005-05-30", "fuel": "gasoline", "price": 2.097}, {"date": "2005-06-06", "fuel": "gasoline", "price": 2.116}, {"date": "2005-06-13", "fuel": "gasoline", "price": 2.13}, {"date": "2005-06-20", "fuel": "gasoline", "price": 2.161}, {"date": "2005-06-27", "fuel": "gasoline", "price": 2.215}, {"date": "2005-07-04", "fuel": "gasoline", "price": 2.226}, {"date": "2005-07-11", "fuel": "gasoline", "price": 2.328}, {"date": "2005-07-18", "fuel": "gasoline", "price": 2.317}, {"date": "2005-07-25", "fuel": "gasoline", "price": 2.289}, {"date": "2005-08-01", "fuel": "gasoline", "price": 2.291}, {"date": "2005-08-08", "fuel": "gasoline", "price": 2.368}, {"date": "2005-08-15", "fuel": "gasoline", "price": 2.55}, {"date": "2005-08-22", "fuel": "gasoline", "price": 2.612}, {"date": "2005-08-29", "fuel": "gasoline", "price": 2.61}, {"date": "2005-09-05", "fuel": "gasoline", "price": 3.069}, {"date": "2005-09-12", "fuel": "gasoline", "price": 2.955}, {"date": "2005-09-19", "fuel": "gasoline", "price": 2.786}, {"date": "2005-09-26", "fuel": "gasoline", "price": 2.803}, {"date": "2005-10-03", "fuel": "gasoline", "price": 2.928}, {"date": "2005-10-10", "fuel": "gasoline", "price": 2.848}, {"date": "2005-10-17", "fuel": "gasoline", "price": 2.725}, {"date": "2005-10-24", "fuel": "gasoline", "price": 2.603}, {"date": "2005-10-31", "fuel": "gasoline", "price": 2.48}, {"date": "2005-11-07", "fuel": "gasoline", "price": 2.376}, {"date": "2005-11-14", "fuel": "gasoline", "price": 2.296}, {"date": "2005-11-21", "fuel": "gasoline", "price": 2.201}, {"date": "2005-11-28", "fuel": "gasoline", "price": 2.154}, {"date": "2005-12-05", "fuel": "gasoline", "price": 2.147}, {"date": "2005-12-12", "fuel": "gasoline", "price": 2.185}, {"date": "2005-12-19", "fuel": "gasoline", "price": 2.211}, {"date": "2005-12-26", "fuel": "gasoline", "price": 2.197}, {"date": "2006-01-02", "fuel": "gasoline", "price": 2.238}, {"date": "2006-01-09", "fuel": "gasoline", "price": 2.327}, {"date": "2006-01-16", "fuel": "gasoline", "price": 2.32}, {"date": "2006-01-23", "fuel": "gasoline", "price": 2.336}, {"date": "2006-01-30", "fuel": "gasoline", "price": 2.357}, {"date": "2006-02-06", "fuel": "gasoline", "price": 2.342}, {"date": "2006-02-13", "fuel": "gasoline", "price": 2.284}, {"date": "2006-02-20", "fuel": "gasoline", "price": 2.24}, {"date": "2006-02-27", "fuel": "gasoline", "price": 2.254}, {"date": "2006-03-06", "fuel": "gasoline", "price": 2.331}, {"date": "2006-03-13", "fuel": "gasoline", "price": 2.366}, {"date": "2006-03-20", "fuel": "gasoline", "price": 2.504}, {"date": "2006-03-27", "fuel": "gasoline", "price": 2.498}, {"date": "2006-04-03", "fuel": "gasoline", "price": 2.588}, {"date": "2006-04-10", "fuel": "gasoline", "price": 2.683}, {"date": "2006-04-17", "fuel": "gasoline", "price": 2.783}, {"date": "2006-04-24", "fuel": "gasoline", "price": 2.914}, {"date": "2006-05-01", "fuel": "gasoline", "price": 2.919}, {"date": "2006-05-08", "fuel": "gasoline", "price": 2.909}, {"date": "2006-05-15", "fuel": "gasoline", "price": 2.947}, {"date": "2006-05-22", "fuel": "gasoline", "price": 2.892}, {"date": "2006-05-29", "fuel": "gasoline", "price": 2.867}, {"date": "2006-06-05", "fuel": "gasoline", "price": 2.892}, {"date": "2006-06-12", "fuel": "gasoline", "price": 2.906}, {"date": "2006-06-19", "fuel": "gasoline", "price": 2.871}, {"date": "2006-06-26", "fuel": "gasoline", "price": 2.869}, {"date": "2006-07-03", "fuel": "gasoline", "price": 2.934}, {"date": "2006-07-10", "fuel": "gasoline", "price": 2.973}, {"date": "2006-07-17", "fuel": "gasoline", "price": 2.989}, {"date": "2006-07-24", "fuel": "gasoline", "price": 3.003}, {"date": "2006-07-31", "fuel": "gasoline", "price": 3.004}, {"date": "2006-08-07", "fuel": "gasoline", "price": 3.038}, {"date": "2006-08-14", "fuel": "gasoline", "price": 3}, {"date": "2006-08-21", "fuel": "gasoline", "price": 2.924}, {"date": "2006-08-28", "fuel": "gasoline", "price": 2.845}, {"date": "2006-09-04", "fuel": "gasoline", "price": 2.727}, {"date": "2006-09-11", "fuel": "gasoline", "price": 2.618}, {"date": "2006-09-18", "fuel": "gasoline", "price": 2.497}, {"date": "2006-09-25", "fuel": "gasoline", "price": 2.378}, {"date": "2006-10-02", "fuel": "gasoline", "price": 2.31}, {"date": "2006-10-09", "fuel": "gasoline", "price": 2.261}, {"date": "2006-10-16", "fuel": "gasoline", "price": 2.226}, {"date": "2006-10-23", "fuel": "gasoline", "price": 2.208}, {"date": "2006-10-30", "fuel": "gasoline", "price": 2.218}, {"date": "2006-11-06", "fuel": "gasoline", "price": 2.2}, {"date": "2006-11-13", "fuel": "gasoline", "price": 2.232}, {"date": "2006-11-20", "fuel": "gasoline", "price": 2.239}, {"date": "2006-11-27", "fuel": "gasoline", "price": 2.246}, {"date": "2006-12-04", "fuel": "gasoline", "price": 2.297}, {"date": "2006-12-11", "fuel": "gasoline", "price": 2.293}, {"date": "2006-12-18", "fuel": "gasoline", "price": 2.32}, {"date": "2006-12-25", "fuel": "gasoline", "price": 2.341}, {"date": "2007-01-01", "fuel": "gasoline", "price": 2.334}, {"date": "2007-01-08", "fuel": "gasoline", "price": 2.306}, {"date": "2007-01-15", "fuel": "gasoline", "price": 2.229}, {"date": "2007-01-22", "fuel": "gasoline", "price": 2.165}, {"date": "2007-01-29", "fuel": "gasoline", "price": 2.165}, {"date": "2007-02-05", "fuel": "gasoline", "price": 2.191}, {"date": "2007-02-12", "fuel": "gasoline", "price": 2.241}, {"date": "2007-02-19", "fuel": "gasoline", "price": 2.296}, {"date": "2007-02-26", "fuel": "gasoline", "price": 2.383}, {"date": "2007-03-05", "fuel": "gasoline", "price": 2.505}, {"date": "2007-03-12", "fuel": "gasoline", "price": 2.559}, {"date": "2007-03-19", "fuel": "gasoline", "price": 2.577}, {"date": "2007-03-26", "fuel": "gasoline", "price": 2.61}, {"date": "2007-04-02", "fuel": "gasoline", "price": 2.707}, {"date": "2007-04-09", "fuel": "gasoline", "price": 2.802}, {"date": "2007-04-16", "fuel": "gasoline", "price": 2.876}, {"date": "2007-04-23", "fuel": "gasoline", "price": 2.869}, {"date": "2007-04-30", "fuel": "gasoline", "price": 2.971}, {"date": "2007-05-07", "fuel": "gasoline", "price": 3.054}, {"date": "2007-05-14", "fuel": "gasoline", "price": 3.103}, {"date": "2007-05-21", "fuel": "gasoline", "price": 3.218}, {"date": "2007-05-28", "fuel": "gasoline", "price": 3.209}, {"date": "2007-06-04", "fuel": "gasoline", "price": 3.157}, {"date": "2007-06-11", "fuel": "gasoline", "price": 3.076}, {"date": "2007-06-18", "fuel": "gasoline", "price": 3.009}, {"date": "2007-06-25", "fuel": "gasoline", "price": 2.982}, {"date": "2007-07-02", "fuel": "gasoline", "price": 2.959}, {"date": "2007-07-09", "fuel": "gasoline", "price": 2.981}, {"date": "2007-07-16", "fuel": "gasoline", "price": 3.049}, {"date": "2007-07-23", "fuel": "gasoline", "price": 2.958}, {"date": "2007-07-30", "fuel": "gasoline", "price": 2.876}, {"date": "2007-08-06", "fuel": "gasoline", "price": 2.838}, {"date": "2007-08-13", "fuel": "gasoline", "price": 2.771}, {"date": "2007-08-20", "fuel": "gasoline", "price": 2.785}, {"date": "2007-08-27", "fuel": "gasoline", "price": 2.749}, {"date": "2007-09-03", "fuel": "gasoline", "price": 2.796}, {"date": "2007-09-10", "fuel": "gasoline", "price": 2.818}, {"date": "2007-09-17", "fuel": "gasoline", "price": 2.787}, {"date": "2007-09-24", "fuel": "gasoline", "price": 2.812}, {"date": "2007-10-01", "fuel": "gasoline", "price": 2.788}, {"date": "2007-10-08", "fuel": "gasoline", "price": 2.77}, {"date": "2007-10-15", "fuel": "gasoline", "price": 2.762}, {"date": "2007-10-22", "fuel": "gasoline", "price": 2.823}, {"date": "2007-10-29", "fuel": "gasoline", "price": 2.872}, {"date": "2007-11-05", "fuel": "gasoline", "price": 3.013}, {"date": "2007-11-12", "fuel": "gasoline", "price": 3.111}, {"date": "2007-11-19", "fuel": "gasoline", "price": 3.099}, {"date": "2007-11-26", "fuel": "gasoline", "price": 3.097}, {"date": "2007-12-03", "fuel": "gasoline", "price": 3.061}, {"date": "2007-12-10", "fuel": "gasoline", "price": 3}, {"date": "2007-12-17", "fuel": "gasoline", "price": 2.998}, {"date": "2007-12-24", "fuel": "gasoline", "price": 2.98}, {"date": "2007-12-31", "fuel": "gasoline", "price": 3.053}, {"date": "2008-01-07", "fuel": "gasoline", "price": 3.109}, {"date": "2008-01-14", "fuel": "gasoline", "price": 3.068}, {"date": "2008-01-21", "fuel": "gasoline", "price": 3.017}, {"date": "2008-01-28", "fuel": "gasoline", "price": 2.977}, {"date": "2008-02-04", "fuel": "gasoline", "price": 2.978}, {"date": "2008-02-11", "fuel": "gasoline", "price": 2.96}, {"date": "2008-02-18", "fuel": "gasoline", "price": 3.042}, {"date": "2008-02-25", "fuel": "gasoline", "price": 3.13}, {"date": "2008-03-03", "fuel": "gasoline", "price": 3.162}, {"date": "2008-03-10", "fuel": "gasoline", "price": 3.225}, {"date": "2008-03-17", "fuel": "gasoline", "price": 3.284}, {"date": "2008-03-24", "fuel": "gasoline", "price": 3.259}, {"date": "2008-03-31", "fuel": "gasoline", "price": 3.29}, {"date": "2008-04-07", "fuel": "gasoline", "price": 3.332}, {"date": "2008-04-14", "fuel": "gasoline", "price": 3.389}, {"date": "2008-04-21", "fuel": "gasoline", "price": 3.508}, {"date": "2008-04-28", "fuel": "gasoline", "price": 3.603}, {"date": "2008-05-05", "fuel": "gasoline", "price": 3.613}, {"date": "2008-05-12", "fuel": "gasoline", "price": 3.722}, {"date": "2008-05-19", "fuel": "gasoline", "price": 3.791}, {"date": "2008-05-26", "fuel": "gasoline", "price": 3.937}, {"date": "2008-06-02", "fuel": "gasoline", "price": 3.976}, {"date": "2008-06-09", "fuel": "gasoline", "price": 4.039}, {"date": "2008-06-16", "fuel": "gasoline", "price": 4.082}, {"date": "2008-06-23", "fuel": "gasoline", "price": 4.079}, {"date": "2008-06-30", "fuel": "gasoline", "price": 4.095}, {"date": "2008-07-07", "fuel": "gasoline", "price": 4.114}, {"date": "2008-07-14", "fuel": "gasoline", "price": 4.113}, {"date": "2008-07-21", "fuel": "gasoline", "price": 4.064}, {"date": "2008-07-28", "fuel": "gasoline", "price": 3.955}, {"date": "2008-08-04", "fuel": "gasoline", "price": 3.88}, {"date": "2008-08-11", "fuel": "gasoline", "price": 3.809}, {"date": "2008-08-18", "fuel": "gasoline", "price": 3.74}, {"date": "2008-08-25", "fuel": "gasoline", "price": 3.685}, {"date": "2008-09-01", "fuel": "gasoline", "price": 3.68}, {"date": "2008-09-08", "fuel": "gasoline", "price": 3.648}, {"date": "2008-09-15", "fuel": "gasoline", "price": 3.835}, {"date": "2008-09-22", "fuel": "gasoline", "price": 3.718}, {"date": "2008-09-29", "fuel": "gasoline", "price": 3.632}, {"date": "2008-10-06", "fuel": "gasoline", "price": 3.484}, {"date": "2008-10-13", "fuel": "gasoline", "price": 3.151}, {"date": "2008-10-20", "fuel": "gasoline", "price": 2.914}, {"date": "2008-10-27", "fuel": "gasoline", "price": 2.656}, {"date": "2008-11-03", "fuel": "gasoline", "price": 2.4}, {"date": "2008-11-10", "fuel": "gasoline", "price": 2.224}, {"date": "2008-11-17", "fuel": "gasoline", "price": 2.072}, {"date": "2008-11-24", "fuel": "gasoline", "price": 1.892}, {"date": "2008-12-01", "fuel": "gasoline", "price": 1.811}, {"date": "2008-12-08", "fuel": "gasoline", "price": 1.699}, {"date": "2008-12-15", "fuel": "gasoline", "price": 1.659}, {"date": "2008-12-22", "fuel": "gasoline", "price": 1.653}, {"date": "2008-12-29", "fuel": "gasoline", "price": 1.613}, {"date": "2009-01-05", "fuel": "gasoline", "price": 1.684}, {"date": "2009-01-12", "fuel": "gasoline", "price": 1.784}, {"date": "2009-01-19", "fuel": "gasoline", "price": 1.847}, {"date": "2009-01-26", "fuel": "gasoline", "price": 1.838}, {"date": "2009-02-02", "fuel": "gasoline", "price": 1.892}, {"date": "2009-02-09", "fuel": "gasoline", "price": 1.926}, {"date": "2009-02-16", "fuel": "gasoline", "price": 1.964}, {"date": "2009-02-23", "fuel": "gasoline", "price": 1.909}, {"date": "2009-03-02", "fuel": "gasoline", "price": 1.934}, {"date": "2009-03-09", "fuel": "gasoline", "price": 1.941}, {"date": "2009-03-16", "fuel": "gasoline", "price": 1.91}, {"date": "2009-03-23", "fuel": "gasoline", "price": 1.962}, {"date": "2009-03-30", "fuel": "gasoline", "price": 2.046}, {"date": "2009-04-06", "fuel": "gasoline", "price": 2.037}, {"date": "2009-04-13", "fuel": "gasoline", "price": 2.051}, {"date": "2009-04-20", "fuel": "gasoline", "price": 2.059}, {"date": "2009-04-27", "fuel": "gasoline", "price": 2.049}, {"date": "2009-05-04", "fuel": "gasoline", "price": 2.078}, {"date": "2009-05-11", "fuel": "gasoline", "price": 2.24}, {"date": "2009-05-18", "fuel": "gasoline", "price": 2.309}, {"date": "2009-05-25", "fuel": "gasoline", "price": 2.435}, {"date": "2009-06-01", "fuel": "gasoline", "price": 2.524}, {"date": "2009-06-08", "fuel": "gasoline", "price": 2.624}, {"date": "2009-06-15", "fuel": "gasoline", "price": 2.672}, {"date": "2009-06-22", "fuel": "gasoline", "price": 2.691}, {"date": "2009-06-29", "fuel": "gasoline", "price": 2.642}, {"date": "2009-07-06", "fuel": "gasoline", "price": 2.612}, {"date": "2009-07-13", "fuel": "gasoline", "price": 2.528}, {"date": "2009-07-20", "fuel": "gasoline", "price": 2.463}, {"date": "2009-07-27", "fuel": "gasoline", "price": 2.503}, {"date": "2009-08-03", "fuel": "gasoline", "price": 2.557}, {"date": "2009-08-10", "fuel": "gasoline", "price": 2.647}, {"date": "2009-08-17", "fuel": "gasoline", "price": 2.637}, {"date": "2009-08-24", "fuel": "gasoline", "price": 2.628}, {"date": "2009-08-31", "fuel": "gasoline", "price": 2.613}, {"date": "2009-09-07", "fuel": "gasoline", "price": 2.588}, {"date": "2009-09-14", "fuel": "gasoline", "price": 2.577}, {"date": "2009-09-21", "fuel": "gasoline", "price": 2.552}, {"date": "2009-09-28", "fuel": "gasoline", "price": 2.499}, {"date": "2009-10-05", "fuel": "gasoline", "price": 2.468}, {"date": "2009-10-12", "fuel": "gasoline", "price": 2.489}, {"date": "2009-10-19", "fuel": "gasoline", "price": 2.574}, {"date": "2009-10-26", "fuel": "gasoline", "price": 2.674}, {"date": "2009-11-02", "fuel": "gasoline", "price": 2.694}, {"date": "2009-11-09", "fuel": "gasoline", "price": 2.666}, {"date": "2009-11-16", "fuel": "gasoline", "price": 2.629}, {"date": "2009-11-23", "fuel": "gasoline", "price": 2.639}, {"date": "2009-11-30", "fuel": "gasoline", "price": 2.629}, {"date": "2009-12-07", "fuel": "gasoline", "price": 2.634}, {"date": "2009-12-14", "fuel": "gasoline", "price": 2.599}, {"date": "2009-12-21", "fuel": "gasoline", "price": 2.589}, {"date": "2009-12-28", "fuel": "gasoline", "price": 2.607}, {"date": "2010-01-04", "fuel": "gasoline", "price": 2.665}, {"date": "2010-01-11", "fuel": "gasoline", "price": 2.751}, {"date": "2010-01-18", "fuel": "gasoline", "price": 2.739}, {"date": "2010-01-25", "fuel": "gasoline", "price": 2.705}, {"date": "2010-02-01", "fuel": "gasoline", "price": 2.661}, {"date": "2010-02-08", "fuel": "gasoline", "price": 2.652}, {"date": "2010-02-15", "fuel": "gasoline", "price": 2.608}, {"date": "2010-02-22", "fuel": "gasoline", "price": 2.655}, {"date": "2010-03-01", "fuel": "gasoline", "price": 2.702}, {"date": "2010-03-08", "fuel": "gasoline", "price": 2.751}, {"date": "2010-03-15", "fuel": "gasoline", "price": 2.788}, {"date": "2010-03-22", "fuel": "gasoline", "price": 2.819}, {"date": "2010-03-29", "fuel": "gasoline", "price": 2.798}, {"date": "2010-04-05", "fuel": "gasoline", "price": 2.826}, {"date": "2010-04-12", "fuel": "gasoline", "price": 2.858}, {"date": "2010-04-19", "fuel": "gasoline", "price": 2.86}, {"date": "2010-04-26", "fuel": "gasoline", "price": 2.849}, {"date": "2010-05-03", "fuel": "gasoline", "price": 2.898}, {"date": "2010-05-10", "fuel": "gasoline", "price": 2.905}, {"date": "2010-05-17", "fuel": "gasoline", "price": 2.864}, {"date": "2010-05-24", "fuel": "gasoline", "price": 2.786}, {"date": "2010-05-31", "fuel": "gasoline", "price": 2.728}, {"date": "2010-06-07", "fuel": "gasoline", "price": 2.725}, {"date": "2010-06-14", "fuel": "gasoline", "price": 2.701}, {"date": "2010-06-21", "fuel": "gasoline", "price": 2.743}, {"date": "2010-06-28", "fuel": "gasoline", "price": 2.757}, {"date": "2010-07-05", "fuel": "gasoline", "price": 2.726}, {"date": "2010-07-12", "fuel": "gasoline", "price": 2.718}, {"date": "2010-07-19", "fuel": "gasoline", "price": 2.722}, {"date": "2010-07-26", "fuel": "gasoline", "price": 2.749}, {"date": "2010-08-02", "fuel": "gasoline", "price": 2.735}, {"date": "2010-08-09", "fuel": "gasoline", "price": 2.783}, {"date": "2010-08-16", "fuel": "gasoline", "price": 2.745}, {"date": "2010-08-23", "fuel": "gasoline", "price": 2.704}, {"date": "2010-08-30", "fuel": "gasoline", "price": 2.682}, {"date": "2010-09-06", "fuel": "gasoline", "price": 2.682}, {"date": "2010-09-13", "fuel": "gasoline", "price": 2.721}, {"date": "2010-09-20", "fuel": "gasoline", "price": 2.723}, {"date": "2010-09-27", "fuel": "gasoline", "price": 2.694}, {"date": "2010-10-04", "fuel": "gasoline", "price": 2.732}, {"date": "2010-10-11", "fuel": "gasoline", "price": 2.819}, {"date": "2010-10-18", "fuel": "gasoline", "price": 2.834}, {"date": "2010-10-25", "fuel": "gasoline", "price": 2.817}, {"date": "2010-11-01", "fuel": "gasoline", "price": 2.806}, {"date": "2010-11-08", "fuel": "gasoline", "price": 2.865}, {"date": "2010-11-15", "fuel": "gasoline", "price": 2.892}, {"date": "2010-11-22", "fuel": "gasoline", "price": 2.876}, {"date": "2010-11-29", "fuel": "gasoline", "price": 2.856}, {"date": "2010-12-06", "fuel": "gasoline", "price": 2.958}, {"date": "2010-12-13", "fuel": "gasoline", "price": 2.98}, {"date": "2010-12-20", "fuel": "gasoline", "price": 2.982}, {"date": "2010-12-27", "fuel": "gasoline", "price": 3.052}, {"date": "2011-01-03", "fuel": "gasoline", "price": 3.07}, {"date": "2011-01-10", "fuel": "gasoline", "price": 3.089}, {"date": "2011-01-17", "fuel": "gasoline", "price": 3.104}, {"date": "2011-01-24", "fuel": "gasoline", "price": 3.11}, {"date": "2011-01-31", "fuel": "gasoline", "price": 3.101}, {"date": "2011-02-07", "fuel": "gasoline", "price": 3.132}, {"date": "2011-02-14", "fuel": "gasoline", "price": 3.14}, {"date": "2011-02-21", "fuel": "gasoline", "price": 3.189}, {"date": "2011-02-28", "fuel": "gasoline", "price": 3.383}, {"date": "2011-03-07", "fuel": "gasoline", "price": 3.52}, {"date": "2011-03-14", "fuel": "gasoline", "price": 3.567}, {"date": "2011-03-21", "fuel": "gasoline", "price": 3.562}, {"date": "2011-03-28", "fuel": "gasoline", "price": 3.596}, {"date": "2011-04-04", "fuel": "gasoline", "price": 3.684}, {"date": "2011-04-11", "fuel": "gasoline", "price": 3.791}, {"date": "2011-04-18", "fuel": "gasoline", "price": 3.844}, {"date": "2011-04-25", "fuel": "gasoline", "price": 3.879}, {"date": "2011-05-02", "fuel": "gasoline", "price": 3.963}, {"date": "2011-05-09", "fuel": "gasoline", "price": 3.965}, {"date": "2011-05-16", "fuel": "gasoline", "price": 3.96}, {"date": "2011-05-23", "fuel": "gasoline", "price": 3.849}, {"date": "2011-05-30", "fuel": "gasoline", "price": 3.794}, {"date": "2011-06-06", "fuel": "gasoline", "price": 3.781}, {"date": "2011-06-13", "fuel": "gasoline", "price": 3.713}, {"date": "2011-06-20", "fuel": "gasoline", "price": 3.652}, {"date": "2011-06-27", "fuel": "gasoline", "price": 3.574}, {"date": "2011-07-04", "fuel": "gasoline", "price": 3.579}, {"date": "2011-07-11", "fuel": "gasoline", "price": 3.641}, {"date": "2011-07-18", "fuel": "gasoline", "price": 3.682}, {"date": "2011-07-25", "fuel": "gasoline", "price": 3.699}, {"date": "2011-08-01", "fuel": "gasoline", "price": 3.711}, {"date": "2011-08-08", "fuel": "gasoline", "price": 3.674}, {"date": "2011-08-15", "fuel": "gasoline", "price": 3.604}, {"date": "2011-08-22", "fuel": "gasoline", "price": 3.581}, {"date": "2011-08-29", "fuel": "gasoline", "price": 3.627}, {"date": "2011-09-05", "fuel": "gasoline", "price": 3.674}, {"date": "2011-09-12", "fuel": "gasoline", "price": 3.661}, {"date": "2011-09-19", "fuel": "gasoline", "price": 3.601}, {"date": "2011-09-26", "fuel": "gasoline", "price": 3.509}, {"date": "2011-10-03", "fuel": "gasoline", "price": 3.433}, {"date": "2011-10-10", "fuel": "gasoline", "price": 3.417}, {"date": "2011-10-17", "fuel": "gasoline", "price": 3.476}, {"date": "2011-10-24", "fuel": "gasoline", "price": 3.462}, {"date": "2011-10-31", "fuel": "gasoline", "price": 3.452}, {"date": "2011-11-07", "fuel": "gasoline", "price": 3.424}, {"date": "2011-11-14", "fuel": "gasoline", "price": 3.436}, {"date": "2011-11-21", "fuel": "gasoline", "price": 3.368}, {"date": "2011-11-28", "fuel": "gasoline", "price": 3.307}, {"date": "2011-12-05", "fuel": "gasoline", "price": 3.29}, {"date": "2011-12-12", "fuel": "gasoline", "price": 3.286}, {"date": "2011-12-19", "fuel": "gasoline", "price": 3.229}, {"date": "2011-12-26", "fuel": "gasoline", "price": 3.258}, {"date": "2012-01-02", "fuel": "gasoline", "price": 3.299}, {"date": "2012-01-09", "fuel": "gasoline", "price": 3.382}, {"date": "2012-01-16", "fuel": "gasoline", "price": 3.391}, {"date": "2012-01-23", "fuel": "gasoline", "price": 3.389}, {"date": "2012-01-30", "fuel": "gasoline", "price": 3.439}, {"date": "2012-02-06", "fuel": "gasoline", "price": 3.482}, {"date": "2012-02-13", "fuel": "gasoline", "price": 3.523}, {"date": "2012-02-20", "fuel": "gasoline", "price": 3.591}, {"date": "2012-02-27", "fuel": "gasoline", "price": 3.721}, {"date": "2012-03-05", "fuel": "gasoline", "price": 3.793}, {"date": "2012-03-12", "fuel": "gasoline", "price": 3.829}, {"date": "2012-03-19", "fuel": "gasoline", "price": 3.867}, {"date": "2012-03-26", "fuel": "gasoline", "price": 3.918}, {"date": "2012-04-02", "fuel": "gasoline", "price": 3.941}, {"date": "2012-04-09", "fuel": "gasoline", "price": 3.939}, {"date": "2012-04-16", "fuel": "gasoline", "price": 3.922}, {"date": "2012-04-23", "fuel": "gasoline", "price": 3.87}, {"date": "2012-04-30", "fuel": "gasoline", "price": 3.83}, {"date": "2012-05-07", "fuel": "gasoline", "price": 3.79}, {"date": "2012-05-14", "fuel": "gasoline", "price": 3.754}, {"date": "2012-05-21", "fuel": "gasoline", "price": 3.715}, {"date": "2012-05-28", "fuel": "gasoline", "price": 3.67}, {"date": "2012-06-04", "fuel": "gasoline", "price": 3.613}, {"date": "2012-06-11", "fuel": "gasoline", "price": 3.572}, {"date": "2012-06-18", "fuel": "gasoline", "price": 3.533}, {"date": "2012-06-25", "fuel": "gasoline", "price": 3.437}, {"date": "2012-07-02", "fuel": "gasoline", "price": 3.356}, {"date": "2012-07-09", "fuel": "gasoline", "price": 3.411}, {"date": "2012-07-16", "fuel": "gasoline", "price": 3.427}, {"date": "2012-07-23", "fuel": "gasoline", "price": 3.494}, {"date": "2012-07-30", "fuel": "gasoline", "price": 3.508}, {"date": "2012-08-06", "fuel": "gasoline", "price": 3.645}, {"date": "2012-08-13", "fuel": "gasoline", "price": 3.721}, {"date": "2012-08-20", "fuel": "gasoline", "price": 3.744}, {"date": "2012-08-27", "fuel": "gasoline", "price": 3.776}, {"date": "2012-09-03", "fuel": "gasoline", "price": 3.843}, {"date": "2012-09-10", "fuel": "gasoline", "price": 3.847}, {"date": "2012-09-17", "fuel": "gasoline", "price": 3.878}, {"date": "2012-09-24", "fuel": "gasoline", "price": 3.826}, {"date": "2012-10-01", "fuel": "gasoline", "price": 3.804}, {"date": "2012-10-08", "fuel": "gasoline", "price": 3.85}, {"date": "2012-10-15", "fuel": "gasoline", "price": 3.819}, {"date": "2012-10-22", "fuel": "gasoline", "price": 3.687}, {"date": "2012-10-29", "fuel": "gasoline", "price": 3.568}, {"date": "2012-11-05", "fuel": "gasoline", "price": 3.492}, {"date": "2012-11-12", "fuel": "gasoline", "price": 3.449}, {"date": "2012-11-19", "fuel": "gasoline", "price": 3.429}, {"date": "2012-11-26", "fuel": "gasoline", "price": 3.437}, {"date": "2012-12-03", "fuel": "gasoline", "price": 3.394}, {"date": "2012-12-10", "fuel": "gasoline", "price": 3.349}, {"date": "2012-12-17", "fuel": "gasoline", "price": 3.254}, {"date": "2012-12-24", "fuel": "gasoline", "price": 3.257}, {"date": "2012-12-31", "fuel": "gasoline", "price": 3.298}, {"date": "2013-01-07", "fuel": "gasoline", "price": 3.299}, {"date": "2013-01-14", "fuel": "gasoline", "price": 3.303}, {"date": "2013-01-21", "fuel": "gasoline", "price": 3.315}, {"date": "2013-01-28", "fuel": "gasoline", "price": 3.357}, {"date": "2013-02-04", "fuel": "gasoline", "price": 3.538}, {"date": "2013-02-11", "fuel": "gasoline", "price": 3.611}, {"date": "2013-02-18", "fuel": "gasoline", "price": 3.747}, {"date": "2013-02-25", "fuel": "gasoline", "price": 3.784}, {"date": "2013-03-04", "fuel": "gasoline", "price": 3.759}, {"date": "2013-03-11", "fuel": "gasoline", "price": 3.71}, {"date": "2013-03-18", "fuel": "gasoline", "price": 3.696}, {"date": "2013-03-25", "fuel": "gasoline", "price": 3.68}, {"date": "2013-04-01", "fuel": "gasoline", "price": 3.645}, {"date": "2013-04-08", "fuel": "gasoline", "price": 3.608}, {"date": "2013-04-15", "fuel": "gasoline", "price": 3.542}, {"date": "2013-04-22", "fuel": "gasoline", "price": 3.536}, {"date": "2013-04-29", "fuel": "gasoline", "price": 3.52}, {"date": "2013-05-06", "fuel": "gasoline", "price": 3.538}, {"date": "2013-05-13", "fuel": "gasoline", "price": 3.603}, {"date": "2013-05-20", "fuel": "gasoline", "price": 3.673}, {"date": "2013-05-27", "fuel": "gasoline", "price": 3.645}, {"date": "2013-06-03", "fuel": "gasoline", "price": 3.646}, {"date": "2013-06-10", "fuel": "gasoline", "price": 3.655}, {"date": "2013-06-17", "fuel": "gasoline", "price": 3.626}, {"date": "2013-06-24", "fuel": "gasoline", "price": 3.577}, {"date": "2013-07-01", "fuel": "gasoline", "price": 3.496}, {"date": "2013-07-08", "fuel": "gasoline", "price": 3.492}, {"date": "2013-07-15", "fuel": "gasoline", "price": 3.639}, {"date": "2013-07-22", "fuel": "gasoline", "price": 3.682}, {"date": "2013-07-29", "fuel": "gasoline", "price": 3.646}, {"date": "2013-08-05", "fuel": "gasoline", "price": 3.632}, {"date": "2013-08-12", "fuel": "gasoline", "price": 3.561}, {"date": "2013-08-19", "fuel": "gasoline", "price": 3.55}, {"date": "2013-08-26", "fuel": "gasoline", "price": 3.552}, {"date": "2013-09-02", "fuel": "gasoline", "price": 3.608}, {"date": "2013-09-09", "fuel": "gasoline", "price": 3.587}, {"date": "2013-09-16", "fuel": "gasoline", "price": 3.547}, {"date": "2013-09-23", "fuel": "gasoline", "price": 3.495}, {"date": "2013-09-30", "fuel": "gasoline", "price": 3.425}, {"date": "2013-10-07", "fuel": "gasoline", "price": 3.367}, {"date": "2013-10-14", "fuel": "gasoline", "price": 3.354}, {"date": "2013-10-21", "fuel": "gasoline", "price": 3.36}, {"date": "2013-10-28", "fuel": "gasoline", "price": 3.294}, {"date": "2013-11-04", "fuel": "gasoline", "price": 3.265}, {"date": "2013-11-11", "fuel": "gasoline", "price": 3.194}, {"date": "2013-11-18", "fuel": "gasoline", "price": 3.219}, {"date": "2013-11-25", "fuel": "gasoline", "price": 3.293}, {"date": "2013-12-02", "fuel": "gasoline", "price": 3.272}, {"date": "2013-12-09", "fuel": "gasoline", "price": 3.269}, {"date": "2013-12-16", "fuel": "gasoline", "price": 3.239}, {"date": "2013-12-23", "fuel": "gasoline", "price": 3.271}, {"date": "2013-12-30", "fuel": "gasoline", "price": 3.331}, {"date": "2014-01-06", "fuel": "gasoline", "price": 3.332}, {"date": "2014-01-13", "fuel": "gasoline", "price": 3.327}, {"date": "2014-01-20", "fuel": "gasoline", "price": 3.296}, {"date": "2014-01-27", "fuel": "gasoline", "price": 3.295}, {"date": "2014-02-03", "fuel": "gasoline", "price": 3.292}, {"date": "2014-02-10", "fuel": "gasoline", "price": 3.309}, {"date": "2014-02-17", "fuel": "gasoline", "price": 3.38}, {"date": "2014-02-24", "fuel": "gasoline", "price": 3.444}, {"date": "2014-03-03", "fuel": "gasoline", "price": 3.479}, {"date": "2014-03-10", "fuel": "gasoline", "price": 3.512}, {"date": "2014-03-17", "fuel": "gasoline", "price": 3.547}, {"date": "2014-03-24", "fuel": "gasoline", "price": 3.549}, {"date": "2014-03-31", "fuel": "gasoline", "price": 3.579}, {"date": "2014-04-07", "fuel": "gasoline", "price": 3.596}, {"date": "2014-04-14", "fuel": "gasoline", "price": 3.651}, {"date": "2014-04-21", "fuel": "gasoline", "price": 3.683}, {"date": "2014-04-28", "fuel": "gasoline", "price": 3.713}, {"date": "2014-05-05", "fuel": "gasoline", "price": 3.684}, {"date": "2014-05-12", "fuel": "gasoline", "price": 3.668}, {"date": "2014-05-19", "fuel": "gasoline", "price": 3.665}, {"date": "2014-05-26", "fuel": "gasoline", "price": 3.674}, {"date": "2014-06-02", "fuel": "gasoline", "price": 3.69}, {"date": "2014-06-09", "fuel": "gasoline", "price": 3.674}, {"date": "2014-06-16", "fuel": "gasoline", "price": 3.686}, {"date": "2014-06-23", "fuel": "gasoline", "price": 3.704}, {"date": "2014-06-30", "fuel": "gasoline", "price": 3.704}, {"date": "2014-07-07", "fuel": "gasoline", "price": 3.678}, {"date": "2014-07-14", "fuel": "gasoline", "price": 3.635}, {"date": "2014-07-21", "fuel": "gasoline", "price": 3.593}, {"date": "2014-07-28", "fuel": "gasoline", "price": 3.539}, {"date": "2014-08-04", "fuel": "gasoline", "price": 3.515}, {"date": "2014-08-11", "fuel": "gasoline", "price": 3.505}, {"date": "2014-08-18", "fuel": "gasoline", "price": 3.472}, {"date": "2014-08-25", "fuel": "gasoline", "price": 3.454}, {"date": "2014-09-01", "fuel": "gasoline", "price": 3.459}, {"date": "2014-09-08", "fuel": "gasoline", "price": 3.457}, {"date": "2014-09-15", "fuel": "gasoline", "price": 3.408}, {"date": "2014-09-22", "fuel": "gasoline", "price": 3.353}, {"date": "2014-09-29", "fuel": "gasoline", "price": 3.354}, {"date": "2014-10-06", "fuel": "gasoline", "price": 3.299}, {"date": "2014-10-13", "fuel": "gasoline", "price": 3.207}, {"date": "2014-10-20", "fuel": "gasoline", "price": 3.12}, {"date": "2014-10-27", "fuel": "gasoline", "price": 3.056}, {"date": "2014-11-03", "fuel": "gasoline", "price": 2.993}, {"date": "2014-11-10", "fuel": "gasoline", "price": 2.941}, {"date": "2014-11-17", "fuel": "gasoline", "price": 2.894}, {"date": "2014-11-24", "fuel": "gasoline", "price": 2.821}, {"date": "2014-12-01", "fuel": "gasoline", "price": 2.778}, {"date": "2014-12-08", "fuel": "gasoline", "price": 2.679}, {"date": "2014-12-15", "fuel": "gasoline", "price": 2.554}, {"date": "2014-12-22", "fuel": "gasoline", "price": 2.403}, {"date": "2014-12-29", "fuel": "gasoline", "price": 2.299}, {"date": "2015-01-05", "fuel": "gasoline", "price": 2.214}, {"date": "2015-01-12", "fuel": "gasoline", "price": 2.139}, {"date": "2015-01-19", "fuel": "gasoline", "price": 2.066}, {"date": "2015-01-26", "fuel": "gasoline", "price": 2.044}, {"date": "2015-02-02", "fuel": "gasoline", "price": 2.068}, {"date": "2015-02-09", "fuel": "gasoline", "price": 2.191}, {"date": "2015-02-16", "fuel": "gasoline", "price": 2.274}, {"date": "2015-02-23", "fuel": "gasoline", "price": 2.332}, {"date": "2015-03-02", "fuel": "gasoline", "price": 2.473}, {"date": "2015-03-09", "fuel": "gasoline", "price": 2.487}, {"date": "2015-03-16", "fuel": "gasoline", "price": 2.453}, {"date": "2015-03-23", "fuel": "gasoline", "price": 2.457}, {"date": "2015-03-30", "fuel": "gasoline", "price": 2.448}, {"date": "2015-04-06", "fuel": "gasoline", "price": 2.413}, {"date": "2015-04-13", "fuel": "gasoline", "price": 2.408}, {"date": "2015-04-20", "fuel": "gasoline", "price": 2.485}, {"date": "2015-04-27", "fuel": "gasoline", "price": 2.57}, {"date": "2015-05-04", "fuel": "gasoline", "price": 2.664}, {"date": "2015-05-11", "fuel": "gasoline", "price": 2.691}, {"date": "2015-05-18", "fuel": "gasoline", "price": 2.744}, {"date": "2015-05-25", "fuel": "gasoline", "price": 2.774}, {"date": "2015-06-01", "fuel": "gasoline", "price": 2.78}, {"date": "2015-06-08", "fuel": "gasoline", "price": 2.78}, {"date": "2015-06-15", "fuel": "gasoline", "price": 2.835}, {"date": "2015-06-22", "fuel": "gasoline", "price": 2.812}, {"date": "2015-06-29", "fuel": "gasoline", "price": 2.801}, {"date": "2015-07-06", "fuel": "gasoline", "price": 2.793}, {"date": "2015-07-13", "fuel": "gasoline", "price": 2.834}, {"date": "2015-07-20", "fuel": "gasoline", "price": 2.802}, {"date": "2015-07-27", "fuel": "gasoline", "price": 2.745}, {"date": "2015-08-03", "fuel": "gasoline", "price": 2.689}, {"date": "2015-08-10", "fuel": "gasoline", "price": 2.629}, {"date": "2015-08-17", "fuel": "gasoline", "price": 2.716}, {"date": "2015-08-24", "fuel": "gasoline", "price": 2.637}, {"date": "2015-08-31", "fuel": "gasoline", "price": 2.51}, {"date": "2015-09-07", "fuel": "gasoline", "price": 2.437}, {"date": "2015-09-14", "fuel": "gasoline", "price": 2.375}, {"date": "2015-09-21", "fuel": "gasoline", "price": 2.327}, {"date": "2015-09-28", "fuel": "gasoline", "price": 2.322}, {"date": "2015-10-05", "fuel": "gasoline", "price": 2.318}, {"date": "2015-10-12", "fuel": "gasoline", "price": 2.337}, {"date": "2015-10-19", "fuel": "gasoline", "price": 2.277}, {"date": "2015-10-26", "fuel": "gasoline", "price": 2.228}, {"date": "2015-11-02", "fuel": "gasoline", "price": 2.224}, {"date": "2015-11-09", "fuel": "gasoline", "price": 2.235}, {"date": "2015-11-16", "fuel": "gasoline", "price": 2.178}, {"date": "2015-11-23", "fuel": "gasoline", "price": 2.094}, {"date": "2015-11-30", "fuel": "gasoline", "price": 2.059}, {"date": "2015-12-07", "fuel": "gasoline", "price": 2.053}, {"date": "2015-12-14", "fuel": "gasoline", "price": 2.037}, {"date": "2015-12-21", "fuel": "gasoline", "price": 2.026}, {"date": "2015-12-28", "fuel": "gasoline", "price": 2.034}, {"date": "2016-01-04", "fuel": "gasoline", "price": 2.028}, {"date": "2016-01-11", "fuel": "gasoline", "price": 1.996}, {"date": "2016-01-18", "fuel": "gasoline", "price": 1.914}, {"date": "2016-01-25", "fuel": "gasoline", "price": 1.856}, {"date": "2016-02-01", "fuel": "gasoline", "price": 1.822}, {"date": "2016-02-08", "fuel": "gasoline", "price": 1.759}, {"date": "2016-02-15", "fuel": "gasoline", "price": 1.724}, {"date": "2016-02-22", "fuel": "gasoline", "price": 1.73}, {"date": "2016-02-29", "fuel": "gasoline", "price": 1.783}, {"date": "2016-03-07", "fuel": "gasoline", "price": 1.841}, {"date": "2016-03-14", "fuel": "gasoline", "price": 1.961}, {"date": "2016-03-21", "fuel": "gasoline", "price": 2.007}, {"date": "2016-03-28", "fuel": "gasoline", "price": 2.066}, {"date": "2016-04-04", "fuel": "gasoline", "price": 2.083}, {"date": "2016-04-11", "fuel": "gasoline", "price": 2.069}, {"date": "2016-04-18", "fuel": "gasoline", "price": 2.137}, {"date": "2016-04-25", "fuel": "gasoline", "price": 2.162}, {"date": "2016-05-02", "fuel": "gasoline", "price": 2.24}, {"date": "2016-05-09", "fuel": "gasoline", "price": 2.22}, {"date": "2016-05-16", "fuel": "gasoline", "price": 2.242}, {"date": "2016-05-23", "fuel": "gasoline", "price": 2.3}, {"date": "2016-05-30", "fuel": "gasoline", "price": 2.339}, {"date": "2016-06-06", "fuel": "gasoline", "price": 2.381}, {"date": "2016-06-13", "fuel": "gasoline", "price": 2.399}, {"date": "2016-06-20", "fuel": "gasoline", "price": 2.353}, {"date": "2016-06-27", "fuel": "gasoline", "price": 2.329}, {"date": "2016-07-04", "fuel": "gasoline", "price": 2.291}, {"date": "2016-07-11", "fuel": "gasoline", "price": 2.253}, {"date": "2016-07-18", "fuel": "gasoline", "price": 2.23}, {"date": "2016-07-25", "fuel": "gasoline", "price": 2.182}, {"date": "2016-08-01", "fuel": "gasoline", "price": 2.159}, {"date": "2016-08-08", "fuel": "gasoline", "price": 2.15}, {"date": "2016-08-15", "fuel": "gasoline", "price": 2.149}, {"date": "2016-08-22", "fuel": "gasoline", "price": 2.193}, {"date": "2016-08-29", "fuel": "gasoline", "price": 2.237}, {"date": "2016-09-05", "fuel": "gasoline", "price": 2.223}, {"date": "2016-09-12", "fuel": "gasoline", "price": 2.202}, {"date": "2016-09-19", "fuel": "gasoline", "price": 2.225}, {"date": "2016-09-26", "fuel": "gasoline", "price": 2.224}, {"date": "2016-10-03", "fuel": "gasoline", "price": 2.245}, {"date": "2016-10-10", "fuel": "gasoline", "price": 2.272}, {"date": "2016-10-17", "fuel": "gasoline", "price": 2.257}, {"date": "2016-10-24", "fuel": "gasoline", "price": 2.243}, {"date": "2016-10-31", "fuel": "gasoline", "price": 2.23}, {"date": "2016-11-07", "fuel": "gasoline", "price": 2.233}, {"date": "2016-11-14", "fuel": "gasoline", "price": 2.184}, {"date": "2016-11-21", "fuel": "gasoline", "price": 2.155}, {"date": "2016-11-28", "fuel": "gasoline", "price": 2.154}, {"date": "2016-12-05", "fuel": "gasoline", "price": 2.208}, {"date": "2016-12-12", "fuel": "gasoline", "price": 2.236}, {"date": "2016-12-19", "fuel": "gasoline", "price": 2.264}, {"date": "2016-12-26", "fuel": "gasoline", "price": 2.309}, {"date": "2017-01-02", "fuel": "gasoline", "price": 2.377}, {"date": "2017-01-09", "fuel": "gasoline", "price": 2.388}, {"date": "2017-01-16", "fuel": "gasoline", "price": 2.358}, {"date": "2017-01-23", "fuel": "gasoline", "price": 2.326}, {"date": "2017-01-30", "fuel": "gasoline", "price": 2.296}, {"date": "2017-02-06", "fuel": "gasoline", "price": 2.293}, {"date": "2017-02-13", "fuel": "gasoline", "price": 2.307}, {"date": "2017-02-20", "fuel": "gasoline", "price": 2.302}, {"date": "2017-02-27", "fuel": "gasoline", "price": 2.314}, {"date": "2017-03-06", "fuel": "gasoline", "price": 2.341}, {"date": "2017-03-13", "fuel": "gasoline", "price": 2.323}, {"date": "2017-03-20", "fuel": "gasoline", "price": 2.321}, {"date": "2017-03-27", "fuel": "gasoline", "price": 2.315}, {"date": "2017-04-03", "fuel": "gasoline", "price": 2.36}, {"date": "2017-04-10", "fuel": "gasoline", "price": 2.424}, {"date": "2017-04-17", "fuel": "gasoline", "price": 2.436}, {"date": "2017-04-24", "fuel": "gasoline", "price": 2.449}, {"date": "2017-05-01", "fuel": "gasoline", "price": 2.411}, {"date": "2017-05-08", "fuel": "gasoline", "price": 2.372}, {"date": "2017-05-15", "fuel": "gasoline", "price": 2.369}, {"date": "2017-05-22", "fuel": "gasoline", "price": 2.399}, {"date": "2017-05-29", "fuel": "gasoline", "price": 2.406}, {"date": "2017-06-05", "fuel": "gasoline", "price": 2.414}, {"date": "2017-06-12", "fuel": "gasoline", "price": 2.366}, {"date": "2017-06-19", "fuel": "gasoline", "price": 2.318}, {"date": "2017-06-26", "fuel": "gasoline", "price": 2.288}, {"date": "2017-07-03", "fuel": "gasoline", "price": 2.26}, {"date": "2017-07-10", "fuel": "gasoline", "price": 2.297}, {"date": "2017-07-17", "fuel": "gasoline", "price": 2.278}, {"date": "2017-07-24", "fuel": "gasoline", "price": 2.312}, {"date": "2017-07-31", "fuel": "gasoline", "price": 2.352}, {"date": "2017-08-07", "fuel": "gasoline", "price": 2.378}, {"date": "2017-08-14", "fuel": "gasoline", "price": 2.384}, {"date": "2017-08-21", "fuel": "gasoline", "price": 2.36}, {"date": "2017-08-28", "fuel": "gasoline", "price": 2.399}, {"date": "2017-09-04", "fuel": "gasoline", "price": 2.679}, {"date": "2017-09-11", "fuel": "gasoline", "price": 2.685}, {"date": "2017-09-18", "fuel": "gasoline", "price": 2.634}, {"date": "2017-09-25", "fuel": "gasoline", "price": 2.583}, {"date": "2017-10-02", "fuel": "gasoline", "price": 2.565}, {"date": "2017-10-09", "fuel": "gasoline", "price": 2.504}, {"date": "2017-10-16", "fuel": "gasoline", "price": 2.489}, {"date": "2017-10-23", "fuel": "gasoline", "price": 2.479}, {"date": "2017-10-30", "fuel": "gasoline", "price": 2.488}, {"date": "2017-11-06", "fuel": "gasoline", "price": 2.561}, {"date": "2017-11-13", "fuel": "gasoline", "price": 2.592}, {"date": "2017-11-20", "fuel": "gasoline", "price": 2.568}, {"date": "2017-11-27", "fuel": "gasoline", "price": 2.533}, {"date": "2017-12-04", "fuel": "gasoline", "price": 2.5}, {"date": "2017-12-11", "fuel": "gasoline", "price": 2.485}, {"date": "2017-12-18", "fuel": "gasoline", "price": 2.45}, {"date": "2017-12-25", "fuel": "gasoline", "price": 2.472}, {"date": "2018-01-01", "fuel": "gasoline", "price": 2.52}, {"date": "2018-01-08", "fuel": "gasoline", "price": 2.522}, {"date": "2018-01-15", "fuel": "gasoline", "price": 2.557}, {"date": "2018-01-22", "fuel": "gasoline", "price": 2.567}, {"date": "2018-01-29", "fuel": "gasoline", "price": 2.607}, {"date": "2018-02-05", "fuel": "gasoline", "price": 2.637}, {"date": "2018-02-12", "fuel": "gasoline", "price": 2.607}, {"date": "2018-02-19", "fuel": "gasoline", "price": 2.557}, {"date": "2018-02-26", "fuel": "gasoline", "price": 2.548}, {"date": "2018-03-05", "fuel": "gasoline", "price": 2.56}, {"date": "2018-03-12", "fuel": "gasoline", "price": 2.559}, {"date": "2018-03-19", "fuel": "gasoline", "price": 2.598}, {"date": "2018-03-26", "fuel": "gasoline", "price": 2.648}, {"date": "2018-04-02", "fuel": "gasoline", "price": 2.7}, {"date": "2018-04-09", "fuel": "gasoline", "price": 2.694}, {"date": "2018-04-16", "fuel": "gasoline", "price": 2.747}, {"date": "2018-04-23", "fuel": "gasoline", "price": 2.798}, {"date": "2018-04-30", "fuel": "gasoline", "price": 2.846}, {"date": "2018-05-07", "fuel": "gasoline", "price": 2.845}, {"date": "2018-05-14", "fuel": "gasoline", "price": 2.873}, {"date": "2018-05-21", "fuel": "gasoline", "price": 2.923}, {"date": "2018-05-28", "fuel": "gasoline", "price": 2.962}, {"date": "2018-06-04", "fuel": "gasoline", "price": 2.94}, {"date": "2018-06-11", "fuel": "gasoline", "price": 2.911}, {"date": "2018-06-18", "fuel": "gasoline", "price": 2.879}, {"date": "2018-06-25", "fuel": "gasoline", "price": 2.833}, {"date": "2018-07-02", "fuel": "gasoline", "price": 2.844}, {"date": "2018-07-09", "fuel": "gasoline", "price": 2.857}, {"date": "2018-07-16", "fuel": "gasoline", "price": 2.865}, {"date": "2018-07-23", "fuel": "gasoline", "price": 2.831}, {"date": "2018-07-30", "fuel": "gasoline", "price": 2.846}, {"date": "2018-08-06", "fuel": "gasoline", "price": 2.852}, {"date": "2018-08-13", "fuel": "gasoline", "price": 2.843}, {"date": "2018-08-20", "fuel": "gasoline", "price": 2.821}, {"date": "2018-08-27", "fuel": "gasoline", "price": 2.827}, {"date": "2018-09-03", "fuel": "gasoline", "price": 2.824}, {"date": "2018-09-10", "fuel": "gasoline", "price": 2.833}, {"date": "2018-09-17", "fuel": "gasoline", "price": 2.841}, {"date": "2018-09-24", "fuel": "gasoline", "price": 2.844}, {"date": "2018-10-01", "fuel": "gasoline", "price": 2.866}, {"date": "2018-10-08", "fuel": "gasoline", "price": 2.903}, {"date": "2018-10-15", "fuel": "gasoline", "price": 2.879}, {"date": "2018-10-22", "fuel": "gasoline", "price": 2.841}, {"date": "2018-10-29", "fuel": "gasoline", "price": 2.811}, {"date": "2018-11-05", "fuel": "gasoline", "price": 2.753}, {"date": "2018-11-12", "fuel": "gasoline", "price": 2.686}, {"date": "2018-11-19", "fuel": "gasoline", "price": 2.611}, {"date": "2018-11-26", "fuel": "gasoline", "price": 2.539}, {"date": "2018-12-03", "fuel": "gasoline", "price": 2.451}, {"date": "2018-12-10", "fuel": "gasoline", "price": 2.421}, {"date": "2018-12-17", "fuel": "gasoline", "price": 2.369}, {"date": "2018-12-24", "fuel": "gasoline", "price": 2.321}, {"date": "2018-12-31", "fuel": "gasoline", "price": 2.266}, {"date": "2019-01-07", "fuel": "gasoline", "price": 2.237}, {"date": "2019-01-14", "fuel": "gasoline", "price": 2.247}, {"date": "2019-01-21", "fuel": "gasoline", "price": 2.251}, {"date": "2019-01-28", "fuel": "gasoline", "price": 2.256}, {"date": "2019-02-04", "fuel": "gasoline", "price": 2.254}, {"date": "2019-02-11", "fuel": "gasoline", "price": 2.276}, {"date": "2019-02-18", "fuel": "gasoline", "price": 2.317}, {"date": "2019-02-25", "fuel": "gasoline", "price": 2.39}, {"date": "2019-03-04", "fuel": "gasoline", "price": 2.422}, {"date": "2019-03-11", "fuel": "gasoline", "price": 2.471}, {"date": "2019-03-18", "fuel": "gasoline", "price": 2.548}, {"date": "2019-03-25", "fuel": "gasoline", "price": 2.623}, {"date": "2019-04-01", "fuel": "gasoline", "price": 2.691}, {"date": "2019-04-08", "fuel": "gasoline", "price": 2.745}, {"date": "2019-04-15", "fuel": "gasoline", "price": 2.828}, {"date": "2019-04-22", "fuel": "gasoline", "price": 2.841}, {"date": "2019-04-29", "fuel": "gasoline", "price": 2.887}, {"date": "2019-05-06", "fuel": "gasoline", "price": 2.897}, {"date": "2019-05-13", "fuel": "gasoline", "price": 2.866}, {"date": "2019-05-20", "fuel": "gasoline", "price": 2.852}, {"date": "2019-05-27", "fuel": "gasoline", "price": 2.822}, {"date": "2019-06-03", "fuel": "gasoline", "price": 2.807}, {"date": "2019-06-10", "fuel": "gasoline", "price": 2.732}, {"date": "2019-06-17", "fuel": "gasoline", "price": 2.67}, {"date": "2019-06-24", "fuel": "gasoline", "price": 2.654}, {"date": "2019-07-01", "fuel": "gasoline", "price": 2.713}, {"date": "2019-07-08", "fuel": "gasoline", "price": 2.743}, {"date": "2019-07-15", "fuel": "gasoline", "price": 2.779}, {"date": "2019-07-22", "fuel": "gasoline", "price": 2.75}, {"date": "2019-07-29", "fuel": "gasoline", "price": 2.715}, {"date": "2019-08-05", "fuel": "gasoline", "price": 2.688}, {"date": "2019-08-12", "fuel": "gasoline", "price": 2.624}, {"date": "2019-08-19", "fuel": "gasoline", "price": 2.598}, {"date": "2019-08-26", "fuel": "gasoline", "price": 2.574}, {"date": "2019-09-02", "fuel": "gasoline", "price": 2.563}, {"date": "2019-09-09", "fuel": "gasoline", "price": 2.55}, {"date": "2019-09-16", "fuel": "gasoline", "price": 2.552}, {"date": "2019-09-23", "fuel": "gasoline", "price": 2.654}, {"date": "2019-09-30", "fuel": "gasoline", "price": 2.642}, {"date": "2019-10-07", "fuel": "gasoline", "price": 2.645}, {"date": "2019-10-14", "fuel": "gasoline", "price": 2.629}, {"date": "2019-10-21", "fuel": "gasoline", "price": 2.638}, {"date": "2019-10-28", "fuel": "gasoline", "price": 2.596}, {"date": "2019-11-04", "fuel": "gasoline", "price": 2.605}, {"date": "2019-11-11", "fuel": "gasoline", "price": 2.615}, {"date": "2019-11-18", "fuel": "gasoline", "price": 2.592}, {"date": "2019-11-25", "fuel": "gasoline", "price": 2.579}, {"date": "2019-12-02", "fuel": "gasoline", "price": 2.575}, {"date": "2019-12-09", "fuel": "gasoline", "price": 2.561}, {"date": "2019-12-16", "fuel": "gasoline", "price": 2.536}, {"date": "2019-12-23", "fuel": "gasoline", "price": 2.532}, {"date": "2019-12-30", "fuel": "gasoline", "price": 2.571}, {"date": "2020-01-06", "fuel": "gasoline", "price": 2.578}, {"date": "2020-01-13", "fuel": "gasoline", "price": 2.57}, {"date": "2020-01-20", "fuel": "gasoline", "price": 2.537}, {"date": "2020-01-27", "fuel": "gasoline", "price": 2.506}, {"date": "2020-02-03", "fuel": "gasoline", "price": 2.455}, {"date": "2020-02-10", "fuel": "gasoline", "price": 2.419}, {"date": "2020-02-17", "fuel": "gasoline", "price": 2.428}, {"date": "2020-02-24", "fuel": "gasoline", "price": 2.466}, {"date": "2020-03-02", "fuel": "gasoline", "price": 2.423}, {"date": "2020-03-09", "fuel": "gasoline", "price": 2.375}, {"date": "2020-03-16", "fuel": "gasoline", "price": 2.248}, {"date": "2020-03-23", "fuel": "gasoline", "price": 2.12}, {"date": "2020-03-30", "fuel": "gasoline", "price": 2.005}, {"date": "2020-04-06", "fuel": "gasoline", "price": 1.924}, {"date": "2020-04-13", "fuel": "gasoline", "price": 1.853}, {"date": "2020-04-20", "fuel": "gasoline", "price": 1.812}, {"date": "2020-04-27", "fuel": "gasoline", "price": 1.773}, {"date": "2020-05-04", "fuel": "gasoline", "price": 1.789}, {"date": "2020-05-11", "fuel": "gasoline", "price": 1.851}, {"date": "2020-05-18", "fuel": "gasoline", "price": 1.878}, {"date": "2020-05-25", "fuel": "gasoline", "price": 1.96}, {"date": "2020-06-01", "fuel": "gasoline", "price": 1.974}, {"date": "2020-06-08", "fuel": "gasoline", "price": 2.036}, {"date": "2020-06-15", "fuel": "gasoline", "price": 2.098}, {"date": "2020-06-22", "fuel": "gasoline", "price": 2.129}, {"date": "2020-06-29", "fuel": "gasoline", "price": 2.174}, {"date": "2020-07-06", "fuel": "gasoline", "price": 2.177}, {"date": "2020-07-13", "fuel": "gasoline", "price": 2.195}, {"date": "2020-07-20", "fuel": "gasoline", "price": 2.186}, {"date": "2020-07-27", "fuel": "gasoline", "price": 2.175}, {"date": "2020-08-03", "fuel": "gasoline", "price": 2.176}, {"date": "2020-08-10", "fuel": "gasoline", "price": 2.166}, {"date": "2020-08-17", "fuel": "gasoline", "price": 2.166}, {"date": "2020-08-24", "fuel": "gasoline", "price": 2.182}, {"date": "2020-08-31", "fuel": "gasoline", "price": 2.222}, {"date": "2020-09-07", "fuel": "gasoline", "price": 2.211}, {"date": "2020-09-14", "fuel": "gasoline", "price": 2.183}, {"date": "2020-09-21", "fuel": "gasoline", "price": 2.168}, {"date": "2020-09-28", "fuel": "gasoline", "price": 2.169}, {"date": "2020-10-05", "fuel": "gasoline", "price": 2.172}, {"date": "2020-10-12", "fuel": "gasoline", "price": 2.167}, {"date": "2020-10-19", "fuel": "gasoline", "price": 2.15}, {"date": "2020-10-26", "fuel": "gasoline", "price": 2.143}, {"date": "2020-11-02", "fuel": "gasoline", "price": 2.112}, {"date": "2020-11-09", "fuel": "gasoline", "price": 2.096}, {"date": "2020-11-16", "fuel": "gasoline", "price": 2.111}, {"date": "2020-11-23", "fuel": "gasoline", "price": 2.102}, {"date": "2020-11-30", "fuel": "gasoline", "price": 2.12}, {"date": "2020-12-07", "fuel": "gasoline", "price": 2.156}, {"date": "2020-12-14", "fuel": "gasoline", "price": 2.158}, {"date": "2020-12-21", "fuel": "gasoline", "price": 2.224}, {"date": "2020-12-28", "fuel": "gasoline", "price": 2.243}, {"date": "2021-01-04", "fuel": "gasoline", "price": 2.249}, {"date": "2021-01-11", "fuel": "gasoline", "price": 2.317}, {"date": "2021-01-18", "fuel": "gasoline", "price": 2.379}, {"date": "2021-01-25", "fuel": "gasoline", "price": 2.392}, {"date": "2021-02-01", "fuel": "gasoline", "price": 2.409}, {"date": "2021-02-08", "fuel": "gasoline", "price": 2.461}, {"date": "2021-02-15", "fuel": "gasoline", "price": 2.501}, {"date": "2021-02-22", "fuel": "gasoline", "price": 2.633}, {"date": "2021-03-01", "fuel": "gasoline", "price": 2.711}, {"date": "2021-03-08", "fuel": "gasoline", "price": 2.771}, {"date": "2021-03-15", "fuel": "gasoline", "price": 2.853}, {"date": "2021-03-22", "fuel": "gasoline", "price": 2.865}, {"date": "2021-03-29", "fuel": "gasoline", "price": 2.852}, {"date": "2021-04-05", "fuel": "gasoline", "price": 2.857}, {"date": "2021-04-12", "fuel": "gasoline", "price": 2.849}, {"date": "2021-04-19", "fuel": "gasoline", "price": 2.855}, {"date": "2021-04-26", "fuel": "gasoline", "price": 2.872}, {"date": "2021-05-03", "fuel": "gasoline", "price": 2.89}, {"date": "2021-05-10", "fuel": "gasoline", "price": 2.961}, {"date": "2021-05-17", "fuel": "gasoline", "price": 3.028}, {"date": "2021-05-24", "fuel": "gasoline", "price": 3.02}, {"date": "2021-05-31", "fuel": "gasoline", "price": 3.027}, {"date": "2021-06-07", "fuel": "gasoline", "price": 3.035}, {"date": "2021-06-14", "fuel": "gasoline", "price": 3.069}, {"date": "2021-06-21", "fuel": "gasoline", "price": 3.06}, {"date": "2021-06-28", "fuel": "gasoline", "price": 3.091}, {"date": "2021-07-05", "fuel": "gasoline", "price": 3.122}, {"date": "2021-07-12", "fuel": "gasoline", "price": 3.133}, {"date": "2021-07-19", "fuel": "gasoline", "price": 3.153}, {"date": "2021-07-26", "fuel": "gasoline", "price": 3.136}, {"date": "2021-08-02", "fuel": "gasoline", "price": 3.159}, {"date": "2021-08-09", "fuel": "gasoline", "price": 3.172}, {"date": "2021-08-16", "fuel": "gasoline", "price": 3.174}, {"date": "2021-08-23", "fuel": "gasoline", "price": 3.145}, {"date": "2021-08-30", "fuel": "gasoline", "price": 3.139}, {"date": "2021-09-06", "fuel": "gasoline", "price": 3.176}, {"date": "2021-09-13", "fuel": "gasoline", "price": 3.165}, {"date": "2021-09-20", "fuel": "gasoline", "price": 3.184}, {"date": "2021-09-27", "fuel": "gasoline", "price": 3.175}, {"date": "2021-10-04", "fuel": "gasoline", "price": 3.19}, {"date": "2021-10-11", "fuel": "gasoline", "price": 3.267}, {"date": "2021-10-18", "fuel": "gasoline", "price": 3.322}, {"date": "2021-10-25", "fuel": "gasoline", "price": 3.383}, {"date": "2021-11-01", "fuel": "gasoline", "price": 3.39}, {"date": "2021-11-08", "fuel": "gasoline", "price": 3.41}, {"date": "2021-11-15", "fuel": "gasoline", "price": 3.399}, {"date": "2021-11-22", "fuel": "gasoline", "price": 3.395}, {"date": "2021-11-29", "fuel": "gasoline", "price": 3.38}, {"date": "2021-12-06", "fuel": "gasoline", "price": 3.341}, {"date": "2021-12-13", "fuel": "gasoline", "price": 3.315}, {"date": "2021-12-20", "fuel": "gasoline", "price": 3.295}, {"date": "2021-12-27", "fuel": "gasoline", "price": 3.275}, {"date": "2022-01-03", "fuel": "gasoline", "price": 3.281}, {"date": "2022-01-10", "fuel": "gasoline", "price": 3.295}, {"date": "2022-01-17", "fuel": "gasoline", "price": 3.306}, {"date": "2022-01-24", "fuel": "gasoline", "price": 3.323}, {"date": "2022-01-31", "fuel": "gasoline", "price": 3.368}, {"date": "2022-02-07", "fuel": "gasoline", "price": 3.444}, {"date": "2022-02-14", "fuel": "gasoline", "price": 3.487}, {"date": "2022-02-21", "fuel": "gasoline", "price": 3.53}, {"date": "2022-02-28", "fuel": "gasoline", "price": 3.608}, {"date": "2022-03-07", "fuel": "gasoline", "price": 4.102}, {"date": "2022-03-14", "fuel": "gasoline", "price": 4.315}, {"date": "2022-03-21", "fuel": "gasoline", "price": 4.239}, {"date": "2022-03-28", "fuel": "gasoline", "price": 4.231}, {"date": "2022-04-04", "fuel": "gasoline", "price": 4.17}, {"date": "2022-04-11", "fuel": "gasoline", "price": 4.091}, {"date": "2022-04-18", "fuel": "gasoline", "price": 4.066}, {"date": "2022-04-25", "fuel": "gasoline", "price": 4.107}, {"date": "2022-05-02", "fuel": "gasoline", "price": 4.182}, {"date": "2022-05-09", "fuel": "gasoline", "price": 4.328}, {"date": "2022-05-16", "fuel": "gasoline", "price": 4.491}, {"date": "2022-05-23", "fuel": "gasoline", "price": 4.593}, {"date": "2022-05-30", "fuel": "gasoline", "price": 4.624}, {"date": "2022-06-06", "fuel": "gasoline", "price": 4.876}, {"date": "2022-06-13", "fuel": "gasoline", "price": 5.006}, {"date": "2022-06-20", "fuel": "gasoline", "price": 4.962}, {"date": "2022-06-27", "fuel": "gasoline", "price": 4.872}, {"date": "2022-07-04", "fuel": "gasoline", "price": 4.771}, {"date": "2022-07-11", "fuel": "gasoline", "price": 4.646}, {"date": "2022-07-18", "fuel": "gasoline", "price": 4.49}, {"date": "2022-07-25", "fuel": "gasoline", "price": 4.33}, {"date": "2022-08-01", "fuel": "gasoline", "price": 4.192}, {"date": "2022-08-08", "fuel": "gasoline", "price": 4.038}, {"date": "2022-08-15", "fuel": "gasoline", "price": 3.938}, {"date": "2022-08-22", "fuel": "gasoline", "price": 3.88}, {"date": "2022-08-29", "fuel": "gasoline", "price": 3.827}, {"date": "2022-09-05", "fuel": "gasoline", "price": 3.746}, {"date": "2022-09-12", "fuel": "gasoline", "price": 3.69}, {"date": "2022-09-19", "fuel": "gasoline", "price": 3.654}, {"date": "2022-09-26", "fuel": "gasoline", "price": 3.711}, {"date": "2022-10-03", "fuel": "gasoline", "price": 3.782}, {"date": "2022-10-10", "fuel": "gasoline", "price": 3.912}, {"date": "2022-10-17", "fuel": "gasoline", "price": 3.871}, {"date": "2022-10-24", "fuel": "gasoline", "price": 3.769}, {"date": "2022-10-31", "fuel": "gasoline", "price": 3.742}, {"date": "2022-11-07", "fuel": "gasoline", "price": 3.796}, {"date": "2022-11-14", "fuel": "gasoline", "price": 3.762}, {"date": "2022-11-21", "fuel": "gasoline", "price": 3.648}, {"date": "2022-11-28", "fuel": "gasoline", "price": 3.534}, {"date": "2022-12-05", "fuel": "gasoline", "price": 3.39}, {"date": "2022-12-12", "fuel": "gasoline", "price": 3.239}, {"date": "2022-12-19", "fuel": "gasoline", "price": 3.12}, {"date": "2022-12-26", "fuel": "gasoline", "price": 3.091}, {"date": "2023-01-02", "fuel": "gasoline", "price": 3.223}, {"date": "2023-01-09", "fuel": "gasoline", "price": 3.259}, {"date": "2023-01-16", "fuel": "gasoline", "price": 3.31}, {"date": "2023-01-23", "fuel": "gasoline", "price": 3.415}, {"date": "2023-01-30", "fuel": "gasoline", "price": 3.489}, {"date": "2023-02-06", "fuel": "gasoline", "price": 3.444}, {"date": "2023-02-13", "fuel": "gasoline", "price": 3.39}, {"date": "2023-02-20", "fuel": "gasoline", "price": 3.379}, {"date": "2023-02-27", "fuel": "gasoline", "price": 3.342}, {"date": "2023-03-06", "fuel": "gasoline", "price": 3.389}, {"date": "2023-03-13", "fuel": "gasoline", "price": 3.456}, {"date": "2023-03-20", "fuel": "gasoline", "price": 3.422}, {"date": "2023-03-27", "fuel": "gasoline", "price": 3.421}, {"date": "2023-04-03", "fuel": "gasoline", "price": 3.497}, {"date": "2023-04-10", "fuel": "gasoline", "price": 3.596}, {"date": "2023-04-17", "fuel": "gasoline", "price": 3.663}, {"date": "2023-04-24", "fuel": "gasoline", "price": 3.656}, {"date": "2023-05-01", "fuel": "gasoline", "price": 3.6}, {"date": "2023-05-08", "fuel": "gasoline", "price": 3.533}, {"date": "2023-05-15", "fuel": "gasoline", "price": 3.536}, {"date": "2023-05-22", "fuel": "gasoline", "price": 3.534}, {"date": "2023-05-29", "fuel": "gasoline", "price": 3.571}, {"date": "2023-06-05", "fuel": "gasoline", "price": 3.541}, {"date": "2023-06-12", "fuel": "gasoline", "price": 3.595}, {"date": "2023-06-19", "fuel": "gasoline", "price": 3.577}, {"date": "2023-06-26", "fuel": "gasoline", "price": 3.571}, {"date": "2023-07-03", "fuel": "gasoline", "price": 3.527}, {"date": "2023-07-10", "fuel": "gasoline", "price": 3.546}, {"date": "2023-07-17", "fuel": "gasoline", "price": 3.559}, {"date": "2023-07-24", "fuel": "gasoline", "price": 3.596}, {"date": "2023-07-31", "fuel": "gasoline", "price": 3.757}, {"date": "2023-08-07", "fuel": "gasoline", "price": 3.828}, {"date": "2023-08-14", "fuel": "gasoline", "price": 3.85}, {"date": "2023-08-21", "fuel": "gasoline", "price": 3.868}, {"date": "2023-08-28", "fuel": "gasoline", "price": 3.813}, {"date": "2023-09-04", "fuel": "gasoline", "price": 3.807}, {"date": "2023-09-11", "fuel": "gasoline", "price": 3.822}, {"date": "2023-09-18", "fuel": "gasoline", "price": 3.878}, {"date": "2023-09-25", "fuel": "gasoline", "price": 3.837}, {"date": "2023-10-02", "fuel": "gasoline", "price": 3.798}, {"date": "2023-10-09", "fuel": "gasoline", "price": 3.684}, {"date": "2023-10-16", "fuel": "gasoline", "price": 3.576}, {"date": "2023-10-23", "fuel": "gasoline", "price": 3.533}, {"date": "2023-10-30", "fuel": "gasoline", "price": 3.473}, {"date": "2023-11-06", "fuel": "gasoline", "price": 3.396}, {"date": "2023-11-13", "fuel": "gasoline", "price": 3.349}, {"date": "2023-11-20", "fuel": "gasoline", "price": 3.289}, {"date": "2023-11-27", "fuel": "gasoline", "price": 3.238}, {"date": "2023-12-04", "fuel": "gasoline", "price": 3.231}, {"date": "2023-12-11", "fuel": "gasoline", "price": 3.136}, {"date": "2023-12-18", "fuel": "gasoline", "price": 3.053}, {"date": "2023-12-25", "fuel": "gasoline", "price": 3.116}, {"date": "2024-01-01", "fuel": "gasoline", "price": 3.089}, {"date": "2024-01-08", "fuel": "gasoline", "price": 3.073}, {"date": "2024-01-15", "fuel": "gasoline", "price": 3.058}, {"date": "2024-01-22", "fuel": "gasoline", "price": 3.062}, {"date": "2024-01-29", "fuel": "gasoline", "price": 3.095}, {"date": "2024-02-05", "fuel": "gasoline", "price": 3.136}, {"date": "2024-02-12", "fuel": "gasoline", "price": 3.192}, {"date": "2024-02-19", "fuel": "gasoline", "price": 3.269}, {"date": "2024-02-26", "fuel": "gasoline", "price": 3.249}, {"date": "2024-03-04", "fuel": "gasoline", "price": 3.35}, {"date": "2024-03-11", "fuel": "gasoline", "price": 3.376}, {"date": "2024-03-18", "fuel": "gasoline", "price": 3.453}, {"date": "2024-03-25", "fuel": "gasoline", "price": 3.523}, {"date": "2024-04-01", "fuel": "gasoline", "price": 3.517}, {"date": "2024-04-08", "fuel": "gasoline", "price": 3.591}, {"date": "2024-04-15", "fuel": "gasoline", "price": 3.628}, {"date": "2024-04-22", "fuel": "gasoline", "price": 3.668}, {"date": "2024-04-29", "fuel": "gasoline", "price": 3.653}, {"date": "2024-05-06", "fuel": "gasoline", "price": 3.643}, {"date": "2024-05-13", "fuel": "gasoline", "price": 3.608}, {"date": "2024-05-20", "fuel": "gasoline", "price": 3.584}, {"date": "2024-05-27", "fuel": "gasoline", "price": 3.577}, {"date": "2024-06-03", "fuel": "gasoline", "price": 3.516}, {"date": "2024-06-10", "fuel": "gasoline", "price": 3.429}, {"date": "2024-06-17", "fuel": "gasoline", "price": 3.435}, {"date": "2024-06-24", "fuel": "gasoline", "price": 3.438}, {"date": "2024-07-01", "fuel": "gasoline", "price": 3.479}, {"date": "2024-07-08", "fuel": "gasoline", "price": 3.489}, {"date": "2024-07-15", "fuel": "gasoline", "price": 3.496}, {"date": "2024-07-22", "fuel": "gasoline", "price": 3.471}, {"date": "2024-07-29", "fuel": "gasoline", "price": 3.484}, {"date": "2024-08-05", "fuel": "gasoline", "price": 3.448}, {"date": "2024-08-12", "fuel": "gasoline", "price": 3.414}, {"date": "2024-08-19", "fuel": "gasoline", "price": 3.382}, {"date": "2024-08-26", "fuel": "gasoline", "price": 3.313}, {"date": "2024-09-02", "fuel": "gasoline", "price": 3.289}, {"date": "2024-09-09", "fuel": "gasoline", "price": 3.236}, {"date": "2024-09-16", "fuel": "gasoline", "price": 3.18}, {"date": "2024-09-23", "fuel": "gasoline", "price": 3.185}, {"date": "2024-09-30", "fuel": "gasoline", "price": 3.179}, {"date": "2024-10-07", "fuel": "gasoline", "price": 3.136}, {"date": "2024-10-14", "fuel": "gasoline", "price": 3.171}, {"date": "2024-10-21", "fuel": "gasoline", "price": 3.144}, {"date": "2024-10-28", "fuel": "gasoline", "price": 3.097}, {"date": "2024-11-04", "fuel": "gasoline", "price": 3.069}, {"date": "2024-11-11", "fuel": "gasoline", "price": 3.052}, {"date": "2024-11-18", "fuel": "gasoline", "price": 3.046}, {"date": "2024-11-25", "fuel": "gasoline", "price": 3.044}, {"date": "2024-12-02", "fuel": "gasoline", "price": 3.034}, {"date": "2024-12-09", "fuel": "gasoline", "price": 3.008}, {"date": "2024-12-16", "fuel": "gasoline", "price": 3.016}, {"date": "2024-12-23", "fuel": "gasoline", "price": 3.024}, {"date": "2024-12-30", "fuel": "gasoline", "price": 3.006}, {"date": "2025-01-06", "fuel": "gasoline", "price": 3.047}, {"date": "2025-01-13", "fuel": "gasoline", "price": 3.043}, {"date": "2025-01-20", "fuel": "gasoline", "price": 3.109}, {"date": "2025-01-27", "fuel": "gasoline", "price": 3.103}, {"date": "2025-02-03", "fuel": "gasoline", "price": 3.082}, {"date": "2025-02-10", "fuel": "gasoline", "price": 3.128}, {"date": "2025-02-17", "fuel": "gasoline", "price": 3.148}, {"date": "2025-02-24", "fuel": "gasoline", "price": 3.125}, {"date": "2025-03-03", "fuel": "gasoline", "price": 3.078}, {"date": "2025-03-10", "fuel": "gasoline", "price": 3.069}, {"date": "2025-03-17", "fuel": "gasoline", "price": 3.058}, {"date": "2025-03-24", "fuel": "gasoline", "price": 3.115}, {"date": "2025-03-31", "fuel": "gasoline", "price": 3.162}, {"date": "2025-04-07", "fuel": "gasoline", "price": 3.243}, {"date": "2025-04-14", "fuel": "gasoline", "price": 3.168}, {"date": "2025-04-21", "fuel": "gasoline", "price": 3.141}, {"date": "2025-04-28", "fuel": "gasoline", "price": 3.133}, {"date": "2025-05-05", "fuel": "gasoline", "price": 3.147}, {"date": "2025-05-12", "fuel": "gasoline", "price": 3.12}, {"date": "2025-05-19", "fuel": "gasoline", "price": 3.173}, {"date": "2025-05-26", "fuel": "gasoline", "price": 3.16}, {"date": "2025-06-02", "fuel": "gasoline", "price": 3.127}, {"date": "2025-06-09", "fuel": "gasoline", "price": 3.108}, {"date": "2025-06-16", "fuel": "gasoline", "price": 3.139}, {"date": "2025-06-23", "fuel": "gasoline", "price": 3.213}]}, "semantic_types": {"date": "Date", "price": {"semanticType": "Price", "unit": "USD"}}, "chart_spec": {"chartType": "Line Chart", "title": "Regular gasoline reached a record $5.006 per gallon in June 2022", "subtitle": "Weekly U.S. retail price per gallon, Aug 1990–Jun 2025 (USD)", "source": {"text": "TidyTuesday 2025-07-01; U.S. Energy Information Administration", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"}, "encodings": {"x": {"field": "date"}, "y": {"field": "price"}}, "chartProperties": {"showPoints": true}, "baseSize": {"width": 800, "height": 420}}}, "updates": [{"id": "record-high", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"date": "2022-06-13"}}}, "value": {"text": "Record: $5.006/gal · Jun 13, 2022", "anchor": "point", "highlight": "strong"}}]}]}, {"key": "gpt-6.1-sol__global-human-day-4__r1", "question": "Compare passive leisure with schooling and research.", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"activity": "Passive leisure", "hoursPerDay": 2.59, "uncertainty": 0.24}, {"activity": "Schooling & research", "hoursPerDay": 1.07, "uncertainty": 0.07}]}, "semantic_types": {"activity": "Category", "hoursPerDay": {"semanticType": "Duration", "unit": "hours"}, "uncertainty": "Quantity"}, "chart_spec": {"chartType": "Bar Chart", "title": "Passive leisure takes more than twice as much time", "subtitle": "Worldwide average person: hours per day, compared with schooling & research", "source": {"text": "Fajzel et al. (2023) · TidyTuesday", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2023/2023-09-12"}, "encodings": {"y": {"field": "activity", "sortBy": "x", "sortOrder": "descending"}, "x": {"field": "hoursPerDay"}}, "baseSize": {"width": 640, "height": 300}, "chartProperties": {"showValueLabels": true}}, "field_display_names": {"hoursPerDay": "Hours per day", "activity": "Activity", "uncertainty": "Uncertainty (variance)"}}, "updates": [{"id": "comparison", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"activity": "Passive leisure"}}}, "value": {"text": "1.52 more hours per day", "highlight": "none"}}]}]}, {"key": "gpt-6-luna__global-temps-2__r1", "question": "Annotate the five warmest years on record.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"Year": 1880, "J-D": -0.17}, {"Year": 1881, "J-D": -0.09}, {"Year": 1882, "J-D": -0.11}, {"Year": 1883, "J-D": -0.18}, {"Year": 1884, "J-D": -0.29}, {"Year": 1885, "J-D": -0.34}, {"Year": 1886, "J-D": -0.32}, {"Year": 1887, "J-D": -0.37}, {"Year": 1888, "J-D": -0.17}, {"Year": 1889, "J-D": -0.11}, {"Year": 1890, "J-D": -0.35}, {"Year": 1891, "J-D": -0.22}, {"Year": 1892, "J-D": -0.27}, {"Year": 1893, "J-D": -0.32}, {"Year": 1894, "J-D": -0.31}, {"Year": 1895, "J-D": -0.23}, {"Year": 1896, "J-D": -0.11}, {"Year": 1897, "J-D": -0.11}, {"Year": 1898, "J-D": -0.27}, {"Year": 1899, "J-D": -0.18}, {"Year": 1900, "J-D": -0.08}, {"Year": 1901, "J-D": -0.16}, {"Year": 1902, "J-D": -0.28}, {"Year": 1903, "J-D": -0.37}, {"Year": 1904, "J-D": -0.47}, {"Year": 1905, "J-D": -0.26}, {"Year": 1906, "J-D": -0.22}, {"Year": 1907, "J-D": -0.39}, {"Year": 1908, "J-D": -0.42}, {"Year": 1909, "J-D": -0.48}, {"Year": 1910, "J-D": -0.43}, {"Year": 1911, "J-D": -0.45}, {"Year": 1912, "J-D": -0.37}, {"Year": 1913, "J-D": -0.34}, {"Year": 1914, "J-D": -0.15}, {"Year": 1915, "J-D": -0.14}, {"Year": 1916, "J-D": -0.36}, {"Year": 1917, "J-D": -0.46}, {"Year": 1918, "J-D": -0.3}, {"Year": 1919, "J-D": -0.28}, {"Year": 1920, "J-D": -0.27}, {"Year": 1921, "J-D": -0.19}, {"Year": 1922, "J-D": -0.28}, {"Year": 1923, "J-D": -0.26}, {"Year": 1924, "J-D": -0.27}, {"Year": 1925, "J-D": -0.22}, {"Year": 1926, "J-D": -0.11}, {"Year": 1927, "J-D": -0.22}, {"Year": 1928, "J-D": -0.2}, {"Year": 1929, "J-D": -0.36}, {"Year": 1930, "J-D": -0.16}, {"Year": 1931, "J-D": -0.09}, {"Year": 1932, "J-D": -0.16}, {"Year": 1933, "J-D": -0.28}, {"Year": 1934, "J-D": -0.12}, {"Year": 1935, "J-D": -0.2}, {"Year": 1936, "J-D": -0.14}, {"Year": 1937, "J-D": -0.03}, {"Year": 1938, "J-D": 0}, {"Year": 1939, "J-D": -0.02}, {"Year": 1940, "J-D": 0.13}, {"Year": 1941, "J-D": 0.19}, {"Year": 1942, "J-D": 0.07}, {"Year": 1943, "J-D": 0.09}, {"Year": 1944, "J-D": 0.21}, {"Year": 1945, "J-D": 0.09}, {"Year": 1946, "J-D": -0.07}, {"Year": 1947, "J-D": -0.02}, {"Year": 1948, "J-D": -0.11}, {"Year": 1949, "J-D": -0.11}, {"Year": 1950, "J-D": -0.17}, {"Year": 1951, "J-D": -0.07}, {"Year": 1952, "J-D": 0.01}, {"Year": 1953, "J-D": 0.08}, {"Year": 1954, "J-D": -0.13}, {"Year": 1955, "J-D": -0.14}, {"Year": 1956, "J-D": -0.19}, {"Year": 1957, "J-D": 0.05}, {"Year": 1958, "J-D": 0.06}, {"Year": 1959, "J-D": 0.03}, {"Year": 1960, "J-D": -0.03}, {"Year": 1961, "J-D": 0.06}, {"Year": 1962, "J-D": 0.03}, {"Year": 1963, "J-D": 0.05}, {"Year": 1964, "J-D": -0.2}, {"Year": 1965, "J-D": -0.11}, {"Year": 1966, "J-D": -0.06}, {"Year": 1967, "J-D": -0.02}, {"Year": 1968, "J-D": -0.08}, {"Year": 1969, "J-D": 0.05}, {"Year": 1970, "J-D": 0.03}, {"Year": 1971, "J-D": -0.08}, {"Year": 1972, "J-D": 0.01}, {"Year": 1973, "J-D": 0.16}, {"Year": 1974, "J-D": -0.07}, {"Year": 1975, "J-D": -0.01}, {"Year": 1976, "J-D": -0.1}, {"Year": 1977, "J-D": 0.18}, {"Year": 1978, "J-D": 0.07}, {"Year": 1979, "J-D": 0.16}, {"Year": 1980, "J-D": 0.26}, {"Year": 1981, "J-D": 0.32}, {"Year": 1982, "J-D": 0.14}, {"Year": 1983, "J-D": 0.31}, {"Year": 1984, "J-D": 0.16}, {"Year": 1985, "J-D": 0.12}, {"Year": 1986, "J-D": 0.18}, {"Year": 1987, "J-D": 0.32}, {"Year": 1988, "J-D": 0.39}, {"Year": 1989, "J-D": 0.27}, {"Year": 1990, "J-D": 0.45}, {"Year": 1991, "J-D": 0.4}, {"Year": 1992, "J-D": 0.22}, {"Year": 1993, "J-D": 0.23}, {"Year": 1994, "J-D": 0.32}, {"Year": 1995, "J-D": 0.45}, {"Year": 1996, "J-D": 0.33}, {"Year": 1997, "J-D": 0.46}, {"Year": 1998, "J-D": 0.61}, {"Year": 1999, "J-D": 0.38}, {"Year": 2000, "J-D": 0.39}, {"Year": 2001, "J-D": 0.54}, {"Year": 2002, "J-D": 0.63}, {"Year": 2003, "J-D": 0.62}, {"Year": 2004, "J-D": 0.53}, {"Year": 2005, "J-D": 0.68}, {"Year": 2006, "J-D": 0.64}, {"Year": 2007, "J-D": 0.67}, {"Year": 2008, "J-D": 0.54}, {"Year": 2009, "J-D": 0.66}, {"Year": 2010, "J-D": 0.73}, {"Year": 2011, "J-D": 0.61}, {"Year": 2012, "J-D": 0.65}, {"Year": 2013, "J-D": 0.68}, {"Year": 2014, "J-D": 0.75}, {"Year": 2015, "J-D": 0.9}, {"Year": 2016, "J-D": 1.02}, {"Year": 2017, "J-D": 0.92}, {"Year": 2018, "J-D": 0.85}, {"Year": 2019, "J-D": 0.98}, {"Year": 2020, "J-D": 1.02}, {"Year": 2021, "J-D": 0.85}, {"Year": 2022, "J-D": 0.9}]}, "semantic_types": {"Year": "Year", "J-D": {"semanticType": "Temperature", "unit": "°C", "divergingMidpoint": 0}}, "chart_spec": {"chartType": "Line Chart", "title": "2016 and 2020 share the highest annual anomaly", "subtitle": "Global annual (January–December) surface temperature anomaly, °C vs 1951–1980; 2023 omitted because it is partial", "source": {"text": "TidyTuesday / NASA GISTEMP v4", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2023/2023-07-11"}, "encodings": {"x": {"field": "Year"}, "y": {"field": "J-D"}}, "chartProperties": {"showPoints": true}, "baseSize": {"width": 760, "height": 420}}}, "updates": [{"id": "warmest-years", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"Year": 2016}}}, "value": {"text": "2016 · +1.02°C", "anchor": "point", "highlight": "strong"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2020}}}, "value": {"text": "2020 · +1.02°C", "anchor": "point", "highlight": "strong"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2019}}}, "value": {"text": "2019 · +0.98°C", "anchor": "point", "highlight": "strong"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2017}}}, "value": {"text": "2017 · +0.92°C", "anchor": "point", "highlight": "strong"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2015}}}, "value": {"text": "2015 · +0.90°C", "anchor": "point", "highlight": "strong"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2022}}}, "value": {"text": "2022 · +0.90°C (tied)", "anchor": "point", "highlight": "strong"}}]}]}, {"key": "gpt-6.1-sol__income-inequality-4__r1", "question": "Point out the most unequal country even after taxes.", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"Entity": "South Africa", "Code": "ZAF", "Year": 2017, "gini_mi_eq": 0.706, "gini_dhi_eq": 0.616, "Country_year": "South Africa (2017)"}, {"Entity": "Cote d'Ivoire", "Code": "CIV", "Year": 2015, "gini_mi_eq": null, "gini_dhi_eq": 0.579, "Country_year": "Cote d'Ivoire (2015)"}, {"Entity": "Dominican Republic", "Code": "DOM", "Year": 2007, "gini_mi_eq": 0.523, "gini_dhi_eq": 0.515, "Country_year": "Dominican Republic (2007)"}, {"Entity": "Colombia", "Code": "COL", "Year": 2023, "gini_mi_eq": null, "gini_dhi_eq": 0.508, "Country_year": "Colombia (2023)"}, {"Entity": "India", "Code": "IND", "Year": 2011, "gini_mi_eq": null, "gini_dhi_eq": 0.501, "Country_year": "India (2011)"}, {"Entity": "Palestine", "Code": "PSE", "Year": 2023, "gini_mi_eq": null, "gini_dhi_eq": 0.49, "Country_year": "Palestine (2023)"}, {"Entity": "Panama", "Code": "PAN", "Year": 2016, "gini_mi_eq": null, "gini_dhi_eq": 0.461, "Country_year": "Panama (2016)"}, {"Entity": "Chile", "Code": "CHL", "Year": 2017, "gini_mi_eq": null, "gini_dhi_eq": 0.459, "Country_year": "Chile (2017)"}, {"Entity": "Brazil", "Code": "BRA", "Year": 2022, "gini_mi_eq": null, "gini_dhi_eq": 0.453, "Country_year": "Brazil (2022)"}, {"Entity": "Paraguay", "Code": "PRY", "Year": 2020, "gini_mi_eq": null, "gini_dhi_eq": 0.443, "Country_year": "Paraguay (2020)"}]}, "semantic_types": {"Country_year": "Category", "gini_dhi_eq": {"semanticType": "Number", "intrinsicDomain": [0, 1]}}, "chart_spec": {"chartType": "Bar Chart", "title": "South Africa remains the most unequal after taxes", "subtitle": "Post-tax-and-transfer Gini (0–1, higher = more unequal). Top 10 countries using each country's latest observation; years differ.", "source": "Luxembourg Income Study via Our World in Data · TidyTuesday 2025-08-05", "encodings": {"y": {"field": "Country_year", "sortBy": "x", "sortOrder": "descending"}, "x": {"field": "gini_dhi_eq", "title": "Post-tax Gini"}}, "baseSize": {"width": 740, "height": 450}, "chartProperties": {"showValueLabels": true, "includeZero_x": true}}, "field_display_names": {"Country_year": "Country (observation year)", "gini_dhi_eq": "Post-tax Gini"}}, "updates": [{"id": "agent", "ops": [{"op": "set-style", "targets": [{"select": {"key": {"Country_year": "South Africa (2017)"}}}], "value": {"state": "emphasized"}}, {"op": "annotate-text", "target": {"select": {"key": {"Country_year": "South Africa (2017)"}}}, "value": {"text": "Down from 0.706 before taxes and transfers", "highlight": "none"}}]}]}, {"key": "gpt-6-luna__life-expectancy-5__r1", "question": "Show world life expectancy since 1950 and mark 2019 as the pre-pandemic high.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"Entity": "World", "Code": "OWID_WRL", "Year": 1950, "LifeExpectancy": 46.4643}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1951, "LifeExpectancy": 47.144}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1952, "LifeExpectancy": 48.2311}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1953, "LifeExpectancy": 48.8024}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1954, "LifeExpectancy": 49.5919}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1955, "LifeExpectancy": 50.1229}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1956, "LifeExpectancy": 50.6425}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1957, "LifeExpectancy": 50.9448}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1958, "LifeExpectancy": 51.537}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1959, "LifeExpectancy": 49.3453}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1960, "LifeExpectancy": 47.6972}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1961, "LifeExpectancy": 50.3587}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1962, "LifeExpectancy": 53.1245}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1963, "LifeExpectancy": 53.5761}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1964, "LifeExpectancy": 54.1638}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1965, "LifeExpectancy": 53.8924}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1966, "LifeExpectancy": 54.472}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1967, "LifeExpectancy": 54.9203}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1968, "LifeExpectancy": 55.486}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1969, "LifeExpectancy": 55.8286}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1970, "LifeExpectancy": 56.112}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1971, "LifeExpectancy": 55.8924}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1972, "LifeExpectancy": 57.1231}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1973, "LifeExpectancy": 57.6327}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1974, "LifeExpectancy": 58.0422}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1975, "LifeExpectancy": 58.2754}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1976, "LifeExpectancy": 58.7107}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1977, "LifeExpectancy": 59.3652}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1978, "LifeExpectancy": 59.7402}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1979, "LifeExpectancy": 60.2037}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1980, "LifeExpectancy": 60.5524}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1981, "LifeExpectancy": 60.9915}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1982, "LifeExpectancy": 61.4165}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1983, "LifeExpectancy": 61.5651}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1984, "LifeExpectancy": 61.907}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1985, "LifeExpectancy": 62.2356}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1986, "LifeExpectancy": 62.7665}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1987, "LifeExpectancy": 63.1585}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1988, "LifeExpectancy": 63.2806}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1989, "LifeExpectancy": 63.7919}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1990, "LifeExpectancy": 63.9879}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1991, "LifeExpectancy": 64.0583}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1992, "LifeExpectancy": 64.3027}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1993, "LifeExpectancy": 64.4369}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1994, "LifeExpectancy": 64.4588}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1995, "LifeExpectancy": 64.8766}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1996, "LifeExpectancy": 65.1429}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1997, "LifeExpectancy": 65.5007}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1998, "LifeExpectancy": 65.7215}, {"Entity": "World", "Code": "OWID_WRL", "Year": 1999, "LifeExpectancy": 66.0735}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2000, "LifeExpectancy": 66.4525}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2001, "LifeExpectancy": 66.8336}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2002, "LifeExpectancy": 67.1373}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2003, "LifeExpectancy": 67.46}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2004, "LifeExpectancy": 67.8074}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2005, "LifeExpectancy": 68.2047}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2006, "LifeExpectancy": 68.7027}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2007, "LifeExpectancy": 69.0508}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2008, "LifeExpectancy": 69.3014}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2009, "LifeExpectancy": 69.7965}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2010, "LifeExpectancy": 70.1088}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2011, "LifeExpectancy": 70.5303}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2012, "LifeExpectancy": 70.8725}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2013, "LifeExpectancy": 71.2072}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2014, "LifeExpectancy": 71.5649}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2015, "LifeExpectancy": 71.8004}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2016, "LifeExpectancy": 72.1102}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2017, "LifeExpectancy": 72.3267}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2018, "LifeExpectancy": 72.5759}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2019, "LifeExpectancy": 72.7897}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2020, "LifeExpectancy": 72.0361}, {"Entity": "World", "Code": "OWID_WRL", "Year": 2021, "LifeExpectancy": 71.0479}]}, "semantic_types": {"Entity": "Category", "Code": "ID", "Year": "Year", "LifeExpectancy": {"semanticType": "Quantity", "unit": "years"}}, "chart_spec": {"chartType": "Line Chart", "title": "World life expectancy reached a pre-pandemic high in 2019", "subtitle": "Period life expectancy at birth, world, 1950–2021 (years)", "encodings": {"x": {"field": "Year"}, "y": {"field": "LifeExpectancy"}}, "baseSize": {"width": 700, "height": 380}, "chartProperties": {"showPoints": true}}}, "updates": [{"id": "pre-pandemic-high", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"Year": 2019}}}, "value": {"text": "Pre-pandemic high", "anchor": "point", "highlight": "strong"}}]}]}, {"key": "gpt-6-luna__london-marathon-3__r1", "question": "When did demand for places really take off?", "model": "gpt-6-luna", "spec": {"data": {"values": [{"Year": 1981, "Applicants": 20000}, {"Year": 1982, "Applicants": 90000}, {"Year": 1983, "Applicants": 60000}, {"Year": 1984, "Applicants": 70000}, {"Year": 1985, "Applicants": 83000}, {"Year": 1986, "Applicants": 80000}, {"Year": 1987, "Applicants": 80000}, {"Year": 1988, "Applicants": 73000}, {"Year": 1989, "Applicants": 72000}, {"Year": 1990, "Applicants": 73000}, {"Year": 1991, "Applicants": 79000}, {"Year": 1992, "Applicants": 83000}, {"Year": 1993, "Applicants": 68000}, {"Year": 1994, "Applicants": 72000}, {"Year": 1995, "Applicants": 79000}, {"Year": 1996, "Applicants": 68000}, {"Year": 1997, "Applicants": 78000}, {"Year": 1998, "Applicants": 96000}, {"Year": 1999, "Applicants": 87000}, {"Year": 2000, "Applicants": 93000}, {"Year": 2001, "Applicants": 92000}, {"Year": 2002, "Applicants": 99000}, {"Year": 2003, "Applicants": 111000}, {"Year": 2004, "Applicants": 108000}, {"Year": 2005, "Applicants": 132000}, {"Year": 2006, "Applicants": 119000}, {"Year": 2007, "Applicants": 128000}, {"Year": 2008, "Applicants": 120000}, {"Year": 2009, "Applicants": 155000}, {"Year": 2010, "Applicants": 163000}, {"Year": 2011, "Applicants": 163926}, {"Year": 2012, "Applicants": 170150}, {"Year": 2013, "Applicants": 167449}, {"Year": 2014, "Applicants": 169682}, {"Year": 2015, "Applicants": 172888}, {"Year": 2016, "Applicants": 247069}, {"Year": 2017, "Applicants": 253930}, {"Year": 2018, "Applicants": 386050}, {"Year": 2019, "Applicants": 414168}, {"Year": 2020, "Applicants": 457861}]}, "semantic_types": {"Year": "Year", "Applicants": "Count"}, "chart_spec": {"chartType": "Line Chart", "title": "Demand for London Marathon places takes off from 2016", "subtitle": "Applicants by race year, people", "encodings": {"x": {"field": "Year"}, "y": {"field": "Applicants"}}}}, "updates": [{"id": "demand-surge", "ops": [{"op": "set-style", "targets": [{"select": {"where": {"Year": {"range": [2016, 2020]}}}}], "value": {"state": "emphasized"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2016}}}, "value": {"text": "First step-change: 247,069 applicants (+43% vs 2015)", "anchor": "point"}}, {"op": "annotate-text", "target": {"select": {"key": {"Year": 2018}}}, "value": {"text": "A second leap: 386,050 (+52% vs 2017)", "anchor": "point"}}]}]}, {"key": "gpt-6-luna__measles-1__r1", "question": "Which years had the most measles cases worldwide?", "model": "gpt-6-luna", "spec": {"data": {"values": [{"year": 2012, "global_measles_cases": 112548}, {"year": 2013, "global_measles_cases": 178526}, {"year": 2014, "global_measles_cases": 290888}, {"year": 2015, "global_measles_cases": 247474}, {"year": 2016, "global_measles_cases": 180015}, {"year": 2017, "global_measles_cases": 168190}, {"year": 2018, "global_measles_cases": 276157}, {"year": 2019, "global_measles_cases": 541401}, {"year": 2020, "global_measles_cases": 93840}, {"year": 2021, "global_measles_cases": 59619}, {"year": 2022, "global_measles_cases": 174340}, {"year": 2023, "global_measles_cases": 321889}, {"year": 2024, "global_measles_cases": 359534}, {"year": 2025, "global_measles_cases": 88853}]}, "semantic_types": {"year": "Year", "global_measles_cases": "Count"}, "chart_spec": {"chartType": "Bar Chart", "title": "Measles cases peaked in 2019, with another surge in 2023–24", "subtitle": "Reported annual measles cases summed across countries, 2012–2025; 2025 is partial", "source": {"text": "TidyTuesday, 2025-06-24", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-06-24"}, "encodings": {"x": {"field": "year"}, "y": {"field": "global_measles_cases"}}, "chartProperties": {"showValueLabels": true}}}, "updates": [{"id": "finding", "ops": [{"op": "set-style", "targets": [{"select": {"key": {"year": 2019}}}], "value": {"state": "emphasized"}}]}]}, {"key": "gpt-6.1-sol__nhl-births-2__r1", "question": "Compare players' birth months with all Canadian births and highlight the months that are over-represented.", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"month": "Jan", "population": "Canada-born NHL players", "share": 9.93050475493782, "difference_pp": 1.9152393342558014}, {"month": "Jan", "population": "All Canadian births", "share": 8.015265420682018, "difference_pp": 1.9152393342558014}, {"month": "Feb", "population": "Canada-born NHL players", "share": 9.747622531089977, "difference_pp": 2.202526073228168}, {"month": "Feb", "population": "All Canadian births", "share": 7.545096457861809, "difference_pp": 2.202526073228168}, {"month": "Mar", "population": "Canada-born NHL players", "share": 9.381858083394294, "difference_pp": 0.9016345547498332}, {"month": "Mar", "population": "All Canadian births", "share": 8.48022352864446, "difference_pp": 0.9016345547498332}, {"month": "Apr", "population": "Canada-born NHL players", "share": 9.619604974396488, "difference_pp": 1.2467914686780865}, {"month": "Apr", "population": "All Canadian births", "share": 8.372813505718401, "difference_pp": 1.2467914686780865}, {"month": "May", "population": "Canada-born NHL players", "share": 9.528163862472567, "difference_pp": 0.7621947635230306}, {"month": "May", "population": "All Canadian births", "share": 8.765969098949537, "difference_pp": 0.7621947635230306}, {"month": "Jun", "population": "Canada-born NHL players", "share": 8.467446964155084, "difference_pp": -0.05608115240867484}, {"month": "Jun", "population": "All Canadian births", "share": 8.523528116563758, "difference_pp": -0.05608115240867484}, {"month": "Jul", "population": "Canada-born NHL players", "share": 7.991953182150695, "difference_pp": -0.8834608977494209}, {"month": "Jul", "population": "All Canadian births", "share": 8.875414079900116, "difference_pp": -0.8834608977494209}, {"month": "Aug", "population": "Canada-born NHL players", "share": 7.187271397220191, "difference_pp": -1.5317233777909331}, {"month": "Aug", "population": "All Canadian births", "share": 8.718994775011124, "difference_pp": -1.5317233777909331}, {"month": "Sep", "population": "Canada-born NHL players", "share": 7.6993416239941475, "difference_pp": -0.9810740932383037}, {"month": "Sep", "population": "All Canadian births", "share": 8.680415717232451, "difference_pp": -0.9810740932383037}, {"month": "Oct", "population": "Canada-born NHL players", "share": 7.022677395757132, "difference_pp": -1.3447379367916223}, {"month": "Oct", "population": "All Canadian births", "share": 8.367415332548754, "difference_pp": -1.3447379367916223}, {"month": "Nov", "population": "Canada-born NHL players", "share": 6.839795171909291, "difference_pp": -0.9801823941685202}, {"month": "Nov", "population": "All Canadian births", "share": 7.819977566077811, "difference_pp": -0.9801823941685202}, {"month": "Dec", "population": "Canada-born NHL players", "share": 6.583760058522311, "difference_pp": -1.2511263422874483}, {"month": "Dec", "population": "All Canadian births", "share": 7.83488640080976, "difference_pp": -1.2511263422874483}]}, "semantic_types": {"month": "Month", "population": "Category", "share": {"semanticType": "Percentage", "percentScale": "percent"}}, "chart_spec": {"chartType": "Grouped Bar Chart", "title": "January–May births are over-represented among Canada-born NHL players", "subtitle": "Monthly shares: 5,468 players (born 1879–2005) vs 11.74 million Canadian births (1991–2022)", "source": {"text": "TidyTuesday, 2024-01-09", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2024/2024-01-09"}, "encodings": {"x": {"field": "month"}, "y": {"field": "share", "title": "Share of births (%)"}, "group": {"field": "population"}}, "baseSize": {"width": 850, "height": 420}}}, "updates": [{"id": "overrepresented", "ops": [{"op": "annotate-region", "name": "early-months", "value": {"x": ["Jan", "Feb", "Mar", "Apr", "May"], "text": "Higher share among players", "layer": "under"}}]}]}, {"key": "gpt-6.1-sol__penguins-2__r1", "question": "Plot flipper length against body mass and outline each species' cluster.", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"species": "Adelie", "flipper_len": 181, "body_mass": 3750}, {"species": "Adelie", "flipper_len": 186, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 195, "body_mass": 3250}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3450}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3650}, {"species": "Adelie", "flipper_len": 181, "body_mass": 3625}, {"species": "Adelie", "flipper_len": 195, "body_mass": 4675}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3475}, {"species": "Adelie", "flipper_len": 190, "body_mass": 4250}, {"species": "Adelie", "flipper_len": 186, "body_mass": 3300}, {"species": "Adelie", "flipper_len": 180, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 182, "body_mass": 3200}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 198, "body_mass": 4400}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 195, "body_mass": 3450}, {"species": "Adelie", "flipper_len": 197, "body_mass": 4500}, {"species": "Adelie", "flipper_len": 184, "body_mass": 3325}, {"species": "Adelie", "flipper_len": 194, "body_mass": 4200}, {"species": "Adelie", "flipper_len": 174, "body_mass": 3400}, {"species": "Adelie", "flipper_len": 180, "body_mass": 3600}, {"species": "Adelie", "flipper_len": 189, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3950}, {"species": "Adelie", "flipper_len": 180, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 183, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3200}, {"species": "Adelie", "flipper_len": 172, "body_mass": 3150}, {"species": "Adelie", "flipper_len": 180, "body_mass": 3950}, {"species": "Adelie", "flipper_len": 178, "body_mass": 3250}, {"species": "Adelie", "flipper_len": 178, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 188, "body_mass": 3300}, {"species": "Adelie", "flipper_len": 184, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 195, "body_mass": 3325}, {"species": "Adelie", "flipper_len": 196, "body_mass": 4150}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3950}, {"species": "Adelie", "flipper_len": 180, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 181, "body_mass": 3300}, {"species": "Adelie", "flipper_len": 184, "body_mass": 4650}, {"species": "Adelie", "flipper_len": 182, "body_mass": 3150}, {"species": "Adelie", "flipper_len": 195, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 186, "body_mass": 3100}, {"species": "Adelie", "flipper_len": 196, "body_mass": 4400}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3000}, {"species": "Adelie", "flipper_len": 190, "body_mass": 4600}, {"species": "Adelie", "flipper_len": 182, "body_mass": 3425}, {"species": "Adelie", "flipper_len": 179, "body_mass": 2975}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3450}, {"species": "Adelie", "flipper_len": 191, "body_mass": 4150}, {"species": "Adelie", "flipper_len": 186, "body_mass": 3500}, {"species": "Adelie", "flipper_len": 188, "body_mass": 4300}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3450}, {"species": "Adelie", "flipper_len": 200, "body_mass": 4050}, {"species": "Adelie", "flipper_len": 187, "body_mass": 2900}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 186, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 181, "body_mass": 2850}, {"species": "Adelie", "flipper_len": 194, "body_mass": 3750}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3150}, {"species": "Adelie", "flipper_len": 195, "body_mass": 4400}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3600}, {"species": "Adelie", "flipper_len": 192, "body_mass": 4050}, {"species": "Adelie", "flipper_len": 184, "body_mass": 2850}, {"species": "Adelie", "flipper_len": 192, "body_mass": 3950}, {"species": "Adelie", "flipper_len": 195, "body_mass": 3350}, {"species": "Adelie", "flipper_len": 188, "body_mass": 4100}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3050}, {"species": "Adelie", "flipper_len": 198, "body_mass": 4450}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3600}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 196, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 197, "body_mass": 4150}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 195, "body_mass": 4250}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 184, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 195, "body_mass": 4000}, {"species": "Adelie", "flipper_len": 189, "body_mass": 3200}, {"species": "Adelie", "flipper_len": 196, "body_mass": 4700}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 193, "body_mass": 4200}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3350}, {"species": "Adelie", "flipper_len": 194, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3800}, {"species": "Adelie", "flipper_len": 189, "body_mass": 3500}, {"species": "Adelie", "flipper_len": 189, "body_mass": 3950}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3600}, {"species": "Adelie", "flipper_len": 202, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 205, "body_mass": 4300}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3400}, {"species": "Adelie", "flipper_len": 186, "body_mass": 4450}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3300}, {"species": "Adelie", "flipper_len": 208, "body_mass": 4300}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 196, "body_mass": 4350}, {"species": "Adelie", "flipper_len": 178, "body_mass": 2900}, {"species": "Adelie", "flipper_len": 192, "body_mass": 4100}, {"species": "Adelie", "flipper_len": 192, "body_mass": 3725}, {"species": "Adelie", "flipper_len": 203, "body_mass": 4725}, {"species": "Adelie", "flipper_len": 183, "body_mass": 3075}, {"species": "Adelie", "flipper_len": 190, "body_mass": 4250}, {"species": "Adelie", "flipper_len": 193, "body_mass": 2925}, {"species": "Adelie", "flipper_len": 184, "body_mass": 3550}, {"species": "Adelie", "flipper_len": 199, "body_mass": 3750}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 181, "body_mass": 3175}, {"species": "Adelie", "flipper_len": 197, "body_mass": 4775}, {"species": "Adelie", "flipper_len": 198, "body_mass": 3825}, {"species": "Adelie", "flipper_len": 191, "body_mass": 4600}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3200}, {"species": "Adelie", "flipper_len": 197, "body_mass": 4275}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 196, "body_mass": 4075}, {"species": "Adelie", "flipper_len": 188, "body_mass": 2900}, {"species": "Adelie", "flipper_len": 199, "body_mass": 3775}, {"species": "Adelie", "flipper_len": 189, "body_mass": 3350}, {"species": "Adelie", "flipper_len": 189, "body_mass": 3325}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3150}, {"species": "Adelie", "flipper_len": 198, "body_mass": 3500}, {"species": "Adelie", "flipper_len": 176, "body_mass": 3450}, {"species": "Adelie", "flipper_len": 202, "body_mass": 3875}, {"species": "Adelie", "flipper_len": 186, "body_mass": 3050}, {"species": "Adelie", "flipper_len": 199, "body_mass": 4000}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3275}, {"species": "Adelie", "flipper_len": 195, "body_mass": 4300}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3050}, {"species": "Adelie", "flipper_len": 210, "body_mass": 4000}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3325}, {"species": "Adelie", "flipper_len": 197, "body_mass": 3500}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3500}, {"species": "Adelie", "flipper_len": 199, "body_mass": 4475}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3425}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3900}, {"species": "Adelie", "flipper_len": 191, "body_mass": 3175}, {"species": "Adelie", "flipper_len": 200, "body_mass": 3975}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3400}, {"species": "Adelie", "flipper_len": 193, "body_mass": 4250}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3400}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3475}, {"species": "Adelie", "flipper_len": 188, "body_mass": 3050}, {"species": "Adelie", "flipper_len": 190, "body_mass": 3725}, {"species": "Adelie", "flipper_len": 192, "body_mass": 3000}, {"species": "Adelie", "flipper_len": 185, "body_mass": 3650}, {"species": "Adelie", "flipper_len": 190, "body_mass": 4250}, {"species": "Adelie", "flipper_len": 184, "body_mass": 3475}, {"species": "Adelie", "flipper_len": 195, "body_mass": 3450}, {"species": "Adelie", "flipper_len": 193, "body_mass": 3750}, {"species": "Adelie", "flipper_len": 187, "body_mass": 3700}, {"species": "Adelie", "flipper_len": 201, "body_mass": 4000}, {"species": "Gentoo", "flipper_len": 211, "body_mass": 4500}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 5700}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4450}, {"species": "Gentoo", "flipper_len": 218, "body_mass": 5700}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5400}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4550}, {"species": "Gentoo", "flipper_len": 211, "body_mass": 4800}, {"species": "Gentoo", "flipper_len": 219, "body_mass": 5200}, {"species": "Gentoo", "flipper_len": 209, "body_mass": 4400}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5150}, {"species": "Gentoo", "flipper_len": 214, "body_mass": 4650}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 5550}, {"species": "Gentoo", "flipper_len": 214, "body_mass": 4650}, {"species": "Gentoo", "flipper_len": 213, "body_mass": 5850}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4200}, {"species": "Gentoo", "flipper_len": 217, "body_mass": 5850}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4150}, {"species": "Gentoo", "flipper_len": 221, "body_mass": 6300}, {"species": "Gentoo", "flipper_len": 209, "body_mass": 4800}, {"species": "Gentoo", "flipper_len": 222, "body_mass": 5350}, {"species": "Gentoo", "flipper_len": 218, "body_mass": 5700}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5000}, {"species": "Gentoo", "flipper_len": 213, "body_mass": 4400}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5050}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5000}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5100}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 4100}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5650}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4600}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 5550}, {"species": "Gentoo", "flipper_len": 222, "body_mass": 5250}, {"species": "Gentoo", "flipper_len": 209, "body_mass": 4700}, {"species": "Gentoo", "flipper_len": 207, "body_mass": 5050}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 6050}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 5150}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 5400}, {"species": "Gentoo", "flipper_len": 213, "body_mass": 4950}, {"species": "Gentoo", "flipper_len": 219, "body_mass": 5250}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 4350}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 5350}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 3950}, {"species": "Gentoo", "flipper_len": 225, "body_mass": 5700}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4300}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 4750}, {"species": "Gentoo", "flipper_len": 222, "body_mass": 5550}, {"species": "Gentoo", "flipper_len": 217, "body_mass": 4900}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4200}, {"species": "Gentoo", "flipper_len": 225, "body_mass": 5400}, {"species": "Gentoo", "flipper_len": 213, "body_mass": 5100}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5300}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4850}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 5300}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4400}, {"species": "Gentoo", "flipper_len": 225, "body_mass": 5000}, {"species": "Gentoo", "flipper_len": 217, "body_mass": 4900}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 5050}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 4300}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 5000}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 4450}, {"species": "Gentoo", "flipper_len": 224, "body_mass": 5550}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 4200}, {"species": "Gentoo", "flipper_len": 221, "body_mass": 5300}, {"species": "Gentoo", "flipper_len": 214, "body_mass": 4400}, {"species": "Gentoo", "flipper_len": 231, "body_mass": 5650}, {"species": "Gentoo", "flipper_len": 219, "body_mass": 4700}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 5700}, {"species": "Gentoo", "flipper_len": 214, "body_mass": 4650}, {"species": "Gentoo", "flipper_len": 229, "body_mass": 5800}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 4700}, {"species": "Gentoo", "flipper_len": 223, "body_mass": 5550}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 4750}, {"species": "Gentoo", "flipper_len": 221, "body_mass": 5000}, {"species": "Gentoo", "flipper_len": 221, "body_mass": 5100}, {"species": "Gentoo", "flipper_len": 217, "body_mass": 5200}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 4700}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 5800}, {"species": "Gentoo", "flipper_len": 209, "body_mass": 4600}, {"species": "Gentoo", "flipper_len": 220, "body_mass": 6000}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 4750}, {"species": "Gentoo", "flipper_len": 223, "body_mass": 5950}, {"species": "Gentoo", "flipper_len": 212, "body_mass": 4625}, {"species": "Gentoo", "flipper_len": 221, "body_mass": 5450}, {"species": "Gentoo", "flipper_len": 212, "body_mass": 4725}, {"species": "Gentoo", "flipper_len": 224, "body_mass": 5350}, {"species": "Gentoo", "flipper_len": 212, "body_mass": 4750}, {"species": "Gentoo", "flipper_len": 228, "body_mass": 5600}, {"species": "Gentoo", "flipper_len": 218, "body_mass": 4600}, {"species": "Gentoo", "flipper_len": 218, "body_mass": 5300}, {"species": "Gentoo", "flipper_len": 212, "body_mass": 4875}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 5550}, {"species": "Gentoo", "flipper_len": 218, "body_mass": 4950}, {"species": "Gentoo", "flipper_len": 228, "body_mass": 5400}, {"species": "Gentoo", "flipper_len": 212, "body_mass": 4750}, {"species": "Gentoo", "flipper_len": 224, "body_mass": 5650}, {"species": "Gentoo", "flipper_len": 214, "body_mass": 4850}, {"species": "Gentoo", "flipper_len": 226, "body_mass": 5200}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 4925}, {"species": "Gentoo", "flipper_len": 222, "body_mass": 4875}, {"species": "Gentoo", "flipper_len": 203, "body_mass": 4625}, {"species": "Gentoo", "flipper_len": 225, "body_mass": 5250}, {"species": "Gentoo", "flipper_len": 219, "body_mass": 4850}, {"species": "Gentoo", "flipper_len": 228, "body_mass": 5600}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 4975}, {"species": "Gentoo", "flipper_len": 228, "body_mass": 5500}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 4725}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 5500}, {"species": "Gentoo", "flipper_len": 210, "body_mass": 4700}, {"species": "Gentoo", "flipper_len": 219, "body_mass": 5500}, {"species": "Gentoo", "flipper_len": 208, "body_mass": 4575}, {"species": "Gentoo", "flipper_len": 209, "body_mass": 5500}, {"species": "Gentoo", "flipper_len": 216, "body_mass": 5000}, {"species": "Gentoo", "flipper_len": 229, "body_mass": 5950}, {"species": "Gentoo", "flipper_len": 213, "body_mass": 4650}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 5500}, {"species": "Gentoo", "flipper_len": 217, "body_mass": 4375}, {"species": "Gentoo", "flipper_len": 230, "body_mass": 5850}, {"species": "Gentoo", "flipper_len": 217, "body_mass": 4875}, {"species": "Gentoo", "flipper_len": 222, "body_mass": 6000}, {"species": "Gentoo", "flipper_len": 214, "body_mass": 4925}, {"species": "Gentoo", "flipper_len": 215, "body_mass": 4850}, {"species": "Gentoo", "flipper_len": 222, "body_mass": 5750}, {"species": "Gentoo", "flipper_len": 212, "body_mass": 5200}, {"species": "Gentoo", "flipper_len": 213, "body_mass": 5400}, {"species": "Chinstrap", "flipper_len": 192, "body_mass": 3500}, {"species": "Chinstrap", "flipper_len": 196, "body_mass": 3900}, {"species": "Chinstrap", "flipper_len": 193, "body_mass": 3650}, {"species": "Chinstrap", "flipper_len": 188, "body_mass": 3525}, {"species": "Chinstrap", "flipper_len": 197, "body_mass": 3725}, {"species": "Chinstrap", "flipper_len": 198, "body_mass": 3950}, {"species": "Chinstrap", "flipper_len": 178, "body_mass": 3250}, {"species": "Chinstrap", "flipper_len": 197, "body_mass": 3750}, {"species": "Chinstrap", "flipper_len": 195, "body_mass": 4150}, {"species": "Chinstrap", "flipper_len": 198, "body_mass": 3700}, {"species": "Chinstrap", "flipper_len": 193, "body_mass": 3800}, {"species": "Chinstrap", "flipper_len": 194, "body_mass": 3775}, {"species": "Chinstrap", "flipper_len": 185, "body_mass": 3700}, {"species": "Chinstrap", "flipper_len": 201, "body_mass": 4050}, {"species": "Chinstrap", "flipper_len": 190, "body_mass": 3575}, {"species": "Chinstrap", "flipper_len": 201, "body_mass": 4050}, {"species": "Chinstrap", "flipper_len": 197, "body_mass": 3300}, {"species": "Chinstrap", "flipper_len": 181, "body_mass": 3700}, {"species": "Chinstrap", "flipper_len": 190, "body_mass": 3450}, {"species": "Chinstrap", "flipper_len": 195, "body_mass": 4400}, {"species": "Chinstrap", "flipper_len": 181, "body_mass": 3600}, {"species": "Chinstrap", "flipper_len": 191, "body_mass": 3400}, {"species": "Chinstrap", "flipper_len": 187, "body_mass": 2900}, {"species": "Chinstrap", "flipper_len": 193, "body_mass": 3800}, {"species": "Chinstrap", "flipper_len": 195, "body_mass": 3300}, {"species": "Chinstrap", "flipper_len": 197, "body_mass": 4150}, {"species": "Chinstrap", "flipper_len": 200, "body_mass": 3400}, {"species": "Chinstrap", "flipper_len": 200, "body_mass": 3800}, {"species": "Chinstrap", "flipper_len": 191, "body_mass": 3700}, {"species": "Chinstrap", "flipper_len": 205, "body_mass": 4550}, {"species": "Chinstrap", "flipper_len": 187, "body_mass": 3200}, {"species": "Chinstrap", "flipper_len": 201, "body_mass": 4300}, {"species": "Chinstrap", "flipper_len": 187, "body_mass": 3350}, {"species": "Chinstrap", "flipper_len": 203, "body_mass": 4100}, {"species": "Chinstrap", "flipper_len": 195, "body_mass": 3600}, {"species": "Chinstrap", "flipper_len": 199, "body_mass": 3900}, {"species": "Chinstrap", "flipper_len": 195, "body_mass": 3850}, {"species": "Chinstrap", "flipper_len": 210, "body_mass": 4800}, {"species": "Chinstrap", "flipper_len": 192, "body_mass": 2700}, {"species": "Chinstrap", "flipper_len": 205, "body_mass": 4500}, {"species": "Chinstrap", "flipper_len": 210, "body_mass": 3950}, {"species": "Chinstrap", "flipper_len": 187, "body_mass": 3650}, {"species": "Chinstrap", "flipper_len": 196, "body_mass": 3550}, {"species": "Chinstrap", "flipper_len": 196, "body_mass": 3500}, {"species": "Chinstrap", "flipper_len": 196, "body_mass": 3675}, {"species": "Chinstrap", "flipper_len": 201, "body_mass": 4450}, {"species": "Chinstrap", "flipper_len": 190, "body_mass": 3400}, {"species": "Chinstrap", "flipper_len": 212, "body_mass": 4300}, {"species": "Chinstrap", "flipper_len": 187, "body_mass": 3250}, {"species": "Chinstrap", "flipper_len": 198, "body_mass": 3675}, {"species": "Chinstrap", "flipper_len": 199, "body_mass": 3325}, {"species": "Chinstrap", "flipper_len": 201, "body_mass": 3950}, {"species": "Chinstrap", "flipper_len": 193, "body_mass": 3600}, {"species": "Chinstrap", "flipper_len": 203, "body_mass": 4050}, {"species": "Chinstrap", "flipper_len": 187, "body_mass": 3350}, {"species": "Chinstrap", "flipper_len": 197, "body_mass": 3450}, {"species": "Chinstrap", "flipper_len": 191, "body_mass": 3250}, {"species": "Chinstrap", "flipper_len": 203, "body_mass": 4050}, {"species": "Chinstrap", "flipper_len": 202, "body_mass": 3800}, {"species": "Chinstrap", "flipper_len": 194, "body_mass": 3525}, {"species": "Chinstrap", "flipper_len": 206, "body_mass": 3950}, {"species": "Chinstrap", "flipper_len": 189, "body_mass": 3650}, {"species": "Chinstrap", "flipper_len": 195, "body_mass": 3650}, {"species": "Chinstrap", "flipper_len": 207, "body_mass": 4000}, {"species": "Chinstrap", "flipper_len": 202, "body_mass": 3400}, {"species": "Chinstrap", "flipper_len": 193, "body_mass": 3775}, {"species": "Chinstrap", "flipper_len": 210, "body_mass": 4100}, {"species": "Chinstrap", "flipper_len": 198, "body_mass": 3775}]}, "semantic_types": {"species": "Category", "body_mass": {"semanticType": "Quantity", "unit": "g"}, "flipper_len": {"semanticType": "Quantity", "unit": "mm"}}, "chart_spec": {"chartType": "Scatter Plot", "title": "Gentoo penguins are heavier and have longer flippers", "subtitle": "Palmer Archipelago, 2007–2009 · 342 penguins; 2 missing measurements omitted. Outlines enclose each species.", "source": {"text": "TidyTuesday 2025-04-15", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-04-15"}, "encodings": {"x": {"field": "body_mass"}, "y": {"field": "flipper_len"}, "color": {"field": "species"}}, "baseSize": {"width": 650, "height": 450}, "chartProperties": {"includeZero_x": false, "includeZero_y": false}}, "field_display_names": {"body_mass": "Body mass", "flipper_len": "Flipper length", "species": "Species"}}, "updates": [{"id": "species-clusters", "ops": [{"op": "annotate-enclosure", "name": "Adelie-cluster", "value": {"targets": [{"select": {"key": {"species": "Adelie"}}}], "shape": "hull", "connect": "none"}}, {"op": "annotate-enclosure", "name": "Chinstrap-cluster", "value": {"targets": [{"select": {"key": {"species": "Chinstrap"}}}], "shape": "hull", "connect": "none"}}, {"op": "annotate-enclosure", "name": "Gentoo-cluster", "value": {"targets": [{"select": {"key": {"species": "Gentoo"}}}], "shape": "hull", "connect": "none"}}]}]}, {"key": "gpt-6.1-sol__pixar-3__r1", "question": "Have Pixar films been getting longer?", "model": "gpt-6.1-sol", "spec": {"data": {"values": [{"film": "Toy Story", "year": 1995, "run_time": 81, "record_group": "1995–2020"}, {"film": "A Bug's Life", "year": 1998, "run_time": 95, "record_group": "1995–2020"}, {"film": "Toy Story 2", "year": 1999, "run_time": 92, "record_group": "1995–2020"}, {"film": "Monsters, Inc.", "year": 2001, "run_time": 92, "record_group": "1995–2020"}, {"film": "Finding Nemo", "year": 2003, "run_time": 100, "record_group": "1995–2020"}, {"film": "The Incredibles", "year": 2004, "run_time": 115, "record_group": "1995–2020"}, {"film": "Cars", "year": 2006, "run_time": 117, "record_group": "1995–2020"}, {"film": "Ratatouille", "year": 2007, "run_time": 111, "record_group": "1995–2020"}, {"film": "WALL-E", "year": 2008, "run_time": 98, "record_group": "1995–2020"}, {"film": "Up", "year": 2009, "run_time": 96, "record_group": "1995–2020"}, {"film": "Toy Story 3", "year": 2010, "run_time": 103, "record_group": "1995–2020"}, {"film": "Cars 2", "year": 2011, "run_time": 106, "record_group": "1995–2020"}, {"film": "Brave", "year": 2012, "run_time": 93, "record_group": "1995–2020"}, {"film": "Monsters University", "year": 2013, "run_time": 104, "record_group": "1995–2020"}, {"film": "Inside Out", "year": 2015, "run_time": 95, "record_group": "1995–2020"}, {"film": "The Good Dinosaur", "year": 2015, "run_time": 93, "record_group": "1995–2020"}, {"film": "Finding Dory", "year": 2016, "run_time": 97, "record_group": "1995–2020"}, {"film": "Cars 3", "year": 2017, "run_time": 102, "record_group": "1995–2020"}, {"film": "Coco", "year": 2017, "run_time": 105, "record_group": "1995–2020"}, {"film": "Incredibles 2", "year": 2018, "run_time": 118, "record_group": "1995–2020"}, {"film": "Toy Story 4", "year": 2019, "run_time": 100, "record_group": "1995–2020"}, {"film": "Onward", "year": 2020, "run_time": 102, "record_group": "1995–2020"}, {"film": "Soul", "year": 2020, "run_time": 100, "record_group": "1995–2020"}, {"film": "Luca", "year": 2021, "run_time": 151, "record_group": "2021–23: incomplete records"}, {"film": "Unnamed film (2023)", "year": 2023, "run_time": 155, "record_group": "2021–23: incomplete records"}]}, "semantic_types": {"film": "Name", "year": "Year", "run_time": {"semanticType": "Duration", "unit": "min"}, "record_group": "Category"}, "chart_spec": {"chartType": "Scatter Plot", "title": "Pixar's runtimes rose early, then largely levelled off", "subtitle": "Runtime in minutes by release year • 25 recorded runtimes; 2 missing", "source": {"text": "TidyTuesday 2025-03-11", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-03-11"}, "encodings": {"x": {"field": "year"}, "y": {"field": "run_time"}, "color": {"field": "record_group"}, "detail": {"field": "film"}}, "baseSize": {"width": 720, "height": 420}}, "field_display_names": {"year": "Release year", "run_time": "Runtime", "record_group": "Records"}, "interaction_spec": {"interactions": [{"type": "click-highlight", "options": {"targets": ["mark"]}}, {"type": "brush-x"}]}}, "updates": [{"id": "data-caveat", "ops": [{"op": "annotate-enclosure", "name": "late-records", "value": {"targets": [{"select": {"where": {"year": {"range": [2021, 2023]}}}}], "text": "Late records need verification"}}]}]}, {"key": "gpt-6-luna__qatar-cars-5__r2", "question": "Among cars under QAR 200,000, point out the one that gives the most horsepower for the money.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"origin": "Germany", "make": "BMW", "model": "3 Series Sedan", "length": 4.713, "width": 1.827, "height": 1.44, "seating": 5, "trunk": 59, "economy": 7.6, "horsepower": 386, "price": 164257, "mass": 1653, "performance": 4.3, "type": "Sedan", "enginetype": "Petrol", "car": "BMW 3 Series Sedan", "hp_per_1000_qar": 2.3499759523186228}, {"origin": "Germany", "make": "Audi", "model": "A3", "length": 4.456, "width": 1.96, "height": 1.416, "seating": 5, "trunk": 425, "economy": 6.5, "horsepower": 180, "price": 165000, "mass": 1325, "performance": 6.7, "type": "Sedan", "enginetype": "Petrol", "car": "Audi A3", "hp_per_1000_qar": 1.090909090909091}, {"origin": "Germany", "make": "Mercedes", "model": "GLB 200", "length": 4.633, "width": 4.633, "height": 1.659, "seating": 5, "trunk": 565, "economy": 7.5, "horsepower": 221, "price": 168997, "mass": 1656, "performance": 9, "type": "SUV", "enginetype": "Hybrid", "car": "Mercedes GLB 200", "hp_per_1000_qar": 1.3077155215773062}, {"origin": "Germany", "make": "Porsche", "model": "Macan Standard", "length": 4.681, "width": 1.92, "height": 1.62, "seating": 5, "trunk": 488, "economy": 19, "horsepower": 252, "price": 137000, "mass": 2580, "performance": 4.5, "type": "SUV", "enginetype": "Petrol", "car": "Porsche Macan Standard", "hp_per_1000_qar": 1.8394160583941606}, {"origin": "Germany", "make": "Volkswagen", "model": "Touareg", "length": 4.8, "width": 1.9, "height": 1.7, "seating": 5, "trunk": 300, "economy": 9.5, "horsepower": 250, "price": 199000, "mass": 2164, "performance": 8, "type": "SUV", "enginetype": "Petrol", "car": "Volkswagen Touareg", "hp_per_1000_qar": 1.256281407035176}, {"origin": "Germany", "make": "Volkswagen", "model": "Golf", "length": 4.287, "width": 1.789, "height": 1.478, "seating": 5, "trunk": 245, "economy": 6.5, "horsepower": 245, "price": 139000, "mass": 1446, "performance": 4.8, "type": "Hatchback", "enginetype": "Petrol", "car": "Volkswagen Golf", "hp_per_1000_qar": 1.7625899280575539}, {"origin": "Germany", "make": "Volkswagen", "model": "Tiguan", "length": 4.486, "width": 1.839, "height": 1.632, "seating": 5, "trunk": 810, "economy": 6.7, "horsepower": 150, "price": 99900, "mass": 1703, "performance": 7.5, "type": "SUV", "enginetype": "Petrol", "car": "Volkswagen Tiguan", "hp_per_1000_qar": 1.5015015015015014}, {"origin": "Germany", "make": "Volkswagen", "model": "T-Roc", "length": 4.24, "width": 1.819, "height": 1.573, "seating": 5, "trunk": 445, "economy": 7.3, "horsepower": 150, "price": 88900, "mass": 1516, "performance": 8, "type": "SUV", "enginetype": "Petrol", "car": "Volkswagen T-Roc", "hp_per_1000_qar": 1.687289088863892}, {"origin": "Japan", "make": "Toyota", "model": "Yaris", "length": 4.425, "width": 1.74, "height": 1.48, "seating": 5, "trunk": 286, "economy": 5.1, "horsepower": 97, "price": 57300, "mass": 1135, "performance": 11, "type": "Sedan", "enginetype": "Petrol", "car": "Toyota Yaris", "hp_per_1000_qar": 1.692844677137871}, {"origin": "Japan", "make": "Toyota", "model": "Raize", "length": 4.03, "width": 1.71, "height": 1.635, "seating": 5, "trunk": 369, "economy": 5, "horsepower": 87, "price": 57700, "mass": 1680, "performance": 12, "type": "SUV", "enginetype": "Petrol", "car": "Toyota Raize", "hp_per_1000_qar": 1.5077989601386481}, {"origin": "Japan", "make": "Toyota", "model": "RAV4 Adventure", "length": 4.61, "width": 1.865, "height": 1.69, "seating": 5, "trunk": 1085, "economy": 7.3, "horsepower": 203, "price": 130900, "mass": 1583, "performance": 8.2, "type": "SUV", "enginetype": "Petrol", "car": "Toyota RAV4 Adventure", "hp_per_1000_qar": 1.5508021390374334}, {"origin": "Japan", "make": "Toyota", "model": "Rav4 Hybrid", "length": 4.6, "width": 1.855, "height": 1.685, "seating": 5, "trunk": 1085, "economy": 4.1, "horsepower": 219, "price": 117700, "mass": 1674, "performance": 7.5, "type": "SUV", "enginetype": "Hybrid", "car": "Toyota Rav4 Hybrid", "hp_per_1000_qar": 1.860662701784197}, {"origin": "Japan", "make": "Toyota", "model": "Fortuner", "length": 4.795, "width": 1.855, "height": 1.835, "seating": 7, "trunk": 348, "economy": 12.4, "horsepower": 164, "price": 124000, "mass": 2620, "performance": 12, "type": "SUV", "enginetype": "Petrol", "car": "Toyota Fortuner", "hp_per_1000_qar": 1.3225806451612903}, {"origin": "Japan", "make": "Honda", "model": "Civic Type R", "length": 4.594, "width": 1.89, "height": 1.407, "seating": 5, "trunk": 609, "economy": 9.8, "horsepower": 315, "price": 189999, "mass": 1446, "performance": 5.4, "type": "Hatchback", "enginetype": "Petrol", "car": "Honda Civic Type R", "hp_per_1000_qar": 1.6579034626498035}, {"origin": "Japan", "make": "Honda", "model": "CR-V", "length": 4.586, "width": 1.855, "height": 1.678, "seating": 5, "trunk": 587, "economy": 6.4, "horsepower": 184, "price": 119999, "mass": 1575, "performance": 7.5, "type": "SUV", "enginetype": "Petrol", "car": "Honda CR-V", "hp_per_1000_qar": 1.5333461112175935}, {"origin": "Japan", "make": "Honda", "model": "City", "length": 4.553, "width": 1.748, "height": 1.467, "seating": 5, "trunk": 506, "economy": 7.5, "horsepower": 118, "price": 61999, "mass": 1178, "performance": 10.9, "type": "Sedan", "enginetype": "Petrol", "car": "Honda City", "hp_per_1000_qar": 1.9032565041371636}, {"origin": "Japan", "make": "Lexus", "model": "UX 200", "length": 4.495, "width": 1.84, "height": 1.52, "seating": 7, "trunk": 371, "economy": 5.8, "horsepower": 169, "price": 137000, "mass": 1622, "performance": 4.4, "type": "SUV", "enginetype": "Petrol", "car": "Lexus UX 200", "hp_per_1000_qar": 1.2335766423357666}, {"origin": "Japan", "make": "Mazda", "model": "MX-5", "length": 3.914, "width": 1.735, "height": 1.235, "seating": 2, "trunk": 127, "economy": 8.1, "horsepower": 181, "price": 140000, "mass": 1099, "performance": 6.5, "type": "Sedan", "enginetype": "Petrol", "car": "Mazda MX-5", "hp_per_1000_qar": 1.292857142857143}, {"origin": "Japan", "make": "Mazda", "model": "CX-5", "length": 4.55, "width": 1.84, "height": 1.675, "seating": 5, "trunk": 824, "economy": 6.8, "horsepower": 152, "price": 105000, "mass": 1492, "performance": 9.4, "type": "SUV", "enginetype": "Petrol", "car": "Mazda CX-5", "hp_per_1000_qar": 1.4476190476190476}, {"origin": "Japan", "make": "Mazda", "model": 3, "length": 4.66, "width": 1.795, "height": 1.44, "seating": 5, "trunk": 450, "economy": 5.5, "horsepower": 153, "price": 81500, "mass": 1427, "performance": 8.5, "type": "Sedan", "enginetype": "Petrol", "car": "Mazda 3", "hp_per_1000_qar": 1.8773006134969323}, {"origin": "Japan", "make": "Mazda", "model": "CX-3", "length": 4.275, "width": 1.765, "height": 1.535, "seating": 5, "trunk": 264, "economy": 6.3, "horsepower": 148, "price": 72500, "mass": 1294, "performance": 9, "type": "SUV", "enginetype": "Petrol", "car": "Mazda CX-3", "hp_per_1000_qar": 2.0413793103448272}, {"origin": "Japan", "make": "Mitsubishi", "model": "Montero", "length": 4.785, "width": 1.815, "height": 1.8, "seating": 7, "trunk": 131, "economy": 7.7, "horsepower": 181, "price": 117000, "mass": 2045, "performance": 9.7, "type": "SUV", "enginetype": "Petrol", "car": "Mitsubishi Montero", "hp_per_1000_qar": 1.547008547008547}, {"origin": "Japan", "make": "Mitsubishi", "model": "Xpander", "length": 4.475, "width": 1.75, "height": 1.695, "seating": 7, "trunk": 781, "economy": 6.7, "horsepower": 105, "price": 65000, "mass": 1255, "performance": 12.5, "type": "SUV", "enginetype": "Petrol", "car": "Mitsubishi Xpander", "hp_per_1000_qar": 1.6153846153846154}, {"origin": "Japan", "make": "Mitsubishi", "model": "Attrage", "length": 4.245, "width": 1.67, "height": 1.515, "seating": 5, "trunk": 450, "economy": 4.8, "horsepower": 76, "price": 45000, "mass": 945, "performance": 14, "type": "Sedan", "enginetype": "Petrol", "car": "Mitsubishi Attrage", "hp_per_1000_qar": 1.6888888888888889}, {"origin": "Japan", "make": "Nissan", "model": "Nissan Patrol Safari", "length": 5.08, "width": 1.94, "height": 1.855, "seating": 7, "trunk": 135, "economy": 16.7, "horsepower": 280, "price": 164500, "mass": 2610, "performance": 9.9, "type": "SUV", "enginetype": "Petrol", "car": "Nissan Nissan Patrol Safari", "hp_per_1000_qar": 1.702127659574468}, {"origin": "Japan", "make": "Nissan", "model": "Sunny", "length": 4.496, "width": 1.74, "height": 1.455, "seating": 5, "trunk": 482, "economy": 5.1, "horsepower": 118, "price": 58500, "mass": 1029, "performance": 10.5, "type": "Sedan", "enginetype": "Petrol", "car": "Nissan Sunny", "hp_per_1000_qar": 2.0170940170940175}, {"origin": "Japan", "make": "Toyota", "model": "Camry", "length": 4.91, "width": 1.84, "height": 1.45, "seating": 5, "trunk": 428, "economy": 5, "horsepower": 181, "price": 103300, "mass": 1565, "performance": 7.2, "type": "Sedan", "enginetype": "Hybrid", "car": "Toyota Camry", "hp_per_1000_qar": 1.7521781219748307}, {"origin": "Japan", "make": "Toyota", "model": "Corolla", "length": 4.63, "width": 1.78, "height": 1.435, "seating": 5, "trunk": 368, "economy": 6.9, "horsepower": 121, "price": 73700, "mass": 1388, "performance": 8.2, "type": "Sedan", "enginetype": "Hybrid", "car": "Toyota Corolla", "hp_per_1000_qar": 1.6417910447761193}, {"origin": "PR China", "make": "Chery", "model": "Tiggo 8 Pro Max", "length": 4.722, "width": 1.86, "height": 1.705, "seating": 7, "trunk": 117, "economy": 6.7, "horsepower": 254, "price": 112200, "mass": 1541, "performance": 7.3, "type": "SUV", "enginetype": "Petrol", "car": "Chery Tiggo 8 Pro Max", "hp_per_1000_qar": 2.2638146167557935}, {"origin": "PR China", "make": "Chery", "model": "Arrizo 8", "length": 4.78, "width": 1.843, "height": 1.469, "seating": 5, "trunk": 455, "economy": 6.5, "horsepower": 250, "price": 91000, "mass": 1428, "performance": 8.9, "type": "Sedan", "enginetype": "Petrol", "car": "Chery Arrizo 8", "hp_per_1000_qar": 2.7472527472527473}, {"origin": "PR China", "make": "Geely", "model": "Lynk & Co 08 EM-P", "length": 4.82, "width": 1.915, "height": 1.685, "seating": 5, "trunk": 1200, "economy": 1.2, "horsepower": 380, "price": 165000, "mass": 2038, "performance": 4, "type": "SUV", "enginetype": "Petrol", "car": "Geely Lynk & Co 08 EM-P", "hp_per_1000_qar": 2.3030303030303028}, {"origin": "PR China", "make": "Geely", "model": "Monjaro", "length": 4.77, "width": 1.895, "height": 1.689, "seating": 5, "trunk": 355, "economy": 8.4, "horsepower": 235, "price": 118000, "mass": 1760, "performance": 8, "type": "SUV", "enginetype": "Petrol", "car": "Geely Monjaro", "hp_per_1000_qar": 1.9915254237288134}, {"origin": "PR China", "make": "Geely", "model": "Emgrand", "length": 4.635, "width": 1.785, "height": 1.46, "seating": 5, "trunk": 500, "economy": 6.5, "horsepower": 102, "price": 49400, "mass": 1195, "performance": 6.9, "type": "Sedan", "enginetype": "Petrol", "car": "Geely Emgrand", "hp_per_1000_qar": 2.064777327935223}, {"origin": "PR China", "make": "Jetour", "model": "X90 Plus", "length": 4.858, "width": 1.925, "height": 1.78, "seating": 7, "trunk": 510, "economy": 8.3, "horsepower": 197, "price": 99000, "mass": 1653, "performance": 8.5, "type": "SUV", "enginetype": "Petrol", "car": "Jetour X90 Plus", "hp_per_1000_qar": 1.98989898989899}, {"origin": "PR China", "make": "Jetour", "model": "X70 Plus", "length": 4.749, "width": 1.9, "height": 1.72, "seating": 5, "trunk": 57, "economy": 7.6, "horsepower": 154, "price": 76000, "mass": 1582, "performance": 8, "type": "SUV", "enginetype": "Petrol", "car": "Jetour X70 Plus", "hp_per_1000_qar": 2.026315789473684}, {"origin": "PR China", "make": "MG", "model": "RX8", "length": 4.923, "width": 1.81, "height": 1.93, "seating": 7, "trunk": 343, "economy": 9.2, "horsepower": 220, "price": 103000, "mass": 1980, "performance": 9, "type": "SUV", "enginetype": "Petrol", "car": "MG RX8", "hp_per_1000_qar": 2.1359223300970873}, {"origin": "PR China", "make": "MG", "model": "MG One", "length": 4.679, "width": 1.866, "height": 1.617, "seating": 5, "trunk": 336, "economy": 10.2, "horsepower": 181, "price": 73000, "mass": 1515, "performance": 8.8, "type": "SUV", "enginetype": "Petrol", "car": "MG MG One", "hp_per_1000_qar": 2.4794520547945207}, {"origin": "PR China", "make": "MG", "model": "MG 5", "length": 4.601, "width": 1.818, "height": 1.489, "seating": 5, "trunk": 512, "economy": 8.1, "horsepower": 112, "price": 46000, "mass": 1318, "performance": 7.7, "type": "Sedan", "enginetype": "Petrol", "car": "MG MG 5", "hp_per_1000_qar": 2.434782608695652}, {"origin": "South Korea", "make": "Hyundai", "model": "Ioniq 5", "length": 4.635, "width": 1.89, "height": 1.605, "seating": 5, "trunk": 527, "economy": null, "horsepower": 302, "price": 190900, "mass": 2205, "performance": 4.5, "type": "SUV", "enginetype": "Electric", "car": "Hyundai Ioniq 5", "hp_per_1000_qar": 1.5819800942902043}, {"origin": "South Korea", "make": "Hyundai", "model": "Tuscon", "length": 4.63, "width": 1.865, "height": 1.665, "seating": 5, "trunk": 539, "economy": 8.7, "horsepower": 156, "price": 90900, "mass": 1555, "performance": 9.5, "type": "SUV", "enginetype": "Petrol", "car": "Hyundai Tuscon", "hp_per_1000_qar": 1.716171617161716}, {"origin": "South Korea", "make": "Hyundai", "model": "Accent", "length": 4.44, "width": 1.729, "height": 1.475, "seating": 5, "trunk": 387, "economy": 6.5, "horsepower": 130, "price": 58900, "mass": 1215, "performance": 11.1, "type": "Sedan", "enginetype": "Petrol", "car": "Hyundai Accent", "hp_per_1000_qar": 2.2071307300509337}, {"origin": "South Korea", "make": "Kia", "model": "K8", "length": 5.015, "width": 1.875, "height": 1.455, "seating": 5, "trunk": 510, "economy": 9.4, "horsepower": 300, "price": 123000, "mass": 1640, "performance": 7, "type": "Sedan", "enginetype": "Hybrid", "car": "Kia K8", "hp_per_1000_qar": 2.4390243902439024}, {"origin": "South Korea", "make": "Kia", "model": "K5", "length": 4.905, "width": 1.86, "height": 1.445, "seating": 5, "trunk": 510, "economy": 6.2, "horsepower": 150, "price": 96000, "mass": 1465, "performance": 7.4, "type": "Sedan", "enginetype": "Petrol", "car": "Kia K5", "hp_per_1000_qar": 1.5625}, {"origin": "South Korea", "make": "Kia", "model": "Pegas", "length": 4.3, "width": 1.7, "height": 1.46, "seating": 5, "trunk": 475, "economy": 6.1, "horsepower": 95, "price": 47000, "mass": 1060, "performance": 12, "type": "Sedan", "enginetype": "Petrol", "car": "Kia Pegas", "hp_per_1000_qar": 2.021276595744681}, {"origin": "Sweden", "make": "Volvo", "model": "Volvo XC60", "length": 4.688, "width": 1.902, "height": 1.658, "seating": 5, "trunk": 71, "economy": 7.1, "horsepower": 250, "price": 190000, "mass": 2121, "performance": 4.8, "type": "SUV", "enginetype": "Hybrid", "car": "Volvo Volvo XC60", "hp_per_1000_qar": 1.3157894736842104}, {"origin": "Sweden", "make": "Volvo", "model": "XC40", "length": 4.425, "width": 1.91, "height": 1.652, "seating": 5, "trunk": 54, "economy": 7.7, "horsepower": 197, "price": 160000, "mass": 1751, "performance": 6.4, "type": "SUV", "enginetype": "Hybrid", "car": "Volvo XC40", "hp_per_1000_qar": 1.23125}, {"origin": "USA", "make": "Cadillac", "model": "XT5", "length": 4.813, "width": 1.905, "height": 1.676, "seating": 5, "trunk": 849, "economy": 10, "horsepower": 237, "price": 174400, "mass": 1872, "performance": 8.3, "type": "SUV", "enginetype": "Petrol", "car": "Cadillac XT5", "hp_per_1000_qar": 1.3589449541284402}, {"origin": "USA", "make": "Cadillac", "model": "CT4", "length": 4.75, "width": 1.814, "height": 1.422, "seating": 5, "trunk": 303, "economy": 10.6, "horsepower": 240, "price": 141300, "mass": 1552, "performance": 6.4, "type": "Sedan", "enginetype": "Petrol", "car": "Cadillac CT4", "hp_per_1000_qar": 1.6985138004246285}, {"origin": "USA", "make": "Ford", "model": "Explorer", "length": 5.04, "width": 2.1, "height": 1.78, "seating": 7, "trunk": 595, "economy": 10, "horsepower": 290, "price": 159000, "mass": 1952, "performance": 5.9, "type": "SUV", "enginetype": "Petrol", "car": "Ford Explorer", "hp_per_1000_qar": 1.8238993710691824}, {"origin": "USA", "make": "Ford", "model": "Figo", "length": 3.8, "width": 1.68, "height": 1.43, "seating": 5, "trunk": 284, "economy": 5.5, "horsepower": 84, "price": 37400, "mass": 1056, "performance": 9.5, "type": "Hatchback", "enginetype": "Petrol", "car": "Ford Figo", "hp_per_1000_qar": 2.2459893048128343}, {"origin": "USA", "make": "Tesla", "model": "Model Y", "length": 4.751, "width": 1.921, "height": 1.624, "seating": 5, "trunk": 480, "economy": null, "horsepower": 342, "price": 188490, "mass": 1909, "performance": 6.9, "type": "SUV", "enginetype": "Electric", "car": "Tesla Model Y", "hp_per_1000_qar": 1.814419863122712}, {"origin": "USA", "make": "Tesla", "model": "Model 3", "length": 4.72, "width": 1.85, "height": 1.443, "seating": 5, "trunk": 542, "economy": null, "horsepower": 460, "price": 158490, "mass": 1765, "performance": 3.1, "type": "Sedan", "enginetype": "Electric", "car": "Tesla Model 3", "hp_per_1000_qar": 2.902391318064231}, {"origin": "PR China", "make": "BYD", "model": "Seal", "length": 4.8, "width": 1.875, "height": 1.46, "seating": 5, "trunk": 400, "economy": null, "horsepower": 204, "price": 164000, "mass": 2185, "performance": 3.8, "type": "Sedan", "enginetype": "Electric", "car": "BYD Seal", "hp_per_1000_qar": 1.2439024390243902}, {"origin": "PR China", "make": "BYD", "model": "Atto 3", "length": 4.455, "width": 1.875, "height": 1.615, "seating": 5, "trunk": 440, "economy": null, "horsepower": 201, "price": 148500, "mass": 1680, "performance": 7.3, "type": "SUV", "enginetype": "Electric", "car": "BYD Atto 3", "hp_per_1000_qar": 1.3535353535353534}, {"origin": "PR China", "make": "Jetour", "model": "T2", "length": 4.785, "width": 2.006, "height": 1.88, "seating": 5, "trunk": 580, "economy": 11, "horsepower": 254, "price": 129000, "mass": 1880, "performance": 6, "type": "SUV", "enginetype": "Petrol", "car": "Jetour T2", "hp_per_1000_qar": 1.9689922480620154}, {"origin": "PR China", "make": "Chery", "model": "Arrizo 5", "length": 4.572, "width": 1.825, "height": 1.482, "seating": 5, "trunk": 430, "economy": 7, "horsepower": 114, "price": 53000, "mass": 1265, "performance": 11.5, "type": "Sedan", "enginetype": "Petrol", "car": "Chery Arrizo 5", "hp_per_1000_qar": 2.150943396226415}, {"origin": "PR China", "make": "Bestune", "model": "B70", "length": 4.8, "width": 1.82, "height": 1.472, "seating": 5, "trunk": 522, "economy": 7.6, "horsepower": 145, "price": 59000, "mass": 1440, "performance": 9, "type": "Sedan", "enginetype": "Petrol", "car": "Bestune B70", "hp_per_1000_qar": 2.4576271186440675}, {"origin": "PR China", "make": "MG", "model": "ZS", "length": 4.314, "width": 1.809, "height": 1.624, "seating": 5, "trunk": 448, "economy": 5.8, "horsepower": 112, "price": 59000, "mass": 1258, "performance": 10.9, "type": "SUV", "enginetype": "Petrol", "car": "MG ZS", "hp_per_1000_qar": 1.8983050847457628}, {"origin": "Japan", "make": "Toyota", "model": "Crown", "length": 4.98, "width": 1.84, "height": 1.54, "seating": 5, "trunk": 450, "economy": 5.5, "horsepower": 345, "price": 173000, "mass": 1965, "performance": 5.9, "type": "Sedan", "enginetype": "Hybrid", "car": "Toyota Crown", "hp_per_1000_qar": 1.9942196531791907}, {"origin": "Japan", "make": "Subaru", "model": "BRZ 2025", "length": 4.265, "width": 1.775, "height": 1.31, "seating": 4, "trunk": 178, "economy": 9.5, "horsepower": 237, "price": 125000, "mass": 1285, "performance": 6.3, "type": "Coupe", "enginetype": "Petrol", "car": "Subaru BRZ 2025", "hp_per_1000_qar": 1.896}, {"origin": "South Korea", "make": "Kia", "model": "Picanto", "length": 3.595, "width": 1.595, "height": 1.495, "seating": 5, "trunk": 255, "economy": 6, "horsepower": 84, "price": 58000, "mass": 976, "performance": 13.7, "type": "Hatchback", "enginetype": "Petrol", "car": "Kia Picanto", "hp_per_1000_qar": 1.4482758620689655}, {"origin": "PR China", "make": "Bestune", "model": "Oley", "length": 4.555, "width": 1.66, "height": 1.465, "seating": 4, "trunk": 300, "economy": 6.7, "horsepower": 101, "price": 35000, "mass": 1150, "performance": 12.1, "type": "Hatchback", "enginetype": "Petrol", "car": "Bestune Oley", "hp_per_1000_qar": 2.8857142857142857}, {"origin": "Japan", "make": "Mitsubishi", "model": "Mirage", "length": 3.78, "width": 1.665, "height": 1.5, "seating": 5, "trunk": 235, "economy": 4.8, "horsepower": 77, "price": 44000, "mass": 1050, "performance": 13.9, "type": "Hatchback", "enginetype": "Petrol", "car": "Mitsubishi Mirage", "hp_per_1000_qar": 1.75}, {"origin": "South Korea", "make": "Hyundai", "model": "Grand i10", "length": 3.665, "width": 1.66, "height": 1.5, "seating": 5, "trunk": 252, "economy": 5.3, "horsepower": 86, "price": 46900, "mass": 1840, "performance": 14.5, "type": "Hatchback", "enginetype": "Petrol", "car": "Hyundai Grand i10", "hp_per_1000_qar": 1.8336886993603412}, {"origin": "PR China", "make": "MG", "model": "MG3 Luxury", "length": 4.055, "width": 1.729, "height": 1.504, "seating": 5, "trunk": 293, "economy": 6.7, "horsepower": 109, "price": 57000, "mass": 1308, "performance": 10.8, "type": "Hatchback", "enginetype": "Petrol", "car": "MG MG3 Luxury", "hp_per_1000_qar": 1.912280701754386}]}, "semantic_types": {"price": {"semanticType": "Price", "unit": "QAR"}, "horsepower": {"semanticType": "Quantity", "unit": "hp"}, "car": "Name", "enginetype": "Category"}, "chart_spec": {"chartType": "Scatter Plot", "title": "Tesla Model 3 leads horsepower per QAR under QAR 200,000", "subtitle": "Horsepower versus listed price for qualifying cars; best is 2.90 hp per QAR 1,000", "source": {"text": "TidyTuesday 2025-12-09", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"}, "encodings": {"x": {"field": "price"}, "y": {"field": "horsepower"}, "color": {"field": "enginetype"}, "detail": {"field": "car"}}}}, "updates": [{"id": "answer", "ops": [{"op": "set-style", "targets": [{"select": {"key": {"car": "Tesla Model 3"}}}], "value": {"state": "emphasized"}}, {"op": "annotate-text", "target": {"select": {"key": {"car": "Tesla Model 3"}}}, "value": {"text": "Best value: 460 hp for QAR 158,490 (2.90 hp per QAR 1,000)", "anchor": "point", "highlight": "strong"}}]}]}, {"key": "gpt-6-luna__sechselaeuten-4__r2", "question": "Are any years missing a burn time?", "model": "gpt-6-luna", "spec": {"data": {"values": [{"year": 1923, "duration": 60, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1952, "duration": 6, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1953, "duration": 8, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1956, "duration": 4, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1958, "duration": 8, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1959, "duration": 8, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1961, "duration": 7, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1965, "duration": 20, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1966, "duration": 16, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1967, "duration": 6, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1968, "duration": 5, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1969, "duration": 10, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1970, "duration": 40, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1971, "duration": 5, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1972, "duration": 8, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1973, "duration": 26, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1974, "duration": 5.12, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1975, "duration": 22, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1976, "duration": 11, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1977, "duration": 27, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1978, "duration": 12, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1979, "duration": 19, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1980, "duration": 17, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1981, "duration": 14.17, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1982, "duration": 13, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1983, "duration": 24.33, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1984, "duration": 22, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1985, "duration": 24, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1986, "duration": 14, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1987, "duration": 17, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1988, "duration": 40, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1989, "duration": 24, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1990, "duration": 10.5, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1991, "duration": 12, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1992, "duration": 10.22, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1993, "duration": 23.5, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1994, "duration": 21.92, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1995, "duration": 5.85, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1996, "duration": 8, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1997, "duration": 7.5, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1998, "duration": 10.22, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 1999, "duration": 23.87, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2000, "duration": 16.75, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2001, "duration": 26.38, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2002, "duration": 12.4, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2003, "duration": 5.7, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2004, "duration": 11.7, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2005, "duration": 17.87, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2006, "duration": 10.47, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2007, "duration": 12.15, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2008, "duration": 26.02, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2009, "duration": 12.92, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2010, "duration": 12.9, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2011, "duration": 10.93, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2012, "duration": 12.12, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2013, "duration": 35.18, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2015, "duration": 20.65, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2016, "duration": 43.57, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2017, "duration": 9.93, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2018, "duration": 20.52, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2019, "duration": 17.73, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2020, "duration": null, "duration_status": "Missing", "measure": "Burn time"}, {"year": 2021, "duration": 12.95, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2022, "duration": 37.98, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2023, "duration": 57, "duration_status": "Recorded", "measure": "Burn time"}, {"year": 2024, "duration": null, "duration_status": "Missing", "measure": "Burn time"}, {"year": 2025, "duration": 26.5, "duration_status": "Recorded", "measure": "Burn time"}]}, "semantic_types": {"year": "Year", "duration_status": "Category", "measure": "Category", "duration": "Duration"}, "chart_spec": {"chartType": "Heatmap", "title": "Burn times are missing for 2020 and 2024", "subtitle": "Festival-year rows in the dataset; tile color indicates whether a burn time is recorded", "encodings": {"x": {"field": "year"}, "y": {"field": "measure"}, "color": {"field": "duration_status"}}, "baseSize": {"width": 900, "height": 280}}}, "updates": [{"id": "missing-years", "ops": [{"op": "set-style", "targets": [{"select": {"where": {"year": {"in": [2020, 2024]}}}}], "value": {"state": "emphasized"}}]}]}, {"key": "gpt-6-luna__space-objects-4__r2", "question": "Show the range that yearly launches stayed within for decades before the boom.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"Year": 1957, "num_objects": 2}, {"Year": 1958, "num_objects": 8}, {"Year": 1959, "num_objects": 14}, {"Year": 1960, "num_objects": 20}, {"Year": 1961, "num_objects": 38}, {"Year": 1962, "num_objects": 77}, {"Year": 1963, "num_objects": 71}, {"Year": 1964, "num_objects": 107}, {"Year": 1965, "num_objects": 163}, {"Year": 1966, "num_objects": 145}, {"Year": 1967, "num_objects": 159}, {"Year": 1968, "num_objects": 140}, {"Year": 1969, "num_objects": 138}, {"Year": 1970, "num_objects": 130}, {"Year": 1971, "num_objects": 156}, {"Year": 1972, "num_objects": 133}, {"Year": 1973, "num_objects": 138}, {"Year": 1974, "num_objects": 128}, {"Year": 1975, "num_objects": 158}, {"Year": 1976, "num_objects": 158}, {"Year": 1977, "num_objects": 137}, {"Year": 1978, "num_objects": 165}, {"Year": 1979, "num_objects": 124}, {"Year": 1980, "num_objects": 130}, {"Year": 1981, "num_objects": 158}, {"Year": 1982, "num_objects": 145}, {"Year": 1983, "num_objects": 154}, {"Year": 1984, "num_objects": 163}, {"Year": 1985, "num_objects": 165}, {"Year": 1986, "num_objects": 134}, {"Year": 1987, "num_objects": 135}, {"Year": 1988, "num_objects": 145}, {"Year": 1989, "num_objects": 139}, {"Year": 1990, "num_objects": 168}, {"Year": 1991, "num_objects": 135}, {"Year": 1992, "num_objects": 130}, {"Year": 1993, "num_objects": 108}, {"Year": 1994, "num_objects": 123}, {"Year": 1995, "num_objects": 105}, {"Year": 1996, "num_objects": 100}, {"Year": 1997, "num_objects": 152}, {"Year": 1998, "num_objects": 157}, {"Year": 1999, "num_objects": 129}, {"Year": 2000, "num_objects": 121}, {"Year": 2001, "num_objects": 86}, {"Year": 2002, "num_objects": 96}, {"Year": 2003, "num_objects": 88}, {"Year": 2004, "num_objects": 74}, {"Year": 2005, "num_objects": 72}, {"Year": 2006, "num_objects": 95}, {"Year": 2007, "num_objects": 111}, {"Year": 2008, "num_objects": 109}, {"Year": 2009, "num_objects": 125}, {"Year": 2010, "num_objects": 120}, {"Year": 2011, "num_objects": 129}, {"Year": 2012, "num_objects": 134}, {"Year": 2013, "num_objects": 210}, {"Year": 2014, "num_objects": 241}, {"Year": 2015, "num_objects": 222}, {"Year": 2016, "num_objects": 221}, {"Year": 2017, "num_objects": 456}, {"Year": 2018, "num_objects": 454}, {"Year": 2019, "num_objects": 586}, {"Year": 2020, "num_objects": 1274}, {"Year": 2021, "num_objects": 1813}, {"Year": 2022, "num_objects": 2478}, {"Year": 2023, "num_objects": 2664}]}, "semantic_types": {"Year": "Year", "num_objects": "Count"}, "chart_spec": {"chartType": "Line Chart", "title": "For five decades, annual launches stayed within 71–168", "subtitle": "Objects launched worldwide per year; shaded band marks 1962–2012 and its observed range", "encodings": {"x": {"field": "Year"}, "y": {"field": "num_objects"}}, "chartProperties": {"showPoints": false}}}, "updates": [{"id": "pre-boom-range", "ops": [{"op": "annotate-region", "name": "pre-boom-range", "value": {"x": [1962, 2012], "y": [71, 168], "text": "1962–2012 range: 71–168 launches/year", "layer": "under", "opacity": 0.16}}]}]}, {"key": "gpt-6-luna__trash-wheel-2__r2", "question": "Mark when each new wheel started collecting.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"ID": "mister", "Name": "Mister Trash Wheel", "start_date": "2014-05-16", "first_dumpster": 1}, {"ID": "professor", "Name": "Professor Trash Wheel", "start_date": "2017-01-02", "first_dumpster": 1}, {"ID": "captain", "Name": "Captain Trash Wheel", "start_date": "2018-06-30", "first_dumpster": 1}, {"ID": "gwynnda", "Name": "Gwynnda Trash Wheel", "start_date": "2021-07-03", "first_dumpster": 1}]}, "semantic_types": {"ID": "ID", "Name": "Name", "start_date": "Date", "first_dumpster": "Count"}, "chart_spec": {"chartType": "Scatter Plot", "title": "Mister started first; Gwynnda started most recently", "subtitle": "First recorded collection date for each Baltimore trash wheel", "source": {"text": "TidyTuesday 2024-03-05", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2024/2024-03-05"}, "encodings": {"x": {"field": "start_date"}, "y": {"field": "Name"}}, "baseSize": {"width": 640, "height": 360}}, "field_display_names": {"start_date": "Started collecting"}}, "updates": [{"id": "start-dates", "ops": [{"op": "annotate-text", "target": {"select": {"key": {"Name": "Mister Trash Wheel", "start_date": "2014-05-16"}}}, "value": {"text": "May 16, 2014", "anchor": "point"}}, {"op": "annotate-text", "target": {"select": {"key": {"Name": "Professor Trash Wheel", "start_date": "2017-01-02"}}}, "value": {"text": "Jan 2, 2017", "anchor": "point"}}, {"op": "annotate-text", "target": {"select": {"key": {"Name": "Captain Trash Wheel", "start_date": "2018-06-30"}}}, "value": {"text": "Jun 30, 2018", "anchor": "point"}}, {"op": "annotate-text", "target": {"select": {"key": {"Name": "Gwynnda Trash Wheel", "start_date": "2021-07-03"}}}, "value": {"text": "Jul 3, 2021", "anchor": "point"}}]}]}, {"key": "gpt-6-luna__union-membership-3__r2", "question": "Note the gap in the data.", "model": "gpt-6-luna", "spec": {"data": {"values": [{"year": 1973, "series": "Union members", "share": 0.2395225018262863}, {"year": 1973, "series": "Members or covered", "share": null}, {"year": 1974, "series": "Union members", "share": 0.2357485890388488}, {"year": 1974, "series": "Members or covered", "share": null}, {"year": 1975, "series": "Union members", "share": 0.22163026034832}, {"year": 1975, "series": "Members or covered", "share": null}, {"year": 1976, "series": "Union members", "share": 0.2209147065877914}, {"year": 1976, "series": "Members or covered", "share": null}, {"year": 1977, "series": "Union members", "share": 0.2377243340015411}, {"year": 1977, "series": "Members or covered", "share": 0.2647670805454254}, {"year": 1978, "series": "Union members", "share": 0.2300724238157272}, {"year": 1978, "series": "Members or covered", "share": 0.2577209174633026}, {"year": 1979, "series": "Union members", "share": 0.2408972978591919}, {"year": 1979, "series": "Members or covered", "share": 0.2702135443687439}, {"year": 1980, "series": "Union members", "share": 0.2297139465808868}, {"year": 1980, "series": "Members or covered", "share": 0.2571273446083069}, {"year": 1981, "series": "Union members", "share": 0.2137339413166046}, {"year": 1981, "series": "Members or covered", "share": 0.2395974099636078}, {"year": 1982, "series": "Union members", "share": null}, {"year": 1982, "series": "Members or covered", "share": null}, {"year": 1983, "series": "Union members", "share": 0.2006736397743225}, {"year": 1983, "series": "Members or covered", "share": 0.2325547486543655}, {"year": 1984, "series": "Union members", "share": 0.1880787461996078}, {"year": 1984, "series": "Members or covered", "share": 0.216190680861473}, {"year": 1985, "series": "Union members", "share": 0.1798138618469238}, {"year": 1985, "series": "Members or covered", "share": 0.2048033773899078}, {"year": 1986, "series": "Union members", "share": 0.1751778423786163}, {"year": 1986, "series": "Members or covered", "share": 0.1989405751228332}, {"year": 1987, "series": "Union members", "share": 0.1703182011842727}, {"year": 1987, "series": "Members or covered", "share": 0.1918472349643707}, {"year": 1988, "series": "Union members", "share": 0.1676569581031799}, {"year": 1988, "series": "Members or covered", "share": 0.1897426843643188}, {"year": 1989, "series": "Union members", "share": 0.1639013588428497}, {"year": 1989, "series": "Members or covered", "share": 0.185520201921463}, {"year": 1990, "series": "Union members", "share": 0.1599607467651367}, {"year": 1990, "series": "Members or covered", "share": 0.1821693778038025}, {"year": 1991, "series": "Union members", "share": 0.1601562649011612}, {"year": 1991, "series": "Members or covered", "share": 0.1811548918485641}, {"year": 1992, "series": "Union members", "share": 0.1568597108125686}, {"year": 1992, "series": "Members or covered", "share": 0.1774985194206237}, {"year": 1993, "series": "Union members", "share": 0.1567132025957107}, {"year": 1993, "series": "Members or covered", "share": 0.1760812252759933}, {"year": 1994, "series": "Union members", "share": 0.1550208032131195}, {"year": 1994, "series": "Members or covered", "share": 0.1744871735572815}, {"year": 1995, "series": "Union members", "share": 0.1486720144748687}, {"year": 1995, "series": "Members or covered", "share": 0.1667269915342331}, {"year": 1996, "series": "Union members", "share": 0.1453137099742889}, {"year": 1996, "series": "Members or covered", "share": 0.1621835976839065}, {"year": 1997, "series": "Union members", "share": 0.1406574249267578}, {"year": 1997, "series": "Members or covered", "share": 0.1564876288175583}, {"year": 1998, "series": "Union members", "share": 0.1388796716928482}, {"year": 1998, "series": "Members or covered", "share": 0.1535024940967559}, {"year": 1999, "series": "Union members", "share": 0.1385020911693573}, {"year": 1999, "series": "Members or covered", "share": 0.1528391391038894}, {"year": 2000, "series": "Union members", "share": 0.1346035450696945}, {"year": 2000, "series": "Members or covered", "share": 0.1485618501901626}, {"year": 2001, "series": "Union members", "share": 0.1349440217018127}, {"year": 2001, "series": "Members or covered", "share": 0.1481106430292129}, {"year": 2002, "series": "Union members", "share": 0.1331789046525955}, {"year": 2002, "series": "Members or covered", "share": 0.1458721905946731}, {"year": 2003, "series": "Union members", "share": 0.1289330422878265}, {"year": 2003, "series": "Members or covered", "share": 0.1426010578870773}, {"year": 2004, "series": "Union members", "share": 0.1252215206623077}, {"year": 2004, "series": "Members or covered", "share": 0.1382984220981598}, {"year": 2005, "series": "Union members", "share": 0.1245967149734497}, {"year": 2005, "series": "Members or covered", "share": 0.13681361079216}, {"year": 2006, "series": "Union members", "share": 0.1197710558772087}, {"year": 2006, "series": "Members or covered", "share": 0.1314765363931656}, {"year": 2007, "series": "Union members", "share": 0.1207575649023056}, {"year": 2007, "series": "Members or covered", "share": 0.1328792572021484}, {"year": 2008, "series": "Union members", "share": 0.1244232580065727}, {"year": 2008, "series": "Members or covered", "share": 0.1372775733470916}, {"year": 2009, "series": "Union members", "share": 0.1231207400560379}, {"year": 2009, "series": "Members or covered", "share": 0.1357829570770263}, {"year": 2010, "series": "Union members", "share": 0.1185999512672424}, {"year": 2010, "series": "Members or covered", "share": 0.131289854645729}, {"year": 2011, "series": "Union members", "share": 0.1178392767906189}, {"year": 2011, "series": "Members or covered", "share": 0.1300295740365982}, {"year": 2012, "series": "Union members", "share": 0.1124529615044593}, {"year": 2012, "series": "Members or covered", "share": 0.1246513351798057}, {"year": 2013, "series": "Union members", "share": 0.1124061793088913}, {"year": 2013, "series": "Members or covered", "share": 0.1240250095725059}, {"year": 2014, "series": "Union members", "share": 0.1108377948403358}, {"year": 2014, "series": "Members or covered", "share": 0.1228002980351448}, {"year": 2015, "series": "Union members", "share": 0.1105347052216529}, {"year": 2015, "series": "Members or covered", "share": 0.1228433176875114}, {"year": 2016, "series": "Union members", "share": 0.1068789511919021}, {"year": 2016, "series": "Members or covered", "share": 0.1194765865802764}, {"year": 2017, "series": "Union members", "share": 0.1073976680636406}, {"year": 2017, "series": "Members or covered", "share": 0.1191775947809219}, {"year": 2018, "series": "Union members", "share": 0.1051899641752243}, {"year": 2018, "series": "Members or covered", "share": 0.1168520748615264}, {"year": 2019, "series": "Union members", "share": 0.1027510911226272}, {"year": 2019, "series": "Members or covered", "share": 0.1155063137412071}, {"year": 2020, "series": "Union members", "share": 0.1077886894345283}, {"year": 2020, "series": "Members or covered", "share": 0.1205384135246276}, {"year": 2021, "series": "Union members", "share": 0.1026496738195419}, {"year": 2021, "series": "Members or covered", "share": 0.1157846897840499}, {"year": 2022, "series": "Union members", "share": 0.1007778942584991}, {"year": 2022, "series": "Members or covered", "share": 0.11288683116436}]}, "semantic_types": {"year": "Year", "series": "Category", "share": {"semanticType": "Percentage", "percentScale": "fraction"}}, "chart_spec": {"chartType": "Line Chart", "title": "Covered-worker data starts in 1977; 1982 is missing entirely", "subtitle": "Union members and workers covered by a union contract, all US wage and salary workers, 1973–2022 (% of employed workers)", "source": {"text": "TidyTuesday 2023-09-05", "href": "https://github.com/rfordatascience/tidytuesday/tree/main/data/2023/2023-09-05"}, "encodings": {"x": {"field": "year"}, "y": {"field": "share"}, "color": {"field": "series"}}, "chartProperties": {"showPoints": true}, "baseSize": {"width": 760, "height": 420}}, "field_display_names": {"year": "Year", "share": "Share of employed workers", "series": "Measure"}}, "updates": [{"id": "data-gaps", "ops": [{"op": "annotate-region", "name": "coverage-not-reported", "value": {"x": [1973, 1976], "text": "Covered series not reported", "layer": "under", "opacity": 0.18}}, {"op": "annotate-region", "name": "missing-year", "value": {"x": [1981, 1983], "text": "No observations in 1982", "layer": "under", "opacity": 0.18}}]}]}] diff --git a/site/src/playground/annotation-lab.css b/site/src/playground/annotation-lab.css index f9a0444d..8fbaf7a4 100644 --- a/site/src/playground/annotation-lab.css +++ b/site/src/playground/annotation-lab.css @@ -6,36 +6,73 @@ width: min(100%, 1120px); } -.annotation-title-row, -.annotation-toolbar { +.annotation-controls { + /* Below the sticky dev header, as the maps page pins its panel. */ + position: sticky; + top: 60px; + z-index: 5; display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 18px; + flex-wrap: wrap; + align-items: center; + gap: 10px 18px; + width: min(100%, 1440px); + box-sizing: border-box; + padding: 10px 12px; + border: 1px solid rgba(0, 0, 0, 0.12); + border-radius: 8px; + background: rgba(250, 251, 252, 0.96); + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); + font-size: 12px; } -.annotation-toolbar { +.annotation-control { + display: flex; align-items: center; - margin-top: 8px; + gap: 8px; } -.annotation-coverage { - display: flex; +.annotation-control > span { + color: #4b525a; +} + +.annotation-segmented { + display: inline-flex; flex-wrap: wrap; - gap: 5px; + gap: 2px; + padding: 3px; + border-radius: 8px; + background: rgba(0, 0, 0, 0.05); } -.annotation-coverage span { - padding: 3px 7px; - border: 1px solid #d8dde2; - border-radius: 4px; - color: #5f6972; - background: #fff; +.annotation-segmented button { + border: 0; + border-radius: 5px; + padding: 3px 9px; + background: transparent; + color: #4b525a; + font: inherit; + font-size: 12px; + cursor: pointer; +} + +.annotation-segmented button small { + color: #87919a; font-size: 10px; - font-weight: 600; +} + +.annotation-segmented button[aria-checked='true'] { + background: #fff; + color: #1f2328; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); +} + +.annotation-segmented button:disabled { + opacity: 0.4; + cursor: default; } .annotation-reset { + margin-left: auto; display: inline-flex; align-items: center; gap: 6px; @@ -56,9 +93,32 @@ } .annotation-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-items: start; + gap: 16px; width: min(100%, 1440px); - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - gap: 8px; +} + +/* Caption lab: each card is as wide as its 640 × 400 chart and legend, so nothing is clipped. */ +.caption-grid { + width: min(100%, 1400px); + grid-template-columns: repeat(auto-fill, minmax(min(680px, 100%), 1fr)); + gap: 16px; +} + +.caption-card { + grid-template-rows: auto auto; + overflow: auto; +} + +.caption-card .cf-probe-heading { + padding: 12px 16px 0; +} + +.caption-card .cf-mount { + padding: 12px 16px 16px; + min-height: 400px; } .annotation-static-card { @@ -67,17 +127,17 @@ } .annotation-static-card .cf-probe-header { - min-height: 38px; - padding: 7px 9px; + min-height: 42px; + padding: 8px 12px; } .annotation-static-card .cf-probe-header h2 { - font-size: 12px; + font-size: 13px; } .annotation-static-card .cf-probe-header p { margin-top: 1px; - font-size: 9px; + font-size: 11px; } .annotation-static-card .cf-probe-header p span { @@ -90,26 +150,24 @@ } .annotation-static-stage { - padding: 6px; + padding: 12px; pointer-events: none; + /* The chart is compiled to the stage's width; nothing to scroll to. */ + overflow: hidden; } .annotation-static-stage .cf-mount { min-height: 0; } -/* The Vega SVG carries a viewBox, so it scales down like an image. */ -.annotation-static-stage svg.marks { - max-width: 100%; - height: auto; -} -@media (max-width: 640px) { - .annotation-title-row, - .annotation-toolbar { - align-items: stretch; - flex-direction: column; + +@media (max-width: 900px) { + .annotation-grid { + grid-template-columns: minmax(0, 1fr); } +} +@media (max-width: 640px) { .annotation-static-card .cf-probe-header { align-items: flex-start; flex-direction: row; diff --git a/site/src/playground/anomaly-data.ts b/site/src/playground/anomaly-data.ts new file mode 100644 index 00000000..f90d73ba --- /dev/null +++ b/site/src/playground/anomaly-data.ts @@ -0,0 +1,29 @@ +import type { ChartAssemblyInput } from 'flint-chart'; + +export const ANOMALY_MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +/** Monthly anomalies shaped like NASA GISTEMP: numeric years 1880–2023, 2023 through May only. */ +export const anomalyRows = Array.from({ length: 144 }, (_, index) => 1880 + index).flatMap((Year) => + ANOMALY_MONTHS.slice(0, Year === 2023 ? 5 : 12).map((Month, month) => { + const trend = Year < 1910 ? -0.25 : Year < 1975 ? -0.25 + (Year - 1910) * 0.004 : 0.01 + (Year - 1975) * 0.019; + const wobble = 0.12 * Math.sin(Year * 1.7 + month * 0.9) + 0.08 * Math.cos(Year * 0.37 + month * 2.1); + return { Year, Month, Anomaly: Math.round((trend + wobble) * 100) / 100 }; + })); + +/** The eval chart that drew nothing, then labelled one window, then put its rail under the source line. */ +export const anomalyInput = { + data: { values: anomalyRows }, + semantic_types: { + Year: 'Year', Month: 'Month', + Anomaly: { semanticType: 'Temperature', unit: '°C', divergingMidpoint: 0 }, + }, + field_display_names: { Anomaly: 'Temperature anomaly (°C)' }, + chart_spec: { + chartType: 'Heatmap', + title: 'Recent decades are consistently warmer than the 1951–1980 baseline', + subtitle: 'Monthly global surface temperature anomalies, 1880–2023 (°C). 2023 includes January–May only.', + source: { text: 'NASA GISTEMP v4 (shape only; values synthetic)' }, + encodings: { x: { field: 'Year', type: 'ordinal' }, y: { field: 'Month' }, color: { field: 'Anomaly' } }, + baseSize: { width: 1100, height: 400 }, + }, +} as unknown as ChartAssemblyInput; diff --git a/site/src/playground/axis-label-lab.css b/site/src/playground/axis-label-lab.css index ec5b0590..eb095ac6 100644 --- a/site/src/playground/axis-label-lab.css +++ b/site/src/playground/axis-label-lab.css @@ -28,6 +28,7 @@ .accessibility-showcase { margin-bottom: 24px; } .release-demo-heading { margin-bottom: 10px; } .release-demo-heading h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: 0; } +.release-demo-heading h3 { font-size: 15px; margin: 0 0 4px; letter-spacing: 0; } .release-demo-heading p { margin: 0; max-width: 72ch; font-size: 13px; line-height: 1.5; color: #61676d; } .accessibility-actions { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; } .wrapping-tabs { display: flex; flex-wrap: wrap; gap: 4px; } diff --git a/site/src/playground/backend-layout/BackendLayoutLab.tsx b/site/src/playground/backend-layout/BackendLayoutLab.tsx new file mode 100644 index 00000000..4bb67bcb --- /dev/null +++ b/site/src/playground/backend-layout/BackendLayoutLab.tsx @@ -0,0 +1,217 @@ +/** + * Backend layout: the Vega-Lite layout labs' cases drawn by ECharts, Chart.js or Plotly, one page per + * backend, with what each backend's frame measured and the cases to check by eye at the top. + */ +import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'; +import { Link, useParams, useSearchParams } from 'react-router-dom'; +import type { ChartAssemblyInput } from 'flint-chart'; +import { FlintView } from '../../components/FlintView'; +import { ScaleToFit } from '../../components/ScaleToFit'; +import { BACKENDS, type PreviewBackend } from '../../shared/supported-backends'; +import { SECTIONS, SETUPS, LEGEND_SIZES, setupLabel, sectionCases, type LayoutCase, type SectionId } from './cases'; +import { REVIEW_NOTES, type ReviewBackend } from './review-notes'; +import './backend-layout.css'; + +const PAGE_BACKENDS: ReviewBackend[] = ['echarts', 'chartjs', 'plotly']; +const THEMED: Record = { echarts: false, chartjs: false, plotly: true }; + +/** Defer a chart until its card scrolls near the viewport. */ +function Lazy({ children, minHeight = 220 }: { children: ReactNode; minHeight?: number }) { + const ref = useRef(null); + const [visible, setVisible] = useState(false); + useEffect(() => { + const el = ref.current; + if (!el) return; + const observer = new IntersectionObserver(([entry]) => { + if (entry.isIntersecting) { setVisible(true); observer.disconnect(); } + }, { rootMargin: '400px' }); + observer.observe(el); + return () => observer.disconnect(); + }, []); + return
{visible ? children : null}
; +} + +interface Compiled { width?: number; height?: number; fit?: any; planned?: any; warnings: number; error?: string } + +function compile(backend: PreviewBackend, input: ChartAssemblyInput): Compiled { + try { + const spec: any = BACKENDS[backend].assemble(input); + return { + width: spec?._width ?? spec?.layout?.width ?? spec?.width, + height: spec?._height ?? spec?.layout?.height ?? spec?.height, + fit: spec?._canvasFit, + planned: spec?._planned, + warnings: Array.isArray(spec?._warnings) ? spec._warnings.length : 0, + }; + } catch (error) { + return { warnings: 0, error: String(error) }; + } +} + +function FitLine({ compiled }: { compiled: Compiled }) { + if (compiled.error) return {compiled.error}; + const fit = compiled.fit; + const size = compiled.width && compiled.height ? `${Math.round(compiled.width)} × ${Math.round(compiled.height)}` : ''; + if (!fit) return {size}; + const tone = fit.scale < 0.7 ? 'is-bad' : fit.scale < 0.97 ? 'is-warn' : 'is-ok'; + return ( + + {size} in {fit.box.width} × {fit.box.height} · {fit.scale >= 0.995 ? 'inside its box' : `host scales to ${Math.round(fit.scale * 100)}%`} + {fit.plotScale ? ` · plot laid out at ${Math.round(fit.plotScale * 100)}%` : ''} + {fit.treatment?.names ? ` · key names held to ${fit.treatment.names.keyWidth}px` : ''} + {fit.flags?.length ? ` · ${fit.flags.length} flag${fit.flags.length > 1 ? 's' : ''}` : ''} + + ); +} + +/** A chart at its natural size in focus mode, else shrunk into its card. */ +function Chart({ input, backend, focus, width }: { input: ChartAssemblyInput; backend: PreviewBackend; focus: boolean; width?: number }) { + const view = ; + // A renderer that fills its container (Chart.js) is given the width it was planned at. + if (focus) return
{view}
; + return ( + + {view} + + ); +} + +function CaseCard({ c, backend, reference, flagged, focus = false }: { c: LayoutCase; backend: ReviewBackend; reference: boolean; flagged: boolean; focus?: boolean }) { + const supported = Boolean(BACKENDS[backend].getTemplateDef(c.input.chart_spec.chartType)); + const compiled = useMemo(() => (supported ? compile(backend, c.input) : { warnings: 0 }), [backend, c.input, supported]); + const themeIgnored = c.theme && !THEMED[backend]; + if (!supported) { + return ( +
+

{c.title}

{c.id}
+

{BACKENDS[backend].label} has no {c.input.chart_spec.chartType} template; this case is drawn by Vega-Lite only.

+
+ ); + } + return ( +
+
+

{c.title}

+
+ {c.id} + {c.theme && {c.theme}{themeIgnored ? ' (no themes here)' : ''}} + {flagged && review} +
+
+ {c.note &&

{c.note}

} +
+
+
{BACKENDS[backend].label} · {compiled.warnings ? ` · ${compiled.warnings} warning${compiled.warnings > 1 ? 's' : ''}` : ''}
+ +
+ {reference && ( +
+
Vega-Lite reference
+ +
+ )} +
+
+ ); +} + +export function BackendLayoutLab() { + const params = useParams(); + const backend = (PAGE_BACKENDS.includes(params.backend as ReviewBackend) ? params.backend : 'echarts') as ReviewBackend; + const [search, setSearch] = useSearchParams(); + const section = (SECTIONS.some((s) => s.id === search.get('section')) ? search.get('section') : 'axis-labels') as SectionId; + const setupId = search.get('setup') ?? SETUPS[0].id; + const setup = SETUPS.find((s) => s.id === setupId) ?? SETUPS[0]; + const legendKey = search.get('size') ?? 'm'; + const legendSize = LEGEND_SIZES.find((s) => s.key === legendKey) ?? LEGEND_SIZES[1]; + const reference = search.get('reference') !== 'off'; + const update = (key: string, value: string | undefined) => { + const next = new URLSearchParams(search); + if (value === undefined) next.delete(key); else next.set(key, value); + setSearch(next, { replace: true }); + }; + const caseId = search.get('case'); + const focusSection = caseId ? SECTIONS.find((s) => sectionCases(s.id, { setup, legendSize }).some((c) => c.id === caseId))?.id : undefined; + const cases = useMemo(() => sectionCases(focusSection ?? section, { setup, legendSize }), [focusSection, section, setup, legendSize]); + const focused = caseId ? cases.find((c) => c.id === caseId) : undefined; + const notes = REVIEW_NOTES[backend]; + const flagged = new Set(notes.map((n) => n.caseId).filter(Boolean) as string[]); + const meta = SECTIONS.find((s) => s.id === section)!; + + const goTo = (note: { section: SectionId; caseId?: string }) => { + const next = new URLSearchParams(search); + next.set('section', note.section); + if (note.caseId) next.set('case', note.caseId); else next.delete('case'); + setSearch(next, { replace: true }); + }; + + return ( +
+
+
+

{BACKENDS[backend].label} layout

+

+ The Vega-Lite layout labs’ cases, drawn by {BACKENDS[backend].label} in its own style: titles broken with no widow, + band labels from the shared plan, gutters and keys measured, and the canvas fit judged against each chart’s box. +

+
+ +
+ +
+ Needs review · {notes.length} {notes.length === 1 ? 'case' : 'cases'} for {BACKENDS[backend].label} + {notes.length === 0 ?

Nothing flagged.

: ( +
    + {notes.map((note, index) => ( +
  1. + +

    {note.question}

    +

    Now: {note.now}

    +
  2. + ))} +
+ )} +
+ + + +
+

{meta.lead}

+ {section === 'canvas-squeeze' && ( + + )} + {section === 'legend' && ( + + )} + +
+ + {focused ? ( +
+ + +
+ ) : ( +
+ {cases.map((c) => )} +
+ )} +
+ ); +} diff --git a/site/src/playground/backend-layout/backend-layout.css b/site/src/playground/backend-layout/backend-layout.css new file mode 100644 index 00000000..fbf9cd27 --- /dev/null +++ b/site/src/playground/backend-layout/backend-layout.css @@ -0,0 +1,62 @@ +.bl-lab { max-width: 1400px; margin: 0 auto; padding: 12px 0 48px; } +.bl-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; } +.bl-heading h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: 0; } +.bl-heading p { margin: 0; max-width: 80ch; font-size: 13px; line-height: 1.5; color: #61676d; } +.bl-backends { display: flex; gap: 4px; } +.bl-backends a { padding: 6px 10px; font-size: 13px; color: #61676d; text-decoration: none; border: 1px solid #d4d8dc; border-radius: 4px; } +.bl-backends a.is-active { color: #fff; background: #176a92; border-color: #176a92; } +.bl-review { margin: 0 0 16px; padding: 10px 14px; background: #fff8e6; border: 1px solid #f0d9a0; border-radius: 6px; font-size: 13px; } +.bl-review summary { cursor: pointer; font-weight: 600; } +.bl-review ol { margin: 10px 0 0; padding-left: 20px; } +.bl-review li { margin-bottom: 10px; } +.bl-review li p { margin: 2px 0; line-height: 1.45; } +.bl-review button { font: inherit; font-size: 12px; padding: 0; color: #176a92; background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; } +.bl-sections { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #d4d8dc; margin-bottom: 10px; } +.bl-sections button { font: inherit; font-size: 13px; padding: 6px 10px; color: #61676d; background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; } +.bl-sections button.is-active { color: #20262c; border-bottom-color: #176a92; font-weight: 600; } +.bl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 14px; font-size: 12px; color: #61676d; } +.bl-controls p { flex: 1 1 420px; margin: 0; line-height: 1.45; } +.bl-controls label { display: flex; align-items: center; gap: 6px; } +.bl-controls select { padding: 4px 6px; border: 1px solid #d4d8dc; border-radius: 4px; background: #fff; color: inherit; } +.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(620px, 1fr)); gap: 18px; } +.bl-case { min-width: 0; padding: 12px; background: #fff; border: 1px solid #e3e6e9; border-radius: 6px; scroll-margin-top: 96px; } +.bl-case.is-wide { grid-column: 1 / -1; } +.bl-case.is-flagged { border-color: #e2b13c; box-shadow: 0 0 0 1px #f0d9a0; } +.bl-case header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; } +.bl-case h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: 0; } +.bl-tags { display: flex; gap: 6px; align-items: center; font-size: 11px; color: #61676d; } +.bl-tags code { font-size: 10px; color: #8a9096; } +.bl-tag { padding: 1px 6px; background: #eef3f6; border-radius: 3px; } +.bl-tag.is-muted { color: #8a9096; background: #f3f4f5; } +.bl-tag.is-flag { color: #7a5200; background: #fbe8b8; } +.bl-note { margin: 0 0 8px; font-size: 12px; line-height: 1.45; color: #61676d; } +.bl-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; } +.bl-single { display: grid; grid-template-columns: minmax(0, 1fr); } +.bl-pair figure, .bl-single figure { min-width: 0; margin: 0; } +.bl-pair figcaption, .bl-single figcaption { margin-bottom: 6px; font-size: 11px; color: #61676d; } +.bl-reference { opacity: .9; } +.bl-fit.is-ok { color: #2b7a3d; } +.bl-fit.is-warn { color: #9a6700; } +.bl-fit.is-bad, .bl-fit.is-error { color: #b42318; } +.bl-focus > button { margin-bottom: 10px; font: inherit; font-size: 12px; color: #176a92; background: none; border: 0; cursor: pointer; padding: 0; } +.bl-focus .bl-pair { grid-template-columns: max-content max-content; align-items: start; } +.bl-natural { display: inline-block; background: #fff; } +.bl-tags a { text-decoration: none; } +.bl-focus { overflow-x: auto; } +.bl-focus .bl-case { width: max-content; max-width: none; } +.bl-case.is-unsupported { background: #f7f8f9; border-style: dashed; } +/* Chart.js fills its wrapper, capped at the container's width; here every chart is drawn at its planned size and scaled to fit. */ +.bl-lab div:has(> canvas) { max-width: none !important; } +.bl-fix-group { margin-bottom: 28px; } +.bl-fix-group > h2 { margin: 16px 0 4px; font-size: 16px; letter-spacing: 0; } +.bl-fix-group .bl-case { margin-bottom: 14px; } +.bl-fix-pair { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; overflow-x: auto; } +.bl-fix-pair figure { margin: 0; } +.bl-fix-pair figcaption { margin-bottom: 6px; font-size: 11px; color: #61676d; } +.bl-fix-pair .bl-natural { border: 1px dashed #e3e6e9; } +.bl-case details { margin-top: 8px; font-size: 12px; } +.bl-case summary { cursor: pointer; color: #176a92; } +.bl-diff { margin-top: 6px; border-collapse: collapse; font-size: 11px; } +.bl-diff th, .bl-diff td { padding: 3px 8px; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: top; max-width: 420px; word-break: break-word; } +.bl-diff th { color: #61676d; font-weight: 600; } +.bl-no-before { width: 240px; padding: 24px 12px; border: 1px dashed #e3e6e9; } diff --git a/site/src/playground/backend-layout/cases.ts b/site/src/playground/backend-layout/cases.ts new file mode 100644 index 00000000..9926071b --- /dev/null +++ b/site/src/playground/backend-layout/cases.ts @@ -0,0 +1,150 @@ +/** + * The layout cases every backend page draws: the same inputs the Vega-Lite layout labs use (axis + * labels, title wrap, calendar axes, categorical temporal, canvas squeeze, density, legend, colour), + * gathered by section so ECharts, Chart.js and Plotly can be checked against them one by one. + */ +import type { ChartAssemblyInput } from 'flint-chart'; +import { LABEL_CASES, DUAL_LEGEND_CASES, HORIZONTAL_LEGEND_CASES, FACET_LABEL_CASES, labelCaseInput } from '../axis-label-cases'; +import { TEXT_CASES, bubbleInput, CHART_WIDTHS, CHART_DECKS } from '../TitleWrapLab'; +import { EXAMPLES as CALENDAR_EXAMPLES, INSPECTION_EXAMPLES, exampleInput } from '../CalendarAxisLab'; +import { CASES as TEMPORAL_CASES } from '../CategoricalTemporalLab'; +import { CASES as SQUEEZE_CASES } from '../canvas-squeeze/cases'; +import { SETUPS, boxOf, setupLabel, type Setup } from '../canvas-squeeze/CanvasSqueeze'; +import { SERIES_COUNTS, lineInput, DOT_DATA, dotInput } from '../DensityLab'; +import { SINGLE as LEGEND_SINGLE, MULTI as LEGEND_MULTI, SIZES as LEGEND_SIZES } from '../LegendLab'; +import { CASES as COLOR_CASES, ROWS as COLOR_ROWS } from '../ColorLab'; +import { gapminderRows } from '../gapminder-dashboard-data'; + +export type SectionId = 'axis-labels' | 'title-wrap' | 'calendar' | 'categorical-temporal' | 'canvas-squeeze' | 'density' | 'legend' | 'color'; + +export const SECTIONS: Array<{ id: SectionId; label: string; lead: string }> = [ + { id: 'axis-labels', label: 'Axis labels', lead: 'Category names along x and down y: wrapped, turned, thinned or cut by the shared band-label plan; keys with long names.' }, + { id: 'title-wrap', label: 'Title wrap', lead: 'Headline and deck broken to their block with no widow (fullest lines), set in the backend\u2019s own title type.' }, + { id: 'calendar', label: 'Calendar axes', lead: 'Continuous date axes: the backend keeps its own calendar ticks; the frame measures the room they take.' }, + { id: 'categorical-temporal', label: 'Categorical temporal', lead: 'Dates on a banded axis: names as written, or as a calendar names them where crowded.' }, + { id: 'canvas-squeeze', label: 'Canvas squeeze', lead: 'Charts set in a small box: title, keys and labels measured; past legibility the plot is laid out smaller, once.' }, + { id: 'density', label: 'Density', lead: 'Many series thin their lines (15% ink rule, 0.75 px floor); many dots as the backend draws them.' }, + { id: 'legend', label: 'Legend', lead: 'Keys beside the plot with long names wrapped, or moved where they will not stand beside it.' }, + { id: 'color', label: 'Color', lead: 'Colour controls on a heatmap and a bar chart, and the room the colour key takes.' }, +]; + +export interface LayoutCase { + id: string; + title: string; + note?: string; + /** The house the Vega-Lite lab draws the case in; ECharts and Chart.js have no themes. */ + theme?: string; + input: ChartAssemblyInput; + /** Spans two columns. */ + wide?: boolean; +} + +const withTheme = (input: ChartAssemblyInput, theme: string | undefined): ChartAssemblyInput => + theme ? { ...input, theme_spec: theme } : input; + +function axisLabelCases(): LayoutCase[] { + const out: LayoutCase[] = []; + for (const c of LABEL_CASES) { + for (const surface of ['x', 'y', 'color'] as const) { + out.push({ id: `labels-${c.id}-${surface}`, title: `${c.title} · ${surface === 'color' ? 'colour legend' : `${surface} axis`}`, input: labelCaseInput(c, surface, 480, 320) }); + } + } + for (const c of DUAL_LEGEND_CASES) { + out.push({ id: `labels-dual-${c.id}`, title: `Colour + size · ${c.title}${c.longSizeTitle ? ' · long size title' : ''}`, input: labelCaseInput(c, 'dual', 480, 320) }); + } + for (const c of HORIZONTAL_LEGEND_CASES) out.push({ id: `labels-${c.id}`, title: `Titled · ${c.title}`, input: c.input }); + for (const c of FACET_LABEL_CASES) out.push({ id: `labels-${c.id}`, title: `Facets · ${c.title}`, input: c.input, wide: true }); + return out; +} + +const FIVE = new Set(['China', 'India', 'United States', 'Brazil', 'Nigeria']); + +/** A plain chart under a headline or deck from the title-wrap lab, at the lab's block width. */ +function titledLine(headline: string | undefined, deck: string | undefined, width: number): ChartAssemblyInput { + return { + data: { values: gapminderRows.filter((row) => FIVE.has(row.Country)) }, + semantic_types: { Country: 'Country', Year: 'Year', 'Life expectancy': 'Quantity' }, + chart_spec: { + chartType: 'Line Chart', + ...(headline ? { title: headline } : {}), + ...(deck ? { subtitle: deck } : {}), + encodings: { x: 'Year', y: 'Life expectancy', color: 'Country' }, + baseSize: { width, height: 260 }, + }, + }; +} + +function titleWrapCases(): LayoutCase[] { + const out: LayoutCase[] = []; + for (const c of TEXT_CASES) { + const input = c.role === 'headline' ? titledLine(c.text, undefined, c.block) : titledLine('Life expectancy, five countries', c.text, c.block); + out.push({ id: `title-${c.id}`, title: `${c.label} · ${c.block}px plot`, note: c.note, input }); + } + for (const deck of CHART_DECKS) { + for (const width of CHART_WIDTHS) { + out.push({ id: `title-bubble-${deck.id}-${width}`, title: `Bubble chart · ${deck.label} · ${width}px plot`, theme: 'economist', input: bubbleInput(width, deck.text) }); + } + } + out.push({ id: 'title-headline-narrow', title: 'Headline only · 260px plot', input: titledLine('Life expectancy has risen in every one of these five countries since 1952', undefined, 260) }); + out.push({ id: 'title-unbroken', title: 'Unbroken headline · 260px plot', note: 'One long word cannot break: it is set a size down where that fits, else left whole.', input: titledLine('Lifeexpectancyhasrisenineverycountrysince1952', undefined, 260) }); + return out; +} + +function calendarCases(): LayoutCase[] { + return [...INSPECTION_EXAMPLES, ...CALENDAR_EXAMPLES].map((example) => ({ + id: `calendar-${example.id}`, + title: example.title, + input: exampleInput(example, example.planningWidth ?? 480, example.planningHeight ?? 420, ''), + wide: Boolean(example.facets) || (example.planningWidth ?? 0) > 600, + })); +} + +function temporalCases(): LayoutCase[] { + return TEMPORAL_CASES.map((c) => ({ id: `temporal-${c.id}`, title: `${c.group} · ${c.id}`, note: c.note, theme: c.theme, input: withTheme(c.input, c.theme) })); +} + +function squeezeCases(setup: Setup): LayoutCase[] { + return SQUEEZE_CASES.map((c) => { + const input = structuredClone(c.input) as unknown as ChartAssemblyInput; + (input.chart_spec as any).baseSize = setup.base; + (input.chart_spec as any).canvasSize = boxOf(setup); + return { id: `squeeze-${c.id}`, title: `${c.kind === 'squeezed' ? 'Squeezed' : 'Healthy'} · ${c.name}`, note: c.note, theme: c.theme, input: withTheme(input, c.theme) }; + }); +} + +function densityCases(): LayoutCase[] { + const out: LayoutCase[] = SERIES_COUNTS.map((count) => ({ id: `density-lines-${count}`, title: `${count} series`, note: 'Lines thin with the number of series.', input: lineInput(count, undefined) })); + for (const data of DOT_DATA) out.push({ id: `density-dots-${data.key}`, title: data.label, input: dotInput(data, undefined) }); + return out; +} + +function legendCases(size: { width: number; height: number }): LayoutCase[] { + return [...LEGEND_SINGLE, ...LEGEND_MULTI].map((c) => ({ id: `legend-${c.key}`, title: c.label, note: c.why, input: c.input(size) })); +} + +function colorCases(): LayoutCase[] { + return COLOR_CASES.map((c, index) => ({ + id: `color-${index}`, + title: `${c.chart_spec.chartType} · color ${JSON.stringify((c.chart_spec.encodings as any).color)}`, + theme: typeof c.theme_spec === 'string' ? c.theme_spec : undefined, + input: { ...c, data: { values: COLOR_ROWS } } as ChartAssemblyInput, + })); +} + +export { SETUPS, boxOf, setupLabel, LEGEND_SIZES }; +export type { Setup }; + +export interface SectionOptions { setup: Setup; legendSize: { width: number; height: number } } + +export function sectionCases(section: SectionId, options: SectionOptions): LayoutCase[] { + switch (section) { + case 'axis-labels': return axisLabelCases(); + case 'title-wrap': return titleWrapCases(); + case 'calendar': return calendarCases(); + case 'categorical-temporal': return temporalCases(); + case 'canvas-squeeze': return squeezeCases(options.setup); + case 'density': return densityCases(); + case 'legend': return legendCases(options.legendSize); + case 'color': return colorCases(); + } +} diff --git a/site/src/playground/backend-layout/overlap-sweep.ts b/site/src/playground/backend-layout/overlap-sweep.ts new file mode 100644 index 00000000..2695f4c0 --- /dev/null +++ b/site/src/playground/backend-layout/overlap-sweep.ts @@ -0,0 +1,16 @@ +/** Dev helper: text boxes in an SVG that overlap one another (pairs), for sweeping a backend's cases. */ +export function overlappingTexts(svg: SVGSVGElement, minArea = 6): Array<[string, string]> { + const boxes = [...svg.querySelectorAll('text')].map((t) => ({ text: (t.textContent ?? '').trim(), r: t.getBoundingClientRect() })) + .filter((b) => b.text && b.r.width > 0 && b.r.height > 0); + const out: Array<[string, string]> = []; + for (let i = 0; i < boxes.length; i++) { + for (let j = i + 1; j < boxes.length; j++) { + const a = boxes[i].r; + const b = boxes[j].r; + const w = Math.min(a.right, b.right) - Math.max(a.left, b.left); + const h = Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top); + if (w > 1 && h > 1 && w * h >= minArea) out.push([boxes[i].text, boxes[j].text]); + } + } + return out; +} diff --git a/site/src/playground/backend-layout/review-notes.ts b/site/src/playground/backend-layout/review-notes.ts new file mode 100644 index 00000000..eccff983 --- /dev/null +++ b/site/src/playground/backend-layout/review-notes.ts @@ -0,0 +1,167 @@ +/** + * Cases to check by eye, per backend: where the layout made a call that may not suit the library's + * own look, or where the backend cannot draw what the plan decided. One central list per backend, + * shown at the top of its page; each note links to its case. + */ +import type { SectionId } from './cases'; + +export type ReviewBackend = 'echarts' | 'chartjs' | 'plotly'; + +export interface ReviewNote { + section: SectionId; + /** The case id on the page (`labels-…`, `title-…`); unset for notes about a whole section. */ + caseId?: string; + /** What to look at, as a question. */ + question: string; + /** What Flint does now, and why. */ + now: string; +} + +export const REVIEW_NOTES: Record = { + echarts: [ + { + section: 'title-wrap', caseId: 'title-snapshot-deck', + question: 'Should the headline sit centred over the canvas, as ECharts 6 sets its title, or start-aligned over the plot as Vega-Lite and most houses set it?', + now: 'ECharts\u2019 own title: centred, 15 px from the top, 18 px bold over a 12 px grey deck, broken to the canvas width less padding with the shared no-widow rule. The plot starts under the block; a key beside the plot starts under it too.', + }, + { + section: 'calendar', caseId: 'calendar-inspection-cadence', + question: 'Is ECharts\u2019 own time axis acceptable for calendar labels, or should Vega-Lite\u2019s calendar tick plan (`planTemporalTicks`) move to core and drive ECharts too?', + now: 'The Line/Area templates stand every time label on end; the frame stands them flat where a label fits a sixth of the plot, with `hideOverlap` dropping any that would collide. Tick choice and boundary labels are ECharts\u2019 own (e.g. \u201cJan 08\u201d, not \u201cJan 5, 2024\u201d). Dense series (density-lines-164) stay turned.', + }, + { + section: 'density', caseId: 'density-lines-30', + question: 'When long series names make the side key take too much width, is ECharts\u2019 own foot legend (one line a name, flowing in rows) the right fallback, or should the names wrap beside the plot instead?', + now: 'The canvas fit tries, in turn, key names held to 120 px (wrapped beside the plot), the key at the foot, and a smaller plot, and keeps whichever reads best, only where it beats the plan. Here none beats the plan, so the key stays beside the plot and the host scales the drawing to about 63%.', + }, + { + section: 'legend', caseId: 'legend-long-size', + question: 'Two keys (colour + size): the colour legend sits at the foot and the size key is ECharts\u2019 own continuous visualMap. Is the native ramp, stood from the plot\u2019s top with its title centred over the bar, the right look, or should it show discrete bubbles as Vega-Lite does?', + now: 'Native visualMap kept (per review). The frame stands each vertical ramp from the plot top, centres its title over the bar clear of the chart title, and widens `grid.right` to fit; the foot rows of the colour legend are measured as ECharts wraps them so the plot and its x name stay clear.', + }, + { + section: 'color', + question: 'A binned colour scale\u2019s pieces now break at round values (\u201c\u221225,000 \u2013 0\u201d) rather than at the data\u2019s raw quantiles. Is rounding the edges right when it makes the bins slightly uneven in count?', + now: '`roundBinEdges` (core) snaps each edge to the coarsest round step that keeps the edges distinct; the outer pieces stay open (\u201c< \u2026\u201d, \u201c\u2265 \u2026\u201d) and an authored domain still wins.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-pie-ok', + question: 'Axis-less charts (pie, sunburst, gauge, radar, funnel): is pushing the whole chart down under the title right, or should the title shrink the chart instead?', + now: 'The canvas grows by the title block; every positioned component moves down by it (percent centres and radii are held in px of the canvas as it was). A component placed with `top: \u2018middle\u2019` (funnel) is left where ECharts puts it and may sit closer to the title.', + }, + { + section: 'axis-labels', caseId: 'labels-facet-long', + question: 'Facets: only the title is laid out; each panel keeps the facet combiner\u2019s own label handling (turned names). Should panels take the band-label plan too?', + now: 'The frame treats a multi-grid option as one block: the title is broken over the canvas and every grid moves down under it. Panel gutters are not re-measured.', + }, + { + section: 'axis-labels', caseId: 'labels-short-control-color', + question: 'A padded scatter domain ends off the round ticks (11.25, 41.4). Hiding those end labels matches Vega-Lite; is that right for ECharts readers, who are used to seeing them?', + now: '`showMinLabel` / `showMaxLabel` set false only where the end is not on one of the renderer\u2019s round ticks.', + }, + ], + chartjs: [ + { + section: 'title-wrap', caseId: 'title-snapshot-deck', + question: 'Chart.js\u2019 title plugin defaults to 12 px bold over a 12 px subtitle, much quieter than the other backends. Keep the library default, or set the headline a size or two up?', + now: 'Library default kept: `plugins.title` (12 px bold) and `plugins.subtitle` (12 px), centred, lines given as arrays and broken with the shared no-widow rule. The canvas grows by the block so the plot keeps its planned size.', + }, + { + section: 'legend', caseId: 'legend-colour-10-long', + question: 'Chart.js holds a side legend to a quarter of the canvas and cannot wrap names in a row at the foot. Are cut names (\u201cBosnia and He\u2026\u201d) acceptable, or should long-name keys fall back to an HTML legend?', + now: 'Beside the plot names wrap onto lines (array labels) within the quarter-canvas cap and are cut past it; at the foot each name stands on one line, cut where it would run past the canvas.', + }, + { + section: 'legend', caseId: 'legend-ramp', + question: 'Legends a template writes itself (a colour ramp\u2019s stops) keep the layout pass\u2019s fixed 96 px gutter; Chart.js draws them wider than planned. Measure them too?', + now: 'Left as the layout pass set them; the plot comes out narrower than planned by the difference (Chart.js fits its boxes inside the canvas).', + }, + { + section: 'axis-labels', caseId: 'labels-facet-long', + question: 'Facet grids are composed by the HTML host, which draws no chart title yet. Add a title row to the facet host?', + now: 'Faceted charts skip the frame: no title, panels as before.', + }, + { + section: 'calendar', caseId: 'calendar-inspection-cadence', + question: 'Chart.js\u2019 time scale picks sparse ticks (\u201cJan 2024\u201d, \u201cMar 2024\u201d) with its own autoSkip. Acceptable, or should the calendar tick plan drive Chart.js ticks?', + now: 'Chart.js\u2019 own time ticks; the frame only measures the room they take.', + }, + { + section: 'color', + question: 'Chart.js has no Heatmap, Boxplot or Donut template, so most Color cases and several squeeze/temporal cases are drawn by Vega-Lite only. Expected?', + now: 'Shown on the page as unsupported, not as errors.', + }, + ], + plotly: [ + { + section: 'title-wrap', caseId: 'title-long-deck', + question: 'Text is measured as Verdana, which Plotly\u2019s default stack (\u201cOpen Sans\u201d, verdana, arial) draws in where Open Sans is not loaded. If a host loads Open Sans, lines break a little early (Open Sans runs ~5% narrower). Fine?', + now: 'Headline and deck broken with the shared no-widow rule in Verdana metrics; the deck rides as a smaller second span under the headline (Plotly 2.x has no subtitle). Broken lines come out of a continuous plot.', + }, + { + section: 'axis-labels', caseId: 'labels-horizontal-narrow', + question: 'Wrapping a long legend name puts `
` into the trace name, which the hover label shows too (in full, `namelength: -1`). Acceptable, or should the hover keep the one-line name via a hovertemplate?', + now: 'Names wrap only when the canvas fit holds key names to 120 px; otherwise Plotly\u2019s legend sets them on one line beside the plot.', + }, + { + section: 'density', caseId: 'density-lines-164', + question: 'Plotly\u2019s side legend never wraps into columns (it scrolls), so a long key makes a wide figure. Is moving it to a horizontal row at the foot (container-anchored) the right fallback?', + now: 'Side legend measured as one column; the canvas fit may hold names to 120 px or move the key to the foot, taking whichever reads best and only where it beats the plan.', + }, + { + section: 'color', caseId: 'color-4', + question: 'The colour bar\u2019s room is estimated from its ticks and title; Plotly\u2019s automargin settles the last 10\u201330 px. Close enough?', + now: 'Right margin = max(32, bar + widest tick label, title); Plotly may still grow it.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-products-swiss', + question: 'Themed Plotly charts: a house that sets the key above or below the plot has the plan\u2019s side room given back before the theme lays the axes out. Check houses with keys on top look balanced.', + now: 'The key, the red tab or rule (`planHeader`), the headline and the source line (`planSource`) all start at the chart\u2019s left edge, as Vega-Lite sets them; a house that stands the value axis on the right (Economist) has it drawn there. The foot follows the names the house realizes: room kept for turned names or for an axis title moved into the deck is given back.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-stacked-economist', + question: 'Plotly draws headline and deck as one block of lines, so the house\u2019s padding between them (e.g. Economist 7 px) is not drawn; the deck sits at Plotly\u2019s own line spacing. Acceptable, or draw the deck as a separate annotation?', + now: 'Title height reserved as the lines Plotly draws, plus the house\u2019s title offset; the key above the plot is set inside Plotly\u2019s padded legend box so the gaps between what is drawn match the house\u2019s.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-gapminder-economist', + question: 'Plotly has no size legend, so a bubble chart shows only its colour key (Vega-Lite also shows \u201cPopulation (M)\u201d with sample circles). Draw a size key from dummy traces or shapes?', + now: 'Colour key only; bubble size is unexplained in the figure.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-cpi-nyt', + question: 'Plotly\u2019s templates leave keys untitled. A house that titles its key (NYT: \u201cDirection\u201d) now gets the field\u2019s name inline at the start of the row, as Vega-Lite sets it. Right for every house?', + now: 'The key is titled from the colour (or group) field\u2019s display name only where the house\u2019s resolved `legend.title` is on; untheme\u2019d Plotly charts stay untitled. Names along the band are cut in the face they were planned in, so they break as Vega-Lite breaks them.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-ch-ten-long-keys-top', + question: 'A house key of ten long names on top made the drawing 1.5\u00d7 taller than its box; the canvas fit now stands it beside the plot (one column, Plotly\u2019s side legend). Is overriding the house\u2019s top placement right here, as Vega-Lite does?', + now: '`refitCanvas` tries `{ keys: \u2019side\u2019 }` (and with names held to 120 px) when keys in rows above or below the plot make the drawing tall; the side key is measured as Plotly draws it (`keyBlock`, `PLOTLY_PROFILE`) and kept only where it reads clearly better.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-oecd-16-slide', + question: 'Facets: one shared y title and one shared x title (centred), x labels only under each column\u2019s last panel, years thinned to flat round ticks. Vega-Lite repeats the y title per row and the x title per column. Prefer the repeated titles?', + now: 'The grid is planned with Plotly\u2019s furniture (`plFacetFurniture`: 4 columns here, as Vega-Lite) and laid out around measured labels (`plLayoutFacetGrid`). Banded x axes keep labels on every panel, rows spaced for them.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-ch-pie-callouts-economist', + question: 'A themed pie (or one with a source line) whose callouts would stand outside it now names its slices in a key, in the house\u2019s row where it fits in two rows, else beside the pie, with shares inside \u2014 as Vega-Lite does. Right for every house, or should a house with no key on top keep callouts?', + now: 'Fixed: outside callouts let Plotly\u2019s automargin grow the margins after the header was written, dragging the paper-referenced red tab off the headline (and with it the plot area). Callouts are turned off and the pie\u2019s room is fixed, so nothing the frame hung from the plot moves. Unthemed pies with no source keep Plotly\u2019s callouts. Inside/outside packing before keying was considered and skipped; instead `chartProperties.sliceNames` (`auto` | `onSlices` | `key`), also settable per house in `chartDefaults[\u2019Pie Chart\u2019]`, lets the author or house choose.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-companies-default', + question: 'Overflow policy (needs a decision): with Plotly\u2019s own sizes (12 px Verdana, 40 px before each key name) a seven-long-name key and the planned 300 px plot cannot share a 450 px box; the host scales the drawing to 75%. Vega-Lite fits because its key is ~130 px wide. Which should give: (a) the library\u2019s type sizes (step key, tick and title text down to a 10 px floor), (b) the plot (laid out smaller \u2014 tried, it left a 180 px plot and a scrolling key, worse), or (c) accept host scaling down to some limit?', + now: 'Decided for now: the key gives way, the plot and library type sizes do not (except key text, one size, 10 px floor). Names are held to 120 px of their own width (then 90 px with smaller text), scored by flags plus host shrink below 90%; the plot shrinks only past legibility (70%). Here that takes Plotly from 75% to 83% (Datawrapper 85% \u2192 94%). Reverse the call if you prefer smaller tick/title type or a smaller plot. ECharts stays at 82%: its size ramp holds the right edge, so the colour key cannot stand beside the plot without stacking with it.', + }, + { + section: 'canvas-squeeze', caseId: 'squeeze-oecd-4-card', + question: 'Plotly still assembles through `computeLayout` and takes the plan\u2019s decisions piecemeal; only Vega-Lite runs `planLayout` with a `BackendLayoutProfile`. Move Plotly (then ECharts and Chart.js) onto `planLayout` with their own profiles, so facet columns, tick counts and label sizes come from one plan?', + now: 'Not done: a large change to each backend\u2019s assemble. The drawing side is profiled (`BackendProfile`); the plan side gets Plotly\u2019s facet furniture through `facetFixedPadding`/`facetGap` only.', + }, + { + section: 'categorical-temporal', caseId: 'temporal-bar-24-months', + question: 'Bars over a regular run of months stay on a time scale (Vega-Lite, and Plotly\u2019s date axis) with one width each, centred on the 1st: months run 28\u201331 days, so the gap after February all but closes while the others stay ~2 px (visible at 24 bars in 400 px). Fix by (a) spanning each bar f/2 of the way to its neighbours (gaps a constant share of each month, centres within 2% of a step \u2014 needs working x/x2 columns, so the tooltip, brush and house bar fraction need care), (b) Vega-Lite\u2019s own `timeUnit` spans (bars move to mid-month, half a step off their ticks), or (c) bands for whole month runs, as heatmaps now do?', + now: 'Not changed: the \u201cruns of time stay continuous\u201d rule for bars stands. Heatmaps changed: a whole run of months or quarters (`readsAsCalendarRun`) is drawn as equal cells named by the calendar (`Jan`/`2025`, `Feb`, \u2026) on every backend, the time scale one `xAxisType` choice away; a run with a gap, or of days, weeks or years, keeps its time scale.', + }, + ], +}; diff --git a/site/src/playground/binning/BinningLab.tsx b/site/src/playground/binning/BinningLab.tsx new file mode 100644 index 00000000..1c7c25a3 --- /dev/null +++ b/site/src/playground/binning/BinningLab.tsx @@ -0,0 +1,315 @@ +import { useCallback, useMemo, useState } from 'react'; +import { assembleVegaLite, type ChartAssemblyInput } from 'flint-chart'; +import { VegaLiteView } from '../../components/VegaLiteView'; +import { CASES, type BinningCase } from './cases'; +import './binning-lab.css'; + +/** + * How Flint cuts a continuous colour into stepped classes, shown as it ships: every case under every + * setup that bins — the four houses that quantize their ramp, and an author's `bins` without a + * house — with what each chart's key prints and how its cells fill the classes. Known limits follow, + * each with the alternatives considered. + */ + +type Spec = Record; + +const SETUPS: { id: string; label: string; theme?: string; bins?: number }[] = [ + { id: 'pop', label: 'Pop', theme: 'pop' }, + { id: 'swiss', label: 'Swiss', theme: 'swiss' }, + { id: 'cartoon', label: 'Cartoon', theme: 'cartoon' }, + { id: 'de-stijl', label: 'De Stijl', theme: 'de-stijl' }, + { id: 'bins', label: 'No theme, bins: 5', bins: 5 }, +]; + +const SIZE = { width: 340, height: 240 }; + +function inputOf(c: BinningCase, setup: { theme?: string; bins?: number }, extra: { semantic?: Record; showTextLabels?: boolean } = {}): ChartAssemblyInput { + return { + data: { values: c.values }, + semantic_types: { ...c.semantic, ...extra.semantic }, + chart_spec: { + chartType: 'Heatmap', + title: c.title, + encodings: { x: c.x, y: c.y, color: setup.bins ? { field: c.color, bins: setup.bins } : c.color }, + canvasSize: SIZE, + ...(extra.showTextLabels ? { chartProperties: { showTextLabels: true } } : {}), + }, + ...(setup.theme ? { theme_spec: setup.theme } : {}), + } as unknown as ChartAssemblyInput; +} + +/** The drawn cells' colour encoding: the first on the field that draws a key. */ +function cellColor(spec: Spec, field: string): Spec | undefined { + let found: Spec | undefined; + const visit = (node: Spec | undefined) => { + if (!node || typeof node !== 'object' || found) return; + const enc = node.encoding?.color; + if (enc?.field?.startsWith(field) && enc.legend !== null) found = enc; + for (const key of ['layer', 'hconcat', 'vconcat', 'concat'] as const) (node[key] ?? []).forEach(visit); + if (node.spec) visit(node.spec); + }; + visit(spec); + return found; +} + +const fmt = (v: number) => { + const s = String(Number(v.toPrecision(6))); + return v < 0 ? `−${s.slice(1)}` : s; +}; + +/** A drawn key label read back as a number: "−10%" is −0.1, "1,000" is 1000, "−40k" is −40000. */ +function readBack(label: string): number { + const text = label.replace('−', '-').replace(/,/g, ''); + const scale = text.endsWith('%') ? 0.01 : text.endsWith('k') ? 1e3 : text.endsWith('M') ? 1e6 : 1; + return Number(text.replace(/[%kM]$/, '')) * scale; +} + +interface Stepped { + breaks: number[]; + /** Where the outer classes close, where the breaks are even and the data lies within a step of them. */ + closed?: [number, number]; + counts: number[]; +} + +/** The classes a compiled chart steps its colour into, and how its cells fill them. */ +function steppedOf(spec: Spec, field: string, values: number[]): Stepped | undefined { + const scale = cellColor(spec, field)?.scale; + if (scale?.type !== 'threshold' || !Array.isArray(scale.domain)) return undefined; + const breaks: number[] = scale.domain; + const counts = new Array(breaks.length + 1).fill(0); + for (const v of values) { + let i = 0; + while (i < breaks.length && v >= breaks[i]) i++; + counts[i]++; + } + const step = breaks.length > 1 ? breaks[1] - breaks[0] : undefined; + const even = step !== undefined && breaks.every((b, i) => i === 0 || Math.abs(b - breaks[i - 1] - step) < 1e-9 * Math.abs(step)); + const [dmin, dmax] = [Math.min(...values), Math.max(...values)]; + const closed = even && dmin >= breaks[0] - step! - 1e-9 && dmax <= breaks[breaks.length - 1] + step! + 1e-9 + ? [Number((breaks[0] - step!).toPrecision(12)), Number((breaks[breaks.length - 1] + step!).toPrecision(12))] as [number, number] + : undefined; + return { breaks, ...(closed ? { closed } : {}), counts }; +} + +/** One compiled chart, with what its key prints and how its cells fill the classes. */ +function Panel({ title, input, field, values, pivot, note }: { + title: string; input: ChartAssemblyInput; field: string; values: number[]; pivot?: number; note?: string; +}) { + const [drawn, setDrawn] = useState(); + const built = useMemo(() => { + try { + const compiled = assembleVegaLite(input) as Spec; + return { compiled, stepped: steppedOf(compiled, field, values) }; + } catch (error) { + return { error: (error as Error).message }; + } + }, [input, field, values]); + const onReady = useCallback((svg: SVGSVGElement) => { + const legend = svg.querySelector('.role-legend'); + setDrawn([...(legend?.querySelectorAll('.role-legend-label text') ?? [])].map((t) => (t.textContent ?? '').trim()).filter(Boolean)); + }, []); + if ('error' in built) return
{title}

{built.error}

; + const { compiled, stepped } = built; + const mismatch = stepped && drawn && drawn.length === stepped.breaks.length + && drawn.some((label, i) => Math.abs(readBack(label) - stepped.breaks[i]) > 1e-9 * Math.max(1, Math.abs(stepped.breaks[i]))); + const empty = stepped?.counts.filter((count) => count === 0).length ?? 0; + const neutral = stepped && pivot !== undefined && !stepped.breaks.includes(pivot) + && stepped.breaks.some((b, i) => i > 0 && Math.abs((stepped.breaks[i - 1] + b) / 2 - pivot) < 1e-9); + return ( +
+
{title}{note ? {note} : null}
+ + {stepped ? ( +
+
breaks
{stepped.breaks.map(fmt).join(' ')}
+ {drawn && <>
key prints
{drawn.join(' ')}{mismatch ? ' ← not the breaks' : ''}
} +
classes
{stepped.counts.length}{stepped.closed ? ` · closed ${fmt(stepped.closed[0])} … ${fmt(stepped.closed[1])}` : ' · ends open'}
+
cells
{stepped.counts.join(' / ')}{empty ? · {empty} empty : null}
+ {pivot !== undefined && <>
pivot
{stepped.breaks.includes(pivot) ? 'a break' : neutral ? 'centres a neutral class' : 'inside a class'}
} +
+ ) :

Not stepped: the colour runs as {cellColor(compiled, field)?.scale?.type ?? 'a continuous'} scale.

} +
+ ); +} + +function CaseRow({ c }: { c: BinningCase }) { + const values = useMemo(() => c.values.map((row) => Number(row[c.color])).filter(Number.isFinite), [c]); + const inputs = useMemo(() => SETUPS.map((setup) => ({ setup, input: inputOf(c, setup) })), [c]); + return ( +
+

+ {c.label} + + data {fmt(Math.min(...values))} … {fmt(Math.max(...values))} + {c.pivot !== undefined ? ` · pivot ${c.pivot}, ${c.pivotRole === 'neutral' ? 'a neutral class' : 'a break'}` : ' · no pivot'} + +

+

{c.why}

+
+ {inputs.map(({ setup, input }) => ( + + ))} +
+
+ ); +} + +/** The ramp-balance finding grounding reports for each house that bins, read from a compiled chart. */ +function RampReports() { + const warm = CASES.find((c) => c.key === 'warm')!; + const rows = useMemo(() => SETUPS.filter((setup) => setup.theme).map((setup) => { + const report = ((assembleVegaLite(inputOf(warm, setup)) as Spec)._theme?.report ?? []) as { code: string; message: string }[]; + return { label: setup.label, message: report.find((entry) => entry.code === 'diverging-ramp-unbalanced')?.message }; + }), [warm]); + return ( +
    + {rows.map((row) =>
  • {row.label} — {row.message ?? 'balanced within 3 L*'}
  • )} +
+ ); +} + +/** The count each case steps into under each house, where it is not the house's five. */ +function CountDrift() { + const rows = useMemo(() => CASES.flatMap((c) => { + const values = c.values.map((row) => Number(row[c.color])).filter(Number.isFinite); + return SETUPS.filter((setup) => setup.theme).map((setup) => { + const stepped = steppedOf(assembleVegaLite(inputOf(c, setup)) as Spec, c.color, values); + return { key: `${c.key}-${setup.id}`, label: `${c.label}, ${setup.label}`, classes: stepped?.counts.length }; + }).filter((row) => row.classes !== undefined && row.classes !== 5); + }), []); + return

{rows.length ? rows.map((row) => `${row.label}: ${row.classes}`).join(' · ') : 'Every case steps into five.'}

; +} + +/** A grid of signed net values no round step closes into seven classes. */ +const NET: BinningCase = { + key: 'net', label: 'Net new users', values: ['A', 'B', 'C'].flatMap((game, g) => ['Jan', 'Feb', 'Mar'].map((month, p) => ({ game, month, net: (g - 1) * 1000 + p * 300 - 400 }))), + x: 'month', y: 'game', color: 'net', pivot: 0, pivotRole: 'break', + semantic: { game: 'Category', month: 'Category', net: 'Profit' }, title: 'Net new users', why: '', +}; + +export function BinningLab() { + const correlation = CASES.find((c) => c.key === 'correlation')!; + const corrValues = useMemo(() => correlation.values.map((row) => Number(row[correlation.color])), [correlation]); + const warm = CASES.find((c) => c.key === 'warm')!; + const warmValues = useMemo(() => warm.values.map((row) => Number(row[warm.color])), [warm]); + const netValues = useMemo(() => NET.values.map((row) => Number(row.net)), []); + const demos = useMemo(() => ({ + corrAuto: inputOf(correlation, { theme: 'swiss' }), + corrStated: inputOf(correlation, { theme: 'swiss' }, { semantic: { r: { semanticType: 'Correlation', divergingNeutral: 0.1 } } }), + netSeven: inputOf(NET, { bins: 7 }), + netFour: inputOf(NET, { bins: 4 }), + labelled: inputOf(warm, { theme: 'pop' }, { showTextLabels: true }), + }), [correlation, warm]); + return ( +
+
+

Binned colour scales

+

+ A stepped colour scale cuts a continuous field into a few classes: a house that bins its ramp + (consumption: 'quantize' — pop, swiss, cartoon, de-stijl) or an author's bins. + Flint cuts it at round values (roundColorClasses), the same in Vega-Lite and ECharts. +

+
+ +
+

How the classes are chosen

+
    +
  1. A round step. 1, 2, 2.5 or 5 of a power of ten, the one Talbot, Lin & Hanrahan's (2010) extended labeling scores best: how round the step is, how closely the classes cover the data, how near their count comes to the target.
  2. +
  3. The pivot. A diverging field's pivot is a break where its values merely cross a sign (Profit, PercentageChange, Temperature), so a small gain never reads as a small loss; it centres a neutral class a step wide where the type always has it (Correlation, Sentiment, a stated divergingMidpoint). The divergingNeutral annotation sets the band's half-width, or false for a break.
  4. +
  5. Each side its own classes. Every break is a multiple of the step from the pivot, and each side takes only the classes its data reaches — no symmetric domain, no empty dark classes. Neither side takes more than four where a coarser step holds it.
  6. +
  7. Colour per unit, the same both sides. The ramp steps out from its centre at one rate set by the longer side, so equal distances from the pivot read as equal colours and the shorter side keeps to its pale end. Each class takes the colour at its far edge, so the classes beside a break show their sign; a neutral class takes the centre.
  8. +
  9. The count. A house's five is a target. An author's bins is held exactly where a round step closes that many classes, else that many with the outer two open.
  10. +
  11. The key prints each break as it is, in the field's own format (a percentage, a currency), compacted (−40k) only where full labels would not fit.
  12. +
  13. Grounding reports a diverging ramp whose two arms differ by more than 3 L* at mirrored points (diverging-ramp-unbalanced).
  14. +
+

+ Under each chart: the breaks in the compiled scale, what the key prints (flagged where it is not the breaks), + the classes and where they close, how many cells fall in each class, and how the pivot sits. +

+
+ +
+

Every case, every setup

+ {CASES.map((c) => )} +
+ +
+

Known limits and alternatives

+ +
+

1. A neutral class a step wide can print two-digit breaks

+

+ A neutral class centred on the pivot puts its breaks half a step from it. With the step correlations take + (0.5), that is ±0.25 and ±0.75 — round, but two digits. A step of 1 would give ±0.5 and only three classes; + a step of 0.2 would give ±0.1, ±0.3 … and more classes a side than the cap allows. An author who knows the + band states it: divergingNeutral: 0.1. +

+

Alternatives: a default band per type (±0.1 for Correlation); let the neutral class be narrower than the other classes.

+
+ + +
+
+ +
+

2. The houses' diverging ramps are not balanced

+

+ Equal distances from the pivot read as equal only where the ramp's two arms are equally light at mirrored + points. The classes are placed for that, but every house that bins today has arms that differ — pop by + more than 20 L* — so one side's classes read heavier. Warm hues also read stronger than cool ones at the + same lightness. Grounding reports it; it does not correct it. +

+ +

Alternatives: rebalance the ramps in a perceptual space (OKLCH / CIELAB, matched L* per mirrored stop); let grounding correct a ramp past the tolerance rather than report it.

+
+ +
+

3. An author's count no round step closes is held with the outer classes open

+

+ bins: 7 over −1,400 … 1,200 has no round step that closes seven classes about 0, so the seven + come with the outer two open ("< −750", "≥ 500"), wider than the rest. bins: 4 closes at ±2,000. + The open edges are centred on the data's middle, not fitted to where the values fall, so a gappy field can + leave a class empty — here, and the unemployment case under bins: 5 above. +

+

Alternatives: treat an author's count as a target, as a house's is (round and closed, but not the count asked for); widen the round steps to 3 and 4 of a power of ten; place the open edges where they leave no class empty.

+
+ + +
+
+ +
+

4. A house's count drifts from five

+

+ Five is a target: the step that reads best can give fewer or more classes (up to seven, within the + four-a-side cap). The cases that step into other than five: +

+ +

Alternatives: hold a house to its count ±1; cap the total at the house's count rather than per side.

+
+ +
+

5. A heatmap's printed values keep their own ink rule

+

+ Values printed in the cells pick white or black by their distance from the pivot (past half the widest), + not by the class colour behind them, so a label can sit dark on a dark class or light on a pale one. +

+

Alternative: derive the label ink from the class colours (as the themes' ink scale on a ramp does).

+
+ +
+
+ +
+

6. A colour Vega-Lite aggregates is not stepped

+

+ The classes are found from the rows. Where the colour encoding still carries an aggregate for + Vega-Lite to compute (rather than Flint aggregating before it draws, as a heatmap does), the rows do not hold + the values drawn, and the scale stays an even quantize of the domain, with unround breaks. +

+

Alternative: aggregate the rows as Vega-Lite will before finding the classes.

+
+
+
+ ); +} diff --git a/site/src/playground/binning/binning-lab.css b/site/src/playground/binning/binning-lab.css new file mode 100644 index 00000000..7f4027ed --- /dev/null +++ b/site/src/playground/binning/binning-lab.css @@ -0,0 +1,26 @@ +.bl-page { display: flex; flex-direction: column; gap: 28px; padding-bottom: 60px; } +.bl-heading { width: min(100%, 1180px); } +.bl-heading h1 { margin: 0; } +.bl-page p { margin: 8px 0 0; color: #444; line-height: 1.55; max-width: 980px; } +.bl-page h2 { font-size: 20px; margin: 0 0 10px; } +.bl-small { font-size: 12px; color: #666; } +.bl-decision ol { margin: 6px 0 0; padding-left: 22px; max-width: 980px; color: #333; font-size: 14px; line-height: 1.6; } +.bl-decision li { margin-bottom: 4px; } + +.bl-case { margin-top: 18px; } +.bl-case h3, .bl-issues h3 { font-size: 16px; margin: 0 0 4px; } +.bl-case h3 span { font-weight: 400; font-size: 13px; color: #666; margin-left: 8px; } +.bl-case > p { margin: 0 0 10px; font-size: 13px; } +.bl-panels { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-top: 10px; } +.bl-panel { margin: 0; border: 1px solid #e5e5e5; border-radius: 6px; padding: 8px; background: #fff; max-width: 100%; overflow-x: auto; } +.bl-panel figcaption { display: flex; flex-direction: column; margin-bottom: 6px; } +.bl-panel figcaption b { font: 600 13px/1.4 system-ui, sans-serif; color: #222; } +.bl-panel figcaption span { font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: #666; } +.bl-metrics { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 8px 0 0; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: #333; } +.bl-metrics dt { color: #888; } +.bl-metrics dd { margin: 0; } + +.bl-issues article { margin-top: 22px; padding-top: 14px; border-top: 1px solid #eee; } +.bl-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #333; line-height: 1.6; } +.bl-bad { color: #b42318; font-weight: 600; } +.bl-warn { color: #a15c00; } diff --git a/site/src/playground/binning/cases.ts b/site/src/playground/binning/cases.ts new file mode 100644 index 00000000..0f92f41f --- /dev/null +++ b/site/src/playground/binning/cases.ts @@ -0,0 +1,127 @@ +/** + * Fields a stepped colour scale is asked to cut, of every shape the rules must hold for: lopsided + * either way about a pivot, balanced about one, fractional, skewed and one-signed. + */ + +type Row = Record; + +export interface BinningCase { + key: string; + label: string; + why: string; + /** The field's diverging midpoint, where it has one. */ + pivot?: number; + /** How the pivot sits among the classes, as the semantics decide it. */ + pivotRole?: 'break' | 'neutral'; + values: Row[]; + x: string; + y: string; + color: string; + semantic: Record; + title: string; + subtitle?: string; +} + +const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +const grid = (table: Record, columns: string[], row: string, column: string, value: string): Row[] => + Object.entries(table).flatMap(([name, series]) => series.map((v, i) => ({ [row]: name, [column]: columns[i], [value]: v }))); + +/** A seeded generator, so every visit draws the same data. */ +function seeded(seed: number): () => number { + let s = seed; + return () => (s = (s * 16807) % 2147483647) / 2147483647; +} + +const WARM: Record = { + Singapore: [26.5, 27.1, 27.6, 28, 28.3, 28.3, 27.9, 27.9, 27.6, 27.6, 27, 26.4], + Delhi: [14.2, 17.4, 22.9, 29, 32.8, 33.5, 31.1, 30, 29.5, 26.3, 20.7, 15.9], + Cairo: [14, 15.1, 17.6, 21.3, 24.8, 27.2, 27.7, 27.7, 26, 23.4, 19.3, 15.6], + Sydney: [23.5, 23.4, 22.1, 19.5, 16.6, 14.2, 13.4, 14.5, 17.2, 19.2, 20.8, 22.4], + Seattle: [5.3, 6.2, 7.9, 10.2, 13.5, 16.2, 19.2, 19.4, 16.6, 11.7, 7.7, 5.1], + Moscow: [-6.5, -6.7, -1, 6.7, 13.2, 17, 19.2, 17, 11.3, 5.6, -1.2, -5.2], +}; + +const COLD: Record = { + Yakutsk: [-38.6, -33.8, -20.1, -4.8, 7.5, 16.4, 19.5, 15.2, 6.1, -7.8, -27, -37.6], + Ulaanbaatar: [-21.6, -16.6, -7.4, 1.3, 8.7, 14.6, 16.9, 15.1, 8.2, -0.4, -11.2, -19.6], + Montreal: [-9.7, -7.7, -2, 6.4, 13.4, 18.6, 21.2, 20.1, 15.5, 8.5, 2.1, -5.4], + Anchorage: [-8.3, -6.5, -3.6, 2.6, 8.5, 12.7, 14.9, 14.1, 9.6, 1.8, -5.1, -7.6], + Oslo: [-4.3, -4, -0.2, 4.5, 10.8, 15.2, 16.4, 15.2, 10.8, 6.3, 0.7, -3.1], + Reykjavik: [-0.5, 0.4, 0.5, 2.9, 6.3, 9, 10.6, 10.3, 7.4, 4.4, 1.1, -0.2], +}; + +const QUARTERS = ['Q1 23', 'Q2 23', 'Q3 23', 'Q4 23', 'Q1 24', 'Q2 24', 'Q3 24', 'Q4 24']; +const REGIONS = ['North', 'South', 'East', 'West', 'Central', 'Online']; +const growth = (() => { + const r = seeded(11); + return Object.fromEntries(REGIONS.map((region, j) => [region, QUARTERS.map((_, i) => Number((-0.12 + 0.43 * r() ** 1.4 + (j === 5 ? 0.08 : 0) - (i < 2 ? 0.04 : 0)).toFixed(3)))])); +})(); + +const VARIABLES = ['Income', 'Education', 'Age', 'Commute', 'Rent', 'Savings', 'Debt', 'Hours']; +const correlations = (() => { + const r = seeded(5); + const m = VARIABLES.map(() => VARIABLES.map(() => 0)); + for (let i = 0; i < VARIABLES.length; i++) { + m[i][i] = 1; + for (let j = 0; j < i; j++) m[i][j] = m[j][i] = Number((-0.85 + 1.75 * r()).toFixed(2)); + } + return Object.fromEntries(VARIABLES.map((name, i) => [name, m[i]])); +})(); + +const STATES = ['California', 'Texas', 'Florida', 'New York', 'Ohio', 'Oregon']; +const sales = (() => { + const r = seeded(23); + return Object.fromEntries(STATES.map((state, j) => [state, MONTHS.map(() => Math.round(40 + (1310 - j * 150) * r() ** 2.2))])); +})(); + +const COUNTRIES = ['Spain', 'Greece', 'Italy', 'France', 'Germany', 'Poland', 'Czechia']; +const YEARS = ['2017', '2018', '2019', '2020', '2021', '2022', '2023']; +const unemployment = (() => { + const r = seeded(3); + const base = [9.2, 8.9, 7.1, 6.8, 3.4, 3.1, 2.4]; + return Object.fromEntries(COUNTRIES.map((country, j) => [country, YEARS.map((_, i) => Number((base[j] + (i === 3 ? 0.6 : 0) + (r() - 0.5) * 0.9 - i * 0.05).toFixed(1)))])); +})(); + +export const CASES: BinningCase[] = [ + { + key: 'warm', label: 'Warm cities', pivot: 0, pivotRole: 'break', + why: 'Lopsided about 0 °C (−6.7 … 33.5): one pale cold class, four warm. The chart that prompted this work, which read "−20, −7, 7, 20" with two cold classes empty.', + values: grid(WARM, MONTHS, 'City', 'Month', 'Temp (°C)'), x: 'Month', y: 'City', color: 'Temp (°C)', + semantic: { City: 'Category', Month: 'Month', 'Temp (°C)': { semanticType: 'Temperature', unit: '°C' } }, + title: 'Average monthly temperature', subtitle: '°C, climate normals, four cities', + }, + { + key: 'cold', label: 'Cold cities', pivot: 0, pivotRole: 'break', + why: 'Lopsided the other way (−38.6 … 21.2): the cold side takes more classes, the warm side its pale end.', + values: grid(COLD, MONTHS, 'City', 'Month', 'Temp (°C)'), x: 'Month', y: 'City', color: 'Temp (°C)', + semantic: { City: 'Category', Month: 'Month', 'Temp (°C)': { semanticType: 'Temperature', unit: '°C' } }, + title: 'Average monthly temperature', subtitle: '°C, climate normals, cold cities', + }, + { + key: 'growth', label: 'Growth, fractions', pivot: 0, pivotRole: 'break', + why: 'A percentage change stored as fractions: a round step in percent, a break at 0 so a small gain never reads as a small loss.', + values: grid(growth, QUARTERS, 'Region', 'Quarter', 'Growth'), x: 'Quarter', y: 'Region', color: 'Growth', + semantic: { Region: 'Category', Quarter: 'Category', Growth: { semanticType: 'PercentageChange', percentScale: 'fraction' } }, + title: 'Sales growth by region', subtitle: 'Year over year', + }, + { + key: 'correlation', label: 'Correlation matrix', pivot: 0, pivotRole: 'neutral', + why: 'Balanced about 0, a pivot the type always has: a neutral class centred on 0 reads "no relationship".', + values: grid(correlations, VARIABLES, 'Variable', 'With', 'r'), x: 'With', y: 'Variable', color: 'r', + semantic: { Variable: 'Category', With: 'Category', r: 'Correlation' }, + title: 'Correlation between household measures', + }, + { + key: 'sales', label: 'Sales, skewed', why: 'One-signed and skewed (40 … ~1,200): no pivot, steps counted from zero.', + values: grid(sales, MONTHS, 'State', 'Month', 'Sales ($K)'), x: 'Month', y: 'State', color: 'Sales ($K)', + semantic: { State: 'Category', Month: 'Month', 'Sales ($K)': 'Amount' }, + title: 'Monthly sales by state', + }, + { + key: 'unemployment', label: 'Unemployment, narrow', why: 'One-signed and narrow (~2 … 10 points): a step of 2.', + values: grid(unemployment, YEARS, 'Country', 'Year', 'Unemployment (%)'), x: 'Year', y: 'Country', color: 'Unemployment (%)', + semantic: { Country: 'Country', Year: 'Category', 'Unemployment (%)': { semanticType: 'Percentage', percentScale: 'percent' } }, + title: 'Unemployment rate', + }, +]; diff --git a/site/src/playground/canvas-squeeze/CanvasSqueeze.tsx b/site/src/playground/canvas-squeeze/CanvasSqueeze.tsx index 68b8cc14..0fe11d52 100644 --- a/site/src/playground/canvas-squeeze/CanvasSqueeze.tsx +++ b/site/src/playground/canvas-squeeze/CanvasSqueeze.tsx @@ -258,8 +258,8 @@ function measure(svg: SVGSVGElement, view: View, box: { width: number; height: n * How the host sizes the chart: every chart gets the same base size and an allowance to grow under * pressure, so its box is the base times the allowance. */ -interface Setup { id: string; base: { width: number; height: number }; stretch: number } -const SETUPS: Setup[] = [ +export interface Setup { id: string; base: { width: number; height: number }; stretch: number } +export const SETUPS: Setup[] = [ { id: '300x300x1.5', base: { width: 300, height: 300 }, stretch: 1.5 }, { id: '200x200x1.2', base: { width: 200, height: 200 }, stretch: 1.2 }, { id: '300x300x1', base: { width: 300, height: 300 }, stretch: 1 }, @@ -267,10 +267,10 @@ const SETUPS: Setup[] = [ // The Theme Lab's chart wall: a wide base in a narrow card. { id: '300x200x1.5', base: { width: 300, height: 200 }, stretch: 1.5 }, ]; -const setupLabel = (setup: Setup) => `${setup.base.width} × ${setup.base.height}, ×${setup.stretch}`; +export const setupLabel = (setup: Setup) => `${setup.base.width} × ${setup.base.height}, ×${setup.stretch}`; /** The box the chart has to fit, which it is measured against. */ -const boxOf = (setup: Setup) => ({ width: Math.round(setup.base.width * setup.stretch), height: Math.round(setup.base.height * setup.stretch) }); +export const boxOf = (setup: Setup) => ({ width: Math.round(setup.base.width * setup.stretch), height: Math.round(setup.base.height * setup.stretch) }); /** The chart as planned, or as the canvas fit lays it out (`options.canvasFit`). */ type Layout = 'off' | 'auto'; @@ -469,9 +469,9 @@ export function CanvasSqueeze() {

How it decides

  1. Put each problem down to its parts. Too wide: the keys beside the plot. Too tall: the keys stacked above or below, and the title only where it is most of what stands there. A title and a row of keys above a plot are the theme's design, allowed for: only a header much larger than that bends the shape.
  2. -
  3. The least edit a reader would notice, one at a time: keys in one row on their edge; names wrapped — a key's, or, where the chart area itself is too wide, the names down the y axis; the title a size down; one of several keys on an edge moved to another; every key to another edge; the title two sizes down. Never an edit that makes text already too small smaller still. Only the culprit's edits, each priced on one scale; of those that clear, the cheapest is kept, and how its result reads only tells edits alike apart. Two together only where none clears alone.
  4. +
  5. The least edit a reader would notice, one at a time: keys in one row on their edge; names wrapped — a key's, or, where the chart area itself is too wide, the names down the y axis; the title a size down; one of several keys on an edge moved to another; every key to another edge; the title two sizes down; names wrapped down the y axis a size or two smaller, where their two-line rows make the chart too tall. Never an edit that makes text already too small smaller still. Only the culprit's edits, each priced on one scale; of those that clear, the cheapest is kept, and how its result reads only tells edits alike apart. Two together only where none clears alone.
  6. Then the plot. Where the box cannot hold the chart legibly as it is, the plot comes down, keeping its shape. The fit never lays a chart out larger for the host to shrink: one that still overflows is drawn at its size, for the reader to scroll or the host to scale.
  7. -
  8. A chart drawn a little past its box (a warning) gets only the gentlest edits — keys in a row on their edge, or names wrapped — kept where they bring it at least 3 points nearer its box with nothing going wrong.
  9. +
  10. A chart drawn a little past its box (a warning) gets only the gentlest edits — keys in a row on their edge, names wrapped, or names wrapped down the y axis a size or two smaller — kept where they bring it at least 3 points nearer its box with nothing going wrong.
  11. Then the plot, once more. With the title and keys settled, the plot is laid out again, once, in the room the box leaves it at the scale it is shown: a continuous side grows into it, never past its stretch cap, the chart area staying within the looser range of its own shapes. Kept only where the text is no smaller, nothing new goes wrong, and the drawing reads better.
  12. The title spans the drawing. A headline and deck may run over keys beside the plot, not just over the plot and its labels.
diff --git a/site/src/playground/canvas-squeeze/cases.ts b/site/src/playground/canvas-squeeze/cases.ts index 43ee939a..2c26fc09 100644 --- a/site/src/playground/canvas-squeeze/cases.ts +++ b/site/src/playground/canvas-squeeze/cases.ts @@ -494,6 +494,17 @@ export const CASES: SqueezeCase[] = [ chartType: 'Pie Chart', encodings: { color: 'Country', size: 'Share' }, title: 'Shares of the aid budget', subtitle: 'Ten recipients, %', }), }, + { + id: 'ch-pie-callouts-economist', kind: 'squeezed', issue: 'keysTop', group: 'challenge', name: 'A pie with outside callouts, Economist', + note: 'Four slices, two of them thin, under the red tab: the names stay as callouts round the pie and the thin slices\u2019 stand outside it.', + expect: 'The red tab stays on the canvas\u2019s top edge over the headline, wherever the callouts push the pie\u2019s margins.', + theme: 'economist', + input: own([ + { Fuel: 'Natural gas', Share: 58 }, { Fuel: 'Coal', Share: 34 }, { Fuel: 'Nuclear and hydroelectric', Share: 5 }, { Fuel: 'Oil and other liquid fuels', Share: 3 }, + ], { Fuel: 'Category', Share: 'Percentage' }, { + chartType: 'Pie Chart', encodings: { color: 'Fuel', size: 'Share' }, title: 'Power generation by fuel', subtitle: 'Share of output, %', + }), + }, { id: 'ch-series-end', kind: 'healthy', issue: 'control', group: 'challenge', name: 'Lines named at their ends, NYT', note: 'Three regions, which NYT names at the ends of their lines instead of in a key.', diff --git a/site/src/playground/cartoon-lab-data.ts b/site/src/playground/cartoon-lab-data.ts deleted file mode 100644 index 77ab5174..00000000 --- a/site/src/playground/cartoon-lab-data.ts +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * Cartoon lab — hand-authored Vega-Lite mockups of a playful, colourful - * "cartoon" look, in the spirit of xkcd / modern flat illustration. - * - * These are NOT theme-pipeline output. They are manual reference specs for the - * shipped `cartoon` ThemeSpec preset. A first pipeline attempt (font + palette - * + rounded bars) felt flat, so this lab established the reusable levers the - * preset now owns AND a few it still intentionally does not: thick dark - * "sticker" outlines on rounded marks and dots, wobble-free but chunky strokes, - * emoji markers, and a warm paper canvas with a bright crayon palette. - * - * The design tokens the preset is checked against: - * - Type: a rounded comic face (Comic Sans / Comic Neue / Chalkboard). - * - Palette: bright crayon — sky, coral, sunflower, grass, grape, tangerine. - * - Furniture: warm cream paper, dashed soft grid, round-capped axes. - * - Marks: fat dark outlines + rounded corners (the "sticker" look), big - * dots with a white halo, thick round-cap lines. - * - Mood: friendly, approachable, one clear point per chart. - * - * Refs: xkcd.com · "Humor Sans" / xkcd Script · Comic Neue · modern flat-cartoon - * infographics (rounded bars, thick outlines, sticker shapes). - */ - -// The case shape is shared with the other style references. -import type { StyleReferenceCase } from './style-references'; - -const FONT = "'Comic Sans MS', 'Comic Neue', 'Chalkboard SE', 'Marker Felt', cursive"; -const PAPER = '#fffdf5'; -const INK = '#2e2b28'; -const OUTLINE = '#2e2b28'; - -/** Bright crayon set: sky, coral, sunflower, grass, grape, tangerine. */ -export const CARTOON_PALETTE = ['#3aa9ff', '#ff5d5d', '#ffc23c', '#4cc76a', '#9b6cff', '#ff8a3d']; - -/** Shared "system" so the type, grid and axes stay consistent across charts. */ -const cartoonConfig: any = { - background: PAPER, - font: FONT, - padding: { left: 18, top: 16, right: 18, bottom: 16 }, - title: { - anchor: 'start', - font: FONT, - fontSize: 19, - fontWeight: 'bold', - color: INK, - subtitleFont: FONT, - subtitleFontSize: 12.5, - subtitleColor: '#8a837a', - subtitlePadding: 6, - offset: 12, - }, - view: { stroke: null }, - axis: { - domain: true, - domainColor: INK, - domainWidth: 2.5, - domainCap: 'round', - grid: true, - gridColor: '#ece5d6', - gridDash: [3, 5], - gridWidth: 1.5, - ticks: false, - labelFont: FONT, - labelFontSize: 12, - labelColor: INK, - labelPadding: 7, - titleFont: FONT, - titleFontSize: 12.5, - titleFontWeight: 'bold', - titleColor: INK, - }, - legend: { - orient: 'top', - direction: 'horizontal', - titleFont: FONT, - titleColor: INK, - titleFontSize: 12, - titleFontWeight: 'bold', - labelFont: FONT, - labelFontSize: 12, - labelColor: INK, - symbolType: 'circle', - symbolSize: 130, - symbolStrokeColor: OUTLINE, - symbolStrokeWidth: 1.5, - offset: 8, - padding: 0, - }, -}; - -const W = 360; -const H = 300; - -export const CARTOON_CASES: StyleReferenceCase[] = [ - // ── 1. Sticker bars — rounded tops + fat dark outline = the cartoon tell. ── - { - id: 'cartoon-sticker-bars', - title: 'Sticker bars', - note: 'Rounded tops + a fat dark outline give bars a sticker / balloon feel. Bright fills, bold value labels.', - spec: { - width: W, - height: H, - background: PAPER, - title: { text: 'Favourite ice cream 🍦', subtitle: 'Votes in Ms. Rivera’s class' }, - data: { - values: [ - { flavour: 'Choc', votes: 12, c: '#8a5a2a' }, - { flavour: 'Vanilla', votes: 9, c: '#ffc23c' }, - { flavour: 'Strawberry', votes: 15, c: '#ff5d5d' }, - { flavour: 'Mint', votes: 7, c: '#4cc76a' }, - { flavour: 'Berry', votes: 11, c: '#9b6cff' }, - ], - }, - layer: [ - { - mark: { - type: 'bar', - cornerRadiusEnd: 14, - stroke: OUTLINE, - strokeWidth: 2.5, - }, - encoding: { - color: { field: 'c', type: 'nominal', scale: null, legend: null }, - }, - }, - { - mark: { type: 'text', dy: -10, font: FONT, fontSize: 14, fontWeight: 'bold', color: INK }, - encoding: { text: { field: 'votes', type: 'quantitative' } }, - }, - ], - encoding: { - x: { - field: 'flavour', - type: 'nominal', - sort: null, - axis: { labelAngle: 0, grid: false, title: null }, - scale: { paddingInner: 0.35, paddingOuter: 0.2 }, - }, - y: { - field: 'votes', - type: 'quantitative', - axis: { title: null, tickCount: 4, grid: true }, - scale: { domain: [0, 18] }, - }, - }, - config: cartoonConfig, - }, - }, - - // ── 2. Bouncy line — thick round-cap monotone line, big haloed dots. ── - { - id: 'cartoon-bouncy-line', - title: 'Bouncy line', - note: 'Fat round-capped smoothed line with big white-haloed dots — reads like a friendly path, not a data trace.', - spec: { - width: W, - height: H, - background: PAPER, - title: { text: 'My mood this week 😄', subtitle: 'How fun each day felt (0–10)' }, - data: { - values: [ - { day: 'Mon', mood: 4 }, - { day: 'Tue', mood: 6 }, - { day: 'Wed', mood: 3 }, - { day: 'Thu', mood: 7 }, - { day: 'Fri', mood: 9 }, - { day: 'Sat', mood: 10 }, - { day: 'Sun', mood: 8 }, - ], - }, - encoding: { - x: { field: 'day', type: 'nominal', sort: null, axis: { labelAngle: 0, grid: false, title: null } }, - y: { - field: 'mood', - type: 'quantitative', - axis: { title: null, tickCount: 5 }, - scale: { domain: [0, 11] }, - }, - }, - layer: [ - { - mark: { - type: 'line', - color: '#3aa9ff', - strokeWidth: 6, - strokeCap: 'round', - strokeJoin: 'round', - interpolate: 'monotone', - }, - }, - { - mark: { - type: 'point', - filled: true, - color: '#3aa9ff', - size: 260, - stroke: '#ffffff', - strokeWidth: 4, - }, - }, - { - mark: { - type: 'point', - filled: false, - stroke: OUTLINE, - strokeWidth: 2, - size: 260, - }, - }, - ], - config: cartoonConfig, - }, - }, - - // ── 3. Bubble buddies — outlined circles, size = the reading, playful. ── - { - id: 'cartoon-bubbles', - title: 'Bubble buddies', - note: 'Big outlined bubbles, size carries the value, white halo pops them off the paper. Colour just for fun.', - spec: { - width: W, - height: H, - background: PAPER, - title: { text: 'Pets in our street 🐾', subtitle: 'How many of each (bubble = count)' }, - data: { - values: [ - { pet: 'Dogs', x: 1, y: 3, n: 14, c: '#ff8a3d' }, - { pet: 'Cats', x: 2, y: 2, n: 11, c: '#9b6cff' }, - { pet: 'Fish', x: 3, y: 3.2, n: 20, c: '#3aa9ff' }, - { pet: 'Birds', x: 4, y: 1.8, n: 6, c: '#4cc76a' }, - { pet: 'Bunnies', x: 5, y: 2.6, n: 8, c: '#ff5d5d' }, - ], - }, - layer: [ - { - mark: { type: 'circle', stroke: OUTLINE, strokeWidth: 2.5, opacity: 1 }, - encoding: { - size: { - field: 'n', - type: 'quantitative', - scale: { range: [400, 4200] }, - legend: null, - }, - color: { field: 'c', type: 'nominal', scale: null, legend: null }, - }, - }, - { - mark: { type: 'text', font: FONT, fontSize: 12, fontWeight: 'bold', color: INK, dy: 0 }, - encoding: { text: { field: 'pet' } }, - }, - ], - encoding: { - x: { field: 'x', type: 'quantitative', axis: null, scale: { domain: [0.3, 5.7] } }, - y: { field: 'y', type: 'quantitative', axis: null, scale: { domain: [0.8, 4] } }, - }, - config: cartoonConfig, - }, - }, - - // ── 4. Gumball pie — bright wedges, fat white gaps, thick outline ring. ── - { - id: 'cartoon-gumball-pie', - title: 'Gumball pie', - note: 'Bright wedges cut apart by fat white gaps and wrapped in a dark outline — a gumball look, not a spreadsheet pie.', - spec: { - width: W, - height: H, - background: PAPER, - title: { text: 'Where my day goes ⏰', subtitle: 'Hours, roughly' }, - data: { - values: [ - { thing: 'Sleep', hrs: 9 }, - { thing: 'School', hrs: 6 }, - { thing: 'Play', hrs: 4 }, - { thing: 'Food', hrs: 2 }, - { thing: 'Screens', hrs: 3 }, - ], - }, - mark: { - type: 'arc', - stroke: OUTLINE, - strokeWidth: 2.5, - padAngle: 0.05, - cornerRadius: 6, - innerRadius: 0, - }, - encoding: { - theta: { field: 'hrs', type: 'quantitative', stack: true }, - color: { - field: 'thing', - type: 'nominal', - sort: null, - scale: { range: CARTOON_PALETTE }, - legend: { title: null }, - }, - order: { field: 'hrs', sort: 'descending' }, - }, - config: cartoonConfig, - }, - }, - - // ── 5. Emoji markers — the mark *is* the picture. A lever a theme lacks. ── - { - id: 'cartoon-emoji-lollipop', - title: 'Emoji lollipops', - note: 'Emoji markers on stems: the mark itself is the picture. This is a fun lever the current theme spec has no way to express.', - spec: { - width: W, - height: H, - background: PAPER, - title: { text: 'Snack scores 🍩', subtitle: 'Average yum rating (out of 10)' }, - data: { - values: [ - { snack: 'Donut', score: 9, emoji: '🍩' }, - { snack: 'Apple', score: 5, emoji: '🍎' }, - { snack: 'Pizza', score: 8, emoji: '🍕' }, - { snack: 'Grapes', score: 6, emoji: '🍇' }, - { snack: 'Cookie', score: 7, emoji: '🍪' }, - ], - }, - encoding: { - x: { field: 'snack', type: 'nominal', sort: null, axis: { labelAngle: 0, grid: false, title: null } }, - y: { - field: 'score', - type: 'quantitative', - axis: { title: null, tickCount: 5, grid: true }, - scale: { domain: [0, 10.5] }, - }, - }, - layer: [ - { - mark: { type: 'rule', color: '#c9c1b2', strokeWidth: 4, strokeCap: 'round' }, - encoding: { y2: { datum: 0 } }, - }, - { - mark: { type: 'text', fontSize: 30, baseline: 'middle' }, - encoding: { text: { field: 'emoji' } }, - }, - ], - config: cartoonConfig, - }, - }, - - // ── 6. Outlined stacked bars — rounded top, dark outline, white dividers. ── - { - id: 'cartoon-stacked', - title: 'Layer-cake stacks', - note: 'Stacks with a rounded outlined top and thick white dividers — the pieces read as sweets stacked in a jar.', - spec: { - width: W, - height: H, - background: PAPER, - title: { text: 'Marbles in each jar 🫙', subtitle: 'By colour' }, - data: { - values: (() => { - const rows: any[] = []; - const jars: Record> = { - 'Jar A': { Red: 6, Blue: 4, Yellow: 3 }, - 'Jar B': { Red: 3, Blue: 7, Yellow: 5 }, - 'Jar C': { Red: 5, Blue: 2, Yellow: 8 }, - 'Jar D': { Red: 2, Blue: 6, Yellow: 4 }, - }; - for (const [jar, byC] of Object.entries(jars)) - for (const [colour, n] of Object.entries(byC)) rows.push({ jar, colour, n }); - return rows; - })(), - }, - mark: { - type: 'bar', - stroke: '#ffffff', - strokeWidth: 2.5, - cornerRadius: 4, - }, - encoding: { - x: { field: 'jar', type: 'nominal', sort: null, axis: { labelAngle: 0, grid: false, title: null }, scale: { paddingInner: 0.4 } }, - y: { field: 'n', type: 'quantitative', stack: 'zero', axis: { title: null, tickCount: 4 } }, - color: { - field: 'colour', - type: 'nominal', - sort: null, - scale: { domain: ['Red', 'Blue', 'Yellow'], range: ['#ff5d5d', '#3aa9ff', '#ffc23c'] }, - legend: { title: null }, - }, - order: { field: 'colour' }, - }, - config: cartoonConfig, - }, - }, -]; diff --git a/site/src/playground/dense-marks.css b/site/src/playground/dense-marks.css index 3bd28ab7..82d16335 100644 --- a/site/src/playground/dense-marks.css +++ b/site/src/playground/dense-marks.css @@ -19,10 +19,3 @@ .dm-note { font-size: 11px; fill: #888; font-style: italic; } .dm-key { font-size: 10.5px; fill: #444; } -.dm-notes { width: min(100%, 1180px); } -.dm-notes h2 { font-size: 17px; margin: 0 0 6px; } -.dm-notes h3 { font-size: 14px; margin: 16px 0 6px; } -.dm-notes ol, .dm-notes ul { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.55; color: #333; max-width: 960px; } -.dm-notes li { margin-bottom: 6px; } -.dm-notes code { font-size: 12.5px; background: #f3f3f3; padding: 1px 4px; border-radius: 3px; } -.dm-note-text { font-size: 14px; line-height: 1.55; color: #444; max-width: 960px; } diff --git a/site/src/playground/fun/GreekStories.tsx b/site/src/playground/fun/GreekStories.tsx new file mode 100644 index 00000000..2e4d7599 --- /dev/null +++ b/site/src/playground/fun/GreekStories.tsx @@ -0,0 +1,63 @@ +import { useMemo, type ReactNode } from 'react'; +import { MapStoryStage, storySpecText, type MapStory, type StoryLook } from '../stories/MapStoryStage'; +import { ARGONAUTS } from '../stories/argonauts'; +import { OdysseyStory, useStoryLook } from './OdysseyMap'; +import { SpecDetails } from './SpecDetails'; +import './odyssey-map.css'; + +/** A story told on its own map, in the page's look: its stage, and its spec folded away under it. */ +function MapStorySection({ story, look }: { story: MapStory; look: StoryLook }) { + const text = useMemo(() => storySpecText(story, look), [story, look]); + return ( + <> + + + + ); +} + +const STORIES: { id: string; title: string; blurb: string; body: (look: StoryLook, own: boolean) => ReactNode }[] = [ + { + id: 'odyssey', title: 'The wanderings of Odysseus', + blurb: 'Ten years from Troy to Ithaca, the legs as wide as the crew that sailed them.', + body: (look) => , + }, + { + id: 'argonauts', title: ARGONAUTS.title, + blurb: 'Jason and the Argo, out to Colchis for the Golden Fleece and home the long way round.', + body: (look, own) => , + }, +]; + +/** + * The Greek stories, each told chapter by chapter on a map of its own: one page, in the order the + * poems tell them. Their maps share Natural Earth's finest coasts, cut to the Mediterranean. + */ +export function GreekStories() { + const { look, own, controls } = useStoryLook(); + const goTo = (id: string) => document.getElementById(`greek-${id}`)?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + return ( +
+
+

Greek myths on maps

+
+
+ + {controls} + {STORIES.map((story) => ( +
+
+

{story.title}

+

{story.blurb}

+
+ {story.body(look, own)} +
+ ))} +
+
+ ); +} diff --git a/site/src/playground/fun/OdysseyMap.tsx b/site/src/playground/fun/OdysseyMap.tsx new file mode 100644 index 00000000..35ff6e78 --- /dev/null +++ b/site/src/playground/fun/OdysseyMap.tsx @@ -0,0 +1,155 @@ +import { useMemo, useState } from 'react'; +import { DEFAULT_LOOK, OdysseyStoryStage, odysseyOpeningUpdates, odysseySpec, type OdysseyLook } from '../OdysseyStoryStage'; +import { specText } from '../stories/MapStoryStage'; +import './odyssey-map.css'; +import { SpecDetails } from './SpecDetails'; + +/** + * The look the Greek stories are drawn in, and the controls to try others: grounds, palettes, houses + * and how the routes are drawn. One look for every story on the page. + */ + +type Ground = 'calm' | 'atlas' | 'light' | 'muted' | 'dark' | 'minimal' | 'auto' | 'custom'; + +const GROUNDS: { value: Ground; label: string }[] = [ + { value: 'atlas', label: 'Atlas (the demo’s own)' }, + { value: 'calm', label: 'Calm (soft sea, pale land)' }, + { value: 'light', label: 'Light' }, + { value: 'muted', label: 'Muted' }, + { value: 'dark', label: 'Dark' }, + { value: 'minimal', label: 'Minimal' }, + { value: 'auto', label: 'From the theme' }, + { value: 'custom', label: 'Custom colours…' }, +]; + +const PALETTES: Record = { + story: { label: 'Each story’s own', inks: DEFAULT_LOOK.legInks }, + ember: { label: 'Embers (dark red → gold)', inks: ['#7a1f1f', '#b23a2a', '#d9622b', '#ec9a3a', '#f4c95d'] }, + sea: { label: 'Bronze to sea', inks: ['#8a3b12', '#b8641a', '#7d1f2b', '#4a3f7a', '#1d5c7a'] }, + viridis: { label: 'Viridis', inks: ['#440154', '#3b528b', '#21918c', '#5ec962', '#c2a91a'] }, + tableau: { label: 'Tableau', inks: ['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f'] }, + house: { label: 'The house’s own' }, +}; + +const THEMES = ['', 'nyt', 'economist', 'swiss', 'datawrapper', 'apple', 'bbc', 'powerbi']; +/** The houses whose page is dark: a ground left to them has dark water. */ +const DARK_THEMES = new Set(['powerbi']); + +const CURVES: OdysseyLook['curve'][] = ['auto', 'arc', 'great-circle', 'straight']; +const BORDER_WIDTHS = ['', '0', '0.5', '1', '1.5', '2']; + +/** The calm ground the demo first had: atlas with a softer sea and paler land. */ +const CALM: Record = { base: 'atlas', sea: '#d3e3ed', land: '#f7f6f2', coast: '#a9bdcb', border: '#dcd8cf' }; +const CUSTOM_KEYS = ['sea', 'land', 'coast', 'border'] as const; +type Custom = Record<(typeof CUSTOM_KEYS)[number], string>; + +function isDark(hex: string): boolean { + const n = parseInt(hex.replace('#', ''), 16); + const [r, g, b] = [(n >> 16) & 255, (n >> 8) & 255, n & 255]; + return 0.2126 * r + 0.7152 * g + 0.0722 * b < 110; +} + +/** The sea names read on the water the ground paints, or on the page where it paints none. */ +function seaLabelFor(ground: Ground, custom: Custom, theme: string): OdysseyLook['seaLabel'] { + const onWater = (water: string) => (isDark(water) ? { fill: '#b9c8d4', halo: water } : { fill: '#5f7d92', halo: water }); + if (ground === 'calm') return onWater(CALM.sea); + if (ground === 'atlas') return DEFAULT_LOOK.seaLabel; + if (ground === 'dark') return onWater('#1d2227'); + if (ground === 'custom') return onWater(custom.sea); + return DARK_THEMES.has(theme) ? onWater('#252423') : { fill: '#6f7f8c', halo: '#ffffff' }; +} + +/** The spec as JSON, a data row to a line, with the updates that open the story. */ +function odysseySpecText(look: OdysseyLook): string { + return specText({ ...odysseySpec(look), updates: odysseyOpeningUpdates(look) }); +} + +/** The look the page draws its stories in, and the controls that set it. `own` says the palette is each story's own. */ +export function useStoryLook(): { look: OdysseyLook; own: boolean; controls: JSX.Element } { + const [ground, setGround] = useState('atlas'); + const [custom, setCustom] = useState({ sea: CALM.sea, land: CALM.land, coast: CALM.coast, border: CALM.border }); + const [palette, setPalette] = useState('story'); + const [theme, setTheme] = useState(DEFAULT_LOOK.theme ?? ''); + const [curve, setCurve] = useState('auto'); + const [arrows, setArrows] = useState(true); + const [graticule, setGraticule] = useState(false); + const [borderWidth, setBorderWidth] = useState(String(DEFAULT_LOOK.borderWidth ?? '')); + + const look = useMemo(() => ({ + mapStyle: ground === 'calm' ? CALM : ground === 'custom' ? { base: 'atlas', ...custom } : ground, + ...(PALETTES[palette].inks ? { legInks: PALETTES[palette].inks } : {}), + ...(theme ? { theme } : {}), + curve, + arrows, + graticule, + ...(borderWidth !== '' ? { borderWidth: Number(borderWidth) } : {}), + seaLabel: seaLabelFor(ground, custom, theme), + }), [ground, custom, palette, theme, curve, arrows, graticule, borderWidth]); + + const controls = ( +
+ Map look, for every story +
+ + + + + +
+ + +
+ {ground === 'custom' && ( +
+ {CUSTOM_KEYS.map((key) => ( + + ))} +
+ )} +
+
+ ); + return { look, own: palette === 'story', controls }; +} + +/** The Odyssey's story in a look, and its spec. */ +export function OdysseyStory({ look }: { look: OdysseyLook }) { + const text = useMemo(() => odysseySpecText(look), [look]); + return ( + <> + + + + ); +} diff --git a/site/src/playground/fun/SpecDetails.tsx b/site/src/playground/fun/SpecDetails.tsx new file mode 100644 index 00000000..cf16780e --- /dev/null +++ b/site/src/playground/fun/SpecDetails.tsx @@ -0,0 +1,24 @@ +import { useState } from 'react'; + +/** A chart's spec, folded away under its summary until asked for, with a button to copy it. */ +export function SpecDetails({ text, summary = 'Chart spec, opening on the first chapter (its notes and overlays in `updates`)' }: { text: string; summary?: string }) { + const [copied, setCopied] = useState(false); + const copy = (event: React.MouseEvent) => { + // The button sits in the summary: copying does not fold or unfold the spec. + event.preventDefault(); + event.stopPropagation(); + void navigator.clipboard.writeText(text).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 1200); + }); + }; + return ( +
+ + {summary} + + +
{text}
+
+ ); +} diff --git a/site/src/playground/fun/odyssey-map.css b/site/src/playground/fun/odyssey-map.css new file mode 100644 index 00000000..a6ea24d6 --- /dev/null +++ b/site/src/playground/fun/odyssey-map.css @@ -0,0 +1,214 @@ +.odyssey-lab { + width: min(100%, 1000px); + display: flex; + flex-direction: column; + gap: 16px; +} + +.odyssey-lab-controls { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); + gap: 10px 16px; + padding: 14px 16px; + border: 1px solid #e3e6ea; + border-radius: 10px; + background: #fafbfc; + font-size: 13px; +} + +.odyssey-lab-field { + display: flex; + flex-direction: column; + gap: 4px; + color: #4a5560; +} + +.odyssey-lab-field > span { + font-weight: 600; + font-size: 12px; + letter-spacing: 0.02em; +} + +.odyssey-lab-field select { + font: inherit; + padding: 4px 6px; + border: 1px solid #cfd5db; + border-radius: 6px; + background: #fff; +} + +.odyssey-lab-toggles { + display: flex; + gap: 14px; + align-items: flex-end; + padding-bottom: 4px; + color: #4a5560; +} + +.odyssey-lab-toggles label { + display: flex; + gap: 5px; + align-items: center; +} + +.odyssey-lab-swatches { + grid-column: 1 / -1; + display: flex; + flex-wrap: wrap; + gap: 14px; + align-items: center; + color: #4a5560; +} + +.odyssey-lab-swatches label { + display: flex; + gap: 6px; + align-items: center; +} + +.odyssey-lab-swatches input[type='color'] { + width: 28px; + height: 22px; + padding: 0; + border: 1px solid #cfd5db; + border-radius: 4px; + background: none; +} + +.odyssey-lab-palette { + display: flex; + gap: 2px; + height: 6px; + margin-top: 2px; +} + +.odyssey-lab-palette i { + flex: 1; + border-radius: 2px; +} + +.odyssey-lab-spec { + border: 1px solid #e3e6ea; + border-radius: 10px; + overflow: hidden; +} + +.odyssey-lab-spec header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 8px 14px; + background: #f3f5f7; + font-size: 13px; + font-weight: 600; + color: #3c4650; +} + +.odyssey-lab-spec header button { + font: inherit; + font-weight: 500; + padding: 3px 10px; + border: 1px solid #cfd5db; + border-radius: 6px; + background: #fff; + cursor: pointer; +} + +.odyssey-lab-spec pre { + margin: 0; + padding: 12px 14px; + max-height: 520px; + overflow: auto; + font-size: 12px; + line-height: 1.5; + background: #fff; +} + +/* A spec or a set of controls folded away under a summary bar. */ +.story-spec summary, +.story-looks summary { + display: flex; + justify-content: space-between; + align-items: center; + gap: 12px; + padding: 8px 14px; + background: #f3f5f7; + font-size: 13px; + font-weight: 600; + color: #3c4650; + cursor: pointer; + list-style: none; +} + +.story-spec summary::-webkit-details-marker, +.story-looks summary::-webkit-details-marker { + display: none; +} + +.story-spec summary span::before, +.story-looks summary span::before { + content: '▸'; + display: inline-block; + width: 14px; + color: #8a949b; + transition: transform 120ms ease; +} + +.story-spec[open] summary span::before, +.story-looks[open] summary span::before { + transform: rotate(90deg); +} + +.story-spec summary button { + font: inherit; + font-weight: 500; + padding: 3px 10px; + border: 1px solid #cfd5db; + border-radius: 6px; + background: #fff; + cursor: pointer; +} + +.story-looks { + border: 1px solid #e3e6ea; + border-radius: 10px; + overflow: hidden; +} + +.story-looks .odyssey-lab-controls { + border: 0; + border-radius: 0; +} + +/* The page of stories: a contents line, then each story in a section of its own. */ +.greek-stories { + width: min(100%, 1000px); + display: flex; + flex-direction: column; + gap: 44px; +} + +.greek-contents { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.greek-story { + display: flex; + flex-direction: column; + gap: 14px; + scroll-margin-top: 72px; +} + +.greek-story > header h2 { + margin: 0; + font-size: 22px; +} + +.greek-story > header p { + margin: 4px 0 0; + color: #5d6871; + font-size: 14px; + line-height: 1.5; +} diff --git a/site/src/playground/interactive-data-report-model.ts b/site/src/playground/interactive-data-report-model.ts index 3aa69038..2d3ec485 100644 --- a/site/src/playground/interactive-data-report-model.ts +++ b/site/src/playground/interactive-data-report-model.ts @@ -72,7 +72,7 @@ export interface ChatMessage { } /** The update op an interaction preset produces, and the kind of op a sentence carries. */ -export type PresetOp = 'set-style' | 'set-viewport' | 'set-order' | 'set-annotation'; +export type PresetOp = 'set-style' | 'set-viewport' | 'set-order' | 'annotate-text'; export interface Preset { op: PresetOp; @@ -99,7 +99,7 @@ export const OPS: Record = { 'set-style': { title: 'Emphasis', description: 'Emphasizes the rows it names and mutes the rest.' }, 'set-viewport': { title: 'Viewport', description: 'Sets the visible domain on x, y, or both.' }, 'set-order': { title: 'Order', description: 'Sets the category order along an axis.' }, - 'set-annotation': { title: 'Annotation', description: 'Attaches a note to one data key.' }, + 'annotate-text': { title: 'Annotation', description: 'Attaches a note to one data key.' }, }; /** CSS hook for an op: `idr-op-style`, `idr-op-viewport`, and so on. */ @@ -123,12 +123,15 @@ const EMPHASIS = { state: 'emphasized', mutedOpacity: 0.25 } as const; /** Emphasizes the rows the selectors name and mutes the rest. */ export const emphasis = (...match: Selector[]): ChartUpdateOp => ({ op: 'set-style', targets: match.map((key) => ({ select: { key } })), value: EMPHASIS }); -/** Attaches a note to one data key. The key must resolve to exactly one element. */ -export const note = (match: Selector, text: string): ChartUpdateOp => - ({ op: 'set-annotation', target: { select: { key: match } }, value: { text } }); -/** A note anchored to the point mark of the key, where a line chart draws its points. */ +/** + * Attaches a note to one data key. The key must resolve to exactly one element. `highlight` says how + * the note marks it: `'exclusive'` also recedes the rest, as an emphasis does. + */ +export const note = (match: Selector, text: string, highlight?: 'light' | 'exclusive'): ChartUpdateOp => + ({ op: 'annotate-text', target: { select: { key: match } }, value: { text, ...(highlight ? { highlight } : {}) } }); +/** A note anchored to the point of the key, where a line chart draws its points. */ export const pointNote = (match: Selector, text: string): ChartUpdateOp => - ({ op: 'set-annotation', target: { select: { key: match } }, value: { text, subject: { kind: 'mark' } } }); + ({ op: 'annotate-text', target: { select: { key: match } }, value: { text, anchor: 'point' } }); /** Sets the visible domain on x, y, or both. */ export const view = (range: { x?: Domain; y?: Domain }): ChartUpdateOp => ({ op: 'set-viewport', @@ -218,7 +221,7 @@ export function presetCatalog(fixture: InteractionDemoFixture): PresetOption[] { } if (reorder) options.push({ id: 'reorder', op: 'set-order', label: 'Drag reorder', icon: GripVertical, make: () => dragReorder({ id: 'reorder' }) }); if (group) options.push({ id: 'legend', op: 'set-style', label: 'Legend toggle', icon: EyeOff, make: () => legendToggle({ id: 'legend' }) }); - options.push({ id: 'annotate', op: 'set-annotation', label: 'Annotate', icon: MessageSquareText, make: () => clickAnnotate({ id: 'annotate' }) }); + options.push({ id: 'annotate', op: 'annotate-text', label: 'Annotate', icon: MessageSquareText, make: () => clickAnnotate({ id: 'annotate' }) }); return options; } @@ -243,7 +246,7 @@ export const presetOf = (option: PresetOption): Preset => preset(option.op, opti export function sentenceOps(item: Sentence): PresetOp[] { const kinds: PresetOp[] = []; for (const { op } of item.ops) { - const kind: PresetOp = op === 'set-viewport' || op === 'set-order' || op === 'set-annotation' ? op : 'set-style'; + const kind: PresetOp = op === 'set-viewport' || op === 'set-order' || op === 'annotate-text' ? op : 'set-style'; if (!kinds.includes(kind)) kinds.push(kind); } return kinds.length > 0 ? kinds : ['set-style']; @@ -400,7 +403,7 @@ export function sentenceRows(item: Sentence, chart: ChartRows): RowSet { const rows: Row[] = []; for (const op of item.ops) { if (op.op === 'set-style') for (const target of op.targets) rows.push(...targetRows(target, chart)); - else if (op.op === 'set-annotation') rows.push(...targetRows(op.target, chart)); + else if (op.op === 'annotate-text') rows.push(...targetRows(op.target, chart)); else if (op.op === 'set-viewport') rows.push(...rowsInView(chart, { x: toDomain(op.value.x), y: toDomain(op.value.y) })); } return new Set(rows.map(rowId)); @@ -672,8 +675,8 @@ function selectorsFor(update: AgentUpdate, chart: AgentChart, fields: readonly s /** * The sentence for one part of an answer. Each update becomes the op the report would - * write itself: a highlight is an emphasis, an annotate is a note (with an emphasis on its - * key when no highlight accompanies it), a viewport is a view. Null when no update names + * write itself: a highlight is an emphasis, an annotate is a note (which marks its own mark, + * and recedes the rest when no highlight accompanies it), a viewport is a view. Null when no update names * anything the chart shows. */ export function toSentence(id: string, text: string, updates: readonly AgentUpdate[], chart: AgentChart): Sentence | null { @@ -688,8 +691,8 @@ export function toSentence(id: string, text: string, updates: readonly AgentUpda case 'annotate': { const [selector] = selectorsFor(update, chart, chart.annotationFields); if (!selector) break; - ops.push(note(selector, String(update.text ?? '').slice(0, 80) || text.trim().slice(0, 40))); - if (!updates.some((other) => other.op === 'highlight')) ops.push(emphasis(selector)); + const alone = !updates.some((other) => other.op === 'highlight'); + ops.push(note(selector, String(update.text ?? '').slice(0, 80) || text.trim().slice(0, 40), alone ? 'exclusive' : 'light')); break; } case 'viewport': { diff --git a/site/src/playground/interactive-data-report-ui.tsx b/site/src/playground/interactive-data-report-ui.tsx index f127f284..b8c73fcd 100644 --- a/site/src/playground/interactive-data-report-ui.tsx +++ b/site/src/playground/interactive-data-report-ui.tsx @@ -371,7 +371,7 @@ export function ReportSentence({ sentence: item, report, sectionId, action }: Re } function sentenceOpsTitle(item: Sentence): string { - return [...new Set(item.ops.map((op) => OPS[op.op === 'set-viewport' || op.op === 'set-order' || op.op === 'set-annotation' ? op.op : 'set-style'].title))].join(' + '); + return [...new Set(item.ops.map((op) => OPS[op.op === 'set-viewport' || op.op === 'set-order' || op.op === 'annotate-text' ? op.op : 'set-style'].title))].join(' + '); } interface ReportParagraphProps { diff --git a/site/src/playground/label-angles/LabelAngles.tsx b/site/src/playground/label-angles/LabelAngles.tsx deleted file mode 100644 index 1832ffee..00000000 --- a/site/src/playground/label-angles/LabelAngles.tsx +++ /dev/null @@ -1,143 +0,0 @@ -/** - * Axis label overflow: what category names along x do when they do not stand flat and whole. Two - * paths — a row of names, and a sequence that explains itself — each shown step by step with live - * charts compiled by the current Flint. Trimming is an add-on to every step. - */ -import { useMemo, type CSSProperties, type ReactNode } from 'react'; -import { assembleVegaLite, type ChartAssemblyInput } from 'flint-chart'; -import { ScaleToFit } from '../../components/ScaleToFit'; -import { VegaLiteView } from '../../components/VegaLiteView'; -import { siteTheme } from '../../shared/theme'; -import { PREVIEW_CASES } from '../../shared/preview-cases'; - -const card: CSSProperties = { background: siteTheme.surface, border: `1px solid ${siteTheme.border}`, borderRadius: siteTheme.radius, padding: 12 }; -const code = (text: string) => {text}; - -/** A plain house: only its label settings vary. */ -const house = (labels?: Record) => ({ - id: 'label-probe', label: 'Label probe', - ink: { surface: { canvas: '#ffffff' }, series: { single: '#1f4e79', categorical: ['#1f4e79', '#e07b39', '#4a9bd4', '#7a8b99'] } }, - type: { axisLabel: { size: 14 }, axisTitle: { size: 14 } }, - ...(labels ? { labels } : {}), -}) as any; - -const bars = (field: string, type: string, names: string[], title: string, width = 320, chartProperties?: Record, height = 200) => ({ - data: { values: names.map((name, i) => ({ [field]: name, Value: ((i * 7) % 11) + 3 })) }, - semantic_types: { [field]: type, Value: 'Quantity' }, - chart_spec: { chartType: 'Bar Chart', encodings: { x: field, y: 'Value' }, title, baseSize: { width, height }, ...(chartProperties ? { chartProperties } : {}) }, -}) as any; -const fromCase = (id: string, width = 320) => { - const c = PREVIEW_CASES.find((x) => x.id === id)!; - return { data: { values: c.data }, semantic_types: c.semantic_types, chart_spec: { chartType: c.chartType, encodings: c.encodings, title: c.title, baseSize: { width, height: 200 } } } as any; -}; - -const LONG = ['Democratic Republic of the Congo', 'Bosnia and Herzegovina', 'Central African Republic', 'Trinidad and Tobago', 'Papua New Guinea', 'Saint Vincent and the Grenadines']; -const MINUTES = Array.from({ length: 36 }, (_, i) => `${16 + Math.floor((40 + i) / 60)}:${String((40 + i) % 60).padStart(2, '0')}`); -const QUARTERS = Array.from({ length: 8 }, (_, i) => `${2023 + Math.floor(i / 4)} Q${(i % 4) + 1}`); -const DECADES = Array.from({ length: 15 }, (_, i) => `${1880 + i * 10}s cohort of arrivals from overseas territories`); -const plants = (n: number) => Array.from({ length: n }, (_, i) => `Plant-${['North', 'South', 'East', 'West'][i % 4]}${String(i + 1).padStart(2, '0')}`); - -interface Example { step: string; note: ReactNode; input: Omit; labels?: Record } -interface Path { id: string; title: string; who: ReactNode; steps: string[]; examples: Example[] } - -const PATHS: Path[] = [ - { - id: 'names', - title: 'A row of names', - who: 'Countries, products, categories, ordered words (Likert levels, stages). Every name is always printed: names are never left out.', - steps: ['wrap', 'rotate45 (if the theme permits)', 'rotate90'], - examples: [ - { step: 'wrap', note: 'Two lines, broken at a space.', input: fromCase('medals-grouped') }, - { step: 'wrap + trim', note: 'Two lines, each trimmed to the band.', input: bars('Country', 'Country', LONG, 'Population, millions') }, - { step: 'rotate45', note: <>Where the theme permits it: {code('overflow: ["wrap", "rotate45", "rotate90"]')}., input: bars('Site', 'Category', plants(12), 'Output by plant', 320, undefined, 300), labels: { overflow: ['wrap', 'rotate45', 'rotate90'] } }, - { step: 'rotate90', note: 'Upright, whole.', input: bars('Site', 'Category', plants(40), 'Output by plant', 320, undefined, 300) }, - { step: 'rotate90 + trim', note: 'Upright, trimmed at the turned limit (40% of the plot’s height).', input: bars('Country', 'Country', LONG.flatMap((name) => [name, `${name} (overseas territories)`]), 'Population, millions', 320) }, - ], - }, - { - id: 'sequence', - title: 'A sequence that explains itself', - who: 'Times, dates, months, quarters, years, decades, ranks — by semantic type. A name left out reads from its neighbours (16:40 … 16:50 holds 16:45), so the sequence thins to round values before it turns.', - steps: ['wrap', 'skip', 'rotate45 (if the theme permits)', 'rotate90'], - examples: [ - { step: 'wrap', note: 'Two lines, broken at a space.', input: bars('Quarter', 'YearQuarter', QUARTERS, 'Revenue by quarter', 260) }, - { step: 'skip', note: 'Only the round values, flat and full size; every band keeps its tick.', input: bars('Time', 'Time', MINUTES, 'Throttled invocations by minute') }, - { step: 'skip + trim', note: 'Round values trimmed to the room between them.', input: bars('Decade', 'Decade', DECADES, 'Arrivals by decade', 140) }, - { step: 'rotate90', note: <>Where the chart asks for every label: {code('labelOverflow: ["wrap", "rotate90"]')}., input: bars('Time', 'Time', MINUTES, 'Throttled invocations by minute', 320, { labelOverflow: ['wrap', 'rotate90'] }) }, - ], - }, -]; - -function compiled(example: Example) { - try { - const spec: any = assembleVegaLite({ ...structuredClone(example.input), theme_spec: house(example.labels) } as ChartAssemblyInput); - const report = (spec._theme?.report ?? []).find((r: any) => r.code === 'labels-overflow'); - return { spec, step: report?.message.match(/step `([^`]+)`/)?.[1] ?? 'fits' }; - } catch (error) { - return { error: String(error) }; - } -} - -function ExampleCard({ example }: { example: Example }) { - const result = useMemo(() => compiled(example), [example]); - const matches = 'step' in result && result.step === example.step; - return ( -
-
- {example.step} - {'step' in result && !matches && took {result.step}} -
-
{example.note}
- {'error' in result ?
{result.error}
: ( -
- - - -
- )} -
- ); -} - -function PathChips({ steps }: { steps: string[] }) { - return ( -
- {steps.map((step, i) => ( - - {i > 0 && →} - {step} - - ))} - · each step whole, or + trim -
- ); -} - -export function LabelAngles() { - return ( -
-

Axis label overflow

-

- Category names along x that fit their band are always flat — no theme forces a turn. Names that do not fit take - one of two paths. Trimming is an add-on to every step (a theme’s {code('truncation: "never"')} forbids - it; identifiers are never trimmed). The path’s order binds; within it each step is weighed whole and trimmed, at - every size down to the theme’s floor, and the cheapest is taken — so a slightly smaller name beats a turned one. -

-

- A theme states another path in {code('labels.overflow')}, its thresholds in {code('labels.fit')}; a chart in - {' '}{code('chartProperties.labelOverflow')}. Names down y never turn: they wrap or are trimmed. Continuous rulers - (dates and numbers on a scale) never turn: their ticks thin. -

- {PATHS.map((path) => ( -
-

{path.title}

-
{path.who}
- -
- {path.examples.map((example) => )} -
-
- ))} -
- ); -} diff --git a/site/src/playground/label-experiment-lab.css b/site/src/playground/label-experiment-lab.css deleted file mode 100644 index c89cd6c3..00000000 --- a/site/src/playground/label-experiment-lab.css +++ /dev/null @@ -1,134 +0,0 @@ -.label-lab { - max-width: 960px; - margin: 0 auto; - padding: 10px 4px 56px; - color: #16202a; -} - -.label-lab-intro { - margin-bottom: 18px; -} - -.label-lab-intro h1 { - margin: 0 0 5px; - font-size: 20px; - font-weight: 650; - letter-spacing: 0; -} - -.label-lab-intro p { - max-width: 820px; - margin: 0; - color: #5d6872; - font-size: 13px; - line-height: 1.55; -} - -.label-case-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 16px; -} - -.label-case { - display: grid; - grid-template-rows: auto 300px auto; - min-width: 0; - border-top: 1px solid #d8dde2; - background: #fff; -} - -.label-case-header { - display: flex; - justify-content: space-between; - gap: 20px; - align-items: flex-start; - padding: 12px 0 10px; -} - -.label-case-header h2 { - margin: 0; - font-size: 15px; - line-height: 1.25; - letter-spacing: 0; -} - -.label-case-header p { - max-width: 520px; - margin: 5px 0 0; - color: #6a747d; - font-size: 12px; - line-height: 1.4; -} - -.label-outcome { - flex: 0 0 auto; - padding-top: 2px; - color: #737d86; - font-family: ui-monospace, SFMono-Regular, Menlo, monospace; - font-size: 10px; - text-transform: uppercase; -} - -.label-chart-frame { - position: relative; - min-width: 0; - overflow: hidden; - border-top: 1px solid #edf0f2; - border-bottom: 1px solid #edf0f2; - background: #fff; -} - -.label-error { - display: grid; - height: 100%; - place-items: center; - color: #a52c24; - font-family: ui-monospace, SFMono-Regular, Menlo, monospace; - font-size: 12px; -} - -.label-case-footer { - display: flex; - justify-content: space-between; - gap: 10px; - padding: 8px 0 12px; -} - -.label-case-footer > span { - font-size: 10px; - font-weight: 700; - text-transform: uppercase; - white-space: nowrap; -} - -.label-mismatch { color: #a52c24; } - -.label-case-footer code { - min-width: 0; - color: #5d6872; - font-size: 10px; - line-height: 1.45; - white-space: normal; - overflow-wrap: anywhere; -} - -@media (max-width: 980px) { - .label-lab { - padding: 10px 0 40px; - } - - .label-case-grid { - grid-template-columns: 1fr; - } -} - -@media (max-width: 560px) { - .label-case { - grid-template-rows: auto 300px auto; - } - - .label-case-footer { - grid-template-columns: 1fr; - } -} diff --git a/site/src/playground/muted-annotations/cases.json b/site/src/playground/muted-annotations/cases.json new file mode 100644 index 00000000..dfabe079 --- /dev/null +++ b/site/src/playground/muted-annotations/cases.json @@ -0,0 +1 @@ +{"tables":{"3dac8dcbd7":[{"date":"1990-08-20","price":1.191},{"date":"1990-08-27","price":1.245},{"date":"1990-09-03","price":1.242},{"date":"1990-09-10","price":1.252},{"date":"1990-09-17","price":1.266},{"date":"1990-09-24","price":1.272},{"date":"1990-10-01","price":1.321},{"date":"1990-10-08","price":1.333},{"date":"1990-10-15","price":1.339},{"date":"1990-10-22","price":1.345},{"date":"1990-10-29","price":1.339},{"date":"1990-11-05","price":1.334},{"date":"1990-11-12","price":1.328},{"date":"1990-11-19","price":1.323},{"date":"1990-11-26","price":1.311},{"date":"1990-12-03","price":1.341},{"date":"1991-01-21","price":1.192},{"date":"1991-01-28","price":1.168},{"date":"1991-02-04","price":1.139},{"date":"1991-02-11","price":1.106},{"date":"1991-02-18","price":1.078},{"date":"1991-02-25","price":1.054},{"date":"1991-03-04","price":1.025},{"date":"1991-03-11","price":1.045},{"date":"1991-03-18","price":1.043},{"date":"1991-03-25","price":1.047},{"date":"1991-04-01","price":1.052},{"date":"1991-04-08","price":1.066},{"date":"1991-04-15","price":1.069},{"date":"1991-04-22","price":1.09},{"date":"1991-04-29","price":1.104},{"date":"1991-05-06","price":1.113},{"date":"1991-05-13","price":1.121},{"date":"1991-05-20","price":1.129},{"date":"1991-05-27","price":1.14},{"date":"1991-06-03","price":1.138},{"date":"1991-06-10","price":1.135},{"date":"1991-06-17","price":1.126},{"date":"1991-06-24","price":1.114},{"date":"1991-07-01","price":1.104},{"date":"1991-07-08","price":1.098},{"date":"1991-07-15","price":1.094},{"date":"1991-07-22","price":1.091},{"date":"1991-07-29","price":1.091},{"date":"1991-08-05","price":1.099},{"date":"1991-08-12","price":1.112},{"date":"1991-08-19","price":1.124},{"date":"1991-08-26","price":1.124},{"date":"1991-09-02","price":1.127},{"date":"1991-09-09","price":1.12},{"date":"1991-09-16","price":1.11},{"date":"1991-09-23","price":1.097},{"date":"1991-09-30","price":1.092},{"date":"1991-10-07","price":1.089},{"date":"1991-10-14","price":1.084},{"date":"1991-10-21","price":1.088},{"date":"1991-10-28","price":1.091},{"date":"1991-11-04","price":1.091},{"date":"1991-11-11","price":1.102},{"date":"1991-11-18","price":1.104},{"date":"1991-11-25","price":1.099},{"date":"1991-12-02","price":1.099},{"date":"1991-12-09","price":1.091},{"date":"1991-12-16","price":1.075},{"date":"1991-12-23","price":1.063},{"date":"1991-12-30","price":1.053},{"date":"1992-01-06","price":1.042},{"date":"1992-01-13","price":1.026},{"date":"1992-01-20","price":1.014},{"date":"1992-01-27","price":1.006},{"date":"1992-02-03","price":0.995},{"date":"1992-02-10","price":1.004},{"date":"1992-02-17","price":1.011},{"date":"1992-02-24","price":1.014},{"date":"1992-03-02","price":1.012},{"date":"1992-03-09","price":1.013},{"date":"1992-03-16","price":1.01},{"date":"1992-03-23","price":1.015},{"date":"1992-03-30","price":1.013},{"date":"1992-04-06","price":1.026},{"date":"1992-04-13","price":1.051},{"date":"1992-04-20","price":1.058},{"date":"1992-04-27","price":1.072},{"date":"1992-05-04","price":1.089},{"date":"1992-05-11","price":1.102},{"date":"1992-05-18","price":1.118},{"date":"1992-05-25","price":1.12},{"date":"1992-06-01","price":1.128},{"date":"1992-06-08","price":1.143},{"date":"1992-06-15","price":1.151},{"date":"1992-06-22","price":1.153},{"date":"1992-06-29","price":1.149},{"date":"1992-07-06","price":1.147},{"date":"1992-07-13","price":1.139},{"date":"1992-07-20","price":1.132},{"date":"1992-07-27","price":1.128},{"date":"1992-08-03","price":1.126},{"date":"1992-08-10","price":1.123},{"date":"1992-08-17","price":1.116},{"date":"1992-08-24","price":1.123},{"date":"1992-08-31","price":1.121},{"date":"1992-09-07","price":1.121},{"date":"1992-09-14","price":1.124},{"date":"1992-09-21","price":1.123},{"date":"1992-09-28","price":1.118},{"date":"1992-10-05","price":1.115},{"date":"1992-10-12","price":1.115},{"date":"1992-10-19","price":1.113},{"date":"1992-10-26","price":1.113},{"date":"1992-11-02","price":1.12},{"date":"1992-11-09","price":1.12},{"date":"1992-11-16","price":1.112},{"date":"1992-11-23","price":1.106},{"date":"1992-11-30","price":1.098},{"date":"1992-12-07","price":1.089},{"date":"1992-12-14","price":1.078},{"date":"1992-12-21","price":1.074},{"date":"1992-12-28","price":1.069},{"date":"1993-01-04","price":1.065},{"date":"1993-01-11","price":1.066},{"date":"1993-01-18","price":1.061},{"date":"1993-01-25","price":1.055},{"date":"1993-02-01","price":1.055},{"date":"1993-02-08","price":1.062},{"date":"1993-02-15","price":1.053},{"date":"1993-02-22","price":1.047},{"date":"1993-03-01","price":1.042},{"date":"1993-03-08","price":1.048},{"date":"1993-03-15","price":1.058},{"date":"1993-03-22","price":1.056},{"date":"1993-03-29","price":1.057},{"date":"1993-04-05","price":1.068},{"date":"1993-04-12","price":1.079},{"date":"1993-04-19","price":1.079},{"date":"1993-04-26","price":1.086},{"date":"1993-05-03","price":1.086},{"date":"1993-05-10","price":1.097},{"date":"1993-05-17","price":1.106},{"date":"1993-05-24","price":1.106},{"date":"1993-05-31","price":1.107},{"date":"1993-06-07","price":1.104},{"date":"1993-06-14","price":1.101},{"date":"1993-06-21","price":1.095},{"date":"1993-06-28","price":1.089},{"date":"1993-07-05","price":1.086},{"date":"1993-07-12","price":1.081},{"date":"1993-07-19","price":1.075},{"date":"1993-07-26","price":1.069},{"date":"1993-08-02","price":1.062},{"date":"1993-08-09","price":1.06},{"date":"1993-08-16","price":1.059},{"date":"1993-08-23","price":1.065},{"date":"1993-08-30","price":1.062},{"date":"1993-09-06","price":1.055},{"date":"1993-09-13","price":1.051},{"date":"1993-09-20","price":1.045},{"date":"1993-09-27","price":1.047},{"date":"1993-10-04","price":1.092},{"date":"1993-10-11","price":1.09},{"date":"1993-10-18","price":1.093},{"date":"1993-10-25","price":1.092},{"date":"1993-11-01","price":1.084},{"date":"1993-11-08","price":1.075},{"date":"1993-11-15","price":1.064},{"date":"1993-11-22","price":1.058},{"date":"1993-11-29","price":1.051},{"date":"1993-12-06","price":1.036},{"date":"1993-12-13","price":1.018},{"date":"1993-12-20","price":1.003},{"date":"1993-12-27","price":0.999},{"date":"1994-01-03","price":0.992},{"date":"1994-01-10","price":0.995},{"date":"1994-01-17","price":1.001},{"date":"1994-01-24","price":0.999},{"date":"1994-01-31","price":1.005},{"date":"1994-02-07","price":1.007},{"date":"1994-02-14","price":1.016},{"date":"1994-02-21","price":1.009},{"date":"1994-02-28","price":1.004},{"date":"1994-03-07","price":1.007},{"date":"1994-03-14","price":1.005},{"date":"1994-03-21","price":1.007},{"date":"1994-03-28","price":1.012},{"date":"1994-04-04","price":1.011},{"date":"1994-04-11","price":1.028},{"date":"1994-04-18","price":1.033},{"date":"1994-04-25","price":1.037},{"date":"1994-05-02","price":1.04},{"date":"1994-05-09","price":1.045},{"date":"1994-05-16","price":1.046},{"date":"1994-05-23","price":1.05},{"date":"1994-05-30","price":1.056},{"date":"1994-06-06","price":1.065},{"date":"1994-06-13","price":1.073},{"date":"1994-06-20","price":1.079},{"date":"1994-06-27","price":1.095},{"date":"1994-07-04","price":1.097},{"date":"1994-07-11","price":1.103},{"date":"1994-07-18","price":1.109},{"date":"1994-07-25","price":1.114},{"date":"1994-08-01","price":1.13},{"date":"1994-08-08","price":1.157},{"date":"1994-08-15","price":1.161},{"date":"1994-08-22","price":1.165},{"date":"1994-08-29","price":1.161},{"date":"1994-09-05","price":1.156},{"date":"1994-09-12","price":1.15},{"date":"1994-09-19","price":1.14},{"date":"1994-09-26","price":1.129},{"date":"1994-10-03","price":1.12},{"date":"1994-10-10","price":1.114},{"date":"1994-10-17","price":1.106},{"date":"1994-10-24","price":1.107},{"date":"1994-10-31","price":1.121},{"date":"1994-11-07","price":1.123},{"date":"1994-11-14","price":1.122},{"date":"1994-11-21","price":1.113},{"date":"1994-11-28","price":1.105},{"date":"1994-12-05","price":1.103},{"date":"1994-12-12","price":1.095},{"date":"1994-12-19","price":1.087},{"date":"1994-12-26","price":1.077},{"date":"1995-01-02","price":1.079},{"date":"1995-01-09","price":1.086},{"date":"1995-01-16","price":1.078},{"date":"1995-01-23","price":1.083},{"date":"1995-01-30","price":1.083},{"date":"1995-02-06","price":1.076},{"date":"1995-02-13","price":1.074},{"date":"1995-02-20","price":1.067},{"date":"1995-02-27","price":1.073},{"date":"1995-03-06","price":1.076},{"date":"1995-03-13","price":1.069},{"date":"1995-03-20","price":1.068},{"date":"1995-03-27","price":1.075},{"date":"1995-04-03","price":1.087},{"date":"1995-04-10","price":1.103},{"date":"1995-04-17","price":1.117},{"date":"1995-04-24","price":1.138},{"date":"1995-05-01","price":1.148},{"date":"1995-05-08","price":1.169},{"date":"1995-05-15","price":1.179},{"date":"1995-05-22","price":1.197},{"date":"1995-05-29","price":1.199},{"date":"1995-06-05","price":1.199},{"date":"1995-06-12","price":1.196},{"date":"1995-06-19","price":1.189},{"date":"1995-06-26","price":1.182},{"date":"1995-07-03","price":1.175},{"date":"1995-07-10","price":1.165},{"date":"1995-07-17","price":1.153},{"date":"1995-07-24","price":1.144},{"date":"1995-07-31","price":1.132},{"date":"1995-08-07","price":1.127},{"date":"1995-08-14","price":1.125},{"date":"1995-08-21","price":1.124},{"date":"1995-08-28","price":1.117},{"date":"1995-09-04","price":1.113},{"date":"1995-09-11","price":1.111},{"date":"1995-09-18","price":1.11},{"date":"1995-09-25","price":1.109},{"date":"1995-10-02","price":1.105},{"date":"1995-10-09","price":1.097},{"date":"1995-10-16","price":1.087},{"date":"1995-10-23","price":1.079},{"date":"1995-10-30","price":1.068},{"date":"1995-11-06","price":1.065},{"date":"1995-11-13","price":1.063},{"date":"1995-11-20","price":1.06},{"date":"1995-11-27","price":1.061},{"date":"1995-12-04","price":1.062},{"date":"1995-12-11","price":1.063},{"date":"1995-12-18","price":1.078},{"date":"1995-12-25","price":1.082},{"date":"1996-01-01","price":1.083},{"date":"1996-01-08","price":1.093},{"date":"1996-01-15","price":1.098},{"date":"1996-01-22","price":1.091},{"date":"1996-01-29","price":1.087},{"date":"1996-02-05","price":1.083},{"date":"1996-02-12","price":1.08},{"date":"1996-02-19","price":1.087},{"date":"1996-02-26","price":1.107},{"date":"1996-03-04","price":1.124},{"date":"1996-03-11","price":1.125},{"date":"1996-03-18","price":1.135},{"date":"1996-03-25","price":1.164},{"date":"1996-04-01","price":1.178},{"date":"1996-04-08","price":1.204},{"date":"1996-04-15","price":1.242},{"date":"1996-04-22","price":1.256},{"date":"1996-04-29","price":1.273},{"date":"1996-05-06","price":1.275},{"date":"1996-05-13","price":1.277},{"date":"1996-05-20","price":1.285},{"date":"1996-05-27","price":1.275},{"date":"1996-06-03","price":1.269},{"date":"1996-06-10","price":1.262},{"date":"1996-06-17","price":1.258},{"date":"1996-06-24","price":1.245},{"date":"1996-07-01","price":1.234},{"date":"1996-07-08","price":1.231},{"date":"1996-07-15","price":1.228},{"date":"1996-07-22","price":1.227},{"date":"1996-07-29","price":1.218},{"date":"1996-08-05","price":1.207},{"date":"1996-08-12","price":1.203},{"date":"1996-08-19","price":1.205},{"date":"1996-08-26","price":1.209},{"date":"1996-09-02","price":1.197},{"date":"1996-09-09","price":1.203},{"date":"1996-09-16","price":1.206},{"date":"1996-09-23","price":1.206},{"date":"1996-09-30","price":1.2},{"date":"1996-10-07","price":1.194},{"date":"1996-10-14","price":1.203},{"date":"1996-10-21","price":1.204},{"date":"1996-10-28","price":1.215},{"date":"1996-11-04","price":1.223},{"date":"1996-11-11","price":1.226},{"date":"1996-11-18","price":1.236},{"date":"1996-11-25","price":1.244},{"date":"1996-12-02","price":1.241},{"date":"1996-12-09","price":1.241},{"date":"1996-12-16","price":1.236},{"date":"1996-12-23","price":1.231},{"date":"1996-12-30","price":1.227},{"date":"1997-01-06","price":1.225},{"date":"1997-01-13","price":1.241},{"date":"1997-01-20","price":1.241},{"date":"1997-01-27","price":1.238},{"date":"1997-02-03","price":1.236},{"date":"1997-02-10","price":1.234},{"date":"1997-02-17","price":1.227},{"date":"1997-02-24","price":1.223},{"date":"1997-03-03","price":1.215},{"date":"1997-03-10","price":1.206},{"date":"1997-03-17","price":1.2},{"date":"1997-03-24","price":1.204},{"date":"1997-03-31","price":1.2},{"date":"1997-04-07","price":1.203},{"date":"1997-04-14","price":1.199},{"date":"1997-04-21","price":1.199},{"date":"1997-04-28","price":1.195},{"date":"1997-05-05","price":1.193},{"date":"1997-05-12","price":1.193},{"date":"1997-05-19","price":1.203},{"date":"1997-05-26","price":1.212},{"date":"1997-06-02","price":1.215},{"date":"1997-06-09","price":1.207},{"date":"1997-06-16","price":1.198},{"date":"1997-06-23","price":1.187},{"date":"1997-06-30","price":1.181},{"date":"1997-07-07","price":1.177},{"date":"1997-07-14","price":1.173},{"date":"1997-07-21","price":1.177},{"date":"1997-07-28","price":1.17},{"date":"1997-08-04","price":1.193},{"date":"1997-08-11","price":1.228},{"date":"1997-08-18","price":1.229},{"date":"1997-08-25","price":1.244},{"date":"1997-09-01","price":1.243},{"date":"1997-09-08","price":1.243},{"date":"1997-09-15","price":1.236},{"date":"1997-09-22","price":1.225},{"date":"1997-09-29","price":1.21},{"date":"1997-10-06","price":1.209},{"date":"1997-10-13","price":1.203},{"date":"1997-10-20","price":1.193},{"date":"1997-10-27","price":1.182},{"date":"1997-11-03","price":1.176},{"date":"1997-11-10","price":1.177},{"date":"1997-11-17","price":1.168},{"date":"1997-11-24","price":1.162},{"date":"1997-12-01","price":1.152},{"date":"1997-12-08","price":1.141},{"date":"1997-12-15","price":1.131},{"date":"1997-12-22","price":1.121},{"date":"1997-12-29","price":1.112},{"date":"1998-01-05","price":1.102},{"date":"1998-01-12","price":1.094},{"date":"1998-01-19","price":1.083},{"date":"1998-01-26","price":1.066},{"date":"1998-02-02","price":1.061},{"date":"1998-02-09","price":1.053},{"date":"1998-02-16","price":1.038},{"date":"1998-02-23","price":1.044},{"date":"1998-03-02","price":1.028},{"date":"1998-03-09","price":1.018},{"date":"1998-03-16","price":1.008},{"date":"1998-03-23","price":1},{"date":"1998-03-30","price":1.03},{"date":"1998-04-06","price":1.028},{"date":"1998-04-13","price":1.025},{"date":"1998-04-20","price":1.028},{"date":"1998-04-27","price":1.04},{"date":"1998-05-04","price":1.049},{"date":"1998-05-11","price":1.063},{"date":"1998-05-18","price":1.072},{"date":"1998-05-25","price":1.07},{"date":"1998-06-01","price":1.066},{"date":"1998-06-08","price":1.075},{"date":"1998-06-15","price":1.066},{"date":"1998-06-22","price":1.058},{"date":"1998-06-29","price":1.057},{"date":"1998-07-06","price":1.058},{"date":"1998-07-13","price":1.054},{"date":"1998-07-20","price":1.059},{"date":"1998-07-27","price":1.05},{"date":"1998-08-03","price":1.039},{"date":"1998-08-10","price":1.033},{"date":"1998-08-17","price":1.026},{"date":"1998-08-24","price":1.019},{"date":"1998-08-31","price":1.013},{"date":"1998-09-07","price":1.007},{"date":"1998-09-14","price":1.002},{"date":"1998-09-21","price":1.014},{"date":"1998-09-28","price":1.014},{"date":"1998-10-05","price":1.019},{"date":"1998-10-12","price":1.022},{"date":"1998-10-19","price":1.019},{"date":"1998-10-26","price":1.015},{"date":"1998-11-02","price":1.01},{"date":"1998-11-09","price":1.008},{"date":"1998-11-16","price":0.996},{"date":"1998-11-23","price":0.989},{"date":"1998-11-30","price":0.974},{"date":"1998-12-07","price":0.954},{"date":"1998-12-14","price":0.945},{"date":"1998-12-21","price":0.944},{"date":"1998-12-28","price":0.937},{"date":"1999-01-04","price":0.935},{"date":"1999-01-11","price":0.941},{"date":"1999-01-18","price":0.944},{"date":"1999-01-25","price":0.936},{"date":"1999-02-01","price":0.929},{"date":"1999-02-08","price":0.927},{"date":"1999-02-15","price":0.919},{"date":"1999-02-22","price":0.907},{"date":"1999-03-01","price":0.913},{"date":"1999-03-08","price":0.921},{"date":"1999-03-15","price":0.977},{"date":"1999-03-22","price":1.017},{"date":"1999-03-29","price":1.082},{"date":"1999-04-05","price":1.118},{"date":"1999-04-12","price":1.14},{"date":"1999-04-19","price":1.135},{"date":"1999-04-26","price":1.131},{"date":"1999-05-03","price":1.136},{"date":"1999-05-10","price":1.14},{"date":"1999-05-17","price":1.14},{"date":"1999-05-24","price":1.126},{"date":"1999-05-31","price":1.111},{"date":"1999-06-07","price":1.112},{"date":"1999-06-14","price":1.108},{"date":"1999-06-21","price":1.124},{"date":"1999-06-28","price":1.113},{"date":"1999-07-05","price":1.125},{"date":"1999-07-12","price":1.143},{"date":"1999-07-19","price":1.169},{"date":"1999-07-26","price":1.193},{"date":"1999-08-02","price":1.195},{"date":"1999-08-09","price":1.206},{"date":"1999-08-16","price":1.236},{"date":"1999-08-23","price":1.234},{"date":"1999-08-30","price":1.233},{"date":"1999-09-06","price":1.242},{"date":"1999-09-13","price":1.25},{"date":"1999-09-20","price":1.268},{"date":"1999-09-27","price":1.262},{"date":"1999-10-04","price":1.255},{"date":"1999-10-11","price":1.249},{"date":"1999-10-18","price":1.236},{"date":"1999-10-25","price":1.237},{"date":"1999-11-01","price":1.23},{"date":"1999-11-08","price":1.233},{"date":"1999-11-15","price":1.251},{"date":"1999-11-22","price":1.269},{"date":"1999-11-29","price":1.274},{"date":"1999-12-06","price":1.273},{"date":"1999-12-13","price":1.275},{"date":"1999-12-20","price":1.269},{"date":"1999-12-27","price":1.273},{"date":"2000-01-03","price":1.272},{"date":"2000-01-10","price":1.264},{"date":"2000-01-17","price":1.277},{"date":"2000-01-24","price":1.315},{"date":"2000-01-31","price":1.316},{"date":"2000-02-07","price":1.325},{"date":"2000-02-14","price":1.356},{"date":"2000-02-21","price":1.406},{"date":"2000-02-28","price":1.421},{"date":"2000-03-06","price":1.501},{"date":"2000-03-13","price":1.527},{"date":"2000-03-20","price":1.529},{"date":"2000-03-27","price":1.508},{"date":"2000-04-03","price":1.503},{"date":"2000-04-10","price":1.475},{"date":"2000-04-17","price":1.444},{"date":"2000-04-24","price":1.437},{"date":"2000-05-01","price":1.42},{"date":"2000-05-08","price":1.455},{"date":"2000-05-15","price":1.492},{"date":"2000-05-22","price":1.527},{"date":"2000-05-29","price":1.54},{"date":"2000-06-05","price":1.563},{"date":"2000-06-12","price":1.631},{"date":"2000-06-19","price":1.681},{"date":"2000-06-26","price":1.658},{"date":"2000-07-03","price":1.625},{"date":"2000-07-10","price":1.593},{"date":"2000-07-17","price":1.546},{"date":"2000-07-24","price":1.52},{"date":"2000-07-31","price":1.471},{"date":"2000-08-07","price":1.462},{"date":"2000-08-14","price":1.447},{"date":"2000-08-21","price":1.468},{"date":"2000-08-28","price":1.481},{"date":"2000-09-04","price":1.53},{"date":"2000-09-11","price":1.561},{"date":"2000-09-18","price":1.562},{"date":"2000-09-25","price":1.548},{"date":"2000-10-02","price":1.524},{"date":"2000-10-09","price":1.502},{"date":"2000-10-16","price":1.539},{"date":"2000-10-23","price":1.551},{"date":"2000-10-30","price":1.545},{"date":"2000-11-06","price":1.526},{"date":"2000-11-13","price":1.523},{"date":"2000-11-20","price":1.51},{"date":"2000-11-27","price":1.51},{"date":"2000-12-04","price":1.486},{"date":"2000-12-11","price":1.449},{"date":"2000-12-18","price":1.422},{"date":"2000-12-25","price":1.414},{"date":"2001-01-01","price":1.406},{"date":"2001-01-08","price":1.425},{"date":"2001-01-15","price":1.474},{"date":"2001-01-22","price":1.471},{"date":"2001-01-29","price":1.46},{"date":"2001-02-05","price":1.443},{"date":"2001-02-12","price":1.476},{"date":"2001-02-19","price":1.449},{"date":"2001-02-26","price":1.431},{"date":"2001-03-05","price":1.417},{"date":"2001-03-12","price":1.412},{"date":"2001-03-19","price":1.404},{"date":"2001-03-26","price":1.404},{"date":"2001-04-02","price":1.442},{"date":"2001-04-09","price":1.5},{"date":"2001-04-16","price":1.571},{"date":"2001-04-23","price":1.619},{"date":"2001-04-30","price":1.626},{"date":"2001-05-07","price":1.703},{"date":"2001-05-14","price":1.713},{"date":"2001-05-21","price":1.687},{"date":"2001-05-28","price":1.704},{"date":"2001-06-04","price":1.679},{"date":"2001-06-11","price":1.647},{"date":"2001-06-18","price":1.601},{"date":"2001-06-25","price":1.538},{"date":"2001-07-02","price":1.474},{"date":"2001-07-09","price":1.437},{"date":"2001-07-16","price":1.413},{"date":"2001-07-23","price":1.395},{"date":"2001-07-30","price":1.384},{"date":"2001-08-06","price":1.376},{"date":"2001-08-13","price":1.392},{"date":"2001-08-20","price":1.427},{"date":"2001-08-27","price":1.488},{"date":"2001-09-03","price":1.545},{"date":"2001-09-10","price":1.527},{"date":"2001-09-17","price":1.529},{"date":"2001-09-24","price":1.485},{"date":"2001-10-01","price":1.416},{"date":"2001-10-08","price":1.352},{"date":"2001-10-15","price":1.309},{"date":"2001-10-22","price":1.265},{"date":"2001-10-29","price":1.235},{"date":"2001-11-05","price":1.206},{"date":"2001-11-12","price":1.182},{"date":"2001-11-19","price":1.167},{"date":"2001-11-26","price":1.127},{"date":"2001-12-03","price":1.108},{"date":"2001-12-10","price":1.095},{"date":"2001-12-17","price":1.059},{"date":"2001-12-24","price":1.072},{"date":"2001-12-31","price":1.096},{"date":"2002-01-07","price":1.112},{"date":"2002-01-14","price":1.111},{"date":"2002-01-21","price":1.105},{"date":"2002-01-28","price":1.101},{"date":"2002-02-04","price":1.116},{"date":"2002-02-11","price":1.107},{"date":"2002-02-18","price":1.116},{"date":"2002-02-25","price":1.116},{"date":"2002-03-04","price":1.144},{"date":"2002-03-11","price":1.223},{"date":"2002-03-18","price":1.288},{"date":"2002-03-25","price":1.342},{"date":"2002-04-01","price":1.371},{"date":"2002-04-08","price":1.413},{"date":"2002-04-15","price":1.404},{"date":"2002-04-22","price":1.404},{"date":"2002-04-29","price":1.393},{"date":"2002-05-06","price":1.395},{"date":"2002-05-13","price":1.388},{"date":"2002-05-20","price":1.397},{"date":"2002-05-27","price":1.387},{"date":"2002-06-03","price":1.392},{"date":"2002-06-10","price":1.375},{"date":"2002-06-17","price":1.378},{"date":"2002-06-24","price":1.384},{"date":"2002-07-01","price":1.392},{"date":"2002-07-08","price":1.382},{"date":"2002-07-15","price":1.394},{"date":"2002-07-22","price":1.41},{"date":"2002-07-29","price":1.407},{"date":"2002-08-05","price":1.395},{"date":"2002-08-12","price":1.393},{"date":"2002-08-19","price":1.392},{"date":"2002-08-26","price":1.403},{"date":"2002-09-02","price":1.394},{"date":"2002-09-09","price":1.395},{"date":"2002-09-16","price":1.401},{"date":"2002-09-23","price":1.395},{"date":"2002-09-30","price":1.413},{"date":"2002-10-07","price":1.439},{"date":"2002-10-14","price":1.44},{"date":"2002-10-21","price":1.458},{"date":"2002-10-28","price":1.444},{"date":"2002-11-04","price":1.448},{"date":"2002-11-11","price":1.439},{"date":"2002-11-18","price":1.409},{"date":"2002-11-25","price":1.38},{"date":"2002-12-02","price":1.364},{"date":"2002-12-09","price":1.36},{"date":"2002-12-16","price":1.363},{"date":"2002-12-23","price":1.401},{"date":"2002-12-30","price":1.441},{"date":"2003-01-06","price":1.444},{"date":"2003-01-13","price":1.454},{"date":"2003-01-20","price":1.459},{"date":"2003-01-27","price":1.473},{"date":"2003-02-03","price":1.527},{"date":"2003-02-10","price":1.607},{"date":"2003-02-17","price":1.66},{"date":"2003-02-24","price":1.658},{"date":"2003-03-03","price":1.686},{"date":"2003-03-10","price":1.712},{"date":"2003-03-17","price":1.728},{"date":"2003-03-24","price":1.69},{"date":"2003-03-31","price":1.649},{"date":"2003-04-07","price":1.63},{"date":"2003-04-14","price":1.595},{"date":"2003-04-21","price":1.574},{"date":"2003-04-28","price":1.557},{"date":"2003-05-05","price":1.513},{"date":"2003-05-12","price":1.491},{"date":"2003-05-19","price":1.498},{"date":"2003-05-26","price":1.487},{"date":"2003-06-02","price":1.473},{"date":"2003-06-09","price":1.49},{"date":"2003-06-16","price":1.518},{"date":"2003-06-23","price":1.496},{"date":"2003-06-30","price":1.487},{"date":"2003-07-07","price":1.489},{"date":"2003-07-14","price":1.521},{"date":"2003-07-21","price":1.524},{"date":"2003-07-28","price":1.516},{"date":"2003-08-04","price":1.536},{"date":"2003-08-11","price":1.571},{"date":"2003-08-18","price":1.627},{"date":"2003-08-25","price":1.747},{"date":"2003-09-01","price":1.746},{"date":"2003-09-08","price":1.717},{"date":"2003-09-15","price":1.697},{"date":"2003-09-22","price":1.643},{"date":"2003-09-29","price":1.591},{"date":"2003-10-06","price":1.573},{"date":"2003-10-13","price":1.568},{"date":"2003-10-20","price":1.571},{"date":"2003-10-27","price":1.542},{"date":"2003-11-03","price":1.535},{"date":"2003-11-10","price":1.504},{"date":"2003-11-17","price":1.497},{"date":"2003-11-24","price":1.512},{"date":"2003-12-01","price":1.49},{"date":"2003-12-08","price":1.476},{"date":"2003-12-15","price":1.465},{"date":"2003-12-22","price":1.485},{"date":"2003-12-29","price":1.478},{"date":"2004-01-05","price":1.51},{"date":"2004-01-12","price":1.56},{"date":"2004-01-19","price":1.595},{"date":"2004-01-26","price":1.622},{"date":"2004-02-02","price":1.616},{"date":"2004-02-09","price":1.638},{"date":"2004-02-16","price":1.648},{"date":"2004-02-23","price":1.688},{"date":"2004-03-01","price":1.717},{"date":"2004-03-08","price":1.738},{"date":"2004-03-15","price":1.724},{"date":"2004-03-22","price":1.743},{"date":"2004-03-29","price":1.758},{"date":"2004-04-05","price":1.78},{"date":"2004-04-12","price":1.786},{"date":"2004-04-19","price":1.813},{"date":"2004-04-26","price":1.812},{"date":"2004-05-03","price":1.844},{"date":"2004-05-10","price":1.941},{"date":"2004-05-17","price":2.017},{"date":"2004-05-24","price":2.064},{"date":"2004-05-31","price":2.051},{"date":"2004-06-07","price":2.034},{"date":"2004-06-14","price":1.985},{"date":"2004-06-21","price":1.937},{"date":"2004-06-28","price":1.921},{"date":"2004-07-05","price":1.895},{"date":"2004-07-12","price":1.917},{"date":"2004-07-19","price":1.928},{"date":"2004-07-26","price":1.905},{"date":"2004-08-02","price":1.888},{"date":"2004-08-09","price":1.877},{"date":"2004-08-16","price":1.875},{"date":"2004-08-23","price":1.884},{"date":"2004-08-30","price":1.866},{"date":"2004-09-06","price":1.85},{"date":"2004-09-13","price":1.846},{"date":"2004-09-20","price":1.866},{"date":"2004-09-27","price":1.917},{"date":"2004-10-04","price":1.938},{"date":"2004-10-11","price":1.993},{"date":"2004-10-18","price":2.035},{"date":"2004-10-25","price":2.032},{"date":"2004-11-01","price":2.034},{"date":"2004-11-08","price":2.001},{"date":"2004-11-15","price":1.969},{"date":"2004-11-22","price":1.948},{"date":"2004-11-29","price":1.945},{"date":"2004-12-06","price":1.911},{"date":"2004-12-13","price":1.847},{"date":"2004-12-20","price":1.815},{"date":"2004-12-27","price":1.791},{"date":"2005-01-03","price":1.778},{"date":"2005-01-10","price":1.793},{"date":"2005-01-17","price":1.819},{"date":"2005-01-24","price":1.853},{"date":"2005-01-31","price":1.911},{"date":"2005-02-07","price":1.909},{"date":"2005-02-14","price":1.898},{"date":"2005-02-21","price":1.905},{"date":"2005-02-28","price":1.928},{"date":"2005-03-07","price":1.999},{"date":"2005-03-14","price":2.056},{"date":"2005-03-21","price":2.109},{"date":"2005-03-28","price":2.153},{"date":"2005-04-04","price":2.217},{"date":"2005-04-11","price":2.28},{"date":"2005-04-18","price":2.237},{"date":"2005-04-25","price":2.236},{"date":"2005-05-02","price":2.235},{"date":"2005-05-09","price":2.186},{"date":"2005-05-16","price":2.163},{"date":"2005-05-23","price":2.125},{"date":"2005-05-30","price":2.097},{"date":"2005-06-06","price":2.116},{"date":"2005-06-13","price":2.13},{"date":"2005-06-20","price":2.161},{"date":"2005-06-27","price":2.215},{"date":"2005-07-04","price":2.226},{"date":"2005-07-11","price":2.328},{"date":"2005-07-18","price":2.317},{"date":"2005-07-25","price":2.289},{"date":"2005-08-01","price":2.291},{"date":"2005-08-08","price":2.368},{"date":"2005-08-15","price":2.55},{"date":"2005-08-22","price":2.612},{"date":"2005-08-29","price":2.61},{"date":"2005-09-05","price":3.069},{"date":"2005-09-12","price":2.955},{"date":"2005-09-19","price":2.786},{"date":"2005-09-26","price":2.803},{"date":"2005-10-03","price":2.928},{"date":"2005-10-10","price":2.848},{"date":"2005-10-17","price":2.725},{"date":"2005-10-24","price":2.603},{"date":"2005-10-31","price":2.48},{"date":"2005-11-07","price":2.376},{"date":"2005-11-14","price":2.296},{"date":"2005-11-21","price":2.201},{"date":"2005-11-28","price":2.154},{"date":"2005-12-05","price":2.147},{"date":"2005-12-12","price":2.185},{"date":"2005-12-19","price":2.211},{"date":"2005-12-26","price":2.197},{"date":"2006-01-02","price":2.238},{"date":"2006-01-09","price":2.327},{"date":"2006-01-16","price":2.32},{"date":"2006-01-23","price":2.336},{"date":"2006-01-30","price":2.357},{"date":"2006-02-06","price":2.342},{"date":"2006-02-13","price":2.284},{"date":"2006-02-20","price":2.24},{"date":"2006-02-27","price":2.254},{"date":"2006-03-06","price":2.331},{"date":"2006-03-13","price":2.366},{"date":"2006-03-20","price":2.504},{"date":"2006-03-27","price":2.498},{"date":"2006-04-03","price":2.588},{"date":"2006-04-10","price":2.683},{"date":"2006-04-17","price":2.783},{"date":"2006-04-24","price":2.914},{"date":"2006-05-01","price":2.919},{"date":"2006-05-08","price":2.909},{"date":"2006-05-15","price":2.947},{"date":"2006-05-22","price":2.892},{"date":"2006-05-29","price":2.867},{"date":"2006-06-05","price":2.892},{"date":"2006-06-12","price":2.906},{"date":"2006-06-19","price":2.871},{"date":"2006-06-26","price":2.869},{"date":"2006-07-03","price":2.934},{"date":"2006-07-10","price":2.973},{"date":"2006-07-17","price":2.989},{"date":"2006-07-24","price":3.003},{"date":"2006-07-31","price":3.004},{"date":"2006-08-07","price":3.038},{"date":"2006-08-14","price":3},{"date":"2006-08-21","price":2.924},{"date":"2006-08-28","price":2.845},{"date":"2006-09-04","price":2.727},{"date":"2006-09-11","price":2.618},{"date":"2006-09-18","price":2.497},{"date":"2006-09-25","price":2.378},{"date":"2006-10-02","price":2.31},{"date":"2006-10-09","price":2.261},{"date":"2006-10-16","price":2.226},{"date":"2006-10-23","price":2.208},{"date":"2006-10-30","price":2.218},{"date":"2006-11-06","price":2.2},{"date":"2006-11-13","price":2.232},{"date":"2006-11-20","price":2.239},{"date":"2006-11-27","price":2.246},{"date":"2006-12-04","price":2.297},{"date":"2006-12-11","price":2.293},{"date":"2006-12-18","price":2.32},{"date":"2006-12-25","price":2.341},{"date":"2007-01-01","price":2.334},{"date":"2007-01-08","price":2.306},{"date":"2007-01-15","price":2.229},{"date":"2007-01-22","price":2.165},{"date":"2007-01-29","price":2.165},{"date":"2007-02-05","price":2.191},{"date":"2007-02-12","price":2.241},{"date":"2007-02-19","price":2.296},{"date":"2007-02-26","price":2.383},{"date":"2007-03-05","price":2.505},{"date":"2007-03-12","price":2.559},{"date":"2007-03-19","price":2.577},{"date":"2007-03-26","price":2.61},{"date":"2007-04-02","price":2.707},{"date":"2007-04-09","price":2.802},{"date":"2007-04-16","price":2.876},{"date":"2007-04-23","price":2.869},{"date":"2007-04-30","price":2.971},{"date":"2007-05-07","price":3.054},{"date":"2007-05-14","price":3.103},{"date":"2007-05-21","price":3.218},{"date":"2007-05-28","price":3.209},{"date":"2007-06-04","price":3.157},{"date":"2007-06-11","price":3.076},{"date":"2007-06-18","price":3.009},{"date":"2007-06-25","price":2.982},{"date":"2007-07-02","price":2.959},{"date":"2007-07-09","price":2.981},{"date":"2007-07-16","price":3.049},{"date":"2007-07-23","price":2.958},{"date":"2007-07-30","price":2.876},{"date":"2007-08-06","price":2.838},{"date":"2007-08-13","price":2.771},{"date":"2007-08-20","price":2.785},{"date":"2007-08-27","price":2.749},{"date":"2007-09-03","price":2.796},{"date":"2007-09-10","price":2.818},{"date":"2007-09-17","price":2.787},{"date":"2007-09-24","price":2.812},{"date":"2007-10-01","price":2.788},{"date":"2007-10-08","price":2.77},{"date":"2007-10-15","price":2.762},{"date":"2007-10-22","price":2.823},{"date":"2007-10-29","price":2.872},{"date":"2007-11-05","price":3.013},{"date":"2007-11-12","price":3.111},{"date":"2007-11-19","price":3.099},{"date":"2007-11-26","price":3.097},{"date":"2007-12-03","price":3.061},{"date":"2007-12-10","price":3},{"date":"2007-12-17","price":2.998},{"date":"2007-12-24","price":2.98},{"date":"2007-12-31","price":3.053},{"date":"2008-01-07","price":3.109},{"date":"2008-01-14","price":3.068},{"date":"2008-01-21","price":3.017},{"date":"2008-01-28","price":2.977},{"date":"2008-02-04","price":2.978},{"date":"2008-02-11","price":2.96},{"date":"2008-02-18","price":3.042},{"date":"2008-02-25","price":3.13},{"date":"2008-03-03","price":3.162},{"date":"2008-03-10","price":3.225},{"date":"2008-03-17","price":3.284},{"date":"2008-03-24","price":3.259},{"date":"2008-03-31","price":3.29},{"date":"2008-04-07","price":3.332},{"date":"2008-04-14","price":3.389},{"date":"2008-04-21","price":3.508},{"date":"2008-04-28","price":3.603},{"date":"2008-05-05","price":3.613},{"date":"2008-05-12","price":3.722},{"date":"2008-05-19","price":3.791},{"date":"2008-05-26","price":3.937},{"date":"2008-06-02","price":3.976},{"date":"2008-06-09","price":4.039},{"date":"2008-06-16","price":4.082},{"date":"2008-06-23","price":4.079},{"date":"2008-06-30","price":4.095},{"date":"2008-07-07","price":4.114},{"date":"2008-07-14","price":4.113},{"date":"2008-07-21","price":4.064},{"date":"2008-07-28","price":3.955},{"date":"2008-08-04","price":3.88},{"date":"2008-08-11","price":3.809},{"date":"2008-08-18","price":3.74},{"date":"2008-08-25","price":3.685},{"date":"2008-09-01","price":3.68},{"date":"2008-09-08","price":3.648},{"date":"2008-09-15","price":3.835},{"date":"2008-09-22","price":3.718},{"date":"2008-09-29","price":3.632},{"date":"2008-10-06","price":3.484},{"date":"2008-10-13","price":3.151},{"date":"2008-10-20","price":2.914},{"date":"2008-10-27","price":2.656},{"date":"2008-11-03","price":2.4},{"date":"2008-11-10","price":2.224},{"date":"2008-11-17","price":2.072},{"date":"2008-11-24","price":1.892},{"date":"2008-12-01","price":1.811},{"date":"2008-12-08","price":1.699},{"date":"2008-12-15","price":1.659},{"date":"2008-12-22","price":1.653},{"date":"2008-12-29","price":1.613},{"date":"2009-01-05","price":1.684},{"date":"2009-01-12","price":1.784},{"date":"2009-01-19","price":1.847},{"date":"2009-01-26","price":1.838},{"date":"2009-02-02","price":1.892},{"date":"2009-02-09","price":1.926},{"date":"2009-02-16","price":1.964},{"date":"2009-02-23","price":1.909},{"date":"2009-03-02","price":1.934},{"date":"2009-03-09","price":1.941},{"date":"2009-03-16","price":1.91},{"date":"2009-03-23","price":1.962},{"date":"2009-03-30","price":2.046},{"date":"2009-04-06","price":2.037},{"date":"2009-04-13","price":2.051},{"date":"2009-04-20","price":2.059},{"date":"2009-04-27","price":2.049},{"date":"2009-05-04","price":2.078},{"date":"2009-05-11","price":2.24},{"date":"2009-05-18","price":2.309},{"date":"2009-05-25","price":2.435},{"date":"2009-06-01","price":2.524},{"date":"2009-06-08","price":2.624},{"date":"2009-06-15","price":2.672},{"date":"2009-06-22","price":2.691},{"date":"2009-06-29","price":2.642},{"date":"2009-07-06","price":2.612},{"date":"2009-07-13","price":2.528},{"date":"2009-07-20","price":2.463},{"date":"2009-07-27","price":2.503},{"date":"2009-08-03","price":2.557},{"date":"2009-08-10","price":2.647},{"date":"2009-08-17","price":2.637},{"date":"2009-08-24","price":2.628},{"date":"2009-08-31","price":2.613},{"date":"2009-09-07","price":2.588},{"date":"2009-09-14","price":2.577},{"date":"2009-09-21","price":2.552},{"date":"2009-09-28","price":2.499},{"date":"2009-10-05","price":2.468},{"date":"2009-10-12","price":2.489},{"date":"2009-10-19","price":2.574},{"date":"2009-10-26","price":2.674},{"date":"2009-11-02","price":2.694},{"date":"2009-11-09","price":2.666},{"date":"2009-11-16","price":2.629},{"date":"2009-11-23","price":2.639},{"date":"2009-11-30","price":2.629},{"date":"2009-12-07","price":2.634},{"date":"2009-12-14","price":2.599},{"date":"2009-12-21","price":2.589},{"date":"2009-12-28","price":2.607},{"date":"2010-01-04","price":2.665},{"date":"2010-01-11","price":2.751},{"date":"2010-01-18","price":2.739},{"date":"2010-01-25","price":2.705},{"date":"2010-02-01","price":2.661},{"date":"2010-02-08","price":2.652},{"date":"2010-02-15","price":2.608},{"date":"2010-02-22","price":2.655},{"date":"2010-03-01","price":2.702},{"date":"2010-03-08","price":2.751},{"date":"2010-03-15","price":2.788},{"date":"2010-03-22","price":2.819},{"date":"2010-03-29","price":2.798},{"date":"2010-04-05","price":2.826},{"date":"2010-04-12","price":2.858},{"date":"2010-04-19","price":2.86},{"date":"2010-04-26","price":2.849},{"date":"2010-05-03","price":2.898},{"date":"2010-05-10","price":2.905},{"date":"2010-05-17","price":2.864},{"date":"2010-05-24","price":2.786},{"date":"2010-05-31","price":2.728},{"date":"2010-06-07","price":2.725},{"date":"2010-06-14","price":2.701},{"date":"2010-06-21","price":2.743},{"date":"2010-06-28","price":2.757},{"date":"2010-07-05","price":2.726},{"date":"2010-07-12","price":2.718},{"date":"2010-07-19","price":2.722},{"date":"2010-07-26","price":2.749},{"date":"2010-08-02","price":2.735},{"date":"2010-08-09","price":2.783},{"date":"2010-08-16","price":2.745},{"date":"2010-08-23","price":2.704},{"date":"2010-08-30","price":2.682},{"date":"2010-09-06","price":2.682},{"date":"2010-09-13","price":2.721},{"date":"2010-09-20","price":2.723},{"date":"2010-09-27","price":2.694},{"date":"2010-10-04","price":2.732},{"date":"2010-10-11","price":2.819},{"date":"2010-10-18","price":2.834},{"date":"2010-10-25","price":2.817},{"date":"2010-11-01","price":2.806},{"date":"2010-11-08","price":2.865},{"date":"2010-11-15","price":2.892},{"date":"2010-11-22","price":2.876},{"date":"2010-11-29","price":2.856},{"date":"2010-12-06","price":2.958},{"date":"2010-12-13","price":2.98},{"date":"2010-12-20","price":2.982},{"date":"2010-12-27","price":3.052},{"date":"2011-01-03","price":3.07},{"date":"2011-01-10","price":3.089},{"date":"2011-01-17","price":3.104},{"date":"2011-01-24","price":3.11},{"date":"2011-01-31","price":3.101},{"date":"2011-02-07","price":3.132},{"date":"2011-02-14","price":3.14},{"date":"2011-02-21","price":3.189},{"date":"2011-02-28","price":3.383},{"date":"2011-03-07","price":3.52},{"date":"2011-03-14","price":3.567},{"date":"2011-03-21","price":3.562},{"date":"2011-03-28","price":3.596},{"date":"2011-04-04","price":3.684},{"date":"2011-04-11","price":3.791},{"date":"2011-04-18","price":3.844},{"date":"2011-04-25","price":3.879},{"date":"2011-05-02","price":3.963},{"date":"2011-05-09","price":3.965},{"date":"2011-05-16","price":3.96},{"date":"2011-05-23","price":3.849},{"date":"2011-05-30","price":3.794},{"date":"2011-06-06","price":3.781},{"date":"2011-06-13","price":3.713},{"date":"2011-06-20","price":3.652},{"date":"2011-06-27","price":3.574},{"date":"2011-07-04","price":3.579},{"date":"2011-07-11","price":3.641},{"date":"2011-07-18","price":3.682},{"date":"2011-07-25","price":3.699},{"date":"2011-08-01","price":3.711},{"date":"2011-08-08","price":3.674},{"date":"2011-08-15","price":3.604},{"date":"2011-08-22","price":3.581},{"date":"2011-08-29","price":3.627},{"date":"2011-09-05","price":3.674},{"date":"2011-09-12","price":3.661},{"date":"2011-09-19","price":3.601},{"date":"2011-09-26","price":3.509},{"date":"2011-10-03","price":3.433},{"date":"2011-10-10","price":3.417},{"date":"2011-10-17","price":3.476},{"date":"2011-10-24","price":3.462},{"date":"2011-10-31","price":3.452},{"date":"2011-11-07","price":3.424},{"date":"2011-11-14","price":3.436},{"date":"2011-11-21","price":3.368},{"date":"2011-11-28","price":3.307},{"date":"2011-12-05","price":3.29},{"date":"2011-12-12","price":3.286},{"date":"2011-12-19","price":3.229},{"date":"2011-12-26","price":3.258},{"date":"2012-01-02","price":3.299},{"date":"2012-01-09","price":3.382},{"date":"2012-01-16","price":3.391},{"date":"2012-01-23","price":3.389},{"date":"2012-01-30","price":3.439},{"date":"2012-02-06","price":3.482},{"date":"2012-02-13","price":3.523},{"date":"2012-02-20","price":3.591},{"date":"2012-02-27","price":3.721},{"date":"2012-03-05","price":3.793},{"date":"2012-03-12","price":3.829},{"date":"2012-03-19","price":3.867},{"date":"2012-03-26","price":3.918},{"date":"2012-04-02","price":3.941},{"date":"2012-04-09","price":3.939},{"date":"2012-04-16","price":3.922},{"date":"2012-04-23","price":3.87},{"date":"2012-04-30","price":3.83},{"date":"2012-05-07","price":3.79},{"date":"2012-05-14","price":3.754},{"date":"2012-05-21","price":3.715},{"date":"2012-05-28","price":3.67},{"date":"2012-06-04","price":3.613},{"date":"2012-06-11","price":3.572},{"date":"2012-06-18","price":3.533},{"date":"2012-06-25","price":3.437},{"date":"2012-07-02","price":3.356},{"date":"2012-07-09","price":3.411},{"date":"2012-07-16","price":3.427},{"date":"2012-07-23","price":3.494},{"date":"2012-07-30","price":3.508},{"date":"2012-08-06","price":3.645},{"date":"2012-08-13","price":3.721},{"date":"2012-08-20","price":3.744},{"date":"2012-08-27","price":3.776},{"date":"2012-09-03","price":3.843},{"date":"2012-09-10","price":3.847},{"date":"2012-09-17","price":3.878},{"date":"2012-09-24","price":3.826},{"date":"2012-10-01","price":3.804},{"date":"2012-10-08","price":3.85},{"date":"2012-10-15","price":3.819},{"date":"2012-10-22","price":3.687},{"date":"2012-10-29","price":3.568},{"date":"2012-11-05","price":3.492},{"date":"2012-11-12","price":3.449},{"date":"2012-11-19","price":3.429},{"date":"2012-11-26","price":3.437},{"date":"2012-12-03","price":3.394},{"date":"2012-12-10","price":3.349},{"date":"2012-12-17","price":3.254},{"date":"2012-12-24","price":3.257},{"date":"2012-12-31","price":3.298},{"date":"2013-01-07","price":3.299},{"date":"2013-01-14","price":3.303},{"date":"2013-01-21","price":3.315},{"date":"2013-01-28","price":3.357},{"date":"2013-02-04","price":3.538},{"date":"2013-02-11","price":3.611},{"date":"2013-02-18","price":3.747},{"date":"2013-02-25","price":3.784},{"date":"2013-03-04","price":3.759},{"date":"2013-03-11","price":3.71},{"date":"2013-03-18","price":3.696},{"date":"2013-03-25","price":3.68},{"date":"2013-04-01","price":3.645},{"date":"2013-04-08","price":3.608},{"date":"2013-04-15","price":3.542},{"date":"2013-04-22","price":3.536},{"date":"2013-04-29","price":3.52},{"date":"2013-05-06","price":3.538},{"date":"2013-05-13","price":3.603},{"date":"2013-05-20","price":3.673},{"date":"2013-05-27","price":3.645},{"date":"2013-06-03","price":3.646},{"date":"2013-06-10","price":3.655},{"date":"2013-06-17","price":3.626},{"date":"2013-06-24","price":3.577},{"date":"2013-07-01","price":3.496},{"date":"2013-07-08","price":3.492},{"date":"2013-07-15","price":3.639},{"date":"2013-07-22","price":3.682},{"date":"2013-07-29","price":3.646},{"date":"2013-08-05","price":3.632},{"date":"2013-08-12","price":3.561},{"date":"2013-08-19","price":3.55},{"date":"2013-08-26","price":3.552},{"date":"2013-09-02","price":3.608},{"date":"2013-09-09","price":3.587},{"date":"2013-09-16","price":3.547},{"date":"2013-09-23","price":3.495},{"date":"2013-09-30","price":3.425},{"date":"2013-10-07","price":3.367},{"date":"2013-10-14","price":3.354},{"date":"2013-10-21","price":3.36},{"date":"2013-10-28","price":3.294},{"date":"2013-11-04","price":3.265},{"date":"2013-11-11","price":3.194},{"date":"2013-11-18","price":3.219},{"date":"2013-11-25","price":3.293},{"date":"2013-12-02","price":3.272},{"date":"2013-12-09","price":3.269},{"date":"2013-12-16","price":3.239},{"date":"2013-12-23","price":3.271},{"date":"2013-12-30","price":3.331},{"date":"2014-01-06","price":3.332},{"date":"2014-01-13","price":3.327},{"date":"2014-01-20","price":3.296},{"date":"2014-01-27","price":3.295},{"date":"2014-02-03","price":3.292},{"date":"2014-02-10","price":3.309},{"date":"2014-02-17","price":3.38},{"date":"2014-02-24","price":3.444},{"date":"2014-03-03","price":3.479},{"date":"2014-03-10","price":3.512},{"date":"2014-03-17","price":3.547},{"date":"2014-03-24","price":3.549},{"date":"2014-03-31","price":3.579},{"date":"2014-04-07","price":3.596},{"date":"2014-04-14","price":3.651},{"date":"2014-04-21","price":3.683},{"date":"2014-04-28","price":3.713},{"date":"2014-05-05","price":3.684},{"date":"2014-05-12","price":3.668},{"date":"2014-05-19","price":3.665},{"date":"2014-05-26","price":3.674},{"date":"2014-06-02","price":3.69},{"date":"2014-06-09","price":3.674},{"date":"2014-06-16","price":3.686},{"date":"2014-06-23","price":3.704},{"date":"2014-06-30","price":3.704},{"date":"2014-07-07","price":3.678},{"date":"2014-07-14","price":3.635},{"date":"2014-07-21","price":3.593},{"date":"2014-07-28","price":3.539},{"date":"2014-08-04","price":3.515},{"date":"2014-08-11","price":3.505},{"date":"2014-08-18","price":3.472},{"date":"2014-08-25","price":3.454},{"date":"2014-09-01","price":3.459},{"date":"2014-09-08","price":3.457},{"date":"2014-09-15","price":3.408},{"date":"2014-09-22","price":3.353},{"date":"2014-09-29","price":3.354},{"date":"2014-10-06","price":3.299},{"date":"2014-10-13","price":3.207},{"date":"2014-10-20","price":3.12},{"date":"2014-10-27","price":3.056},{"date":"2014-11-03","price":2.993},{"date":"2014-11-10","price":2.941},{"date":"2014-11-17","price":2.894},{"date":"2014-11-24","price":2.821},{"date":"2014-12-01","price":2.778},{"date":"2014-12-08","price":2.679},{"date":"2014-12-15","price":2.554},{"date":"2014-12-22","price":2.403},{"date":"2014-12-29","price":2.299},{"date":"2015-01-05","price":2.214},{"date":"2015-01-12","price":2.139},{"date":"2015-01-19","price":2.066},{"date":"2015-01-26","price":2.044},{"date":"2015-02-02","price":2.068},{"date":"2015-02-09","price":2.191},{"date":"2015-02-16","price":2.274},{"date":"2015-02-23","price":2.332},{"date":"2015-03-02","price":2.473},{"date":"2015-03-09","price":2.487},{"date":"2015-03-16","price":2.453},{"date":"2015-03-23","price":2.457},{"date":"2015-03-30","price":2.448},{"date":"2015-04-06","price":2.413},{"date":"2015-04-13","price":2.408},{"date":"2015-04-20","price":2.485},{"date":"2015-04-27","price":2.57},{"date":"2015-05-04","price":2.664},{"date":"2015-05-11","price":2.691},{"date":"2015-05-18","price":2.744},{"date":"2015-05-25","price":2.774},{"date":"2015-06-01","price":2.78},{"date":"2015-06-08","price":2.78},{"date":"2015-06-15","price":2.835},{"date":"2015-06-22","price":2.812},{"date":"2015-06-29","price":2.801},{"date":"2015-07-06","price":2.793},{"date":"2015-07-13","price":2.834},{"date":"2015-07-20","price":2.802},{"date":"2015-07-27","price":2.745},{"date":"2015-08-03","price":2.689},{"date":"2015-08-10","price":2.629},{"date":"2015-08-17","price":2.716},{"date":"2015-08-24","price":2.637},{"date":"2015-08-31","price":2.51},{"date":"2015-09-07","price":2.437},{"date":"2015-09-14","price":2.375},{"date":"2015-09-21","price":2.327},{"date":"2015-09-28","price":2.322},{"date":"2015-10-05","price":2.318},{"date":"2015-10-12","price":2.337},{"date":"2015-10-19","price":2.277},{"date":"2015-10-26","price":2.228},{"date":"2015-11-02","price":2.224},{"date":"2015-11-09","price":2.235},{"date":"2015-11-16","price":2.178},{"date":"2015-11-23","price":2.094},{"date":"2015-11-30","price":2.059},{"date":"2015-12-07","price":2.053},{"date":"2015-12-14","price":2.037},{"date":"2015-12-21","price":2.026},{"date":"2015-12-28","price":2.034},{"date":"2016-01-04","price":2.028},{"date":"2016-01-11","price":1.996},{"date":"2016-01-18","price":1.914},{"date":"2016-01-25","price":1.856},{"date":"2016-02-01","price":1.822},{"date":"2016-02-08","price":1.759},{"date":"2016-02-15","price":1.724},{"date":"2016-02-22","price":1.73},{"date":"2016-02-29","price":1.783},{"date":"2016-03-07","price":1.841},{"date":"2016-03-14","price":1.961},{"date":"2016-03-21","price":2.007},{"date":"2016-03-28","price":2.066},{"date":"2016-04-04","price":2.083},{"date":"2016-04-11","price":2.069},{"date":"2016-04-18","price":2.137},{"date":"2016-04-25","price":2.162},{"date":"2016-05-02","price":2.24},{"date":"2016-05-09","price":2.22},{"date":"2016-05-16","price":2.242},{"date":"2016-05-23","price":2.3},{"date":"2016-05-30","price":2.339},{"date":"2016-06-06","price":2.381},{"date":"2016-06-13","price":2.399},{"date":"2016-06-20","price":2.353},{"date":"2016-06-27","price":2.329},{"date":"2016-07-04","price":2.291},{"date":"2016-07-11","price":2.253},{"date":"2016-07-18","price":2.23},{"date":"2016-07-25","price":2.182},{"date":"2016-08-01","price":2.159},{"date":"2016-08-08","price":2.15},{"date":"2016-08-15","price":2.149},{"date":"2016-08-22","price":2.193},{"date":"2016-08-29","price":2.237},{"date":"2016-09-05","price":2.223},{"date":"2016-09-12","price":2.202},{"date":"2016-09-19","price":2.225},{"date":"2016-09-26","price":2.224},{"date":"2016-10-03","price":2.245},{"date":"2016-10-10","price":2.272},{"date":"2016-10-17","price":2.257},{"date":"2016-10-24","price":2.243},{"date":"2016-10-31","price":2.23},{"date":"2016-11-07","price":2.233},{"date":"2016-11-14","price":2.184},{"date":"2016-11-21","price":2.155},{"date":"2016-11-28","price":2.154},{"date":"2016-12-05","price":2.208},{"date":"2016-12-12","price":2.236},{"date":"2016-12-19","price":2.264},{"date":"2016-12-26","price":2.309},{"date":"2017-01-02","price":2.377},{"date":"2017-01-09","price":2.388},{"date":"2017-01-16","price":2.358},{"date":"2017-01-23","price":2.326},{"date":"2017-01-30","price":2.296},{"date":"2017-02-06","price":2.293},{"date":"2017-02-13","price":2.307},{"date":"2017-02-20","price":2.302},{"date":"2017-02-27","price":2.314},{"date":"2017-03-06","price":2.341},{"date":"2017-03-13","price":2.323},{"date":"2017-03-20","price":2.321},{"date":"2017-03-27","price":2.315},{"date":"2017-04-03","price":2.36},{"date":"2017-04-10","price":2.424},{"date":"2017-04-17","price":2.436},{"date":"2017-04-24","price":2.449},{"date":"2017-05-01","price":2.411},{"date":"2017-05-08","price":2.372},{"date":"2017-05-15","price":2.369},{"date":"2017-05-22","price":2.399},{"date":"2017-05-29","price":2.406},{"date":"2017-06-05","price":2.414},{"date":"2017-06-12","price":2.366},{"date":"2017-06-19","price":2.318},{"date":"2017-06-26","price":2.288},{"date":"2017-07-03","price":2.26},{"date":"2017-07-10","price":2.297},{"date":"2017-07-17","price":2.278},{"date":"2017-07-24","price":2.312},{"date":"2017-07-31","price":2.352},{"date":"2017-08-07","price":2.378},{"date":"2017-08-14","price":2.384},{"date":"2017-08-21","price":2.36},{"date":"2017-08-28","price":2.399},{"date":"2017-09-04","price":2.679},{"date":"2017-09-11","price":2.685},{"date":"2017-09-18","price":2.634},{"date":"2017-09-25","price":2.583},{"date":"2017-10-02","price":2.565},{"date":"2017-10-09","price":2.504},{"date":"2017-10-16","price":2.489},{"date":"2017-10-23","price":2.479},{"date":"2017-10-30","price":2.488},{"date":"2017-11-06","price":2.561},{"date":"2017-11-13","price":2.592},{"date":"2017-11-20","price":2.568},{"date":"2017-11-27","price":2.533},{"date":"2017-12-04","price":2.5},{"date":"2017-12-11","price":2.485},{"date":"2017-12-18","price":2.45},{"date":"2017-12-25","price":2.472},{"date":"2018-01-01","price":2.52},{"date":"2018-01-08","price":2.522},{"date":"2018-01-15","price":2.557},{"date":"2018-01-22","price":2.567},{"date":"2018-01-29","price":2.607},{"date":"2018-02-05","price":2.637},{"date":"2018-02-12","price":2.607},{"date":"2018-02-19","price":2.557},{"date":"2018-02-26","price":2.548},{"date":"2018-03-05","price":2.56},{"date":"2018-03-12","price":2.559},{"date":"2018-03-19","price":2.598},{"date":"2018-03-26","price":2.648},{"date":"2018-04-02","price":2.7},{"date":"2018-04-09","price":2.694},{"date":"2018-04-16","price":2.747},{"date":"2018-04-23","price":2.798},{"date":"2018-04-30","price":2.846},{"date":"2018-05-07","price":2.845},{"date":"2018-05-14","price":2.873},{"date":"2018-05-21","price":2.923},{"date":"2018-05-28","price":2.962},{"date":"2018-06-04","price":2.94},{"date":"2018-06-11","price":2.911},{"date":"2018-06-18","price":2.879},{"date":"2018-06-25","price":2.833},{"date":"2018-07-02","price":2.844},{"date":"2018-07-09","price":2.857},{"date":"2018-07-16","price":2.865},{"date":"2018-07-23","price":2.831},{"date":"2018-07-30","price":2.846},{"date":"2018-08-06","price":2.852},{"date":"2018-08-13","price":2.843},{"date":"2018-08-20","price":2.821},{"date":"2018-08-27","price":2.827},{"date":"2018-09-03","price":2.824},{"date":"2018-09-10","price":2.833},{"date":"2018-09-17","price":2.841},{"date":"2018-09-24","price":2.844},{"date":"2018-10-01","price":2.866},{"date":"2018-10-08","price":2.903},{"date":"2018-10-15","price":2.879},{"date":"2018-10-22","price":2.841},{"date":"2018-10-29","price":2.811},{"date":"2018-11-05","price":2.753},{"date":"2018-11-12","price":2.686},{"date":"2018-11-19","price":2.611},{"date":"2018-11-26","price":2.539},{"date":"2018-12-03","price":2.451},{"date":"2018-12-10","price":2.421},{"date":"2018-12-17","price":2.369},{"date":"2018-12-24","price":2.321},{"date":"2018-12-31","price":2.266},{"date":"2019-01-07","price":2.237},{"date":"2019-01-14","price":2.247},{"date":"2019-01-21","price":2.251},{"date":"2019-01-28","price":2.256},{"date":"2019-02-04","price":2.254},{"date":"2019-02-11","price":2.276},{"date":"2019-02-18","price":2.317},{"date":"2019-02-25","price":2.39},{"date":"2019-03-04","price":2.422},{"date":"2019-03-11","price":2.471},{"date":"2019-03-18","price":2.548},{"date":"2019-03-25","price":2.623},{"date":"2019-04-01","price":2.691},{"date":"2019-04-08","price":2.745},{"date":"2019-04-15","price":2.828},{"date":"2019-04-22","price":2.841},{"date":"2019-04-29","price":2.887},{"date":"2019-05-06","price":2.897},{"date":"2019-05-13","price":2.866},{"date":"2019-05-20","price":2.852},{"date":"2019-05-27","price":2.822},{"date":"2019-06-03","price":2.807},{"date":"2019-06-10","price":2.732},{"date":"2019-06-17","price":2.67},{"date":"2019-06-24","price":2.654},{"date":"2019-07-01","price":2.713},{"date":"2019-07-08","price":2.743},{"date":"2019-07-15","price":2.779},{"date":"2019-07-22","price":2.75},{"date":"2019-07-29","price":2.715},{"date":"2019-08-05","price":2.688},{"date":"2019-08-12","price":2.624},{"date":"2019-08-19","price":2.598},{"date":"2019-08-26","price":2.574},{"date":"2019-09-02","price":2.563},{"date":"2019-09-09","price":2.55},{"date":"2019-09-16","price":2.552},{"date":"2019-09-23","price":2.654},{"date":"2019-09-30","price":2.642},{"date":"2019-10-07","price":2.645},{"date":"2019-10-14","price":2.629},{"date":"2019-10-21","price":2.638},{"date":"2019-10-28","price":2.596},{"date":"2019-11-04","price":2.605},{"date":"2019-11-11","price":2.615},{"date":"2019-11-18","price":2.592},{"date":"2019-11-25","price":2.579},{"date":"2019-12-02","price":2.575},{"date":"2019-12-09","price":2.561},{"date":"2019-12-16","price":2.536},{"date":"2019-12-23","price":2.532},{"date":"2019-12-30","price":2.571},{"date":"2020-01-06","price":2.578},{"date":"2020-01-13","price":2.57},{"date":"2020-01-20","price":2.537},{"date":"2020-01-27","price":2.506},{"date":"2020-02-03","price":2.455},{"date":"2020-02-10","price":2.419},{"date":"2020-02-17","price":2.428},{"date":"2020-02-24","price":2.466},{"date":"2020-03-02","price":2.423},{"date":"2020-03-09","price":2.375},{"date":"2020-03-16","price":2.248},{"date":"2020-03-23","price":2.12},{"date":"2020-03-30","price":2.005},{"date":"2020-04-06","price":1.924},{"date":"2020-04-13","price":1.853},{"date":"2020-04-20","price":1.812},{"date":"2020-04-27","price":1.773},{"date":"2020-05-04","price":1.789},{"date":"2020-05-11","price":1.851},{"date":"2020-05-18","price":1.878},{"date":"2020-05-25","price":1.96},{"date":"2020-06-01","price":1.974},{"date":"2020-06-08","price":2.036},{"date":"2020-06-15","price":2.098},{"date":"2020-06-22","price":2.129},{"date":"2020-06-29","price":2.174},{"date":"2020-07-06","price":2.177},{"date":"2020-07-13","price":2.195},{"date":"2020-07-20","price":2.186},{"date":"2020-07-27","price":2.175},{"date":"2020-08-03","price":2.176},{"date":"2020-08-10","price":2.166},{"date":"2020-08-17","price":2.166},{"date":"2020-08-24","price":2.182},{"date":"2020-08-31","price":2.222},{"date":"2020-09-07","price":2.211},{"date":"2020-09-14","price":2.183},{"date":"2020-09-21","price":2.168},{"date":"2020-09-28","price":2.169},{"date":"2020-10-05","price":2.172},{"date":"2020-10-12","price":2.167},{"date":"2020-10-19","price":2.15},{"date":"2020-10-26","price":2.143},{"date":"2020-11-02","price":2.112},{"date":"2020-11-09","price":2.096},{"date":"2020-11-16","price":2.111},{"date":"2020-11-23","price":2.102},{"date":"2020-11-30","price":2.12},{"date":"2020-12-07","price":2.156},{"date":"2020-12-14","price":2.158},{"date":"2020-12-21","price":2.224},{"date":"2020-12-28","price":2.243},{"date":"2021-01-04","price":2.249},{"date":"2021-01-11","price":2.317},{"date":"2021-01-18","price":2.379},{"date":"2021-01-25","price":2.392},{"date":"2021-02-01","price":2.409},{"date":"2021-02-08","price":2.461},{"date":"2021-02-15","price":2.501},{"date":"2021-02-22","price":2.633},{"date":"2021-03-01","price":2.711},{"date":"2021-03-08","price":2.771},{"date":"2021-03-15","price":2.853},{"date":"2021-03-22","price":2.865},{"date":"2021-03-29","price":2.852},{"date":"2021-04-05","price":2.857},{"date":"2021-04-12","price":2.849},{"date":"2021-04-19","price":2.855},{"date":"2021-04-26","price":2.872},{"date":"2021-05-03","price":2.89},{"date":"2021-05-10","price":2.961},{"date":"2021-05-17","price":3.028},{"date":"2021-05-24","price":3.02},{"date":"2021-05-31","price":3.027},{"date":"2021-06-07","price":3.035},{"date":"2021-06-14","price":3.069},{"date":"2021-06-21","price":3.06},{"date":"2021-06-28","price":3.091},{"date":"2021-07-05","price":3.122},{"date":"2021-07-12","price":3.133},{"date":"2021-07-19","price":3.153},{"date":"2021-07-26","price":3.136},{"date":"2021-08-02","price":3.159},{"date":"2021-08-09","price":3.172},{"date":"2021-08-16","price":3.174},{"date":"2021-08-23","price":3.145},{"date":"2021-08-30","price":3.139},{"date":"2021-09-06","price":3.176},{"date":"2021-09-13","price":3.165},{"date":"2021-09-20","price":3.184},{"date":"2021-09-27","price":3.175},{"date":"2021-10-04","price":3.19},{"date":"2021-10-11","price":3.267},{"date":"2021-10-18","price":3.322},{"date":"2021-10-25","price":3.383},{"date":"2021-11-01","price":3.39},{"date":"2021-11-08","price":3.41},{"date":"2021-11-15","price":3.399},{"date":"2021-11-22","price":3.395},{"date":"2021-11-29","price":3.38},{"date":"2021-12-06","price":3.341},{"date":"2021-12-13","price":3.315},{"date":"2021-12-20","price":3.295},{"date":"2021-12-27","price":3.275},{"date":"2022-01-03","price":3.281},{"date":"2022-01-10","price":3.295},{"date":"2022-01-17","price":3.306},{"date":"2022-01-24","price":3.323},{"date":"2022-01-31","price":3.368},{"date":"2022-02-07","price":3.444},{"date":"2022-02-14","price":3.487},{"date":"2022-02-21","price":3.53},{"date":"2022-02-28","price":3.608},{"date":"2022-03-07","price":4.102},{"date":"2022-03-14","price":4.315},{"date":"2022-03-21","price":4.239},{"date":"2022-03-28","price":4.231},{"date":"2022-04-04","price":4.17},{"date":"2022-04-11","price":4.091},{"date":"2022-04-18","price":4.066},{"date":"2022-04-25","price":4.107},{"date":"2022-05-02","price":4.182},{"date":"2022-05-09","price":4.328},{"date":"2022-05-16","price":4.491},{"date":"2022-05-23","price":4.593},{"date":"2022-05-30","price":4.624},{"date":"2022-06-06","price":4.876},{"date":"2022-06-13","price":5.006},{"date":"2022-06-20","price":4.962},{"date":"2022-06-27","price":4.872},{"date":"2022-07-04","price":4.771},{"date":"2022-07-11","price":4.646},{"date":"2022-07-18","price":4.49},{"date":"2022-07-25","price":4.33},{"date":"2022-08-01","price":4.192},{"date":"2022-08-08","price":4.038},{"date":"2022-08-15","price":3.938},{"date":"2022-08-22","price":3.88},{"date":"2022-08-29","price":3.827},{"date":"2022-09-05","price":3.746},{"date":"2022-09-12","price":3.69},{"date":"2022-09-19","price":3.654},{"date":"2022-09-26","price":3.711},{"date":"2022-10-03","price":3.782},{"date":"2022-10-10","price":3.912},{"date":"2022-10-17","price":3.871},{"date":"2022-10-24","price":3.769},{"date":"2022-10-31","price":3.742},{"date":"2022-11-07","price":3.796},{"date":"2022-11-14","price":3.762},{"date":"2022-11-21","price":3.648},{"date":"2022-11-28","price":3.534},{"date":"2022-12-05","price":3.39},{"date":"2022-12-12","price":3.239},{"date":"2022-12-19","price":3.12},{"date":"2022-12-26","price":3.091},{"date":"2023-01-02","price":3.223},{"date":"2023-01-09","price":3.259},{"date":"2023-01-16","price":3.31},{"date":"2023-01-23","price":3.415},{"date":"2023-01-30","price":3.489},{"date":"2023-02-06","price":3.444},{"date":"2023-02-13","price":3.39},{"date":"2023-02-20","price":3.379},{"date":"2023-02-27","price":3.342},{"date":"2023-03-06","price":3.389},{"date":"2023-03-13","price":3.456},{"date":"2023-03-20","price":3.422},{"date":"2023-03-27","price":3.421},{"date":"2023-04-03","price":3.497},{"date":"2023-04-10","price":3.596},{"date":"2023-04-17","price":3.663},{"date":"2023-04-24","price":3.656},{"date":"2023-05-01","price":3.6},{"date":"2023-05-08","price":3.533},{"date":"2023-05-15","price":3.536},{"date":"2023-05-22","price":3.534},{"date":"2023-05-29","price":3.571},{"date":"2023-06-05","price":3.541},{"date":"2023-06-12","price":3.595},{"date":"2023-06-19","price":3.577},{"date":"2023-06-26","price":3.571},{"date":"2023-07-03","price":3.527},{"date":"2023-07-10","price":3.546},{"date":"2023-07-17","price":3.559},{"date":"2023-07-24","price":3.596},{"date":"2023-07-31","price":3.757},{"date":"2023-08-07","price":3.828},{"date":"2023-08-14","price":3.85},{"date":"2023-08-21","price":3.868},{"date":"2023-08-28","price":3.813},{"date":"2023-09-04","price":3.807},{"date":"2023-09-11","price":3.822},{"date":"2023-09-18","price":3.878},{"date":"2023-09-25","price":3.837},{"date":"2023-10-02","price":3.798},{"date":"2023-10-09","price":3.684},{"date":"2023-10-16","price":3.576},{"date":"2023-10-23","price":3.533},{"date":"2023-10-30","price":3.473},{"date":"2023-11-06","price":3.396},{"date":"2023-11-13","price":3.349},{"date":"2023-11-20","price":3.289},{"date":"2023-11-27","price":3.238},{"date":"2023-12-04","price":3.231},{"date":"2023-12-11","price":3.136},{"date":"2023-12-18","price":3.053},{"date":"2023-12-25","price":3.116},{"date":"2024-01-01","price":3.089},{"date":"2024-01-08","price":3.073},{"date":"2024-01-15","price":3.058},{"date":"2024-01-22","price":3.062},{"date":"2024-01-29","price":3.095},{"date":"2024-02-05","price":3.136},{"date":"2024-02-12","price":3.192},{"date":"2024-02-19","price":3.269},{"date":"2024-02-26","price":3.249},{"date":"2024-03-04","price":3.35},{"date":"2024-03-11","price":3.376},{"date":"2024-03-18","price":3.453},{"date":"2024-03-25","price":3.523},{"date":"2024-04-01","price":3.517},{"date":"2024-04-08","price":3.591},{"date":"2024-04-15","price":3.628},{"date":"2024-04-22","price":3.668},{"date":"2024-04-29","price":3.653},{"date":"2024-05-06","price":3.643},{"date":"2024-05-13","price":3.608},{"date":"2024-05-20","price":3.584},{"date":"2024-05-27","price":3.577},{"date":"2024-06-03","price":3.516},{"date":"2024-06-10","price":3.429},{"date":"2024-06-17","price":3.435},{"date":"2024-06-24","price":3.438},{"date":"2024-07-01","price":3.479},{"date":"2024-07-08","price":3.489},{"date":"2024-07-15","price":3.496},{"date":"2024-07-22","price":3.471},{"date":"2024-07-29","price":3.484},{"date":"2024-08-05","price":3.448},{"date":"2024-08-12","price":3.414},{"date":"2024-08-19","price":3.382},{"date":"2024-08-26","price":3.313},{"date":"2024-09-02","price":3.289},{"date":"2024-09-09","price":3.236},{"date":"2024-09-16","price":3.18},{"date":"2024-09-23","price":3.185},{"date":"2024-09-30","price":3.179},{"date":"2024-10-07","price":3.136},{"date":"2024-10-14","price":3.171},{"date":"2024-10-21","price":3.144},{"date":"2024-10-28","price":3.097},{"date":"2024-11-04","price":3.069},{"date":"2024-11-11","price":3.052},{"date":"2024-11-18","price":3.046},{"date":"2024-11-25","price":3.044},{"date":"2024-12-02","price":3.034},{"date":"2024-12-09","price":3.008},{"date":"2024-12-16","price":3.016},{"date":"2024-12-23","price":3.024},{"date":"2024-12-30","price":3.006},{"date":"2025-01-06","price":3.047},{"date":"2025-01-13","price":3.043},{"date":"2025-01-20","price":3.109},{"date":"2025-01-27","price":3.103},{"date":"2025-02-03","price":3.082},{"date":"2025-02-10","price":3.128},{"date":"2025-02-17","price":3.148},{"date":"2025-02-24","price":3.125},{"date":"2025-03-03","price":3.078},{"date":"2025-03-10","price":3.069},{"date":"2025-03-17","price":3.058},{"date":"2025-03-24","price":3.115},{"date":"2025-03-31","price":3.162},{"date":"2025-04-07","price":3.243},{"date":"2025-04-14","price":3.168},{"date":"2025-04-21","price":3.141},{"date":"2025-04-28","price":3.133},{"date":"2025-05-05","price":3.147},{"date":"2025-05-12","price":3.12},{"date":"2025-05-19","price":3.173},{"date":"2025-05-26","price":3.16},{"date":"2025-06-02","price":3.127},{"date":"2025-06-09","price":3.108},{"date":"2025-06-16","price":3.139},{"date":"2025-06-23","price":3.213}],"c845080ee9":[{"car":"BMW 3 Series Sedan","horsepower":386,"price":164257,"type":"Sedan","enginetype":"Petrol"},{"car":"BMW X1","horsepower":313,"price":264000,"type":"SUV","enginetype":"Petrol"},{"car":"Audi RS Q8","horsepower":600,"price":630000,"type":"SUV","enginetype":"Petrol"},{"car":"Audi RS3","horsepower":400,"price":310000,"type":"Sedan","enginetype":"Petrol"},{"car":"Audi A3","horsepower":180,"price":165000,"type":"Sedan","enginetype":"Petrol"},{"car":"Mercedes Maybach","horsepower":612,"price":1281000,"type":"Sedan","enginetype":"Petrol"},{"car":"Mercedes G-Wagon","horsepower":585,"price":1011500,"type":"SUV","enginetype":"Petrol"},{"car":"Mercedes EQS","horsepower":333,"price":564500,"type":"SUV","enginetype":"Electric"},{"car":"Mercedes GLA","horsepower":163,"price":209500,"type":"SUV","enginetype":"Petrol"},{"car":"Mercedes GLB 200","horsepower":221,"price":168997,"type":"SUV","enginetype":"Hybrid"},{"car":"Porsche 991 Carrera S","horsepower":473,"price":530000,"type":"Coupe","enginetype":"Petrol"},{"car":"Porsche Cayenne","horsepower":453,"price":371500,"type":"SUV","enginetype":"Petrol"},{"car":"Porsche Macan Standard","horsepower":252,"price":137000,"type":"SUV","enginetype":"Petrol"},{"car":"Volkswagen Touareg","horsepower":250,"price":199000,"type":"SUV","enginetype":"Petrol"},{"car":"Volkswagen Golf","horsepower":245,"price":139000,"type":"Hatchback","enginetype":"Petrol"},{"car":"Volkswagen Tiguan","horsepower":150,"price":99900,"type":"SUV","enginetype":"Petrol"},{"car":"Volkswagen T-Roc","horsepower":150,"price":88900,"type":"SUV","enginetype":"Petrol"},{"car":"Bugatti Chiron","horsepower":1578,"price":13103960,"type":"Coupe","enginetype":"Petrol"},{"car":"Bugatti Centodieci","horsepower":1600,"price":33000000,"type":"Coupe","enginetype":"Petrol"},{"car":"Maserati Quattroporte","horsepower":350,"price":458000,"type":"Sedan","enginetype":"Petrol"},{"car":"Maserati Ghibli","horsepower":330,"price":362500,"type":"Sedan","enginetype":"Petrol"},{"car":"Maserati Grecale","horsepower":300,"price":289000,"type":"SUV","enginetype":"Petrol"},{"car":"Toyota Yaris","horsepower":97,"price":57300,"type":"Sedan","enginetype":"Petrol"},{"car":"Toyota Raize","horsepower":87,"price":57700,"type":"SUV","enginetype":"Petrol"},{"car":"Toyota RAV4 Adventure","horsepower":203,"price":130900,"type":"SUV","enginetype":"Petrol"},{"car":"Toyota Rav4 Hybrid","horsepower":219,"price":117700,"type":"SUV","enginetype":"Hybrid"},{"car":"Toyota Fortuner","horsepower":164,"price":124000,"type":"SUV","enginetype":"Petrol"},{"car":"Toyota Supra","horsepower":382,"price":220000,"type":"Coupe","enginetype":"Petrol"},{"car":"Honda Civic Type R","horsepower":315,"price":189999,"type":"Hatchback","enginetype":"Petrol"},{"car":"Honda CR-V","horsepower":184,"price":119999,"type":"SUV","enginetype":"Petrol"},{"car":"Honda City","horsepower":118,"price":61999,"type":"Sedan","enginetype":"Petrol"},{"car":"Lexus RC F","horsepower":471,"price":320000,"type":"Coupe","enginetype":"Petrol"},{"car":"Lexus LC 500","horsepower":471,"price":395000,"type":"Coupe","enginetype":"Petrol"},{"car":"Lexus UX 200","horsepower":169,"price":137000,"type":"SUV","enginetype":"Petrol"},{"car":"Lexus LX","horsepower":509,"price":475000,"type":"SUV","enginetype":"Petrol"},{"car":"Mazda MX-5","horsepower":181,"price":140000,"type":"Sedan","enginetype":"Petrol"},{"car":"Mazda CX-5","horsepower":152,"price":105000,"type":"SUV","enginetype":"Petrol"},{"car":"Mazda 3","horsepower":153,"price":81500,"type":"Sedan","enginetype":"Petrol"},{"car":"Mazda CX-3","horsepower":148,"price":72500,"type":"SUV","enginetype":"Petrol"},{"car":"Mitsubishi Montero","horsepower":181,"price":117000,"type":"SUV","enginetype":"Petrol"},{"car":"Mitsubishi Xpander","horsepower":105,"price":65000,"type":"SUV","enginetype":"Petrol"},{"car":"Mitsubishi Attrage","horsepower":76,"price":45000,"type":"Sedan","enginetype":"Petrol"},{"car":"Nissan Nissan Patrol","horsepower":316,"price":222500,"type":"SUV","enginetype":"Petrol"},{"car":"Nissan Nissan Patrol Safari","horsepower":280,"price":164500,"type":"SUV","enginetype":"Petrol"},{"car":"Nissan Sunny","horsepower":118,"price":58500,"type":"Sedan","enginetype":"Petrol"},{"car":"Toyota Land Cruiser","horsepower":326,"price":228700,"type":"SUV","enginetype":"Hybrid"},{"car":"Toyota Camry","horsepower":181,"price":103300,"type":"Sedan","enginetype":"Hybrid"},{"car":"Toyota Corolla","horsepower":121,"price":73700,"type":"Sedan","enginetype":"Hybrid"},{"car":"Chery Tiggo 8 Pro Max","horsepower":254,"price":112200,"type":"SUV","enginetype":"Petrol"},{"car":"Chery Arrizo 8","horsepower":250,"price":91000,"type":"Sedan","enginetype":"Petrol"},{"car":"Geely Lynk & Co 08 EM-P","horsepower":380,"price":165000,"type":"SUV","enginetype":"Petrol"},{"car":"Geely Monjaro","horsepower":235,"price":118000,"type":"SUV","enginetype":"Petrol"},{"car":"Geely Emgrand","horsepower":102,"price":49400,"type":"Sedan","enginetype":"Petrol"},{"car":"Jetour X90 Plus","horsepower":197,"price":99000,"type":"SUV","enginetype":"Petrol"},{"car":"Jetour X70 Plus","horsepower":154,"price":76000,"type":"SUV","enginetype":"Petrol"},{"car":"MG RX8","horsepower":220,"price":103000,"type":"SUV","enginetype":"Petrol"},{"car":"MG MG One","horsepower":181,"price":73000,"type":"SUV","enginetype":"Petrol"},{"car":"MG MG 5","horsepower":112,"price":46000,"type":"Sedan","enginetype":"Petrol"},{"car":"Hyundai Ioniq 5","horsepower":302,"price":190900,"type":"SUV","enginetype":"Electric"},{"car":"Hyundai Tuscon","horsepower":156,"price":90900,"type":"SUV","enginetype":"Petrol"},{"car":"Hyundai Accent","horsepower":130,"price":58900,"type":"Sedan","enginetype":"Petrol"},{"car":"Kia EV9","horsepower":215,"price":345000,"type":"SUV","enginetype":"Electric"},{"car":"Kia K8","horsepower":300,"price":123000,"type":"Sedan","enginetype":"Hybrid"},{"car":"Kia K5","horsepower":150,"price":96000,"type":"Sedan","enginetype":"Petrol"},{"car":"Kia Pegas","horsepower":95,"price":47000,"type":"Sedan","enginetype":"Petrol"},{"car":"Volvo XC90","horsepower":249,"price":245000,"type":"SUV","enginetype":"Hybrid"},{"car":"Volvo Volvo XC60","horsepower":250,"price":190000,"type":"SUV","enginetype":"Hybrid"},{"car":"Volvo XC40","horsepower":197,"price":160000,"type":"SUV","enginetype":"Hybrid"},{"car":"Bentley Flying Spur","horsepower":521,"price":1300000,"type":"Sedan","enginetype":"Hybrid"},{"car":"Bentley Continental GT","horsepower":521,"price":1150000,"type":"Coupe","enginetype":"Hybrid"},{"car":"Bentley Bentyaga","horsepower":542,"price":990000,"type":"SUV","enginetype":"Petrol"},{"car":"Jaguar I-Pace","horsepower":395,"price":355200,"type":"SUV","enginetype":"Electric"},{"car":"Land Rover Defender","horsepower":517,"price":232500,"type":"SUV","enginetype":"Hybrid"},{"car":"Land Rover Range Rover","horsepower":376,"price":204800,"type":"SUV","enginetype":"Petrol"},{"car":"Land Rover Range Rover Evoque","horsepower":200,"price":221800,"type":"SUV","enginetype":"Petrol"},{"car":"Lotus Evija","horsepower":1973,"price":8010200,"type":"Coupe","enginetype":"Electric"},{"car":"McLaren Senna","horsepower":800,"price":5000000,"type":"Coupe","enginetype":"Petrol"},{"car":"McLaren 720S","horsepower":710,"price":1120000,"type":"Coupe","enginetype":"Petrol"},{"car":"McLaren Artura","horsepower":671,"price":945700,"type":"Coupe","enginetype":"Hybrid"},{"car":"Cadillac XT5","horsepower":237,"price":174400,"type":"SUV","enginetype":"Petrol"},{"car":"Cadillac CT4","horsepower":240,"price":141300,"type":"Sedan","enginetype":"Petrol"},{"car":"Ford Bronco Raptor","horsepower":418,"price":359000,"type":"SUV","enginetype":"Petrol"},{"car":"Cadillac Escalade","horsepower":420,"price":341900,"type":"SUV","enginetype":"Petrol"},{"car":"Ford Explorer","horsepower":290,"price":159000,"type":"SUV","enginetype":"Petrol"},{"car":"Ford Figo","horsepower":84,"price":37400,"type":"Hatchback","enginetype":"Petrol"},{"car":"Tesla Model X","horsepower":670,"price":318490,"type":"SUV","enginetype":"Electric"},{"car":"Tesla Model Y","horsepower":342,"price":188490,"type":"SUV","enginetype":"Electric"},{"car":"Tesla Model 3","horsepower":460,"price":158490,"type":"Sedan","enginetype":"Electric"},{"car":"BYD Seal","horsepower":204,"price":164000,"type":"Sedan","enginetype":"Electric"},{"car":"BYD Atto 3","horsepower":201,"price":148500,"type":"SUV","enginetype":"Electric"},{"car":"Jetour T2","horsepower":254,"price":129000,"type":"SUV","enginetype":"Petrol"},{"car":"Chery Arrizo 5","horsepower":114,"price":53000,"type":"Sedan","enginetype":"Petrol"},{"car":"Bestune B70","horsepower":145,"price":59000,"type":"Sedan","enginetype":"Petrol"},{"car":"MG ZS","horsepower":112,"price":59000,"type":"SUV","enginetype":"Petrol"},{"car":"Kia Telluride","horsepower":291,"price":205000,"type":"SUV","enginetype":"Petrol"},{"car":"Toyota Crown","horsepower":345,"price":173000,"type":"Sedan","enginetype":"Hybrid"},{"car":"BMW X3","horsepower":248,"price":305000,"type":"SUV","enginetype":"Petrol"},{"car":"BMW 8 Series Gran Coupe","horsepower":340,"price":435000,"type":"Coupe","enginetype":"Petrol"},{"car":"BMW 2 Series Coupe","horsepower":252,"price":224500,"type":"Coupe","enginetype":"Petrol"},{"car":"Subaru BRZ 2025","horsepower":237,"price":125000,"type":"Coupe","enginetype":"Petrol"},{"car":"Kia Picanto","horsepower":84,"price":58000,"type":"Hatchback","enginetype":"Petrol"},{"car":"Bestune Oley","horsepower":101,"price":35000,"type":"Hatchback","enginetype":"Petrol"},{"car":"Mitsubishi Mirage","horsepower":77,"price":44000,"type":"Hatchback","enginetype":"Petrol"},{"car":"Hyundai Grand i10","horsepower":86,"price":46900,"type":"Hatchback","enginetype":"Petrol"},{"car":"MG MG3 Luxury","horsepower":109,"price":57000,"type":"Hatchback","enginetype":"Petrol"}],"fe320c7a55":[{"Entity":"China","Year":2000,"num_objects":6},{"Entity":"China","Year":2001,"num_objects":2},{"Entity":"China","Year":2002,"num_objects":7},{"Entity":"China","Year":2003,"num_objects":9},{"Entity":"China","Year":2004,"num_objects":11},{"Entity":"China","Year":2005,"num_objects":7},{"Entity":"China","Year":2006,"num_objects":13},{"Entity":"China","Year":2007,"num_objects":10},{"Entity":"China","Year":2008,"num_objects":17},{"Entity":"China","Year":2009,"num_objects":8},{"Entity":"China","Year":2010,"num_objects":20},{"Entity":"China","Year":2011,"num_objects":20},{"Entity":"China","Year":2012,"num_objects":26},{"Entity":"China","Year":2013,"num_objects":19},{"Entity":"China","Year":2014,"num_objects":25},{"Entity":"China","Year":2015,"num_objects":38},{"Entity":"China","Year":2016,"num_objects":38},{"Entity":"China","Year":2017,"num_objects":32},{"Entity":"China","Year":2018,"num_objects":95},{"Entity":"China","Year":2019,"num_objects":82},{"Entity":"China","Year":2020,"num_objects":73},{"Entity":"China","Year":2021,"num_objects":110},{"Entity":"China","Year":2022,"num_objects":182},{"Entity":"China","Year":2023,"num_objects":128},{"Entity":"Russia","Year":2000,"num_objects":23},{"Entity":"Russia","Year":2001,"num_objects":30},{"Entity":"Russia","Year":2002,"num_objects":19},{"Entity":"Russia","Year":2003,"num_objects":22},{"Entity":"Russia","Year":2004,"num_objects":19},{"Entity":"Russia","Year":2005,"num_objects":19},{"Entity":"Russia","Year":2006,"num_objects":16},{"Entity":"Russia","Year":2007,"num_objects":18},{"Entity":"Russia","Year":2008,"num_objects":21},{"Entity":"Russia","Year":2009,"num_objects":30},{"Entity":"Russia","Year":2010,"num_objects":24},{"Entity":"Russia","Year":2011,"num_objects":24},{"Entity":"Russia","Year":2012,"num_objects":23},{"Entity":"Russia","Year":2013,"num_objects":29},{"Entity":"Russia","Year":2014,"num_objects":35},{"Entity":"Russia","Year":2015,"num_objects":27},{"Entity":"Russia","Year":2016,"num_objects":14},{"Entity":"Russia","Year":2017,"num_objects":25},{"Entity":"Russia","Year":2018,"num_objects":23},{"Entity":"Russia","Year":2019,"num_objects":30},{"Entity":"Russia","Year":2020,"num_objects":24},{"Entity":"Russia","Year":2021,"num_objects":21},{"Entity":"Russia","Year":2022,"num_objects":50},{"Entity":"Russia","Year":2023,"num_objects":62}],"c3925ad964":[{"species":"Adelie","body_mass":3701},{"species":"Gentoo","body_mass":5076},{"species":"Chinstrap","body_mass":3733}],"bf708b40a2":[{"date":"2019-01-07","price":2.237},{"date":"2019-01-14","price":2.247},{"date":"2019-01-21","price":2.251},{"date":"2019-01-28","price":2.256},{"date":"2019-02-04","price":2.254},{"date":"2019-02-11","price":2.276},{"date":"2019-02-18","price":2.317},{"date":"2019-02-25","price":2.39},{"date":"2019-03-04","price":2.422},{"date":"2019-03-11","price":2.471},{"date":"2019-03-18","price":2.548},{"date":"2019-03-25","price":2.623},{"date":"2019-04-01","price":2.691},{"date":"2019-04-08","price":2.745},{"date":"2019-04-15","price":2.828},{"date":"2019-04-22","price":2.841},{"date":"2019-04-29","price":2.887},{"date":"2019-05-06","price":2.897},{"date":"2019-05-13","price":2.866},{"date":"2019-05-20","price":2.852},{"date":"2019-05-27","price":2.822},{"date":"2019-06-03","price":2.807},{"date":"2019-06-10","price":2.732},{"date":"2019-06-17","price":2.67},{"date":"2019-06-24","price":2.654},{"date":"2019-07-01","price":2.713},{"date":"2019-07-08","price":2.743},{"date":"2019-07-15","price":2.779},{"date":"2019-07-22","price":2.75},{"date":"2019-07-29","price":2.715},{"date":"2019-08-05","price":2.688},{"date":"2019-08-12","price":2.624},{"date":"2019-08-19","price":2.598},{"date":"2019-08-26","price":2.574},{"date":"2019-09-02","price":2.563},{"date":"2019-09-09","price":2.55},{"date":"2019-09-16","price":2.552},{"date":"2019-09-23","price":2.654},{"date":"2019-09-30","price":2.642},{"date":"2019-10-07","price":2.645},{"date":"2019-10-14","price":2.629},{"date":"2019-10-21","price":2.638},{"date":"2019-10-28","price":2.596},{"date":"2019-11-04","price":2.605},{"date":"2019-11-11","price":2.615},{"date":"2019-11-18","price":2.592},{"date":"2019-11-25","price":2.579},{"date":"2019-12-02","price":2.575},{"date":"2019-12-09","price":2.561},{"date":"2019-12-16","price":2.536},{"date":"2019-12-23","price":2.532},{"date":"2019-12-30","price":2.571},{"date":"2020-01-06","price":2.578},{"date":"2020-01-13","price":2.57},{"date":"2020-01-20","price":2.537},{"date":"2020-01-27","price":2.506},{"date":"2020-02-03","price":2.455},{"date":"2020-02-10","price":2.419},{"date":"2020-02-17","price":2.428},{"date":"2020-02-24","price":2.466},{"date":"2020-03-02","price":2.423},{"date":"2020-03-09","price":2.375},{"date":"2020-03-16","price":2.248},{"date":"2020-03-23","price":2.12},{"date":"2020-03-30","price":2.005},{"date":"2020-04-06","price":1.924},{"date":"2020-04-13","price":1.853},{"date":"2020-04-20","price":1.812},{"date":"2020-04-27","price":1.773},{"date":"2020-05-04","price":1.789},{"date":"2020-05-11","price":1.851},{"date":"2020-05-18","price":1.878},{"date":"2020-05-25","price":1.96},{"date":"2020-06-01","price":1.974},{"date":"2020-06-08","price":2.036},{"date":"2020-06-15","price":2.098},{"date":"2020-06-22","price":2.129},{"date":"2020-06-29","price":2.174},{"date":"2020-07-06","price":2.177},{"date":"2020-07-13","price":2.195},{"date":"2020-07-20","price":2.186},{"date":"2020-07-27","price":2.175},{"date":"2020-08-03","price":2.176},{"date":"2020-08-10","price":2.166},{"date":"2020-08-17","price":2.166},{"date":"2020-08-24","price":2.182},{"date":"2020-08-31","price":2.222},{"date":"2020-09-07","price":2.211},{"date":"2020-09-14","price":2.183},{"date":"2020-09-21","price":2.168},{"date":"2020-09-28","price":2.169},{"date":"2020-10-05","price":2.172},{"date":"2020-10-12","price":2.167},{"date":"2020-10-19","price":2.15},{"date":"2020-10-26","price":2.143},{"date":"2020-11-02","price":2.112},{"date":"2020-11-09","price":2.096},{"date":"2020-11-16","price":2.111},{"date":"2020-11-23","price":2.102},{"date":"2020-11-30","price":2.12},{"date":"2020-12-07","price":2.156},{"date":"2020-12-14","price":2.158},{"date":"2020-12-21","price":2.224},{"date":"2020-12-28","price":2.243},{"date":"2021-01-04","price":2.249},{"date":"2021-01-11","price":2.317},{"date":"2021-01-18","price":2.379},{"date":"2021-01-25","price":2.392},{"date":"2021-02-01","price":2.409},{"date":"2021-02-08","price":2.461},{"date":"2021-02-15","price":2.501},{"date":"2021-02-22","price":2.633},{"date":"2021-03-01","price":2.711},{"date":"2021-03-08","price":2.771},{"date":"2021-03-15","price":2.853},{"date":"2021-03-22","price":2.865},{"date":"2021-03-29","price":2.852},{"date":"2021-04-05","price":2.857},{"date":"2021-04-12","price":2.849},{"date":"2021-04-19","price":2.855},{"date":"2021-04-26","price":2.872},{"date":"2021-05-03","price":2.89},{"date":"2021-05-10","price":2.961},{"date":"2021-05-17","price":3.028},{"date":"2021-05-24","price":3.02},{"date":"2021-05-31","price":3.027},{"date":"2021-06-07","price":3.035},{"date":"2021-06-14","price":3.069},{"date":"2021-06-21","price":3.06},{"date":"2021-06-28","price":3.091},{"date":"2021-07-05","price":3.122},{"date":"2021-07-12","price":3.133},{"date":"2021-07-19","price":3.153},{"date":"2021-07-26","price":3.136},{"date":"2021-08-02","price":3.159},{"date":"2021-08-09","price":3.172},{"date":"2021-08-16","price":3.174},{"date":"2021-08-23","price":3.145},{"date":"2021-08-30","price":3.139},{"date":"2021-09-06","price":3.176},{"date":"2021-09-13","price":3.165},{"date":"2021-09-20","price":3.184},{"date":"2021-09-27","price":3.175},{"date":"2021-10-04","price":3.19},{"date":"2021-10-11","price":3.267},{"date":"2021-10-18","price":3.322},{"date":"2021-10-25","price":3.383},{"date":"2021-11-01","price":3.39},{"date":"2021-11-08","price":3.41},{"date":"2021-11-15","price":3.399},{"date":"2021-11-22","price":3.395},{"date":"2021-11-29","price":3.38},{"date":"2021-12-06","price":3.341},{"date":"2021-12-13","price":3.315},{"date":"2021-12-20","price":3.295},{"date":"2021-12-27","price":3.275},{"date":"2022-01-03","price":3.281},{"date":"2022-01-10","price":3.295},{"date":"2022-01-17","price":3.306},{"date":"2022-01-24","price":3.323},{"date":"2022-01-31","price":3.368},{"date":"2022-02-07","price":3.444},{"date":"2022-02-14","price":3.487},{"date":"2022-02-21","price":3.53},{"date":"2022-02-28","price":3.608},{"date":"2022-03-07","price":4.102},{"date":"2022-03-14","price":4.315},{"date":"2022-03-21","price":4.239},{"date":"2022-03-28","price":4.231},{"date":"2022-04-04","price":4.17},{"date":"2022-04-11","price":4.091},{"date":"2022-04-18","price":4.066},{"date":"2022-04-25","price":4.107},{"date":"2022-05-02","price":4.182},{"date":"2022-05-09","price":4.328},{"date":"2022-05-16","price":4.491},{"date":"2022-05-23","price":4.593},{"date":"2022-05-30","price":4.624},{"date":"2022-06-06","price":4.876},{"date":"2022-06-13","price":5.006},{"date":"2022-06-20","price":4.962},{"date":"2022-06-27","price":4.872},{"date":"2022-07-04","price":4.771},{"date":"2022-07-11","price":4.646},{"date":"2022-07-18","price":4.49},{"date":"2022-07-25","price":4.33},{"date":"2022-08-01","price":4.192},{"date":"2022-08-08","price":4.038},{"date":"2022-08-15","price":3.938},{"date":"2022-08-22","price":3.88},{"date":"2022-08-29","price":3.827},{"date":"2022-09-05","price":3.746},{"date":"2022-09-12","price":3.69},{"date":"2022-09-19","price":3.654},{"date":"2022-09-26","price":3.711},{"date":"2022-10-03","price":3.782},{"date":"2022-10-10","price":3.912},{"date":"2022-10-17","price":3.871},{"date":"2022-10-24","price":3.769},{"date":"2022-10-31","price":3.742},{"date":"2022-11-07","price":3.796},{"date":"2022-11-14","price":3.762},{"date":"2022-11-21","price":3.648},{"date":"2022-11-28","price":3.534},{"date":"2022-12-05","price":3.39},{"date":"2022-12-12","price":3.239},{"date":"2022-12-19","price":3.12},{"date":"2022-12-26","price":3.091},{"date":"2023-01-02","price":3.223},{"date":"2023-01-09","price":3.259},{"date":"2023-01-16","price":3.31},{"date":"2023-01-23","price":3.415},{"date":"2023-01-30","price":3.489},{"date":"2023-02-06","price":3.444},{"date":"2023-02-13","price":3.39},{"date":"2023-02-20","price":3.379},{"date":"2023-02-27","price":3.342},{"date":"2023-03-06","price":3.389},{"date":"2023-03-13","price":3.456},{"date":"2023-03-20","price":3.422},{"date":"2023-03-27","price":3.421},{"date":"2023-04-03","price":3.497},{"date":"2023-04-10","price":3.596},{"date":"2023-04-17","price":3.663},{"date":"2023-04-24","price":3.656},{"date":"2023-05-01","price":3.6},{"date":"2023-05-08","price":3.533},{"date":"2023-05-15","price":3.536},{"date":"2023-05-22","price":3.534},{"date":"2023-05-29","price":3.571},{"date":"2023-06-05","price":3.541},{"date":"2023-06-12","price":3.595},{"date":"2023-06-19","price":3.577},{"date":"2023-06-26","price":3.571},{"date":"2023-07-03","price":3.527},{"date":"2023-07-10","price":3.546},{"date":"2023-07-17","price":3.559},{"date":"2023-07-24","price":3.596},{"date":"2023-07-31","price":3.757},{"date":"2023-08-07","price":3.828},{"date":"2023-08-14","price":3.85},{"date":"2023-08-21","price":3.868},{"date":"2023-08-28","price":3.813},{"date":"2023-09-04","price":3.807},{"date":"2023-09-11","price":3.822},{"date":"2023-09-18","price":3.878},{"date":"2023-09-25","price":3.837},{"date":"2023-10-02","price":3.798},{"date":"2023-10-09","price":3.684},{"date":"2023-10-16","price":3.576},{"date":"2023-10-23","price":3.533},{"date":"2023-10-30","price":3.473},{"date":"2023-11-06","price":3.396},{"date":"2023-11-13","price":3.349},{"date":"2023-11-20","price":3.289},{"date":"2023-11-27","price":3.238},{"date":"2023-12-04","price":3.231},{"date":"2023-12-11","price":3.136},{"date":"2023-12-18","price":3.053},{"date":"2023-12-25","price":3.116},{"date":"2024-01-01","price":3.089},{"date":"2024-01-08","price":3.073},{"date":"2024-01-15","price":3.058},{"date":"2024-01-22","price":3.062},{"date":"2024-01-29","price":3.095},{"date":"2024-02-05","price":3.136},{"date":"2024-02-12","price":3.192},{"date":"2024-02-19","price":3.269},{"date":"2024-02-26","price":3.249},{"date":"2024-03-04","price":3.35},{"date":"2024-03-11","price":3.376},{"date":"2024-03-18","price":3.453},{"date":"2024-03-25","price":3.523},{"date":"2024-04-01","price":3.517},{"date":"2024-04-08","price":3.591},{"date":"2024-04-15","price":3.628},{"date":"2024-04-22","price":3.668},{"date":"2024-04-29","price":3.653},{"date":"2024-05-06","price":3.643},{"date":"2024-05-13","price":3.608},{"date":"2024-05-20","price":3.584},{"date":"2024-05-27","price":3.577},{"date":"2024-06-03","price":3.516},{"date":"2024-06-10","price":3.429},{"date":"2024-06-17","price":3.435},{"date":"2024-06-24","price":3.438},{"date":"2024-07-01","price":3.479},{"date":"2024-07-08","price":3.489},{"date":"2024-07-15","price":3.496},{"date":"2024-07-22","price":3.471},{"date":"2024-07-29","price":3.484},{"date":"2024-08-05","price":3.448},{"date":"2024-08-12","price":3.414},{"date":"2024-08-19","price":3.382},{"date":"2024-08-26","price":3.313},{"date":"2024-09-02","price":3.289},{"date":"2024-09-09","price":3.236},{"date":"2024-09-16","price":3.18},{"date":"2024-09-23","price":3.185},{"date":"2024-09-30","price":3.179},{"date":"2024-10-07","price":3.136},{"date":"2024-10-14","price":3.171},{"date":"2024-10-21","price":3.144},{"date":"2024-10-28","price":3.097},{"date":"2024-11-04","price":3.069},{"date":"2024-11-11","price":3.052},{"date":"2024-11-18","price":3.046},{"date":"2024-11-25","price":3.044},{"date":"2024-12-02","price":3.034},{"date":"2024-12-09","price":3.008},{"date":"2024-12-16","price":3.016},{"date":"2024-12-23","price":3.024},{"date":"2024-12-30","price":3.006},{"date":"2025-01-06","price":3.047},{"date":"2025-01-13","price":3.043},{"date":"2025-01-20","price":3.109},{"date":"2025-01-27","price":3.103},{"date":"2025-02-03","price":3.082},{"date":"2025-02-10","price":3.128},{"date":"2025-02-17","price":3.148},{"date":"2025-02-24","price":3.125},{"date":"2025-03-03","price":3.078},{"date":"2025-03-10","price":3.069},{"date":"2025-03-17","price":3.058},{"date":"2025-03-24","price":3.115},{"date":"2025-03-31","price":3.162},{"date":"2025-04-07","price":3.243},{"date":"2025-04-14","price":3.168},{"date":"2025-04-21","price":3.141},{"date":"2025-04-28","price":3.133},{"date":"2025-05-05","price":3.147},{"date":"2025-05-12","price":3.12},{"date":"2025-05-19","price":3.173},{"date":"2025-05-26","price":3.16},{"date":"2025-06-02","price":3.127},{"date":"2025-06-09","price":3.108},{"date":"2025-06-16","price":3.139},{"date":"2025-06-23","price":3.213}],"352b75c8eb":[{"Subcategory":"Active recreation","hoursPerDay":0.42,"uncertainty":0.05},{"Subcategory":"Allocation","hoursPerDay":0.91,"uncertainty":0.06},{"Subcategory":"Artifacts","hoursPerDay":0.42,"uncertainty":0.02},{"Subcategory":"Buildings","hoursPerDay":0.22,"uncertainty":0.08},{"Subcategory":"Energy","hoursPerDay":0.04,"uncertainty":0.01},{"Subcategory":"Food growth & collection","hoursPerDay":0.81,"uncertainty":0.05},{"Subcategory":"Food preparation","hoursPerDay":0.92,"uncertainty":0.07},{"Subcategory":"Food processing","hoursPerDay":0.07,"uncertainty":0.01},{"Subcategory":"Health care","hoursPerDay":0.2,"uncertainty":0.2},{"Subcategory":"Human transportation","hoursPerDay":0.9,"uncertainty":0.22},{"Subcategory":"Hygiene & grooming","hoursPerDay":1.05,"uncertainty":0.2},{"Subcategory":"Infrastructure","hoursPerDay":0.05,"uncertainty":0},{"Subcategory":"Inhabited environment","hoursPerDay":0.75,"uncertainty":0.06},{"Subcategory":"Interactive","hoursPerDay":0.88,"uncertainty":0.12},{"Subcategory":"Material transportation","hoursPerDay":0.31,"uncertainty":0.05},{"Subcategory":"Materials","hoursPerDay":0.07,"uncertainty":0.01},{"Subcategory":"Meals","hoursPerDay":1.6,"uncertainty":0.22},{"Subcategory":"Passive","hoursPerDay":2.59,"uncertainty":0.24},{"Subcategory":"Physical child care","hoursPerDay":0.29,"uncertainty":0.03},{"Subcategory":"Religious practice","hoursPerDay":0.2,"uncertainty":0.05},{"Subcategory":"Schooling & research","hoursPerDay":1.07,"uncertainty":0.07},{"Subcategory":"Sleep & bedrest","hoursPerDay":9.1,"uncertainty":0.39},{"Subcategory":"Social","hoursPerDay":1.12,"uncertainty":0.1},{"Subcategory":"Waste management","hoursPerDay":0.01,"uncertainty":0}],"faf50efcec":[{"country":"Russia","internet_share":0.2867475398657202,"map_country":"Russia"},{"country":"Canada","internet_share":0.773937794060837,"map_country":"Canada"},{"country":"United States","internet_share":0.7682849393106482,"map_country":"United States"},{"country":"China","internet_share":0.2869382092124107,"map_country":"China"},{"country":"Brazil","internet_share":0.3749294595550384,"map_country":"Brazil"},{"country":"Australia","internet_share":0.7024288710795106,"map_country":"Australia"},{"country":"India","internet_share":0.049612380287839,"map_country":"India"},{"country":"Argentina","internet_share":0.3182847006675797,"map_country":"Argentina"},{"country":"Kazakhstan","internet_share":0.2952283872094962,"map_country":"Kazakhstan"},{"country":"Congo, Democratic Republic of the","internet_share":0.0037451372621217,"map_country":"COD"},{"country":"Greenland","internet_share":0.6236141906873615,"map_country":"Greenland"},{"country":"Saudi Arabia","internet_share":0.3574199153031088,"map_country":"Saudi Arabia"},{"country":"Mexico","internet_share":0.2578839689240673,"map_country":"Mexico"},{"country":"Indonesia","internet_share":0.0788613546528276,"map_country":"Indonesia"},{"country":"Sudan","internet_share":0.1183691003889185,"map_country":"Sudan"},{"country":"Libya","internet_share":0.0566768318756011,"map_country":"Libya"},{"country":"Iran","internet_share":0.1016072186300484,"map_country":"Iran"},{"country":"Mongolia","internet_share":0.1117435722049715,"map_country":"Mongolia"},{"country":"Peru","internet_share":0.3037687324189865,"map_country":"Peru"},{"country":"Chad","internet_share":0.0147299705479452,"map_country":"Chad"},{"country":"Niger","internet_share":0.0066356841098324,"map_country":"Niger"},{"country":"Mali","internet_share":0.0151799630807255,"map_country":"Mali"},{"country":"South Africa","internet_share":0.0913682908000503,"map_country":"South Africa"},{"country":"Colombia","internet_share":0.4873576657968052,"map_country":"Colombia"},{"country":"Ethiopia","internet_share":0.004628831558527,"map_country":"Ethiopia"},{"country":"Bolivia","internet_share":0.1037484317808441,"map_country":"Bolivia"},{"country":"Mauritania","internet_share":0.0213261692569905,"map_country":"Mauritania"},{"country":"Egypt","internet_share":0.2317276835141185,"map_country":"Egypt"},{"country":"Tanzania","internet_share":0.0136585772299269,"map_country":"Tanzania"},{"country":"Venezuela","internet_share":0.3089181746489927,"map_country":"Venezuela"},{"country":"Namibia","internet_share":0.057996566603257,"map_country":"Namibia"},{"country":"Mozambique","internet_share":0.0248500089745143,"map_country":"Mozambique"},{"country":"Pakistan","internet_share":0.1041471368483489,"map_country":"Pakistan"},{"country":"Turkey","internet_share":0.3336584521482346,"map_country":"Turkey"},{"country":"Chile","internet_share":0.4036536965729,"map_country":"Chile"},{"country":"Zambia","internet_share":0.0557570598910202,"map_country":"Zambia"},{"country":"Burma","internet_share":0.0019732267924805,"map_country":"MMR"},{"country":"Afghanistan","internet_share":0.0314239630594973,"map_country":"Afghanistan"},{"country":"France","internet_share":0.6831070768154527,"map_country":"France"},{"country":"Somalia","internet_share":0.0101648986295894,"map_country":"Somalia"},{"country":"Central African Republic","internet_share":0.0042819582342341,"map_country":"Central African Republic"},{"country":"Ukraine","internet_share":0.1754290385813611,"map_country":"Ukraine"},{"country":"Madagascar","internet_share":0.0137876484909054,"map_country":"Madagascar"},{"country":"Botswana","internet_share":0.0556642038348925,"map_country":"Botswana"},{"country":"Kenya","internet_share":0.088780160593446,"map_country":"Kenya"},{"country":"Yemen","internet_share":0.0901624790052695,"map_country":"Yemen"},{"country":"Thailand","internet_share":0.2580844172384329,"map_country":"Thailand"},{"country":"Spain","internet_share":0.589028337020233,"map_country":"Spain"},{"country":"Turkmenistan","internet_share":0.0155454149436681,"map_country":"Turkmenistan"},{"country":"Cameroon","internet_share":0.0324071360029273,"map_country":"Cameroon"},{"country":"Papua New Guinea","internet_share":0.0190760186975504,"map_country":"Papua New Guinea"},{"country":"Sweden","internet_share":0.8636533276208942,"map_country":"Sweden"},{"country":"Uzbekistan","internet_share":0.1620824760256893,"map_country":"Uzbekistan"},{"country":"Morocco","internet_share":0.4005492311170579,"map_country":"Morocco"},{"country":"Iraq","internet_share":0.0100013220526358,"map_country":"Iraq"},{"country":"Paraguay","internet_share":0.1648304111362707,"map_country":"Paraguay"},{"country":"Zimbabwe","internet_share":0.103327681413238,"map_country":"Zimbabwe"},{"country":"Japan","internet_share":0.7803253836160527,"map_country":"Japan"},{"country":"Germany","internet_share":0.8040452519754357,"map_country":"Germany"},{"country":"Congo, Republic of the","internet_share":0.0525904214225751,"map_country":"COG"},{"country":"Finland","internet_share":0.8337763501701242,"map_country":"Finland"},{"country":"Vietnam","internet_share":0.2502841011418797,"map_country":"Vietnam"},{"country":"Malaysia","internet_share":0.510584902188991,"map_country":"Malaysia"},{"country":"Norway","internet_share":0.8607573887989258,"map_country":"Norway"},{"country":"Cote d'Ivoire","internet_share":0.0423345585540163,"map_country":"CIV"},{"country":"Poland","internet_share":0.585506614605292,"map_country":"Poland"},{"country":"Oman","internet_share":0.4550007376291821,"map_country":"Oman"},{"country":"Italy","internet_share":0.4739776617173358,"map_country":"Italy"},{"country":"Philippines","internet_share":0.0768843318322932,"map_country":"Philippines"},{"country":"Ecuador","internet_share":0.2141249517468271,"map_country":"Ecuador"},{"country":"Burkina Faso","internet_share":0.009697729767451,"map_country":"Burkina Faso"},{"country":"New Zealand","internet_share":0.7723909315852461,"map_country":"New Zealand"},{"country":"Gabon","internet_share":0.0590698177743951,"map_country":"Gabon"},{"country":"Guinea","internet_share":0.0082793122732612,"map_country":"Guinea"},{"country":"United Kingdom","internet_share":0.8070536147064483,"map_country":"United Kingdom"},{"country":"Uganda","internet_share":0.0890895507283558,"map_country":"Uganda"},{"country":"Ghana","internet_share":0.0503530771747676,"map_country":"Ghana"},{"country":"Romania","internet_share":0.3583546354232844,"map_country":"Romania"},{"country":"Laos","internet_share":0.0440936614038922,"map_country":"Laos"},{"country":"Guyana","internet_share":0.2577648955753078,"map_country":"Guyana"},{"country":"Belarus","internet_share":0.2750816033791636,"map_country":"Belarus"},{"country":"Kyrgyzstan","internet_share":0.3916696941514703,"map_country":"Kyrgyzstan"},{"country":"Senegal","internet_share":0.1333242690430947,"map_country":"Senegal"},{"country":"Syria","internet_share":0.2489466282159528,"map_country":"Syria"},{"country":"Cambodia","internet_share":0.005078167553912,"map_country":"Cambodia"},{"country":"Uruguay","internet_share":0.421545695553398,"map_country":"Uruguay"},{"country":"Suriname","internet_share":0.2843134005801389,"map_country":"Suriname"},{"country":"Tunisia","internet_share":0.3199993856011796,"map_country":"Tunisia"},{"country":"Nepal","internet_share":0.0186465442335045,"map_country":"Nepal"},{"country":"Bangladesh","internet_share":0.0037123969014518,"map_country":"Bangladesh"},{"country":"Tajikistan","internet_share":0.0869401921030484,"map_country":"Tajikistan"},{"country":"Greece","internet_share":0.4613218602063912,"map_country":"Greece"},{"country":"Nicaragua","internet_share":0.0341617821986338,"map_country":"Nicaragua"},{"country":"Malawi","internet_share":0.0412257988332937,"map_country":"Malawi"},{"country":"Eritrea","internet_share":0.0313440173595705,"map_country":"Eritrea"},{"country":"Honduras","internet_share":0.0850956340252746,"map_country":"Honduras"},{"country":"Liberia","internet_share":0.0048872152891643,"map_country":"Liberia"},{"country":"Bulgaria","internet_share":0.4902728140764184,"map_country":"Bulgaria"},{"country":"Cuba","internet_share":0.1453755327909178,"map_country":"Cuba"},{"country":"Guatemala","internet_share":0.1555941206860096,"map_country":"Guatemala"},{"country":"Iceland","internet_share":0.9503672589656248,"map_country":"Iceland"},{"country":"Korea, South","internet_share":0.8034260042407027,"map_country":"KOR"},{"country":"Hungary","internet_share":0.6226353768194139,"map_country":"Hungary"},{"country":"Portugal","internet_share":0.4779063558771107,"map_country":"Portugal"},{"country":"Jordan","internet_share":0.2070489708644773,"map_country":"Jordan"},{"country":"Azerbaijan","internet_share":0.2498397205924711,"map_country":"Azerbaijan"},{"country":"Austria","internet_share":0.7470453220467023,"map_country":"Austria"},{"country":"United Arab Emirates","internet_share":0.6127410702626934,"map_country":"United Arab Emirates"},{"country":"Czech Republic","internet_share":0.628655157851631,"map_country":"Czech Republic"},{"country":"Serbia","internet_share":0.5696441658839319,"map_country":"Serbia"},{"country":"Panama","internet_share":0.2659881815670024,"map_country":"Panama"},{"country":"Sierra Leone","internet_share":0.0025941353390003,"map_country":"Sierra Leone"},{"country":"Ireland","internet_share":0.6294533253737767,"map_country":"Ireland"},{"country":"Georgia","internet_share":0.2633775537492808,"map_country":"Georgia"},{"country":"Sri Lanka","internet_share":0.0812660677124242,"map_country":"Sri Lanka"},{"country":"Lithuania","internet_share":0.5602244092399375,"map_country":"Lithuania"},{"country":"Latvia","internet_share":0.6946352818376429,"map_country":"Latvia"},{"country":"Togo","internet_share":0.0484671300902389,"map_country":"Togo"},{"country":"Croatia","internet_share":0.4997165886670362,"map_country":"Croatia"},{"country":"Bosnia and Herzegovina","internet_share":0.3672859300302223,"map_country":"Bosnia and Herzegovina"},{"country":"Costa Rica","internet_share":0.3122874710266624,"map_country":"Costa Rica"},{"country":"Slovakia","internet_share":0.746383402255463,"map_country":"Slovakia"},{"country":"Dominican Republic","internet_share":0.2609727141964229,"map_country":"Dominican Republic"},{"country":"Estonia","internet_share":0.7724650435122714,"map_country":"Estonia"},{"country":"Denmark","internet_share":0.852924102144754,"map_country":"Denmark"},{"country":"Netherlands","internet_share":0.8811809388807521,"map_country":"Netherlands"},{"country":"Switzerland","internet_share":0.763131897275897,"map_country":"Switzerland"},{"country":"Bhutan","internet_share":0.0681530390121625,"map_country":"Bhutan"},{"country":"Guinea-Bissau","internet_share":0.0219086121514257,"map_country":"Guinea-Bissau"},{"country":"Moldova","internet_share":0.3720047062920982,"map_country":"Moldova"},{"country":"Belgium","internet_share":0.776411112602962,"map_country":"Belgium"},{"country":"Lesotho","internet_share":0.0395466959971328,"map_country":"Lesotho"},{"country":"Armenia","internet_share":0.0680251882700005,"map_country":"Armenia"},{"country":"Solomon Islands","internet_share":0.0163965875422007,"map_country":"Solomon Islands"},{"country":"Albania","internet_share":0.4304337878603765,"map_country":"Albania"},{"country":"Equatorial Guinea","internet_share":0.019937584284753,"map_country":"Equatorial Guinea"},{"country":"Burundi","internet_share":0.0151790157129746,"map_country":"Burundi"},{"country":"Haiti","internet_share":0.1000327006898555,"map_country":"Haiti"},{"country":"Rwanda","internet_share":0.036475234369592,"map_country":"Rwanda"},{"country":"Macedonia","internet_share":0.5053260022020166,"map_country":"MKD"},{"country":"Djibouti","internet_share":0.0319682440547089,"map_country":"Djibouti"},{"country":"Belize","internet_share":0.1056201664104399,"map_country":"Belize"},{"country":"El Salvador","internet_share":0.1217857380738132,"map_country":"El Salvador"},{"country":"Israel","internet_share":0.5785076420539897,"map_country":"Israel"},{"country":"Slovenia","internet_share":0.6528216177503103,"map_country":"Slovenia"},{"country":"New Caledonia","internet_share":0.3173536439665472,"map_country":"New Caledonia"},{"country":"Fiji","internet_share":0.1264383469127232,"map_country":"Fiji"},{"country":"Kuwait","internet_share":0.4010630358065432,"map_country":"Kuwait"},{"country":"Swaziland","internet_share":0.0634675544140944,"map_country":"SWZ"},{"country":"Timor-Leste","internet_share":0.0017477541359353,"map_country":"Timor-Leste"},{"country":"Bahamas, The","internet_share":0.3598128227595593,"map_country":"BHS"},{"country":"Montenegro","internet_share":0.4307453741023574,"map_country":"Montenegro"},{"country":"Puerto Rico","internet_share":0.2761746605882465,"map_country":"Puerto Rico"},{"country":"Vanuatu","internet_share":0.0636854388863289,"map_country":"Vanuatu"},{"country":"Falkland Islands (Islas Malvinas)","internet_share":0.8628384409401963,"map_country":"FLK"},{"country":"Qatar","internet_share":0.265547580022231,"map_country":"Qatar"},{"country":"Gambia, The","internet_share":0.0675659183174268,"map_country":"GMB"},{"country":"Jamaica","internet_share":0.5395812358150884,"map_country":"Jamaica"},{"country":"Lebanon","internet_share":0.1699939584147179,"map_country":"Lebanon"},{"country":"Cyprus","internet_share":0.3700772223823795,"map_country":"Cyprus"},{"country":"Brunei","internet_share":0.7450168569231679,"map_country":"Brunei"},{"country":"Trinidad and Tobago","internet_share":0.4845103748950091,"map_country":"Trinidad and Tobago"},{"country":"Cabo Verde","internet_share":0.2785334286536622,"map_country":"Cabo Verde"},{"country":"Samoa","internet_share":0.0457717110482739,"map_country":"Samoa"},{"country":"Luxembourg","internet_share":0.815292545018745,"map_country":"Luxembourg"},{"country":"Comoros","internet_share":0.0316874547671363,"map_country":"Comoros"},{"country":"Mauritius","internet_share":0.2178559221127517,"map_country":"Mauritius"},{"country":"Sao Tome and Principe","internet_share":0.1402104732497321,"map_country":"Sao Tome and Principe"},{"country":"Kiribati","internet_share":0.0746497205420718,"map_country":"Kiribati"},{"country":"Bahrain","internet_share":0.31923256339563,"map_country":"Bahrain"},{"country":"Dominica","internet_share":0.3812168988005283,"map_country":"Dominica"},{"country":"Tonga","internet_share":0.0789177001127395,"map_country":"Tonga"},{"country":"Micronesia, Federated States of","internet_share":0.1608614604328119,"map_country":"FSM"},{"country":"Singapore","internet_share":0.5810715102344924,"map_country":"Singapore"},{"country":"Saint Lucia","internet_share":0.8747444326097868,"map_country":"Saint Lucia"},{"country":"Andorra","internet_share":0.785181024596878,"map_country":"Andorra"},{"country":"Seychelles","internet_share":0.3491543917075832,"map_country":"Seychelles"},{"country":"Antigua and Barbuda","internet_share":0.71197765485514,"map_country":"Antigua and Barbuda"},{"country":"Barbados","internet_share":0.6489919911626623,"map_country":"Barbados"},{"country":"Saint Vincent and the Grenadines","internet_share":0.7384519714724344,"map_country":"Saint Vincent and the Grenadines"},{"country":"Grenada","internet_share":0.2269591110465538,"map_country":"Grenada"},{"country":"Malta","internet_share":0.5830536404502551,"map_country":"Malta"},{"country":"Maldives","internet_share":0.2195149836761137,"map_country":"Maldives"},{"country":"Saint Kitts and Nevis","internet_share":0.3298537001823897,"map_country":"Saint Kitts and Nevis"},{"country":"Marshall Islands","internet_share":0.0309933364326669,"map_country":"Marshall Islands"},{"country":"Liechtenstein","internet_share":0.6164071503229438,"map_country":"Liechtenstein"},{"country":"San Marino","internet_share":0.5192107995846313,"map_country":"San Marino"},{"country":"Tuvalu","internet_share":0.3895381190873678,"map_country":"Tuvalu"},{"country":"Monaco","internet_share":0.753900616231808,"map_country":"Monaco"},{"country":"Hong Kong","internet_share":0.6851137010367951,"map_country":"Hong Kong"},{"country":"Macau","internet_share":0.4595910286198321,"map_country":"MAC"}],"71f188c336":[{"Year":1980,"Month":"Jan","Anomaly":0.3},{"Year":1981,"Month":"Jan","Anomaly":0.53},{"Year":1982,"Month":"Jan","Anomaly":0.05},{"Year":1983,"Month":"Jan","Anomaly":0.53},{"Year":1984,"Month":"Jan","Anomaly":0.31},{"Year":1985,"Month":"Jan","Anomaly":0.22},{"Year":1986,"Month":"Jan","Anomaly":0.26},{"Year":1987,"Month":"Jan","Anomaly":0.32},{"Year":1988,"Month":"Jan","Anomaly":0.57},{"Year":1989,"Month":"Jan","Anomaly":0.13},{"Year":1990,"Month":"Jan","Anomaly":0.41},{"Year":1991,"Month":"Jan","Anomaly":0.43},{"Year":1992,"Month":"Jan","Anomaly":0.48},{"Year":1993,"Month":"Jan","Anomaly":0.35},{"Year":1994,"Month":"Jan","Anomaly":0.26},{"Year":1995,"Month":"Jan","Anomaly":0.52},{"Year":1996,"Month":"Jan","Anomaly":0.24},{"Year":1997,"Month":"Jan","Anomaly":0.31},{"Year":1998,"Month":"Jan","Anomaly":0.58},{"Year":1999,"Month":"Jan","Anomaly":0.49},{"Year":2000,"Month":"Jan","Anomaly":0.25},{"Year":2001,"Month":"Jan","Anomaly":0.46},{"Year":2002,"Month":"Jan","Anomaly":0.78},{"Year":2003,"Month":"Jan","Anomaly":0.75},{"Year":2004,"Month":"Jan","Anomaly":0.58},{"Year":2005,"Month":"Jan","Anomaly":0.74},{"Year":2006,"Month":"Jan","Anomaly":0.56},{"Year":2007,"Month":"Jan","Anomaly":1.02},{"Year":2008,"Month":"Jan","Anomaly":0.31},{"Year":2009,"Month":"Jan","Anomaly":0.65},{"Year":2010,"Month":"Jan","Anomaly":0.75},{"Year":2011,"Month":"Jan","Anomaly":0.52},{"Year":2012,"Month":"Jan","Anomaly":0.49},{"Year":2013,"Month":"Jan","Anomaly":0.71},{"Year":2014,"Month":"Jan","Anomaly":0.76},{"Year":2015,"Month":"Jan","Anomaly":0.86},{"Year":2016,"Month":"Jan","Anomaly":1.17},{"Year":2017,"Month":"Jan","Anomaly":1.02},{"Year":2018,"Month":"Jan","Anomaly":0.82},{"Year":2019,"Month":"Jan","Anomaly":0.93},{"Year":2020,"Month":"Jan","Anomaly":1.18},{"Year":2021,"Month":"Jan","Anomaly":0.81},{"Year":2022,"Month":"Jan","Anomaly":0.91},{"Year":2023,"Month":"Jan","Anomaly":0.87},{"Year":1980,"Month":"Feb","Anomaly":0.39},{"Year":1981,"Month":"Feb","Anomaly":0.42},{"Year":1982,"Month":"Feb","Anomaly":0.16},{"Year":1983,"Month":"Feb","Anomaly":0.43},{"Year":1984,"Month":"Feb","Anomaly":0.14},{"Year":1985,"Month":"Feb","Anomaly":-0.04},{"Year":1986,"Month":"Feb","Anomaly":0.37},{"Year":1987,"Month":"Feb","Anomaly":0.43},{"Year":1988,"Month":"Feb","Anomaly":0.44},{"Year":1989,"Month":"Feb","Anomaly":0.3},{"Year":1990,"Month":"Feb","Anomaly":0.44},{"Year":1991,"Month":"Feb","Anomaly":0.5},{"Year":1992,"Month":"Feb","Anomaly":0.4},{"Year":1993,"Month":"Feb","Anomaly":0.37},{"Year":1994,"Month":"Feb","Anomaly":0.03},{"Year":1995,"Month":"Feb","Anomaly":0.79},{"Year":1996,"Month":"Feb","Anomaly":0.46},{"Year":1997,"Month":"Feb","Anomaly":0.41},{"Year":1998,"Month":"Feb","Anomaly":0.88},{"Year":1999,"Month":"Feb","Anomaly":0.64},{"Year":2000,"Month":"Feb","Anomaly":0.56},{"Year":2001,"Month":"Feb","Anomaly":0.44},{"Year":2002,"Month":"Feb","Anomaly":0.79},{"Year":2003,"Month":"Feb","Anomaly":0.59},{"Year":2004,"Month":"Feb","Anomaly":0.73},{"Year":2005,"Month":"Feb","Anomaly":0.6},{"Year":2006,"Month":"Feb","Anomaly":0.73},{"Year":2007,"Month":"Feb","Anomaly":0.7},{"Year":2008,"Month":"Feb","Anomaly":0.38},{"Year":2009,"Month":"Feb","Anomaly":0.53},{"Year":2010,"Month":"Feb","Anomaly":0.84},{"Year":2011,"Month":"Feb","Anomaly":0.48},{"Year":2012,"Month":"Feb","Anomaly":0.5},{"Year":2013,"Month":"Feb","Anomaly":0.63},{"Year":2014,"Month":"Feb","Anomaly":0.55},{"Year":2015,"Month":"Feb","Anomaly":0.91},{"Year":2016,"Month":"Feb","Anomaly":1.37},{"Year":2017,"Month":"Feb","Anomaly":1.14},{"Year":2018,"Month":"Feb","Anomaly":0.85},{"Year":2019,"Month":"Feb","Anomaly":0.95},{"Year":2020,"Month":"Feb","Anomaly":1.25},{"Year":2021,"Month":"Feb","Anomaly":0.64},{"Year":2022,"Month":"Feb","Anomaly":0.9},{"Year":2023,"Month":"Feb","Anomaly":0.98},{"Year":1980,"Month":"Mar","Anomaly":0.3},{"Year":1981,"Month":"Mar","Anomaly":0.48},{"Year":1982,"Month":"Mar","Anomaly":0.03},{"Year":1983,"Month":"Mar","Anomaly":0.42},{"Year":1984,"Month":"Mar","Anomaly":0.26},{"Year":1985,"Month":"Mar","Anomaly":0.18},{"Year":1986,"Month":"Mar","Anomaly":0.3},{"Year":1987,"Month":"Mar","Anomaly":0.19},{"Year":1988,"Month":"Mar","Anomaly":0.52},{"Year":1989,"Month":"Mar","Anomaly":0.36},{"Year":1990,"Month":"Mar","Anomaly":0.8},{"Year":1991,"Month":"Mar","Anomaly":0.35},{"Year":1992,"Month":"Mar","Anomaly":0.48},{"Year":1993,"Month":"Mar","Anomaly":0.36},{"Year":1994,"Month":"Mar","Anomaly":0.29},{"Year":1995,"Month":"Mar","Anomaly":0.47},{"Year":1996,"Month":"Mar","Anomaly":0.33},{"Year":1997,"Month":"Mar","Anomaly":0.52},{"Year":1998,"Month":"Mar","Anomaly":0.63},{"Year":1999,"Month":"Mar","Anomaly":0.32},{"Year":2000,"Month":"Mar","Anomaly":0.55},{"Year":2001,"Month":"Mar","Anomaly":0.56},{"Year":2002,"Month":"Mar","Anomaly":0.88},{"Year":2003,"Month":"Mar","Anomaly":0.6},{"Year":2004,"Month":"Mar","Anomaly":0.63},{"Year":2005,"Month":"Mar","Anomaly":0.74},{"Year":2006,"Month":"Mar","Anomaly":0.63},{"Year":2007,"Month":"Mar","Anomaly":0.73},{"Year":2008,"Month":"Mar","Anomaly":0.75},{"Year":2009,"Month":"Mar","Anomaly":0.54},{"Year":2010,"Month":"Mar","Anomaly":0.93},{"Year":2011,"Month":"Mar","Anomaly":0.66},{"Year":2012,"Month":"Mar","Anomaly":0.58},{"Year":2013,"Month":"Mar","Anomaly":0.67},{"Year":2014,"Month":"Mar","Anomaly":0.78},{"Year":2015,"Month":"Mar","Anomaly":0.96},{"Year":2016,"Month":"Mar","Anomaly":1.36},{"Year":2017,"Month":"Mar","Anomaly":1.16},{"Year":2018,"Month":"Mar","Anomaly":0.88},{"Year":2019,"Month":"Mar","Anomaly":1.17},{"Year":2020,"Month":"Mar","Anomaly":1.17},{"Year":2021,"Month":"Mar","Anomaly":0.89},{"Year":2022,"Month":"Mar","Anomaly":1.05},{"Year":2023,"Month":"Mar","Anomaly":1.21},{"Year":1980,"Month":"Apr","Anomaly":0.3},{"Year":1981,"Month":"Apr","Anomaly":0.32},{"Year":1982,"Month":"Apr","Anomaly":0.15},{"Year":1983,"Month":"Apr","Anomaly":0.28},{"Year":1984,"Month":"Apr","Anomaly":0.06},{"Year":1985,"Month":"Apr","Anomaly":0.12},{"Year":1986,"Month":"Apr","Anomaly":0.22},{"Year":1987,"Month":"Apr","Anomaly":0.24},{"Year":1988,"Month":"Apr","Anomaly":0.43},{"Year":1989,"Month":"Apr","Anomaly":0.29},{"Year":1990,"Month":"Apr","Anomaly":0.56},{"Year":1991,"Month":"Apr","Anomaly":0.51},{"Year":1992,"Month":"Apr","Anomaly":0.27},{"Year":1993,"Month":"Apr","Anomaly":0.28},{"Year":1994,"Month":"Apr","Anomaly":0.41},{"Year":1995,"Month":"Apr","Anomaly":0.47},{"Year":1996,"Month":"Apr","Anomaly":0.33},{"Year":1997,"Month":"Apr","Anomaly":0.34},{"Year":1998,"Month":"Apr","Anomaly":0.63},{"Year":1999,"Month":"Apr","Anomaly":0.32},{"Year":2000,"Month":"Apr","Anomaly":0.57},{"Year":2001,"Month":"Apr","Anomaly":0.5},{"Year":2002,"Month":"Apr","Anomaly":0.58},{"Year":2003,"Month":"Apr","Anomaly":0.55},{"Year":2004,"Month":"Apr","Anomaly":0.61},{"Year":2005,"Month":"Apr","Anomaly":0.67},{"Year":2006,"Month":"Apr","Anomaly":0.47},{"Year":2007,"Month":"Apr","Anomaly":0.77},{"Year":2008,"Month":"Apr","Anomaly":0.54},{"Year":2009,"Month":"Apr","Anomaly":0.61},{"Year":2010,"Month":"Apr","Anomaly":0.85},{"Year":2011,"Month":"Apr","Anomaly":0.65},{"Year":2012,"Month":"Apr","Anomaly":0.73},{"Year":2013,"Month":"Apr","Anomaly":0.54},{"Year":2014,"Month":"Apr","Anomaly":0.8},{"Year":2015,"Month":"Apr","Anomaly":0.76},{"Year":2016,"Month":"Apr","Anomaly":1.1},{"Year":2017,"Month":"Apr","Anomaly":0.94},{"Year":2018,"Month":"Apr","Anomaly":0.89},{"Year":2019,"Month":"Apr","Anomaly":1.02},{"Year":2020,"Month":"Apr","Anomaly":1.13},{"Year":2021,"Month":"Apr","Anomaly":0.76},{"Year":2022,"Month":"Apr","Anomaly":0.84},{"Year":2023,"Month":"Apr","Anomaly":1},{"Year":1980,"Month":"May","Anomaly":0.35},{"Year":1981,"Month":"May","Anomaly":0.25},{"Year":1982,"Month":"May","Anomaly":0.18},{"Year":1983,"Month":"May","Anomaly":0.34},{"Year":1984,"Month":"May","Anomaly":0.33},{"Year":1985,"Month":"May","Anomaly":0.14},{"Year":1986,"Month":"May","Anomaly":0.21},{"Year":1987,"Month":"May","Anomaly":0.26},{"Year":1988,"Month":"May","Anomaly":0.44},{"Year":1989,"Month":"May","Anomaly":0.17},{"Year":1990,"Month":"May","Anomaly":0.45},{"Year":1991,"Month":"May","Anomaly":0.34},{"Year":1992,"Month":"May","Anomaly":0.31},{"Year":1993,"Month":"May","Anomaly":0.28},{"Year":1994,"Month":"May","Anomaly":0.28},{"Year":1995,"Month":"May","Anomaly":0.27},{"Year":1996,"Month":"May","Anomaly":0.27},{"Year":1997,"Month":"May","Anomaly":0.34},{"Year":1998,"Month":"May","Anomaly":0.68},{"Year":1999,"Month":"May","Anomaly":0.26},{"Year":2000,"Month":"May","Anomaly":0.36},{"Year":2001,"Month":"May","Anomaly":0.58},{"Year":2002,"Month":"May","Anomaly":0.64},{"Year":2003,"Month":"May","Anomaly":0.61},{"Year":2004,"Month":"May","Anomaly":0.37},{"Year":2005,"Month":"May","Anomaly":0.63},{"Year":2006,"Month":"May","Anomaly":0.48},{"Year":2007,"Month":"May","Anomaly":0.69},{"Year":2008,"Month":"May","Anomaly":0.49},{"Year":2009,"Month":"May","Anomaly":0.65},{"Year":2010,"Month":"May","Anomaly":0.76},{"Year":2011,"Month":"May","Anomaly":0.53},{"Year":2012,"Month":"May","Anomaly":0.78},{"Year":2013,"Month":"May","Anomaly":0.61},{"Year":2014,"Month":"May","Anomaly":0.86},{"Year":2015,"Month":"May","Anomaly":0.8},{"Year":2016,"Month":"May","Anomaly":0.95},{"Year":2017,"Month":"May","Anomaly":0.92},{"Year":2018,"Month":"May","Anomaly":0.83},{"Year":2019,"Month":"May","Anomaly":0.85},{"Year":2020,"Month":"May","Anomaly":1.02},{"Year":2021,"Month":"May","Anomaly":0.79},{"Year":2022,"Month":"May","Anomaly":0.84},{"Year":2023,"Month":"May","Anomaly":0.94},{"Year":1980,"Month":"Jun","Anomaly":0.2},{"Year":1981,"Month":"Jun","Anomaly":0.29},{"Year":1982,"Month":"Jun","Anomaly":0.06},{"Year":1983,"Month":"Jun","Anomaly":0.23},{"Year":1984,"Month":"Jun","Anomaly":0.02},{"Year":1985,"Month":"Jun","Anomaly":0.15},{"Year":1986,"Month":"Jun","Anomaly":0.12},{"Year":1987,"Month":"Jun","Anomaly":0.35},{"Year":1988,"Month":"Jun","Anomaly":0.4},{"Year":1989,"Month":"Jun","Anomaly":0.17},{"Year":1990,"Month":"Jun","Anomaly":0.37},{"Year":1991,"Month":"Jun","Anomaly":0.53},{"Year":1992,"Month":"Jun","Anomaly":0.26},{"Year":1993,"Month":"Jun","Anomaly":0.23},{"Year":1994,"Month":"Jun","Anomaly":0.44},{"Year":1995,"Month":"Jun","Anomaly":0.43},{"Year":1996,"Month":"Jun","Anomaly":0.25},{"Year":1997,"Month":"Jun","Anomaly":0.54},{"Year":1998,"Month":"Jun","Anomaly":0.77},{"Year":1999,"Month":"Jun","Anomaly":0.36},{"Year":2000,"Month":"Jun","Anomaly":0.4},{"Year":2001,"Month":"Jun","Anomaly":0.52},{"Year":2002,"Month":"Jun","Anomaly":0.53},{"Year":2003,"Month":"Jun","Anomaly":0.48},{"Year":2004,"Month":"Jun","Anomaly":0.44},{"Year":2005,"Month":"Jun","Anomaly":0.64},{"Year":2006,"Month":"Jun","Anomaly":0.66},{"Year":2007,"Month":"Jun","Anomaly":0.61},{"Year":2008,"Month":"Jun","Anomaly":0.49},{"Year":2009,"Month":"Jun","Anomaly":0.65},{"Year":2010,"Month":"Jun","Anomaly":0.68},{"Year":2011,"Month":"Jun","Anomaly":0.63},{"Year":2012,"Month":"Jun","Anomaly":0.65},{"Year":2013,"Month":"Jun","Anomaly":0.69},{"Year":2014,"Month":"Jun","Anomaly":0.67},{"Year":2015,"Month":"Jun","Anomaly":0.81},{"Year":2016,"Month":"Jun","Anomaly":0.8},{"Year":2017,"Month":"Jun","Anomaly":0.72},{"Year":2018,"Month":"Jun","Anomaly":0.77},{"Year":2019,"Month":"Jun","Anomaly":0.91},{"Year":2020,"Month":"Jun","Anomaly":0.92},{"Year":2021,"Month":"Jun","Anomaly":0.84},{"Year":2022,"Month":"Jun","Anomaly":0.93},{"Year":1980,"Month":"Jul","Anomaly":0.22},{"Year":1981,"Month":"Jul","Anomaly":0.32},{"Year":1982,"Month":"Jul","Anomaly":0.15},{"Year":1983,"Month":"Jul","Anomaly":0.18},{"Year":1984,"Month":"Jul","Anomaly":0.19},{"Year":1985,"Month":"Jul","Anomaly":0.04},{"Year":1986,"Month":"Jul","Anomaly":0.11},{"Year":1987,"Month":"Jul","Anomaly":0.4},{"Year":1988,"Month":"Jul","Anomaly":0.33},{"Year":1989,"Month":"Jul","Anomaly":0.34},{"Year":1990,"Month":"Jul","Anomaly":0.46},{"Year":1991,"Month":"Jul","Anomaly":0.47},{"Year":1992,"Month":"Jul","Anomaly":0.08},{"Year":1993,"Month":"Jul","Anomaly":0.25},{"Year":1994,"Month":"Jul","Anomaly":0.3},{"Year":1995,"Month":"Jul","Anomaly":0.45},{"Year":1996,"Month":"Jul","Anomaly":0.36},{"Year":1997,"Month":"Jul","Anomaly":0.33},{"Year":1998,"Month":"Jul","Anomaly":0.65},{"Year":1999,"Month":"Jul","Anomaly":0.38},{"Year":2000,"Month":"Jul","Anomaly":0.39},{"Year":2001,"Month":"Jul","Anomaly":0.59},{"Year":2002,"Month":"Jul","Anomaly":0.61},{"Year":2003,"Month":"Jul","Anomaly":0.58},{"Year":2004,"Month":"Jul","Anomaly":0.26},{"Year":2005,"Month":"Jul","Anomaly":0.62},{"Year":2006,"Month":"Jul","Anomaly":0.54},{"Year":2007,"Month":"Jul","Anomaly":0.6},{"Year":2008,"Month":"Jul","Anomaly":0.6},{"Year":2009,"Month":"Jul","Anomaly":0.74},{"Year":2010,"Month":"Jul","Anomaly":0.63},{"Year":2011,"Month":"Jul","Anomaly":0.71},{"Year":2012,"Month":"Jul","Anomaly":0.59},{"Year":2013,"Month":"Jul","Anomaly":0.6},{"Year":2014,"Month":"Jul","Anomaly":0.58},{"Year":2015,"Month":"Jul","Anomaly":0.73},{"Year":2016,"Month":"Jul","Anomaly":0.84},{"Year":2017,"Month":"Jul","Anomaly":0.82},{"Year":2018,"Month":"Jul","Anomaly":0.82},{"Year":2019,"Month":"Jul","Anomaly":0.94},{"Year":2020,"Month":"Jul","Anomaly":0.9},{"Year":2021,"Month":"Jul","Anomaly":0.92},{"Year":2022,"Month":"Jul","Anomaly":0.94},{"Year":1980,"Month":"Aug","Anomaly":0.18},{"Year":1981,"Month":"Aug","Anomaly":0.35},{"Year":1982,"Month":"Aug","Anomaly":0.04},{"Year":1983,"Month":"Aug","Anomaly":0.36},{"Year":1984,"Month":"Aug","Anomaly":0.19},{"Year":1985,"Month":"Aug","Anomaly":0.17},{"Year":1986,"Month":"Aug","Anomaly":0.16},{"Year":1987,"Month":"Aug","Anomaly":0.25},{"Year":1988,"Month":"Aug","Anomaly":0.39},{"Year":1989,"Month":"Aug","Anomaly":0.33},{"Year":1990,"Month":"Aug","Anomaly":0.34},{"Year":1991,"Month":"Aug","Anomaly":0.39},{"Year":1992,"Month":"Aug","Anomaly":0.08},{"Year":1993,"Month":"Aug","Anomaly":0.11},{"Year":1994,"Month":"Aug","Anomaly":0.21},{"Year":1995,"Month":"Aug","Anomaly":0.45},{"Year":1996,"Month":"Aug","Anomaly":0.48},{"Year":1997,"Month":"Aug","Anomaly":0.41},{"Year":1998,"Month":"Aug","Anomaly":0.65},{"Year":1999,"Month":"Aug","Anomaly":0.31},{"Year":2000,"Month":"Aug","Anomaly":0.42},{"Year":2001,"Month":"Aug","Anomaly":0.49},{"Year":2002,"Month":"Aug","Anomaly":0.53},{"Year":2003,"Month":"Aug","Anomaly":0.65},{"Year":2004,"Month":"Aug","Anomaly":0.46},{"Year":2005,"Month":"Aug","Anomaly":0.6},{"Year":2006,"Month":"Aug","Anomaly":0.71},{"Year":2007,"Month":"Aug","Anomaly":0.6},{"Year":2008,"Month":"Aug","Anomaly":0.46},{"Year":2009,"Month":"Aug","Anomaly":0.69},{"Year":2010,"Month":"Aug","Anomaly":0.67},{"Year":2011,"Month":"Aug","Anomaly":0.75},{"Year":2012,"Month":"Aug","Anomaly":0.65},{"Year":2013,"Month":"Aug","Anomaly":0.69},{"Year":2014,"Month":"Aug","Anomaly":0.83},{"Year":2015,"Month":"Aug","Anomaly":0.81},{"Year":2016,"Month":"Aug","Anomaly":1.02},{"Year":2017,"Month":"Aug","Anomaly":0.87},{"Year":2018,"Month":"Aug","Anomaly":0.77},{"Year":2019,"Month":"Aug","Anomaly":0.95},{"Year":2020,"Month":"Aug","Anomaly":0.88},{"Year":2021,"Month":"Aug","Anomaly":0.82},{"Year":2022,"Month":"Aug","Anomaly":0.96},{"Year":1980,"Month":"Sep","Anomaly":0.2},{"Year":1981,"Month":"Sep","Anomaly":0.15},{"Year":1982,"Month":"Sep","Anomaly":0.14},{"Year":1983,"Month":"Sep","Anomaly":0.37},{"Year":1984,"Month":"Sep","Anomaly":0.21},{"Year":1985,"Month":"Sep","Anomaly":0.13},{"Year":1986,"Month":"Sep","Anomaly":0.03},{"Year":1987,"Month":"Sep","Anomaly":0.35},{"Year":1988,"Month":"Sep","Anomaly":0.37},{"Year":1989,"Month":"Sep","Anomaly":0.34},{"Year":1990,"Month":"Sep","Anomaly":0.23},{"Year":1991,"Month":"Sep","Anomaly":0.44},{"Year":1992,"Month":"Sep","Anomaly":-0.01},{"Year":1993,"Month":"Sep","Anomaly":0.12},{"Year":1994,"Month":"Sep","Anomaly":0.32},{"Year":1995,"Month":"Sep","Anomaly":0.34},{"Year":1996,"Month":"Sep","Anomaly":0.25},{"Year":1997,"Month":"Sep","Anomaly":0.52},{"Year":1998,"Month":"Sep","Anomaly":0.42},{"Year":1999,"Month":"Sep","Anomaly":0.39},{"Year":2000,"Month":"Sep","Anomaly":0.39},{"Year":2001,"Month":"Sep","Anomaly":0.52},{"Year":2002,"Month":"Sep","Anomaly":0.63},{"Year":2003,"Month":"Sep","Anomaly":0.62},{"Year":2004,"Month":"Sep","Anomaly":0.5},{"Year":2005,"Month":"Sep","Anomaly":0.71},{"Year":2006,"Month":"Sep","Anomaly":0.65},{"Year":2007,"Month":"Sep","Anomaly":0.6},{"Year":2008,"Month":"Sep","Anomaly":0.61},{"Year":2009,"Month":"Sep","Anomaly":0.72},{"Year":2010,"Month":"Sep","Anomaly":0.63},{"Year":2011,"Month":"Sep","Anomaly":0.57},{"Year":2012,"Month":"Sep","Anomaly":0.72},{"Year":2013,"Month":"Sep","Anomaly":0.77},{"Year":2014,"Month":"Sep","Anomaly":0.87},{"Year":2015,"Month":"Sep","Anomaly":0.85},{"Year":2016,"Month":"Sep","Anomaly":0.91},{"Year":2017,"Month":"Sep","Anomaly":0.77},{"Year":2018,"Month":"Sep","Anomaly":0.8},{"Year":2019,"Month":"Sep","Anomaly":0.93},{"Year":2020,"Month":"Sep","Anomaly":0.99},{"Year":2021,"Month":"Sep","Anomaly":0.93},{"Year":2022,"Month":"Sep","Anomaly":0.9},{"Year":1980,"Month":"Oct","Anomaly":0.13},{"Year":1981,"Month":"Oct","Anomaly":0.12},{"Year":1982,"Month":"Oct","Anomaly":0.13},{"Year":1983,"Month":"Oct","Anomaly":0.17},{"Year":1984,"Month":"Oct","Anomaly":0.14},{"Year":1985,"Month":"Oct","Anomaly":0.12},{"Year":1986,"Month":"Oct","Anomaly":0.15},{"Year":1987,"Month":"Oct","Anomaly":0.33},{"Year":1988,"Month":"Oct","Anomaly":0.38},{"Year":1989,"Month":"Oct","Anomaly":0.29},{"Year":1990,"Month":"Oct","Anomaly":0.45},{"Year":1991,"Month":"Oct","Anomaly":0.29},{"Year":1992,"Month":"Oct","Anomaly":0.06},{"Year":1993,"Month":"Oct","Anomaly":0.23},{"Year":1994,"Month":"Oct","Anomaly":0.42},{"Year":1995,"Month":"Oct","Anomaly":0.47},{"Year":1996,"Month":"Oct","Anomaly":0.2},{"Year":1997,"Month":"Oct","Anomaly":0.61},{"Year":1998,"Month":"Oct","Anomaly":0.41},{"Year":1999,"Month":"Oct","Anomaly":0.34},{"Year":2000,"Month":"Oct","Anomaly":0.26},{"Year":2001,"Month":"Oct","Anomaly":0.5},{"Year":2002,"Month":"Oct","Anomaly":0.54},{"Year":2003,"Month":"Oct","Anomaly":0.73},{"Year":2004,"Month":"Oct","Anomaly":0.61},{"Year":2005,"Month":"Oct","Anomaly":0.75},{"Year":2006,"Month":"Oct","Anomaly":0.7},{"Year":2007,"Month":"Oct","Anomaly":0.59},{"Year":2008,"Month":"Oct","Anomaly":0.67},{"Year":2009,"Month":"Oct","Anomaly":0.65},{"Year":2010,"Month":"Oct","Anomaly":0.71},{"Year":2011,"Month":"Oct","Anomaly":0.66},{"Year":2012,"Month":"Oct","Anomaly":0.8},{"Year":2013,"Month":"Oct","Anomaly":0.69},{"Year":2014,"Month":"Oct","Anomaly":0.81},{"Year":2015,"Month":"Oct","Anomaly":1.09},{"Year":2016,"Month":"Oct","Anomaly":0.89},{"Year":2017,"Month":"Oct","Anomaly":0.9},{"Year":2018,"Month":"Oct","Anomaly":1.02},{"Year":2019,"Month":"Oct","Anomaly":1.01},{"Year":2020,"Month":"Oct","Anomaly":0.89},{"Year":2021,"Month":"Oct","Anomaly":1},{"Year":2022,"Month":"Oct","Anomaly":0.97},{"Year":1980,"Month":"Nov","Anomaly":0.3},{"Year":1981,"Month":"Nov","Anomaly":0.23},{"Year":1982,"Month":"Nov","Anomaly":0.18},{"Year":1983,"Month":"Nov","Anomaly":0.3},{"Year":1984,"Month":"Nov","Anomaly":0.07},{"Year":1985,"Month":"Nov","Anomaly":0.05},{"Year":1986,"Month":"Nov","Anomaly":0.1},{"Year":1987,"Month":"Nov","Anomaly":0.29},{"Year":1988,"Month":"Nov","Anomaly":0.12},{"Year":1989,"Month":"Nov","Anomaly":0.2},{"Year":1990,"Month":"Nov","Anomaly":0.46},{"Year":1991,"Month":"Nov","Anomaly":0.3},{"Year":1992,"Month":"Nov","Anomaly":0.03},{"Year":1993,"Month":"Nov","Anomaly":0.03},{"Year":1994,"Month":"Nov","Anomaly":0.44},{"Year":1995,"Month":"Nov","Anomaly":0.44},{"Year":1996,"Month":"Nov","Anomaly":0.38},{"Year":1997,"Month":"Nov","Anomaly":0.64},{"Year":1998,"Month":"Nov","Anomaly":0.43},{"Year":1999,"Month":"Nov","Anomaly":0.37},{"Year":2000,"Month":"Nov","Anomaly":0.3},{"Year":2001,"Month":"Nov","Anomaly":0.72},{"Year":2002,"Month":"Nov","Anomaly":0.59},{"Year":2003,"Month":"Nov","Anomaly":0.53},{"Year":2004,"Month":"Nov","Anomaly":0.73},{"Year":2005,"Month":"Nov","Anomaly":0.74},{"Year":2006,"Month":"Nov","Anomaly":0.74},{"Year":2007,"Month":"Nov","Anomaly":0.59},{"Year":2008,"Month":"Nov","Anomaly":0.69},{"Year":2009,"Month":"Nov","Anomaly":0.8},{"Year":2010,"Month":"Nov","Anomaly":0.82},{"Year":2011,"Month":"Nov","Anomaly":0.59},{"Year":2012,"Month":"Nov","Anomaly":0.79},{"Year":2013,"Month":"Nov","Anomaly":0.84},{"Year":2014,"Month":"Nov","Anomaly":0.67},{"Year":2015,"Month":"Nov","Anomaly":1.06},{"Year":2016,"Month":"Nov","Anomaly":0.92},{"Year":2017,"Month":"Nov","Anomaly":0.89},{"Year":2018,"Month":"Nov","Anomaly":0.83},{"Year":2019,"Month":"Nov","Anomaly":1},{"Year":2020,"Month":"Nov","Anomaly":1.11},{"Year":2021,"Month":"Nov","Anomaly":0.94},{"Year":2022,"Month":"Nov","Anomaly":0.73},{"Year":1980,"Month":"Dec","Anomaly":0.22},{"Year":1981,"Month":"Dec","Anomaly":0.41},{"Year":1982,"Month":"Dec","Anomaly":0.43},{"Year":1983,"Month":"Dec","Anomaly":0.17},{"Year":1984,"Month":"Dec","Anomaly":-0.04},{"Year":1985,"Month":"Dec","Anomaly":0.14},{"Year":1986,"Month":"Dec","Anomaly":0.13},{"Year":1987,"Month":"Dec","Anomaly":0.46},{"Year":1988,"Month":"Dec","Anomaly":0.29},{"Year":1989,"Month":"Dec","Anomaly":0.37},{"Year":1990,"Month":"Dec","Anomaly":0.41},{"Year":1991,"Month":"Dec","Anomaly":0.32},{"Year":1992,"Month":"Dec","Anomaly":0.22},{"Year":1993,"Month":"Dec","Anomaly":0.18},{"Year":1994,"Month":"Dec","Anomaly":0.38},{"Year":1995,"Month":"Dec","Anomaly":0.26},{"Year":1996,"Month":"Dec","Anomaly":0.37},{"Year":1997,"Month":"Dec","Anomaly":0.59},{"Year":1998,"Month":"Dec","Anomaly":0.55},{"Year":1999,"Month":"Dec","Anomaly":0.41},{"Year":2000,"Month":"Dec","Anomaly":0.28},{"Year":2001,"Month":"Dec","Anomaly":0.56},{"Year":2002,"Month":"Dec","Anomaly":0.44},{"Year":2003,"Month":"Dec","Anomaly":0.75},{"Year":2004,"Month":"Dec","Anomaly":0.51},{"Year":2005,"Month":"Dec","Anomaly":0.68},{"Year":2006,"Month":"Dec","Anomaly":0.79},{"Year":2007,"Month":"Dec","Anomaly":0.5},{"Year":2008,"Month":"Dec","Anomaly":0.54},{"Year":2009,"Month":"Dec","Anomaly":0.68},{"Year":2010,"Month":"Dec","Anomaly":0.45},{"Year":2011,"Month":"Dec","Anomaly":0.61},{"Year":2012,"Month":"Dec","Anomaly":0.54},{"Year":2013,"Month":"Dec","Anomaly":0.7},{"Year":2014,"Month":"Dec","Anomaly":0.78},{"Year":2015,"Month":"Dec","Anomaly":1.16},{"Year":2016,"Month":"Dec","Anomaly":0.87},{"Year":2017,"Month":"Dec","Anomaly":0.93},{"Year":2018,"Month":"Dec","Anomaly":0.92},{"Year":2019,"Month":"Dec","Anomaly":1.09},{"Year":2020,"Month":"Dec","Anomaly":0.81},{"Year":2021,"Month":"Dec","Anomaly":0.86},{"Year":2022,"Month":"Dec","Anomaly":0.8}],"19b31aae9f":[{"who_region":"Africa","cases":289766},{"who_region":"Europe","cases":104442},{"who_region":"Western Pacific","cases":64072},{"who_region":"Eastern Mediterranean","cases":30703},{"who_region":"South-East Asia","cases":29139},{"who_region":"Americas","cases":23279}],"42be3deccc":[{"species":"Adelie","bill_len":39.1,"bill_dep":18.7},{"species":"Adelie","bill_len":39.5,"bill_dep":17.4},{"species":"Adelie","bill_len":40.3,"bill_dep":18},{"species":"Adelie","bill_len":36.7,"bill_dep":19.3},{"species":"Adelie","bill_len":39.3,"bill_dep":20.6},{"species":"Adelie","bill_len":38.9,"bill_dep":17.8},{"species":"Adelie","bill_len":39.2,"bill_dep":19.6},{"species":"Adelie","bill_len":34.1,"bill_dep":18.1},{"species":"Adelie","bill_len":42,"bill_dep":20.2},{"species":"Adelie","bill_len":37.8,"bill_dep":17.1},{"species":"Adelie","bill_len":37.8,"bill_dep":17.3},{"species":"Adelie","bill_len":41.1,"bill_dep":17.6},{"species":"Adelie","bill_len":38.6,"bill_dep":21.2},{"species":"Adelie","bill_len":34.6,"bill_dep":21.1},{"species":"Adelie","bill_len":36.6,"bill_dep":17.8},{"species":"Adelie","bill_len":38.7,"bill_dep":19},{"species":"Adelie","bill_len":42.5,"bill_dep":20.7},{"species":"Adelie","bill_len":34.4,"bill_dep":18.4},{"species":"Adelie","bill_len":46,"bill_dep":21.5},{"species":"Adelie","bill_len":37.8,"bill_dep":18.3},{"species":"Adelie","bill_len":37.7,"bill_dep":18.7},{"species":"Adelie","bill_len":35.9,"bill_dep":19.2},{"species":"Adelie","bill_len":38.2,"bill_dep":18.1},{"species":"Adelie","bill_len":38.8,"bill_dep":17.2},{"species":"Adelie","bill_len":35.3,"bill_dep":18.9},{"species":"Adelie","bill_len":40.6,"bill_dep":18.6},{"species":"Adelie","bill_len":40.5,"bill_dep":17.9},{"species":"Adelie","bill_len":37.9,"bill_dep":18.6},{"species":"Adelie","bill_len":40.5,"bill_dep":18.9},{"species":"Adelie","bill_len":39.5,"bill_dep":16.7},{"species":"Adelie","bill_len":37.2,"bill_dep":18.1},{"species":"Adelie","bill_len":39.5,"bill_dep":17.8},{"species":"Adelie","bill_len":40.9,"bill_dep":18.9},{"species":"Adelie","bill_len":36.4,"bill_dep":17},{"species":"Adelie","bill_len":39.2,"bill_dep":21.1},{"species":"Adelie","bill_len":38.8,"bill_dep":20},{"species":"Adelie","bill_len":42.2,"bill_dep":18.5},{"species":"Adelie","bill_len":37.6,"bill_dep":19.3},{"species":"Adelie","bill_len":39.8,"bill_dep":19.1},{"species":"Adelie","bill_len":36.5,"bill_dep":18},{"species":"Adelie","bill_len":40.8,"bill_dep":18.4},{"species":"Adelie","bill_len":36,"bill_dep":18.5},{"species":"Adelie","bill_len":44.1,"bill_dep":19.7},{"species":"Adelie","bill_len":37,"bill_dep":16.9},{"species":"Adelie","bill_len":39.6,"bill_dep":18.8},{"species":"Adelie","bill_len":41.1,"bill_dep":19},{"species":"Adelie","bill_len":37.5,"bill_dep":18.9},{"species":"Adelie","bill_len":36,"bill_dep":17.9},{"species":"Adelie","bill_len":42.3,"bill_dep":21.2},{"species":"Adelie","bill_len":39.6,"bill_dep":17.7},{"species":"Adelie","bill_len":40.1,"bill_dep":18.9},{"species":"Adelie","bill_len":35,"bill_dep":17.9},{"species":"Adelie","bill_len":42,"bill_dep":19.5},{"species":"Adelie","bill_len":34.5,"bill_dep":18.1},{"species":"Adelie","bill_len":41.4,"bill_dep":18.6},{"species":"Adelie","bill_len":39,"bill_dep":17.5},{"species":"Adelie","bill_len":40.6,"bill_dep":18.8},{"species":"Adelie","bill_len":36.5,"bill_dep":16.6},{"species":"Adelie","bill_len":37.6,"bill_dep":19.1},{"species":"Adelie","bill_len":35.7,"bill_dep":16.9},{"species":"Adelie","bill_len":41.3,"bill_dep":21.1},{"species":"Adelie","bill_len":37.6,"bill_dep":17},{"species":"Adelie","bill_len":41.1,"bill_dep":18.2},{"species":"Adelie","bill_len":36.4,"bill_dep":17.1},{"species":"Adelie","bill_len":41.6,"bill_dep":18},{"species":"Adelie","bill_len":35.5,"bill_dep":16.2},{"species":"Adelie","bill_len":41.1,"bill_dep":19.1},{"species":"Adelie","bill_len":35.9,"bill_dep":16.6},{"species":"Adelie","bill_len":41.8,"bill_dep":19.4},{"species":"Adelie","bill_len":33.5,"bill_dep":19},{"species":"Adelie","bill_len":39.7,"bill_dep":18.4},{"species":"Adelie","bill_len":39.6,"bill_dep":17.2},{"species":"Adelie","bill_len":45.8,"bill_dep":18.9},{"species":"Adelie","bill_len":35.5,"bill_dep":17.5},{"species":"Adelie","bill_len":42.8,"bill_dep":18.5},{"species":"Adelie","bill_len":40.9,"bill_dep":16.8},{"species":"Adelie","bill_len":37.2,"bill_dep":19.4},{"species":"Adelie","bill_len":36.2,"bill_dep":16.1},{"species":"Adelie","bill_len":42.1,"bill_dep":19.1},{"species":"Adelie","bill_len":34.6,"bill_dep":17.2},{"species":"Adelie","bill_len":42.9,"bill_dep":17.6},{"species":"Adelie","bill_len":36.7,"bill_dep":18.8},{"species":"Adelie","bill_len":35.1,"bill_dep":19.4},{"species":"Adelie","bill_len":37.3,"bill_dep":17.8},{"species":"Adelie","bill_len":41.3,"bill_dep":20.3},{"species":"Adelie","bill_len":36.3,"bill_dep":19.5},{"species":"Adelie","bill_len":36.9,"bill_dep":18.6},{"species":"Adelie","bill_len":38.3,"bill_dep":19.2},{"species":"Adelie","bill_len":38.9,"bill_dep":18.8},{"species":"Adelie","bill_len":35.7,"bill_dep":18},{"species":"Adelie","bill_len":41.1,"bill_dep":18.1},{"species":"Adelie","bill_len":34,"bill_dep":17.1},{"species":"Adelie","bill_len":39.6,"bill_dep":18.1},{"species":"Adelie","bill_len":36.2,"bill_dep":17.3},{"species":"Adelie","bill_len":40.8,"bill_dep":18.9},{"species":"Adelie","bill_len":38.1,"bill_dep":18.6},{"species":"Adelie","bill_len":40.3,"bill_dep":18.5},{"species":"Adelie","bill_len":33.1,"bill_dep":16.1},{"species":"Adelie","bill_len":43.2,"bill_dep":18.5},{"species":"Adelie","bill_len":35,"bill_dep":17.9},{"species":"Adelie","bill_len":41,"bill_dep":20},{"species":"Adelie","bill_len":37.7,"bill_dep":16},{"species":"Adelie","bill_len":37.8,"bill_dep":20},{"species":"Adelie","bill_len":37.9,"bill_dep":18.6},{"species":"Adelie","bill_len":39.7,"bill_dep":18.9},{"species":"Adelie","bill_len":38.6,"bill_dep":17.2},{"species":"Adelie","bill_len":38.2,"bill_dep":20},{"species":"Adelie","bill_len":38.1,"bill_dep":17},{"species":"Adelie","bill_len":43.2,"bill_dep":19},{"species":"Adelie","bill_len":38.1,"bill_dep":16.5},{"species":"Adelie","bill_len":45.6,"bill_dep":20.3},{"species":"Adelie","bill_len":39.7,"bill_dep":17.7},{"species":"Adelie","bill_len":42.2,"bill_dep":19.5},{"species":"Adelie","bill_len":39.6,"bill_dep":20.7},{"species":"Adelie","bill_len":42.7,"bill_dep":18.3},{"species":"Adelie","bill_len":38.6,"bill_dep":17},{"species":"Adelie","bill_len":37.3,"bill_dep":20.5},{"species":"Adelie","bill_len":35.7,"bill_dep":17},{"species":"Adelie","bill_len":41.1,"bill_dep":18.6},{"species":"Adelie","bill_len":36.2,"bill_dep":17.2},{"species":"Adelie","bill_len":37.7,"bill_dep":19.8},{"species":"Adelie","bill_len":40.2,"bill_dep":17},{"species":"Adelie","bill_len":41.4,"bill_dep":18.5},{"species":"Adelie","bill_len":35.2,"bill_dep":15.9},{"species":"Adelie","bill_len":40.6,"bill_dep":19},{"species":"Adelie","bill_len":38.8,"bill_dep":17.6},{"species":"Adelie","bill_len":41.5,"bill_dep":18.3},{"species":"Adelie","bill_len":39,"bill_dep":17.1},{"species":"Adelie","bill_len":44.1,"bill_dep":18},{"species":"Adelie","bill_len":38.5,"bill_dep":17.9},{"species":"Adelie","bill_len":43.1,"bill_dep":19.2},{"species":"Adelie","bill_len":36.8,"bill_dep":18.5},{"species":"Adelie","bill_len":37.5,"bill_dep":18.5},{"species":"Adelie","bill_len":38.1,"bill_dep":17.6},{"species":"Adelie","bill_len":41.1,"bill_dep":17.5},{"species":"Adelie","bill_len":35.6,"bill_dep":17.5},{"species":"Adelie","bill_len":40.2,"bill_dep":20.1},{"species":"Adelie","bill_len":37,"bill_dep":16.5},{"species":"Adelie","bill_len":39.7,"bill_dep":17.9},{"species":"Adelie","bill_len":40.2,"bill_dep":17.1},{"species":"Adelie","bill_len":40.6,"bill_dep":17.2},{"species":"Adelie","bill_len":32.1,"bill_dep":15.5},{"species":"Adelie","bill_len":40.7,"bill_dep":17},{"species":"Adelie","bill_len":37.3,"bill_dep":16.8},{"species":"Adelie","bill_len":39,"bill_dep":18.7},{"species":"Adelie","bill_len":39.2,"bill_dep":18.6},{"species":"Adelie","bill_len":36.6,"bill_dep":18.4},{"species":"Adelie","bill_len":36,"bill_dep":17.8},{"species":"Adelie","bill_len":37.8,"bill_dep":18.1},{"species":"Adelie","bill_len":36,"bill_dep":17.1},{"species":"Adelie","bill_len":41.5,"bill_dep":18.5},{"species":"Gentoo","bill_len":46.1,"bill_dep":13.2},{"species":"Gentoo","bill_len":50,"bill_dep":16.3},{"species":"Gentoo","bill_len":48.7,"bill_dep":14.1},{"species":"Gentoo","bill_len":50,"bill_dep":15.2},{"species":"Gentoo","bill_len":47.6,"bill_dep":14.5},{"species":"Gentoo","bill_len":46.5,"bill_dep":13.5},{"species":"Gentoo","bill_len":45.4,"bill_dep":14.6},{"species":"Gentoo","bill_len":46.7,"bill_dep":15.3},{"species":"Gentoo","bill_len":43.3,"bill_dep":13.4},{"species":"Gentoo","bill_len":46.8,"bill_dep":15.4},{"species":"Gentoo","bill_len":40.9,"bill_dep":13.7},{"species":"Gentoo","bill_len":49,"bill_dep":16.1},{"species":"Gentoo","bill_len":45.5,"bill_dep":13.7},{"species":"Gentoo","bill_len":48.4,"bill_dep":14.6},{"species":"Gentoo","bill_len":45.8,"bill_dep":14.6},{"species":"Gentoo","bill_len":49.3,"bill_dep":15.7},{"species":"Gentoo","bill_len":42,"bill_dep":13.5},{"species":"Gentoo","bill_len":49.2,"bill_dep":15.2},{"species":"Gentoo","bill_len":46.2,"bill_dep":14.5},{"species":"Gentoo","bill_len":48.7,"bill_dep":15.1},{"species":"Gentoo","bill_len":50.2,"bill_dep":14.3},{"species":"Gentoo","bill_len":45.1,"bill_dep":14.5},{"species":"Gentoo","bill_len":46.5,"bill_dep":14.5},{"species":"Gentoo","bill_len":46.3,"bill_dep":15.8},{"species":"Gentoo","bill_len":42.9,"bill_dep":13.1},{"species":"Gentoo","bill_len":46.1,"bill_dep":15.1},{"species":"Gentoo","bill_len":44.5,"bill_dep":14.3},{"species":"Gentoo","bill_len":47.8,"bill_dep":15},{"species":"Gentoo","bill_len":48.2,"bill_dep":14.3},{"species":"Gentoo","bill_len":50,"bill_dep":15.3},{"species":"Gentoo","bill_len":47.3,"bill_dep":15.3},{"species":"Gentoo","bill_len":42.8,"bill_dep":14.2},{"species":"Gentoo","bill_len":45.1,"bill_dep":14.5},{"species":"Gentoo","bill_len":59.6,"bill_dep":17},{"species":"Gentoo","bill_len":49.1,"bill_dep":14.8},{"species":"Gentoo","bill_len":48.4,"bill_dep":16.3},{"species":"Gentoo","bill_len":42.6,"bill_dep":13.7},{"species":"Gentoo","bill_len":44.4,"bill_dep":17.3},{"species":"Gentoo","bill_len":44,"bill_dep":13.6},{"species":"Gentoo","bill_len":48.7,"bill_dep":15.7},{"species":"Gentoo","bill_len":42.7,"bill_dep":13.7},{"species":"Gentoo","bill_len":49.6,"bill_dep":16},{"species":"Gentoo","bill_len":45.3,"bill_dep":13.7},{"species":"Gentoo","bill_len":49.6,"bill_dep":15},{"species":"Gentoo","bill_len":50.5,"bill_dep":15.9},{"species":"Gentoo","bill_len":43.6,"bill_dep":13.9},{"species":"Gentoo","bill_len":45.5,"bill_dep":13.9},{"species":"Gentoo","bill_len":50.5,"bill_dep":15.9},{"species":"Gentoo","bill_len":44.9,"bill_dep":13.3},{"species":"Gentoo","bill_len":45.2,"bill_dep":15.8},{"species":"Gentoo","bill_len":46.6,"bill_dep":14.2},{"species":"Gentoo","bill_len":48.5,"bill_dep":14.1},{"species":"Gentoo","bill_len":45.1,"bill_dep":14.4},{"species":"Gentoo","bill_len":50.1,"bill_dep":15},{"species":"Gentoo","bill_len":46.5,"bill_dep":14.4},{"species":"Gentoo","bill_len":45,"bill_dep":15.4},{"species":"Gentoo","bill_len":43.8,"bill_dep":13.9},{"species":"Gentoo","bill_len":45.5,"bill_dep":15},{"species":"Gentoo","bill_len":43.2,"bill_dep":14.5},{"species":"Gentoo","bill_len":50.4,"bill_dep":15.3},{"species":"Gentoo","bill_len":45.3,"bill_dep":13.8},{"species":"Gentoo","bill_len":46.2,"bill_dep":14.9},{"species":"Gentoo","bill_len":45.7,"bill_dep":13.9},{"species":"Gentoo","bill_len":54.3,"bill_dep":15.7},{"species":"Gentoo","bill_len":45.8,"bill_dep":14.2},{"species":"Gentoo","bill_len":49.8,"bill_dep":16.8},{"species":"Gentoo","bill_len":46.2,"bill_dep":14.4},{"species":"Gentoo","bill_len":49.5,"bill_dep":16.2},{"species":"Gentoo","bill_len":43.5,"bill_dep":14.2},{"species":"Gentoo","bill_len":50.7,"bill_dep":15},{"species":"Gentoo","bill_len":47.7,"bill_dep":15},{"species":"Gentoo","bill_len":46.4,"bill_dep":15.6},{"species":"Gentoo","bill_len":48.2,"bill_dep":15.6},{"species":"Gentoo","bill_len":46.5,"bill_dep":14.8},{"species":"Gentoo","bill_len":46.4,"bill_dep":15},{"species":"Gentoo","bill_len":48.6,"bill_dep":16},{"species":"Gentoo","bill_len":47.5,"bill_dep":14.2},{"species":"Gentoo","bill_len":51.1,"bill_dep":16.3},{"species":"Gentoo","bill_len":45.2,"bill_dep":13.8},{"species":"Gentoo","bill_len":45.2,"bill_dep":16.4},{"species":"Gentoo","bill_len":49.1,"bill_dep":14.5},{"species":"Gentoo","bill_len":52.5,"bill_dep":15.6},{"species":"Gentoo","bill_len":47.4,"bill_dep":14.6},{"species":"Gentoo","bill_len":50,"bill_dep":15.9},{"species":"Gentoo","bill_len":44.9,"bill_dep":13.8},{"species":"Gentoo","bill_len":50.8,"bill_dep":17.3},{"species":"Gentoo","bill_len":43.4,"bill_dep":14.4},{"species":"Gentoo","bill_len":51.3,"bill_dep":14.2},{"species":"Gentoo","bill_len":47.5,"bill_dep":14},{"species":"Gentoo","bill_len":52.1,"bill_dep":17},{"species":"Gentoo","bill_len":47.5,"bill_dep":15},{"species":"Gentoo","bill_len":52.2,"bill_dep":17.1},{"species":"Gentoo","bill_len":45.5,"bill_dep":14.5},{"species":"Gentoo","bill_len":49.5,"bill_dep":16.1},{"species":"Gentoo","bill_len":44.5,"bill_dep":14.7},{"species":"Gentoo","bill_len":50.8,"bill_dep":15.7},{"species":"Gentoo","bill_len":49.4,"bill_dep":15.8},{"species":"Gentoo","bill_len":46.9,"bill_dep":14.6},{"species":"Gentoo","bill_len":48.4,"bill_dep":14.4},{"species":"Gentoo","bill_len":51.1,"bill_dep":16.5},{"species":"Gentoo","bill_len":48.5,"bill_dep":15},{"species":"Gentoo","bill_len":55.9,"bill_dep":17},{"species":"Gentoo","bill_len":47.2,"bill_dep":15.5},{"species":"Gentoo","bill_len":49.1,"bill_dep":15},{"species":"Gentoo","bill_len":47.3,"bill_dep":13.8},{"species":"Gentoo","bill_len":46.8,"bill_dep":16.1},{"species":"Gentoo","bill_len":41.7,"bill_dep":14.7},{"species":"Gentoo","bill_len":53.4,"bill_dep":15.8},{"species":"Gentoo","bill_len":43.3,"bill_dep":14},{"species":"Gentoo","bill_len":48.1,"bill_dep":15.1},{"species":"Gentoo","bill_len":50.5,"bill_dep":15.2},{"species":"Gentoo","bill_len":49.8,"bill_dep":15.9},{"species":"Gentoo","bill_len":43.5,"bill_dep":15.2},{"species":"Gentoo","bill_len":51.5,"bill_dep":16.3},{"species":"Gentoo","bill_len":46.2,"bill_dep":14.1},{"species":"Gentoo","bill_len":55.1,"bill_dep":16},{"species":"Gentoo","bill_len":44.5,"bill_dep":15.7},{"species":"Gentoo","bill_len":48.8,"bill_dep":16.2},{"species":"Gentoo","bill_len":47.2,"bill_dep":13.7},{"species":"Gentoo","bill_len":46.8,"bill_dep":14.3},{"species":"Gentoo","bill_len":50.4,"bill_dep":15.7},{"species":"Gentoo","bill_len":45.2,"bill_dep":14.8},{"species":"Gentoo","bill_len":49.9,"bill_dep":16.1},{"species":"Chinstrap","bill_len":46.5,"bill_dep":17.9},{"species":"Chinstrap","bill_len":50,"bill_dep":19.5},{"species":"Chinstrap","bill_len":51.3,"bill_dep":19.2},{"species":"Chinstrap","bill_len":45.4,"bill_dep":18.7},{"species":"Chinstrap","bill_len":52.7,"bill_dep":19.8},{"species":"Chinstrap","bill_len":45.2,"bill_dep":17.8},{"species":"Chinstrap","bill_len":46.1,"bill_dep":18.2},{"species":"Chinstrap","bill_len":51.3,"bill_dep":18.2},{"species":"Chinstrap","bill_len":46,"bill_dep":18.9},{"species":"Chinstrap","bill_len":51.3,"bill_dep":19.9},{"species":"Chinstrap","bill_len":46.6,"bill_dep":17.8},{"species":"Chinstrap","bill_len":51.7,"bill_dep":20.3},{"species":"Chinstrap","bill_len":47,"bill_dep":17.3},{"species":"Chinstrap","bill_len":52,"bill_dep":18.1},{"species":"Chinstrap","bill_len":45.9,"bill_dep":17.1},{"species":"Chinstrap","bill_len":50.5,"bill_dep":19.6},{"species":"Chinstrap","bill_len":50.3,"bill_dep":20},{"species":"Chinstrap","bill_len":58,"bill_dep":17.8},{"species":"Chinstrap","bill_len":46.4,"bill_dep":18.6},{"species":"Chinstrap","bill_len":49.2,"bill_dep":18.2},{"species":"Chinstrap","bill_len":42.4,"bill_dep":17.3},{"species":"Chinstrap","bill_len":48.5,"bill_dep":17.5},{"species":"Chinstrap","bill_len":43.2,"bill_dep":16.6},{"species":"Chinstrap","bill_len":50.6,"bill_dep":19.4},{"species":"Chinstrap","bill_len":46.7,"bill_dep":17.9},{"species":"Chinstrap","bill_len":52,"bill_dep":19},{"species":"Chinstrap","bill_len":50.5,"bill_dep":18.4},{"species":"Chinstrap","bill_len":49.5,"bill_dep":19},{"species":"Chinstrap","bill_len":46.4,"bill_dep":17.8},{"species":"Chinstrap","bill_len":52.8,"bill_dep":20},{"species":"Chinstrap","bill_len":40.9,"bill_dep":16.6},{"species":"Chinstrap","bill_len":54.2,"bill_dep":20.8},{"species":"Chinstrap","bill_len":42.5,"bill_dep":16.7},{"species":"Chinstrap","bill_len":51,"bill_dep":18.8},{"species":"Chinstrap","bill_len":49.7,"bill_dep":18.6},{"species":"Chinstrap","bill_len":47.5,"bill_dep":16.8},{"species":"Chinstrap","bill_len":47.6,"bill_dep":18.3},{"species":"Chinstrap","bill_len":52,"bill_dep":20.7},{"species":"Chinstrap","bill_len":46.9,"bill_dep":16.6},{"species":"Chinstrap","bill_len":53.5,"bill_dep":19.9},{"species":"Chinstrap","bill_len":49,"bill_dep":19.5},{"species":"Chinstrap","bill_len":46.2,"bill_dep":17.5},{"species":"Chinstrap","bill_len":50.9,"bill_dep":19.1},{"species":"Chinstrap","bill_len":45.5,"bill_dep":17},{"species":"Chinstrap","bill_len":50.9,"bill_dep":17.9},{"species":"Chinstrap","bill_len":50.8,"bill_dep":18.5},{"species":"Chinstrap","bill_len":50.1,"bill_dep":17.9},{"species":"Chinstrap","bill_len":49,"bill_dep":19.6},{"species":"Chinstrap","bill_len":51.5,"bill_dep":18.7},{"species":"Chinstrap","bill_len":49.8,"bill_dep":17.3},{"species":"Chinstrap","bill_len":48.1,"bill_dep":16.4},{"species":"Chinstrap","bill_len":51.4,"bill_dep":19},{"species":"Chinstrap","bill_len":45.7,"bill_dep":17.3},{"species":"Chinstrap","bill_len":50.7,"bill_dep":19.7},{"species":"Chinstrap","bill_len":42.5,"bill_dep":17.3},{"species":"Chinstrap","bill_len":52.2,"bill_dep":18.8},{"species":"Chinstrap","bill_len":45.2,"bill_dep":16.6},{"species":"Chinstrap","bill_len":49.3,"bill_dep":19.9},{"species":"Chinstrap","bill_len":50.2,"bill_dep":18.8},{"species":"Chinstrap","bill_len":45.6,"bill_dep":19.4},{"species":"Chinstrap","bill_len":51.9,"bill_dep":19.5},{"species":"Chinstrap","bill_len":46.8,"bill_dep":16.5},{"species":"Chinstrap","bill_len":45.7,"bill_dep":17},{"species":"Chinstrap","bill_len":55.8,"bill_dep":19.8},{"species":"Chinstrap","bill_len":43.5,"bill_dep":18.1},{"species":"Chinstrap","bill_len":49.6,"bill_dep":18.2},{"species":"Chinstrap","bill_len":50.8,"bill_dep":19},{"species":"Chinstrap","bill_len":50.2,"bill_dep":18.7}],"bfd4dfa854":[{"date":"2022-01-03","price":3.281},{"date":"2022-01-10","price":3.295},{"date":"2022-01-17","price":3.306},{"date":"2022-01-24","price":3.323},{"date":"2022-01-31","price":3.368},{"date":"2022-02-07","price":3.444},{"date":"2022-02-14","price":3.487},{"date":"2022-02-21","price":3.53},{"date":"2022-02-28","price":3.608},{"date":"2022-03-07","price":4.102},{"date":"2022-03-14","price":4.315},{"date":"2022-03-21","price":4.239},{"date":"2022-03-28","price":4.231},{"date":"2022-04-04","price":4.17},{"date":"2022-04-11","price":4.091},{"date":"2022-04-18","price":4.066},{"date":"2022-04-25","price":4.107},{"date":"2022-05-02","price":4.182},{"date":"2022-05-09","price":4.328},{"date":"2022-05-16","price":4.491},{"date":"2022-05-23","price":4.593},{"date":"2022-05-30","price":4.624},{"date":"2022-06-06","price":4.876},{"date":"2022-06-13","price":5.006},{"date":"2022-06-20","price":4.962},{"date":"2022-06-27","price":4.872},{"date":"2022-07-04","price":4.771},{"date":"2022-07-11","price":4.646},{"date":"2022-07-18","price":4.49},{"date":"2022-07-25","price":4.33},{"date":"2022-08-01","price":4.192},{"date":"2022-08-08","price":4.038},{"date":"2022-08-15","price":3.938},{"date":"2022-08-22","price":3.88},{"date":"2022-08-29","price":3.827},{"date":"2022-09-05","price":3.746},{"date":"2022-09-12","price":3.69},{"date":"2022-09-19","price":3.654},{"date":"2022-09-26","price":3.711},{"date":"2022-10-03","price":3.782},{"date":"2022-10-10","price":3.912},{"date":"2022-10-17","price":3.871},{"date":"2022-10-24","price":3.769},{"date":"2022-10-31","price":3.742},{"date":"2022-11-07","price":3.796},{"date":"2022-11-14","price":3.762},{"date":"2022-11-21","price":3.648},{"date":"2022-11-28","price":3.534},{"date":"2022-12-05","price":3.39},{"date":"2022-12-12","price":3.239},{"date":"2022-12-19","price":3.12},{"date":"2022-12-26","price":3.091}]},"cases":[{"id":"line-peak","group":"one","question":"When did regular gasoline prices peak?","technique":"Point + value label","verdict":"muted","why":"The title says it; the dot and a few words find the week among 1,813.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"$5.01 · Jun 13, 2022","anchor":"point"}}]}],"table":"3dac8dcbd7"},{"id":"scatter-outlier","group":"one","question":"Which car is the most expensive?","technique":"Point + name label","verdict":"muted","why":"A scatter has no axis label per point, so the label names it as well as giving the value.","spec":{"data":{},"semantic_types":{"car":"Name","horsepower":{"semanticType":"Quantity","unit":"hp"},"price":{"semanticType":"Price","unit":"QAR"},"type":"Category","enginetype":"Category"},"chart_spec":{"chartType":"Scatter Plot","title":"The Bugatti Centodieci is the most expensive car listed","subtitle":"105 cars sold in Qatar, 2025 · Price in Qatari riyals (log scale) versus horsepower","source":{"text":"TidyTuesday · 2025-12-09","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"},"encodings":{"x":{"field":"horsepower"},"y":{"field":"price"},"detail":{"field":"car"},"color":{"field":"type"}},"chartProperties":{"logScale_y":true,"opacity":0.5}},"field_display_names":{"car":"Car","horsepower":"Horsepower","price":"Price","type":"Car type"},"interaction_spec":{"interactions":[{"type":"click-highlight","options":{"targets":["mark"]}},{"type":"navigate"}]}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Centodieci"}}},"value":{"highlight":"light","text":"Bugatti Centodieci · QAR 33.0M"}}]}],"table":"c845080ee9"},{"id":"style-default","group":"style","question":"When did regular gasoline prices peak?","technique":"Default type: the labels' face","verdict":"muted","why":"With no annotation role in the theme, a note keeps the axis labels' face and weight, one size up, in the primary ink.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"$5.01 · Jun 13, 2022","anchor":"point"}}]}],"table":"3dac8dcbd7"},{"id":"style-theme","group":"style","question":"When did regular gasoline prices peak?","technique":"Theme type: BBC's annotation role","verdict":"muted","why":"A theme with a type.annotation role sets the note's face, size and ink.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"},"theme_spec":"bbc"},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"$5.01 · Jun 13, 2022","anchor":"point"}}]}],"table":"3dac8dcbd7"},{"id":"style-note","group":"style","question":"When did regular gasoline prices peak?","technique":"One note's own style","verdict":"muted","why":"value.style sets one note's fontSize, fontWeight or color over the theme.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"$5.01 · Jun 13, 2022","anchor":"point","style":{"fontWeight":"bold","color":"#9a3412"}}}]}],"table":"3dac8dcbd7"},{"id":"line-crossing","group":"two","question":"When did China overtake Russia in objects launched?","technique":"One point, one label naming both","verdict":"muted","why":"At a crossing the two marks nearly coincide, and two notes there trade places. One label on one point names both values.","spec":{"data":{},"semantic_types":{"Entity":"Country","Year":"Year","num_objects":"Count"},"chart_spec":{"chartType":"Line Chart","title":"China first launched more objects than Russia in 2012","subtitle":"Annual objects launched into space, 2000–2023; objects, not rocket launches","source":"UN Office for Outer Space Affairs via Our World in Data · TidyTuesday 2024-04-23","encodings":{"x":{"field":"Year"},"y":{"field":"num_objects"},"color":{"field":"Entity"}}},"field_display_names":{"num_objects":"Objects launched","Entity":"Country"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"Entity":"China","Year":2012}}},"value":{"highlight":"light","text":"2012: China 26, Russia 23","anchor":"point"}}]}],"table":"fe320c7a55"},{"id":"bar-difference","group":"two","question":"How much heavier are Gentoo than Adelie penguins?","technique":"Two bars, a value each","verdict":"muted","why":"The difference is in the title; the two values it is made of sit on their bars.","spec":{"data":{},"semantic_types":{"species":"Category","body_mass":{"semanticType":"Mass","unit":"g"}},"chart_spec":{"chartType":"Bar Chart","encodings":{"x":{"field":"species"},"y":{"field":"body_mass","title":"Mean body mass (g)"}},"title":"Gentoo outweigh Adelie by 1.4 kg on average"},"field_display_names":{"species":"Species","body_mass":"Mean body mass"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"species":"Gentoo"}}},"value":{"highlight":"light","text":"5.08 kg"}},{"op":"annotate-text","target":{"select":{"key":{"species":"Adelie"}}},"value":{"highlight":"light","text":"3.70 kg"}}]}],"table":"c3925ad964"},{"id":"threshold","group":"threshold","question":"How long have gas prices stayed above $3?","technique":"Rule + point where it began","verdict":"muted","why":"A plain dashed rule at the value the question names, and one point where the run starts.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline has stayed above $3 since May 2021","subtitle":"Weekly US average retail price, 2019–2025","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"set-overlay","name":"three","value":{"mark":"rule","role":"reference","data":{"values":[{"y":3}]},"encodings":{"y":{"field":"y"}},"style":{"strokeDash":"dash"}}},{"op":"annotate-text","target":{"select":{"key":{"date":"2021-05-17"}}},"value":{"highlight":"light","text":"May 17, 2021 · $3.03","anchor":"point"}}]}],"table":"bf708b40a2"},{"id":"pie-label","group":"room","question":"What takes up most of the human day?","technique":"Donut: short label in the hole","verdict":"muted","why":"A donut's hole is open room: a short label sits there, no leader. Where the hole is too small, the caption may sit inside a big slice; it is never put on the legend.","spec":{"data":{},"semantic_types":{"Subcategory":"Category","hoursPerDay":{"semanticType":"Duration","unit":"hours"},"uncertainty":"Quantity"},"chart_spec":{"chartType":"Pie Chart","title":"Sleep & bedrest takes 9.1 of the day's 24 hours","subtitle":"Average hours per person per day worldwide, across 24 activity subcategories","source":{"text":"Fajzel et al. (2023) · TidyTuesday 2023-09-12","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2023/2023-09-12"},"encodings":{"size":{"field":"hoursPerDay"},"color":{"field":"Subcategory"}},"chartProperties":{"innerRadius":70}},"field_display_names":{"Subcategory":"Activity","hoursPerDay":"Hours per day","uncertainty":"Uncertainty (variance)"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"Subcategory":"Sleep & bedrest"}}},"value":{"highlight":"light","text":"Sleep & bedrest · 9.1 h"}}]}],"table":"352b75c8eb"},{"id":"map-label","group":"room","question":"Which country has the highest share of internet users?","technique":"Map, small region by open sea: short label + leader","verdict":"muted","why":"Iceland is too small to find by its outline alone, and the sea beside it is open: a short label on a leader finds it.","spec":{"data":{},"semantic_types":{"map_country":"Country","country":"Country","internet_share":{"semanticType":"Percentage","percentScale":"fraction"}},"chart_spec":{"chartType":"Choropleth","title":"Iceland has the highest internet use, 95% of people","subtitle":"Internet users ÷ population · CIA World Factbook, 2014 edition. Unshaded areas lack data or matching boundaries.","source":{"text":"CIA World Factbook · TidyTuesday 2024-10-22","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2024/2024-10-22"},"encodings":{"id":{"field":"map_country"},"color":{"field":"internet_share","domain":[0,1]},"detail":{"field":"country"}},"chartProperties":{"region":"world"}},"field_display_names":{"internet_share":"Internet users (% of population)","country":"Country","map_country":"Country"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"country":"Iceland"}}},"value":{"highlight":"strong","text":"Iceland · 95%"}}]}],"table":"faf50efcec"},{"id":"heatmap-max","group":"room","question":"Which month was the warmest on record?","technique":"Heatmap, no gaps between cells: outline only","verdict":"muted","why":"Every cell is ink; any label covers its neighbours. The outline points and the title names it. The cell has to be in view: on a grid that scrolls, narrow the years first.","spec":{"data":{},"semantic_types":{"Year":"Year","Month":"Month","Anomaly":{"semanticType":"Temperature","unit":"°C","divergingMidpoint":0}},"chart_spec":{"chartType":"Heatmap","title":"The warmest month on record was Feb 2016, +1.37 °C","subtitle":"Monthly global surface temperature anomalies, 1980–2023 (°C)","source":{"text":"NASA GISTEMP v4 · TidyTuesday 2023-07-11","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2023/2023-07-11"},"encodings":{"x":{"field":"Year","type":"ordinal"},"y":{"field":"Month"},"color":{"field":"Anomaly"}}},"field_display_names":{"Anomaly":"Temperature anomaly (°C)"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"Year":2016,"Month":"Feb"}}},"value":{"text":"","highlight":"strong"}}]}],"table":"71f188c336"},{"id":"bar-top","group":"room","question":"Which WHO region had the most measles cases in 2019?","technique":"Bars that already print values: outline only","verdict":"muted","why":"The axis names the region and the bar prints its value; another label would repeat both.","spec":{"data":{},"semantic_types":{"who_region":"Region","cases":"Count"},"chart_spec":{"chartType":"Bar Chart","title":"Africa reported the most measles cases in 2019","subtitle":"Total reported measles cases by WHO region; summed across countries","source":{"text":"WHO via TidyTuesday, 2025-06-24","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-06-24"},"encodings":{"y":{"field":"who_region","sortBy":"x","sortOrder":"descending"},"x":{"field":"cases"}},"chartProperties":{"showValueLabels":true}}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"who_region":"Africa"}}},"value":{"text":"","highlight":"strong"}}]}],"table":"19b31aae9f"},{"id":"span-shade","group":"span","question":"How long did the 2008 gas price crash last?","technique":"Light shade, no caption (title gives the dates)","verdict":"muted","why":"One light shade under the line points at the span; the title already names it, so no text.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Gas prices fell from $4.11 to $1.61 between July and December 2008","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-region","name":"crash","value":{"layer":"under","opacity":0.12,"x":["2008-07-07","2008-12-29"]}}]}],"table":"3dac8dcbd7"},{"id":"span-caption","group":"span","question":"How long did the 2008 gas price crash last?","technique":"Light shade + short range caption (open plot above)","verdict":"muted","why":"The title gives the event, not the dates, and there is open plot above the shade, so a range label of a few words fits.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Gas prices crashed in the second half of 2008","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-region","name":"crash","value":{"layer":"under","opacity":0.12,"x":["2008-07-07","2008-12-29"],"text":"Jul–Dec 2008"}}]}],"table":"3dac8dcbd7"},{"id":"span-band","group":"span","question":"Since 2022, have gas prices stayed between $3 and $4?","technique":"Light y band, no caption","verdict":"muted","why":"The answer is a band of values: a light horizontal shade, under the line, says where it is.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Since late 2022, regular gasoline has stayed between $3 and $4","subtitle":"Weekly US average retail price, 2019–2025","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-region","name":"band","value":{"layer":"under","opacity":0.12,"y":[3,4]}}]}],"table":"bf708b40a2"},{"id":"set-emphasis","group":"span","question":"Which cars cost more than QAR 5 million?","technique":"Light emphasis on a small set + a label each (3 members, room)","verdict":"muted","why":"Three answers with open space round them: the rest recede a little, each answer is lifted and carries its name. On a chart drawn translucent the set also takes full opacity, or emphasis barely separates it.","spec":{"data":{},"semantic_types":{"car":"Name","horsepower":{"semanticType":"Quantity","unit":"hp"},"price":{"semanticType":"Price","unit":"QAR"},"type":"Category","enginetype":"Category"},"chart_spec":{"chartType":"Scatter Plot","title":"Three cars cost more than QAR 5 million","subtitle":"105 cars sold in Qatar, 2025 · Price in Qatari riyals (log scale) versus horsepower","source":{"text":"TidyTuesday · 2025-12-09","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"},"encodings":{"x":{"field":"horsepower"},"y":{"field":"price"},"detail":{"field":"car"},"color":{"field":"type"}},"chartProperties":{"logScale_y":true,"opacity":0.5}},"field_display_names":{"car":"Car","horsepower":"Horsepower","price":"Price","type":"Car type"},"interaction_spec":{"interactions":[{"type":"click-highlight","options":{"targets":["mark"]}},{"type":"navigate"}]}},"updates":[{"id":"muted","ops":[{"op":"set-style","targets":[{"select":{"where":{"price":{"range":[5000001,1000000000.0]}}}}],"value":{"state":"emphasized","emphasis":"light","opacity":1}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Centodieci"}}},"value":{"highlight":"none","text":"Bugatti Centodieci · 33M"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Chiron"}}},"value":{"highlight":"none","text":"Bugatti Chiron · 13M"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Lotus Evija"}}},"value":{"highlight":"none","text":"Lotus Evija · 8M"}}]}],"table":"c845080ee9"},{"id":"set-outline","group":"span","question":"Which cars cost more than QAR 5 million?","technique":"Outline each member, rest as drawn","verdict":"muted","why":"The quieter form: the title lists the cars and each is ringed; nothing else on the chart changes.","spec":{"data":{},"semantic_types":{"car":"Name","horsepower":{"semanticType":"Quantity","unit":"hp"},"price":{"semanticType":"Price","unit":"QAR"},"type":"Category","enginetype":"Category"},"chart_spec":{"chartType":"Scatter Plot","title":"Three cars cost more than QAR 5 million: Bugatti Centodieci, Bugatti Chiron, Lotus Evija","subtitle":"105 cars sold in Qatar, 2025 · Price in Qatari riyals (log scale) versus horsepower","source":{"text":"TidyTuesday · 2025-12-09","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"},"encodings":{"x":{"field":"horsepower"},"y":{"field":"price"},"detail":{"field":"car"},"color":{"field":"type"}},"chartProperties":{"logScale_y":true,"opacity":0.5}},"field_display_names":{"car":"Car","horsepower":"Horsepower","price":"Price","type":"Car type"},"interaction_spec":{"interactions":[{"type":"click-highlight","options":{"targets":["mark"]}},{"type":"navigate"}]}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Centodieci"}}},"value":{"text":"","highlight":"strong"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Chiron"}}},"value":{"text":"","highlight":"strong"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Lotus Evija"}}},"value":{"text":"","highlight":"strong"}}]}],"table":"c845080ee9"},{"id":"enclosure","group":"span","question":"Do Gentoo penguins form their own cluster?","technique":"One light enclosure, no caption","verdict":"muted","why":"The answer is a group: one outline round it. The legend already names the colour, so no caption.","spec":{"data":{},"semantic_types":{"species":"Category","bill_len":{"semanticType":"Quantity","unit":"mm"},"bill_dep":{"semanticType":"Quantity","unit":"mm"}},"chart_spec":{"chartType":"Scatter Plot","title":"Gentoo penguins form their own cluster: longer, shallower bills","subtitle":"Palmer Archipelago, 2007–2009 · 342 penguins; 2 missing measurements excluded","source":{"text":"TidyTuesday 2025-04-15","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-04-15"},"encodings":{"x":{"field":"bill_dep"},"y":{"field":"bill_len"},"color":{"field":"species"}}},"field_display_names":{"bill_dep":"Bill depth","bill_len":"Bill length","species":"Species"}},"updates":[{"id":"muted","ops":[{"op":"annotate-enclosure","name":"gentoo","value":{"targets":[{"select":{"where":{"species":{"in":["Gentoo"]}}}}],"shape":"hull","connect":"none"}}]}],"table":"42be3deccc"},{"id":"set-labels","group":"outside","question":"Which are the 12 most expensive cars?","technique":"Avoid: a label on every member of a large set","verdict":"avoid","why":"Twelve labels crowd the upper corner and hide each other; emphasise the set and list it in the reply.","spec":{"data":{},"semantic_types":{"car":"Name","horsepower":{"semanticType":"Quantity","unit":"hp"},"price":{"semanticType":"Price","unit":"QAR"},"type":"Category","enginetype":"Category"},"chart_spec":{"chartType":"Scatter Plot","title":"The 12 most expensive cars listed","subtitle":"105 cars sold in Qatar, 2025 · Price in Qatari riyals (log scale) versus horsepower","source":{"text":"TidyTuesday · 2025-12-09","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"},"encodings":{"x":{"field":"horsepower"},"y":{"field":"price"},"detail":{"field":"car"},"color":{"field":"type"}},"chartProperties":{"logScale_y":true,"opacity":0.5}},"field_display_names":{"car":"Car","horsepower":"Horsepower","price":"Price","type":"Car type"},"interaction_spec":{"interactions":[{"type":"click-highlight","options":{"targets":["mark"]}},{"type":"navigate"}]}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Centodieci"}}},"value":{"highlight":"none","text":"Bugatti Centodieci"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Chiron"}}},"value":{"highlight":"none","text":"Bugatti Chiron"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Lotus Evija"}}},"value":{"highlight":"none","text":"Lotus Evija"}},{"op":"annotate-text","target":{"select":{"key":{"car":"McLaren Senna"}}},"value":{"highlight":"none","text":"McLaren Senna"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bentley Flying Spur"}}},"value":{"highlight":"none","text":"Bentley Flying Spur"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Mercedes Maybach"}}},"value":{"highlight":"none","text":"Mercedes Maybach"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bentley Continental GT"}}},"value":{"highlight":"none","text":"Bentley Continental GT"}},{"op":"annotate-text","target":{"select":{"key":{"car":"McLaren 720S"}}},"value":{"highlight":"none","text":"McLaren 720S"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Mercedes G-Wagon"}}},"value":{"highlight":"none","text":"Mercedes G-Wagon"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bentley Bentyaga"}}},"value":{"highlight":"none","text":"Bentley Bentyaga"}},{"op":"annotate-text","target":{"select":{"key":{"car":"McLaren Artura"}}},"value":{"highlight":"none","text":"McLaren Artura"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Audi RS Q8"}}},"value":{"highlight":"none","text":"Audi RS Q8"}}]}],"table":"c845080ee9"},{"id":"unasked-context","group":"outside","question":"When did regular gasoline prices peak?","technique":"Avoid: shading context the question did not ask for","verdict":"avoid","why":"The question is the peak; shaded episodes it did not ask about are the agent's story, not the answer.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"$5.01 · Jun 13, 2022","anchor":"point"}},{"op":"annotate-region","name":"crash","value":{"layer":"under","opacity":0.12,"x":["2008-07-07","2008-12-29"],"text":"2008 crash"}},{"op":"annotate-region","name":"covid","value":{"layer":"under","opacity":0.12,"x":["2020-03-01","2020-06-01"],"text":"Pandemic"}}]}],"table":"3dac8dcbd7"},{"id":"paint-theme","group":"style","question":"Which cars cost more than QAR 5 million?","technique":"Rings in the theme's highlight paint","verdict":"muted","why":"A house that extends datawrapper with interaction.highlight { color, width }: every ring, outline and enclosure takes it. (A partial theme_spec with no extends drops the house palette, so the dots go single-colour.)","spec":{"data":{},"semantic_types":{"car":"Name","horsepower":{"semanticType":"Quantity","unit":"hp"},"price":{"semanticType":"Price","unit":"QAR"},"type":"Category","enginetype":"Category"},"chart_spec":{"chartType":"Scatter Plot","title":"Three cars cost more than QAR 5 million: Bugatti Centodieci, Bugatti Chiron, Lotus Evija","subtitle":"105 cars sold in Qatar, 2025 · Price in Qatari riyals (log scale) versus horsepower","source":{"text":"TidyTuesday · 2025-12-09","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"},"encodings":{"x":{"field":"horsepower"},"y":{"field":"price"},"detail":{"field":"car"},"color":{"field":"type"}},"chartProperties":{"logScale_y":true,"opacity":0.5}},"field_display_names":{"car":"Car","horsepower":"Horsepower","price":"Price","type":"Car type"},"interaction_spec":{"interactions":[{"type":"click-highlight","options":{"targets":["mark"]}},{"type":"navigate"}]},"theme_spec":{"extends":"datawrapper","interaction":{"highlight":{"color":"#2563eb","width":1.75}}}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Centodieci"}}},"value":{"text":"","highlight":"strong"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Chiron"}}},"value":{"text":"","highlight":"strong"}},{"op":"annotate-text","target":{"select":{"key":{"car":"Lotus Evija"}}},"value":{"text":"","highlight":"strong"}}]}],"table":"c845080ee9"},{"id":"paint-note","group":"style","question":"Which car is the most expensive?","technique":"One note's own highlightStyle","verdict":"muted","why":"value.highlightStyle sets one note's ring or outline over the theme.","spec":{"data":{},"semantic_types":{"car":"Name","horsepower":{"semanticType":"Quantity","unit":"hp"},"price":{"semanticType":"Price","unit":"QAR"},"type":"Category","enginetype":"Category"},"chart_spec":{"chartType":"Scatter Plot","title":"The Bugatti Centodieci is the most expensive car listed","subtitle":"105 cars sold in Qatar, 2025 · Price in Qatari riyals (log scale) versus horsepower","source":{"text":"TidyTuesday · 2025-12-09","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-12-09"},"encodings":{"x":{"field":"horsepower"},"y":{"field":"price"},"detail":{"field":"car"},"color":{"field":"type"}},"chartProperties":{"logScale_y":true,"opacity":0.5}},"field_display_names":{"car":"Car","horsepower":"Horsepower","price":"Price","type":"Car type"},"interaction_spec":{"interactions":[{"type":"click-highlight","options":{"targets":["mark"]}},{"type":"navigate"}]}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"car":"Bugatti Centodieci"}}},"value":{"text":"","highlight":"strong","highlightStyle":{"color":"#b91c1c","width":2}}}]}],"table":"c845080ee9"},{"id":"paint-enclosure","group":"style","question":"Do Gentoo penguins form their own cluster?","technique":"Enclosure in the theme's highlight paint","verdict":"muted","why":"Without a theme highlight an enclosure round one colour's cluster takes that colour; with one, it takes the house's paint. Its own color and width override both.","spec":{"data":{},"semantic_types":{"species":"Category","bill_len":{"semanticType":"Quantity","unit":"mm"},"bill_dep":{"semanticType":"Quantity","unit":"mm"}},"chart_spec":{"chartType":"Scatter Plot","title":"Gentoo penguins form their own cluster: longer, shallower bills","subtitle":"Palmer Archipelago, 2007–2009 · 342 penguins; 2 missing measurements excluded","source":{"text":"TidyTuesday 2025-04-15","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-04-15"},"encodings":{"x":{"field":"bill_dep"},"y":{"field":"bill_len"},"color":{"field":"species"}}},"field_display_names":{"bill_dep":"Bill depth","bill_len":"Bill length","species":"Species"},"theme_spec":{"extends":"datawrapper","interaction":{"highlight":{"color":"#2563eb","width":1.75}}}},"updates":[{"id":"muted","ops":[{"op":"annotate-enclosure","name":"gentoo","value":{"targets":[{"select":{"where":{"species":{"in":["Gentoo"]}}}}],"shape":"hull","connect":"none"}}]}],"table":"42be3deccc"},{"id":"story-notes","group":"outside","question":"I need one chart that explains the 2022 spike to someone who doesn't follow energy markets.","technique":"Story notes (full tier)","verdict":"opt-in","why":"Sentences that tell a story are the full tier: only when the user asks for an explaining chart.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Gasoline jumped 53% by June 2022—then fell back","subtitle":"US regular gasoline, all formulations • Weekly average retail price per gallon, 2022","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price","title":"Price per gallon (USD)"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-01-03"}}},"value":{"text":"January starts at $3.28 per gallon","anchor":"point","highlight":"none"}},{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"text":"June peak: $5.01\nA 15-gallon fill-up costs $26 more than in January","anchor":"point","highlight":"light"}},{"op":"annotate-text","target":{"select":{"key":{"date":"2022-12-26"}}},"value":{"text":"Year-end: $3.09\nBack below January's price","anchor":"point","highlight":"none"}}]}],"table":"bfd4dfa854"},{"id":"heatmap-label","group":"outside","question":"Which month was the warmest on record?","technique":"Avoid: a label inside a dense grid","verdict":"avoid","why":"With no open space the label sits on the neighbouring cells and hides the data it is about.","spec":{"data":{},"semantic_types":{"Year":"Year","Month":"Month","Anomaly":{"semanticType":"Temperature","unit":"°C","divergingMidpoint":0}},"chart_spec":{"chartType":"Heatmap","title":"The warmest month on record was Feb 2016, +1.37 °C","subtitle":"Monthly global surface temperature anomalies, 1980–2023 (°C)","source":{"text":"NASA GISTEMP v4 · TidyTuesday 2023-07-11","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2023/2023-07-11"},"encodings":{"x":{"field":"Year","type":"ordinal"},"y":{"field":"Month"},"color":{"field":"Anomaly"}}},"field_display_names":{"Anomaly":"Temperature anomaly (°C)"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"Year":2016,"Month":"Feb"}}},"value":{"highlight":"light","text":"Feb 2016 · +1.37 °C"}}]}],"table":"71f188c336"},{"id":"tag-only","group":"outside","question":"When did regular gasoline prices peak?","technique":"Avoid: “Peak”","verdict":"avoid","why":"A bare tag says nothing the dot does not; name the value and when.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"Peak","anchor":"point"}}]}],"table":"3dac8dcbd7"},{"id":"sentence","group":"outside","question":"When did regular gasoline prices peak?","technique":"Avoid: “Record high: $5.006 a gallon,…”","verdict":"avoid","why":"A sentence repeats the title and crowds the line; a few words point.","spec":{"data":{},"semantic_types":{"date":"Date","price":{"semanticType":"Price","unit":"USD"}},"chart_spec":{"chartType":"Line Chart","title":"Regular gasoline peaked at $5.006 a gallon in June 2022","subtitle":"US average weekly retail price, all formulations · August 1990–June 2025 · USD per gallon","source":{"text":"US Energy Information Administration via TidyTuesday","href":"https://github.com/rfordatascience/tidytuesday/tree/main/data/2025/2025-07-01"},"encodings":{"x":{"field":"date"},"y":{"field":"price"}}},"field_display_names":{"date":"Week ending","price":"Price per gallon"}},"updates":[{"id":"muted","ops":[{"op":"annotate-text","target":{"select":{"key":{"date":"2022-06-13"}}},"value":{"highlight":"light","text":"Record high: $5.006 a gallon,\nthe week of June 13, 2022","anchor":"point"}}]}],"table":"3dac8dcbd7"}]} diff --git a/site/src/playground/muted-annotations/muted-annotations.css b/site/src/playground/muted-annotations/muted-annotations.css new file mode 100644 index 00000000..7af2ce5b --- /dev/null +++ b/site/src/playground/muted-annotations/muted-annotations.css @@ -0,0 +1,113 @@ +.ma-page { + display: flex; + flex-direction: column; + gap: 24px; + padding: 24px; + max-width: 1600px; + font-size: 13px; + color: #22272e; +} + +.ma-heading h1 { + margin: 0 0 8px; + font-size: 22px; +} + +.ma-heading p, +.ma-rules { + max-width: 980px; + line-height: 1.5; +} + +.ma-rules { + padding-left: 20px; +} + +.ma-rules li { + margin-bottom: 4px; +} + +.ma-section h2 { + margin: 0 0 4px; + font-size: 16px; +} + +.ma-section > p { + margin: 0 0 12px; + max-width: 980px; + color: #57606a; + line-height: 1.5; +} + +.ma-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); + gap: 14px; +} + +.ma-card { + border: 1px solid #d8dee4; + border-left-width: 4px; + border-radius: 8px; + padding: 10px 12px; + background: #fff; + min-width: 0; +} + +.ma-muted { border-left-color: #2da44e; } +.ma-opt-in { border-left-color: #bf8700; } +.ma-avoid { border-left-color: #cf222e; } + +.ma-card-head { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; +} + +.ma-verdict { + padding: 0 8px; + border-radius: 9px; + color: #fff; + font-size: 11px; + font-weight: 600; +} + +.ma-verdict-muted { background: #2da44e; } +.ma-verdict-opt-in { background: #bf8700; } +.ma-verdict-avoid { background: #cf222e; } + +.ma-technique { + font-weight: 600; +} + +.ma-question { + margin: 6px 0; + color: #57606a; +} + +.ma-mount { + width: 100%; + height: 360px; + overflow: hidden; +} + +.ma-why { + margin: 8px 0 4px; + line-height: 1.45; +} + +.ma-ops summary { + font-family: ui-monospace, SFMono-Regular, Menlo, monospace; + font-size: 11px; + color: #57606a; + cursor: pointer; +} + +.ma-ops pre { + font-size: 11px; + white-space: pre-wrap; + background: #f6f8fa; + padding: 6px; + border-radius: 6px; +} diff --git a/site/src/playground/new-theme-test/IssuesView.tsx b/site/src/playground/new-theme-test/IssuesView.tsx new file mode 100644 index 00000000..61531bfa --- /dev/null +++ b/site/src/playground/new-theme-test/IssuesView.tsx @@ -0,0 +1,109 @@ +/** + * The issues the style-guide gaps add up to, for the Theme improvement page: every in-scope gap grouped by the + * part of the system a principled fix would change, and what was found along the way. + */ +import ReactMarkdown from 'react-markdown'; +import { FINDINGS, FLINT_BUGS, ISSUE_STATUS, PROBES } from './findings'; +import { + BY_ISSUE, Badge, DEFERRED, FAMILIES, FAMILY_OF, GapRow, IN_SCOPE, IssueChip, KIND_LABELS, Md, houseCount, issueHref, progress, + representatives, stageHref, +} from './gaps'; +import type { GapKind } from './types'; + +function IssueDetail({ issue }: { issue: string }) { + const entries = BY_ISSUE.get(issue) ?? []; + const family = FAMILY_OF.get(issue); + const bugs = FLINT_BUGS.filter((bug) => bug.issue === issue); + const examples = representatives(issue); + const rest = entries.filter((entry) => !examples.includes(entry)); + const p = progress(issue); + const state = ISSUE_STATUS[issue]; + const kinds = (Object.keys(KIND_LABELS) as GapKind[]).filter((kind) => entries.some((entry) => entry.gap.kind === kind)); + return ( +
+

{family?.label}

+

{issue}

+

{PROBES[issue] ?? entries[0]?.gap.title}

+
+ {entries.length} gaps · {houseCount(entries)} houses + {kinds.map((kind) => {entries.filter((entry) => entry.gap.kind === kind).length} {KIND_LABELS[kind].toLowerCase()})} + {p.addressed > 0 && {p.addressed} addressed} + {state && {state.status === 'skip' ? 'skipped for now' : 'later'}: {state.note}} +
+ {bugs.length > 0 && ( + + )} +

Examples

+ {examples.map((entry, i) => )} + {rest.length > 0 && ( + <> +

Every other case ({rest.length})

+ {rest.map((entry) => )} + + )} +
+ ); +} + +export function IssuesView({ issue, onIssue }: { issue: string | null; onIssue: (issue: string) => void }) { + const addressed = IN_SCOPE.filter((entry) => entry.gap.addressed).length; + const fixed = FLINT_BUGS.filter((bug) => bug.fixed && !bug.fixed.partly).length; + return ( +
+

+ Every gap the {houseCount(IN_SCOPE)} style-guide houses left, grouped by the part of Flint a fix would change. The number on an issue is how + many houses hit it; a dot marks an open Flint bug. So far {addressed} of {IN_SCOPE.length} gaps are addressed and {fixed} of {FLINT_BUGS.length} bugs + fixed. {DEFERRED.length} gaps about chart annotations are left out. +

+
+ {FAMILIES.map((family) => ( +
+
{family.label}
+
{family.issues.map((id) => )}
+
+ ))} +
+ {issue && BY_ISSUE.has(issue) ? :

Pick an issue to see its cases.

} +
+ ); +} + +export function FindingsView() { + return ( +
+
+

Findings

+ {FINDINGS} +
+
+

Flint bugs found along the way

+ + + + {FLINT_BUGS.map((bug) => ( + + + + + + + ))} + +
BugHousesStatusIssue
{bug.summary}{bug.houses} + {bug.fixed + ? {bug.fixed.partly ? 'partly fixed' : 'fixed'} · {bug.fixed.stage} + : open} + {bug.issue}
+
+
+ ); +} diff --git a/site/src/playground/new-theme-test/NewThemeTest.tsx b/site/src/playground/new-theme-test/NewThemeTest.tsx index 18ef5a49..f0be7ea8 100644 --- a/site/src/playground/new-theme-test/NewThemeTest.tsx +++ b/site/src/playground/new-theme-test/NewThemeTest.tsx @@ -1,23 +1,17 @@ /** - * New theme test: published data-visualisation style guides, one tab per house. - * - * Each tab holds what the guide says (research/.json), the closest ThemeSpec the current schema - * can state, that theme over the standard preview charts, and the gaps: for every rule the theme - * could not state or Flint did not draw, Flint's chart beside a hand-crafted Vega-Lite chart of what - * the guide asks for, with notes on the difference. The overview tab collects the gaps across houses. + * Style guides: published data-visualisation style guides, each mapped onto a Flint ThemeSpec. A house page + * reads in three steps: what the guide is and where it comes from, what Flint draws with the theme today, + * and the gaps between the two. The issues those gaps add up to live on the Theme improvement page. */ -import { useHouseFonts } from '../house-fonts'; -import { useEffect, useMemo, useState, type CSSProperties, type ReactNode } from 'react'; -import { useSearchParams } from 'react-router-dom'; -import ReactMarkdown from 'react-markdown'; +import { useMemo, useState } from 'react'; +import { Navigate, useSearchParams } from 'react-router-dom'; import { FlintView } from '../../components/FlintView'; import { ScaleToFit } from '../../components/ScaleToFit'; -import { VegaLiteView } from '../../components/VegaLiteView'; -import { siteTheme } from '../../shared/theme'; import { PREVIEW_CASES } from '../../shared/preview-cases'; +import { useHouseFonts } from '../house-fonts'; import { STYLE_GUIDE_THEMES } from './themes'; -import { DEFERRED_PROBES, FINDINGS, FLINT_BUGS, ISSUE_FAMILIES, ISSUE_STATUS, PROBES, REPRESENTATIVES, canonicalProbe, type IssueFamily } from './findings'; -import type { GapKind, ResearchRecord, StyleGuideTheme, ThemeGap } from './types'; +import { Badge, GapRow, Md, isDeferred } from './gaps'; +import type { ResearchRecord, StyleGuideTheme } from './types'; const RESEARCH = Object.values( import.meta.glob('./research/*.json', { eager: true, import: 'default' }) as Record, @@ -25,113 +19,23 @@ const RESEARCH = Object.values( const THEME_BY_ID = new Map(STYLE_GUIDE_THEMES.map((theme) => [theme.id, theme])); -type Entry = { theme: StyleGuideTheme; gap: ThemeGap; issue: string }; -const ENTRIES: Entry[] = STYLE_GUIDE_THEMES.flatMap((theme) => theme.gaps.map((gap) => ({ theme, gap, issue: canonicalProbe(gap.probe) }))); -const isDeferred = (gap: ThemeGap) => DEFERRED_PROBES.has(canonicalProbe(gap.probe)); -const IN_SCOPE = ENTRIES.filter((entry) => !DEFERRED_PROBES.has(entry.issue)); -const DEFERRED = ENTRIES.filter((entry) => DEFERRED_PROBES.has(entry.issue)); -const BY_ISSUE = new Map(); -for (const entry of IN_SCOPE) BY_ISSUE.set(entry.issue, [...(BY_ISSUE.get(entry.issue) ?? []), entry]); - -/** The families, plus one holding any issue no family names, so nothing in scope goes unlisted. */ -const FAMILIES: IssueFamily[] = (() => { - const named = new Set(ISSUE_FAMILIES.flatMap((family) => family.issues)); - const rest = [...BY_ISSUE.keys()].filter((issue) => !named.has(issue)).sort(); - const families = ISSUE_FAMILIES.map((family) => ({ ...family, issues: family.issues.filter((issue) => BY_ISSUE.has(issue)) })); - return rest.length ? [...families, { id: 'other', label: 'Other', principle: 'Issues no family claims yet.', issues: rest }] : families; -})(); -const FAMILY_OF = new Map(FAMILIES.flatMap((family) => family.issues.map((issue) => [issue, family] as const))); -const houseCount = (entries: Entry[]) => new Set(entries.map((entry) => entry.theme.id)).size; - -const SEVERITY_SCORE = { high: 30, medium: 20, low: 10 } as const; - -/** Up to `limit` examples from different houses: hand-picked first, then the strongest evidence. */ -function representatives(issue: string, limit = 3): Entry[] { - const entries = BY_ISSUE.get(issue) ?? []; - const picked: Entry[] = []; - for (const ref of REPRESENTATIVES[issue] ?? []) { - const [house, gapId] = ref.split(':'); - const found = entries.find((entry) => entry.theme.id === house && entry.gap.id === gapId); - if (found) picked.push(found); - } - const hasBug = FLINT_BUGS.some((bug) => bug.issue === issue); - const score = ({ gap }: Entry) => (gap.flint && gap.expectedSpec ? 100 : 0) + SEVERITY_SCORE[gap.severity] - + (gap.observed ? 5 : 0) + (hasBug && gap.kind === 'realization' ? 15 : 0); - for (const entry of [...entries].sort((a, b) => score(b) - score(a))) { - if (picked.length >= limit) break; - if (picked.some((p) => p.theme.id === entry.theme.id)) continue; - picked.push(entry); - } - return picked.slice(0, limit); -} - const DEFAULT_GALLERY = [ 'population', 'temp-anomaly', 'medals-grouped', 'electricity-stacked', 'ev-share', 'us-unemployment', 'electricity-mix-area', 'browser-pie', 'gapminder-bubble', 'temp-heatmap', ]; -const KIND_COLORS: Record = { - expressiveness: '#b42318', - 'chart-spec': '#9a3412', - realization: '#6941c6', - 'visual-quality': '#0e7090', - 'product-ui': '#475467', -}; - -const KIND_LABELS: Record = { - expressiveness: 'ThemeSpec cannot state it', - 'chart-spec': 'Chart spec has no slot', - realization: 'Stated, not drawn', - 'visual-quality': 'Visual quality', - 'product-ui': 'Product UI', -}; - -const card: CSSProperties = { - background: siteTheme.surface, - border: `1px solid ${siteTheme.border}`, - borderRadius: siteTheme.radius, - padding: 16, -}; - -function Badge({ color, children }: { color: string; children: ReactNode }) { - return ( - {children} - ); -} - -function Section({ title, children, id }: { title: string; children: ReactNode; id?: string }) { - return ( -
-

{title}

- {children} -
- ); -} - +const RULES_SHOWN = 5; const HEX = /^#[0-9a-f]{3,8}$/i; +const hexes = (value: unknown): string[] => (Array.isArray(value) ? value : [value]).filter((c): c is string => typeof c === 'string' && HEX.test(c)); -function Swatches({ label, colors }: { label: string; colors: unknown }) { - const list = (Array.isArray(colors) ? colors : [colors]).filter((c): c is string => typeof c === 'string' && HEX.test(c)); - if (!list.length) return null; - return ( -
-
{label}
-
- {list.map((c, i) => ( -
-
- {c.replace('#', '')} -
- ))} -
-
- ); +function Swatches({ colors, size = 'md' }: { colors: string[]; size?: 'sm' | 'md' }) { + if (!colors.length) return null; + return {colors.map((c, i) => )}; } -/** A research block as a definition list, skipping empty values. */ +const shortUrl = (url: string) => url.replace(/^https?:\/\/(www\.)?/, '').replace(/\/$/, ''); + +/** A research block as label / value lines, for the full notes. */ function Facts({ title, value }: { title: string; value: unknown }) { if (value == null || value === '') return null; const entries: [string, unknown][] = typeof value === 'object' && !Array.isArray(value) @@ -144,478 +48,218 @@ function Facts({ title, value }: { title: string; value: unknown }) { : typeof v === 'object' ? Object.entries(v as Record).filter(([, x]) => x != null).map(([k, x]) => `${k}: ${text(x)}`).join('; ') : String(v); return ( -
-
{title}
- - - {shown.map(([k, v]) => ( - - {k && } - - - ))} - -
{k}{text(v)}
+
+

{title}

+
+ {shown.map(([k, v]) =>
{k &&
{k}
}
{text(v)}
)} +
); } -function ThemeDoc({ r }: { r: ResearchRecord }) { +/** 1. What the guide is: its summary, sources, palette, type and the rules that make it recognisable. */ +function About({ r }: { r: ResearchRecord }) { + const [allRules, setAllRules] = useState(false); const colors = (r.colors ?? {}) as Record; + const typography = (r.typography ?? {}) as Record; + const rules = r.distinctiveRules ?? []; + const palette: [string, string[]][] = ([ + ['Categorical', hexes(colors.categorical)], + ['Sequential', hexes(colors.sequential)], + ['Diverging', hexes(colors.diverging)], + ['Surface and text', hexes([colors.background, colors.text, colors.gridline])], + ] as [string, string[]][]).filter(([, list]) => list.length); return ( -
-
-
Colour
- - - - - - - - - {typeof colors.categoricalNotes === 'string' &&

{colors.categoricalNotes}

} - {typeof colors.notes === 'string' &&

{colors.notes}

} - -
-
- - - - - - - - - - -
-
- ); -} - -function Rules({ r }: { r: ResearchRecord }) { - if (!r.distinctiveRules?.length) return

No distinctive rules recorded.

; - return ( -
    - {r.distinctiveRules.map((rule, i) => ( -
  1. - {rule.rule} - {rule.quote && — “{rule.quote}”} - {rule.source && <> source} -
  2. - ))} -
- ); -} - -function Panel({ label, children }: { label: string; children: ReactNode }) { - return ( -
-
{label}
-
{children}
-
- ); -} - -function Expected({ gap }: { gap: ThemeGap }) { - if (!gap.expectedSpec) return
Described in the notes.
; - const frame = gap.expectedFrame; - return ( - -
- {frame?.headerHtml &&
} - - {frame?.footerHtml &&
} -
- - ); -} - -function GapCard({ gap, index, house, onOpenHouse }: { gap: ThemeGap; index: number; house?: StyleGuideTheme; onOpenHouse?: (id: string) => void }) { - const sev = { high: '#b42318', medium: '#b54708', low: '#667085' }[gap.severity]; - return ( -
-
- {house && ( - - )} - {index + 1}. {gap.title} - {KIND_LABELS[gap.kind]} - {gap.severity} - {gap.probe && {gap.probe}} - {gap.addressed && addressed · {gap.addressed.stage}} -
-
- Guide{gap.rule} - Current{gap.current} - Expected{gap.expected} - {gap.proposal && <>Proposal{gap.proposal}} - {gap.observed && <>Observed{gap.observed}} - {gap.addressed && <>Addressed{gap.addressed.stage} — {gap.addressed.note} The current panel draws the house as it now stands; “Current” and “Observed” describe it before.} -
- {(gap.flint || gap.expectedSpec) && ( -
- - {gap.flint - ? - :
Not drawable in Flint.
} -
- +
+

1 The guide

+
+
+

{r.summary}

+

+ Sources: {r.urls.map((url, i) => {i ? ' · ' : ''}{shortUrl(url)})} + {r.access !== 'full' && <> {r.access} access} +

+
+ {palette.map(([label, list]) =>
{label}
)} + {typeof typography.family === 'string' &&
Type
{typography.family}
} +
+
+ {rules.length > 0 && ( + <> +

What makes it recognisable

+
    + {(allRules ? rules : rules.slice(0, RULES_SHOWN)).map((rule, i) => ( +
  1. {rule.rule}{rule.source && <> source}
  2. + ))} +
+ {rules.length > RULES_SHOWN && ( + + )} + )} -
- ); -} - -function Gallery({ theme }: { theme: StyleGuideTheme }) { - const ids = theme.gallery ?? DEFAULT_GALLERY; - const cases = ids.map((id) => PREVIEW_CASES.find((c) => c.id === id)).filter((c): c is NonNullable => Boolean(c)); - return ( -
- {cases.map((c) => ( -
- - - +
+ Full research notes + {r.accessNotes &&

{r.accessNotes}

} +
+ + + + + + + + + + + +
- ))} -
- ); -} - -const md = (source: string) => ( -
- {source} -
-); - -function ThemeTab({ r }: { r: ResearchRecord }) { - const theme = THEME_BY_ID.get(r.id); - const [showSpec, setShowSpec] = useState(false); - return ( -
-
-
-

{r.org}

- access: {r.access} - {r.context && {r.context}} - {theme && {theme.gaps.length} gaps} -
-

{r.summary}

- - {r.accessNotes &&

{r.accessNotes}

} -
- -
-
- {r.referenceImages?.some((image) => image.describes) && ( -
-
-
    + {r.referenceImages?.some((image) => image.describes) && ( +
    +

    Reference charts in the guide

    +
      {r.referenceImages.filter((image) => image.describes).map((image, i) => ( -
    • {image.describes} {image.url && image}
    • +
    • {image.describes} {image.url && image}
    • ))}
    -
- )} - - {theme ? ( - <> -
-
- {md(theme.notes)} - - {showSpec &&
{JSON.stringify(theme.theme, null, 2)}
} -
-
-
-
!isDeferred(gap)).length})`} id="gaps"> - {theme.gaps.filter((gap) => !isDeferred(gap)).map((gap, i) => )} -
- {theme.gaps.some(isDeferred) && ( -
- - Deferred to the annotation layer ({theme.gaps.filter(isDeferred).length}) — emphasis, callouts and in-text keys - -
- {theme.gaps.filter(isDeferred).map((gap, i) => )} -
-
- )} - - ) : ( -
Not yet mapped onto a ThemeSpec.
- )} -
- ); -} - -/** The theme-improvement stage a link opens; the page finds the area from the stage. */ -const stageHref = (stage: string) => `#/playground/theme-improvement?stage=${stage.toLowerCase()}`; -const DONE = '#067647'; - -/** How far an issue has come: its gaps addressed, its bugs fixed and still open. */ -function progress(issue: string) { - const entries = BY_ISSUE.get(issue) ?? []; - const addressed = entries.filter((entry) => entry.gap.addressed); - const bugs = FLINT_BUGS.filter((bug) => bug.issue === issue); - const fixed = bugs.filter((bug) => bug.fixed && !bug.fixed.partly).length; - const stages = [...new Set([...addressed.map((entry) => entry.gap.addressed!.stage), ...bugs.flatMap((bug) => (bug.fixed ? [bug.fixed.stage] : []))])].sort(); - return { entries, addressed: addressed.length, bugs: bugs.length, fixed, open: bugs.length - fixed, stages }; -} - -function IssueChip({ issue, onIssue }: { issue: string; onIssue: (issue: string) => void }) { - const p = progress(issue); - const done = p.entries.length > 0 && p.addressed === p.entries.length && p.open === 0; - const state = ISSUE_STATUS[issue]; - return ( - - ); -} - -/** Where the theme-improvement work stands against the issues. */ -function IssueProgress() { - const addressed = IN_SCOPE.filter((entry) => entry.gap.addressed); - const byStage = new Map(); - for (const entry of addressed) byStage.set(entry.gap.addressed!.stage, (byStage.get(entry.gap.addressed!.stage) ?? 0) + 1); - const fixed = FLINT_BUGS.filter((bug) => bug.fixed && !bug.fixed.partly).length; - const partly = FLINT_BUGS.filter((bug) => bug.fixed?.partly).length; - const stages = [...byStage.entries()].sort(([a], [b]) => a.localeCompare(b, undefined, { numeric: true })); - return ( -
- Progress.{' '} - {addressed.length} of {IN_SCOPE.length} gaps addressed across {houseCount(addressed)} houses; {fixed} of {FLINT_BUGS.length} Flint bugs fixed{partly ? `, ${partly} partly` : ''}. - {' '}By stage:{' '} - {stages.map(([stage, n], i) => ( - {i ? ' · ' : ''}{stage} {n} - ))} - . Each addressed case card links to its stage on the Theme improvement page, where it is shown before and after. -
+ )} + + ); } -function Overview({ onIssue }: { onIssue: (issue: string) => void }) { - const kinds = Object.keys(KIND_LABELS) as GapKind[]; +/** 2. What Flint draws with the house theme over the standard charts, and how the guide was mapped. */ +function FlintToday({ theme }: { theme: StyleGuideTheme }) { + const [showSpec, setShowSpec] = useState(false); + const cases = (theme.gallery ?? DEFAULT_GALLERY) + .map((id) => PREVIEW_CASES.find((c) => c.id === id)) + .filter((c): c is NonNullable => Boolean(c)); return ( -
-

New theme test — overview

-

- {RESEARCH.length} style guides researched from datavizstyleguide.com/examples, {STYLE_GUIDE_THEMES.length} mapped onto a ThemeSpec. - {' '}{IN_SCOPE.length} gaps in scope; {DEFERRED.length} more about chart annotations are deferred. -

-
- {kinds.map((kind) => ( -
-
{IN_SCOPE.filter((entry) => entry.gap.kind === kind).length}
-
{KIND_LABELS[kind]}
+
+

2 In Flint today

+
+ {cases.map((c) => ( +
+ + +
))} -
-
{DEFERRED.length}
-
Deferred: chart annotations ({houseCount(DEFERRED)} houses)
-
-
-
- {FAMILIES.map((family) => ( -
-
{family.label}
-
{family.principle}
-
{family.issues.map((issue) => )}
-
- ))} -
-
-
{md(FINDINGS)}
-
- - - {FLINT_BUGS.map((bug) => ( - - - - - - - - ))} - -
{bug.id}{bug.summary}{bug.houses} house{bug.houses === 1 ? '' : 's'}{bug.fixed ? {bug.fixed.partly ? 'partly fixed' : 'fixed'} · {bug.fixed.stage} : open}
-
-
+
+ How the guide maps onto the ThemeSpec + {theme.notes} + + {showSpec &&
{JSON.stringify(theme.theme, null, 2)}
} +
+ ); } -/** One issue: what it is, the family principle, the Flint bugs behind it, and representative cases. */ -function IssueDetail({ issue, onOpen }: { issue: string; onOpen: (id: string) => void }) { - const entries = BY_ISSUE.get(issue) ?? []; - const family = FAMILY_OF.get(issue); - const bugs = FLINT_BUGS.filter((bug) => bug.issue === issue); - const examples = representatives(issue); - const kinds = Object.keys(KIND_LABELS) as GapKind[]; - const rest = entries.filter((entry) => !examples.includes(entry)); +/** 3. Where the theme falls short of the guide, most severe first. */ +function Gaps({ theme }: { theme: StyleGuideTheme }) { + const rank = { high: 0, medium: 1, low: 2 } as const; + const gaps = theme.gaps.filter((gap) => !isDeferred(gap)).sort((a, b) => rank[a.severity] - rank[b.severity]); + const deferred = theme.gaps.filter(isDeferred); return ( -
-
{family?.label}
-

{issue}

-

{PROBES[issue] ?? entries[0]?.gap.title}

- {family &&

Principle for the family: {family.principle}

} -
- {entries.length} gaps · {houseCount(entries)} houses - {ISSUE_STATUS[issue] && {ISSUE_STATUS[issue].status === 'skip' ? 'Skipped for now' : 'Later'} — {ISSUE_STATUS[issue].note}} - {entries.some((entry) => entry.gap.addressed) && {entries.filter((entry) => entry.gap.addressed).length} addressed} - {kinds.map((kind) => { - const n = entries.filter((entry) => entry.gap.kind === kind).length; - return n ? {n} {KIND_LABELS[kind].toLowerCase()} : null; - })} -
- {bugs.length > 0 && ( -
-
Flint bugs behind this issue
- -
+
+

3 Gaps {gaps.length}

+ {gaps.length ? gaps.map((gap) => ) :

None found.

} + {deferred.length > 0 && ( +
+ {deferred.length} more about chart annotations (emphasis, callouts, in-text keys), left for the annotation layer + {deferred.map((gap) => )} +
)} -

Representative examples

- {examples.map((entry, i) => )} - {rest.length > 0 && ( - <> -

Every other case ({rest.length})

- - - {rest.map(({ theme, gap }) => ( - - - - - - - - ))} - -
- - {gap.title}{gap.addressed && addressed · {gap.addressed.stage}}{KIND_LABELS[gap.kind]}{gap.severity}{gap.flint && gap.expectedSpec ? ' · panels' : ''}
- - )} -
+ ); } -function Issues({ issue, onIssue, onOpen }: { issue: string | null; onIssue: (issue: string) => void; onOpen: (id: string) => void }) { +function HousePage({ r }: { r: ResearchRecord }) { + const theme = THEME_BY_ID.get(r.id); + return ( +
+
+

{r.org}

+ {r.context && {r.context}} +
+ + {theme ? <> :

Not yet mapped onto a ThemeSpec.

} +
+ ); +} + +function Index({ onOpen }: { onOpen: (id: string) => void }) { return (
-

Issues

-

- Every in-scope gap, grouped by the part of the system a principled fix would change. Pick an issue to see its family principle, - the Flint bugs behind it, and up to three representative cases from different houses (both panels, highest severity first). - Chart annotations are deferred and not listed. Green marks what the theme-improvement stages have addressed. +

Style guides

+

+ {RESEARCH.length} published data-visualisation style guides (from datavizstyleguide.com), {STYLE_GUIDE_THEMES.length} of them mapped onto a + Flint ThemeSpec. Each page shows the guide, what Flint draws with it, and the gaps. The issues across houses, and the fixes + made for them, are on Theme improvement.

- -
- {FAMILIES.map((family) => ( -
-
{family.label}
-
{family.issues.map((id) => ( - - - - ))}
-
- ))} +
+ {RESEARCH.map((r) => { + const theme = THEME_BY_ID.get(r.id); + const gaps = theme?.gaps.filter((gap) => !isDeferred(gap)).length; + return ( + + ); + })}
- {issue && BY_ISSUE.has(issue) ? - :
Pick an issue above.
}
); } - export function NewThemeTest() { const fontsReady = useHouseFonts(); const [params, setParams] = useSearchParams(); - const active = params.get('theme') ?? 'overview'; + const active = params.get('theme'); const [filter, setFilter] = useState(''); - const open = (id: string) => { - setParams({ theme: id }); + const open = (id: string | null) => { + setParams(id ? { theme: id } : {}); window.scrollTo({ top: 0 }); }; - const openIssue = (issue: string) => { - setParams({ theme: 'issues', issue }); - window.setTimeout(() => document.getElementById('issue-detail')?.scrollIntoView({ block: 'start' }), 50); - }; const record = RESEARCH.find((r) => r.id === active); const list = useMemo( () => RESEARCH.filter((r) => r.org.toLowerCase().includes(filter.toLowerCase()) || r.id.includes(filter.toLowerCase())), [filter], ); + // The issues once lived here; old links to them open them on Theme improvement. + if (active === 'issues') { + const issue = params.get('issue'); + return ; + } return ( -
- -