[工具|绘图] markdown的绘图工具Graphviz示例

Graphviz: Graphviz 是一个开源的图形可视化工具,它使用 DOT 语言描述图形结构和属性,并将其转换为图形形式。你可以在 Markdown 中使用 Graphviz 的语法来创建有向图、无向图、流程图等。
dot语言官方地址
示例代码

digraph BusinessModelCanvas {
  rankdir=RL;
  edge[style=invis];
  node [shape=rectangle];

  subgraph cluster_label{
    rank=same;
  subgraph cluster_top{
  enterpriseCustomer[label=<
    <b>企业客户</b>
  >];
  educationCustomer[label=<
    <b>教育机构</b>
  >];
  governmentCustomer[label=<
    <b>政府机构</b>
  >];

  subgraph cluster_customerSegments {
    label="客户细分"
    style=filled;
    color="#e5fbf0";
    enterpriseCustomer;
    educationCustomer;
    governmentCustomer;
  }

  regularUpdates[label=<
    <b>定期更新和升级</b>
  >];
  customerFeedback[label=<
    <b>客户反馈和需求收集</b>
  >];
  longTermPartnership[label=<
    <b>长期合作伙伴关系</b>
  >];
 subgraph cluster_customerRelationships{
    label="客户关系";
    style=filled;
    color="#48A0F7";
    regularUpdates;
    customerFeedback;
    longTermPartnership;
 }
 enterpriseCustomer -> regularUpdates[weight=20];

 indirectSales[label=<
    <b>间接销售</b>
  >];
  partnerCoSelling[label=<
    <b>合作伙伴联合销售</b>
  >];
 subgraph cluster_Channels{
  label="渠道通路";
  style=filled;
  color="#44df92";
  indirectSales;
  partnerCoSelling;
 }
 governmentCustomer -> partnerCoSelling[weight=0];

  applicationOnboarding[label=<
    <b>简化应用接入和管理</b>
  >];
  applicationEntryPoint[label=<
    <b>提供统一的应用入口</b>
  >];
  subgraph cluster_ValueProposition{
    label="价值主张";
    style=filled;
    color="#ffa899";
    applicationOnboarding;
    applicationEntryPoint;
  }
  regularUpdates -> applicationOnboarding;
  partnerCoSelling -> applicationEntryPoint;

  launcher[label=<
    <b>启动台</b>
  >];
  applicationManagement[label=<
    <b>应用管理</b>
  >];
  subgraph cluster_KeyActivities{
    label="关键业务";
    style=filled;
    color="#ccdeff";
    launcher;
    applicationManagement;
  }
  applicationOnboarding -> launcher;
   
   iam[label=<
    <b>管理系统</b>
  >];
   subgraph cluster_KeyResources{
    label="核心资源";
    style=filled;
    color="#99bdff";
    iam;
   }
   applicationEntryPoint -> iam;

 iamServer[label=<
    <b>身份验证服务提供商(IAM)</b>
  >];
  developer[label=<
    <b>应用开发商(IAM)</b>
  >];
  subgraph cluster_KeyPartnership{
    label="重要合作";
    style=filled;
    color="#55e0a6";
    iamServer;
    developer;
  }
  launcher -> iamServer;
  iam -> developer;
  }

  subgraph cluster_bottom{
  indirectIncome[label=<
    <b>间接收入</b>
  >];
  subgraph cluster_RevenueStreams{
    label="收益来源";
    style=filled;
    color="#55e0a6";
    indirectIncome;
  }

  researchCosts[label=<
    <b>研发和技术支持成本</b>
  >];
  collaborationCosts[label=<
    <b>合作伙伴关系成本</b>
  >];
  managementCosts[label=<
    <b>管理和行政成本</b>
  >];
  subgraph cluster_CostStructure{
    label="成本结构";
    style=filled;
    color="#e0ccff";
    rank=same;
    researchCosts;
    collaborationCosts;
    managementCosts;
  }
  indirectIncome -> managementCosts;
  managementCosts-> collaborationCosts;
  collaborationCosts ->researchCosts;
  }
  }
}

