-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdemo.js
31 lines (27 loc) · 1.32 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// demo.js
export function internals() {
const data = {}
const tx = chart.Timeline.xAxis
data.rangeLength = [`range.length:`,`${tx.range.Length}`]
data.rangeIntervalStr = [`range.intervalStr:`,`${tx.range.intervalStr}`]
data.rangeStart = ["range.indexStart: ", tx.indexStart]
data.rangeEnd = ["range.indexEnd: ", tx.indexEnd]
data.rangeStartTS = ["range.indexStart TS: ", new Date(tx.range.value(tx.indexStart)[0])]
data.rangeEndTS = ["range.indexEnd TS: ", new Date(tx.range.value(tx.indexEnd)[0])]
data.scrollPos = ["scrollPos:", chart.scrollPos]
data.bufferPx = ["bufferPx:", chart.bufferPx]
data.gradsTimeSpan = ["grads.timeSpan: ", tx.xAxisGrads.timeSpan]
data.gradsUnits = []
for (let u in tx.xAxisGrads.units) {
if (tx.xAxisGrads.units[u] !== 0)
data.gradsUnits.push(`grads.units: ${u}: ${tx.xAxisGrads.units[u]}, `)
}
data.mouseXPos = ["mouseXPos:", chart.mousePos.x]
data.mouseRangePos = ["xPos2Index:", chart.Timeline.xPos2Index(chart.mousePos.x)]
data.candleW = ["candleW:", chart.candleW]
data.primaryPaneW = ["primaryPaneW:", chart.Chart.width]
data.primaryPaneLayerW = ["primaryPaneLayerW:", chart.Chart.layerWidth]
data.primaryPaneViewportW = ["primaryPaneViewportW:", chart.Chart.graph.viewport.width]
data.candlesOnLayer = ["candlesOnLayer:", chart.candlesOnLayer]
return data
}