. */ /** * For more information, please contact */ namespace Goat1000\SVGGraph; trait SteppedLineTrait { /** * Double each point to create a stepped line */ protected function getLinePoints($points) { $new_points = []; $prev = null; foreach($points as $point) { if($prev) { $prev[0] = $point[0]; $new_points[] = $prev; } $new_points[] = $point; $prev = $point; } return $new_points; } }