{"size": 1028, "ext": "js", "max_stars_repo_path": "src/Phina/Util/Grid.js", "max_stars_repo_name": "hansel-no-kioku/purescript-phinajs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Phina/Util/Grid.js", "max_issues_repo_name": "hansel-no-kioku/purescript-phinajs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/Phina/Util/Grid.js", "max_forks_repo_name": "hansel-no-kioku/purescript-phinajs", "max_forks_repo_forks_event_min_datetime": "2018-12-10T03:57:52.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-10T03:57:52.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 20.9795918367, "max_line_length": 79, "alphanum_fraction": 0.6313229572}
//-----------------------------------------------------------------------------
// Phina.Util.Grid

/* global phina */

exports._setGrid = function(axis, columns, isLoop, offset, target) {
  var grid = target[axis];

  grid.columns = columns;
  grid.loop = isLoop;
  grid.offset = offset;

  return target;
};

exports._getSpan = function(axis, sp, target) {
  return target[axis].span(sp);
};

exports._getUnit = function(axis, target) {
  return target[axis].unit();
};

exports._getCenter = function(axis, target) {
  return target[axis].center();
};

exports._getGrid = function(axis, target) {
  var grid = target[axis].grid;

  return phina.util.Grid(grid.width, grid.columns, grid.loop, grid.offset);
};

exports._newGrid = function(width, columns, isLoop, offset) {
  return phina.util.Grid(width, columns, isLoop, offset);
};

exports._span = function(index, grid) {
  return grid.span(index);
};

exports._unit = function(grid) {
  return grid.unit();
};

exports._center = function(grid) {
  return grid.center();
};
