Skip to content

Commit

Permalink
Remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
kbroman committed Jan 7, 2022
1 parent 68720b9 commit 0c3f7dc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## d3panels 1.8.2 (2022-01-07)

- Remove some debug code


## d3panels 1.8.1 (2022-01-07)

- Revised `formatAxis()` to consider all gaps rather than just the gap
Expand Down
9 changes: 3 additions & 6 deletions d3panels.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!function() { // encapsulate d3panels functions
var d3panels = {
version: "1.8.1"
version: "1.8.2"
};
"use strict";

Expand Down Expand Up @@ -52,26 +52,23 @@ d3panels.formatAxis = function (d) {


d.sort();
console.log(d);

if (modulo(d.length, 2)) {
// odd number of values
gap = d[(d.length - 1) / 2];
} else {
gap = (d[d.length / 2 - 1] + d[d.length / 2]) / 2;
}
}
} // turn gap into number of digits

console.log(gap); // turn gap into number of digits

ndig = Math.round(d3panels.log10(Math.abs(gap)));

if (ndig > 0) {
ndig = 0;
}

ndig = Math.abs(ndig) + extra_digits;
console.log("ndig: " + ndig); // function to return
ndig = Math.abs(ndig) + extra_digits; // function to return

return function (val) {
if (val != null && val !== "NA") {
Expand Down
2 changes: 1 addition & 1 deletion d3panels.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3panels",
"version": "1.8.1",
"version": "1.8.2",
"description": "D3-based graphics panels",
"author": "Karl Broman <[email protected]> (https://kbroman.org)",
"repository": "github:kbroman/d3panels",
Expand Down
2 changes: 1 addition & 1 deletion src/d3panels_top.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!function() { // encapsulate d3panels functions
var d3panels = {
version: "1.8.1"
version: "1.8.2"
};
4 changes: 0 additions & 4 deletions src/panelutil.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ d3panels.formatAxis = (d, extra_digits=0) ->
d = (d[i]-d[i-1] for i in [1..(d.length-1)])
# get median
d.sort()
console.log(d)
if d.length %% 2 # odd number of values
gap = d[(d.length-1)/2]
else
gap = (d[d.length/2-1] + d[d.length/2])/2
console.log(gap)

# turn gap into number of digits
ndig = Math.round( d3panels.log10(Math.abs(gap)) )
ndig = 0 if ndig > 0
ndig = Math.abs(ndig) + extra_digits

console.log("ndig: #{ndig}")

# function to return
(val) ->
return d3.format(".#{ndig}f")(val) if val? and val != "NA"
Expand Down

0 comments on commit 0c3f7dc

Please sign in to comment.