【问题标题】:How to represent a JSON structure as an organizational tree in HTML?如何将 JSON 结构表示为 HTML 中的组织树?
【发布时间】:2019-07-03 20:38:40
【问题描述】:

我有一个嵌套的 json 对象,它表示父节点与其子节点之间的一对多关系。我想将此 json 表示为 HTML 中的组织结构图。我发现我可以使用 Google Charts 来做到这一点,但我不确定 Google Charts 是否让您能够设计盒子或对设计进行任何修改。

有人知道我可以学习的任何资源吗?

这是我构造的json对象:

{ 'id': 1,
  'name': 'Parent Node',
  'description': 'First Parent Node',
  'children': [
  {
      'id': 2,
      'name': 'child1',
      'description': 'child1',
      'children': [
      {
          'id': 4,
          'name': 'grand1',
          'description': 'grand1',
          'children': []
       }]
   },
   {
       'id': 3,
       'name': 'child2',
       'description': 'child2',
       'children': []
   }]
 }

这个问题Representing Binary Tree Structure in Web browser也类似,但是链接好像失效了。

【问题讨论】:

标签: html json hierarchical-data


【解决方案1】:

这是您提到的另一个问题的链接的工作版本:http://experiments.wemakesites.net/css3-treeview-with-multiple-node-selection.html

【讨论】:

    【解决方案2】:

    我不确定你希望你的显示器是什么样子,所以这里有两个可行的答案:

    【讨论】:

      猜你喜欢
      • 2010-09-19
      • 1970-01-01
      • 2020-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-07
      • 1970-01-01
      相关资源
      最近更新 更多