Working on 4w 3

This commit is contained in:
Brady
2019-09-30 22:29:42 -06:00
parent 21d4f28699
commit f2be979bd6
12 changed files with 413 additions and 8 deletions

12
.idea/CS5890_Data_Visualization.iml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/CS5890_Data_Visualization.iml" filepath="$PROJECT_DIR$/.idea/CS5890_Data_Visualization.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

344
.idea/workspace.xml generated Normal file
View File

@@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AnalysisUIOptions">
<option name="SCOPE_TYPE" value="8" />
<option name="CUSTOM_SCOPE_NAME" value="Project Files" />
</component>
<component name="ChangeListManager">
<list default="true" id="95cda6cc-11fa-479c-aa55-189041317d70" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/hw2/js/Tree.js" beforeDir="false" afterPath="$PROJECT_DIR$/hw2/js/Tree.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hw3/d3.js" beforeDir="false" afterPath="$PROJECT_DIR$/hw3/d3.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hw3/script.js" beforeDir="false" afterPath="$PROJECT_DIR$/hw3/script.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hw4/d3.js" beforeDir="false" afterPath="$PROJECT_DIR$/hw4/d3.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hw4/hw4.html" beforeDir="false" afterPath="$PROJECT_DIR$/hw4/hw4.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hw4/js/barChart.js" beforeDir="false" afterPath="$PROJECT_DIR$/hw4/js/barChart.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hw4/js/script.js" beforeDir="false" afterPath="$PROJECT_DIR$/hw4/js/script.js" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
<ignored path="$PROJECT_DIR$/tmp/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DockManager">
<window id="1">
<content type="file-editors">
<state>
<leaf>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hw3/d3.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3025" />
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hw3/script.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1976">
<caret line="40" lean-forward="true" selection-start-line="40" selection-end-line="40" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/hw2/js/Tree.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="169">
<caret line="80" selection-start-line="80" selection-end-line="81" />
</state>
</provider>
</entry>
</file>
</leaf>
</state>
</content>
</window>
<window id="2">
<content type="file-editors">
<state>
<leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/hw4/hw4.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="473">
<caret line="64" column="28" selection-start-line="64" selection-start-column="28" selection-end-line="64" selection-end-column="28" />
</state>
</provider>
</entry>
</file>
</leaf>
</state>
</content>
</window>
</component>
<component name="FUSProjectUsageTrigger">
<session id="-934308036">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.open.time.8" value="1" />
<entry key="project.opened" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="html" value="3" />
<entry key="js" value="11" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="HTML" value="3" />
<entry key="JavaScript" value="11" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="html" value="102" />
<entry key="js" value="2582" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="HTML" value="102" />
<entry key="JavaScript" value="2582" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/hw4/js/barChart.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="23" column="6" selection-start-line="23" selection-start-column="6" selection-end-line="23" selection-end-column="6" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hw4/js/script.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-143">
<caret line="10" column="44" selection-start-line="10" selection-start-column="44" selection-end-line="10" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>chooseData</find>
<find>foreach</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/hw4/hw4.html" />
<option value="$PROJECT_DIR$/hw3/script.js" />
<option value="$PROJECT_DIR$/hw4/js/script.js" />
<option value="$PROJECT_DIR$/hw4/js/barChart.js" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds" fullScreen="true">
<option name="width" value="1920" />
<option name="height" value="1080" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="CS5890_Data_Visualization" type="b2602c69:ProjectViewProjectNode" />
<item name="CS5890_Data_Visualization" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="CS5890_Data_Visualization" type="b2602c69:ProjectViewProjectNode" />
<item name="CS5890_Data_Visualization" type="462c0819:PsiDirectoryNode" />
<item name="hw2" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="CS5890_Data_Visualization" type="b2602c69:ProjectViewProjectNode" />
<item name="CS5890_Data_Visualization" type="462c0819:PsiDirectoryNode" />
<item name="hw2" type="462c0819:PsiDirectoryNode" />
<item name="js" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="CS5890_Data_Visualization" type="b2602c69:ProjectViewProjectNode" />
<item name="CS5890_Data_Visualization" type="462c0819:PsiDirectoryNode" />
<item name="hw4" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="CS5890_Data_Visualization" type="b2602c69:ProjectViewProjectNode" />
<item name="CS5890_Data_Visualization" type="462c0819:PsiDirectoryNode" />
<item name="hw4" type="462c0819:PsiDirectoryNode" />
<item name="js" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="95cda6cc-11fa-479c-aa55-189041317d70" name="Default Changelist" comment="" />
<created>1569894134559</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1569894134559</updated>
<workItem from="1569894139996" duration="9680000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="9680000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1920" height="1080" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24960506" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
<window_info anchor="bottom" id="Terminal" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" visible="true" weight="0.2960396" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/hw3/d3.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3025" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hw4/d3.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="106" lean-forward="true" selection-start-line="106" selection-end-line="106" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hw3/script.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1976">
<caret line="40" lean-forward="true" selection-start-line="40" selection-end-line="40" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hw2/hw2.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/hw4/js/script.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-143">
<caret line="10" column="44" selection-start-line="10" selection-start-column="44" selection-end-line="10" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hw2/js/Tree.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="169">
<caret line="80" selection-start-line="80" selection-end-line="81" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hw4/hw4.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="473">
<caret line="64" column="28" selection-start-line="64" selection-start-column="28" selection-end-line="64" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hw4/js/barChart.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="23" column="6" selection-start-line="23" selection-start-column="6" selection-end-line="23" selection-end-column="6" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@@ -96,7 +96,7 @@ class Tree {
.attr("r", 35) .attr("r", 35)
.attr("cx", (node.level+3) * 100) .attr("cx", (node.level+3) * 100)
.attr("cy", (node.position+3) * 100) .attr("cy", (node.position+3) * 100);
svgElement.append("text") svgElement.append("text")
.attr("class", "label") .attr("class", "label")
.attr("dx", (node.level+3) * 100) .attr("dx", (node.level+3) * 100)

4
hw3/d3.js vendored
View File

@@ -5390,8 +5390,8 @@ function contours() {
// Marching squares with isolines stitched into rings. // Marching squares with isolines stitched into rings.
// Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js
function isorings(values, value, callback) { function isorings(values, value, callback) {
var fragmentByStart = new Array, var fragmentByStart = [],
fragmentByEnd = new Array, fragmentByEnd = [],
x, y, t0, t1, t2, t3; x, y, t0, t1, t2, t3;
// Special case for the first row (y = -1, t2 = t3 = 0). // Special case for the first row (y = -1, t2 = t3 = 0).

View File

@@ -24,7 +24,7 @@ function update(data) {
.range([0, 150]); .range([0, 150]);
let bScale = d3.scaleLinear() let bScale = d3.scaleLinear()
.domain([0, d3.max(data, d => d.b)]) .domain([0, d3.max(data, d => d.b)])
.range([0, 150]); .range([0, 150]
let iScale = d3.scaleLinear() let iScale = d3.scaleLinear()
.domain([0, data.length]) .domain([0, data.length])
.range([0, 110]); .range([0, 110]);

4
hw4/d3.js vendored
View File

@@ -5390,8 +5390,8 @@ function contours() {
// Marching squares with isolines stitched into rings. // Marching squares with isolines stitched into rings.
// Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js
function isorings(values, value, callback) { function isorings(values, value, callback) {
var fragmentByStart = new Array, var fragmentByStart = [],
fragmentByEnd = new Array, fragmentByEnd = [],
x, y, t0, t1, t2, t3; x, y, t0, t1, t2, t3;
// Special case for the first row (y = -1, t2 = t3 = 0). // Special case for the first row (y = -1, t2 = t3 = 0).

View File

@@ -20,7 +20,7 @@
<header> <header>
<img src="assets/fifa_russia_logo.png" alt="Fifa WC Russia Logo" id="logo"/> <img src="assets/fifa_russia_logo.png" alt="Fifa WC Russia Logo" id="logo"/>
<h1>Exploring FIFA World Cup Statistics: CS-5630/6630 Homework 4</h1> <h1>Exploring FIFA World Cup Statistics: CS-5630/6630 Homework 4</h1>
<div>Name: YOURNAME; E-Mail: YOUREMAIL; A#: A12345678</div> <div>Name: Brady Bodily; E-Mail: brady.bodily1@aggiemail.usu.edu; A#: A00987897</div>
</header> </header>
<div id="details" class="view"> <div id="details" class="view">

View File

@@ -21,7 +21,16 @@ class BarChart {
// Create the x and y scales; make // Create the x and y scales; make
// sure to leave room for the axes // sure to leave room for the axes
let data = this.chooseData(selectedDimension);
let xaxisHeight = 20;
let yaxisWidth = 20;
let dataNum = [];
data.forEach(x => dataNum.push(x.data));
let datadate = [];
data.forEach(x => datadate.push(x.date));
// Create colorScale // Create colorScale
@@ -51,5 +60,19 @@ class BarChart {
// ******* TODO: PART I ******* // ******* TODO: PART I *******
//Changed the selected data when a user selects a different //Changed the selected data when a user selects a different
// menu item from the drop down. // menu item from the drop down.
let currentDataType = d3.select('#dataset')
.node().value;
//.property("value");
let selectedData = [];
this.allData.forEach(x => {
var item = [];
item.date = x["year"];
item.data = x[currentDataType];
selectedData.push(item);
});
console.log(this.allData);
console.log(selectedData);
return selectedData;
} }
} }

View File

@@ -46,5 +46,11 @@ function chooseData() {
// ******* TODO: PART I ******* // ******* TODO: PART I *******
// Changed the selected data when a user selects a different // Changed the selected data when a user selects a different
// menu item from the drop down. // menu item from the drop down.
let currentDataType = d3.select('#dataset')
.node().value;
//.property("value");
let selectedData = [];
this.allData.forEach(x => selectedData.push(x[currentDataType]));
return selectedData;
} }