Skip to content

Commit

Permalink
fixing up explanatory text, bug in min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaskruchten committed Feb 24, 2015
1 parent 80455c7 commit 7294f77
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
5 changes: 2 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ <h3 align="center">Basic examples</h3>
<li><a href="simple_ui_from_table.html">pivotUI() with table element input</a></li>
</ul>
</li>
<h3 align="center">Montreal Weather 2014 Dataset</h3>
<h3 align="center">Montreal Weather 2014 Dataset <small>(<a href="montreal_2014.csv">CSV</a>)</small></h3>
<ul>
<li><a href="montreal_2014.html">pivotUI() with date derivers and sort overriding</a></li>
</ul>
<h3 align="center">Canadian MPs 2012 Dataset</h3>
<h3 align="center">Canadian Parliament 2012 Dataset <small>(<a href="mps.csv">CSV</a> or <a href="mps.json">JSON</a>)</small></h3>
<ul>
<li><a href="mps.html">pivotUI()</a></li>
<li><a href="mps_prepop.html">pivotUI() prepopulated</a></li>
Expand All @@ -36,7 +36,6 @@ <h3 align="center">Canadian MPs 2012 Dataset</h3>
<li><a href="gchart.html">pivotUI() with Google Charts renderers</a></li>
<li><a href="d3.html">pivotUI() with D3 renderers</a></li>
<li><a href="fully_loaded.html">pivotUI() mobile-enabled and with all renderers</a></li>
<li>Download the data in <a href="mps.csv">CSV</a> or <a href="mps.json">JSON</a></li>
</ul>
<h3 align="center">Bring your own dataset</h3>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion examples/montreal_2014.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<p><a href="index.html">&laquo; back to examples</a>
</p>

<p style="width: 800px">This example loads data from a CSV and shows date handling with derivers and sort overriding. This example also features custom aggregators, Google Charts and hidden attributes.</p>
<p style="width: 800px">This example loads the "Montreal Weather 2014" dataset from a CSV and shows date handling with derivers and sort overriding. This example also features custom aggregators, Google Charts and hidden attributes.</p>


<div id="output" style="margin: 10px;"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/mps.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</script>
<p><a href="index.html">&laquo; back to examples</a></p>

<p style="width: 800px">This example simply loads up a pivot table, ready for interaction.</p>
<p style="width: 800px">This example simply loads up a pivot table with the "Canadian Parliament 2012" dataset, ready for interaction.</p>


<div id="output" style="margin: 30px;"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/mps_agg.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<p><a href="index.html">&laquo; back to examples</a></p>

<p style="width: 800px">This example shows custom aggregators.</p>
<p style="width: 800px">This example shows custom aggregators using the "Canadian Parliament 2012" dataset.</p>


<div id="output" style="margin: 30px;"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/mps_csv.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</script>
<p><a href="index.html">&laquo; back to examples</a></p>

<p style="width: 800px">This example loads data from a CSV instead of from JSON.</p>
<p style="width: 800px">This example loads the "Canadian Parliament 2012" dataset from a CSV instead of from JSON.</p>


<div id="output" style="margin: 30px;"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/mps_fr.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<p><a href="index.html">&laquo; back to examples</a></p>

<p style="width: 800px">This example shows French localization.</p>
<p style="width: 800px">This example shows French localization using the "Canadian Parliament 2012" dataset.</p>


<div id="output" style="margin: 30px;"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/mps_prepop.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<p><a href="index.html">&laquo; back to examples</a></p>

<p style="width: 800px">This example shows how to prepopulate the UI on load.</p>
<p style="width: 800px">This example shows how to prepopulate the UI on load using the "Canadian Parliament 2012" dataset.</p>


<div id="output" style="margin: 30px;"></div>
Expand Down
8 changes: 6 additions & 2 deletions pivot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ callWithJQuery ($) ->

min: (formatter=usFmt) -> ([attr]) -> (data, rowKey, colKey) ->
val: null
push: (record) -> @val = Math.min(record[attr], @val ? record[attr])
push: (record) ->
x = parseFloat(record[attr])
if not isNaN x then @val = Math.min(x, @val ? x)
value: -> @val
format: formatter
numInputs: if attr? then 0 else 1

max: (formatter=usFmt) -> ([attr]) -> (data, rowKey, colKey) ->
val: null
push: (record) -> @val = Math.max(record[attr], @val ? record[attr])
push: (record) ->
x = parseFloat(record[attr])
if not isNaN x then @val = Math.max(x, @val ? x)
value: -> @val
format: formatter
numInputs: if attr? then 0 else 1
Expand Down

0 comments on commit 7294f77

Please sign in to comment.