D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for...

12
D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set the height and width parameters var svg = d3.select("div").select("div") .append("svg") .attr("height",h) .attr("width", w) .style("border", "1px solid black"); if(dataSource == 0){ d3.json("covtype.csv", function(error, root) { console.log(root); if (error) throw error; //Create the scale for the scatter plot var xScale = d3.scale.linear() .domain([d3.min(dataset, function(d) { return d[0];}),d3.max(dataset, function(d) { return d[0];})]) .range([-1,1]); var yScale = d3.scale.linear() .domain([d3.min(dataset, function(d) { return d[1];}),d3.max(dataset, function(d) { return d[1];})]) .range([-1,1]); //This is the function that creates the SVG lines var line = svg.selectAll("line") .data(lisa) .enter() .append("line");

Transcript of D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for...

Page 1: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set

D3.js for scatter plot with line

var w = 200;

var h = 200;

//create the svg element and set the height and width parameters

var svg = d3.select("div").select("div")

.append("svg")

.attr("height",h)

.attr("width", w)

.style("border", "1px solid black");

if(dataSource == 0){

d3.json("covtype.csv", function(error, root) {

console.log(root);

if (error) throw error;

//Create the scale for the scatter plot

var xScale = d3.scale.linear()

.domain([d3.min(dataset, function(d) { return d[0];}),d3.max(dataset, function(d) { return d[0];})])

.range([-1,1]);

var yScale = d3.scale.linear()

.domain([d3.min(dataset, function(d) { return d[1];}),d3.max(dataset, function(d) { return d[1];})])

.range([-1,1]);

//This is the function that creates the SVG lines

var line = svg.selectAll("line")

.data(lisa)

.enter()

.append("line");

Page 2: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set

//This gets the cooresponding x,y cordinates from the dataset

line.attr("x1", function(d) {

return xScale(d[0]);

})

.attr("y1", function(d) {

return yScale(d[1]);

})

.attr("x2", function(d) {

return xScale(d[2]);

})

.attr("y2", function(d) {

return yScale(d[3]);

})

.attr("stroke", "black");

PCA in Python -Jupyter NoteBook

Page 3: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set

Feature Extraction, Model building and performance evaluation

Page 4: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 5: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 6: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 7: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 8: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 9: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 10: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 11: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set
Page 12: D3.js for scatter plot with lineathena.ecs.csus.edu/~natesha/Project_Source_Code.pdf · D3.js for scatter plot with line var w = 200; var h = 200; //create the svg element and set