Skip to content

Instantly share code, notes, and snippets.

@annabsmylie
Last active September 27, 2016 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annabsmylie/12517cefd87940715702fd4c117dd285 to your computer and use it in GitHub Desktop.
Save annabsmylie/12517cefd87940715702fd4c117dd285 to your computer and use it in GitHub Desktop.
ascii nate: anna
license: mit

Generate UTF-8 Art. Upload your own picture (it will be downsampled to 72 pixels wide).

Try changing the inputs of the scale, since the initial values are Chinese, you'll need to replace all of them if you are using ASCII for the image to line up.

You can double click on the scale to add a new value. Try dragging the numbers around to see how the image is affected by the scale.

Built with blockbuilder.org

forked from enjalot's block: ascii nate: dark

//http://stackoverflow.com/questions/18922880/html5-canvas-resize-downscale-image-high-quality
//http://jsfiddle.net/gamealchemist/r6aVp/
function downScaleCanvas(cv, scale) {
if (!(scale < 1) || !(scale > 0)) throw ('scale must be a positive number <1 ');
var sqScale = scale * scale; // square scale = area of source pixel within target
var sw = cv.width; // source image width
var sh = cv.height; // source image height
var tw = Math.floor(sw * scale); // target image width
var th = Math.floor(sh * scale); // target image height
var sx = 0, sy = 0, sIndex = 0; // source x,y, index within source array
var tx = 0, ty = 0, yIndex = 0, tIndex = 0; // target x,y, x,y index within target array
var tX = 0, tY = 0; // rounded tx, ty
var w = 0, nw = 0, wx = 0, nwx = 0, wy = 0, nwy = 0; // weight / next weight x / y
// weight is weight of current source point within target.
// next weight is weight of current source point within next target's point.
var crossX = false; // does scaled px cross its current px right border ?
var crossY = false; // does scaled px cross its current px bottom border ?
var sBuffer = cv.getContext('2d').
getImageData(0, 0, sw, sh).data; // source buffer 8 bit rgba
var tBuffer = new Float32Array(3 * tw * th); // target buffer Float32 rgb
var sR = 0, sG = 0, sB = 0; // source's current point r,g,b
/* untested !
var sA = 0; //source alpha */
for (sy = 0; sy < sh; sy++) {
ty = sy * scale; // y src position within target
tY = 0 | ty; // rounded : target pixel's y
yIndex = 3 * tY * tw; // line index within target array
crossY = (tY != (0 | ty + scale));
if (crossY) { // if pixel is crossing botton target pixel
wy = (tY + 1 - ty); // weight of point within target pixel
nwy = (ty + scale - tY - 1); // ... within y+1 target pixel
}
for (sx = 0; sx < sw; sx++, sIndex += 4) {
tx = sx * scale; // x src position within target
tX = 0 | tx; // rounded : target pixel's x
tIndex = yIndex + tX * 3; // target pixel index within target array
crossX = (tX != (0 | tx + scale));
if (crossX) { // if pixel is crossing target pixel's right
wx = (tX + 1 - tx); // weight of point within target pixel
nwx = (tx + scale - tX - 1); // ... within x+1 target pixel
}
sR = sBuffer[sIndex ]; // retrieving r,g,b for curr src px.
sG = sBuffer[sIndex + 1];
sB = sBuffer[sIndex + 2];
/* !! untested : handling alpha !!
sA = sBuffer[sIndex + 3];
if (!sA) continue;
if (sA != 0xFF) {
sR = (sR * sA) >> 8; // or use /256 instead ??
sG = (sG * sA) >> 8;
sB = (sB * sA) >> 8;
}
*/
if (!crossX && !crossY) { // pixel does not cross
// just add components weighted by squared scale.
tBuffer[tIndex ] += sR * sqScale;
tBuffer[tIndex + 1] += sG * sqScale;
tBuffer[tIndex + 2] += sB * sqScale;
} else if (crossX && !crossY) { // cross on X only
w = wx * scale;
// add weighted component for current px
tBuffer[tIndex ] += sR * w;
tBuffer[tIndex + 1] += sG * w;
tBuffer[tIndex + 2] += sB * w;
// add weighted component for next (tX+1) px
nw = nwx * scale
tBuffer[tIndex + 3] += sR * nw;
tBuffer[tIndex + 4] += sG * nw;
tBuffer[tIndex + 5] += sB * nw;
} else if (crossY && !crossX) { // cross on Y only
w = wy * scale;
// add weighted component for current px
tBuffer[tIndex ] += sR * w;
tBuffer[tIndex + 1] += sG * w;
tBuffer[tIndex + 2] += sB * w;
// add weighted component for next (tY+1) px
nw = nwy * scale
tBuffer[tIndex + 3 * tw ] += sR * nw;
tBuffer[tIndex + 3 * tw + 1] += sG * nw;
tBuffer[tIndex + 3 * tw + 2] += sB * nw;
} else { // crosses both x and y : four target points involved
// add weighted component for current px
w = wx * wy;
tBuffer[tIndex ] += sR * w;
tBuffer[tIndex + 1] += sG * w;
tBuffer[tIndex + 2] += sB * w;
// for tX + 1; tY px
nw = nwx * wy;
tBuffer[tIndex + 3] += sR * nw;
tBuffer[tIndex + 4] += sG * nw;
tBuffer[tIndex + 5] += sB * nw;
// for tX ; tY + 1 px
nw = wx * nwy;
tBuffer[tIndex + 3 * tw ] += sR * nw;
tBuffer[tIndex + 3 * tw + 1] += sG * nw;
tBuffer[tIndex + 3 * tw + 2] += sB * nw;
// for tX + 1 ; tY +1 px
nw = nwx * nwy;
tBuffer[tIndex + 3 * tw + 3] += sR * nw;
tBuffer[tIndex + 3 * tw + 4] += sG * nw;
tBuffer[tIndex + 3 * tw + 5] += sB * nw;
}
} // end for sx
} // end for sy
// create result canvas
var resCV = document.createElement('canvas');
resCV.width = tw;
resCV.height = th;
var resCtx = resCV.getContext('2d');
var imgRes = resCtx.getImageData(0, 0, tw, th);
var jsonArray = [];
var tByteBuffer = imgRes.data;
// convert float32 array into a UInt8Clamped Array
var pxIndex = 0; //
var r,g,b;
for (sIndex = 0, tIndex = 0; pxIndex < tw * th; sIndex += 3, tIndex += 4, pxIndex++) {
r = tByteBuffer[tIndex] = Math.ceil(tBuffer[sIndex]);
g = tByteBuffer[tIndex + 1] = Math.ceil(tBuffer[sIndex + 1]);
b = tByteBuffer[tIndex + 2] = Math.ceil(tBuffer[sIndex + 2]);
tByteBuffer[tIndex + 3] = 255;
jsonArray.push([r,g,b]);
}
// writing result to canvas.
resCtx.putImageData(imgRes, 0, 0);
return { canvas: resCV, jsonArray: jsonArray };
}
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="scaler.js"></script>
<script src="downscale.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
svg { width: 100%; height: 100%; }
p {
margin: 0;
padding: 0;
display: inline-block;
float:left;
}
#ascii {
margin: 10px;
font-size: 7px;
font-family: 'Courier New', monospace;
letter-spacing: 2px;
line-height: 6.75px;
font-weight: bold;
}
#file {
margin-left: 30px;
}
</style>
</head>
<body>
<div id="container">
<pre id="ascii">
</pre>
</div>
<input id="file" type="file" name="files[]">
<img id="preview" style="display:none">
<script>
d3.json("nate.json", function(err, nate) {
var targetWidth = 72;
var display = d3.select("body");
var scale = d3.scale.linear()
.domain([0, 50, 100, 150, 200, 255])
.range(["n", "a", "D", "A", "N", "3"])
var scaler = d3.scaler()
.scale(scale);
var container = display.append("div")
.attr("id", "scaler")
container.call(scaler);
scaler.on("update", function() {
scale.interpolate(function(a,b) {
return function(t) {
return [a,b][Math.round(t)];
}
})
render();
})
var r, g, b;
function getPixels(data) {
var pixels = [];
for(var i = 0; i < data.length; i++)
{
r = data[i][0];
g = data[i][1];
b = data[i][2];
//converting the pixel into grayscale
gray = r*0.2126 + g*0.7152 + b*0.0722;
pixels.push({r:r, g:g, b:b, gray: gray});
}
return pixels;
}
render(getPixels(nate));
function render(pixels) {
var ps;
if(pixels) {
ps = display.select("#ascii").selectAll("p")
.data(pixels)
ps.enter()
.append("p")
ps.exit().remove();
} else {
ps = display.select("#ascii").selectAll("p");
}
ps.text(function(d) {
//return asciiScale.invert(d.gray);
return scale(d.gray)
})
.style({
"clear": function(d,i) {
if(i !== 0 && i%targetWidth === 0)
return "left";
},
"color": function(d,i) {
return "rgba(" + [d.r, d.g, d.b, 1] + ")";
//return colorScale(i);
}
})
}
d3.select("#file").node()
.addEventListener("change", function(evt) {
d3.select("#downscaled").selectAll("canvas").remove();
var files = evt.target.files;
var file = files[0];
if(file.type.indexOf("image/") === 0) {
var reader = new FileReader();
reader.onload = (function(data) {
var img = document.getElementById('preview')
img.src = data.target.result;
setTimeout(function() {
scaleImage(img);
}, 300);
});
reader.readAsDataURL(file);
}
})
function scaleImage(img) {
var imgCV = document.createElement('canvas');
imgCV.width = img.width;
imgCV.height = img.height;
var imgCtx = imgCV.getContext('2d');
imgCtx.drawImage(img, 0, 0);
var scale = targetWidth / img.width;
console.log("scale", scale)
var downscaled = downScaleCanvas(imgCV, scale);
console.log("scaled", targetWidth, img.height * scale);
render(getPixels(downscaled.jsonArray));
}
})
</script>
</body>
[[152,142,140],[154,145,142],[154,146,140],[153,146,140],[155,147,141],[155,146,140],[157,146,140],[156,146,140],[156,147,140],[156,149,141],[158,151,145],[159,151,147],[155,151,142],[159,153,149],[161,154,148],[162,155,147],[161,155,147],[161,157,148],[163,159,148],[165,160,148],[167,161,149],[168,162,150],[169,164,154],[169,166,158],[169,166,162],[169,166,162],[167,166,161],[167,166,161],[171,170,165],[172,171,166],[172,173,167],[171,171,166],[171,170,166],[173,172,168],[171,171,167],[168,168,166],[172,172,170],[173,173,171],[174,174,172],[174,174,172],[175,175,173],[175,175,173],[175,175,173],[174,174,172],[174,174,172],[176,176,174],[174,175,173],[173,175,172],[174,176,175],[174,176,175],[173,175,174],[174,175,177],[174,175,177],[173,174,176],[174,175,178],[173,174,176],[174,175,177],[169,173,174],[169,173,174],[171,175,176],[171,175,176],[171,174,175],[172,173,175],[171,172,174],[172,173,174],[170,172,171],[167,171,172],[168,172,173],[169,173,174],[166,170,171],[167,171,172],[167,171,172],[151,142,138],[154,144,140],[152,142,137],[154,145,140],[158,148,142],[156,146,139],[156,145,140],[158,148,142],[159,150,143],[157,149,141],[157,150,143],[157,151,143],[158,153,146],[160,154,148],[161,154,147],[164,157,149],[163,157,149],[164,160,151],[163,160,150],[166,162,151],[167,162,150],[169,163,151],[168,164,153],[170,168,157],[170,167,160],[169,166,160],[170,168,162],[171,169,163],[170,169,163],[171,170,164],[167,167,162],[139,138,134],[97,94,92],[65,60,60],[51,47,47],[50,49,48],[74,74,73],[116,116,114],[162,162,159],[174,174,171],[175,174,173],[175,175,174],[176,176,174],[176,176,174],[175,175,173],[175,175,173],[174,174,172],[174,175,172],[175,176,174],[174,175,174],[175,176,176],[174,174,175],[173,174,175],[174,175,176],[173,175,174],[171,173,172],[172,173,173],[174,176,175],[172,175,174],[170,173,172],[171,174,174],[169,172,172],[171,172,174],[172,173,175],[170,172,173],[170,173,173],[167,171,173],[169,173,175],[166,170,172],[168,172,174],[168,171,173],[170,172,175],[152,143,135],[153,143,135],[156,144,137],[154,143,139],[157,146,142],[156,145,141],[154,146,141],[157,149,143],[155,146,139],[158,149,142],[160,152,144],[160,152,144],[158,150,142],[160,153,145],[163,156,148],[161,154,146],[164,159,150],[164,160,151],[164,161,152],[167,164,153],[167,163,151],[170,164,152],[171,166,156],[170,167,158],[172,169,162],[170,167,160],[172,169,162],[171,168,161],[171,169,163],[134,133,129],[74,69,69],[36,30,30],[48,36,38],[56,42,43],[51,37,39],[44,34,34],[48,39,39],[48,39,38],[77,69,67],[160,155,152],[176,172,169],[178,175,173],[175,175,173],[175,175,173],[175,175,173],[175,175,173],[174,174,172],[174,174,172],[174,174,172],[173,173,172],[174,174,174],[172,172,172],[173,174,173],[174,176,175],[172,174,173],[171,173,172],[172,174,171],[170,172,169],[170,172,169],[171,173,170],[171,173,172],[170,171,171],[170,171,173],[171,172,174],[170,172,174],[168,172,173],[168,172,175],[168,172,175],[167,171,174],[168,172,175],[166,169,173],[168,169,173],[156,143,137],[157,144,136],[157,144,136],[156,145,139],[156,145,140],[157,146,142],[155,146,141],[158,149,144],[159,150,145],[159,150,145],[159,150,143],[162,153,144],[162,153,144],[162,153,144],[167,158,149],[167,160,151],[166,160,151],[165,161,152],[166,164,152],[166,164,152],[168,166,154],[170,166,155],[171,168,156],[170,167,159],[170,167,160],[170,167,160],[170,167,160],[168,167,159],[115,113,107],[33,27,24],[33,23,21],[52,34,34],[76,56,56],[96,72,74],[90,68,68],[79,57,58],[74,55,55],[63,46,44],[72,54,51],[89,76,71],[144,135,130],[176,167,166],[177,173,172],[175,174,172],[177,176,174],[175,175,175],[174,174,173],[174,174,172],[173,173,171],[174,174,172],[173,173,171],[173,173,173],[173,174,173],[172,174,173],[173,173,172],[173,174,171],[172,174,171],[171,173,170],[172,174,171],[172,174,171],[172,174,171],[171,173,171],[171,173,172],[171,173,172],[171,173,172],[170,171,173],[166,170,173],[168,172,175],[167,171,174],[167,171,174],[167,171,174],[166,170,173],[157,143,134],[158,144,136],[159,145,138],[156,144,138],[156,144,139],[159,147,142],[158,148,143],[158,149,144],[158,150,145],[161,152,147],[160,151,145],[162,154,144],[163,155,145],[164,155,145],[166,157,146],[165,160,148],[164,160,148],[166,162,151],[167,164,152],[168,165,153],[167,165,153],[169,166,156],[170,167,157],[170,167,160],[172,168,162],[173,169,163],[169,165,158],[136,129,124],[54,44,40],[53,37,34],[85,63,63],[147,119,118],[182,152,150],[202,171,169],[204,174,172],[212,183,181],[210,181,179],[197,169,166],[167,138,135],[132,105,101],[110,87,84],[123,106,104],[152,141,142],[168,163,162],[175,172,171],[173,173,172],[173,174,173],[174,174,173],[174,174,172],[174,174,172],[172,172,170],[174,174,172],[171,172,171],[171,173,172],[173,174,171],[171,173,170],[171,173,170],[172,174,171],[172,174,171],[171,173,170],[171,172,170],[172,173,170],[170,171,168],[170,171,168],[169,170,168],[169,170,170],[169,173,175],[167,171,173],[167,171,173],[168,171,174],[165,168,171],[168,170,173],[157,143,134],[157,143,134],[159,144,138],[159,146,140],[158,145,141],[160,146,144],[158,147,143],[159,150,145],[158,151,145],[162,153,148],[163,154,148],[163,154,145],[164,156,145],[165,157,145],[166,158,145],[168,161,149],[167,160,149],[170,163,152],[166,162,150],[168,165,153],[168,166,154],[169,166,157],[168,165,157],[170,167,160],[172,168,161],[174,168,160],[138,129,120],[66,50,44],[88,65,62],[147,119,114],[190,158,154],[211,176,170],[222,188,182],[229,195,190],[234,200,197],[234,202,199],[237,204,202],[240,208,205],[240,208,205],[237,203,201],[199,169,166],[145,118,116],[100,79,79],[126,114,113],[157,148,149],[174,170,169],[173,173,172],[174,174,174],[173,173,171],[172,172,170],[173,173,171],[172,172,170],[171,172,170],[170,172,171],[170,172,170],[170,172,169],[171,173,170],[170,172,169],[168,170,167],[170,172,169],[170,170,168],[170,170,167],[171,172,167],[172,171,167],[169,169,166],[167,167,165],[167,171,171],[165,169,170],[167,171,172],[168,169,173],[166,167,170],[168,170,171],[155,141,132],[156,142,133],[157,142,136],[157,144,138],[159,146,140],[161,148,142],[161,147,143],[159,148,142],[159,151,145],[160,151,145],[161,152,145],[164,155,146],[164,155,146],[165,156,146],[166,156,146],[168,160,149],[167,159,148],[170,162,151],[170,164,152],[170,165,154],[170,166,155],[170,167,158],[171,167,159],[173,168,162],[172,164,159],[138,125,117],[104,83,76],[122,95,87],[176,140,134],[202,165,158],[212,175,166],[219,183,174],[225,191,182],[232,197,192],[235,201,196],[236,203,198],[243,210,205],[243,210,205],[245,212,207],[245,210,206],[241,208,204],[233,201,198],[197,169,169],[124,103,103],[87,71,71],[149,137,136],[174,170,169],[174,172,170],[174,173,171],[173,172,170],[172,171,169],[171,171,169],[171,171,169],[172,172,170],[171,173,170],[170,171,167],[170,171,166],[170,172,167],[172,173,169],[170,172,169],[171,171,169],[168,169,166],[169,170,165],[169,168,164],[171,171,167],[169,169,167],[166,170,168],[165,169,168],[166,170,169],[169,171,169],[166,168,165],[167,169,164],[152,138,129],[153,140,131],[153,139,131],[156,143,136],[154,141,135],[157,144,136],[159,146,137],[159,147,138],[158,149,139],[159,150,141],[161,152,143],[160,150,141],[163,154,144],[164,155,145],[165,155,144],[168,159,147],[168,159,147],[169,161,149],[170,164,152],[172,167,155],[173,167,157],[169,166,157],[172,167,159],[171,164,158],[109,98,89],[115,92,82],[163,128,120],[188,147,139],[192,151,142],[202,160,152],[215,174,167],[223,184,177],[227,193,184],[229,195,190],[235,201,196],[238,205,200],[240,207,202],[243,210,205],[243,210,205],[244,209,205],[243,208,205],[245,210,207],[241,207,205],[232,199,199],[178,152,151],[114,93,94],[147,136,135],[175,170,168],[175,172,170],[170,169,167],[172,171,169],[172,172,170],[169,170,168],[170,171,169],[170,171,168],[169,170,167],[170,171,166],[171,170,165],[170,170,165],[169,170,166],[169,169,166],[168,168,165],[168,169,165],[169,169,166],[168,168,164],[168,169,165],[167,169,167],[166,169,167],[164,167,165],[166,168,163],[165,167,162],[166,168,163],[153,137,129],[153,138,129],[154,140,131],[156,140,133],[154,138,131],[156,140,129],[157,142,130],[159,144,132],[155,143,131],[159,148,137],[162,149,139],[164,151,141],[163,150,138],[164,153,140],[165,155,143],[168,158,146],[168,159,147],[169,161,148],[170,164,152],[171,165,152],[171,165,152],[172,165,154],[173,165,155],[133,120,112],[120,95,86],[166,127,118],[190,146,136],[200,154,146],[200,156,147],[207,163,154],[214,172,166],[221,182,175],[224,190,182],[228,195,188],[236,203,197],[241,208,203],[241,208,203],[241,208,203],[243,210,205],[248,213,209],[247,212,208],[247,212,208],[245,210,208],[244,208,207],[239,207,206],[210,181,183],[130,111,111],[132,118,118],[171,162,163],[174,170,169],[171,170,168],[169,169,167],[170,171,169],[170,172,169],[170,171,169],[169,169,167],[169,170,165],[168,168,162],[169,168,163],[170,169,164],[169,170,165],[169,169,166],[168,168,166],[169,169,167],[167,168,164],[167,168,163],[166,168,164],[167,169,166],[167,169,166],[165,167,162],[166,168,163],[168,170,165],[160,141,128],[160,141,132],[159,141,132],[159,141,131],[159,141,129],[161,143,129],[160,143,129],[158,145,130],[159,145,132],[160,147,135],[164,150,137],[167,152,138],[165,153,138],[168,156,140],[166,154,138],[167,157,142],[168,159,144],[170,161,146],[172,165,150],[171,164,150],[172,165,152],[173,163,154],[165,154,145],[122,101,93],[162,125,116],[185,139,129],[200,151,141],[207,159,149],[209,162,153],[211,167,158],[215,174,168],[223,184,177],[225,191,185],[229,196,191],[236,203,198],[239,206,201],[241,207,205],[239,205,203],[244,210,208],[248,214,212],[247,212,210],[248,213,210],[249,214,212],[247,213,211],[243,209,208],[242,211,209],[218,193,192],[138,118,120],[121,109,111],[159,155,154],[171,170,167],[171,171,169],[170,170,168],[171,172,170],[170,170,167],[169,169,164],[169,169,161],[169,169,162],[168,168,161],[168,169,163],[167,168,163],[167,168,164],[169,169,166],[169,169,166],[167,168,164],[165,167,162],[167,167,164],[167,167,163],[166,167,162],[168,167,163],[167,167,164],[165,167,164],[164,143,128],[165,143,130],[164,143,131],[165,146,132],[168,150,136],[165,147,133],[167,150,135],[167,152,137],[168,153,139],[169,152,137],[172,155,140],[174,157,141],[175,159,143],[176,163,147],[177,165,150],[176,167,152],[179,170,155],[183,174,159],[181,173,157],[184,175,160],[184,175,161],[178,165,154],[121,102,91],[153,115,107],[169,121,111],[188,136,125],[204,151,142],[206,156,146],[211,164,155],[215,170,162],[219,177,171],[223,185,178],[226,192,187],[230,197,192],[235,202,197],[237,204,199],[240,207,205],[240,208,205],[245,212,210],[250,217,215],[250,218,215],[252,218,217],[254,220,219],[251,218,217],[249,215,215],[247,213,212],[243,213,212],[217,193,194],[131,114,116],[93,86,87],[159,158,159],[172,172,171],[173,173,169],[173,172,168],[174,174,168],[172,172,165],[172,170,163],[173,171,163],[170,169,162],[169,169,164],[171,170,166],[170,169,165],[171,170,164],[169,169,164],[169,169,164],[169,170,165],[167,168,162],[169,169,163],[169,168,163],[170,168,164],[168,167,163],[165,165,162],[168,146,132],[168,146,132],[166,144,130],[169,150,136],[169,150,136],[170,152,138],[171,153,139],[172,155,140],[172,156,141],[173,155,141],[176,159,144],[177,160,144],[178,162,146],[179,165,150],[180,168,154],[179,170,155],[180,171,156],[183,174,159],[184,175,160],[185,175,162],[178,168,156],[107,89,77],[143,110,100],[157,109,99],[170,116,106],[193,136,127],[206,151,141],[202,150,138],[208,159,152],[212,166,160],[218,176,170],[224,186,181],[225,190,186],[228,195,190],[232,199,194],[236,203,198],[240,209,205],[243,212,209],[245,214,211],[250,217,217],[251,222,221],[254,225,223],[254,227,227],[253,229,227],[254,222,222],[250,216,216],[247,214,215],[240,211,213],[197,174,177],[108,96,100],[99,95,99],[181,178,178],[186,183,179],[188,184,179],[187,184,176],[188,185,176],[186,184,173],[185,182,173],[186,183,176],[185,181,177],[185,182,176],[185,182,177],[184,181,176],[180,179,174],[178,177,172],[180,179,174],[181,179,174],[181,178,173],[181,178,173],[180,177,172],[178,176,171],[177,176,172],[170,151,137],[171,151,137],[173,152,139],[171,153,139],[173,155,141],[175,157,143],[175,159,146],[176,160,146],[175,159,144],[179,162,146],[179,163,147],[180,165,150],[180,166,150],[183,170,155],[182,170,156],[182,173,158],[183,174,159],[184,175,160],[184,176,164],[183,175,163],[94,79,71],[125,94,84],[147,101,90],[158,103,93],[166,109,100],[178,120,110],[203,145,134],[202,147,140],[204,155,147],[209,163,157],[215,172,168],[221,184,179],[225,190,184],[229,194,189],[233,198,196],[238,204,202],[237,206,203],[244,213,210],[244,213,211],[247,217,215],[250,220,219],[254,225,225],[255,230,230],[254,232,233],[253,226,226],[251,220,218],[250,217,216],[247,216,214],[222,197,198],[152,134,137],[88,80,85],[124,120,121],[187,184,179],[189,186,179],[190,185,179],[190,186,179],[188,185,176],[188,185,178],[188,185,178],[188,185,178],[188,185,178],[187,184,177],[188,185,178],[187,184,177],[187,185,178],[186,185,178],[186,183,176],[187,184,177],[186,183,176],[187,184,177],[187,184,178],[186,182,179],[175,159,146],[173,156,143],[175,157,144],[176,158,145],[178,161,147],[178,162,148],[177,162,149],[180,165,151],[182,168,152],[180,167,151],[181,168,152],[181,169,153],[183,171,157],[184,172,159],[184,173,160],[184,175,160],[185,176,162],[185,177,163],[186,177,167],[116,105,97],[94,72,63],[144,102,95],[148,97,88],[164,106,97],[172,110,103],[173,113,104],[187,129,119],[199,145,138],[205,155,148],[210,164,158],[212,170,166],[217,180,174],[222,187,181],[226,191,186],[231,197,194],[236,202,200],[235,204,201],[244,213,210],[246,215,213],[249,218,216],[252,222,221],[254,225,225],[254,228,229],[255,232,232],[254,228,229],[253,222,221],[252,221,220],[249,218,216],[231,203,204],[190,168,171],[113,102,104],[75,70,71],[164,161,158],[191,188,181],[191,187,178],[190,186,178],[189,185,178],[190,187,180],[189,186,179],[189,186,179],[189,186,179],[189,186,179],[188,185,178],[187,184,177],[188,184,178],[188,184,178],[188,185,178],[187,184,178],[187,183,178],[188,185,179],[188,185,180],[186,184,181],[176,163,150],[178,164,151],[179,163,151],[179,164,151],[179,164,151],[181,167,154],[179,165,152],[181,168,153],[182,169,153],[184,171,155],[184,171,155],[185,172,156],[185,173,161],[186,175,163],[185,175,163],[187,178,163],[186,177,165],[187,178,168],[151,141,133],[47,31,24],[132,97,92],[143,96,89],[152,96,88],[158,97,90],[169,106,99],[175,114,107],[189,130,122],[203,148,141],[209,159,152],[213,167,161],[207,166,162],[216,180,174],[221,186,180],[221,186,182],[231,196,193],[233,199,197],[237,206,203],[241,210,207],[245,214,212],[248,217,215],[250,220,219],[252,222,222],[254,224,226],[254,228,229],[254,228,229],[255,225,226],[254,224,223],[250,219,217],[237,209,209],[199,177,179],[148,134,138],[74,66,69],[108,104,105],[191,187,184],[191,188,180],[191,187,180],[191,186,180],[190,187,180],[189,186,179],[191,188,181],[189,186,179],[190,187,180],[189,186,179],[187,184,177],[188,185,178],[189,186,179],[189,186,179],[188,184,179],[188,184,181],[188,184,181],[187,185,181],[187,186,182],[179,166,150],[181,167,154],[181,167,156],[181,167,156],[182,168,157],[183,169,158],[184,170,159],[184,170,158],[186,172,159],[186,173,157],[187,173,159],[187,173,160],[189,177,165],[188,177,165],[189,179,167],[188,178,166],[188,178,168],[188,179,170],[78,68,63],[71,46,41],[141,99,94],[142,92,86],[145,89,82],[153,94,86],[164,101,94],[171,109,102],[184,126,118],[197,143,137],[208,159,152],[210,166,159],[212,172,166],[218,180,177],[218,183,179],[226,191,187],[230,196,193],[232,198,196],[237,203,201],[241,209,206],[244,213,210],[247,216,214],[249,218,216],[252,220,222],[254,225,227],[255,227,229],[255,226,228],[255,227,226],[254,225,224],[251,221,219],[244,215,217],[214,191,192],[159,143,145],[99,90,95],[58,54,56],[186,182,180],[191,188,182],[191,188,181],[191,188,181],[191,188,181],[192,190,182],[189,189,181],[190,187,180],[190,187,180],[190,187,180],[190,187,180],[189,186,179],[188,185,178],[188,185,178],[189,186,180],[189,186,181],[188,186,182],[187,186,182],[187,186,182],[181,168,153],[183,170,156],[183,170,159],[186,172,162],[186,173,163],[186,172,162],[186,172,162],[187,173,162],[188,174,161],[188,175,161],[189,176,163],[191,177,165],[190,179,167],[190,179,167],[189,179,168],[190,180,169],[192,183,172],[191,181,172],[44,32,28],[104,70,67],[145,95,92],[149,95,88],[154,95,88],[155,95,87],[168,105,97],[178,116,108],[179,121,113],[195,141,137],[209,160,155],[214,169,163],[220,181,175],[222,184,181],[224,188,184],[227,191,188],[232,197,194],[232,198,196],[237,203,201],[240,208,205],[244,213,211],[248,217,215],[252,221,220],[254,223,225],[253,224,226],[254,226,228],[255,226,228],[254,225,226],[253,224,224],[252,222,221],[247,218,219],[227,202,203],[182,160,163],[111,98,104],[60,53,56],[157,153,152],[193,189,184],[193,190,183],[193,190,183],[192,189,182],[192,189,182],[191,190,182],[191,188,181],[192,189,182],[191,188,181],[190,187,180],[191,188,181],[190,187,180],[190,187,180],[190,187,181],[190,187,181],[188,187,182],[188,187,182],[189,188,184],[185,171,158],[184,171,158],[183,171,160],[187,174,165],[186,173,164],[186,173,164],[190,176,167],[190,176,167],[190,176,166],[192,178,167],[193,179,168],[193,179,168],[193,183,171],[194,184,173],[193,183,173],[192,184,173],[193,184,174],[174,164,155],[41,26,19],[117,81,75],[145,96,88],[148,93,83],[153,94,86],[156,94,87],[167,105,96],[187,126,119],[203,148,141],[210,161,156],[213,168,162],[213,172,166],[222,185,178],[225,187,184],[226,188,185],[220,182,181],[226,190,189],[230,196,194],[234,200,198],[238,205,203],[242,211,209],[248,217,215],[253,222,222],[255,225,227],[254,225,227],[255,227,229],[254,225,227],[254,226,228],[254,224,225],[252,222,222],[249,220,220],[233,207,207],[205,182,184],[127,111,116],[64,55,59],[134,129,130],[193,190,186],[194,191,184],[193,190,183],[193,190,183],[192,189,182],[193,190,183],[192,189,182],[193,190,183],[192,189,182],[191,188,181],[191,188,181],[192,189,182],[191,188,181],[190,187,180],[191,188,181],[189,188,182],[190,189,184],[188,187,182],[187,175,163],[187,175,163],[188,176,164],[188,175,166],[191,178,169],[191,178,169],[191,180,171],[190,180,171],[192,180,171],[193,182,173],[193,182,173],[194,183,173],[195,185,175],[194,185,175],[195,187,176],[194,187,176],[196,188,180],[139,130,124],[52,35,29],[122,81,74],[143,94,84],[147,94,82],[155,96,87],[161,101,93],[174,115,107],[194,136,128],[210,156,151],[212,164,160],[222,179,173],[220,181,177],[223,188,186],[223,188,186],[218,183,181],[217,178,178],[218,178,178],[222,187,185],[227,193,192],[232,200,198],[237,206,204],[244,215,215],[247,219,220],[252,224,228],[252,225,225],[253,226,227],[254,227,228],[254,227,228],[253,225,227],[252,222,224],[248,218,218],[242,213,214],[215,190,191],[146,126,130],[65,55,57],[111,106,107],[191,190,187],[193,191,186],[193,190,183],[194,191,184],[194,191,185],[192,190,185],[193,190,183],[194,191,184],[192,189,182],[193,190,183],[193,190,183],[193,190,183],[192,189,182],[190,188,182],[190,189,184],[187,188,182],[188,189,183],[188,189,183],[189,177,166],[190,178,167],[190,178,167],[190,179,170],[193,181,172],[193,181,172],[193,182,173],[193,183,175],[192,183,176],[195,186,178],[195,185,176],[196,187,176],[196,187,177],[197,188,177],[197,189,178],[197,190,180],[197,189,180],[114,105,99],[60,39,34],[126,84,76],[144,95,85],[146,92,80],[149,93,82],[164,107,98],[171,114,106],[187,130,124],[204,152,148],[202,154,151],[215,171,166],[219,179,177],[222,186,184],[223,189,186],[222,185,184],[210,169,170],[206,165,165],[216,177,177],[223,187,187],[229,196,195],[234,204,203],[232,204,204],[233,208,209],[233,209,212],[235,210,213],[239,217,219],[238,216,217],[246,223,224],[249,225,226],[250,222,222],[249,219,220],[246,216,217],[226,200,200],[157,136,139],[69,57,60],[98,92,93],[193,191,187],[195,192,187],[195,192,185],[195,192,185],[195,193,187],[193,192,187],[194,192,186],[194,191,185],[195,192,185],[194,191,184],[195,192,185],[194,191,184],[192,190,184],[191,189,184],[190,190,185],[189,190,185],[188,189,184],[189,190,185],[192,179,170],[193,180,171],[195,182,173],[193,183,174],[194,184,175],[193,183,174],[196,184,176],[195,186,178],[195,186,179],[196,187,180],[197,188,179],[197,189,178],[198,190,179],[199,191,180],[200,192,181],[197,190,180],[197,189,180],[96,87,81],[65,43,37],[130,87,79],[141,92,82],[146,95,85],[149,98,89],[153,102,94],[157,105,100],[169,118,113],[184,137,134],[197,152,149],[205,162,159],[209,168,167],[218,177,178],[223,187,185],[218,180,179],[203,161,162],[197,155,156],[202,163,163],[202,164,164],[204,171,171],[204,175,174],[162,138,140],[168,146,150],[170,150,155],[186,165,171],[182,164,169],[179,161,166],[194,174,179],[232,212,215],[242,217,218],[246,217,219],[246,216,217],[237,210,209],[179,155,155],[76,60,62],[86,80,80],[194,190,187],[196,192,188],[196,193,186],[195,192,185],[196,194,188],[194,193,188],[193,192,187],[194,192,186],[195,192,185],[195,192,185],[195,192,185],[194,191,184],[192,191,186],[191,191,186],[190,191,186],[190,191,186],[190,191,186],[190,191,186],[192,182,172],[195,185,175],[194,184,174],[195,185,176],[195,185,176],[196,186,177],[198,188,179],[197,188,180],[199,190,183],[199,190,183],[198,190,181],[199,191,180],[199,191,180],[199,191,180],[201,193,182],[198,192,180],[200,191,184],[84,76,72],[81,57,51],[135,93,86],[139,93,86],[129,87,79],[112,72,67],[110,73,67],[116,76,72],[122,82,79],[136,97,94],[159,119,118],[173,133,132],[177,137,137],[198,158,158],[214,175,174],[204,165,165],[179,136,137],[170,127,129],[171,132,133],[141,105,109],[140,109,112],[108,81,84],[70,46,50],[61,42,46],[65,48,54],[90,73,79],[98,81,88],[107,92,99],[119,103,113],[138,120,129],[181,159,164],[233,207,211],[243,213,213],[242,213,211],[200,173,175],[76,58,60],[85,77,75],[193,190,185],[196,193,187],[196,193,186],[197,194,187],[196,194,188],[195,194,189],[194,193,189],[195,194,190],[195,194,189],[196,193,188],[195,193,188],[193,192,187],[191,192,186],[191,192,187],[191,192,187],[191,192,187],[191,192,187],[190,192,187],[194,184,175],[195,185,176],[195,185,176],[196,186,177],[196,186,178],[198,188,180],[198,190,181],[198,189,181],[198,189,182],[200,191,184],[200,191,183],[200,191,181],[200,192,182],[200,192,182],[200,193,182],[199,193,182],[201,193,185],[89,81,76],[93,69,61],[129,91,84],[115,79,73],[71,44,41],[47,28,26],[43,26,23],[46,27,26],[56,35,35],[61,40,39],[76,52,50],[90,60,60],[117,80,80],[147,109,108],[189,148,148],[186,144,145],[165,120,122],[135,91,94],[113,73,75],[101,64,68],[85,53,57],[73,45,49],[49,25,28],[37,17,21],[34,16,21],[40,23,27],[51,34,39],[60,43,51],[78,60,70],[97,79,88],[110,88,96],[171,145,149],[237,209,208],[241,212,209],[195,169,170],[82,64,65],[81,72,70],[195,192,187],[197,194,189],[198,195,189],[199,196,190],[198,196,190],[196,195,190],[194,193,189],[195,194,189],[195,194,189],[195,193,188],[194,193,188],[194,193,188],[193,193,187],[192,193,188],[192,192,188],[192,193,189],[191,193,189],[190,192,188],[196,186,177],[196,186,177],[196,186,177],[197,187,178],[198,189,181],[198,189,182],[199,190,183],[200,191,184],[199,190,183],[199,190,183],[200,191,183],[200,191,182],[200,193,183],[200,193,183],[201,194,184],[201,194,184],[200,193,184],[99,91,87],[96,72,66],[113,84,77],[55,30,25],[30,15,13],[24,12,14],[22,10,13],[23,12,14],[24,11,13],[28,12,14],[32,14,15],[37,15,16],[60,29,28],[93,57,55],[138,97,97],[147,105,106],[147,101,103],[116,72,75],[97,55,59],[85,44,50],[81,45,48],[80,45,48],[67,36,39],[57,27,31],[58,28,33],[64,37,41],[82,56,59],[102,77,83],[120,95,103],[133,109,117],[134,109,117],[150,124,128],[223,196,197],[239,210,211],[190,165,167],[82,64,66],[88,77,76],[195,192,187],[198,195,190],[198,195,190],[198,195,190],[198,196,191],[197,196,191],[195,194,190],[195,194,190],[195,194,189],[194,193,188],[194,193,188],[194,193,188],[194,194,188],[193,193,189],[193,193,191],[193,194,191],[192,194,191],[192,194,191],[196,186,177],[196,187,178],[197,188,179],[197,188,181],[198,190,182],[198,191,183],[200,191,184],[199,190,183],[200,191,182],[199,192,182],[200,193,184],[201,194,186],[201,194,186],[201,195,187],[200,196,187],[199,195,186],[200,194,186],[122,114,110],[92,72,66],[72,48,44],[33,14,14],[26,13,14],[28,15,17],[29,15,19],[28,14,18],[29,14,17],[30,14,18],[37,18,23],[45,21,22],[50,21,20],[67,32,31],[95,56,56],[112,70,70],[136,90,92],[126,80,82],[115,68,73],[106,60,63],[116,67,72],[116,68,74],[106,60,64],[104,61,65],[103,63,69],[114,78,85],[134,99,106],[162,128,134],[173,141,146],[164,133,139],[154,124,129],[156,127,131],[209,180,183],[238,209,211],[187,162,164],[83,65,66],[109,99,98],[195,192,187],[199,195,191],[199,195,192],[197,196,192],[197,196,192],[196,195,191],[196,195,190],[196,195,190],[196,195,190],[195,194,189],[194,193,188],[194,195,189],[194,195,190],[193,194,189],[192,194,189],[192,194,191],[192,194,191],[192,194,191],[196,187,179],[197,188,180],[198,189,181],[198,189,182],[198,190,183],[199,192,185],[200,191,185],[199,190,183],[200,191,182],[200,193,183],[200,193,185],[201,194,187],[201,195,188],[201,195,188],[200,195,188],[200,196,188],[200,196,188],[147,140,135],[77,60,57],[63,42,40],[47,26,24],[54,36,35],[65,45,46],[74,52,55],[73,51,54],[71,50,53],[65,42,47],[61,35,38],[64,37,37],[67,38,37],[75,40,38],[92,51,51],[117,73,74],[163,116,119],[178,132,134],[153,107,110],[134,85,89],[119,67,71],[99,45,50],[86,35,40],[88,43,49],[112,74,80],[156,122,129],[162,131,137],[134,98,104],[159,119,126],[185,147,153],[182,149,154],[182,153,156],[214,185,187],[235,207,209],[189,165,167],[76,58,60],[123,111,111],[199,195,191],[200,196,192],[199,195,192],[197,196,192],[197,196,192],[196,195,191],[197,196,191],[195,194,189],[197,196,191],[196,196,190],[196,196,190],[195,196,190],[194,195,190],[194,196,191],[193,195,190],[193,195,191],[193,195,192],[192,194,191],[197,188,181],[197,188,181],[198,189,182],[198,189,182],[200,192,185],[199,192,186],[201,192,187],[200,191,184],[201,192,183],[199,192,182],[201,194,186],[202,195,189],[200,195,189],[201,196,190],[200,195,189],[200,197,190],[200,196,189],[177,169,163],[65,48,43],[78,56,51],[67,42,38],[78,50,49],[87,60,58],[85,58,61],[73,49,53],[61,42,44],[55,35,37],[54,31,31],[50,25,25],[53,22,22],[68,29,29],[100,55,57],[151,105,107],[218,173,175],[244,202,203],[225,182,183],[149,100,103],[95,45,48],[86,34,38],[88,41,47],[76,35,40],[53,21,27],[53,26,35],[103,75,83],[170,133,142],[146,105,112],[156,115,121],[197,161,165],[202,173,175],[222,193,195],[233,208,208],[194,173,175],[73,55,57],[145,132,132],[204,195,193],[202,195,193],[200,196,193],[198,197,193],[197,196,192],[198,197,193],[197,196,192],[197,196,191],[197,196,191],[195,196,190],[195,196,191],[196,197,192],[194,195,190],[194,196,191],[193,195,190],[194,196,191],[194,196,192],[194,196,193],[197,188,181],[198,189,182],[199,190,183],[200,191,184],[199,191,185],[200,193,187],[201,194,188],[200,193,186],[200,193,185],[202,195,187],[203,196,189],[203,196,190],[201,196,190],[200,195,189],[201,196,190],[201,197,188],[201,197,187],[206,195,186],[76,57,53],[89,62,55],[83,52,46],[93,58,54],[78,48,47],[71,43,46],[47,25,30],[31,13,17],[34,16,20],[40,21,24],[49,24,26],[52,22,21],[64,26,23],[101,55,54],[179,129,130],[241,194,196],[255,216,216],[248,207,209],[177,132,134],[105,58,60],[85,36,40],[102,56,62],[83,43,51],[43,14,19],[56,29,35],[127,101,108],[130,94,102],[136,95,101],[156,115,121],[196,159,163],[217,187,189],[227,200,201],[232,206,207],[205,181,184],[84,63,68],[185,168,171],[217,200,200],[213,199,198],[202,196,193],[200,197,193],[199,197,192],[197,198,193],[197,198,192],[197,198,192],[197,198,192],[197,196,191],[196,196,191],[196,197,192],[196,197,192],[195,197,192],[195,197,192],[194,196,191],[194,196,192],[195,197,194],[197,188,181],[198,189,182],[199,190,182],[200,191,184],[202,194,188],[200,193,187],[200,193,187],[201,194,187],[201,194,186],[202,195,187],[202,195,187],[202,195,188],[200,195,189],[201,196,190],[201,196,190],[202,198,189],[203,196,187],[211,195,188],[109,88,83],[114,80,72],[106,68,61],[92,54,48],[65,30,27],[55,28,29],[60,41,43],[30,14,17],[31,14,18],[49,30,32],[62,36,38],[52,21,20],[75,32,30],[113,62,62],[195,141,143],[235,188,190],[253,212,214],[249,209,210],[232,191,192],[177,132,135],[103,55,60],[112,63,71],[109,65,74],[103,67,74],[117,84,91],[191,162,169],[206,171,178],[203,165,170],[208,172,176],[209,176,180],[227,197,198],[234,207,208],[235,208,209],[215,190,193],[129,108,113],[243,214,220],[239,204,209],[216,182,187],[207,194,192],[201,197,192],[198,197,193],[198,199,194],[197,198,193],[198,199,193],[197,198,192],[198,198,192],[197,198,192],[197,198,193],[196,197,192],[196,197,193],[195,197,193],[195,197,193],[195,197,194],[195,197,194],[199,190,183],[199,190,182],[198,189,180],[201,192,184],[200,192,187],[201,194,188],[201,194,188],[202,195,188],[202,195,187],[203,196,188],[202,195,187],[202,195,187],[201,196,190],[202,197,191],[202,197,191],[204,196,189],[199,183,176],[124,96,91],[94,63,59],[122,85,76],[112,71,64],[96,55,48],[80,43,37],[72,42,38],[76,48,49],[55,30,34],[58,33,37],[68,41,44],[67,34,37],[67,27,28],[95,46,45],[130,75,75],[201,144,146],[234,186,189],[252,210,213],[246,206,207],[246,205,206],[220,174,179],[163,116,122],[138,88,97],[139,88,97],[148,102,109],[164,123,130],[188,152,157],[207,173,178],[226,192,196],[235,203,206],[237,207,209],[240,212,211],[241,212,213],[239,210,212],[230,201,203],[176,151,154],[241,205,211],[195,145,154],[173,107,121],[208,195,191],[202,199,193],[199,198,194],[198,199,194],[199,200,195],[197,198,193],[197,198,193],[198,199,193],[197,198,192],[197,198,192],[197,198,193],[197,198,194],[196,198,195],[196,198,195],[196,198,195],[196,198,195],[199,190,183],[200,191,183],[200,191,182],[199,192,184],[200,193,185],[201,194,186],[202,195,189],[202,195,189],[201,194,188],[203,196,190],[202,196,190],[201,196,190],[201,196,190],[202,197,191],[205,197,191],[208,196,188],[178,155,150],[118,76,76],[83,46,44],[132,89,82],[121,77,69],[110,66,56],[104,62,56],[98,58,56],[89,52,50],[87,52,52],[96,61,64],[91,52,54],[85,45,46],[97,49,51],[119,65,63],[133,72,72],[195,136,139],[236,187,190],[253,211,215],[247,206,210],[249,208,211],[250,209,214],[232,192,197],[198,153,160],[171,125,133],[167,121,129],[180,140,146],[199,162,167],[220,187,190],[236,206,208],[240,210,212],[242,213,215],[246,218,217],[243,215,214],[240,212,211],[236,207,208],[191,161,163],[232,194,199],[228,177,187],[182,110,126],[211,195,192],[202,198,195],[201,199,195],[199,200,195],[199,200,195],[198,199,195],[198,198,196],[199,199,195],[198,199,194],[197,198,193],[199,200,195],[197,199,194],[196,198,195],[196,198,195],[197,199,196],[197,199,196],[198,190,183],[199,191,183],[200,192,183],[200,193,185],[201,194,186],[202,195,188],[200,193,187],[202,195,189],[202,195,189],[202,196,190],[202,197,191],[203,198,192],[202,198,192],[202,198,191],[203,196,190],[208,195,188],[173,146,140],[104,55,53],[97,54,50],[138,89,79],[129,82,71],[124,76,67],[117,70,64],[111,66,60],[105,60,57],[115,69,67],[130,85,83],[128,79,80],[118,69,68],[128,73,72],[134,74,73],[138,75,75],[201,141,144],[242,193,196],[254,213,218],[249,208,213],[249,208,212],[252,214,217],[253,219,222],[244,208,212],[214,177,182],[209,172,176],[229,195,198],[235,204,207],[240,211,213],[246,219,219],[247,220,220],[247,220,220],[247,220,218],[245,217,215],[239,211,209],[237,205,206],[203,168,171],[253,219,222],[243,192,201],[193,121,137],[214,196,195],[203,199,196],[201,199,195],[199,200,195],[200,201,196],[200,200,196],[199,199,197],[198,199,195],[198,200,195],[198,200,195],[199,200,196],[198,200,196],[197,199,196],[198,200,197],[198,200,197],[197,199,196],[199,192,184],[200,193,185],[201,194,186],[201,194,186],[201,194,187],[202,195,189],[201,194,188],[202,195,189],[203,196,190],[201,196,190],[202,197,191],[201,196,190],[201,198,191],[202,199,192],[203,197,191],[209,196,189],[158,127,123],[110,57,56],[114,64,59],[138,89,79],[134,86,74],[131,82,74],[132,83,78],[135,85,81],[138,89,85],[154,101,98],[155,102,99],[137,83,81],[133,78,74],[135,76,71],[140,76,73],[141,77,75],[194,132,134],[242,195,196],[254,213,220],[250,209,215],[250,208,212],[251,213,216],[251,217,221],[250,219,221],[245,213,216],[237,203,207],[231,199,202],[236,206,208],[244,215,217],[245,217,216],[248,220,219],[250,222,221],[245,217,215],[245,217,214],[238,210,207],[236,201,201],[183,142,145],[230,183,189],[247,198,207],[185,127,139],[212,196,196],[204,200,197],[203,201,197],[200,201,196],[201,202,197],[200,200,196],[200,200,198],[199,201,198],[199,201,197],[199,201,196],[198,200,197],[198,200,197],[198,200,197],[197,199,196],[198,200,197],[198,200,197],[199,192,184],[200,193,186],[200,193,187],[201,194,188],[202,195,189],[202,195,189],[201,196,190],[201,196,190],[201,196,190],[202,197,191],[202,197,191],[202,197,191],[202,199,192],[203,200,193],[204,198,192],[208,197,189],[169,140,135],[117,65,64],[112,63,58],[137,89,80],[135,88,79],[138,88,81],[138,87,80],[147,91,87],[151,97,91],[156,101,95],[159,103,96],[142,84,80],[140,80,76],[140,77,72],[140,75,71],[146,81,78],[206,148,149],[241,194,197],[250,209,213],[248,207,211],[247,206,210],[246,208,211],[248,212,214],[251,219,221],[247,215,218],[246,214,217],[242,212,214],[236,206,208],[238,208,210],[240,211,212],[241,212,212],[246,218,215],[242,214,211],[238,210,207],[235,205,203],[230,196,194],[190,148,149],[212,166,169],[243,197,204],[217,177,184],[210,198,198],[204,201,198],[201,202,197],[201,202,197],[201,202,197],[200,202,198],[200,202,199],[199,201,198],[199,201,198],[200,202,198],[199,201,198],[199,201,198],[199,201,198],[199,201,198],[198,200,197],[199,201,198],[200,193,185],[201,194,187],[201,194,188],[201,195,189],[201,195,189],[202,196,190],[201,196,190],[202,197,191],[202,197,191],[202,197,191],[202,197,191],[202,197,191],[202,199,192],[202,199,192],[204,199,193],[209,197,193],[198,172,171],[118,71,73],[109,61,58],[133,86,80],[130,83,76],[137,87,80],[132,81,74],[142,86,81],[157,100,93],[166,108,102],[156,97,92],[147,87,83],[139,78,73],[135,72,67],[138,73,70],[172,109,106],[216,158,159],[239,193,196],[250,209,213],[249,208,212],[246,205,209],[243,203,207],[237,200,203],[243,210,212],[243,211,213],[245,213,215],[243,212,215],[243,212,214],[239,208,210],[235,206,207],[234,205,204],[238,210,207],[237,209,206],[235,207,204],[233,203,201],[223,189,187],[218,176,178],[215,169,172],[240,200,205],[227,200,202],[209,198,197],[204,201,198],[202,203,198],[202,203,199],[201,202,198],[201,202,199],[200,201,199],[200,201,198],[201,203,200],[200,202,199],[200,202,199],[201,203,200],[200,202,199],[200,202,199],[200,202,199],[199,201,198],[200,193,185],[200,193,186],[201,194,188],[200,195,189],[200,195,189],[200,195,189],[201,196,190],[202,197,191],[201,196,190],[202,197,191],[204,199,193],[203,198,192],[202,199,192],[203,200,193],[203,200,193],[206,199,193],[215,195,193],[124,81,83],[100,52,52],[128,80,77],[127,80,73],[130,80,73],[134,83,75],[142,86,79],[160,103,96],[167,109,103],[153,94,90],[145,86,83],[133,73,70],[133,72,70],[145,81,81],[179,117,117],[213,155,159],[232,182,186],[251,209,213],[252,211,215],[247,206,210],[244,204,207],[236,197,200],[228,190,193],[238,202,204],[245,210,211],[248,215,218],[248,216,218],[244,212,213],[240,210,210],[235,206,205],[234,206,203],[232,204,201],[234,206,203],[230,200,198],[210,175,175],[217,177,179],[226,185,186],[240,206,209],[224,202,203],[210,200,198],[205,202,198],[202,203,199],[202,202,200],[202,202,200],[202,202,200],[202,202,200],[201,203,200],[201,203,200],[201,203,200],[201,203,200],[201,203,200],[201,203,200],[201,203,200],[201,203,200],[200,202,199],[200,193,185],[201,194,187],[202,195,189],[200,195,189],[199,194,188],[201,196,190],[201,196,190],[202,197,191],[202,197,191],[202,197,191],[202,198,191],[202,199,192],[202,199,192],[202,199,192],[202,199,192],[206,200,194],[210,196,191],[143,106,106],[94,48,47],[116,69,65],[131,83,79],[130,80,74],[134,82,74],[141,86,79],[158,101,95],[157,99,95],[147,89,87],[137,78,80],[123,64,65],[137,78,78],[137,75,77],[152,90,93],[183,125,129],[209,156,161],[228,180,186],[232,185,190],[231,186,191],[237,195,199],[239,199,203],[222,182,185],[216,177,180],[237,200,202],[245,211,212],[245,211,212],[244,213,213],[241,213,210],[237,209,206],[232,204,201],[231,203,200],[231,203,200],[226,196,194],[201,166,164],[218,179,179],[245,205,206],[239,205,207],[220,201,202],[207,200,198],[203,204,199],[203,204,200],[203,203,201],[202,202,200],[202,203,200],[202,204,201],[202,204,201],[202,204,201],[201,203,200],[202,204,201],[201,203,200],[202,204,201],[202,204,201],[202,204,201],[201,203,200],[200,193,186],[201,194,187],[201,195,189],[200,195,189],[200,196,190],[201,197,190],[201,197,190],[202,198,191],[202,197,191],[203,198,192],[203,199,192],[203,199,192],[202,199,192],[203,200,193],[204,201,194],[206,200,194],[210,198,192],[150,117,115],[106,61,59],[105,59,54],[127,79,75],[133,84,79],[135,85,77],[140,87,80],[150,94,91],[148,91,89],[140,82,80],[120,61,63],[119,60,63],[133,75,79],[124,67,72],[123,64,70],[139,82,87],[170,114,121],[212,158,166],[199,147,155],[191,143,149],[218,171,177],[234,190,195],[229,188,193],[203,162,166],[218,178,182],[239,204,205],[245,211,211],[241,211,210],[239,211,208],[237,209,206],[233,205,202],[230,202,199],[226,197,194],[214,185,182],[191,157,155],[230,193,193],[243,204,206],[240,210,211],[218,201,201],[208,203,200],[204,205,200],[203,204,200],[204,204,201],[203,204,202],[203,205,202],[203,205,202],[203,205,202],[203,205,202],[202,204,201],[202,204,201],[203,205,202],[203,205,202],[202,204,201],[202,204,201],[202,204,201],[200,193,187],[200,194,188],[200,195,189],[200,195,189],[200,196,190],[201,198,191],[200,197,190],[201,197,191],[203,198,192],[203,198,192],[203,198,192],[203,198,192],[202,199,192],[204,201,194],[204,201,194],[205,199,193],[210,198,193],[157,124,123],[118,73,70],[88,42,38],[124,77,71],[132,85,79],[132,85,78],[141,89,83],[145,90,87],[144,86,85],[135,75,75],[116,58,57],[118,60,61],[114,58,61],[93,41,46],[85,32,39],[114,60,69],[130,74,83],[169,113,122],[108,56,63],[90,41,47],[153,105,111],[222,178,182],[234,193,199],[215,175,179],[205,166,169],[228,194,193],[240,208,206],[242,213,210],[240,212,209],[235,207,204],[234,206,203],[230,202,199],[220,192,188],[213,184,180],[193,158,156],[240,206,206],[248,215,216],[245,219,220],[219,204,202],[207,203,200],[204,205,200],[204,205,200],[205,206,201],[204,206,202],[204,206,203],[203,205,202],[203,205,202],[204,206,203],[204,206,203],[204,206,203],[204,206,203],[203,205,202],[204,206,203],[202,204,201],[203,205,202],[199,194,188],[200,195,189],[199,194,188],[200,195,191],[200,196,192],[200,197,192],[201,198,192],[202,199,193],[203,199,193],[203,198,194],[203,198,193],[204,199,193],[203,200,195],[203,200,195],[204,201,196],[206,200,194],[211,198,193],[167,136,133],[130,86,83],[90,45,41],[115,70,65],[128,84,79],[129,83,78],[134,85,81],[140,85,83],[138,82,81],[128,71,70],[117,61,58],[117,65,61],[110,61,61],[90,43,48],[88,43,50],[99,50,59],[119,68,75],[130,75,82],[116,63,68],[112,61,66],[176,129,135],[240,199,203],[237,201,205],[228,193,195],[213,178,177],[219,188,186],[231,200,198],[240,211,208],[241,213,212],[234,207,205],[230,204,201],[230,202,199],[222,193,189],[206,175,170],[189,154,153],[247,214,215],[250,220,223],[241,217,219],[216,203,203],[208,203,202],[205,206,203],[205,207,203],[205,207,204],[204,206,203],[204,206,202],[204,206,201],[204,206,203],[205,207,205],[205,207,206],[203,206,205],[202,206,205],[202,206,204],[202,206,205],[203,206,204],[204,206,203],[200,195,189],[199,194,188],[200,195,189],[200,195,190],[201,197,192],[200,197,192],[201,198,193],[201,198,193],[202,199,193],[203,198,194],[203,198,193],[204,199,193],[203,200,194],[203,200,194],[204,201,195],[206,200,195],[210,199,194],[166,140,136],[133,92,88],[89,49,44],[99,60,54],[122,80,75],[128,84,79],[137,89,85],[138,88,85],[130,79,77],[120,67,66],[120,69,65],[118,71,66],[100,57,54],[74,36,37],[66,28,33],[83,43,49],[110,64,68],[128,78,83],[142,93,96],[161,114,117],[214,172,175],[231,195,196],[230,197,198],[232,199,199],[231,198,197],[226,195,193],[228,197,195],[232,204,202],[239,211,210],[235,207,206],[227,201,198],[222,194,191],[207,178,174],[197,167,163],[172,142,140],[210,180,182],[221,196,198],[219,201,202],[213,205,204],[207,206,204],[206,208,205],[206,208,205],[204,206,203],[205,207,204],[205,207,203],[205,207,203],[205,207,203],[205,208,205],[205,208,206],[203,207,206],[203,207,206],[203,207,206],[202,207,204],[203,207,204],[204,207,203],[200,195,189],[200,195,189],[200,195,189],[199,194,188],[201,197,191],[201,198,193],[201,198,193],[202,199,194],[202,199,194],[203,198,194],[203,198,193],[204,199,193],[203,200,193],[204,201,194],[204,201,194],[205,200,196],[208,200,195],[180,161,158],[121,89,85],[88,52,49],[86,51,48],[112,74,69],[121,82,76],[129,86,81],[132,85,82],[126,78,76],[120,71,70],[103,55,51],[91,49,43],[80,43,39],[63,27,27],[66,28,33],[91,52,57],[111,66,69],[122,73,77],[153,103,106],[170,125,126],[179,139,139],[199,164,161],[204,170,168],[212,176,176],[224,186,187],[229,197,196],[228,198,197],[227,199,198],[233,205,204],[231,203,202],[226,198,197],[222,194,190],[208,179,175],[192,163,159],[180,156,153],[206,188,188],[198,184,185],[209,202,200],[209,208,205],[207,208,206],[207,209,206],[206,208,205],[205,207,204],[206,208,205],[206,208,205],[206,208,205],[207,209,206],[205,208,205],[204,209,205],[204,208,207],[204,208,207],[204,208,207],[204,209,205],[203,208,204],[203,208,204],[199,196,189],[200,197,191],[200,197,189],[200,197,192],[201,198,193],[200,197,192],[201,198,193],[202,198,193],[203,198,194],[204,199,193],[204,199,193],[204,199,193],[203,200,193],[204,201,194],[204,201,194],[204,201,196],[206,202,196],[210,200,194],[161,142,136],[112,85,82],[82,52,50],[92,58,54],[116,77,73],[125,83,79],[128,83,80],[116,71,69],[93,51,49],[75,35,33],[73,33,33],[74,37,39],[69,32,34],[91,51,55],[157,110,116],[160,112,115],[132,80,84],[185,132,137],[204,154,156],[187,141,143],[194,153,154],[195,155,156],[171,131,132],[172,133,134],[202,167,165],[230,198,196],[227,198,196],[225,199,196],[228,202,198],[228,200,197],[226,198,194],[213,186,182],[192,167,163],[184,167,163],[213,204,203],[211,206,206],[210,207,206],[207,209,206],[207,209,206],[207,209,206],[207,209,206],[207,209,206],[208,210,207],[208,210,207],[206,208,205],[207,209,206],[207,209,206],[207,209,206],[205,209,208],[205,209,208],[204,208,207],[204,209,205],[205,209,207],[205,208,207],[199,196,190],[200,197,191],[200,197,190],[200,197,192],[201,198,193],[201,198,193],[202,199,194],[201,198,192],[203,199,193],[204,199,193],[204,199,193],[205,200,194],[204,201,194],[204,201,195],[205,202,196],[205,202,197],[205,201,197],[206,201,197],[207,199,195],[159,142,139],[83,57,53],[75,43,38],[103,65,61],[119,78,74],[116,76,73],[92,51,49],[71,32,29],[82,42,41],[88,47,48],[100,60,64],[109,62,69],[130,80,87],[177,121,130],[216,156,165],[208,146,155],[198,138,146],[211,154,162],[224,172,179],[229,181,187],[208,161,166],[165,121,125],[148,105,107],[156,116,116],[207,173,171],[226,196,194],[225,197,194],[223,195,192],[213,185,182],[212,183,178],[211,183,178],[185,161,157],[198,186,182],[211,208,205],[209,209,207],[208,210,207],[207,210,207],[208,210,207],[207,209,206],[207,209,206],[209,211,208],[208,210,207],[208,210,207],[208,210,207],[208,210,207],[207,209,206],[206,210,206],[206,210,208],[206,210,208],[205,210,207],[205,209,207],[204,209,207],[204,209,208],[200,197,192],[200,197,192],[200,197,192],[201,198,193],[201,198,193],[200,197,192],[202,199,194],[202,199,193],[202,199,192],[205,200,194],[205,200,194],[205,200,194],[204,201,194],[205,202,196],[204,201,196],[205,202,197],[205,202,197],[205,202,197],[206,201,197],[170,158,154],[92,72,66],[79,50,44],[92,56,51],[109,70,65],[107,67,65],[84,44,42],[84,44,42],[88,48,48],[81,38,40],[91,45,52],[88,35,45],[88,29,40],[97,32,44],[116,47,62],[127,57,73],[117,48,64],[119,53,68],[129,69,82],[151,96,107],[159,107,117],[122,74,79],[129,81,84],[156,114,114],[185,148,148],[228,197,195],[223,193,191],[217,186,183],[202,170,164],[211,179,174],[209,178,174],[174,153,149],[207,196,192],[210,208,205],[208,209,206],[208,210,207],[208,210,207],[208,210,207],[207,209,206],[207,209,206],[208,210,207],[208,210,207],[209,211,208],[209,211,208],[209,211,208],[207,211,207],[206,211,207],[206,211,207],[206,211,207],[206,211,207],[206,210,208],[205,209,208],[205,209,208],[199,196,189],[199,196,189],[200,197,190],[200,197,190],[201,198,192],[201,198,193],[201,198,193],[202,199,194],[203,200,195],[203,200,193],[203,200,193],[203,200,193],[204,201,194],[205,202,196],[204,201,196],[205,202,197],[204,202,197],[204,203,198],[206,202,198],[189,179,174],[82,63,59],[79,51,44],[84,51,45],[96,61,57],[110,70,70],[105,65,65],[94,54,54],[91,48,49],[78,33,35],[84,34,38],[94,38,45],[107,44,54],[132,62,76],[144,72,88],[167,94,111],[197,127,145],[229,164,181],[220,159,175],[206,151,164],[189,139,148],[156,110,116],[127,82,84],[154,113,113],[199,161,160],[221,188,184],[215,183,180],[197,165,159],[198,164,156],[206,170,164],[192,161,156],[177,156,152],[212,203,199],[210,209,206],[210,210,208],[210,212,209],[209,211,208],[209,211,208],[208,210,207],[208,210,207],[209,211,208],[208,210,207],[209,211,208],[209,211,208],[207,212,208],[207,211,207],[206,211,207],[206,211,207],[207,212,208],[206,211,207],[206,210,209],[205,209,208],[205,209,208],[199,196,189],[199,196,189],[199,196,189],[201,198,191],[201,198,192],[201,198,193],[201,198,193],[202,199,194],[202,199,194],[203,200,194],[203,200,194],[203,200,193],[204,201,195],[205,202,196],[204,201,196],[204,202,197],[202,201,196],[204,203,198],[206,202,198],[190,182,177],[97,79,74],[77,50,46],[82,50,47],[87,53,50],[99,60,59],[105,65,65],[99,58,58],[107,60,62],[115,66,68],[119,66,69],[123,64,71],[151,87,96],[183,114,126],[203,130,147],[209,137,154],[218,149,165],[234,172,188],[240,185,198],[238,189,200],[231,187,193],[229,188,192],[200,159,160],[186,145,145],[204,165,161],[213,175,169],[202,166,159],[177,140,133],[197,160,152],[192,155,149],[178,146,140],[184,164,159],[215,208,203],[211,211,208],[210,211,209],[210,212,209],[210,212,209],[210,212,209],[210,212,209],[210,212,209],[210,212,209],[209,212,209],[209,212,210],[209,212,210],[207,211,208],[207,211,209],[207,211,209],[207,212,209],[207,212,209],[206,211,208],[207,211,209],[206,210,209],[205,209,208],[199,196,189],[199,196,189],[200,197,190],[200,197,192],[201,198,193],[201,198,193],[200,197,192],[202,199,194],[202,199,194],[203,200,195],[202,199,193],[204,201,194],[204,201,196],[205,202,197],[205,202,197],[203,202,197],[203,202,197],[204,203,198],[206,203,198],[200,195,190],[120,105,99],[76,53,48],[75,46,43],[77,46,43],[91,53,52],[91,52,52],[106,63,64],[115,66,69],[122,73,76],[125,71,76],[127,70,73],[130,69,74],[128,67,73],[125,61,71],[129,65,75],[142,81,91],[180,123,134],[217,167,175],[230,187,193],[234,193,197],[234,195,197],[228,190,191],[213,173,172],[206,167,162],[203,164,157],[179,139,133],[175,134,128],[193,152,146],[183,145,138],[157,124,118],[196,179,173],[213,209,203],[211,212,208],[211,213,210],[210,212,209],[210,212,209],[210,212,209],[211,213,210],[210,212,209],[210,212,209],[209,212,211],[208,212,211],[209,213,212],[207,211,210],[207,211,210],[207,211,210],[207,211,210],[207,211,210],[207,211,210],[206,210,209],[206,210,209],[206,210,209],[199,196,189],[200,197,191],[200,197,192],[200,197,192],[201,198,193],[201,198,193],[201,198,193],[201,198,193],[203,200,195],[202,199,194],[202,199,194],[204,201,195],[204,201,196],[204,201,196],[205,202,197],[206,203,198],[205,203,198],[204,203,198],[205,202,197],[207,202,198],[171,162,156],[68,50,46],[63,37,33],[81,50,48],[85,51,49],[89,50,50],[105,62,64],[114,67,67],[123,73,73],[122,70,70],[122,67,69],[127,72,74],[127,74,75],[118,65,67],[120,66,70],[144,89,95],[188,133,141],[216,168,174],[219,177,181],[228,189,192],[226,189,190],[222,186,185],[220,182,178],[202,165,157],[197,155,149],[184,142,135],[188,142,137],[194,150,145],[165,126,120],[160,130,126],[212,199,193],[214,211,207],[211,213,209],[211,213,210],[211,213,210],[211,213,210],[211,213,210],[209,213,210],[209,214,211],[209,213,212],[209,213,212],[208,212,211],[209,213,212],[209,213,212],[208,212,211],[208,212,211],[206,212,210],[207,212,210],[207,211,210],[207,211,210],[207,211,210],[206,210,209],[199,196,190],[199,196,191],[200,197,192],[200,197,192],[201,197,193],[201,198,194],[201,198,193],[201,198,193],[202,199,194],[203,200,195],[203,200,195],[203,200,195],[204,201,196],[204,201,196],[205,202,197],[205,202,197],[205,203,198],[204,203,198],[205,202,197],[206,203,198],[200,194,188],[88,75,71],[63,40,37],[75,45,44],[80,47,45],[87,49,48],[102,60,60],[107,61,62],[116,66,65],[122,71,69],[125,72,69],[126,75,71],[126,78,75],[113,67,66],[129,82,84],[162,113,117],[177,124,132],[207,160,166],[223,182,187],[229,189,193],[225,187,188],[217,181,178],[210,172,168],[199,161,154],[195,153,147],[191,144,138],[202,153,149],[175,129,125],[154,115,112],[173,154,150],[215,210,205],[214,213,210],[212,213,210],[212,214,211],[213,215,212],[212,215,212],[210,213,210],[210,214,211],[210,214,212],[210,214,213],[209,213,212],[209,213,212],[209,213,212],[208,213,210],[208,212,210],[209,213,212],[207,212,211],[207,212,211],[207,211,210],[207,211,210],[207,211,210],[206,211,210],[199,196,191],[199,196,191],[200,197,192],[200,196,193],[201,197,194],[201,197,194],[201,198,193],[202,199,194],[202,199,194],[202,199,194],[203,200,195],[203,200,195],[204,201,196],[204,201,196],[205,202,197],[205,202,197],[205,202,197],[205,202,197],[204,203,198],[205,203,198],[208,202,198],[159,151,147],[58,40,37],[63,37,35],[69,39,36],[78,43,41],[96,56,56],[99,54,55],[114,65,63],[124,72,68],[135,82,78],[135,84,80],[119,72,71],[106,62,62],[143,99,103],[181,138,141],[219,174,182],[222,182,188],[231,195,199],[220,182,185],[221,184,184],[223,185,182],[215,173,171],[196,153,148],[192,145,140],[190,139,135],[183,134,129],[147,100,96],[152,117,114],[206,194,190],[215,213,208],[213,213,211],[213,213,211],[213,215,212],[213,215,212],[211,215,211],[209,214,210],[211,215,213],[211,215,214],[210,214,213],[209,213,212],[209,213,212],[209,213,212],[208,213,209],[208,213,210],[208,212,211],[209,213,212],[208,212,211],[209,213,212],[208,212,211],[207,212,210],[206,212,210],[198,195,190],[199,196,191],[200,197,192],[201,197,194],[201,197,194],[202,198,195],[201,197,194],[202,198,194],[202,199,194],[203,200,195],[203,200,195],[203,200,195],[202,201,196],[203,202,197],[203,201,196],[203,202,197],[204,203,198],[204,202,197],[205,204,199],[205,203,198],[207,204,199],[207,200,197],[124,111,109],[52,29,29],[62,32,30],[75,41,39],[92,53,53],[94,52,52],[110,63,59],[126,76,71],[139,87,83],[125,73,71],[111,64,65],[115,73,74],[127,85,86],[177,135,137],[222,182,189],[229,192,197],[235,200,204],[231,195,196],[222,184,184],[218,178,178],[213,171,169],[198,152,147],[185,134,131],[163,113,108],[140,90,86],[137,96,93],[181,160,154],[216,210,204],[214,215,211],[213,214,212],[213,215,212],[213,215,212],[212,214,211],[213,215,212],[212,214,211],[211,216,212],[210,215,212],[210,214,213],[209,213,212],[209,213,212],[209,213,212],[209,214,212],[208,212,211],[209,213,212],[209,213,212],[209,213,212],[207,213,211],[208,213,211],[207,213,211],[206,212,210],[198,195,191],[200,196,192],[200,197,193],[200,197,193],[201,197,194],[201,197,194],[201,197,194],[202,199,195],[201,198,193],[203,200,194],[203,200,194],[204,201,195],[203,201,195],[203,202,196],[202,201,196],[203,202,197],[203,202,197],[203,203,197],[204,203,198],[204,203,198],[205,203,198],[208,202,199],[156,143,141],[58,37,36],[52,26,23],[63,33,31],[68,35,33],[85,47,46],[109,66,62],[116,70,65],[120,72,67],[120,71,68],[115,68,68],[110,67,68],[117,74,75],[181,139,139],[205,165,167],[227,188,191],[228,192,195],[225,187,189],[209,170,171],[200,159,160],[203,157,155],[201,151,148],[163,108,106],[133,79,76],[119,73,70],[183,153,150],[213,200,196],[216,214,210],[214,214,211],[214,216,213],[213,215,212],[214,216,213],[213,215,212],[212,214,211],[214,216,213],[212,217,213],[211,215,213],[211,215,214],[209,213,212],[210,214,213],[209,213,212],[210,214,213],[209,213,212],[209,213,212],[208,213,212],[208,213,212],[207,213,211],[207,213,212],[207,213,212],[206,212,210],[198,194,191],[199,195,192],[199,195,192],[200,197,192],[201,197,193],[201,197,194],[202,198,195],[201,198,194],[202,199,194],[202,199,192],[203,200,193],[203,200,193],[203,200,193],[203,201,195],[202,201,196],[203,202,197],[203,202,197],[203,202,197],[204,203,198],[204,203,198],[204,203,199],[207,202,200],[159,142,142],[92,65,66],[60,30,28],[51,19,17],[61,30,28],[68,34,32],[91,53,51],[100,59,56],[98,53,49],[113,69,65],[108,63,60],[119,74,72],[135,90,87],[158,111,108],[185,140,141],[207,164,165],[203,162,163],[207,166,167],[199,158,158],[187,141,140],[183,135,131],[163,109,107],[136,82,80],[117,69,64],[151,112,109],[212,190,187],[219,211,209],[215,214,213],[215,215,213],[214,216,213],[213,215,212],[214,216,213],[214,216,213],[214,216,213],[214,216,213],[211,216,212],[211,216,213],[210,214,213],[210,214,213],[210,214,213],[209,213,212],[210,214,213],[209,213,212],[209,213,212],[208,214,212],[207,213,211],[207,213,211],[207,213,213],[207,213,212],[206,212,210],[199,196,191],[199,196,192],[200,196,193],[200,197,192],[200,196,192],[201,197,194],[202,198,195],[201,198,194],[202,199,194],[202,199,194],[203,200,194],[203,200,193],[204,201,194],[204,201,195],[204,201,196],[203,202,197],[203,202,197],[203,202,197],[204,203,198],[205,202,199],[206,203,200],[208,202,199],[154,136,135],[101,70,69],[83,49,48],[57,25,23],[51,21,20],[55,23,24],[72,40,39],[80,44,43],[92,51,49],[101,60,57],[101,58,55],[114,71,66],[117,73,68],[138,93,88],[150,105,100],[178,133,130],[177,133,131],[183,138,140],[173,129,127],[177,129,126],[150,101,96],[110,60,56],[111,65,60],[143,102,99],[209,179,177],[219,204,202],[220,213,213],[215,215,213],[214,215,213],[215,217,214],[215,217,214],[214,216,213],[214,216,213],[213,215,212],[214,216,213],[211,216,212],[211,216,212],[210,215,211],[210,214,213],[210,214,213],[210,214,213],[210,215,213],[210,215,211],[209,213,212],[208,214,212],[207,213,212],[207,213,213],[207,213,211],[206,212,211],[207,213,211],[198,195,191],[199,196,192],[200,196,192],[200,197,192],[200,197,193],[201,197,194],[201,197,194],[202,198,195],[202,199,195],[202,199,194],[202,199,193],[203,200,193],[203,200,193],[203,200,194],[203,200,195],[202,201,197],[203,202,197],[203,202,198],[203,202,199],[205,202,200],[206,202,200],[212,205,203],[144,124,122],[104,70,68],[94,60,56],[73,41,37],[51,22,20],[45,17,16],[59,31,30],[73,43,42],[92,56,54],[95,58,55],[90,53,48],[99,58,52],[98,56,50],[120,75,69],[130,85,80],[157,112,107],[149,102,98],[170,123,122],[153,107,102],[140,92,86],[114,65,60],[96,50,47],[121,80,78],[209,176,175],[222,199,198],[217,207,204],[217,214,213],[214,216,213],[213,216,213],[215,217,214],[215,217,214],[214,216,213],[214,216,213],[214,216,213],[212,216,212],[211,216,212],[211,216,212],[211,216,212],[210,215,213],[209,214,211],[210,214,212],[209,214,211],[210,214,211],[209,214,212],[208,214,212],[208,214,213],[207,213,213],[207,213,211],[206,212,210],[207,213,211],[197,193,190],[198,195,191],[199,196,191],[199,195,192],[199,195,192],[200,196,193],[201,197,194],[201,197,194],[201,197,194],[202,199,194],[202,199,193],[203,200,193],[203,200,195],[203,199,196],[203,200,197],[202,200,200],[201,200,199],[206,205,204],[187,187,188],[143,141,143],[100,95,98],[55,44,44],[83,57,58],[105,68,68],[100,61,61],[90,53,52],[72,41,38],[53,23,23],[47,18,18],[63,34,35],[70,39,38],[72,40,38],[68,35,33],[76,40,35],[86,49,43],[103,62,57],[116,74,69],[115,73,68],[121,79,73],[128,82,81],[116,70,65],[104,57,53],[95,52,48],[130,91,91],[207,174,174],[226,198,200],[220,201,202],[215,205,205],[216,214,215],[213,216,216],[212,216,216],[215,216,217],[215,216,216],[214,216,216],[214,216,213],[213,216,213],[212,217,213],[212,217,213],[211,216,212],[211,216,212],[210,215,211],[209,214,210],[209,214,210],[209,214,210],[209,214,211],[208,214,212],[207,213,211],[208,214,213],[207,213,213],[207,213,211],[207,213,211],[207,213,211],[196,195,191],[198,195,192],[199,195,192],[199,195,194],[199,195,196],[200,196,195],[201,197,197],[200,196,196],[201,197,195],[200,199,195],[200,198,193],[202,199,197],[200,198,197],[201,200,198],[201,201,201],[165,164,167],[109,108,112],[52,51,56],[20,20,25],[19,19,24],[19,14,20],[23,9,11],[86,55,57],[104,65,64],[101,61,61],[94,55,55],[89,53,53],[79,46,46],[59,27,30],[54,23,26],[60,30,32],[59,27,29],[53,20,21],[72,41,39],[63,31,28],[81,46,43],[91,54,49],[74,35,31],[80,39,36],[74,33,30],[85,42,41],[96,54,55],[131,95,95],[207,176,178],[227,198,202],[229,202,207],[220,200,204],[218,207,213],[216,215,222],[211,216,221],[209,216,222],[211,216,221],[212,216,221],[213,217,220],[212,217,216],[211,217,214],[211,216,211],[212,217,213],[212,217,213],[211,216,212],[211,216,212],[209,214,210],[209,214,210],[209,213,212],[209,214,213],[208,214,212],[207,213,211],[208,214,212],[207,213,211],[207,213,211],[207,213,211],[206,212,210],[196,195,193],[196,194,193],[197,194,196],[191,187,191],[179,175,182],[195,191,197],[198,196,198],[200,197,198],[200,197,196],[198,197,196],[186,185,185],[129,129,132],[106,106,109],[98,98,101],[45,44,49],[23,23,30],[18,17,25],[15,15,24],[13,13,19],[12,11,16],[14,7,13],[33,13,16],[94,59,61],[101,62,61],[104,64,64],[100,59,60],[91,50,51],[85,47,48],[81,44,46],[72,37,39],[61,30,30],[58,28,28],[51,22,23],[50,22,22],[48,18,18],[56,26,25],[68,33,33],[65,29,29],[67,29,29],[77,40,40],[109,71,73],[166,132,134],[202,174,177],[223,195,198],[232,203,207],[227,201,206],[219,198,205],[143,131,147],[128,125,144],[139,142,163],[142,146,169],[137,141,159],[150,155,170],[198,204,216],[210,216,222],[211,216,219],[212,217,216],[211,216,214],[211,216,213],[210,215,211],[210,215,211],[210,215,211],[209,214,211],[209,214,212],[208,214,212],[208,214,212],[207,213,211],[207,213,211],[207,213,211],[206,212,210],[206,212,211],[206,212,211],[195,193,194],[195,193,195],[118,116,123],[62,59,70],[57,53,69],[77,73,88],[147,145,155],[196,195,203],[194,194,200],[128,128,133],[36,37,44],[22,23,31],[20,21,29],[18,18,25],[16,15,21],[15,15,23],[11,11,20],[8,8,18],[8,7,14],[9,6,11],[16,5,6],[74,46,47],[99,57,57],[101,58,59],[102,58,59],[102,58,59],[98,54,55],[96,53,53],[89,48,48],[86,48,46],[82,47,46],[78,45,46],[69,38,40],[62,31,34],[67,36,37],[71,38,39],[75,39,41],[87,50,54],[110,70,77],[128,92,97],[175,139,145],[211,180,185],[218,192,195],[227,200,203],[231,202,206],[228,202,207],[216,195,203],[115,105,124],[81,75,105],[74,76,108],[69,72,105],[61,65,95],[40,44,69],[82,87,108],[155,163,179],[207,215,227],[208,216,222],[209,215,218],[210,216,217],[209,216,214],[209,213,213],[209,213,212],[209,213,212],[208,214,212],[208,214,212],[207,213,211],[208,214,212],[207,213,211],[206,212,210],[206,212,210],[206,212,211],[205,211,211],[193,193,194],[125,124,131],[50,50,61],[46,43,60],[49,46,65],[48,45,65],[57,56,71],[125,124,138],[60,60,73],[15,18,28],[11,13,24],[12,14,26],[15,15,25],[12,13,20],[11,11,16],[8,9,14],[8,9,16],[4,7,14],[7,6,13],[12,5,8],[51,32,30],[94,58,57],[99,55,53],[99,55,54],[98,54,55],[99,54,55],[99,54,54],[99,53,54],[96,52,52],[92,50,48],[91,52,51],[85,47,51],[87,52,57],[86,50,56],[88,52,57],[95,58,63],[103,62,68],[119,77,84],[137,96,104],[167,128,135],[207,174,180],[223,192,197],[224,195,199],[227,198,202],[230,201,205],[227,199,204],[217,193,199],[90,79,97],[44,40,67],[45,46,76],[48,52,82],[42,46,74],[15,19,44],[43,48,73],[79,86,111],[115,122,149],[153,160,179],[189,197,212],[207,216,225],[206,216,222],[208,214,217],[207,214,214],[208,214,215],[208,214,214],[208,214,213],[207,213,211],[207,213,211],[207,213,211],[206,212,210],[207,213,211],[206,212,210],[206,212,212],[193,192,197],[52,51,62],[31,30,45],[35,32,52],[36,32,55],[43,40,64],[44,45,68],[49,50,72],[42,42,64],[20,22,41],[19,21,37],[19,21,34],[17,17,28],[11,11,20],[6,7,13],[4,6,11],[3,6,12],[6,9,16],[12,11,14],[38,26,26],[82,54,52],[92,54,49],[94,51,51],[99,55,55],[95,51,52],[97,52,51],[97,50,49],[98,52,51],[97,52,51],[97,51,52],[93,51,49],[92,51,53],[92,53,56],[92,52,56],[100,60,64],[105,64,68],[116,72,77],[128,84,90],[165,124,132],[206,168,175],[218,185,190],[222,191,196],[224,196,200],[228,200,204],[228,199,203],[226,198,202],[212,188,195],[87,76,91],[22,20,41],[17,20,45],[24,28,54],[32,37,59],[12,16,38],[18,22,46],[44,51,78],[77,84,117],[88,97,130],[67,78,110],[86,97,125],[134,146,166],[190,200,214],[204,215,220],[205,215,218],[207,213,216],[208,213,213],[208,214,213],[207,213,211],[206,212,210],[206,212,210],[206,212,210],[205,211,210],[205,211,210],[179,178,182],[29,28,40],[21,20,35],[26,25,44],[25,24,46],[27,29,53],[34,39,64],[41,46,71],[42,46,71],[46,48,70],[22,24,44],[18,19,37],[16,16,29],[16,16,26],[13,13,20],[5,8,13],[3,6,12],[10,13,20],[12,11,13],[43,30,29],[87,58,57],[89,49,47],[89,49,49],[90,51,53],[94,52,53],[93,49,50],[98,52,52],[98,52,53],[101,55,55],[100,54,56],[97,55,56],[93,51,52],[95,54,56],[100,57,59],[107,65,66],[115,69,70],[127,82,85],[155,111,115],[189,149,156],[206,172,178],[213,184,188],[219,191,195],[225,199,202],[226,199,202],[226,197,201],[222,194,198],[213,188,196],[104,95,106],[36,38,56],[5,11,33],[5,12,35],[8,14,34],[9,11,33],[13,15,38],[21,26,53],[53,59,95],[76,86,122],[69,82,120],[56,70,108],[48,62,100],[55,69,103],[117,132,156],[195,207,220],[205,214,221],[207,213,216],[207,213,213],[206,212,210],[206,212,210],[206,212,210],[205,211,209],[205,211,209],[205,211,209],[182,182,184],[22,22,32],[10,12,25],[19,19,37],[21,21,41],[25,28,52],[23,28,53],[34,38,64],[39,43,70],[52,56,82],[53,57,82],[24,28,51],[14,15,32],[15,16,28],[12,13,20],[7,10,17],[5,10,16],[7,14,20],[9,11,15],[19,10,11],[76,52,51],[85,53,52],[86,49,49],[87,49,52],[88,48,53],[94,52,57],[99,55,57],[101,56,58],[103,58,60],[103,58,61],[102,57,60],[99,55,57],[99,55,57],[105,61,62],[114,70,71],[129,84,85],[155,113,116],[184,142,147],[199,162,167],[207,175,180],[216,187,191],[222,196,199],[223,197,200],[225,197,201],[226,197,202],[220,192,196],[213,190,195],[141,127,137],[24,28,43],[41,55,78],[36,50,74],[37,45,69],[19,23,48],[12,16,41],[12,18,45],[32,36,73],[72,80,120],[80,93,135],[57,71,113],[33,48,90],[41,56,94],[49,63,100],[89,104,132],[184,196,211],[205,214,220],[205,212,214],[207,212,211],[206,211,208],[206,211,207],[205,210,208],[206,210,209],[206,210,209],[192,192,194],[45,46,54],[11,13,26],[17,19,37],[18,20,40],[24,28,52],[25,29,54],[22,26,52],[31,35,62],[40,44,73],[55,58,87],[56,60,88],[31,33,55],[16,17,34],[10,12,23],[4,7,15],[3,8,15],[5,12,18],[8,12,17],[8,8,10],[36,22,23],[73,46,45],[79,47,45],[83,48,50],[87,51,54],[88,50,53],[94,54,55],[98,56,57],[102,58,60],[105,60,62],[105,60,63],[104,59,63],[103,58,63],[110,66,67],[130,86,87],[159,115,116],[182,142,146],[196,159,162],[209,177,180],[215,185,189],[219,190,195],[224,196,200],[223,197,200],[224,196,200],[223,194,199],[219,190,194],[217,192,195],[210,192,198],[72,73,86],[34,52,74],[24,42,66],[34,47,73],[64,70,97],[45,50,75],[27,32,60],[34,39,74],[65,74,114],[79,92,137],[66,80,125],[35,50,95],[37,52,90],[43,58,95],[61,75,112],[92,106,136],[190,202,216],[204,212,217],[206,211,211],[206,211,208],[206,211,207],[206,210,209],[206,210,209],[205,210,209],[191,191,194],[117,118,125],[23,25,37],[16,17,36],[21,24,47],[21,25,50],[26,30,57],[28,32,59],[21,25,52],[27,31,59],[41,44,75],[48,51,82],[61,62,90],[35,38,58],[5,9,23],[2,6,17],[3,8,18],[4,11,20],[6,11,19],[8,11,15],[12,6,10],[51,33,33],[73,46,46],[78,45,49],[84,50,54],[85,50,53],[90,51,51],[93,50,51],[97,51,53],[106,60,62],[108,62,65],[110,64,68],[112,67,72],[126,81,85],[154,109,113],[178,133,137],[186,146,150],[200,165,168],[207,175,178],[214,185,189],[219,190,194],[223,194,198],[223,197,200],[224,197,201],[224,195,200],[219,189,194],[217,193,196],[212,192,197],[166,158,170],[27,41,63],[44,62,86],[6,19,45],[27,36,62],[53,58,85],[48,53,82],[41,48,82],[58,68,108],[74,88,133],[75,89,133],[43,54,98],[15,27,60],[41,54,87],[61,75,110],[79,93,128],[114,129,157],[200,213,220],[203,211,213],[206,211,209],[206,211,207],[205,209,208],[205,210,209],[204,210,210],[191,191,192],[158,158,166],[22,24,38],[27,32,51],[30,35,60],[27,33,60],[25,30,57],[31,36,63],[25,29,56],[24,28,55],[28,31,60],[39,43,73],[54,58,85],[60,64,89],[35,39,59],[2,7,25],[3,9,22],[3,9,20],[3,10,19],[5,11,19],[7,9,14],[20,11,14],[62,41,43],[72,45,47],[82,51,56],[83,52,56],[87,49,50],[92,49,48],[97,51,51],[107,61,61],[111,67,68],[119,74,79],[131,86,91],[146,101,106],[164,119,124],[183,138,143],[199,158,162],[204,169,172],[209,178,181],[211,182,184],[217,188,190],[221,192,194],[225,196,198],[226,197,199],[221,192,195],[219,189,192],[220,194,196],[215,193,197],[209,196,204],[33,41,58],[47,65,88],[15,31,56],[5,14,38],[21,28,54],[42,49,77],[43,52,84],[56,68,108],[78,91,136],[74,87,131],[57,68,108],[2,12,40],[13,21,49],[41,54,86],[73,87,125],[94,111,145],[163,178,196],[202,211,218],[205,211,210],[205,211,209],[205,211,209],[203,209,208],[204,210,210],[189,190,191],[110,110,119],[35,37,53],[33,37,60],[34,39,67],[36,42,72],[37,43,74],[24,30,59],[29,34,62],[31,35,62],[22,26,52],[27,31,58],[35,39,65],[42,46,73],[54,59,84],[42,47,70],[4,10,29],[2,9,23],[3,10,22],[4,12,22],[7,12,19],[10,8,13],[27,17,19],[64,43,47],[77,49,54],[82,51,55],[88,49,51],[93,51,50],[101,55,55],[111,65,65],[128,84,86],[154,109,113],[167,122,126],[165,120,124],[165,120,124],[179,134,138],[186,146,149],[196,160,163],[202,170,173],[209,180,182],[217,188,190],[222,193,196],[226,197,200],[226,197,199],[221,192,194],[221,193,195],[222,196,198],[218,197,201],[214,200,208],[67,67,84],[31,48,71],[38,64,89],[3,11,38],[4,12,37],[14,23,52],[29,38,70],[41,53,91],[70,83,126],[75,88,131],[55,66,102],[3,10,32],[2,7,26],[8,17,42],[41,55,91],[86,105,141],[120,137,164],[201,211,218],[203,210,210],[205,211,209],[205,211,209],[204,210,208],[203,209,208],[189,190,193],[75,76,86],[26,28,44],[27,30,54],[31,37,64],[33,39,70],[37,43,75],[34,40,71],[25,32,62],[30,34,61],[22,26,52],[19,23,48],[23,27,52],[33,37,63],[46,50,77],[52,57,84],[55,61,88],[17,25,47],[2,9,27],[3,11,24],[4,10,20],[7,10,17],[10,7,11],[38,25,30],[71,49,54],[79,49,53],[87,51,52],[92,50,49],[102,56,56],[126,80,80],[161,119,121],[185,143,145],[187,145,147],[179,134,137],[177,132,135],[180,135,138],[188,148,151],[196,161,164],[204,172,175],[209,180,182],[217,188,191],[222,193,197],[226,197,201],[223,194,197],[216,187,189],[222,196,197],[223,197,199],[218,197,201],[215,200,207],[94,92,109],[23,37,59],[47,79,109],[12,33,61],[11,25,54],[9,19,49],[9,16,48],[26,37,72],[55,69,108],[69,82,126],[67,79,115],[11,18,44],[1,6,26],[4,10,38],[54,67,106],[89,107,147],[99,114,149],[199,211,222],[203,211,214],[204,209,209],[205,211,209],[204,210,208],[203,209,207],[188,192,196],[70,72,83],[20,22,40],[21,26,48],[29,34,63],[29,36,66],[32,40,73],[36,45,78],[29,38,69],[23,28,58],[29,34,60],[23,27,53],[15,19,44],[20,25,50],[31,37,63],[43,48,77],[58,63,93],[58,66,95],[37,45,69],[3,12,32],[2,10,24],[4,11,20],[9,12,17],[13,9,12],[52,37,40],[78,50,54],[86,50,53],[95,52,53],[113,66,66],[151,103,103],[194,150,152],[204,164,166],[197,157,158],[186,146,149],[180,140,142],[186,145,147],[192,153,154],[198,162,163],[202,168,169],[208,178,180],[216,186,189],[222,193,197],[228,199,203],[222,193,197],[220,191,195],[224,199,202],[224,201,204],[222,202,204],[217,202,211],[106,103,121],[23,37,61],[46,82,114],[30,61,95],[42,60,98],[64,77,113],[12,22,54],[5,15,48],[31,43,79],[64,77,116],[74,86,124],[37,46,76],[3,7,35],[37,45,80],[77,93,134],[89,110,149],[96,114,150],[195,208,223],[201,211,215],[204,211,211],[203,209,207],[204,210,208],[203,209,207],[69,71,80],[21,23,36],[21,22,41],[24,28,51],[30,34,63],[30,38,66],[29,38,70],[32,39,74],[34,42,78],[32,42,74],[23,30,60],[21,26,54],[21,26,51],[16,22,47],[20,26,52],[30,36,63],[42,47,76],[56,63,93],[56,68,95],[39,53,80],[9,20,41],[3,11,26],[4,13,21],[8,12,17],[20,14,19],[69,48,52],[93,61,63],[108,66,67],[127,80,80],[172,124,125],[210,167,169],[215,177,178],[206,170,170],[196,160,163],[189,151,154],[186,147,149],[191,152,154],[200,162,164],[203,168,170],[206,174,177],[214,183,186],[222,192,196],[226,197,201],[223,194,198],[226,199,202],[226,202,206],[227,204,208],[225,205,208],[219,204,213],[105,101,118],[19,35,58],[45,82,117],[30,64,102],[36,58,100],[79,95,139],[63,73,113],[5,11,44],[10,19,50],[37,50,86],[65,77,116],[61,74,112],[15,27,61],[77,95,133],[83,104,147],[87,110,152],[86,107,144],[193,210,228],[198,211,217],[202,210,213],[202,210,208],[202,209,207],[202,208,206],[15,18,31],[13,15,30],[22,23,42],[19,23,44],[25,30,55],[24,32,60],[28,37,69],[24,32,68],[28,40,76],[34,47,81],[32,43,76],[26,35,64],[22,29,57],[27,34,61],[20,26,52],[21,27,53],[32,38,64],[62,67,96],[117,124,152],[163,180,194],[61,76,102],[18,29,53],[2,13,29],[6,14,25],[10,17,26],[32,28,35],[110,85,91],[133,95,98],[140,96,97],[165,120,122],[212,171,173],[224,188,188],[221,188,186],[207,176,178],[196,162,165],[189,153,157],[192,154,157],[195,157,160],[201,165,167],[208,173,176],[214,182,185],[225,195,197],[226,197,201],[224,196,200],[228,202,205],[228,206,208],[231,208,214],[230,209,214],[221,206,214],[87,83,98],[20,35,56],[40,74,109],[34,67,109],[38,60,105],[77,93,139],[78,90,133],[41,51,87],[2,8,37],[10,21,50],[45,55,89],[42,56,94],[55,73,112],[77,98,141],[84,108,154],[82,106,151],[90,112,154],[150,168,197],[189,204,221],[198,211,219],[201,210,212],[202,209,209],[202,208,206]]
d3.scaler = function() {
var scale;
var height = 255;
var max;
var min;
var selection;
var dispatch = d3.dispatch("update");
var editing;
var drag = d3.behavior.drag()
.on("drag", function(d,i) {
if(editing) return false;
var y = getY(i);
if(!y && y !== 0) return;
var dy = d3.event.dy;
y += dy;
if(y > max) y = max;
if(y < min) y = min;
//move things around
setY(i, y);
//sort & reorder the domain and range
var domain = scale.domain();
var range = scale.range();
var zipped = d3.zip(domain, range);
zipped.sort(function(a,b) {
return a[0] - b[0];
})
domain = zipped.map(function(d) { return d[0] })
range = zipped.map(function(d) { return d[1] })
scaler.update();
})
var scaler = function(g) {
selection = g;
scaler._update();
}
dispatch.on("update.internal", function() {
scaler._update();
});
scaler._update = function() {
selection.each(function() {
var sel = d3.select(this);
var domain = scale.domain();
var range = scale.range();
//background. TODO: use svg?
var bg = sel.selectAll("div.background")
.data([0])
bg.enter().append("div").classed("background",true)
bg.style({
"margin-top": "16px",
width: 10+"px",
height: height+ "px",
"background-color":"grey"
})
bg.on("dblclick", function() {
var domain = scale.domain();
var range = scale.range();
var y = d3.mouse(this)[1];
var i = d3.bisect(domain, y);
domain.splice(i, 0, y);
range.splice(i, 0, "");
scaler.update();
});
//handle things
var handles = sel.selectAll("div.handle")
.data(domain)
var handlesEnter = handles.enter().append("div").classed("handle", true);
handlesEnter.append("div").classed("line", true);
//the input
var inputs = handlesEnter.append("input").classed("ascii", true)
.on("mouseup", function() { this.select(); d3.event.cancelBubble = true; })
.on("keyup", function(d,i) {
setX(i, this.value);
scaler.update();
})
.attr("maxlength", 1);
//the number
var numbers = handlesEnter.append("span.number")
.classed("number", true)
inputs.on("focus", function() {
console.log("focus!")
editing = true;
})
inputs.on("blur", function() {
console.log("blur!")
editing = false;
})
handlesEnter.call(drag)
handles.style("top", function(d,i) {
return getY(i) + "px";
})
handles.select(".number")
.text(function(d,i) {
return getY(i)
})
handles.select(".ascii")
.attr("value", function(d,i) {
return getX(i);
})
})
}
scaler.scale = function(_) {
if(!arguments.length) return scale;
scale = _;
max = d3.max(scale.domain());
min = d3.min(scale.domain());
return scaler;
}
function getY(i) {
var domain = scale.domain();
return domain[i];
}
function setY(i, v) {
var domain = scale.domain();
domain[i] = v;
}
function getX(i) {
var range = scale.range();
return range[i];
}
function setX(i, v) {
var range = scale.range();
range[i] = v;
}
d3.rebind(scaler, dispatch, "on", "update")
return scaler;
}
body {
overflow:scroll;
background-color: #000;
}
canvas {
position:absolute;
top: 100px;
right: 50px;;
}
#scaler {
position:absolute;
top: 100px;
right: 150px;
width: 100px;
}
.background {
border: 1px solid #51A874;
background-color: #000000;
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(0, 0, 0)), to(rgb(255, 255, 255)));
background-image: -webkit-linear-gradient(top, rgb(0, 0, 0), rgb(255, 255, 255));
background-image: -moz-linear-gradient(top, rgb(0, 0, 0), rgb(255, 255, 255));
background-image: -o-linear-gradient(top, rgb(0, 0, 0), rgb(255, 255, 255));
background-image: -ms-linear-gradient(top, rgb(0, 0, 0), rgb(255, 255, 255));
background-image: linear-gradient(top, rgb(0, 0, 0), rgb(255, 255, 255));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#000000', EndColorStr='#ffffff');
}
.handle {
position: absolute;
left: 27px;
}
.handle .line {
width: 15px;
border-top: 1px solid #13D661;
border-bottom: 1px solid #0C7235;
position:absolute;
top: 16px;
left: -15px;
}
input.ascii {
margin-top: 5px;
border: none !important;
font-size: 12px !important;
width: 25px !important;
border-radius: 0 !important;
text-align: center;
height: 20px;
}
.number {
cursor: ns-resize;
margin-left: 5px;
font-family: Helvetica;
font-size: 12px;
color: white;
line-height: 1em;
position:relative;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment