-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove unused exports? #2051
base: main
Are you sure you want to change the base?
remove unused exports? #2051
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,12 +50,10 @@ export const singleton = [null]; // for data-less decoration marks, e.g. frame | |
export const field = (name) => (d) => d[name]; | ||
export const indexOf = {transform: range}; | ||
export const identity = {transform: (d) => d}; | ||
export const zero = () => 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems to be here for consistency only |
||
export const one = () => 1; | ||
export const yes = () => true; | ||
export const string = (x) => (x == null ? x : `${x}`); | ||
export const number = (x) => (x == null ? x : +x); | ||
export const boolean = (x) => (x == null ? x : !!x); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems to be here for consistency only |
||
export const first = (x) => (x ? x[0] : undefined); | ||
export const second = (x) => (x ? x[1] : undefined); | ||
export const third = (x) => (x ? x[2] : undefined); | ||
|
@@ -225,11 +223,6 @@ export function range(data) { | |
return r; | ||
} | ||
|
||
// Returns a filtered range of data given the test function. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused |
||
export function where(data, test) { | ||
return range(data).filter((i) => test(data[i], i, data)); | ||
} | ||
|
||
// Returns an array [values[index[0]], values[index[1]], …]. | ||
export function take(values, index) { | ||
return map(index, (i) => values[i], values.constructor); | ||
|
@@ -528,7 +521,7 @@ export function inherit(options = {}, ...rest) { | |
|
||
// Given an iterable of named things (objects with a name property), returns a | ||
// corresponding object with properties associated with the given name. | ||
export function named(things) { | ||
function named(things) { | ||
console.warn("named iterables are deprecated; please use an object instead"); | ||
const names = new Set(); | ||
return Object.fromEntries( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
export function ibetainv(p, a, b) { | ||
function ibetainv(p, a, b) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is an external library, we might not want to mess with it too much |
||
var EPS = 1e-8; | ||
var a1 = a - 1; | ||
var b1 = b - 1; | ||
|
@@ -60,7 +60,7 @@ export function ibetainv(p, a, b) { | |
return x; | ||
} | ||
|
||
export function ibeta(x, a, b) { | ||
function ibeta(x, a, b) { | ||
// Factors in front of the continued fraction. | ||
var bt = | ||
x === 0 || x === 1 ? 0 : Math.exp(gammaln(a + b) - gammaln(a) - gammaln(b) + a * Math.log(x) + b * Math.log(1 - x)); | ||
|
@@ -72,7 +72,7 @@ export function ibeta(x, a, b) { | |
return 1 - (bt * betacf(1 - x, b, a)) / b; | ||
} | ||
|
||
export function betacf(x, a, b) { | ||
function betacf(x, a, b) { | ||
var fpmin = 1e-30; | ||
var m = 1; | ||
var qab = a + b; | ||
|
@@ -112,7 +112,7 @@ export function betacf(x, a, b) { | |
return h; | ||
} | ||
|
||
export function gammaln(x) { | ||
function gammaln(x) { | ||
var j = 0; | ||
var cof = [ | ||
76.18009172947146, -86.5053203294167, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I learned that we don't need to set the default locale (cf. #384) in this function, since it's only called from formatAuto.