Skip to content

Commit

Permalink
Merge pull request #1253 from 18F/dev
Browse files Browse the repository at this point in the history
[staging] merge v1.3.0
  • Loading branch information
shawnbot committed Sep 10, 2015
2 parents 911d9a2 + b399ffa commit c53cc9b
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 16 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description:
baseurl: /college-choice

# app version number
version: v1.2.4
version: v1.3.0

# Build settings
markdown: kramdown
Expand Down
2 changes: 1 addition & 1 deletion _includes/footer-data.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer>

<p>See our work on <a href="https://www.github.com/18f/college-choice" target="_blank">GitHub</a> <i class="fa fa-github"></i> | <a href="https://github.com/18F/college-choice/releases" target="_blank">{{ site.version }}</a></p>
<p>See our work on <a href="https://www.github.com/18f/collegescorecard" target="_blank">GitHub</a> <i class="fa fa-github"></i> | <a href="https://github.com/18F/collegescorecard/releases" target="_blank">{{ site.version }}</a></p>
<p class="footer-owner"><a href="http://www.ed.gov/" target="_blank">U.S. Department of Education</a></p>
<p><a href="mailto:[email protected]">Contact Us</a> | <a href="http://www2.ed.gov/notices/index.html?src=ft" target="_blank">Notices</a></p>
<p class="footer-attribution">Zipcode latitude and longitude provided by <a href="http://www.geonames.org/">GeoNames</a> under a Creative Commons Attribution 3.0 License.</p>
Expand Down
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer>

<p>Powered by <a href="{{ site.baseurl }}/data/">College Scorecard Data</a> | <a href="https://github.com/18F/college-choice/releases" target="_blank">{{ site.version }}</a></p>
<p>Powered by <a href="{{ site.baseurl }}/data/">College Scorecard Data</a> | <a href="https://github.com/18F/collegescorecard/releases" target="_blank">{{ site.version }}</a></p>
<p class="footer-owner"><a href="http://www.ed.gov/" target="_blank">U.S. Department of Education</a></p>
<p><a href="mailto:[email protected]">Contact Us</a> | <a href="http://www2.ed.gov/notices/index.html?src=ft" target="_blank">Notices</a></p>
<p class="footer-attribution">Zipcode latitude and longitude provided by <a href="http://www.geonames.org/">GeoNames</a> under a Creative Commons Attribution 3.0 License.</p>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified assets/FullDataDocumentation.pdf
Binary file not shown.
Binary file modified assets/UsingFederalDataToMeasureAndImprovePerformance.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h2>Data Insights</h2>
</div>

<div class="gallery-cell">
<p>To help complement federal data and address the limitations of the federal graduation rate measure collected through IPEDS, <span class="insight-highlight">several external organizations have launched efforts to measure accurate completion rates and other data sources.</span> One leading effort, the Student Achievement Measure, provides data on progress and completion of transfer, part-time, and full-time students. The Voluntary Framework of Accountability explores remedial education, academic measures, and workforce outcomes. Additionally, IPEDS will begin collecting and publishing more comprehensive graduation rates next year.</p>
<p>To help complement federal data and address the limitations of the federal graduation rate measure collected through IPEDS, <span class="insight-highlight">several external organizations have launched efforts to measure accurate completion rates and other data sources.</span> One effort, the Student Achievement Measure, provides data on progress and completion of transfer, part-time, and full-time students. The Voluntary Framework of Accountability explores remedial education, academic measures, and workforce outcomes. Additionally, IPEDS will begin collecting and publishing more comprehensive graduation rates next year.</p>
<cite class="insight-cite">Learn more in the Technical Paper</cite>
</div>

Expand Down
4 changes: 2 additions & 2 deletions js/picc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/picc.js.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions js/src/picc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,18 @@ picc.data.rangify = function(obj, key, values) {
return obj;
};

picc.data.selectKeys = function(obj, keys) {
var copy = {};
keys.forEach(function(key) {
if (key in obj) {
copy[key] = obj[key];
} else {
console.warn('no such key in source object:', key, obj);
}
});
return copy;
};

