"틀:SemanticGraph"의 두 판 사이의 차이

광주문화예술인문스토리플랫폼
이동: 둘러보기, 검색
2번째 줄: 2번째 줄:
 
{{#tag:html|
 
{{#tag:html|
 
<div id="semantic-graph-container">
 
<div id="semantic-graph-container">
<iframe id="semantic-graph-iframe" width="100%" height="640px" style="border:0" src="https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key|}}}"></iframe>
+
<iframe id="semantic-graph-iframe" width="100%" height="640px" style="border:0" src="https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key{{!}}|}}}"></iframe>
 
<br/>
 
<br/>
 
<input type="button" value="전체화면" onclick="location.href='https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key}}}'">  
 
<input type="button" value="전체화면" onclick="location.href='https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key}}}'">  
13번째 줄: 13번째 줄:
 
   iframe.addEventListener('load', function() {
 
   iframe.addEventListener('load', function() {
 
     try {
 
     try {
      // iframe 내용 접근 시도 (same-origin인 경우)
+
       var iframeDoc = iframe.contentDocument {{!}}{{!}} iframe.contentWindow.document;
       var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
 
 
        
 
        
      // 404 또는 에러 페이지 체크
+
       if (iframeDoc.title.includes('404') {{!}}{{!}}
       if (iframeDoc.title.includes('404') ||
+
           iframeDoc.body.innerHTML.includes('404') {{!}}{{!}}
           iframeDoc.body.innerHTML.includes('404') ||
 
 
           iframeDoc.body.innerHTML.length < 100) {
 
           iframeDoc.body.innerHTML.length < 100) {
 
         hideGraphSection();
 
         hideGraphSection();
 
       }
 
       }
 
     } catch(e) {
 
     } catch(e) {
      // Cross-origin인 경우 접근 불가, fetch로 체크
 
 
       fetch(iframe.src, {method: 'HEAD'})
 
       fetch(iframe.src, {method: 'HEAD'})
 
         .then(function(response) {
 
         .then(function(response) {
           if (!response.ok || response.status === 404) {
+
           if (!response.ok {{!}}{{!}} response.status === 404) {
 
             hideGraphSection();
 
             hideGraphSection();
 
           }
 
           }
36번째 줄: 33번째 줄:
 
   });
 
   });
 
    
 
    
  // 에러 발생 시에도 숨김
 
 
   iframe.addEventListener('error', function() {
 
   iframe.addEventListener('error', function() {
 
     hideGraphSection();
 
     hideGraphSection();
42번째 줄: 38번째 줄:
 
    
 
    
 
   function hideGraphSection() {
 
   function hideGraphSection() {
    // iframe이 포함된 p 태그 찾기
 
 
     var pTag = container.closest('p');
 
     var pTag = container.closest('p');
 
     if (pTag) {
 
     if (pTag) {
 
       pTag.style.display = 'none';
 
       pTag.style.display = 'none';
 
        
 
        
      // 이전 형제 요소 중 h2 찾기
 
 
       var prevElement = pTag.previousElementSibling;
 
       var prevElement = pTag.previousElementSibling;
 
       while (prevElement) {
 
       while (prevElement) {
62번째 줄: 56번째 줄:
 
}}
 
}}
 
</onlyinclude>
 
</onlyinclude>
 +
  
  

2026년 1월 12일 (월) 09:33 판




사용방법

시맨틱 데이터베이스의 특정 노드를 중심으로 하는 네트워크 그래프를 출력하는 틀입니다

{{SemanticGraph | key = }}