[TASK] Remove jsHashes

This commit is contained in:
Xaver Maierhofer 2016-05-26 00:27:46 +02:00 committed by Milan Pässler
parent a2ab0dce4f
commit e32fe6648d
3 changed files with 5 additions and 9 deletions

3
app.js
View file

@ -12,8 +12,7 @@ require.config({
"d3": "../bower_components/d3/d3.min", "d3": "../bower_components/d3/d3.min",
"virtual-dom": "../bower_components/virtual-dom/dist/virtual-dom", "virtual-dom": "../bower_components/virtual-dom/dist/virtual-dom",
"rbush": "../bower_components/rbush/rbush", "rbush": "../bower_components/rbush/rbush",
"helper": "../helper", "helper": "../helper"
"jshashes": "../bower_components/jshashes/hashes"
}, },
shim: { shim: {
"leaflet.label": ["leaflet"], "leaflet.label": ["leaflet"],

View file

@ -21,8 +21,7 @@
"roboto-fontface": "~0.3.0", "roboto-fontface": "~0.3.0",
"virtual-dom": "~2.1.1", "virtual-dom": "~2.1.1",
"leaflet-providers": "~1.1.10", "leaflet-providers": "~1.1.10",
"rbush": "https://github.com/mourner/rbush.git#~1.4.3", "rbush": "https://github.com/mourner/rbush.git#~1.4.3"
"jshashes": "~1.0.5"
}, },
"authors": [ "authors": [
"Milan Pässler <me@petabyteboy.de>", "Milan Pässler <me@petabyteboy.de>",

View file

@ -1,6 +1,5 @@
define(["leaflet", "jshashes"], define(["leaflet"],
function (L, jsHashes) { function (L) {
var MD5 = new jsHashes.MD5();
return L.TileLayer.Canvas.extend({ return L.TileLayer.Canvas.extend({
setData: function (d) { setData: function (d) {
@ -8,8 +7,7 @@ define(["leaflet", "jshashes"],
//pre-calculate start angles //pre-calculate start angles
this.data.all().forEach(function (d) { this.data.all().forEach(function (d) {
var hash = MD5.hex(d.node.nodeinfo.node_id); d.startAngle = (parseInt(d.node.nodeinfo.node_id.substr(10, 2), 16) / 255) * 2 * Math.PI;
d.startAngle = (parseInt(hash.substr(0, 2), 16) / 255) * 2 * Math.PI;
}); });
this.redraw(); this.redraw();
}, },