Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              
            
          
!

CSS

            
              
            
          
!

JS

            
              //proj4.js
var utm = "+proj=utm +zone=17";
var wgs84 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
var chart;
var data = [];


var Abby = function() {
    var dataPoints = [];
    var dataSeries = {
            type: "line",
            showInLegend: true,
            legendText: "Abby"
        };
    var results;
    
    d3.csv("https://codepen.io/anon/pen/oLPQQR.js", function(tempResults) {
    	//csv data is stored in https://codepen.io/anon/pen/oLPQQR.js, you can replace it with path to csv-file
    		results = tempResults;
    		parseResults();
    	});

    	function parseResults() {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) + (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
            chart.render();
        }
    
};
var Atlas = function() {
    var dataPoints = [];
    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Atlas"
    };
    d3.csv('Atlas.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var BenBob = function() {
    var dataPoints = [];
    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "BenBob"
    };
    d3.csv('BenBob.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Chibi = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Chibi"
    };
    d3.csv('Chibi.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Chloe = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Chloe"
    };
    d3.csv('Chloe.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Clementina = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Clementina"
    };
    d3.csv('Clementina.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Ellie = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Ellie"
    };
    d3.csv('Ellie.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Gillian = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Gillian"
    };
    d3.csv('Gillian.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Greg = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Greg"
    };
    d3.csv('Greg.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Ibeth = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Ibeth"
    };
    d3.csv('Ibeth.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Judy = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Judy"
    };
    d3.csv('Judy.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Kyle = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Kyle"
    };
    d3.csv('Kyle.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Mimi = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Mimi"
    };
    d3.csv('Mimi.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Merk = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Merk"
    };
    d3.csv('Merk.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Olga = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Olga"
    };
    d3.csv('Olga.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Ornette = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Ornette"
    };
    d3.csv('Ornette.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Pliny = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Pliny"
    };
    d3.csv('Pliny.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Ripley = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Ripley"
    };
    d3.csv('Ripley.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Serge = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Serge"
    };
    d3.csv('Serge.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Sofie = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Sofie"
    };
    d3.csv('Sofie.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Veruca = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Veruca"
    };
    d3.csv('Veruca.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Vielle = function() {
    var dataPoints = [];

    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Vielle"
    };
    d3.csv('Vielle.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var Bonnie = function() {
    var dataPoints = [];
    var dataSeries = {
        type: "line",
        showInLegend: true,
        legendText: "Bonnie"
    };
    d3.csv('Bonnie.csv',
        function(results) {
            results.forEach(function(d) {
                d.time = parseFloat(d.Day) +
                    (parseFloat(d.Hour) / 24) + ((parseFloat(d.Minute) / 60) / 24);
            });
            results.forEach(function(d) {
                dataPoints.push({
                    x: d.time,
                    y: parseFloat(d.Height)
                });
            });
            dataSeries.dataPoints = dataPoints;
            data.push(dataSeries);
        });
};
var charter = function() {
    var chart = new CanvasJS.Chart("chartContainer", {
        zoomEnabled: true,
        title: {
            text: "Heights!"
        },
        legend: {
            horizontalAlign: "right",
            verticalAlign: "center"
        },
        animationEnabled: true,
        axisX: {
            title: "Time (days)",
            labelAngle: 30
        },

        axisY: {
            title: "Height (m)",
            includeZero: true
        },

        data: data

    });

    chart.render();
};

