-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
619 lines (497 loc) · 18.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
<!DOCTYPE html>
<head>
<title>
UBS Organizational Chart
</title>
<link rel="shortcut icon" href="favicon.ico">
</head>
<!-- HYPERLINK TESTING -->
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<!-- Sidebar -->
<div class="w3-sidebar w3-bar-block w3-animate-right" style="display:none;z-index:5;right:0" id="mySidebar">
<button class="w3-bar-item w3-button w3-large" onclick="w3_close()">Close ×</button>
<a href="#" class="w3-bar-item w3-button">UBS Careers</a>
<a href="#" class="w3-bar-item w3-button">Connections</a>
<a href="#" class="w3-bar-item w3-button">Job Board</a>
<a href="#" class="w3-bar-item w3-button">WhoIsWho</a>
<a href="#" class="w3-bar-item w3-button">HRi</a>
</div>
<!-- Page Content -->
<div class="w3-overlay w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" id="myOverlay"></div>
<div>
<button class="w3-button w3-white w3-xxlarge w3-right" onclick="w3_open()">☰</button>
<div class="w3-container">
<h1 align="center">Navi</h1>
<p align="center"> For information, please look to the bottom or to the right (v1.1).</p>
</div>
</div>
<script>
function w3_open() {
document.getElementById("mySidebar").style.display = "block";
document.getElementById("myOverlay").style.display = "block";
}
function w3_close() {
document.getElementById("mySidebar").style.display = "none";
document.getElementById("myOverlay").style.display = "none";
}
</script>
</html>
<br></br>
<!-- HYPERLINK TESTING 2 -->
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
<meta charset="utf-8">
<style>
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Open+Sans:400,600">
<link rel="stylesheet" type="text/css" href="sequences.css"/>
circle,
path {
cursor: pointer;
}
circle {
fill: none;
pointer-events: all;
}
#tooltip { background-color: white;
padding: 3px 5px;
border: 1px solid black;
text-align: center;}
html {
font-family: sans-serif;
}
</style>
<body>
<script type = "text/javascript" src = "d3.v3.min.js"></script>
<!-- <script src="http://d3js.org/d3.v3.min.js"></script> -->
<script>
var margin = {top: 350, right: 480, bottom: 350, left: 480},
radius = Math.min(margin.top, margin.right, margin.bottom, margin.left) - 10;
function filter_min_arc_size_text(d, i) {return (d.dx*d.depth*radius/3)>14};
var hue = d3.scale.category10();
var luminance = d3.scale.sqrt()
.domain([0, 1e6])
.clamp(true)
.range([90, 20]);
var svg = d3.select("body").append("svg")
.attr("width", margin.left + margin.right)
.attr("height", margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var partition = d3.layout.partition()
.sort(function(a, b) { return d3.ascending(a.name, b.name); })
.size([2 * Math.PI, radius]);
var arc = d3.svg.arc()
.startAngle(function(d) { return d.x; })
.endAngle(function(d) { return d.x + d.dx - .01 / (d.depth + .5); })
.innerRadius(function(d) { return radius / 3 * d.depth; })
.outerRadius(function(d) { return radius / 3 * (d.depth + 1) - 1; });
//Tooltip description
var tooltip = d3.select("body")
.append("div")
.attr("id", "tooltip")
.style("position", "absolute")
.style("z-index", "10")
.style("opacity", 0);
function format_number(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
// function format_description(d) {
// var description = d.description;
// return '<b>' + d.name + '</b></br>'+ d.description + '<br> (' + format_number(d.value) + ')';
// }
function format_description(d) {
if (d.position == null) {
var description = d.description;
return '<b>' + d.name + '</b></br>'+ d.description + '<br>' + help_format(d); /////////////CONNECTIONS DATA?
}
var description = d.description;
return '<b>' + d.name + '</b></br>'+ d.description + '<br> Position: ' + d.position;
}
function long_names(d) {
var str = d.name;
var matches = str.match(/\b(\w)/g); // ['J','S','O','N']
var acronym = matches.join(''); // JSON
if (str.length >= 13) {
return '<b>' + acronym + '</b></br>' + d.name + '<br>'
}
return '<b>' + d.name + '</b></br>'
}
//ADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD "position" data as well? so something to default on?
//MAYBE return HEADCOUNT (with 0 as basic employee)
function help_format(d) {
if (String(d.size) === "undefined") {
return ""
}
return '(' + d.size + ')'
}
function getAngle(d) {
var angle=(d.x +d.dx/2)*180/Math.PI - 90
return angle;
}
// function getAngle(d) {
// // Offset the angle by 90 deg since the '0' degree axis for arc is Y axis, while
// // for text it is the X axis.
// var thetaDeg = (180 / Math.PI * (arc.startAngle()(d) + arc.endAngle()(d)) / 2 - 90);
// // If we are rotating the text by more than 90 deg, then "flip" it.
// // This is why "text-anchor", "middle" is important, otherwise, this "flip" would
// // a little harder.
// return (thetaDeg > 90) ? thetaDeg - 180 : thetaDeg;
// }
//EDITING 1
function mouseover(d) {
var percentage = (100 * d.value / totalSize).toPrecision(3);
var percentageString = percentage + "%";
if (percentage < 0.1) {
percentageString = "< 0.1%";
}
d3.select("#percentage")
.text(percentageString);
d3.select("#explanation")
.style("visibility", "");
var sequenceArray = getAncestors(d);
updateBreadcrumbs(sequenceArray, percentageString);
// Fade all the segments.
d3.selectAll("path")
.style("opacity", 0.3);
// Then highlight only those that are an ancestor of the current segment.
vis.selectAll("path")
.filter(function(node) {
return (sequenceArray.indexOf(node) >= 0);
})
.style("opacity", 1);
}
// Restore everything to full opacity when moving off the visualization.
function mouseleave(d) {
// Hide the breadcrumb trail
d3.select("#trail")
.style("visibility", "hidden");
// Deactivate all segments during transition.
d3.selectAll("path").on("mouseover", null);
// Transition each segment to full opacity and then reactivate it.
d3.selectAll("path")
.transition()
.duration(1000)
.style("opacity", 1)
.each("end", function() {
d3.select(this).on("mouseover", mouseover);
});
d3.select("#explanation")
.style("visibility", "hidden");
}
function mouseOverArc(d) {
d3.select(this).attr("stroke","black")
tooltip.html(format_description(d));
return tooltip.transition()
.duration(50)
.style("opacity", 0.9);
}
function mouseOutArc(){
d3.select(this).attr("stroke","")
return tooltip.style("opacity", 0);
}
function mouseMoveArc (d) {
return tooltip
.style("top", (d3.event.pageY-10)+"px")
.style("left", (d3.event.pageX+10)+"px");
}
function convertToSize (d) {
if (d.size === "GEB") {
return 150
}
else if (d.size === "GMD") {
return 100
}
else if (d.size === "MD") {
return 70
}
else if (d.size === "ED") {
return 45
}
else if (d.size === "DI") {
return 30
}
else if (d.size === "AD") {
return 20
}
else if (d.size === "AO") {
return 15
}
else if (d.size === "EE") {
return 12
}
else if (d.size === "NA") {
return 10
}
}
var root_ = null;
d3.json("static.json", function(error, root) {
//d3.json("flare-labeled.json", function(error, root) {
if (error) return console.warn(error);
// Compute the initial layout on the entire tree to sum sizes.
// Also compute the full name and fill color for each node,
// and stash the children so they can be restored as we descend.
partition
.value(function(d) { return convertToSize(d); }) //////////////////////////////////////////////////////here is SIZE: add function for converting "AD" to 100 etc.
.nodes(root)
.forEach(function(d) {
d._children = d.children;
d.sum = d.value;
d.key = key(d);
d.fill = fill(d);
});
// Now redefine the value function to use the previously-computed sum.
partition
.children(function(d, depth) { return depth < 2 ? d._children : null; })
.value(function(d) { return d.sum; });
var center = svg.append("circle")
.attr("r", radius / 3)
.on("click", zoomOut);
center.append("title")
.text("zoom out");
var partitioned_data=partition.nodes(root).slice(1)
var path = svg.selectAll("path")
.data(partitioned_data)
.enter().append("path")
.attr("d", arc)
.style("fill", function(d) { return d.fill; })
.each(function(d) { this._current = updateArc(d); })
.on("click", zoomIn)
.on("mouseover", mouseOverArc)
.on("mousemove", mouseMoveArc)
.on("mouseout", mouseOutArc);
var texts = svg.selectAll("text")
.data(partitioned_data)
.enter().append("text")
.attr("text-anchor", function(d) {
var angle = getAngle(d);
if (angle<= 90 || angle>= 270) {
return 0
} else {
return d.x + d.dx / 2 > Math.PI ? "end" : "start";
}
})
// .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ") rotate(" + getAngle2(d) + ")"; })
// .style("text-anchor", "middle")
.filter(filter_min_arc_size_text)
.attr("transform", function(d) {
var angle = getAngle(d);
if (angle<= 90 || angle>= 270) {
return "rotate(" + angle + ")"
} else {
return "rotate(" + angle + ")translate(" + (d.y*2 + 10) + ")rotate(" + (angle > 90 ? -180 : 0) + ")"
}
})
.attr("x", function(d) { return radius / 3 * d.depth; })
.attr("dx", "6") // margin
.attr("dy", ".35em") // vertical-align
.text(function(d,i) {return nameCorrect(d)})
//.text(function(d,i) {return d.name})
//NEW 1
function nameCorrect(d) {
var str = d.name;
var matches = str.match(/\b(\w)/g); // ['J','S','O','N']
var acronym = matches.join(''); // JSON
if (str.length >= 13) {
return acronym
}
return str
}
//NEW 2
function zoomIn(p) {
if (p.depth > 1) p = p.parent;
if (!p.children) return;
zoom(p, p);
}
////EDITED
//USE THIS TO DISPLAY TREE of HIERRCHY
function hierarch(p) {
if (p.parent != null) {
return hierarch(p.parent)+p.name;
} else {
return p.name
}
}
////EDITED 2
function zoomOut(p) {
if (!p.parent) return;
zoom(p.parent, p);
}
/////////////////////////////////////////////////////////////////////////////////////////////////LOOK HERE! MAYBE SEARCH or SUGGESTED MATCH CLICK = ZOOM?
// Zoom to the specified new root.
function zoom(root, p) {
if (document.documentElement.__transition__) return;
// Rescale outside angles to match the new layout.
var enterArc,
exitArc,
outsideAngle = d3.scale.linear().domain([0, 2 * Math.PI]);
function insideArc(d) {
return p.key > d.key
? {depth: d.depth - 1, x: 0, dx: 0} : p.key < d.key
? {depth: d.depth - 1, x: 2 * Math.PI, dx: 0}
: {depth: 0, x: 0, dx: 2 * Math.PI};
}
function outsideArc(d) {
return {depth: d.depth + 1, x: outsideAngle(d.x), dx: outsideAngle(d.x + d.dx) - outsideAngle(d.x)};
}
center.datum(root);
// When zooming in, arcs enter from the outside and exit to the inside.
// Entering outside arcs start from the old layout.
if (root === p) enterArc = outsideArc, exitArc = insideArc, outsideAngle.range([p.x, p.x + p.dx]);
var new_data=partition.nodes(root).slice(1)
path = path.data(new_data, function(d) { return d.key; });
// When zooming out, arcs enter from the inside and exit to the outside.
// Exiting outside arcs transition to the new layout.
if (root !== p) enterArc = insideArc, exitArc = outsideArc, outsideAngle.range([p.x, p.x + p.dx]);
d3.transition().duration(d3.event.altKey ? 7500 : 750).each(function() {
path.exit().transition()
.style("fill-opacity", function(d) { return d.depth === 1 + (root === p) ? 1 : 0; })
.attrTween("d", function(d) { return arcTween.call(this, exitArc(d)); })
.remove();
path.enter().append("path")
.style("fill-opacity", function(d) { return d.depth === 2 - (root === p) ? 1 : 0; })
.style("fill", function(d) { return d.fill; })
.on("click", zoomIn)
.on("mouseover", mouseOverArc)
.on("mousemove", mouseMoveArc)
.on("mouseout", mouseOutArc)
.each(function(d) { this._current = enterArc(d); });
path.transition()
.style("fill-opacity", 1)
.attrTween("d", function(d) { return arcTween.call(this, updateArc(d)); });
});
texts = texts.data(new_data, function(d) { return d.key; })
texts.exit()
.remove()
texts.enter()
.append("text")
texts.style("opacity", 0)
.attr("text-anchor", function(d) {
return d.x + d.dx / 2 > Math.PI ? "end" : "start";
})
.attr("transform", function(d) {
var angle = getAngle(d);
if (angle<= 90 || angle>= 270) {
return "rotate(" + angle + ")"
} else {
return "rotate(" + angle +")translate(" + (d.y*2+10) + ")rotate(" + (angle > 90 ? -180 : 0) + ")"
//return "rotate(" + angle + ")translate(" + (d.y + 10, d.y*2+10) + ")rotate(" + (angle > 90 ? -180 : 0) + ")"
}
})
.attr("x", function(d) { return radius / 3 * d.depth; })
.attr("dx", "6") // margin
.attr("dy", ".35em") // vertical-align
.filter(filter_min_arc_size_text)
.text(function(d,i) {return nameCorrect(d)})
.transition().delay(750).style("opacity", 1)
}
});
function key(d) {
var k = [], p = d;
while (p.depth) k.push(p.name), p = p.parent;
return k.reverse().join(".");
}
function fill(d) {
var p = d;
while (p.depth > 1) p = p.parent;
var c = d3.lab(hue(p.name));
c.l = luminance(d.sum);
return c;
}
function arcTween(b) {
var i = d3.interpolate(this._current, b);
this._current = i(0);
return function(t) {
return arc(i(t));
};
}
function updateArc(d) {
return {depth: d.depth, x: d.x, dx: d.dx};
}
d3.select(self.frameElement).style("height", margin.top + margin.bottom + "px");
d3.select("body").append("input").attr("id", "searchid").attr("value", "");
d3.select("body").append("button")
.attr("type", "button")
.text("search")
.on('click', function () {
svg.selectAll("path")[0].forEach(function (d) {
d3.select(d).style("opacity", 1);
//CREATED THIS OUTER IF WRAPPER
if (String(document.getElementById("searchid".value)) === "testing") {
}
else {
if (d3.select(d).data()[0].name.includes(document.getElementById("searchid").value)) {
d3.select(d).style("opacity", 1);
}
// else if (d3.select(d).data()[2].position.includes(document.getElementById("searchid").value)) {
// d3.select(d).style("opacity", 0);
// }
else {
d3.select(d).style("opacity", 0.1);
}
}
})
});
</script>
<h2>Problems?</h2>
<form id="form1" action="/" method="post">
<fieldset><legend>Contact Form</legend>
<p class="first">
<label for="name">Name</label>
<input type="text" name="name" id="name" size="30" />
</p>
<p>
<label for="email">Email</label>
<input type="text" name="email" id="email" size="30" />
</p>
<p>
<label for="category">Category</label>
<select name = "Select Category">
<option value="" style="display:none">Select Most Applicable</option>
<option value="update">Incorrect Data</option>
<option value="update">Update Information</option>
<option value="error">Web Error</option>
<option value="Other">Other</option>
</select> </p>
</fieldset>
<fieldset>
<p>
<label for="message">Message</label>
<textarea name="message" id="message" cols="40" rows="5">Please describe the issue here.</textarea>
</p>
</fieldset>
<p class="submit"><button type="submit">Send</button></p>
</form>
<!--
<link rel='stylesheet prefetch' href='css/https___www_wallaceerick_.css'>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1> Org Chart <span>Useful Links</span></h1>
<section class="container">
<div id="box" class="box show-front">
<figure class="front"></figure>
<figure class="back"></figure>
<figure class="right"></figure>
<figure class="left"></figure>
<figure class="top"></figure>
<figure class="bottom"></figure>
</div>
</section>
<ul id="options">
<li><button class="current show-front">Career</button></li>
<li><button class="show-back">Job</button></li>
<li><button class="show-right">HRi</button></li>
<li><button class="show-left">Mentoring</button></li>
<li><button class="show-top">Connections</button></li>
<li><button class="show-bottom">WhoIsWho</button></li>
<!--
<li><button id="toggle-backface-visibility">Toggle Backface Visibility</button></li>
-->
</ul>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://desandro.github.io/3dtransforms/js/utils.js'></script>
<script src="js/index.js"></script>
</body>