소스 검색

Made a tiny graph editor in with D3

Joeri Exelmans 3 년 전
부모
커밋
3e0682f977
2개의 변경된 파일148개의 추가작업 그리고 46개의 파일을 삭제
  1. 18 0
      dist/index.html
  2. 130 46
      src/frontend/index.js

+ 18 - 0
dist/index.html

@@ -8,9 +8,27 @@
       svg {
         background-color: white;
       }
+      textarea {
+        background-color: #eee;
+      }
     </style>
   </head>
   <body>
+    <svg width="600" height="400" id="svg">
+      <defs>
+        <marker id="arrowhead" markerWidth="10" markerHeight="7" 
+        refX="0" refY="3.5" orient="auto">
+          <polygon points="0 0, 10 3.5, 0 7" />
+        </marker>
+      </defs>
+    </svg>
+    <textarea rows="26" cols="40" readonly id="log"></textarea>
+    <br/>
+
+    <button id="createNode">Create node</button>
+    <br/>
+    Left-click on a node to delete it. Drag with the right mouse button from one node to another to create an edge.
+
     <script type="module" src="./bundle.js"></script>
   </body>
 </html>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 130 - 46
src/frontend/index.js