Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peyman MO #22

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Name

write-your-name
Peyman Mortazavi

# How many points have you earned?

0/100
90/100

(Make your own calculation and replace the number 0 with the points you think you've earned.)

# How many hours have you spent on this?

fill-in-your-answer
10 hours

# What is the most difficult part about this week's challenge?

fill-in-your-answer
It was so long !

# Show and tell (6 points)

Expand All @@ -30,25 +30,29 @@ fill-in-your-answer

## 1 (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/checkpoint1-a.png)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/checkpoint1-b.png)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/checkpoint1-c.png)

[checkpoint1](checkpoint1.html)
[checkpoint1](checkpoint1-a.html)
[checkpoint2](checkpoint1-b.html)
[checkpoint3](checkpoint1-c.html)

## 2 (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/checkpoint2.png)

[checkpoint2](checkpoint2.html)

## 3 (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/checkpoint3.png)

[checkpoint3](checkpoint3.html)

## 4 (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/checkpoint4.png)

[checkpoint4](checkpoint4.html)

Expand All @@ -58,69 +62,69 @@ fill-in-your-answer

### 1.a. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge1-a.png)

[challenge1-a](challenge1-a.html)

### 1.b. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge1-b.png)

[challenge1-b](checkpoint1-b.html)
[challenge1-b](challenge1-b.html)

### 1.c. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge1-c.png)

[challenge1-c](checkpoint1-c.html)
[challenge1-c](challenge1-c.html)

### 1.d. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge1-d.png)

[challenge1-d](checkpoint1-d.html)
[challenge1-d](challenge1-d.html)

## Challenge 2 (5 points x 6 = 30 points)

### 2.a. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge2-a.png)

### 2.b. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge2-b.png)

### 2.c. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge2-c.png)

### 2.d. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge2-d.png)

### 2.e. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge2-e.png)

### 2.f. (5 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge2-f.png)

[challenge2](checkpoint2.html)
[challenge2](challenge2.html)

## Challenge 3 (8 points x 3 = 24 points)

### 3.a. (8 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge3-a.png)

[challenge3-a](checkpoint3-a.html)
[challenge3-a](challenge3-a.html)

### 3.b. (8 points)

![image](image.png?raw=true)
![image](https://dl.dropboxusercontent.com/u/44502811/Big%20Data%20ScreenShots/Week%208/challenge3-b.png)

[challenge3-b](checkpoint3-b.html)
[challenge3-b](challenge3-b.html)

### 3.c. (8 points)

Expand Down
69 changes: 69 additions & 0 deletions challenge1-a.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.12/d3.min.js"></script>
<style type="text/css">
.chart rect {
fill: steelblue;
}

.chart text {
fill: white;
font: 10px sans-serif;
text-anchor: end;
}
</style>
</head>
<svg class="chart"></svg>
<body>
<script type="text/javascript">
var width = 600;
var height = 600;
var barHeight = 20;

var colors = ["skyblue", "steelblue", "green", "gold", "black", "orange", "maroon", "pink", "gray"];

var scaleFunction = d3.scale.linear().range([0, width]);

var chart = d3.select(".chart").attr("width", width);

d3.json("https://api.github.com/orgs/csci-4830-002-2014/repos",
function(error, data) {
dataset = data;

scaleFunction.domain([0, d3.max(data, function(d) { return d.forks_count; })]);

chart.attr("height", barHeight * data.length);

var bar = chart.selectAll("g")
.data(data)
.enter().append("g")
.attr("transform", function(d, i) { return "translate(0," + i * barHeight + ")"; });

bar.append("rect")
.attr("width", function(d) { return scaleFunction(d.forks_count); })
.attr("height", barHeight - 1)
.attr("rx", 5)
.attr("ry", 5)
.style("fill", function(d,i) { return colors[i%colors.length]; });

bar.append("text")
.attr("x", function(d) { return scaleFunction(d.forks_count) - 3; })
.attr("y", barHeight / 2)
.attr("dy", ".35em")
.text(function(d) { return d.forks_count; });

bar.append("text")
.attr("x", 5)
.attr("y", barHeight / 2)
.attr("dy", ".35em")
.style("fill", "black")
.style("text-anchor", "start")
.text(function(d) { return d.name; });

});
</script>
</body>
</html>
86 changes: 86 additions & 0 deletions challenge1-b.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3: Scaled scatterplot, resized to be bigger!</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
/* No style rules here yet */
</style>
</head>
<body>
<script type="text/javascript">

//Width and height
var w = 500;
var h = 300;
var padding = 20;

//var scaleFunction = d3.scale.linear().range([0, width]);

// var dataset = [
// [5, 20], [480, 90], [250, 50], [100, 33], [330, 95],
// [410, 12], [475, 44], [25, 67], [85, 21], [220, 88],
// [600, 150]
// ];

d3.json("https://api.github.com/orgs/csci-4830-002-2014/repos",
function(error, data) {

var xScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.size; })])
.range([padding, w - padding * 2]);

var yScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.forks_count; })])
.range([h - padding, padding]);

var rScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.forks_count; })])
.range([2, 5]);

//Create SVG element
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

svg.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr("cx", function(d) {
return xScale(d.size);
})
.attr("cy", function(d) {
return yScale(d.forks_count);
})
.attr("r", function(d) {
return rScale(d.forks_count);
});

svg.selectAll("text")
.data(data)
.enter()
.append("text")
.text(function(d) {
return d.name;
})
.attr("x", function(d) {
return xScale(d.size);
})
.attr("y", function(d) {
return yScale(d.forks_count);
})
.attr("font-family", "sans-serif")
.attr("font-size", "11px")
.attr("fill", "red");

});

//Create scale functions


</script>
</body>
</html>
85 changes: 85 additions & 0 deletions challenge1-c.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3: Scaled scatterplot, resized to be bigger!</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
/* No style rules here yet */
</style>
</head>
<body>
<script type="text/javascript">

//Width and height
var w = 500;
var h = 300;
var padding = 20;

//var scaleFunction = d3.scale.linear().range([0, width]);

// var dataset = [
// [5, 20], [480, 90], [250, 50], [100, 33], [330, 95],
// [410, 12], [475, 44], [25, 67], [85, 21], [220, 88],
// [600, 150]
// ];

d3.json("https://api.github.com/orgs/csci-4830-002-2014/repos",
function(error, data) {

var xScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.size; })])
.range([padding, w - padding * 2]);

var yScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.forks_count; })])
.range([h - padding, padding]);

var rScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.forks_count; })])
.range([2, 5]);

var colorScale = d3.scale.linear().domain([0, d3.max(data, function(d) { return d.open_issues_count; } )]).range([0,1]);

//Create SVG element
var svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);

svg.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr("cx", function(d) {
return xScale(d.size);
})
.attr("cy", function(d) {
return yScale(d.forks_count);
})
.attr("r", function(d) {
return rScale(d.forks_count);
})
.style("opacity", function(d){return colorScale(d.open_issues_count);});

svg.selectAll("text")
.data(data)
.enter()
.append("text")
.text(function(d) {
return d.name;
})
.attr("x", function(d) {
return xScale(d.size);
})
.attr("y", function(d) {
return yScale(d.forks_count);
})
.attr("font-family", "sans-serif")
.attr("font-size", "11px")
.attr("fill", "red");

});
</script>
</body>
</html>
Loading