Update c3.js and c3.min.js

parent 8f937523
......@@ -3454,25 +3454,57 @@
}
function buildPath(points){
var path = '';
var path = create('path');
var d = '';
for(var i = 0; i<points.length; i++){
path += (points[i].action || 'L') + pt(points[i]);
d += (points[i].action || 'L') + pt(points[i]);
}
path.attr('d', d);
return path;
}
var serifThickness = 3;
return {
asterisk: function(size, color){
size /= 2;
return buildPath([
{ action: 'M', x: size, y: size },
{ action: 'L', x: -size, y: -size },
{ action: 'M', x: size, y: -size },
{ action: 'L', x: -size, y: size },
{ action: 'M', x: 0, y: -size },
{ action: 'L', x: 0, y: size }
]).style('stroke', color);
},
circle: function(size){
return create('circle').attr('r', size/2);
},
cross: function(size, color){
size /= 2;
return buildPath([
{ action: 'M', x: size, y: size },
{ action: 'L', x: -size, y: -size },
{ action: 'M', x: size, y: -size },
{ action: 'L', x: -size, y: size }
]).style('stroke', color);
},
plus: function(size, color){
size /= 2;
return buildPath([
{ action: 'M', x: 0, y: size },
{ action: 'L', x: 0, y: -size },
{ action: 'M', x: size, y: 0 },
{ action: 'L', x: -size, y: 0 }
]).style('stroke', color);
},
rhombus: function(size){
var marker = create('path');
// height/width ratio
var ratio = 1;
size /= 2;
var path = buildPath([
var marker = buildPath([
{ action: 'M', x: 0, y: size },
{ action: 'L', x: size/ratio, y: 0 },
{ action: 'L', x: 0, y: -size },
......@@ -3480,19 +3512,46 @@
{ action: 'Z' }
]);
marker.attr('d', path)
.style('stroke', 'none');
marker.style('stroke', 'none');
return marker;
},
serif: function(size){
var marker = create('rect');
marker.attr('width', size)
.attr('height', serifThickness)
.attr('x', -size/2)
.attr('y', -serifThickness/2)
.style('shape-rendering', 'crispEdges');
return marker;
},
serifRight: function(size){
var marker = create('rect');
marker.attr('width', size/2)
.attr('height', serifThickness)
.attr('x', 0)
.attr('y', -serifThickness/2)
.style('shape-rendering', 'crispEdges');
return marker;
},
square: function(size){
var marker = create('rect');
marker.attr('width', size)
.attr('height', size)
.attr('x', -size/2)
.attr('y', -size/2);
.attr('y', -size/2)
.style('shape-rendering', 'crispEdges');
return marker;
},
triangle: function(size){
size /= 2;
return buildPath([
{ action: 'M', x: 0, y: -size },
{ action: 'L', x: size, y: size },
{ action: 'L', x: -size, y: size },
{ action: 'Z' }
]).style('stroke', 'none');
}
};
})();
......@@ -3504,9 +3563,10 @@
return marker_fn.circle($$.pointR(d, i)).node();
}
return marker_fn[$$.config.marker_types[d.id]]($$.pointR(d, i), $$.color(d, i)).node();
var func = marker_fn[$$.config.marker_types[d.id]];
return func($$.pointR(d, i), $$.color(d, i)).node();
};
c3_chart_internal_fn.initBar = function () {
var $$ = this;
$$.main.select('.' + CLASS.chart).append("g")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment