echarts树图实现的组织架构

img

demo: https://d9yb5o.csb.app/

import React, { useEffect, useRef, useState } from "react";
import { treeData, orgLogo } from "./mockdata";
import * as echarts from "echarts";

const WinnerHeight = window.innerHeight;

export default function App() {
  const [treeHeight, setTreeHeight] = useState(WinnerHeight);
  let myChart = null;
  const chart = useRef();

  const formatData = (it, index) => {
    const newObj = { ...it };
    const { title: name, key = 0 } = newObj;
    if (index <= 1) {
      Object.assign(newObj, {
        label: {
          height: 40,
          verticalAlign: "middle",
          align: index === 0 ? "left" : "center",
          color: "#fff",
          formatter: () => `{logo|}{name|${name}(${key})}`,
          backgroundColor: "rgba(79,125,217,1)",
          borderRadius: [20, 5, 5, 20],
          rich: {
            logo: {
              backgroundColor: {
                image: orgLogo
              },
              width: 40,
              height: 40
            },
            name: {
              height: 40,
              color: "#FFF",
              padding: [0, 10],
              align: "center",
              fontSize: 16,
              borderRadius: [5]
            }
          }
        },
        emphasis: {
          label: {
            height: 40,
            verticalAlign: "middle",
            align: index === 0 ? "left" : "center",
            color: "#fff",
            formatter: () => `{logo|}{name|${name}(${key})}`,
            backgroundColor: "rgba(62,101,226,1)",
            borderRadius: [20, 5, 5, 20],
            rich: {
              logo: {
                backgroundColor: {
                  image: orgLogo
                },
                width: 40,
                height: 40
              },
              name: {
                height: 40,
                color: "#FFF",
                padding: [0, 10],
                align: "center",
                fontSize: 16,
                borderRadius: [5]
              }
            }
          }
        }
      });
    }

    if (index > 1) {
      Object.assign(newObj, {
        label: {
          height: 30,
          verticalAlign: "middle",
          align: "center",
          color: "#fff",
          backgroundColor: "rgba(62,101,226,1)",
          borderRadius: [5],
          formatter: () => `{name|${name}(${key})}`,
          rich: {
            name: {
              height: 30,
              color: "#FFF",
              padding: [0, 10],
              align: "center",
              fontSize: 12
            }
          }
        },
        emphasis: {
          label: {
            backgroundColor: "rgba(62,101,226,1)"
          }
        }
      });
    }

    if (newObj.children) {
      const newChildren = [];
      const sourceChildren = [...newObj.children];
      sourceChildren.forEach((el) => {
        newChildren.push(formatData(el, index + 1));
      });
      newObj.children = newChildren;
    }
    return newObj;
  };

  const getTreeLeafnode = (it) => {
    const leafnode = [];
    const getChildren = (children) => {
      if (children && children.children && children.children.length) {
        children.children.forEach((el) => {
          getChildren(el);
        });
      } else {
        leafnode.push(children);
      }
    };

    getChildren(it);
    return leafnode.length;
  };
  const drawSaveTrend = () => {
    myChart.clear();
    const res = treeData.map((el) => formatData(el, 0));
    const leafnode = getTreeLeafnode(treeData[0]);
    const option = {
      series: [
        {
          type: "tree",
          orient: "horizontal",
          name: "机构",
          edgeShape: "polyline",
          data: res,
          top: 20,
          bottom: 20,
          left: 20,
          lineStyle: {
            color: "rgba(207,5,183,1)",
            width: 3
          },
          expandAndCollapse: true,
          animationDuration: 550,
          animationDurationUpdate: 750
        }
      ]
    };
    myChart.setOption(option);
    const newTreeHeight =
      leafnode * 35 > WinnerHeight ? leafnode * 35 : WinnerHeight;
    setTreeHeight(newTreeHeight);
    myChart.resize({ height: newTreeHeight });
  };

  const resize = () => {
    myChart?.resize();
  };
  useEffect(() => {}, []);

  useEffect(() => {
    window.addEventListener("resize", () => resize());
    if (chart.current) {
      echarts.dispose(chart.current);
    }
    myChart = echarts.init(chart.current);
    drawSaveTrend();
  }, []);

  return (
    <div
      ref={chart}
      style={{
        width: "100%",
        height: treeHeight
      }}
    />
  );
}


数据文件mockdata

const treeData = [
  {
    title: "0-0",
    key: "0-0",
    children: [
      {
        title: "0-0-0",
        key: "0-0-0",
        children: [
          {
            title: "0-0-0-0",
            key: "0-0-0-0"
          },
          {
            title: "0-0-0-1",
            key: "0-0-0-1"
          },
          {
            title: "0-0-0-2",
            key: "0-0-0-2"
          }
        ]
      },
      {
        title: "0-0-1",
        key: "0-0-1",
        children: [
          {
            title: "0-0-1-0",
            key: "0-0-1-0"
          },
          {
            title: "0-0-1-1",
            key: "0-0-1-1"
          },
          {
            title: "0-0-1-2",
            key: "0-0-1-2"
          }
        ]
      },
      {
        title: "0-0-2",
        key: "0-0-2"
      }
    ]
  },
  {
    title: "0-1",
    key: "0-1",
    children: [
      {
        title: "0-1-0-0",
        key: "0-1-0-0"
      },
      {
        title: "0-1-0-1",
        key: "0-1-0-1"
      },
      {
        title: "0-1-0-2",
        key: "0-1-0-2"
      }
    ]
  },
  {
    title: "0-2",
    key: "0-2"
  }
];

