@graphysdk/theme-gamma 0.0.0-stage → 0.1.1-beta.1791459323341
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +17 -0
- package/README.md +64 -2
- package/dist/fonts.d.ts +2 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1872 -0
- package/dist/mushroom/mushroom.d.ts +15 -0
- package/dist/mushroom/renderer/area.d.ts +5 -0
- package/dist/mushroom/renderer/bar.d.ts +7 -0
- package/dist/mushroom/renderer/cap.d.ts +19 -0
- package/dist/mushroom/renderer/line.d.ts +5 -0
- package/dist/mushroom/renderer/plugins.d.ts +8 -0
- package/dist/mushroom/renderer/point.d.ts +5 -0
- package/dist/mushroom/renderer/slice.d.ts +6 -0
- package/dist/mushroom/renderer/texture.d.ts +39 -0
- package/dist/mushroom/styles.d.ts +31 -0
- package/dist/night/night.d.ts +14 -0
- package/dist/night/renderer/area.d.ts +5 -0
- package/dist/night/renderer/bar.d.ts +3 -0
- package/dist/night/renderer/corner.d.ts +2 -0
- package/dist/night/renderer/glass.d.ts +18 -0
- package/dist/night/renderer/line.d.ts +5 -0
- package/dist/night/renderer/plugins.d.ts +8 -0
- package/dist/night/renderer/point.d.ts +5 -0
- package/dist/night/renderer/slice.d.ts +3 -0
- package/dist/night/renderer/star.d.ts +12 -0
- package/dist/night/sky.d.ts +5 -0
- package/dist/night/styles.d.ts +30 -0
- package/dist/shared/bar-frame.d.ts +22 -0
- package/dist/shared/ink.d.ts +10 -0
- package/dist/shared/intro.d.ts +20 -0
- package/dist/shared/paint.d.ts +21 -0
- package/dist/shared/slice-extent.d.ts +12 -0
- package/dist/shared/trace.d.ts +19 -0
- package/dist/shared/utils/paths.d.ts +7 -0
- package/dist/shared/utils/projections.d.ts +16 -0
- package/fonts.css +2 -0
- package/licenses/PolyForm-Free-Trial-1.0.0.md +93 -0
- package/licenses/PolyForm-NonCommercial-1.0.0.md +131 -0
- package/licenses/PolyForm-Small-Business-1.0.0.md +121 -0
- package/package.json +79 -3
- package/src/fonts.css.d.ts +2 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
This software is available under any of the following licenses, at your option,
|
|
4
|
+
depending on which one's conditions you meet:
|
|
5
|
+
|
|
6
|
+
- **PolyForm Noncommercial 1.0.0** — for noncommercial use (personal,
|
|
7
|
+
charitable, educational, research, government).
|
|
8
|
+
See [licenses/PolyForm-NonCommercial-1.0.0.md](licenses/PolyForm-NonCommercial-1.0.0.md)
|
|
9
|
+
|
|
10
|
+
- **PolyForm Small Business 1.0.0** — free commercial use for organizations
|
|
11
|
+
under the size thresholds defined in the license.
|
|
12
|
+
See [licenses/PolyForm-Small-Business-1.0.0.md](licenses/PolyForm-Small-Business-1.0.0.md)
|
|
13
|
+
|
|
14
|
+
- **PolyForm Free Trial 1.0.0** — a 32-day evaluation for anyone else.
|
|
15
|
+
See [licenses/PolyForm-Free-Trial-1.0.0.md](licenses/PolyForm-Free-Trial-1.0.0.md)
|
|
16
|
+
|
|
17
|
+
For commercial use beyond these terms, contact [hello@graphy.dev](mailto:hello@graphy.dev) or visit [https://graphy.dev](https://graphy.dev).
|
package/README.md
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @graphysdk/theme-gamma
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
> **Beta.** This package is on a `0.x` version line: a minor release may change its look. Use a caret range (`^0.1.0`) to take only patches.
|
|
4
|
+
|
|
5
|
+
Two themes for the Graphy charting SDK in Gamma's look:
|
|
6
|
+
|
|
7
|
+
- `gammaNight`: the starred night sky behind Gamma's wordmark. Shapes are a pale glass that fades as it falls, with the stars showing through, and every reading is a star.
|
|
8
|
+
- `gammaMushroom`: Gamma's mushroom forest under a summer sky. Bars grow as mushrooms whose caps end at their values, and a pie is the underside of a cap.
|
|
9
|
+
|
|
10
|
+
Learn more at [graphy.dev](https://graphy.dev).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @graphysdk/theme-gamma @graphysdk/react
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Requires React 19. Its only peer is `@graphysdk/react`.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Pass one of the themes to `createGraphyKit` and import its fonts once. Every graph drawn through the kit's `GraphProvider` takes the theme; specs are written as usual.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { createGraphyKit, GraphRenderer } from '@graphysdk/react';
|
|
26
|
+
import { gammaNight } from '@graphysdk/theme-gamma';
|
|
27
|
+
import '@graphysdk/theme-gamma/fonts.css';
|
|
28
|
+
|
|
29
|
+
const kit = createGraphyKit({ theme: gammaNight });
|
|
30
|
+
|
|
31
|
+
const spec = kit.pipe(
|
|
32
|
+
kit.createSpec({ x: 'quarter', y: 'revenue', color: 'region' }),
|
|
33
|
+
kit.geom.bar({ position: 'dodge' }),
|
|
34
|
+
kit.scale.x(),
|
|
35
|
+
kit.scale.y()
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export function Revenue({ data }) {
|
|
39
|
+
return (
|
|
40
|
+
<kit.GraphProvider spec={spec} data={data}>
|
|
41
|
+
<GraphRenderer />
|
|
42
|
+
</kit.GraphProvider>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
A spec's own `styles()`, scales and `config()` sit above the theme, so a graph can still change anything. The themes are drawn for a graph about 600 pixels wide; `style.graph({ textScale: 1.5 })` scales their type for a larger one.
|
|
48
|
+
|
|
49
|
+
`gammaNight` is drawn for the dark scheme and `gammaMushroom` for the light one, whatever `colorScheme` the provider is given.
|
|
50
|
+
|
|
51
|
+
`fonts.css` loads Plus Jakarta Sans and Inter from Google Fonts, standing in for Gamma's own ES Build and PP Mori. To host the fonts yourself, leave the import out and load families named `Plus Jakarta Sans` and `Inter` before the first graph is drawn.
|
|
52
|
+
|
|
53
|
+
## Docs
|
|
54
|
+
|
|
55
|
+
- [Gamma](https://docs.graphy.dev/sdk-next/themes/gamma)
|
|
56
|
+
|
|
57
|
+
## Feedback
|
|
58
|
+
|
|
59
|
+
This package is released early to hear what works. Tell us on [Discord](https://discord.gg/yGmYCjkSr).
|
|
60
|
+
|
|
61
|
+
## Licence
|
|
62
|
+
|
|
63
|
+
This package is available under PolyForm Noncommercial, Small Business, or a 32-day Free Trial. Free Trial is local or internal evaluation only — it does not cover a public page. See [what you can do under the trial](https://docs.graphy.dev/licence/evaluation).
|
|
64
|
+
|
|
65
|
+
For a commercial licence, [talk to us](https://graphy.dev/license).
|
package/dist/fonts.d.ts
ADDED
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let S=require("react"),o=require("@graphysdk/react"),i=require("react/jsx-runtime");var Te=/^#([0-9a-f]{6})$/iu,Ie=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/iu,he=e=>{const r=Te.exec(e);if(r?.[1]!==void 0){const n=Number.parseInt(r[1],16);return[n>>16&255,n>>8&255,n&255]}const t=Ie.exec(e);return t?.[1]!==void 0&&t[2]!==void 0&&t[3]!==void 0?[Number(t[1]),Number(t[2]),Number(t[3])]:null},M=(e,r,t)=>{const n=he(e),a=he(r);if(n===null||a===null)return e;const[s,l,h]=n.map((c,d)=>Math.round(c+((a[d]??0)-c)*t));return`rgb(${s}, ${l}, ${h})`},C=e=>`${e}-${(0,S.useId)().replace(/[^a-zA-Z0-9]/gu,"")}`,N=e=>{const r=C(e);return t=>`${r}-${t.replace(/[^a-zA-Z0-9]/gu,"")}`},ke=e=>{let r=e||1;return()=>{r=r+1831565813|0;let t=Math.imul(r^r>>>15,1|r);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}},Be=1.70158,ze=e=>1+2.70158*(e-1)**3+Be*(e-1)**2,De=e=>Math.sqrt(1-(e-1)**2),Ne=e=>e.type==="grow"?Math.max(0,...Object.values(e.delayByKey)):0,Ke=e=>{const[r,t]=(0,S.useState)({intro:e,seconds:0});return(0,S.useEffect)(()=>{if(!e)return;const n=Ne(e)+e.durationSeconds;let a=null,s=0;const l=h=>{a??=h;const c=Math.max(0,(h-a)/1e3),d=c>=n;t({intro:e,seconds:d?1/0:c}),d||(s=requestAnimationFrame(l))};return s=requestAnimationFrame(l),()=>cancelAnimationFrame(s)},[e]),e?r.intro===e?r.seconds:0:1/0},B=e=>{const r=e?.type==="grow"?e:null,t=Ke(r),n=(0,S.useCallback)(a=>{if(r===null||t===1/0)return 1;const s=r.delayByKey[a]??0,l=Math.min(1,Math.max(0,(t-s)/r.durationSeconds));return r.growAxis==="angle"?De(l):ze(l)},[r,t]);return{plan:t===1/0?null:r,readGrowth:n}},_=(e,r,t)=>e+(r-e)*t,z=({intro:e,children:r})=>e?.type==="wipe"?(0,i.jsx)(o.IntroWipeClip,{intro:e,children:r}):e?.type==="fade"?(0,i.jsx)(o.IntroFade,{intro:e,children:r}):r,W=e=>{const r=(0,o.useGeomStyleReader)(e);return(t,n)=>({color:(0,o.toPaintColor)(r.get("fill",t,n)),opacity:r.get("alpha",t,n),fillOpacity:r.get("fillAlpha",t,n),edge:r.get("stroke",t,n),edgeWidth:r.get("strokeWidth",t,n)})},Q=e=>{const r=(0,o.useGeomStyleReader)(e);return(t,n)=>{const a=r.get("strokeWidth",t,n);return{color:r.get("stroke",t,n),opacity:r.get("alpha",t,n)*r.get("strokeAlpha",t,n),width:a,dashArray:(0,o.toStrokeDasharray)(r.get("dashArray",t,n),a)}}},D=(e,r)=>{const t=(0,o.getX)(e),n=(0,o.getY)(e)??(0,o.getYMax)(e);return t===null||n===null?null:{x:(0,o.toViewBoxX)(t)*r.width,y:(0,o.toViewBoxY)(n)*r.height}},O=(e,r)=>{const t=(0,o.getX)(e),n=(0,o.getY)(e)??(0,o.getRadiusExtent)(e).outerRadius;if(t===null||n===null)return null;const a=(0,o.polarToUnit)(t,n),s=Math.min(r.width,r.height)/2;return{x:r.width/2+a.x*s,y:r.height/2-a.y*s}},Ue=e=>`${e.map((r,t)=>`${t===0?"M":"L"}${r.x},${r.y}`).join(" ")} Z`,H=(e,r)=>{const t=(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),n=[];return e.data.groupBy(o.GROUP_VARIABLES.group).forEach(a=>{const s=[...a],[l]=s,h=r(s);l===void 0||h===null||n.push({key:t(l),observation:l,path:h})}),n},Xe=(e,r)=>e.flatMap(t=>{const n=(0,o.getX)(t),a=O(t,r);return n===null||a===null?[]:[{angle:n,point:a}]}).sort((t,n)=>t.angle-n.angle).map(({point:t})=>t),J=(e,r)=>{const t=Xe(e,r);return t.length===0?null:Ue(t)},je=(e,r,t)=>{const n=(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id);return Array.from(e.data,a=>({observation:a,point:t(a,r)})).flatMap(({observation:a,point:s})=>s===null?[]:[{key:n(a),observation:a,point:s}])},Ve=/[a-df-zA-DF-Z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/gu,Ye=/^[a-zA-Z]$/u,Ze=(e,r)=>e==="H"?"x":e==="V"?"y":r%2===0?"x":"y",I=(e,r)=>{let t="",n=0;return(e.match(Ve)??[]).map(a=>{if(Ye.test(a))return t=a.toUpperCase(),n=0,a;const s=Ze(t,n);return n+=1,String(Number(a)*(s==="x"?r.width:r.height))}).join(" ")},K=26,Y={shade:"#138F6E",body:"#2FB27A",sunlit:"#C2DC5E",stipple:"#0B6B50"},Z={underside:"#F8CCD8",gill:"#DE8FAA"},qe="#6A4BD8",Se="#FFFFFF",Re=({id:e,color:r,opacity:t,count:n,seed:a,largest:s})=>{const l=ke(a);return(0,i.jsx)("pattern",{id:e,patternUnits:"userSpaceOnUse",width:K,height:K,children:Array.from({length:n},(h,c)=>(0,i.jsx)("circle",{cx:l()*K,cy:l()*K,r:.35+l()**2*(s-.35),fill:r,fillOpacity:t*(.5+l()*.5)},c))})},$e=({id:e})=>(0,i.jsx)(Re,{id:e,color:Se,opacity:.75,count:16,seed:5,largest:1.1}),we=({id:e})=>(0,i.jsx)(Re,{id:e,color:Y.stipple,opacity:.55,count:34,seed:9,largest:1.4}),Qe=({id:e,color:r})=>(0,i.jsxs)("linearGradient",{id:e,x1:0,y1:0,x2:.35,y2:1,children:[(0,i.jsx)("stop",{offset:0,stopColor:M(r,Se,.18)}),(0,i.jsx)("stop",{offset:.55,stopColor:r}),(0,i.jsx)("stop",{offset:1,stopColor:M(r,qe,.4)})]}),Ce=({id:e})=>(0,i.jsxs)("linearGradient",{id:e,x1:0,y1:0,x2:1,y2:.2,children:[(0,i.jsx)("stop",{offset:0,stopColor:Y.shade}),(0,i.jsx)("stop",{offset:.55,stopColor:Y.body}),(0,i.jsx)("stop",{offset:1,stopColor:Y.sunlit})]}),Je="#6A4BD8",et="#FFFFFF",ee=({cx:e,cy:r,width:t,color:n,opacity:a=1,edge:s})=>{const l=t/2,h=t*.55,c=r+h/2,d=r-h/2,u=`M${e-l},${c} C${e-l},${d+h*.4} ${e-l*.56},${d} ${e},${d} C${e+l*.56},${d} ${e+l},${d+h*.4} ${e+l},${c} Q${e},${c+h*.22} ${e-l},${c} Z`;return(0,i.jsxs)("g",{opacity:a,children:[(0,i.jsx)("path",{d:`M${e-l*.92},${c+h*.04} Q${e},${c+h*.22} ${e+l*.92},${c+h*.04} Q${e},${c+h*.55} ${e-l*.92},${c+h*.04} Z`,fill:Z.underside,stroke:Z.gill,strokeWidth:.5}),(0,i.jsx)("path",{d:u,fill:n,...s}),(0,i.jsx)("path",{d:`M${e-l*.55},${d+h*.3} Q${e-l*.2},${d+h*.08} ${e+l*.1},${d+h*.12}`,fill:"none",stroke:M(n,et,.55),strokeWidth:Math.max(.8,t*.07),strokeLinecap:"round"}),(0,i.jsx)("path",{d:u,fill:"none",stroke:M(n,Je,.35),strokeWidth:.6})]})},tt=2,rt=24,nt="#6A4BD8",We=({layer:e,coordSystem:r,panel:t})=>{const n=W(e),a=C("speckle"),s=(0,S.useMemo)(()=>{if(r===void 0)return H(e,d=>J(d,t)).map(d=>({...d,fill:d.path,edge:d.path}));const{areaGenerator:l,lineGenerator:h}=(0,o.createAreaPathGenerators)(r,e.params),c=new Map;return H(e,d=>{const u=(0,o.prepareAreaObservations)(d,e.params.missingValues),g=l(u),p=h(u);if(!g)return null;const f=I(g,t);return p&&c.set(f,I(p,t)),f}).map(d=>({...d,fill:d.path,edge:c.get(d.path)??""}))},[e,r,t]);return t.width<=0||t.height<=0?null:(0,i.jsxs)("g",{"data-geom":"area",children:[(0,i.jsx)("defs",{children:(0,i.jsx)($e,{id:a})}),s.map(({key:l,observation:h,fill:c,edge:d})=>{const u=n(h);return(0,i.jsxs)("g",{opacity:u.opacity,children:[(0,i.jsx)("path",{d:c,fill:u.color,fillOpacity:u.fillOpacity}),(0,i.jsx)("path",{d:c,fill:`url(#${a})`}),(0,i.jsx)("path",{d,fill:"none",stroke:M(u.color,nt,.3),strokeWidth:tt,strokeLinejoin:"round"})]},l)})]})},be=({layer:e,observation:r,panel:t,project:n})=>{const a=W(e)(r,"hovered"),s=n(r,t);return s===null?null:(0,i.jsx)("g",{"data-geom":"area",children:(0,i.jsx)(ee,{cx:s.x,cy:s.y,width:rt,color:a.color,opacity:a.opacity})})},ot=(0,o.defineGeomRenderer)("area",{coord:"cartesian",guideMode:"crosshair",swatchShape:"area",render:({layer:e,coordSystem:r,panelRect:t,intro:n})=>r.type!=="cartesian"?null:(0,i.jsx)(z,{intro:n,children:(0,i.jsx)(We,{layer:e,coordSystem:r,panel:t})}),renderHover:({layer:e,primary:r,panelRect:t})=>(0,i.jsx)(be,{layer:e,observation:r.observation,panel:t,project:D}),renderHoverCompanions:()=>null}),at=(0,o.defineGeomRenderer)("area",{coord:"polar",guideMode:"crosshair",swatchShape:"area",render:({layer:e,panelRect:r,intro:t})=>(0,i.jsx)(z,{intro:t,children:(0,i.jsx)(We,{layer:e,panel:r})}),renderHover:({layer:e,primary:r,panelRect:t})=>(0,i.jsx)(be,{layer:e,observation:r.observation,panel:t,project:O}),renderHoverCompanions:()=>null}),it={solo:{base:!0,value:!0},floor:{base:!0,value:!1},ceiling:{base:!1,value:!0},middle:{base:!1,value:!1}},st={top:"bottom",bottom:"top",left:"right",right:"left"},lt=(e,r)=>r==="x"?((0,o.getYMax)(e)??(0,o.getY)(e)??0)>=((0,o.getYMin)(e)??0)?"top":"bottom":((0,o.getXMax)(e)??0)>=((0,o.getXMin)(e)??0)?"right":"left",dt=(e,r,t)=>{const n=Math.max(0,e.width-t),a=Math.max(0,e.height-t);return r==="top"?{...e,y:e.y+e.height-a,height:a}:r==="bottom"?{...e,height:a}:r==="left"?{...e,x:e.x+e.width-n,width:n}:{...e,width:n}},ht=(e,r,{baseline:t,growth:n})=>{const a=r==="x",s=a?e.y:e.x,l=a?e.height:e.width,h=_(t,s,n),c=_(t,s+l,n),d={start:Math.min(h,c),span:Math.abs(c-h)};return a?{...e,y:d.start,height:d.span}:{...e,x:d.start,width:d.span}},Fe=(e,r,t,n,a)=>{const s=(0,o.getBarRectBounds)(r,e);if(!s)return null;const l=a===void 0?s:ht(s,r,a);if(l.width<=0||l.height<=0)return null;const h=it[(0,o.getStackRole)(e)],c=lt(e,r),d={x:l.x*t.width,y:l.y*t.height,width:l.width*t.width,height:l.height*t.height},u=[h.value?[]:[c],h.base?[]:[st[c]]].flat().reduce((j,b)=>dt(j,b,n/2),d),g=c==="top"||c==="bottom",p=g?u.width:u.height,f=g?u.height:u.width;if(p<=0||f<=0)return null;const{x:y,y:R,width:x,height:k}=u,A=(j,b)=>c==="top"?{x:y+j,y:R+k-b}:c==="bottom"?{x:y+j,y:R+b}:c==="right"?{x:y+b,y:R+j}:{x:y+x-b,y:R+j};return{breadth:p,length:f,endsStack:h.value,at:A}},ct=({x:e,y:r})=>`${Math.round(e*100)/100},${Math.round(r*100)/100}`,T=(e,r)=>`${r.map((t,n)=>{const a=t.map(([s,l])=>ct(e.at(s,l)));return n===0?`M${a.join(" ")}`:t.length===3?`C${a.join(" ")}`:`L${a.join(" ")}`}).join(" ")} Z`,ut=3,gt=.62,pt=.6,ft=.22,U=.48,X=.34,mt=3.2,xt=4,vt=(e,r)=>{const{breadth:t,length:n}=e,a=Math.min(t*gt,n*pt),s=n-a,l=a*ft,h=t/2,c=T(e,[[[0,s]],[[0,s+a*.62],[t*.2,n],[h,n]],[[t*.8,n],[t,s+a*.62],[t,s]],[[t*.75,s-l*.5],[t*.25,s-l*.5],[0,s]]]),d=T(e,[[[0,s]],[[t*.25,s-l*.5],[t*.75,s-l*.5],[t,s]],[[t*.85,s-l*1.9],[t*.15,s-l*1.9],[0,s]]]),u=e.at(h,s-l*1.3),g=Math.max(6,Math.floor(t/mt)),p=Array.from({length:g+1},(y,R)=>{const x=e.at(t*R/g,s);return`M${u.x},${u.y} L${x.x},${x.y}`}).join(" "),f=s-l*1.1;return{rim:s,cap:c,underside:d,gills:p,stalk:r&&f>0?T(e,[[[h-t*U/2,0]],[[h-t*U/2,f*.4],[h-t*X/2,f*.7],[h-t*X/2,f]],[[h+t*X/2,f]],[[h+t*X/2,f*.7],[h+t*U/2,f*.4],[h+t*U/2,0]]]):null}},yt=(e,r)=>{const{breadth:t}=e,n=Math.min(xt,t/2,r/2);return T(e,[[[0,n]],[[0,r-n]],[[0,r],[0,r],[n,r]],[[t-n,r]],[[t,r],[t,r],[t,r-n]],[[t,n]],[[t,0],[t,0],[t-n,0]],[[n,0]],[[0,0],[0,0],[0,n]]])},ce=({layer:e,observations:r,mainAxis:t,panel:n,state:a,intro:s})=>{const l=W(e),h=N("cap"),c=C("speckle"),d=C("stipple"),u=C("stalk"),g=C("gills"),p=(0,S.useMemo)(()=>(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),{plan:f,readGrowth:y}=B(s);if(n.width<=0||n.height<=0)return null;const R=[...r].map((x,k)=>({key:p(x),index:k,paint:l(x,a),frame:Fe(x,t,n,ut,f===null?void 0:{baseline:f.baseline,growth:y(p(x))}),isSolo:(0,o.getStackRole)(x)==="solo"}));return(0,i.jsxs)("g",{"data-geom":"bar",children:[(0,i.jsxs)("defs",{children:[(0,i.jsx)($e,{id:c}),(0,i.jsx)(we,{id:d}),(0,i.jsx)(Ce,{id:u}),[...new Set(R.map(({paint:x})=>x.color))].map(x=>(0,i.jsx)(Qe,{id:h(x),color:x},x))]}),R.map(({key:x,index:k,paint:A,frame:j,isSolo:b})=>{if(j===null)return null;const se=`url(#${h(A.color)})`,le=a==="hovered"?{stroke:A.edge,strokeWidth:A.edgeWidth}:{},$=j.endsStack?vt(j,b):null,ne=b?null:yt(j,$===null?j.length:$.rim),de=`${g}-${k}`;return(0,i.jsxs)("g",{opacity:A.opacity,children:[ne!==null&&(0,i.jsxs)("g",{children:[(0,i.jsx)("path",{d:ne,fill:se,fillOpacity:A.fillOpacity,...le}),(0,i.jsx)("path",{d:ne,fill:`url(#${c})`})]}),$!==null&&$.stalk!==null&&(0,i.jsxs)("g",{children:[(0,i.jsx)("path",{d:$.stalk,fill:`url(#${u})`}),(0,i.jsx)("path",{d:$.stalk,fill:`url(#${d})`})]}),$!==null&&(0,i.jsxs)("g",{children:[(0,i.jsx)("clipPath",{id:de,children:(0,i.jsx)("path",{d:$.underside})}),(0,i.jsx)("path",{d:$.underside,fill:Z.underside}),(0,i.jsx)("path",{d:$.gills,stroke:Z.gill,strokeWidth:.6,clipPath:`url(#${de})`}),(0,i.jsx)("path",{d:$.cap,fill:se,fillOpacity:A.fillOpacity,...le}),(0,i.jsx)("path",{d:$.cap,fill:`url(#${c})`})]})]},x)})]})},At=(0,o.defineGeomRenderer)("bar",{coord:"cartesian",guideMode:"band",swatchShape:"square",render:({layer:e,coordSystem:r,panelRect:t,intro:n})=>(0,i.jsx)(ce,{layer:e,observations:e.data,mainAxis:(0,o.readMainAxis)(r),panel:t,intro:n}),renderHover:({layer:e,coordSystem:r,primary:t,panelRect:n})=>(0,i.jsx)(ce,{layer:e,observations:[t.observation],mainAxis:(0,o.readMainAxis)(r),panel:n,state:"hovered"}),renderHoverCompanions:()=>null}),kt=15,jt=18,St=24,Rt=({layer:e,panel:r,coord:t,project:n})=>{const a=Q(e),s=(0,S.useMemo)(()=>{if(t==="polar")return H(e,u=>J(u,r));const d=(0,o.createLinePathGenerator)(e.params);return H(e,u=>{const g=d((0,o.prepareLineObservations)(u,e.params.missingValues));return g?I(g,r):null})},[e,r,t]),l=(0,S.useMemo)(()=>je(e,r,n),[e,r,n]),h=l.length/Math.max(1,s.length),c=r.width/Math.max(1,h)>=jt;return r.width<=0||r.height<=0?null:(0,i.jsxs)("g",{"data-geom":"line",children:[s.map(({key:d,path:u,observation:g})=>{const p=a(g);return(0,i.jsx)("path",{d:u,fill:"none",stroke:p.color,strokeWidth:p.width,strokeDasharray:p.dashArray,strokeLinecap:"round",strokeLinejoin:"round",opacity:p.opacity},d)}),c&&l.map(({key:d,observation:u,point:g})=>(0,i.jsx)(ee,{cx:g.x,cy:g.y,width:kt,color:a(u).color},d))]})},$t=({layer:e,observation:r,panel:t,project:n})=>{const a=Q(e)(r,"hovered"),s=n(r,t);return s===null?null:(0,i.jsx)("g",{"data-geom":"line",children:(0,i.jsx)(ee,{cx:s.x,cy:s.y,width:St,color:a.color,opacity:a.opacity})})},Ee=(e,r)=>(0,o.defineGeomRenderer)("line",{coord:e,guideMode:"crosshair",swatchShape:"line",render:({layer:t,panelRect:n,intro:a})=>(0,i.jsx)(z,{intro:a,children:(0,i.jsx)(Rt,{layer:t,panel:n,coord:e,project:r})}),renderHover:({layer:t,primary:n,panelRect:a})=>(0,i.jsx)($t,{layer:t,observation:n.observation,panel:a,project:r}),renderHoverCompanions:()=>null,getOverlayAnchor:({observation:t})=>{const n=(0,o.getX)(t),a=(0,o.getY)(t);return n===null||a===null?null:{x:n,y:a}}}),wt=Ee("cartesian",D),Ct=Ee("polar",O),Wt=2.6,bt=5,ue=({layer:e,observations:r,panel:t,project:n,state:a,intro:s})=>{const l=(0,o.useGeomStyleReader)(e),h=W(e),c=(0,S.useMemo)(()=>(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),d=a==="hovered"?bt:0,{readGrowth:u}=B(s);return(0,i.jsx)("g",{"data-geom":"point",children:Array.from(r,g=>{const p=n(g,t);if(p===null)return null;const f=h(g,a),y=c(g);return(0,i.jsx)(ee,{cx:p.x,cy:p.y,width:(l.get("size",g,a)+d)*u(y)*Wt,color:f.color,opacity:f.opacity,edge:a==="hovered"?{stroke:f.edge,strokeWidth:f.edgeWidth}:void 0},y)})})},Me=(e,r)=>(0,o.defineGeomRenderer)("point",{coord:e,swatchShape:"circle",render:({layer:t,panelRect:n,intro:a})=>(0,i.jsx)(ue,{layer:t,observations:t.data,panel:n,project:r,intro:a}),renderHover:({layer:t,primary:n,panelRect:a})=>(0,i.jsx)(ue,{layer:t,observations:[n.observation],panel:a,project:r,state:"hovered"}),renderHoverCompanions:()=>null}),Ft=Me("cartesian",D),Et=Me("polar",O),He=(e,r,t)=>{const{startAngle:n,endAngle:a}=(0,o.getAngleExtent)(e),{innerRadius:s,outerRadius:l}=(0,o.getRadiusExtent)(e);return n===null||a===null||s===null||l===null?null:r?.growAxis==="angle"?{startAngle:_(r.baseline,n,t),endAngle:_(r.baseline,a,t),innerRadius:s,outerRadius:l}:r?.growAxis==="radius"?{startAngle:n,endAngle:a,innerRadius:_(r.baseline,s,t),outerRadius:_(r.baseline,l,t)}:{startAngle:n,endAngle:a,innerRadius:s,outerRadius:l}},Mt=2,Ht=3,oe=Math.PI/80,Pt=.2,ge=.17,pe="#FFFFFF",Ot="#3A2466",fe=(e,r,t)=>{const n=(0,o.polarToUnit)(r,1);return`${(e.width/2+n.x*t).toFixed(2)},${(e.height/2-n.y*t).toFixed(2)}`},Gt=(e,r)=>{if(e===null)return null;const{startAngle:t,endAngle:n,innerRadius:a,outerRadius:s}=e,l=Math.min(r.width,r.height)/2,h=s*l,c=a*l;if(h<=0)return null;const d=Math.max(0,n-t),u=d>=2*Math.PI-1e-6?0:Math.min(Mt/2/h,d/4),g=t+u,p=n-u,f=(0,o.buildPolarBarArcPath)({startAngle:g,endAngle:p,innerRadius:a,outerRadius:s},{centerX:r.width/2,centerY:r.height/2,radius:l,digits:Ht});if(f===void 0)return null;const y=Math.max(c,l*Pt*s)+1,R=h-1,x=[];for(let k=Math.ceil(g/oe);k*oe<p;k+=1){const A=k*oe;A>g&&R>y&&x.push(`M${fe(r,A,y)} L${fe(r,A,R)}`)}return{path:f,gills:x.join(" ")}},me=({layer:e,observations:r,panel:t,state:n,intro:a})=>{const s=W(e),l=C("underside"),h=C("stalk"),c=C("stipple"),d=(0,S.useMemo)(()=>(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),{plan:u,readGrowth:g}=B(a);if(t.width<=0||t.height<=0)return null;const p=Math.min(t.width,t.height)/2,f=[...r].map((x,k)=>{const A=d(x);return{key:A,index:k,observation:x,paint:s(x,n),slice:Gt(He(x,u,g(A)),t)}}),y=f.map(({observation:x})=>(0,o.getRadiusExtent)(x)),R=n===void 0&&f.length>1&&y.every(({innerRadius:x,outerRadius:k})=>x===0&&k===y[0]?.outerRadius);return(0,i.jsxs)("g",{"data-geom":"bar",children:[(0,i.jsxs)("defs",{children:[(0,i.jsx)(Ce,{id:h}),(0,i.jsx)(we,{id:c}),f.map(({index:x,paint:k})=>(0,i.jsxs)("radialGradient",{id:`${l}-${x}`,gradientUnits:"userSpaceOnUse",cx:t.width/2,cy:t.height/2,r:p,children:[(0,i.jsx)("stop",{offset:0,stopColor:M(k.color,pe,.5)}),(0,i.jsx)("stop",{offset:.75,stopColor:k.color}),(0,i.jsx)("stop",{offset:1,stopColor:M(k.color,Ot,.25)})]},x))]}),f.map(({key:x,index:k,paint:A,slice:j})=>j===null?null:(0,i.jsxs)("g",{opacity:A.opacity,children:[(0,i.jsx)("path",{d:j.path,fill:`url(#${l}-${k})`,fillOpacity:A.fillOpacity,stroke:n==="hovered"?A.edge:"none",strokeWidth:A.edgeWidth}),(0,i.jsx)("path",{d:j.gills,stroke:M(A.color,pe,.6),strokeWidth:.7,strokeOpacity:.85})]},x)),R&&(0,i.jsxs)("g",{children:[(0,i.jsx)("circle",{cx:t.width/2,cy:t.height/2,r:p*ge,fill:`url(#${h})`}),(0,i.jsx)("circle",{cx:t.width/2,cy:t.height/2,r:p*ge,fill:`url(#${c})`})]})]})},Lt=(0,o.defineGeomRenderer)("bar",{coord:"polar",guideMode:"band",swatchShape:"slice",render:({layer:e,panelRect:r,intro:t})=>(0,i.jsx)(me,{layer:e,observations:e.data,panel:r,intro:t}),renderHover:({layer:e,primary:r,panelRect:t})=>(0,i.jsx)(me,{layer:e,observations:[r.observation],panel:t,state:"hovered"}),renderHoverCompanions:()=>null}),_t=[At,Lt,wt,Ct,ot,at,Ft,Et],Pe="'ESBuild', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif",q="'PPMori', 'Inter', ui-sans-serif, system-ui, sans-serif",v={sky:"#84C1FA",haze:"#AFE7FC",mist:"#E8EEFC",ground:"#FFFFFF",raised:"#FFFFFF",text:"#002253",secondary:"#4B5A78",accent:"#0540AD",rule:"rgba(0, 34, 83, 0.55)",grid:"rgba(255, 255, 255, 0.75)"},P={coral:"#FF5D73",violet:"#6B5BE2",pink:"#F26DB5",orange:"#FF9A3C",purple:"#B05CE0",teal:"#1FA88A"},Tt=[P.coral,P.violet,P.pink,P.orange,P.purple,P.teal],It=["#FBD7E1","#FF5D73","#6B5BE2"],F={textColor:v.text},G={textColor:v.secondary},ae={fontFamily:Pe},Bt={tokens:{graphBackground:v.mist,graphBorder:v.rule,geom:P.coral,geomBorder:v.secondary,textPrimary:v.text,textSecondary:v.secondary,ruleLine:v.text,gridLine:v.grid,hoverAffordance:v.text,hoverGuideFill:"rgba(255, 255, 255, 0.35)",hoverGuideLine:v.rule,tooltipBackground:v.raised,tooltipBorder:"rgba(0, 34, 83, 0.15)",tooltipPrimaryRow:"rgba(5, 64, 173, 0.08)",annotationShape:v.accent,annotationArrow:v.text,differenceLabelBackground:v.raised},defaults:[o.style.graph({fill:{gradient:"linear",angle:180,stops:[{offset:0,color:v.sky},{offset:.45,color:v.haze},{offset:.85,color:v.mist},{offset:1,color:v.ground}]},strokeWidth:0,cornerRadius:16,fontFamily:q,padding:28}),o.style.geom({shadow:"none"},{state:"hovered"}),o.style.geom.bar({stroke:v.text,strokeWidth:0}),o.style.geom.bar({strokeWidth:1.5},{state:"hovered"}),o.style.geom.line({strokeWidth:3,dashArray:[],lineCap:"round",lineJoin:"round"}),o.style.geom.area({fillAlpha:.8,strokeWidth:2,dashArray:[]}),o.style.geom.point({size:10,stroke:v.text}),o.style.geom.tile({cornerRadius:8,stroke:v.ground,strokeWidth:2}),o.style.geom.tile({stroke:v.text,strokeWidth:1.5},{state:"hovered"}),o.style.geom.rule({strokeWidth:1.5,dashArray:[5,4]}),o.style.geom.rule.label({...F,fontWeight:600,fontSize:13}),o.style.gridLine({dashArray:[]}),o.style.gridLine.x({strokeWidth:0}),o.style.gridLine.y({strokeWidth:1.5}),o.style.panelBorder({strokeWidth:0}),o.style.panelBorder.bottom({stroke:v.text,strokeWidth:1.5,dashArray:[]}),o.style.tickLine({strokeWidth:0}),o.style.tickLabel({...G,fontWeight:500,fontSize:13,lineHeight:1}),o.style.axisLabel({...G,fontWeight:600,fontSize:13,lineHeight:1}),o.style.heading({...F,...ae}),o.style.heading.h1({fontWeight:800,fontSize:30,lineHeight:1.1,letterSpacing:-.8}),o.style.heading.h2({...G,fontFamily:q,fontWeight:400,fontSize:16,lineHeight:1.35}),o.style.caption({...G,fontWeight:400,fontSize:13}),o.style.source({...G,fontWeight:400,fontSize:12}),o.style.dataLabel({...F,fontWeight:600,fontSize:13,fill:"transparent"}),o.style.legendItem({...F,fontWeight:500,fontSize:13,fill:"transparent",stroke:"transparent"}),o.style.directLabel({fontWeight:600,fontSize:13}),o.style.headlineItem.number({...ae,fontWeight:800,fontSize:32,lineHeight:1.1}),o.style.tooltip({strokeWidth:1,cornerRadius:12,paddingInline:12,paddingBlock:9}),o.style.tooltip.heading({...F,...ae,fontWeight:700,fontSize:14,lineHeight:1.3}),o.style.tooltip.label({...G,fontWeight:400,fontSize:13,lineHeight:1.35}),o.style.tooltip.value({...F,fontWeight:600,fontSize:13,lineHeight:1.35}),o.style.legend.popover({cornerRadius:12}),o.style.annotation.text({...F,fill:v.raised,stroke:"rgba(0, 34, 83, 0.15)",strokeWidth:1,cornerRadius:10,paddingInline:10,paddingBlock:5,fontSize:13,lineHeight:1.3}),o.style.annotation.shape({fillAlpha:.12,stroke:v.accent,strokeWidth:1}),o.style.annotation.arrow({strokeWidth:1.5,dashArray:[]}),o.style.annotation.differenceArrow({stroke:v.accent,strokeWidth:1.5}),o.style.annotation.differenceArrow.label({...F,fill:v.raised,stroke:"rgba(0, 34, 83, 0.15)",strokeWidth:1,cornerRadius:10,fontWeight:600,fontSize:13}),o.style.panelBorder.bottom({strokeWidth:0},{coord:"polar"}),o.style.tickLabel({...F,fontWeight:700,textOutlineColor:v.ground,textOutlineWidth:3},{coord:"polar"})]},zt={name:"gamma-mushroom",styles:Bt,palette:Tt,colormap:It,colorScheme:"light",plugins:_t},Dt=.92,Nt=.38,te=({idFor:e,colors:r,panel:t,fall:n,strength:a=1})=>(0,i.jsx)("defs",{children:[...new Set(r)].map(s=>(0,i.jsxs)("linearGradient",{id:e(s),gradientUnits:"userSpaceOnUse",x1:n==="left"?t.width:0,y1:0,x2:0,y2:n==="down"?t.height:0,children:[(0,i.jsx)("stop",{offset:0,stopColor:s,stopOpacity:Dt*a}),(0,i.jsx)("stop",{offset:1,stopColor:s,stopOpacity:Nt*a})]},s))}),Kt=.18,Ut=2.2,Xt=.35,xe="#FFFFFF",Vt=(e,r,t)=>{const n=t*Kt;return[`M${e},${r-t}`,`Q${e+n},${r-n} ${e+t},${r}`,`Q${e+n},${r+n} ${e},${r+t}`,`Q${e-n},${r+n} ${e-t},${r}`,`Q${e-n},${r-n} ${e},${r-t}`,"Z"].join(" ")},re=({cx:e,cy:r,reach:t,color:n,opacity:a=1})=>{const s=C("halo");return(0,i.jsxs)("g",{opacity:a,children:[(0,i.jsx)("defs",{children:(0,i.jsxs)("radialGradient",{id:s,children:[(0,i.jsx)("stop",{offset:0,stopColor:n,stopOpacity:Xt}),(0,i.jsx)("stop",{offset:1,stopColor:n,stopOpacity:0})]})}),(0,i.jsx)("circle",{cx:e,cy:r,r:t*Ut,fill:`url(#${s})`}),(0,i.jsx)("path",{d:Vt(e,r,t),fill:M(n,xe,.55)}),(0,i.jsx)("circle",{cx:e,cy:r,r:Math.max(.8,t*.16),fill:xe})]})},Yt=1.5,Zt=10,Oe=({layer:e,coordSystem:r,panel:t})=>{const n=W(e),a=N("night-area"),s=(0,S.useMemo)(()=>{if(r===void 0)return H(e,d=>J(d,t)).map(d=>({...d,fill:d.path,edge:d.path}));const{areaGenerator:l,lineGenerator:h}=(0,o.createAreaPathGenerators)(r,e.params),c=new Map;return H(e,d=>{const u=(0,o.prepareAreaObservations)(d,e.params.missingValues),g=l(u),p=h(u);if(!g)return null;const f=I(g,t);return p&&c.set(f,I(p,t)),f}).map(d=>({...d,fill:d.path,edge:c.get(d.path)??""}))},[e,r,t]);return t.width<=0||t.height<=0?null:(0,i.jsxs)("g",{"data-geom":"area",children:[(0,i.jsx)(te,{idFor:a,colors:s.map(({observation:l})=>n(l).color),panel:t,fall:r?.mainAxis==="y"?"left":"down"}),s.map(({key:l,observation:h,fill:c,edge:d})=>{const u=n(h);return(0,i.jsxs)("g",{opacity:u.opacity,children:[(0,i.jsx)("path",{d:c,fill:`url(#${a(u.color)})`,fillOpacity:u.fillOpacity}),(0,i.jsx)("path",{d,fill:"none",stroke:u.color,strokeWidth:Yt,strokeLinejoin:"round"})]},l)})]})},Ge=({layer:e,observation:r,panel:t,project:n})=>{const a=W(e)(r,"hovered"),s=n(r,t);return s===null?null:(0,i.jsx)("g",{"data-geom":"area",children:(0,i.jsx)(re,{cx:s.x,cy:s.y,reach:Zt,color:a.color,opacity:a.opacity})})},qt=(0,o.defineGeomRenderer)("area",{coord:"cartesian",guideMode:"crosshair",swatchShape:"area",render:({layer:e,coordSystem:r,panelRect:t,intro:n})=>r.type!=="cartesian"?null:(0,i.jsx)(z,{intro:n,children:(0,i.jsx)(Oe,{layer:e,coordSystem:r,panel:t})}),renderHover:({layer:e,primary:r,panelRect:t})=>(0,i.jsx)(Ge,{layer:e,observation:r.observation,panel:t,project:D}),renderHoverCompanions:()=>null}),Qt=(0,o.defineGeomRenderer)("area",{coord:"polar",guideMode:"crosshair",swatchShape:"area",render:({layer:e,panelRect:r,intro:t})=>(0,i.jsx)(z,{intro:t,children:(0,i.jsx)(Oe,{layer:e,panel:r})}),renderHover:({layer:e,primary:r,panelRect:t})=>(0,i.jsx)(Ge,{layer:e,observation:r.observation,panel:t,project:O}),renderHoverCompanions:()=>null}),Jt=3,V=.5523,er=e=>{const{breadth:r,length:t,endsStack:n}=e,a=n?Math.min(6,r/2,t):0;return a===0?T(e,[[[0,0]],[[0,t]],[[r,t]],[[r,0]]]):T(e,[[[0,0]],[[0,t-a]],[[0,t-a+a*V],[a-a*V,t],[a,t]],[[r-a,t]],[[r-a+a*V,t],[r,t-a+a*V],[r,t-a]],[[r,0]]])},ve=({layer:e,observations:r,mainAxis:t,panel:n,state:a,intro:s})=>{const l=W(e),h=N("night-bar"),c=(0,S.useMemo)(()=>(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),{plan:d,readGrowth:u}=B(s);if(n.width<=0||n.height<=0)return null;const g=[...r].map(p=>({key:c(p),paint:l(p,a),frame:Fe(p,t,n,Jt,d===null?void 0:{baseline:d.baseline,growth:u(c(p))})}));return(0,i.jsxs)("g",{"data-geom":"bar",children:[(0,i.jsx)(te,{idFor:h,colors:g.map(({paint:p})=>p.color),panel:n,fall:t==="x"?"down":"left"}),g.map(({key:p,paint:f,frame:y})=>y===null?null:(0,i.jsx)("path",{d:er(y),fill:`url(#${h(f.color)})`,fillOpacity:f.fillOpacity,opacity:f.opacity,stroke:a==="hovered"?f.edge:"none",strokeWidth:f.edgeWidth},p))]})},tr=(0,o.defineGeomRenderer)("bar",{coord:"cartesian",guideMode:"band",swatchShape:"square",render:({layer:e,coordSystem:r,panelRect:t,intro:n})=>(0,i.jsx)(ve,{layer:e,observations:e.data,mainAxis:(0,o.readMainAxis)(r),panel:t,intro:n}),renderHover:({layer:e,coordSystem:r,primary:t,panelRect:n})=>(0,i.jsx)(ve,{layer:e,observations:[t.observation],mainAxis:(0,o.readMainAxis)(r),panel:n,state:"hovered"}),renderHoverCompanions:()=>null}),rr=4,nr=6,or=10,ar=({layer:e,panel:r,coord:t,project:n})=>{const a=Q(e),s=N("night-line"),l=(0,S.useMemo)(()=>{if(t==="polar")return H(e,d=>J(d,r));const c=(0,o.createLinePathGenerator)(e.params);return H(e,d=>{const u=c((0,o.prepareLineObservations)(d,e.params.missingValues));return u?I(u,r):null})},[e,r,t]),h=(0,S.useMemo)(()=>je(e,r,n),[e,r,n]);return r.width<=0||r.height<=0?null:(0,i.jsxs)("g",{"data-geom":"line",children:[(0,i.jsx)(te,{idFor:s,colors:l.map(({observation:c})=>a(c).color),panel:r,fall:"down",strength:.75}),l.map(({key:c,path:d,observation:u})=>{const g=a(u);return(0,i.jsxs)("g",{opacity:g.opacity,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,i.jsx)("path",{d,stroke:`url(#${s(g.color)})`,strokeWidth:g.width*rr}),(0,i.jsx)("path",{d,stroke:g.color,strokeWidth:g.width*.6,strokeDasharray:g.dashArray})]},c)}),h.map(({key:c,observation:d,point:u})=>(0,i.jsx)(re,{cx:u.x,cy:u.y,reach:nr,color:a(d).color},c))]})},ir=({layer:e,observation:r,panel:t,project:n})=>{const a=Q(e)(r,"hovered"),s=n(r,t);return s===null?null:(0,i.jsx)("g",{"data-geom":"line",children:(0,i.jsx)(re,{cx:s.x,cy:s.y,reach:or,color:a.color,opacity:a.opacity})})},Le=(e,r)=>(0,o.defineGeomRenderer)("line",{coord:e,guideMode:"crosshair",swatchShape:"line",render:({layer:t,panelRect:n,intro:a})=>(0,i.jsx)(z,{intro:a,children:(0,i.jsx)(ar,{layer:t,panel:n,coord:e,project:r})}),renderHover:({layer:t,primary:n,panelRect:a})=>(0,i.jsx)(ir,{layer:t,observation:n.observation,panel:a,project:r}),renderHoverCompanions:()=>null,getOverlayAnchor:({observation:t})=>{const n=(0,o.getX)(t),a=(0,o.getY)(t);return n===null||a===null?null:{x:n,y:a}}}),sr=Le("cartesian",D),lr=Le("polar",O),dr=.85,hr=5,ye=({layer:e,observations:r,panel:t,project:n,state:a,intro:s})=>{const l=(0,o.useGeomStyleReader)(e),h=W(e),c=(0,S.useMemo)(()=>(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),d=a==="hovered"?hr:0,{readGrowth:u}=B(s);return(0,i.jsx)("g",{"data-geom":"point",children:Array.from(r,g=>{const p=n(g,t);if(p===null)return null;const f=h(g,a),y=c(g);return(0,i.jsx)(re,{cx:p.x,cy:p.y,reach:(l.get("size",g,a)+d)*u(y)*dr,color:f.color,opacity:f.opacity},y)})})},_e=(e,r)=>(0,o.defineGeomRenderer)("point",{coord:e,swatchShape:"circle",render:({layer:t,panelRect:n,intro:a})=>(0,i.jsx)(ye,{layer:t,observations:t.data,panel:n,project:r,intro:a}),renderHover:({layer:t,primary:n,panelRect:a})=>(0,i.jsx)(ye,{layer:t,observations:[n.observation],panel:a,project:r,state:"hovered"}),renderHoverCompanions:()=>null}),cr=_e("cartesian",D),ur=_e("polar",O),gr=4,pr=2,fr=3,mr=(e,r)=>{if(e===null)return null;const{startAngle:t,endAngle:n,innerRadius:a,outerRadius:s}=e,l=Math.min(r.width,r.height)/2,h=s*l;if(h<=0||l<=0)return null;const c=Math.max(0,n-t),d=c>=2*Math.PI-1e-6?0:Math.min(gr/2/h,c/4),u=a>0?Math.min(s,a+pr/l):0;return(0,o.buildPolarBarArcPath)({startAngle:t+d,endAngle:n-d,innerRadius:u,outerRadius:s},{centerX:r.width/2,centerY:r.height/2,radius:l,digits:fr})??null},Ae=({layer:e,observations:r,panel:t,state:n,intro:a})=>{const s=W(e),l=N("night-slice"),h=(0,S.useMemo)(()=>(0,o.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),{plan:c,readGrowth:d}=B(a);if(t.width<=0||t.height<=0)return null;const u=[...r].map(g=>{const p=h(g);return{key:p,paint:s(g,n),path:mr(He(g,c,d(p)),t)}});return(0,i.jsxs)("g",{"data-geom":"bar",children:[(0,i.jsx)(te,{idFor:l,colors:u.map(({paint:g})=>g.color),panel:t,fall:"down"}),u.map(({key:g,paint:p,path:f})=>f===null?null:(0,i.jsx)("path",{d:f,fill:`url(#${l(p.color)})`,fillOpacity:p.fillOpacity,opacity:p.opacity},g))]})},xr=(0,o.defineGeomRenderer)("bar",{coord:"polar",guideMode:"band",swatchShape:"slice",render:({layer:e,panelRect:r,intro:t})=>(0,i.jsx)(Ae,{layer:e,observations:e.data,panel:r,intro:t}),renderHover:({layer:e,primary:r,panelRect:t})=>(0,i.jsx)(Ae,{layer:e,observations:[r.observation],panel:t,state:"hovered"}),renderHoverCompanions:()=>null}),vr=[tr,xr,sr,lr,qt,Qt,cr,ur],yr=150,Ar=(e,r)=>{const t=ke(23),n=Array.from({length:yr},()=>{const s=t()*100,l=t()**1.7*100,h=.35+t()**3*1.1,c=(.3+t()*.65)*(1-l/140);return`<circle cx="${s.toFixed(2)}%" cy="${l.toFixed(2)}%" r="${h.toFixed(2)}" fill="${r}" fill-opacity="${c.toFixed(2)}"/>`}),a='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs><linearGradient id="s" x1="0" y1="0" x2="0" y2="1">'+e.map(({offset:s,color:l})=>`<stop offset="${s}" stop-color="${l}"/>`).join("")+'</linearGradient></defs><rect width="100%" height="100%" fill="url(#s)"/>'+n.join("")+"</svg>";return`data:image/svg+xml,${encodeURIComponent(a)}`},m={zenith:"#122547",dusk:"#31347A",horizon:"#405199",raised:"#1B2A5C",text:"#EEF2FE",secondary:"#AAB5E6",rule:"rgba(170, 181, 230, 0.6)",grid:"rgba(170, 181, 230, 0.13)",star:"#FFFFFF"},E={wordmark:"#B9C3FF",sky:"#6CAEEE",petal:"#FF8FB8",mint:"#5FE0C1",gold:"#FFD66B",coral:"#FF8A65"},kr=[E.wordmark,E.petal,E.mint,E.gold,E.sky,E.coral],jr=["#3A4A9C","#6CAEEE","#E8EEFC"],w={textColor:m.text},L={textColor:m.secondary},ie={fontFamily:Pe},Sr={tokens:{graphBackground:m.dusk,graphBorder:m.rule,geom:E.wordmark,geomBorder:m.secondary,textPrimary:m.text,textSecondary:m.secondary,ruleLine:m.rule,gridLine:m.grid,hoverAffordance:m.text,hoverGuideFill:"rgba(185, 195, 255, 0.08)",hoverGuideLine:m.rule,tooltipBackground:m.raised,tooltipBorder:m.rule,tooltipPrimaryRow:"rgba(185, 195, 255, 0.12)",annotationShape:E.gold,annotationArrow:m.text,differenceLabelBackground:m.raised},defaults:[o.style.graph({fill:{image:Ar([{offset:0,color:m.zenith},{offset:.55,color:m.dusk},{offset:1,color:m.horizon}],m.star),fit:"stretch",fallback:m.dusk},strokeWidth:0,cornerRadius:16,fontFamily:q,padding:28}),o.style.geom({shadow:"none"},{state:"hovered"}),o.style.geom.bar({stroke:m.text,strokeWidth:0}),o.style.geom.bar({strokeWidth:1.5},{state:"hovered"}),o.style.geom.line({strokeWidth:2.5,dashArray:[],lineCap:"round",lineJoin:"round"}),o.style.geom.area({fillAlpha:.75,strokeWidth:1.5,dashArray:[]}),o.style.geom.point({size:10}),o.style.geom.tile({cornerRadius:6,stroke:m.dusk,strokeWidth:2}),o.style.geom.tile({stroke:m.text,strokeWidth:1.5},{state:"hovered"}),o.style.geom.rule({strokeWidth:1,dashArray:[4,4]}),o.style.geom.rule.label({...w,fontWeight:500,fontSize:13}),o.style.gridLine({dashArray:[]}),o.style.gridLine.x({strokeWidth:0}),o.style.gridLine.y({strokeWidth:1}),o.style.panelBorder({strokeWidth:0}),o.style.panelBorder.bottom({stroke:m.rule,strokeWidth:1,dashArray:[]}),o.style.tickLine({strokeWidth:0}),o.style.tickLabel({...L,fontWeight:400,fontSize:13,lineHeight:1}),o.style.axisLabel({...L,fontWeight:500,fontSize:13,lineHeight:1}),o.style.heading({...w,...ie}),o.style.heading.h1({fontWeight:800,fontSize:28,lineHeight:1.15,letterSpacing:-.6}),o.style.heading.h2({...L,fontFamily:q,fontWeight:400,fontSize:16,lineHeight:1.35}),o.style.caption({...L,fontWeight:400,fontSize:13}),o.style.source({...L,fontWeight:400,fontSize:12}),o.style.dataLabel({...w,fontWeight:600,fontSize:13,fill:"transparent"}),o.style.legendItem({...w,fontWeight:500,fontSize:13,fill:"transparent",stroke:"transparent"}),o.style.directLabel({fontWeight:600,fontSize:13}),o.style.headlineItem.number({...ie,fontWeight:800,fontSize:32,lineHeight:1.1}),o.style.tooltip({strokeWidth:1,cornerRadius:12,paddingInline:12,paddingBlock:9,shadow:"none"}),o.style.tooltip.heading({...w,...ie,fontWeight:700,fontSize:14,lineHeight:1.3}),o.style.tooltip.label({...L,fontWeight:400,fontSize:13,lineHeight:1.35}),o.style.tooltip.value({...w,fontWeight:600,fontSize:13,lineHeight:1.35}),o.style.legend.popover({cornerRadius:12,shadow:"none"}),o.style.annotation.text({...w,fill:m.raised,stroke:m.rule,strokeWidth:1,cornerRadius:10,paddingInline:10,paddingBlock:5,fontSize:13,lineHeight:1.3}),o.style.annotation.shape({fillAlpha:.14,stroke:E.gold,strokeWidth:1}),o.style.annotation.arrow({strokeWidth:1.5,dashArray:[]}),o.style.annotation.pinnedNumber({stroke:m.dusk,shadow:"none"}),o.style.annotation.pinnedNumber.label({...w,fill:m.raised,stroke:m.rule,cornerRadius:10,shadow:"none"}),o.style.annotation.comment({stroke:m.dusk,shadow:"none"}),o.style.annotation.comment.label({...w,fill:m.raised,stroke:m.rule,cornerRadius:10,shadow:"none"}),o.style.annotation.differenceArrow({stroke:m.text,strokeWidth:1.5}),o.style.annotation.differenceArrow.label({...w,fill:m.raised,stroke:m.rule,strokeWidth:1,cornerRadius:10,fontWeight:600,fontSize:13}),o.style.panelBorder.bottom({strokeWidth:0},{coord:"polar"}),o.style.tickLabel({...w,fontWeight:600,textOutlineColor:m.dusk,textOutlineWidth:3},{coord:"polar"})]},Rr={name:"gamma-night",styles:Sr,palette:kr,colormap:jr,colorScheme:"dark",plugins:vr};exports.gammaMushroom=zt;exports.gammaNight=Rr;
|
package/dist/index.d.ts
ADDED