Skip to content

Commit

Permalink
remove deprecated name attribute handling and husl, husla functions, …
Browse files Browse the repository at this point in the history
…update documentation, fixes less#463
  • Loading branch information
nebulon42 committed May 25, 2017
1 parent 132aeda commit d7b7ea7
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs-generator/index._
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
2 changes: 1 addition & 1 deletion docs/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
2 changes: 1 addition & 1 deletion docs/2.0.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
2 changes: 1 addition & 1 deletion docs/2.0.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
4 changes: 2 additions & 2 deletions docs/2.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ The text's horizontal alignment from its centerpoint


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_

Define how text is justified
* * *
Expand Down Expand Up @@ -1641,7 +1641,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
4 changes: 2 additions & 2 deletions docs/2.1.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ The text's horizontal alignment from its centerpoint


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_

Define how text is justified
* * *
Expand Down Expand Up @@ -1652,7 +1652,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
4 changes: 2 additions & 2 deletions docs/2.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ The text's horizontal alignment from its centerpoint


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_

Define how text is justified
* * *
Expand Down Expand Up @@ -1853,7 +1853,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
4 changes: 2 additions & 2 deletions docs/2.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ The text's horizontal alignment from its centerpoint.


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_

Define how text is justified
* * *
Expand Down Expand Up @@ -1908,7 +1908,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
8 changes: 4 additions & 4 deletions docs/3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ The width of the stroke around the marker, in pixels. This is positioned on the


Default Value: 1
_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_
_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_

The opacity of a line.
* * *
Expand Down Expand Up @@ -2105,7 +2105,7 @@ The text's horizontal alignment from it's centerpoint. If `placement` is set to


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_

Define how text is justified.
* * *
Expand Down Expand Up @@ -2182,7 +2182,7 @@ Composite operation. This defines how this symbolizer should behave relative to


Default Value:
_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_
_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_

Comma separated list of OpenType typographic features. The syntax and semantics conforms to `font-feature-settings` from W3C CSS.
* * *
Expand Down Expand Up @@ -2317,7 +2317,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
8 changes: 4 additions & 4 deletions docs/3.0.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ The width of the stroke around the marker, in pixels. This is positioned on the


Default Value: 1
_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_
_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_

The opacity of a line.
* * *
Expand Down Expand Up @@ -2105,7 +2105,7 @@ The text's horizontal alignment from it's centerpoint. If `placement` is set to


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_

Define how text is justified.
* * *
Expand Down Expand Up @@ -2182,7 +2182,7 @@ Composite operation. This defines how this symbolizer should behave relative to


Default Value:
_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_
_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_

Comma separated list of OpenType typographic features. The syntax and semantics conforms to `font-feature-settings` from W3C CSS.
* * *
Expand Down Expand Up @@ -2317,7 +2317,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
8 changes: 4 additions & 4 deletions docs/3.0.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ The width of the stroke around the marker, in pixels. This is positioned on the


Default Value: 1
_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_
_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_

The opacity of a line.
* * *
Expand Down Expand Up @@ -2105,7 +2105,7 @@ The text's horizontal alignment from it's centerpoint. If `placement` is set to


Default Value: auto
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_
_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_

Define how text is justified.
* * *
Expand Down Expand Up @@ -2182,7 +2182,7 @@ Composite operation. This defines how this symbolizer should behave relative to


Default Value:
_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_
_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_

Comma separated list of OpenType typographic features. The syntax and semantics conforms to `font-feature-settings` from W3C CSS.
* * *
Expand Down Expand Up @@ -2317,7 +2317,7 @@ Below is a list of values and an explanation of any expression that can be appli

### Color

CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`.
CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`.

``` css
#line {
Expand Down
8 changes: 0 additions & 8 deletions lib/carto/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ tree.functions = {

return new tree.Color(hsl, a, false);
},
husl: function (h, s, l) {
console.warn('Warning: husl() is deprecated and will be removed in 1.0.0. Use hsluv() instead.');
return this.hsluv(h, s, l);
},
husla: function (h, s, l, a) {
console.warn('Warning: husla() is deprecated and will be removed in 1.0.0. Use hsluva() instead.');
return this.hsluva(h, s, l, a);
},
hsluv: function (h, s, l) {
return this.hsluva(h, s, l, 1.0);
},
Expand Down
8 changes: 2 additions & 6 deletions lib/carto/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,12 @@ carto.Renderer.prototype.render = function render(m) {
l = m.Layer[i];
styles = [];

if (_.has(l, 'name')) { // remove in 1.0.0
l.layerId = l.name;
console.warn('Warning: using the name attribute for layers (like ' + l.name + ' here) is deprecated and will be removed in 1.0.0. Use id instead.');
}
else if (_.has(l, 'id')) {
if (_.has(l, 'id')) {
l.layerId = l.id;
}
else {
l.layerId = '';
var e = new Error("Either name (deprecated) or id attributes are required for layers.\n");
var e = new Error("The id attribute is required for layers.\n");
e.stack = null; // do not show stack trace
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion test/errorhandling/issue165.result
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Either name (deprecated) or id attributes are required for layers.
The id attribute is required for layers.

0 comments on commit d7b7ea7

Please sign in to comment.