Skip to content

Commit 1893f9a

Browse files
committed
0.15.13
1 parent ae19fad commit 1893f9a

12 files changed

+79
-25
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "d3.compose",
33
"homepage": "https://github.com/CSNW/d3.compose",
4-
"version": "0.15.12",
4+
"version": "0.15.13",
55
"main": [
66
"./dist/d3.compose-all.js",
77
"./dist/d3.compose.css"

dist/d3.compose-all.js

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* d3.compose - Compose complex, data-driven visualizations from reusable charts and components with d3
3-
* v0.15.12 - https://github.com/CSNW/d3.compose - license: MIT
3+
* v0.15.13 - https://github.com/CSNW/d3.compose - license: MIT
44
*/
55
(function (global, factory) {
66
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('d3'), require('d3.chart')) :
@@ -361,6 +361,11 @@
361361
return !isUndefined(value) ? value : default_value;
362362
}
363363

364+
function deprecate(message, version) {
365+
if (typeof console != 'undefined' && console.warn)
366+
console.warn('DEPRECATED (will be removed in ' + version + ') - ' + message);
367+
}
368+
364369
var utils = {
365370
slice: slice,
366371
toString: toString,
@@ -481,8 +486,7 @@
481486
function property(options) {
482487
// DEPRECATED: name as first argument
483488
if (arguments.length == 2) {
484-
if (typeof console != 'undefined' && console.warn)
485-
console.warn('DEPRECATED - name argument for property is no longer supported will be removed in the next version of d3.compose');
489+
deprecate('"name" as the first argument for property is no longer required/supported and will be removed in the next version of d3.compose.', 'v0.17.0');
486490
options = arguments[1];
487491
}
488492

@@ -1426,6 +1430,26 @@
14261430
}
14271431
};
14281432

1433+
function createProperties(Item, keys) {
1434+
keys = keys || Object.keys(Item.properties);
1435+
1436+
keys.forEach(function(key) {
1437+
if (Item.prototype[key])
1438+
return;
1439+
1440+
Item.prototype[key] = property({
1441+
get: function() {
1442+
deprecate('The ' + key + ' property will be removed and replaced by "this.props.' + key + '"');
1443+
return this.options()[key];
1444+
},
1445+
set: function(value) {
1446+
// Deliberately mutate underlying options to avoid firing options setter
1447+
this.options()[key] = value;
1448+
}
1449+
});
1450+
});
1451+
}
1452+
14291453
var helpers = {
14301454
property: property,
14311455
dimensions: dimensions,
@@ -3436,6 +3460,9 @@
34363460
}
34373461
});
34383462

3463+
// DEPRECATED Backwards compatibility for properties
3464+
createProperties(Legend);
3465+
34393466
function prepareMargins$2(selection, props) {
34403467
return extend({}, props, {
34413468
margins: getMargins(props.margins, default_legend_margins)
@@ -3646,6 +3673,9 @@
36463673
layer_type: 'chart'
36473674
});
36483675

3676+
// DEPRECATED Backwards compatibility for properties
3677+
createProperties(InsetLegend);
3678+
36493679
function getTransform(layer, props) {
36503680
var value = props.translation;
36513681
var x = value.x || 0;
@@ -3816,6 +3846,9 @@
38163846
z_index: 70
38173847
});
38183848

3849+
// DEPRECATED Backwards compatibility for properties
3850+
createProperties(Text);
3851+
38193852
function prepareText(selection, props) {
38203853
// Calculate transform
38213854
var x = {
@@ -3925,6 +3958,9 @@
39253958
})
39263959
});
39273960

3961+
// DEPRECATED Backwards compatibility for properties
3962+
createProperties(Title);
3963+
39283964
function prepareMargins(selection, props) {
39293965
return extend({}, props, {
39303966
margins: getMargins(props.margins, defaultMargins(props.position))
@@ -3985,6 +4021,9 @@
39854021
})
39864022
});
39874023

