本文整理汇总了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])
})