Skip to content

Commit

Permalink
Merge branch 'release/v2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
BigFatDog committed Mar 27, 2018
2 parents 3d3135f + e5af630 commit b79350c
Show file tree
Hide file tree
Showing 169 changed files with 3,375 additions and 3,178 deletions.
18 changes: 13 additions & 5 deletions demo/area-stacked.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
};

var chart = new VizArtBasic.StackedArea('#chart', options);
var chart = VizArtBasic.stackedArea('#chart', options);
d3.csv('assets/profit.csv', function(err, res){
chart.render(res);

Expand All @@ -68,20 +68,28 @@
// chart.revealVoronoi();
// chart.revealQuadtree();
// })
var options2 = chart.options();
var opt = chart.options();

// change color
$('#group').click(function(){
chart.groupedLayout();
// opt.plots.stackLayout = false;
// chart.options(opt);
chart.group();
});

$('#zero').click(function(){
chart.stackLayout();
// opt.plots.stackLayout = true;
// opt.plots.stackMethod = 'zero';
// chart.options(opt);
chart.stack();

});

$('#expand').click(function(){
chart.expandLayout();
// opt.plots.stackLayout = true;
// opt.plots.stackMethod = 'expand';
// chart.options(opt);
chart.expand();
});

});
Expand Down
42 changes: 32 additions & 10 deletions demo/area.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link href="./lib/bootstrap-3.3.7/css/bootstrap.css" rel="stylesheet" type="text/css">
<script src="./lib/stats.js"></script>
<script src="./lib/chance.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.js"></script>
<script src="./lib/d3.js"></script>
<script src="./lib/jquery-1.12.4.min.js"></script>
<script src="./lib/bootstrap-3.3.7/js/bootstrap.js"></script>
Expand Down Expand Up @@ -64,7 +65,7 @@
},
},
animation: {
enabled: false
enabled: true
},
ordering: {
accessor: 'date',
Expand All @@ -80,7 +81,7 @@
}
};

var area = new VizArtBasic.Area('#bar', options);
var area = VizArtBasic.area('#bar', options);
// area.on('rendered', function(){
// area.revealVoronoi();
// area.revealQuadtree();
Expand Down Expand Up @@ -108,35 +109,56 @@
// change color
$('#color1').click(function(){
options2.color.scheme = "BuGn";
area.transitionColor(options2.color);
area.color(options2.color);
});

$('#color2').click(function(){
options2.color.scheme = "Blues";
area.transitionColor(options2.color)
area.color(options2.color)
});

$('#color3').click(function(){
options2.color.scheme = "Warm";
area.transitionColor(options2.color)
area.color(options2.color)
});

$('#color4').click(function(){
options2.color.scheme = "Cubehelix";
area.transitionColor(options2.color);
area.color(options2.color);
console.log(area);
});

$('#a1').click(function(){
area.sort('date', 'asc');
options2.ordering = {
accessor: 'date',
direction: 'asc'
}
area.options(options2);
area.update();
})
$('#a2').click(function(){
area.sort('date', 'desc');
options2.ordering = {
accessor: 'date',
direction: 'desc'
}
area.options(options2);
area.update();
});
$('#a3').click(function(){
area.sort(metricAccessor, 'asc');
options2.ordering = {
accessor: metricAccessor,
direction: 'asc'
}
area.options(options2);
area.update();
});
$('#a4').click(function(){
area.sort(metricAccessor, 'desc');
options2.ordering = {
accessor: metricAccessor,
direction: 'desc'
}
area.options(options2);
area.update();
});

});
Expand Down
10 changes: 6 additions & 4 deletions demo/bar-grouped.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
};


var chart = new VizArtBasic.StackedBar('#chart', options);
var chart = VizArtBasic.stackedBar('#chart', options);

