Skip to content

Commit

Permalink
<refactor>
Browse files Browse the repository at this point in the history
  • Loading branch information
kanitw committed Dec 3, 2014
1 parent 2656f3e commit 1b542f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/vegalite.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,23 +540,24 @@ vl.axis.defs = function(names, enc) {

function axis_def(name, enc){
var type = name, axis;
if(name==COL) type = "x";
if(name==ROW) type = "y";
var isCol = name==COL, isRow = name==ROW;
if(isCol) type = "x";
if(isRow) type = "y";

var axis = {
type: type,
scale: name,
ticks: 3 //TODO(kanitw): better determine # of ticks
};

if(name==COL || name ==ROW){
if(isRow || isCol){
axis.properties = {
ticks: { opacity: {"value": 0} },
majorTicks: { opacity: {"value": 0} },
axis: { opacity: {"value": 0} }
};
}
if(name==COL){
if(isCol){
axis.offset = enc.config("yAxisMargin");
}

Expand Down
2 changes: 1 addition & 1 deletion test-output.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Vegalite UI</title>
<title>Vegalite Test Output</title>
<script src="lib/d3.v3.min.js"></script>
<script src="lib/vega.js"></script>
<script src="lib/json3-compactstringify.js"></script>
Expand Down

0 comments on commit 1b542f1

Please sign in to comment.