Skip to content

Instantly share code, notes, and snippets.

@SJXdct
SJXdct / biPartite.js
Last active October 26, 2017 09:14
Bipartite graph of tracking traffic between 28 sites and 26 trackers
!function(){
var bP={};
var b=30, bb=200, height=600, buffMargin=1, minHeight=14;
//var c1=[-180, 40], c2=[-50, 160], c3=[0, 210]; //Column positions of labels.
var c1=[-150, 40], c2=[-7, 230], c3=[-10, 230];
// c1 : 1. distance between sites and traffic
//2. distance between bars and trackers
//c2: 1. position of header(left raffic)
//2. position of header(right traffic)
//c3: 1. distance between bars and traffic(sites)
@SJXdct
SJXdct / flare-top28.json
Last active October 22, 2017 02:53
Bilevel graph of 28 sites and their trackers
{
"name": "flare",
"children": [
{"name":"apple.com","size":273686,
"children": [
{"name":"RU","size":2},
{"name":"Others","size":4},
{"name":"CN","size":70},
@SJXdct
SJXdct / biPartite.js
Last active September 4, 2017 14:16
Bipartite of Traffic transition on sites and trackers
!function(){
var bP={};
var b=30, bb=200, height=600, buffMargin=1, minHeight=14;
//var c1=[-180, 40], c2=[-50, 160], c3=[0, 210]; //Column positions of labels.
var c1=[-200, 40], c2=[-53, 250], c3=[-2, 300];
//var colors =["#FF99CC", "#66CCCC", "#FFCC33", "#6666CC", "#99CC33", "#99CCFF", "#999999", "#CC6699", "#0099CC", "#FF9900"];
var colors = ["#000000"]
bP.partData = function(data,p){
var sData={};
@SJXdct
SJXdct / index.html
Last active September 4, 2017 09:41
Domains-trackers graph
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.links line {
stroke: #999;
stroke-opacity: 0.6;
}
.nodes circle {
@SJXdct
SJXdct / .block
Last active February 28, 2017 08:15
bilevel chart for adverser traffic share
license: mit