@graphysdk/viz-engine 0.0.1-plugins.9 → 1.8.1-beta.1786024899180

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.
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./config.types-CQX-tSXl.cjs");var v="value",L=t.prefixInternalVariable("lineSeriesLabel"),P=t.prefixInternalVariable("barSeriesLabel"),N=t.prefixInternalVariable("constantY"),C=.15,W=(e,r,i,s)=>j[r](e,i,s),E=e=>{const{numeric:r,categorical:i,temporal:s}=e.groupVariableNamesByType();return t.isDefined(s[0])?s[0]:t.isDefined(i[0])?i[0]:t.isDefined(r[0])?r[0]:""},x=e=>{const r=E(e),{numeric:i}=e.groupVariableNamesByType(),s=i.filter(a=>a!==r);return s.length<=1?{transforms:[],mapping:{x:r,y:s[0]??""},seriesVariables:s}:{transforms:[t.transform.reshape({keep:[r],keyName:"key",valueName:v})],mapping:{x:r,y:v,color:"key"},seriesVariables:s}},w=e=>{const r=e.appearance?.seriesStyles;if(!r||e.seriesVariables.length===0)return{mapping:{},scales:[]};if(!e.seriesVariables.some(s=>t.isDefined(r[s]?.lineStyle)))return{mapping:{},scales:[]};if(e.seriesVariables.length===1){const s=e.seriesVariables[0];if(!s)return{mapping:{},scales:[]};const a=r[s]?.lineStyle;return a?{mapping:{lineType:{value:a}},scales:[]}:{mapping:{},scales:[]}}const i=e.seriesVariables.map(s=>r[s]?.lineStyle??"solid");return{mapping:{lineType:"key"},scales:[t.scale.lineType.discrete({domain:e.seriesVariables,range:i})]}},z=e=>{const{categorical:r,temporal:i,numeric:s}=e.groupVariableNamesByType(),a=s[0];if(!t.isDefined(a))throw new t.UserInputError({code:"INVALID_DATA_SHAPE",message:"No first numeric variable found",suggestion:"Provide at least one numeric column for this chart type."});const n=s.slice(1);return n.length===0?{...H(),mapping:{x:a,y:N,label:r[0]}}:n.length===1?{transforms:[],scales:[],mapping:{x:a,y:n[0]??"",label:r[0]}}:{transforms:[t.transform.reshape({keep:[a,...r,...i],keyName:"key",valueName:v})],scales:[],mapping:{x:a,y:v,label:r[0],color:"key"}}},H=()=>({transforms:[t.transform.constant({variableName:N,type:"categorical",value:""})],scales:[t.scale.y.discrete()]}),Y=e=>{const{categorical:r,temporal:i,numeric:s}=e.groupVariableNamesByType();let a,n;if(t.isDefined(r[0])&&t.isDefined(s[0]))a=r[0],n=s[0];else if(t.isDefined(i[0])&&t.isDefined(s[0]))a=i[0],n=s[0];else if(t.isDefined(s[0])&&t.isDefined(s[1]))a=s[0],n=s[1];else throw new t.UserInputError({code:"INVALID_DATA_SHAPE",message:"No label or value variable found",suggestion:"Provide a label column and a numeric value column for this chart type."});return{x:"",y:n,color:a}},M=(e,r,i)=>{const{transforms:s,mapping:a,seriesVariables:n}=x(e.dataset),o=w({appearance:i,seriesVariables:n}),u=n.length<=1,l=[t.geom.line({params:{interpolate:r?.isSmoothLine?"catmull-rom":"linear",missingValues:r?.missingValues}})],c=[];return u&&(r?.showFill??!0)&&c.push(t.style.geom.line({fillAlpha:C})),typeof r?.lineThickness=="number"&&c.push(t.style.geom.line({strokeWidth:r.lineThickness})),r?.showPoints&&(l.push(t.geom.point({interactive:!1})),typeof r.pointSize=="number"&&c.push(t.style.geom.point({size:r.pointSize}))),{layers:l,coords:t.coord.cartesian(),mapping:{...a,...o.mapping},scales:o.scales,transforms:s,seriesVariables:n,styleDefaults:c}},U=(e,r,i)=>{const{transforms:s,mapping:a,seriesVariables:n}=x(e.dataset),o=w({appearance:i,seriesVariables:n}),u=[t.geom.area({position:"stack",params:{interpolate:r?.isSmoothLine?"catmull-rom":"linear",missingValues:r?.missingValues}})],l=[];return typeof r?.lineThickness=="number"&&l.push(t.style.geom.area({strokeWidth:r.lineThickness})),r?.showPoints&&(u.push(t.geom.point({position:"stack",interactive:!1})),typeof r.pointSize=="number"&&l.push(t.style.geom.point({size:r.pointSize}))),{layers:u,coords:t.coord.cartesian(),mapping:{...a,...o.mapping},scales:o.scales,transforms:s,seriesVariables:n,styleDefaults:l}},h=(e,r,i,s,a)=>{const{transforms:n,mapping:o,seriesVariables:u}=x(e.dataset),l=[...n];if(s?.sortBars){const c=t.extractVariableName(o.y);c!==null&&c!==""&&l.push(t.transform.sort({variableName:c,direction:"desc"}))}if(!a?.useSingleColorForBars){const c=E(e.dataset),{numeric:p}=e.dataset.groupVariableNamesByType();p.filter(y=>y!==c).length===1&&e.dataset.getType(c)==="categorical"&&(o.color=c)}return{layers:[t.geom.bar({position:r})],coords:i,mapping:o,scales:[],transforms:l,seriesVariables:u}},_=(e,r)=>({layers:[t.geom.bar({position:"fill"})],coords:t.coord.polar({theta:"y",innerRadius:r==="donut"?.55:0}),mapping:Y(e.dataset),scales:[],seriesVariables:[]}),G=e=>{const{transforms:r,scales:i,mapping:s}=z(e.dataset);return{layers:[t.geom.point()],coords:t.coord.cartesian(),mapping:s,scales:i,transforms:r,seriesVariables:[]}},K=e=>{const{numeric:r,categorical:i}=e.dataset.groupVariableNamesByType(),s=r[0];if(!t.isDefined(s))throw new t.UserInputError({code:"INVALID_DATA_SHAPE",message:"No first numeric variable found",suggestion:"Provide at least one numeric column for this chart type."});const a=t.isDefined(r[1])?{transforms:[],scales:[]}:H(),n={x:s,y:r[1]??N,size:r[2],label:i[0]},o=[...a.scales];return t.isDefined(n.size)&&o.push(t.scale.size.continuous()),{layers:[t.geom.point()],coords:t.coord.cartesian(),mapping:n,scales:o,transforms:a.transforms,seriesVariables:[]}},T=(e,r,i)=>{const s=i?.seriesStyles?.[e]?.lineStyle;return t.geom.line({transforms:[t.transform.constant({variableName:L,type:"categorical",value:e})],aes:{y:e,color:L,...s?{lineType:{value:s}}:{}},...r?{yScaleType:"secondary"}:void 0})},X=(e,r,i)=>{const{numeric:s,categorical:a,temporal:n}=e.dataset.groupVariableNamesByType(),o=E(e.dataset),u=[...a,...n],l=s.filter(m=>m!==o),c=r?.comboType??"grouped-bars",p=c==="lines";if(l.length===1)return p?M(e,r,i):h(e,"dodge",t.coord.cartesian(),r,i);const y=e.axes?.hasDualYAxis===!0,b=p?[]:l.slice(0,-1),f=p?l:l.slice(-1),d=[],D=[];if(b.length>0){const m=c==="stacked-bars"?"stack":"dodge",g=b.length===1?b[0]:null;t.isDefined(g)?d.push(t.geom.bar({transforms:[t.transform.constant({variableName:P,type:"categorical",value:g})],aes:{y:g,color:P},position:m})):d.push(t.geom.bar({transforms:[t.transform.reshape({keep:u,reshape:b,keyName:"key",valueName:v})],aes:{y:v,color:"key"},position:m}))}if(p&&f.length>=2){const m=y?f.slice(0,-1):f,g=m.length===1?m[0]:null;if(t.isDefined(g))d.push(T(g,!1,i));else{const S=w({appearance:i,seriesVariables:m});d.push(t.geom.line({transforms:[t.transform.reshape({keep:u,reshape:m,keyName:"key",valueName:v})],aes:{y:v,color:"key",...S.mapping}})),D.push(...S.scales)}if(y){const S=f[f.length-1];t.isDefined(S)&&d.push(T(S,!0,i))}}else for(const m of f)d.push(T(m,y,i));return{layers:d,coords:t.coord.cartesian(),mapping:{x:o},scales:D,seriesVariables:l}},k=e=>()=>{throw new t.UserInputError({code:"UNSUPPORTED_GRAPH_TYPE",message:`Unsupported graph type: ${e}`,context:{requested:e}})},j={line:(e,r,i)=>M(e,r,i),areaStacked:(e,r,i)=>U(e,r,i),bar:(e,r,i)=>h(e,"dodge",t.coord.flip(),r,i),barStacked:(e,r,i)=>h(e,"stack",t.coord.flip(),r,i),barStackedFill:(e,r,i)=>h(e,"fill",t.coord.flip(),r,i),column:(e,r,i)=>h(e,"dodge",t.coord.cartesian(),r,i),columnStacked:(e,r,i)=>h(e,"stack",t.coord.cartesian(),r,i),columnStackedFill:(e,r,i)=>h(e,"fill",t.coord.cartesian(),r,i),pie:e=>_(e,"pie"),donut:e=>_(e,"donut"),scatter:e=>G(e),bubble:e=>K(e),combo:(e,r,i)=>X(e,r,i),funnel:k("funnel"),heatmap:k("heatmap"),waterfall:k("waterfall"),mekko:k("mekko"),table:k("table")},q="#%_ENCODED_%#",F=e=>{if(!e.startsWith(q))return e;try{const{value:r}=JSON.parse(e.slice(13));return typeof r=="string"?r:e}catch{return e}},$=({annotations:e,dataset:r,mapping:i,seriesVariables:s})=>{const a=[],n=[],o=[],u=[],l=[],c=[],p=[],y=[],b={dataset:r,...J(i,s)};for(const f of e??[])switch(f.type){case"difference-arrow":{const d=Q(f,b);d!==null&&a.push(d);break}case"shape":n.push(Z(f));break;case"arrow":o.push(te(f));break;case"highlight":break;case"text":u.push(re(f));break;case"image":l.push(ee(f));break;case"sticker":{const d=ie(f,b);d!==null&&c.push(d);break}case"tooltip":{const d=se(f,b);if(d===null)break;d.kind==="pinnedNumber"?p.push(d.value):y.push(d.value);break}default:throw new t.InternalError({message:`Unsupported annotation type: ${f.type}`})}return{differenceArrows:a,shapes:n,arrows:o,textAnnotations:u,images:l,stickers:c,pinnedNumbers:p,comments:y}},J=(e,r)=>{const i=t.extractVariableName(e.x),s=t.extractVariableName(e.group)??t.extractVariableName(e.color),a=i!==null&&i!=="",n=s==="key"||r.length>=2;return{anchorVariable:a?i:s,groupIsSeriesKey:n}},Q=(e,r)=>{const i=V(r,e.start),s=V(r,e.end);return i===null||s===null?null:{id:e.id,start:i,end:s,label:e.show,color:e.color??null,size:e.size,labelCrossPosition:e.labelPosition}},Z=e=>({id:e.id,kind:e.shape,zOrder:e.layer==="abovePlot"?"foreground":"background",region:{anchorType:"panel",x:e.x,y:e.y,width:e.width,height:e.height},fillColor:e.fillColor,fillOpacity:e.fillOpacity,strokeWidth:e.strokeWidth,strokeColor:e.fillColor}),ee=e=>({id:e.id,src:e.src,zOrder:e.layer==="abovePlot"?"foreground":"background",region:{anchorType:"panel",x:e.x,y:e.y,width:e.width,height:e.height},fit:e.fit,opacity:e.opacity}),re=e=>({id:e.id,content:e.content,at:{anchorType:"panel",x:e.x,y:e.y},width:e.width,align:"top-left",backgroundColor:e.backgroundColor??null,backgroundColorStyle:e.backgroundColorStyle}),ie=(e,r)=>{const i=V(r,e);return i===null?null:{id:e.id,at:{anchorType:"observation",...i},sticker:e.sticker}},se=(e,r)=>{const i=V(r,e);return i===null?null:e.caption===null||e.caption===void 0?{kind:"pinnedNumber",value:{id:e.id,at:i}}:{kind:"comment",value:{id:e.id,at:i,content:e.caption}}},te=e=>({id:e.id,start:{anchorType:"panel",x:e.startX,y:e.startY},end:{anchorType:"panel",x:e.endX,y:e.endY},color:e.color??null,thickness:e.thickness,startArrowheadStyle:e.startArrowheadStyle,endArrowheadStyle:e.endArrowheadStyle,lineStyle:e.lineStyle,hasStickerStyle:e.hasStickerStyle}),V=(e,r)=>{if(!t.isDefined(r))return null;const{dataset:i,anchorVariable:s,groupIsSeriesKey:a}=e;if(s===null)return null;const n=ae(r,s,i);return n===null?null:a?t.isDefined(r.columnKey)?{anchorValue:n,groupValue:F(r.columnKey)}:null:{anchorValue:n,groupValue:void 0}},ae=(e,r,i)=>!t.isDefined(e.rowIndex)||!i.hasVariable(r)?null:i.getValues(r)[e.rowIndex]??null,ne="#E5E5E5",oe={x:"top",y:"left"},le=new Set(["pie","donut"]);function ce(e,r=!1){return t.config({legend:pe(e.legend),axes:ye(e.axes,r),headline:be(e),numberFormat:he(e.appearance),content:ge(e.content),appearance:ue(e.appearance,e.themeOverrides)}).config}function ue(e,r){const i=me(e?.border),s=e?.hasRoundedCorners===!1?0:void 0,a=de(e,r),n={};return e?.textScale!==void 0&&(n.textScale=e.textScale),i!==void 0&&(n.border=i),s!==void 0&&(n.cornerRadius=s),a!==void 0&&(n.background=a),Object.keys(n).length>0?n:void 0}function de(e,r){if(e?.backgroundModifier==="tint")return{type:"tinted"};const i=r?.graphBackground;if(typeof i=="string")return{type:"solid",color:i}}var fe=e=>t.BORDER_PRESETS.includes(e);function me(e){if(!e?.style)return;if(e.style==="none")return{type:"none"};const r=e.width??0;if(e.style==="grey")return{type:"solid",color:ne,width:r};if(e.style==="preset")return e.color===void 0||!fe(e.color)?void 0:{type:"preset",preset:e.color,width:r};if(e.color!==void 0)return e.style==="custom"?{type:"solid",color:e.color,width:r}:{type:e.style,color:e.color,width:r}}function pe(e){if(e)return{position:e.position}}function R(e,r,i){return!r&&i===void 0?{}:{...r?.isHidden!==void 0?{isVisible:!r.isHidden}:void 0,...r?.label!==void 0?{label:r.label}:void 0,...r?.isReversed?{position:oe[e]}:void 0,...r?.tickDisplayMode?{ticks:{mode:r.tickDisplayMode}}:void 0,...i!==void 0?{grid:{isVisible:i}}:void 0}}function ve(e){return{...e.label!==void 0?{label:e.label}:void 0}}function ye(e,r=!1){if(!e)return;const i=R("x",e.x,e.showGridLines),s=R("y",e.y,e.showGridLines);return{x:r?s:i,y:r?i:s,...e.y2?{ySecondary:ve(e.y2)}:void 0}}function be(e){const{headlineNumbers:r,options:i,type:s}=e,a=s!==void 0&&le.has(s)?i?.pieTotalPosition:void 0;if(r===void 0&&a===void 0)return;const n={};return r?.show!==void 0&&(n.show=r.show),r?.compareWith!==void 0&&(n.compareWith=r.compareWith),r?.size!==void 0&&(n.size=r.size),a!==void 0&&(n.show="total",n.position=a==="center"?"center":"above"),n}function he(e){if(e?.numberFormat)return{decimals:e.numberFormat.decimalPlaces,abbreviation:e.numberFormat.abbreviation}}function ge(e){if(!e)return;const r={};e.title!==void 0&&(r.title=e.title),e.isTitleHidden!==void 0&&(r.isTitleVisible=!e.isTitleHidden),e.subtitle!==void 0&&(r.subtitle=e.subtitle),e.isSubtitleHidden!==void 0&&(r.isSubtitleVisible=!e.isSubtitleHidden),e.caption!==void 0&&(r.caption=e.caption),e.isCaptionHidden!==void 0&&(r.isCaptionVisible=!e.isCaptionHidden);const i=Se(e.source);return i!==void 0&&(r.source=i),e.isSourceHidden!==void 0&&(r.isSourceVisible=!e.isSourceHidden),e.brandMark!==void 0&&(r.brandMark={...e.brandMark},e.brandMark.enabled!==void 0&&(r.isBrandMarkVisible=e.brandMark.enabled)),e.isBrandMarkHidden!==void 0&&e.brandMark?.enabled===void 0&&(r.isBrandMarkVisible=!e.isBrandMarkHidden),r}function Se(e){if(!e)return;const r={};return e.label!==void 0&&(r.label=e.label),e.url!==void 0&&(r.url=e.url),Object.keys(r).length===0?void 0:r}var ke=new t.TransformRegistry,Ve=["key",t.prefixInternalVariable("lineSeriesLabel"),t.prefixInternalVariable("barSeriesLabel")];function Te(e){const r=e.annotations??[],i=Ne(e.mapping),s=xe(e.dataset,e.transforms,e.layers),a=[];for(const n of r){if(n.type!=="highlight")continue;const o=Ee({annotation:n,rowIdentityVariable:i,dataset:e.dataset,compiledVariableNames:s});o!==null&&a.push({type:"highlight",id:n.id,predicate:o,scope:Ae(n.highlight,e.mapping)})}return a}function Ae(e,r){const i=t.extractVariableName(r.x);return!(i!==null&&i!=="")&&e==="x-value"?"series":e}function Ne(e){const r=t.extractVariableName(e.x);return r!==null&&r!==""?r:t.extractVariableName(e.color)}function Ee({annotation:e,rowIdentityVariable:r,dataset:i,compiledVariableNames:s}){switch(e.highlight){case"x-value":return I(e,r,i);case"series":return B(e,s);case"data-point":{const a=I(e,r,i),n=B(e,s);return a===null&&n===null?null:a===null?n:n===null?a:{and:[a,n]}}}}function I(e,r,i){if(r===null)return null;const s=we(e,r,i);return s===null?null:{variable:r,eq:s}}function B(e,r){const i=e.columnKey;if(!t.isDefined(i))return null;const s=Ve.filter(a=>r.includes(a));return s.length===0?null:{or:s.map(a=>({variable:a,eq:i}))}}function xe(e,r,i){const s=[...e.getVariableNames()],a=n=>{for(const o of n){const{getIntroducedVariables:u}=ke.get(o.transformType),l=u?.(o);l&&s.push(...l)}};a(r);for(const n of i)a(n.transforms??[]);return s}function we(e,r,i){return e.rowValue!==void 0?e.rowValue:!t.isDefined(e.rowIndex)||!i.getVariableNames().includes(r)?null:i.getValues(r)[e.rowIndex]??null}function De(e,r,i){const{colorScheme:s,customPalettes:a}=i;if(a&&e&&a[e])return{type:"custom",id:e};if(e?.startsWith("preset:pastel"))return{type:"pastel",variant:A(r)};if(e?.startsWith("preset:graphy"))return{type:"graphy",variant:A(r)};if(e?.startsWith("preset:mono:")){const n=e.slice(12);if(Le(n))return{type:"mono",base:n,variant:s}}if(e?.startsWith("preset:neon:")){const n=e.slice(12);if(Pe(n))return{type:"neon",base:n,variant:A(r)}}return{type:"default"}}function A(e){if(e==="waterfall")return"waterfall"}function Le(e){return t.MONO_BASES.includes(e)}function Pe(e){return t.NEON_BASES.includes(e)}function _e({axes:e,palette:r,overrides:i,isFlipped:s}){const a=[];return a.push(O("x",s?e?.y:e?.x)),a.push(O("y",s?e?.x:e?.y)),a.push(t.scale.color.palette({palette:r,overrides:i})),a}function O(e,r){return r?.scaleType==="logarithmic"||r?.min!==void 0||r?.max!==void 0?r.scaleType==="logarithmic"?t.scale[e].log({domainMin:r.min??void 0,domainMax:r.max??void 0}):t.scale[e]({domainMin:r.min??void 0,domainMax:r.max??void 0}):t.scale[e]()}function Re(e){if(!e)return;const r={};for(const[i,s]of Object.entries(e)){if(!i.startsWith("series"))continue;const a=Number.parseInt(i.slice(6));if(Number.isNaN(a))continue;const n={hex:s.customColor,id:s.paletteColorId};(n.hex!==void 0||n.id!==void 0)&&(r[a]=n)}return Object.keys(r).length>0?r:void 0}function Ie({palette:e,overrides:r,ctx:i}){const s=Oe(e,r,i);if(s!==void 0)return{type:"styles",defaults:[t.style.geom.bar({color:s}),t.style.geom.line({color:s}),t.style.geom.area({color:s}),t.style.geom.point({color:s})]}}function Be(e){return e?.highlightStyle===void 0?[]:e.highlightStyle==="grey"?[t.style.geom({saturation:0,alpha:.6},{state:"dimmed"})]:[t.style.geom({alpha:t.DEFAULT_DIMMED_ALPHA},{state:"dimmed"})]}function Oe(e,r,i){const s=e.type==="custom"?i.customPalettes?.[e.id]:void 0,a=r?.[1];if(a?.hex!==void 0)return a.hex;if(a?.id!==void 0){const n=s?.find(o=>o.id===a.id)?.hex;if(n!==void 0)return n}if(e.type!=="default")return e.type==="custom"?s?.[0]?.hex:t.resolvePaletteRange(e)[0]}var He=new Set(["column","columnStacked","columnStackedFill","bar","barStacked","barStackedFill","line","areaStacked","scatter","bubble","funnel","combo"]),Me=new Set(["column","columnStacked","columnStackedFill","bar","barStacked","barStackedFill","line","areaStacked","combo"]);function Fe(e,r,i={}){return Ce(t.parseDataset(r),e,i)}function Ce(e,r,i={}){const s=r.type??"column",a=W({dataset:e,axes:r.axes},s,r.options??void 0,r.appearance??void 0),n=a.coords.coordType==="flip",o=a.transforms??[],u=De(r.appearance?.paletteId,s,i),l=Re(r.appearance?.seriesStyles);return{mapping:a.mapping,layers:ze(s,r,a.layers,a.coords,a.mapping,a.seriesVariables),scales:[..._e({axes:r.axes,palette:u,overrides:l,isFlipped:n}),...a.scales],styles:We(Ie({palette:u,overrides:l,ctx:i}),[...a.styleDefaults??[],...Be(r.appearance??void 0)]),transforms:o,highlights:Te({annotations:r.annotations,dataset:e,mapping:a.mapping,transforms:o,layers:a.layers}),annotations:$({annotations:r.annotations,dataset:e,mapping:a.mapping,seriesVariables:a.seriesVariables}),coords:a.coords,config:ce(r,n)}}function We(e,r){const i=[...e?.defaults??[],...r??[]];if(i.length!==0)return{type:"styles",defaults:i}}function ze(e,r,i,s,a,n){const o=Xe(r.dataLabels),u=o===void 0?i:i.filter(c=>c.interactive!==!1).map(c=>({...c,dataLabels:{...o,...c.dataLabels}})),l=r.axes?.hasDualYAxis??!1;return[...u,...Ye({type:e,trendline:r.referenceLines?.trendline,coords:s}),...Ue({type:e,hasDualYAxis:l,goalLine:r.referenceLines?.goalLine,coords:s}),...Ke({type:e,hasDualYAxis:l,averageLine:r.referenceLines?.averageLine,coords:s,mapping:a,seriesVariables:n})]}function Ye({type:e,trendline:r,coords:i}){return r===void 0?[]:He.has(e)?i.coordType==="polar"?[]:[t.geom.line({aes:{lineType:{value:"dashed"}},stat:t.stat.smooth({method:r}),interactive:!1})]:[]}function Ue({type:e,hasDualYAxis:r,goalLine:i,coords:s}){if(!Ge(i))return[];if(s.coordType==="polar")return[];const a=s.coordType==="flip"?"end":"start";return[t.geom.rule({aes:{y:{value:i.target}},params:{labelPosition:a,label:i.label??"Goal"},yScaleType:e==="combo"&&r?"secondary":"primary",interactive:!1})]}function Ge(e){return e!==void 0&&Number.isFinite(e.target)}function Ke({type:e,hasDualYAxis:r,averageLine:i,coords:s,mapping:a,seriesVariables:n}){if(i===void 0)return[];if(!Me.has(e))return[];if(s.coordType==="polar")return[];const o=F(i.columnKey);if(!n.includes(o))return[];const u=a.color==="key",l=u?v:o,c=u?[t.transform.filter({variableName:"key",operator:"eq",value:o})]:[];return[t.geom.rule({aes:{y:l,color:void 0,group:void 0,lineType:void 0},stat:t.stat.mean(),transforms:c,params:{label:"Average",labelPosition:s.coordType==="flip"?"end":"start"},yScaleType:e==="combo"&&r?"secondary":"primary",interactive:!1})]}function Xe(e){if(!e)return;const r={};return e.showDataLabels!==void 0&&(r.showDataLabels=e.showDataLabels),e.dataLabelFormat!==void 0&&(r.format=e.dataLabelFormat),e.showStackTotals!==void 0&&(r.showStackTotals=e.showStackTotals),e.showCategoryLabels!==void 0&&(r.showCategoryLabels=e.showCategoryLabels),Object.keys(r).length===0?void 0:r}var je=[.8,1,1.2,1.4,1.6,1.8,2,2.5,3,4];exports.CHART_TEXT_SCALES=je;exports.convertGraphConfig=Fe;