diff --git a/arcade.html b/arcade.html new file mode 100644 index 0000000..3046ce5 --- /dev/null +++ b/arcade.html @@ -0,0 +1,18 @@ + + + + + + + + ← Back +

ARCADE Simularium Library

+
+ + + + + + diff --git a/index.html b/index.html index 3465d79..b28d5bb 100644 --- a/index.html +++ b/index.html @@ -6,9 +6,21 @@

Simularium Trajectory Libraries

-

Main Simularium Library

+

Main Library

https://aics-simularium-data.s3.us-east-2.amazonaws.com
+
+

AICS ReaDDy Library

+ https://readdy-working-bucket.s3.us-west-2.amazonaws.com +
+
+

AICS PhysiCell Library

+ https://physicell-working-bucket.s3.us-west-2.amazonaws.com +
+
+

ARCADE Library

+ https://arcade-working-bucket.s3.us-west-2.amazonaws.com +
diff --git a/list.js b/list.js index fd6f16c..15b791e 100644 --- a/list.js +++ b/list.js @@ -4,6 +4,11 @@ jQuery(function($) { } else { var url = location.protocol + '//' + location.hostname; } + if (typeof EXCLUDE_DIRS != 'undefined') { + var exclude_dirs = EXCLUDE_DIRS; + } else { + var exclude_dirs = []; + } $.get(url) .done(function(data) { var xml = $(data); @@ -15,10 +20,10 @@ jQuery(function($) { Size: item.find('Size').text(), } }); - renderTable(files, url); + renderTable(files, url, exclude_dirs); }) .fail(function(error) { - alert('There was an error'); + alert(url + ' is not accessible, check that everyone has permission to list files and that the CORS policy allows GET from all origins'); console.log(error); }); }); @@ -45,22 +50,44 @@ var formatSize = function (str) { return ( size / Math.pow(1024, i) ).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; } -function renderTable(files, bucket_url) { +function renderTable(files, bucket_url, exclude_dirs) { + var n_files = files.length; + var n_files_listed = 0; var content = '

' + bucket_url + '

'; - content += '
Choose a file to load in the Simularium Viewer.
'; + content += '
Found ' + n_files + ' file(s) '; + if (n_files === 1000) + { + content += '(This is the maximum listable)'; + } + content += '

Choose a file to load in the Simularium Viewer.
'; $.each(files, function(idx, item) { var key = item.Key; var ext = getExtension(key); if (ext === "simularium") { - var filename = camalize(getFilename(key)); - var link = "https://simularium.allencell.org/viewer?trajUrl=" + bucket_url + "/" + key; - content += '

' + filename + '

'; - content += key + '
'; - content += 'Modified: ' + formatDate(item.LastModified) + ' ', - content += 'Size: ' + formatSize(item.Size) + '
'; + var exclude = false; + $.each(exclude_dirs, function(dir) { + if (key.includes(exclude_dirs[dir])) + { + exclude = true; + } + }); + if (!exclude) + { + var filename = camalize(getFilename(key)); + var link = "https://simularium.allencell.org/viewer?trajUrl=" + bucket_url + "/" + key; + content += '

' + filename + '

'; + content += key + '
'; + content += 'Modified: ' + formatDate(item.LastModified) + ' ', + content += 'Size: ' + formatSize(item.Size) + '
'; + n_files_listed++; + } } }); + if (n_files > 0 && n_files_listed === 0) + { + content += '
No .simularium files found in the first 1000 files (alphabetically) that were not in excluded directories.
'; + } document.getElementById('listing').innerHTML = '
' + content + '
'; } diff --git a/main.css b/main.css index a5c6391..faac770 100644 --- a/main.css +++ b/main.css @@ -53,6 +53,14 @@ h3 { margin-bottom: 40; } +.error { + font-family: Overpass; + font-size: 16px; + margin-left: 15; + margin-bottom: 40; + color: red; +} + h2 { font-family: Overpass; margin-bottom: 0; diff --git a/main.html b/main.html index 31877c0..120e62a 100644 --- a/main.html +++ b/main.html @@ -1,5 +1,6 @@ + diff --git a/physicell.html b/physicell.html new file mode 100644 index 0000000..1837bca --- /dev/null +++ b/physicell.html @@ -0,0 +1,18 @@ + + + + + + + + ← Back +

AICS PhysiCell Simularium Library

+
+ + + + + + diff --git a/readdy.html b/readdy.html new file mode 100644 index 0000000..3c69dd9 --- /dev/null +++ b/readdy.html @@ -0,0 +1,19 @@ + + + + + + + + ← Back +

AICS ReaDDy Simularium Library

+
+ + + + + +