function renderChord(chord) {
	
	var chart = new svguitar.SVGuitarChord(chord)

		// draw the chart
		chart
		  .configure({
		          color: '#000000',
		          strings: 6,
		          frets: 4,
		          position: 1,
		          nutSize: 0,
		          fingerSize: 0.85,
		          strokeWidth: 4,
		          style: 'normal',
		          orientation: 'vertical',
				  titleFontSize: 72
		        })
		  .chord({
		  		title: chord.getAttribute('svguitar-chord'),
		  		  fingers: JSON.parse(chord.getAttribute('svguitar-fingers')),
		  		  barres: JSON.parse(chord.getAttribute('svguitar-barres')),
		  		  position: chord.getAttribute('svguitar-position')
		  })
		  .draw();
		  
		  chord.removeAttribute('svguitar-chord');
}

function renderPageChords() {
	var nodes = document.querySelectorAll('[svguitar-chord]');
	nodes.forEach(chord => {
		renderChord(chord);
	});
}

renderPageChords();

