examples/playground/script.js
/**
 * plots a .csv file using the contents of the decodedData variable
 */
plots a .csv file using the contents of the decodedData variable
plots a . csv file using the contents of the decodedData variable
function plotcsv()
{
    var x1 = document.getElementById("x1").value
    var x2 = document.getElementById("x2").value
    var x3 = document.getElementById("x3").value
    if(x1 == "") x1 = undefined
    if(x2 == "") x2 = undefined
    if(x3 == "") x3 = undefined
    var options = getOptions()
    if(options.title == undefined)
        options.title = fname
    plot.plotCsvString(data, x1, x2, x3, options)
    if(plot.oldData.dataframe != undefined)
    {
        var tableData = plot.oldData.dataframe.slice(0, 19)
        var table = "<table>"
        table += "<tr><td>indices:</td></tr><tr>"
        var i
        for(i = 0;i < tableData[0].length; i++)
            table += "<td>"+i+"</td>"
        table += "</tr><tr><td>data:</td></tr>"
        for(i = 0;i < tableData.length; i++)
            tableData[i] = "<td>"+tableData[i].join("</td><td>")+"</td>"
        table += "<tr>"+tableData.join("</tr><tr>")+"</tr>"
        table += "</table>"
        document.getElementById("csvhead").innerHTML = "head of dataframe:<br/><br/>"+table
    }
}
function plotcsv ( ) { var x1 = document . getElementById ( "x1" ) . value var x2 = document . getElementById ( "x2" ) . value var x3 = document . getElementById ( "x3" ) . value if ( x1 == "" ) x1 = undefined if ( x2 == "" ) x2 = undefined if ( x3 == "" ) x3 = undefined var options = getOptions ( ) if ( options . title == undefined ) options . title = fname plot . plotCsvString ( data , x1 , x2 , x3 , options ) if ( plot . oldData . dataframe != undefined ) { var tableData = plot . oldData . dataframe . slice ( 0 , 19 ) var table = "<table>" table += "<tr><td>indices:</td></tr><tr>" var i for ( i = 0 ; i < tableData [ 0 ] . length ; i ++ ) table += "<td>" + i + "</td>" table += "</tr><tr><td>data:</td></tr>" for ( i = 0 ; i < tableData . length ; i ++ ) tableData [ i ] = "<td>" + tableData [ i ] . join ( "</td><td>" ) + "</td>" table += "<tr>" + tableData . join ( "</tr><tr>" ) + "</tr>" table += "</table>" document . getElementById ( "csvhead" ) . innerHTML = "head of dataframe:<br/><br/>" + table } }
plots a .csv file using the contents of the decodedData variable
plots a . csv file using the contents of the decodedData variable
// (calling it function plot() throws an error) // display the dataframes head