-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdatart-uml.iife.js
1 lines (1 loc) · 4.06 KB
/
datart-uml.iife.js
1
(function(){"use strict";var e='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1639279995753" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5363" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M149.33 517.97h341.34v106.65h42.66V517.97h341.34v127.97h42.67V475.3h-384v-85.33h-42.67v85.33h-384v170.65h42.67V517.97z m85.34 170.65H21.33A21.33 21.33 0 0 0 0 709.94v170.67c0 11.775 9.544 21.33 21.33 21.33h213.34c11.776 0 21.33-9.555 21.33-21.33V709.95c0-11.777-9.564-21.33-21.33-21.33z m384 0H405.33A21.33 21.33 0 0 0 384 709.94v170.67c0 11.775 9.544 21.33 21.33 21.33h213.34c11.776 0 21.33-9.555 21.33-21.33V709.95c0-11.777-9.564-21.33-21.33-21.33z m384 0H789.33A21.33 21.33 0 0 0 768 709.94v170.67c0 11.775 9.544 21.33 21.33 21.33h213.34c11.776 0 21.33-9.555 21.33-21.33V709.95c0-11.777-9.564-21.33-21.33-21.33zM341.33 325.98h341.34c11.776 0 21.33-9.554 21.33-21.34V133.98a21.34 21.34 0 0 0-21.33-21.34H341.33A21.33 21.33 0 0 0 320 133.98v170.66c0 11.776 9.544 21.34 21.33 21.34z" p-id="5364"></path></svg>';function t({dHelper:t}){const n={code:`%%{config: { 'fontFamily': 'Menlo', 'fontSize': 12, 'fontWeight': 400} }%%\n %%{init: { 'logLevel': 'debug', 'theme': '' } }%%\n \n sequenceDiagram\n participant A as 项目主入口\n participant C as 图表管理器\n participant V as 可视化模块\n participant S as 后端服务\n \n A->>C: 初始化 Chart Manager\n C->>S: 请求插件图表路径集合\n S--\x3e>C: 返回插件图表路径集合\n Note right of S: 服务端将从'custom-chart-plugins'文件夹读取自定义组件\n loop 插件集合\n C->>S: 下载插件图表\n S--\x3e>C: 返回插件图表路文件\n C--\x3e>C: 检查及加载插件图表文件\n end\n C->>C: 加载默认图表集合\n C--\x3e>A: 完成图表初始化\n A->>V: 切换到可视化模块开始制作自定义图表\n V->>S: 保存制作完成的图表\n `,watermark:`Powered by Datart`};return{config:{datas:[],styles:[{label:"code.title",key:"code",comType:"group",rows:[{label:"code.area",key:"area",comType:"text",options:{}}]},{label:"watermark.title",key:"watermark",comType:"group",rows:[{label:"watermark.area",key:"area",comType:"text",options:{}}]}],settings:[],i18ns:[{lang:"zh-CN",translation:{code:{title:"代码设置",area:"编辑区"},watermark:{title:"水印设置",area:"编辑区"}}},{lang:"en",translation:{code:{title:"Code Setting",area:"Editor Block"},watermark:{title:"Watermark Setting",area:"Editor Block"}}}]},isISOContainer:"experiment-mermaid-uml-chart",dependency:["https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.13.3/mermaid.min.js"],meta:{id:"experiment-mermaid-uml-chart",name:"[Experiment] Mermaid UML",icon:e,requirements:[{group:null,aggregate:null}]},_containerId:null,onMount(e,t){this._containerId=e.containerId;if("mermaid"in t.window){this.chart=t.window.mermaid.mermaidAPI;this.chart.initialize({startOnLoad:false})}},onUpdated(e,a){const r=e.config.styles;const i=t.getValue(r,["code","area"])||n.code;const o=t.getValue(r,["watermark","area"])||n.watermark;var s=a.document.getElementById(this._containerId);if(this.chart&&s){this.chart.render("theGraph",i,(function(e){s.style.position="relative";s.style.overflow="hidden";s.style.margin="20px";s.innerHTML=e}));this.addWatermark(s,o,a)}},onUnMount(){},onResize(e,t){},addWatermark(e,t,n){if(!t)return;const a=n.document.createElement("div");a.style.position="absolute";a.style.left="-50%";a.style.top="-50%";a.style.width="200%";a.style.height="200%";a.style.color="#f1f1f1";a.style["line-height"]="90px";a.style["z-index"]=1;a.style["font-size"]="18px";a.style["-webkit-transform"]="rotate(-45deg)";a.style["-webkit-transform"]="rotate(-45deg)";a.innerHTML=`\n <p>${Array(Math.ceil(1/t.length*2e3)).fill(`${t}`).join(Array(20).fill(" ").join(" "))}</p>\n `;e.appendChild(a)}}}return t})();