@graphysdk/react-renderer 1.9.0-beta.1788803137845 → 1.9.0-beta.1788852065633

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const l=require("./history-chords-Dj1OKqU5.cjs"),W=require("./dev.utils-BU9Kwcpp.cjs");let p=require("@graphysdk/viz-engine"),c=require("react"),i=require("react/jsx-runtime"),A=require("zustand"),B=require("zustand/vanilla"),$=require("clsx");$=l.__toESM($,1);var ne="_1a5iqpb0",oe="_1a5iqpb1";var ie="_1a5iqpb3",ae="_1a5iqpb4",le="_1a5iqpb5";var L=({errors:e})=>{const[t,...r]=e;return(0,i.jsxs)("div",{role:"alert",className:ne,children:[(0,i.jsx)("strong",{className:oe,children:"This chart could not be rendered."}),t&&(0,i.jsx)(U,{diagnostic:t}),r.length>0&&(0,i.jsx)("ul",{className:"_1a5iqpb2",children:r.map((s,o)=>(0,i.jsx)("li",{children:(0,i.jsx)(U,{diagnostic:s})},`${s.code}-${o}`))})]})},U=({diagnostic:e})=>(0,i.jsxs)("div",{className:ie,children:[(0,i.jsx)("span",{className:ae,children:e.code}),(0,i.jsx)("p",{className:le,children:e.message}),e.suggestion&&(0,i.jsx)("p",{className:"_1a5iqpb6",children:e.suggestion})]});function ce(e=[],t=[]){return e.length===t.length&&e.every((r,s)=>Object.is(r,t[s]))}var z=class extends c.Component{constructor(...e){super(...e),this.state={caughtDiagnostic:null}}static getDerivedStateFromError(e){return{caughtDiagnostic:(0,p.buildDiagnostic)(e)}}componentDidCatch(e,t){const r=(0,p.buildDiagnostic)(e);l.logDiagnostics([r]),this.props.onError?.([r]),console.error("Chart render component stack:",t.componentStack)}componentDidUpdate(e){this.state.caughtDiagnostic&&!ce(e.resetKeys,this.props.resetKeys)&&this.setState({caughtDiagnostic:null})}render(){const{caughtDiagnostic:e}=this.state;if(e)return(0,i.jsx)(L,{errors:[e]});const{forcedErrors:t,children:r}=this.props;return t&&t.length>0?(0,i.jsx)(L,{errors:t}):r}},X=e=>typeof e=="object"&&"geom"in e&&"render"in e,de=e=>{const t=(0,p.resolveDefinition)(e);return t instanceof p.Geom?t:null},Q=(e,t)=>{const r=e.filter(s=>ue(s,t));return r.length===e.length?e:r},ue=(e,t)=>e.kind!=="annotation"?!0:(0,p.findAnnotation)(t.annotations,e.id)!==null,Y=[],me=()=>(0,B.createStore)(e=>({selection:Y,setSelection:t=>e(r=>he(r.selection,t)?r:{selection:t}),clearSelection:()=>e(t=>t.selection.length===0?t:{selection:Y})})),he=(e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,s)=>{const o=t[s];return o!==void 0&&(0,p.areEditTargetsEqual)(r,o)}),ge=5,pe=e=>{if(!W.IS_DEV)return{emit:()=>{},subscribe:()=>ve,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let r=null;return{emit:s=>{const o=e.getLastCompile();if(o){r=s;for(const d of t)d(s,o)}},subscribe:s=>(t.add(s),()=>{t.delete(s)}),getLastTrigger:()=>r,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},fe=()=>(0,B.createStore)(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,r)=>e(s=>{if(s.lastSnapshot===r)return s;const o={id:s.nextId,label:ye(t),stages:r.stages,durationMs:r.durationMs};return{lastCompile:o,history:Se(s.history,o,ge),nextId:s.nextId+1,lastSnapshot:r}})})),ve=()=>{},ye=e=>{switch(e.kind){case"init":return"init";case"input":return"input change";case"data":return"data change";case"command":return e.command.metadata.description}},Se=(e,t,r)=>{const s=e.length>=r?e.length-(r-1):0;return[...e.slice(s),t]};function be(e){const t=e.filter(X),r=new Set([...Object.keys(l.BUILT_IN_GEOM_RENDERERS),...t.map(u=>u.geom)]),s=[],o=new Set;for(const u of e){const m=de(u);m===null||r.has(m.type)||o.has(m.type)||(o.add(m.type),s.push({kind:"user-input",severity:"error",code:"MISSING_GEOM_RENDERER",message:`Custom geom '${m.type}' is registered but has no renderer.`,context:{requested:m.type,kind:"geom-renderer"},suggestion:`Add a render half for it: \`defineGeomRenderer(${m.type}Geom, { coord, render })\`, then include it in \`plugins\`.`}))}const d=new Map;for(const u of t){if("definition"in u)continue;const m=`${u.geom}|${u.coord}`,v=d.get(m);v?v.count+=1:d.set(m,{geom:u.geom,coord:u.coord,count:1})}const a=[];for(const{geom:u,coord:m,count:v}of d.values())v<2||a.push({kind:"user-input",severity:"warning",code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple render-only overrides register ('${u}', '${m}') (${v} entries); the last in the array wins.`,context:{requested:`${u}@${m}`,kind:"geom-renderer"},suggestion:`Keep a single render-only override for ('${u}', '${m}').`});return{errors:s,warnings:a}}function Ee(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s)t(a.geom,r.type)!==null||o.has(a.geom)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_GEOM_RENDERER",message:`No renderer for geom '${a.geom}' under ${r.type} coords; the layer is not painted.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:`Register a renderer for ('${a.geom}', '${r.type}') via \`defineGeomRenderer\`.`}));return d}function Ce(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s){if(a.interactive===!1||a.spatialKind!=="render-hit-test"||o.has(a.geom))continue;const u=t(a.geom,r.type);u===null||u.hitTest||l.isOverlayHosted(u)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_RENDER_HIT_TEST",message:`Geom '${a.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:`Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${a.geom}', '${r.type}').`}))}return d}function xe(e){const t=new Set,r=[];for(const s of e.layers){const o=s.identityKey;s.interactive!==!1&&(s.spatialKind!=="render-hit-test"||typeof o!="object"||t.has(s.geom)||s.data.hasVariable(o.variable)||(t.add(s.geom),r.push({kind:"user-input",severity:"warning",code:"RENDER_HIT_TEST_IDENTITY",message:`Geom '${s.geom}' keys its identity on '${o.variable}', a column its compile output does not emit; its hover lookup is empty.`,context:{requested:s.geom,kind:"geom-renderer"},suggestion:`Emit the '${o.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`})))}return r}function Te(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s){if(a.interactive===!1||a.spatialKind!=="render-hit-test"||o.has(a.geom))continue;const u=t(a.geom,r.type);u===null||!u.hitTest||!l.isOverlayHosted(u)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"CONFLICTING_RENDER_HIT_TEST",message:`Geom '${a.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:"Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."}))}return d}function Re(e,t){const r=new Set,s=[];for(const o of e.layers)o.interactive!==!1&&(o.spatialKind!=="render-hit-test"||r.has(o.geom)||t.hasCapability(o.geom)||(r.add(o.geom),s.push({kind:"user-input",severity:"warning",code:"MISSING_ANCHOR_CAPABILITY",message:`Geom '${o.geom}' declares no \`resolveAnchorPosition\`; its observations cannot be annotated, so the editor overlay paints no creation trigger on them.`,context:{requested:o.geom,kind:"geom-renderer"},suggestion:"Implement `resolveAnchorPosition(observation, context)` on the geom, returning the normalised panel position an annotation on that observation belongs at."})));return s}function qe(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s){if(a.interactive===!1||a.spatialKind==="render-hit-test"||o.has(a.geom))continue;const u=t(a.geom,r.type);u===null||!l.isOverlayHosted(u)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"OVERLAY_REQUIRES_RENDER_HIT_TEST",message:`Geom '${a.geom}' declares an overlay render but its layer's spatialKind is '${a.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:"Have the geom's manifest yield spatialKind 'render-hit-test' so the compiled layer carries the `byKey` index the overlay's `pushHover` resolves against."}))}return d}var Ge=e=>(0,B.createStore)(t=>({compiled:e,setCompiled:r=>t(s=>s.compiled===r?s:{compiled:r})})),ke=({input:e,data:t,customPalettes:r,colorScheme:s,plugins:o,resolveRenderer:d,anchorResolver:a,onChange:u,onError:m,onWarnings:v})=>{const x=l.useLatestRef(u),j=l.useLatestRef(m),q=l.useLatestRef(v),[{session:f,compileBus:h}]=(0,c.useState)(()=>{const n=(0,p.createCompiler)({plugins:o});return{session:new p.GraphCompilationSession(n),compileBus:pe(n)}}),[g]=(0,c.useState)(()=>be(o??[])),S=(0,c.useRef)(null),[k]=(0,c.useState)(Ne),T=(0,c.useRef)(null),b=(0,c.useCallback)(n=>g.errors.length===0?n:[...g.errors,...n??[]],[g]),_=(0,c.useCallback)(n=>{if(!n.ok)return n.errors;if(T.current)T.current.getState().setCompiled(n.compiled);else{const y=Ge(n.compiled);y.subscribe(k.notify),T.current=y,k.notify()}return null},[k]),[I,D]=(0,c.useState)(()=>{const n=f.compile({input:e,data:t,customPalettes:r,colorScheme:s});return S.current=n,b(_(n))}),G=(0,c.useCallback)(n=>n.ok?[...n.warnings,...Ee(n.compiled,d),...Ce(n.compiled,d),...xe(n.compiled),...Te(n.compiled,d),...qe(n.compiled,d),...Re(n.compiled,a)]:n.warnings,[d,a]),E=(0,c.useCallback)(n=>{n.length!==0&&(l.logDiagnostics(n),j.current?.(n))},[j]),R=(0,c.useCallback)(n=>{n.length!==0&&(l.logDiagnostics(n),q.current?.(n))},[q]);(0,c.useEffect)(()=>{const n=S.current;n&&(E([...g.errors,...n.ok?[]:n.errors]),R([...g.warnings,...G(n)]),n.ok&&h.emit({kind:"init"}))},[h,E,R,g,G]),(0,c.useEffect)(()=>{const n=f.update({input:e,data:t,customPalettes:r,colorScheme:s});if(!n)return;n.sealedInput&&x.current?.(n.sealedInput);const y=_(n.result);D(b(y)),y&&E(y),R(G(n.result)),y||h.emit({kind:n.inputChanged?"input":"data"})},[e,t,r,s,f,h,_,E,R,b,G,x]);const N=(0,c.useCallback)(n=>{D(y=>y===null?y:b(null)),R(G(n))},[b,R,G]),w=(0,c.useCallback)(n=>{n.compiled&&T.current?.getState().setCompiled(n.compiled),n.result&&N(n.result),n.command&&h.emit({kind:"command",command:n.command}),n.input&&x.current?.(n.input),n.errors&&E([...n.errors])},[N,h,x,E]),C=(0,c.useCallback)(n=>{for(const y of n)w(y);return n.some(y=>!!y.compiled)},[w]),M=(0,c.useCallback)((n,y)=>{C(f.applyCommand(n,y))},[f,C]),te=(0,c.useCallback)(()=>{C(f.seal())},[f,C]),K=(0,c.useCallback)(()=>C(f.undo()),[f,C]),O=(0,c.useCallback)(()=>C(f.redo()),[f,C]),re=(0,c.useMemo)(()=>({stack:f.history,undo:K,redo:O}),[f,K,O]),se=(0,c.useCallback)(()=>T.current?.getState().compiled??null,[]);return{store:T.current,dispatch:M,seal:te,history:re,subscribe:k.subscribe,getCompiled:se,compileBus:h,compileErrors:I}},Ne=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify:()=>e.forEach(t=>t())}},je={},J=({data:e,input:t,plugins:r=[],formattingLocale:s,handleRef:o,onChange:d,onError:a,onWarnings:u,customPalettes:m,colorScheme:v="light",themeOverrides:x=je,children:j})=>{const[q]=(0,c.useState)(()=>l.createGeomRendererResolver(r.filter(X))),f=(0,c.useId)(),[h]=(0,c.useState)(()=>(0,p.createAnchorResolver)(r)),[g]=(0,c.useState)(()=>me()),{store:S,dispatch:k,seal:T,history:b,subscribe:_,getCompiled:I,compileBus:D,compileErrors:G}=ke({input:t,data:e,customPalettes:m,colorScheme:v,plugins:r,resolveRenderer:q,anchorResolver:h,onChange:d,onError:a,onWarnings:u});(0,c.useEffect)(()=>{if(S)return S.subscribe((N,w)=>{if(N.compiled.spec===w.compiled.spec)return;const{selection:C,setSelection:M}=g.getState();C.length!==0&&M(Q(C,N.compiled.spec))})},[S,g]);const E=(0,c.useMemo)(()=>({dispatch:k,seal:T}),[k,T]);(0,c.useImperativeHandle)(o,()=>({commands:E,undo:b.undo,redo:b.redo,subscribe:_,getCompiled:I,getSelection:()=>g.getState().selection,setSelection:N=>g.getState().setSelection(N),subscribeSelection:g.subscribe}),[E,b,_,I,g]);const R=(0,c.useMemo)(()=>S?{chartId:f,store:S,selectionStore:g,commands:E,history:b,formattingLocale:s,compileBus:D,colorScheme:v,themeOverrides:x,anchorResolver:h}:null,[f,S,g,E,b,s,D,v,x,h]);return(0,i.jsx)(z,{forcedErrors:G,onError:a,resetKeys:[t,e],children:R?(0,i.jsx)(l.GraphContext.Provider,{value:R,children:(0,i.jsx)(l.GeomRendererResolverProvider,{value:q,children:j})}):null})};function _e(e){const t=(0,p.createGraphyBuilder)(e);return{...t,GraphProvider:s=>(0,i.jsx)(J,{...s,plugins:t.plugins})}}var De=({children:e,...t})=>(0,i.jsx)("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",pointerEvents:"none",...t,children:e}),Ie=({box:e,children:t})=>(0,i.jsx)("svg",{x:(0,p.toPercent)(e.x0),y:(0,p.toPercent)(e.y0),width:(0,p.toPercent)(e.x1-e.x0),height:(0,p.toPercent)(e.y1-e.y0),overflow:"hidden",pointerEvents:"none",children:t}),we="drqe3u0",He="drqe3u1",Me="drqe3u2",Pe="drqe3u3",H="drqe3u4",$e="drqe3u5",Le="drqe3u6",Be="drqe3u7",P="drqe3u8",Ke="drqe3u9",Oe="drqe3ua";var Ae="drqe3uc",Ue="drqe3ud",Ye="drqe3ue",Fe="drqe3uf";var Ve="drqe3uh",We="drqe3ui",F={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},V={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},Z={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"},ze=({width:e=380,style:t,className:r}={})=>{const{compileBus:s}=l.useGraphContext(),[o]=(0,c.useState)(()=>fe()),[d,a]=(0,c.useState)(!1),[u,m]=(0,c.useState)(p.isCompilerCachingEnabled);(0,c.useEffect)(()=>{const{recordCompile:h}=o.getState(),g=s.getLastTrigger(),S=s.getLastCompile();return g&&S&&h(g,S),s.subscribe(h)},[o,s]);const v=(0,A.useStore)(o,h=>h.lastCompile),x=(0,A.useStore)(o,h=>h.history),j=s.getCacheStats(),q=v===null&&x.length===0,f=()=>{m(h=>{const g=!h;return(0,p.setCompilerCachingEnabled)(g),g})};return(0,i.jsxs)("div",{className:(0,$.default)(Oe,r),style:{width:e,...t},children:[(0,i.jsxs)("div",{className:we,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:He,children:"compile cache"}),(0,i.jsx)("div",{className:Ye,children:q?"production: stats disabled":v?`last: ${v.label} · ${ee(v.durationMs)}`:"awaiting first compile…"})]}),(0,i.jsx)("button",{type:"button",onClick:()=>a(h=>!h),className:Fe,children:d?"▾":"▴"})]}),!d&&(0,i.jsxs)("div",{className:"drqe3ub",children:[(0,i.jsxs)("button",{type:"button",onClick:f,className:u?F.enabled:F.disabled,"aria-pressed":u,children:["cache ",u?"enabled":"disabled"]}),(0,i.jsx)("span",{className:"drqe3ug",children:"next compile reflects this toggle"})]}),!d&&!q&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xe,{delta:v?.stages,cumulative:j}),(0,i.jsx)(Qe,{entries:x})]})]})},Xe=({delta:e,cumulative:t})=>(0,i.jsxs)("table",{className:Me,children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:Ve,children:[(0,i.jsx)("th",{className:Pe,children:"stage"}),(0,i.jsx)("th",{className:H,children:"Δ miss"}),(0,i.jsx)("th",{className:H,children:"Δ hit"}),(0,i.jsx)("th",{className:H,children:"total miss"}),(0,i.jsx)("th",{className:H,children:"total hit"})]})}),(0,i.jsx)("tbody",{children:p.COMPILER_STAGE_KEYS.map(r=>{const s=e?.[r],o=Je(s);return(0,i.jsxs)("tr",{className:Ae,children:[(0,i.jsxs)("td",{className:$e,children:[(0,i.jsx)("span",{className:Z[o],"aria-hidden":!0})," ",r]}),(0,i.jsx)("td",{className:o==="ran"?V.ran:V.dim,children:s?.misses??0}),(0,i.jsx)("td",{className:P,children:s?.hits??0}),(0,i.jsx)("td",{className:P,children:t[r].misses}),(0,i.jsx)("td",{className:P,children:t[r].hits})]},r)})})]}),Qe=({entries:e})=>e.length===0?null:(0,i.jsxs)("div",{className:Ue,children:[(0,i.jsx)("div",{className:We,children:"recent compiles"}),e.map(t=>{const r=Ze(t.stages,d=>d.misses>0),s=p.COMPILER_STAGE_KEYS.length,o=r===0?"cached":"ran";return(0,i.jsxs)("div",{className:Le,children:[(0,i.jsx)("span",{className:Z[o],"aria-hidden":!0}),(0,i.jsx)("span",{className:Be,title:t.label,children:t.label}),(0,i.jsxs)("span",{className:Ke,children:[r,"/",s," ran · ",ee(t.durationMs)]})]},t.id)})]}),Je=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",Ze=(e,t)=>{let r=0;for(const s of p.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},ee=e=>e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,et=()=>{const{history:e}=l.useGraphContext(),{stack:t,undo:r,redo:s}=e,o=(0,c.useCallback)(u=>t.subscribe(u),[t]),d=(0,c.useCallback)(()=>t.getSnapshot(),[t]),a=(0,c.useSyncExternalStore)(o,d,d);return(0,c.useMemo)(()=>({...a,undo:r,redo:s}),[a,r,s])},tt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),rt=(e,t={})=>{const{target:r,enabled:s=!0}=t;(0,c.useEffect)(()=>{const o=st(r);if(!s||!o)return;const d=a=>{if(!nt(a)||a.defaultPrevented||ot(a.target))return;const u=l.resolveHistoryStep(a);if(!u)return;const m=e.current;m&&(u==="undo"?m.undo():m.redo())&&a.preventDefault()};return o.addEventListener("keydown",d),()=>o.removeEventListener("keydown",d)},[e,r,s])},st=e=>e===void 0?window:e!==null&&"current"in e?e.current:e,nt=e=>"key"in e,ot=e=>e instanceof HTMLInputElement?!tt.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA":!1;exports.BrandMark=l.BrandMark;exports.CanvasTextMeasurer=l.CanvasTextMeasurer;exports.DefaultFooter=l.DefaultFooter;exports.DefaultGrid=l.DefaultGrid;exports.DefaultHeader=l.DefaultHeader;exports.DefaultSwatch=l.DefaultSwatch;exports.DefaultTooltip=l.DefaultTooltip;exports.DevToolsPanel=ze;exports.GraphErrorBoundary=z;exports.GraphErrorPanel=L;exports.GraphProvider=J;exports.GraphRenderer=l.GraphRenderer;exports.HoverProvider=l.HoverProvider;exports.TextMeasurerProvider=l.TextMeasurerProvider;exports.ThemeProvider=l.ThemeProvider;exports.UnitBoxSvg=Ie;exports.UnitSpaceSvg=De;exports.createGraphyKit=_e;exports.darkTheme=l.darkTheme;exports.defineGeomRenderer=l.defineGeomRenderer;exports.lightTheme=l.lightTheme;exports.lightenCss=l.lightenCss;exports.pruneSelection=Q;exports.resolveBrandMarkVisual=l.resolveBrandMarkVisual;exports.useCompiledSelector=l.useCompiledSelector;exports.useElementScreenRect=l.useElementScreenRect;exports.useGeomHitTest=l.useGeomHitTest;exports.useGeomHover=l.useGeomHover;exports.useGraphCommands=l.useGraphCommands;exports.useGraphHandle=l.useGraphHandle;exports.useGraphHistory=et;exports.useGraphHistoryShortcuts=rt;exports.useGraphSelection=l.useGraphSelection;exports.useHandleCompiled=l.useHandleCompiled;exports.useHoverState=l.useHoverState;exports.useStyleReaders=l.useStyleReaders;exports.useTextMeasurer=l.useTextMeasurer;exports.vars=W.vars;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const l=require("./history-chords-D__p4inW.cjs"),W=require("./dev.utils-MDtVKEi4.cjs");let f=require("@graphysdk/viz-engine"),c=require("react"),i=require("react/jsx-runtime"),O=require("zustand"),L=require("zustand/vanilla"),P=require("clsx");P=l.__toESM(P,1);var ne="_1a5iqpb0",oe="_1a5iqpb1";var ie="_1a5iqpb3",ae="_1a5iqpb4",le="_1a5iqpb5";var $=({errors:e})=>{const[t,...r]=e;return(0,i.jsxs)("div",{role:"alert",className:ne,children:[(0,i.jsx)("strong",{className:oe,children:"This chart could not be rendered."}),t&&(0,i.jsx)(A,{diagnostic:t}),r.length>0&&(0,i.jsx)("ul",{className:"_1a5iqpb2",children:r.map((s,o)=>(0,i.jsx)("li",{children:(0,i.jsx)(A,{diagnostic:s})},`${s.code}-${o}`))})]})},A=({diagnostic:e})=>(0,i.jsxs)("div",{className:ie,children:[(0,i.jsx)("span",{className:ae,children:e.code}),(0,i.jsx)("p",{className:le,children:e.message}),e.suggestion&&(0,i.jsx)("p",{className:"_1a5iqpb6",children:e.suggestion})]});function ce(e=[],t=[]){return e.length===t.length&&e.every((r,s)=>Object.is(r,t[s]))}var V=class extends c.Component{constructor(...e){super(...e),this.state={caughtDiagnostic:null}}static getDerivedStateFromError(e){return{caughtDiagnostic:(0,f.buildDiagnostic)(e)}}componentDidCatch(e,t){const r=(0,f.buildDiagnostic)(e);l.logDiagnostics([r]),this.props.onError?.([r]),console.error("Chart render component stack:",t.componentStack)}componentDidUpdate(e){this.state.caughtDiagnostic&&!ce(e.resetKeys,this.props.resetKeys)&&this.setState({caughtDiagnostic:null})}render(){const{caughtDiagnostic:e}=this.state;if(e)return(0,i.jsx)($,{errors:[e]});const{forcedErrors:t,children:r}=this.props;return t&&t.length>0?(0,i.jsx)($,{errors:t}):r}},z=e=>typeof e=="object"&&"geom"in e&&"render"in e,de=e=>{const t=(0,f.resolveDefinition)(e);return t instanceof f.Geom?t:null},X=(e,t)=>{const r=e.filter(s=>ue(s,t));return r.length===e.length?e:r},ue=(e,t)=>e.kind!=="annotation"?!0:(0,f.findAnnotation)(t.annotations,e.id)!==null,U=[],me=()=>(0,L.createStore)(e=>({selection:U,setSelection:t=>e(r=>he(r.selection,t)?r:{selection:t}),clearSelection:()=>e(t=>t.selection.length===0?t:{selection:U})})),he=(e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,s)=>{const o=t[s];return o!==void 0&&(0,f.areEditTargetsEqual)(r,o)}),ge=5,pe=e=>{if(!W.IS_DEV)return{emit:()=>{},subscribe:()=>ve,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let r=null;return{emit:s=>{const o=e.getLastCompile();if(o){r=s;for(const d of t)d(s,o)}},subscribe:s=>(t.add(s),()=>{t.delete(s)}),getLastTrigger:()=>r,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},fe=()=>(0,L.createStore)(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,r)=>e(s=>{if(s.lastSnapshot===r)return s;const o={id:s.nextId,label:ye(t),stages:r.stages,durationMs:r.durationMs};return{lastCompile:o,history:Se(s.history,o,ge),nextId:s.nextId+1,lastSnapshot:r}})})),ve=()=>{},ye=e=>{switch(e.kind){case"init":return"init";case"input":return"input change";case"data":return"data change";case"command":return e.command.metadata.description}},Se=(e,t,r)=>{const s=e.length>=r?e.length-(r-1):0;return[...e.slice(s),t]};function be(e){const t=e.filter(z),r=new Set([...Object.keys(l.BUILT_IN_GEOM_RENDERERS),...t.map(u=>u.geom)]),s=[],o=new Set;for(const u of e){const h=de(u);h===null||r.has(h.type)||o.has(h.type)||(o.add(h.type),s.push({kind:"user-input",severity:"error",code:"MISSING_GEOM_RENDERER",message:`Custom geom '${h.type}' is registered but has no renderer.`,context:{requested:h.type,kind:"geom-renderer"},suggestion:`Add a render half for it: \`defineGeomRenderer(${h.type}Geom, { coord, render })\`, then include it in \`plugins\`.`}))}const d=new Map;for(const u of t){if("definition"in u)continue;const h=`${u.geom}|${u.coord}`,v=d.get(h);v?v.count+=1:d.set(h,{geom:u.geom,coord:u.coord,count:1})}const a=[];for(const{geom:u,coord:h,count:v}of d.values())v<2||a.push({kind:"user-input",severity:"warning",code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple render-only overrides register ('${u}', '${h}') (${v} entries); the last in the array wins.`,context:{requested:`${u}@${h}`,kind:"geom-renderer"},suggestion:`Keep a single render-only override for ('${u}', '${h}').`});return{errors:s,warnings:a}}function Ee(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s)t(a.geom,r.type)!==null||o.has(a.geom)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_GEOM_RENDERER",message:`No renderer for geom '${a.geom}' under ${r.type} coords; the layer is not painted.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:`Register a renderer for ('${a.geom}', '${r.type}') via \`defineGeomRenderer\`.`}));return d}function Ce(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s){if(a.interactive===!1||a.spatialKind!=="render-hit-test"||o.has(a.geom))continue;const u=t(a.geom,r.type);u===null||u.hitTest||l.isOverlayHosted(u)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_RENDER_HIT_TEST",message:`Geom '${a.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:`Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${a.geom}', '${r.type}').`}))}return d}function xe(e){const t=new Set,r=[];for(const s of e.layers){const o=s.identityKey;s.interactive!==!1&&(s.spatialKind!=="render-hit-test"||typeof o!="object"||t.has(s.geom)||s.data.hasVariable(o.variable)||(t.add(s.geom),r.push({kind:"user-input",severity:"warning",code:"RENDER_HIT_TEST_IDENTITY",message:`Geom '${s.geom}' keys its identity on '${o.variable}', a column its compile output does not emit; its hover lookup is empty.`,context:{requested:s.geom,kind:"geom-renderer"},suggestion:`Emit the '${o.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`})))}return r}function Te(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s){if(a.interactive===!1||a.spatialKind!=="render-hit-test"||o.has(a.geom))continue;const u=t(a.geom,r.type);u===null||!u.hitTest||!l.isOverlayHosted(u)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"CONFLICTING_RENDER_HIT_TEST",message:`Geom '${a.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:"Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."}))}return d}function Re(e,t){const r=new Set,s=[];for(const o of e.layers)o.interactive!==!1&&(o.spatialKind!=="render-hit-test"||r.has(o.geom)||t.hasCapability(o.geom)||(r.add(o.geom),s.push({kind:"user-input",severity:"warning",code:"MISSING_ANCHOR_CAPABILITY",message:`Geom '${o.geom}' declares no \`resolveAnchorPosition\`; its observations cannot be annotated, so the editor overlay paints no creation trigger on them.`,context:{requested:o.geom,kind:"geom-renderer"},suggestion:"Implement `resolveAnchorPosition(observation, context)` on the geom, returning the normalised panel position an annotation on that observation belongs at."})));return s}function qe(e,t){const{coordSystem:r,layers:s}=e,o=new Set,d=[];for(const a of s){if(a.interactive===!1||a.spatialKind==="render-hit-test"||o.has(a.geom))continue;const u=t(a.geom,r.type);u===null||!l.isOverlayHosted(u)||(o.add(a.geom),d.push({kind:"user-input",severity:"warning",code:"OVERLAY_REQUIRES_RENDER_HIT_TEST",message:`Geom '${a.geom}' declares an overlay render but its layer's spatialKind is '${a.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,context:{requested:a.geom,kind:"geom-renderer"},suggestion:"Have the geom's manifest yield spatialKind 'render-hit-test' so the compiled layer carries the `byKey` index the overlay's `pushHover` resolves against."}))}return d}var Ge=e=>(0,L.createStore)(t=>({compiled:e,setCompiled:r=>t(s=>s.compiled===r?s:{compiled:r})})),ke=({input:e,data:t,customPalettes:r,colorScheme:s,plugins:o,resolveRenderer:d,anchorResolver:a,onChange:u,onError:h,onWarnings:v})=>{const x=l.useLatestRef(u),k=l.useLatestRef(h),R=l.useLatestRef(v),[{session:g,compileBus:m}]=(0,c.useState)(()=>{const n=(0,f.createCompiler)({plugins:o});return{session:new f.GraphCompilationSession(n),compileBus:pe(n)}}),[p]=(0,c.useState)(()=>be(o??[])),q=(0,c.useRef)(null),[N]=(0,c.useState)(Ne),S=(0,c.useRef)(null),G=(0,c.useCallback)(n=>p.errors.length===0?n:[...p.errors,...n??[]],[p]),j=(0,c.useCallback)(n=>{if(!n.ok)return n.errors;if(S.current)S.current.getState().setCompiled(n.compiled);else{const y=Ge(n.compiled);y.subscribe(N.notify),S.current=y,N.notify()}return null},[N]),[D,w]=(0,c.useState)(()=>{const n=g.compile({input:e,data:t,customPalettes:r,colorScheme:s});return q.current=n,G(j(n))}),b=(0,c.useCallback)(n=>n.ok?[...n.warnings,...Ee(n.compiled,d),...Ce(n.compiled,d),...xe(n.compiled),...Te(n.compiled,d),...qe(n.compiled,d),...Re(n.compiled,a)]:n.warnings,[d,a]),T=(0,c.useCallback)(n=>{n.length!==0&&(l.logDiagnostics(n),k.current?.(n))},[k]),E=(0,c.useCallback)(n=>{n.length!==0&&(l.logDiagnostics(n),R.current?.(n))},[R]);(0,c.useEffect)(()=>{const n=q.current;n&&(T([...p.errors,...n.ok?[]:n.errors]),E([...p.warnings,...b(n)]),n.ok&&m.emit({kind:"init"}))},[m,T,E,p,b]),(0,c.useEffect)(()=>{const n=g.update({input:e,data:t,customPalettes:r,colorScheme:s});if(!n)return;n.sealedInput&&x.current?.(n.sealedInput);const y=j(n.result);w(G(y)),y&&T(y),E(b(n.result)),y||m.emit({kind:n.inputChanged?"input":"data"})},[e,t,r,s,g,m,j,T,E,G,b,x]);const I=(0,c.useCallback)(n=>{w(y=>y===null?y:G(null)),E(b(n))},[G,E,b]),_=(0,c.useCallback)(n=>{n.compiled&&S.current?.getState().setCompiled(n.compiled),n.result&&I(n.result),n.command&&m.emit({kind:"command",command:n.command}),n.input&&x.current?.(n.input),n.errors&&T([...n.errors])},[I,m,x,T]),C=(0,c.useCallback)(n=>{for(const y of n)_(y);return n.some(y=>!!y.compiled)},[_]),ee=(0,c.useCallback)((n,y)=>{C(g.applyCommand(n,y))},[g,C]),te=(0,c.useCallback)(()=>{C(g.seal())},[g,C]),B=(0,c.useCallback)(()=>C(g.undo()),[g,C]),K=(0,c.useCallback)(()=>C(g.redo()),[g,C]),re=(0,c.useMemo)(()=>({stack:g.history,undo:B,redo:K}),[g,B,K]),se=(0,c.useCallback)(()=>S.current?.getState().compiled??null,[]);return{store:S.current,dispatch:ee,seal:te,history:re,subscribe:N.subscribe,getCompiled:se,compileBus:m,compileErrors:D}},Ne=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify:()=>e.forEach(t=>t())}},Q=({data:e,input:t,plugins:r=[],formattingLocale:s,handleRef:o,onChange:d,onError:a,onWarnings:u,customPalettes:h,colorScheme:v="light",children:x})=>{const[k]=(0,c.useState)(()=>l.createGeomRendererResolver(r.filter(z))),R=(0,c.useId)(),[g]=(0,c.useState)(()=>(0,f.createAnchorResolver)(r)),[m]=(0,c.useState)(()=>me()),{store:p,dispatch:q,seal:N,history:S,subscribe:G,getCompiled:j,compileBus:D,compileErrors:w}=ke({input:t,data:e,customPalettes:h,colorScheme:v,plugins:r,resolveRenderer:k,anchorResolver:g,onChange:d,onError:a,onWarnings:u});(0,c.useEffect)(()=>{if(p)return p.subscribe((E,I)=>{if(E.compiled.spec===I.compiled.spec)return;const{selection:_,setSelection:C}=m.getState();_.length!==0&&C(X(_,E.compiled.spec))})},[p,m]);const b=(0,c.useMemo)(()=>({dispatch:q,seal:N}),[q,N]);(0,c.useImperativeHandle)(o,()=>({commands:b,undo:S.undo,redo:S.redo,subscribe:G,getCompiled:j,getSelection:()=>m.getState().selection,setSelection:E=>m.getState().setSelection(E),subscribeSelection:m.subscribe}),[b,S,G,j,m]);const T=(0,c.useMemo)(()=>p?{chartId:R,store:p,selectionStore:m,commands:b,history:S,formattingLocale:s,compileBus:D,colorScheme:v,anchorResolver:g}:null,[R,p,m,b,S,s,D,v,g]);return(0,i.jsx)(V,{forcedErrors:w,onError:a,resetKeys:[t,e],children:T?(0,i.jsx)(l.GraphContext.Provider,{value:T,children:(0,i.jsx)(l.GeomRendererResolverProvider,{value:k,children:x})}):null})};function je(e){const t=(0,f.createGraphyBuilder)(e);return{...t,GraphProvider:s=>(0,i.jsx)(Q,{...s,plugins:t.plugins})}}var _e=({children:e,...t})=>(0,i.jsx)("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",pointerEvents:"none",...t,children:e}),De=({box:e,children:t})=>(0,i.jsx)("svg",{x:(0,f.toPercent)(e.x0),y:(0,f.toPercent)(e.y0),width:(0,f.toPercent)(e.x1-e.x0),height:(0,f.toPercent)(e.y1-e.y0),overflow:"hidden",pointerEvents:"none",children:t}),we="drqe3u0",Ie="drqe3u1",He="drqe3u2",Me="drqe3u3",H="drqe3u4",Pe="drqe3u5",$e="drqe3u6",Le="drqe3u7",M="drqe3u8",Be="drqe3u9",Ke="drqe3ua";var Oe="drqe3uc",Ae="drqe3ud",Ue="drqe3ue",Ye="drqe3uf";var Fe="drqe3uh",We="drqe3ui",Y={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},F={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},J={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"},Ve=({width:e=380,style:t,className:r}={})=>{const{compileBus:s}=l.useGraphContext(),[o]=(0,c.useState)(()=>fe()),[d,a]=(0,c.useState)(!1),[u,h]=(0,c.useState)(f.isCompilerCachingEnabled);(0,c.useEffect)(()=>{const{recordCompile:m}=o.getState(),p=s.getLastTrigger(),q=s.getLastCompile();return p&&q&&m(p,q),s.subscribe(m)},[o,s]);const v=(0,O.useStore)(o,m=>m.lastCompile),x=(0,O.useStore)(o,m=>m.history),k=s.getCacheStats(),R=v===null&&x.length===0,g=()=>{h(m=>{const p=!m;return(0,f.setCompilerCachingEnabled)(p),p})};return(0,i.jsxs)("div",{className:(0,P.default)(Ke,r),style:{width:e,...t},children:[(0,i.jsxs)("div",{className:we,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:Ie,children:"compile cache"}),(0,i.jsx)("div",{className:Ue,children:R?"production: stats disabled":v?`last: ${v.label} · ${Z(v.durationMs)}`:"awaiting first compile…"})]}),(0,i.jsx)("button",{type:"button",onClick:()=>a(m=>!m),className:Ye,children:d?"▾":"▴"})]}),!d&&(0,i.jsxs)("div",{className:"drqe3ub",children:[(0,i.jsxs)("button",{type:"button",onClick:g,className:u?Y.enabled:Y.disabled,"aria-pressed":u,children:["cache ",u?"enabled":"disabled"]}),(0,i.jsx)("span",{className:"drqe3ug",children:"next compile reflects this toggle"})]}),!d&&!R&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ze,{delta:v?.stages,cumulative:k}),(0,i.jsx)(Xe,{entries:x})]})]})},ze=({delta:e,cumulative:t})=>(0,i.jsxs)("table",{className:He,children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:Fe,children:[(0,i.jsx)("th",{className:Me,children:"stage"}),(0,i.jsx)("th",{className:H,children:"Δ miss"}),(0,i.jsx)("th",{className:H,children:"Δ hit"}),(0,i.jsx)("th",{className:H,children:"total miss"}),(0,i.jsx)("th",{className:H,children:"total hit"})]})}),(0,i.jsx)("tbody",{children:f.COMPILER_STAGE_KEYS.map(r=>{const s=e?.[r],o=Qe(s);return(0,i.jsxs)("tr",{className:Oe,children:[(0,i.jsxs)("td",{className:Pe,children:[(0,i.jsx)("span",{className:J[o],"aria-hidden":!0})," ",r]}),(0,i.jsx)("td",{className:o==="ran"?F.ran:F.dim,children:s?.misses??0}),(0,i.jsx)("td",{className:M,children:s?.hits??0}),(0,i.jsx)("td",{className:M,children:t[r].misses}),(0,i.jsx)("td",{className:M,children:t[r].hits})]},r)})})]}),Xe=({entries:e})=>e.length===0?null:(0,i.jsxs)("div",{className:Ae,children:[(0,i.jsx)("div",{className:We,children:"recent compiles"}),e.map(t=>{const r=Je(t.stages,d=>d.misses>0),s=f.COMPILER_STAGE_KEYS.length,o=r===0?"cached":"ran";return(0,i.jsxs)("div",{className:$e,children:[(0,i.jsx)("span",{className:J[o],"aria-hidden":!0}),(0,i.jsx)("span",{className:Le,title:t.label,children:t.label}),(0,i.jsxs)("span",{className:Be,children:[r,"/",s," ran · ",Z(t.durationMs)]})]},t.id)})]}),Qe=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",Je=(e,t)=>{let r=0;for(const s of f.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},Z=e=>e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,Ze=()=>{const{history:e}=l.useGraphContext(),{stack:t,undo:r,redo:s}=e,o=(0,c.useCallback)(u=>t.subscribe(u),[t]),d=(0,c.useCallback)(()=>t.getSnapshot(),[t]),a=(0,c.useSyncExternalStore)(o,d,d);return(0,c.useMemo)(()=>({...a,undo:r,redo:s}),[a,r,s])},et=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),tt=(e,t={})=>{const{target:r,enabled:s=!0}=t;(0,c.useEffect)(()=>{const o=rt(r);if(!s||!o)return;const d=a=>{if(!st(a)||a.defaultPrevented||nt(a.target))return;const u=l.resolveHistoryStep(a);if(!u)return;const h=e.current;h&&(u==="undo"?h.undo():h.redo())&&a.preventDefault()};return o.addEventListener("keydown",d),()=>o.removeEventListener("keydown",d)},[e,r,s])},rt=e=>e===void 0?window:e!==null&&"current"in e?e.current:e,st=e=>"key"in e,nt=e=>e instanceof HTMLInputElement?!et.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA":!1;exports.BrandMark=l.BrandMark;exports.CanvasTextMeasurer=l.CanvasTextMeasurer;exports.DefaultFooter=l.DefaultFooter;exports.DefaultGrid=l.DefaultGrid;exports.DefaultHeader=l.DefaultHeader;exports.DefaultSwatch=l.DefaultSwatch;exports.DefaultTooltip=l.DefaultTooltip;exports.DevToolsPanel=Ve;exports.GraphErrorBoundary=V;exports.GraphErrorPanel=$;exports.GraphProvider=Q;exports.GraphRenderer=l.GraphRenderer;exports.HoverProvider=l.HoverProvider;exports.TextMeasurerProvider=l.TextMeasurerProvider;exports.ThemeProvider=l.ThemeProvider;exports.UnitBoxSvg=De;exports.UnitSpaceSvg=_e;exports.createGraphyKit=je;exports.darkTheme=l.darkTheme;exports.defineGeomRenderer=l.defineGeomRenderer;exports.lightTheme=l.lightTheme;exports.lightenCss=l.lightenCss;exports.pruneSelection=X;exports.resolveBrandMarkVisual=l.resolveBrandMarkVisual;exports.useCompiledSelector=l.useCompiledSelector;exports.useElementScreenRect=l.useElementScreenRect;exports.useGeomHitTest=l.useGeomHitTest;exports.useGeomHover=l.useGeomHover;exports.useGraphCommands=l.useGraphCommands;exports.useGraphHandle=l.useGraphHandle;exports.useGraphHistory=Ze;exports.useGraphHistoryShortcuts=tt;exports.useGraphSelection=l.useGraphSelection;exports.useHandleCompiled=l.useHandleCompiled;exports.useHoverState=l.useHoverState;exports.useStyleReaders=l.useStyleReaders;exports.useTextMeasurer=l.useTextMeasurer;exports.vars=W.vars;
package/dist/index.d.ts CHANGED
@@ -589,7 +589,7 @@ export declare type GraphMode = 'readonly' | 'editable';
589
589
  * render-throw from a renderer component — converge on a single {@link GraphErrorBoundary} that shows
