103 lines
4.4 KiB
JavaScript
103 lines
4.4 KiB
JavaScript
export function translateDiagram(n){
|
|
switch(n.noteId){
|
|
case '2lpgmasyYDzj':return `sequenceDiagram
|
|
participant Alice as 앨리스
|
|
participant John as 존
|
|
participant Bob as 밥
|
|
Alice->>John: 존 안녕? 잘 지내?
|
|
loop 건강 확인
|
|
John->>John: 건강에 대한 걱정 떨치기
|
|
end
|
|
Note right of John: 합리적으로 생각하자!
|
|
John-->>Alice: 잘 지내!
|
|
John->>Bob: 너는 어때?
|
|
Bob-->>John: 아주 좋아!
|
|
`;
|
|
case 'AKehCOdmh8N4':return `mindmap
|
|
root((마인드맵))
|
|
기원
|
|
오랜 역사
|
|
::icon(fa fa-book)
|
|
대중화
|
|
영국의 대중 심리학 저술가 토니 부잔
|
|
연구
|
|
효과와 특징
|
|
자동 생성
|
|
활용
|
|
창의적 발상
|
|
전략 수립
|
|
논증 구조 정리
|
|
도구
|
|
펜과 종이
|
|
Mermaid
|
|
`;
|
|
case 'H9buVO01mMRb':return `gantt
|
|
section 작업
|
|
완료된 작업 :done, des1, 2014-01-06,2014-01-08
|
|
진행 중인 작업 :active, des2, 2014-01-07, 3d
|
|
병렬 작업 1 :des3, after des1, 1d
|
|
병렬 작업 2 :des4, after des1, 1d
|
|
병렬 작업 3 :des5, after des3, 1d
|
|
병렬 작업 4 :des6, after des4, 1d
|
|
`;
|
|
case 'VzyZ9ykt9htN':return `journey
|
|
title 나의 근무일
|
|
section 출근
|
|
차 끓이기: 5: 나
|
|
위층으로 이동: 3: 나
|
|
일하기: 1: 나, 고양이
|
|
section 퇴근
|
|
아래층으로 이동: 5: 나
|
|
앉아서 쉬기: 3: 나
|
|
`;
|
|
case 'W5T6rJy0WKmY':return `graph TD
|
|
A[사각형] -->|연결 문구| B(둥근 사각형)
|
|
B --> C{판단}
|
|
C -->|첫 번째| D[결과 1]
|
|
C -->|두 번째| E[결과 2]
|
|
`;
|
|
case 'Z56PMxIxGueC':return 'pie\n"개" : 386\n"고양이" : 85\n"쥐" : 15\n';
|
|
case 'bp1FVvjsJB0V':return `erDiagram
|
|
고객 }|..|{ 배송지 : 보유
|
|
고객 ||--o{ 주문 : 주문함
|
|
고객 ||--o{ 청구서 : 지불책임
|
|
배송지 ||--o{ 주문 : 수령
|
|
청구서 ||--|{ 주문 : 청구대상
|
|
주문 ||--|{ 주문항목 : 포함
|
|
상품분류 ||--|{ 상품 : 분류
|
|
상품 ||--o{ 주문항목 : 주문됨
|
|
`;
|
|
case 'iP3r5W4tQFLb':return `stateDiagram-v2
|
|
state "정지" as Still
|
|
state "이동" as Moving
|
|
state "충돌" as Crash
|
|
[*] --> Still
|
|
Still --> [*]
|
|
Still --> Moving
|
|
Moving --> Still
|
|
Moving --> Crash
|
|
Crash --> [*]
|
|
`;
|
|
}
|
|
let c=n.content;
|
|
const map={
|
|
'System Context diagram for Internet Banking System':'인터넷뱅킹 시스템의 구성',
|
|
'Banking Customer A':'은행 고객 A','Banking Customer B':'은행 고객 B','Banking Customer C':'은행 고객 C','Banking Customer D':'은행 고객 D',
|
|
'A customer of the bank, with personal bank accounts.':'개인 계좌를 보유한 은행 고객입니다.',
|
|
'Internet Banking System':'인터넷뱅킹 시스템','Allows customers to view information about their bank accounts, and make payments.':'계좌 정보를 확인하고 결제할 수 있습니다.',
|
|
'A customer of the bank, <br/> with personal bank accounts.':'개인 계좌를 보유한<br/>은행 고객입니다.',
|
|
'Mainframe Banking System':'메인프레임 뱅킹 시스템','Stores all of the core banking information about customers, accounts, transactions, etc.':'고객과 계좌 및 거래에 관한 핵심 정보를 저장합니다.',
|
|
'BankBoundary2':'은행 내부 영역 2','BankBoundary3':'은행 내부 영역 3','BankBoundary':'은행 내부 영역',
|
|
'Banking System A':'은행 시스템 A','Banking System B':'은행 시스템 B','A system of the bank, with personal bank accounts.':'개인 계좌를 관리하는 은행 시스템입니다.',
|
|
'E-mail system':'전자우편 시스템','The internal Microsoft Exchange e-mail system.':'내부 Microsoft Exchange 전자우편 시스템입니다.',
|
|
'Banking System D Database':'은행 시스템 D 데이터베이스','Banking System F Queue':'은행 시스템 F 대기열','Banking System G Queue':'은행 시스템 G 대기열',
|
|
'Sends e-mails to':'전자우편 발송 대상','Sends e-mails':'전자우편 발송','Uses':'사용','"boundary"':'"영역"',
|
|
'Git Issues - days since last update':'Git 이슈 — 마지막 수정 후 경과 일수','section Issue':'section 이슈 ',
|
|
'Guarantee':'보증','User attributes':'사용자 속성','Master data':'기준 데이터','Exchange Rate':'환율','Profit Centers':'수익 부서','Vendor Partners':'공급 협력사','Work Situation':'업무 현황','Customer':'고객',
|
|
'Cool':'멋진 관계','Where am i?':'현재 위치는?',
|
|
'branch develop':'branch 개발','checkout main':'checkout main'
|
|
};
|
|
if(n.type==='mermaid')for(let[k,v]of Object.entries(map))c=c.replaceAll(k,v);
|
|
return c;
|
|
}
|