grid-assign-js
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -1,2 +0,2 @@ | ||
import { point } from "../index"; | ||
import { point } from "../lap-jv/"; | ||
interface IGenerateGrid { | ||
@@ -25,2 +25,3 @@ width: number; | ||
anchorMiddleGrid?: boolean; | ||
returnPointConversion?: boolean; | ||
} | ||
@@ -27,0 +28,0 @@ export declare function autoGridAssignment({ points, screenWidth, screenHeight, screenX, screenY, numColumns, numRows, anchorMiddleGrid, }: IGridAssignment): { |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.autoGridAssignment = exports.generateGrid = void 0; | ||
const index_1 = require("../index"); | ||
const lap_jv_1 = __importDefault(require("../lap-jv/")); | ||
function generateGrid({ width, height, numRows, numColumns, centerPoint = false, translate = [0, 0], }) { | ||
@@ -59,3 +62,3 @@ const gridHeight = height / numRows; | ||
// apply linear assignment to get optimal assignments | ||
const assignments = (0, index_1.assign)({ points, assignTo: gridsInPointSpace }); | ||
const assignments = (0, lap_jv_1.default)({ points, assignTo: gridsInPointSpace }); | ||
// convert back to the screen space grids and give assignments | ||
@@ -62,0 +65,0 @@ const screenSpaceAssignments = assignments.map((a, i) => { |
import assign from "./lap-jv"; | ||
import * as grid from "./grid"; | ||
export declare type point = number[]; | ||
export declare type metricFunc = (p1: point, p2: point) => number; | ||
export declare type costMatrix = number[][]; | ||
export { assign, grid }; |
@@ -1,2 +0,4 @@ | ||
import { metricFunc, point } from "../index"; | ||
export declare type point = number[]; | ||
export declare type metricFunc = (p1: point, p2: point) => number; | ||
export declare type costMatrix = number[][]; | ||
declare const assignToGrids: ({ assignTo, points, distanceMetric, }: { | ||
@@ -3,0 +5,0 @@ assignTo: point[]; |
{ | ||
"name": "grid-assign-js", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"main": "dist", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40177
568