From cdfe9de4415503e78a47cb814a31930916322a19 Mon Sep 17 00:00:00 2001 From: David Honegger Rogers Date: Thu, 14 Apr 2022 14:29:10 -0600 Subject: [PATCH 1/6] look and feel --- cinema/lib/2.2/common.css | 38 ++++++++++++++++++++++++++++++++++-- cinema/lib/2.2/view.css | 26 ------------------------ cinema/view/2.2/css/view.css | 26 ------------------------ cinema_explorer.html | 2 +- cinema_simple.html | 3 +-- cinema_view.html | 3 +-- 6 files changed, 39 insertions(+), 59 deletions(-) delete mode 100644 cinema/lib/2.2/view.css delete mode 100644 cinema/view/2.2/css/view.css diff --git a/cinema/lib/2.2/common.css b/cinema/lib/2.2/common.css index b12697a..c4377ca 100644 --- a/cinema/lib/2.2/common.css +++ b/cinema/lib/2.2/common.css @@ -14,16 +14,50 @@ body { header, footer { padding-left: 1px; padding-right: 1px; - padding-top: 10px; - padding-bottom: 10px; color: white; background-color: #373737; clear: left; text-align: center; } +header { + padding-top: 1px; + padding-bottom: 1px; +} + +footer { + padding-top: 10px; + padding-bottom: 10px; +} + #header h2 { display: inline-block; margin: initial; } +#resultsArea { + float: left; + left: 0px; + right: 0px; + width: 100%; + padding: 10px; + background-color: white; +} + +.imageArea { + float: left; + position: relative; + width: 75%; +} + +.sliderArea { + float: left; + position: relative; + width: 20%; +} + +.cinemaImage { + float: left; + position: relative; + padding: 2px; +} diff --git a/cinema/lib/2.2/view.css b/cinema/lib/2.2/view.css deleted file mode 100644 index 8080383..0000000 --- a/cinema/lib/2.2/view.css +++ /dev/null @@ -1,26 +0,0 @@ -#resultsArea { - float: left; - left: 0px; - right: 0px; - width: 100%; - padding: 10px; - background-color: white; -} - -.imageArea { - float: left; - position: relative; - width: 75%; -} - -.sliderArea { - float: left; - position: relative; - width: 20%; -} - -.cinemaImage { - float: left; - position: relative; - padding: 2px; -} diff --git a/cinema/view/2.2/css/view.css b/cinema/view/2.2/css/view.css deleted file mode 100644 index 8080383..0000000 --- a/cinema/view/2.2/css/view.css +++ /dev/null @@ -1,26 +0,0 @@ -#resultsArea { - float: left; - left: 0px; - right: 0px; - width: 100%; - padding: 10px; - background-color: white; -} - -.imageArea { - float: left; - position: relative; - width: 75%; -} - -.sliderArea { - float: left; - position: relative; - width: 20%; -} - -.cinemaImage { - float: left; - position: relative; - padding: 2px; -} diff --git a/cinema_explorer.html b/cinema_explorer.html index 550de16..3597c2e 100644 --- a/cinema_explorer.html +++ b/cinema_explorer.html @@ -84,7 +84,7 @@
-
 
+
From db54b9db3d6ad2a41253b482f44ae038749a452b Mon Sep 17 00:00:00 2001 From: David Honegger Rogers Date: Fri, 15 Apr 2022 09:07:55 -0600 Subject: [PATCH 4/6] updating common look --- cinema/lib/2.2/common.css | 12 +++++++++--- cinema_simple.html | 6 ++++-- cinema_view.html | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cinema/lib/2.2/common.css b/cinema/lib/2.2/common.css index eb6b8cf..380720c 100644 --- a/cinema/lib/2.2/common.css +++ b/cinema/lib/2.2/common.css @@ -9,22 +9,28 @@ div.container { body { background-color: #f9f9f9; + margin: 0; } header, footer { + font-weight: bold; padding-left: 1px; padding-right: 1px; - padding-top: 2px; - padding-bottom: 2px; + padding-top: 10px; + padding-bottom: 10px; color: white; background-color: #373737; clear: left; text-align: center; } +footer { + padding-top: 2px; + padding-bottom: 2px; +} + #header h2 { display: inline-block; - margin: initial; } #resultsArea { diff --git a/cinema_simple.html b/cinema_simple.html index b78b368..db44c80 100644 --- a/cinema_simple.html +++ b/cinema_simple.html @@ -19,7 +19,7 @@
-

Cinema:Simple

+ Cinema:Simple
@@ -57,6 +57,7 @@

Cinema:Simple

dataSets.forEach(function(item, index) { q.defer(d3.csv, item + "/data.csv"); }); + q.awaitAll(function(error, results) { var values = {}; results.forEach(function(item, index) { @@ -105,7 +106,8 @@

Cinema:Simple

}); } -function doneLoading(results, values) { +function doneLoading(results, values) +{ var imageSizeSlider = d3.select("#imageSize") .property("value", (100/dataSets.length)-1) .on("input", function() { diff --git a/cinema_view.html b/cinema_view.html index befc659..c912c0f 100644 --- a/cinema_view.html +++ b/cinema_view.html @@ -21,7 +21,7 @@
-

Cinema:View

+ Cinema:View
From 38a2b1cabb0dd2bda3e2ac93751577ddfe1fa2b7 Mon Sep 17 00:00:00 2001 From: David Honegger Rogers Date: Fri, 15 Apr 2022 09:10:24 -0600 Subject: [PATCH 5/6] update --- cinema_simple.html | 2 ++ cinema_view.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cinema_simple.html b/cinema_simple.html index db44c80..6ffd3ce 100644 --- a/cinema_simple.html +++ b/cinema_simple.html @@ -19,7 +19,9 @@
+ Cinema:Simple +
diff --git a/cinema_view.html b/cinema_view.html index c912c0f..321d9ff 100644 --- a/cinema_view.html +++ b/cinema_view.html @@ -21,7 +21,9 @@
+ Cinema:View +
From 1e20a88f743194f45bdcb9cfbd58a744a00c8936 Mon Sep 17 00:00:00 2001 From: David Honegger Rogers Date: Fri, 15 Apr 2022 10:23:01 -0600 Subject: [PATCH 6/6] updating tests --- cinema/lib/2.2/common.css | 3 +-- cinema/view/2.2/main.js | 1 + citation.md => doc/citation.md | 0 testing/explorer/browser.py | 2 +- testing/explorer/small.json | 6 ++--- testing/view/browser.py | 9 +++++++ testing/view/server.py | 10 ++++++++ testing/view/small.json | 24 +++++++++++------ testplan_explorer.html | 47 ++++++++++++++++++++++++++++++---- testplan_view.html | 32 +++++++++++++++++++++++ 10 files changed, 115 insertions(+), 19 deletions(-) rename citation.md => doc/citation.md (100%) create mode 100644 testing/view/browser.py create mode 100644 testing/view/server.py diff --git a/cinema/lib/2.2/common.css b/cinema/lib/2.2/common.css index 380720c..5602b54 100644 --- a/cinema/lib/2.2/common.css +++ b/cinema/lib/2.2/common.css @@ -61,8 +61,7 @@ footer { .cinemaImage { float: left; - position: relative; - padding: 2px; + border: 1px solid black; } .flex-container { diff --git a/cinema/view/2.2/main.js b/cinema/view/2.2/main.js index 2eb7df9..82f6da2 100644 --- a/cinema/view/2.2/main.js +++ b/cinema/view/2.2/main.js @@ -295,6 +295,7 @@ function optionSelected() .attr("id", "image_div_" + index.toString()) .style("width","" + imageSizeSlider.node().value + "%") .style("text-align","center") + .style("margin","5px") .text(datasetNamestoLoad[index]) .append("img") diff --git a/citation.md b/doc/citation.md similarity index 100% rename from citation.md rename to doc/citation.md diff --git a/testing/explorer/browser.py b/testing/explorer/browser.py index b955217..b665035 100644 --- a/testing/explorer/browser.py +++ b/testing/explorer/browser.py @@ -3,7 +3,7 @@ # open several instances of URL to test webbrowser.open_new("http://127.0.0.1:8000/cinema_explorer.html") -webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_explorer.html?databases=testing/small.json") +webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_explorer.html?databases=testing/explorer/small.json") webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_explorer.html?databases=data/sphere.cdb") webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_explorer.html?databases=data/sphere_multi-image.cdb,data/sphere.cdb") diff --git a/testing/explorer/small.json b/testing/explorer/small.json index c008774..8fd711f 100644 --- a/testing/explorer/small.json +++ b/testing/explorer/small.json @@ -1,14 +1,14 @@ [ { - "name" : "sphere", + "name" : "testing explorer: sphere", "directory" : "data/sphere.cdb" }, { - "name" : "Sphere Multi-Image", + "name" : "testing explorer: Sphere Multi-Image", "directory" : "data/sphere_multi-image.cdb" }, { - "name" : "Many File Types", + "name" : "testing explorer: Many File Types", "directory" : "data/file_types.cdb" } ] diff --git a/testing/view/browser.py b/testing/view/browser.py new file mode 100644 index 0000000..017e7f4 --- /dev/null +++ b/testing/view/browser.py @@ -0,0 +1,9 @@ +import webbrowser + + +# open several instances of URL to test +webbrowser.open_new("http://127.0.0.1:8000/cinema_view.html") +webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_view.html?databases=testing/view/small.json") +webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_view.html?databases=data/sphere.cdb") +webbrowser.open_new_tab("http://127.0.0.1:8000/cinema_view.html?databases=data/sphere_multi-image.cdb,data/sphere.cdb") + diff --git a/testing/view/server.py b/testing/view/server.py new file mode 100644 index 0000000..869b93c --- /dev/null +++ b/testing/view/server.py @@ -0,0 +1,10 @@ +import http.server +import socketserver + +PORT = 8000 + +handler = http.server.SimpleHTTPRequestHandler + +with socketserver.TCPServer(("", PORT), handler) as httpd: + print("Server started at localhost:" + str(PORT)) + httpd.serve_forever() diff --git a/testing/view/small.json b/testing/view/small.json index ad48110..9bbf681 100644 --- a/testing/view/small.json +++ b/testing/view/small.json @@ -1,18 +1,26 @@ [ { - "database_name-comment" : "The name of the dataset. It will appear in the dropdown.", - "database_name": "sphere test", - - "databases-comment" : "JSON array containing list of datasets to view", + "database_name": "testing view: sphere", "datasets": [ { - "name-comment": "Each dataset must have a name that will appear at the top of the image", - "name": "sphere", - - "location-comment" : "Location of the cinema database relative to cinema root or absolute paths", + "name": "testing view: sphere", "location": "data/sphere.cdb" } ] + }, + { + "database_name": "testing view: sedov", + "datasets": + [ + { + "name": "testing view: sedov1", + "location": "data/sedov1.cdb" + }, + { + "name": "testing view: sedov2", + "location": "data/sedov2.cdb" + } + ] } ] diff --git a/testplan_explorer.html b/testplan_explorer.html index e828c96..2366ee8 100644 --- a/testplan_explorer.html +++ b/testplan_explorer.html @@ -3,25 +3,62 @@

Cinema Explorer URL Test Plan

The following links test attribute passing over URL:

+

No server

- + - + - + - + - + + +
Normal behaviorcinema_explorer.html + cinema_explorer.html
Passing a database.json filecinema_explorer.html?databases=testing/explorer/small.json + cinema_explorer.html?databases=testing/explorer/small.json
Passing a single databasecinema_explorer.html?databases=data/sphere_multi-image.cdb + cinema_explorer.html?databases=data/sphere_multi-image.cdb
Passing multiple databasescinema_explorer.html?databases=data/sphere_multi-image.cdb,data/sphere.cdb + cinema_explorer.html?databases=data/sphere_multi-image.cdb,data/sphere.cdb
Passing ParaView databasecinema_explorer.html?databases=data/test_paraview.cdb + cinema_explorer.html?databases=data/test_paraview.cdb
+ +

With server

+Run server at testing/explorer/server.py +

+ + + + + + + + + + + + + + + + + + + +
Normal behavior + cinema_explorer.html
Passing a database.json file + cinema_explorer.html?databases=testing/explorer/small.json
Passing a single database + cinema_explorer.html?databases=data/sphere_multi-image.cdb
Passing multiple databases + cinema_explorer.html?databases=data/sphere_multi-image.cdb,data/sphere.cdb
Passing ParaView database + cinema_explorer.html?databases=data/test_paraview.cdb
diff --git a/testplan_view.html b/testplan_view.html index d5e5580..851f8f0 100644 --- a/testplan_view.html +++ b/testplan_view.html @@ -3,6 +3,7 @@

Cinema View URL Test Plan

The following links test attribute passing over URL, within the browser:

+

No server

@@ -30,3 +31,34 @@

Cinema View URL Test Plan

cinema_view.html?databases=data/test_paraview.cdb&assetname=FILE_png
Normal behavior
+ +

With server

+Run server at testing/view/server.py +

+ + + + + + + + + + + + + + + + + + + + + +
Normal behavior + cinema_view.html
Passing a database.json file + cinema_view.html?databases=testing/view/small.json
Single database + cinema_view.html?databases=data/sedov3.cdb
Multiple databases + cinema_view.html?databases=data/sedov3.cdb,data/sedov2.cdb,data/sedov1.cdb
Loading ParaView database (assetname attribute) + cinema_view.html?databases=data/test_paraview.cdb&assetname=FILE_png