keefereuther commited on
Commit
a970d92
·
1 Parent(s): 77ddc6f

Update space

Browse files
Files changed (3) hide show
  1. README.md +31 -12
  2. index.html +37 -19
  3. style.css +60 -18
README.md CHANGED
@@ -1,12 +1,31 @@
1
- ---
2
- title: Ojs Confidence Intervals
3
- emoji: 📊
4
- colorFrom: green
5
- colorTo: pink
6
- sdk: static
7
- pinned: false
8
- license: gpl-3.0
9
- short_description: Teaching Confidence Intervals in D3 OJS
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Confidence Intervals OJS/D3 Version
2
+
3
+ This is a reimplementation of the Confidence Intervals app using Observable JavaScript (OJS) and D3.js.
4
+
5
+ ## Local Development
6
+
7
+ 1. Install Node.js if you don't have it already
8
+ 2. Clone this repository
9
+ 3. Navigate to the ojs_version directory
10
+ 4. Run a local server:
11
+ ```
12
+ npx http-server
13
+ ```
14
+ 5. Open your browser to http://localhost:8080
15
+
16
+ ## Hosting on Hugging Face Spaces
17
+
18
+ 1. Create a new Space on Hugging Face (https://huggingface.co/spaces)
19
+ 2. Choose "Static HTML" as the Space type
20
+ 3. Upload these files to your Space repository:
21
+ - index.html
22
+ - style.css
23
+ - script.js
24
+ - any other assets
25
+ 4. Your app will be hosted at https://huggingface.co/spaces/[your-username]/[your-space-name]
26
+
27
+ ## Structure
28
+
29
+ - `index.html`: Main HTML file that loads the OJS runtime and D3
30
+ - `script.js`: Contains the OJS code for the interactive visualizations
31
+ - `style.css`: Styling for the application
index.html CHANGED
@@ -1,19 +1,37 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Confidence Intervals Interactive</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
9
+ <script type="module">
10
+ import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@5/dist/runtime.js";
11
+ import define from "./script.js";
12
+ new Runtime().module(define, name => {
13
+ return new Inspector(document.querySelector(`#${name}`));
14
+ });
15
+ </script>
16
+ </head>
17
+ <body>
18
+ <header>
19
+ <h1>Learning about Confidence Intervals</h1>
20
+ <h5>Created by Keefe Reuther, OJS version</h5>
21
+ </header>
22
+
23
+ <div class="tabs">
24
+ <button class="tab-btn active" data-tab="single-sample">Single Sample</button>
25
+ <button class="tab-btn" data-tab="multiple-samples">Multiple Samples</button>
26
+ <button class="tab-btn" data-tab="bootstrapping">Bootstrapping</button>
27
+ </div>
28
+
29
+ <div id="content">
30
+ <div id="tab1" class="viewof-singleSampleSD"></div>
31
+ <div id="singleSamplePlot"></div>
32
+ <!-- More observable outputs will be placed here -->
33
+ </div>
34
+
35
+ <script src="ui.js"></script>
36
+ </body>
37
+ </html>
style.css CHANGED
@@ -1,28 +1,70 @@
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  body {
2
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
3
+ max-width: 1200px;
4
+ margin: 0 auto;
5
+ padding: 20px;
6
  }
7
 
8
+ header {
9
+ text-align: center;
10
+ margin-bottom: 20px;
11
  }
12
 
13
+ .tabs {
14
+ display: flex;
15
+ margin-bottom: 20px;
16
+ border-bottom: 1px solid #ddd;
 
17
  }
18
 
19
+ .tab-btn {
20
+ background: none;
21
+ border: none;
22
+ padding: 10px 20px;
23
+ cursor: pointer;
24
+ font-size: 16px;
25
  }
26
 
27
+ .tab-btn.active {
28
+ border-bottom: 3px solid #4e79a7;
29
+ font-weight: bold;
30
  }
31
+
32
+ #content {
33
+ display: flex;
34
+ flex-wrap: wrap;
35
+ }
36
+
37
+ .control-panel {
38
+ width: 300px;
39
+ padding: 20px;
40
+ background-color: #f5f5f5;
41
+ border-radius: 5px;
42
+ }
43
+
44
+ .input-group {
45
+ margin-bottom: 15px;
46
+ }
47
+
48
+ label {
49
+ display: block;
50
+ margin-bottom: 5px;
51
+ }
52
+
53
+ button {
54
+ background-color: #4e79a7;
55
+ color: white;
56
+ border: none;
57
+ padding: 10px 15px;
58
+ border-radius: 4px;
59
+ cursor: pointer;
60
+ }
61
+
62
+ button:hover {
63
+ background-color: #3a5a80;
64
+ }
65
+
66
+ hr {
67
+ margin: 20px 0;
68
+ border: none;
69
+ border-top: 1px solid #ddd;
70
+ }