diff --git a/README.md b/README.md index 0d242fe5..e14ba087 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,20 @@ # PixPlot +This repository is a fork of the original PixPlot created by the Yale DH lab. In our version, cluster visualisation via different colors is added. In order to use this, create the plot_data.json as usual and then add group information to each image and a global group_count. Afterwards, the json should look like that: + +
+ {"atlas_counts": {"64px": 15.0, "32px": 4.0},
+ "group_count": 3,
+ "positions": [
+ ["picture1", 0, 0, 0, 0, 0],
+ ["picture2", 0, 0, 0, 0, 1],
+ ...
+ "clusters": [...]
+ }
+
+
+- - - -
+
This repository contains code that can be used to visualize tens of thousands of images in a two-dimensional projection within which similar images are clustered together. The image analysis uses Tensorflow's Inception bindings, and the visualization layer uses a custom WebGL viewer.

diff --git a/assets/js/tsne-webgl.js b/assets/js/tsne-webgl.js
index b31f7715..a3289c6d 100644
--- a/assets/js/tsne-webgl.js
+++ b/assets/js/tsne-webgl.js
@@ -21,17 +21,22 @@ var sizes = {
cols: 2048 / 32,
rows: 2048 / 32
}
-}
+};
// Count of 32px and 64px atlas files to fetch
-var atlasCounts = { '32px': null, '64px': null }
+var atlasCounts = { '32px': null, '64px': null };
+
+// Group count
+var groupCount = 1;
// Create a store for the load progress. Data structure:
// {atlas0: percentLoaded, atlas1: percentLoaded}
var loadProgress = {};
// Create a store for the 32px and 64px atlas materials
-var materials = { 32: [], 64: [] }
+var materials = { 32: [], 64: [] };
+
+var colors = [0xbfffc1, 0xffbb8e, 0xbff9ff, 0xecbfff];
// Many graphics cards only support 2**16 vertices per mesh,
// and each image requires 4 distinct vertices
@@ -164,6 +169,14 @@ function loadData() {
var data = JSON.parse(data);
// Set the atlas counts
atlasCounts = data.atlas_counts;
+ // Set the group counts
+ if (data.group_count){
+ groupCount = data.group_count;
+ };
+ materials = []
+ for (group = 0; group