This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A 2D view that renders values as a bar chart on a Raphael.js Paper (drawing context). | |
var BarChart = function(paper, values, axisMaxValue, barSpacingAsWidthMultiplier) { | |
// inheritance | |
var self = Infographic(paper); | |
// validation | |
if(typeof values === "undefined") { | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Infographic = function(paperRaphael) { | |
// inheritance | |
var self = {}; | |
var elements = []; | |
// private | |
var paper; | |
// validatation | |
if(typeof paperRaphael === "undefined") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var values = [3.1, 4, 2]; | |
var elements = []; | |
var drawValueLabels = function() { | |
var barSpacingWidth = (barSpacingAsWidthMultiplier * paperWidth); | |
var barWidthWithoutSpacing = paperWidth / values.length; | |
var barWidthWithTrailingSpacing = barWidthWithoutSpacing - barSpacingWidth; | |
var barWidth = barWidthWithTrailingSpacing + (barSpacingWidth / values.length); | |
values.forEach(function(value, valueIndex) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rename = proc { |key, value| [rename_map[key] || key, value] } | |
hidden_strengths = Hash[hidden_strengths.map &rename] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
ct.name as competency_name, | |
s.id as section_id, | |
s.name as section_name, | |
q.id as question_id, | |
case when avg(not c.user_id = c.for_user_id then a.score) else null end as other_score , | |
case when avg(c.user_id = c.for_user_id then a.score) else null end as subject_score, | |
case when avg(c.user_id = c.for_user_id then a.score) - avg(case when not c.user_id = c.for_user_id then a.score else null end) else null end as gap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select review_id, completion_for_user_id, reviewer_relationship, competency_name, round(avg(score),2) as score, 'TODO' as gap from( | |
select | |
r.id as review_id, | |
c.for_user_id as completion_for_user_id, | |
ifnull(ru.relationship, 'Self') as reviewer_relationship, | |
ct.id as competency_id, | |
ct.position as competency_position, | |
ct.name as competency_name, | |
s.id as section_id, | |
s.name as section_name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
IFNULL(review_users.relationship, 'Self') AS relationship_name, | |
AVG(reviewer_answers.score) AS reviewers_average_score, | |
AVG(reviewee_answers.score) AS reviewee_average_score | |
FROM | |
review_users, | |
competencies as competency, | |
answers as reviewer_answers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Relationship Average Score Reviewee Average Score | |
Direct Report 2.4965034965035 3.77272727272727 | |
Line Manager 2.4965034965035 3.77272727272727 | |
Other 2.4965034965035 3.77272727272727 | |
Peer 2.4965034965035 3.77272727272727 | |
Self 2.4965034965035 3.77272727272727 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select review_id, completion_for_user_id, reviewer_relationship, competency_name, round(avg(score),2) as score, 'TODO' as gap from( | |
select | |
r.id as review_id, | |
c.for_user_id as completion_for_user_id, | |
ifnull(ru.relationship, 'Self') as reviewer_relationship, | |
ct.id as competency_id, | |
ct.position as competency_position, | |
ct.name as competency_name, | |
s.id as section_id, | |
s.name as section_name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Relationship Average Score Self Average Score | |
Direct Report 2.8 3.77 | |
Line Manager 3.32 3.77 | |
Other 4.09 3.77 | |
Peer 3.07 3.77 | |
Self 3.77 3.77 | |