4024+
// DEPRECATED Backwards compatibility for properties
4025+
createProperties(AxisTitle);
4026+
39884027
function prepareMargins$1(selection, props) {
39894028
return extend({}, props, {
39904029
margins: getMargins(props.margins, defaultMargins$1(props.position))
@@ -4149,6 +4188,10 @@
41494188
*/
41504189
scale: types.any,
41514190

4191+
xScale: types.any,
4192+
4193+
yScale: types.any,
4194+
41524195
/**
41534196
{x,y} translation of axis relative to chart
41544197
(set by default based on position)
@@ -4231,6 +4274,9 @@
42314274
z_index: 60
42324275
});
42334276

4277+
// DEPRECATED Backwards compatibility for properties
4278+
createProperties(Axis);
4279+
42344280
// TODO Move to xy.prepare
42354281
function prepareScales(selection, props) {
42364282
var xScale = props.orientation == 'horizontal' ? props.scale : props.xScale;
@@ -6695,7 +6741,7 @@
66956741
});
66966742

66976743
var d3c = d3.compose = {
6698-
VERSION: '0.15.12',
6744+
VERSION: '0.15.13',
66996745
utils: utils,
67006746
helpers: helpers,
67016747
Base: Base,

dist/d3.compose-all.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/d3.compose-all.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/d3.compose-mixins.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* d3.compose - Compose complex, data-driven visualizations from reusable charts and components with d3
3-
* v0.15.12 - https://github.com/CSNW/d3.compose - license: MIT
3+
* v0.15.13 - https://github.com/CSNW/d3.compose - license: MIT
44
*/
55
(function (global, factory) {
66
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('d3'), require('d3.chart')) :
@@ -163,6 +163,11 @@
163163
return !isUndefined(value) ? value : default_value;
164164
}
165165

166+
function deprecate(message, version) {
167+
if (typeof console != 'undefined' && console.warn)
168+
console.warn('DEPRECATED (will be removed in ' + version + ') - ' + message);
169+
}
170+
166171
var utils = {
167172
slice: slice,
168173
toString: toString,
@@ -283,8 +288,7 @@
283288
function property(options) {
284289
// DEPRECATED: name as first argument
285290
if (arguments.length == 2) {
286-
if (typeof console != 'undefined' && console.warn)
287-
console.warn('DEPRECATED - name argument for property is no longer supported will be removed in the next version of d3.compose');
291+
deprecate('"name" as the first argument for property is no longer required/supported and will be removed in the next version of d3.compose.', 'v0.17.0');
288292
options = arguments[1];
289293
}
290294

@@ -4168,7 +4172,7 @@
41684172
});
41694173

41704174
var d3c = d3.compose = {
4171-
VERSION: '0.15.12',
4175+
VERSION: '0.15.13',
41724176
utils: utils,
41734177
helpers: helpers,
41744178
Base: Base,

dist/d3.compose-mixins.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/d3.compose-mixins.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/d3.compose.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* d3.compose - Compose complex, data-driven visualizations from reusable charts and components with d3
3-
* v0.15.12 - https://github.com/CSNW/d3.compose - license: MIT
3+
* v0.15.13 - https://github.com/CSNW/d3.compose - license: MIT
44
*/
55
.chart-compose {
66
font-size: 14px;

dist/d3.compose.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* d3.compose - Compose complex, data-driven visualizations from reusable charts and components with d3
3-
* v0.15.12 - https://github.com/CSNW/d3.compose - license: MIT
3+
* v0.15.13 - https://github.com/CSNW/d3.compose - license: MIT
44
*/
55
(function (global, factory) {
66
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('d3'), require('d3.chart')) :
@@ -163,6 +163,11 @@
163163
return !isUndefined(value) ? value : default_value;
164164
}
165165

166+
function deprecate(message, version) {
167+
if (typeof console != 'undefined' && console.warn)
168+
console.warn('DEPRECATED (will be removed in ' + version + ') - ' + message);
169+
}
170+
166171
var utils = {
167172
slice: slice,
168173
toString: toString,
@@ -283,8 +288,7 @@
283288
function property(options) {
284289
// DEPRECATED: name as first argument
285290
if (arguments.length == 2) {
286-
if (typeof console != 'undefined' && console.warn)
287-
console.warn('DEPRECATED - name argument for property is no longer supported will be removed in the next version of d3.compose');
291+
deprecate('"name" as the first argument for property is no longer required/supported and will be removed in the next version of d3.compose.', 'v0.17.0');
288292
options = arguments[1];
289293
}
290294

@@ -2949,7 +2953,7 @@
29492953
});
29502954

29512955
var d3c = d3.compose = {
2952-
VERSION: '0.15.12',
2956+
VERSION: '0.15.13',
29532957
utils: utils,
29542958
helpers: helpers,
29552959
Base: Base,

dist/d3.compose.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)