tessellatron
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -1,4 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class Cell { | ||
export default class Cell { | ||
constructor(id) { | ||
@@ -53,2 +51,1 @@ // each cell has a unique "ID". | ||
} | ||
exports.default = Cell; |
import { GraphType } from './types'; | ||
declare const _default: (dimensions: number[], layout?: string) => GraphType; | ||
declare const _default: (dimensions: Array<number>, layout?: string) => GraphType; | ||
export default _default; |
@@ -1,18 +0,14 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hypercube_1 = require("./graph/hypercube"); | ||
exports.default = (dimensions, layout = 'hypercube') => { | ||
import HypercubeGraph from './graph/hypercube'; | ||
export default (dimensions, layout = 'hypercube') => { | ||
// get the associated typing. | ||
if (layout === 'hypercube') { | ||
return new hypercube_1.default(dimensions); | ||
return new HypercubeGraph(dimensions); | ||
// } else if (layout === 'trigon') { | ||
// return new TrigonGraph(dimensions) | ||
// } else if (layout === 'hexagon') { | ||
// return new HexagonGraph(dimensions) | ||
} | ||
else if (layout === 'trigon') { | ||
return new hypercube_1.default(dimensions); | ||
} | ||
else if (layout === 'hexagon') { | ||
return new hypercube_1.default(dimensions); | ||
} | ||
else { | ||
return new hypercube_1.default(dimensions); | ||
return new HypercubeGraph(dimensions); | ||
} | ||
}; |
@@ -1,4 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const cell_1 = require("../cell"); | ||
import Cell from '../cell'; | ||
// multiply is a reducer function. | ||
@@ -30,3 +28,3 @@ const multiply = (a, b) => a * b; | ||
***********************************************************/ | ||
class HypercubeGraph { | ||
export default class HypercubeGraph { | ||
constructor(dimensions) { | ||
@@ -109,3 +107,3 @@ /* CALCULATE MAP INFORMATION */ | ||
// create a new cell using the id from size. | ||
this.data[id] = new cell_1.default(id); | ||
this.data[id] = new Cell(id); | ||
// populate neighbors of this cell. | ||
@@ -347,2 +345,1 @@ this.data[id].neighbors = this.findNeighborsOf(id); | ||
} | ||
exports.default = HypercubeGraph; |
@@ -1,10 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const graph_1 = require("./graph"); | ||
const hypercube_1 = require("./graph/hypercube"); | ||
exports.HypercubeGraph = hypercube_1.default; | ||
const cell_1 = require("./cell"); | ||
exports.Cell = cell_1.default; | ||
import Graph from './graph'; | ||
import HypercubeGraph from './graph/hypercube'; | ||
import Cell from './cell'; | ||
// export those who will never have breaking changes. | ||
export { HypercubeGraph, Cell, }; | ||
// export a omnipotent class-generator class. | ||
// this is expiremental, so be on your guard. | ||
exports.default = graph_1.default; | ||
export default Graph; |
@@ -1,2 +0,39 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* | ||
export type shape = ( | ||
// three-sided shapes | ||
// |'trigon' | ||
// |'trilateral' | ||
|'triangle' | ||
// four-sided shapes | ||
// |'tetragon' | ||
// |'quadrilateral' | ||
// |'quadrangle' | ||
|'square' | ||
// |'rectangle' | ||
// |'rhombus' | ||
// six-sided shapes | ||
|'hexagon' | ||
// six-sided bodies | ||
// |'hexahedron' | ||
|'cube' | ||
// twelve-sided bodies | ||
|'rhombic dodecahedron' | ||
// eight-sided entity | ||
|'tesseract' | ||
) | ||
export type algorithm = ( | ||
// breadth-first | ||
|'recursive breadth-first traversal' | ||
|'iterative breadth-first traversal' | ||
// depth-first | ||
|'recursive depth-first traversal' | ||
|'iterative depth-first traversal' | ||
) | ||
*/ |
{ | ||
"name": "tessellatron", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Tessellatron creates graphs (represented by json structures) with tesselating spacial patterns.", | ||
@@ -20,2 +20,3 @@ "keywords": [ | ||
}, | ||
"type": "module", | ||
"main": "lib/index.js", | ||
@@ -27,4 +28,4 @@ "files": [ | ||
"devDependencies": { | ||
"ts-node": "^8.9.1", | ||
"typescript": "^3.8.3" | ||
"ts-node": "^8.10.1", | ||
"typescript": "^3.9.2" | ||
}, | ||
@@ -31,0 +32,0 @@ "scripts": { |
27574
520
Yes