vega-scale
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -319,7 +319,17 @@ (function (global, factory) { | ||
scale.domain = function(_$$1) { | ||
return arguments.length ? (domain = numbers(_$$1), scale) : domain.slice(); | ||
if (arguments.length) { | ||
domain = numbers(_$$1); | ||
return scale; | ||
} else { | ||
return domain.slice(); | ||
} | ||
}; | ||
scale.range = function(_$$1) { | ||
return arguments.length ? (range$$1 = slice.call(_$$1), scale) : range$$1.slice(); | ||
if (arguments.length) { | ||
range$$1 = slice.call(_$$1); | ||
return scale; | ||
} else { | ||
return range$$1.slice(); | ||
} | ||
}; | ||
@@ -352,3 +362,8 @@ | ||
scale.clamp = function(_$$1) { | ||
return arguments.length ? (clamp = !!_$$1, scale) : clamp; | ||
if (arguments.length) { | ||
clamp = !!_$$1; | ||
return scale; | ||
} else { | ||
return clamp; | ||
} | ||
}; | ||
@@ -361,3 +376,8 @@ | ||
scale.interpolator = function(_$$1) { | ||
return arguments.length ? (interpolator = _$$1, scale) : interpolator; | ||
if (arguments.length) { | ||
interpolator = _$$1; | ||
return scale; | ||
} else { | ||
return interpolator; | ||
} | ||
}; | ||
@@ -403,4 +423,8 @@ | ||
function scale(type, scale) { | ||
return arguments.length > 1 ? (scales[type] = create(type, scale), this) | ||
: scales.hasOwnProperty(type) ? scales[type] : undefined; | ||
if (arguments.length > 1) { | ||
scales[type] = create(type, scale); | ||
return this; | ||
} else { | ||
return scales.hasOwnProperty(type) ? scales[type] : undefined; | ||
} | ||
} | ||
@@ -532,3 +556,6 @@ | ||
var schemes$1 = function(name, scheme) { | ||
if (arguments.length > 1) return (schemes[name] = scheme, this); | ||
if (arguments.length > 1) { | ||
schemes[name] = scheme; | ||
return this; | ||
} | ||
@@ -535,0 +562,0 @@ var part = name.split('-'); |
{ | ||
"name": "vega-scale", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Scales and color schemes for visual encoding.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -76,7 +76,17 @@ import {bisect} from 'd3-array'; | ||
scale.domain = function(_) { | ||
return arguments.length ? (domain = numbers(_), scale) : domain.slice(); | ||
if (arguments.length) { | ||
domain = numbers(_); | ||
return scale; | ||
} else { | ||
return domain.slice(); | ||
} | ||
}; | ||
scale.range = function(_) { | ||
return arguments.length ? (range = slice.call(_), scale) : range.slice(); | ||
if (arguments.length) { | ||
range = slice.call(_); | ||
return scale; | ||
} else { | ||
return range.slice(); | ||
} | ||
}; | ||
@@ -83,0 +93,0 @@ |
@@ -34,4 +34,8 @@ import invertRange from './invertRange'; | ||
export default function scale(type, scale) { | ||
return arguments.length > 1 ? (scales[type] = create(type, scale), this) | ||
: scales.hasOwnProperty(type) ? scales[type] : undefined; | ||
if (arguments.length > 1) { | ||
scales[type] = create(type, scale); | ||
return this; | ||
} else { | ||
return scales.hasOwnProperty(type) ? scales[type] : undefined; | ||
} | ||
} | ||
@@ -38,0 +42,0 @@ |
@@ -22,3 +22,8 @@ import {peek} from 'vega-util'; | ||
scale.clamp = function(_) { | ||
return arguments.length ? (clamp = !!_, scale) : clamp; | ||
if (arguments.length) { | ||
clamp = !!_; | ||
return scale; | ||
} else { | ||
return clamp; | ||
} | ||
}; | ||
@@ -31,3 +36,8 @@ | ||
scale.interpolator = function(_) { | ||
return arguments.length ? (interpolator = _, scale) : interpolator; | ||
if (arguments.length) { | ||
interpolator = _; | ||
return scale; | ||
} else { | ||
return interpolator; | ||
} | ||
}; | ||
@@ -34,0 +44,0 @@ |
@@ -79,3 +79,6 @@ import {tableau10, tableau20, blueOrange} from './palettes'; | ||
export default function(name, scheme) { | ||
if (arguments.length > 1) return (schemes[name] = scheme, this); | ||
if (arguments.length > 1) { | ||
schemes[name] = scheme; | ||
return this; | ||
} | ||
@@ -82,0 +85,0 @@ var part = name.split('-'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44434
1030