"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),r=require("lodash"),b=require("../../core/useChart.js"),m=require("../../utils/parseOtherData.js"),v={class:"zerov-widget"},f=["id"],O=t.defineComponent({name:"zv-chart-other-graph-basic2"}),_=t.defineComponent({...O,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(i,{expose:u,emit:l}){const e=i,d=l,{id:h,setOption:a,chart:p,renderChart:o,renderData:n}=b.useChart({basicOption:r.cloneDeep(e.basicOption),useEvents:r.cloneDeep(e.useEvents),customRenderData:s=>{s=r.cloneDeep(s),window.SHJDatasourceV2({tId:e.uuid,sources:e.sources,callback:({data:c})=>{try{window.SHJParseEvent(e.useEvents,"dataListener",c),a(m.parseOtherData(r.cloneDeep(c),e.basicOption))}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),a(s)}}})},emit:d});return t.watch(()=>e.sources,()=>{e.sources&&e.sources.length>0&&n(e.basicOption)},{deep:!0}),t.watch(()=>r.cloneDeep(e.basicOption),(s,c)=>{r.isEqual(s,c)||o(s)},{deep:!0}),u({getEchartsInstance:()=>p.value,refresh:()=>{e.sources&&e.sources.length>0&&o(e.basicOption),n(e.basicOption)},refreshView:()=>{e.sources&&e.sources.length>0&&o(e.basicOption)},refreshData:()=>{n(e.basicOption)}}),(s,c)=>(t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{id:t.unref(h),class:"widget"},null,8,f)]))}});exports.default=_;
