Skip to content

Commit

Permalink
Keep original size scale in a primary layer
Browse files Browse the repository at this point in the history
  • Loading branch information
vladminsky committed Nov 11, 2016
1 parent ef0d7c9 commit 8565b2c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions plugins/layers.js
Expand Up @@ -378,12 +378,17 @@
unit.type = xLayer.type ? ELEMENT_TYPE[xLayer.type] : unit.type;
unit.y = layerScaleName;

var sizeScaleName = ('size_null' + layerNum);
fullSpec.addScale(sizeScaleName, {type: 'size', source: '?', mid:1});
unit.size = sizeScaleName;
var isNotEmptySizeScale = (fullSpec.getScale(unit.size).dim);
if (isPrimaryLayer && isNotEmptySizeScale) {
// leave original size scale
} else {
var sizeScaleName = ('size_null' + layerNum);
fullSpec.addScale(sizeScaleName, {type: 'size', source: '?', mid:1});
unit.size = sizeScaleName;
}

var isFullScale = (fullSpec.getScale(unit.color).dim);
if (isPrimaryLayer && isFullScale) {
var isNotEmptyColorScale = (fullSpec.getScale(unit.color).dim);
if (isPrimaryLayer && isNotEmptyColorScale) {
// leave original color scale
} else {
unit.color = self.fieldColorScale;
Expand Down

0 comments on commit 8565b2c

Please sign in to comment.