Skip to content

Commit

Permalink
index file updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush-Sharma410 committed Jul 3, 2024
1 parent 2803dbb commit 1563110
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
const urlParams = new URLSearchParams(window.location.search);
let ifMusic = urlParams.get('music') == 'true';

let dataDirectory = "data/global_1/";
let dataDirectory = "data/preturbing/";
let firstFile = true; // We want this to be false after loading the first file so that the points dont shift around

// ** Set of variables from deposit_reader.py, important for coordiante conversion **
Expand Down Expand Up @@ -145,10 +145,10 @@
var anchorList = ["0: also_ADV", "918: right_NOUN"];
var searchAnchorList = ["0: also_ADV", "918: right_NOUN"];
var searchZoomList = ["0: also_ADV", "918: right_NOUN"];
var datasetList = ["data/global_1/", "data/global_2/", "data/music_demo/", "data/plankton/"];
var datasetList = ["data/Umap_demo","data/medicines/","data/demo/","data/medicines-d","data/medicines-e","data/quasi_random"];

//var datasetList = ["data/global_1/", "data/global_2/", "data/music_demo/", "data/Lautonomy_Data/"];
let traceDataDirectory = "data/global_1/"; // CONTROLS WHICH DATASET TO LOAD WITH!!
let traceDataDirectory = "data/preturbing/"; // CONTROLS WHICH DATASET TO LOAD WITH!!
var dataTraceController;

// change initial dataset if music == true, modified for quick access to music embedding
Expand Down Expand Up @@ -238,7 +238,7 @@
var annotationThreeNotes = [''];
var annotationFourNotes = [''];
var annotationFiveNotes = [''];
var yearsBool = true;
var yearsBool = false;
var years = {};
var full_years_arr;
var years_header;
Expand Down Expand Up @@ -701,9 +701,10 @@
left: `${tooltipPosition.x + tooltipWidth / 16 - tooltipWidth/2}px`,
top: `${tooltipPosition.y + tooltipHeight / 16 + 30}px`
});

divElement.text(text);
divElement.css({opacity: 0.7});
var formattedText = text.split("---->").join("<br> Salts : ");

divElement.html(formattedText);
divElement.css({opacity: 0.9});
}

function hideTooltip() {
Expand Down Expand Up @@ -881,9 +882,11 @@
// Search bar
searchFolder.add(GUIparam, "textField").name('Search Term').onFinishChange(function (searchedTerm) {
console.log(searchedTerm);
console.log("allPoints are - ",allPoints);
console.log("current anchor list", anchorList);
const anchorResults = fuzzysort.go(searchedTerm, anchorList, {limit: 100, all: true, allowTypo: true});
const zoomResults = fuzzysort.go(searchedTerm, allPoints, {limit: 100, all: true, allowTypo: true});
const anchorResults = fuzzysort.go(searchedTerm, anchorList, {threshold:0.0, all: true, allowTypo: false});
const zoomResults = fuzzysort.go(searchedTerm, allPoints, {threshold:0.0, all: true, allowTypo: false});
console.log("the zoom results are",zoomResults)
searchAnchorList = anchorResults.map(x => x.target);
searchZoomList = zoomResults.map(x => x.target);
// searchFolder.remove(chooseAnchorController);
Expand Down Expand Up @@ -929,7 +932,29 @@
// });
updateDropdown(zoomController, searchZoomList);
updateDropdown(chooseAnchorController, searchAnchorList);

let zoomResultsStrings = []
for (let i = 0; i < zoomResults.length; i++) {
zoomResultsStrings.push(zoomResults[i].target);
}
console.log("zoomResultsStrings are -",zoomResultsStrings)


for (let i = 0; i < maxParticleCount; i++) {
if (particleData[i].includes(searchedTerm))
{

particleColor[i * 3] = 255;
particleColor[i * 3 + 1] = 0;
particleColor[i * 3 + 2] = 0;
particleOpacity[i] = 1.0;

}
else{
particleColor[ i * 3 ] = 0.0;
particleColor[ i * 3 + 1 ] = 0.0;
particleColor[ i * 3 + 2] = 0.0;
particleOpacity[i] = 0.0;
}}
});

// Jump to point dropdown
Expand Down

0 comments on commit 1563110

Please sign in to comment.