├── LICENSE ├── README.md ├── samples ├── 3d.html ├── about.html ├── animation.html ├── contact.html ├── container.html ├── container2.html ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap.min.css │ └── jquery.snippet.min.css ├── cutFruit.html ├── dev.html ├── device.html ├── diy.html ├── gravitate.html ├── img │ ├── OS_Apple.png │ ├── OS_Ubuntu.png │ ├── OS_Windows_8.png │ ├── acer-samll.jpg │ ├── bg.jpg │ ├── building.png │ ├── cloud.png │ ├── cutfruit.jpg │ ├── cutfruit_bg.jpg │ ├── delivery.png │ ├── email.png │ ├── fruit │ │ ├── apple.png │ │ ├── background.jpg │ │ ├── banana.png │ │ ├── basaha.png │ │ ├── boom.png │ │ ├── developing.png │ │ ├── dojo.png │ │ ├── flash.png │ │ ├── flash_bak.png │ │ ├── game-over.png │ │ ├── home-desc.png │ │ ├── home-mask.png │ │ ├── logo.png │ │ ├── lose.png │ │ ├── new-game.png │ │ ├── new.png │ │ ├── ninja.png │ │ ├── peach.png │ │ ├── quit.png │ │ ├── sandia.png │ │ ├── score.png │ │ └── xxxf.png │ ├── harddisk.png │ ├── helpdesk.png │ ├── home.png │ ├── host.png │ ├── laptop.png │ ├── memory.png │ ├── ne.png │ ├── new-game.png │ ├── ok.png │ ├── person.png │ ├── phone │ │ ├── IE.png │ │ ├── Karate.png │ │ ├── SMS.png │ │ ├── Setup.png │ │ ├── bullets.png │ │ ├── power.png │ │ ├── signal.png │ │ ├── usb.png │ │ └── writing.png │ ├── print.png │ ├── qq.png │ ├── room.jpg │ ├── telephone.png │ ├── vm.png │ ├── vm_inner.jpg │ └── zone.png ├── index.html ├── js │ ├── animation.js │ ├── dev.js │ ├── excanvas.js │ ├── jquery.js │ ├── jtopo-0.3.0-min.js │ ├── menu.js │ └── snippet │ │ └── jquery.snippet.min.js ├── keyboard.html ├── link.html ├── mix.html ├── mix2.html ├── mix3.html ├── mix4.html ├── mouse.html ├── node.html ├── nodeDown.html ├── phoneNode.html ├── real.html ├── rotate.html ├── sound │ ├── boom.mp3 │ ├── boom.ogg │ ├── menu.mp3 │ ├── menu.ogg │ ├── over.mp3 │ ├── over.ogg │ ├── splatter.mp3 │ ├── splatter.ogg │ ├── start.mp3 │ ├── start.ogg │ ├── throw.mp3 │ └── throw.ogg ├── star.html ├── star2.html ├── star3.html ├── star4.html ├── tree.html ├── tree2.html ├── tree3.html └── umlNode.html └── src ├── jtopo.abstractnode.js ├── jtopo.animation.js ├── jtopo.container.js ├── jtopo.databox.js ├── jtopo.element.js ├── jtopo.js ├── jtopo.layout.js ├── jtopo.link.js ├── jtopo.node.js └── jtopo.util.js /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JTopo 2 | ===== 3 | 4 | http://wondery.github.io/jtopo/ 5 | 6 | An simple and powerful HTML5 topology libraries. 7 | More about please to see samples. 8 | 9 | -------------------------------------------------------------------------------- /samples/3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 64 | 70 | 71 | 72 | 73 | 74 | 96 | 97 |
98 |
99 |
100 | 104 |
105 |
106 | 107 |
108 |        Effect: 109 | 113 |
114 |
115 | 116 |
117 | 118 |
119 |

© Company 2013

120 |
121 | 122 |
123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /samples/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 56 | 62 | 63 | 64 | 65 | 66 | 88 | 89 |
90 |
91 |
92 | 96 |
97 |
98 | 99 |
100 |
101 | 102 |
103 | 104 |
105 |

© Company 2013

106 |
107 | 108 |
109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /samples/animation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 51 | 57 | 58 | 59 | 60 | 61 | 83 | 84 |
85 |
86 |
87 | 91 |
92 |
93 | 94 |
95 |        Chooice: 96 | 108 |
109 |
110 | 111 |
112 | 113 |
114 |

© Company 2013

115 |
116 | 117 |
118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /samples/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 56 | 62 | 63 | 64 | 65 | 66 | 88 | 89 |
90 |
91 |
92 | 96 |
97 |
98 | 99 |
100 |
101 | 102 |
103 | 104 |
105 |

© Company 2013

106 |
107 | 108 |
109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /samples/container.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 104 | 110 | 111 | 112 | 113 | 114 | 136 | 137 |
138 |
139 |
140 | 144 |
145 |
146 | 147 |
148 |
149 | 150 |
151 | 152 |
153 |

© Company 2013

