There are definitely easier ways to create this behavior, especially for a triangle.
But if you want a generic way to transition cycle through the path data given the way you've set up this example, you need something like the following that will cycle through each element in your lineData array and update the path accordingly:
var idx = 0;
svgContainer.on('click', function() {
lineGraph
.transition()
.attr('d', lineFunction(lineData[idx]))
idx++;
if(idx >= dataset.length) idx = 0;
});
This one is set up to cycle through your data every time you click on the svgContainer. See here for working example: http://tributary.io/inlet/9044406
EDIT: This is an alternative version that cycles every 500ms on load: http://tributary.io/inlet/9061336
var idx = 0;
var cycle = function(){
lineGraph
.transition()
.attr('d', lineFunction(lineData[idx]))
idx++;
if(idx >= dataset.length) idx = 0;
}
setInterval(cycle, 500)