-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a1d16f7
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.chart div { | ||
font: 10px sans-serif; | ||
background-color: steelblue; | ||
text-align: right; | ||
padding: 3px; | ||
margin: 1px; | ||
color: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>Simple chart</title> | ||
</head> | ||
|
||
<body> | ||
<div class="chart"></div> | ||
|
||
<script src="https://d3js.org/d3.v4.min.js"></script> | ||
|
||
<script> | ||
var data = [30, 86, 168, 281, 303, 365]; | ||
|
||
d3.select(".chart") | ||
.selectAll("div") | ||
.data(data) | ||
.enter() | ||
.append("div") | ||
.style("width", function (d) { | ||
return d + "px"; | ||
}) | ||
.text(function (d) { | ||
return d; | ||
}); | ||
</script> | ||
|
||
<style> | ||
.chart div { | ||
font: 10px sans-serif; | ||
background-color: steelblue; | ||
text-align: right; | ||
padding: 3px; | ||
margin: 1px; | ||
color: white; | ||
} | ||
</style> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var data = [30, 86, 168, 281, 303, 365]; | ||
|
||
d3.select(".chart") | ||
.selectAll("div") | ||
.data(data) | ||
.enter() | ||
.append("div") | ||
.style("width", function(d) { return d + "px"; }) | ||
.text(function(d) { return d; }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "d3projects", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"express": "^4.15.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var express = require("express"); | ||
var path = require("path"); | ||
|
||
var app = express(); | ||
|
||
const dir = "charts/Simple-Charts" | ||
|
||
app.use(express.static("Simple-Charts")); | ||
|
||
|
||
app.get("/", (req, res) => { | ||
res.sendFile(path.resolve(__dirname, dir, "index.html")); | ||
}) | ||
|
||
app.listen(3000, () => { | ||
console.log("App listening on port 3000"); | ||
console.log("App path files: " + path.resolve(__dirname, dir, "index.html")); | ||
}) |