Привет, я новичок в макете дерева D3, так что я изо всех сил, как я буду манипулировать моим массивом данных в массив в желаемую форму, пожалуйста, помогите ……… ниже мой массив из базы данных
Array
(
[0] => Array
(
[ocap_id] => 1001
[ocap_name] => PBTF
[parent_id] => 1
[child_id] => 2
[parent_desc] => Perform SPC Data Monitoring using SPC system based control chart
)
[1] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 2
[child_id] => 3
[parent_desc] => Encountered OOC?
)
[2] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 2
[child_id] => 4
[parent_desc] => Encountered OOC?
)
[3] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 3
[child_id] => 5
[parent_desc] => NO
)
[4] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 4
[child_id] => 6
[parent_desc] => YES
)
[5] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 5
[child_id] => 0
[parent_desc] => Continue next step
)
[6] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 6
[child_id] => 7
[parent_desc] => Complete reeling in process reel then stop operation.
)
[7] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 7
[child_id] => 8
[parent_desc] => Technician to verify SPC chart to identify the specific actual OOC:
)
[8] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 8
[child_id] => 9
[parent_desc] => Technician to perform machine verification and corrective actions based from the specific actual OOC:
)
[9] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 9
[child_id] => 10
[parent_desc] => Perform PBFT and check results if sufficient to clear the trend of OOC
)
[10] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 10
[child_id] => 11
[parent_desc] => OK?
)
[11] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 10
[child_id] => 12
[parent_desc] => OK?
)
[12] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 11
[child_id] => 8
[parent_desc] => NO
)
[13] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 12
[child_id] => 13
[parent_desc] => YES
)
[14] => Array
(
[ocap_id] => 1001
[ocap_name] => PBFT
[parent_id] => 13
[child_id] => 5
[parent_desc] => Accomplish SPC OOC RC&CA at computer.
)
)
хорошо, как вы заметили, у меня есть отношения родителей и детей …….
я хочу, чтобы все дочерние массивы были внутри родительского массива, как в этом примере макета дерева D3 https://github.com/mbostock/d3/wiki/Tree-Layout Пожалуйста, помогите мне заранее спасибо
Задача ещё не решена.
Других решений пока нет …