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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              - var d = 2000, l = .1*d, h = .5*l;
- var oy = -.59*d;
- var b = 1.25*l, m = b + .5*l, db = b - l;
- var u = 2, hu = .5*u;
- var sw = .005*d, fs = Math.round(.07*d);
- var na = Math.round(.05*fs);

svg(viewBox=[oy - .25*d, oy, 2*d, 1.5*d].join(' ')
		| tspan { font-size: .5em }
		| g [d] {
		| 	fill: none;
		| 	stroke: #ccc;
		| 	stroke-width: #{sw};
		| 	stroke-linecap: round
		| }
		| g {
		| 	font: #{fs}px consolas, monaco, monospace;
		| 	letter-spacing: #{-.2*fs}px
		| }
		| g [d] + *, #g g * { stroke: #333 }
		| marker[id], [x] { stroke: none; fill: #333 }
		| g g {
		| 	marker-start: url(#s);
		| 	marker-end: url(#e)
		| }
		| g + * + [d] {
		| 	stroke: #f90;
		| 	stroke-width: #{3*sw};
		| 	stroke-dasharray: #{u} #{l - u}
		| }
		| g + [d] {
		| 	stroke-width: #{2*sw};
		| 	stroke-dasharray: #{u} #{.5*h - u}
		| }
		| g ~ [x] {
		|		fill: #95a;
		| 	font: #{fs}px comic sans ms, noteworthy, dancing script ot, ubuntu, cursive
		| }
		| use ~ [x] { fill: #b53 }
	marker#s(markerWidth=na markerHeight=na 
						viewBox='-8 -4 8 8' orient='auto' refX='-7')
		path(d='M-8 0 0-4V4')
	marker#e(markerWidth=na markerHeight=na 
					 viewBox='0 -4 8 8' orient='auto' refX='7')
		path(d='M8 0 0-4V4')
		text(x=Math.round(l - .63*fs) y=Math.round(.7*fs - b)) 1·l
		text(x=Math.round(1.5*l - .63*fs) y=Math.round(.2*fs - 2*b)) 2·l
		text(x=Math.round(2.75*l - .63*fs) y=Math.round(.2*fs - 3*b)) i·l
		text(x=Math.round(4*l - 2*fs) y=Math.round(-4*b))
			| (n<tspan dx='#{Math.round(.15*fs)}'>c </tspan>-1)·l
		text(x=Math.round(.4*fs - m) y=Math.round(l + .3*fs)) 1·l
		text(x=-Math.round(m + b + .3*fs) y=Math.round(1.5*l + .3*fs)) 2·l
		text(x=-(m + 2*b + .3*fs) y=(2.75*l + .3*fs)) j·l
		text(x=-(m + 3*b + 2*fs) y=Math.round(4*l + .3*fs))
			| (n<tspan dx='#{Math.round(.15*fs)}'>r </tspan>-1)·l
						M${4.3*l} ${h}h${1.4*l}M${6.8*l} ${h}h${.7*l}
						M${4.3*l} ${1.5*l}h${1.4*l}M${6.8*l} ${1.5*l}h${.7*l}
						M${4.3*l} ${2.5*l}h${1.4*l}M${6.8*l} ${2.5*l}h${.7*l}
						M${5*l} ${4.3*l}v${.7*l}h${.7*l}M${6.8*l} ${5*l}h${.7*l}
						M${7.5*l} ${4.3*l}v${1.4*l}M${7.5*l} ${6.8*l}v${.7*l}`)
		path(d=`M0 0h${3*l}v${3*l}M${2*l} 0v${2*l}h${l}M${l} 0v${l}h${2*l}
						M${4.5*l} 0v${3*l}h${l}V0z
						M${4.5*l} ${l}h${l}v${l}h${-l}
						M${7*l} 0v${3*l}h${l}V0z
						M${7*l} ${l}h${l}v${l}h${-l}
						M${4.5*l} ${4.5*l}h${l}v${l}
						M${7*l} ${4.5*l}h${l}v${l}h${-l}z
						M${7*l} ${7*l}h${l}v${l}`)
			path(d=`M${1.5*l}${db - b}h${.7*l}M${-.2*l}${db - b}h${.7*l}`)
			path(d=`M${h}${db - 2*b}h${2*l}`)
			path(d=`M${h}${db - 3*b}h${4.5*l}`)
			path(d=`M${h}${db - 4*b}h${7*l}`)
		path(d=`M${3.5*l - hu} ${h}h${.75*l}M${6*l - hu} ${h}h${.75*l}
						M${3.5*l - hu} ${1.5*l}h${.75*l}M${6*l - hu} ${1.5*l}h${.75*l}
						M${3.5*l - hu} ${2.5*l}h${.75*l}M${6*l - hu} ${2.5*l}h${.75*l}
						M${6*l - hu} ${5*l}h${.75*l}
						M${5*l} ${3.5*l}v${.75*l}
						M${7.5*l} ${3.5*l}v${.75*l}M${7.5*l} ${6*l}v${.75*l}`)
		path(d=`M${h - hu} ${h}h${3*l}
						M${5*l - hu} ${h}h${l}M${7.5*l - hu} ${h}h${u}
						M${1.5*l - hu} ${1.5*l}h${2*l}
						M${5*l - hu} ${1.5*l}h${l}M${7.5*l - hu} ${1.5*l}h${u}
						M${2.5*l - hu} ${2.5*l}h${l}
						M${5*l - hu} ${2.5*l}h${l}M${7.5*l - hu} ${2.5*l}h${u}
						M${5*l - hu} ${5*l}h${l}M${7.5*l - hu} ${5*l}h${u}
						M${7.5*l - hu} ${7.5*l}h${u}`)
	text(x=8*l + .2*fs y=-.2*fs) rows:
	text(x=8*l + .2*fs y=(h + .3*fs)) 0
	text(x=8*l + .2*fs y=(1.5*l + .3*fs)) 1
	text(x=8*l + .2*fs y=(2.5*l + .3*fs)) 2
	text(x=8*l + .2*fs y=(5*l + .3*fs)) j
	text(x=8*l + .2*fs y=(7.5*l + .3*fs)) n<tspan>r</tspan>-1
			transform='rotate(45) scale(1 -1) rotate(-45)')
	text(x=-4*fs y=8*l + fs) columns:
	text(x=.5*l - .3*fs y=8*l + fs) 0
	text(x=1.5*l - .3*fs y=8*l + fs) 1
	text(x=2.5*l - .3*fs y=8*l + fs) 2
	text(x=5*l - .3*fs y=8*l + fs) i
	text(x=7.5*l - .8*fs y=8*l + fs) n<tspan>c</tspan>-1

// minimal SVG
<svg viewBox='-1680 -1180 4000 3000' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><style>tspan{font-size:.5em}g [d]{fill:none;stroke:#ccc;stroke-width:10;stroke-linecap:round}g{font:140px consolas,monaco,monospace;letter-spacing:-28px}g [d]+*,#g g *{stroke:#333}marker[id],[x]{stroke:none;fill:#333}g g{marker-start:url(#s);marker-end:url(#e)}g+*+[d]{stroke:#f90;stroke-width:30;stroke-dasharray:2 198}g+[d]{stroke-width:20;stroke-dasharray:2 48}g~[x]{fill:#95a;font:140px comic sans ms,noteworthy,dancing script ot,ubuntu,cursive}use~[x]{fill:#b53}</style><marker id='s' markerWidth='7' markerHeight='7' viewBox='-8 -4 8 8' orient='auto' refX='-7'><path d='M-8 0 0-4V4'/></marker><marker id='e' markerWidth='7' markerHeight='7' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><g><text x='112' y='-152'>1·l</text><text x='212' y='-472'>2·l</text><text x='462' y='-722'>i·l</text><text x='520' y='-1000'>(n<tspan dx=21>c </tspan>-1)·l</text><text x='-294' y='242'>1·l</text><text x='-642' y='342'>2·l</text><text x='-892' y='592'>j·l</text><text x='-1380' y='842'>(n<tspan dx=21>r </tspan>-1)·l</text></g><g id='g'><path d='M100-1000V100H640M860 100h280M1360 100h140M300-250V300H640M860 300h280M1360 300h140M500-500V500H640M860 500h280M1360 500h140M1000-750V640M1000 860v140h140M1360 1000h140M1500-1000V640M1500 860v280M1500 1360v140'/><path d='M0 0h600v600M400 0v400h200M200 0v200h400M900 0v600h200V0zM900 200h200v200h-200M1400 0v600h200V0zM1400 200h200v200h-200M900 900h200v200M1400 900h200v200h-200zM1400 1400h200v200'/><g><path d='M300-200h140M-40-200h140'/><path d='M100-450h400'/><path d='M100-700h900'/><path d='M100-950h1400'/></g><path d='M699 100h150M1199 100h150M699 300h150M1199 300h150M699 500h150M1199 500h150M1199 1000h150M1000 700v150M1500 700v150M1500 1200v150'/><path d='M99 100h600M999 100h200M1499 100h2M299 300h400M999 300h200M1499 300h2M499 500h200M999 500h200M1499 500h2M999 1000h200M1499 1000h2M1499 1500h2'/></g><text x='1628' y='-28'>rows:</text><text x='1628' y='142'>0</text><text x='1628' y='342'>1</text><text x='1628' y='542'>2</text><text x='1628' y='1042'>j</text><text x='1628' y='1542'>n<tspan>r</tspan>-1</text><use xlink:href='#g' transform='rotate(45) scale(1-1) rotate(-45)'/><text x='-560' y='1740'>columns:</text><text x='58' y='1740'>0</text><text x='258' y='1740'>1</text><text x='458' y='1740'>2</text><text x='958' y='1740'>i</text><text x='1388' y='1740'>n<tspan>c</tspan>-1</text></svg>
              body {
	display: flex;
	flex-direction: column;
	margin: 0;
	height: 100vh;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.