vega-lite
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "vega-lite", | ||
"author": "Jeffrey Heer, Dominik Moritz, Kanit \"Ham\" Wongsuphasawat", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"collaborators": [ | ||
@@ -6,0 +6,0 @@ "Kanit Wongsuphasawat <kanitw@gmail.com> (http://kanitw.yellowpigz.com)", |
@@ -16,14 +16,6 @@ "use strict"; | ||
var orient = config.mark.orient; | ||
if (orient) { | ||
p.orient = { value: orient }; | ||
} | ||
p.orient = { value: orient }; | ||
var stack = model.stack(); | ||
var _x = x(model.encoding().x, model.scaleName(channel_1.X), orient, stack); | ||
if (_x) { | ||
p.x = _x; | ||
} | ||
var _y = y(model.encoding().y, model.scaleName(channel_1.Y), orient, stack); | ||
if (_y) { | ||
p.y = _y; | ||
} | ||
p.x = x(model.encoding().x, model.scaleName(channel_1.X), orient, stack); | ||
p.y = y(model.encoding().y, model.scaleName(channel_1.Y), orient, stack); | ||
var _x2 = x2(model.encoding().x, model.encoding().x2, model.scaleName(channel_1.X), orient, stack); | ||
@@ -81,4 +73,4 @@ if (_x2) { | ||
function x2(xFieldDef, x2FieldDef, scaleName, orient, stack) { | ||
if (stack && channel_1.X === stack.fieldChannel) { | ||
if (orient === config_1.Orient.HORIZONTAL) { | ||
if (orient === config_1.Orient.HORIZONTAL) { | ||
if (stack && channel_1.X === stack.fieldChannel) { | ||
return { | ||
@@ -89,6 +81,4 @@ scale: scaleName, | ||
} | ||
} | ||
else if (fielddef_1.isMeasure(x2FieldDef)) { | ||
if (orient === config_1.Orient.HORIZONTAL) { | ||
if (x2FieldDef && x2FieldDef.field) { | ||
else if (x2FieldDef) { | ||
if (x2FieldDef.field) { | ||
return { | ||
@@ -99,9 +89,13 @@ scale: scaleName, | ||
} | ||
else { | ||
else if (x2FieldDef.value) { | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
value: x2FieldDef.value | ||
}; | ||
} | ||
} | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
}; | ||
} | ||
@@ -147,4 +141,4 @@ return undefined; | ||
function y2(yFieldDef, y2FieldDef, scaleName, orient, stack) { | ||
if (stack && channel_1.Y === stack.fieldChannel) { | ||
if (orient !== config_1.Orient.HORIZONTAL) { | ||
if (orient !== config_1.Orient.HORIZONTAL) { | ||
if (stack && channel_1.Y === stack.fieldChannel) { | ||
return { | ||
@@ -155,6 +149,4 @@ scale: scaleName, | ||
} | ||
} | ||
else if (fielddef_1.isMeasure(yFieldDef)) { | ||
if (orient !== config_1.Orient.HORIZONTAL) { | ||
if (y2FieldDef && y2FieldDef.field) { | ||
else if (y2FieldDef) { | ||
if (y2FieldDef.field) { | ||
return { | ||
@@ -165,9 +157,13 @@ scale: scaleName, | ||
} | ||
else { | ||
else if (y2FieldDef.value) { | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
value: y2FieldDef.value | ||
}; | ||
} | ||
} | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
}; | ||
} | ||
@@ -174,0 +170,0 @@ return undefined; |
@@ -21,18 +21,12 @@ import {VgValueRef} from '../../vega.schema'; | ||
// We should always have orient as we augment it in config.ts | ||
const orient = config.mark.orient; | ||
if (orient) { | ||
p.orient = { value: orient} ; | ||
} | ||
p.orient = { value: orient} ; | ||
const stack = model.stack(); | ||
const _x = x(model.encoding().x, model.scaleName(X), orient, stack); | ||
if (_x) { | ||
p.x = _x; | ||
} | ||
const _y = y(model.encoding().y, model.scaleName(Y), orient, stack); | ||
if (_y) { | ||
p.y = _y; | ||
} | ||
p.x = x(model.encoding().x, model.scaleName(X), orient, stack); | ||
p.y = y(model.encoding().y, model.scaleName(Y), orient, stack); | ||
// Have only x2 or y2 | ||
const _x2 = x2(model.encoding().x, model.encoding().x2, model.scaleName(X), orient, stack); | ||
@@ -90,4 +84,4 @@ if (_x2) { | ||
// x | ||
if (stack && X === stack.fieldChannel) { // Stacked Measure | ||
if (orient === Orient.HORIZONTAL) { | ||
if (orient === Orient.HORIZONTAL) { | ||
if (stack && X === stack.fieldChannel) { // Stacked Measure | ||
return { | ||
@@ -97,6 +91,4 @@ scale: scaleName, | ||
}; | ||
} | ||
} else if (isMeasure(x2FieldDef)) { // Measure | ||
if (orient === Orient.HORIZONTAL) { | ||
if (x2FieldDef && x2FieldDef.field) { | ||
} else if (x2FieldDef) { | ||
if (x2FieldDef.field) { | ||
return { | ||
@@ -106,9 +98,16 @@ scale: scaleName, | ||
}; | ||
} else { | ||
} else if (x2FieldDef.value) { | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
value: x2FieldDef.value | ||
}; | ||
} | ||
} | ||
// TODO: make this work for log scale | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
}; | ||
} | ||
@@ -151,4 +150,4 @@ return undefined; | ||
export function y2(yFieldDef: FieldDef, y2FieldDef: FieldDef, scaleName: string, orient: Orient, stack: StackProperties): VgValueRef { | ||
if (stack && Y === stack.fieldChannel) { // Stacked Measure | ||
if (orient !== Orient.HORIZONTAL) { | ||
if (orient !== Orient.HORIZONTAL) { | ||
if (stack && Y === stack.fieldChannel) { // Stacked Measure | ||
return { | ||
@@ -158,7 +157,5 @@ scale: scaleName, | ||
}; | ||
} | ||
} else if (isMeasure(yFieldDef)) { | ||
if (orient !== Orient.HORIZONTAL) { | ||
} else if (y2FieldDef) { | ||
// y2 | ||
if (y2FieldDef && y2FieldDef.field) { | ||
if (y2FieldDef.field) { | ||
return { | ||
@@ -168,9 +165,16 @@ scale: scaleName, | ||
}; | ||
} else { | ||
} else if (y2FieldDef.value) { | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
value: y2FieldDef.value | ||
}; | ||
} | ||
} | ||
// TODO: make this work for log scale | ||
return { | ||
scale: scaleName, | ||
value: 0 | ||
}; | ||
} | ||
@@ -177,0 +181,0 @@ return undefined; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
2454589
33667