Skip to content

Instantly share code, notes, and snippets.

@jexp jexp/neo_datatable.js

Last active Jan 30, 2017
Embed
What would you like to do?
Bookmarklet to zoom and pan Neo4j graph viz and query plans, Hold "Alt" to zoom & pan.
javascript: (function() {
var createTable = function() { $("neo-table > table.table.data:not(datatable)").addClass("datatable").DataTable(); };
if ($("#style-datatable").length == 0) {
$("body").append($('<link id="style-datatable" rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">'));
$.getScript('//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js',createTable);
} else {
createTable();
}
})();
javascript: (function() { var script = document.createElement("script");
script.setAttribute("src", "//cdn.rawgit.com/anvaka/panzoom/v1.2.1/dist/panzoom.min.js");
script.addEventListener('load', function() {
$(".graph > g,.query-plan > g").each(function() { panzoom($(this)[0], { beforeWheel: function(e) { return !e.altKey; }}); });
}, false);
document.body.appendChild(script);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.