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.


                <div id='description'>
  <p>Change the type to <code>'calendar.days', 'calendar.hours', 'matrix.cooc' </code>or <code>'matrix'</code> (set to default). Calendar days and hours only works if unix time stamp data are used.</p>
  <p><code>matrix.cooc</code> represent data that has the same occurrence.</p>
  <p><code>.type(<button class='rs-btn--small rs-btn--selected' onclick = 'cooc()'>matrix.cooc</button>
  <button class='rs-btn--small' onclick = 'matrixx()'>matrix</button>);</code></p>
  <div id='chartMatrix'></div>


                #description {
  margin: 1em;




let emailData = [
  { "x": "jeff.dasovich","y": "jeff.dasovich","z": 491},
  { "x": "jeff.dasovich", "y": "james.d.steffes","z": 1967},
  { "x": "jeff.dasovich","y":"j.kaminski", "z": 2},
  { "x": "jeff.dasovich", "y": "kay.mann","z": 0},
  { "x": "jeff.dasovich","y": "steven.j.kean","z": 1396},
  { "x": "jeff.dasovich","y": "sara.shackleton","z": 0},
  { "x": "jeff.dasovich","y": "lynn.blair","z": 0},
  { "x": "jeff.dasovich", "y": "sally.beck","z": 80},
  { "x": "jeff.dasovich","y": "richard.b.sanders","z": 719},
  { "x": "jeff.dasovich", "y": "matthew.lenhart","z": 0},
  { "x": "james.d.steffes", "y": "jeff.dasovich","z": 660},
  { "x": "james.d.steffes", "y": "james.d.steffes","z": 13},
  { "x": "james.d.steffes", "y": "j.kaminski", "z": 4},
  { "x": "james.d.steffes", "y": "kay.mann","z": 0},
  { "x": "james.d.steffes","y": "steven.j.kean","z": 385},
  { "x": "james.d.steffes", "y": "sara.shackleton","z": 0},
  { "x": "james.d.steffes", "y": "lynn.blair", "z": 0},
  { "x": "james.d.steffes", "y": "sally.beck","z": 15},
  { "x": "kay.mann", "y": "sally.beck","z": 1500},
  { "x": "sally.beck", "y": "kay.mann","z": 1500}

let matrix = d3_rs_squares.html()
                          .type('matrix.cooc')  //type
                          .inset({ top:110,left:110,bottom:0,right:0 }) //inset size
                          .width(800); //change the width of the overall chart'#chartMatrix') 

function cooc(){
  let matrix = d3_rs_squares.html()
                          .inset({ top:110,left:110,bottom:0,right:0 })

function matrixx(){
  let matrix = d3_rs_squares.html()
                          .inset({ top:110,left:110,bottom:0,right:0 })

// Generic function to toggle selected state of a button
  .on('click', function() {
    let selected = this;
      .classed('rs-btn--selected', function() {
        return (selected === this);