d3.csv('assets/movies.csv', function(err, res){
var data = _.uniqWith(res, function(a, b) {
Expand All @@ -81,19 +81,21 @@

});

var opt = chart.options();


// change color
$('#group').click(function(){
chart.groupedLayout();
chart.group();
});

$('#zero').click(function(){
chart.stackLayout();
chart.stack();

});

$('#expand').click(function(){
chart.expandLayout();
chart.expand();
});

$('#x-asc').click(function () {
Expand Down
18 changes: 9 additions & 9 deletions demo/bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@



var barChart = new VizArtBasic.Bar('#bar', options);
var barChart = VizArtBasic.bar('#bar', options);

d3.csv('assets/movies.csv', function(err, res){
var data = _.uniqWith(res, function(a, b) {
Expand Down Expand Up @@ -124,30 +124,30 @@
'#eb3ba6'
];

barChart.transitionColor(options2.color);
barChart.color(options2.color);
});

$('#color2').click(function(){
options2.color.scheme = "Cold";
barChart.transitionColor(options2.color)
barChart.color(options2.color)
});

$('#color3').click(function(){
options2.color.scheme = "Warm";
barChart.transitionColor(options2.color)
barChart.color(options2.color)
});

$('#color4').click(function(){
options2.color.scheme = d3.interpolateCubehelixDefault;
barChart.transitionColor(options2.color);
barChart.color(options2.color);
});

$('#set1').click(function(){
options2.color.scheme = [
'#deebf7',
'#3182bd'
];
barChart.transitionColor(options2.color);
barChart.color(options2.color);
});


Expand All @@ -157,7 +157,7 @@
'#9ecae1',
'#3182bd'
];
barChart.transitionColor(options2.color);
barChart.color(options2.color);
});


Expand All @@ -169,7 +169,7 @@
'#3182bd',
'#08519c',
];
barChart.transitionColor(options2.color);
barChart.color(options2.color);
});


Expand All @@ -187,7 +187,7 @@
'#08519c',
'#08306b'
];
barChart.transitionColor(options2.color);
barChart.color(options2.color);
});

$('#a1').click(function(){
Expand Down
16 changes: 4 additions & 12 deletions demo/corona.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
}
};

var chart = new VizArtBasic.Corona('#chart', options);
var chart = VizArtBasic.corona('#chart', options);

d3.csv('assets/app-downloads.csv', function(err, res){
chart.render(res);
Expand All @@ -150,24 +150,16 @@

// change color
$('#group').click(function(){
opt.plots.stackLayout = false;
chart.options(opt);
chart.update();
chart.group();
});

$('#zero').click(function(){
opt.plots.stackLayout = true;
opt.plots.stackMethod = 'zero';
chart.options(opt);
chart.update();
chart.stack();

});

$('#expand').click(function(){
opt.plots.stackLayout = true;
opt.plots.stackMethod = 'expand';
chart.options(opt);
chart.update();
chart.expand();
});

$('#dark').click(function(){
Expand Down
2 changes: 1 addition & 1 deletion demo/line-multi.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
};

var chart = new VizArtBasic.MultiLine('#chart', options);
var chart = VizArtBasic.multiLine('#chart', options);

d3.csv('assets/profit.csv', function(err, res){
chart.render(res);
Expand Down
38 changes: 29 additions & 9 deletions demo/line.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
};

var line = new VizArtBasic.Line('#bar', options);
var line = VizArtBasic.line('#bar', options);
line.on('rendered', function(){
// line._revealVoronoi();
// line._revealQuadtree();
Expand Down Expand Up @@ -103,35 +103,55 @@
// change color
$('#color1').click(function(){
options2.color.scheme = "BuGn";
line.transitionColor(options2.color);
line.color(options2.color);
});

$('#color2').click(function(){
options2.color.scheme = "Blues";
line.transitionColor(options2.color)
line.color(options2.color)
});

$('#color3').click(function(){
options2.color.scheme = "Warm";
line.transitionColor(options2.color)
line.color(options2.color)
});

$('#color4').click(function(){
options2.color.scheme = "Cubehelix";
line.transitionColor(options2.color);
line.color(options2.color);
});

$('#a1').click(function(){
line.sort('date', 'asc');
options2.ordering = {
accessor: 'date',
direction: 'asc'
}
line.options(options2);
line.update();
})
$('#a2').click(function(){
line.sort('date', 'desc');
options2.ordering = {
accessor: 'date',
direction: 'desc'
}
line.options(options2);
line.update();
});
$('#a3').click(function(){
line.sort(metricAccessor, 'asc');
options2.ordering = {
accessor: metricAccessor,
direction: 'asc'
}
line.options(options2);
line.update();
});
$('#a4').click(function(){
line.sort(metricAccessor, 'desc');
options2.ordering = {
accessor: metricAccessor,
direction: 'desc'
}
line.options(options2);
line.update();
});

});
Expand Down
Loading

0 comments on commit b79350c

Please sign in to comment.