Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active February 8, 2016 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mbostock/587387 to your computer and use it in GitHub Desktop.
Save mbostock/587387 to your computer and use it in GitHub Desktop.
Minecraft Overviewer
license: gpl-3.0
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdn.rawgit.com/simplegeo/polymaps/v2.2.0/polymaps.min.js"></script>
<style type="text/css">
@import url("https://cdn.rawgit.com/simplegeo/polymaps/v2.2.0/examples/example.css");
html, body {
height: 100%;
}
svg {
display: block;
}
</style>
</head>
<body>
<script type="text/javascript">
var po = org.polymaps;
var map = po.map()
.container(document.body.appendChild(po.svg("svg")))
.tileSize({x: 384, y: 384})
.zoomRange([0, 5])
.zoom(1)
.center({lat: -45, lon: 0})
.add(po.interact())
.add(po.hash());
map.add(po.image()
.url(minecraft("http://graphics.stanford.edu/~mbostock/minecraft-sample", ".png")));
map.add(po.compass()
.pan("none"));
function minecraft(path, ext) {
return function(c) {
var k = 1 << c.zoom;
if (c.column < 0
|| c.column >= k
|| c.row < 0
|| c.row >= k) return "about:blank";
if (c.zoom) {
for (var url = [path], z = c.zoom - 1; z >= 0; --z) {
k = Math.pow(2, -z);
url.push("/", (~~(c.column * k) & 1) + ((~~(c.row * k) & 1) << 1));
}
url.push(ext);
return url.join("");
}
return path + "/base" + ext;
};
}
</script>
</body>
</html>
@raja1985
Copy link

Hi, I'm trying to play with this (http://mbostock.github.io/d3/talk/20111116/bundle.html) example with my own data. which has csv file contents as below:
source_proj ,issue_link, destination_proj ,dest_issuetype
[Inactive] Eikon Collab MM - Insider iPhone,Bug to Story,[Inactive] Eikon Collab MM - Insider iPhone,Story
[Inactive] Eikon Collab MM - Insider iPhone,jira_subtask_link,[Inactive] Eikon Collab MM - Insider iPhone,Acceptance Test
[Inactive] Eikon Collab MM - Insider iPhone,jira_subtask_link,[Inactive] Eikon Collab MM - Insider iPhone,Task

an so on.

can you guide me how to implement this graph with these four attribute. how to have relationship with them?

source_proj ,issue_link, destination_proj ,dest_issuetype

@tisdall
Copy link

tisdall commented May 25, 2015

This "block" is broken. The reason and solution can be found here: http://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment