Skip to content

Commit

Permalink
Gets the reset buttons working, and a little more padding for the tra…
Browse files Browse the repository at this point in the history
…il count on summary. #50
  • Loading branch information
abkfenris committed Feb 18, 2017
1 parent f396189 commit 0d0071b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion k8s/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
spec:
containers:
- name: web
image: gcr.io/alex-kerney/sugarloaf:0.1.5
image: gcr.io/alex-kerney/sugarloaf:0.1.6
command:
- gunicorn
- --log-level
Expand Down
25 changes: 25 additions & 0 deletions sugarloaf/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,31 @@ function buildCharts() {
// each time the table is rendered remove the extra thing
table.select('tr.dc-table-group').remove();
});

d3.selectAll('a#open').on('click', function() {
sugarloaf.openChart.filterAll();
dc.renderAll();
});
d3.selectAll('a#groomed').on('click', function() {
sugarloaf.groomedChart.filterAll();
dc.renderAll();
});
d3.selectAll('a#snowmaking').on('click', function() {
sugarloaf.snowmakingChart.filterAll();
dc.renderAll();
});
d3.selectAll('a#difficulty').on('click', function() {
sugarloaf.difficultyChart.filterAll();
dc.renderAll();
});
d3.selectAll('a#area').on('click', function() {
sugarloaf.areaChart.filterAll();
dc.renderAll();
});

dc.renderAll();


}

function summaryToDates(summary) {
Expand Down Expand Up @@ -216,6 +239,8 @@ function countDate(date) {
function buildSummaryChart(summary) {
sugarloaf.dates = summaryToDates(summary);


MARGINS.left = 35;
// get the width of the parent container
var maxWidth = d3.select('#chart-summary')[0][0].clientWidth;
var width = maxWidth - MARGINS.left - MARGINS.right,
Expand Down

0 comments on commit 0d0071b

Please sign in to comment.