业务流程图示例(使用泳道图)

digraph BusinessProcessDiagram {
    edge[style=invis];
    rankdir=RL;
    node[shape=box];

    start[label=<
    <b>开始</b>
    >,shape=ellipse];
    authEnd[label=<
    <b>结束</b>
    >,shape=ellipse];
    orgAdminEnd[label=<
    <b>结束</b>
    >,shape=ellipse];
    orgMemEnd[label=<
    <b>结束</b>
    >,shape=ellipse];

    subgraph cluster_InternalSystems {
        rank=same;
        style = rounded;

        
        isOrgAdmin[label=<
        <b>是否管理组织</b>
        >,shape=diamond, fillcolor=lightblue];
        sysSyncOrg[label=<
          <b>同步组织信息</b>
        >];
        sysSyncUser[label=<
          <b>同步用户信息</b>
        >];
        sysSyncApp[label=<
          <b>同步应用信息</b>
        >];

        subgraph cluster_SystemAdmin {
            label = "应用中心";
            style=rounded;
            color="#48A0F7";
            rank=min;
            labeljust=l;
            isOrgAdmin;
            sysSyncOrg;
            sysSyncUser;
            sysSyncApp;
        }
    
        addOrgApps[label=<
          <b>添加组织应用</b>
        >];
    
        pushApps[label=<
          <b>发布应用</b>
        >];

        subgraph cluster_OrgAdmin {
            label = "组织管理员";
            style=rounded;
            color="#48A0F7";
            rank=min;
            labeljust=l;
            addOrgApps;
            pushApps;
        }
        
        
        
        orgMemFindOrgApp[label=<
          <b>查看应用列表</b>
        >];
        startApps[label=<
          <b>启动应用</b>
        >];
        addOrgMemPerApp[label=<
          <b>添加当前用户的个人应用</b>
        >];
        subgraph cluster_OrgMember {
            label = "组织成员";
            rank=min;
            labeljust=l;
            style=rounded;
            color="#48A0F7";
            orgMemFindOrgApp;
            startApps;
            addOrgMemPerApp;
        }
    }
    
    authentication[label=<
          <b>身份验证</b>
        >];
        isVerified[label=<
          <b>是否认证通过</b>
        >,shape=diamond];
        orgInfo[label=<
          <b>组织信息</b>
        >];
        userInfo[label=<
          <b>用户信息</b>
        >];
        appInfo[label=<
          <b>应用信息</b>
        >];

    subgraph cluster_ExternalSystem {
        label = "管理系统";
        rank=min;
        style=filled;
        color=gray;
        authentication;
        isVerified;
        orgInfo;
        userInfo;
        appInfo;
    }
    
    sysSyncOrg -> orgInfo[style=bold];
    sysSyncUser -> userInfo[style=bold];
    sysSyncApp -> appInfo[style=bold];

    start -> authentication[style=bold,constraint=false];
    authentication -> isVerified[style=bold,constraint=false];
    isVerified -> authEnd[label="NO",style=bold];
    isVerified -> isOrgAdmin[label="YES",style=bold];
    isOrgAdmin -> addOrgApps[label="YES",style=bold];
    addOrgApps -> pushApps[style=bold,constraint=false];
    pushApps -> orgAdminEnd[style=bold];
    isOrgAdmin -> addOrgMemPerApp[label="NO",style=bold];
    isOrgAdmin -> orgMemFindOrgApp[label="NO",style=bold];
    orgMemFindOrgApp -> startApps[style=bold,constraint=false];
    addOrgMemPerApp -> orgMemEnd[style=bold,constraint=false];
    startApps -> orgMemEnd[style=bold];
}

猜你喜欢

转载自blog.csdn.net/macaiyun0629/article/details/131788889