You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
959 B
31 lines
959 B
function filterCSV( contentFilename ){
|
|
|
|
if ( contentFilename.endsWith(".csv") ) {
|
|
console.log('it is a CSV file', contentFilename)
|
|
|
|
// mereology option
|
|
let openingOptions = filesWithMetadata[contentFilename].openingOptions
|
|
// can be used via e.g. showFile("https://fabien.benetou.fr/?action=source",{ mereology:"whole"})
|
|
|
|
fetch( contentFilename )
|
|
.then( r => r.text() ).then( r => {
|
|
// console.log('CSV', r)
|
|
|
|
console.log( "mereology", openingOptions.mereology )
|
|
switch( openingOptions.mereology ) {
|
|
case "whole":
|
|
addNewNote(r, "0 1.4 -.8")
|
|
break;
|
|
default:
|
|
r.split('\n').map( (c,i) => addNewNote(c, "0 "+(1+i/10)+" -.8") )
|
|
}
|
|
|
|
AFRAME.scenes[0].emit('csvloaded', contentFilename)
|
|
// to use the event consider :
|
|
//AFRAME.scenes[0].addEventListener("csvloaded", e => console.log(e))
|
|
})
|
|
}
|
|
applyNextFilter( contentFilename )
|
|
}
|
|
|
|
sequentialFilters.push( filterCSV )
|
|
|