Added debug page

This commit is contained in:
Evgeniy Timokhov 2019-06-13 12:55:53 +03:00
parent 42e5d8227f
commit eec8bcfef3
3 changed files with 50 additions and 1 deletions

2
.gitignore vendored
View File

@ -3,6 +3,8 @@ node_modules/
npm-debug.log*
package-lock.json
debug.html
# python
*.pyc

View File

@ -24,4 +24,7 @@ To bundle production builds (minified) too just set the `NODE_ENV` variable to `
## Tips
To make sure that your local copy passed all (almost) checks, you can use the `verify` npm script: `npm run verify`.
- To make sure that your local copy passed all (almost) checks, you can use the `verify` npm script: `npm run verify`.
- If you want to play with locally built package, you can create a `debug.html` page: `cp debug.html.example debug.html`.
This file (`debug.html`) is under gitignore, so you don't need to worry about changing it and you can modify it as you wish.

44
debug.html.example Normal file
View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<title>Debug page</title>
<script type="text/javascript" src="./dist/lightweight-charts.standalone.development.js"></script>
</head>
<body style="padding: 0; margin: 0;">
<div id="container" style="position: absolute; width: 100%; height: 100%;"></div>
<script type="text/javascript">
function generateData() {
var res = [];
var time = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 0));
for (var i = 0; i < 500; ++i) {
res.push({
time: time.getTime() / 1000,
value: i,
});
time.setUTCDate(time.getUTCDate() + 1);
}
return res;
}
var chart = LightweightCharts.createChart(document.getElementById('container'));
var mainSeries = chart.addLineSeries({
priceFormat: {
minMove: 1,
precision: 0,
},
});
mainSeries.setData(generateData());
</script>
</body>
</html>