{"version":3,"file":"Simple_Line_Chart.CtHTELbM.mjs","names":[],"sources":["https:/framerusercontent.com/modules/qTvVuFhWfnckoiaBSZ1A/8JzSE3tC1qiUqZs6UNyA/Simple_Line_Chart.js"],"sourcesContent":["\"use client\";import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{m,useInView,LazyMotion,domAnimation}from\"framer-motion\";import{useRef}from\"react\";// -------------------------------------------------- //\n// FRAMER PROPERTY CONTROLS\n// -------------------------------------------------- //\naddPropertyControls(SimpleLineChartFramer,{minY:{type:ControlType.Number,title:\"Min Y\",defaultValue:0},maxY:{type:ControlType.Number,title:\"Max Y\",defaultValue:140},values:{type:ControlType.Array,title:\"Values\",control:{type:ControlType.Number},defaultValue:[0,20,15,40,60,50,80,100,75,100,120,140]},strokeColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#f0591a\"},strokeWidth:{type:ControlType.Number,title:\"Line Width\",defaultValue:8,min:1,max:50,step:1},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"rgba(0, 0, 0, 0)\"},transitionAnimation:{type:ControlType.Transition,// defaultValue: { type: \"spring\", stiffness: 800, damping: 60 },\ndefaultValue:{duration:2,ease:\"easeInOut\",pathLength:{type:\"spring\",duration:2.5}}},smoothLine:{type:ControlType.Boolean,title:\"Smooth Line\",defaultValue:true},smoothness:{type:ControlType.Number,title:\"Smoothness\",defaultValue:33,min:0,max:100,unit:\"%\",step:1,hidden:props=>!props.smoothLine},inViewAnimation:{type:ControlType.Object,title:\"In View Animation\",defaultValue:{once:true,amount:.5},controls:{once:{type:ControlType.Boolean,title:\"Once\",defaultValue:true,description:\"If true, the animation will only play once.\"},amount:{type:ControlType.Number,title:\"Amount\",defaultValue:.3,min:0,max:1,description:\"The amount of the component that must be in view to trigger the animation.\"}}},viewBox:{type:ControlType.Object,title:\"Viewbox SVG\",defaultValue:{minX:0,minY:0,width:1e3,height:800},controls:{minX:{type:ControlType.Number,title:\"Min X\",defaultValue:0},minY:{type:ControlType.Number,title:\"Min Y\",defaultValue:0},width:{type:ControlType.Number,title:\"Width\",defaultValue:1e3,min:1},height:{type:ControlType.Number,title:\"Height\",defaultValue:800,min:1}}}});// -------------------------------------------------- //\n// MAIN COMPONENT\n// -------------------------------------------------- //\n/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 400\n * @framerIntrinsicWidth 600\n * @framerDisableUnlink\n */export default function SimpleLineChartFramer(props){// Generate points with calculated X values\nconst points=props.values.map((y,index)=>({x:index/(props.values.length-1||1)*props.viewBox.width,y:props.viewBox.height-(y-props.minY)/(props.maxY-props.minY)*props.viewBox.height}));// Generate path data from points with optional smoothing\nconst pathData=points.length>0?props.smoothLine?points.reduce((path,point,index)=>{if(index===0)return`M ${point.x} ${point.y}`;// Calculate control points with smoothness factor\nconst prev=points[index-1];const distance=(point.x-prev.x)*(props.smoothness/100)// Convert percentage to factor\n;const controlPoint1X=prev.x+distance;const controlPoint2X=point.x-distance;return`${path} C ${controlPoint1X} ${prev.y}, ${controlPoint2X} ${point.y}, ${point.x} ${point.y}`;},\"\"):points.map((point,index)=>`${index===0?\"M\":\"L\"} ${point.x} ${point.y}`).join(\" \"):\"\";const isOnFramerCanvas=RenderTarget.hasRestrictions();// Add ref and useInView hook\nconst ref=useRef(null);const isInView=useInView(ref,{once:props.inViewAnimation.once,amount:props.inViewAnimation.amount});return /*#__PURE__*/_jsx(LazyMotion,{features:domAnimation,children:/*#__PURE__*/_jsx(\"svg\",{ref:ref,width:\"100%\",height:\"100%\",viewBox:`${props.viewBox.minX} ${props.viewBox.minY} ${props.viewBox.width} ${props.viewBox.height}`,style:{backgroundColor:props.backgroundColor},children:points.length>0&&/*#__PURE__*/_jsx(m.path,{d:pathData,fill:\"none\",stroke:props.strokeColor,strokeWidth:props.strokeWidth,initial:{pathLength:isOnFramerCanvas?1:0,opacity:1},animate:{pathLength:isInView?1:0,opacity:1},transition:props.transitionAnimation})})});}SimpleLineChartFramer.displayName=\"LINE CHART - BACHOFF STUDIO\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SimpleLineChartFramer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Simple_Line_Chart.map"],"mappings":"gZAaG,SAAwB,EAAsB,EAAM,CACvD,IAAM,EAAO,EAAM,OAAO,IAAI,CAAC,EAAE,KAAS,CAAC,EAAE,GAAO,EAAM,OAAO,OAAO,GAAG,GAAG,EAAM,QAAQ,MAAM,EAAE,EAAM,QAAQ,QAAQ,EAAE,EAAM,OAAO,EAAM,KAAK,EAAM,MAAM,EAAM,QAAQ,MAAO,GAAE,CACjL,EAAS,EAAO,OAAO,EAAE,EAAM,WAAW,EAAO,OAAO,CAAC,EAAK,EAAM,IAAQ,CAAC,GAAG,IAAQ,EAAE,OAAO,IAAI,EAAM,EAAE,GAAG,EAAM,IAC5H,IAAM,EAAK,EAAO,EAAM,GAAS,GAAU,EAAM,EAAE,EAAK,IAAI,EAAM,WAAW,KACtE,EAAe,EAAK,EAAE,EAAe,EAAe,EAAM,EAAE,EAAS,SAAS,EAAK,KAAK,EAAe,GAAG,EAAK,EAAE,IAAI,EAAe,GAAG,EAAM,EAAE,IAAI,EAAM,EAAE,GAAG,EAAM,GAAK,EAAC,GAAG,CAAC,EAAO,IAAI,CAAC,EAAM,OAAW,IAAQ,EAAE,IAAI,IAAI,GAAG,EAAM,EAAE,GAAG,EAAM,IAAI,CAAC,KAAK,IAAI,CAAC,GAAS,EAAiB,EAAa,iBAAiB,CACzT,EAAI,EAAO,KAAK,CAAO,EAAS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