const orgLogo =
  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAIABJREFUeF7tnQf07UpVxj9kiYD0roCoVCki0qsKSHlgoSMItifCQ0EQpKNSpSNSBQTpPKQoTZCigHRQaUpXUBBEkCK9uH73ZS755yaZb08m55ycf/ZaZ92SqXvyZfbs2eVkWmnlwMqBQQ6cbOXNrBw4i6QLNr8fkXQaSadt/fr+/X2Svtj8vtT6O//X/vf/SPpXSe9vfrNO5LA2vgKkzsonEFyoBQj+D4BsihJQ2qDh/z6zqQHsYz8rQOKrykt/BUlXbP3irWyuxsckvV7SGyS9RdI/bq7r5fe0AiS/huwEl2t+l5V0iXyVnS7xuRZY3iHp7esuM7xeK0D6eXMVSb8o6RqSLrLTr/v0wX1L0lsl/bWkF67nmYMMXQHyXX5wfviF5nf56e/dIlv4jqQXNEABLF9e5CwqDvqwA+SMDSDYLQDHSt/lAGeXBJbXHVbGHFaAHNfaLc5+WBc/MO9/aMDybEmfDNRbfNHDBpDrSrqVpJ9b/MptZwKfkPRESU84LEA5LADZBWC8T9LHm4u/L0hq/7gETP/+mqTTtX5cLPb9G+XBWbeDEx0aoOw7QLYBjA9Leq+k9zS/9Pdvz/AyAxCAcuHOn5sCDkD5s+a3l6LXvgJkU8D4t0ZFyiXcmxtAfGUGIESbTMDhQjNdap4h2kig/N7uKPsGEC7y7ijpxoHFdYt+XRIXa/ze1ly2fcStvAPlflIS/OGHGvsCM4wJEfLhkh45Q9tbaXJfAPIDDTAAx/dU5CRng79sfphpYCC4L4Rodm1JN2xAU3NeaL0ACmriRdM+AOR3GnD8cMWVeGMLGHwV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4f4aPCrIcamsZCfg12/OAXBlElNrbt0gDB/XDYBSenN7RAPEbvYUQDMe6Yyekfr448BINgt+NPJM+5OhbRn7BjszoulfQBIYj6XVIhd+CrXJmLDvlnSm5r0xl+v3cEG20MTCI/4Xd3MEBsZHtlkkzi1KxeZkfEfKLtPAEkT4wCP6IUl6Rz0hQYomEOQr2JnzCIGJnvqBgyYwGBuf9k5mNK0yW6LOLXrPLFZsI8AYfJnbfzIseuJhK+0GdcqCGAw/0Bl/KHm90FJXylpbGId5n2+JtsXfwIIoqPPTc+RRAq8xWinXIbsK0DS/HHpxfuOXzSaisvDoXL4qgAUQJP+/KQkAMUP33r+xLQ7R8wDZyP8+NOPlHcJDOnvUT//XL9jz7/VgAJg7M2O0Z3wvgOkPV+cdgAKosYu0Zc6oEEl2gVDNLjBnPMj4Aag4PeuOTvahbYPE0ASv0n9BlCmWJ7uwtptegzE/CKyDP42/P1Q0GEESFrYizUm46g4a1yG7eML880mr/0Lmj/Z3Q4VHWaAtBcadSdAwccCM/vDTqizCYrBjzPUoaUVIAeX/vtbuwqAOcUhejOwqk2geO0hmvfoVFeADLOHG3p2FnJtc6mWS4+wxHeKnSJdgBLOs2bUyiXy45gxrwDxl5HAZ+leAdBsUqXqj3K8JCYz+MLgrw84dtoXo9akp7SzAqSce4Dkqg1oiDAy1ZmrfCT9NVHH4qZLOjNAwWXmCoggl1eABBk2UhyfbMQwwMKv+/daFsdpCF9t1K2oXAECf7b//tl6Uzu8La0A2dzak0WJC0B+BDtIf+/+G8UAl4ecB9Kv79+L8qvYHJvr9vT/VOSxjy77sUQAAAAASUVORK5CYII=";

export { orgLogo, treeData };

// 图片转为Base64格式
// const image2Base64 = img => {
//   const canvas = document.createElement('canvas')
//   canvas.width = img.width
//   canvas.height = img.height
//   const ctx = canvas.getContext('2d')
//   ctx.drawImage(img, 0, 0, img.width, img.height)
//   const dataURL = canvas.toDataURL('image/png')
//   return dataURL
// }

// const img = new Image()
// img.src = 图片来源
// const imgdata = image2Base64(img)
posted @ 2022-10-28 09:49  VictoriaC~  阅读(549)  评论(0编辑  收藏  举报