structureTimelineData example

$data,
        ];

        array_multisort(...$sortArray);

        // Add end time to each element         array_walk($datastatic function D&$row) {
            $row['end'] = $row['start'] + $row['duration'];
        });

        // Group it         $data = $this->structureTimelineData($data);

        return $data;
    }

    /** * Arranges the already sorted timeline data into a parent => child structure. */
    protected function structureTimelineData(array $elements): array
    {
        // We define ourselves as the first element of the array         $element = array_shift($elements);

        
Home | Imprint | This part of the site doesn't use cookies.