variation
parent
9c9862e564
commit
95359274af
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
Binary file not shown.
After Width: | Height: | Size: 130 KiB |
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$( function() {
|
||||
$( ".draggable" ).draggable();
|
||||
});
|
||||
|
||||
});
|
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Hello!</title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- import the webpage's stylesheet -->
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
|
||||
<!-- import the webpage's javascript file -->
|
||||
<script src="script.js" defer></script>
|
||||
<script src="https://d3js.org/d3.v5.js"></script>
|
||||
<script src="priority-queue.js"></script>
|
||||
<script src="language.js"></script>
|
||||
<script src="terrain.js"></script>
|
||||
<style>
|
||||
path, line {
|
||||
fill: none;
|
||||
stroke: black;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
.field {
|
||||
stroke: none;
|
||||
fill-opacity: 1.0;
|
||||
}
|
||||
|
||||
.slope {
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.river {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.coast {
|
||||
stroke-width: 4;
|
||||
}
|
||||
|
||||
.border {
|
||||
stroke-width: 5;
|
||||
stroke-dasharray: 4,4;
|
||||
stroke-linecap: butt;
|
||||
}
|
||||
|
||||
text {
|
||||
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||
color: black;
|
||||
stroke: white;
|
||||
stroke-width: 5;
|
||||
stroke-linejoin: round;
|
||||
paint-order: stroke;
|
||||
}
|
||||
|
||||
text.region {
|
||||
stroke-width:10;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
svg {
|
||||
float: right;
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<svg width="1000" height="1000"></svg>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,387 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PriorityQueue = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue, ArrayStrategy, BHeapStrategy, BinaryHeapStrategy, PriorityQueue,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
AbstractPriorityQueue = _dereq_('./PriorityQueue/AbstractPriorityQueue');
|
||||
|
||||
ArrayStrategy = _dereq_('./PriorityQueue/ArrayStrategy');
|
||||
|
||||
BinaryHeapStrategy = _dereq_('./PriorityQueue/BinaryHeapStrategy');
|
||||
|
||||
BHeapStrategy = _dereq_('./PriorityQueue/BHeapStrategy');
|
||||
|
||||
PriorityQueue = (function(superClass) {
|
||||
extend(PriorityQueue, superClass);
|
||||
|
||||
function PriorityQueue(options) {
|
||||
options || (options = {});
|
||||
options.strategy || (options.strategy = BinaryHeapStrategy);
|
||||
options.comparator || (options.comparator = function(a, b) {
|
||||
return (a || 0) - (b || 0);
|
||||
});
|
||||
PriorityQueue.__super__.constructor.call(this, options);
|
||||
}
|
||||
|
||||
return PriorityQueue;
|
||||
|
||||
})(AbstractPriorityQueue);
|
||||
|
||||
PriorityQueue.ArrayStrategy = ArrayStrategy;
|
||||
|
||||
PriorityQueue.BinaryHeapStrategy = BinaryHeapStrategy;
|
||||
|
||||
PriorityQueue.BHeapStrategy = BHeapStrategy;
|
||||
|
||||
module.exports = PriorityQueue;
|
||||
|
||||
|
||||
},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3,"./PriorityQueue/BHeapStrategy":4,"./PriorityQueue/BinaryHeapStrategy":5}],2:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue;
|
||||
|
||||
module.exports = AbstractPriorityQueue = (function() {
|
||||
function AbstractPriorityQueue(options) {
|
||||
var ref;
|
||||
if ((options != null ? options.strategy : void 0) == null) {
|
||||
throw 'Must pass options.strategy, a strategy';
|
||||
}
|
||||
if ((options != null ? options.comparator : void 0) == null) {
|
||||
throw 'Must pass options.comparator, a comparator';
|
||||
}
|
||||
this.priv = new options.strategy(options);
|
||||
this.length = (options != null ? (ref = options.initialValues) != null ? ref.length : void 0 : void 0) || 0;
|
||||
}
|
||||
|
||||
AbstractPriorityQueue.prototype.queue = function(value) {
|
||||
this.length++;
|
||||
this.priv.queue(value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.dequeue = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
this.length--;
|
||||
return this.priv.dequeue();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.peek = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
return this.priv.peek();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
return this.priv.clear();
|
||||
};
|
||||
|
||||
return AbstractPriorityQueue;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],3:[function(_dereq_,module,exports){
|
||||
var ArrayStrategy, binarySearchForIndexReversed;
|
||||
|
||||
binarySearchForIndexReversed = function(array, value, comparator) {
|
||||
var high, low, mid;
|
||||
low = 0;
|
||||
high = array.length;
|
||||
while (low < high) {
|
||||
mid = (low + high) >>> 1;
|
||||
if (comparator(array[mid], value) >= 0) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
high = mid;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
};
|
||||
|
||||
module.exports = ArrayStrategy = (function() {
|
||||
function ArrayStrategy(options) {
|
||||
var ref;
|
||||
this.options = options;
|
||||
this.comparator = this.options.comparator;
|
||||
this.data = ((ref = this.options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this.data.sort(this.comparator).reverse();
|
||||
}
|
||||
|
||||
ArrayStrategy.prototype.queue = function(value) {
|
||||
var pos;
|
||||
pos = binarySearchForIndexReversed(this.data, value, this.comparator);
|
||||
this.data.splice(pos, 0, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.dequeue = function() {
|
||||
return this.data.pop();
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.peek = function() {
|
||||
return this.data[this.data.length - 1];
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.clear = function() {
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return ArrayStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],4:[function(_dereq_,module,exports){
|
||||
var BHeapStrategy;
|
||||
|
||||
module.exports = BHeapStrategy = (function() {
|
||||
function BHeapStrategy(options) {
|
||||
var arr, i, j, k, len, ref, ref1, shift, value;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.pageSize = (options != null ? options.pageSize : void 0) || 512;
|
||||
this.length = 0;
|
||||
shift = 0;
|
||||
while ((1 << shift) < this.pageSize) {
|
||||
shift += 1;
|
||||
}
|
||||
if (1 << shift !== this.pageSize) {
|
||||
throw 'pageSize must be a power of two';
|
||||
}
|
||||
this._shift = shift;
|
||||
this._emptyMemoryPageTemplate = arr = [];
|
||||
for (i = j = 0, ref = this.pageSize; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
|
||||
arr.push(null);
|
||||
}
|
||||
this._memory = [];
|
||||
this._mask = this.pageSize - 1;
|
||||
if (options.initialValues) {
|
||||
ref1 = options.initialValues;
|
||||
for (k = 0, len = ref1.length; k < len; k++) {
|
||||
value = ref1[k];
|
||||
this.queue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BHeapStrategy.prototype.queue = function(value) {
|
||||
this.length += 1;
|
||||
this._write(this.length, value);
|
||||
this._bubbleUp(this.length, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.dequeue = function() {
|
||||
var ret, val;
|
||||
ret = this._read(1);
|
||||
val = this._read(this.length);
|
||||
this.length -= 1;
|
||||
if (this.length > 0) {
|
||||
this._write(1, val);
|
||||
this._bubbleDown(1, val);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.peek = function() {
|
||||
return this._read(1);
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this._memory.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._write = function(index, value) {
|
||||
var page;
|
||||
page = index >> this._shift;
|
||||
while (page >= this._memory.length) {
|
||||
this._memory.push(this._emptyMemoryPageTemplate.slice(0));
|
||||
}
|
||||
return this._memory[page][index & this._mask] = value;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._read = function(index) {
|
||||
return this._memory[index >> this._shift][index & this._mask];
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleUp = function(index, value) {
|
||||
var compare, indexInPage, parentIndex, parentValue;
|
||||
compare = this.comparator;
|
||||
while (index > 1) {
|
||||
indexInPage = index & this._mask;
|
||||
if (index < this.pageSize || indexInPage > 3) {
|
||||
parentIndex = (index & ~this._mask) | (indexInPage >> 1);
|
||||
} else if (indexInPage < 2) {
|
||||
parentIndex = (index - this.pageSize) >> this._shift;
|
||||
parentIndex += parentIndex & ~(this._mask >> 1);
|
||||
parentIndex |= this.pageSize >> 1;
|
||||
} else {
|
||||
parentIndex = index - 2;
|
||||
}
|
||||
parentValue = this._read(parentIndex);
|
||||
if (compare(parentValue, value) < 0) {
|
||||
break;
|
||||
}
|
||||
this._write(parentIndex, value);
|
||||
this._write(index, parentValue);
|
||||
index = parentIndex;
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleDown = function(index, value) {
|
||||
var childIndex1, childIndex2, childValue1, childValue2, compare;
|
||||
compare = this.comparator;
|
||||
while (index < this.length) {
|
||||
if (index > this._mask && !(index & (this._mask - 1))) {
|
||||
childIndex1 = childIndex2 = index + 2;
|
||||
} else if (index & (this.pageSize >> 1)) {
|
||||
childIndex1 = (index & ~this._mask) >> 1;
|
||||
childIndex1 |= index & (this._mask >> 1);
|
||||
childIndex1 = (childIndex1 + 1) << this._shift;
|
||||
childIndex2 = childIndex1 + 1;
|
||||
} else {
|
||||
childIndex1 = index + (index & this._mask);
|
||||
childIndex2 = childIndex1 + 1;
|
||||
}
|
||||
if (childIndex1 !== childIndex2 && childIndex2 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
childValue2 = this._read(childIndex2);
|
||||
if (compare(childValue1, value) < 0 && compare(childValue1, childValue2) <= 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else if (compare(childValue2, value) < 0) {
|
||||
this._write(childIndex2, value);
|
||||
this._write(index, childValue2);
|
||||
index = childIndex2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (childIndex1 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
if (compare(childValue1, value) < 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],5:[function(_dereq_,module,exports){
|
||||
var BinaryHeapStrategy;
|
||||
|
||||
module.exports = BinaryHeapStrategy = (function() {
|
||||
function BinaryHeapStrategy(options) {
|
||||
var ref;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.length = 0;
|
||||
this.data = ((ref = options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this._heapify();
|
||||
}
|
||||
|
||||
BinaryHeapStrategy.prototype._heapify = function() {
|
||||
var i, j, ref;
|
||||
if (this.data.length > 0) {
|
||||
for (i = j = 1, ref = this.data.length; 1 <= ref ? j < ref : j > ref; i = 1 <= ref ? ++j : --j) {
|
||||
this._bubbleUp(i);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.queue = function(value) {
|
||||
this.data.push(value);
|
||||
this._bubbleUp(this.data.length - 1);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.dequeue = function() {
|
||||
var last, ret;
|
||||
ret = this.data[0];
|
||||
last = this.data.pop();
|
||||
if (this.data.length > 0) {
|
||||
this.data[0] = last;
|
||||
this._bubbleDown(0);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.peek = function() {
|
||||
return this.data[0];
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleUp = function(pos) {
|
||||
var parent, x;
|
||||
while (pos > 0) {
|
||||
parent = (pos - 1) >>> 1;
|
||||
if (this.comparator(this.data[pos], this.data[parent]) < 0) {
|
||||
x = this.data[parent];
|
||||
this.data[parent] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = parent;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleDown = function(pos) {
|
||||
var last, left, minIndex, right, x;
|
||||
last = this.data.length - 1;
|
||||
while (true) {
|
||||
left = (pos << 1) + 1;
|
||||
right = left + 1;
|
||||
minIndex = pos;
|
||||
if (left <= last && this.comparator(this.data[left], this.data[minIndex]) < 0) {
|
||||
minIndex = left;
|
||||
}
|
||||
if (right <= last && this.comparator(this.data[right], this.data[minIndex]) < 0) {
|
||||
minIndex = right;
|
||||
}
|
||||
if (minIndex !== pos) {
|
||||
x = this.data[minIndex];
|
||||
this.data[minIndex] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = minIndex;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BinaryHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}]},{},[1])(1)
|
||||
});
|
@ -0,0 +1,21 @@
|
||||
/* If you're feeling fancy you can add interactivity
|
||||
to your site with Javascript */
|
||||
|
||||
// prints "hi" in the browser's dev tools console
|
||||
console.log("hi");
|
||||
var svg = d3.select("svg");
|
||||
|
||||
var params = {
|
||||
extent: defaultExtent,
|
||||
generator: generateCoast,
|
||||
npts: 1684,
|
||||
ncities: 15,
|
||||
nterrs: 5,
|
||||
fontsizes: {
|
||||
region: 40,
|
||||
city: 25,
|
||||
town: 20
|
||||
}
|
||||
}
|
||||
|
||||
doMap(svg, defaultParams);
|
@ -0,0 +1,11 @@
|
||||
/* CSS files add styling rules to your content */
|
||||
|
||||
body {
|
||||
font-family: helvetica, arial, sans-serif;
|
||||
margin: 2em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-style: italic;
|
||||
color: #373fff;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,70 @@
|
||||
function setupTypewriter(t) {
|
||||
var HTML = t.innerHTML;
|
||||
|
||||
t.innerHTML = "";
|
||||
|
||||
var cursorPosition = 0,
|
||||
tag = "",
|
||||
writingTag = false,
|
||||
tagOpen = false,
|
||||
typeSpeed = 100,
|
||||
tempTypeSpeed = 0;
|
||||
|
||||
var type = function() {
|
||||
|
||||
if (writingTag === true) {
|
||||
tag += HTML[cursorPosition];
|
||||
}
|
||||
|
||||
if (HTML[cursorPosition] === "<") {
|
||||
tempTypeSpeed = 0;
|
||||
if (tagOpen) {
|
||||
tagOpen = false;
|
||||
writingTag = true;
|
||||
} else {
|
||||
tag = "";
|
||||
tagOpen = true;
|
||||
writingTag = true;
|
||||
tag += HTML[cursorPosition];
|
||||
}
|
||||
}
|
||||
if (!writingTag && tagOpen) {
|
||||
tag.innerHTML += HTML[cursorPosition];
|
||||
}
|
||||
if (!writingTag && !tagOpen) {
|
||||
if (HTML[cursorPosition] === " ") {
|
||||
tempTypeSpeed = 0;
|
||||
}
|
||||
else {
|
||||
tempTypeSpeed = (Math.random() * typeSpeed) + 50;
|
||||
}
|
||||
t.innerHTML += HTML[cursorPosition];
|
||||
}
|
||||
if (writingTag === true && HTML[cursorPosition] === ">") {
|
||||
tempTypeSpeed = (Math.random() * typeSpeed) + 50;
|
||||
writingTag = false;
|
||||
if (tagOpen) {
|
||||
var newSpan = document.createElement("span");
|
||||
t.appendChild(newSpan);
|
||||
newSpan.innerHTML = tag;
|
||||
tag = newSpan.firstChild;
|
||||
}
|
||||
}
|
||||
|
||||
cursorPosition += 1;
|
||||
if (cursorPosition < HTML.length - 1) {
|
||||
setTimeout(type, tempTypeSpeed);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
type: type
|
||||
};
|
||||
}
|
||||
|
||||
var typer = document.getElementById('typewriter');
|
||||
|
||||
typewriter = setupTypewriter(typewriter);
|
||||
|
||||
typewriter.type();
|
@ -0,0 +1,226 @@
|
||||
body{ font-family: "Lucida Console", Monaco, monospace;
|
||||
overflow: hidden;}
|
||||
|
||||
p { font-size: 20px; }
|
||||
|
||||
a{ text-decoration: none; }
|
||||
|
||||
#space-time{
|
||||
z-index: 101;
|
||||
position: relative;
|
||||
width: 600px;
|
||||
height: 500px;
|
||||
top: 1158px;
|
||||
left: 853px;
|
||||
}
|
||||
|
||||
#ilinx{
|
||||
position: absolute;
|
||||
width: 106px;
|
||||
left: 250px;
|
||||
top: 420px;
|
||||
}
|
||||
|
||||
.ilinx {
|
||||
font-size: 35px;
|
||||
margin-top: -2px;
|
||||
float:left;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
#spiral {
|
||||
width: 300px;
|
||||
position: absolute;
|
||||
margin-top: -150px;
|
||||
margin-left: -150px;
|
||||
top: 250px;
|
||||
left: 300px;
|
||||
}
|
||||
|
||||
.rotating {
|
||||
-webkit-animation: rotating 3s linear infinite;
|
||||
-moz-animation: rotating 3s linear infinite;
|
||||
-ms-animation: rotating 3s linear infinite;
|
||||
-o-animation: rotating 3s linear infinite;
|
||||
animation: rotating 3s linear infinite;
|
||||
}
|
||||
|
||||
#islands{
|
||||
|
||||
}
|
||||
|
||||
a.island:link{color:blue;}
|
||||
a.island:hover{color: red;
|
||||
-webkit-animation: breathe 3s linear infinite;
|
||||
-moz-animation: breathe 3s linear infinite;
|
||||
-ms-animation: breathe 3s linear infinite;
|
||||
-o-animation: breathe 3s linear infinite;
|
||||
animation: breathe 3s linear infinite;
|
||||
}
|
||||
a.island:visited{color: black;}
|
||||
|
||||
#lemuria {
|
||||
position: absolute;
|
||||
left: 68px;
|
||||
top:269px;
|
||||
|
||||
}
|
||||
|
||||
#mu {
|
||||
position: absolute;
|
||||
left: 189px;
|
||||
top:76px;
|
||||
|
||||
}
|
||||
|
||||
#hyperborea {
|
||||
position: absolute;
|
||||
left: 444px;
|
||||
top: 151px;
|
||||
|
||||
}
|
||||
|
||||
#thule{
|
||||
position: absolute;
|
||||
left: 421px;
|
||||
top:322px;
|
||||
}
|
||||
|
||||
#sea {
|
||||
position: relative;
|
||||
width: 2500px;
|
||||
height: 2500px;
|
||||
/* border-style: dotted;
|
||||
border-width: 2px;*/
|
||||
top: -990px;
|
||||
left: -145px;
|
||||
/* background-image: url('./img/grid3.png');
|
||||
background-repeat: repeat;*/
|
||||
}
|
||||
|
||||
#iper{
|
||||
position: relative;
|
||||
left: -27px;
|
||||
top: -47px;
|
||||
}
|
||||
|
||||
#m {
|
||||
position: relative;
|
||||
left: -632px;
|
||||
top: -48px;
|
||||
}
|
||||
|
||||
#thl{
|
||||
position: relative;
|
||||
left: -30px;
|
||||
top: -38px;
|
||||
}
|
||||
|
||||
#lmr{
|
||||
position: relative;
|
||||
left: -532px;
|
||||
top: -28px;
|
||||
}
|
||||
|
||||
/* SVG */
|
||||
text {
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
color: black;
|
||||
stroke: white;
|
||||
stroke-width: 6;
|
||||
stroke-linejoin: round;
|
||||
paint-order: stroke;
|
||||
}
|
||||
|
||||
text.region {
|
||||
stroke-width:6;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
svg {
|
||||
float: right;
|
||||
}
|
||||
|
||||
path, line {
|
||||
fill: none;
|
||||
stroke: black;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
.field {
|
||||
stroke: none;
|
||||
fill-opacity: 1.0;
|
||||
}
|
||||
|
||||
.slope {
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.river {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.coast {
|
||||
stroke-width: 4;
|
||||
}
|
||||
|
||||
.border {
|
||||
stroke-width: 5;
|
||||
stroke-dasharray: 4,4;
|
||||
stroke-linecap: butt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Rotate loop */
|
||||
|
||||
@-webkit-keyframes rotating /* Safari and Chrome */ {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes rotating {
|
||||
from {
|
||||
-ms-transform: rotate(0deg);
|
||||
-moz-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-ms-transform: rotate(360deg);
|
||||
-moz-transform: rotate(360deg);
|
||||
-webkit-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Breathing text */
|
||||
|
||||
@-webkit-keyframes breathe /* Safari and Chrome */ {
|
||||
0% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
50% {font-size:21px; color: red; letter-spacing: 1px; margin-left: -6px;}
|
||||
100% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
}
|
||||
@keyframes breathe {
|
||||
0% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
50% {font-size:21px; color: red; letter-spacing: 1px; margin-left: -6px;}
|
||||
100% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,228 @@
|
||||
body{ font-family: "Lucida Console", Monaco, monospace;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;}
|
||||
|
||||
p { font-size: 20px; }
|
||||
|
||||
a{ text-decoration: none; }
|
||||
|
||||
#space-time{
|
||||
z-index: 101;
|
||||
position: relative;
|
||||
width: 600px;
|
||||
height: 500px;
|
||||
top: 1158px;
|
||||
left: 853px;
|
||||
}
|
||||
|
||||
#ilinx{
|
||||
position: absolute;
|
||||
width: 106px;
|
||||
left: 250px;
|
||||
top: 420px;
|
||||
}
|
||||
|
||||
.ilinx {
|
||||
font-size: 35px;
|
||||
margin-top: -2px;
|
||||
float:left;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
#spiral {
|
||||
width: 300px;
|
||||
position: absolute;
|
||||
margin-top: -150px;
|
||||
margin-left: -150px;
|
||||
top: 250px;
|
||||
left: 300px;
|
||||
}
|
||||
|
||||
.rotating {
|
||||
-webkit-animation: rotating 3s linear infinite;
|
||||
-moz-animation: rotating 3s linear infinite;
|
||||
-ms-animation: rotating 3s linear infinite;
|
||||
-o-animation: rotating 3s linear infinite;
|
||||
animation: rotating 3s linear infinite;
|
||||
}
|
||||
|
||||
#islands{
|
||||
|
||||
}
|
||||
|
||||
a.island:link{color:white;}
|
||||
a.island:hover{color: red;
|
||||
-webkit-animation: breathe 3s linear infinite;
|
||||
-moz-animation: breathe 3s linear infinite;
|
||||
-ms-animation: breathe 3s linear infinite;
|
||||
-o-animation: breathe 3s linear infinite;
|
||||
animation: breathe 3s linear infinite;
|
||||
}
|
||||
a.island:visited{color: white;}
|
||||
|
||||
#lemuria {
|
||||
position: absolute;
|
||||
left: 68px;
|
||||
top:269px;
|
||||
|
||||
}
|
||||
|
||||
#mu {
|
||||
position: absolute;
|
||||
left: 189px;
|
||||
top:76px;
|
||||
|
||||
}
|
||||
|
||||
#hyperborea {
|
||||
position: absolute;
|
||||
left: 444px;
|
||||
top: 151px;
|
||||
|
||||
}
|
||||
|
||||
#thule{
|
||||
position: absolute;
|
||||
left: 421px;
|
||||
top:322px;
|
||||
}
|
||||
|
||||
#sea {
|
||||
position: relative;
|
||||
width: 2500px;
|
||||
height: 2500px;
|
||||
/* border-style: dotted;
|
||||
border-width: 2px;*/
|
||||
top: -990px;
|
||||
left: -145px;
|
||||
/* background-image: url('./img/grid3.png');
|
||||
background-repeat: repeat;*/
|
||||
}
|
||||
|
||||
#iper{
|
||||
position: relative;
|
||||
left: -27px;
|
||||
top: -47px;
|
||||
}
|
||||
|
||||
#m {
|
||||
position: relative;
|
||||
left: -632px;
|
||||
top: -48px;
|
||||
}
|
||||
|
||||
#thl{
|
||||
position: relative;
|
||||
left: -30px;
|
||||
top: -38px;
|
||||
}
|
||||
|
||||
#lmr{
|
||||
position: relative;
|
||||
left: -532px;
|
||||
top: -28px;
|
||||
}
|
||||
|
||||
/* SVG */
|
||||
text {
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
color: black;
|
||||
stroke: white;
|
||||
stroke-width: 6;
|
||||
stroke-linejoin: round;
|
||||
paint-order: stroke;
|
||||
}
|
||||
|
||||
text.region {
|
||||
stroke-width:6;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
svg {
|
||||
float: right;
|
||||
}
|
||||
|
||||
path, line {
|
||||
fill: none;
|
||||
stroke: white;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
.field {
|
||||
stroke: none;
|
||||
fill-opacity: 1.0;
|
||||
}
|
||||
|
||||
.slope {
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.river {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.coast {
|
||||
stroke-width: 4;
|
||||
}
|
||||
|
||||
.border {
|
||||
stroke-width: 5;
|
||||
stroke-dasharray: 4,4;
|
||||
stroke-linecap: butt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Rotate loop */
|
||||
|
||||
@-webkit-keyframes rotating /* Safari and Chrome */ {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes rotating {
|
||||
from {
|
||||
-ms-transform: rotate(0deg);
|
||||
-moz-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-ms-transform: rotate(360deg);
|
||||
-moz-transform: rotate(360deg);
|
||||
-webkit-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Breathing text */
|
||||
|
||||
@-webkit-keyframes breathe /* Safari and Chrome */ {
|
||||
0% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
50% {font-size:21px; color: red; letter-spacing: 1px; margin-left: -6px;}
|
||||
100% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
}
|
||||
@keyframes breathe {
|
||||
0% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
50% {font-size:21px; color: red; letter-spacing: 1px; margin-left: -6px;}
|
||||
100% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,387 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PriorityQueue = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue, ArrayStrategy, BHeapStrategy, BinaryHeapStrategy, PriorityQueue,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
AbstractPriorityQueue = _dereq_('./PriorityQueue/AbstractPriorityQueue');
|
||||
|
||||
ArrayStrategy = _dereq_('./PriorityQueue/ArrayStrategy');
|
||||
|
||||
BinaryHeapStrategy = _dereq_('./PriorityQueue/BinaryHeapStrategy');
|
||||
|
||||
BHeapStrategy = _dereq_('./PriorityQueue/BHeapStrategy');
|
||||
|
||||
PriorityQueue = (function(superClass) {
|
||||
extend(PriorityQueue, superClass);
|
||||
|
||||
function PriorityQueue(options) {
|
||||
options || (options = {});
|
||||
options.strategy || (options.strategy = BinaryHeapStrategy);
|
||||
options.comparator || (options.comparator = function(a, b) {
|
||||
return (a || 0) - (b || 0);
|
||||
});
|
||||
PriorityQueue.__super__.constructor.call(this, options);
|
||||
}
|
||||
|
||||
return PriorityQueue;
|
||||
|
||||
})(AbstractPriorityQueue);
|
||||
|
||||
PriorityQueue.ArrayStrategy = ArrayStrategy;
|
||||
|
||||
PriorityQueue.BinaryHeapStrategy = BinaryHeapStrategy;
|
||||
|
||||
PriorityQueue.BHeapStrategy = BHeapStrategy;
|
||||
|
||||
module.exports = PriorityQueue;
|
||||
|
||||
|
||||
},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3,"./PriorityQueue/BHeapStrategy":4,"./PriorityQueue/BinaryHeapStrategy":5}],2:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue;
|
||||
|
||||
module.exports = AbstractPriorityQueue = (function() {
|
||||
function AbstractPriorityQueue(options) {
|
||||
var ref;
|
||||
if ((options != null ? options.strategy : void 0) == null) {
|
||||
throw 'Must pass options.strategy, a strategy';
|
||||
}
|
||||
if ((options != null ? options.comparator : void 0) == null) {
|
||||
throw 'Must pass options.comparator, a comparator';
|
||||
}
|
||||
this.priv = new options.strategy(options);
|
||||
this.length = (options != null ? (ref = options.initialValues) != null ? ref.length : void 0 : void 0) || 0;
|
||||
}
|
||||
|
||||
AbstractPriorityQueue.prototype.queue = function(value) {
|
||||
this.length++;
|
||||
this.priv.queue(value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.dequeue = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
this.length--;
|
||||
return this.priv.dequeue();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.peek = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
return this.priv.peek();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
return this.priv.clear();
|
||||
};
|
||||
|
||||
return AbstractPriorityQueue;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],3:[function(_dereq_,module,exports){
|
||||
var ArrayStrategy, binarySearchForIndexReversed;
|
||||
|
||||
binarySearchForIndexReversed = function(array, value, comparator) {
|
||||
var high, low, mid;
|
||||
low = 0;
|
||||
high = array.length;
|
||||
while (low < high) {
|
||||
mid = (low + high) >>> 1;
|
||||
if (comparator(array[mid], value) >= 0) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
high = mid;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
};
|
||||
|
||||
module.exports = ArrayStrategy = (function() {
|
||||
function ArrayStrategy(options) {
|
||||
var ref;
|
||||
this.options = options;
|
||||
this.comparator = this.options.comparator;
|
||||
this.data = ((ref = this.options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this.data.sort(this.comparator).reverse();
|
||||
}
|
||||
|
||||
ArrayStrategy.prototype.queue = function(value) {
|
||||
var pos;
|
||||
pos = binarySearchForIndexReversed(this.data, value, this.comparator);
|
||||
this.data.splice(pos, 0, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.dequeue = function() {
|
||||
return this.data.pop();
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.peek = function() {
|
||||
return this.data[this.data.length - 1];
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.clear = function() {
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return ArrayStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],4:[function(_dereq_,module,exports){
|
||||
var BHeapStrategy;
|
||||
|
||||
module.exports = BHeapStrategy = (function() {
|
||||
function BHeapStrategy(options) {
|
||||
var arr, i, j, k, len, ref, ref1, shift, value;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.pageSize = (options != null ? options.pageSize : void 0) || 512;
|
||||
this.length = 0;
|
||||
shift = 0;
|
||||
while ((1 << shift) < this.pageSize) {
|
||||
shift += 1;
|
||||
}
|
||||
if (1 << shift !== this.pageSize) {
|
||||
throw 'pageSize must be a power of two';
|
||||
}
|
||||
this._shift = shift;
|
||||
this._emptyMemoryPageTemplate = arr = [];
|
||||
for (i = j = 0, ref = this.pageSize; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
|
||||
arr.push(null);
|
||||
}
|
||||
this._memory = [];
|
||||
this._mask = this.pageSize - 1;
|
||||
if (options.initialValues) {
|
||||
ref1 = options.initialValues;
|
||||
for (k = 0, len = ref1.length; k < len; k++) {
|
||||
value = ref1[k];
|
||||
this.queue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BHeapStrategy.prototype.queue = function(value) {
|
||||
this.length += 1;
|
||||
this._write(this.length, value);
|
||||
this._bubbleUp(this.length, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.dequeue = function() {
|
||||
var ret, val;
|
||||
ret = this._read(1);
|
||||
val = this._read(this.length);
|
||||
this.length -= 1;
|
||||
if (this.length > 0) {
|
||||
this._write(1, val);
|
||||
this._bubbleDown(1, val);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.peek = function() {
|
||||
return this._read(1);
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this._memory.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._write = function(index, value) {
|
||||
var page;
|
||||
page = index >> this._shift;
|
||||
while (page >= this._memory.length) {
|
||||
this._memory.push(this._emptyMemoryPageTemplate.slice(0));
|
||||
}
|
||||
return this._memory[page][index & this._mask] = value;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._read = function(index) {
|
||||
return this._memory[index >> this._shift][index & this._mask];
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleUp = function(index, value) {
|
||||
var compare, indexInPage, parentIndex, parentValue;
|
||||
compare = this.comparator;
|
||||
while (index > 1) {
|
||||
indexInPage = index & this._mask;
|
||||
if (index < this.pageSize || indexInPage > 3) {
|
||||
parentIndex = (index & ~this._mask) | (indexInPage >> 1);
|
||||
} else if (indexInPage < 2) {
|
||||
parentIndex = (index - this.pageSize) >> this._shift;
|
||||
parentIndex += parentIndex & ~(this._mask >> 1);
|
||||
parentIndex |= this.pageSize >> 1;
|
||||
} else {
|
||||
parentIndex = index - 2;
|
||||
}
|
||||
parentValue = this._read(parentIndex);
|
||||
if (compare(parentValue, value) < 0) {
|
||||
break;
|
||||
}
|
||||
this._write(parentIndex, value);
|
||||
this._write(index, parentValue);
|
||||
index = parentIndex;
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleDown = function(index, value) {
|
||||
var childIndex1, childIndex2, childValue1, childValue2, compare;
|
||||
compare = this.comparator;
|
||||
while (index < this.length) {
|
||||
if (index > this._mask && !(index & (this._mask - 1))) {
|
||||
childIndex1 = childIndex2 = index + 2;
|
||||
} else if (index & (this.pageSize >> 1)) {
|
||||
childIndex1 = (index & ~this._mask) >> 1;
|
||||
childIndex1 |= index & (this._mask >> 1);
|
||||
childIndex1 = (childIndex1 + 1) << this._shift;
|
||||
childIndex2 = childIndex1 + 1;
|
||||
} else {
|
||||
childIndex1 = index + (index & this._mask);
|
||||
childIndex2 = childIndex1 + 1;
|
||||
}
|
||||
if (childIndex1 !== childIndex2 && childIndex2 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
childValue2 = this._read(childIndex2);
|
||||
if (compare(childValue1, value) < 0 && compare(childValue1, childValue2) <= 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else if (compare(childValue2, value) < 0) {
|
||||
this._write(childIndex2, value);
|
||||
this._write(index, childValue2);
|
||||
index = childIndex2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (childIndex1 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
if (compare(childValue1, value) < 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],5:[function(_dereq_,module,exports){
|
||||
var BinaryHeapStrategy;
|
||||
|
||||
module.exports = BinaryHeapStrategy = (function() {
|
||||
function BinaryHeapStrategy(options) {
|
||||
var ref;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.length = 0;
|
||||
this.data = ((ref = options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this._heapify();
|
||||
}
|
||||
|
||||
BinaryHeapStrategy.prototype._heapify = function() {
|
||||
var i, j, ref;
|
||||
if (this.data.length > 0) {
|
||||
for (i = j = 1, ref = this.data.length; 1 <= ref ? j < ref : j > ref; i = 1 <= ref ? ++j : --j) {
|
||||
this._bubbleUp(i);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.queue = function(value) {
|
||||
this.data.push(value);
|
||||
this._bubbleUp(this.data.length - 1);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.dequeue = function() {
|
||||
var last, ret;
|
||||
ret = this.data[0];
|
||||
last = this.data.pop();
|
||||
if (this.data.length > 0) {
|
||||
this.data[0] = last;
|
||||
this._bubbleDown(0);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.peek = function() {
|
||||
return this.data[0];
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleUp = function(pos) {
|
||||
var parent, x;
|
||||
while (pos > 0) {
|
||||
parent = (pos - 1) >>> 1;
|
||||
if (this.comparator(this.data[pos], this.data[parent]) < 0) {
|
||||
x = this.data[parent];
|
||||
this.data[parent] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = parent;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleDown = function(pos) {
|
||||
var last, left, minIndex, right, x;
|
||||
last = this.data.length - 1;
|
||||
while (true) {
|
||||
left = (pos << 1) + 1;
|
||||
right = left + 1;
|
||||
minIndex = pos;
|
||||
if (left <= last && this.comparator(this.data[left], this.data[minIndex]) < 0) {
|
||||
minIndex = left;
|
||||
}
|
||||
if (right <= last && this.comparator(this.data[right], this.data[minIndex]) < 0) {
|
||||
minIndex = right;
|
||||
}
|
||||
if (minIndex !== pos) {
|
||||
x = this.data[minIndex];
|
||||
this.data[minIndex] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = minIndex;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BinaryHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}]},{},[1])(1)
|
||||
});
|
@ -0,0 +1,21 @@
|
||||
/* If you're feeling fancy you can add interactivity
|
||||
to your site with Javascript */
|
||||
|
||||
// prints "hi" in the browser's dev tools console
|
||||
console.log("hi");
|
||||
var svg = d3.select("svg");
|
||||
|
||||
var params = {
|
||||
extent: defaultExtent,
|
||||
generator: generateCoast,
|
||||
npts: 1684,
|
||||
ncities: 15,
|
||||
nterrs: 5,
|
||||
fontsizes: {
|
||||
region: 40,
|
||||
city: 25,
|
||||
town: 20
|
||||
}
|
||||
}
|
||||
|
||||
doMap(svg, defaultParams);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,387 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PriorityQueue = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue, ArrayStrategy, BHeapStrategy, BinaryHeapStrategy, PriorityQueue,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
AbstractPriorityQueue = _dereq_('./PriorityQueue/AbstractPriorityQueue');
|
||||
|
||||
ArrayStrategy = _dereq_('./PriorityQueue/ArrayStrategy');
|
||||
|
||||
BinaryHeapStrategy = _dereq_('./PriorityQueue/BinaryHeapStrategy');
|
||||
|
||||
BHeapStrategy = _dereq_('./PriorityQueue/BHeapStrategy');
|
||||
|
||||
PriorityQueue = (function(superClass) {
|
||||
extend(PriorityQueue, superClass);
|
||||
|
||||
function PriorityQueue(options) {
|
||||
options || (options = {});
|
||||
options.strategy || (options.strategy = BinaryHeapStrategy);
|
||||
options.comparator || (options.comparator = function(a, b) {
|
||||
return (a || 0) - (b || 0);
|
||||
});
|
||||
PriorityQueue.__super__.constructor.call(this, options);
|
||||
}
|
||||
|
||||
return PriorityQueue;
|
||||
|
||||
})(AbstractPriorityQueue);
|
||||
|
||||
PriorityQueue.ArrayStrategy = ArrayStrategy;
|
||||
|
||||
PriorityQueue.BinaryHeapStrategy = BinaryHeapStrategy;
|
||||
|
||||
PriorityQueue.BHeapStrategy = BHeapStrategy;
|
||||
|
||||
module.exports = PriorityQueue;
|
||||
|
||||
|
||||
},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3,"./PriorityQueue/BHeapStrategy":4,"./PriorityQueue/BinaryHeapStrategy":5}],2:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue;
|
||||
|
||||
module.exports = AbstractPriorityQueue = (function() {
|
||||
function AbstractPriorityQueue(options) {
|
||||
var ref;
|
||||
if ((options != null ? options.strategy : void 0) == null) {
|
||||
throw 'Must pass options.strategy, a strategy';
|
||||
}
|
||||
if ((options != null ? options.comparator : void 0) == null) {
|
||||
throw 'Must pass options.comparator, a comparator';
|
||||
}
|
||||
this.priv = new options.strategy(options);
|
||||
this.length = (options != null ? (ref = options.initialValues) != null ? ref.length : void 0 : void 0) || 0;
|
||||
}
|
||||
|
||||
AbstractPriorityQueue.prototype.queue = function(value) {
|
||||
this.length++;
|
||||
this.priv.queue(value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.dequeue = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
this.length--;
|
||||
return this.priv.dequeue();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.peek = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
return this.priv.peek();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
return this.priv.clear();
|
||||
};
|
||||
|
||||
return AbstractPriorityQueue;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],3:[function(_dereq_,module,exports){
|
||||
var ArrayStrategy, binarySearchForIndexReversed;
|
||||
|
||||
binarySearchForIndexReversed = function(array, value, comparator) {
|
||||
var high, low, mid;
|
||||
low = 0;
|
||||
high = array.length;
|
||||
while (low < high) {
|
||||
mid = (low + high) >>> 1;
|
||||
if (comparator(array[mid], value) >= 0) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
high = mid;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
};
|
||||
|
||||
module.exports = ArrayStrategy = (function() {
|
||||
function ArrayStrategy(options) {
|
||||
var ref;
|
||||
this.options = options;
|
||||
this.comparator = this.options.comparator;
|
||||
this.data = ((ref = this.options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this.data.sort(this.comparator).reverse();
|
||||
}
|
||||
|
||||
ArrayStrategy.prototype.queue = function(value) {
|
||||
var pos;
|
||||
pos = binarySearchForIndexReversed(this.data, value, this.comparator);
|
||||
this.data.splice(pos, 0, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.dequeue = function() {
|
||||
return this.data.pop();
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.peek = function() {
|
||||
return this.data[this.data.length - 1];
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.clear = function() {
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return ArrayStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],4:[function(_dereq_,module,exports){
|
||||
var BHeapStrategy;
|
||||
|
||||
module.exports = BHeapStrategy = (function() {
|
||||
function BHeapStrategy(options) {
|
||||
var arr, i, j, k, len, ref, ref1, shift, value;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.pageSize = (options != null ? options.pageSize : void 0) || 512;
|
||||
this.length = 0;
|
||||
shift = 0;
|
||||
while ((1 << shift) < this.pageSize) {
|
||||
shift += 1;
|
||||
}
|
||||
if (1 << shift !== this.pageSize) {
|
||||
throw 'pageSize must be a power of two';
|
||||
}
|
||||
this._shift = shift;
|
||||
this._emptyMemoryPageTemplate = arr = [];
|
||||
for (i = j = 0, ref = this.pageSize; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
|
||||
arr.push(null);
|
||||
}
|
||||
this._memory = [];
|
||||
this._mask = this.pageSize - 1;
|
||||
if (options.initialValues) {
|
||||
ref1 = options.initialValues;
|
||||
for (k = 0, len = ref1.length; k < len; k++) {
|
||||
value = ref1[k];
|
||||
this.queue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BHeapStrategy.prototype.queue = function(value) {
|
||||
this.length += 1;
|
||||
this._write(this.length, value);
|
||||
this._bubbleUp(this.length, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.dequeue = function() {
|
||||
var ret, val;
|
||||
ret = this._read(1);
|
||||
val = this._read(this.length);
|
||||
this.length -= 1;
|
||||
if (this.length > 0) {
|
||||
this._write(1, val);
|
||||
this._bubbleDown(1, val);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.peek = function() {
|
||||
return this._read(1);
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this._memory.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._write = function(index, value) {
|
||||
var page;
|
||||
page = index >> this._shift;
|
||||
while (page >= this._memory.length) {
|
||||
this._memory.push(this._emptyMemoryPageTemplate.slice(0));
|
||||
}
|
||||
return this._memory[page][index & this._mask] = value;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._read = function(index) {
|
||||
return this._memory[index >> this._shift][index & this._mask];
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleUp = function(index, value) {
|
||||
var compare, indexInPage, parentIndex, parentValue;
|
||||
compare = this.comparator;
|
||||
while (index > 1) {
|
||||
indexInPage = index & this._mask;
|
||||
if (index < this.pageSize || indexInPage > 3) {
|
||||
parentIndex = (index & ~this._mask) | (indexInPage >> 1);
|
||||
} else if (indexInPage < 2) {
|
||||
parentIndex = (index - this.pageSize) >> this._shift;
|
||||
parentIndex += parentIndex & ~(this._mask >> 1);
|
||||
parentIndex |= this.pageSize >> 1;
|
||||
} else {
|
||||
parentIndex = index - 2;
|
||||
}
|
||||
parentValue = this._read(parentIndex);
|
||||
if (compare(parentValue, value) < 0) {
|
||||
break;
|
||||
}
|
||||
this._write(parentIndex, value);
|
||||
this._write(index, parentValue);
|
||||
index = parentIndex;
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleDown = function(index, value) {
|
||||
var childIndex1, childIndex2, childValue1, childValue2, compare;
|
||||
compare = this.comparator;
|
||||
while (index < this.length) {
|
||||
if (index > this._mask && !(index & (this._mask - 1))) {
|
||||
childIndex1 = childIndex2 = index + 2;
|
||||
} else if (index & (this.pageSize >> 1)) {
|
||||
childIndex1 = (index & ~this._mask) >> 1;
|
||||
childIndex1 |= index & (this._mask >> 1);
|
||||
childIndex1 = (childIndex1 + 1) << this._shift;
|
||||
childIndex2 = childIndex1 + 1;
|
||||
} else {
|
||||
childIndex1 = index + (index & this._mask);
|
||||
childIndex2 = childIndex1 + 1;
|
||||
}
|
||||
if (childIndex1 !== childIndex2 && childIndex2 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
childValue2 = this._read(childIndex2);
|
||||
if (compare(childValue1, value) < 0 && compare(childValue1, childValue2) <= 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else if (compare(childValue2, value) < 0) {
|
||||
this._write(childIndex2, value);
|
||||
this._write(index, childValue2);
|
||||
index = childIndex2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (childIndex1 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
if (compare(childValue1, value) < 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],5:[function(_dereq_,module,exports){
|
||||
var BinaryHeapStrategy;
|
||||
|
||||
module.exports = BinaryHeapStrategy = (function() {
|
||||
function BinaryHeapStrategy(options) {
|
||||
var ref;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.length = 0;
|
||||
this.data = ((ref = options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this._heapify();
|
||||
}
|
||||
|
||||
BinaryHeapStrategy.prototype._heapify = function() {
|
||||
var i, j, ref;
|
||||
if (this.data.length > 0) {
|
||||
for (i = j = 1, ref = this.data.length; 1 <= ref ? j < ref : j > ref; i = 1 <= ref ? ++j : --j) {
|
||||
this._bubbleUp(i);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.queue = function(value) {
|
||||
this.data.push(value);
|
||||
this._bubbleUp(this.data.length - 1);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.dequeue = function() {
|
||||
var last, ret;
|
||||
ret = this.data[0];
|
||||
last = this.data.pop();
|
||||
if (this.data.length > 0) {
|
||||
this.data[0] = last;
|
||||
this._bubbleDown(0);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.peek = function() {
|
||||
return this.data[0];
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleUp = function(pos) {
|
||||
var parent, x;
|
||||
while (pos > 0) {
|
||||
parent = (pos - 1) >>> 1;
|
||||
if (this.comparator(this.data[pos], this.data[parent]) < 0) {
|
||||
x = this.data[parent];
|
||||
this.data[parent] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = parent;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleDown = function(pos) {
|
||||
var last, left, minIndex, right, x;
|
||||
last = this.data.length - 1;
|
||||
while (true) {
|
||||
left = (pos << 1) + 1;
|
||||
right = left + 1;
|
||||
minIndex = pos;
|
||||
if (left <= last && this.comparator(this.data[left], this.data[minIndex]) < 0) {
|
||||
minIndex = left;
|
||||
}
|
||||
if (right <= last && this.comparator(this.data[right], this.data[minIndex]) < 0) {
|
||||
minIndex = right;
|
||||
}
|
||||
if (minIndex !== pos) {
|
||||
x = this.data[minIndex];
|
||||
this.data[minIndex] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = minIndex;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BinaryHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}]},{},[1])(1)
|
||||
});
|
@ -0,0 +1,21 @@
|
||||
/* If you're feeling fancy you can add interactivity
|
||||
to your site with Javascript */
|
||||
|
||||
// prints "hi" in the browser's dev tools console
|
||||
console.log("hi");
|
||||
var svg = d3.select("svg");
|
||||
|
||||
var params = {
|
||||
extent: defaultExtent,
|
||||
generator: generateCoast,
|
||||
npts: 1684,
|
||||
ncities: 15,
|
||||
nterrs: 5,
|
||||
fontsizes: {
|
||||
region: 40,
|
||||
city: 25,
|
||||
town: 20
|
||||
}
|
||||
}
|
||||
|
||||
doMap(svg, defaultParams);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,387 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PriorityQueue = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue, ArrayStrategy, BHeapStrategy, BinaryHeapStrategy, PriorityQueue,
|
||||
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
AbstractPriorityQueue = _dereq_('./PriorityQueue/AbstractPriorityQueue');
|
||||
|
||||
ArrayStrategy = _dereq_('./PriorityQueue/ArrayStrategy');
|
||||
|
||||
BinaryHeapStrategy = _dereq_('./PriorityQueue/BinaryHeapStrategy');
|
||||
|
||||
BHeapStrategy = _dereq_('./PriorityQueue/BHeapStrategy');
|
||||
|
||||
PriorityQueue = (function(superClass) {
|
||||
extend(PriorityQueue, superClass);
|
||||
|
||||
function PriorityQueue(options) {
|
||||
options || (options = {});
|
||||
options.strategy || (options.strategy = BinaryHeapStrategy);
|
||||
options.comparator || (options.comparator = function(a, b) {
|
||||
return (a || 0) - (b || 0);
|
||||
});
|
||||
PriorityQueue.__super__.constructor.call(this, options);
|
||||
}
|
||||
|
||||
return PriorityQueue;
|
||||
|
||||
})(AbstractPriorityQueue);
|
||||
|
||||
PriorityQueue.ArrayStrategy = ArrayStrategy;
|
||||
|
||||
PriorityQueue.BinaryHeapStrategy = BinaryHeapStrategy;
|
||||
|
||||
PriorityQueue.BHeapStrategy = BHeapStrategy;
|
||||
|
||||
module.exports = PriorityQueue;
|
||||
|
||||
|
||||
},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3,"./PriorityQueue/BHeapStrategy":4,"./PriorityQueue/BinaryHeapStrategy":5}],2:[function(_dereq_,module,exports){
|
||||
var AbstractPriorityQueue;
|
||||
|
||||
module.exports = AbstractPriorityQueue = (function() {
|
||||
function AbstractPriorityQueue(options) {
|
||||
var ref;
|
||||
if ((options != null ? options.strategy : void 0) == null) {
|
||||
throw 'Must pass options.strategy, a strategy';
|
||||
}
|
||||
if ((options != null ? options.comparator : void 0) == null) {
|
||||
throw 'Must pass options.comparator, a comparator';
|
||||
}
|
||||
this.priv = new options.strategy(options);
|
||||
this.length = (options != null ? (ref = options.initialValues) != null ? ref.length : void 0 : void 0) || 0;
|
||||
}
|
||||
|
||||
AbstractPriorityQueue.prototype.queue = function(value) {
|
||||
this.length++;
|
||||
this.priv.queue(value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.dequeue = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
this.length--;
|
||||
return this.priv.dequeue();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.peek = function(value) {
|
||||
if (!this.length) {
|
||||
throw 'Empty queue';
|
||||
}
|
||||
return this.priv.peek();
|
||||
};
|
||||
|
||||
AbstractPriorityQueue.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
return this.priv.clear();
|
||||
};
|
||||
|
||||
return AbstractPriorityQueue;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],3:[function(_dereq_,module,exports){
|
||||
var ArrayStrategy, binarySearchForIndexReversed;
|
||||
|
||||
binarySearchForIndexReversed = function(array, value, comparator) {
|
||||
var high, low, mid;
|
||||
low = 0;
|
||||
high = array.length;
|
||||
while (low < high) {
|
||||
mid = (low + high) >>> 1;
|
||||
if (comparator(array[mid], value) >= 0) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
high = mid;
|
||||
}
|
||||
}
|
||||
return low;
|
||||
};
|
||||
|
||||
module.exports = ArrayStrategy = (function() {
|
||||
function ArrayStrategy(options) {
|
||||
var ref;
|
||||
this.options = options;
|
||||
this.comparator = this.options.comparator;
|
||||
this.data = ((ref = this.options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this.data.sort(this.comparator).reverse();
|
||||
}
|
||||
|
||||
ArrayStrategy.prototype.queue = function(value) {
|
||||
var pos;
|
||||
pos = binarySearchForIndexReversed(this.data, value, this.comparator);
|
||||
this.data.splice(pos, 0, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.dequeue = function() {
|
||||
return this.data.pop();
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.peek = function() {
|
||||
return this.data[this.data.length - 1];
|
||||
};
|
||||
|
||||
ArrayStrategy.prototype.clear = function() {
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return ArrayStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],4:[function(_dereq_,module,exports){
|
||||
var BHeapStrategy;
|
||||
|
||||
module.exports = BHeapStrategy = (function() {
|
||||
function BHeapStrategy(options) {
|
||||
var arr, i, j, k, len, ref, ref1, shift, value;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.pageSize = (options != null ? options.pageSize : void 0) || 512;
|
||||
this.length = 0;
|
||||
shift = 0;
|
||||
while ((1 << shift) < this.pageSize) {
|
||||
shift += 1;
|
||||
}
|
||||
if (1 << shift !== this.pageSize) {
|
||||
throw 'pageSize must be a power of two';
|
||||
}
|
||||
this._shift = shift;
|
||||
this._emptyMemoryPageTemplate = arr = [];
|
||||
for (i = j = 0, ref = this.pageSize; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
|
||||
arr.push(null);
|
||||
}
|
||||
this._memory = [];
|
||||
this._mask = this.pageSize - 1;
|
||||
if (options.initialValues) {
|
||||
ref1 = options.initialValues;
|
||||
for (k = 0, len = ref1.length; k < len; k++) {
|
||||
value = ref1[k];
|
||||
this.queue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BHeapStrategy.prototype.queue = function(value) {
|
||||
this.length += 1;
|
||||
this._write(this.length, value);
|
||||
this._bubbleUp(this.length, value);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.dequeue = function() {
|
||||
var ret, val;
|
||||
ret = this._read(1);
|
||||
val = this._read(this.length);
|
||||
this.length -= 1;
|
||||
if (this.length > 0) {
|
||||
this._write(1, val);
|
||||
this._bubbleDown(1, val);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.peek = function() {
|
||||
return this._read(1);
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this._memory.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._write = function(index, value) {
|
||||
var page;
|
||||
page = index >> this._shift;
|
||||
while (page >= this._memory.length) {
|
||||
this._memory.push(this._emptyMemoryPageTemplate.slice(0));
|
||||
}
|
||||
return this._memory[page][index & this._mask] = value;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._read = function(index) {
|
||||
return this._memory[index >> this._shift][index & this._mask];
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleUp = function(index, value) {
|
||||
var compare, indexInPage, parentIndex, parentValue;
|
||||
compare = this.comparator;
|
||||
while (index > 1) {
|
||||
indexInPage = index & this._mask;
|
||||
if (index < this.pageSize || indexInPage > 3) {
|
||||
parentIndex = (index & ~this._mask) | (indexInPage >> 1);
|
||||
} else if (indexInPage < 2) {
|
||||
parentIndex = (index - this.pageSize) >> this._shift;
|
||||
parentIndex += parentIndex & ~(this._mask >> 1);
|
||||
parentIndex |= this.pageSize >> 1;
|
||||
} else {
|
||||
parentIndex = index - 2;
|
||||
}
|
||||
parentValue = this._read(parentIndex);
|
||||
if (compare(parentValue, value) < 0) {
|
||||
break;
|
||||
}
|
||||
this._write(parentIndex, value);
|
||||
this._write(index, parentValue);
|
||||
index = parentIndex;
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BHeapStrategy.prototype._bubbleDown = function(index, value) {
|
||||
var childIndex1, childIndex2, childValue1, childValue2, compare;
|
||||
compare = this.comparator;
|
||||
while (index < this.length) {
|
||||
if (index > this._mask && !(index & (this._mask - 1))) {
|
||||
childIndex1 = childIndex2 = index + 2;
|
||||
} else if (index & (this.pageSize >> 1)) {
|
||||
childIndex1 = (index & ~this._mask) >> 1;
|
||||
childIndex1 |= index & (this._mask >> 1);
|
||||
childIndex1 = (childIndex1 + 1) << this._shift;
|
||||
childIndex2 = childIndex1 + 1;
|
||||
} else {
|
||||
childIndex1 = index + (index & this._mask);
|
||||
childIndex2 = childIndex1 + 1;
|
||||
}
|
||||
if (childIndex1 !== childIndex2 && childIndex2 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
childValue2 = this._read(childIndex2);
|
||||
if (compare(childValue1, value) < 0 && compare(childValue1, childValue2) <= 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else if (compare(childValue2, value) < 0) {
|
||||
this._write(childIndex2, value);
|
||||
this._write(index, childValue2);
|
||||
index = childIndex2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (childIndex1 <= this.length) {
|
||||
childValue1 = this._read(childIndex1);
|
||||
if (compare(childValue1, value) < 0) {
|
||||
this._write(childIndex1, value);
|
||||
this._write(index, childValue1);
|
||||
index = childIndex1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}],5:[function(_dereq_,module,exports){
|
||||
var BinaryHeapStrategy;
|
||||
|
||||
module.exports = BinaryHeapStrategy = (function() {
|
||||
function BinaryHeapStrategy(options) {
|
||||
var ref;
|
||||
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
this.length = 0;
|
||||
this.data = ((ref = options.initialValues) != null ? ref.slice(0) : void 0) || [];
|
||||
this._heapify();
|
||||
}
|
||||
|
||||
BinaryHeapStrategy.prototype._heapify = function() {
|
||||
var i, j, ref;
|
||||
if (this.data.length > 0) {
|
||||
for (i = j = 1, ref = this.data.length; 1 <= ref ? j < ref : j > ref; i = 1 <= ref ? ++j : --j) {
|
||||
this._bubbleUp(i);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.queue = function(value) {
|
||||
this.data.push(value);
|
||||
this._bubbleUp(this.data.length - 1);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.dequeue = function() {
|
||||
var last, ret;
|
||||
ret = this.data[0];
|
||||
last = this.data.pop();
|
||||
if (this.data.length > 0) {
|
||||
this.data[0] = last;
|
||||
this._bubbleDown(0);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.peek = function() {
|
||||
return this.data[0];
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
this.data.length = 0;
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleUp = function(pos) {
|
||||
var parent, x;
|
||||
while (pos > 0) {
|
||||
parent = (pos - 1) >>> 1;
|
||||
if (this.comparator(this.data[pos], this.data[parent]) < 0) {
|
||||
x = this.data[parent];
|
||||
this.data[parent] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = parent;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
BinaryHeapStrategy.prototype._bubbleDown = function(pos) {
|
||||
var last, left, minIndex, right, x;
|
||||
last = this.data.length - 1;
|
||||
while (true) {
|
||||
left = (pos << 1) + 1;
|
||||
right = left + 1;
|
||||
minIndex = pos;
|
||||
if (left <= last && this.comparator(this.data[left], this.data[minIndex]) < 0) {
|
||||
minIndex = left;
|
||||
}
|
||||
if (right <= last && this.comparator(this.data[right], this.data[minIndex]) < 0) {
|
||||
minIndex = right;
|
||||
}
|
||||
if (minIndex !== pos) {
|
||||
x = this.data[minIndex];
|
||||
this.data[minIndex] = this.data[pos];
|
||||
this.data[pos] = x;
|
||||
pos = minIndex;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
return BinaryHeapStrategy;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},{}]},{},[1])(1)
|
||||
});
|
@ -0,0 +1,21 @@
|
||||
/* If you're feeling fancy you can add interactivity
|
||||
to your site with Javascript */
|
||||
|
||||
// prints "hi" in the browser's dev tools console
|
||||
console.log("hi");
|
||||
var svg = d3.select("svg");
|
||||
|
||||
var params = {
|
||||
extent: defaultExtent,
|
||||
generator: generateCoast,
|
||||
npts: 1684,
|
||||
ncities: 15,
|
||||
nterrs: 5,
|
||||
fontsizes: {
|
||||
region: 40,
|
||||
city: 25,
|
||||
town: 20
|
||||
}
|
||||
}
|
||||
|
||||
doMap(svg, defaultParams);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,276 @@
|
||||
body{ font-family: "Lucida Console", Monaco, monospace;
|
||||
overflow: hidden;
|
||||
background-color: black;
|
||||
color: white;}
|
||||
|
||||
p { font-size: 20px; }
|
||||
|
||||
a{ text-decoration: none; }
|
||||
|
||||
#space-time{
|
||||
z-index: 101;
|
||||
position: relative;
|
||||
width: 600px;
|
||||
height: 500px;
|
||||
top: 1158px;
|
||||
left: 853px;
|
||||
}
|
||||
|
||||
#ilinx{
|
||||
position: absolute;
|
||||
width: 106px;
|
||||
left: 250px;
|
||||
top: 420px;
|
||||
}
|
||||
|
||||
.ilinx {
|
||||
font-size: 35px;
|
||||
margin-top: -2px;
|
||||
float:left;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
#spiral {
|
||||
width: 300px;
|
||||
position: absolute;
|
||||
margin-top: -150px;
|
||||
margin-left: -150px;
|
||||
top: 250px;
|
||||
left: 300px;
|
||||
}
|
||||
|
||||
.rotating {
|
||||
-webkit-animation: rotating 3s linear infinite;
|
||||
-moz-animation: rotating 3s linear infinite;
|
||||
-ms-animation: rotating 3s linear infinite;
|
||||
-o-animation: rotating 3s linear infinite;
|
||||
animation: rotating 3s linear infinite;
|
||||
}
|
||||
|
||||
#islands{
|
||||
|
||||
}
|
||||
|
||||
a.island:link{color:white;}
|
||||
a.island:hover{color: red;
|
||||
-webkit-animation: breathe 3s linear infinite;
|
||||
-moz-animation: breathe 3s linear infinite;
|
||||
-ms-animation: breathe 3s linear infinite;
|
||||
-o-animation: breathe 3s linear infinite;
|
||||
animation: breathe 3s linear infinite;
|
||||
}
|
||||
a.island:visited{color: white;}
|
||||
|
||||
#lemuria {
|
||||
position: absolute;
|
||||
left: 68px;
|
||||
top:269px;
|
||||
|
||||
}
|
||||
|
||||
#mu {
|
||||
position: absolute;
|
||||
left: 189px;
|
||||
top:76px;
|
||||
|
||||
}
|
||||
|
||||
#hyperborea {
|
||||
position: absolute;
|
||||
left: 444px;
|
||||
top: 151px;
|
||||
|
||||
}
|
||||
|
||||
#thule{
|
||||
position: absolute;
|
||||
left: 421px;
|
||||
top:322px;
|
||||
}
|
||||
|
||||
#sea {
|
||||
position: relative;
|
||||
width: 2500px;
|
||||
height: 2500px;
|
||||
/* border-style: dotted;
|
||||
border-width: 2px;*/
|
||||
top: -990px;
|
||||
left: -145px;
|
||||
/* background-image: url('./img/grid3.png');
|
||||
background-repeat: repeat;*/
|
||||
}
|
||||
|
||||
#iper{
|
||||
position: relative;
|
||||
left: -27px;
|
||||
top: -47px;
|
||||
}
|
||||
|
||||
#m {
|
||||
position: relative;
|
||||
left: -632px;
|
||||
top: -48px;
|
||||
}
|
||||
|
||||
#thl{
|
||||
position: relative;
|
||||
left: -30px;
|
||||
top: -38px;
|
||||
}
|
||||
|
||||
#lmr{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 1454px;
|
||||
}
|
||||
|
||||
#MVU{
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
left: 278px;
|
||||
top: 321px;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
.inner{
|
||||
font-size: 15px;
|
||||
background-color: yellow;
|
||||
|
||||
}
|
||||
|
||||
a.place:hover{letter-spacing: -4px;
|
||||
color: green;
|
||||
-webkit-animation: breathe 1s linear infinite;
|
||||
-moz-animation: breathe 1s linear infinite;
|
||||
-ms-animation: breathe 1s linear infinite;
|
||||
-o-animation: breathe 1s linear infinite;
|
||||
animation: breathe 1s linear infinite;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* SVG */
|
||||
text {
|
||||
font-family: "Lucida Console", Monaco, monospace;
|
||||
color: black;
|
||||
stroke: white;
|
||||
stroke-width: 6;
|
||||
stroke-linejoin: round;
|
||||
paint-order: stroke;
|
||||
}
|
||||
|
||||
text.region {
|
||||
stroke-width:6;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
svg {
|
||||
float: right;
|
||||
}
|
||||
|
||||
path, line {
|
||||
fill: none;
|
||||
stroke: white;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
|
||||
.field {
|
||||
stroke: none;
|
||||
fill-opacity: 1.0;
|
||||
}
|
||||
|
||||
.slope {
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.river {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.coast {
|
||||
stroke-width: 4;
|
||||
}
|
||||
|
||||
.border {
|
||||
stroke-width: 5;
|
||||
stroke-dasharray: 4,4;
|
||||
stroke-linecap: butt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Rotate loop */
|
||||
|
||||
@-webkit-keyframes rotating /* Safari and Chrome */ {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-webkit-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes rotating {
|
||||
from {
|
||||
-ms-transform: rotate(0deg);
|
||||
-moz-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
-ms-transform: rotate(360deg);
|
||||
-moz-transform: rotate(360deg);
|
||||
-webkit-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Breathing text */
|
||||
|
||||
@-webkit-keyframes breathe /* Safari and Chrome */ {
|
||||
0% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
50% {font-size:21px; color: red; letter-spacing: 1px; margin-left: -6px;}
|
||||
100% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
}
|
||||
@keyframes breathe {
|
||||
0% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
50% {font-size:21px; color: red; letter-spacing: 1px; margin-left: -6px;}
|
||||
100% {font-size:20px; color: white; letter-spacing: 0px; margin-left: 0px;}
|
||||
}
|
Loading…
Reference in New Issue