Added scripts to generate a single html file from CSVs;
./generate_page.sh csv1 csv2 > output.html
This commit is contained in:
parent
73b8c6113c
commit
f47ce0856c
43
generate_page.sh
Executable file
43
generate_page.sh
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
##
|
||||||
|
## pregeneratehtml.sh
|
||||||
|
##
|
||||||
|
## Made by gaspar_d
|
||||||
|
## Login <d.gasparina@gmail.com>
|
||||||
|
##
|
||||||
|
## Started on Tue 23 Feb 20:17:04 2016 gaspar_d
|
||||||
|
## Last update Tue 23 Feb 21:08:26 2016 gaspar_d
|
||||||
|
##
|
||||||
|
|
||||||
|
main() {
|
||||||
|
gCSVs=""
|
||||||
|
|
||||||
|
while [[ "$#" -gt "0" ]]; do
|
||||||
|
file=$1
|
||||||
|
content=`cat $file`
|
||||||
|
gCSVs="${gCSVs}\`${content}\`,"
|
||||||
|
shift;
|
||||||
|
done
|
||||||
|
gCSVs="[${gCSVs%?}]"
|
||||||
|
output=$1
|
||||||
|
|
||||||
|
html=`cat index.html | grep -v stylesheet | grep -v script | grep -v '</body>'`
|
||||||
|
echo $html
|
||||||
|
for js in js/{d3.min.js,jquery-2.1.4.js,nv.d3.min.js,dashboard.js,graph.js}; do
|
||||||
|
echo "<script type='text/javascript'>"
|
||||||
|
cat ${js}
|
||||||
|
echo "</script>"
|
||||||
|
done
|
||||||
|
echo "<script type='text/javascript'>gCSVs=${gCSVs};</script>"
|
||||||
|
for css in css/*.css; do
|
||||||
|
echo "<style>"
|
||||||
|
cat ${css}
|
||||||
|
echo "</style>"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "</body>"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
main $@
|
10595
generate_page_example.html
Normal file
10595
generate_page_example.html
Normal file
File diff suppressed because one or more lines are too long
@ -1,9 +1,8 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
gGraphs = {};
|
gGraphs = {};
|
||||||
|
gCSVs = [];
|
||||||
|
|
||||||
var brush = d3.svg.brush()
|
var brush = d3.svg.brush()
|
||||||
.on("brushend", brushed);
|
.on("brushend", brushed);
|
||||||
@ -19,8 +18,6 @@ var x = d3.time.scale().range([0, width]),
|
|||||||
/*
|
/*
|
||||||
* DOM functions
|
* DOM functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on('dragenter', function (e) {
|
$(document).on('dragenter', function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -39,10 +36,24 @@ $(document).on('drop', function (e) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Init functions
|
||||||
|
*/
|
||||||
|
$(document).ready(function() {
|
||||||
|
// initialize graphs contained in gCSVs
|
||||||
|
if (gCSVs !== undefined && gCSVs.length > 0) {
|
||||||
|
$('#drop-background').hide();
|
||||||
|
for (i in gCSVs) {
|
||||||
|
processCSV(gCSVs[i], "csv " + i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Settings functions
|
* Settings functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var settings = { "compact": false }
|
var settings = { "compact": false }
|
||||||
applySettings(settings)
|
applySettings(settings)
|
||||||
|
|
||||||
@ -52,7 +63,6 @@ function applySettings(settings) {
|
|||||||
/*
|
/*
|
||||||
* CSV Processing functions
|
* CSV Processing functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function processFiles(files) {
|
function processFiles(files) {
|
||||||
for (f = 0; file = files[f]; f++) {
|
for (f = 0; file = files[f]; f++) {
|
||||||
processFile(file);
|
processFile(file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user