154 |
155 | 156 |
157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /samples/container2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 102 | 108 | 109 | 110 | 111 | 112 | 134 | 135 |
136 |
137 |
138 | 142 |
143 |
144 | 145 |
146 |
147 | 148 |
149 | 150 |
151 |

© Company 2013

152 |
153 | 154 |
155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /samples/cutFruit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 262 | 268 | 269 | 270 | 271 | 272 | 294 | 295 |
296 |
297 |
298 | 302 |
303 |
304 | 305 |
306 |
307 | 308 |
309 | 312 | 315 | 318 | 321 | 324 | 327 |
328 |

© Company 2013

329 |
330 | 331 |
332 | 333 | 334 | 335 | -------------------------------------------------------------------------------- /samples/dev.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /samples/device.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 79 | 85 | 86 | 87 | 88 | 89 | 111 | 112 |
113 |
114 |
115 | 119 |
120 |
121 | 122 |
123 |
124 | 125 |
126 | 127 |
128 |

© Company 2013

129 |
130 | 131 |
132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /samples/diy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 202 | 208 | 209 | 210 | 211 | 212 | 234 | 235 |
236 |
237 |
238 | 242 |
243 |
244 | 245 |
246 |
247 | 248 |
249 | 250 |
251 |

© Company 2013

252 |
253 | 254 |
255 | 256 | 257 | 258 | -------------------------------------------------------------------------------- /samples/gravitate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 87 | 93 | 94 | 95 | 96 | 97 | 119 | 120 |
121 |
122 |
123 | 127 |
128 |
129 | 130 |

131 |

132 |
133 | 134 |
135 | 136 |
137 |

© Company 2013

138 |
139 | 140 |
141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /samples/img/OS_Apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/OS_Apple.png -------------------------------------------------------------------------------- /samples/img/OS_Ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/OS_Ubuntu.png -------------------------------------------------------------------------------- /samples/img/OS_Windows_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/OS_Windows_8.png -------------------------------------------------------------------------------- /samples/img/acer-samll.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/acer-samll.jpg -------------------------------------------------------------------------------- /samples/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/bg.jpg -------------------------------------------------------------------------------- /samples/img/building.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/building.png -------------------------------------------------------------------------------- /samples/img/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/cloud.png -------------------------------------------------------------------------------- /samples/img/cutfruit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/cutfruit.jpg -------------------------------------------------------------------------------- /samples/img/cutfruit_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/cutfruit_bg.jpg -------------------------------------------------------------------------------- /samples/img/delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/delivery.png -------------------------------------------------------------------------------- /samples/img/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/email.png -------------------------------------------------------------------------------- /samples/img/fruit/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/apple.png -------------------------------------------------------------------------------- /samples/img/fruit/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/background.jpg -------------------------------------------------------------------------------- /samples/img/fruit/banana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/banana.png -------------------------------------------------------------------------------- /samples/img/fruit/basaha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/basaha.png -------------------------------------------------------------------------------- /samples/img/fruit/boom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/boom.png -------------------------------------------------------------------------------- /samples/img/fruit/developing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/developing.png -------------------------------------------------------------------------------- /samples/img/fruit/dojo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/dojo.png -------------------------------------------------------------------------------- /samples/img/fruit/flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/flash.png -------------------------------------------------------------------------------- /samples/img/fruit/flash_bak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/flash_bak.png -------------------------------------------------------------------------------- /samples/img/fruit/game-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/game-over.png -------------------------------------------------------------------------------- /samples/img/fruit/home-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/home-desc.png -------------------------------------------------------------------------------- /samples/img/fruit/home-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/home-mask.png -------------------------------------------------------------------------------- /samples/img/fruit/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/logo.png -------------------------------------------------------------------------------- /samples/img/fruit/lose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/lose.png -------------------------------------------------------------------------------- /samples/img/fruit/new-game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/new-game.png -------------------------------------------------------------------------------- /samples/img/fruit/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/new.png -------------------------------------------------------------------------------- /samples/img/fruit/ninja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/ninja.png -------------------------------------------------------------------------------- /samples/img/fruit/peach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/peach.png -------------------------------------------------------------------------------- /samples/img/fruit/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/quit.png -------------------------------------------------------------------------------- /samples/img/fruit/sandia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/sandia.png -------------------------------------------------------------------------------- /samples/img/fruit/score.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/score.png -------------------------------------------------------------------------------- /samples/img/fruit/xxxf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/fruit/xxxf.png -------------------------------------------------------------------------------- /samples/img/harddisk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/harddisk.png -------------------------------------------------------------------------------- /samples/img/helpdesk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/helpdesk.png -------------------------------------------------------------------------------- /samples/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/home.png -------------------------------------------------------------------------------- /samples/img/host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/host.png -------------------------------------------------------------------------------- /samples/img/laptop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/laptop.png -------------------------------------------------------------------------------- /samples/img/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/memory.png -------------------------------------------------------------------------------- /samples/img/ne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/ne.png -------------------------------------------------------------------------------- /samples/img/new-game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/new-game.png -------------------------------------------------------------------------------- /samples/img/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/ok.png -------------------------------------------------------------------------------- /samples/img/person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/person.png -------------------------------------------------------------------------------- /samples/img/phone/IE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/IE.png -------------------------------------------------------------------------------- /samples/img/phone/Karate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/Karate.png -------------------------------------------------------------------------------- /samples/img/phone/SMS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/SMS.png -------------------------------------------------------------------------------- /samples/img/phone/Setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/Setup.png -------------------------------------------------------------------------------- /samples/img/phone/bullets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/bullets.png -------------------------------------------------------------------------------- /samples/img/phone/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/power.png -------------------------------------------------------------------------------- /samples/img/phone/signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/signal.png -------------------------------------------------------------------------------- /samples/img/phone/usb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/usb.png -------------------------------------------------------------------------------- /samples/img/phone/writing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/phone/writing.png -------------------------------------------------------------------------------- /samples/img/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/print.png -------------------------------------------------------------------------------- /samples/img/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/qq.png -------------------------------------------------------------------------------- /samples/img/room.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/room.jpg -------------------------------------------------------------------------------- /samples/img/telephone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/telephone.png -------------------------------------------------------------------------------- /samples/img/vm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/vm.png -------------------------------------------------------------------------------- /samples/img/vm_inner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/vm_inner.jpg -------------------------------------------------------------------------------- /samples/img/zone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/img/zone.png -------------------------------------------------------------------------------- /samples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 58 | 64 | 65 | 66 | 67 | 68 | 90 | 91 |
92 |
93 |
94 | 98 |
99 |
100 | 101 |
102 |
103 | 104 |
105 | 106 |
107 |

© Company 2013

108 |
109 | 110 |
111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /samples/js/menu.js: -------------------------------------------------------------------------------- 1 | var menus = [ 2 | {text:'Hello world', href:'index.html'}, 3 | 'Basic', 4 | {text:'Node', href:'node.html'}, 5 | {text:'UML-Node', href:'umlNode.html'}, 6 | {text:'phoneNode', href:'phoneNode.html'}, 7 | {text:'Link', href:'link.html'}, 8 | {text:'Container', href:'container.html'}, 9 | {text:'Container-2', href:'container2.html'}, 10 | 'Layout', 11 | {text:'star', href:'star.html'}, 12 | {text:'star-2', href:'star2.html'}, 13 | {text:'star-3', href:'star3.html'}, 14 | {text:'tree', href:'tree.html'}, 15 | {text:'tree-2', href:'tree2.html'}, 16 | {text:'tree-3', href:'tree3.html'}, 17 | {text:'mix', href:'mix.html'}, 18 | {text:'mix-2', href:'mix2.html'}, 19 | {text:'mix-3', href:'mix3.html'}, 20 | {text:'mix-4', href:'mix4.html'}, 21 | 'Effect', 22 | {text:'gravitate', href:'gravitate.html'}, 23 | {text:'rotate', href:'rotate.html'}, 24 | {text:'nodeDown', href:'nodeDown.html'}, 25 | 'Animation', 26 | {text:'basic', href:'animation.html'}, 27 | {text:'cutFruit', href:'cutFruit.html'}, 28 | 'Event', 29 | {text:'mouse', href:'mouse.html'}, 30 | {text:'keyboard', href:'keyboard.html'}, 31 | 'Real', 32 | {text:'DIY Machine', href:'diy.html'}, 33 | {text:'Device', href:'device.html'}, 34 | '3D', 35 | {text:'basic', href:'3d.html'} 36 | 37 | ]; 38 | 39 | function drawMenus(menus){ 40 | var ul = $('#Menu_ul'); 41 | $.each(menus, function(i, e){ 42 | var li = $('
  • ').appendTo(ul); 43 | if(typeof e == 'string'){ 44 | li.addClass('nav-header').html(e); 45 | }else{ 46 | var a = $('').attr('href', e.href).html(e.text); 47 | li.append(a); 48 | if(location.href.indexOf(e.href) != -1){ 49 | li.addClass('active'); 50 | } 51 | } 52 | }); 53 | } 54 | 55 | 56 | String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { 57 | if (!RegExp.prototype.isPrototypeOf(reallyDo)) { 58 | return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith); 59 | } else { 60 | return this.replace(reallyDo, replaceWith); 61 | } 62 | }; 63 | 64 | $(document).ready(function(){ 65 | drawMenus(menus); 66 | $('.brand').html('JTopo'); 67 | $('.pull-right').html(''); 68 | 69 | var code = $('#code').text(); 70 | code = code.replaceAll('>', '>'); 71 | code = code.replaceAll('<', '<'); 72 | $('
    ').appendTo($('#canvas').parent().css('width', '800px'))
    73 | 		.html(code).snippet("javascript",{style:"acid",collapse:true});
    74 | });
    75 | 
    76 | 
    77 | 
    
    
    --------------------------------------------------------------------------------
    /samples/keyboard.html:
    --------------------------------------------------------------------------------
      1 | 
      2 | 
      3 | 
      4 |   
      5 | 	
      6 | 	
      7 | 	
      8 | 	
      9 | 	
     10 | 
     11 |     
     12 |     
     13 |     
     31 |     
     32 | 	
     33 | 	
     34 | 	
     35 | 	
     36 | 	
     37 | 	
     38 | 	
     39 | 	
     40 | 	
     41 | 	
     61 | 	
     67 |   
     68 | 
     69 |   
     70 | 
     71 |     
     93 | 
     94 |     
    95 |
    96 |
    97 | 102 |
    103 |
    104 | 105 |
    106 |
    107 | 108 |
    109 | 110 |
    111 |

    © Company 2013

    112 |
    113 | 114 |
    115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /samples/link.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 119 | 125 | 126 | 127 | 128 | 129 | 151 | 152 |
    153 |
    154 |
    155 | 159 |
    160 |
    161 | 162 |
    163 |
    164 | 165 |
    166 | 167 |
    168 |

    © Company 2013

    169 |
    170 | 171 |
    172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /samples/mix.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 101 | 107 | 108 | 109 | 110 | 111 | 133 | 134 |
    135 |
    136 |
    137 | 141 |
    142 |
    143 | 144 |
    145 |
    146 | 147 |
    148 | 149 |
    150 |

    © Company 2013

    151 |
    152 | 153 |
    154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /samples/mix2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 70 | 76 | 77 | 78 | 79 | 80 | 102 | 103 |
    104 |
    105 |
    106 | 111 |
    112 |
    113 | 114 |
    115 |
    116 | 117 |
    118 | 119 |
    120 |

    © Company 2013

    121 |
    122 | 123 |
    124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /samples/mix3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 70 | 76 | 77 | 78 | 79 | 80 | 102 | 103 |
    104 |
    105 |
    106 | 111 |
    112 |
    113 | 114 |
    115 |
    116 | 117 |
    118 | 119 |
    120 |

    © Company 2013

    121 |
    122 | 123 |
    124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /samples/mix4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 75 | 81 | 82 | 83 | 84 | 85 | 107 | 108 |
    109 |
    110 |
    111 | 116 |
    117 |
    118 | 119 |
    120 |
    121 | 122 |
    123 | 124 |
    125 |

    © Company 2013

    126 |
    127 | 128 |
    129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /samples/mouse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 73 | 79 | 80 | 81 | 82 | 83 | 105 | 106 |
    107 |
    108 |
    109 | 114 |
    115 |
    116 | 117 |
    118 |
    119 | 120 |
    121 | 122 |
    123 |

    © Company 2013

    124 |
    125 | 126 |
    127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /samples/node.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 85 | 91 | 92 | 93 | 94 | 95 | 117 | 118 |
    119 |
    120 |
    121 | 125 |
    126 |
    127 | 128 |
    129 |
    130 | 131 |
    132 | 133 |
    134 |

    © Company 2013

    135 |
    136 | 137 |
    138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /samples/nodeDown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 104 | 110 | 111 | 112 | 113 | 114 | 136 | 137 |
    138 |
    139 |
    140 | 144 |
    145 |
    146 | 147 |
    148 |
    149 | 150 |
    151 | 152 |
    153 |

    © Company 2013

    154 |
    155 | 156 |
    157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /samples/phoneNode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 62 | 68 | 69 | 70 | 71 | 72 | 94 | 95 |
    96 |
    97 |
    98 | 102 |
    103 |
    104 | 105 |
    106 |
    107 | 108 |
    109 | 110 |
    111 |

    © Company 2013

    112 |
    113 | 114 |
    115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /samples/real.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 61 | 67 | 68 | 69 | 70 | 71 | 93 | 94 |
    95 |
    96 |
    97 | 101 |
    102 |
    103 | 104 |
    105 |
    106 | 107 |
    108 | 109 |
    110 |

    © Company 2013

    111 |
    112 | 113 |
    114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /samples/rotate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 60 | 66 | 67 | 68 | 69 | 70 | 92 | 93 |
    94 |
    95 |
    96 | 101 |
    102 |
    103 | 104 |
    105 |
    106 | 107 |
    108 | 109 |
    110 |

    © Company 2013

    111 |
    112 | 113 |
    114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /samples/sound/boom.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/boom.mp3 -------------------------------------------------------------------------------- /samples/sound/boom.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/boom.ogg -------------------------------------------------------------------------------- /samples/sound/menu.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/menu.mp3 -------------------------------------------------------------------------------- /samples/sound/menu.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/menu.ogg -------------------------------------------------------------------------------- /samples/sound/over.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/over.mp3 -------------------------------------------------------------------------------- /samples/sound/over.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/over.ogg -------------------------------------------------------------------------------- /samples/sound/splatter.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/splatter.mp3 -------------------------------------------------------------------------------- /samples/sound/splatter.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/splatter.ogg -------------------------------------------------------------------------------- /samples/sound/start.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/start.mp3 -------------------------------------------------------------------------------- /samples/sound/start.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/start.ogg -------------------------------------------------------------------------------- /samples/sound/throw.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/throw.mp3 -------------------------------------------------------------------------------- /samples/sound/throw.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuanjie54188/jtopo/3247af33618b9f94eb6f54a2f930b062bb53730c/samples/sound/throw.ogg -------------------------------------------------------------------------------- /samples/star.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 65 | 71 | 72 | 73 | 74 | 75 | 97 | 98 |
    99 |
    100 |
    101 | 106 |
    107 |
    108 | 109 |
    110 |
    111 | 112 |
    113 | 114 |
    115 |

    © Company 2013

    116 |
    117 | 118 |
    119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /samples/star2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 67 | 73 | 74 | 75 | 76 | 77 | 99 | 100 |
    101 |
    102 |
    103 | 108 |
    109 |
    110 | 111 |
    112 |
    113 | 114 |
    115 | 116 |
    117 |

    © Company 2013

    118 |
    119 | 120 |
    121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /samples/star3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 62 | 68 | 69 | 70 | 71 | 72 | 94 | 95 |
    96 |
    97 |
    98 | 102 |
    103 |
    104 | 105 |
    106 |
    107 | 108 |
    109 | 110 |
    111 |

    © Company 2013

    112 |
    113 | 114 |
    115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /samples/star4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 80 | 86 | 87 | 88 | 89 | 90 | 112 | 113 |
    114 |
    115 |
    116 | 136 |
    137 |
    138 | 139 |
    140 |
    141 | 142 |
    143 | 144 |
    145 |

    © Company 2013

    146 |
    147 | 148 |
    149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /samples/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 60 | 66 | 67 | 68 | 69 | 70 | 92 | 93 |
    94 |
    95 |
    96 | 101 |
    102 |
    103 | 104 |
    105 |
    106 | 107 |
    108 | 109 |
    110 |

    © Company 2013

    111 |
    112 | 113 |
    114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /samples/tree2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 61 | 67 | 68 | 69 | 70 | 71 | 93 | 94 |
    95 |
    96 |
    97 | 102 |
    103 |
    104 | 105 |
    106 |
    107 | 108 |
    109 | 110 |
    111 |

    © Company 2013

    112 |
    113 | 114 |
    115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /samples/tree3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 61 | 67 | 68 | 69 | 70 | 71 | 93 | 94 |
    95 |
    96 |
    97 | 102 |
    103 |
    104 | 105 |
    106 |
    107 | 108 |
    109 | 110 |
    111 |

    © Company 2013

    112 |
    113 | 114 |
    115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /samples/umlNode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 73 | 79 | 80 | 81 | 82 | 83 | 105 | 106 |
    107 |
    108 |
    109 | 113 |
    114 |
    115 | 116 |
    117 |
    118 | 119 |
    120 | 121 |
    122 |

    © Company 2013

    123 |
    124 | 125 |
    126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /src/jtopo.abstractnode.js: -------------------------------------------------------------------------------- 1 | /* 2 | * JTopo (Javascript topology libraries) 0.2.0 3 | * https://github.com/wondery/jtopo 4 | * 5 | * Copyright (c) 2013 wondery 6 | * Released under the LGPL license, Version 3.0 7 | * http://www.gnu.org/licenses/lgpl.html 8 | * 9 | * Author: wondery 10 | * Email: jtopology@163.com 11 | */ 12 | 13 | (function(JTopo){ 14 | /** 15 | * Abstract node object 16 | * @param {int} id 17 | * @param {String} name 18 | */ 19 | function AbstractNode(name) { 20 | this.id = null; 21 | this.x = 0; 22 | this.y = 0; 23 | this.width = 0; 24 | this.height = 0; 25 | this.visible = true; 26 | this.dragable = true; 27 | 28 | this.name = name; 29 | this.image = null; 30 | this.color = null; 31 | this.layout = null; 32 | this.gravitate = null;//function(){}; 33 | this.parentContainer = null; 34 | this.inContainer = null; 35 | this.outContainer = null; 36 | this.fixed = false; 37 | }; 38 | 39 | AbstractNode.prototype = new JTopo.Element(); 40 | 41 | AbstractNode.prototype.getName = function(){ 42 | return this.name; 43 | }; 44 | 45 | AbstractNode.prototype.setName = function(n){ 46 | this.name = n; 47 | return this; 48 | }; 49 | 50 | AbstractNode.prototype.getImage = function(){ 51 | return this.image; 52 | }; 53 | 54 | AbstractNode.prototype.setImage = function(i){ 55 | var node = this; 56 | if(typeof i == 'string'){ 57 | var img = this.image = new Image(); 58 | this.image.onload = function(){ 59 | node.setSize(img.width, img.height); 60 | }; 61 | this.image.src = i; 62 | }else{ 63 | this.image = i; 64 | } 65 | }; 66 | 67 | var ImageCache = {}; 68 | AbstractNode.prototype.getTypeImage = function(type){ 69 | var typeImages = { 70 | 'zone' : './img/zone.png', 71 | 'host' : './img/host.png', 72 | 'vm' : './img/vm.png' 73 | }; 74 | if(ImageCache[type]){ 75 | return ImageCache[type]; 76 | } 77 | var src = typeImages[type]; 78 | if(src == null) return null; 79 | 80 | var image = new Image(); 81 | image.src = src; 82 | return ImageCache[type] = image; 83 | }; 84 | 85 | AbstractNode.prototype.getType = function(){ 86 | return this.type; 87 | }; 88 | 89 | AbstractNode.prototype.setType = function(type){ 90 | this.type = type; 91 | this.setImage(this.getTypeImage(type)); 92 | }; 93 | 94 | JTopo.AbstractNode = AbstractNode; 95 | 96 | })(JTopo); 97 | -------------------------------------------------------------------------------- /src/jtopo.animation.js: -------------------------------------------------------------------------------- 1 | /* 2 | * JTopo (Javascript topology libraries) 0.2.0 3 | * https://github.com/wondery/jtopo 4 | * 5 | * Copyright (c) 2013 wondery 6 | * Released under the LGPL license, Version 3.0 7 | * http://www.gnu.org/licenses/lgpl.html 8 | * 9 | * Author: wondery 10 | * Email: jtopology@163.com 11 | */ 12 | 13 | (function(JTopo){ 14 | var isStopAll = false; 15 | 16 | //gravity 17 | function gravity(node, option){ 18 | var box = option.context; 19 | var gravity = option.gravity || 0.1; 20 | 21 | var t = null; 22 | var effect = {}; 23 | 24 | function stop(){ 25 | window.clearInterval(t); 26 | if(effect.onStop){ 27 | effect.onStop(node); 28 | } 29 | return effect; 30 | } 31 | 32 | function run(){ 33 | var dx = option.dx || 0, dy = option.dy || 2; 34 | t = setInterval(function(){ 35 | if(isStopAll){ 36 | effect.stop(); 37 | return; 38 | } 39 | dy += gravity; 40 | if(node.y + node.height < box.canvas.height){ 41 | node.setLocation(node.x + dx, node.y + dy); 42 | box.updateView(); 43 | }else{ 44 | dy = 0; 45 | stop(); 46 | } 47 | }, 20); 48 | return effect; 49 | } 50 | 51 | effect.run = run; 52 | effect.stop = stop; 53 | effect.onStop = function(f){ effect.onStop = f; return effect;}; 54 | return effect; 55 | } 56 | 57 | // 58 | function rotate(node, option){ 59 | var box = option.context; 60 | var t = null; 61 | var effect = {}; 62 | var v = option.v; 63 | 64 | function run(){ 65 | t = setInterval(function(){ 66 | if(isStopAll){ 67 | effect.stop(); 68 | return; 69 | } 70 | node.rotate += v || 0.2; 71 | if(node.rotate>2*Math.PI){ 72 | node.rotate = 0; 73 | } 74 | box.updateView(); 75 | }, 100); 76 | return effect; 77 | } 78 | function stop(){ 79 | window.clearInterval(t); 80 | if(effect.onStop){ 81 | effect.onStop(node); 82 | } 83 | return effect; 84 | } 85 | 86 | effect.run = run; 87 | effect.stop = stop; 88 | effect.onStop = function(f){ effect.onStop = f; return effect;}; 89 | return effect; 90 | } 91 | 92 | // 93 | function dividedTwoPiece(node, option){ 94 | var box = option.context; 95 | var style = node.style; 96 | var effect = {}; 97 | 98 | function genNode(x, y, r, beginDegree, endDegree){ 99 | var newNode = new JTopo.Node(); 100 | newNode.setImage(node.image); 101 | newNode.setSize(node.width, node.height); 102 | newNode.setLocation(x, y); 103 | newNode.draw = function(ctx){ 104 | ctx.save(); 105 | ctx.arc(this.x+this.width/2, this.y+this.height/2, r, beginDegree, endDegree); 106 | ctx.clip(); 107 | ctx.beginPath(); 108 | if(this.image != null){ 109 | ctx.drawImage(this.image, this.x, this.y); 110 | }else{ 111 | ctx.fillStyle = 'rgba(' + this.style.fillStyle + ',' + this.alpha + ')'; 112 | ctx.rect(this.x, this.y, this.width, this.height); 113 | ctx.fill(); 114 | } 115 | ctx.closePath(); 116 | ctx.restore(); 117 | }; 118 | return newNode; 119 | }; 120 | 121 | function split(angle, box){ 122 | var beginDegree = angle; 123 | var endDegree = angle + Math.PI; 124 | 125 | var node1 = genNode(node.x, node.y , node.width, beginDegree, endDegree); 126 | var node2 = genNode(node.x- 2 + Math.random()*4, node.y , node.width, beginDegree + Math.PI, beginDegree); 127 | 128 | node.setVisible(false); 129 | 130 | box.add(node1); 131 | box.add(node2); 132 | box.updateView(); 133 | 134 | JTopo.Animation.gravity(node1, {context:box, dx:0.3}).run().onStop(function(n){ 135 | box.remove(node1); 136 | box.remove(node2); 137 | box.updateView(); 138 | effect.stop(); 139 | }); 140 | JTopo.Animation.gravity(node2, {context:box, dx:-0.2}).run(); 141 | } 142 | 143 | function run(){ 144 | split(option.angle, box); 145 | return effect; 146 | } 147 | function stop(){ 148 | if(effect.onStop){ 149 | effect.onStop(node); 150 | } 151 | return effect; 152 | } 153 | 154 | effect.onStop = function(f){ effect.onStop = f; return effect;}; 155 | effect.run = run; 156 | effect.stop = stop; 157 | return effect; 158 | } 159 | 160 | function repeatThrow(node, option){ 161 | var gravity = 0.8; 162 | var wind = 2; 163 | var angle = 0; 164 | var box = option.context; 165 | node.isSelected = function(){ return false; }; 166 | node.isFocus = function(){return false; }; 167 | node.setDragable(false); 168 | 169 | function initNode(node){ 170 | node.setVisible(true); 171 | node.rotate = Math.random(); 172 | var w = box.canvas.width/2; 173 | node.x = w + Math.random() * (w - 100) - Math.random() * (w - 100); 174 | node.y = box.canvas.height; 175 | node.vx = Math.random() * 5 - Math.random() * 5; 176 | node.vy = -25; 177 | } 178 | 179 | var t = null; 180 | var effect = {}; 181 | function run(){ 182 | initNode(node); 183 | t = setInterval(function(){ 184 | if(isStopAll){ 185 | effect.stop(); 186 | return; 187 | } 188 | node.vy += gravity; 189 | node.x += node.vx; 190 | node.y += node.vy; 191 | if(node.x < 0 || node.x >box.canvas.width || node.y>box.canvas.height){ 192 | if(effect.onStop){ 193 | effect.onStop(node); 194 | } 195 | initNode(node); 196 | } 197 | box.updateView(); 198 | }, 50); 199 | return effect; 200 | } 201 | function stop(){ 202 | window.clearInterval(t); 203 | } 204 | 205 | effect.onStop = function(f){ effect.onStop = f; return effect;}; 206 | effect.run = run; 207 | effect.stop = stop; 208 | return effect; 209 | } 210 | 211 | function stopAll(){ 212 | isStopAll = true; 213 | } 214 | 215 | function startAll(){ 216 | isStopAll = false; 217 | } 218 | 219 | 220 | //cycle 221 | function cycle(node, option){ 222 | var p1 = option.p1; 223 | var p2 = option.p2; 224 | var box = option.context; 225 | 226 | var midX = p1.x + (p2.x - p1.x)/2; 227 | var midY = p1.y + (p2.y - p1.y)/2; 228 | var r = JTopo.util.getDistance(p1, p2)/2; 229 | 230 | var angle = Math.atan2(midY, midX); 231 | var speed = option.speed || 0.2; 232 | var effect = {}; 233 | var t = null; 234 | function run(){ 235 | t = setInterval(function(){ 236 | if(isStopAll){ 237 | effect.stop(); 238 | return; 239 | } 240 | //var newx = p1.x + midX + Math.cos(angle) * r; 241 | var newy = p1.y + midX + Math.sin(angle) * r; 242 | node.setLocation(node.x,newy); 243 | box.updateView(); 244 | angle += speed; 245 | }, 100); 246 | return effect; 247 | } 248 | function stop(){ 249 | window.clearInterval(t); 250 | } 251 | 252 | effect.run = run; 253 | effect.stop = stop; 254 | return effect; 255 | } 256 | 257 | //move 258 | function move(node, option){ 259 | var p = option.position; 260 | var box = option.context; 261 | var easing = option.easing || 0.2; 262 | 263 | var effect = {}; 264 | var t = null; 265 | function run(){ 266 | t = setInterval(function(){ 267 | if(isStopAll){ 268 | effect.stop(); 269 | return; 270 | } 271 | var dx = p.x - node.x; 272 | var dy = p.y - node.y; 273 | var vx = dx * easing; 274 | var vy = dy * easing; 275 | 276 | node.x += vx; 277 | node.y += vy; 278 | box.updateView(); 279 | if(vx < 0.01 && vy<0.1){ 280 | stop(); 281 | } 282 | }, 100); 283 | return effect; 284 | } 285 | function stop(){ 286 | window.clearInterval(t); 287 | } 288 | effect.onStop = function(f){ effect.onStop = f; return effect;}; 289 | effect.run = run; 290 | effect.stop = stop; 291 | return effect; 292 | } 293 | 294 | //scala 295 | function scala(node, option){ 296 | var p = option.position; 297 | var box = option.context; 298 | var scala = option.scala || 1; 299 | var v = 0.06; 300 | var oldScala = node.scala; 301 | 302 | var effect = {}; 303 | var t = null; 304 | function run(){ 305 | t = setInterval(function(){ 306 | node.scala += v; 307 | 308 | if(node.scala >= scala){ 309 | stop(); 310 | } 311 | box.updateView(); 312 | }, 100); 313 | return effect; 314 | } 315 | function stop(){ 316 | if(effect.onStop){ 317 | effect.onStop(node); 318 | } 319 | node.scala = oldScala; 320 | window.clearInterval(t); 321 | } 322 | effect.onStop = function(f){ effect.onStop = f; return effect;}; 323 | effect.run = run; 324 | effect.stop = stop; 325 | return effect; 326 | } 327 | 328 | JTopo.Animation = { 329 | gravity : gravity, 330 | dividedTwoPiece : dividedTwoPiece, 331 | repeatThrow: repeatThrow, 332 | rotate: rotate, 333 | cycle: cycle, 334 | move: move, 335 | scala: scala, 336 | stopAll: stopAll, 337 | startAll: startAll 338 | }; 339 | })(JTopo); 340 | -------------------------------------------------------------------------------- /src/jtopo.container.js: -------------------------------------------------------------------------------- 1 | /* 2 | * JTopo (Javascript topology libraries) 0.2.0 3 | * https://github.com/wondery/jtopo 4 | * 5 | * Copyright (c) 2013 wondery 6 | * Released under the LGPL license, Version 3.0 7 | * http://www.gnu.org/licenses/lgpl.html 8 | * 9 | * Author: wondery 10 | * Email: jtopology@163.com 11 | */ 12 | 13 | (function(JTopo){ 14 | 15 | function Container(name) { 16 | this.name = name; 17 | this.x = 0; 18 | this.y = 0; 19 | this.width = 40; 20 | this.height = 40; 21 | this.items = []; 22 | this.style = {fillStyle: '193, 200, 254'}; 23 | this.alpha = 0.3; 24 | this.dragable = true; 25 | }; 26 | 27 | Container.prototype = new JTopo.Element(); 28 | 29 | Container.prototype.add = function (e) { 30 | this.items.push(e); 31 | e.parentContainer = this; 32 | }; 33 | 34 | Container.prototype.remove = function (e) { 35 | for(var i=0; i 0){ 66 | var minX = 10000000; 67 | var maxX = -10000000; 68 | var minY = 10000000; 69 | var maxY = -10000000; 70 | var width = maxX - minX; 71 | var height = maxY - minY; 72 | for (var i = 0; i < this.items.length; i++) { 73 | var item = this.items[i]; 74 | if (item.x <= minX) { 75 | minX = item.x; 76 | } 77 | if (item.x >= maxX) { 78 | maxX = item.x; 79 | } 80 | if (item.y <= minY) { 81 | minY = item.y; 82 | } 83 | if (item.y >= maxY) { 84 | maxY = item.y; 85 | } 86 | width = maxX - minX + item.width; 87 | height = maxY - minY + item.height; 88 | } 89 | 90 | this.x = minX - 5; 91 | this.y = minY - 5; 92 | this.width = width + 5; 93 | this.height = height + 5; 94 | } 95 | }; 96 | 97 | Container.prototype.draw = function (ctx) { 98 | this.updateBound(); 99 | ctx.save(); 100 | ctx.beginPath(); 101 | ctx.shadowBlur = 9; 102 | ctx.shadowColor = 'rgba(0,0,0,0.5)'; 103 | ctx.shadowOffsetX = 3; 104 | ctx.shadowOffsetY = 3; 105 | ctx.fillStyle = 'rgba(' + this.style.fillStyle + ',' + this.alpha + ')'; 106 | ctx.fillRect(this.x, this.y, this.width, this.height); 107 | ctx.closePath(); 108 | ctx.restore(); 109 | }; 110 | 111 | function GhomboidContainer(){ 112 | var container = new JTopo.Container(); 113 | container.offset = 50; 114 | container.draw = function(ctx){ 115 | this.updateBound(); 116 | ctx.save(); 117 | ctx.beginPath(); 118 | ctx.shadowBlur = 9; 119 | ctx.shadowColor = 'rgba(0,0,0,0.9)'; 120 | ctx.shadowOffsetX = 6; 121 | ctx.shadowOffsetY = 6; 122 | ctx.fillStyle = 'rgba(' + this.style.fillStyle + ',' + this.alpha + ')'; 123 | ctx.moveTo(this.x+this.offset, this.y); 124 | ctx.lineTo(this.x+this.offset+this.width, this.y); 125 | ctx.lineTo(this.x+this.width, this.y+this.height); 126 | ctx.lineTo(this.x, this.y+this.height); 127 | ctx.lineTo(this.x+this.offset, this.y); 128 | ctx.fill(); 129 | ctx.stroke(); 130 | ctx.closePath(); 131 | ctx.restore(); 132 | }; 133 | return container; 134 | } 135 | 136 | 137 | function GridContainer(){ 138 | var container = new JTopo.Container(); 139 | container.rows = 3; 140 | container.cols = 2; 141 | container.cellWidth = 60; 142 | container.cellHeight = 60; 143 | container.offset = 3; 144 | //container.padding = {left:0, right:0, top:0, bottom:0}; 145 | 146 | container.adjustLayout = function(){ 147 | for(var i=0; i c.x+c.width || this.y+this.height < c.y || this.y>c.y + c.height){ 221 | this.parentContainer.remove(this); 222 | break; 223 | } 224 | } 225 | } 226 | 227 | if(this.inContainer && this.isOnMousedrag){ 228 | for (var j = 0; j < box.containers.length; j++) { 229 | var group = box.containers[j]; 230 | if(! this.inContainer(group)) continue; 231 | if (x > group.x && x < group.x+group.width && y>group.y && y group.x && x < group.x+group.width && y>group.y && y