class_docstr: <<< Tree diagrams >>>
  
  Tree diagrams are used primarily to visualize tree data structures,
  which are special hierarchical types with unique root nodes, left subtrees,
  and right subtrees.
docstr: 间隔折叠节点，当节点过多时可以解决节点显示过杂间隔。
  
  :param data: 节点数据
  :param interval: 指定间隔
docstr_tok: ["\u95f4\u9694\u6298\u53e0\u8282\u70b9\uff0c\u5f53\u8282\u70b9\u8fc7\u591a\u65f6\u53ef\u4ee5\u89e3\u51b3\u8282\u70b9\u663e\u793a\u8fc7\u6742\u95f4\u9694\u3002",":","param","data",":","\u8282\u70b9\u6570\u636e",":","param","interval",":","\u6307\u5b9a\u95f4\u9694"]
code: def _set_collapse_interval(data, interval):
      """
      间隔折叠节点，当节点过多时可以解决节点显示过杂间隔。
  
      :param data: 节点数据
      :param interval: 指定间隔
      """
      if interval <= 0:
          return data
      if data and isinstance(data, list):
          for d in data:
              children = d.get("children", None)
              if children and interval > 0:
                  for index, value in enumerate(children):
                      if index % interval == 0:
                          value.update(collapsed="false")
          return data
  
imports: from ...None import options
  from ...None import types
  from ...charts.chart import Chart
  from ...globals import ChartType
label_desc: Use image node_id 1 for calling the Tree obj's underlying member method code with example usage: obj._set_collapse_interval(data, interval) and returns: data, data