@graphysdk/react-renderer 1.9.0-beta.1791362023266 → 1.9.0-beta.1791362672521
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/editable.cjs +1 -1
- package/dist/editable.mjs +2 -2
- package/dist/graph-config.cjs +1 -1
- package/dist/graph-config.mjs +1 -1
- package/dist/{history-chords-DFnzCXYC.cjs → history-chords-BS3S3uQm.cjs} +1 -1
- package/dist/{history-chords-BGGcz0SP.js → history-chords-CpqPOjNc.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{theme.contract.css-AyXDNf0F.js → theme.contract.css-DRIwwcHW.js} +1 -1
- package/dist/theme.contract.css-VQwFtkVc.cjs +1 -0
- package/package.json +2 -2
- package/dist/theme.contract.css +0 -1
- package/dist/theme.contract.css-DKDKSByt.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as A } from "./theme.contract.css-
|
|
1
|
+
import { n as A } from "./theme.contract.css-DRIwwcHW.js";
|
|
2
2
|
import { ANNOTATION_TOOLTIP_MARKER_GAP_PX as _i, CachedTextMeasurer as Bn, DATA_LABEL_ROLES as es, DEFAULT_GEOM_COLOR as Lr, DEFAULT_HOVER_AFFORDANCE_COLOR as Mr, DEFAULT_POINT_SIZE_PX as Je, GROUP_VARIABLES as re, HeuristicTextMeasurer as ts, HoverEngine as rs, InternalError as ns, LayoutCompiler as os, NAMED_WEIGHTS as lt, POLAR_RIM_LABEL_GAP_PX as as, POSITION_VARIABLES as dt, RESOLVED_DATA_LABEL_POSITIONS as is, RESTING_HOVER_STATE as Ft, alignUnitFractions as Ro, applyTextTransform as yt, areAnchorsEqual as ss, areEditMenuTriggersEqual as ls, areEditTargetsEqual as vt, areEndpointsComparable as Tn, arePointerRegionListsEqual as ds, arePredicatesEqual as Co, buildAverageLineSymbols as cs, buildBarRectBounds as us, buildCalloutHitRegions as hs, buildColumnKey as Or, buildDataLabelsContent as vs, buildFontString as gs, buildHeadlineItemRows as Io, buildLayerIntroPlan as fs, buildObservationsTarget as ps, buildPointSymbolInBox as ms, buildPointSymbolPath as As, buildPolarBarArcPath as He, buildSliceGroupKey as Nr, buildTooltipContent as ys, compositeColor as cr, computeArrow as xs, computeDifferenceArrow as bs, computeDirectLabelsLayout as ws, computeLetterSpacingWidth as Ss, computeLineBoxHeight as De, computePanelBorderPaths as ks, computePanelBorderSizes as Es, countLayerGeoms as Ps, createAreaPathGenerators as Fr, createDataLabelPlacementResolver as Rs, createLayerYValueFormatter as Cs, createLineFillAreaGenerator as Is, createLinePathGenerator as Hr, createPinnedNumberValueFormatter as Bs, createSegmentYReader as Ts, createStableCellKeyGenerator as Ls, createStableKeyGenerator as be, ensureReadableTextColor as Dr, findAnnotation as Ms, findLayerById as Bo, findPointerRegion as Ln, formatHeadline as Os, formatLegends as Ns, formatRuleValue as Fs, getAestheticFromScaleAestheticKey as ye, getAlpha as To, getAngleExtent as Hs, getBarRectBounds as jt, getBoundingRect as Ds, getDifferenceArrowLabelBox as Ws, getGroup as Ve, getHoverGuideLineProps as Gs, getHoverGuideRectProps as Vs, getPaintedTileRect as Wr, getPointSymbolOuterRadius as Us, getPolarHoverGuideArcProps as zs, getRadiusExtent as Lo, getShapeAnnotationStroke as Ys, getSize as js, getStackRole as Ks, getUnionExtent as Mo, getX as X, getXMax as Oo, getY as _, getYMax as Kt, isAnnotationMovable as Qs, isFullTurnSweep as Gr, isGradientPaint as No, isImagePaint as Xs, isPatternPaint as Vr, isPositionScale as Mn, isSafeUrl as Ur, orderPointerRegions as qs, paintKey as On, paintsInDonutHole as Js, pickFilters as Zs, pickReadableTextColor as Fo, placeCallouts as $s, polarToUnit as _s, positionToAngle as el, prepareAreaObservations as zr, prepareLineObservations as Yr, projectAnchorToPanel as mt, projectRegionToPanel as jr, readAnchoredObservation as Ho, readColorGroupObservation as tl, readGeomColor as Qt, readGeomEffects as q, readMainAxis as rl, removeAlpha as nl, resolveArrowAnnotationStyle as ol, resolveArrowColor as al, resolveBarBorderTreatment as xt, resolveBarCornerRadiiPx as il, resolveBarCornerRadiusPx as Kr, resolveBarPaintOrigin as sl, resolveCalloutAnnotationStyle as Ar, resolveChromeMargins as ll, resolveDataLabelStyle as dl, resolveDeferredAnchors as cl, resolveDifferenceArrowAnnotationStyle as Do, resolveDirectLabelStyle as Wo, resolveGraphPadding as ul, resolveHeadlineItemStyle as Nt, resolveHeadlineNumberStyle as Go, resolveHeadlinePlacement as hl, resolveLegendItemStyle as Xt, resolvePanelBorderStyle as Vo, resolvePolarBarCornerRadiusUnit as vl, resolveRuleLabelStyle as gl, resolveSwatchGeomPaint as Uo, resolveTooltipStyle as fl, toFontSpec as ee, toPaintColor as V, toPanelCursor as pl, toPercent as C, toStrokeDasharray as he, toViewBoxX as zo, toViewBoxY as Yo, truncateToWidth as jo, withAlpha as ml } from "@graphysdk/viz-engine";
|
|
3
3
|
import { Fragment as qt, createContext as K, memo as ve, useCallback as ce, useContext as G, useEffect as W, useId as j, useLayoutEffect as Al, useMemo as b, useRef as H, useState as U, useSyncExternalStore as yl } from "react";
|
|
4
4
|
import { Fragment as T, jsx as s, jsxs as w } from "react/jsx-runtime";
|
|
@@ -23,7 +23,7 @@ import './history-chords.css';var Nn = Object.defineProperty, El = (e, t) => {
|
|
|
23
23
|
});
|
|
24
24
|
return t || Nn(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
25
25
|
};
|
|
26
|
-
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "1.9.0-beta.
|
|
26
|
+
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "1.9.0-beta.1791362672521");
|
|
27
27
|
function Pl(e) {
|
|
28
28
|
for (const t of e) (t.severity === "error" ? console.error : console.warn)(`[graphy] ${t.code}: ${t.message}`, t);
|
|
29
29
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("./history-chords-DFnzCXYC.cjs"),pe=require("./theme.contract.css-DKDKSByt.cjs");let g=require("@graphysdk/viz-engine"),l=require("react"),o=require("react/jsx-runtime"),Y=require("zustand"),K=require("motion/react"),z=require("zustand/vanilla"),V=require("clsx");V=a.__toESM(V,1);var ve="_1a5iqpb0",fe="_1a5iqpb1";var Se="_1a5iqpb3",ye="_1a5iqpb4",be="_1a5iqpb5";var W=({errors:e})=>{const[t,...r]=e;return(0,o.jsxs)("div",{role:"alert",className:ve,children:[(0,o.jsx)("strong",{className:fe,children:"This chart could not be rendered."}),t&&(0,o.jsx)(Q,{diagnostic:t}),r.length>0&&(0,o.jsx)("ul",{className:"_1a5iqpb2",children:r.map((s,n)=>(0,o.jsx)("li",{children:(0,o.jsx)(Q,{diagnostic:s})},`${s.code}-${n}`))})]})},Q=({diagnostic:e})=>(0,o.jsxs)("div",{className:Se,children:[(0,o.jsx)("span",{className:ye,children:e.code}),(0,o.jsx)("p",{className:be,children:e.message}),e.suggestion&&(0,o.jsx)("p",{className:"_1a5iqpb6",children:e.suggestion})]});function Ee(e=[],t=[]){return e.length===t.length&&e.every((r,s)=>Object.is(r,t[s]))}var re=class extends l.Component{constructor(...e){super(...e),this.state={caughtDiagnostic:null}}static getDerivedStateFromError(e){return{caughtDiagnostic:(0,g.buildDiagnostic)(e)}}componentDidCatch(e,t){const r=(0,g.buildDiagnostic)(e);a.logDiagnostics([r]),this.props.onError?.([r]),console.error("Chart render component stack:",t.componentStack)}componentDidUpdate(e){this.state.caughtDiagnostic&&!Ee(e.resetKeys,this.props.resetKeys)&&this.setState({caughtDiagnostic:null})}render(){const{caughtDiagnostic:e}=this.state;if(e)return(0,o.jsx)(W,{errors:[e]});const{forcedErrors:t,children:r}=this.props;return t&&t.length>0?(0,o.jsx)(W,{errors:t}):r}},se={},ne=(0,l.createContext)(se),M=({shapes:e=se,children:t})=>(0,o.jsx)(ne.Provider,{value:e,children:t}),U=()=>(0,l.useContext)(ne),oe=e=>typeof e=="object"&&"geom"in e&&"render"in e,ae=e=>{const t=(0,g.resolveDefinition)(e);return t instanceof g.Geom?t:null},ie=(e,t)=>{const r=e.filter(s=>Te(s,t));return r.length===e.length?e:r},Te=(e,t)=>e.kind==="annotation"?(0,g.findAnnotation)(t.annotations,e.id)!==null:e.kind==="observations"||e.kind==="layer"&&e.layerId!==void 0?(0,g.findLayerById)(t.layers,e.layerId)!==void 0:!0,J=[],xe=()=>(0,z.createStore)(e=>({selection:J,setSelection:t=>e(r=>Ge(r.selection,t)?r:{selection:t}),clearSelection:()=>e(t=>t.selection.length===0?t:{selection:J})})),Ge=(e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,s)=>{const n=t[s];return n!==void 0&&(0,g.areEditTargetsEqual)(r,n)}),Re=process.env.NODE_ENV!=="production",Ce=5,je=e=>{if(!Re)return{emit:()=>{},subscribe:()=>De,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let r=null;return{emit:s=>{const n=e.getLastCompile();if(n){r=s;for(const u of t)u(s,n)}},subscribe:s=>(t.add(s),()=>{t.delete(s)}),getLastTrigger:()=>r,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},Ne=()=>(0,z.createStore)(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,r)=>e(s=>{if(s.lastSnapshot===r)return s;const n={id:s.nextId,label:_e(t),stages:r.stages,stageDurationsMs:r.stageDurationsMs,durationMs:r.durationMs};return{lastCompile:n,history:Pe(s.history,n,Ce),nextId:s.nextId+1,lastSnapshot:r}})})),De=()=>{},_e=e=>{switch(e.kind){case"init":return"init";case"spec":return"spec change";case"data":return"data change";case"command":return e.command.metadata.description}},Pe=(e,t,r)=>{const s=e.length>=r?e.length-(r-1):0;return[...e.slice(s),t]};function qe(e,t){let r;return e.layers.flatMap((s,n)=>a.isOverlayHosted(t(s.geom,e.coordSystem.type))?Ae(s)?(r??=(0,g.createStyleResolver)().readers(e),Oe(s,r.geom(s))?[{kind:"user-input",severity:"warning",code:"INVALID_STYLE_RULE",message:`Style 'overlay' is not supported on portal-rendered geom '${s.geom}' (layer '${s.id}'); it is ignored.`,context:{param:"overlay",layerIndex:n,requested:s.geom},suggestion:"Remove the geom overlay or use a renderer that paints inside the panel SVG."}]:[]):[]:[])}function Z(e){const t=e.filter(oe),r=new Set([...Object.keys(a.BUILT_IN_GEOM_RENDERERS),...t.map(d=>d.geom)]),s=[],n=new Set;for(const d of e){const h=ae(d);h===null||r.has(h.type)||n.has(h.type)||(n.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 u=new Map;for(const d of t){if("definition"in d)continue;const h=`${d.geom}|${d.coord}`,v=u.get(h);v?v.count+=1:u.set(h,{geom:d.geom,coord:d.coord,count:1})}const c=[];for(const{geom:d,coord:h,count:v}of u.values())v<2||c.push({kind:"user-input",severity:"warning",code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple render-only overrides register ('${d}', '${h}') (${v} entries); the last in the array wins.`,context:{requested:`${d}@${h}`,kind:"geom-renderer"},suggestion:`Keep a single render-only override for ('${d}', '${h}').`});return c.push(...$e(e)),{errors:s,warnings:c}}function Ie(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s)t(c.geom,r.type)!==null||n.has(c.geom)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"MISSING_GEOM_RENDERER",message:`No renderer for geom '${c.geom}' under ${r.type} coords; the layer is not painted.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:`Register a renderer for ('${c.geom}', '${r.type}') via \`defineGeomRenderer\`.`}));return u}function ke(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const d=t(c.geom,r.type);d===null||d.hitTest||a.isOverlayHosted(d)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"MISSING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,context:{requested:c.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 ('${c.geom}', '${r.type}').`}))}return u}function Le(e){const t=new Set,r=[];for(const s of e.layers){const n=s.identityKey;s.interactive!==!1&&(s.spatialKind!=="render-hit-test"||typeof n!="object"||t.has(s.geom)||s.data.hasVariable(n.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 '${n.variable}', a column its compile output does not emit; its hover lookup is empty.`,context:{requested:s.geom,kind:"geom-renderer"},suggestion:`Emit the '${n.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`})))}return r}function we(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const d=t(c.geom,r.type);d===null||!d.hitTest||!a.isOverlayHosted(d)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"CONFLICTING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,context:{requested:c.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 u}function Me(e,t){const r=new Set,s=[];for(const n of e.layers)n.interactive!==!1&&(n.spatialKind!=="render-hit-test"||r.has(n.geom)||t.hasCapability(n.geom)||(r.add(n.geom),s.push({kind:"user-input",severity:"warning",code:"MISSING_ANCHOR_CAPABILITY",message:`Geom '${n.geom}' declares no \`resolveAnchorPosition\`; its observations cannot be annotated, so the editor overlay paints no creation trigger on them.`,context:{requested:n.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 He(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s){if(c.interactive===!1||c.spatialKind==="render-hit-test"||n.has(c.geom))continue;const d=t(c.geom,r.type);d===null||!a.isOverlayHosted(d)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"OVERLAY_REQUIRES_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares an overlay render but its layer's spatialKind is '${c.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:"Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."}))}return u}var Ae=e=>[e.styles.defaults,e.styles.overrides].some(t=>t.some(r=>(r.declarations.overlay?.length??0)>0)),Oe=(e,t)=>{const[r]=e.data;if(r===void 0)return!1;if((t.get("overlay",r)?.length??0)>0)return!0;for(const s of e.data)if((t.get("overlay",s,"hovered")?.length??0)>0)return!0;return!1};function $e(e){const t=new Set,r=[];for(const s of e){const n=ae(s);n===null||t.has(n.type)||n.dataLabelCoordTypes.length===0||n.getDataLabelPlacements!==void 0||(t.add(n.type),r.push({kind:"user-input",severity:"warning",code:"MISSING_DATA_LABEL_PLACEMENT",message:`Geom '${n.type}' declares \`dataLabelCoordTypes\` but implements no \`getDataLabelPlacements\`; its layers paint no data labels.`,context:{requested:n.type,kind:"geom-renderer"},suggestion:"Implement `getDataLabelPlacements(context)` on the geom, or drop `dataLabelCoordTypes` so the compiler warns the author off the flag."}))}return r}var Be=e=>(0,z.createStore)(t=>({scene:e,setScene:r=>t(s=>s.scene===r?s:{scene:r})})),Ke=({spec:e,data:t,customPalettes:r,colorScheme:s,plugins:n,theme:u,resolveRenderer:c,anchorResolver:d,onSpecChange:h,onError:v,onWarnings:P})=>{const N=a.useLatestRef(h),T=a.useLatestRef(v),x=a.useLatestRef(P),[{session:m,compileBus:f}]=(0,l.useState)(()=>{const i=(0,g.createCompiler)({plugins:n,theme:u});return{session:new g.GraphCompilationSession(i),compileBus:je(i)}}),[S]=(0,l.useState)(()=>{const i=Z(n??[]),p=Z(u?.plugins??[]);return{errors:[...p.errors,...i.errors],warnings:[...p.warnings,...i.warnings]}}),_=(0,l.useRef)(null),[y]=(0,l.useState)(Ue),R=(0,l.useRef)(null),D=(0,l.useCallback)(i=>S.errors.length===0?i:[...S.errors,...i??[]],[S]),G=(0,l.useCallback)(i=>{if(!i.ok)return i.errors;if(R.current)R.current.getState().setScene(i.scene);else{const p=Be(i.scene);p.subscribe(y.notify),R.current=p,y.notify()}return null},[y]),[H,I]=(0,l.useState)(()=>{const i=m.compile({spec:e,data:t,customPalettes:r,colorScheme:s});return _.current=i,D(G(i))}),E=(0,l.useCallback)(i=>i.ok?[...i.warnings,...Ie(i.scene,c),...ke(i.scene,c),...Le(i.scene),...we(i.scene,c),...He(i.scene,c),...qe(i.scene,c),...Me(i.scene,d)]:i.warnings,[c,d]),C=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),T.current?.(i))},[T]),j=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),x.current?.(i))},[x]);(0,l.useEffect)(()=>{const i=_.current;i&&(C([...S.errors,...i.ok?[]:i.errors]),j([...S.warnings,...E(i)]),i.ok&&f.emit({kind:"init"}))},[f,C,j,S,E]),(0,l.useEffect)(()=>{const i=m.update({spec:e,data:t,customPalettes:r,colorScheme:s});if(!i)return;i.committedSpec&&N.current?.(i.committedSpec);const p=G(i.result);I(D(p)),p&&C(p),j(E(i.result)),p||f.emit({kind:i.specChanged?"spec":"data"})},[e,t,r,s,m,f,G,C,j,D,E,N]);const k=(0,l.useCallback)(i=>{I(p=>p===null?p:D(null)),j(E(i))},[D,j,E]),A=(0,l.useCallback)(i=>{i.scene&&R.current?.getState().setScene(i.scene),i.result&&k(i.result),i.command&&f.emit({kind:"command",command:i.command}),i.spec&&N.current?.(i.spec),i.errors&&C([...i.errors])},[k,f,N,C]),b=(0,l.useCallback)(i=>{for(const p of i)A(p);return i.some(p=>!!p.scene)},[A]),O=(0,l.useCallback)((i,p)=>{b(m.applyCommand(i,p))},[m,b]),q=(0,l.useCallback)(()=>{b(m.commit())},[m,b]),$=(0,l.useCallback)(()=>b(m.undo()),[m,b]),L=(0,l.useCallback)(()=>b(m.redo()),[m,b]),F=(0,l.useMemo)(()=>({stack:m.history,undo:$,redo:L}),[m,$,L]),ge=(0,l.useCallback)(()=>R.current?.getState().scene??null,[]);return{store:R.current,dispatch:O,commit:q,history:F,subscribe:y.subscribe,getScene:ge,compileBus:f,compileErrors:H}},Ue=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify:()=>e.forEach(t=>t())}},ce=({data:e,spec:t,plugins:r=[],theme:s,formattingLocale:n,handleRef:u,onSpecChange:c,onError:d,onWarnings:h,customPalettes:v,colorScheme:P="light",children:N})=>{const[T]=(0,l.useState)(()=>s),x=T?.colorScheme??P,[m]=(0,l.useState)(()=>a.createGeomRendererResolver([...T?.plugins??[],...r].filter(oe))),f=(0,l.useId)(),[S]=(0,l.useState)(()=>(0,g.createAnchorResolver)(r)),[_]=(0,l.useState)(()=>(0,g.createDataLabelPlacementResolver)(r)),[y]=(0,l.useState)(()=>xe()),[R]=(0,l.useState)(()=>a.createTargetBoundaryStore()),D=(0,l.useMemo)(()=>(0,g.createStyleResolver)({colorScheme:x}),[x]),{store:G,dispatch:H,commit:I,history:E,subscribe:C,getScene:j,compileBus:k,compileErrors:A}=Ke({spec:t,data:e,customPalettes:v,colorScheme:x,plugins:r,theme:T,resolveRenderer:m,anchorResolver:S,onSpecChange:c,onError:d,onWarnings:h});(0,l.useEffect)(()=>{if(G)return G.subscribe((q,$)=>{if(q.scene.spec===$.scene.spec)return;const{selection:L,setSelection:F}=y.getState();L.length!==0&&F(ie(L,q.scene.spec))})},[G,y]);const b=(0,l.useMemo)(()=>({dispatch:H,commit:I}),[H,I]);(0,l.useImperativeHandle)(u,()=>({commands:b,undo:E.undo,redo:E.redo,subscribe:C,getScene:j,getSelection:()=>y.getState().selection,setSelection:q=>y.getState().setSelection(q),subscribeSelection:y.subscribe,canPlaceDataLabels:_.hasCapability,canFormatDataLabelsAsPercentages:_.hasPercentageFormat}),[b,E,C,j,y,_]);const O=(0,l.useMemo)(()=>G?{chartId:f,store:G,selectionStore:y,targetBoundaryStore:R,commands:b,history:E,formattingLocale:n,compileBus:k,colorScheme:x,styleResolver:D,anchorResolver:S}:null,[f,G,y,R,b,E,n,k,x,D,S]);return(0,o.jsx)(re,{forcedErrors:A,onError:d,resetKeys:[t,e],children:O?(0,o.jsx)(a.GraphContext.Provider,{value:O,children:(0,o.jsx)(a.GeomRendererResolverProvider,{value:m,children:(0,o.jsx)(a.DataLabelPlacementResolverProvider,{value:_,children:(0,o.jsx)(M,{shapes:T?.shapes,children:N})})})}):null})};function Fe({theme:e,...t}={}){const r=(0,g.createSpecBuilder)(t);return{...r,GraphProvider:n=>(0,o.jsx)(ce,{...n,plugins:r.plugins,theme:e})}}var le=({shouldAnimateTransitions:e,cx:t,cy:r,r:s,...n})=>e?(0,o.jsx)(K.motion.circle,{initial:!1,animate:{cx:t,cy:r,r:s},transition:a.DEFAULT_SPRING_TRANSITION,...n}):(0,o.jsx)("circle",{cx:t,cy:r,r:s,...n}),ue=({shouldAnimateTransitions:e,x1:t,y1:r,x2:s,y2:n,...u})=>e?(0,o.jsx)(K.motion.line,{initial:!1,animate:{x1:t,y1:r,x2:s,y2:n},transition:a.DEFAULT_SPRING_TRANSITION,...u}):(0,o.jsx)("line",{x1:t,y1:r,x2:s,y2:n,...u}),de=({shouldAnimateTransitions:e,x:t,y:r,width:s,height:n,...u})=>e?(0,o.jsx)(K.motion.rect,{initial:!1,animate:{attrX:t,attrY:r,width:s,height:n},transition:a.DEFAULT_SPRING_TRANSITION,...u}):(0,o.jsx)("rect",{x:t,y:r,width:s,height:n,...u}),me=({shouldAnimateTransitions:e,d:t,source:r,...s})=>e?(0,o.jsx)(Xe,{d:t,source:r,...s}):(0,o.jsx)("path",{d:t,...s}),Ye=e=>{const{Circle:t}=U();return t===void 0?le(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Ve=e=>{const{Line:t}=U();return t===void 0?ue(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},We=e=>{const{Rect:t}=U();return t===void 0?de(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},ze=e=>{const{Path:t}=U();return t===void 0?me(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Xe=({d:e,source:t,...r})=>{const s=a.useSvgPathMorph(e,a.DEFAULT_SPRING_TRANSITION,t);return(0,o.jsx)(K.motion.path,{d:s,...r})},Qe=({children:e,...t})=>(0,o.jsx)("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",pointerEvents:"none",...t,children:e}),Je=({box:e,children:t})=>(0,o.jsx)("svg",{x:(0,g.toPercent)(e.x0),y:(0,g.toPercent)(e.y0),width:(0,g.toPercent)(e.x1-e.x0),height:(0,g.toPercent)(e.y1-e.y0),overflow:"hidden",pointerEvents:"none",children:t}),Ze="drqe3u0",et="drqe3u1",tt="drqe3u2",rt="drqe3u3",w="drqe3u4",st="drqe3u5",nt="drqe3u6",ot="drqe3u7",B="drqe3u8",at="drqe3u9",it="drqe3ua";var ct="drqe3uc",lt="drqe3ud",ut="drqe3ue",dt="drqe3uf";var mt="drqe3uh",ht="drqe3ui",ee={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},te={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},he={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"},gt=({width:e=440,style:t,className:r}={})=>{const{compileBus:s}=a.useGraphContext(),[n]=(0,l.useState)(()=>Ne()),[u,c]=(0,l.useState)(!1),[d,h]=(0,l.useState)(g.isCompilerCachingEnabled);(0,l.useEffect)(()=>{const{recordCompile:m}=n.getState(),f=s.getLastTrigger(),S=s.getLastCompile();return f&&S&&m(f,S),s.subscribe(m)},[n,s]);const v=(0,Y.useStore)(n,m=>m.lastCompile),P=(0,Y.useStore)(n,m=>m.history),N=s.getCacheStats(),T=v===null&&P.length===0,x=()=>{h(m=>{const f=!m;return(0,g.setCompilerCachingEnabled)(f),f})};return(0,o.jsxs)("div",{className:(0,V.default)(it,r),style:{width:e,...t},children:[(0,o.jsxs)("div",{className:Ze,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:et,children:"compile cache"}),(0,o.jsx)("div",{className:ut,children:T?"production: stats disabled":v?`last: ${v.label} · ${X(v.durationMs)}`:"awaiting first compile…"})]}),(0,o.jsx)("button",{type:"button",onClick:()=>c(m=>!m),className:dt,children:u?"▾":"▴"})]}),!u&&(0,o.jsxs)("div",{className:"drqe3ub",children:[(0,o.jsxs)("button",{type:"button",onClick:x,className:d?ee.enabled:ee.disabled,"aria-pressed":d,children:["cache ",d?"enabled":"disabled"]}),(0,o.jsx)("span",{className:"drqe3ug",children:"next compile reflects this toggle"})]}),!u&&!T&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(pt,{delta:v?.stages,durations:v?.stageDurationsMs,cumulative:N}),(0,o.jsx)(vt,{entries:P})]})]})},pt=({delta:e,durations:t,cumulative:r})=>(0,o.jsxs)("table",{className:tt,children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:mt,children:[(0,o.jsx)("th",{className:rt,children:"stage"}),(0,o.jsx)("th",{className:w,children:"time"}),(0,o.jsx)("th",{className:w,children:"Δ miss"}),(0,o.jsx)("th",{className:w,children:"Δ hit"}),(0,o.jsx)("th",{className:w,children:"total miss"}),(0,o.jsx)("th",{className:w,children:"total hit"})]})}),(0,o.jsx)("tbody",{children:g.COMPILER_STAGE_KEYS.map(s=>{const n=e?.[s],u=ft(n);return(0,o.jsxs)("tr",{className:ct,children:[(0,o.jsxs)("td",{className:st,children:[(0,o.jsx)("span",{className:he[u],"aria-hidden":!0})," ",s]}),(0,o.jsx)("td",{className:B,children:t===void 0||u==="untouched"?"—":X(t[s])}),(0,o.jsx)("td",{className:u==="ran"?te.ran:te.dim,children:n?.misses??0}),(0,o.jsx)("td",{className:B,children:n?.hits??0}),(0,o.jsx)("td",{className:B,children:r[s].misses}),(0,o.jsx)("td",{className:B,children:r[s].hits})]},s)})})]}),vt=({entries:e})=>e.length===0?null:(0,o.jsxs)("div",{className:lt,children:[(0,o.jsx)("div",{className:ht,children:"recent compiles"}),e.map(t=>{const r=St(t.stages,u=>u.misses>0),s=g.COMPILER_STAGE_KEYS.length,n=r===0?"cached":"ran";return(0,o.jsxs)("div",{className:nt,children:[(0,o.jsx)("span",{className:he[n],"aria-hidden":!0}),(0,o.jsx)("span",{className:ot,title:t.label,children:t.label}),(0,o.jsxs)("span",{className:at,children:[r,"/",s," ran · ",X(t.durationMs)]})]},t.id)})]}),ft=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",St=(e,t)=>{let r=0;for(const s of g.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},X=e=>e<.1?"<0.1ms":e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,yt=()=>{const{history:e}=a.useGraphContext(),{stack:t,undo:r,redo:s}=e,n=(0,l.useCallback)(d=>t.subscribe(d),[t]),u=(0,l.useCallback)(()=>t.getSnapshot(),[t]),c=(0,l.useSyncExternalStore)(n,u,u);return(0,l.useMemo)(()=>({...c,undo:r,redo:s}),[c,r,s])},bt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),Et=(e,t={})=>{const{target:r,enabled:s=!0}=t;(0,l.useEffect)(()=>{const n=Tt(r);if(!s||!n)return;const u=c=>{if(!xt(c)||c.defaultPrevented||Gt(c.target))return;const d=a.resolveHistoryStep(c);if(!d)return;const h=e.current;h&&(d==="undo"?h.undo():h.redo())&&c.preventDefault()};return n.addEventListener("keydown",u),()=>n.removeEventListener("keydown",u)},[e,r,s])},Tt=e=>e===void 0?window:e!==null&&"current"in e?e.current:e,xt=e=>"key"in e,Gt=e=>e instanceof HTMLInputElement?!bt.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA":!1,Rt=()=>{const{targetBoundaryStore:e}=a.useGraphContext();return(0,Y.useStore)(e,t=>t.boundary)};exports.BrandMark=a.BrandMark;exports.CanvasTextMeasurer=a.CanvasTextMeasurer;exports.DefaultFooter=a.DefaultFooter;exports.DefaultGeomCircle=le;exports.DefaultGeomLine=ue;exports.DefaultGeomPath=me;exports.DefaultGeomRect=de;exports.DefaultGrid=a.DefaultGrid;exports.DefaultHeader=a.DefaultHeader;exports.DefaultSwatch=a.DefaultSwatch;exports.DefaultTooltip=a.DefaultTooltip;exports.DevToolsPanel=gt;exports.GRAPH_MODES=a.GRAPH_MODES;exports.GeomCircle=Ye;exports.GeomLine=Ve;exports.GeomPath=ze;exports.GeomRect=We;exports.GraphErrorBoundary=re;exports.GraphErrorPanel=W;exports.GraphProvider=ce;exports.GraphRenderer=a.GraphRenderer;exports.HoverProvider=a.HoverProvider;exports.IntroFade=a.IntroFade;exports.IntroWipeClip=a.IntroWipeClip;exports.TextMeasurerProvider=a.TextMeasurerProvider;exports.ThemeProvider=a.ThemeProvider;exports.UnitBoxSvg=Je;exports.UnitSpaceSvg=Qe;exports.buildDotsEditOutlineShapes=a.buildDotsEditOutlineShapes;exports.createGraphyKit=Fe;exports.darkTheme=a.darkTheme;exports.defineGeomRenderer=a.defineGeomRenderer;exports.lightTheme=a.lightTheme;exports.lightenCss=a.lightenCss;exports.projectPointCartesian=a.projectPointCartesian;exports.pruneSelection=ie;exports.resolveBrandMarkVisual=a.resolveBrandMarkVisual;exports.scalePointToPanel=a.scalePointToPanel;exports.stampAxisEditTarget=a.stampAxisEditTarget;exports.stampGridEditTarget=a.stampGridEditTarget;exports.stampLegendEditTarget=a.stampLegendEditTarget;exports.useElementScreenRect=a.useElementScreenRect;exports.useGeomHitTest=a.useGeomHitTest;exports.useGeomHover=a.useGeomHover;exports.useGeomReaderTree=a.useGeomReaderTree;exports.useGeomStyleReader=a.useGeomStyleReader;exports.useGraphCommands=a.useGraphCommands;exports.useGraphHandle=a.useGraphHandle;exports.useGraphHistory=yt;exports.useGraphHistoryShortcuts=Et;exports.useGraphLocale=a.useGraphLocale;exports.useGraphSelection=a.useGraphSelection;exports.useGuidesTakePress=a.useGuidesTakePress;exports.useHandleScene=a.useHandleScene;exports.useHoverState=a.useHoverState;exports.usePaintDefs=a.usePaintDefs;exports.useResolvedStyle=a.useResolvedStyle;exports.useSceneSelector=a.useSceneSelector;exports.useStyleReaderTree=a.useStyleReaderTree;exports.useStyleResolver=a.useStyleResolver;exports.useTargetBoundary=Rt;exports.useTextMeasurer=a.useTextMeasurer;exports.vars=pe.vars;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("./history-chords-BS3S3uQm.cjs"),pe=require("./theme.contract.css-VQwFtkVc.cjs");let g=require("@graphysdk/viz-engine"),l=require("react"),o=require("react/jsx-runtime"),Y=require("zustand"),K=require("motion/react"),z=require("zustand/vanilla"),V=require("clsx");V=a.__toESM(V,1);var ve="_1a5iqpb0",fe="_1a5iqpb1";var Se="_1a5iqpb3",ye="_1a5iqpb4",be="_1a5iqpb5";var W=({errors:e})=>{const[t,...r]=e;return(0,o.jsxs)("div",{role:"alert",className:ve,children:[(0,o.jsx)("strong",{className:fe,children:"This chart could not be rendered."}),t&&(0,o.jsx)(Q,{diagnostic:t}),r.length>0&&(0,o.jsx)("ul",{className:"_1a5iqpb2",children:r.map((s,n)=>(0,o.jsx)("li",{children:(0,o.jsx)(Q,{diagnostic:s})},`${s.code}-${n}`))})]})},Q=({diagnostic:e})=>(0,o.jsxs)("div",{className:Se,children:[(0,o.jsx)("span",{className:ye,children:e.code}),(0,o.jsx)("p",{className:be,children:e.message}),e.suggestion&&(0,o.jsx)("p",{className:"_1a5iqpb6",children:e.suggestion})]});function Ee(e=[],t=[]){return e.length===t.length&&e.every((r,s)=>Object.is(r,t[s]))}var re=class extends l.Component{constructor(...e){super(...e),this.state={caughtDiagnostic:null}}static getDerivedStateFromError(e){return{caughtDiagnostic:(0,g.buildDiagnostic)(e)}}componentDidCatch(e,t){const r=(0,g.buildDiagnostic)(e);a.logDiagnostics([r]),this.props.onError?.([r]),console.error("Chart render component stack:",t.componentStack)}componentDidUpdate(e){this.state.caughtDiagnostic&&!Ee(e.resetKeys,this.props.resetKeys)&&this.setState({caughtDiagnostic:null})}render(){const{caughtDiagnostic:e}=this.state;if(e)return(0,o.jsx)(W,{errors:[e]});const{forcedErrors:t,children:r}=this.props;return t&&t.length>0?(0,o.jsx)(W,{errors:t}):r}},se={},ne=(0,l.createContext)(se),M=({shapes:e=se,children:t})=>(0,o.jsx)(ne.Provider,{value:e,children:t}),U=()=>(0,l.useContext)(ne),oe=e=>typeof e=="object"&&"geom"in e&&"render"in e,ae=e=>{const t=(0,g.resolveDefinition)(e);return t instanceof g.Geom?t:null},ie=(e,t)=>{const r=e.filter(s=>Te(s,t));return r.length===e.length?e:r},Te=(e,t)=>e.kind==="annotation"?(0,g.findAnnotation)(t.annotations,e.id)!==null:e.kind==="observations"||e.kind==="layer"&&e.layerId!==void 0?(0,g.findLayerById)(t.layers,e.layerId)!==void 0:!0,J=[],xe=()=>(0,z.createStore)(e=>({selection:J,setSelection:t=>e(r=>Ge(r.selection,t)?r:{selection:t}),clearSelection:()=>e(t=>t.selection.length===0?t:{selection:J})})),Ge=(e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,s)=>{const n=t[s];return n!==void 0&&(0,g.areEditTargetsEqual)(r,n)}),Re=process.env.NODE_ENV!=="production",Ce=5,je=e=>{if(!Re)return{emit:()=>{},subscribe:()=>De,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let r=null;return{emit:s=>{const n=e.getLastCompile();if(n){r=s;for(const u of t)u(s,n)}},subscribe:s=>(t.add(s),()=>{t.delete(s)}),getLastTrigger:()=>r,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},Ne=()=>(0,z.createStore)(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,r)=>e(s=>{if(s.lastSnapshot===r)return s;const n={id:s.nextId,label:_e(t),stages:r.stages,stageDurationsMs:r.stageDurationsMs,durationMs:r.durationMs};return{lastCompile:n,history:Pe(s.history,n,Ce),nextId:s.nextId+1,lastSnapshot:r}})})),De=()=>{},_e=e=>{switch(e.kind){case"init":return"init";case"spec":return"spec change";case"data":return"data change";case"command":return e.command.metadata.description}},Pe=(e,t,r)=>{const s=e.length>=r?e.length-(r-1):0;return[...e.slice(s),t]};function qe(e,t){let r;return e.layers.flatMap((s,n)=>a.isOverlayHosted(t(s.geom,e.coordSystem.type))?Ae(s)?(r??=(0,g.createStyleResolver)().readers(e),Oe(s,r.geom(s))?[{kind:"user-input",severity:"warning",code:"INVALID_STYLE_RULE",message:`Style 'overlay' is not supported on portal-rendered geom '${s.geom}' (layer '${s.id}'); it is ignored.`,context:{param:"overlay",layerIndex:n,requested:s.geom},suggestion:"Remove the geom overlay or use a renderer that paints inside the panel SVG."}]:[]):[]:[])}function Z(e){const t=e.filter(oe),r=new Set([...Object.keys(a.BUILT_IN_GEOM_RENDERERS),...t.map(d=>d.geom)]),s=[],n=new Set;for(const d of e){const h=ae(d);h===null||r.has(h.type)||n.has(h.type)||(n.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 u=new Map;for(const d of t){if("definition"in d)continue;const h=`${d.geom}|${d.coord}`,v=u.get(h);v?v.count+=1:u.set(h,{geom:d.geom,coord:d.coord,count:1})}const c=[];for(const{geom:d,coord:h,count:v}of u.values())v<2||c.push({kind:"user-input",severity:"warning",code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple render-only overrides register ('${d}', '${h}') (${v} entries); the last in the array wins.`,context:{requested:`${d}@${h}`,kind:"geom-renderer"},suggestion:`Keep a single render-only override for ('${d}', '${h}').`});return c.push(...$e(e)),{errors:s,warnings:c}}function Ie(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s)t(c.geom,r.type)!==null||n.has(c.geom)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"MISSING_GEOM_RENDERER",message:`No renderer for geom '${c.geom}' under ${r.type} coords; the layer is not painted.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:`Register a renderer for ('${c.geom}', '${r.type}') via \`defineGeomRenderer\`.`}));return u}function ke(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const d=t(c.geom,r.type);d===null||d.hitTest||a.isOverlayHosted(d)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"MISSING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,context:{requested:c.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 ('${c.geom}', '${r.type}').`}))}return u}function Le(e){const t=new Set,r=[];for(const s of e.layers){const n=s.identityKey;s.interactive!==!1&&(s.spatialKind!=="render-hit-test"||typeof n!="object"||t.has(s.geom)||s.data.hasVariable(n.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 '${n.variable}', a column its compile output does not emit; its hover lookup is empty.`,context:{requested:s.geom,kind:"geom-renderer"},suggestion:`Emit the '${n.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`})))}return r}function we(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const d=t(c.geom,r.type);d===null||!d.hitTest||!a.isOverlayHosted(d)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"CONFLICTING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,context:{requested:c.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 u}function Me(e,t){const r=new Set,s=[];for(const n of e.layers)n.interactive!==!1&&(n.spatialKind!=="render-hit-test"||r.has(n.geom)||t.hasCapability(n.geom)||(r.add(n.geom),s.push({kind:"user-input",severity:"warning",code:"MISSING_ANCHOR_CAPABILITY",message:`Geom '${n.geom}' declares no \`resolveAnchorPosition\`; its observations cannot be annotated, so the editor overlay paints no creation trigger on them.`,context:{requested:n.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 He(e,t){const{coordSystem:r,layers:s}=e,n=new Set,u=[];for(const c of s){if(c.interactive===!1||c.spatialKind==="render-hit-test"||n.has(c.geom))continue;const d=t(c.geom,r.type);d===null||!a.isOverlayHosted(d)||(n.add(c.geom),u.push({kind:"user-input",severity:"warning",code:"OVERLAY_REQUIRES_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares an overlay render but its layer's spatialKind is '${c.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:"Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."}))}return u}var Ae=e=>[e.styles.defaults,e.styles.overrides].some(t=>t.some(r=>(r.declarations.overlay?.length??0)>0)),Oe=(e,t)=>{const[r]=e.data;if(r===void 0)return!1;if((t.get("overlay",r)?.length??0)>0)return!0;for(const s of e.data)if((t.get("overlay",s,"hovered")?.length??0)>0)return!0;return!1};function $e(e){const t=new Set,r=[];for(const s of e){const n=ae(s);n===null||t.has(n.type)||n.dataLabelCoordTypes.length===0||n.getDataLabelPlacements!==void 0||(t.add(n.type),r.push({kind:"user-input",severity:"warning",code:"MISSING_DATA_LABEL_PLACEMENT",message:`Geom '${n.type}' declares \`dataLabelCoordTypes\` but implements no \`getDataLabelPlacements\`; its layers paint no data labels.`,context:{requested:n.type,kind:"geom-renderer"},suggestion:"Implement `getDataLabelPlacements(context)` on the geom, or drop `dataLabelCoordTypes` so the compiler warns the author off the flag."}))}return r}var Be=e=>(0,z.createStore)(t=>({scene:e,setScene:r=>t(s=>s.scene===r?s:{scene:r})})),Ke=({spec:e,data:t,customPalettes:r,colorScheme:s,plugins:n,theme:u,resolveRenderer:c,anchorResolver:d,onSpecChange:h,onError:v,onWarnings:P})=>{const N=a.useLatestRef(h),T=a.useLatestRef(v),x=a.useLatestRef(P),[{session:m,compileBus:f}]=(0,l.useState)(()=>{const i=(0,g.createCompiler)({plugins:n,theme:u});return{session:new g.GraphCompilationSession(i),compileBus:je(i)}}),[S]=(0,l.useState)(()=>{const i=Z(n??[]),p=Z(u?.plugins??[]);return{errors:[...p.errors,...i.errors],warnings:[...p.warnings,...i.warnings]}}),_=(0,l.useRef)(null),[y]=(0,l.useState)(Ue),R=(0,l.useRef)(null),D=(0,l.useCallback)(i=>S.errors.length===0?i:[...S.errors,...i??[]],[S]),G=(0,l.useCallback)(i=>{if(!i.ok)return i.errors;if(R.current)R.current.getState().setScene(i.scene);else{const p=Be(i.scene);p.subscribe(y.notify),R.current=p,y.notify()}return null},[y]),[H,I]=(0,l.useState)(()=>{const i=m.compile({spec:e,data:t,customPalettes:r,colorScheme:s});return _.current=i,D(G(i))}),E=(0,l.useCallback)(i=>i.ok?[...i.warnings,...Ie(i.scene,c),...ke(i.scene,c),...Le(i.scene),...we(i.scene,c),...He(i.scene,c),...qe(i.scene,c),...Me(i.scene,d)]:i.warnings,[c,d]),C=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),T.current?.(i))},[T]),j=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),x.current?.(i))},[x]);(0,l.useEffect)(()=>{const i=_.current;i&&(C([...S.errors,...i.ok?[]:i.errors]),j([...S.warnings,...E(i)]),i.ok&&f.emit({kind:"init"}))},[f,C,j,S,E]),(0,l.useEffect)(()=>{const i=m.update({spec:e,data:t,customPalettes:r,colorScheme:s});if(!i)return;i.committedSpec&&N.current?.(i.committedSpec);const p=G(i.result);I(D(p)),p&&C(p),j(E(i.result)),p||f.emit({kind:i.specChanged?"spec":"data"})},[e,t,r,s,m,f,G,C,j,D,E,N]);const k=(0,l.useCallback)(i=>{I(p=>p===null?p:D(null)),j(E(i))},[D,j,E]),A=(0,l.useCallback)(i=>{i.scene&&R.current?.getState().setScene(i.scene),i.result&&k(i.result),i.command&&f.emit({kind:"command",command:i.command}),i.spec&&N.current?.(i.spec),i.errors&&C([...i.errors])},[k,f,N,C]),b=(0,l.useCallback)(i=>{for(const p of i)A(p);return i.some(p=>!!p.scene)},[A]),O=(0,l.useCallback)((i,p)=>{b(m.applyCommand(i,p))},[m,b]),q=(0,l.useCallback)(()=>{b(m.commit())},[m,b]),$=(0,l.useCallback)(()=>b(m.undo()),[m,b]),L=(0,l.useCallback)(()=>b(m.redo()),[m,b]),F=(0,l.useMemo)(()=>({stack:m.history,undo:$,redo:L}),[m,$,L]),ge=(0,l.useCallback)(()=>R.current?.getState().scene??null,[]);return{store:R.current,dispatch:O,commit:q,history:F,subscribe:y.subscribe,getScene:ge,compileBus:f,compileErrors:H}},Ue=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify:()=>e.forEach(t=>t())}},ce=({data:e,spec:t,plugins:r=[],theme:s,formattingLocale:n,handleRef:u,onSpecChange:c,onError:d,onWarnings:h,customPalettes:v,colorScheme:P="light",children:N})=>{const[T]=(0,l.useState)(()=>s),x=T?.colorScheme??P,[m]=(0,l.useState)(()=>a.createGeomRendererResolver([...T?.plugins??[],...r].filter(oe))),f=(0,l.useId)(),[S]=(0,l.useState)(()=>(0,g.createAnchorResolver)(r)),[_]=(0,l.useState)(()=>(0,g.createDataLabelPlacementResolver)(r)),[y]=(0,l.useState)(()=>xe()),[R]=(0,l.useState)(()=>a.createTargetBoundaryStore()),D=(0,l.useMemo)(()=>(0,g.createStyleResolver)({colorScheme:x}),[x]),{store:G,dispatch:H,commit:I,history:E,subscribe:C,getScene:j,compileBus:k,compileErrors:A}=Ke({spec:t,data:e,customPalettes:v,colorScheme:x,plugins:r,theme:T,resolveRenderer:m,anchorResolver:S,onSpecChange:c,onError:d,onWarnings:h});(0,l.useEffect)(()=>{if(G)return G.subscribe((q,$)=>{if(q.scene.spec===$.scene.spec)return;const{selection:L,setSelection:F}=y.getState();L.length!==0&&F(ie(L,q.scene.spec))})},[G,y]);const b=(0,l.useMemo)(()=>({dispatch:H,commit:I}),[H,I]);(0,l.useImperativeHandle)(u,()=>({commands:b,undo:E.undo,redo:E.redo,subscribe:C,getScene:j,getSelection:()=>y.getState().selection,setSelection:q=>y.getState().setSelection(q),subscribeSelection:y.subscribe,canPlaceDataLabels:_.hasCapability,canFormatDataLabelsAsPercentages:_.hasPercentageFormat}),[b,E,C,j,y,_]);const O=(0,l.useMemo)(()=>G?{chartId:f,store:G,selectionStore:y,targetBoundaryStore:R,commands:b,history:E,formattingLocale:n,compileBus:k,colorScheme:x,styleResolver:D,anchorResolver:S}:null,[f,G,y,R,b,E,n,k,x,D,S]);return(0,o.jsx)(re,{forcedErrors:A,onError:d,resetKeys:[t,e],children:O?(0,o.jsx)(a.GraphContext.Provider,{value:O,children:(0,o.jsx)(a.GeomRendererResolverProvider,{value:m,children:(0,o.jsx)(a.DataLabelPlacementResolverProvider,{value:_,children:(0,o.jsx)(M,{shapes:T?.shapes,children:N})})})}):null})};function Fe({theme:e,...t}={}){const r=(0,g.createSpecBuilder)(t);return{...r,GraphProvider:n=>(0,o.jsx)(ce,{...n,plugins:r.plugins,theme:e})}}var le=({shouldAnimateTransitions:e,cx:t,cy:r,r:s,...n})=>e?(0,o.jsx)(K.motion.circle,{initial:!1,animate:{cx:t,cy:r,r:s},transition:a.DEFAULT_SPRING_TRANSITION,...n}):(0,o.jsx)("circle",{cx:t,cy:r,r:s,...n}),ue=({shouldAnimateTransitions:e,x1:t,y1:r,x2:s,y2:n,...u})=>e?(0,o.jsx)(K.motion.line,{initial:!1,animate:{x1:t,y1:r,x2:s,y2:n},transition:a.DEFAULT_SPRING_TRANSITION,...u}):(0,o.jsx)("line",{x1:t,y1:r,x2:s,y2:n,...u}),de=({shouldAnimateTransitions:e,x:t,y:r,width:s,height:n,...u})=>e?(0,o.jsx)(K.motion.rect,{initial:!1,animate:{attrX:t,attrY:r,width:s,height:n},transition:a.DEFAULT_SPRING_TRANSITION,...u}):(0,o.jsx)("rect",{x:t,y:r,width:s,height:n,...u}),me=({shouldAnimateTransitions:e,d:t,source:r,...s})=>e?(0,o.jsx)(Xe,{d:t,source:r,...s}):(0,o.jsx)("path",{d:t,...s}),Ye=e=>{const{Circle:t}=U();return t===void 0?le(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Ve=e=>{const{Line:t}=U();return t===void 0?ue(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},We=e=>{const{Rect:t}=U();return t===void 0?de(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},ze=e=>{const{Path:t}=U();return t===void 0?me(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Xe=({d:e,source:t,...r})=>{const s=a.useSvgPathMorph(e,a.DEFAULT_SPRING_TRANSITION,t);return(0,o.jsx)(K.motion.path,{d:s,...r})},Qe=({children:e,...t})=>(0,o.jsx)("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",pointerEvents:"none",...t,children:e}),Je=({box:e,children:t})=>(0,o.jsx)("svg",{x:(0,g.toPercent)(e.x0),y:(0,g.toPercent)(e.y0),width:(0,g.toPercent)(e.x1-e.x0),height:(0,g.toPercent)(e.y1-e.y0),overflow:"hidden",pointerEvents:"none",children:t}),Ze="drqe3u0",et="drqe3u1",tt="drqe3u2",rt="drqe3u3",w="drqe3u4",st="drqe3u5",nt="drqe3u6",ot="drqe3u7",B="drqe3u8",at="drqe3u9",it="drqe3ua";var ct="drqe3uc",lt="drqe3ud",ut="drqe3ue",dt="drqe3uf";var mt="drqe3uh",ht="drqe3ui",ee={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},te={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},he={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"},gt=({width:e=440,style:t,className:r}={})=>{const{compileBus:s}=a.useGraphContext(),[n]=(0,l.useState)(()=>Ne()),[u,c]=(0,l.useState)(!1),[d,h]=(0,l.useState)(g.isCompilerCachingEnabled);(0,l.useEffect)(()=>{const{recordCompile:m}=n.getState(),f=s.getLastTrigger(),S=s.getLastCompile();return f&&S&&m(f,S),s.subscribe(m)},[n,s]);const v=(0,Y.useStore)(n,m=>m.lastCompile),P=(0,Y.useStore)(n,m=>m.history),N=s.getCacheStats(),T=v===null&&P.length===0,x=()=>{h(m=>{const f=!m;return(0,g.setCompilerCachingEnabled)(f),f})};return(0,o.jsxs)("div",{className:(0,V.default)(it,r),style:{width:e,...t},children:[(0,o.jsxs)("div",{className:Ze,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:et,children:"compile cache"}),(0,o.jsx)("div",{className:ut,children:T?"production: stats disabled":v?`last: ${v.label} · ${X(v.durationMs)}`:"awaiting first compile…"})]}),(0,o.jsx)("button",{type:"button",onClick:()=>c(m=>!m),className:dt,children:u?"▾":"▴"})]}),!u&&(0,o.jsxs)("div",{className:"drqe3ub",children:[(0,o.jsxs)("button",{type:"button",onClick:x,className:d?ee.enabled:ee.disabled,"aria-pressed":d,children:["cache ",d?"enabled":"disabled"]}),(0,o.jsx)("span",{className:"drqe3ug",children:"next compile reflects this toggle"})]}),!u&&!T&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(pt,{delta:v?.stages,durations:v?.stageDurationsMs,cumulative:N}),(0,o.jsx)(vt,{entries:P})]})]})},pt=({delta:e,durations:t,cumulative:r})=>(0,o.jsxs)("table",{className:tt,children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:mt,children:[(0,o.jsx)("th",{className:rt,children:"stage"}),(0,o.jsx)("th",{className:w,children:"time"}),(0,o.jsx)("th",{className:w,children:"Δ miss"}),(0,o.jsx)("th",{className:w,children:"Δ hit"}),(0,o.jsx)("th",{className:w,children:"total miss"}),(0,o.jsx)("th",{className:w,children:"total hit"})]})}),(0,o.jsx)("tbody",{children:g.COMPILER_STAGE_KEYS.map(s=>{const n=e?.[s],u=ft(n);return(0,o.jsxs)("tr",{className:ct,children:[(0,o.jsxs)("td",{className:st,children:[(0,o.jsx)("span",{className:he[u],"aria-hidden":!0})," ",s]}),(0,o.jsx)("td",{className:B,children:t===void 0||u==="untouched"?"—":X(t[s])}),(0,o.jsx)("td",{className:u==="ran"?te.ran:te.dim,children:n?.misses??0}),(0,o.jsx)("td",{className:B,children:n?.hits??0}),(0,o.jsx)("td",{className:B,children:r[s].misses}),(0,o.jsx)("td",{className:B,children:r[s].hits})]},s)})})]}),vt=({entries:e})=>e.length===0?null:(0,o.jsxs)("div",{className:lt,children:[(0,o.jsx)("div",{className:ht,children:"recent compiles"}),e.map(t=>{const r=St(t.stages,u=>u.misses>0),s=g.COMPILER_STAGE_KEYS.length,n=r===0?"cached":"ran";return(0,o.jsxs)("div",{className:nt,children:[(0,o.jsx)("span",{className:he[n],"aria-hidden":!0}),(0,o.jsx)("span",{className:ot,title:t.label,children:t.label}),(0,o.jsxs)("span",{className:at,children:[r,"/",s," ran · ",X(t.durationMs)]})]},t.id)})]}),ft=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",St=(e,t)=>{let r=0;for(const s of g.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},X=e=>e<.1?"<0.1ms":e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,yt=()=>{const{history:e}=a.useGraphContext(),{stack:t,undo:r,redo:s}=e,n=(0,l.useCallback)(d=>t.subscribe(d),[t]),u=(0,l.useCallback)(()=>t.getSnapshot(),[t]),c=(0,l.useSyncExternalStore)(n,u,u);return(0,l.useMemo)(()=>({...c,undo:r,redo:s}),[c,r,s])},bt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),Et=(e,t={})=>{const{target:r,enabled:s=!0}=t;(0,l.useEffect)(()=>{const n=Tt(r);if(!s||!n)return;const u=c=>{if(!xt(c)||c.defaultPrevented||Gt(c.target))return;const d=a.resolveHistoryStep(c);if(!d)return;const h=e.current;h&&(d==="undo"?h.undo():h.redo())&&c.preventDefault()};return n.addEventListener("keydown",u),()=>n.removeEventListener("keydown",u)},[e,r,s])},Tt=e=>e===void 0?window:e!==null&&"current"in e?e.current:e,xt=e=>"key"in e,Gt=e=>e instanceof HTMLInputElement?!bt.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA":!1,Rt=()=>{const{targetBoundaryStore:e}=a.useGraphContext();return(0,Y.useStore)(e,t=>t.boundary)};exports.BrandMark=a.BrandMark;exports.CanvasTextMeasurer=a.CanvasTextMeasurer;exports.DefaultFooter=a.DefaultFooter;exports.DefaultGeomCircle=le;exports.DefaultGeomLine=ue;exports.DefaultGeomPath=me;exports.DefaultGeomRect=de;exports.DefaultGrid=a.DefaultGrid;exports.DefaultHeader=a.DefaultHeader;exports.DefaultSwatch=a.DefaultSwatch;exports.DefaultTooltip=a.DefaultTooltip;exports.DevToolsPanel=gt;exports.GRAPH_MODES=a.GRAPH_MODES;exports.GeomCircle=Ye;exports.GeomLine=Ve;exports.GeomPath=ze;exports.GeomRect=We;exports.GraphErrorBoundary=re;exports.GraphErrorPanel=W;exports.GraphProvider=ce;exports.GraphRenderer=a.GraphRenderer;exports.HoverProvider=a.HoverProvider;exports.IntroFade=a.IntroFade;exports.IntroWipeClip=a.IntroWipeClip;exports.TextMeasurerProvider=a.TextMeasurerProvider;exports.ThemeProvider=a.ThemeProvider;exports.UnitBoxSvg=Je;exports.UnitSpaceSvg=Qe;exports.buildDotsEditOutlineShapes=a.buildDotsEditOutlineShapes;exports.createGraphyKit=Fe;exports.darkTheme=a.darkTheme;exports.defineGeomRenderer=a.defineGeomRenderer;exports.lightTheme=a.lightTheme;exports.lightenCss=a.lightenCss;exports.projectPointCartesian=a.projectPointCartesian;exports.pruneSelection=ie;exports.resolveBrandMarkVisual=a.resolveBrandMarkVisual;exports.scalePointToPanel=a.scalePointToPanel;exports.stampAxisEditTarget=a.stampAxisEditTarget;exports.stampGridEditTarget=a.stampGridEditTarget;exports.stampLegendEditTarget=a.stampLegendEditTarget;exports.useElementScreenRect=a.useElementScreenRect;exports.useGeomHitTest=a.useGeomHitTest;exports.useGeomHover=a.useGeomHover;exports.useGeomReaderTree=a.useGeomReaderTree;exports.useGeomStyleReader=a.useGeomStyleReader;exports.useGraphCommands=a.useGraphCommands;exports.useGraphHandle=a.useGraphHandle;exports.useGraphHistory=yt;exports.useGraphHistoryShortcuts=Et;exports.useGraphLocale=a.useGraphLocale;exports.useGraphSelection=a.useGraphSelection;exports.useGuidesTakePress=a.useGuidesTakePress;exports.useHandleScene=a.useHandleScene;exports.useHoverState=a.useHoverState;exports.usePaintDefs=a.usePaintDefs;exports.useResolvedStyle=a.useResolvedStyle;exports.useSceneSelector=a.useSceneSelector;exports.useStyleReaderTree=a.useStyleReaderTree;exports.useStyleResolver=a.useStyleResolver;exports.useTargetBoundary=Rt;exports.useTextMeasurer=a.useTextMeasurer;exports.vars=pe.vars;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as er, B as tr, Bt as rr, Dt as nr, Et as sr, Ft as Y, Gt as or, I as ar, It as be, Kt as ir, L as cr, Lt as lr, M as dr, Mt as Ee, Nt as Te, Pt as ur, St as mr, Ut as hr, Vt as Re, Wt as gr, Zt as pr, _n as Z, a as fr, an as vr, at as yr, cn as Sr, dn as br, dt as Er, fn as Tr, gn as Ne, h as Rr, hn as ee, i as Nr, in as V, j as Cr, kt as Q, ln as Gr, mn as Ce, mt as Dr, n as qr, nn as Ir, ot as wr, pn as _r, pt as Pr, r as kr, rn as Ge, rt as Lr, s as $r, sn as Mr, t as De, tn as xr, un as Hr, w as Ar, xt as Br, yt as Or, z as Kr } from "./history-chords-
|
|
2
|
-
import { n as Ur } from "./theme.contract.css-
|
|
1
|
+
import { A as er, B as tr, Bt as rr, Dt as nr, Et as sr, Ft as Y, Gt as or, I as ar, It as be, Kt as ir, L as cr, Lt as lr, M as dr, Mt as Ee, Nt as Te, Pt as ur, St as mr, Ut as hr, Vt as Re, Wt as gr, Zt as pr, _n as Z, a as fr, an as vr, at as yr, cn as Sr, dn as br, dt as Er, fn as Tr, gn as Ne, h as Rr, hn as ee, i as Nr, in as V, j as Cr, kt as Q, ln as Gr, mn as Ce, mt as Dr, n as qr, nn as Ir, ot as wr, pn as _r, pt as Pr, r as kr, rn as Ge, rt as Lr, s as $r, sn as Mr, t as De, tn as xr, un as Hr, w as Ar, xt as Br, yt as Or, z as Kr } from "./history-chords-CpqPOjNc.js";
|
|
2
|
+
import { n as Ur } from "./theme.contract.css-DRIwwcHW.js";
|
|
3
3
|
import { COMPILER_STAGE_KEYS as te, Geom as qe, GraphCompilationSession as Ie, areEditTargetsEqual as we, buildDiagnostic as se, createAnchorResolver as _e, createCompiler as Pe, createDataLabelPlacementResolver as ke, createSpecBuilder as Le, createStyleResolver as he, findAnnotation as $e, findLayerById as oe, isCompilerCachingEnabled as Me, resolveDefinition as xe, setCompilerCachingEnabled as He, toPercent as U } from "@graphysdk/viz-engine";
|
|
4
4
|
import { Component as Ae, createContext as Be, useCallback as p, useContext as Oe, useEffect as H, useId as Ke, useImperativeHandle as Fe, useMemo as x, useRef as ae, useState as b, useSyncExternalStore as Ue } from "react";
|
|
5
5
|
import { Fragment as je, jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],r={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",gray100:"var(--graphy-gray-100)",gray95:"var(--graphy-gray-95)",gray90:"var(--graphy-gray-90)",gray85:"var(--graphy-gray-85)",gray80:"var(--graphy-gray-80)",gray75:"var(--graphy-gray-75)",gray70:"var(--graphy-gray-70)",gray60:"var(--graphy-gray-60)",gray50:"var(--graphy-gray-50)",gray0:"var(--graphy-gray-0)",grayGradient80:"var(--graphy-gray-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",annotationOutlineColor:"var(--graphy-annotation-outline-color)",editMenuTriggerIconColor:"var(--graphy-edit-menu-trigger-icon-color)",tooltipRowGap:"var(--graphy-tooltip-row-gap)",editorControlHeight:"var(--graphy-editor-control-height)",legendSwatchGap:"var(--graphy-legend-swatch-gap)",headlineRowGap:"var(--graphy-headline-row-gap)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",zIndexEditorPopover:"var(--graphy-z-index-editor-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",fontFamily:"var(--graphy-font-family)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)",fontEditorControlLabel:"var(--graphy-font-editor-control-label)",fontEditorControlValue:"var(--graphy-font-editor-control-value)",fontEditorSectionTitle:"var(--graphy-font-editor-section-title)",fontEditorCaption:"var(--graphy-font-editor-caption)"};Object.defineProperty(exports,"CANVAS_COLOR_KEYS",{enumerable:!0,get:function(){return a}});Object.defineProperty(exports,"vars",{enumerable:!0,get:function(){return r}});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"visualization",
|
|
12
12
|
"renderer"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.9.0-beta.
|
|
14
|
+
"version": "1.9.0-beta.1791362672521",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"**/*.css.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react-colorful": "^5.6.1",
|
|
56
56
|
"react-intl": "^8.1.3",
|
|
57
57
|
"zustand": "^5.0.12",
|
|
58
|
-
"@graphysdk/viz-engine": "1.9.0-beta.
|
|
58
|
+
"@graphysdk/viz-engine": "1.9.0-beta.1791362672521"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@tiptap/core": "^3.0.0",
|
package/dist/theme.contract.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require('./theme.contract.css');var a=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],r={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",gray100:"var(--graphy-gray-100)",gray95:"var(--graphy-gray-95)",gray90:"var(--graphy-gray-90)",gray85:"var(--graphy-gray-85)",gray80:"var(--graphy-gray-80)",gray75:"var(--graphy-gray-75)",gray70:"var(--graphy-gray-70)",gray60:"var(--graphy-gray-60)",gray50:"var(--graphy-gray-50)",gray0:"var(--graphy-gray-0)",grayGradient80:"var(--graphy-gray-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",legendFocusOutlineColor:"var(--graphy-legend-focus-outline-color)",annotationOutlineColor:"var(--graphy-annotation-outline-color)",editMenuTriggerIconColor:"var(--graphy-edit-menu-trigger-icon-color)",tooltipRowGap:"var(--graphy-tooltip-row-gap)",editorControlHeight:"var(--graphy-editor-control-height)",legendSwatchGap:"var(--graphy-legend-swatch-gap)",headlineRowGap:"var(--graphy-headline-row-gap)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",zIndexEditorPopover:"var(--graphy-z-index-editor-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",fontFamily:"var(--graphy-font-family)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)",fontEditorControlLabel:"var(--graphy-font-editor-control-label)",fontEditorControlValue:"var(--graphy-font-editor-control-value)",fontEditorSectionTitle:"var(--graphy-font-editor-section-title)",fontEditorCaption:"var(--graphy-font-editor-caption)"};Object.defineProperty(exports,"CANVAS_COLOR_KEYS",{enumerable:!0,get:function(){return a}});Object.defineProperty(exports,"vars",{enumerable:!0,get:function(){return r}});
|