Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.


                <h4>Overview of total number of emails during a whole year</h5>
<div id='chart'></div>




                let csv = (url) => new Promise((ok, ko) => d3.csv(url, (err, data) => err ? ko(err) : ok(data))); //check url 

let calendarData = csv(''); //get data from doc in csv format

calendarData.then(data => {   //if url is ok proceed
  let allCalendarData = d3.nest()   //nest the data
  .entries(data)                    //use entries  
  .map(theData => {                 //map the data
    const date = new Date(theData.Date);    //change int into time format
    return{                 //assign the values               
      d: date,                    
      v: theData.totalEmails       
let chart = d3_rs_squares.html()
                         .type('calendar.days') //calendar type
                         .width(700)            //chage width 
                         .height(500)           //change height     
                         .color('brown')        //chart colour
                         .starting('utcMonday');  //starting week

//this get the information of the position being hovered
let rstip = d3_rs_tip.body()
        .attr('class', 'd3-tip')
        .html(d => {
          let r = '';
           r = d.x+','+d.y
            if(d.x.indexOf('@') > -1){
              r = d.x;
              r = d3.timeFormat('%d %b')(new Date(d.x))
            r += ',' + 'Emails:' + d.z  
          return r;
  //display the infomation'svg').call(rstip)
      .on('mouseout', rstip.hide);