quoslibero
Version:
FusionCharts JavaScript charting framework
1 lines • 875 B
JavaScript
import{componentFactory}from'../../../fc-core/src/lib';let removeSets=function(a,b){let c,d,e,f=a.getChildren();if(b&&b.length)for(e=b.length-1;-1<e;e--)for(c=f[b[e]],d=c&&c.length-1;-1<d;c[d].remove(),d--);};export default function(a){let b,c,d,e=a.getFromEnv('dataSource'),f=e.dataset,g=e.connectors,h=e.labels,i=a.getChildren(),j=i.canvas[0],k=b=j.getChildren('vCanvas')[0],l=[];return h&&(h=[h]),f||g||h?void(c=a.getDSGroupdef(),componentFactory(b,c,'datasetGroup_dragNode'),d=b.getChildren('datasetGroup_dragNode'),d&&(k=d[0]),f&&f.length?componentFactory(k,a.getDSdef('dragnode'),'dataset',f.length,f):l.push('dataset'),g&&g.length?componentFactory(k,a.getDSdef('connector'),'connector',g.length,g):l.push('connector'),h&&h.length?componentFactory(k,a.getDSdef('dragableLabels'),'labels',h.length,h):l.push('labels'),l.length&&removeSets(k,l)):void a.setChartMessage()}