UNPKG

vue-data-ui-hq

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

2 lines (1 loc) 7.3 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./useNestedProp-C14rfl0j.cjs"),c=require("./index-ZfICPrrM.cjs"),C=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_=["xmlns","height","width"],p={id:"follower",fy:"30%",fx:"30%"},x=["stop-color","stop-opacity"],E=["r","fill","stroke","stroke-width","stroke-dasharray"],N=["r"],g={key:2,class:"wave"},V=["id"],w=["id"],S=["filter","stroke"],B={key:3,class:"crosshair"},R=["x1","stroke","stroke-width","stroke-dasharray"],b=["x1","stroke","stroke-width","stroke-dasharray"],F=["y1","stroke","stroke-width","stroke-dasharray"],z=["y1","stroke","stroke-width","stroke-dasharray"],L=["cy","r","fill"],O=["cy","r","fill"],I=["cx","r","fill"],T=["cx","r","fill"],D={key:5,class:"coordinates"},$=["x","y","font-size","fill"],W=["transform"],G=["font-size","fill"],P={__name:"vue-ui-cursor",props:{config:{type:Object,default:{}}},setup(h){const{vue_ui_cursor:k}=c.useConfig(),y=h,l=e.ref(c.createUid()),r=e.computed(()=>v.useNestedProp({userConfig:y.config,defaultConfig:k})),n=e.ref({x:-100,y:-100});function u({clientX:t,clientY:o,...A}){n.value.x=t-r.value.centerCircleRadius,n.value.y=o-r.value.centerCircleRadius}function d(t){n.value.x=t.targetTouches[0].clientX-r.value.centerCircleRadius,n.value.y=t.targetTouches[0].clientY-r.value.centerCircleRadius}const f=e.ref(!0);function i(t){f.value=t}const s=e.ref(!1),a=e.ref(null);function m(){s.value=!1,a.value&&clearTimeout(a.value),e.nextTick(()=>{s.value=!0,a.value=setTimeout(()=>{s.value=!1},1e3)})}return e.onMounted(()=>{const t=r.value.parentId?document.getElementById(r.value.parentId):document.getElementsByTagName("div")[0];t.addEventListener("mousemove",u),t.addEventListener("touchmove",d),t.addEventListener("mouseleave",()=>i(!1)),t.addEventListener("mouseenter",()=>i(!0)),t.addEventListener("click",m)}),e.onBeforeUnmount(()=>{const t=r.value.parentId?document.getElementById(r.value.parentId):document.getElementsByTagName("div")[0];t.removeEventListener("mousemove",u),t.removeEventListener("touchmove",d),t.removeEventListener("mouseleave",()=>i(!1)),t.removeEventListener("mouseenter",()=>i(!0)),t.removeEventListener("click",m)}),e.computed(()=>r.value.centerCircleRadius/2.5),(t,o)=>e.unref(f)?(e.openBlock(),e.createElementBlock("svg",{key:0,"data-html2canvas-ignore":"",xmlns:e.unref(c.XMLNS),style:e.normalizeStyle(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${e.unref(n).y}px; left:${e.unref(n).x}px;`),viewBox:"0 0 100 100",height:e.unref(r).centerCircleRadius*2,width:e.unref(r).centerCircleRadius*2},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",p,[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r).bubbleEffectColor,"stop-opacity":e.unref(r).bubbleEffectOpacity},null,8,x),o[0]||(o[0]=e.createElementVNode("stop",{offset:"95%","stop-color":"transparent"},null,-1))])]),e.unref(r).showCenterCircle?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:50,cy:50,r:e.unref(r).centerCircleRadius,fill:e.unref(c.setOpacity)(e.unref(r).centerCircleColor,e.unref(r).centerCircleOpacity*100),stroke:e.unref(r).centerCircleStroke,"stroke-width":e.unref(r).centerCircleStrokeWidth,"stroke-dasharray":e.unref(r).centerCircleDasharray},null,8,E)):e.createCommentVNode("",!0),e.unref(r).bubbleEffect?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:50,cy:50,r:e.unref(r).centerCircleRadius,fill:"url(#follower)",stroke:"none"},null,8,N)):e.createCommentVNode("",!0),e.unref(r).useWaveOnClick?(e.openBlock(),e.createElementBlock("g",g,[e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${e.unref(l)}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:4,id:`blur_std_${e.unref(l)}`},null,8,w),o[1]||(o[1]=e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1))],8,V)]),e.unref(s)?(e.openBlock(),e.createElementBlock("circle",{key:0,class:e.normalizeClass({"circle-wave":e.unref(s)}),cx:50,cy:50,r:50,filter:`url(#blur_${e.unref(l)})`,stroke:e.unref(r).centerCircleStroke,fill:"none","stroke-width":"3"},null,10,S)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(r).showCrosshair?(e.openBlock(),e.createElementBlock("g",B,[e.createElementVNode("line",{x1:-e.unref(r).centerCircleRadius+50,x2:-5e3,y1:50,y2:50,stroke:e.unref(r).crosshairStroke,"stroke-width":e.unref(r).crosshairStrokeWidth,"stroke-dasharray":e.unref(r).crosshairDasharray,"stroke-linecap":"round"},null,8,R),e.createElementVNode("line",{x1:50+e.unref(r).centerCircleRadius,x2:5e3,y1:50,y2:50,stroke:e.unref(r).crosshairStroke,"stroke-width":e.unref(r).crosshairStrokeWidth,"stroke-dasharray":e.unref(r).crosshairDasharray,"stroke-linecap":"round"},null,8,b),e.createElementVNode("line",{x1:50,x2:50,y1:-e.unref(r).centerCircleRadius+50,y2:-5e3,stroke:e.unref(r).crosshairStroke,"stroke-width":e.unref(r).crosshairStrokeWidth,"stroke-dasharray":e.unref(r).crosshairDasharray,"stroke-linecap":"round"},null,8,F),e.createElementVNode("line",{x1:50,x2:50,y1:e.unref(r).centerCircleRadius+50,y2:5e3,stroke:e.unref(r).crosshairStroke,"stroke-width":e.unref(r).crosshairStrokeWidth,"stroke-dasharray":e.unref(r).crosshairDasharray,"stroke-linecap":"round"},null,8,z)])):e.createCommentVNode("",!0),e.unref(r).showIntersectCircles?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"rotating-circles":e.unref(r).isLoading})},[e.createElementVNode("circle",{cx:50,cy:e.unref(r).centerCircleRadius+50,r:e.unref(r).intersectCirclesRadius,fill:e.unref(r).intersectCirclesFill},null,8,L),e.createElementVNode("circle",{cx:50,cy:-e.unref(r).centerCircleRadius+50,r:e.unref(r).intersectCirclesRadius,fill:e.unref(r).intersectCirclesFill},null,8,O),e.createElementVNode("circle",{cx:-e.unref(r).centerCircleRadius+50,cy:50,r:e.unref(r).intersectCirclesRadius,fill:e.unref(r).intersectCirclesFill},null,8,I),e.createElementVNode("circle",{cx:e.unref(r).centerCircleRadius+50,cy:50,r:e.unref(r).intersectCirclesRadius,fill:e.unref(r).intersectCirclesFill},null,8,T)],2)):e.createCommentVNode("",!0),e.unref(r).showCoordinates?(e.openBlock(),e.createElementBlock("g",D,[e.createElementVNode("text",{"text-anchor":"end",x:-e.unref(r).centerCircleRadius+50-e.unref(r).coordinatesFontSize/2+e.unref(r).coordinatesOffset,y:50-e.unref(r).coordinatesFontSize/2+e.unref(r).coordinatesOffset,"font-size":e.unref(r).coordinatesFontSize,fill:e.unref(r).coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},"font-family":"Arial"},e.toDisplayString(e.unref(n).x.toFixed(0)),9,$),e.createElementVNode("g",{transform:`translate(${50-e.unref(r).coordinatesFontSize/2+e.unref(r).coordinatesOffset}, ${-e.unref(r).centerCircleRadius+50-e.unref(r).coordinatesFontSize/2+e.unref(r).coordinatesOffset})`},[e.createElementVNode("text",{"text-anchor":"start","font-size":e.unref(r).coordinatesFontSize,fill:e.unref(r).coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},transform:"rotate(-90)","font-family":"Arial"},e.toDisplayString(e.unref(n).y.toFixed(0)),9,G)],8,W)])):e.createCommentVNode("",!0)],12,_)):e.createCommentVNode("",!0)}},q=C._export_sfc(P,[["__scopeId","data-v-2eca1939"]]);exports.default=q;