本文整理匯總了TypeScript中models/tickers/log_ticker.LogTicker類的典型用法代碼示例。如果您正苦於以下問題:TypeScript LogTicker類的具體用法?TypeScript LogTicker怎麽用?TypeScript LogTicker使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了LogTicker類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should have three major ticks and nine minor ticks for short range", () => {
const ticker = new LogTicker({desired_num_ticks: 3, num_minor_ticks: 2})
const ticks = ticker.get_ticks_no_defaults(1, 999, null, 3)
expect(ticks.major).to.be.deep.equal([1, 10, 100])
// 0.2 is weird, should be 0.5 i think
expect(ticks.minor).to.be.deep.equal([0.2, 0.1, 1, 5, 10, 50, 100, 500, 1000])
})
示例2: it
it("should have correct default ticks for (1.0001, 1e3) range", () => {
const ticker = new LogTicker()
const ticks = ticker.get_ticks_no_defaults(1.0001, 1e3, null, 4)
expect(ticks.major).to.be.deep.equal([1e1, 1e2, 1e3])
expect(ticks.minor).to.be.deep.equal([2, 4, 6, 8, 10, 20, 40, 60, 80, 100, 200, 400, 600, 800, 1000])
})