From a44280759ecb78d4e3395a500355d9d90e55bf12 Mon Sep 17 00:00:00 2001 From: Beusekom Date: Mon, 29 Aug 2022 14:06:13 +0200 Subject: [PATCH 1/4] Changes to generate poster images --- examples/matrix.js | 17 ++++++++++++++++- examples/miserables/index.html | 1 + examples/timeseries/index.html | 2 +- examples/timeseries/order_functions.js | 4 ++-- nbproject/private/private.properties | 1 + nbproject/private/private.xml | 15 +++++++++++++++ src/nn_2opt.js | 5 ++++- 7 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 nbproject/private/private.properties create mode 100644 nbproject/private/private.xml diff --git a/examples/matrix.js b/examples/matrix.js index 00970bd..fcb12ba 100644 --- a/examples/matrix.js +++ b/examples/matrix.js @@ -101,6 +101,15 @@ function matrix(json) { return nodes.map(function(n) { return n.spectral; }); } + + function computeNN2OPT() { + var order = leafOrder(adjacency); + + order.forEach(function(lo, i) { + nodes[i].leafOrder = lo; + }); + return nodes.map(function(n) { return n.leafOrder; }); + } // Precompute the orders. var orders = { @@ -114,7 +123,8 @@ function matrix(json) { leafOrderDist: computeLeaforderDist, barycenter: computeBarycenter, rcm: computeRCM, - spectral: computeSpectral + spectral: computeSpectral, + nn2opt: computeNN2OPT }; // The default sort order. @@ -240,6 +250,11 @@ function matrix(json) { order("leafOrderDist"); //d3.select("#order").property("selectedIndex", 4); } + else if (currentOrder == 'nn2opt') { + orders.nn2opt = computeNN2OPT; + order("nn2opt"); + //d3.select("#order").property("selectedIndex", 4); + } // leafOrder.forEach(function(lo, i) { // nodes[lo].leafOrder = i; diff --git a/examples/miserables/index.html b/examples/miserables/index.html index 5d5f86a..14664a6 100644 --- a/examples/miserables/index.html +++ b/examples/miserables/index.html @@ -47,6 +47,7 @@

Les Misérables Co-occurrence

+

Distance: