index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  2. <meta charset="utf-8">
  3. <title>Websfg</title>
  4. <!--
  5. /*
  6. * Copyright t lefering
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. * These are the four essential freedoms with GNU GPL software:
  22. * 1: freedom to run the program, for any purpose
  23. * 2: freedom to study how the program works, and change it to make it do what you wish
  24. * 3: freedom to redistribute copies to help your Free Software friends
  25. * 4: freedom to distribute copies of your modified versions to your Free Software friends
  26. * , ,
  27. * / \
  28. * ((__-^^-,-^^-__))
  29. * `-_---' `---_-'
  30. * `--|o` 'o|--'
  31. * \ ` /
  32. * ): :(
  33. * :o_o:
  34. * "-"
  35. */
  36. -->
  37. </head>
  38. <body>
  39. <style>
  40. button { margin:4px; cursor:pointer; font-size: 70%; font-family; arial,sans-serif; margin-right: 5px }
  41. </style>
  42. <h2>Websfg sfg.c as wasm sugiyama graph layout running in the browser</h2>
  43. <a href="https://notabug.org/mooigraph/sfgraph">This is a test-version and See sfg.c in sfgraph at notabug</a>
  44. <br>
  45. <br>
  46. Enter your graph data as edges between node numbers into the text area below.<br>
  47. The node numbers must start with number 1 and try the sample buttons below. <br>
  48. Enter a edge from node number 2 to node number 3 like this way on one line:<br>
  49. 2 3
  50. <br>
  51. <button id="sample_1_btn" disabled>Sample 1</button>
  52. <button id="sample_2_btn" disabled>Sample 2</button>
  53. <button id="sample_3_btn" disabled>Sample 3</button>
  54. <button id="sample_4_btn" disabled>Sample 4</button>
  55. <button id="sample_5_btn" disabled>Sample 5</button>
  56. <br>
  57. <textarea id="graph_data" rows="20" cols="80" width="100%" wrap="off">
  58. # this is a comment line starting with # char
  59. # input edges between node numbers starting with node number 1 like this:
  60. # this graph has 10 nodes, 12 edges
  61. 1 2
  62. 1 3
  63. 1 4
  64. 1 5
  65. 5 7
  66. 8 7
  67. 9 8
  68. 9 6
  69. 6 7
  70. 2 7
  71. 7 10
  72. 6 10
  73. </textarea><br>
  74. maximum 1000 chars input text
  75. <p>
  76. <button id="generate_btn" style="font-size: 100%">Generate Graph layout</button>
  77. </p>
  78. <div id="graph_svg_div">
  79. <!-- Target for dynamic svg generation -->
  80. </div>
  81. <script language="javascript" type="text/javascript" src="jquery-3.6.0.js"> </script>
  82. <script language="javascript" type="text/javascript" src="site.js"> </script>
  83. <script type="bogus" id="sample1_text">
  84. # this graph has 21 nodes, 38 edges
  85. 1 2
  86. 1 3
  87. 1 4
  88. 1 5
  89. 5 6
  90. 5 7
  91. 8 9
  92. 8 10
  93. 8 5
  94. 11 12
  95. 11 13
  96. 11 8
  97. 14 15
  98. 14 16
  99. 14 11
  100. 17 19
  101. 17 14
  102. 19 16
  103. 20 19
  104. 21 20
  105. 21 18
  106. 18 19
  107. 18 15
  108. 15 16
  109. 15 12
  110. 13 10
  111. 12 13
  112. 12 9
  113. 9 10
  114. 9 6
  115. 6 7
  116. 4 21
  117. 4 20
  118. 4 17
  119. 3 7
  120. 2 3
  121. 2 21
  122. 2 6
  123. </script>
  124. <!------------------------------------------------------------------>
  125. <script type="bogus" id="sample2_text">
  126. # this graph has 12 nodes, 22 edges
  127. 1 2
  128. 1 3
  129. 1 4
  130. 1 5
  131. 5 6
  132. 5 7
  133. 8 9
  134. 8 10
  135. 8 5
  136. 10 7
  137. 12 11
  138. 12 9
  139. 9 10
  140. 9 6
  141. 6 7
  142. 4 12
  143. 4 11
  144. 4 8
  145. 3 11
  146. 2 3
  147. 2 12
  148. 2 6
  149. </script>
  150. <!------------------------------------------------------------------>
  151. <script type="bogus" id="sample3_text">
  152. # this graph has 15 nodes, 27 edges
  153. 1 2
  154. 1 3
  155. 1 4
  156. 1 5
  157. 5 6
  158. 8 9
  159. 8 10
  160. 8 5
  161. 11 12
  162. 11 13
  163. 11 8
  164. 13 10
  165. 14 13
  166. 15 14
  167. 15 12
  168. 12 13
  169. 10 7
  170. 9 10
  171. 9 6
  172. 6 7
  173. 4 15
  174. 4 14
  175. 4 11
  176. 3 14
  177. 3 7
  178. 2 3
  179. 2 6
  180. </script>
  181. <!------------------------------------------------------------------>
  182. <script type="bogus" id="sample4_text">
  183. # this graph has 12 nodes, 22 edges
  184. 1 2
  185. 1 3
  186. 1 4
  187. 1 5
  188. 5 6
  189. 5 7
  190. 8 9
  191. 8 10
  192. 8 5
  193. 10 7
  194. 12 11
  195. 12 9
  196. 9 10
  197. 9 6
  198. 6 7
  199. 4 12
  200. 4 11
  201. 4 8
  202. 3 11
  203. 2 3
  204. 2 12
  205. 2 6
  206. </script>
  207. <!------------------------------------------------------------------>
  208. <script type="bogus" id="sample5_text">
  209. # this graph has 24 nodes, 42 edges
  210. 1 2
  211. 1 3
  212. 1 4
  213. 1 5
  214. 5 6
  215. 5 7
  216. 8 9
  217. 8 10
  218. 8 5
  219. 11 13
  220. 11 8
  221. 14 16
  222. 14 11
  223. 17 19
  224. 17 14
  225. 20 22
  226. 20 17
  227. 22 19
  228. 23 22
  229. 24 23
  230. 24 21
  231. 21 22
  232. 21 18
  233. 19 16
  234. 18 19
  235. 18 15
  236. 16 13
  237. 15 16
  238. 15 12
  239. 13 10
  240. 12 13
  241. 12 9
  242. 9 10
  243. 9 6
  244. 6 7
  245. 4 24
  246. 4 23
  247. 4 20
  248. 3 7
  249. 2 3
  250. 2 24
  251. 2 6
  252. </script>
  253. </body>
  254. <!-- Defer loading of javascript by placing these tags at the tail end of the document -->
  255. </html>