datav关联关系展示

1.数据中显示担保方与被担保方之间的关系

表数据抽取

insert into t_correlation_item (Name)  
(select distinct(a.Name)  
from
 (select * from (select distinct(FULL_NAME_SECURED_PARTY) as Name 
from  major_event_external_guarantees_detail_simple) b where b.Name not in ( select Name from t_correlation_item) ) a);

delete from t_correlation_item where Name not like '%公司%' 
and  Name not like '%医院%' 
and Name not like '%厂%'
and Name not like '%集团%'
and Name not like '%银行%'
and Name not like '%局%'
and Name not like '%所%'
and Name not like '%土地%'
and Name not like '%电%'
and Name not like '%营体%'
and Name not like '%中铁%'
and Name not like '%地产%'
and Name not like '%中心%'
and Name not like '%学校%'
and Name not like '%研究%'
and Name not like '%社%'
and Name not like '%学院%'
and Name not like '%酒店%'
and Name not like '%处%'

select b.id,c.id, a.value from  (select  FULL_NAME_SECURED_PARTY as Target,FULL_NAME as Source, count(*) as value from major_event_external_guarantees_detail_simple group by  FULL_NAME_SECURED_PARTY,FULL_NAME) a join t_correlation_item b on a.Source = b.Name join t_correlation_item c on a.Target = c.Name;

insert into t_correlation_rule (select b.id as Source,c.id as Target, a.value as Value from  (select  FULL_NAME_SECURED_PARTY as Target,FULL_NAME as Source, count(*) as value from major_event_external_guarantees_detail_simple group by  FULL_NAME_SECURED_PARTY,FULL_NAME) a join t_correlation_item b on a.Source = b.Name join t_correlation_item c on a.Target = c.Name);

 select * from t_correlation_item where id in (select id from ((select Source as id from t_correlation_rule order by Value desc limit 100) union  (select Target as id from t_correlation_rule order by Value desc limit 100) )b);

2. 数据格式

Id,Name,Value
0,电脑硬件/台式整机/网络设备,32
1,笔记本电肿11,
2,MP3/MP4/iPod/录音窿25,
3,数码相机/摄像暿图形冲印,20

Source,Target,Value
0,9,14
0,29,13
1,34,11

其中第一个Value 可以控制球颜色大小,默认为1

第二个Value表示边的长度

0,9 表示第几个item而不是id,从0开始计数

3.js 代码

 


datav关联关系展示_第1张图片

你可能感兴趣的:(other)