Commit 213216dc authored by Porter Libby's avatar Porter Libby
Browse files

remove extra file

parent cb87b6d0
// Test data for now
// Mimic form of JSON input for future development
var items = [{
'name': "First Year Advising",
'items': [],
'type': "circle-1",
'column': 0
},
{
'name': "Career Exploration",
'items': [],
'type': "circle-2",
'column': 0
},
{
'name': "Campus Life",
'items': [],
'type': "square-2",
'column': 1
},
{
'name': "Community Engagement",
'items': [],
'type': "square-5",
'column': 1
},
{
'name': "Career Exploration",
'items': [],
'type': "circle-1",
'column': 1
},
{
'name': "Major Selection",
'items': [],
'type': "square-3",
'column': 2
},
{
'name': "Research",
'items': [],
'type': "square-4",
'column': 2
},
{
'name': "Internship",
'items': [],
'type': "square-5",
'column': 2
},
{
'name': "Off-Campus Study",
'items': [],
'type': "square-1",
'column': 3
},
{
'name': "Career",
'items': [],
'type': "square-2",
'column': 3
}];
var container = document.getElementById("flow-chart-container");
var columns = items[items.length - 1].column;
// main render
function main(){
// loop over the colums in in the chart
console.table(items);
console.log(columns);
for (j = 0; j < columns + 1; j++){
var column = document.createElement('div');
column.className = 'flow-chart-column';
// loop over the items in each column
for (i = 0; i < items.length; i++){
if (items[i].column == j) {
var line = document.createElement('div');
line.className = 'flow-chart-line-down';
line.innerHTML = "<svg height='40px' width='100%'><line x1='50%' y1='0' x2='50%' y2='40' stroke-dasharray='4' style='stroke:rgb(0,0,0);stroke-width:2' /></svg>"
// create div of specific shape
var elem = document.createElement("div");
elem.className = "flow-chart-block flow-chart-" + items[i].type;
// create text to go in div
var text = document.createElement("p");
text.innerText = items[i].name;
// append elements together
elem.append(text);
column.append(line);
column.append(elem);
}
}
var endline = document.createElement('div');
endline.className = 'flow-chart-line-down';
endline.innerHTML = "<svg height='40px' width='100%'><line x1='50%' y1='0' x2='50%' y2='40' stroke-dasharray='4' style='stroke:rgb(0,0,0);stroke-width:2' /></svg>"
if (j != columns){
column.append(endline);
}
container.append(column);
}
}
main();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment