我正在使用 gojs 制作思维导图。我想要做的是,将 JSON 输出格式化为路径。我的意思是我想采用这样的思维导图路径。
根>节点1>节点2>节点3
这是输出 JSON
{ "class": "TreeModel", "nodeDataArray": [{"key":0,"text":"Mind Map Root","loc":"-323 -89","scale":1.2100000000000002,"font":"bold 13px sans-serif"},{"text":"parent1","brush":"#f9a281","parent":0,"key":-14,"loc":"-160.293935546875 -179.425","dir":"right"},{"text":"parent1child1","brush":"#f9a281","parent":-14,"key":-15,"loc":"-66.20311523437499 -220.425","dir":"right"},{"text":"parent1child2","brush":"#f9a281","parent":-14,"key":-16,"loc":"-66.20311523437499 -179.425","dir":"right"},{"text":"parent1child3","brush":"#f9a281","parent":-14,"key":-17,"loc":"-66.20311523437499 -138.425","dir":"right"},{"text":"parent1child1child1","brush":"#f9a281","parent":-15,"key":-18,"loc":"61.85401367187501 -240.925","dir":"right","font":"bold 13px sans-serif"},{"text":"parent1child1child2","brush":"#f9a281","parent":-15,"key":-19,"loc":"61.85401367187501 -199.925","dir":"right"},{"text":"parent2","brush":"#a2e2f7","parent":0,"key":-9,"loc":"-160.293935546875 -66.92500000000001"},{"text":"parent2child1","brush":"#a2e2f7","parent":-9,"key":-10,"loc":"-66.20311523437499 -107.92500000000001"},{"text":"parent2child1child1","brush":"#a2e2f7","parent":-10,"key":-11,"loc":"61.85401367187501 -128.425"},{"text":"parent2child2","brush":"#a2e2f7","parent":-9,"key":-12,"loc":"-66.20311523437499 -25.92500000000001"},{"text":"parent2child1child2","brush":"#a2e2f7","parent":-10,"key":-13,"loc":"61.85401367187501 -87.42500000000001"},{"text":"parent2child2child1","brush":"#a2e2f7","parent":-12,"key":-20,"loc":"61.85401367187501 -46.42500000000001"},{"text":"parent2child2child2","brush":"#a2e2f7","parent":-12,"key":-21,"loc":"61.85401367187501 -5.425000000000011"},{"text":"parent3","brush":"#c2ace6","parent":0,"key":-22,"loc":"-160.293935546875 -25.92500000000001"},{"text":"parent4","brush":"#f49ffa","dir":"left","parent":0,"key":-23,"loc":"-467.29393554687505 -56.92500000000001"},{"text":"idea","brush":"#f9a281","dir":"right","parent":-18,"key":-24,"loc":"223.877451171875 -240.925"}]}
任何人都可以在 PHP 中提供帮助。