本文整理匯總了TypeScript中app/core/utils/ticks.logp函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript logp函數的具體用法?TypeScript logp怎麽用?TypeScript logp使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了logp函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: logScaleTickValues
function logScaleTickValues(domain, base) {
let domainMin = domain[0];
let domainMax = domain[1];
let tickValues = [];
if (domainMin < 1) {
let under_one_ticks = Math.floor(ticksUtils.logp(domainMin, base));
for (let i = under_one_ticks; i < 0; i++) {
let tick_value = Math.pow(base, i);
tickValues.push(tick_value);
}
}
let ticks = Math.ceil(ticksUtils.logp(domainMax, base));
for (let i = 0; i <= ticks; i++) {
let tick_value = Math.pow(base, i);
tickValues.push(tick_value);
}
return tickValues;
}
示例2: logScaleTickValues
logScaleTickValues(domain, base) {
const domainMin = domain[0];
const domainMax = domain[1];
const tickValues = [];
if (domainMin < 1) {
const underOneTicks = Math.floor(ticksUtils.logp(domainMin, base));
for (let i = underOneTicks; i < 0; i++) {
const tickValue = Math.pow(base, i);
tickValues.push(tickValue);
}
}
const ticks = Math.ceil(ticksUtils.logp(domainMax, base));
for (let i = 0; i <= ticks; i++) {
const tickValue = Math.pow(base, i);
tickValues.push(tickValue);
}
return tickValues;
}
示例3: adjustLogMin
function adjustLogMin(min, base) {
return Math.pow(base, Math.floor(ticksUtils.logp(min, base)));
}
示例4: adjustLogMax
function adjustLogMax(max, base) {
return Math.pow(base, Math.ceil(ticksUtils.logp(max, base)));
}