semiotic 3.13.2 → 3.13.3
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/README.md +47 -46
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +4 -4
- package/ai/reference.md +23 -12
- package/ai/schema.json +258 -96
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/c-2YFVDRU4.min.js +1 -0
- package/dist/c-4OVDIXAR.min.js +1 -0
- package/dist/c-57IIWW46.min.js +1 -0
- package/dist/c-62UTMRQE.min.js +1 -0
- package/dist/c-6QV6F3U7.min.js +1 -0
- package/dist/c-7S46KBYD.min.js +2 -0
- package/dist/c-AJSS332Z.min.js +2 -0
- package/dist/c-B3X2IJRQ.min.js +1 -0
- package/dist/c-BLLDBVFK.min.js +38 -0
- package/dist/c-C7TT4J7K.min.js +1 -0
- package/dist/{c-ZMB3VTD4.min.js → c-CJ5GA7DM.min.js} +1 -1
- package/dist/c-D7YDFHLY.min.js +1 -0
- package/dist/{c-BR2TOCUN.min.js → c-DMDFJQU4.min.js} +1 -1
- package/dist/{c-JDU4Y4IW.min.js → c-FRVHZIGR.min.js} +1 -1
- package/dist/{c-MSZ3ZDAP.min.js → c-HAZCVHI7.min.js} +1 -1
- package/dist/c-HN5U72U7.min.js +1 -0
- package/dist/c-JA5F7ITS.min.js +1 -0
- package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
- package/dist/{c-OOR2LN4A.min.js → c-KJGJEOSV.min.js} +1 -1
- package/dist/c-M2TPZE7P.min.js +1 -0
- package/dist/c-OA6RJZ7S.min.js +1 -0
- package/dist/c-OBBSIOYU.min.js +1 -0
- package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
- package/dist/{c-HOMJ3C6B.min.js → c-QSEAAHEU.min.js} +1 -1
- package/dist/c-RQWI623R.min.js +1 -0
- package/dist/{c-WFSEQ2XG.min.js → c-RWFADOKS.min.js} +1 -1
- package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
- package/dist/{c-H5THWQI4.min.js → c-TOXWQRXS.min.js} +3 -3
- package/dist/c-VBDWHTC7.min.js +1 -0
- package/dist/c-VBIPDCE7.min.js +1 -0
- package/dist/c-WTNRBWZZ.min.js +51 -0
- package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
- package/dist/c-XPNBS3W2.min.js +1 -0
- package/dist/c-XT3G3YWU.min.js +1 -0
- package/dist/c-ZP6O6UHV.min.js +1 -0
- package/dist/c-ZVL7ULNH.min.js +1 -0
- package/dist/components/ChartErrorBoundary.d.ts +5 -1
- package/dist/components/ai/intentWeights.d.ts +22 -0
- package/dist/components/ai/streamSchema.d.ts +98 -0
- package/dist/components/ai/streamingTypes.d.ts +27 -4
- package/dist/components/ai/suggestCharts.d.ts +10 -2
- package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
- package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
- package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
- package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
- package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
- package/dist/components/charts/realtime/aggregate.d.ts +11 -12
- package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
- package/dist/components/charts/realtime/eventTime.d.ts +7 -1
- package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
- package/dist/components/charts/shared/ChartError.d.ts +4 -6
- package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
- package/dist/components/charts/shared/axisExtent.d.ts +2 -1
- package/dist/components/charts/shared/chartMode.d.ts +2 -2
- package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
- package/dist/components/charts/shared/types.d.ts +3 -0
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
- package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
- package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
- package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
- package/dist/components/legendGeometry.d.ts +148 -0
- package/dist/components/legendLayout.d.ts +20 -38
- package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
- package/dist/components/realtime/SlidingExtent.d.ts +18 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
- package/dist/components/realtime/renderers/types.d.ts +1 -0
- package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
- package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
- package/dist/components/recipes/compositional/metrics.d.ts +2 -2
- package/dist/components/recipes/compositional/projection.d.ts +3 -1
- package/dist/components/recipes/compositional/routing.d.ts +3 -1
- package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
- package/dist/components/recipes/compositional/topology.d.ts +2 -0
- package/dist/components/recipes/compositional/types.d.ts +10 -1
- package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +3 -2
- package/dist/components/semiotic-ai-stream.d.ts +3 -2
- package/dist/components/semiotic-recipes-react.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +2 -0
- package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +5 -0
- package/dist/components/server/staticLegendText.d.ts +13 -0
- package/dist/components/server/staticSVGChrome.d.ts +2 -2
- package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
- package/dist/components/stream/FrameRuntime.d.ts +3 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
- package/dist/components/stream/IngestActivity.d.ts +9 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
- package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +8 -3
- package/dist/components/stream/accessibleDataRows.d.ts +1 -0
- package/dist/components/stream/axisTickUtils.d.ts +25 -5
- package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
- package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
- package/dist/components/stream/geoTypes.d.ts +2 -0
- package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
- package/dist/components/stream/hitTestUtils.d.ts +7 -0
- package/dist/components/stream/keyboardNav.d.ts +3 -1
- package/dist/components/stream/navigationGraph.d.ts +10 -3
- package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
- package/dist/components/stream/networkNavGroups.d.ts +3 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
- package/dist/components/stream/networkSceneTypes.d.ts +10 -0
- package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
- package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
- package/dist/components/stream/ordinalTypes.d.ts +11 -2
- package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
- package/dist/components/stream/pipelineConfig.d.ts +7 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
- package/dist/components/stream/roundScaleDomain.d.ts +9 -0
- package/dist/components/stream/stalenessBands.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
- package/dist/components/stream/types.d.ts +10 -2
- package/dist/components/stream/useFrame.d.ts +7 -4
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
- package/dist/components/stream/useStalenessCheck.d.ts +5 -3
- package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
- package/dist/components/stream/xyDateTicks.d.ts +33 -4
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
- package/dist/components/types/legendTypes.d.ts +12 -1
- package/dist/geo.min.js +155 -152
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-ai-core.d.ts +3 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +5 -5
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1022 -1018
- package/dist/semiotic-client-compositional.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.d.ts +2 -0
- package/dist/semiotic-recipes-react.min.js +8 -8
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +399 -394
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +399 -394
- package/dist/semiotic-utils-core.d.ts +2 -0
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +399 -394
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +11 -11
- package/dist/c-27SDQN3J.min.js +0 -1
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-4EUQNA7N.min.js +0 -2
- package/dist/c-5EPR4KFB.min.js +0 -1
- package/dist/c-5KZ3NO6X.min.js +0 -1
- package/dist/c-7UN2WUMI.min.js +0 -1
- package/dist/c-BRBTXINY.min.js +0 -1
- package/dist/c-C3Z7ZRAA.min.js +0 -1
- package/dist/c-C4WRRUZ5.min.js +0 -1
- package/dist/c-CXDAWBOW.min.js +0 -1
- package/dist/c-DJ6DT5BL.min.js +0 -51
- package/dist/c-DNBFFE3P.min.js +0 -1
- package/dist/c-HR5AH3MA.min.js +0 -1
- package/dist/c-HTL37JCD.min.js +0 -1
- package/dist/c-JS2D7A2P.min.js +0 -1
- package/dist/c-L6OT4OVA.min.js +0 -1
- package/dist/c-NB2UEX5C.min.js +0 -1
- package/dist/c-OU7A3IUL.min.js +0 -1
- package/dist/c-PNLTF6YG.min.js +0 -37
- package/dist/c-QVKOXC3S.min.js +0 -1
- package/dist/c-SIQVOV6A.min.js +0 -1
- package/dist/c-TBMFC5CR.min.js +0 -1
- package/dist/c-XF5ILLBG.min.js +0 -1
- package/dist/c-YQHGEETR.min.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function o({componentName:e,message:t,diagnosticHint:i,width:r,height:n}){return k("div",{role:"alert",style:{width:r,height:Math.max(n,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:L("div",{style:{textAlign:"center",maxWidth:400},children:[k("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),k("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),i&&k("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:i})]})})}function s({componentName:t,width:i,height:r,children:n}){return E(e,{fallback:e=>E(o,{componentName:t,message:e.message,width:i,height:r}),children:n})}function u(e){return typeof window>"u"?void 0:window.matchMedia?.(e)}function c(e,t={}){if("function"==typeof e)return e;let i=t.locale??"en-US",r=t.currency??"USD";if("currency"===e){let e=t.precision??2,n=new Intl.NumberFormat(i,{style:"currency",currency:r,maximumFractionDigits:e,minimumFractionDigits:e});return e=>n.format(e)}if("percent"===e){let e=t.precision??1,r=new Intl.NumberFormat(i,{style:"percent",maximumFractionDigits:e,minimumFractionDigits:0});return e=>r.format(e)}if("compact"===e){let e=t.precision??1,r=new Intl.NumberFormat(i,{notation:"compact",maximumFractionDigits:e,minimumFractionDigits:0});return e=>r.format(e)}if("duration"===e)return e=>m(e);let n=t.precision??0,a=new Intl.NumberFormat(i,{notation:t.notation??"standard",maximumFractionDigits:n,minimumFractionDigits:0});return e=>a.format(e)}function m(e){if(!Number.isFinite(e))return String(e);let t=e<0?"-":"",i=Math.abs(e),r=Math.round(i);if(r<1e3)return`${t}${r}ms`;let n=Math.round(i/10)/100;if(n<60)return`${t}${function(e){return String(Math.round(100*e)/100)}(n)}s`;let a=Math.round(i/1e3);if(a<3600)return`${t}${d(Math.floor(a/60),"m",a%60,"s")}`;let l=Math.round(i/6e4);if(l<1440)return`${t}${d(Math.floor(l/60),"h",l%60,"m")}`;let o=Math.round(i/36e5);return`${t}${d(Math.floor(o/24),"d",o%24,"h")}`}function d(e,t,i,r){return 0===i?`${e}${t}`:`${e}${t} ${i}${r}`}function h(e,t,i){return`${t??""}${e}${i??""}`}function b(e,t){return 0===e||t(Math.abs(e))===t(0)}function f(e,t){return Number.isFinite(e)?b(e,t)?t(0):`${e>0?"+":"−"}${t(Math.abs(e))}`:""}function p(e,t,i="en-US",r=1){if(!Number.isFinite(e)||!Number.isFinite(t)||0===e)return null;let n=(t-e)/Math.abs(e);return new Intl.NumberFormat(i,{style:"percent",maximumFractionDigits:r,minimumFractionDigits:0,signDisplay:"exceptZero"}).format(n)}function g(e,t){if(!t||0===t.length||!Number.isFinite(e))return null;let i=t.filter(e=>Number.isFinite(e.at)||e.at===-1/0).slice().sort((e,t)=>e.at-t.at),r=null;for(let t of i){if(!(e>=t.at))break;r=t}return r}function y(e,t){return t||("neutral"===e?"var(--semiotic-text, currentColor)":`var(--semiotic-${e}, currentColor)`)}function v(e,t){let i=t.padding??1;if(0===e.length)return{line:"",area:"",points:[]};if(1===e.length){let e=t.width/2,i=t.height/2;return{line:`M${e},${i}`,area:"",points:[{x:e,y:i}]}}let r=t.yMin??e.reduce((e,t)=>Number.isFinite(t)&&t<e?t:e,1/0),n=(t.yMax??e.reduce((e,t)=>Number.isFinite(t)&&t>e?t:e,-1/0))-r||1,a=Math.max(0,t.width-2*i),l=Math.max(0,t.height-2*i),o=a/(e.length-1),s=[],u="";for(let t=0;t<e.length;t++){let a=e[t];if(!Number.isFinite(a))continue;let c=i+t*o,m=i+l-(a-r)/n*l;u+=`${0===s.length?"M":"L"}${c.toFixed(2)},${m.toFixed(2)}`,s.push({x:c,y:m})}if(0===s.length)return{line:"",area:"",points:[]};let c=s[0],m=i+l;return{line:u,area:`${u} L${s[s.length-1].x.toFixed(2)},${m.toFixed(2)} L${c.x.toFixed(2)},${m.toFixed(2)} Z`,points:s}}function x(e,t){return e.displayName=t,e}function w(e,t,i){return void 0===e?i:"function"==typeof e?e(t):e}function N(e){return"positive"===e?"var(--semiotic-success, currentColor)":"negative"===e?"var(--semiotic-danger, currentColor)":"var(--semiotic-text-secondary, currentColor)"}function S(e){return"positive"===e?"▲":"negative"===e?"▼":"■"}function F(e){let t=Math.floor(.45*e.width),i=Math.floor(.6*e.width),r=(e,t)=>q("div",{style:{width:e,height:t,background:"var(--semiotic-border, #e0e0e0)",borderRadius:4,opacity:.55}});return O("div",{style:{display:"flex",flexDirection:"column",gap:10,justifyContent:"center",width:"100%",height:"100%"},children:["thumbnail"!==e.mode&&"inline"!==e.mode?r(t,10):null,r(i,"presentation"===e.mode?48:28),"tile"===e.mode||"presentation"===e.mode?r(Math.floor(.35*e.width),8):null]})}import{forwardRef as $,useCallback as _,useEffect as z,useImperativeHandle as D,useMemo as M,useRef as C,useState as I}from"react";import{Component as j}from"react";import{jsx as k,jsxs as L}from"react/jsx-runtime";import{jsx as T}from"react/jsx-runtime";var e=class extends j{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){let{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:T(o,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{jsx as E}from"react/jsx-runtime";import{useState as B,useEffect as H}from"react";import{useEffect as R,useLayoutEffect as W,useRef as V,useState as A,useSyncExternalStore as P}from"react";var t=()=>()=>{},i=()=>!1,r=()=>!0;import{useMemo as U}from"react";import{Fragment as Z,jsx as q,jsxs as O}from"react/jsx-runtime";var n={tile:{width:280,height:184,align:"start",labelSize:13,captionSize:11,valueSize:40,deltaSize:13,padding:{top:14,right:16,bottom:14,left:16},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:44},presentation:{width:540,height:320,align:"center",labelSize:18,captionSize:14,valueSize:96,deltaSize:18,padding:{top:32,right:32,bottom:32,left:32},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:80},inline:{width:void 0,height:void 0,align:"inherit",labelSize:0,captionSize:0,valueSize:0,deltaSize:0,padding:{top:0,right:0,bottom:0,left:0},background:"transparent",border:!1,showHeader:!1,showDelta:!0,showTrend:!1,showChart:!1,chartSize:0},thumbnail:{width:96,height:56,align:"center",labelSize:0,captionSize:0,valueSize:22,deltaSize:0,padding:{top:4,right:6,bottom:4,left:6},background:"transparent",border:!1,showHeader:!1,showDelta:!1,showTrend:!1,showChart:!1,chartSize:0}},a=/*#__PURE__*/x(/*#__PURE__*/$((e,a)=>{let{value:l,label:o,caption:m,format:d,locale:p,currency:v,precision:x,prefix:$,suffix:j,unit:k,comparison:L,target:T,delta:E,deltaFormat:R,showDeltaPercent:W,direction:A,sentiment:X,thresholds:Y,windowSize:G=60,mode:J="tile",align:K,width:Q,height:ee,padding:te,emphasis:ie,color:re,background:ne,borderColor:ae,borderRadius:le,className:oe,style:se,animate:ue,stalenessThreshold:ce,staleLabel:me,headerSlot:de,valueSlot:he,deltaSlot:be,trendSlot:fe,chartSlot:pe,chartSize:ge,footerSlot:ye,onClick:ve,onObservation:xe,chartId:we,description:Ne,summary:Se,loading:Fe,loadingContent:$e,emptyContent:_e}=e,ze=n[J]??n.tile,De=K??ze.align,Me=Q??ze.width,Ce=ee??ze.height,Ie=function(e){let[t,i]=B(()=>u(e)?.matches??!1);return H(()=>{let t=u(e);return i(t?.matches??!1),function(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}(t,e=>i(e.matches))},[e]),t}("(prefers-reduced-motion: reduce)"),je=function(){let e=P(t,i,r);return V(e).current}(),[ke,Le]=I([]),[Te,Ee]=I(null),[Be,He]=I(null),[Re,We]=I(null),Ve=C([]),Ae=C(null),Pe=C(l);z(()=>{Pe.current=l},[l]);let Ue=C(G);z(()=>{Ue.current=G},[G]);let Ze=_(e=>{let t="number"==typeof e?{value:e,time:Date.now()}:{time:Date.now(),...e},i="number"==typeof t.time?t.time:t.time instanceof Date?t.time.getTime():Date.now();return{...t,time:i}},[]),qe=_(e=>{if(0===e.length)return;let t=Ue.current,i=e.map(Ze),r=Ve.current.concat(i);r.length>t&&(r=r.slice(r.length-t)),Ve.current=r;let n=i[i.length-1];Ae.current=n.value,Le(r),Ee(n.value);for(let e=i.length-1;e>=0;e--){let t=i[e].comparison;if(null!=t){He(t);break}}We(n.time)},[Ze]),Oe=_(e=>qe([e]),[qe]);D(a,()=>({push:e=>Oe(e),pushMany:e=>qe(e),clear:()=>{Ve.current=[],Ae.current=null,Le([]),Ee(null),He(null),We(null)},getValue:()=>Ae.current??(Number.isFinite(Pe.current)?Pe.current:null),getData:()=>Ve.current.slice()}),[Oe,qe]);let Xe=Te??l,Ye=null==Xe||"number"!=typeof Xe||!Number.isFinite(Xe),Ge=M(()=>c(d??"number",{locale:p,currency:v,precision:x}),[d,p,v,x]),Je=M(()=>c(R??d??"number",{locale:p,currency:v,precision:null==R&&null==d?0:x}),[R,d,p,v,x]),Ke=ue??!1,Qe=("object"!=typeof Ke||!1!==Ke.intro)&&!!Ke,et=Number.isFinite(Xe)?Xe:0,tt=function(e,t,i,r=e){let[n,a]=I(()=>r),l=C(r),o=C(null),s=C(e),u=C(0),c=!!t,m="object"==typeof t?t.duration:void 0,d="number"==typeof m&&Number.isFinite(m)?Math.max(0,m):300,h="object"==typeof t&&"linear"===t.easing?"linear":"ease-out",b=C(e);return z(()=>{let t=e=>{l.current=e,a(e)};if(!Number.isFinite(e))return void t(e);if(!c||i)return void t(e);if(0===d)return void t(e);s.current=l.current,b.current=e,u.current=typeof performance<"u"?performance.now():Date.now();let r="linear"===h?e=>e:e=>1-Math.pow(1-e,3),n=e=>{let i=Math.min(1,(e-u.current)/d),a=r(i),l=s.current+(b.current-s.current)*a;t(l),i<1?o.current=requestAnimationFrame(n):(o.current=null,t(b.current))};return o.current=requestAnimationFrame(n),()=>{null!=o.current&&cancelAnimationFrame(o.current),o.current=null}},[c,d,h,i,e]),n}(et,Ke,Ie,C(!Qe||Ie||je?et:0).current),it=Ke?tt:Number.isFinite(Xe)?Xe:0,rt=M(()=>g(Number.isFinite(Xe)?Xe:NaN,Y),[Xe,Y]),nt=rt?rt.level:"neutral",at=re??y(nt,rt?.color),lt=Be??L?.value??null,ot=E??(null!=lt&&Number.isFinite(Xe)?Xe-lt:null),st=null!=ot&&Number.isFinite(ot)&&b(ot,Je)?0:ot,ut=function(e,t,i){if(i&&"auto"!==i)return i;if(null==e||0===e||!Number.isFinite(e))return"neutral";let r=t??"higher-is-better";return"neutral"===r?"neutral":("higher-is-better"===r?e>0:e<0)?"positive":"negative"}(st,L?.direction??T?.direction??A,X),ct=null!=ot&&Number.isFinite(ot)?f(ot,Je):null,mt=M(()=>new Intl.NumberFormat(p??"en-US",{style:"percent",maximumFractionDigits:1,minimumFractionDigits:0,signDisplay:"exceptZero"}),[p]),dt=null!=lt&&Number.isFinite(Xe)&&(W??!0)&&0!==lt?mt.format((Xe-lt)/Math.abs(lt)):null,ht=function({target:e,value:t,format:i,locale:r,currency:n,precision:a}){let l=U(()=>new Intl.NumberFormat(r??"en-US",{style:"percent",maximumFractionDigits:0}),[r]),o=U(()=>c(e?.format??i??"number",{locale:r,currency:n,precision:a}),[e?.format,i,r,n,a]);return U(()=>{if(!e||!Number.isFinite(e.value))return null;let i="number"==typeof t&&Number.isFinite(t)&&0!==e.value?l.format(t/e.value):null,r=o(e.value),n=i?e.label?`${i} of ${e.label} (${r})`:`${i} of ${r}`:e.label?`target ${e.label} (${r})`:`target ${r}`;return{label:e.label,percent:i,formattedValue:r,text:n}},[e,t,o,l])}({target:T,value:Xe,format:d,locale:p,currency:v,precision:x}),bt=ht?.percent??null,ft=ht?.text??null,pt=function(e,t){let[i,r]=I(!1);return z(()=>{if(!t||null==e)return void r(!1);let i=()=>{let i=Date.now()-e;r(i>=t)};i();let n=setInterval(i,Math.max(250,Math.floor(t/4)));return()=>clearInterval(n)},[e,t]),i}(Re,ce),gt=Number.isFinite(it)?h(Ge(it),$,j):"",yt={value:Ye?null:Xe,formattedValue:gt,level:nt,color:at,delta:ot,deltaFormatted:ct,deltaPercent:dt,sentiment:ut,isStale:pt,pushBuffer:ke},vt=Ne??function(e){let t=[];if(e.label&&t.push(`${e.label}:`),t.push(e.unit?`${e.formattedValue} ${e.unit}`:e.formattedValue),e.deltaFormatted){let i=e.delta,r=null!=i&&Number.isFinite(i)&&0!==i?i>0?"up":"down":"change",n=e.deltaPercent?` (${e.deltaPercent})`:"",a=e.comparisonLabel?` from ${e.comparisonLabel}`:"";t.push(`${r} ${e.deltaFormatted}${n}${a}`)}return e.targetText&&t.push(e.targetText),e.thresholdLabel&&t.push(e.thresholdLabel),e.stale&&t.push(e.staleLabel??"stale"),t.join(", ")}({label:o,formattedValue:Number.isFinite(Xe)?h(Ge(Xe),$,j):"",unit:k,comparisonLabel:L?.label,delta:st,deltaFormatted:ct,deltaPercent:dt,targetText:ft,thresholdLabel:rt?.label,stale:pt,staleLabel:me}),xt="number"==typeof te?{top:te,right:te,bottom:te,left:te}:{...ze.padding,...te??{}},wt="end"===De?"flex-end":"center"===De?"center":"start"===De?"flex-start":"inherit",Nt={position:"relative",boxSizing:"border-box",width:Me,height:Ce,padding:`${xt.top}px ${xt.right}px ${xt.bottom}px ${xt.left}px`,background:ne??ze.background,border:ze.border?`1px solid ${ae??"var(--semiotic-border, #e2e2e2)"}`:void 0,borderRadius:"number"==typeof le?`${le}px`:le??"var(--semiotic-border-radius, 8px)",display:"inline"===J?"inline-flex":"flex",flexDirection:"column",alignItems:"inherit"===wt?void 0:wt,textAlign:De,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",color:"var(--semiotic-text, #111)",opacity:pt?.55:1,transition:"opacity 240ms ease-out",gridColumn:"primary"===ie?"span 2":void 0,cursor:ve?"pointer":void 0,...se},St=_(e=>{let t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,r=e.clientY-t.top,n={value:Ye?Number.NaN:Xe,level:nt,delta:ot};ve&&ve(n,{x:i,y:r}),xe&&xe({type:"click",datum:n,x:i,y:r,chartType:"BigNumber",chartId:we,timestamp:Date.now()})},[ve,xe,we,Ye,Xe,nt,ot]),Ft="inline"===J?"span":"div",$t=["semiotic-bignumber",`semiotic-bignumber--mode-${J}`,`semiotic-bignumber--level-${nt}`,`semiotic-bignumber--sentiment-${ut}`,pt?"semiotic-bignumber--stale":null,oe].filter(Boolean).join(" "),_t="positive"===ut?"up":"negative"===ut?"down":"flat";if(Fe){let e="number"==typeof Me?Me:280,t="number"==typeof Ce?Ce:160;return q(Ft,{role:"status","aria-live":"polite","aria-busy":"true",className:`${$t} semiotic-bignumber--loading`,style:{...Nt,opacity:1},children:$e??q(F,{width:e,height:t,mode:J})})}return Ye?!1===_e?null:q(Ft,{role:"status","aria-label":o?`${o}: no value`:"no value",className:`${$t} semiotic-bignumber--empty`,style:{...Nt,color:"var(--semiotic-text-secondary, #666)",fontSize:13,alignItems:"center",justifyContent:"center"},children:_e??"—"}):q(s,{componentName:"BigNumber",width:"number"==typeof Me?Me:280,height:"number"==typeof Ce?Ce:160,children:O(Ft,{role:"group","aria-label":vt,"data-chart":"BigNumber","data-mode":J,"data-level":nt,"data-stale":pt?"true":void 0,"data-sentiment":ut,className:$t,style:Nt,onClick:ve||xe?St:void 0,children:[ze.showHeader&&(o||m||de)?q("div",{className:"semiotic-bignumber__header",style:{display:"flex",flexDirection:"column",gap:2,marginBottom:6,paddingRight:ze.showChart&&null!=pe?(ge??ze.chartSize)+8:0},children:w(de,yt,O(Z,{children:[o?q("span",{className:"semiotic-bignumber__label",style:{fontSize:ze.labelSize,color:"var(--semiotic-text-secondary, #6b7280)",fontWeight:500,letterSpacing:.2},children:o}):null,m?q("span",{className:"semiotic-bignumber__caption",style:{fontSize:ze.captionSize,color:"var(--semiotic-text-secondary, #9ca3af)"},children:m}):null]}))}):null,w(he,yt,O(Ft,{className:`semiotic-bignumber__value semiotic-bignumber__value--${nt}`,style:{display:"inline"===J?"inline-flex":"flex",alignItems:"baseline",gap:6,fontVariantNumeric:"tabular-nums",fontWeight:600,color:at,fontSize:ze.valueSize||void 0,lineHeight:1.05},children:[q("span",{className:"semiotic-bignumber__value-text",children:gt}),k?q("span",{className:"semiotic-bignumber__unit",style:{fontSize:ze.valueSize?Math.max(11,Math.round(.32*ze.valueSize)):"0.75em",color:"var(--semiotic-text-secondary, #9ca3af)",fontWeight:500},children:k}):null]})),ze.showDelta&&(ct||ht||L)?q(Ft,{className:`semiotic-bignumber__delta semiotic-bignumber__delta--${_t}`,style:{display:"inline"===J?"inline-flex":"flex",flexWrap:"wrap",gap:8,alignItems:"baseline",marginTop:"inline"===J?0:6,fontSize:ze.deltaSize||void 0,color:"var(--semiotic-text-secondary, #6b7280)"},children:w(be,yt,O(Z,{children:[ct?O("span",{className:`semiotic-bignumber__delta-row semiotic-bignumber__delta-row--${_t}`,style:{display:"inline-flex",alignItems:"center",gap:4,color:N(ut),fontWeight:600},children:[q("span",{"aria-hidden":"true",className:`semiotic-bignumber__arrow semiotic-bignumber__arrow--${_t}`,children:S(ut)}),q("span",{className:"semiotic-bignumber__delta-amount",children:ct}),dt?O("span",{className:"semiotic-bignumber__delta-percent",style:{fontWeight:500},children:["(",dt,")"]}):null]}):null,L?.label?q("span",{className:"semiotic-bignumber__comparison-label",children:L.label}):null,ht?O("span",{className:"semiotic-bignumber__target",style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[ct||L?.label?q("span",{"aria-hidden":"true",className:"semiotic-bignumber__separator",children:"·"}):null,q("span",{className:"semiotic-bignumber__target-percent",style:{fontWeight:500,color:"var(--semiotic-text, #111)"},children:bt}),O("span",{className:"semiotic-bignumber__target-value",children:["of ",ht.formattedValue,ht.label?` ${ht.label}`:""]})]}):null]}))}):null,ze.showChart&&null!=pe?q("div",{className:"semiotic-bignumber__chart",style:{position:"absolute",top:xt.top,right:xt.right,width:ge??ze.chartSize,height:ge??ze.chartSize,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:q("div",{style:{pointerEvents:"auto",lineHeight:0},children:w(pe,yt,null)})}):null,ze.showTrend&&null!=fe?q("div",{className:"semiotic-bignumber__trend",style:{position:"absolute",left:xt.left,right:xt.right,bottom:xt.bottom+(null!=ye?28:0)},children:w(fe,yt,null)}):null,null!=ye?q(Ft,{className:"semiotic-bignumber__footer",style:{position:"absolute",left:xt.left,right:xt.right,bottom:xt.bottom,fontSize:ze.deltaSize||void 0,color:"var(--semiotic-text-secondary, #9ca3af)"},children:w(ye,yt,null)}):null,Se?q("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:Se}):null]})})}),"BigNumber"),l=a;export{a as BigNumber,l as BigNumberDefault,c as buildFormatter,v as buildSparklinePath,y as colorForLevel,p as formatDeltaPercent,m as formatDuration,f as formatSignedDelta,g as resolveThreshold};
|
|
2
|
+
function e(e){return typeof window>"u"?void 0:window.matchMedia?.(e)}function t(e,t={}){if("function"==typeof e)return e;let r=t.locale??"en-US",n=t.currency??"USD";if("currency"===e){let e=t.precision??2,i=new Intl.NumberFormat(r,{style:"currency",currency:n,maximumFractionDigits:e,minimumFractionDigits:e});return e=>i.format(e)}if("percent"===e){let e=t.precision??1,i=new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:e,minimumFractionDigits:0});return e=>i.format(e)}if("compact"===e){let e=t.precision??1,i=new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:e,minimumFractionDigits:0});return e=>i.format(e)}if("duration"===e)return e=>i(e);let a=t.precision??0,l=new Intl.NumberFormat(r,{notation:t.notation??"standard",maximumFractionDigits:a,minimumFractionDigits:0});return e=>l.format(e)}function i(e){if(!Number.isFinite(e))return String(e);let t=e<0?"-":"",i=Math.abs(e),n=Math.round(i);if(n<1e3)return`${t}${n}ms`;let a=Math.round(i/10)/100;if(a<60)return`${t}${function(e){return String(Math.round(100*e)/100)}(a)}s`;let l=Math.round(i/1e3);if(l<3600)return`${t}${r(Math.floor(l/60),"m",l%60,"s")}`;let o=Math.round(i/6e4);if(o<1440)return`${t}${r(Math.floor(o/60),"h",o%60,"m")}`;let s=Math.round(i/36e5);return`${t}${r(Math.floor(s/24),"d",s%24,"h")}`}function r(e,t,i,r){return 0===i?`${e}${t}`:`${e}${t} ${i}${r}`}function n(e,t,i){return`${t??""}${e}${i??""}`}function a(e,t){return 0===e||t(Math.abs(e))===t(0)}function l(e,t){return Number.isFinite(e)?a(e,t)?t(0):`${e>0?"+":"−"}${t(Math.abs(e))}`:""}function o(e,t,i="en-US",r=1){if(!Number.isFinite(e)||!Number.isFinite(t)||0===e)return null;let n=(t-e)/Math.abs(e);return new Intl.NumberFormat(i,{style:"percent",maximumFractionDigits:r,minimumFractionDigits:0,signDisplay:"exceptZero"}).format(n)}function s(e,t){if(!t||0===t.length||!Number.isFinite(e))return null;let i=t.filter(e=>Number.isFinite(e.at)||e.at===-1/0).slice().sort((e,t)=>e.at-t.at),r=null;for(let t of i){if(!(e>=t.at))break;r=t}return r}function u(e,t){return t||("neutral"===e?"var(--semiotic-text, currentColor)":`var(--semiotic-${e}, currentColor)`)}function c(e,t){let i=t.padding??1;if(0===e.length)return{line:"",area:"",points:[]};if(1===e.length){let e=t.width/2,i=t.height/2;return{line:`M${e},${i}`,area:"",points:[{x:e,y:i}]}}let r=t.yMin??e.reduce((e,t)=>Number.isFinite(t)&&t<e?t:e,1/0),n=(t.yMax??e.reduce((e,t)=>Number.isFinite(t)&&t>e?t:e,-1/0))-r||1,a=Math.max(0,t.width-2*i),l=Math.max(0,t.height-2*i),o=a/(e.length-1),s=[],u="";for(let t=0;t<e.length;t++){let a=e[t];if(!Number.isFinite(a))continue;let c=i+t*o,m=i+l-(a-r)/n*l;u+=`${0===s.length?"M":"L"}${c.toFixed(2)},${m.toFixed(2)}`,s.push({x:c,y:m})}if(0===s.length)return{line:"",area:"",points:[]};let c=s[0],m=i+l;return{line:u,area:`${u} L${s[s.length-1].x.toFixed(2)},${m.toFixed(2)} L${c.x.toFixed(2)},${m.toFixed(2)} Z`,points:s}}function m({componentName:e,message:t,width:i,height:r}){return V("div",{role:"alert",style:{width:i,height:"number"==typeof r?Math.max(r,120):r,display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:P("div",{style:{textAlign:"center",maxWidth:400},children:[V("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),V("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t})]})})}function d(e,t,i){let r=e,n=R.forwardRef(function(e,n){return U(x,{fallback:r=>{let n=i(e);return U(m,{componentName:t,message:r.message,width:e.responsiveWidth?"100%":n.width??"auto",height:e.responsiveHeight?"100%":"number"==typeof n.height?`${n.height}px`:n.height??"auto"})},children:U(r,{...e,...null==n?{}:{ref:n}})})});return n.displayName=t,n}function h(e,t,i){return void 0===e?i:"function"==typeof e?e(t):e}function b(e){return"positive"===e?"var(--semiotic-success, currentColor)":"negative"===e?"var(--semiotic-danger, currentColor)":"var(--semiotic-text-secondary, currentColor)"}function f(e){return"positive"===e?"▲":"negative"===e?"▼":"■"}function p(e){let t=Math.floor(.45*e.width),i=Math.floor(.6*e.width),r=(e,t)=>q("div",{style:{width:e,height:t,background:"var(--semiotic-border, #e0e0e0)",borderRadius:4,opacity:.55}});return K("div",{style:{display:"flex",flexDirection:"column",gap:10,justifyContent:"center",width:"100%",height:"100%"},children:["thumbnail"!==e.mode&&"inline"!==e.mode?r(t,10):null,r(i,"presentation"===e.mode?48:28),"tile"===e.mode||"presentation"===e.mode?r(Math.floor(.35*e.width),8):null]})}import{forwardRef as $,useCallback as F,useEffect as _,useImperativeHandle as z,useMemo as D,useRef as M,useState as C}from"react";import{useState as j,useEffect as I}from"react";import{useEffect as L,useLayoutEffect as k,useRef as T,useState as E,useSyncExternalStore as B}from"react";var g=()=>()=>{},y=()=>!1,v=()=>!0;import{useMemo as H}from"react";import*as R from"react";import{Component as W}from"react";import{jsx as V,jsxs as P}from"react/jsx-runtime";import{jsx as A}from"react/jsx-runtime";var x=class extends W{constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){if(!this.state.error||!t.error)return;let i=e.resetKeys??[e.children],r=this.props.resetKeys??[this.props.children];(i.length!==r.length||r.some((e,t)=>!Object.is(e,i[t])))&&this.reset()}render(){if(this.state.error){let{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t,this.reset):void 0!==e?e:A(m,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:"100%",height:"100%"})}return this.props.children}};import{jsx as U}from"react/jsx-runtime";import{Fragment as Z,jsx as q,jsxs as K}from"react/jsx-runtime";var w={tile:{width:280,height:184,align:"start",labelSize:13,captionSize:11,valueSize:40,deltaSize:13,padding:{top:14,right:16,bottom:14,left:16},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:44},presentation:{width:540,height:320,align:"center",labelSize:18,captionSize:14,valueSize:96,deltaSize:18,padding:{top:32,right:32,bottom:32,left:32},background:"var(--semiotic-surface, transparent)",border:!0,showHeader:!0,showDelta:!0,showTrend:!0,showChart:!0,chartSize:80},inline:{width:void 0,height:void 0,align:"inherit",labelSize:0,captionSize:0,valueSize:0,deltaSize:0,padding:{top:0,right:0,bottom:0,left:0},background:"transparent",border:!1,showHeader:!1,showDelta:!0,showTrend:!1,showChart:!1,chartSize:0},thumbnail:{width:96,height:56,align:"center",labelSize:0,captionSize:0,valueSize:22,deltaSize:0,padding:{top:4,right:6,bottom:4,left:6},background:"transparent",border:!1,showHeader:!1,showDelta:!1,showTrend:!1,showChart:!1,chartSize:0}},N=/*#__PURE__*/d(/*#__PURE__*/$((i,r)=>{let{value:o,label:c,caption:m,format:d,locale:x,currency:N,precision:S,prefix:$,suffix:L,unit:k,comparison:E,target:R,delta:W,deltaFormat:V,showDeltaPercent:P,direction:A,sentiment:U,thresholds:O,windowSize:X=60,mode:Y="tile",align:G,width:J,height:Q,padding:ee,emphasis:te,color:ie,background:re,borderColor:ne,borderRadius:ae,className:le,style:oe,animate:se,stalenessThreshold:ue,staleLabel:ce,headerSlot:me,valueSlot:de,deltaSlot:he,trendSlot:be,chartSlot:fe,chartSize:pe,footerSlot:ge,onClick:ye,onObservation:ve,chartId:xe,description:we,summary:Ne,loading:Se,loadingContent:$e,emptyContent:Fe}=i,_e=w[Y]??w.tile,ze=G??_e.align,De=J??_e.width,Me=Q??_e.height,Ce=function(t){let[i,r]=j(()=>e(t)?.matches??!1);return I(()=>{let i=e(t);return r(i?.matches??!1),function(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}(i,e=>r(e.matches))},[t]),i}("(prefers-reduced-motion: reduce)"),je=function(){let e=B(g,y,v);return T(e).current}(),[Ie,Le]=C([]),[ke,Te]=C(null),[Ee,Be]=C(null),[He,Re]=C(null),We=M([]),Ve=M(null),Pe=M(o);_(()=>{Pe.current=o},[o]);let Ae=M(X);_(()=>{Ae.current=X},[X]);let Ue=F(e=>{let t="number"==typeof e?{value:e,time:Date.now()}:{time:Date.now(),...e},i="number"==typeof t.time?t.time:t.time instanceof Date?t.time.getTime():Date.now();return{...t,time:i}},[]),Ze=F(e=>{if(0===e.length)return;let t=Ae.current,i=e.map(Ue),r=We.current.concat(i);r.length>t&&(r=r.slice(r.length-t)),We.current=r;let n=i[i.length-1];Ve.current=n.value,Le(r),Te(n.value);for(let e=i.length-1;e>=0;e--){let t=i[e].comparison;if(null!=t){Be(t);break}}Re(n.time)},[Ue]),qe=F(e=>Ze([e]),[Ze]);z(r,()=>({push:e=>qe(e),pushMany:e=>Ze(e),clear:()=>{We.current=[],Ve.current=null,Le([]),Te(null),Be(null),Re(null)},getValue:()=>Ve.current??(Number.isFinite(Pe.current)?Pe.current:null),getData:()=>We.current.slice()}),[qe,Ze]);let Ke=ke??o,Oe=null==Ke||"number"!=typeof Ke||!Number.isFinite(Ke),Xe=D(()=>t(d??"number",{locale:x,currency:N,precision:S}),[d,x,N,S]),Ye=D(()=>t(V??d??"number",{locale:x,currency:N,precision:null==V&&null==d?0:S}),[V,d,x,N,S]),Ge=se??!1,Je=("object"!=typeof Ge||!1!==Ge.intro)&&!!Ge,Qe=Number.isFinite(Ke)?Ke:0,et=function(e,t,i,r=e){let[n,a]=C(()=>r),l=M(r),o=M(null),s=M(e),u=M(0),c=!!t,m="object"==typeof t?t.duration:void 0,d="number"==typeof m&&Number.isFinite(m)?Math.max(0,m):300,h="object"==typeof t&&"linear"===t.easing?"linear":"ease-out",b=M(e);return _(()=>{let t=e=>{l.current=e,a(e)};if(!Number.isFinite(e))return void t(e);if(!c||i)return void t(e);if(0===d)return void t(e);s.current=l.current,b.current=e,u.current=typeof performance<"u"?performance.now():Date.now();let r="linear"===h?e=>e:e=>1-Math.pow(1-e,3),n=e=>{let i=Math.min(1,(e-u.current)/d),a=r(i),l=s.current+(b.current-s.current)*a;t(l),i<1?o.current=requestAnimationFrame(n):(o.current=null,t(b.current))};return o.current=requestAnimationFrame(n),()=>{null!=o.current&&cancelAnimationFrame(o.current),o.current=null}},[c,d,h,i,e]),n}(Qe,Ge,Ce,M(!Je||Ce||je?Qe:0).current),tt=Ge?et:Number.isFinite(Ke)?Ke:0,it=D(()=>s(Number.isFinite(Ke)?Ke:NaN,O),[Ke,O]),rt=it?it.level:"neutral",nt=ie??u(rt,it?.color),at=Ee??E?.value??null,lt=W??(null!=at&&Number.isFinite(Ke)?Ke-at:null),ot=null!=lt&&Number.isFinite(lt)&&a(lt,Ye)?0:lt,st=function(e,t,i){if(i&&"auto"!==i)return i;if(null==e||0===e||!Number.isFinite(e))return"neutral";let r=t??"higher-is-better";return"neutral"===r?"neutral":("higher-is-better"===r?e>0:e<0)?"positive":"negative"}(ot,E?.direction??R?.direction??A,U),ut=null!=lt&&Number.isFinite(lt)?l(lt,Ye):null,ct=D(()=>new Intl.NumberFormat(x??"en-US",{style:"percent",maximumFractionDigits:1,minimumFractionDigits:0,signDisplay:"exceptZero"}),[x]),mt=null!=at&&Number.isFinite(Ke)&&(P??!0)&&0!==at?ct.format((Ke-at)/Math.abs(at)):null,dt=function({target:e,value:i,format:r,locale:n,currency:a,precision:l}){let o=H(()=>new Intl.NumberFormat(n??"en-US",{style:"percent",maximumFractionDigits:0}),[n]),s=H(()=>t(e?.format??r??"number",{locale:n,currency:a,precision:l}),[e?.format,r,n,a,l]);return H(()=>{if(!e||!Number.isFinite(e.value))return null;let t="number"==typeof i&&Number.isFinite(i)&&0!==e.value?o.format(i/e.value):null,r=s(e.value),n=t?e.label?`${t} of ${e.label} (${r})`:`${t} of ${r}`:e.label?`target ${e.label} (${r})`:`target ${r}`;return{label:e.label,percent:t,formattedValue:r,text:n}},[e,i,s,o])}({target:R,value:Ke,format:d,locale:x,currency:N,precision:S}),ht=dt?.percent??null,bt=dt?.text??null,ft=function(e,t){let[i,r]=C(!1);return _(()=>{if(!t||null==e)return void r(!1);let i=()=>{let i=Date.now()-e;r(i>=t)};i();let n=setInterval(i,Math.max(250,Math.floor(t/4)));return()=>clearInterval(n)},[e,t]),i}(He,ue),pt=Number.isFinite(tt)?n(Xe(tt),$,L):"",gt={value:Oe?null:Ke,formattedValue:pt,level:rt,color:nt,delta:lt,deltaFormatted:ut,deltaPercent:mt,sentiment:st,isStale:ft,pushBuffer:Ie},yt=we??function(e){let t=[];if(e.label&&t.push(`${e.label}:`),t.push(e.unit?`${e.formattedValue} ${e.unit}`:e.formattedValue),e.deltaFormatted){let i=e.delta,r=null!=i&&Number.isFinite(i)&&0!==i?i>0?"up":"down":"change",n=e.deltaPercent?` (${e.deltaPercent})`:"",a=e.comparisonLabel?` from ${e.comparisonLabel}`:"";t.push(`${r} ${e.deltaFormatted}${n}${a}`)}return e.targetText&&t.push(e.targetText),e.thresholdLabel&&t.push(e.thresholdLabel),e.stale&&t.push(e.staleLabel??"stale"),t.join(", ")}({label:c,formattedValue:Number.isFinite(Ke)?n(Xe(Ke),$,L):"",unit:k,comparisonLabel:E?.label,delta:ot,deltaFormatted:ut,deltaPercent:mt,targetText:bt,thresholdLabel:it?.label,stale:ft,staleLabel:ce}),vt="number"==typeof ee?{top:ee,right:ee,bottom:ee,left:ee}:{..._e.padding,...ee??{}},xt="end"===ze?"flex-end":"center"===ze?"center":"start"===ze?"flex-start":"inherit",wt={position:"relative",boxSizing:"border-box",width:De,height:Me,padding:`${vt.top}px ${vt.right}px ${vt.bottom}px ${vt.left}px`,background:re??_e.background,border:_e.border?`1px solid ${ne??"var(--semiotic-border, #e2e2e2)"}`:void 0,borderRadius:"number"==typeof ae?`${ae}px`:ae??"var(--semiotic-border-radius, 8px)",display:"inline"===Y?"inline-flex":"flex",flexDirection:"column",alignItems:"inherit"===xt?void 0:xt,textAlign:ze,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",color:"var(--semiotic-text, #111)",opacity:ft?.55:1,transition:"opacity 240ms ease-out",gridColumn:"primary"===te?"span 2":void 0,cursor:ye?"pointer":void 0,...oe},Nt=F(e=>{let t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,r=e.clientY-t.top,n={value:Oe?Number.NaN:Ke,level:rt,delta:lt};ye&&ye(n,{x:i,y:r}),ve&&ve({type:"click",datum:n,x:i,y:r,chartType:"BigNumber",chartId:xe,timestamp:Date.now()})},[ye,ve,xe,Oe,Ke,rt,lt]),St="inline"===Y?"span":"div",$t=["semiotic-bignumber",`semiotic-bignumber--mode-${Y}`,`semiotic-bignumber--level-${rt}`,`semiotic-bignumber--sentiment-${st}`,ft?"semiotic-bignumber--stale":null,le].filter(Boolean).join(" "),Ft="positive"===st?"up":"negative"===st?"down":"flat";if(Se){let e="number"==typeof De?De:280,t="number"==typeof Me?Me:160;return q(St,{role:"status","aria-live":"polite","aria-busy":"true",className:`${$t} semiotic-bignumber--loading`,style:{...wt,opacity:1},children:$e??q(p,{width:e,height:t,mode:Y})})}return Oe?!1===Fe?null:q(St,{role:"status","aria-label":c?`${c}: no value`:"no value",className:`${$t} semiotic-bignumber--empty`,style:{...wt,color:"var(--semiotic-text-secondary, #666)",fontSize:13,alignItems:"center",justifyContent:"center"},children:Fe??"—"}):K(St,{role:"group","aria-label":yt,"data-chart":"BigNumber","data-mode":Y,"data-level":rt,"data-stale":ft?"true":void 0,"data-sentiment":st,className:$t,style:wt,onClick:ye||ve?Nt:void 0,children:[_e.showHeader&&(c||m||me)?q("div",{className:"semiotic-bignumber__header",style:{display:"flex",flexDirection:"column",gap:2,marginBottom:6,paddingRight:_e.showChart&&null!=fe?(pe??_e.chartSize)+8:0},children:h(me,gt,K(Z,{children:[c?q("span",{className:"semiotic-bignumber__label",style:{fontSize:_e.labelSize,color:"var(--semiotic-text-secondary, #6b7280)",fontWeight:500,letterSpacing:.2},children:c}):null,m?q("span",{className:"semiotic-bignumber__caption",style:{fontSize:_e.captionSize,color:"var(--semiotic-text-secondary, #9ca3af)"},children:m}):null]}))}):null,h(de,gt,K(St,{className:`semiotic-bignumber__value semiotic-bignumber__value--${rt}`,style:{display:"inline"===Y?"inline-flex":"flex",alignItems:"baseline",gap:6,fontVariantNumeric:"tabular-nums",fontWeight:600,color:nt,fontSize:_e.valueSize||void 0,lineHeight:1.05},children:[q("span",{className:"semiotic-bignumber__value-text",children:pt}),k?q("span",{className:"semiotic-bignumber__unit",style:{fontSize:_e.valueSize?Math.max(11,Math.round(.32*_e.valueSize)):"0.75em",color:"var(--semiotic-text-secondary, #9ca3af)",fontWeight:500},children:k}):null]})),_e.showDelta&&(ut||dt||E)?q(St,{className:`semiotic-bignumber__delta semiotic-bignumber__delta--${Ft}`,style:{display:"inline"===Y?"inline-flex":"flex",flexWrap:"wrap",gap:8,alignItems:"baseline",marginTop:"inline"===Y?0:6,fontSize:_e.deltaSize||void 0,color:"var(--semiotic-text-secondary, #6b7280)"},children:h(he,gt,K(Z,{children:[ut?K("span",{className:`semiotic-bignumber__delta-row semiotic-bignumber__delta-row--${Ft}`,style:{display:"inline-flex",alignItems:"center",gap:4,color:b(st),fontWeight:600},children:[q("span",{"aria-hidden":"true",className:`semiotic-bignumber__arrow semiotic-bignumber__arrow--${Ft}`,children:f(st)}),q("span",{className:"semiotic-bignumber__delta-amount",children:ut}),mt?K("span",{className:"semiotic-bignumber__delta-percent",style:{fontWeight:500},children:["(",mt,")"]}):null]}):null,E?.label?q("span",{className:"semiotic-bignumber__comparison-label",children:E.label}):null,dt?K("span",{className:"semiotic-bignumber__target",style:{display:"inline-flex",alignItems:"baseline",gap:4},children:[ut||E?.label?q("span",{"aria-hidden":"true",className:"semiotic-bignumber__separator",children:"·"}):null,q("span",{className:"semiotic-bignumber__target-percent",style:{fontWeight:500,color:"var(--semiotic-text, #111)"},children:ht}),K("span",{className:"semiotic-bignumber__target-value",children:["of ",dt.formattedValue,dt.label?` ${dt.label}`:""]})]}):null]}))}):null,_e.showChart&&null!=fe?q("div",{className:"semiotic-bignumber__chart",style:{position:"absolute",top:vt.top,right:vt.right,width:pe??_e.chartSize,height:pe??_e.chartSize,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:q("div",{style:{pointerEvents:"auto",lineHeight:0},children:h(fe,gt,null)})}):null,_e.showTrend&&null!=be?q("div",{className:"semiotic-bignumber__trend",style:{position:"absolute",left:vt.left,right:vt.right,bottom:vt.bottom+(null!=ge?28:0)},children:h(be,gt,null)}):null,null!=ge?q(St,{className:"semiotic-bignumber__footer",style:{position:"absolute",left:vt.left,right:vt.right,bottom:vt.bottom,fontSize:_e.deltaSize||void 0,color:"var(--semiotic-text-secondary, #9ca3af)"},children:h(ge,gt,null)}):null,Ne?q("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:Ne}):null]})}),"BigNumber",e=>{let t=w[e.mode??"tile"]??w.tile;return{width:e.width??t.width,height:e.height??t.height}}),S=N;export{N as BigNumber,S as BigNumberDefault,t as buildFormatter,c as buildSparklinePath,u as colorForLevel,o as formatDeltaPercent,i as formatDuration,l as formatSignedDelta,s as resolveThreshold};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{a as darkenColor,b as lightenColor}from"./c-ATM475SA.min.js";export{a as useForceLayout}from"./c-HOMJ3C6B.min.js";export{a as registerBuiltInXYPlugins}from"./c-HR5AH3MA.min.js";export{aC as AccessibleNavTree,bc as ChartContainer,bf as ChartGrid,bg as ContextLayout,bh as DetailsPanel,bv as IntentMark,bx as MobileAnnotationCalloutList,bd as MobileChartContainer,aG as MobileStandardControls,bk as ObservationReadout,be as SmallMultipleChart,e as auditVisualizationControls,an as buildNavigationTree,aD as clampMobileRange,W as configToJSX,X as configToJSXWithReport,V as copyConfig,bs as dashboardIntentManifest,Z as deserializeSelections,a as exportChart,S as fromConfig,U as fromURL,$ as fromVegaLite,bu as intentManifestFromRecipe,bl as observedDatum,Y as serializeSelections,bt as summarizeIntentManifest,R as toConfig,T as toURL,aF as useMobileRangeControls,bw as useNavigationSync,aE as zoomMobileRange}from"./c-H5THWQI4.min.js";import{b as t}from"./c-G7EPPJDS.min.js";export{a as VISUALIZATION_CONTROL_TYPES,b as createControlObservationAdapter}from"./c-G7EPPJDS.min.js";import{a as s,b as u}from"./c-ZMB3VTD4.min.js";export{d as CARBON_ALERT,c as CARBON_CATEGORICAL_14,e as THEME_PRESETS,g as ThemeProvider,f as resolveThemePreset,b as themeToCSSVariables}from"./c-ZMB3VTD4.min.js";export{g as AreaChart,k as BubbleChart,f as BumpChart,q as CandlestickChart,b as ConnectedScatterplot,h as DifferenceChart,j as Heatmap,m as MinimapChart,p as MultiAxisLineChart,o as QuadrantChart,a as Scatterplot,l as ScatterplotMatrix,i as StackedAreaChart,r as WaterfallChart,c as XYCustomChart,e as rankBumpData}from"./c-DJ6DT5BL.min.js";export{e as LineChart}from"./c-5EPR4KFB.min.js";export{b as BarChart,f as BoxPlot,l as DonutChart,j as DotPlot,o as FunnelChart,m as GaugeChart,n as GroupedBarChart,g as Histogram,d as LikertChart,r as OrdinalCustomChart,k as PieChart,p as RadarChart,i as RidgelinePlot,c as StackedBarChart,a as StreamOrdinalFrame,e as SwarmPlot,q as SwimlaneChart,h as ViolinPlot}from"./c-27SDQN3J.min.js";export{b as ChordDiagram,n as CirclePack,a as ForceDirectedGraph,p as NetworkCustomChart,o as OrbitDiagram,k as ProcessSankey,c as SankeyDiagram,l as TreeDiagram,m as Treemap,f as diagnoseProcessSankeyLayout,h as diagnoseProcessSankeyProps,g as explainProcessSankeyLayout,e as formatProcessSankeyIssue,i as inventoryAtTime,j as toProcessSankeyTime,d as validateProcessSankey}from"./c-TBMFC5CR.min.js";export{p as RealtimeHeatmap,k as RealtimeHistogram,i as RealtimeLineChart,n as RealtimeSwarmChart,m as RealtimeTemporalHistogram,o as RealtimeWaterfallChart,l as TemporalHistogram}from"./c-PNLTF6YG.min.js";import"./c-JS2D7A2P.min.js";import"./c-5NAU4JAY.min.js";export{f as StreamXYFrame}from"./c-BRBTXINY.min.js";import{a as y}from"./c-XF5ILLBG.min.js";export{d as IncrementalExtent,a as pointerToLocalPoint}from"./c-XF5ILLBG.min.js";export{a as RingBuffer}from"./c-5KZ3NO6X.min.js";export{b as StreamNetworkFrame,a as useNetworkPerspective}from"./c-CXDAWBOW.min.js";export{f as preloadNetworkPerspectiveExtras}from"./c-PTFHNN34.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{C as AnnotationLabel,be as CategoryColorProvider,a$ as ChartErrorBoundary,bv as LinkedCharts,aM as MultiLineTooltip,aR as MultiPointTooltip,aL as Tooltip,D as annotationStableId,f as compileMotionEncoding,bP as composeStyleRules,j as deriveMotionVector,B as estimateLabelWidth,aN as isMultiTooltip,bL as makeNodeRuleContext,bJ as makeRuleValueResolver,bQ as makeStyleRuleStyleFn,bK as makeXYRuleContext,bM as matchesThreshold,aS as normalizeTooltip,h as opacityFromAge,e as resolveMotionAccessor,g as resolveMotionAge,i as resolveMotionVector,aP as resolveMultiCapableTooltip,bm as resolveResponsiveRules,bO as resolveStyleRules,aQ as resolveTooltipContent,bl as responsiveRuleMatches,bN as ruleMatches,aK as smartTooltipEntries,bR as styleRulesToNodeStyle,bT as styleRulesToPieceStyle,bS as styleRulesToXYStyle,bj as useBrushSelection,bf as useCategoryColors,br as useChartObserver,S as useCrosshairPosition,bk as useFilteredData,bs as useLinkedChartsActive,T as useLinkedCrosshair,bi as useLinkedHover,bg as useSelection,bh as useSelectionActions}from"./c-L6OT4OVA.min.js";export{h as createHatchPattern,j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-JDI7HKEM.min.js";export{d as COLOR_BLIND_SAFE_CATEGORICAL,f as DARK_THEME,g as HIGH_CONTRAST_THEME,e as LIGHT_THEME,A as TooltipRoot,D as hasOwnTooltipChrome,w as hasTooltipContent,C as markTooltipChrome,H as useTheme}from"./c-HTL37JCD.min.js";import{b as v,c as x}from"./c-GRTKU3C7.min.js";import*as M from"react";import{useRef as P,useMemo as I,useEffect as F}from"react";import{jsx as O,jsxs as N}from"react/jsx-runtime";export{NetworkPerspectiveBillboard,NetworkPerspectiveGround}from"./semiotic-network-placement.module.min.js";var L=2*Math.PI;function E(e,t,r){let a=r?.center?.x??0,o=r?.center?.y??0;return{x:a+Math.sin(e)*t,y:o-Math.cos(e)*t}}function z(e,t,r,a,o){let n=o?.center,i=(e,t)=>{let{x:r,y:a}=E(e,t,{center:n});return`${G(r)},${G(a)}`},s=Math.max(0,r),l=Math.max(s,a),c=Math.abs(t-e),u=t>=e?1:0;if(c>=L-1e-6){let e=n?.x??0,t=n?.y??0,r=`${G(e)},${G(t-l)}`,a=`${G(e)},${G(t+l)}`,o=`M${r} A${G(l)},${G(l)} 0 1 1 ${a} A${G(l)},${G(l)} 0 1 1 ${r} Z`;if(s>0){let r=`${G(e)},${G(t-s)}`,a=`${G(e)},${G(t+s)}`;o+=` M${r} A${G(s)},${G(s)} 0 1 0 ${a} A${G(s)},${G(s)} 0 1 0 ${r} Z`}return o}let m=c>Math.PI?1:0,p=i(e,l),d=i(t,l);if(s<=0){let e=n?.x??0,t=n?.y??0;return`M${G(e)},${G(t)} L${p} A${G(l)},${G(l)} 0 ${m} ${u} ${d} Z`}let h=i(t,s),y=i(e,s);return`M${p} A${G(l)},${G(l)} 0 ${m} ${u} ${d} L${h} A${G(s)},${G(s)} 0 ${m} ${1===u?0:1} ${y} Z`}function G(e){return Math.round(1e3*e)/1e3}var J="var(--semiotic-focus, #005fcc)";function Q(e){return Number(e.toPrecision(12))}function K(e){try{return e.matches(":focus-visible")}catch{return!0}}function _({value:e,onChange:r,period:a=365,radius:o=180,innerRadius:n=14,width:i,height:s,step:l,largeStep:c,label:u="Range",formatValue:m,arcFill:p="var(--semiotic-primary, #4e79a7)",stroke:d="var(--semiotic-bg, #ffffff)",onObservation:h,controlType:y="range-boundary",controlId:f,chartId:$,chartType:g="CircularBrush",className:v,style:b}){let C=i??2*o+40,T=s??2*o+40,x=C/2,S=T/2,j=function(e){let[t,r]=e,a=r-t||1,o=L;return e=>0+(e-t)/a*(o-0)}([0,a]),k=Number.isInteger(a)&&a>=2,D=null!=l&&l>0?l:k?1:a/100,I=null!=c&&c>0?c:k?7:10*D,w=Q(Math.max(0,Math.ceil(a/D-1e-9)-1)*D),A=P(null),R=P(e);R.current=e;let[F,B]=M.useState(null),U=P(!1),V=M.useMemo(()=>t({controlType:y,controlId:f,chartId:$,chartType:g,onObservation:h}),[y,f,$,g,h]),W=e=>{let t=Q(function(e,t,r=0){return t<=0?e:((e-r)%t+t)%t+r}(e,a));return t>=a?0:t},H=(e,t)=>e.end-e.start>=a?e:{start:W(e.start+t),end:W(e.end+t)},G=(e,t,a)=>{let o=e(R.current);R.current=o;let n=[o.start,o.end];a.start&&V("control-start",n,t),r(e),V("control-change",n,t),a.end&&V("control-end",n,t)},Y=e=>{let t=e.currentTarget.ownerSVGElement??e.currentTarget,r=t.getBoundingClientRect(),o=t.viewBox?.baseVal,n=o?.width||C,i=o?.height||T;return s=(e.clientX-r.left)*(n/(r.width||1))-x,l=(e.clientY-r.top)*(i/(r.height||1))-S,c=(Math.atan2(s-0,-(l-0))+L)%L/L*a,W(Q(Math.round(c/D)*D));var s,l,c},X=(e,t)=>{e.preventDefault(),e.stopPropagation();let r=e.currentTarget;r.ownerDocument?.activeElement!==r&&(U.current=!0,r.focus?.({preventScroll:!0}),U.current=!1),r.ownerSVGElement?.setPointerCapture?.(e.pointerId),A.current={mode:t,lastValue:Y(e),changed:!1}},Z=e=>{let t=e.currentTarget.ownerSVGElement??e.currentTarget;t?.hasPointerCapture?.(e.pointerId)&&t.releasePointerCapture(e.pointerId);let r=A.current;if(A.current=null,r?.changed){let e=R.current;V("control-end",[e.start,e.end],"pointer")}},_=e=>G(e,"keyboard",{start:!0,end:!0}),q=(e,t)=>{_("range"===e?e=>H(e,t):r=>({...r,[e]:W(r[e]+t)}))},ee=(e,t)=>{_("range"===e?e=>H(e,t-e.start):r=>({...r,[e]:t}))},te=e=>t=>{let r=t.shiftKey?I:D,a={ArrowRight:()=>q(e,r),ArrowUp:()=>q(e,r),ArrowLeft:()=>q(e,-r),ArrowDown:()=>q(e,-r),PageUp:()=>q(e,I),PageDown:()=>q(e,-I),Home:()=>ee(e,0),End:()=>ee(e,w)}[t.key];a&&(t.preventDefault(),a())},re=e=>({onFocus:t=>B({mode:e,visible:!U.current&&K(t.currentTarget)}),onBlur:()=>B(null)}),ae=e=>F?.mode===e&&F.visible,oe=e.start<=e.end?[[e.start,e.end]]:[[e.start,a],[0,e.end]],ne=e=>m?m(e):String(e);return O("svg",{viewBox:`0 0 ${C} ${T}`,width:C,height:T,className:v,onPointerMove:e=>{let t=A.current;if(!t)return;let r=Y(e),o=!t.changed;if("range"===t.mode){let e=function(e,t,r){if(r<=0)return t-e;let a=(t-e)%r;return a>r/2?a-=r:a<=-r/2&&(a+=r),a}(t.lastValue,r,a);if(0===e)return;return t.lastValue=r,t.changed=!0,void G(t=>H(t,e),"pointer",{start:o,end:!1})}let n=t.mode;R.current[n]!==r&&(t.changed=!0,G(e=>({...e,[n]:r}),"pointer",{start:o,end:!1}))},onPointerUp:Z,onPointerCancel:Z,onLostPointerCapture:Z,style:{touchAction:"none",...b},"aria-label":`${u} brush`,"data-viz-control-id":f,children:N("g",{transform:`translate(${x},${S})`,children:[O("g",{role:"slider",tabIndex:0,"aria-label":`${u} (move both ends)`,"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":e.start,"aria-valuetext":`${ne(e.start)} to ${ne(e.end)}`,onPointerDown:e=>X(e,"range"),onKeyDown:te("range"),...re("range"),style:{cursor:"grab",outline:"none"},children:oe.map(([e,t],r)=>O("path",{d:z(j(e),j(t),n,o),fill:p,fillOpacity:.35,stroke:ae("range")?J:d,strokeWidth:ae("range")?3:1},r))}),["start","end"].map(t=>{let r=e[t],i=(e=>E(j(e),n))(r),s=(e=>E(j(e),o+8))(r);return N("g",{role:"slider",tabIndex:0,"aria-label":`${u} ${t}`,"aria-valuemin":0,"aria-valuemax":"end"===t&&e.end===a?a:w,"aria-valuenow":r,"aria-valuetext":ne(r),onPointerDown:e=>X(e,t),onKeyDown:te(t),...re(t),style:{cursor:"grab",outline:"none"},children:[O("line",{x1:i.x,y1:i.y,x2:s.x,y2:s.y,stroke:"transparent",strokeWidth:20}),O("line",{x1:i.x,y1:i.y,x2:s.x,y2:s.y,stroke:d,strokeWidth:1.5}),O("circle",{cx:s.x,cy:s.y,r:4.5,fill:d,stroke:p,strokeWidth:1}),ae(t)&&O("circle",{cx:s.x,cy:s.y,r:8,fill:"none",stroke:J,strokeWidth:2})]},t)})]})})}function ee(e,t,r,a,o){let n=Math.min(r,Math.max(t,e));if(!(a>0))return n;let i=o+Math.round((n-o)/a)*a;return Math.min(r,Math.max(t,Number(i.toFixed(12))))}function te(e,t,r,{min:a,max:o,step:n,largeStep:i}){let s=t?i:n;switch(e){case"ArrowLeft":case"ArrowDown":return r-s;case"ArrowRight":case"ArrowUp":return r+s;case"PageDown":return r-i;case"PageUp":return r+i;case"Home":return a;case"End":return o;default:return null}}function re({value:e,onChange:r,pointToValue:a,pointerToValue:o,min:n,max:i,step:s=1,stepOrigin:l=n,largeStep:c=5*s,x:u,y:m,controlType:p="value",controlId:d,label:h,ariaRoleDescription:f,valueText:$,radius:g=12,fill:v="var(--semiotic-bg, #ffffff)",stroke:b="var(--semiotic-primary, #4e79a7)",strokeWidth:C=4,labelText:T,labelDx:x=16,labelDy:S=-16,labelClassName:j,className:k,disabled:D=!1,onChangeStart:I,onChangeEnd:w,onObservation:A,chartId:R,chartType:F}){let L=P(null),E=P(e);E.current=e;let B=M.useMemo(()=>t({controlType:p,controlId:d,chartId:R,chartType:F,onObservation:A}),[R,F,d,p,A]),U=e=>{if(D)return;let t=(e=>{if(a){let t=y(e);return t?a(t):null}return o?.(e)})(e);if(null==t||!Number.isFinite(t))return;let c=ee(t,n,i,s,l);E.current=c,r(c),B("control-change",c,"pointer")},V=e=>{e.stopPropagation(),L.current===e.pointerId&&(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),L.current=null,w?.(E.current),B("control-end",E.current,"pointer"))},W=["semiotic-direct-manipulation-control",k].filter(Boolean).join(" ");return N("g",{className:W,role:"slider",tabIndex:D?-1:0,"aria-disabled":D||void 0,"aria-label":h,"aria-valuemin":n,"aria-valuemax":i,"aria-valuenow":e,"aria-valuetext":$??`${h}: ${e}`,"aria-roledescription":f,"data-viz-control":p,"data-viz-control-id":d,"data-viz-control-state":"controlled",pointerEvents:"all",onPointerDown:e=>{D||(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),L.current=e.pointerId,I?.(E.current),B("control-start",E.current,"pointer"),U(e))},onPointerMove:e=>{e.stopPropagation(),L.current===e.pointerId&&U(e)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onKeyDown:e=>{if(D)return;let t=E.current,a=te(e.key,e.shiftKey,t,{min:n,max:i,step:s,largeStep:c});if(null===a)return;e.preventDefault();let o=ee(a,n,i,s,l);o!==t&&(I?.(t),B("control-start",t,"keyboard"),E.current=o,r(o),B("control-change",o,"keyboard"),w?.(o),B("control-end",o,"keyboard"))},style:{cursor:D?"default":"grab",touchAction:"none"},children:[O("circle",{className:"semiotic-direct-manipulation-control__hit",cx:u,cy:m,r:g+10,fill:"transparent"}),O("circle",{className:"semiotic-direct-manipulation-control__handle",cx:u,cy:m,r:g,fill:v,stroke:b,strokeWidth:C}),T?O("text",{className:j,x:u+x,y:m+S,fill:b,children:T}):null]})}function ae({values:e,onChange:r,markers:a,valueToPoint:o,pointToValue:n,min:i,max:s,step:l=1,stepOrigin:c=i,largeStep:u=5*l,ordered:m=!0,label:p,ariaRoleDescription:d,controlType:h="value",controlId:f="markers",radius:$=12,fill:g="var(--semiotic-bg, #ffffff)",stroke:b="var(--semiotic-primary, #4e79a7)",strokeWidth:C=4,labelDx:T=16,labelDy:S=-16,labelClassName:j,className:k,disabled:D=!1,onChangeStart:I,onChangeEnd:w,onObservation:A,chartId:R,chartType:F}){let L=P([...e]);L.current=[...e];let E=P(null),B=M.useMemo(()=>a.map((e,r)=>t({controlType:h,controlId:e.controlId??`${f}-${r}`,chartId:R,chartType:F,onObservation:A})),[R,F,f,h,a,A]),U=(e,t)=>m?{lo:e>0?Math.max(i,t[e-1]):i,hi:e<t.length-1?Math.min(s,t[e+1]):s}:{lo:i,hi:s},V=(e,t,a)=>{let{lo:o,hi:n}=U(e,L.current),i=ee(t,o,n,l,c);if(i===L.current[e])return!1;let s=[...L.current];return s[e]=i,L.current=s,r(s,{index:e,source:a}),B[e]?.("control-change",i,a),!0},W=(e,t)=>{let r=y(e),a=r?n(r,t):null;return null!=a&&Number.isFinite(a)?a:null},H=e=>t=>{if(D)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture?.(t.pointerId);let r=L.current[e],a=m?L.current.flatMap((e,t)=>e===r?[t]:[]):[e];E.current={pointerId:t.pointerId,pressedIndex:e,startValue:r,coincident:a,active:a.length>1?null:e};let o={index:e,source:"pointer"};if(I?.([...L.current],o),B[e]?.("control-start",r,"pointer"),1===a.length){let r=W(t,e);null!=r&&V(e,r,"pointer")}},z=e=>{e.stopPropagation();let t=E.current;if(!t||t.pointerId!==e.pointerId)return;let r=W(e,t.active??t.pressedIndex);if(null!=r){if(null===t.active){if(r===t.startValue)return;t.active=r<t.startValue?v(t.coincident):x(t.coincident)}V(t.active,r,"pointer")}},G=e=>{e.stopPropagation();let t=E.current;if(!t||t.pointerId!==e.pointerId)return;e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),E.current=null;let r=t.active??t.pressedIndex;w?.([...L.current],{index:r,source:"pointer"}),B[r]?.("control-end",L.current[r],"pointer")},Y=e=>t=>{if(D)return;let{lo:r,hi:a}=U(e,L.current),o=L.current[e],n=te(t.key,t.shiftKey,o,{min:r,max:a,step:l,largeStep:u});if(null===n)return;t.preventDefault();let i={index:e,source:"keyboard"},s=[...L.current];ee(n,r,a,l,c)!==o&&(I?.(s,i),B[e]?.("control-start",o,"keyboard"),V(e,n,"keyboard"),w?.([...L.current],i),B[e]?.("control-end",L.current[e],"keyboard"))};return O("g",{className:["semiotic-direct-manipulation-markers",k].filter(Boolean).join(" "),role:"group","aria-label":p,children:e.map((t,r)=>{let n=a[r]??{label:`Marker ${r+1}`},i=o(t,r),{lo:s,hi:l}=U(r,e),c=n.stroke??b,u=n.radius??$;return N("g",{className:["semiotic-direct-manipulation-control",n.className].filter(Boolean).join(" "),role:"slider",tabIndex:D?-1:0,"aria-disabled":D||void 0,"aria-label":n.label,"aria-valuemin":s,"aria-valuemax":l,"aria-valuenow":t,"aria-valuetext":n.valueText?.(t)??`${n.label}: ${t}`,"aria-roledescription":d,"data-viz-control":h,"data-viz-control-id":n.controlId??`${f}-${r}`,"data-viz-control-state":"controlled",pointerEvents:"all",onPointerDown:H(r),onPointerMove:z,onPointerUp:G,onPointerCancel:G,onLostPointerCapture:G,onKeyDown:Y(r),style:{cursor:D?"default":"grab",touchAction:"none"},children:[O("circle",{className:"semiotic-direct-manipulation-control__hit",cx:i.x,cy:i.y,r:u+10,fill:"transparent"}),O("circle",{className:"semiotic-direct-manipulation-control__handle",cx:i.x,cy:i.y,r:u,fill:n.fill??g,stroke:c,strokeWidth:C}),n.labelText?O("text",{className:j,x:i.x+T,y:i.y+S,fill:c,children:n.labelText}):null]},n.controlId??r)})})}function oe(e,t=":root"){return s(t),`${t} {\n${Object.entries(u(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function ne(e){return{semiotic:{mode:{$value:e.mode,$type:"string"},bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},...null!=e.colors.focus?{focus:{$value:e.colors.focus,$type:"color"}}:{},...null!=e.colors.cellBorder?{"cell-border":{$value:e.colors.cellBorder,$type:"color"}}:{},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"title-size":{$value:`${e.typography.titleSize}px`,$type:"dimension"},...null!=e.borderRadius?{"border-radius":{$value:e.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip?{tooltip:{...null!=e.tooltip.background?{bg:{$value:e.tooltip.background,$type:"color"}}:{},...null!=e.tooltip.text?{text:{$value:e.tooltip.text,$type:"color"}}:{},...null!=e.tooltip.borderRadius?{radius:{$value:e.tooltip.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip.fontSize?{"font-size":{$value:e.tooltip.fontSize,$type:"dimension"}}:{},...null!=e.tooltip.shadow?{shadow:{$value:e.tooltip.shadow,$type:"shadow"}}:{},...null!=e.tooltip.chrome?{chrome:{$value:e.tooltip.chrome,$type:"string"}}:{}}}:{},...null!=e.colors.selection||null!=e.colors.selectionOpacity?{selection:{...null!=e.colors.selection?{color:{$value:e.colors.selection,$type:"color"}}:{},...null!=e.colors.selectionOpacity?{opacity:{$value:e.colors.selectionOpacity,$type:"number"}}:{}}}:{},...null!=e.accessibility?{accessibility:Object.fromEntries(Object.entries(e.accessibility).map(([e,t])=>[e,{$value:t,$type:"boolean"}]))}:{},categorical:{$value:[...e.colors.categorical],$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:`${e.typography.legendSize}px`,$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.titleFontSize?{"title-font-size":{$value:`${e.typography.titleFontSize}px`,$type:"dimension"}}:{},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:`${e.typography.tickSize}px`,$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:`${e.typography.labelSize}px`,$type:"dimension"}}:{},...null!=e.colors.secondary?{secondary:{$value:e.colors.secondary,$type:"color"}}:{},...null!=e.colors.surface?{surface:{$value:e.colors.surface,$type:"color"}}:{},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function ie(e){return e<10?`0${e}`:String(e)}var se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function le(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}var ce={year:!0,date:!0};function ue(e,t,r,a=ce){let{month:o,day:n,year:i,hours:s,minutes:l,seconds:c}=r(e),u=se[o],m=ie(s),p=ie(l),d=ie(c),h=a.year?`${u} ${n}, ${i} `:`${u} ${n} `;switch(t){case"seconds":return`${a.date?h:""}${m}:${p}:${d}`;case"minutes":case"hours":return`${a.date?h:""}${m}:${p}`;case"days":return a.year?`${u} ${n}, ${i}`:`${u} ${n}`;case"months":return a.year?`${u} ${i}`:`${u}`;case"years":return`${i}`}}function me(e,t={}){let r,a,o=e,n=(m=function(e={}){let t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}(t),"utc"===m.kind?e=>le(e,!0):"local"===m.kind?e=>le(e,!1):function(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>le(e,!0)}return e=>{let r={};for(let a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}(m.id)),{includeYear:i="always",includeDate:s="always"}=t,l="clock"===t.deltaStyle,c="auto"===i?n(new Date(t.referenceTime??Date.now())).year:void 0,u={referenceYear:!1,oneDay:!1};var m;return(t,m,p)=>{let d=t instanceof Date?t:new Date(t);!e&&p&&p.length>=2&&p!==r&&(r=p,o=function(e){if(e.length<2)return"days";let t=[];for(let r=1;r<e.length;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);let r=t[Math.floor(t.length/2)];return r<12e4?"seconds":r<72e5?"minutes":r<1728e5?"hours":r<5184e6?"days":r<3456e7?"months":"years"}(p));let h=o||"days";if(null==m||!p||0===p.length)return ue(d,h,n);let y="seconds"===h||"minutes"===h||"hours"===h,f="always"===i&&"always"===s?ce:{year:"years"===h||"never"!==i,date:!y||"never"!==s};if(0===m){if(f===ce)return ue(d,h,n);let{referenceYear:e,oneDay:t}="auto"===i||"auto"===s?(e=>{if(e!==a){a=e;let t=e.map(e=>n(new Date(e))),[r]=t;u={referenceYear:t.every(e=>e.year===c),oneDay:t.every(e=>e.year===r.year&&e.month===r.month&&e.day===r.day)}}return u})(p):u,r=f.date&&!(y&&"auto"===s&&t),o=r&&f.year&&!("years"!==h&&"auto"===i&&e);return ue(d,h,n,{year:o||"years"===h,date:r})}return function(e,t,r,a,o=ce,n=!1){let i=a(e),s=a(t),l=i.year!==s.year,c=l||i.month!==s.month,u=c||i.day!==s.day,m=u||i.hours!==s.hours,p=m||i.minutes!==s.minutes,d=o.date,h=l&&o.year,y=se[i.month],{day:f,year:$}=i,g=ie(i.hours),v=ie(i.minutes),b=ie(i.seconds);switch(r){case"seconds":return h&&d?`${y} ${f}, ${$} ${g}:${v}:${b}`:u&&d?`${y} ${f} ${g}:${v}:${b}`:m||n?`${g}:${v}:${b}`:p?`${v}:${b}`:`:${b}`;case"minutes":return h&&d?`${y} ${f}, ${$} ${g}:${v}`:u&&d?`${y} ${f} ${g}:${v}`:m||n?`${g}:${v}`:`:${v}`;case"hours":return h&&d?`${y} ${f}, ${$} ${g}:${v}`:u&&d?`${y} ${f} ${g}:${v}`:`${g}:${v}`;case"days":return h?`${y} ${f}, ${$}`:c||n?`${y} ${f}`:`${f}`;case"months":return h?`${y} ${$}`:`${y}`;case"years":return`${$}`}}(d,new Date(p[m-1]),h,n,f,l)}}var pe=[[1e3,"K"],[1e6,"M"],[1e9,"B"]];function de(e){if(null==e)return"";if("number"!=typeof e||!isFinite(e))return String(e);if(0===e)return"0";let t=parseFloat(e.toPrecision(12)),r=Math.abs(t);if(r>=1e4)for(let e=pe.length-1;e>=0;e--){let[a,o]=pe[e];if(r<a)continue;let n=parseFloat((t/a).toPrecision(3));if(Math.abs(n)>=1e3&&e<pe.length-1){let[r,a]=pe[e+1];return`${parseFloat((t/r).toPrecision(3))}${a}`}return`${n}${o}`}return Number.isInteger(t)?String(t):String(parseFloat(t.toPrecision(6)))}function he(e,t,r,a){let o=new Map,n=null==a;if(r.forEach((e,t)=>{let r=a?.(e,t);(null==r||o.has(r))&&(n=!0),o.set(r??String(t),e)}),n&&(o.clear(),r.forEach((e,t)=>o.set(String(t),e))),0===t.size)return ye(e,[...r]),o;let i=[...t.values()],s=null==a||[...t.keys()].some((e,t)=>a(i[t],t)!==e);if(n||s)return i.length<=r.length&&i.every((e,t)=>e===r[t])&&n===s?ye(e,r.slice(i.length)):fe(e,r),o;let l=[];if(t.forEach((e,t)=>{o.has(t)||l.push(t)}),l.length>0&&!e.remove||!e.update&&!e.remove&&[...o].some(([e,r])=>t.has(e)&&t.get(e)!==r))return fe(e,r),o;l.length>0&&e.remove?.(l);let c=[];return o.forEach((r,a)=>{let o=t.get(a);void 0===o?c.push(r):o!==r&&(e.update?e.update(a,()=>r):(e.remove?.(a),c.push(r)))}),ye(e,c),o}function ye(e,t){if(0!==t.length)if(e.pushMany)e.pushMany(t);else if(e.push)for(let r of t)e.push(r)}function fe(e,t){if(!e.clear)throw new Error("Synchronizing these changed rows requires a clear() handle");e.clear(),ye(e,[...t])}function $e(e,t,r={}){let{id:a,resetKey:o}=r,n=I(()=>function(e){return null==e?null:"function"==typeof e?(t,r)=>{let a=e(t,r);return null==a?null:String(a)}:t=>{let r=t[e];return null==r?null:String(r)}}(a),[a]),i=P({map:new Map,handle:null,resetKey:void 0});F(()=>{let r=e.current;if(!r)return;let a=i.current;(a.handle!==r||a.resetKey!==o)&&(r.clear?.(),a.map=new Map,a.handle=r,a.resetKey=o),a.map=he(r,a.map,t,n)},[e,t,n,o])}export{_ as CircularBrush,re as DirectManipulationControl,ae as DirectManipulationMarkers,me as adaptiveTimeTicks,de as smartTickFormat,he as syncPushBuffer,oe as themeToCSS,ne as themeToTokens,$e as useSyncedPushData};
|
|
2
|
+
export{a as darkenColor,b as lightenColor}from"./c-ATM475SA.min.js";export{a as useForceLayout}from"./c-QSEAAHEU.min.js";export{a as IncrementalExtent}from"./c-OA6RJZ7S.min.js";export{a as registerBuiltInXYPlugins}from"./c-XPNBS3W2.min.js";export{aC as AccessibleNavTree,bc as ChartContainer,bf as ChartGrid,bg as ContextLayout,bh as DetailsPanel,bv as IntentMark,bx as MobileAnnotationCalloutList,bd as MobileChartContainer,aG as MobileStandardControls,bk as ObservationReadout,be as SmallMultipleChart,e as auditVisualizationControls,an as buildNavigationTree,aD as clampMobileRange,W as configToJSX,X as configToJSXWithReport,V as copyConfig,bs as dashboardIntentManifest,Z as deserializeSelections,a as exportChart,S as fromConfig,U as fromURL,$ as fromVegaLite,bu as intentManifestFromRecipe,bl as observedDatum,Y as serializeSelections,bt as summarizeIntentManifest,R as toConfig,T as toURL,aF as useMobileRangeControls,bw as useNavigationSync,aE as zoomMobileRange}from"./c-TOXWQRXS.min.js";import{b as t}from"./c-G7EPPJDS.min.js";export{a as VISUALIZATION_CONTROL_TYPES,b as createControlObservationAdapter}from"./c-G7EPPJDS.min.js";import{a as s,b as u}from"./c-CJ5GA7DM.min.js";export{d as CARBON_ALERT,c as CARBON_CATEGORICAL_14,e as THEME_PRESETS,g as ThemeProvider,f as resolveThemePreset,b as themeToCSSVariables}from"./c-CJ5GA7DM.min.js";export{g as AreaChart,k as BubbleChart,f as BumpChart,q as CandlestickChart,b as ConnectedScatterplot,h as DifferenceChart,j as Heatmap,m as MinimapChart,p as MultiAxisLineChart,o as QuadrantChart,a as Scatterplot,l as ScatterplotMatrix,i as StackedAreaChart,r as WaterfallChart,c as XYCustomChart,e as rankBumpData}from"./c-WTNRBWZZ.min.js";export{f as LineChart}from"./c-JA5F7ITS.min.js";export{b as BarChart,f as BoxPlot,l as DonutChart,j as DotPlot,o as FunnelChart,m as GaugeChart,n as GroupedBarChart,g as Histogram,d as LikertChart,r as OrdinalCustomChart,k as PieChart,p as RadarChart,i as RidgelinePlot,c as StackedBarChart,a as StreamOrdinalFrame,e as SwarmPlot,q as SwimlaneChart,h as ViolinPlot}from"./c-D7YDFHLY.min.js";export{b as ChordDiagram,n as CirclePack,a as ForceDirectedGraph,p as NetworkCustomChart,o as OrbitDiagram,k as ProcessSankey,c as SankeyDiagram,l as TreeDiagram,m as Treemap,f as diagnoseProcessSankeyLayout,h as diagnoseProcessSankeyProps,g as explainProcessSankeyLayout,e as formatProcessSankeyIssue,i as inventoryAtTime,j as toProcessSankeyTime,d as validateProcessSankey}from"./c-2YFVDRU4.min.js";export{p as RealtimeHeatmap,k as RealtimeHistogram,i as RealtimeLineChart,n as RealtimeSwarmChart,m as RealtimeTemporalHistogram,o as RealtimeWaterfallChart,l as TemporalHistogram}from"./c-BLLDBVFK.min.js";import"./c-ZVL7ULNH.min.js";import"./c-5NAU4JAY.min.js";export{f as StreamXYFrame}from"./c-4OVDIXAR.min.js";import{a as y}from"./c-57IIWW46.min.js";export{a as pointerToLocalPoint}from"./c-57IIWW46.min.js";export{a as RingBuffer}from"./c-VBIPDCE7.min.js";export{b as StreamNetworkFrame,a as useNetworkPerspective}from"./c-6QV6F3U7.min.js";export{f as preloadNetworkPerspectiveExtras}from"./c-PTFHNN34.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{C as AnnotationLabel,bg as CategoryColorProvider,bb as ChartErrorBoundary,bx as LinkedCharts,aM as MultiLineTooltip,aR as MultiPointTooltip,aL as Tooltip,D as annotationStableId,f as compileMotionEncoding,bR as composeStyleRules,j as deriveMotionVector,B as estimateLabelWidth,aN as isMultiTooltip,bN as makeNodeRuleContext,bL as makeRuleValueResolver,bS as makeStyleRuleStyleFn,bM as makeXYRuleContext,bO as matchesThreshold,aS as normalizeTooltip,h as opacityFromAge,e as resolveMotionAccessor,g as resolveMotionAge,i as resolveMotionVector,aP as resolveMultiCapableTooltip,bo as resolveResponsiveRules,bQ as resolveStyleRules,aQ as resolveTooltipContent,bn as responsiveRuleMatches,bP as ruleMatches,aK as smartTooltipEntries,bT as styleRulesToNodeStyle,bV as styleRulesToPieceStyle,bU as styleRulesToXYStyle,bl as useBrushSelection,bh as useCategoryColors,bt as useChartObserver,S as useCrosshairPosition,bm as useFilteredData,bu as useLinkedChartsActive,T as useLinkedCrosshair,bk as useLinkedHover,bi as useSelection,bj as useSelectionActions}from"./c-62UTMRQE.min.js";export{h as createHatchPattern,j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-JDI7HKEM.min.js";export{d as COLOR_BLIND_SAFE_CATEGORICAL,f as DARK_THEME,g as HIGH_CONTRAST_THEME,e as LIGHT_THEME,B as TooltipRoot,E as hasOwnTooltipChrome,x as hasTooltipContent,D as markTooltipChrome,o as useTheme}from"./c-B3X2IJRQ.min.js";import{b as v,c as M}from"./c-GRTKU3C7.min.js";import*as P from"react";import{useRef as I,useMemo as w,useEffect as A}from"react";import{jsx as F,jsxs as O}from"react/jsx-runtime";export{NetworkPerspectiveBillboard,NetworkPerspectiveGround}from"./semiotic-network-placement.module.min.js";var N=2*Math.PI;function L(e,t,r){let a=r?.center?.x??0,o=r?.center?.y??0;return{x:a+Math.sin(e)*t,y:o-Math.cos(e)*t}}function H(e,t,r,a,o){let n=o?.center,i=(e,t)=>{let{x:r,y:a}=L(e,t,{center:n});return`${z(r)},${z(a)}`},l=Math.max(0,r),s=Math.max(l,a),c=Math.abs(t-e),u=t>=e?1:0;if(c>=N-1e-6){let e=n?.x??0,t=n?.y??0,r=`${z(e)},${z(t-s)}`,a=`${z(e)},${z(t+s)}`,o=`M${r} A${z(s)},${z(s)} 0 1 1 ${a} A${z(s)},${z(s)} 0 1 1 ${r} Z`;if(l>0){let r=`${z(e)},${z(t-l)}`,a=`${z(e)},${z(t+l)}`;o+=` M${r} A${z(l)},${z(l)} 0 1 0 ${a} A${z(l)},${z(l)} 0 1 0 ${r} Z`}return o}let m=c>Math.PI?1:0,p=i(e,s),d=i(t,s);if(l<=0){let e=n?.x??0,t=n?.y??0;return`M${z(e)},${z(t)} L${p} A${z(s)},${z(s)} 0 ${m} ${u} ${d} Z`}let h=i(t,l),y=i(e,l);return`M${p} A${z(s)},${z(s)} 0 ${m} ${u} ${d} L${h} A${z(l)},${z(l)} 0 ${m} ${1===u?0:1} ${y} Z`}function z(e){return Math.round(1e3*e)/1e3}var G="var(--semiotic-focus, #005fcc)";function J(e){return Number(e.toPrecision(12))}function Q(e){try{return e.matches(":focus-visible")}catch{return!0}}function K({value:e,onChange:r,period:a=365,radius:o=180,innerRadius:n=14,width:i,height:l,step:s,largeStep:c,label:u="Range",formatValue:m,arcFill:p="var(--semiotic-primary, #4e79a7)",stroke:d="var(--semiotic-bg, #ffffff)",onObservation:h,controlType:y="range-boundary",controlId:f,chartId:$,chartType:g="CircularBrush",className:b,style:v}){let C=i??2*o+40,x=l??2*o+40,T=C/2,S=x/2,j=function(e){let[t,r]=e,a=r-t||1,o=N;return e=>0+(e-t)/a*(o-0)}([0,a]),M=Number.isInteger(a)&&a>=2,k=null!=s&&s>0?s:M?1:a/100,D=null!=c&&c>0?c:M?7:10*k,w=J(Math.max(0,Math.ceil(a/k-1e-9)-1)*k),R=I(null),A=I(e);A.current=e;let[E,B]=P.useState(null),V=I(!1),U=P.useMemo(()=>t({controlType:y,controlId:f,chartId:$,chartType:g,onObservation:h}),[y,f,$,g,h]),W=e=>{let t=J(function(e,t,r=0){return t<=0?e:((e-r)%t+t)%t+r}(e,a));return t>=a?0:t},z=(e,t)=>e.end-e.start>=a?e:{start:W(e.start+t),end:W(e.end+t)},Y=(e,t,a)=>{let o=e(A.current);A.current=o;let n=[o.start,o.end];a.start&&U("control-start",n,t),r(e),U("control-change",n,t),a.end&&U("control-end",n,t)},X=e=>{let t=e.currentTarget.ownerSVGElement??e.currentTarget,r=t.getBoundingClientRect(),o=t.viewBox?.baseVal,n=o?.width||C,i=o?.height||x;return l=function(e,t){return(Math.atan2(e-0,-(t-0))+N)%N}((e.clientX-r.left)*(n/(r.width||1))-T,(e.clientY-r.top)*(i/(r.height||1))-S)/N*a,W(J(Math.round(l/k)*k));var l},K=(e,t)=>{e.preventDefault(),e.stopPropagation();let r=e.currentTarget;r.ownerDocument?.activeElement!==r&&(V.current=!0,r.focus?.({preventScroll:!0}),V.current=!1),r.ownerSVGElement?.setPointerCapture?.(e.pointerId),R.current={mode:t,lastValue:X(e),changed:!1}},Z=e=>{let t=e.currentTarget.ownerSVGElement??e.currentTarget;t?.hasPointerCapture?.(e.pointerId)&&t.releasePointerCapture(e.pointerId);let r=R.current;if(R.current=null,r?.changed){let e=A.current;U("control-end",[e.start,e.end],"pointer")}},_=e=>Y(e,"keyboard",{start:!0,end:!0}),q=(e,t)=>{_("range"===e?e=>z(e,t):r=>({...r,[e]:W(r[e]+t)}))},ee=(e,t)=>{_("range"===e?e=>z(e,t-e.start):r=>({...r,[e]:t}))},te=e=>t=>{let r=t.shiftKey?D:k,a={ArrowRight:()=>q(e,r),ArrowUp:()=>q(e,r),ArrowLeft:()=>q(e,-r),ArrowDown:()=>q(e,-r),PageUp:()=>q(e,D),PageDown:()=>q(e,-D),Home:()=>ee(e,0),End:()=>ee(e,w)}[t.key];a&&(t.preventDefault(),a())},re=e=>({onFocus:t=>B({mode:e,visible:!V.current&&Q(t.currentTarget)}),onBlur:()=>B(null)}),ae=e=>E?.mode===e&&E.visible,oe=e.start<=e.end?[[e.start,e.end]]:[[e.start,a],[0,e.end]],ne=e=>m?m(e):String(e);return F("svg",{viewBox:`0 0 ${C} ${x}`,width:C,height:x,className:b,onPointerMove:e=>{let t=R.current;if(!t)return;let r=X(e),o=!t.changed;if("range"===t.mode){let e=function(e,t,r){if(r<=0)return t-e;let a=(t-e)%r;return a>r/2?a-=r:a<=-r/2&&(a+=r),a}(t.lastValue,r,a);if(0===e)return;return t.lastValue=r,t.changed=!0,void Y(t=>z(t,e),"pointer",{start:o,end:!1})}let n=t.mode;A.current[n]!==r&&(t.changed=!0,Y(e=>({...e,[n]:r}),"pointer",{start:o,end:!1}))},onPointerUp:Z,onPointerCancel:Z,onLostPointerCapture:Z,style:{touchAction:"none",...v},"aria-label":`${u} brush`,"data-viz-control-id":f,children:O("g",{transform:`translate(${T},${S})`,children:[F("g",{role:"slider",tabIndex:0,"aria-label":`${u} (move both ends)`,"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":e.start,"aria-valuetext":`${ne(e.start)} to ${ne(e.end)}`,onPointerDown:e=>K(e,"range"),onKeyDown:te("range"),...re("range"),style:{cursor:"grab",outline:"none"},children:oe.map(([e,t],r)=>F("path",{d:H(j(e),j(t),n,o),fill:p,fillOpacity:.35,stroke:ae("range")?G:d,strokeWidth:ae("range")?3:1},r))}),["start","end"].map(t=>{let r=e[t],i=(e=>L(j(e),n))(r),l=(e=>L(j(e),o+8))(r);return O("g",{role:"slider",tabIndex:0,"aria-label":`${u} ${t}`,"aria-valuemin":0,"aria-valuemax":"end"===t&&e.end===a?a:w,"aria-valuenow":r,"aria-valuetext":ne(r),onPointerDown:e=>K(e,t),onKeyDown:te(t),...re(t),style:{cursor:"grab",outline:"none"},children:[F("line",{x1:i.x,y1:i.y,x2:l.x,y2:l.y,stroke:"transparent",strokeWidth:20}),F("line",{x1:i.x,y1:i.y,x2:l.x,y2:l.y,stroke:d,strokeWidth:1.5}),F("circle",{cx:l.x,cy:l.y,r:4.5,fill:d,stroke:p,strokeWidth:1}),ae(t)&&F("circle",{cx:l.x,cy:l.y,r:8,fill:"none",stroke:G,strokeWidth:2})]},t)})]})})}function _(e,t,r,a,o){let n=Math.min(r,Math.max(t,e));if(!(a>0))return n;let i=o+Math.round((n-o)/a)*a;return Math.min(r,Math.max(t,Number(i.toFixed(12))))}function ee(e,t,r,{min:a,max:o,step:n,largeStep:i}){let l=t?i:n;switch(e){case"ArrowLeft":case"ArrowDown":return r-l;case"ArrowRight":case"ArrowUp":return r+l;case"PageDown":return r-i;case"PageUp":return r+i;case"Home":return a;case"End":return o;default:return null}}function te({value:e,onChange:r,pointToValue:a,pointerToValue:o,min:n,max:i,step:l=1,stepOrigin:s=n,largeStep:c=5*l,x:u,y:m,controlType:p="value",controlId:d,label:h,ariaRoleDescription:f,valueText:$,radius:g=12,fill:b="var(--semiotic-bg, #ffffff)",stroke:v="var(--semiotic-primary, #4e79a7)",strokeWidth:C=4,labelText:x,labelDx:T=16,labelDy:S=-16,labelClassName:j,className:M,disabled:k=!1,onChangeStart:D,onChangeEnd:w,onObservation:R,chartId:A,chartType:E}){let N=I(null),L=I(e);L.current=e;let B=P.useMemo(()=>t({controlType:p,controlId:d,chartId:A,chartType:E,onObservation:R}),[A,E,d,p,R]),V=e=>{if(k)return;let t=(e=>{if(a){let t=y(e);return t?a(t):null}return o?.(e)})(e);if(null==t||!Number.isFinite(t))return;let c=_(t,n,i,l,s);L.current=c,r(c),B("control-change",c,"pointer")},U=e=>{e.stopPropagation(),N.current===e.pointerId&&(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),N.current=null,w?.(L.current),B("control-end",L.current,"pointer"))},W=["semiotic-direct-manipulation-control",M].filter(Boolean).join(" ");return O("g",{className:W,role:"slider",tabIndex:k?-1:0,"aria-disabled":k||void 0,"aria-label":h,"aria-valuemin":n,"aria-valuemax":i,"aria-valuenow":e,"aria-valuetext":$??`${h}: ${e}`,"aria-roledescription":f,"data-viz-control":p,"data-viz-control-id":d,"data-viz-control-state":"controlled",pointerEvents:"all",onPointerDown:e=>{k||(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),N.current=e.pointerId,D?.(L.current),B("control-start",L.current,"pointer"),V(e))},onPointerMove:e=>{e.stopPropagation(),N.current===e.pointerId&&V(e)},onPointerUp:U,onPointerCancel:U,onLostPointerCapture:U,onKeyDown:e=>{if(k)return;let t=L.current,a=ee(e.key,e.shiftKey,t,{min:n,max:i,step:l,largeStep:c});if(null===a)return;e.preventDefault();let o=_(a,n,i,l,s);o!==t&&(D?.(t),B("control-start",t,"keyboard"),L.current=o,r(o),B("control-change",o,"keyboard"),w?.(o),B("control-end",o,"keyboard"))},style:{cursor:k?"default":"grab",touchAction:"none"},children:[F("circle",{className:"semiotic-direct-manipulation-control__hit",cx:u,cy:m,r:g+10,fill:"transparent"}),F("circle",{className:"semiotic-direct-manipulation-control__handle",cx:u,cy:m,r:g,fill:b,stroke:v,strokeWidth:C}),x?F("text",{className:j,x:u+T,y:m+S,fill:v,children:x}):null]})}function re({values:e,onChange:r,markers:a,valueToPoint:o,pointToValue:n,min:i,max:l,step:s=1,stepOrigin:c=i,largeStep:u=5*s,ordered:m=!0,label:p,ariaRoleDescription:d,controlType:h="value",controlId:f="markers",radius:$=12,fill:g="var(--semiotic-bg, #ffffff)",stroke:b="var(--semiotic-primary, #4e79a7)",strokeWidth:C=4,labelDx:x=16,labelDy:T=-16,labelClassName:S,className:j,disabled:k=!1,onChangeStart:D,onChangeEnd:w,onObservation:R,chartId:A,chartType:E}){let N=I([...e]);N.current=[...e];let L=I(null),B=P.useMemo(()=>a.map((e,r)=>t({controlType:h,controlId:e.controlId??`${f}-${r}`,chartId:A,chartType:E,onObservation:R})),[A,E,f,h,a,R]),V=(e,t)=>m?{lo:e>0?Math.max(i,t[e-1]):i,hi:e<t.length-1?Math.min(l,t[e+1]):l}:{lo:i,hi:l},U=(e,t,a)=>{let{lo:o,hi:n}=V(e,N.current),i=_(t,o,n,s,c);if(i===N.current[e])return!1;let l=[...N.current];return l[e]=i,N.current=l,r(l,{index:e,source:a}),B[e]?.("control-change",i,a),!0},W=(e,t)=>{let r=y(e),a=r?n(r,t):null;return null!=a&&Number.isFinite(a)?a:null},H=e=>t=>{if(k)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.setPointerCapture?.(t.pointerId);let r=N.current[e],a=m?N.current.flatMap((e,t)=>e===r?[t]:[]):[e];L.current={pointerId:t.pointerId,pressedIndex:e,startValue:r,coincident:a,active:a.length>1?null:e};let o={index:e,source:"pointer"};if(D?.([...N.current],o),B[e]?.("control-start",r,"pointer"),1===a.length){let r=W(t,e);null!=r&&U(e,r,"pointer")}},z=e=>{e.stopPropagation();let t=L.current;if(!t||t.pointerId!==e.pointerId)return;let r=W(e,t.active??t.pressedIndex);if(null!=r){if(null===t.active){if(r===t.startValue)return;t.active=r<t.startValue?v(t.coincident):M(t.coincident)}U(t.active,r,"pointer")}},G=e=>{e.stopPropagation();let t=L.current;if(!t||t.pointerId!==e.pointerId)return;e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),L.current=null;let r=t.active??t.pressedIndex;w?.([...N.current],{index:r,source:"pointer"}),B[r]?.("control-end",N.current[r],"pointer")},Y=e=>t=>{if(k)return;let{lo:r,hi:a}=V(e,N.current),o=N.current[e],n=ee(t.key,t.shiftKey,o,{min:r,max:a,step:s,largeStep:u});if(null===n)return;t.preventDefault();let i={index:e,source:"keyboard"},l=[...N.current];_(n,r,a,s,c)!==o&&(D?.(l,i),B[e]?.("control-start",o,"keyboard"),U(e,n,"keyboard"),w?.([...N.current],i),B[e]?.("control-end",N.current[e],"keyboard"))};return F("g",{className:["semiotic-direct-manipulation-markers",j].filter(Boolean).join(" "),role:"group","aria-label":p,children:e.map((t,r)=>{let n=a[r]??{label:`Marker ${r+1}`},i=o(t,r),{lo:l,hi:s}=V(r,e),c=n.stroke??b,u=n.radius??$;return O("g",{className:["semiotic-direct-manipulation-control",n.className].filter(Boolean).join(" "),role:"slider",tabIndex:k?-1:0,"aria-disabled":k||void 0,"aria-label":n.label,"aria-valuemin":l,"aria-valuemax":s,"aria-valuenow":t,"aria-valuetext":n.valueText?.(t)??`${n.label}: ${t}`,"aria-roledescription":d,"data-viz-control":h,"data-viz-control-id":n.controlId??`${f}-${r}`,"data-viz-control-state":"controlled",pointerEvents:"all",onPointerDown:H(r),onPointerMove:z,onPointerUp:G,onPointerCancel:G,onLostPointerCapture:G,onKeyDown:Y(r),style:{cursor:k?"default":"grab",touchAction:"none"},children:[F("circle",{className:"semiotic-direct-manipulation-control__hit",cx:i.x,cy:i.y,r:u+10,fill:"transparent"}),F("circle",{className:"semiotic-direct-manipulation-control__handle",cx:i.x,cy:i.y,r:u,fill:n.fill??g,stroke:c,strokeWidth:C}),n.labelText?F("text",{className:S,x:i.x+x,y:i.y+T,fill:c,children:n.labelText}):null]},n.controlId??r)})})}function ae(e,t=":root"){return s(t),`${t} {\n${Object.entries(u(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function oe(e){return{semiotic:{mode:{$value:e.mode,$type:"string"},bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},...null!=e.colors.focus?{focus:{$value:e.colors.focus,$type:"color"}}:{},...null!=e.colors.cellBorder?{"cell-border":{$value:e.colors.cellBorder,$type:"color"}}:{},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"title-size":{$value:`${e.typography.titleSize}px`,$type:"dimension"},...null!=e.borderRadius?{"border-radius":{$value:e.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip?{tooltip:{...null!=e.tooltip.background?{bg:{$value:e.tooltip.background,$type:"color"}}:{},...null!=e.tooltip.text?{text:{$value:e.tooltip.text,$type:"color"}}:{},...null!=e.tooltip.borderRadius?{radius:{$value:e.tooltip.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip.fontSize?{"font-size":{$value:e.tooltip.fontSize,$type:"dimension"}}:{},...null!=e.tooltip.shadow?{shadow:{$value:e.tooltip.shadow,$type:"shadow"}}:{},...null!=e.tooltip.chrome?{chrome:{$value:e.tooltip.chrome,$type:"string"}}:{}}}:{},...null!=e.colors.selection||null!=e.colors.selectionOpacity?{selection:{...null!=e.colors.selection?{color:{$value:e.colors.selection,$type:"color"}}:{},...null!=e.colors.selectionOpacity?{opacity:{$value:e.colors.selectionOpacity,$type:"number"}}:{}}}:{},...null!=e.accessibility?{accessibility:Object.fromEntries(Object.entries(e.accessibility).map(([e,t])=>[e,{$value:t,$type:"boolean"}]))}:{},categorical:{$value:[...e.colors.categorical],$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:`${e.typography.legendSize}px`,$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.titleFontSize?{"title-font-size":{$value:`${e.typography.titleFontSize}px`,$type:"dimension"}}:{},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:`${e.typography.tickSize}px`,$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:`${e.typography.labelSize}px`,$type:"dimension"}}:{},...null!=e.colors.secondary?{secondary:{$value:e.colors.secondary,$type:"color"}}:{},...null!=e.colors.surface?{surface:{$value:e.colors.surface,$type:"color"}}:{},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function ne(e){return e<10?`0${e}`:String(e)}var ie=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function le(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}var se={year:!0,date:!0};function ce(e,t,r,a=se){let{month:o,day:n,year:i,hours:l,minutes:s,seconds:c}=r(e),u=ie[o],m=ne(l),p=ne(s),d=ne(c),h=a.year?`${u} ${n}, ${i} `:`${u} ${n} `;switch(t){case"seconds":return`${a.date?h:""}${m}:${p}:${d}`;case"minutes":case"hours":return`${a.date?h:""}${m}:${p}`;case"days":return a.year?`${u} ${n}, ${i}`:`${u} ${n}`;case"months":return a.year?`${u} ${i}`:`${u}`;case"years":return`${i}`}}function ue(e,t={}){let r,a,o=e,n=(m=function(e={}){let t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}(t),"utc"===m.kind?e=>le(e,!0):"local"===m.kind?e=>le(e,!1):function(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>le(e,!0)}return e=>{let r={};for(let a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}(m.id)),{includeYear:i="always",includeDate:l="always"}=t,s="clock"===t.deltaStyle,c="auto"===i?n(new Date(t.referenceTime??Date.now())).year:void 0,u={referenceYear:!1,oneDay:!1};var m;return(t,m,p)=>{let d=t instanceof Date?t:new Date(t);!e&&p&&p.length>=2&&p!==r&&(r=p,o=function(e){if(e.length<2)return"days";let t=[];for(let r=1;r<e.length;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);let r=t[Math.floor(t.length/2)];return r<12e4?"seconds":r<72e5?"minutes":r<1728e5?"hours":r<5184e6?"days":r<3456e7?"months":"years"}(p));let h=o||"days";if(null==m||!p||0===p.length)return ce(d,h,n);let y="seconds"===h||"minutes"===h||"hours"===h,f="always"===i&&"always"===l?se:{year:"years"===h||"never"!==i,date:!y||"never"!==l};if(0===m){if(f===se)return ce(d,h,n);let{referenceYear:e,oneDay:t}="auto"===i||"auto"===l?(e=>{if(e!==a){a=e;let t=e.map(e=>n(new Date(e))),[r]=t;u={referenceYear:t.every(e=>e.year===c),oneDay:t.every(e=>e.year===r.year&&e.month===r.month&&e.day===r.day)}}return u})(p):u,r=f.date&&!(y&&"auto"===l&&t),o=r&&f.year&&!("years"!==h&&"auto"===i&&e);return ce(d,h,n,{year:o||"years"===h,date:r})}return function(e,t,r,a,o=se,n=!1){let i=a(e),l=a(t),s=i.year!==l.year,c=s||i.month!==l.month,u=c||i.day!==l.day,m=u||i.hours!==l.hours,p=m||i.minutes!==l.minutes,d=o.date,h=s&&o.year,y=ie[i.month],{day:f,year:$}=i,g=ne(i.hours),b=ne(i.minutes),v=ne(i.seconds);switch(r){case"seconds":return h&&d?`${y} ${f}, ${$} ${g}:${b}:${v}`:u&&d?`${y} ${f} ${g}:${b}:${v}`:m||n?`${g}:${b}:${v}`:p?`${b}:${v}`:`:${v}`;case"minutes":return h&&d?`${y} ${f}, ${$} ${g}:${b}`:u&&d?`${y} ${f} ${g}:${b}`:m||n?`${g}:${b}`:`:${b}`;case"hours":return h&&d?`${y} ${f}, ${$} ${g}:${b}`:u&&d?`${y} ${f} ${g}:${b}`:`${g}:${b}`;case"days":return h?`${y} ${f}, ${$}`:c||n?`${y} ${f}`:`${f}`;case"months":return h?`${y} ${$}`:`${y}`;case"years":return`${$}`}}(d,new Date(p[m-1]),h,n,f,s)}}var me=[[1e3,"K"],[1e6,"M"],[1e9,"B"]];function pe(e){if(null==e)return"";if("number"!=typeof e||!isFinite(e))return String(e);if(0===e)return"0";let t=parseFloat(e.toPrecision(12)),r=Math.abs(t);if(r>=1e4)for(let e=me.length-1;e>=0;e--){let[a,o]=me[e];if(r<a)continue;let n=parseFloat((t/a).toPrecision(3));if(Math.abs(n)>=1e3&&e<me.length-1){let[r,a]=me[e+1];return`${parseFloat((t/r).toPrecision(3))}${a}`}return`${n}${o}`}return Number.isInteger(t)?String(t):String(parseFloat(t.toPrecision(6)))}function de(e,t,r,a){let o=new Map,n=null==a;if(r.forEach((e,t)=>{let r=a?.(e,t);(null==r||o.has(r))&&(n=!0),o.set(r??String(t),e)}),n&&(o.clear(),r.forEach((e,t)=>o.set(String(t),e))),0===t.size)return he(e,[...r]),o;let i=[...t.values()],l=null==a||[...t.keys()].some((e,t)=>a(i[t],t)!==e);if(n||l)return i.length<=r.length&&i.every((e,t)=>e===r[t])&&n===l?he(e,r.slice(i.length)):ye(e,r),o;let s=[];if(t.forEach((e,t)=>{o.has(t)||s.push(t)}),s.length>0&&!e.remove||!e.update&&!e.remove&&[...o].some(([e,r])=>t.has(e)&&t.get(e)!==r))return ye(e,r),o;s.length>0&&e.remove?.(s);let c=[];return o.forEach((r,a)=>{let o=t.get(a);void 0===o?c.push(r):o!==r&&(e.update?e.update(a,()=>r):(e.remove?.(a),c.push(r)))}),he(e,c),o}function he(e,t){if(0!==t.length)if(e.pushMany)e.pushMany(t);else if(e.push)for(let r of t)e.push(r)}function ye(e,t){if(!e.clear)throw new Error("Synchronizing these changed rows requires a clear() handle");e.clear(),he(e,[...t])}function fe(e,t,r={}){let{id:a,resetKey:o}=r,n=w(()=>function(e){return null==e?null:"function"==typeof e?(t,r)=>{let a=e(t,r);return null==a?null:String(a)}:t=>{let r=t[e];return null==r?null:String(r)}}(a),[a]),i=I({map:new Map,handle:null,resetKey:void 0});A(()=>{let r=e.current;if(!r)return;let a=i.current;(a.handle!==r||a.resetKey!==o)&&(r.clear?.(),a.map=new Map,a.handle=r,a.resetKey=o),a.map=de(r,a.map,t,n)},[e,t,n,o])}export{K as CircularBrush,te as DirectManipulationControl,re as DirectManipulationMarkers,ue as adaptiveTimeTicks,pe as smartTickFormat,de as syncPushBuffer,ae as themeToCSS,oe as themeToTokens,fe as useSyncedPushData};
|