Pen Settings



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


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.


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.

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.


                <body id="pageBody">
<div id="chart-container"></div>

<a id="github-link" href="" target="_blank"><i class="fa fa-github-square"></i></a>



                #chart-container {
  font-family: Arial;
  border-radius: 5px;
  overflow: auto;
  text-align: center;
  position: absolute;
  left: 40px;
  width: calc(100% - 80px);
  height: auto;
  max-height: 330px;
  z-index: 1;
  border: 2px dashed #666;

.orgchart {
  background: rgba(255, 255, 255, 0.6);

#github-link {
  position: fixed;
  top: 0px;
  right: 10px;
  font-size: 3em;
  z-index: 100;


                (function($) {
  $(function() {

    var map = new ol.Map({
      layers: [
        new ol.layer.Tile({
          source: new ol.source.Stamen({
            layer: 'watercolor'
          preload: 4
        new ol.layer.Tile({
          source: new ol.source.Stamen({
            layer: 'terrain-labels'
          preload: 1
      target: 'pageBody',
      view: new ol.View({
        center: ol.proj.transform([-87.6297980, 41.8781140], 'EPSG:4326', 'EPSG:3857'),
        zoom: 10
    var ds = {
      'name': 'Lao Lao',
      'title': 'President Office',
      'position': [-87.6297980, 41.8781140],
      'children': [{
        'name': 'Bo Miao',
        'title': 'Administration  Dept.',
        'position': [-83.0457540, 42.3314270]
      }, {
        'name': 'Su Miao',
        'title': 'R & D Dept.',
        'position': [-81.6943610, 41.4993200]
      }, {
        'name': 'Yu Jie',
        'title': 'Product Dept.',
        'position': [-71.0588800, 42.3600820]
      }, {
        'name': 'Yu Li',
        'title': 'Legal Dept.',
        'position': [-74.0059410, 40.7127840]
      }, {
        'name': 'Hong Miao',
        'title': 'Finance Dept.',
        'position': [-80.8431270, 35.2270870]
      }, {
        'name': 'Yu Wei',
        'title': 'Security Dept.',
        'position': [-81.6556510, 30.3321840]
      }, {
        'name': 'Chun Miao',
        'title': 'HR Dept. ',
        'position': [-81.3792360, 28.5383350]
      }, {
        'name': 'Yu Tie',
        'title': 'Marketing Dept.',
        'position': [-80.1917900, 25.7616800]
    var oc = $('#chart-container').orgchart({
      'data': ds,
      'nodeContent': 'title',
      'createNode': function($node, data) {
        $node.on('click', function() {
          var view = map.getView();
          var duration = 2000;
          var start = +new Date();
          var pan = ol.animation.pan({
            duration: duration,
            source: view.getCenter(),
            start: start
          var bounce = ol.animation.bounce({
            duration: duration,
            resolution: 4 * view.getResolution(),
            start: start
          map.beforeRender(pan, bounce);
          view.setCenter(ol.proj.transform(data.position, 'EPSG:4326', 'EPSG:3857'));