/**
* Tooltip helper functions.
*/
Expand Down Expand Up @@ -1593,6 +1605,9 @@ picc.tooltip = {
clearTimeout(this.__tooltipShowTimeout);
if (!this.tooltip) return;
this.tooltip.setAttribute('aria-hidden', true);
if (this.tooltip.originalParent) {
this.tooltip.originalParent.appendChild(this.tooltip);
}
this.tooltip = null;
},

Expand All @@ -1616,6 +1631,8 @@ picc.tooltip = {
// the outer element's size
if (parent === tooltip.parentNode) {
parent.removeChild(tooltip);
} else {
tooltip.originalParent = tooltip.parentNode;
}

var content = tooltip.querySelector('.tooltip-content') || tooltip;
Expand Down
64 changes: 55 additions & 9 deletions js/src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = function search() {
var ready = false;
var alreadyLoaded = false;

// are we in IE? hopefully not.
var ie = typeof document.documentMode === 'number';

// "incremental" updates will only hide the list of schools, and
// not any of the other elements (results total, sort, pages)
var incremental = false;
Expand All @@ -33,6 +36,24 @@ module.exports = function search() {

var change = picc.debounce(onChange, 100);

// only render these directives, for performance (and IE11, *cough*)
var directives = picc.data.selectKeys(picc.school.directives, [
'title',
'school_link',
'name',
'city',
'state',
'under_investigation',
'size_number',
'average_cost',
'average_cost_meter',
'grad_rate',
'grad_rate_meter',
'average_salary',
'average_salary_meter',
'more_link'
]);

var win = d3.select(window);

// get a reference to all of the sliders
Expand Down Expand Up @@ -226,9 +247,6 @@ module.exports = function search() {
history.replaceState(params, 'search', qs);
}

previousParams = params;
alreadyLoaded = true;

d3.select('a.results-share')
.attr('href', function() {
return picc.template.resolve(
Expand Down Expand Up @@ -260,6 +278,7 @@ module.exports = function search() {
paginator.classList.remove('show-loading');
bottomPaginator.classList.remove('show-loading');

previousParams = params;
incremental = false;

console.timeEnd && console.timeEnd('[load]');
Expand All @@ -280,12 +299,12 @@ module.exports = function search() {
var meta = data.metadata || data;
// console.log('meta:', meta);
var total = meta.total;
var _total = function() { return total; };

// render the basic DOM template for each school
tagalong(resultsRoot, data, {
results_word: format.plural(_total, 'Result'),
results_total: format.number(_total, '0')
// only update the heading
var heading = resultsRoot.querySelector('.results-main-alert');
tagalong(heading, meta, {
results_word: format.plural('total', 'Result'),
results_total: format.number('total', '0')
});

var page = +params.page || 0;
Expand Down Expand Up @@ -346,7 +365,28 @@ module.exports = function search() {
});

var resultsList = resultsRoot.querySelector('.schools-list');
tagalong(resultsList, data.results, picc.school.directives);

/*
* XXX this avoids a nasty hard crash in IE11, which seems to have some
* problems with tagalong's data joining algorithm (and/or, you know,
* it's just broken).
*
* Removing the children of the results list after it's already been
* rendered (iff `alreadyLoaded` is true) guarantees that tagalong has
* stashed a reference to the template node.
*
* Note: we _don't_ do this in other browsers because it has performance
* implications. Rendering will be much faster when the existing nodes
* are reused and modified in place, rather than being cloned anew each
* time.
*/
if (ie && alreadyLoaded) {
removeAllChildren(resultsList);
}

tagalong(resultsList, data.results, directives);

alreadyLoaded = true;

console.timeEnd && console.timeEnd('[render]');
});
Expand Down Expand Up @@ -483,4 +523,10 @@ module.exports = function search() {
}
}

function removeAllChildren(node) {
while (node.lastChild) {
node.removeChild(node.lastChild);
}
}

};

0 comments on commit c53cc9b

Please sign in to comment.