semiotic 3.13.1 → 3.13.2
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 +20 -21
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/reference.md +1 -1
- package/ai/schema.json +1 -1
- 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-27SDQN3J.min.js +1 -0
- package/dist/{c-N2TVSOYL.min.js → c-4EUQNA7N.min.js} +2 -2
- package/dist/c-5EPR4KFB.min.js +1 -0
- package/dist/c-5HTUQRJT.min.js +1 -0
- package/dist/{c-XORVM6C5.min.js → c-5KZ3NO6X.min.js} +1 -1
- package/dist/c-5NAU4JAY.min.js +1 -0
- package/dist/c-73ORHEHO.min.js +1 -0
- package/dist/{c-ZWJDTDEV.min.js → c-AMQAAW7G.min.js} +1 -1
- package/dist/c-BQWX6NBX.min.js +1 -0
- package/dist/c-BR2TOCUN.min.js +1 -0
- package/dist/c-BRBTXINY.min.js +1 -0
- package/dist/c-C3Z7ZRAA.min.js +1 -0
- package/dist/c-C4WRRUZ5.min.js +1 -0
- package/dist/c-CXDAWBOW.min.js +1 -0
- package/dist/c-DHNROAXY.min.js +1 -0
- package/dist/{c-OSLNYZ3Q.min.js → c-DJ6DT5BL.min.js} +16 -16
- package/dist/c-DNBFFE3P.min.js +1 -0
- package/dist/{c-4P2EM44G.min.js → c-H5THWQI4.min.js} +3 -3
- package/dist/{c-XZJWL7UL.min.js → c-HOMJ3C6B.min.js} +1 -1
- package/dist/c-HR5AH3MA.min.js +1 -0
- package/dist/c-HTL37JCD.min.js +1 -0
- package/dist/{c-VZNIIKL6.min.js → c-JDI7HKEM.min.js} +1 -1
- package/dist/{c-RAIBDXDV.min.js → c-JDU4Y4IW.min.js} +1 -1
- package/dist/{c-ENRZPF5E.min.js → c-JS2D7A2P.min.js} +1 -1
- package/dist/c-L6OT4OVA.min.js +1 -0
- package/dist/c-LDGV6TDQ.min.js +1 -0
- package/dist/c-LW3GP7RY.min.js +1 -0
- package/dist/{c-I54V24WG.min.js → c-MSZ3ZDAP.min.js} +1 -1
- package/dist/{c-W5ATXREF.min.js → c-NB2UEX5C.min.js} +1 -1
- package/dist/{c-XOGN3524.min.js → c-NBBYSAQY.min.js} +2 -2
- package/dist/c-OMTJIC3P.min.js +1 -0
- package/dist/{c-HGWITEJI.min.js → c-OOR2LN4A.min.js} +1 -1
- package/dist/c-OU7A3IUL.min.js +1 -0
- package/dist/{c-2M2OPWVA.min.js → c-PNLTF6YG.min.js} +33 -33
- package/dist/c-QVKOXC3S.min.js +1 -0
- package/dist/{c-OIJL2WZH.min.js → c-TBMFC5CR.min.js} +1 -1
- package/dist/c-TFESQSWE.min.js +1 -0
- package/dist/c-TX53234M.min.js +1 -0
- package/dist/c-TZBEQ5UY.min.js +1 -0
- package/dist/c-UALVQIIJ.min.js +1 -0
- package/dist/{c-62JIVHK5.min.js → c-WFSEQ2XG.min.js} +1 -1
- package/dist/{c-4YPPVFZH.min.js → c-XF5ILLBG.min.js} +1 -1
- package/dist/c-YCBCZFOC.min.js +1 -0
- package/dist/c-YQHGEETR.min.js +2 -0
- package/dist/c-ZBSL4Y32.min.js +1 -0
- package/dist/c-ZMB3VTD4.min.js +1 -0
- package/dist/components/charts/shared/types.d.ts +1 -1
- package/dist/components/recipes/atlas/resolution/appearance.d.ts +1 -1
- package/dist/components/recipes/atlas/resolution/scene.d.ts +1 -1
- package/dist/components/semiotic-network-zoom.d.ts +1 -1
- package/dist/components/store/ThemeStore.d.ts +4 -1
- package/dist/components/store/themeCore.d.ts +2 -0
- package/dist/components/stream/mediaQuery.d.ts +2 -0
- package/dist/components/stream/networkEdgeHitIndex.d.ts +6 -2
- package/dist/components/stream/networkZoom/ZoomableNetworkCustomChart.d.ts +6 -4
- package/dist/components/stream/networkZoom/gestures.d.ts +5 -0
- package/dist/components/stream/networkZoom/types.d.ts +10 -0
- package/dist/components/stream/pipelineTransitionTypes.d.ts +3 -5
- package/dist/components/stream/pipelineTransitionUtils.d.ts +4 -0
- package/dist/components/stream/pipelineTransitions.d.ts +1 -13
- package/dist/components/stream/renderers/networkArcRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/networkCircleRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/networkPrimitiveRenderer.d.ts +5 -0
- package/dist/components/stream/renderers/networkRectRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/renderPulse.d.ts +8 -14
- package/dist/components/stream/sceneToSVGShared.d.ts +9 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/useMediaPreferences.d.ts +1 -4
- package/dist/geo.min.js +152 -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/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1018 -1025
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
- package/dist/semiotic-experimental-network-resolution-react.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-network-zoom.d.ts +1 -1
- package/dist/semiotic-network-zoom.min.js +7 -7
- package/dist/semiotic-network-zoom.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +2 -2
- package/dist/semiotic-server-edge.min.js +394 -397
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +394 -397
- package/dist/semiotic-themes-core.min.js +2 -2
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +2 -2
- package/dist/semiotic-themes.module.min.js +1 -1
- 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 +394 -397
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +1 -1
- package/dist/c-3UXQGCQT.min.js +0 -1
- package/dist/c-4RVDKSMQ.min.js +0 -1
- package/dist/c-6WJKNYIG.min.js +0 -1
- package/dist/c-AQUX6L2O.min.js +0 -1
- package/dist/c-BR5QDUCR.min.js +0 -1
- package/dist/c-C3YQVUB6.min.js +0 -1
- package/dist/c-COP4OISO.min.js +0 -1
- package/dist/c-FAOZZE77.min.js +0 -1
- package/dist/c-HBLICBM6.min.js +0 -1
- package/dist/c-I4BEWAKT.min.js +0 -1
- package/dist/c-IDCFMBA4.min.js +0 -2
- package/dist/c-KLJDKRD5.min.js +0 -1
- package/dist/c-LEICSI5V.min.js +0 -1
- package/dist/c-MOK4RWNO.min.js +0 -1
- package/dist/c-NHZ2E3CI.min.js +0 -1
- package/dist/c-OWRVBUSL.min.js +0 -1
- package/dist/c-QIVKWHDL.min.js +0 -1
- package/dist/c-QUAEYF34.min.js +0 -1
- package/dist/c-RDFFLRKC.min.js +0 -1
- package/dist/c-RTU5425Z.min.js +0 -1
- package/dist/c-SU6Z75M2.min.js +0 -1
- package/dist/c-SWVXFUDL.min.js +0 -1
- package/dist/c-TC47SNSI.min.js +0 -1
- package/dist/c-VLWWXOM5.min.js +0 -1
- package/dist/c-VNFIRKU5.min.js +0 -1
- package/dist/c-WFX456JK.min.js +0 -5
- package/dist/c-WSWMQDFZ.min.js +0 -1
- package/dist/c-YGTMWEEF.min.js +0 -1
- package/dist/c-ZDCTFRA6.min.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{A as e,B as t,c as o,e as a,f as r}from"./c-FAOZZE77.min.js";import{d as i}from"./c-F5V47CBH.min.js";import{b as l}from"./c-5H6IMPPV.min.js";function n(o,a=":root"){return e(a),`${a} {\n${Object.entries(t(o)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function s(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 c(e){return Math.min(255,Math.max(0,Math.round(e)))}function u(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),o=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(o){let e=o.length<=4?o.split("").map(e=>`${e}${e}`).join(""):o;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}let a=t.match(/^(rgba?|hsla?)\(([^()]*)\)$/);if(!a)return null;let r=a[2].includes(","),i=a[2].split("/");if(i.length>2||r&&i.length>1)return null;let l=r?a[2].split(",").map(e=>e.trim()):i[0].trim().split(/\s+/);if(!r){if(3!==l.length)return null;2===i.length&&l.push(i[1].trim())}if(3!==l.length&&4!==l.length)return null;let n,s=(e,t)=>/^[+-]?(?:\d+\.?\d*|\.\d+)%?$/.test(e)?parseFloat(e)*(e.endsWith("%")?t/100:1):NaN,c=void 0===l[3]?1:s(l[3],1);if(a[1].startsWith("hsl")){let e=l[0].match(/^([+-]?(?:\d+\.?\d*|\.\d+))(deg|grad|rad|turn)?$/);if(!e||!l[1].endsWith("%")||!l[2].endsWith("%"))return null;let t=(Number(e[1])*("turn"===e[2]?360:"rad"===e[2]?180/Math.PI:"grad"===e[2]?.9:1)%360+360)%360/60,o=s(l[1],1),a=s(l[2],1);if(!Number.isFinite(t)||o<0||o>1||a<0||a>1)return null;let r=(1-Math.abs(2*a-1))*o,i=r*(1-Math.abs(t%2-1)),c=a-r/2;n=(t<1?[r,i,0]:t<2?[i,r,0]:t<3?[0,r,i]:t<4?[0,i,r]:t<5?[i,0,r]:[r,0,i]).map(e=>255*(e+c))}else n=l.slice(0,3).map(e=>s(e,255));return n.some(e=>!Number.isFinite(e)||e<0||e>255)||!Number.isFinite(c)||c<0||c>1?null:{r:n[0],g:n[1],b:n[2],a:c}}function f(e,t){return t.a<1?null:{r:c(e.r*e.a+t.r*(1-e.a)),g:c(e.g*e.a+t.g*(1-e.a)),b:c(e.b*e.a+t.b*(1-e.a)),a:1}}function m(e){return e.a<1?null:`#${[e.r,e.g,e.b].map(e=>c(e).toString(16).padStart(2,"0")).join("")}`}var d=/^\{([^}]+)\}$/,h={bg:"background",text:"text","text-secondary":"textSecondary",grid:"grid",border:"border",primary:"primary",focus:"focus",secondary:"secondary",surface:"surface",annotation:"annotation","annotation-color":"annotation","cell-border":"cellBorder",success:"success",danger:"danger",warning:"warning",error:"error",info:"info"},p=[["textSecondary",/^(text-?secondary|secondary-?text|muted|subtle|text-?muted|fg-?muted)$/],["text",/^(text|foreground|fg|ink|on-?background|on-?surface|text-?default|fg-?default)$/],["background",/^(background|bg|canvas|base|page|backdrop|bg-?default)$/],["surface",/^(surface|card|elevated|panel|sheet)$/],["border",/^(border|divider|outline|stroke|hairline)$/],["grid",/^(grid|gridline|gridlines)$/],["primary",/^(primary|brand|accent|brand-?primary)$/],["secondary",/^(secondary|brand-?secondary)$/],["focus",/^(focus|ring|focus-?ring)$/],["error",/^(error|critical)$/],["danger",/^(danger|negative|destructive|fail|alert)$/],["success",/^(success|positive|ok|good|pass)$/],["warning",/^(warning|warn|caution)$/],["info",/^(info|information|note)$/],["annotation",/^(annotation|callout)$/]],y=/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*[\d.]+)?\s*\)$/i;function g(e){return"string"==typeof e.value&&("color"===e.type||function(e){let t=e.trim();return null!=u(t)||/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(t)||y.test(t)||/^hsla?\(/i.test(t)}(e.value))}function b(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)?e.join(", "):"string"==typeof e?e:void 0}function v(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"!=typeof e)return;let t=e.trim().match(/^(-?(?:\d+|\d*\.\d+))px$/);return t?Number(t[1]):void 0}function $(e){return"string"==typeof e||"number"==typeof e&&Number.isFinite(e)?e:void 0}function S(e,i={}){let l=function(e){let t=new Map(e.map(e=>[e.path,e])),o=(e,a)=>{if(a>8||"string"!=typeof e)return e;let r=e.match(d);if(!r)return e;let i=t.get(r[1]);return i?o(i.value,a+1):e};return e.map(e=>({...e,value:o(e.value,0)}))}(function(e){let t=[],o=(e,a,r)=>{if(!e||"object"!=typeof e)return;let i=e,l=i.$type??r;if(function(e){return!!e&&"object"==typeof e&&"$value"in e}(i))t.push({path:a.join("."),leaf:a[a.length-1]??"",value:i.$value,type:i.$type??r});else for(let[e,t]of Object.entries(i))e.startsWith("$")||o(t,[...a,e],l)};return o(e,[]),t}(e)),n=new Map(l.map(e=>[e.path,e])),s=new Set,c={};for(let[e,t]of Object.entries(i.mapping??{})){if("fontFamily"===e||"categorical"===e)continue;let o=t?n.get(t):void 0;o&&"string"==typeof o.value&&(c[e]=o.value,s.add(o.path))}for(let e of l){let t=e.path.match(/^semiotic\.([^.]+)$/),o=t&&Object.prototype.hasOwnProperty.call(h,t[1])?h[t[1]]:void 0;o&&!(o in c)&&"string"==typeof e.value&&(c[o]=e.value,s.add(e.path))}for(let[e,t]of p){if(e in c)continue;let o=l.find(e=>!s.has(e.path)&&g(e)&&t.test(e.leaf.toLowerCase()));o&&"string"==typeof o.value&&(c[e]=o.value,s.add(o.path))}let f,y=i.mapping?.categorical,S=(y?n.get(y):void 0)??n.get("semiotic.categorical")??l.find(e=>Array.isArray(e.value)&&/categor|chart|palette|qualitative|series/i.test(e.path));if(S&&Array.isArray(S.value))f=S.value.filter(e=>"string"==typeof e);else{let e=l.filter(e=>g(e)&&/(^|\.)(categorical|chart|palette|qualitative|series)\b/i.test(e.path));e.length>=2&&(f=e.map(e=>e.value))}let x=(i.mapping?.fontFamily?n.get(i.mapping.fontFamily):void 0)??n.get("semiotic.font-family")??l.find(e=>("fontFamily"===e.type||/font-?family|typeface/i.test(e.leaf))&&("string"==typeof e.value||Array.isArray(e.value))),k=x?b(x.value):void 0,M=v(n.get("semiotic.legend-font-size")?.value),w=b(n.get("semiotic.legend-font-family")?.value),A=$(n.get("semiotic.legend-font-weight")?.value),C=v(n.get("semiotic.title-font-size")?.value),F=b(n.get("semiotic.title-font-family")?.value),R=$(n.get("semiotic.title-font-weight")?.value),j=b(n.get("semiotic.tick-font-family")?.value),O=v(n.get("semiotic.tick-font-size")?.value),z=v(n.get("semiotic.axis-label-font-size")?.value),N=v(n.get("semiotic.title-size")?.value),P=e=>{let t=n.get(`semiotic.${e}`)?.value;return"string"==typeof t?t:void 0},I=P("sequential"),W=P("diverging"),q=P("selection.color"),D=n.get("semiotic.selection.opacity")?.value,T=P("border-radius"),E=t=>!!e.semiotic&&"object"==typeof e.semiotic&&Object.prototype.hasOwnProperty.call(e.semiotic,t),L={};for(let[e,t]of Object.entries({bg:"background",text:"text",radius:"borderRadius","font-size":"fontSize",shadow:"shadow"})){let o=P(`tooltip.${e}`);null!=o&&(L[t]=o)}let B=P("tooltip.chrome");("none"===B||"default"===B)&&(L.chrome=B);let _={};for(let e of["colorBlindSafe","highContrast"]){let t=n.get(`semiotic.accessibility.${e}`)?.value;"boolean"==typeof t&&(_[e]=t)}let H={},V={},U={};for(let e of l){let t=e.path.match(/^semiotic\.aesthetics\.weights\.(.+)$/);t&&"number"==typeof e.value&&Number.isFinite(e.value)&&(H[t[1]]=e.value);let o=e.path.match(/^semiotic\.aesthetics\.thresholds\.(.+)$/);o&&"number"==typeof e.value&&Number.isFinite(e.value)&&(V[o[1]]=e.value);let a=e.path.match(/^semiotic\.aesthetics\.rationales\.(.+)$/);a&&"string"==typeof e.value&&(U[a[1]]=e.value)}let Y=n.get("semiotic.aesthetics.profile")?.value,Z=n.get("semiotic.aesthetics.minimum-score")?.value,K="string"==typeof Y||"number"==typeof Z||Object.keys(H).length>0||Object.keys(V).length>0||Object.keys(U).length>0?{..."string"==typeof Y?{name:Y}:{},..."number"==typeof Z?{minimumScore:Z}:{},...Object.keys(H).length>0?{weights:H}:{},...Object.keys(V).length>0?{thresholds:V}:{},...Object.keys(U).length>0?{rationales:U}:{}}:void 0,G=u(c.background),J=G?m(G):null,Q=J?o(J,"#000")>=o(J,"#fff")?"light":"dark":a.mode,X=P("mode"),ee=i.base?.mode??("light"===X||"dark"===X||"auto"===X?X:Q),te=i.base??("dark"===ee?r:a),oe=!i.base&&null!=N&&null!=k&&null!=O&&null!=z&&null!=f&&null!=I&&["mode","primary","bg","text","text-secondary","grid","border"].every(e=>n.has(`semiotic.${e}`)),ae=oe?{primary:te.colors.primary,categorical:te.colors.categorical,sequential:te.colors.sequential,background:te.colors.background,text:te.colors.text,textSecondary:te.colors.textSecondary,grid:te.colors.grid,border:te.colors.border}:te.colors,re={...te,mode:ee,colors:{...ae,...c,...f&&(oe||f.length>0)?{categorical:f}:{},...null!=I?{sequential:I}:{},...null!=W?{diverging:W}:{},...null!=q?{selection:q}:{},..."number"==typeof D&&Number.isFinite(D)&&D>=0&&D<=1?{selectionOpacity:D}:{}},typography:{...te.typography,...k?{fontFamily:k}:{},...null!=N?{titleSize:N}:{},...null!=M?{legendSize:M}:{},...null!=w?{legendFontFamily:w}:{},...null!=A?{legendFontWeight:A}:{},...null!=C?{titleFontSize:C}:{},...null!=F?{titleFontFamily:F}:{},...null!=R?{titleFontWeight:R}:{},...null!=j?{tickFontFamily:j}:{},...null!=O?{tickSize:O}:{},...null!=z?{labelSize:z}:{}},...K?{aesthetics:K}:{},...E("tooltip")?{tooltip:L}:{},...E("accessibility")?{accessibility:_}:{},...null!=T?{borderRadius:T}:{}};return t(re),re}function x(e,t,o){let a=u(e),r=u(t);if(!a||!r)return null;let i=f({...a,a:a.a*Math.min(1,Math.max(0,o))},r);return i?m(i):null}var k=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),M=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),w=Object.freeze({name:"Semiotic balanced",weights:k,thresholds:M,minimumScore:70}),A=Object.freeze({name:"Aesthetics off",weights:/*#__PURE__*/Object.freeze(
|
|
1
|
+
import{B as e,C as t,c as o,e as a,f as r}from"./c-LW3GP7RY.min.js";import{d as i}from"./c-F5V47CBH.min.js";import{b as l}from"./c-5H6IMPPV.min.js";function n(o,a=":root"){return e(a),`${a} {\n${Object.entries(t(o)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function s(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 c(e){return Math.min(255,Math.max(0,Math.round(e)))}function u(e){if("string"!=typeof e)return null;let t=e.trim().toLowerCase(),o=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(o){let e=o.length<=4?o.split("").map(e=>`${e}${e}`).join(""):o;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}let a=t.match(/^(rgba?|hsla?)\(([^()]*)\)$/);if(!a)return null;let r=a[2].includes(","),i=a[2].split("/");if(i.length>2||r&&i.length>1)return null;let l=r?a[2].split(",").map(e=>e.trim()):i[0].trim().split(/\s+/);if(!r){if(3!==l.length)return null;2===i.length&&l.push(i[1].trim())}if(3!==l.length&&4!==l.length)return null;let n,s=(e,t)=>/^[+-]?(?:\d+\.?\d*|\.\d+)%?$/.test(e)?parseFloat(e)*(e.endsWith("%")?t/100:1):NaN,c=void 0===l[3]?1:s(l[3],1);if(a[1].startsWith("hsl")){let e=l[0].match(/^([+-]?(?:\d+\.?\d*|\.\d+))(deg|grad|rad|turn)?$/);if(!e||!l[1].endsWith("%")||!l[2].endsWith("%"))return null;let t=(Number(e[1])*("turn"===e[2]?360:"rad"===e[2]?180/Math.PI:"grad"===e[2]?.9:1)%360+360)%360/60,o=s(l[1],1),a=s(l[2],1);if(!Number.isFinite(t)||o<0||o>1||a<0||a>1)return null;let r=(1-Math.abs(2*a-1))*o,i=r*(1-Math.abs(t%2-1)),c=a-r/2;n=(t<1?[r,i,0]:t<2?[i,r,0]:t<3?[0,r,i]:t<4?[0,i,r]:t<5?[i,0,r]:[r,0,i]).map(e=>255*(e+c))}else n=l.slice(0,3).map(e=>s(e,255));return n.some(e=>!Number.isFinite(e)||e<0||e>255)||!Number.isFinite(c)||c<0||c>1?null:{r:n[0],g:n[1],b:n[2],a:c}}function f(e,t){return t.a<1?null:{r:c(e.r*e.a+t.r*(1-e.a)),g:c(e.g*e.a+t.g*(1-e.a)),b:c(e.b*e.a+t.b*(1-e.a)),a:1}}function m(e){return e.a<1?null:`#${[e.r,e.g,e.b].map(e=>c(e).toString(16).padStart(2,"0")).join("")}`}var d=/^\{([^}]+)\}$/,h={bg:"background",text:"text","text-secondary":"textSecondary",grid:"grid",border:"border",primary:"primary",focus:"focus",secondary:"secondary",surface:"surface",annotation:"annotation","annotation-color":"annotation","cell-border":"cellBorder",success:"success",danger:"danger",warning:"warning",error:"error",info:"info"},p=[["textSecondary",/^(text-?secondary|secondary-?text|muted|subtle|text-?muted|fg-?muted)$/],["text",/^(text|foreground|fg|ink|on-?background|on-?surface|text-?default|fg-?default)$/],["background",/^(background|bg|canvas|base|page|backdrop|bg-?default)$/],["surface",/^(surface|card|elevated|panel|sheet)$/],["border",/^(border|divider|outline|stroke|hairline)$/],["grid",/^(grid|gridline|gridlines)$/],["primary",/^(primary|brand|accent|brand-?primary)$/],["secondary",/^(secondary|brand-?secondary)$/],["focus",/^(focus|ring|focus-?ring)$/],["error",/^(error|critical)$/],["danger",/^(danger|negative|destructive|fail|alert)$/],["success",/^(success|positive|ok|good|pass)$/],["warning",/^(warning|warn|caution)$/],["info",/^(info|information|note)$/],["annotation",/^(annotation|callout)$/]],y=/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*[\d.]+)?\s*\)$/i;function g(e){return"string"==typeof e.value&&("color"===e.type||function(e){let t=e.trim();return null!=u(t)||/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(t)||y.test(t)||/^hsla?\(/i.test(t)}(e.value))}function b(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)?e.join(", "):"string"==typeof e?e:void 0}function v(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"!=typeof e)return;let t=e.trim().match(/^(-?(?:\d+|\d*\.\d+))px$/);return t?Number(t[1]):void 0}function $(e){return"string"==typeof e||"number"==typeof e&&Number.isFinite(e)?e:void 0}function S(e,i={}){let l=function(e){let t=new Map(e.map(e=>[e.path,e])),o=(e,a)=>{if(a>8||"string"!=typeof e)return e;let r=e.match(d);if(!r)return e;let i=t.get(r[1]);return i?o(i.value,a+1):e};return e.map(e=>({...e,value:o(e.value,0)}))}(function(e){let t=[],o=(e,a,r)=>{if(!e||"object"!=typeof e)return;let i=e,l=i.$type??r;if(function(e){return!!e&&"object"==typeof e&&"$value"in e}(i))t.push({path:a.join("."),leaf:a[a.length-1]??"",value:i.$value,type:i.$type??r});else for(let[e,t]of Object.entries(i))e.startsWith("$")||o(t,[...a,e],l)};return o(e,[]),t}(e)),n=new Map(l.map(e=>[e.path,e])),s=new Set,c={};for(let[e,t]of Object.entries(i.mapping??{})){if("fontFamily"===e||"categorical"===e)continue;let o=t?n.get(t):void 0;o&&"string"==typeof o.value&&(c[e]=o.value,s.add(o.path))}for(let e of l){let t=e.path.match(/^semiotic\.([^.]+)$/),o=t&&Object.prototype.hasOwnProperty.call(h,t[1])?h[t[1]]:void 0;o&&!(o in c)&&"string"==typeof e.value&&(c[o]=e.value,s.add(e.path))}for(let[e,t]of p){if(e in c)continue;let o=l.find(e=>!s.has(e.path)&&g(e)&&t.test(e.leaf.toLowerCase()));o&&"string"==typeof o.value&&(c[e]=o.value,s.add(o.path))}let f,y=i.mapping?.categorical,S=(y?n.get(y):void 0)??n.get("semiotic.categorical")??l.find(e=>Array.isArray(e.value)&&/categor|chart|palette|qualitative|series/i.test(e.path));if(S&&Array.isArray(S.value))f=S.value.filter(e=>"string"==typeof e);else{let e=l.filter(e=>g(e)&&/(^|\.)(categorical|chart|palette|qualitative|series)\b/i.test(e.path));e.length>=2&&(f=e.map(e=>e.value))}let x=(i.mapping?.fontFamily?n.get(i.mapping.fontFamily):void 0)??n.get("semiotic.font-family")??l.find(e=>("fontFamily"===e.type||/font-?family|typeface/i.test(e.leaf))&&("string"==typeof e.value||Array.isArray(e.value))),k=x?b(x.value):void 0,M=v(n.get("semiotic.legend-font-size")?.value),w=b(n.get("semiotic.legend-font-family")?.value),C=$(n.get("semiotic.legend-font-weight")?.value),A=v(n.get("semiotic.title-font-size")?.value),F=b(n.get("semiotic.title-font-family")?.value),R=$(n.get("semiotic.title-font-weight")?.value),j=b(n.get("semiotic.tick-font-family")?.value),z=v(n.get("semiotic.tick-font-size")?.value),O=v(n.get("semiotic.axis-label-font-size")?.value),N=v(n.get("semiotic.title-size")?.value),P=e=>{let t=n.get(`semiotic.${e}`)?.value;return"string"==typeof t?t:void 0},I=P("sequential"),W=P("diverging"),q=P("selection.color"),D=n.get("semiotic.selection.opacity")?.value,L=P("border-radius"),T=t=>!!e.semiotic&&"object"==typeof e.semiotic&&Object.prototype.hasOwnProperty.call(e.semiotic,t),E={};for(let[e,t]of Object.entries({bg:"background",text:"text",radius:"borderRadius","font-size":"fontSize",shadow:"shadow"})){let o=P(`tooltip.${e}`);null!=o&&(E[t]=o)}let B=P("tooltip.chrome");("none"===B||"default"===B)&&(E.chrome=B);let _={};for(let e of["colorBlindSafe","highContrast"]){let t=n.get(`semiotic.accessibility.${e}`)?.value;"boolean"==typeof t&&(_[e]=t)}let H={},V={},U={};for(let e of l){let t=e.path.match(/^semiotic\.aesthetics\.weights\.(.+)$/);t&&"number"==typeof e.value&&Number.isFinite(e.value)&&(H[t[1]]=e.value);let o=e.path.match(/^semiotic\.aesthetics\.thresholds\.(.+)$/);o&&"number"==typeof e.value&&Number.isFinite(e.value)&&(V[o[1]]=e.value);let a=e.path.match(/^semiotic\.aesthetics\.rationales\.(.+)$/);a&&"string"==typeof e.value&&(U[a[1]]=e.value)}let Y=n.get("semiotic.aesthetics.profile")?.value,G=n.get("semiotic.aesthetics.minimum-score")?.value,K="string"==typeof Y||"number"==typeof G||Object.keys(H).length>0||Object.keys(V).length>0||Object.keys(U).length>0?{..."string"==typeof Y?{name:Y}:{},..."number"==typeof G?{minimumScore:G}:{},...Object.keys(H).length>0?{weights:H}:{},...Object.keys(V).length>0?{thresholds:V}:{},...Object.keys(U).length>0?{rationales:U}:{}}:void 0,J=u(c.background),Q=J?m(J):null,X=Q?o(Q,"#000")>=o(Q,"#fff")?"light":"dark":a.mode,Z=P("mode"),ee=i.base?.mode??("light"===Z||"dark"===Z||"auto"===Z?Z:X),te=i.base??("dark"===ee?r:a),oe=!i.base&&null!=N&&null!=k&&null!=z&&null!=O&&null!=f&&null!=I&&["mode","primary","bg","text","text-secondary","grid","border"].every(e=>n.has(`semiotic.${e}`)),ae=oe?{primary:te.colors.primary,categorical:te.colors.categorical,sequential:te.colors.sequential,background:te.colors.background,text:te.colors.text,textSecondary:te.colors.textSecondary,grid:te.colors.grid,border:te.colors.border}:te.colors,re={...te,mode:ee,colors:{...ae,...c,...f&&(oe||f.length>0)?{categorical:f}:{},...null!=I?{sequential:I}:{},...null!=W?{diverging:W}:{},...null!=q?{selection:q}:{},..."number"==typeof D&&Number.isFinite(D)&&D>=0&&D<=1?{selectionOpacity:D}:{}},typography:{...te.typography,...k?{fontFamily:k}:{},...null!=N?{titleSize:N}:{},...null!=M?{legendSize:M}:{},...null!=w?{legendFontFamily:w}:{},...null!=C?{legendFontWeight:C}:{},...null!=A?{titleFontSize:A}:{},...null!=F?{titleFontFamily:F}:{},...null!=R?{titleFontWeight:R}:{},...null!=j?{tickFontFamily:j}:{},...null!=z?{tickSize:z}:{},...null!=O?{labelSize:O}:{}},...K?{aesthetics:K}:{},...T("tooltip")?{tooltip:E}:{},...T("accessibility")?{accessibility:_}:{},...null!=L?{borderRadius:L}:{}};return t(re),re}function x(e,t,o){let a=u(e),r=u(t);if(!a||!r)return null;let i=f({...a,a:a.a*Math.min(1,Math.max(0,o))},r);return i?m(i):null}var k=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),M=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),w=Object.freeze({name:"Semiotic balanced",weights:k,thresholds:M,minimumScore:70}),C=Object.freeze({name:"Aesthetics off",weights:/*#__PURE__*/Object.freeze(
|
|
2
2
|
/*#__PURE__*/Object.fromEntries(
|
|
3
|
-
/*#__PURE__*/ /*#__PURE__*/Object.keys(k).map(e=>[e,0]))),minimumScore:0}),
|
|
3
|
+
/*#__PURE__*/ /*#__PURE__*/Object.keys(k).map(e=>[e,0]))),minimumScore:0}),A=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],F=/*#__PURE__*/new Set(["category10","tableau10"]),R=/*#__PURE__*/new Set(["DonutChart","PieChart","SwimlaneChart"]),j={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"};function z(e){return Math.min(1,Math.max(0,e))}function O(e,t){return Number.isFinite(e)?e:t}function N(e){return function(e){if("string"!=typeof e||""===e.trim())return;let t=u(e);return t?m(t)??`rgba(${c(t.r)},${c(t.g)},${c(t.b)},${t.a})`:e.trim().toLowerCase()}(e)}function P(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(N).filter(e=>!!e)}function I(e){return Array.isArray(e)||e&&"object"==typeof e?P(e):[]}function W(e){return!(e.length<4)&&A.some(t=>e.length===t.length&&e.every((e,o)=>e===t[o]))}function q(e,t){let o=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(o.map(e=>String(e[t])))):"function"==typeof t?Array.from(new Set(o.map((e,o)=>String(t(e,o))))):[]}function D(e,t){if(!e.evidence)return.5;let{weakestDataContrast:o,scaffoldContrast:a,hierarchyRatio:r}=e.evidence;return Math.min(z(o/3),z(a/t.scaffoldContrastMin),z(t.scaffoldContrastMax/a),z(r/t.hierarchyRatio))}function L(e,t,o,a,r,i,l){let n=o[e];return{id:e,label:j[e],status:0===n?"disabled":l??(t>=.8?"pass":"warn"),score:t,weight:n,contribution:t*n,message:a,...i?.[e]?{rationale:i[e]}:{},evidence:r}}function T(e,t,r={}){let n=r.theme??a,s=r.profile??n.aesthetics??w,c={...k,...s.weights??{}};for(let e of Object.keys(c)){let t=c[e];c[e]=Number.isFinite(t)?Math.max(0,t):0}let d=function(e){let t=e.thresholds??{},o=Math.max(1,O(t.scaffoldContrastMin,M.scaffoldContrastMin)),a=z(O(t.emphasisRatioMin,M.emphasisRatioMin));return{hierarchyRatio:Math.max(1,O(t.hierarchyRatio,M.hierarchyRatio)),scaffoldContrastMin:o,scaffoldContrastMax:Math.max(o,O(t.scaffoldContrastMax,M.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,O(t.titleScaleRatio,M.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(O(t.categoricalColorMax,M.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,z(O(t.emphasisRatioMax,M.emphasisRatioMax)))}}(s),h=function(e,t,o){let a=I(t.colorScheme),r=P(t.color),l=q(t,t.colorBy),n=R.has(e)?q(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,c=(e,t)=>e.map((e,a)=>N(s?.[e])??("gray"===t?"#999999":o.colors.categorical.length>0?o.colors.categorical[a%o.colors.categorical.length]:"#007bff")),u=l.length>0?s?c(l,"gray"):a.length>0?a:o.colors.categorical:r.length>0?r:n.length>0&&s?c(n,"theme"):a.length>0&&!s?a:o.colors.categorical,f=Math.max(1,l.length||n.length||1),m=l.length>0||n.length>0?u.slice(0,Math.min(u.length,f)):u.slice(0,1),d=function(e){let t=Array.isArray(e.data)?e.data:[],o=Array.isArray(e.styleRules)?e.styleRules:[],a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",r="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",l=[];for(let e of o)!e.style||"function"==typeof e.style||t.some((t,o)=>i(e,t,{value:Number(t[a]),category:String(t[r]??""),index:o}))&&l.push(...P(e.style.fill));return Array.from(new Set(l))}(t).filter(e=>!m.includes(e));return Array.from(new Set([...m,...d]))}(e,t,n),p=function(e){let t=e.colors.surface??e.colors.background,o=u(t),a=u(e.colors.background);if(!o)return t;if(1===o.a)return m(o)??t;if(!a)return t;let r=f(o,a);return r?m(r)??t:t}(n),y=function(e){let t=u(e.backgroundColor),a=t?m(t):null,r=x(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=r&&a?o(r,a):null,n=e.dataColors.map(t=>x(t,e.backgroundColor,1)).map(e=>e&&a?o(e,a):null).filter(e=>null!==e);if(null===i||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};let s=l(n),c=s/i,f={weakestDataContrast:s,scaffoldContrast:i,hierarchyRatio:c},d=Math.max(1,e.minimumScaffoldContrast??1.1),h=Math.max(d,e.maximumScaffoldContrast??2),p=Math.max(1,e.minimumHierarchyRatio??2);return s<3?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:f,finding:{code:"DATA_MARK_CONTRAST",status:"warn",message:"Primary data marks have contrast below 3:1 against the background.",fix:"Increase data-mark contrast against the background before adjusting grids or guides."}}:i<d?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:f,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:s>=3&&i<=h&&c>=p?{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:f,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}:{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:f,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}}({backgroundColor:p,dataColors:h,scaffoldColor:n.colors.grid,minimumHierarchyRatio:d.hierarchyRatio,minimumScaffoldContrast:d.scaffoldContrastMin,maximumScaffoldContrast:d.scaffoldContrastMax}),g=function(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,o=[...I(e.colorScheme),...P(e.color),...P(e.fill),...P(e.stroke),...P(t?.fill),...P(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of a)!e.style||"function"==typeof e.style||o.push(...P(e.style.fill),...P(e.style.stroke));return Array.from(new Set(o))}(t),b=W(n.colors.categorical.map(N).filter(e=>!!e)),v=function(e){let t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,o=[...I(e.colorScheme),...P(e.color),...P(e.fill),...P(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(let e of a)!e.style||"function"==typeof e.style||o.push(...P(e.style.fill));return Array.from(new Set(o))}(t),$="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,S=v.length>0||$?"chart":"theme",C="chart"===S?W(v)||!!$&&F.has($):b,A=C?.2:"chart"===S?1:.8,j=function(e){return Math.max(1,e.length)}(h),T=j<=d.categoricalColorMax?1:z(1-(j-d.categoricalColorMax)/d.categoricalColorMax),E=n.typography.titleFontSize??n.typography.titleSize,B=Math.max(n.typography.tickSize,n.typography.labelSize),_=B>0?E/B:1,H=z((_-1)/(d.titleScaleRatio-1)),V=new Set([...n.colors.categorical,n.colors.primary,n.colors.secondary,n.colors.background,n.colors.surface,n.colors.text,n.colors.textSecondary,n.colors.grid,n.colors.border,n.colors.annotation].map(N).filter(e=>!!e)),U=g.filter(e=>!V.has(e)).length,Y=0===g.length?1:z(1-U/g.length),G=function(e){let t=Array.isArray(e.data)?e.data:[],o=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===o.length)return{ratio:0,authored:!1};let a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",r="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>o.some(o=>i(o,e,{value:Number(e[a]),category:String(e[r]??""),index:t}))).length/t.length,authored:!0}}(t),K=G.authored?G.ratio<d.emphasisRatioMin?z(G.ratio/d.emphasisRatioMin):G.ratio<=d.emphasisRatioMax?1:z(d.emphasisRatioMax/G.ratio):.35,J=[L("mark-scaffold-hierarchy",D(y,d),c,y.finding.message,{hierarchyRatio:y.evidence?.hierarchyRatio??0,markContrast:y.evidence?.weakestDataContrast??0,scaffoldContrast:y.evidence?.scaffoldContrast??0},s.rationales,y.status),L("palette-authorship",A,c,C?"theme"===S?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:S,ubiquitousDefault:C,colorCount:h.length},s.rationales),L("palette-economy",T,c,`${j} color role(s) are used against a policy ceiling of ${d.categoricalColorMax}.`,{colorRoles:j,maximum:d.categoricalColorMax},s.rationales),L("typographic-hierarchy",H,c,`Title-to-supporting-type scale is ${_.toFixed(2)}×.`,{titleSize:E,supportingSize:B,ratio:_},s.rationales),L("theme-coherence",Y,c,`${U} of ${g.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:g.length,outsideTheme:U},s.rationales),L("editorial-emphasis",K,c,G.authored?`${Math.round(100*G.ratio)}% of marks receive authored emphasis.`:"No machine-visible editorial emphasis rule is declared.",{authored:G.authored,emphasizedRatio:G.ratio},s.rationales)],Q=J.reduce((e,t)=>e+t.weight,0),X=J.reduce((e,t)=>e+t.contribution,0),Z=0===Q?null:X/Q*100,ee=100*z(O(s.minimumScore,w.minimumScore??70)/100);return{component:e,profile:s.name??"Unnamed aesthetic profile",ok:null===Z||Z>=ee,score:Z,minimumScore:ee,weightedPoints:X,totalWeight:Q,features:J,method:"weighted-machine-visible-features"}}export{n as a,s as b,S as c,k as d,M as e,w as f,C as g,T as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e,l){let a=l;for(let l of e)"lesser"===l.thresholdType?t<l.value&&(a=l.color):t>l.value&&(a=l.color);return a}function e(e,l,a,h){if(e.length<2||l.length!==e.length||0===a.length)return[];let o=[],i=(t,e,l)=>{let a=o[o.length-1];a?.color===t?a.path.push(l):o.push({color:t,path:[e,l]})};for(let o=1;o<e.length;o++){let[r,n]=e[o-1],[s,p]=e[o],f=l[o-1],g=l[o]-f,c=[0,...0===g?[]:a.map(({value:t})=>(t-f)/g).filter(t=>t>0&&t<1&&Number.isFinite(t)).sort((t,e)=>t-e).filter((t,e,l)=>0===e||t!==l[e-1]),1];for(let e=1;e<c.length;e++){let l=c[e-1],o=c[e];i(t(f+g*((l+o)/2),a,h),[r+(s-r)*l,n+(p-n)*l],[r+(s-r)*o,n+(p-n)*o])}}return o}function l(t,e,l,a,h,o){if(e.length<2)return;let i=[0];for(let t=1;t<e.length;t++){let l=e[t][0]-e[t-1][0],a=e[t][1]-e[t-1][1];i.push(i[t-1]+Math.sqrt(l*l+a*a))}let r=i[i.length-1];if(0===r)return;let n=Math.min(.2*r,40);t.strokeStyle=l,t.lineWidth=a,t.lineCap=o;for(let l=0;l<e.length-1;l++){let a=(i[l]+i[l+1])/2,o=h;a<n&&(o*=a/n),r-a<n&&(o*=(r-a)/n),t.globalAlpha=Math.max(0,o),t.beginPath(),t.moveTo(e[l][0],e[l][1]),t.lineTo(e[l+1][0],e[l+1][1]),t.stroke()}}function a(t,a,p){let f=t.globalAlpha;for(let g of a){if(g.path.length<2)continue;let a=g._introClipFraction;void 0!==a&&a<1&&(t.save(),t.beginPath(),t.rect(0,0,p.width*a,p.height),t.clip());let c=h(g.style.stroke),y=c?"#007bff":g.style.stroke||"#007bff",u=o(t,y)||y,b=c?0:g.style.strokeWidth??2,k=g.colorThresholds,m=g.rawValues;g.style.strokeDasharray?t.setLineDash(g.style.strokeDasharray.split(/[\s,]+/).map(Number)):t.setLineDash([]);let v=f*(g.style.opacity??1),d=v*(g.style.strokeOpacity??1);if(t.globalAlpha=d,b>0&&(t.lineWidth=b),t.lineCap=g.style.strokeLinecap||"butt",g.style._edgeFade&&b>0){let e=d;l(t,g.path,u,b,e,g.style.strokeLinecap||"butt"),void 0!==a&&a<1&&t.restore(),t.globalAlpha=f,t.setLineDash([]),t.lineCap="butt";continue}let T=i(g.curve),A=k&&k.length>0&&m&&m.length===g.path.length,D=g._decayOpacities;if(b>0&&D&&D.length===g.path.length&&!A){t.strokeStyle=u;let e=d;for(let l=0;l<g.path.length-1;l++){let a=.5*(D[l]+D[l+1])*e;t.globalAlpha=a,t.beginPath(),t.moveTo(g.path[l][0],g.path[l][1]),t.lineTo(g.path[l+1][0],g.path[l+1][1]),t.stroke()}}else if(b>0&&!A){t.beginPath();let e=g.strokeGradient&&g.path.length>=2?r(t,g.strokeGradient,u,g.path[0][0],0,g.path[g.path.length-1][0],0):null;if(t.strokeStyle=e||u,T)s().x(t=>t[0]).y(t=>t[1]).curve(T).context(t)(g.path);else{let[e,l]=g.path[0];t.moveTo(e,l);for(let e=1;e<g.path.length;e++)t.lineTo(g.path[e][0],g.path[e][1])}t.stroke()}else if(b>0){let l=e(g.path,m,k,u);for(let e of l){t.beginPath(),t.strokeStyle=o(t,e.color)||e.color,t.moveTo(e.path[0][0],e.path[0][1]);for(let l=1;l<e.path.length;l++)t.lineTo(e.path[l][0],e.path[l][1]);t.stroke()}}if(g.style.fill&&g.style.fillOpacity&&g.style.fillOpacity>0){if(t.beginPath(),t.globalAlpha=v*g.style.fillOpacity,t.fillStyle=n(t,g.style.fill,g.style.fill),T&&!A)s().x(t=>t[0]).y(t=>t[1]).curve(T).context(t)(g.path);else{let[e,l]=g.path[0];t.moveTo(e,l);for(let e=1;e<g.path.length;e++)t.lineTo(g.path[e][0],g.path[e][1])}let e=g.path[g.path.length-1][0],l=g.path[0][0];t.lineTo(e,p.height),t.lineTo(l,p.height),t.closePath(),t.fill()}void 0!==a&&a<1&&t.restore(),t.globalAlpha=f,t.setLineDash([]),t.lineCap="butt"}}import{p as h,c as o,o as i,t as r,q as n}from"./c-JDI7HKEM.min.js";import{line as s}from"d3-shape";var p=(t,e,l,h)=>a(t,e.filter(t=>"line"===t.type),h);export{e as a,p as b,a as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./c-RI7UJTEY.min.js";import{
|
|
1
|
+
import{a as e}from"./c-RI7UJTEY.min.js";import{bJ as t,bO as i}from"./c-L6OT4OVA.min.js";function r(e){return{...e,bySource:Object.fromEntries(Object.entries(e.bySource).map(([e,t])=>[e,{...t}]))}}var a=class{constructor(e,t={},i=[]){if(this.windowSize=e,this.policy=t,this.windows=new Map,this.openWindows=new Set,this.sources=new Map,this.latest=-1/0,this.frontier=-1/0,this.value=-1/0,this.pending=[],!Number.isFinite(e)||e<=0)throw new RangeError("EventDrop windows.size must be a finite positive number");for(let e of i)this.sources.set(e,{latest:-1/0,arrival:-1/0,idle:!1});this.validatePolicy(t)}validatePolicy(e){if("function"!=typeof e){for(let t of["delay","idleTimeout","allowedLateness"]){let i=e[t];if(null!=i&&(!Number.isFinite(i)||i<0))throw new RangeError(`watermark.${t} must be finite and nonnegative`)}if(null!=e.value&&!Number.isFinite(e.value))throw new RangeError("watermark.value must be finite")}}setWatermark(e){this.validatePolicy(e),this.policy=e}getWatermark(){return this.value}getLatestEventTime(){return this.latest}getArrivalFrontier(){return this.frontier}getLedger(){return Array.from(this.windows.values(),r).sort((e,t)=>e.start-t.start)}drainEvents(){let e=this.pending;return this.pending=[],e}snapshot(){return this.state(this.getLedger())}drainDelta(){let e=Array.from(this.changedWindows??[],e=>r(this.windows.get(e)));return this.changedWindows=new Set,this.state(e)}state(e){return{windows:e,sources:Array.from(this.sources,([e,t])=>[e,{...t}]),latest:this.latest,frontier:this.frontier,value:this.value,heldBy:this.heldBy}}restore(e){this.applySnapshot(e,!0)}applyDelta(e){this.applySnapshot(e,!1)}applySnapshot(e,t){let i=e=>Number.isFinite(e)||e===-1/0,a=e=>Number.isSafeInteger(e)&&e>=0;if(![e.latest,e.frontier,e.value].every(i)||new Set(e.windows.map(e=>e.windowId)).size!==e.windows.length||new Set(e.sources.map(([e])=>e)).size!==e.sources.length||e.sources.some(([,e])=>!i(e.latest)||!i(e.arrival))||e.windows.some(e=>!Number.isFinite(e.start)||!Number.isFinite(e.end)||e.end<=e.start||!a(e.accepted)||!a(e.late)||Object.values(e.bySource).some(e=>!a(e.accepted)||!a(e.late))||Object.values(e.bySource).reduce((e,t)=>e+t.accepted,0)!==e.accepted||Object.values(e.bySource).reduce((e,t)=>e+t.late,0)!==e.late))throw new RangeError("Invalid EventDrop ledger snapshot");t&&(this.windows.clear(),this.openWindows.clear());for(let t of e.windows){let e=this.windows.get(t.windowId);e&&this.openWindows.delete(e);let i=r(t);Object.setPrototypeOf(i.bySource,null),this.windows.set(t.windowId,i),i.open&&this.openWindows.add(i)}this.changedWindows?.clear(),this.sources=new Map(e.sources.map(([e,t])=>[e,{...t}])),this.latest=e.latest,this.frontier=e.frontier,this.value=e.value,this.heldBy=e.heldBy,this.pending=[]}advance(e,t="external"){if(!Number.isFinite(e))return;this.frontier=Math.max(this.frontier,e);let i,r=this.policy;if("function"==typeof r)i=r(this.latest);else if(r.external)i=r.external();else if(null!=r.value)i=r.value;else{let t=this.latest;if(r.perSource){let i;t=1/0;for(let[a,n]of this.sources){Number.isFinite(n.arrival)||(n.arrival=e);let s=null!=r.idleTimeout&&e-n.arrival>=r.idleTimeout;s&&!n.idle&&this.pending.push({type:"physics-source-idle",sourceId:a}),n.idle=s,!s&&n.latest<t&&(t=n.latest,i=a)}i&&i!==this.heldBy&&t<this.latest&&this.pending.push({type:"physics-watermark-held",sourceId:i}),this.heldBy=i,t===1/0&&(t=this.latest)}i=t-(r.delay??this.windowSize)}if(!Number.isFinite(i)||i<=this.value)return;let a=this.value;this.value=i,this.pending.push({type:"physics-watermark-advance",from:a,to:i,cause:t});for(let t of this.openWindows)t.end<=this.value&&this.close(t,e)}close(e,t){this.changedWindows?.add(e.windowId),e.open=!1,e.closedAt=t,e.watermarkAtClose=this.value,this.openWindows.delete(e),this.pending.push({type:"physics-window-close",...r(e),watermark:this.value})}append(e){var t;let{eventTime:i,arrivalTime:a,source:n=""}=e;if(!Number.isFinite(i)||!Number.isFinite(a))throw new RangeError("Event and arrival times must be finite");if(a<this.frontier)throw new RangeError("Incremental admissions require nondecreasing arrival times");this.latest=Math.max(this.latest,i);let s=this.sources.get(n);this.sources.set(n,{latest:Math.max(s?.latest??-1/0,i),arrival:a,idle:!1}),this.advance(a,"arrival");let l=Math.floor(i/this.windowSize)*this.windowSize,o=l+this.windowSize,u=`${l}-${o}`,h=this.windows.get(u);h||(h={windowId:u,start:l,end:o,accepted:0,late:0,bySource:Object.create(null),open:!0},this.windows.set(u,h),this.openWindows.add(h),this.pending.push({type:"physics-window-open",windowId:u,start:l,end:o}));let d=e.watermarkAtArrival??this.value,c=o+("function"==typeof this.policy?0:this.policy.allowedLateness??0)<=d,p=(t=h.bySource)[n]??(t[n]={accepted:0,late:0}),m=c?"late":"accepted";return h[m]++,this.changedWindows?.add(u),p[m]++,!h.open&&!c&&this.pending.push({type:"physics-window-update",windowId:u,accepted:h.accepted,late:h.late,bySource:r(h).bySource,watermark:this.value,retractions:1}),h.open&&o<=this.value&&this.close(h,a),{windowId:u,start:l,end:o,late:c,watermarkAtArrival:d}}};function n(e){let[t,i]=e,r=t<160||i<116,a=r?Math.min(12,Math.max(2,.08*t)):32,n=r?Math.min(8,Math.max(2,.12*i)):24,s=r?n:34;return{width:t,height:i,plot:{x:a,y:n,width:Math.max(1,t-2*a),height:Math.max(1,i-n-s)}}}function s(e){let t=String(e??"");if(!t)return"#4e79a7";let i=["#4e79a7","#59a14f","#e15759","#f28e2b","#76b7b2","#edc948","#b07aa1","#ff9da7"],r=0;for(let e=0;e<t.length;e+=1)r=31*r+t.charCodeAt(e)>>>0;return i[r%i.length]}function l(e,t){return t?(i,r)=>({..."function"==typeof e?e(i,r):e,..."function"==typeof t?t(i,r):t}):e}function o(e,r="#4e79a7",a){let n=a?.styleRules,l=!!n&&n.length>0,o=l?t(a?.valueAccessor):void 0;return t=>{let a=t.datum,u=a&&e?"function"==typeof e?e(a,0):a[e]:void 0,h={fill:null==u?r:s(u),stroke:"#111827",strokeWidth:1,opacity:.9};return l&&a&&Object.assign(h,i(a,n,{value:o?o(a):void 0,category:null==u?void 0:String(u)})),h}}function u(e,t,i,r){return{fixedDt:1/120,maxSubsteps:8,colliders:t,observation:{chartType:i},kernel:{seed:e,gravity:{x:0,y:760},cellSize:36,collisionIterations:6,velocityDamping:.995,restitution:.08,friction:.4,sleepSpeed:8,sleepAfter:.6,...r}}}function h(e,t,i){if(!e.length)return[];let r=n(t),a=r.plot.width/Math.max(1,e.length),s=e.reduce((e,t)=>Math.max(e,t.value),1),l=.62*r.plot.height,o=r.plot.y+r.plot.height;return e.map((e,t)=>{let n=Math.max(8,e.value/s*l),u=r.plot.x+(t+.5)*a,h=o-n/2,d=null==e.secondary?"":`, ${e.secondary} secondary`,c=`${i} ${e.label}: ${e.value}${d}`;return{id:`${i}-${e.label}`,label:c,description:c,datum:e,x:u,y:h,shape:"rect",width:Math.max(12,.58*a),height:n,group:i}})}function d(e,t,i){return"function"==typeof i?i(e,t):e[i]}function c(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function p(e,t,i){return Math.max(t,Math.min(i,e))}function m(e,t){let i=c(e);return null!=i&&i>0?i:t}function w(e){if(!e)return;let t=c(e[0]),i=c(e[1]);return null!=t&&null!=i?t<=i?[t,i]:[i,t]:void 0}function f(e){return String(e??"unknown").trim().replace(/[^A-Za-z0-9_-]+/g,"_")||"unknown"}function v(e,t,i=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),a=new Map;for(let n of e){let e=null==n.id?`${t}-${i++}`:String(n.id);for(;null==n.id&&r.has(e);)e=`${t}-${i++}`;r.add(e),a.set(e,null==n.id?{...n,id:e}:n)}return{seed:e,rows:Array.from(a.values()),nextId:i}}function g(t={}){let i=(t.categories?.length?t.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=i.length?i:["Intake"],a=Math.max(r.length,Math.round(t.count??Math.max(48,12*r.length))),n=m(t.unitValue,1),s=e(t.seed??1),l=t.idPrefix??"mechanical-pile",o=r.map(()=>.65+.9*s()),u=o.reduce((e,t)=>e+t,0)||1,h=a-r.length,d=o.map(e=>e/u*h),c=d.map(e=>1+Math.floor(e)),p=a-c.reduce((e,t)=>e+t,0),w=d.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;p>0;e=(e+1)%w.length)c[w[e].index]+=1,p-=1;return r.map((e,t)=>({id:`${l}-${t}`,category:e,value:c[t]*n,mechanical:!0,unitCount:c[t],unitValue:n,share:c[t]/a}))}function y(e,t){let i=e/t,r=Math.round(i);return Math.ceil(r>0&&Math.abs(i-r)<=Number.EPSILON*i*4?r:i)}function b(t){let i=Math.max(2,Math.round(t.bins)),r=Math.max(1,Math.round(t.pegRows??i-1)),a=Math.max(1,Math.round(t.count??Math.max(64,4*i))),n=p(Number.isFinite(t.branchProbability)?t.branchProbability??.5:.5,0,1),s=e(t.seed??1),l=t.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let i=0;for(let e=0;e<r;e+=1)s()<n&&(i+=1);let a=r/2;return{id:`${l}-${t}`,value:i,mechanical:!0,pegRows:r,branchProbability:n,pathRights:i,side:i<a?"left":i>a?"right":"center"}})}function x(e){let{windowSize:t,watermark:i,watermarkAtArrivalAccessor:r}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=v(e.data,"event"),s=n.flatMap((t,i)=>{let r=c(d(t,i,e.timeAccessor));return null==r?[]:[{datum:t,index:i,eventTime:r,arrivalTime:c(d(t,i,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),l="function"==typeof i?null:c(i?.value),o="function"==typeof i?t:c(i?.delay)??t,u=new a(t,i,e.sourceIds);for(let t of s.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){let i=r?c(d(t.datum,t.index,r)):null,a=u.append({eventTime:t.eventTime,arrivalTime:t.arrivalTime,source:String(d(t.datum,t.index,e.sourceAccessor??"source")??""),watermarkAtArrival:i??void 0});t.watermarkAtArrival=a.watermarkAtArrival,t.late=a.late}return{events:s,watermarkValue:s.length?u.getWatermark():l??-o,ledger:u.getLedger(),lifecycleEvents:u.drainEvents()}}export{n as a,l as b,o as c,u as d,h as e,d as f,c as g,p as h,m as i,w as j,f as k,v as l,g as m,y as n,b as o,a as p,x as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function t(e,t){let s=e();return Number.isFinite(s)?s:t}function s(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function i(e){return e?"string"==typeof e?{name:e}:e:null}function a(e,t,s,i){if(!t)return e;let a=(a,...l)=>{let r={...e(a,...l)};if(t.isActive)if(t.predicate(i?i(a):a))s?.selectedStyle&&Object.assign(r,s.selectedStyle);else{let e=s?.unselectedOpacity??.5;r.opacity=(r.opacity??1)*e,s?.unselectedStyle&&Object.assign(r,s.unselectedStyle)}return r};return l(a,[a])}import{a as l}from"./c-5PCO2P5Q.min.js";var r=()=>typeof performance<"u"?performance.now():Date.now(),n=class{constructor(e={}){this.randomSource=Math.random,this.subscribers= new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??r,this.lastWallTime=t(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){let e=t(this.clock,this.lastWallTime),s=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=s),this.logicalTime}emit(){for(let e of this.subscribers)e()}setClock(e){let s=e??r;s!==this.clock&&(this.advance(),this.clock=s,this.lastWallTime=t(s,this.lastWallTime))}setRandomSource(t,s){let i=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(s);t===this.randomInput&&i===this.seedValue||(this.randomInput=t,this.seedValue=i,this.randomSource=t??(void 0===i?Math.random:e(i)))}},u=.5;export{e as a,n as b,s as c,i as d,u as e,a as f};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
return
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
De("span",{style:u,children:"range:"}),
|
|
1
|
+
import{a as R}from"./c-WFSEQ2XG.min.js";import{e as D,f as L,g as O,d as E}from"./c-JS2D7A2P.min.js";import{c as W,f as j,g as $}from"./c-BRBTXINY.min.js";import{e as V,j as G}from"./c-AMQAAW7G.min.js";import{a as U}from"./c-C3Z7ZRAA.min.js";import{a as K}from"./c-L3WAZ53J.min.js";import{S as X,Q as q,A as Y}from"./c-NB2UEX5C.min.js";import{bI as J,aY as Q,bz as Z,by as ee,aR as te,aP as ie,bG as ne,bb as oe,ba as se,bK as re,bP as ae,bH as le,u as ce,z as ue,bd as he,bf as de,bs as me,bB as ge,bq as pe,aQ as ve,bA as fe}from"./c-L6OT4OVA.min.js";import{f as ye}from"./c-OU7A3IUL.min.js";import{m as we,p as be,s as xe,d as Ae}from"./c-WPL6PGP3.min.js";import{g as ke}from"./c-JDI7HKEM.min.js";import{g as Se,a as Ce,b as _e}from"./c-5PCO2P5Q.min.js";import*as He from"react";import{forwardRef as Me,useMemo as Pe,useRef as Te,useCallback as Ie,useState as Ne,useEffect as Be,useImperativeHandle as ze,useLayoutEffect as Fe}from"react";import{jsxs as Re,jsx as De}from"react/jsx-runtime";function Le(e){let t=ke(e);return t^=t>>>16,t=Math.imul(t,2146121005),t^=t>>>15,t=Math.imul(t,2221713035),t^=t>>>16,t>>>0}function Oe(e){let t=Math.round(1e3*e)/10;return`p${String(t).replace(".","_")}`}function Ee(e,t,i){let n=e.length;for(e.push(t);n>0;){let o=n-1>>>1;if(i(e[o],t)<=0)break;e[n]=e[o],n=o}e[n]=t}function We(e,t){let i=e[0],n=e.pop();if(e.length>0){let i=0;for(;2*i+1<e.length;){let o=2*i+1;if(o+1<e.length&&t(e[o+1],e[o])<0&&o++,t(n,e[o])<=0)break;e[i]=e[o],i=o}e[i]=n}return i}function je(e,t){switch(t){case"distinct":return e.distinct??0;case"p50":case"p95":case"p99":return e.percentiles?.[t]??Number.NaN;default:return e[t]??e.mean}}function $e(e,t,i,n=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];let o=je(e,i),s=e.stddev*n;return[o-s,o+s]}function Ve(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;let t=e.trim();if(""===t)return null;a.lastIndex=0;let i,n=0,o=0;for(;null!==(i=a.exec(t));){let e=parseFloat(i[1]),t=r[i[2]];if(null==t||!Number.isFinite(e))return null;n+=e*t,o+=i[0].length}return o!==t.length?null:n>0?n:null}function Ge(e,t){return e.time-t.time||e.order-t.order}function Ue(e,t){let i=[new Date(e),new Date(t)],n=Math.max(...i.map(e=>e.getUTCMilliseconds()?23:e.getUTCSeconds()?19:16)),[o,s]=i.map(e=>e.toISOString()),r=o.slice(0,10)===s.slice(0,10)?"":`${W(t)} `;return`${W(e)} ${o.slice(11,n)}–${r}${s.slice(11,n)}`}function Ke(e,t,i){return i?`${i(e)}–${i(t)}`:e>=d&&t<=m?Ue(e,t):`${qe(e)}–${qe(t)}`}function Xe(e,t,i){return null==e?void 0:"function"==typeof t?t(e):e["string"==typeof t?t:i]}function qe(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?String(e):e.toFixed(2):e instanceof Date?e.toLocaleString():String(e)}function Ye(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:o="y"}=e;return e=>{let s=e?.data??null,r=Xe(s,t,"time"),a=Xe(s,i,"value");
|
|
2
|
+
return Re("div",{className:"semiotic-tooltip",style:c,children:[
|
|
3
|
+
Re("div",{children:[
|
|
4
|
+
Re("span",{style:u,children:[n,":"]}),qe(r)]}),
|
|
5
|
+
Re("div",{children:[
|
|
6
|
+
Re("span",{style:u,children:[o,":"]}),qe(a)]})]})}}function Je(e={}){let t=Ze(e);return i=>{let n=i?.allSeries,o=i?.data??null;return n?.length&&null!=o?.binStart&&null!=o.binEnd? Re("div",{className:"semiotic-tooltip",style:c,children:[
|
|
7
|
+
Re("div",{children:[
|
|
8
|
+
De("span",{style:u,children:"range:"}),Ke(o.binStart,o.binEnd,e.formatTime)]}),n.map((e,t)=>""!==e.group&& Re("div",{children:[
|
|
9
9
|
De("span",{style:{...h,backgroundColor:e.color}}),
|
|
10
|
-
|
|
11
|
-
De("span",{style:u,children:"count:"}),qe(o.total)]})]}):t(i)}}function
|
|
12
|
-
return
|
|
13
|
-
|
|
10
|
+
Re("span",{style:u,children:[e.group,":"]}),qe(e.value)]},t)),null!=o.total&& Re("div",{children:[
|
|
11
|
+
De("span",{style:u,children:"count:"}),qe(o.total)]})]}):t(i)}}function Qe(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let n=e?.data??null,o=Xe(n,t,"time"),s=n?.delta??Xe(n,i,"value"),r=n?.cumEnd,a="number"==typeof s&&s>=0?`+${qe(s)}`:qe(s);
|
|
12
|
+
return Re("div",{className:"semiotic-tooltip",style:c,children:[
|
|
13
|
+
Re("div",{children:[
|
|
14
14
|
De("span",{style:u,children:"x:"}),qe(o)]}),
|
|
15
|
-
|
|
16
|
-
De("span",{style:u,children:"Δ:"}),a]}),null!=r&&
|
|
17
|
-
De("span",{style:u,children:"total:"}),qe(r)]})]})}}function
|
|
18
|
-
return
|
|
19
|
-
|
|
15
|
+
Re("div",{children:[
|
|
16
|
+
De("span",{style:u,children:"Δ:"}),a]}),null!=r&& Re("div",{children:[
|
|
17
|
+
De("span",{style:u,children:"total:"}),qe(r)]})]})}}function Ze(e={}){let{timeAccessor:t,valueAccessor:i,formatTime:n}=e;return e=>{let o=e?.data??null;if(null==o?.binStart||null==o?.binEnd){let e=Xe(o,t,"time"),n=Xe(o,i,"value");
|
|
18
|
+
return Re("div",{className:"semiotic-tooltip",style:c,children:[
|
|
19
|
+
Re("div",{children:[
|
|
20
20
|
De("span",{style:u,children:"x:"}),qe(e)]}),
|
|
21
|
-
|
|
21
|
+
Re("div",{children:[
|
|
22
22
|
De("span",{style:u,children:"y:"}),qe(n)]})]})}
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
De("span",{style:u,children:"range:"}),
|
|
26
|
-
De("span",{style:u,children:"count:"}),qe(o.total)]}),null!=o.category&&
|
|
27
|
-
De("span",{style:u,children:"category:"}),qe(o.category)]}),null!=o.category&&null!=o.categoryValue&&
|
|
28
|
-
De("span",{style:u,children:"category count:"}),qe(o.categoryValue)]})]})}}function et(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:o="y"}=e;return e=>{let s=e?.data??null,r=s?.xCenter??
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
De("span",{style:u,children:"count:"}),qe(l)]}),"sum"===m&&null!=h&&
|
|
35
|
-
De("span",{style:u,children:"sum:"}),qe(h)]}),"mean"===m&&null!=d&&
|
|
36
|
-
De("span",{style:u,children:"mean:"}),qe(d)]})]})}}function tt(e,t,i){return e??i??Math.max(t?.length??0,200)}function it(e){let t=e.window??"tumbling",i=$e("session"===t?e.gap??e.size:e.size);if(null==i)return null;let n=null!=e.hop?$e(e.hop):void 0,o=null!=e.gap?$e(e.gap):void 0;return new s({window:t,size:i,hop:n??void 0,gap:o??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function nt(e,t){let i=t.stat??"mean",n=t.band??"none",o=t.sigma??1;return e.emit().map(e=>{let t={[g]:(e.start+e.end)/2,[p]:Ve(e,i),[w]:e.count,[y]:e.partial,[b]:e.start,[x]:e.end},s=je(e,n,i,o);return s&&(t[v]=s[0],t[f]=s[1]),t})}function ot(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;let o=Number(n);return Number.isFinite(o)?o:null}function st(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=U(e);if(Number.isFinite(t))return t}return Number(e)}function rt(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;if(n instanceof Date)return Number.isFinite(n.getTime())?n:null;if("string"==typeof n){let e=U(n);if(Number.isFinite(e))return new Date(e)}let o=Number(n);return Number.isFinite(o)?o:null}function at(e,t){let i=$e(e.lateness);return null==i?null:new l({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function lt(e){return{...X(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showGrid:e.showGrid,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function ct(e,t){He.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function ut(e,t,i,n){let o=t.find(Boolean)??null;return He.useMemo(()=>o?ye(e??S,o,i,n):e,[o,e,i,n])}function ht(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function dt(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Se(Ce({...t},_e(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:st})}function mt(e){if(!e.axes)return[{orient:"bottom",visible:!1!==e.showTimeAxis},{orient:"left",visible:!1!==e.showValueAxis}];let t=(...t)=>e.axes.some(e=>t.includes(e.orient)),i=!1===e.showTimeAxis&&!t("bottom","top"),n=!1===e.showValueAxis&&!t("left","right");return i||n?[...e.axes,...i?[{orient:"bottom",visible:!1}]:[],...n?[{orient:"left",visible:!1}]:[]]:e.axes}function gt(e,t,i,n=!1){let o=ce({axes:t,showAxes:i});return{...ue(e,t,n),...!o.hasAxis&&{bottom:0},...!o.leftAxis?.hasAxis&&{left:0}}}function pt({enabled:e,categories:t,colors:i,fallbackColor:n,order:o="discovery",domainKey:s}){let r=he(!0),a=de(),l=me(),c=ge(),u="function"==typeof s?_:s,h=Te(null),d=Pe(()=>{let e=h.current,n=e&&Object.is(e.domainKey,u)?new Map(e.indexes): new Map,s=new Set(t),r="explicit-then-alpha"===o?[...Object.keys(i??{}).filter(e=>s.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)pe(n,e);return{domainKey:u,indexes:n}},[t,i,o,u]);H(()=>{h.current=d},[d]);let m=d.indexes,g=Pe(()=>{if(!e)return;let t=c&&c.length>0?c:l?we:be;return e=>{let o=pe(m,e);return(r?xe(r,e):void 0)||(i?xe(i,e):void 0)||n||(a?xe(a,e):void 0)||t[o%t.length]}},[m,i,e,n,l,a,r,c]),p=Pe(()=>{if(!e||!g)return i;let n=Object.keys(i??{}),s=new Set(n),r=t.filter(e=>!s.has(e));"explicit-then-alpha"===o&&r.sort();let a=[...n,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?xe(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,o]);return{colorScale:g,colorMap:p}}var e=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count;let i=e-this._mean;this._m2+=t*i,e<this._min&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,e._min<this._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return this._count<2?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return this._count<2?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},t=class e{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(e){let t=Le(String(e)),i=t>>>32-this.p,n=Math.min(Math.clz32(t<<this.p),32-this.p)+1;this.updateRegister(i,n)}updateRegister(e,t){let i=this.registers[e];t<=i||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;t<this.m;t++)this.updateRegister(t,e.registers[t])}clone(){let t=new e(this.p);return t.registers.set(this.registers),t.harmonicSum=this.harmonicSum,t.zeros=this.zeros,t}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return e<=2.5*this.m&&this.zeros>0?Math.round(this.m*Math.log(this.m/this.zeros)):Math.round(e)}},i=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;t<i;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return Number.NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,n=this.centroids[0].weight/2;if(i<=n)return this.centroids[0].mean;for(let e=1;e<this.centroids.length;e++){let t=this.centroids[e-1],o=this.centroids[e],s=(t.weight+o.weight)/2,r=n+s;if(i<=r){let e=(i-n)/s;return t.mean+(o.mean-t.mean)*e}n=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,this.centroids.length<=1))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,n=this.compression;for(let o=1;o<this.centroids.length;o++){let s=this.centroids[e],r=this.centroids[o],a=(t+s.weight/2)/i,l=4*i*a*(1-a)/n;if(s.weight+r.weight<=Math.max(1,l)){let e=s.weight+r.weight;s.mean=(s.mean*s.weight+r.mean*r.weight)/e,s.weight=e}else t+=s.weight,this.centroids[++e]=r}this.centroids.length=e+1}},n=(e,t)=>e-t,o=class{constructor(n,o){this.stats=new e,this.digest=n?new i:null,this.hll=o?new t:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},s=class{constructor(e){this.windows= new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&t<=e.size?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new o(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size){let n=Math.floor(e/this.size)*this.size;return void this.bump(n,t,i)}let n=this.hop,o=Math.floor(e/n);for(let s=Math.floor((e-this.size)/n)+1;s<=o;s++)this.bump(s*n,t,i)}bump(e,t,i){let o=this.windows.get(e);if(!o){if(this.windows.size>=this.retain&&e<this.starts[0])return;o=this.newBucket(),this.windows.set(e,o),this.retain!==1/0&&Ee(this.starts,e,n)}o.push(t,i)}pushSession(e,t,i){let n=e-this.gap,o=e+this.gap,s=0,r=this.sessions.length,a=this.sessions[r-1];if(!a||e>=a.end)s=r,a&&a.end>=n&&a.start<=o&&s--;else for(;s<r;){let e=s+r>>>1;this.sessions[e].end<n?s=e+1:r=e}let l=this.sessions[s];if(!l||l.start>o){let n=this.newBucket();return n.push(t,i),void this.sessions.splice(s,0,{start:e,end:e,bucket:n})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=s+1;for(;c<this.sessions.length&&this.sessions[c].start<=o;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>s+1&&this.sessions.splice(s+1,c-s-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(We(this.starts,n))}}emit(){if("session"===this.type)return this.sessions.map(e=>{let t=this.latest-e.end<this.gap;return this.row(e.start,e.end,e.bucket,t)});let e=[];for(let[t,i]of this.windows){let n=t+this.size;e.push(this.row(t,n,i,this.latest<n))}return e.sort((e,t)=>e.start-t.start),e}row(e,t,i,n){let o=i.stats,s={start:e,end:t,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(i.digest){let e={};for(let t of this.percentiles)e[Oe(t)]=i.digest.quantile(t);s.percentiles=e}return i.hll&&(s.distinct=i.hll.count()),s}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},r={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},a=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,l=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let i=[],n=Math.max(this._watermark-this.lateness,this._releasedThrough);return this._watermark!==-1/0&&t<n?(this._lateCount+=1,i.push(e),"drop"===this.latePolicy?{released:[],late:i}:{released:[e],late:i}):(t>this._watermark&&(this._watermark=t),Ee(this.held,{item:e,time:t,order:this.nextOrder++},Ke),{released:this.drain(this._watermark-this.lateness),late:i})}drain(e){let t=[],i=this.held[0];for(;i&&i.time<=e;)We(this.held,Ke),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}},c={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},u={opacity:.7,marginRight:4},h={display:"inline-block",width:8,height:8,borderRadius:"50%",marginRight:6},d=1e11,m=864e13,g="time",p="value",v="__aggLower",f="__aggUpper",y="__aggPartial",w="count",b="__aggStart",x="__aggEnd",A="__aggSeries",k=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups= new Map}push(e,t,i){let n=rt(e,t,"time"),o=ot(e,i,"value");if(null==n||null==o)return;let s=null==this.seriesAccessor?"":String("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor]),r=this.groups.get(s);if(!r){if(r=it(this.config),!r)return;this.groups.set(s,r)}r.push(+n,o)}emit(e){let t=[];for(let[i,n]of this.groups)for(let o of nt(n,e))t.push(null==this.seriesAccessor?o:{...o,[A]:i});return t}clear(){this.groups.clear()}},S=()=>({}),C=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(K);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,seriesAccessor:h,data:d,timeAccessor:m,valueAccessor:y,timeExtent:w,valueExtent:b,extentPadding:x,stroke:S,strokeWidth:C,strokeDasharray:_,opacity:H,cursor:M,styleRules:P,background:T,tooltipContent:I,tooltip:N,onHover:z,annotations:F,autoPlaceAnnotations:R,svgAnnotationRules:B,tickFormatTime:D,tickFormatValue:L,decay:O,pulse:E,staleness:W,transition:j,linkedHover:G,selection:U,onObservation:J,chartId:X,loading:Y,loadingContent:ce,emptyContent:ue,emphasis:he,legendPosition:de,aggregate:me,eventTime:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=n??[i.width,i.height],ye=S??"#007bff",we=C??2,be="string"==typeof y?y:"Value",xe=Pe(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:be,color:ye}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:we??2})}]}},[i.showLegend,be,ye,we]),Ae=Q(e.legendInteraction,()=>be,[be]),{legend:ke,margin:Se,legendPosition:Ce}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:de,userMargin:o,defaults:i.marginDefaults,additionalLegend:xe,chartWidth:fe[0],chartHeight:fe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),_e=Je({timeAccessor:m,valueAccessor:y}),He=te(),Me=ie({tooltip:N,defaultTooltipContent:_e,customFunctionContext:"hover",multiDefaultContent:e=>He({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof y?y:"value")})):e.allSeries})}),Re=I??Me.tooltipContent,Be=Te(null),{activeSelectionHook:Le,customHoverBehavior:Oe,customClickBehavior:Ee,crosshairSourceId:We}=ne({selection:U,linkedHover:G,unwrapData:!0,onObservation:J,chartType:"RealtimeLineChart",chartId:X,mobileInteraction:i.mobileInteraction}),Ve=Ie(e=>{z&&z(e),Oe(e)},[z,Oe]),je=null!=me,[$e,Ke]=Ne([]),Ge=Te(null),Ue=Te(me);Ue.current=me;let Ze=Te(je);Ze.current=je;let qe=Te($e),Xe=Ie(e=>{qe.current=e,Ke(e)},[]),Ye=Te({timeAccessor:m,valueAccessor:y});Ye.current={timeAccessor:m,valueAccessor:y};let Qe=je?[me.window??"tumbling",me.size,me.hop??"",me.gap??"",me.retain??"",(me.percentiles??[]).join(","),!0===me.distinct?"1":"0"].join("|"):"";ze(()=>{if(!je)return void(Ge.current=null);let e=Ue.current,t=new k(e,h);if(Ge.current=t,d){let{timeAccessor:e,valueAccessor:i}=Ye.current;for(let n of d)t.push(n,e,i)}Xe(t.emit(e))},[Qe,je,d,m,y,h,Xe]),ze(()=>{je&&Ge.current&&Xe(Ge.current.emit(Ue.current))},[me?.stat,me?.band,me?.sigma]);let et=Ie(e=>{let t=Ge.current,i=Ue.current;if(!t||!i)return;let{timeAccessor:n,valueAccessor:o}=Ye.current;for(let i of e)t.push(i,n,o);Xe(t.emit(i))},[Xe]),it=null!=ge,nt=Te(null),ot=Te(ge);ot.current=ge;let st=Te(it);st.current=it;let ct=Te(J);ct.current=J;let dt=Te(X);dt.current=X;let mt=it?`${ge.lateness}|${ge.latePolicy??"drop"}`:"",gt=Ie(e=>{0!==e.length&&(Ze.current?et(e):Be.current?.pushMany(e))},[et]);ze(()=>{let e=nt.current;if(e&>(e.flush()),!it)return void(nt.current=null);let t=m;nt.current=at(ot.current,e=>Number(rt(e,t,"time")??NaN))},[mt,it,gt,m]);let pt=Ie(e=>{let t=nt.current;if(!st.current||!t)return void gt(e);let i=[];for(let n of e){let e=t.push(n);for(let t of e.released)i.push(t);if(e.late.length){let i=ct.current;if(i){let{timeAccessor:n}=Ye.current,o=ot.current?.latePolicy??"drop";for(let s of e.late)i({type:"late-data",datum:s,eventTime:Number(rt(s,n,"time")??NaN),watermark:t.watermark,policy:o,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:dt.current})}}}gt(i)},[gt]),vt=Ie(()=>{let e=nt.current;!st.current||!e||gt(e.flush())},[gt]);Fe(t,()=>({push:e=>pt([e]),pushMany:e=>pt(e),flush:vt,remove:e=>Ze.current?[]:Be.current?.remove(e)??[],update:(e,t)=>Ze.current?[]:Be.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Ze.current?(Ge.current?.clear(),Xe([])):Be.current?.clear()},getData:()=>Ze.current?qe.current:Be.current?.getData()??[],getScales:()=>Be.current?.getScales()??null}),[vt,pt,Xe]);let ft=oe(Y,fe[0],fe[1],ce,e),yt=ft?null:se(je?void 0:d,fe[0],fe[1],ue,e),wt=Pe(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),bt=Pe(()=>re(je?g:m??"time",je?p:y??"value"),[je,m,y]),xt=Pe(()=>ae(wt,P,bt),[wt,P,bt]),At=Pe(()=>{let e=Z(xt,{stroke:S,strokeWidth:C,opacity:H});return t=>({...e(t),...null!=_&&{strokeDasharray:_},...null!=M&&{cursor:M}})},[xt,S,C,H,_,M]),kt=ut(At,[Le],U),St=a??l??"sliding",Ct=tt(c,d,u),_t=he?`${s||""} semiotic-emphasis-${he}`.trim():s,Ht=je?$e:d,Mt=je?g:m,Pt=je?p:y,Tt=je?"growing":St,It=me?.retain??Math.max($e.length,600),Nt=je?Math.max(1,It):Ct,zt=je&&me&&"none"!==(me.band??"none")?{y0Accessor:v,y1Accessor:f,perSeries:null!=h}:void 0;return ft||yt|| De(V,{ref:Be,...le(G,We),chartType:"line",runtimeMode:"streaming",size:fe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Se,className:_t,...ht(i,Ae,e.legendInteraction),arrowOfTime:r,windowMode:Tt,windowSize:Nt,data:Ht,timeAccessor:Mt,valueAccessor:Pt,groupAccessor:je&&null!=h?A:h,xExtent:w,yExtent:b,extentPadding:x,band:zt,lineStyle:kt??At,showAxes:pe,background:T,hoverAnnotation:ve,tooltipContent:Re,tooltipMode:Me.tooltipMode,...q({linkedHover:G,selection:U,onObservation:J,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ve,customClickBehavior:Ee}),annotations:F,legend:ke,legendPosition:Ce,autoPlaceAnnotations:R,svgAnnotationRules:B,tickFormatTime:D,tickFormatValue:L,decay:O,pulse:E,staleness:W,transition:j,pointIdAccessor:e.pointIdAccessor})}),"RealtimeLineChart"),_=/*#__PURE__*/Symbol("realtime-function-category-domain"),H=typeof window>"u"?ze:Re,M=[],P=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(D);let i=lt(e),{binSize:n,binAlign:o,size:s,margin:r,className:a,arrowOfTime:l="right",windowMode:c,capacityMode:u,windowSize:h,capacity:d,data:m,timeAccessor:g,valueAccessor:p,direction:v="up",timeExtent:f,valueExtent:y,extentPadding:w,categoryAccessor:b,colors:x,fill:A,stroke:k,strokeWidth:S,opacity:C,cursor:_,styleRules:H,valueBands:P,gap:T,background:I,tooltipContent:N,tooltip:z,onHover:F,annotations:R,autoPlaceAnnotations:B,svgAnnotationRules:L,tickFormatTime:O,tickFormatValue:E,linkedHover:W,selection:K,decay:U,pulse:Z,staleness:X,transition:Y,onObservation:te,chartId:re,loading:ue,loadingContent:he,emptyContent:de,emphasis:me,legendPosition:ge,legend:pe,brush:ve,onBrush:fe,linkedBrush:ye}=e,we=i.showAxes,be=Pe(()=>mt({axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}),[e.axes,e.showTimeAxis,e.showValueAxis]),xe=ce({showAxes:we,axes:be}),Ae=gt(i.marginDefaults,be,we,!!i.title),ke=i.enableHover,Se=!1!==i.showLegend,Ce=s??[i.width,i.height],_e=G({isPushMode:void 0===m,colorBy:b,colorScheme:x,showLegend:!1,legendPosition:ge,trackCategoryDomain:Se,registerLinkedCategories:!1}),He=Pe(()=>J(m??[],b),[m,b]),Me=void 0===m?_e.categories:He,{colorScale:Ne,colorMap:ze}=pt({enabled:!!b,categories:Me,colors:x,fallbackColor:A,order:"explicit-then-alpha",domainKey:b}),Fe=Pe(()=>{if(!ze)return Me;let e=new Set(Me);return Object.keys(ze).filter(t=>e.has(t))},[Me,ze]),Re=Ie(e=>{if(null!=e.category)return String(e.category);let t="function"==typeof b?b(e):b?e[b]:"";return String(t)},[b]),{legend:Be,margin:Le,legendPosition:Oe,hasAutomaticLegend:Ee}=ee({data:M,colorBy:b,colorScale:Ne,showLegend:i.showLegend,legendPosition:ge,userMargin:r,defaults:Ae,categories:Fe,additionalLegend:pe,chartWidth:Ce[0],chartHeight:Ce[1],axisChrome:xe}),We=Q(e.legendInteraction,b?Re:void 0,Fe,Ee,!0),Ve=ie({tooltip:z,defaultTooltipContent:Qe({timeAccessor:g,valueAccessor:p,formatTime:O}),multiDefaultContent:Xe({timeAccessor:g,valueAccessor:p,formatTime:O}),customFunctionContext:"hover"}),je=N??Ve.tooltipContent,$e=Te(null),{activeSelectionHook:Ke,hoverSelectionHook:Ge,customHoverBehavior:Ue,customClickBehavior:Ze,crosshairSourceId:qe}=ne({selection:K,linkedHover:W,hoverHighlight:e.hoverHighlight,hoverHighlightField:"binStart",unwrapData:!0,onObservation:te,chartType:"RealtimeHistogram",chartId:re,mobileInteraction:i.mobileInteraction}),Je=Ie(e=>{F&&F(e),Ue(e)},[F,Ue]),Ye=!0===ve?{dimension:"x",snap:"bin"}:"x"===ve?{dimension:"x"}:"object"==typeof ve?ve:void 0,et=Ie(e=>{fe&&fe(e),te&&te(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re})},[fe,te,re]),{brushStreamProps:it}=j({linkedBrush:ye,xAccessor:"string"==typeof g?g:"time",defaultDimension:"x",onBrush:et});ct(t,$e);let nt=oe(ue,Ce[0],Ce[1],he,e),st=nt?null:se(m,Ce[0],Ce[1],de,e),at={};null!=A&&(at.fill=A),null!=k&&(at.stroke=k),null!=S&&(at.strokeWidth=S),null!=C&&(at.opacity=C),null!=_&&(at.cursor=_),null!=T&&(at.gap=T),null!=P&&(at.valueBands=P);let vt=Pe(()=>{if(b&&Ne)return e=>null==e.category?{}:{fill:Ne(String(e.category))}},[b,Ne]),ft=Pe(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,n=Number(e.binStart),o=Number(e.binEnd);return{value:i,x:Number.isFinite(n)&&Number.isFinite(o)?(n+o)/2:void 0,y:i,category:null==e.category?void 0:String(e.category)}},[]),yt=Pe(()=>ae(vt,H,ft),[vt,H,ft]),wt=Pe(()=>e=>({...yt(e),...!b&&null!=A&&{fill:A},...null!=k&&{stroke:k},...null!=S&&{strokeWidth:S},...null!=C&&{opacity:C},...null!=_&&{cursor:_}}),[yt,b,A,k,S,C,_]),bt=Ge||We.legendSelectionHook||Ke,xt="string"==typeof g?g:"time",At=ut(wt,[bt],K,Pe(()=>dt(xt),[xt])),kt=me?`${a||""} semiotic-emphasis-${me}`.trim():a,St=Ie(e=>rt(e,g,"time")??NaN,[g]),Ct=Ie(e=>ot(e,p,"value")??NaN,[p]),_t=c??u??"sliding",Ht=tt(h,m,d);return nt||st|| De(V,{ref:$e,...le(W,qe),chartType:"bar",runtimeMode:"streaming",size:Ce,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Le,className:kt,...ht(i,We,e.legendInteraction),arrowOfTime:l,windowMode:_t,windowSize:Ht,data:m,timeAccessor:St,valueAccessor:Ct,xExtent:f,yExtent:y,invertY:"down"===v,extentPadding:w,binSize:n,binAlign:o,categoryAccessor:b,barColors:ze,barStyle:at,areaStyle:At,showAxes:we,showGrid:i.showGrid,axes:be,background:I,hoverAnnotation:ke,tooltipContent:je,tooltipMode:Ve.tooltipMode,...q({linkedHover:W,selection:K,hoverHighlight:e.hoverHighlight,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Je,customClickBehavior:Ze}),annotations:R,autoPlaceAnnotations:B,svgAnnotationRules:L,tickFormatTime:O,tickFormatValue:E,decay:U,pulse:Z,staleness:X,transition:Y,pointIdAccessor:e.pointIdAccessor,legend:Be,legendPosition:Oe,..._e.categoryDomainProps,brush:Ye||(ye?it.brush:void 0),onBrush:Ye||ye?it.onBrush:void 0})}),"RealtimeHistogram"),T=/*#__PURE__*/Y(function(e){
|
|
37
|
-
return De(P,{...e,windowMode:"growing"})},"TemporalHistogram"),I=P,N=[],
|
|
23
|
+
return Re("div",{className:"semiotic-tooltip",style:c,children:[
|
|
24
|
+
Re("div",{children:[
|
|
25
|
+
De("span",{style:u,children:"range:"}),Ke(o.binStart,o.binEnd,n)]}),null!=o.total&& Re("div",{children:[
|
|
26
|
+
De("span",{style:u,children:"count:"}),qe(o.total)]}),null!=o.category&& Re("div",{children:[
|
|
27
|
+
De("span",{style:u,children:"category:"}),qe(o.category)]}),null!=o.category&&null!=o.categoryValue&& Re("div",{children:[
|
|
28
|
+
De("span",{style:u,children:"category count:"}),qe(o.categoryValue)]})]})}}function et(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:o="y"}=e;return e=>{let s=e?.data??null,r=s?.xCenter??Xe(s,t,"time"),a=s?.yCenter??Xe(s,i,"value"),l=s?.count,h=s?.sum,d=s?.value,m=s?.agg??"count";
|
|
29
|
+
return Re("div",{className:"semiotic-tooltip",style:c,children:[
|
|
30
|
+
Re("div",{children:[
|
|
31
|
+
Re("span",{style:u,children:[n,":"]}),qe(r)]}),
|
|
32
|
+
Re("div",{children:[
|
|
33
|
+
Re("span",{style:u,children:[o,":"]}),qe(a)]}),null!=l&& Re("div",{children:[
|
|
34
|
+
De("span",{style:u,children:"count:"}),qe(l)]}),"sum"===m&&null!=h&& Re("div",{children:[
|
|
35
|
+
De("span",{style:u,children:"sum:"}),qe(h)]}),"mean"===m&&null!=d&& Re("div",{children:[
|
|
36
|
+
De("span",{style:u,children:"mean:"}),qe(d)]})]})}}function tt(e,t,i){return e??i??Math.max(t?.length??0,200)}function it(e){let t=e.window??"tumbling",i=Ve("session"===t?e.gap??e.size:e.size);if(null==i)return null;let n=null!=e.hop?Ve(e.hop):void 0,o=null!=e.gap?Ve(e.gap):void 0;return new s({window:t,size:i,hop:n??void 0,gap:o??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function nt(e,t){let i=t.stat??"mean",n=t.band??"none",o=t.sigma??1;return e.emit().map(e=>{let t={[g]:(e.start+e.end)/2,[p]:je(e,i),[w]:e.count,[y]:e.partial,[b]:e.start,[x]:e.end},s=$e(e,n,i,o);return s&&(t[v]=s[0],t[f]=s[1]),t})}function ot(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;let o=Number(n);return Number.isFinite(o)?o:null}function st(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=K(e);if(Number.isFinite(t))return t}return Number(e)}function rt(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;if(n instanceof Date)return Number.isFinite(n.getTime())?n:null;if("string"==typeof n){let e=K(n);if(Number.isFinite(e))return new Date(e)}let o=Number(n);return Number.isFinite(o)?o:null}function at(e,t){let i=Ve(e.lateness);return null==i?null:new l({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function lt(e){return{...J(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showGrid:e.showGrid,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function ct(e,t){He.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function ut(e,t,i,n){let o=t.find(Boolean)??null;return He.useMemo(()=>o?ye(e??S,o,i,n):e,[o,e,i,n])}function ht(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function dt(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Se(Ce({...t},_e(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:st})}function mt(e){if(!e.axes)return[{orient:"bottom",visible:!1!==e.showTimeAxis},{orient:"left",visible:!1!==e.showValueAxis}];let t=(...t)=>e.axes.some(e=>t.includes(e.orient)),i=!1===e.showTimeAxis&&!t("bottom","top"),n=!1===e.showValueAxis&&!t("left","right");return i||n?[...e.axes,...i?[{orient:"bottom",visible:!1}]:[],...n?[{orient:"left",visible:!1}]:[]]:e.axes}function gt(e,t,i,n=!1){let o=ce({axes:t,showAxes:i});return{...ue(e,t,n),...!o.hasAxis&&{bottom:0},...!o.leftAxis?.hasAxis&&{left:0}}}function pt({enabled:e,categories:t,colors:i,fallbackColor:n,order:o="discovery",domainKey:s}){let r=he(!0),a=de(),l=me(),c=ge(),u="function"==typeof s?_:s,h=Te(null),d=Pe(()=>{let e=h.current,n=e&&Object.is(e.domainKey,u)?new Map(e.indexes): new Map,s=new Set(t),r="explicit-then-alpha"===o?[...Object.keys(i??{}).filter(e=>s.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)pe(n,e);return{domainKey:u,indexes:n}},[t,i,o,u]);H(()=>{h.current=d},[d]);let m=d.indexes,g=Pe(()=>{if(!e)return;let t=c&&c.length>0?c:l?we:be;return e=>{let o=pe(m,e);return(r?xe(r,e):void 0)||(i?xe(i,e):void 0)||n||(a?xe(a,e):void 0)||t[o%t.length]}},[m,i,e,n,l,a,r,c]),p=Pe(()=>{if(!e||!g)return i;let n=Object.keys(i??{}),s=new Set(n),r=t.filter(e=>!s.has(e));"explicit-then-alpha"===o&&r.sort();let a=[...n,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?xe(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,o]);return{colorScale:g,colorMap:p}}var e=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count;let i=e-this._mean;this._m2+=t*i,e<this._min&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,e._min<this._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return this._count<2?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return this._count<2?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},t=class e{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(e){let t=Le(String(e)),i=t>>>32-this.p,n=Math.min(Math.clz32(t<<this.p),32-this.p)+1;this.updateRegister(i,n)}updateRegister(e,t){let i=this.registers[e];t<=i||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;t<this.m;t++)this.updateRegister(t,e.registers[t])}clone(){let t=new e(this.p);return t.registers.set(this.registers),t.harmonicSum=this.harmonicSum,t.zeros=this.zeros,t}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return e<=2.5*this.m&&this.zeros>0?Math.round(this.m*Math.log(this.m/this.zeros)):Math.round(e)}},i=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;t<i;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return Number.NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,n=this.centroids[0].weight/2;if(i<=n)return this.centroids[0].mean;for(let e=1;e<this.centroids.length;e++){let t=this.centroids[e-1],o=this.centroids[e],s=(t.weight+o.weight)/2,r=n+s;if(i<=r){let e=(i-n)/s;return t.mean+(o.mean-t.mean)*e}n=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,this.centroids.length<=1))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,n=this.compression;for(let o=1;o<this.centroids.length;o++){let s=this.centroids[e],r=this.centroids[o],a=(t+s.weight/2)/i,l=4*i*a*(1-a)/n;if(s.weight+r.weight<=Math.max(1,l)){let e=s.weight+r.weight;s.mean=(s.mean*s.weight+r.mean*r.weight)/e,s.weight=e}else t+=s.weight,this.centroids[++e]=r}this.centroids.length=e+1}},n=(e,t)=>e-t,o=class{constructor(n,o){this.stats=new e,this.digest=n?new i:null,this.hll=o?new t:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},s=class{constructor(e){this.windows= new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&t<=e.size?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new o(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size){let n=Math.floor(e/this.size)*this.size;return void this.bump(n,t,i)}let n=this.hop,o=Math.floor(e/n);for(let s=Math.floor((e-this.size)/n)+1;s<=o;s++)this.bump(s*n,t,i)}bump(e,t,i){let o=this.windows.get(e);if(!o){if(this.windows.size>=this.retain&&e<this.starts[0])return;o=this.newBucket(),this.windows.set(e,o),this.retain!==1/0&&Ee(this.starts,e,n)}o.push(t,i)}pushSession(e,t,i){let n=e-this.gap,o=e+this.gap,s=0,r=this.sessions.length,a=this.sessions[r-1];if(!a||e>=a.end)s=r,a&&a.end>=n&&a.start<=o&&s--;else for(;s<r;){let e=s+r>>>1;this.sessions[e].end<n?s=e+1:r=e}let l=this.sessions[s];if(!l||l.start>o){let n=this.newBucket();return n.push(t,i),void this.sessions.splice(s,0,{start:e,end:e,bucket:n})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=s+1;for(;c<this.sessions.length&&this.sessions[c].start<=o;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>s+1&&this.sessions.splice(s+1,c-s-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(We(this.starts,n))}}emit(){if("session"===this.type)return this.sessions.map(e=>{let t=this.latest-e.end<this.gap;return this.row(e.start,e.end,e.bucket,t)});let e=[];for(let[t,i]of this.windows){let n=t+this.size;e.push(this.row(t,n,i,this.latest<n))}return e.sort((e,t)=>e.start-t.start),e}row(e,t,i,n){let o=i.stats,s={start:e,end:t,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(i.digest){let e={};for(let t of this.percentiles)e[Oe(t)]=i.digest.quantile(t);s.percentiles=e}return i.hll&&(s.distinct=i.hll.count()),s}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},r={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},a=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,l=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let i=[],n=Math.max(this._watermark-this.lateness,this._releasedThrough);return this._watermark!==-1/0&&t<n?(this._lateCount+=1,i.push(e),"drop"===this.latePolicy?{released:[],late:i}:{released:[e],late:i}):(t>this._watermark&&(this._watermark=t),Ee(this.held,{item:e,time:t,order:this.nextOrder++},Ge),{released:this.drain(this._watermark-this.lateness),late:i})}drain(e){let t=[],i=this.held[0];for(;i&&i.time<=e;)We(this.held,Ge),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}},c={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},u={opacity:.7,marginRight:4},h={display:"inline-block",width:8,height:8,borderRadius:"50%",marginRight:6},d=1e11,m=864e13,g="time",p="value",v="__aggLower",f="__aggUpper",y="__aggPartial",w="count",b="__aggStart",x="__aggEnd",A="__aggSeries",k=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups= new Map}push(e,t,i){let n=rt(e,t,"time"),o=ot(e,i,"value");if(null==n||null==o)return;let s=null==this.seriesAccessor?"":String("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor]),r=this.groups.get(s);if(!r){if(r=it(this.config),!r)return;this.groups.set(s,r)}r.push(+n,o)}emit(e){let t=[];for(let[i,n]of this.groups)for(let o of nt(n,e))t.push(null==this.seriesAccessor?o:{...o,[A]:i});return t}clear(){this.groups.clear()}},S=()=>({}),C=/*#__PURE__*/Q(/*#__PURE__*/Me(function(e,t){V(G);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,seriesAccessor:h,data:d,timeAccessor:m,valueAccessor:y,timeExtent:w,valueExtent:b,extentPadding:x,stroke:S,strokeWidth:C,strokeDasharray:_,opacity:H,cursor:M,styleRules:P,background:T,tooltipContent:I,tooltip:N,onHover:B,annotations:z,autoPlaceAnnotations:F,svgAnnotationRules:R,tickFormatTime:D,tickFormatValue:L,decay:O,pulse:E,staleness:W,transition:$,linkedHover:U,selection:K,onObservation:Y,chartId:J,loading:Q,loadingContent:ce,emptyContent:ue,emphasis:he,legendPosition:de,aggregate:me,eventTime:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=n??[i.width,i.height],ye=S??"#007bff",we=C??2,be="string"==typeof y?y:"Value",xe=Pe(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:be,color:ye}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:we??2})}]}},[i.showLegend,be,ye,we]),Ae=Z(e.legendInteraction,()=>be,[be]),{legend:ke,margin:Se,legendPosition:Ce}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:de,userMargin:o,defaults:i.marginDefaults,additionalLegend:xe,chartWidth:fe[0],chartHeight:fe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),_e=Ye({timeAccessor:m,valueAccessor:y}),He=te(),Me=ie({tooltip:N,defaultTooltipContent:_e,customFunctionContext:"hover",multiDefaultContent:e=>He({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof y?y:"value")})):e.allSeries})}),Fe=I??Me.tooltipContent,Re=Te(null),{activeSelectionHook:Le,customHoverBehavior:Oe,customClickBehavior:Ee,crosshairSourceId:We}=ne({selection:K,linkedHover:U,unwrapData:!0,onObservation:Y,chartType:"RealtimeLineChart",chartId:J,mobileInteraction:i.mobileInteraction}),je=Ie(e=>{B&&B(e),Oe(e)},[B,Oe]),$e=null!=me,[Ve,Ge]=Ne([]),Ue=Te(null),Ke=Te(me);Ke.current=me;let Xe=Te($e);Xe.current=$e;let qe=Te(Ve),Je=Ie(e=>{qe.current=e,Ge(e)},[]),Qe=Te({timeAccessor:m,valueAccessor:y});Qe.current={timeAccessor:m,valueAccessor:y};let Ze=$e?[me.window??"tumbling",me.size,me.hop??"",me.gap??"",me.retain??"",(me.percentiles??[]).join(","),!0===me.distinct?"1":"0"].join("|"):"";Be(()=>{if(!$e)return void(Ue.current=null);let e=Ke.current,t=new k(e,h);if(Ue.current=t,d){let{timeAccessor:e,valueAccessor:i}=Qe.current;for(let n of d)t.push(n,e,i)}Je(t.emit(e))},[Ze,$e,d,m,y,h,Je]),Be(()=>{$e&&Ue.current&&Je(Ue.current.emit(Ke.current))},[me?.stat,me?.band,me?.sigma]);let et=Ie(e=>{let t=Ue.current,i=Ke.current;if(!t||!i)return;let{timeAccessor:n,valueAccessor:o}=Qe.current;for(let i of e)t.push(i,n,o);Je(t.emit(i))},[Je]),it=null!=ge,nt=Te(null),ot=Te(ge);ot.current=ge;let st=Te(it);st.current=it;let ct=Te(Y);ct.current=Y;let dt=Te(J);dt.current=J;let mt=it?`${ge.lateness}|${ge.latePolicy??"drop"}`:"",gt=Ie(e=>{0!==e.length&&(Xe.current?et(e):Re.current?.pushMany(e))},[et]);Be(()=>{let e=nt.current;if(e&>(e.flush()),!it)return void(nt.current=null);let t=m;nt.current=at(ot.current,e=>Number(rt(e,t,"time")??NaN))},[mt,it,gt,m]);let pt=Ie(e=>{let t=nt.current;if(!st.current||!t)return void gt(e);let i=[];for(let n of e){let e=t.push(n);for(let t of e.released)i.push(t);if(e.late.length){let i=ct.current;if(i){let{timeAccessor:n}=Qe.current,o=ot.current?.latePolicy??"drop";for(let s of e.late)i({type:"late-data",datum:s,eventTime:Number(rt(s,n,"time")??NaN),watermark:t.watermark,policy:o,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:dt.current})}}}gt(i)},[gt]),vt=Ie(()=>{let e=nt.current;!st.current||!e||gt(e.flush())},[gt]);ze(t,()=>({push:e=>pt([e]),pushMany:e=>pt(e),flush:vt,remove:e=>Xe.current?[]:Re.current?.remove(e)??[],update:(e,t)=>Xe.current?[]:Re.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Xe.current?(Ue.current?.clear(),Je([])):Re.current?.clear()},getData:()=>Xe.current?qe.current:Re.current?.getData()??[],getScales:()=>Re.current?.getScales()??null}),[vt,pt,Je]);let ft=oe(Q,fe[0],fe[1],ce,e),yt=ft?null:se($e?void 0:d,fe[0],fe[1],ue,e),wt=Pe(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),bt=Pe(()=>re($e?g:m??"time",$e?p:y??"value"),[$e,m,y]),xt=Pe(()=>ae(wt,P,bt),[wt,P,bt]),At=Pe(()=>{let e=X(xt,{stroke:S,strokeWidth:C,opacity:H});return t=>({...e(t),...null!=_&&{strokeDasharray:_},...null!=M&&{cursor:M}})},[xt,S,C,H,_,M]),kt=ut(At,[Le],K),St=a??l??"sliding",Ct=tt(c,d,u),_t=he?`${s||""} semiotic-emphasis-${he}`.trim():s,Ht=$e?Ve:d,Mt=$e?g:m,Pt=$e?p:y,Tt=$e?"growing":St,It=me?.retain??Math.max(Ve.length,600),Nt=$e?Math.max(1,It):Ct,Bt=$e&&me&&"none"!==(me.band??"none")?{y0Accessor:v,y1Accessor:f,perSeries:null!=h}:void 0;return ft||yt|| De(j,{ref:Re,...le(U,We),chartType:"line",runtimeMode:"streaming",size:fe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Se,className:_t,...ht(i,Ae,e.legendInteraction),arrowOfTime:r,windowMode:Tt,windowSize:Nt,data:Ht,timeAccessor:Mt,valueAccessor:Pt,groupAccessor:$e&&null!=h?A:h,xExtent:w,yExtent:b,extentPadding:x,band:Bt,lineStyle:kt??At,showAxes:pe,background:T,hoverAnnotation:ve,tooltipContent:Fe,tooltipMode:Me.tooltipMode,...q({linkedHover:U,selection:K,onObservation:Y,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:je,customClickBehavior:Ee}),annotations:z,legend:ke,legendPosition:Ce,autoPlaceAnnotations:F,svgAnnotationRules:R,tickFormatTime:D,tickFormatValue:L,decay:O,pulse:E,staleness:W,transition:$,pointIdAccessor:e.pointIdAccessor})}),"RealtimeLineChart"),_=/*#__PURE__*/Symbol("realtime-function-category-domain"),H=typeof window>"u"?Be:Fe,M=[],P=/*#__PURE__*/Q(/*#__PURE__*/Me(function(e,t){V(D);let i=lt(e),{binSize:n,binAlign:o,size:s,margin:r,className:a,arrowOfTime:l="right",windowMode:c,capacityMode:u,windowSize:h,capacity:d,data:m,timeAccessor:g,valueAccessor:p,direction:v="up",timeExtent:f,valueExtent:y,extentPadding:w,categoryAccessor:b,colors:x,fill:A,stroke:k,strokeWidth:S,opacity:C,cursor:_,styleRules:H,valueBands:P,gap:T,background:I,tooltipContent:N,tooltip:B,onHover:z,annotations:F,autoPlaceAnnotations:R,svgAnnotationRules:L,tickFormatTime:O,tickFormatValue:E,linkedHover:W,selection:G,decay:K,pulse:X,staleness:J,transition:Q,onObservation:te,chartId:re,loading:ue,loadingContent:he,emptyContent:de,emphasis:me,legendPosition:ge,legend:pe,brush:ve,onBrush:fe,linkedBrush:ye}=e,we=i.showAxes,be=Pe(()=>mt({axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}),[e.axes,e.showTimeAxis,e.showValueAxis]),xe=ce({showAxes:we,axes:be}),Ae=gt(i.marginDefaults,be,we,!!i.title),ke=i.enableHover,Se=!1!==i.showLegend,Ce=s??[i.width,i.height],_e=U({isPushMode:void 0===m,colorBy:b,colorScheme:x,showLegend:!1,legendPosition:ge,trackCategoryDomain:Se,registerLinkedCategories:!1}),He=Pe(()=>Y(m??[],b),[m,b]),Me=void 0===m?_e.categories:He,{colorScale:Ne,colorMap:Be}=pt({enabled:!!b,categories:Me,colors:x,fallbackColor:A,order:"explicit-then-alpha",domainKey:b}),ze=Pe(()=>{if(!Be)return Me;let e=new Set(Me);return Object.keys(Be).filter(t=>e.has(t))},[Me,Be]),Fe=Ie(e=>{if(null!=e.category)return String(e.category);let t="function"==typeof b?b(e):b?e[b]:"";return String(t)},[b]),{legend:Re,margin:Le,legendPosition:Oe,hasAutomaticLegend:Ee}=ee({data:M,colorBy:b,colorScale:Ne,showLegend:i.showLegend,legendPosition:ge,userMargin:r,defaults:Ae,categories:ze,additionalLegend:pe,chartWidth:Ce[0],chartHeight:Ce[1],axisChrome:xe}),We=Z(e.legendInteraction,b?Fe:void 0,ze,Ee,!0),je=ie({tooltip:B,defaultTooltipContent:Ze({timeAccessor:g,valueAccessor:p,formatTime:O}),multiDefaultContent:Je({timeAccessor:g,valueAccessor:p,formatTime:O}),customFunctionContext:"hover"}),$e=N??je.tooltipContent,Ve=Te(null),{activeSelectionHook:Ge,hoverSelectionHook:Ue,customHoverBehavior:Ke,customClickBehavior:Xe,crosshairSourceId:qe}=ne({selection:G,linkedHover:W,hoverHighlight:e.hoverHighlight,hoverHighlightField:"binStart",unwrapData:!0,onObservation:te,chartType:"RealtimeHistogram",chartId:re,mobileInteraction:i.mobileInteraction}),Ye=Ie(e=>{z&&z(e),Ke(e)},[z,Ke]),Qe=!0===ve?{dimension:"x",snap:"bin"}:"x"===ve?{dimension:"x"}:"object"==typeof ve?ve:void 0,et=Ie(e=>{fe&&fe(e),te&&te(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re})},[fe,te,re]),{brushStreamProps:it}=$({linkedBrush:ye,xAccessor:"string"==typeof g?g:"time",defaultDimension:"x",onBrush:et});ct(t,Ve);let nt=oe(ue,Ce[0],Ce[1],he,e),st=nt?null:se(m,Ce[0],Ce[1],de,e),at={};null!=A&&(at.fill=A),null!=k&&(at.stroke=k),null!=S&&(at.strokeWidth=S),null!=C&&(at.opacity=C),null!=_&&(at.cursor=_),null!=T&&(at.gap=T),null!=P&&(at.valueBands=P);let vt=Pe(()=>{if(b&&Ne)return e=>null==e.category?{}:{fill:Ne(String(e.category))}},[b,Ne]),ft=Pe(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,n=Number(e.binStart),o=Number(e.binEnd);return{value:i,x:Number.isFinite(n)&&Number.isFinite(o)?(n+o)/2:void 0,y:i,category:null==e.category?void 0:String(e.category)}},[]),yt=Pe(()=>ae(vt,H,ft),[vt,H,ft]),wt=Pe(()=>e=>({...yt(e),...!b&&null!=A&&{fill:A},...null!=k&&{stroke:k},...null!=S&&{strokeWidth:S},...null!=C&&{opacity:C},...null!=_&&{cursor:_}}),[yt,b,A,k,S,C,_]),bt=Ue||We.legendSelectionHook||Ge,xt="string"==typeof g?g:"time",At=ut(wt,[bt],G,Pe(()=>dt(xt),[xt])),kt=me?`${a||""} semiotic-emphasis-${me}`.trim():a,St=Ie(e=>rt(e,g,"time")??NaN,[g]),Ct=Ie(e=>ot(e,p,"value")??NaN,[p]),_t=c??u??"sliding",Ht=tt(h,m,d);return nt||st|| De(j,{ref:Ve,...le(W,qe),chartType:"bar",runtimeMode:"streaming",size:Ce,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Le,className:kt,...ht(i,We,e.legendInteraction),arrowOfTime:l,windowMode:_t,windowSize:Ht,data:m,timeAccessor:St,valueAccessor:Ct,xExtent:f,yExtent:y,invertY:"down"===v,extentPadding:w,binSize:n,binAlign:o,categoryAccessor:b,barColors:Be,barStyle:at,areaStyle:At,showAxes:we,showGrid:i.showGrid,axes:be,background:I,hoverAnnotation:ke,tooltipContent:$e,tooltipMode:je.tooltipMode,...q({linkedHover:W,selection:G,hoverHighlight:e.hoverHighlight,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ye,customClickBehavior:Xe}),annotations:F,autoPlaceAnnotations:R,svgAnnotationRules:L,tickFormatTime:O,tickFormatValue:E,decay:K,pulse:X,staleness:J,transition:Q,pointIdAccessor:e.pointIdAccessor,legend:Re,legendPosition:Oe,..._e.categoryDomainProps,brush:Qe||(ye?it.brush:void 0),onBrush:Qe||ye?it.onBrush:void 0})}),"RealtimeHistogram"),T=/*#__PURE__*/Q(function(e){
|
|
37
|
+
return De(P,{...e,windowMode:"growing"})},"TemporalHistogram"),I=P,N=[],B=/*#__PURE__*/Q(/*#__PURE__*/Me(function(e,t){V(L);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:m,timeExtent:g,valueExtent:p,yScaleType:v,extentPadding:f,decay:y,pulse:w,staleness:b,transition:x,categoryAccessor:A,colors:k,radius:S,fill:C,opacity:_,stroke:H,strokeWidth:M,cursor:P,pointStyle:T,styleRules:I,background:B,tooltipContent:z,tooltip:F,onHover:R,annotations:D,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:W,tickFormatValue:$,linkedHover:G,selection:K,onObservation:X,chartId:J,loading:Q,loadingContent:te,emptyContent:ie,emphasis:ce,legendPosition:ue}=e,he=i.showAxes,de=i.enableHover,me=!0===i.showLegend,ge=n??[i.width,i.height],pe=U({isPushMode:void 0===h,colorBy:A,colorScheme:k,showLegend:!1,legendPosition:ue,trackCategoryDomain:me,registerLinkedCategories:!1}),fe=Pe(()=>Y(h??[],A),[h,A]),ye=void 0===h?pe.categories:fe,{colorScale:we}=pt({enabled:!!A,categories:ye,colors:k,fallbackColor:C,domainKey:A}),{legend:be,margin:xe,legendPosition:Ae,hasAutomaticLegend:ke}=ee({data:N,colorBy:A,colorScale:we,showLegend:me,legendPosition:ue,userMargin:o,defaults:i.marginDefaults,categories:ye,chartWidth:ge[0],chartHeight:ge[1],axisChrome:{hasAxis:!1!==i.showAxes}}),Se=Z(e.legendInteraction,A,ye,ke,!0),Ce=z??ve({tooltip:F,defaultTooltipContent:Ye({timeAccessor:d,valueAccessor:m}),customFunctionContext:"hover"}).tooltipContent,_e=Te(null),{activeSelectionHook:He,hoverSelectionHook:Me,customHoverBehavior:Ne,customClickBehavior:Be,crosshairSourceId:ze}=ne({selection:K,linkedHover:G,unwrapData:!0,onObservation:X,chartType:"RealtimeSwarmChart",chartId:J,mobileInteraction:i.mobileInteraction}),Fe=Ie(e=>{R&&R(e),Ne(e)},[R,Ne]);ct(t,_e);let Re=oe(Q,ge[0],ge[1],te,e),Le=Re?null:se(h,ge[0],ge[1],ie,e),Oe={};null!=S&&(Oe.radius=S),null!=C&&(Oe.fill=C),null!=_&&(Oe.opacity=_),null!=H&&(Oe.stroke=H),null!=M&&(Oe.strokeWidth=M),null!=P&&(Oe.cursor=P);let Ee=T,We=Pe(()=>{if(A)return e=>{let t="function"==typeof A?A(e):A?e[A]:void 0;return{...A&&we?{fill:we(String(t))}:void 0}}},[A,we]),je=Pe(()=>{let e=re(d??"time",m??"value");return t=>{let i="function"==typeof A?A(t):A?t[A]:void 0;return e(t,null==i?void 0:String(i))}},[d,m,A]),$e=Pe(()=>ae(We,I,je),[We,I,je]),Ve=ut(Pe(()=>e=>({...$e(e),...Ee?.(e)}),[$e,Ee]),[Me||Se.legendSelectionHook||He],K),Ge=ce?`${s||""} semiotic-emphasis-${ce}`.trim():s,Ue=a??l??"sliding",Ke=tt(c,h,u);return Re||Le|| De(j,{ref:_e,...le(G,ze),chartType:"swarm",runtimeMode:"streaming",size:ge,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,className:Ge,...ht(i,Se,e.legendInteraction),arrowOfTime:r,windowMode:Ue,windowSize:Ke,data:h,timeAccessor:d,valueAccessor:m,xExtent:g,yExtent:p,yScaleType:v,extentPadding:f,decay:y,pulse:w,staleness:b,transition:x,categoryAccessor:A,swarmStyle:Oe,pointStyle:Ve,showAxes:he,background:B,hoverAnnotation:de,tooltipContent:Ce,...q({linkedHover:G,selection:K,onObservation:X,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Fe,customClickBehavior:Be}),annotations:D,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:W,tickFormatValue:$,legend:be,legendPosition:Ae,...pe.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})}),"RealtimeSwarmChart"),z=/*#__PURE__*/Q(/*#__PURE__*/Me(function(e,t){V(O);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:m,timeExtent:g,valueExtent:p,extentPadding:v,decay:f,pulse:y,staleness:w,transition:b,positiveColor:x,negativeColor:A,connectorStroke:k,connectorWidth:S,gap:C,stroke:_,strokeWidth:H,opacity:M,cursor:P,styleRules:T,background:I,tooltipContent:N,tooltip:B,onHover:z,annotations:F,autoPlaceAnnotations:R,svgAnnotationRules:D,tickFormatTime:L,tickFormatValue:E,linkedHover:W,selection:$,onObservation:G,chartId:U,loading:K,loadingContent:X,emptyContent:Y,emphasis:J,legendPosition:Q}=e,te=i.showAxes,ie=i.enableHover,ce=n??[i.width,i.height],ue=Pe(()=>{if(i.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:x},{label:"Negative",color:A}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[A,x,i.showLegend]),he=Ie(e=>{let t=e.delta??("function"==typeof m?m(e):e[m??"value"]);return Number(t)>=0?"Positive":"Negative"},[m]),de=Z(e.legendInteraction,he,["Positive","Negative"]),{legend:me,margin:ge,legendPosition:pe}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:Q,userMargin:o,defaults:i.marginDefaults,additionalLegend:ue,chartWidth:ce[0],chartHeight:ce[1],axisChrome:{hasAxis:!1!==i.showAxes}}),fe=N??ve({tooltip:B,defaultTooltipContent:Qe({timeAccessor:d,valueAccessor:m}),customFunctionContext:"hover"}).tooltipContent,ye=Te(null),{activeSelectionHook:we,hoverSelectionHook:be,customHoverBehavior:xe,customClickBehavior:Ae,crosshairSourceId:ke}=ne({selection:$,linkedHover:W,unwrapData:!0,onObservation:G,chartType:"RealtimeWaterfallChart",chartId:U,mobileInteraction:i.mobileInteraction}),Se=Ie(e=>{z&&z(e),xe(e)},[z,xe]);ct(t,ye);let Ce=oe(K,ce[0],ce[1],X,e),_e=Ce?null:se(h,ce[0],ce[1],Y,e),He={};null!=x&&(He.positiveColor=x),null!=A&&(He.negativeColor=A),null!=k&&(He.connectorStroke=k),null!=S&&(He.connectorWidth=S),null!=C&&(He.gap=C),null!=_&&(He.stroke=_),null!=H&&(He.strokeWidth=H),null!=M&&(He.opacity=M),null!=P&&(He.cursor=P);let Me=be||de.legendSelectionHook||we,Ne=Pe(()=>re(d??"time",m??"value"),[d,m]),Be=Pe(()=>ae(void 0,T,Ne),[T,Ne]),ze=ut(Pe(()=>e=>({...Be(e),...null!=_&&{stroke:_},...null!=H&&{strokeWidth:H},...null!=M&&{opacity:M},...null!=P&&{cursor:P}}),[Be,_,H,M,P]),[Me],$),Fe=J?`${s||""} semiotic-emphasis-${J}`.trim():s,Re=a??l??"sliding",Le=tt(c,h,u);return Ce||_e|| De(j,{ref:ye,...le(W,ke),chartType:"waterfall",runtimeMode:"streaming",size:ce,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ge,className:Fe,...ht(i,de,e.legendInteraction),arrowOfTime:r,windowMode:Re,windowSize:Le,data:h,timeAccessor:d,valueAccessor:m,xExtent:g,yExtent:p,extentPadding:v,decay:f,pulse:y,staleness:w,transition:b,waterfallStyle:He,areaStyle:ze,showAxes:te,background:I,hoverAnnotation:ie,tooltipContent:fe,...q({linkedHover:W,selection:$,onObservation:G,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Se,customClickBehavior:Ae}),annotations:F,autoPlaceAnnotations:R,svgAnnotationRules:D,tickFormatTime:L,tickFormatValue:E,legend:me,legendPosition:pe,pointIdAccessor:e.pointIdAccessor})}),"RealtimeWaterfallChart"),F=/*#__PURE__*/Q(/*#__PURE__*/Me(function(e,t){V(E);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:m,categoryAccessor:g,timeExtent:p,valueExtent:v,extentPadding:f,heatmapXBins:y=20,heatmapYBins:w=20,aggregation:b="count",colorScheme:x,customColorScale:A,cursor:k,styleRules:S,background:C,tooltipContent:_,tooltip:H,onHover:M,annotations:P,autoPlaceAnnotations:T,svgAnnotationRules:I,tickFormatTime:N,tickFormatValue:B,decay:z,pulse:F,staleness:D,linkedHover:L,selection:O,onObservation:W,chartId:$,loading:G,loadingContent:U,emptyContent:K,emphasis:X,legendPosition:Y}=e,J=i.showAxes,Q=i.enableHover,Z=n??[i.width,i.height],[te,ie]=Ne(null),re=Pe(()=>te??[0,1],[te]),ce=Pe(()=>{if("custom"===x&&A)return A;let e=Ae(x||"blues");return t=>{let i=re[1]-re[0]||1;return e(Math.max(0,Math.min(1,(t-re[0])/i)))}},[x,A,re]),ue=fe(e.legendInteraction,e=>Number(e.value),re),he=Pe(()=>i.showLegend?{gradient:{colorFn:ce,domain:re,label:b}}:void 0,[b,ce,i.showLegend,re]),{legend:de,margin:me,legendPosition:ge}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:Y,userMargin:o,defaults:i.marginDefaults,additionalLegend:he,chartWidth:Z[0],chartHeight:Z[1],axisChrome:{hasAxis:!1!==i.showAxes}}),pe=_??ve({tooltip:H,defaultTooltipContent:et({timeAccessor:d,valueAccessor:m}),customFunctionContext:"hover"}).tooltipContent,ye=Te(null),{activeSelectionHook:we,hoverSelectionHook:be,customHoverBehavior:xe,customClickBehavior:ke,crosshairSourceId:Se}=ne({selection:O,linkedHover:L,unwrapData:!0,onObservation:W,chartType:"RealtimeHeatmap",chartId:$,mobileInteraction:i.mobileInteraction}),Ce=Ie(e=>{M&&M(e),xe(e)},[M,xe]);ct(t,ye);let _e=oe(G,Z[0],Z[1],U,e),He=_e?null:se(h,Z[0],Z[1],K,e),Me=X?`${s||""} semiotic-emphasis-${X}`.trim():s,Be=a??l??"sliding",ze=tt(c,h,u),Fe=Pe(()=>{if(null==k)return;let e={cursor:k};return()=>e},[k]),Re=Pe(()=>R(d??"time",m??"value",m??"value"),[d,m]),Le=ut(Pe(()=>ae(Fe,S,Re),[Fe,S,Re]),[be,ue.legendSelectionHook,we],O);return _e||He|| De(j,{ref:ye,...le(L,Se),chartType:"heatmap",runtimeMode:"streaming",size:Z,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:me,className:Me,...ht(i,ue,e.legendInteraction),arrowOfTime:r,windowMode:Be,windowSize:ze,data:h,timeAccessor:d,valueAccessor:m,categoryAccessor:g,xExtent:p,yExtent:v,extentPadding:f,heatmapXBins:y,heatmapYBins:w,heatmapAggregation:b,colorScheme:"custom"!==x?x:void 0,heatmapColorScale:"custom"===x&&"function"==typeof A?A:void 0,onColorDomainChange:ie,areaStyle:Le,showAxes:J,background:C,hoverAnnotation:Q,tooltipContent:pe,...q({linkedHover:L,selection:O,onObservation:W,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ce,customClickBehavior:ke}),annotations:P,autoPlaceAnnotations:T,svgAnnotationRules:I,tickFormatTime:N,tickFormatValue:B,decay:z,pulse:F,staleness:D,legend:de,legendPosition:ge,pointIdAccessor:e.pointIdAccessor})}),"RealtimeHeatmap");export{e as a,t as b,i as c,s as d,je as e,$e as f,Ve as g,l as h,C as i,dt as j,P as k,T as l,I as m,B as n,z as o,F as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(){a("sankey",c),a("force",o),a("chord",t),a("tree",e),a("cluster",e),a("treemap",e),a("circlepack",e),a("partition",e),a("orbit",i)}import{b as c,c as o,d as t,e,k as i}from"./c-JDU4Y4IW.min.js";import{c as a}from"./c-DEWMXCOF.min.js";export{r as a};
|