Skip to content

Commit

Permalink
Improve Rings (#9)
Browse files Browse the repository at this point in the history
* Improve Rings
  • Loading branch information
timglabisch authored Sep 11, 2024
1 parent 4e741ff commit 08dcf58
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
10 changes: 6 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
{ name: "Data Management" },
],
rings: [
{ name: "ADOPT", color: "#5ba300" },
{ name: "TRIAL", color: "#009eb0" },
{ name: "ASSESS", color: "#c7ba00" },
{ name: "HOLD", color: "#e09b96" }
{ name: "Adopt", color: "#5ba300" },
{ name: "Works", color: "#009eb0" },
{ name: "Interesting", color: "#87c1be" },
{ name: "Adopted but Bad", color: "#ff0000" },
{ name: "Hold", color: "#e09b96" },
{ name: "Bad", color: "#ff1100" },
],
entries: data.entries
});
Expand Down
16 changes: 9 additions & 7 deletions docs/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ function radar_visualization(config) {
const rings = [
{ radius: 130 },
{ radius: 220 },
{ radius: 310 },
{ radius: 400 }
{ radius: 280 },
{ radius: 360 },
{ radius: 430 },
{ radius: 490 },
];

const title_offset =
Expand Down Expand Up @@ -167,10 +169,10 @@ function radar_visualization(config) {
}

// partition entries according to segments
var segmented = new Array(4);
for (var quadrant = 0; quadrant < 4; quadrant++) {
segmented[quadrant] = new Array(4);
for (var ring = 0; ring < 4; ring++) {
var segmented = new Array(6);
for (var quadrant = 0; quadrant < 6; quadrant++) {
segmented[quadrant] = new Array(6);
for (var ring = 0; ring < 6; ring++) {
segmented[quadrant][ring] = [];
}
}
Expand All @@ -182,7 +184,7 @@ function radar_visualization(config) {
// assign unique sequential id to each entry
var id = 1;
for (var quadrant of [2,3,1,0]) {
for (var ring = 0; ring < 4; ring++) {
for (var ring = 0; ring < 6; ring++) {
var entries = segmented[quadrant][ring];
entries.sort(function(a,b) { return a.label.localeCompare(b.label); })
for (var i=0; i<entries.length; i++) {
Expand Down
11 changes: 8 additions & 3 deletions docs/vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ window.QUADRANT_TOP_LEFT = 2;
window.QUADRANT_TOP_RIGHT = 3;

window.RING_ADOPT = 0;
window.RING_TRIAL = 1;
window.RING_ASSES = 2;
window.RING_HOLD = 3;
window.RING_WORKS = 1;
window.RING_INTERESTING = 2;
window.RING_ADOPTED_BUT_BAD = 3;
window.RING_HOLD = 4;
window.RING_BAD = 5;

window.RING_TRIAL = window.RING_WORKS;
window.RING_ASSES = window.RING_INTERESTING;

0 comments on commit 08dcf58

Please sign in to comment.