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.


    <script src=""></script>
  <body style="background: #111;">
        <img id="groundTexture" src="" crossorigin>
      <a-cylinder id="ground" src="#groundTexture" radius="32" height="0.1"></a-cylinder>




                // default alpha for bars
let alpha = 0.6;
const data = [ 19, 80, 30, 15, 55];
const dataText = [ 'A', 'B', 'C', 'D', 'D'];
// Scale the height of our bars using d3's linear scale
const hscale = d3.scaleLinear()
  .domain([0, d3.max(data)])
  .range([0, 3]);

// Select the scene object just like an svg
const scene ='a-scene');

// we use d3's enter/update/exit pattern to draw and bind our dom elements
const bars = scene.selectAll('').data(data);
// we set attributes on our cubes to determine how they are rendered
bars.enter().append('a-box').classed('bar', true)
  .attr('position', (d, i) => {
  const x =  i * 0.8 - (data.length / 2);
  const y = hscale(d)/2;
  const z = -3
  return x + " " + y + " " + z   
  .attr('width', (d) => 0.5)
  .attr('depth', (d) => 0.5)
  .attr('height', (d) => hscale(d))
  .attr('opacity', alpha)
  .attr('color', 'blue');