$(function() {

    $('input[type="checkbox"]').change(function(e) {
        var checked = $(this).prop("checked"),
            container = $(this).parent(),
            siblings = container.siblings();

        container.find('input[type="checkbox"]').prop({
            indeterminate: false,
            checked: checked
        });

        function checkSiblings(el) {
            var parent = el.parent().parent(),
                all = true;

            el.siblings().each(function() {
                return all = ($(this).children('input[type="checkbox"]').prop("checked") === checked);
            });

            if (all && checked) {
                parent.children('input[type="checkbox"]').prop({
                    indeterminate: false,
                    checked: checked
                });
                checkSiblings(parent);
            } else if (all && !checked) {
                parent.children('input[type="checkbox"]').prop("checked", checked);
                parent.children('input[type="checkbox"]').prop("indeterminate", (parent.find('input[type="checkbox"]:checked').length > 0));
                checkSiblings(parent);
            } else {
                el.parents("li").children('input[type="checkbox"]').prop({
                    indeterminate: true,
                    checked: false
                });
            }
        }

        checkSiblings(container);
    });
});
var atelesf = function() {
    Veruca();
    Chibi();
    Greg();
    Kyle();
};
var potosf = function() {
    Abby();
    BenBob();
    Bonnie();
    Chloe();
    Ripley();
    Judy();
};
var nasuaf = function() {
    Clementina();
    Ellie();
    Gillian();
    Ornette();
    Pliny();
    Serge();
    Sofie();
    Atlas();
    Vielle();
};
var cebusf = function() {
    Ibeth();
    Olga();
    Mimi();
};
var pecarif = function() {
    Merk();
};
var validate = function() {
		
    chart = new CanvasJS.Chart("chartContainer", {
        zoomEnabled: true,
        title: {
            text: "Heights!"
        },
        legend: {
            horizontalAlign: "right",
            verticalAlign: "center"
        },
        animationEnabled: true,
        axisX: {
            title: "Time (days)",
            labelAngle: 30
        },

        axisY: {
            title: "Height (m)",
            includeZero: true
        },

        data: data

    });

    if (document.getElementById("All").checked) {
        allf();
    }
    var ateles = document.getElementById("Ateles").checked;
    var potos = document.getElementById("Potos").checked;
    var nasua = document.getElementById("Nasua").checked;
    var cebus = document.getElementById("Cebus").checked;
    var pecari = document.getElementById("Pecari").checked;
    var cebusoff = true;
    var atelesoff = true;
    var nasuaoff = true;
    var potosoff = true;
    var pecarioff = true;
    var alloff = true;
    if (ateles) {
        atelesf();
    }
    if (potos) {
        potosf();
    }
    if (nasua) {
        nasuaf();
    }
    if (cebus) {
        cebusf();
        console.log("Checked");
    }
    if (pecari) {
        pecarif();
        console.log("Pecari checked");
    }
    if (document.getElementById("Cebus").indeterminate) {
        console.log("indeterminate");
    }
    if (!cebus && document.getElementById("Ibeth").checked && document.getElementById("Mimi").checked && document.getElementById("Olga").checked) {
        console.log("Not checked with 3 Others");
        cebusoff = false;
    }
    if (!ateles && document.getElementById("Chibi").checked && document.getElementById("Greg").checked && document.getElementById("Kyle").checked && document.getElementById("Veruca").checked) {
        atelesoff = false;
    }
    if (!nasua && document.getElementById("Atlas").checked && document.getElementById("Clementina").checked && document.getElementById("Ellie").checked && document.getElementById("Gillian").checked && document.getElementById("Ornette").checked && document.getElementById("Pliny").checked && document.getElementById("Serge").checked && document.getElementById("Sofie").checked && document.getElementById("Vielle").checked) {
        nasuaoff = false;
    }
    if (!potos && document.getElementById("Abby").checked && document.getElementById("BenBob").checked && document.getElementById("Bonnie").checked && document.getElementById("Chloe").checked && document.getElementById("Judy").checked && document.getElementById("Ripley").checked) {
        potosoff = false;        
    }
    if (!pecari && document.getElementById("Ibeth").checked) {
        pecarioff = false;
    }
    if (document.getElementById("Veruca").checked && (atelesoff)) {
        Veruca();
    }
    if (document.getElementById("Chibi").checked && (atelesoff)) {
        Chibi();
    }
    if (document.getElementById("Abby").checked && (potosoff)) {
    	Abby();
    }
    if (document.getElementById("BenBob").checked && (potosoff)) {
        BenBob();
    }
    if (document.getElementById("Bonnie").checked && (potosoff)) {
        Bonnie();
    }
    if (document.getElementById("Chloe").checked && (potosoff)) {
        Chloe();
    }
    if (document.getElementById("Clementina").checked && (nasuaoff)) {
        Clementina();
    }
    if (document.getElementById("Ellie").checked && (nasuaoff)) {
        Ellie();
    }
    if (document.getElementById("Gillian").checked && (nasuaoff)) {
        Gillian();
    }
    if (document.getElementById("Ornette").checked && (nasuaoff)) {
        Ornette();
    }
    if (document.getElementById("Pliny").checked && (nasuaoff)) {
        Pliny();
    }
    if (document.getElementById("Ripley").checked && (potosoff)) {
        Ripley();
    }
    if (document.getElementById("Serge").checked && (nasuaoff)) {
        Serge();
    }
    if (document.getElementById("Sofie").checked && (nasuaoff)) {
        Sofie();
    }
    if (document.getElementById("Greg").checked && (atelesoff)) {
        Greg();
    }
    if (document.getElementById("Ibeth").checked && (cebusoff)) {
        Ibeth();
        console.log("Ibeth is back");
    }
    if (document.getElementById("Olga").checked && (cebusoff)) {
        Olga();
        console.log("Olga is back");
    }
    if (document.getElementById("Mimi").checked && (cebusoff)) {
        Mimi();
        console.log("Mimi is back");
    }
    if (document.getElementById("Kyle").checked && (atelesoff)) {
        Kyle();
    }
    if (document.getElementById("Atlas").checked && (nasuaoff)) {
        Atlas();
    }
    if (document.getElementById("Vielle").checked && (nasuaoff)) {
        Vielle();
    }
    if (document.getElementById("Judy").checked && (potosoff)) {
        Judy();
    }
    if (document.getElementById("Merk").checked && (pecarioff)) {
        Merk();
        console.log("Merk checked");
    }
    //chart.render();    
};



validate();
            
          
!
999px

Console