590
590
  * the error in place, so a broken chart never blanks the page.
591
591
  */
592
- export declare const GraphProvider: ({ data, input, plugins, formattingLocale, handleRef, onChange, onError, onWarnings, customPalettes, colorScheme, themeOverrides, children, }: GraphProviderProps) => JSX.Element;
592
+ export declare const GraphProvider: ({ data, input, plugins, formattingLocale, handleRef, onChange, onError, onWarnings, customPalettes, colorScheme, children, }: GraphProviderProps) => JSX.Element;
593
593
 
594
594
  /** Props for {@link GraphProvider}: the data and spec input to compile, plus color scheme, locale and plugin wiring. */
595
595
  export declare interface GraphProviderProps {
@@ -614,7 +614,6 @@ export declare interface GraphProviderProps {
614
614
  /** Fires with any warnings a successful compile produced. */
615
615
  onWarnings?: (warnings: VizDiagnostic[]) => void;
616
616
  colorScheme?: ColorScheme;
617
- themeOverrides?: ThemeOverrides;
618
617
  customPalettes?: CustomPalettesInput;
619
618
  children: ReactNode;
620
619
  }
@@ -1057,20 +1056,18 @@ declare interface TextMeasurerProviderProps {
1057
1056
  export declare type ThemeKey = keyof ThemeValues;
1058
1057
 
1059
1058
  /**
1060
- * A partial set of token values layered over a base theme — the shape of the `themeOverrides`
1061
- * prop. Measured font tokens take a {@link FontTokenOverride}; every other token takes its CSS
1062
- * string value.
1059
+ * A partial set of token values layered over a base theme. Measured font tokens take a
1060
+ * {@link FontTokenOverride}; every other token takes its CSS string value.
1063
1061
  */
1064
1062
  export declare type ThemeOverrides = Partial<Omit<ThemeValues, MeasuredFontTokenKey>> & {
1065
1063
  [Key in MeasuredFontTokenKey]?: FontTokenOverride;
1066
1064
  };
1067
1065
 
1068
- /** Resolves the base theme plus per-graph `themeOverrides` into token values and publishes them to the subtree. */
1069
- export declare const ThemeProvider: ({ colorScheme, themeOverrides, textScale, graphBackground, graphFontFamily, headingFontFamily, children, }: ThemeProviderProps) => JSX.Element;
1066
+ /** Resolves the base theme into token values and publishes them to the subtree. */
1067
+ export declare const ThemeProvider: ({ colorScheme, textScale, graphBackground, graphFontFamily, headingFontFamily, children, }: ThemeProviderProps) => JSX.Element;
1070
1068
 
1071
1069
  declare interface ThemeProviderProps {
1072
1070
  colorScheme: ColorScheme;
1073
- themeOverrides?: ThemeOverrides;
1074
1071
  /** The chart's text scale. Omit it where there is no chart, as an editing panel does. */
1075
1072
  textScale?: number;
1076
1073
  /** The chart's resolved background. Omit it where there is no chart; the theme token then stands. */