├── .gitignore ├── GPL-LICENSE.txt ├── MIT-LICENSE.txt ├── README ├── examples ├── basic │ ├── basic.html │ └── basic.js ├── crcnet │ ├── crcnet.html │ ├── crcnet.js │ ├── data │ │ ├── crc.json │ │ ├── crcnet.json │ │ └── index.html │ └── process │ │ ├── data.arbor │ │ ├── data.halfvis │ │ ├── data.json │ │ ├── data │ │ └── crchosts.cfg │ │ ├── hosts2arbor.py │ │ └── hosts2json.py ├── jit.js ├── karen │ ├── data │ │ ├── karen-detail.json │ │ ├── karen-nodedata.php │ │ ├── rrd │ │ │ └── lasttime │ │ └── vlan910.json │ ├── karen-detail.html │ ├── karen-detail.js │ ├── karen.html │ └── karen.js ├── nil │ ├── nil.html │ └── nil.js └── symbols │ └── router.png ├── public ├── crcnet.json └── karen-detail.json ├── src ├── editor.html ├── editor.js ├── lib │ ├── arbor.js │ ├── jit.js │ ├── jquery-1.5.2.js │ └── raphael.js ├── networkmap.css ├── networkmap.js ├── networkmap.php ├── save.php └── utils.js └── tests ├── NetworkMapTest.js ├── UtilitiesTest.js └── test-suite.html /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.rrd 3 | -------------------------------------------------------------------------------- /GPL-LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Joel Oughton, http://joeloughton.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | A computer network map visualisation for my computer science honours project at university. 2 | 3 | Developed with support from the WAND group (http://wand.net.nz). 4 | 5 | More information on this project can be found on my blog: 6 | http://joeloughton.com/blog 7 | -------------------------------------------------------------------------------- /examples/basic/basic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic Network Map 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

28 | Use mouse wheel to zoom in / out. Click and drag to pan. Right click on node to zoom and center. 29 |

30 | 31 | 32 |
33 |
34 |
35 |
36 |
37 |
38 | 39 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/basic/basic.js: -------------------------------------------------------------------------------- 1 | function init(){ 2 | 3 | // example data 4 | var json = [ 5 | { 6 | // This node will end up as a group node as other nodes reference it as 7 | // their parent. 8 | // Groups may be assigned a layout type, otherwise the default is used. 9 | // $type is the node graphic to use. 'group' is an outline of a circle. 10 | // You can implement more node types. 11 | "id": "A", "name": "A", "data": { "$type": "group", "layout": "Star" } 12 | }, 13 | { 14 | "id": "B", "name": "B", "data": { "$type": "group", "layout": "Star" } 15 | }, 16 | { 17 | "id": "C", "name": "C", "data": { "$type": "group", "layout": "Star" } 18 | }, 19 | { 20 | // This node will end up as a child of the A group node because it references 21 | // it as by the 'parentID' property. 22 | "id": "a1", "name": "a1", 23 | "data": { "$type": "circle", "parentID": "A", "root": true }, 24 | "adjacencies": [ { "nodeTo": "a2" }, { "nodeTo": "a3" }, { "nodeTo": "a4" } ] 25 | }, 26 | { 27 | "id": "a2", "name": "a2", 28 | "data": { "$type": "circle", "parentID": "A" }, 29 | "adjacencies": [ { "nodeTo": "a1" } ] 30 | }, 31 | { 32 | "id": "a3", "name": "a3", 33 | "data": { "$type": "circle", "parentID": "A" }, 34 | "adjacencies": [ { "nodeTo": "a1" } ] 35 | }, 36 | { 37 | "id": "a4", "name": "a4", 38 | "data": { "$type": "circle", "parentID": "A" }, 39 | "adjacencies": [ { "nodeTo": "a1" }, { "nodeTo": "a2" } ] 40 | }, 41 | { 42 | "id": "b1", "name": "b1", 43 | "data": { "$type": "circle", "parentID": "B", "root": true }, 44 | "adjacencies": [ { "nodeTo": "a1" }, { "nodeTo": "b2" }, { "nodeTo": "b3" } ] 45 | }, 46 | { 47 | "id": "b2", "name": "b2", 48 | "data": { "$type": "circle", "parentID": "B" }, 49 | "adjacencies": [ { "nodeTo": "b1" } ] 50 | }, 51 | { 52 | "id": "b3", "name": "b3", 53 | "data": { "$type": "circle", "parentID": "B" }, 54 | "adjacencies": [ { "nodeTo": "b1" } ] 55 | }, 56 | { 57 | "id": "c1", "name": "c1", 58 | "data": { "$type": "circle", "parentID": "C", "root": true }, 59 | "adjacencies": [ { "nodeTo": "a1" }, { "nodeTo": "b1" }, { "nodeTo": "c2" }, { "nodeTo": "c3" } ] 60 | }, 61 | { 62 | "id": "c2", "name": "c2", 63 | "data": { "$type": "circle", "parentID": "C" }, 64 | "adjacencies": [ { "nodeTo": "c1" } ] 65 | }, 66 | { 67 | "id": "c3", "name": "c3", 68 | "data": { "$type": "circle", "parentID": "C" }, 69 | "adjacencies": [ { "nodeTo": "c1" } ] 70 | } 71 | ]; 72 | 73 | var nm = new $jit.NetworkMap({ 74 | // id of the visualization container 75 | injectInto: 'infovis', 76 | 77 | // enable zooming and panning 78 | Navigation: { 79 | enable: true, 80 | panning: true, 81 | zooming: 40 // zoom speed 82 | }, 83 | 84 | // Change node and edge styles such as color and width. 85 | // These properties are also set per node with dollar prefixed data-properties in the 86 | // JSON structure. 87 | Node: { 88 | overridable: true, 89 | dim: 20 90 | }, 91 | 92 | Edge: { 93 | overridable: true, 94 | color: '#23A4FF', 95 | lineWidth: 1, 96 | type: 'dblarrow' 97 | }, 98 | 99 | // use html text for labels 100 | Label: { 101 | type: 'HTML' 102 | }, 103 | 104 | // add node events 105 | Events: { 106 | 107 | enable: true, 108 | 109 | // use the default events system 110 | type: 'Native', 111 | 112 | // adds mouse move event to add edge tooltips 113 | onMouseMove: function(node, eventInfo, e) { 114 | var edge = eventInfo.getEdge(); 115 | 116 | if (this.current) this.current.remove(); 117 | if (!edge) return; 118 | 119 | var n1 = edge.nodeFrom, 120 | n2 = edge.nodeTo, 121 | n1f = nm.fitsInCanvas(nm.p2c(n1.getPos())), 122 | n2f = nm.fitsInCanvas(nm.p2c(n2.getPos())); 123 | 124 | if (n1f && n2f || !n1f && !n2f) { 125 | return; 126 | } 127 | 128 | var to = n1f ? n2 : n1; 129 | var from = n1f ? n1 : n2; 130 | 131 | this.current = jQuery('
To ' + to.name + '
') 132 | .css({ position: 'absolute', left: e.clientX, top: e.clientY - 30, color: '#ddd' }) 133 | .appendTo(document.body); 134 | }, 135 | 136 | // change cursor style when hovering a node 137 | onMouseEnter: function() { 138 | nm.canvas.getElement().style.cursor = 'move'; 139 | }, 140 | 141 | onMouseLeave: function() { 142 | nm.canvas.getElement().style.cursor = ''; 143 | }, 144 | 145 | // add a right click handler 146 | onRightClick: function(node, eventInfo, e) { 147 | if (node) nm.zoomNode(node, 1, 30); 148 | }, 149 | 150 | // add a click handler to nodes 151 | onClick: function(node, eventInfo, e) { 152 | var edge = eventInfo.getEdge(); 153 | 154 | if (!edge) return; 155 | 156 | var n1 = edge.nodeFrom, 157 | n2 = edge.nodeTo, 158 | n1f = nm.fitsInCanvas(nm.p2c(n1.getPos())), 159 | n2f = nm.fitsInCanvas(nm.p2c(n2.getPos())); 160 | 161 | if (n1f && n2f || !n1f && !n2f) return; 162 | 163 | var from = n1f ? n1 : n2; 164 | var to = n1f ? n2 : n1; 165 | 166 | nm.followEdge(from, to, 2); 167 | } 168 | }, 169 | 170 | // default layout to use unless otherwise specified 171 | layout: 'Arbor', 172 | 173 | // the alpha of elements that should be faded out 174 | bgAlpha: 0.25, 175 | 176 | // initial label styling 177 | onCreateLabel: function(domElement, node){ 178 | domElement.innerHTML = node.name; 179 | domElement.style.color = "#ddd"; 180 | }, 181 | 182 | // change node styles when DOM labels are placed or moved. 183 | onPlaceLabel: function(domElement, node){ 184 | var style = domElement.style, 185 | left = parseInt(style.left), 186 | top = parseInt(style.top), 187 | w = domElement.offsetWidth; 188 | 189 | style.left = (left - w / 2) + 'px'; 190 | style.top = top + 'px'; 191 | } 192 | }); 193 | 194 | // load JSON data and plot 195 | nm.loadJSON(json); 196 | nm.refresh(); 197 | 198 | // create an overview stack using the utility object 199 | new $NetworkMap.Views.OverviewManager(nm, jQuery('#overview'), 180, 150, {}); 200 | 201 | // debug test 202 | var debug = new $NetworkMap.Debug.GraphicalOutput(nm); 203 | //debug.enable(); 204 | } 205 | -------------------------------------------------------------------------------- /examples/crcnet/crcnet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Crcnet Network Map 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |

Use mouse wheel to zoom in / out. Click and drag to pan.

27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/crcnet/crcnet.js: -------------------------------------------------------------------------------- 1 | var labelType, useGradients, nativeTextSupport, animate; 2 | 3 | (function() { 4 | var ua = navigator.userAgent, 5 | iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i), 6 | typeOfCanvas = typeof HTMLCanvasElement, 7 | nativeCanvasSupport = (typeOfCanvas == 'object' || typeOfCanvas == 'function'), 8 | textSupport = nativeCanvasSupport 9 | && (typeof document.createElement('canvas').getContext('2d').fillText == 'function'); 10 | //I'm setting this based on the fact that ExCanvas provides text support for IE 11 | //and that as of today iPhone/iPad current text support is lame 12 | labelType = (!nativeCanvasSupport || (textSupport && !iStuff))? 'Native' : 'HTML'; 13 | nativeTextSupport = labelType == 'Native'; 14 | useGradients = nativeCanvasSupport; 15 | animate = !(iStuff || !nativeCanvasSupport); 16 | })(); 17 | 18 | function init(){ 19 | // init data 20 | jQuery.getJSON('data/crc.json', function(data) { 21 | var json = []; 22 | 23 | jQuery.each(data, function(index, obj) { 24 | var host = {}, parents; 25 | 26 | jQuery.each(obj, function(key, val) { 27 | switch(key) { 28 | case 'alias': 29 | //host['name'] = val; 30 | break; 31 | case 'address': 32 | break; 33 | case 'host_name': 34 | host['id'] = val; 35 | host['name'] = val; 36 | break; 37 | case 'parents': 38 | parents = val.split(','); 39 | host['adjacencies'] = []; 40 | jQuery.each(parents, function(index, p) { 41 | host['adjacencies'].push({ nodeTo: p }); 42 | }); 43 | break; 44 | default: 45 | } 46 | }); 47 | 48 | if (host.id) 49 | json.push(host); 50 | }); 51 | 52 | makeViz(json); 53 | }); 54 | 55 | function makeViz(json) { 56 | //implement a new node type 57 | $jit.NetworkMap.Plot.NodeTypes.implement({ 58 | 'groups': { 59 | 'render': function(node, canvas) { 60 | this.nodeHelper.circle.render 61 | }, 62 | 'contains': function(node, pos) { 63 | this.nodeHelper.circle.contains 64 | } 65 | } 66 | }); 67 | 68 | // end 69 | // init ForceDirected 70 | var fd = new $jit.NetworkMap({ 71 | injectInto: 'infovis', 72 | Navigation: { 73 | enable: true, 74 | panning: true, //'avoid nodes', 75 | zooming: 40 //zoom speed. higher is more sensible 76 | }, 77 | Node: { 78 | overridable: true, 79 | dim: 4 80 | }, 81 | Edge: { 82 | overridable: true, 83 | color: '#23A4FF', 84 | lineWidth: 1, 85 | type: 'arrowpipe' 86 | }, 87 | //Native canvas text styling 88 | Label: { 89 | type: 'HTML', //Native or HTML 90 | // TODO: can't move nodes properly with HTML labels - may need to overide navigation class 91 | size: 10, 92 | style: 'bold' 93 | }, 94 | // Add node events 95 | Events: { 96 | enable: true, 97 | type: 'Native', // use the default events system 98 | onMouseMove: function(node, eventInfo, e) { 99 | var edge = eventInfo.getEdge(); 100 | 101 | if (this.current) this.current.remove(); 102 | if (!edge) return; 103 | 104 | var n1 = edge.nodeFrom, 105 | n2 = edge.nodeTo, 106 | n1f = fd.fitsInCanvas(fd.p2c(n1.getPos())), 107 | n2f = fd.fitsInCanvas(fd.p2c(n2.getPos())); 108 | 109 | if (n1f && n2f || !n1f && !n2f) { 110 | return; 111 | } 112 | 113 | var to = n1f ? n2 : n1; 114 | var from = n1f ? n1 : n2; 115 | 116 | this.current = jQuery('
To ' + to.name + '
') 117 | .css({ position: 'absolute', left: e.clientX, top: e.clientY - 30, color: '#ddd' }) 118 | .appendTo(document.body); 119 | }, 120 | onMouseWheel: function() { 121 | }, 122 | //Change cursor style when hovering a node 123 | onMouseEnter: function() { 124 | fd.canvas.getElement().style.cursor = 'move'; 125 | }, 126 | onMouseLeave: function() { 127 | fd.canvas.getElement().style.cursor = ''; 128 | }, 129 | //Update node positions when dragged 130 | onDragMove: function(node, eventInfo, e) { 131 | //var pos = eventInfo.getPos(); 132 | //node.pos.setc(pos.x, pos.y); 133 | //fd.plot(); 134 | }, 135 | //Implement the same handler for touchscreens 136 | onTouchMove: function(node, eventInfo, e) { 137 | //$jit.util.event.stop(e); //stop default touchmove event 138 | //this.onDragMove(node, eventInfo, e); 139 | }, 140 | //Add also a click handler to nodes 141 | onClick: function(node, eventInfo, e) { 142 | var edge = eventInfo.getEdge(); 143 | 144 | if (edge) { 145 | var edge = eventInfo.getEdge(); 146 | 147 | if (!edge) return; 148 | 149 | var n1 = edge.nodeFrom, 150 | n2 = edge.nodeTo, 151 | n1f = fd.fitsInCanvas(fd.p2c(n1.getPos())), 152 | n2f = fd.fitsInCanvas(fd.p2c(n2.getPos())); 153 | 154 | if (n1f && n2f || !n1f && !n2f) { 155 | return; 156 | } 157 | 158 | var from = n1f ? n1 : n2; 159 | var to = n1f ? n2 : n1; 160 | 161 | fd.followEdge(from, to, 2); 162 | } 163 | } 164 | }, 165 | //Number of iterations for the FD algorithm 166 | layout: 'Static', 167 | bgAlpha: 0.25, 168 | groupLvls: [ 0 ], 169 | onCreateLabel: function(domElement, node){ 170 | var style = domElement.style; 171 | domElement.innerHTML = node.id; 172 | style.fontSize = "0.8em"; 173 | style.color = "#ddd"; 174 | style.whiteSpace= "nowrap"; 175 | }, 176 | onPlaceLabel: function(domElement, node){ 177 | var style = domElement.style; 178 | var left = parseInt(style.left); 179 | var top = parseInt(style.top); 180 | var w = domElement.offsetWidth; 181 | style.left = (left - w / 2) + 'px'; 182 | style.top = top + 'px'; 183 | } 184 | }); 185 | 186 | $NetworkMap.Json.load('data/crcnet.json', function(json) { 187 | $NetworkMap.Utils.Metrics.initJSON(json); 188 | fd.loadJSON(json); 189 | $NetworkMap.Utils.Metrics.updateMetrics(fd); 190 | 191 | // debug test 192 | //var debug = new $NetworkMap.Debug.GraphicalOutput(fd); 193 | //debug.enable(); 194 | 195 | fd.refresh(); 196 | fd.canvas.scale(2.5, 2.5); 197 | 198 | // overview test 199 | var over = new $NetworkMap.Views.OverviewManager(fd, jQuery('#overview'), 180, 150, { Node: { dim: 5 } }); 200 | 201 | /*var button = jQuery('').click(function() { 202 | jQuery.each(fd.json, function(index, node) { 203 | var pos = fd.graph.getNode(node.id).getPos('current'); 204 | if (!node.data) node.data = {}; 205 | node.data.pos = { x: pos.x, y: pos.y }; 206 | }); 207 | 208 | $NetworkMap.Json.save('../../src/save.php', fd.json, 'crcnet.json'); 209 | }); 210 | jQuery(document.body).append(button);*/ 211 | }); 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /examples/crcnet/data/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/crcnet/process/data.arbor: -------------------------------------------------------------------------------- 1 | orwell -- gtw 2 | orwell -- ether 3 | orwell -- aegis 4 | orwell -- peon 5 | rsc -- vault 6 | orwell -- squalor 7 | gtw -- msb 8 | gtw -- mph 9 | mxx -- mfr 10 | mwp -- dav 11 | mar -- wht 12 | kki -- rch 13 | mwp -- pws 14 | mph -- mwp 15 | dav -- nga 16 | pws -- psc 17 | mil -- ohp 18 | pir2 -- pir 19 | pir3 -- tph 20 | pir3 -- mcg 21 | mcg -- hsk 22 | hsk -- wtu 23 | rch -- mar 24 | mfr2 -- wde 25 | wde -- kor 26 | msb -- kua 27 | gad -- nrd 28 | mfr -- mms 29 | mph -- mxx 30 | mxx -- gad 31 | msb -- nvd 32 | mfr -- mfr2 33 | htb -- kes-p 34 | htb -- kes-h 35 | kes-h -- bax 36 | gtw -- htb 37 | msb -- ttk 38 | pws -- pws2 39 | pws2 -- fitz 40 | fitz -- fitz2 41 | fitz2 -- tay 42 | kes-p -- wks 43 | mcg -- lsa 44 | tay -- tay2 45 | tay2 -- hui 46 | tay2 -- wha 47 | hui -- hui2 48 | hui2 -- kaa 49 | wha -- prt 50 | gtw -- iwl 51 | pws -- pku 52 | pws -- mil 53 | mfr -- hau 54 | wha -- pgs 55 | wha -- wha2 56 | bkr2 -- bkr 57 | olvr -- bkr2 58 | olvr2 -- olvr 59 | frp -- olvr2 60 | bkr -- kai 61 | kai -- kai2 62 | kai -- crs 63 | kai -- tts 64 | kes-h -- col 65 | kki2 -- kki 66 | gtw -- rsc 67 | cbk -- frp 68 | frp -- frp2 69 | cbk2 -- tmw 70 | tmw -- tmw2 71 | gtw -- cbk 72 | gtw -- cbk2 73 | wha -- shf 74 | fitz2 -- cnw 75 | bkr2 -- bkr3 76 | bkr3 -- pkk 77 | pkk -- pkk2 78 | frp2 -- tmro 79 | tmro -- tmro2 80 | mfr2 -- kki2 81 | wde -- wde2 82 | mwp -- pir2 83 | pir2 -- tku 84 | pir2 -- pir3 85 | gtw -- gtw-mph-qb20 86 | gtw-mph-qb20 -- mph-gtw-qb20 87 | mwp -- mwp-pws-qb20 88 | mwp-pws-qb20 -- pws-mwp-qb20 89 | htb -- htb-kes-atlas 90 | htb-kes-atlas -- kes-htb-atlas 91 | mms -- mhs 92 | mhs -- hol 93 | mcg -- speedie 94 | htb -- tol-lns 95 | putu -- ssm 96 | ssm -- ssm2 97 | putu2 -- yman 98 | yman -- yman2 99 | yman -- yman3 100 | yman -- mtku 101 | mtku -- mtku2 102 | ssm -- tane 103 | tane -- tane2 104 | tane -- tane3 105 | ssm2 -- rtkmis 106 | rtkmis -- rtkmis2 107 | rtkmis -- rtkmis3 108 | yman2 -- wmkura 109 | mtku2 -- kutre 110 | mtku2 -- wthe 111 | rtkmis2 -- twra-k 112 | tane2 -- tane-k 113 | rtkmis3 -- rtk-k 114 | yman3 -- ngrpo 115 | ngrpo -- ngrpo2 116 | tol-lns -- putu 117 | tol-lns -- putu2 118 | tol-lns -- putu3 119 | putu3 -- whau 120 | whau -- whau2 121 | whau2 -- whau-k 122 | whau2 -- tawh 123 | tawh -- tawh2 124 | tawh2 -- rua 125 | tawh2 -- tewh 126 | tewh -- tewh2 127 | tewh -- tewh-k 128 | rua -- rua2 129 | ming -- ming-k 130 | tewh-k -- ming 131 | rua -- rua-k 132 | ming2 -- ming-c 133 | ming -- ming2 134 | tawh -- muru 135 | glta2 -- glta-k 136 | muru -- glta 137 | glta -- glta2 138 | yman3 -- mthi 139 | mthi -- mthi2 140 | mthi2 -- mthi-k 141 | htb -- mgtwha 142 | mgtwha -- lee 143 | lee -- lee2 144 | lee2 -- cook 145 | cook -- pkt 146 | lee2 -- khukhu 147 | lee -- horeke 148 | cook -- cook2 149 | cook2 -- oku 150 | -------------------------------------------------------------------------------- /examples/crcnet/process/data.halfvis: -------------------------------------------------------------------------------- 1 | 2 | r:#99aaaa, weight:1} 3 | {color:#99aaaa, label:, shape:dot } 4 | 5 | wha --bkr 6 | 7 | orwell -- gtw 8 | orwell -- ether 9 | orwell -- aegis 10 | orwell -- peon 11 | rsc -- vault 12 | orwell -- squalor 13 | gtw -- msb 14 | gtw -- mph 15 | mxx -- mfr 16 | mwp -- dav 17 | mar -- wht 18 | kki -- rch 19 | mwp -- pws 20 | mph -- mwp 21 | dav -- nga 22 | pws -- psc 23 | mil -- ohp 24 | pir2 -- pir 25 | pir3 -- tph 26 | pir3 -- mcg 27 | mcg -- hsk 28 | hsk -- wtu 29 | rch -- mar 30 | mfr2 -- wde 31 | wde -- kor 32 | msb -- kua 33 | gad -- nrd 34 | mfr -- mms 35 | mph -- mxx 36 | mxx -- gad 37 | msb -- nvd 38 | mfr -- mfr2 39 | htb -- kes-p 40 | htb -- kes-h 41 | kes-h -- bax 42 | gtw -- htb 43 | msb -- ttk 44 | pws -- pws2 45 | pws2 -- fitz 46 | fitz -- fitz2 47 | fitz2 -- tay 48 | kes-p -- wks 49 | mcg -- lsa 50 | tay -- tay2 51 | tay2 -- hui 52 | tay2 -- wha 53 | hui -- hui2 54 | hui2 -- kaa 55 | wha -- prt 56 | gtw -- iwl 57 | pws -- pku 58 | pws -- mil 59 | mfr -- hau 60 | wha -- pgs 61 | wha -- wha2 62 | bkr2 -- bkr 63 | olvr -- bkr2 64 | olvr2 -- olvr 65 | frp -- olvr2 66 | bkr -- kai 67 | kai -- kai2 68 | kai -- crs 69 | kai -- tts 70 | kes-h -- col 71 | kki2 -- kki 72 | gtw -- rsc 73 | cbk -- frp 74 | frp -- frp2 75 | cbk2 -- tmw 76 | tmw -- tmw2 77 | gtw -- cbk 78 | gtw -- cbk2 79 | wha -- shf 80 | fitz2 -- cnw 81 | bkr2 -- bkr3 82 | bkr3 -- pkk 83 | pkk -- pkk2 84 | frp2 -- tmro 85 | tmro -- tmro2 86 | mfr2 -- kki2 87 | wde -- wde2 88 | mwp -- pir2 89 | pir2 -- tku 90 | pir2 -- pir3 91 | gtw -- gtw-mph-qb20 92 | gtw-mph-qb20 -- mph-gtw-qb20 93 | mwp -- mwp-pws-qb20 94 | mwp-pws-qb20 -- pws-mwp-qb20 95 | htb -- htb-kes-atlas 96 | htb-kes-atlas -- kes-htb-atlas 97 | mms -- mhs 98 | mhs -- hol 99 | mcg -- speedie 100 | htb -- tol-lns 101 | putu -- ssm 102 | ssm -- ssm2 103 | putu2 -- yman 104 | yman -- yman2 105 | yman -- yman3 106 | yman -- mtku 107 | mtku -- mtku2 108 | ssm -- tane 109 | tane -- tane2 110 | tane -- tane3 111 | ssm2 -- rtkmis 112 | rtkmis -- rtkmis2 113 | rtkmis -- rtkmis3 114 | yman2 -- wmkura 115 | mtku2 -- kutre 116 | mtku2 -- wthe 117 | rtkmis2 -- twra-k 118 | tane2 -- tane-k 119 | rtkmis3 -- rtk-k 120 | yman3 -- ngrpo 121 | ngrpo -- ngrpo2 122 | tol-lns -- putu 123 | tol-lns -- putu2 124 | tol-lns -- putu3 125 | putu3 -- whau 126 | whau -- whau2 127 | whau2 -- whau-k 128 | whau2 -- tawh 129 | tawh -- tawh2 130 | tawh2 -- rua 131 | tawh2 -- tewh 132 | tewh -- tewh2 133 | tewh -- tewh-k 134 | rua -- rua2 135 | ming -- ming-k 136 | tewh-k -- ming 137 | rua -- rua-k 138 | ming2 -- ming-c 139 | ming -- ming2 140 | tawh -- muru 141 | glta2 -- glta-k 142 | muru -- glta 143 | glta -- glta2 144 | yman3 -- mthi 145 | mthi -- mthi2 146 | mthi2 -- mthi-k 147 | htb -- mgtwha 148 | mgtwha -- lee 149 | lee -- lee2 150 | lee2 -- cook 151 | cook -- pkt 152 | lee2 -- khukhu 153 | lee -- horeke 154 | cook -- cook2 155 | cook2 -- oku 156 | 157 | -------------------------------------------------------------------------------- /examples/crcnet/process/data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "generic-endhost", 4 | "notification_interval": "1440", 5 | "register": "0", 6 | "use": "generic-host" 7 | }, 8 | { 9 | "address": "10.1.250.1", 10 | "alias": "CRCnet Gateway", 11 | "host_name": "gtw", 12 | "parents": "orwell", 13 | "use": "generic-host" 14 | }, 15 | { 16 | "address": "192.107.171.161", 17 | "alias": "CRCnet Monitoring Server", 18 | "host_name": "orwell", 19 | "use": "generic-host" 20 | }, 21 | { 22 | "address": "192.107.171.162", 23 | "alias": "CRCnet AMP Collector", 24 | "host_name": "ether", 25 | "parents": "orwell", 26 | "use": "generic-host" 27 | }, 28 | { 29 | "address": "192.107.171.163", 30 | "alias": "CRCnet Proxy Server", 31 | "host_name": "aegis", 32 | "parents": "orwell", 33 | "use": "generic-host" 34 | }, 35 | { 36 | "address": "192.107.171.164", 37 | "alias": "Peon", 38 | "host_name": "peon", 39 | "parents": "orwell", 40 | "use": "generic-host" 41 | }, 42 | { 43 | "address": "10.1.23.2", 44 | "alias": "CRCnet Backup Server", 45 | "host_name": "vault", 46 | "parents": "rsc", 47 | "use": "generic-host" 48 | }, 49 | { 50 | "address": "114.134.15.199", 51 | "alias": "Squalor", 52 | "host_name": "squalor", 53 | "parents": "orwell", 54 | "use": "generic-host" 55 | }, 56 | { 57 | "address": "10.1.128.2", 58 | "alias": "MSB HostAP", 59 | "host_name": "msb", 60 | "parents": "gtw", 61 | "use": "generic-host" 62 | }, 63 | { 64 | "address": "10.1.128.3", 65 | "alias": "MWP Repeater Station", 66 | "host_name": "mph", 67 | "parents": "gtw", 68 | "use": "generic-host" 69 | }, 70 | { 71 | "address": "10.1.128.4", 72 | "alias": "Murray Frith's Repeater - Soekris", 73 | "host_name": "mfr", 74 | "parents": "mxx", 75 | "use": "generic-host" 76 | }, 77 | { 78 | "address": "10.1.128.5", 79 | "alias": "DAV Repeater - Ngahinapouri", 80 | "host_name": "dav", 81 | "parents": "mwp", 82 | "use": "generic-host" 83 | }, 84 | { 85 | "address": "10.1.128.6", 86 | "alias": "Whatawhata School Repeater", 87 | "host_name": "wht", 88 | "parents": "mar", 89 | "use": "generic-host" 90 | }, 91 | { 92 | "address": "10.1.128.8", 93 | "alias": "Richardson Rd Repeater Station", 94 | "host_name": "rch", 95 | "parents": "kki", 96 | "use": "generic-host" 97 | }, 98 | { 99 | "address": "10.1.128.9", 100 | "alias": "Pirongia South Woolshed", 101 | "host_name": "pws", 102 | "parents": "mwp", 103 | "use": "generic-host" 104 | }, 105 | { 106 | "address": "10.1.128.11", 107 | "alias": "MWP Repeater Station", 108 | "host_name": "mwp", 109 | "parents": "mph", 110 | "use": "generic-host" 111 | }, 112 | { 113 | "address": "10.1.128.12", 114 | "alias": "Ngahinapouri School", 115 | "host_name": "nga", 116 | "parents": "dav", 117 | "use": "generic-host" 118 | }, 119 | { 120 | "address": "10.1.128.13", 121 | "alias": "Pirongia School", 122 | "host_name": "psc", 123 | "parents": "pws", 124 | "use": "generic-host" 125 | }, 126 | { 127 | "address": "10.1.128.15", 128 | "alias": "Ohaupo School", 129 | "host_name": "ohp", 130 | "parents": "mil", 131 | "use": "generic-host" 132 | }, 133 | { 134 | "address": "10.1.128.16", 135 | "alias": "Mt. Pirongia Repeater Station", 136 | "host_name": "pir", 137 | "parents": "pir2", 138 | "use": "generic-host" 139 | }, 140 | { 141 | "address": "10.1.128.17", 142 | "alias": "Te Pahu School", 143 | "host_name": "tph", 144 | "parents": "pir3", 145 | "use": "generic-host" 146 | }, 147 | { 148 | "address": "10.1.128.18", 149 | "alias": "MCG Repeater Station", 150 | "host_name": "mcg", 151 | "parents": "pir3", 152 | "use": "generic-host" 153 | }, 154 | { 155 | "address": "10.1.128.19", 156 | "alias": "HSK Repeater Station", 157 | "host_name": "hsk", 158 | "parents": "mcg", 159 | "use": "generic-host" 160 | }, 161 | { 162 | "address": "10.1.128.20", 163 | "alias": "Waitetuna School", 164 | "host_name": "wtu", 165 | "parents": "hsk", 166 | "use": "generic-host" 167 | }, 168 | { 169 | "address": "10.1.128.21", 170 | "alias": "Marwood Rd Repeater Station", 171 | "host_name": "mar", 172 | "parents": "rch", 173 | "use": "generic-host" 174 | }, 175 | { 176 | "address": "10.1.128.22", 177 | "alias": "wade household repeater station", 178 | "host_name": "wde", 179 | "parents": "mfr2", 180 | "use": "generic-host" 181 | }, 182 | { 183 | "address": "10.1.128.23", 184 | "alias": "Koromatua School", 185 | "host_name": "kor", 186 | "parents": "wde", 187 | "use": "generic-host" 188 | }, 189 | { 190 | "address": "10.1.128.28", 191 | "alias": "Te Kura Kaupapa...", 192 | "host_name": "kua", 193 | "parents": "msb", 194 | "use": "generic-host" 195 | }, 196 | { 197 | "address": "10.1.128.29", 198 | "alias": "Ngahinapouri Rd East", 199 | "host_name": "nrd", 200 | "parents": "gad", 201 | "use": "generic-host" 202 | }, 203 | { 204 | "address": "10.1.128.32", 205 | "alias": "Murray Vicker's Milking Shed", 206 | "host_name": "mms", 207 | "parents": "mfr", 208 | "use": "generic-host" 209 | }, 210 | { 211 | "address": "10.1.128.40", 212 | "alias": "Murray's House Wirless", 213 | "host_name": "mxx", 214 | "parents": "mph", 215 | "use": "generic-host" 216 | }, 217 | { 218 | "address": "10.1.128.41", 219 | "alias": "Gaddes Site", 220 | "host_name": "gad", 221 | "parents": "mxx", 222 | "use": "generic-host" 223 | }, 224 | { 225 | "address": "10.1.128.43", 226 | "alias": "Nevada", 227 | "host_name": "nvd", 228 | "parents": "msb", 229 | "use": "generic-host" 230 | }, 231 | { 232 | "address": "10.1.128.44", 233 | "alias": "Murray Frith's Repeater", 234 | "host_name": "mfr2", 235 | "parents": "mfr", 236 | "use": "generic-host" 237 | }, 238 | { 239 | "address": "10.1.128.45", 240 | "alias": "Kessels Pole", 241 | "host_name": "kes-p", 242 | "parents": "htb", 243 | "use": "generic-host" 244 | }, 245 | { 246 | "address": "10.1.128.46", 247 | "alias": "Kessels House", 248 | "host_name": "kes-h", 249 | "parents": "htb", 250 | "use": "generic-host" 251 | }, 252 | { 253 | "address": "10.1.128.47", 254 | "alias": "Baxter", 255 | "host_name": "bax", 256 | "parents": "kes-h", 257 | "use": "generic-host" 258 | }, 259 | { 260 | "address": "10.1.128.50", 261 | "alias": "Hamilton Tower Building - Kordia", 262 | "host_name": "htb", 263 | "parents": "gtw", 264 | "use": "generic-host" 265 | }, 266 | { 267 | "address": "10.1.128.51", 268 | "alias": "Te Taka Keegan's House", 269 | "host_name": "ttk", 270 | "parents": "msb", 271 | "use": "generic-host" 272 | }, 273 | { 274 | "address": "10.1.128.52", 275 | "alias": "Pirongia South 2nd Device", 276 | "host_name": "pws2", 277 | "parents": "pws", 278 | "use": "generic-host" 279 | }, 280 | { 281 | "address": "10.1.128.53", 282 | "alias": "FITZ Repeater - Ngaroma", 283 | "host_name": "fitz", 284 | "parents": "pws2", 285 | "use": "generic-host" 286 | }, 287 | { 288 | "address": "10.1.128.54", 289 | "alias": "FITZ Repeater2 - Ngaroma", 290 | "host_name": "fitz2", 291 | "parents": "fitz", 292 | "use": "generic-host" 293 | }, 294 | { 295 | "address": "10.1.128.55", 296 | "alias": "TAY Repeater - Ngaroma", 297 | "host_name": "tay", 298 | "parents": "fitz2", 299 | "use": "generic-host" 300 | }, 301 | { 302 | "address": "10.1.128.57", 303 | "alias": "Kessels Pole", 304 | "host_name": "wks", 305 | "parents": "kes-p", 306 | "use": "generic-host" 307 | }, 308 | { 309 | "address": "10.1.128.58", 310 | "alias": "Leisa, Waitetuna", 311 | "host_name": "lsa", 312 | "parents": "mcg", 313 | "use": "generic-host" 314 | }, 315 | { 316 | "address": "10.1.128.59", 317 | "alias": "TAY Repeater - Ngaroma", 318 | "host_name": "tay2", 319 | "parents": "tay", 320 | "use": "generic-host" 321 | }, 322 | { 323 | "address": "10.1.128.60", 324 | "alias": "Huirimu - Ngaroma", 325 | "host_name": "hui", 326 | "parents": "tay2", 327 | "use": "generic-host" 328 | }, 329 | { 330 | "address": "10.1.128.61", 331 | "alias": "Wharepuhunga - Ngaroma", 332 | "host_name": "wha", 333 | "parents": "tay2", 334 | "use": "generic-host" 335 | }, 336 | { 337 | "address": "10.1.128.62", 338 | "alias": "Huirimu 2 - Ngaroma", 339 | "host_name": "hui2", 340 | "parents": "hui", 341 | "use": "generic-host" 342 | }, 343 | { 344 | "address": "10.1.128.63", 345 | "alias": "Kaahu - Whakamaru", 346 | "host_name": "kaa", 347 | "parents": "hui2", 348 | "use": "generic-host" 349 | }, 350 | { 351 | "address": "10.1.128.64", 352 | "alias": "Ports CPE Repeater - Ngaroma", 353 | "host_name": "prt", 354 | "parents": "wha", 355 | "use": "generic-host" 356 | }, 357 | { 358 | "address": "10.1.128.65", 359 | "alias": "Innovation Waikato Router", 360 | "host_name": "iwl", 361 | "parents": "gtw", 362 | "use": "generic-host" 363 | }, 364 | { 365 | "address": "10.1.128.66", 366 | "alias": "Pokeru Factory Road CPE Repeater - Te Awamutu", 367 | "host_name": "pku", 368 | "parents": "pws", 369 | "use": "generic-host" 370 | }, 371 | { 372 | "address": "10.1.128.67", 373 | "alias": "Mill Road CPE Repeater - Ohaupo", 374 | "host_name": "mil", 375 | "parents": "pws", 376 | "use": "generic-host" 377 | }, 378 | { 379 | "address": "10.1.128.68", 380 | "alias": "Hau CPE Repeater - Ngahinapouri", 381 | "host_name": "hau", 382 | "parents": "mfr", 383 | "use": "generic-host" 384 | }, 385 | { 386 | "address": "10.1.128.88", 387 | "alias": "Prendergast AP repeater - Ngaroma", 388 | "host_name": "pgs", 389 | "parents": "wha", 390 | "use": "generic-host" 391 | }, 392 | { 393 | "address": "10.1.128.89", 394 | "alias": "Wharepuhunga 2 - Ngaroma", 395 | "host_name": "wha2", 396 | "parents": "wha", 397 | "use": "generic-host" 398 | }, 399 | { 400 | "address": "10.1.128.90", 401 | "alias": "Barkers Repeater - Tirau", 402 | "host_name": "bkr", 403 | "parents": "bkr2", 404 | "use": "generic-host" 405 | }, 406 | { 407 | "address": "10.1.128.91", 408 | "alias": "Barkers Repeater 2 - Tirau", 409 | "host_name": "bkr2", 410 | "parents": "olvr", 411 | "use": "generic-host" 412 | }, 413 | { 414 | "address": "10.1.128.92", 415 | "alias": "Oliver Road Repeater - Whitehall", 416 | "host_name": "olvr", 417 | "parents": "olvr2", 418 | "use": "generic-host" 419 | }, 420 | { 421 | "address": "10.1.128.93", 422 | "alias": "Oliver Road Repeater 2 - Whitehall", 423 | "host_name": "olvr2", 424 | "parents": "frp", 425 | "use": "generic-host" 426 | }, 427 | { 428 | "address": "10.1.128.94", 429 | "alias": "Kaimai Repeater", 430 | "host_name": "kai", 431 | "parents": "bkr", 432 | "use": "generic-host" 433 | }, 434 | { 435 | "address": "10.1.128.95", 436 | "alias": "Kaimai Repeater 2", 437 | "host_name": "kai2", 438 | "parents": "kai", 439 | "use": "generic-host" 440 | }, 441 | { 442 | "address": "10.1.128.98", 443 | "alias": "Crystal Springs, Matamata", 444 | "host_name": "crs", 445 | "parents": "kai", 446 | "use": "generic-host" 447 | }, 448 | { 449 | "address": "10.1.128.99", 450 | "alias": "Totara Springs, Matamata", 451 | "host_name": "tts", 452 | "parents": "kai", 453 | "use": "generic-host" 454 | }, 455 | { 456 | "address": "10.1.128.103", 457 | "alias": "Clothier Road, Te Pahu", 458 | "host_name": "col", 459 | "parents": "kes-h", 460 | "use": "generic-host" 461 | }, 462 | { 463 | "address": "10.1.128.104", 464 | "alias": "Karakiriki Repeater", 465 | "host_name": "kki", 466 | "parents": "kki2", 467 | "use": "generic-host" 468 | }, 469 | { 470 | "address": "10.1.128.105", 471 | "alias": "Router in RS3", 472 | "host_name": "rsc", 473 | "parents": "gtw", 474 | "use": "generic-host" 475 | }, 476 | { 477 | "address": "10.1.128.106", 478 | "alias": "French Pass, Cambridge", 479 | "host_name": "frp", 480 | "parents": "cbk", 481 | "use": "generic-host" 482 | }, 483 | { 484 | "address": "10.1.128.107", 485 | "alias": "French Pass 2, Cambridge", 486 | "host_name": "frp2", 487 | "parents": "frp", 488 | "use": "generic-host" 489 | }, 490 | { 491 | "address": "10.1.128.123", 492 | "alias": "Te Miro West, Cambridge", 493 | "host_name": "tmw", 494 | "parents": "cbk2", 495 | "use": "generic-host" 496 | }, 497 | { 498 | "address": "10.1.128.122", 499 | "alias": "Te Miro West2 , Cambridge", 500 | "host_name": "tmw2", 501 | "parents": "tmw", 502 | "use": "generic-host" 503 | }, 504 | { 505 | "address": "10.1.128.108", 506 | "alias": "C Block Repeater - University of Waikato", 507 | "host_name": "cbk", 508 | "parents": "gtw", 509 | "use": "generic-host" 510 | }, 511 | { 512 | "address": "10.1.128.121", 513 | "alias": "C Block Repeater 2 - University of Waikato", 514 | "host_name": "cbk2", 515 | "parents": "gtw", 516 | "use": "generic-host" 517 | }, 518 | { 519 | "address": "10.1.128.109", 520 | "alias": "Sheriff's CPE Repeater - Ngaroma", 521 | "host_name": "shf", 522 | "parents": "wha", 523 | "use": "generic-host" 524 | }, 525 | { 526 | "address": "10.1.128.110", 527 | "alias": "Curnow's CPE Repeater - Ngaroma", 528 | "host_name": "cnw", 529 | "parents": "fitz2", 530 | "use": "generic-host" 531 | }, 532 | { 533 | "address": "10.1.128.111", 534 | "alias": "Barkers Repeater 3 - Tirau", 535 | "host_name": "bkr3", 536 | "parents": "bkr2", 537 | "use": "generic-host" 538 | }, 539 | { 540 | "address": "10.1.128.112", 541 | "alias": "Pakaraka Road - Tapapa", 542 | "host_name": "pkk", 543 | "parents": "bkr3", 544 | "use": "generic-host" 545 | }, 546 | { 547 | "address": "10.1.128.113", 548 | "alias": "Pakaraka Road 2 - Tapapa", 549 | "host_name": "pkk2", 550 | "parents": "pkk", 551 | "use": "generic-host" 552 | }, 553 | { 554 | "address": "10.1.128.114", 555 | "alias": "Te Miro - Cambridge", 556 | "host_name": "tmro", 557 | "parents": "frp2", 558 | "use": "generic-host" 559 | }, 560 | { 561 | "address": "10.1.128.115", 562 | "alias": "Te Miro 2 - Cambridge", 563 | "host_name": "tmro2", 564 | "parents": "tmro", 565 | "use": "generic-host" 566 | }, 567 | { 568 | "address": "10.1.128.116", 569 | "alias": "Karakiriki Repeater 2", 570 | "host_name": "kki2", 571 | "parents": "mfr2", 572 | "use": "generic-host" 573 | }, 574 | { 575 | "address": "10.1.128.117", 576 | "alias": "Wade Repeater 2", 577 | "host_name": "wde2", 578 | "parents": "wde", 579 | "use": "generic-host" 580 | }, 581 | { 582 | "address": "10.1.128.118", 583 | "alias": "Pirongia Repeater 2", 584 | "host_name": "pir2", 585 | "parents": "mwp", 586 | "use": "generic-host" 587 | }, 588 | { 589 | "address": "10.1.128.119", 590 | "alias": "Te Uku Repeater", 591 | "host_name": "tku", 592 | "parents": "pir2", 593 | "use": "generic-host" 594 | }, 595 | { 596 | "address": "10.1.128.120", 597 | "alias": "Pirongia Repeater 3", 598 | "host_name": "pir3", 599 | "parents": "pir2", 600 | "use": "generic-host" 601 | }, 602 | { 603 | "address": "10.1.240.129", 604 | "alias": "QuickBridge 20 attached to GTW -> MPH", 605 | "host_name": "gtw-mph-qb20", 606 | "parents": "gtw", 607 | "use": "generic-host" 608 | }, 609 | { 610 | "address": "10.1.240.128", 611 | "alias": "QuickBridge 20 attached to MPH -> GTW", 612 | "host_name": "mph-gtw-qb20", 613 | "parents": "gtw-mph-qb20", 614 | "use": "generic-host" 615 | }, 616 | { 617 | "address": "10.1.253.128", 618 | "alias": "QuickBridge 20 attached to MWP -> PWS", 619 | "host_name": "mwp-pws-qb20", 620 | "parents": "mwp", 621 | "use": "generic-host" 622 | }, 623 | { 624 | "address": "10.1.253.129", 625 | "alias": "QuickBridge 20 attached to PWS -> MWP", 626 | "host_name": "pws-mwp-qb20", 627 | "parents": "mwp-pws-qb20", 628 | "use": "generic-host" 629 | }, 630 | { 631 | "address": "10.1.208.128", 632 | "alias": "Trango Atlas attached to HTB -> KES", 633 | "host_name": "htb-kes-atlas", 634 | "parents": "htb", 635 | "use": "generic-host" 636 | }, 637 | { 638 | "address": "10.1.208.129", 639 | "alias": "Trango Atlas attached to KES -> HTB", 640 | "host_name": "kes-htb-atlas", 641 | "parents": "htb-kes-atlas", 642 | "use": "generic-host" 643 | }, 644 | { 645 | "address": "10.1.25.254", 646 | "alias": "Murray Vicker's House", 647 | "host_name": "mhs", 648 | "parents": "mms", 649 | "use": "generic-host" 650 | }, 651 | { 652 | "address": "10.1.26.254", 653 | "alias": "Holmes' Household", 654 | "host_name": "hol", 655 | "parents": "mhs", 656 | "use": "generic-host" 657 | }, 658 | { 659 | "address": "10.1.4.1", 660 | "alias": "MCG Network Gateway", 661 | "host_name": "speedie", 662 | "parents": "mcg", 663 | "use": "generic-host" 664 | }, 665 | { 666 | "address": "114.134.12.1", 667 | "alias": "Tuhoe Online LNS (tol)", 668 | "host_name": "tol-lns", 669 | "parents": "htb", 670 | "use": "generic-host" 671 | }, 672 | { 673 | "address": "10.2.128.1", 674 | "alias": "ssm - Sisam Taneatua (tol)", 675 | "host_name": "ssm", 676 | "parents": "putu", 677 | "use": "generic-host" 678 | }, 679 | { 680 | "address": "10.2.128.2", 681 | "alias": "ssm - Sisam Taneatua (tol)", 682 | "host_name": "ssm2", 683 | "parents": "ssm", 684 | "use": "generic-host" 685 | }, 686 | { 687 | "address": "10.2.128.3", 688 | "alias": "yman - Yeoman Repeater (tol)", 689 | "host_name": "yman", 690 | "parents": "putu2", 691 | "use": "generic-host" 692 | }, 693 | { 694 | "address": "10.2.128.4", 695 | "alias": "yman - Yeoman Repeater (tol)", 696 | "host_name": "yman2", 697 | "parents": "yman", 698 | "use": "generic-host" 699 | }, 700 | { 701 | "address": "10.2.128.5", 702 | "alias": "yman - Yeoman Repeater (tol)", 703 | "host_name": "yman3", 704 | "parents": "yman", 705 | "use": "generic-host" 706 | }, 707 | { 708 | "address": "10.2.128.6", 709 | "alias": "mtku - Matakerepu (tol)", 710 | "host_name": "mtku", 711 | "parents": "yman", 712 | "use": "generic-host" 713 | }, 714 | { 715 | "address": "10.2.128.7", 716 | "alias": "mtku - Matakerepu (tol)", 717 | "host_name": "mtku2", 718 | "parents": "mtku", 719 | "use": "generic-host" 720 | }, 721 | { 722 | "address": "10.2.128.8", 723 | "alias": "tane - Taneatua Central (tol)", 724 | "host_name": "tane", 725 | "parents": "ssm", 726 | "use": "generic-host" 727 | }, 728 | { 729 | "address": "10.2.128.9", 730 | "alias": "tane - Taneatua Central (tol)", 731 | "host_name": "tane2", 732 | "parents": "tane", 733 | "use": "generic-host" 734 | }, 735 | { 736 | "address": "10.2.128.10", 737 | "alias": "tane - Taneatua Central (tol)", 738 | "host_name": "tane3", 739 | "parents": "tane", 740 | "use": "generic-host" 741 | }, 742 | { 743 | "address": "10.2.128.11", 744 | "alias": "rtkmis - Ruatoki Mission House (tol)", 745 | "host_name": "rtkmis", 746 | "parents": "ssm2", 747 | "use": "generic-host" 748 | }, 749 | { 750 | "address": "10.2.128.12", 751 | "alias": "rtkmis - Ruatoki Mission House (tol)", 752 | "host_name": "rtkmis2", 753 | "parents": "rtkmis", 754 | "use": "generic-host" 755 | }, 756 | { 757 | "address": "10.2.128.13", 758 | "alias": "rtkmis - Ruatoki Mission House (tol)", 759 | "host_name": "rtkmis3", 760 | "parents": "rtkmis", 761 | "use": "generic-host" 762 | }, 763 | { 764 | "address": "10.2.128.14", 765 | "alias": "wmkura - Waimana Kura (tol)", 766 | "host_name": "wmkura", 767 | "parents": "yman2", 768 | "use": "generic-host" 769 | }, 770 | { 771 | "address": "10.2.128.15", 772 | "alias": "kutre - Kutarere Kura (tol)", 773 | "host_name": "kutre", 774 | "parents": "mtku2", 775 | "use": "generic-host" 776 | }, 777 | { 778 | "address": "10.2.128.16", 779 | "alias": "wthe - Waiotahe Kura (tol)", 780 | "host_name": "wthe", 781 | "parents": "mtku2", 782 | "use": "generic-host" 783 | }, 784 | { 785 | "address": "10.2.128.17", 786 | "alias": "twra-k - Tawera Kura (tol)", 787 | "host_name": "twra-k", 788 | "parents": "rtkmis2", 789 | "use": "generic-host" 790 | }, 791 | { 792 | "address": "10.2.128.18", 793 | "alias": "tane-k - Taneatua Kura (tol)", 794 | "host_name": "tane-k", 795 | "parents": "tane2", 796 | "use": "generic-host" 797 | }, 798 | { 799 | "address": "10.2.128.19", 800 | "alias": "rtk-k - Ruatoki Kura (tol)", 801 | "host_name": "rtk-k", 802 | "parents": "rtkmis3", 803 | "use": "generic-host" 804 | }, 805 | { 806 | "address": "10.2.128.20", 807 | "alias": "ngrpo - Ngarepo(tol)", 808 | "host_name": "ngrpo", 809 | "parents": "yman3", 810 | "use": "generic-host" 811 | }, 812 | { 813 | "address": "10.2.128.21", 814 | "alias": "ngrpo - Ngarepo(tol)", 815 | "host_name": "ngrpo2", 816 | "parents": "ngrpo", 817 | "use": "generic-host" 818 | }, 819 | { 820 | "address": "10.2.128.22", 821 | "alias": "putu - Mount Putauaki Radio Club (tol)", 822 | "host_name": "putu", 823 | "parents": "tol-lns", 824 | "use": "generic-host" 825 | }, 826 | { 827 | "address": "10.2.128.23", 828 | "alias": "putu - Mount Putauaki Radio Club (tol)", 829 | "host_name": "putu2", 830 | "parents": "tol-lns", 831 | "use": "generic-host" 832 | }, 833 | { 834 | "address": "10.2.128.24", 835 | "alias": "putu - Mount Putauaki Radio Club (tol)", 836 | "host_name": "putu3", 837 | "parents": "tol-lns", 838 | "use": "generic-host" 839 | }, 840 | { 841 | "address": "10.2.128.25", 842 | "alias": "whau - Waiohau Repeater (tol)", 843 | "host_name": "whau", 844 | "parents": "putu3", 845 | "use": "generic-host" 846 | }, 847 | { 848 | "address": "10.2.128.26", 849 | "alias": "whau - Waiohau Repeater (tol)", 850 | "host_name": "whau2", 851 | "parents": "whau", 852 | "use": "generic-host" 853 | }, 854 | { 855 | "address": "10.2.128.27", 856 | "alias": "whau - Waiohau School (tol)", 857 | "host_name": "whau-k", 858 | "parents": "whau2", 859 | "use": "generic-host" 860 | }, 861 | { 862 | "address": "10.2.128.28", 863 | "alias": "tawh - Tawhiuau (tol)", 864 | "host_name": "tawh", 865 | "parents": "whau2", 866 | "use": "generic-host" 867 | }, 868 | { 869 | "address": "10.2.128.29", 870 | "alias": "tawh - Tawhiuau (tol)", 871 | "host_name": "tawh2", 872 | "parents": "tawh", 873 | "use": "generic-host" 874 | }, 875 | { 876 | "address": "10.2.128.30", 877 | "alias": "rua - Ruatahuna (tol)", 878 | "host_name": "rua", 879 | "parents": "tawh2", 880 | "use": "generic-host" 881 | }, 882 | { 883 | "address": "10.2.128.31", 884 | "alias": "tewh - TeWhaiti (tol)", 885 | "host_name": "tewh", 886 | "parents": "tawh2", 887 | "use": "generic-host" 888 | }, 889 | { 890 | "address": "10.2.128.32", 891 | "alias": "tewh - TeWhaiti (tol)", 892 | "host_name": "tewh2", 893 | "parents": "tewh", 894 | "use": "generic-host" 895 | }, 896 | { 897 | "address": "10.2.128.33", 898 | "alias": "tewh-k - TeWhaiti Kura (tol)", 899 | "host_name": "tewh-k", 900 | "parents": "tewh", 901 | "use": "generic-host" 902 | }, 903 | { 904 | "address": "10.2.128.34", 905 | "alias": "rua - Ruatahuna (tol)", 906 | "host_name": "rua2", 907 | "parents": "rua", 908 | "use": "generic-host" 909 | }, 910 | { 911 | "address": "10.2.128.35", 912 | "alias": "ming-k - Minginui Kura (tol)", 913 | "host_name": "ming-k", 914 | "parents": "ming", 915 | "use": "generic-host" 916 | }, 917 | { 918 | "address": "10.2.128.36", 919 | "alias": "ming - Minginui (tol)", 920 | "host_name": "ming", 921 | "parents": "tewh-k", 922 | "use": "generic-host" 923 | }, 924 | { 925 | "address": "10.2.128.37", 926 | "alias": "rua-k - Huiaru Kura (tol)", 927 | "host_name": "rua-k", 928 | "parents": "rua", 929 | "use": "generic-host" 930 | }, 931 | { 932 | "address": "10.2.128.38", 933 | "alias": "ming-c - Minginui Central (tol)", 934 | "host_name": "ming-c", 935 | "parents": "ming2", 936 | "use": "generic-host" 937 | }, 938 | { 939 | "address": "10.2.128.39", 940 | "alias": "ming - Minginui (tol)", 941 | "host_name": "ming2", 942 | "parents": "ming", 943 | "use": "generic-host" 944 | }, 945 | { 946 | "address": "10.2.128.40", 947 | "alias": "muru - Murupara (tol)", 948 | "host_name": "muru", 949 | "parents": "tawh", 950 | "use": "generic-host" 951 | }, 952 | { 953 | "address": "10.2.128.41", 954 | "alias": "glta-k - Galatea Kura (tol)", 955 | "host_name": "glta-k", 956 | "parents": "glta2", 957 | "use": "generic-host" 958 | }, 959 | { 960 | "address": "10.2.128.42", 961 | "alias": "glta - Galatea (tol)", 962 | "host_name": "glta", 963 | "parents": "muru", 964 | "use": "generic-host" 965 | }, 966 | { 967 | "address": "10.2.128.43", 968 | "alias": "glta2 - Galatea 2 (tol)", 969 | "host_name": "glta2", 970 | "parents": "glta", 971 | "use": "generic-host" 972 | }, 973 | { 974 | "address": "10.2.128.44", 975 | "alias": "mthi - Matahi (tol)", 976 | "host_name": "mthi", 977 | "parents": "yman3", 978 | "use": "generic-host" 979 | }, 980 | { 981 | "address": "10.2.128.45", 982 | "alias": "mthi2 - Matahi 2 (tol)", 983 | "host_name": "mthi2", 984 | "parents": "mthi", 985 | "use": "generic-host" 986 | }, 987 | { 988 | "address": "10.2.128.46", 989 | "alias": "mthi-k - Matahi Kura (tol)", 990 | "host_name": "mthi-k", 991 | "parents": "mthi2", 992 | "use": "generic-host" 993 | }, 994 | { 995 | "address": "10.3.128.1", 996 | "alias": "Mangitaniwha (Hokianga)", 997 | "host_name": "mgtwha", 998 | "parents": "htb", 999 | "use": "generic-host" 1000 | }, 1001 | { 1002 | "address": "10.3.128.2", 1003 | "alias": "LEE ICONZ Tower (Hokianga)", 1004 | "host_name": "lee", 1005 | "parents": "mgtwha", 1006 | "use": "generic-host" 1007 | }, 1008 | { 1009 | "address": "10.3.128.3", 1010 | "alias": "LEE ICONZ Tower (Hokianga)", 1011 | "host_name": "lee2", 1012 | "parents": "lee", 1013 | "use": "generic-host" 1014 | }, 1015 | { 1016 | "address": "10.3.128.4", 1017 | "alias": "Cook (Hokianga)", 1018 | "host_name": "cook", 1019 | "parents": "lee2", 1020 | "use": "generic-host" 1021 | }, 1022 | { 1023 | "address": "10.3.128.5", 1024 | "alias": "Pkt (FIX ME) (Hokianga)", 1025 | "host_name": "pkt", 1026 | "parents": "cook", 1027 | "use": "generic-host" 1028 | }, 1029 | { 1030 | "address": "10.3.128.6", 1031 | "alias": "Kohukohu Library (Hokianga)", 1032 | "host_name": "khukhu", 1033 | "parents": "lee2", 1034 | "use": "generic-host" 1035 | }, 1036 | { 1037 | "address": "10.3.128.7", 1038 | "alias": "Horeke (Hokianga)", 1039 | "host_name": "horeke", 1040 | "parents": "lee", 1041 | "use": "generic-host" 1042 | }, 1043 | { 1044 | "address": "10.3.128.8", 1045 | "alias": "Cook 2 (Hokianga)", 1046 | "host_name": "cook2", 1047 | "parents": "cook", 1048 | "use": "generic-host" 1049 | }, 1050 | { 1051 | "address": "10.3.128.9", 1052 | "alias": "Okaihau College (Hokianga)", 1053 | "host_name": "oku", 1054 | "parents": "cook2", 1055 | "use": "generic-host" 1056 | } 1057 | ] -------------------------------------------------------------------------------- /examples/crcnet/process/hosts2arbor.py: -------------------------------------------------------------------------------- 1 | import json 2 | import argparse 3 | import re 4 | 5 | parser = argparse.ArgumentParser(description='Process a host file into valid JSON') 6 | parser.add_argument('hostf', type=file) 7 | args = parser.parse_args() 8 | #print args.hostf 9 | 10 | fout = file('data.arbor', 'w') 11 | defining = False 12 | hosts = [] 13 | host = {} 14 | 15 | for line in args.hostf: 16 | if line.startswith('}'): 17 | defining = False 18 | hosts.append(host) 19 | 20 | if defining: 21 | line = line.strip() 22 | parts = re.split(' |\t', line, 1) 23 | 24 | if len(parts) > 1: 25 | str = parts[1].strip() 26 | host[parts[0]] = str; 27 | 28 | if line.startswith('define host'): 29 | defining = True 30 | host = {} 31 | 32 | for h in hosts: 33 | if 'host_name' in h and 'parents' in h: 34 | fout.write(h['parents'] + ' -- ' + h['host_name'] + '\n') 35 | 36 | #fout.write(json.dumps(hosts, sort_keys=True, indent=4)) 37 | fout.close() 38 | args.hostf.close() 39 | -------------------------------------------------------------------------------- /examples/crcnet/process/hosts2json.py: -------------------------------------------------------------------------------- 1 | import json 2 | import argparse 3 | import re 4 | 5 | parser = argparse.ArgumentParser(description='Process a host file into valid JSON') 6 | parser.add_argument('hostf', type=file) 7 | args = parser.parse_args() 8 | #print args.hostf 9 | 10 | fout = file('data.json', 'w') 11 | defining = False 12 | hosts = [] 13 | host = {} 14 | 15 | for line in args.hostf: 16 | if line.startswith('}'): 17 | defining = False 18 | hosts.append(host) 19 | 20 | if defining: 21 | line = line.strip() 22 | parts = re.split(' |\t', line, 1) 23 | 24 | if len(parts) > 1: 25 | str = parts[1].strip() 26 | host[parts[0]] = str; 27 | 28 | if line.startswith('define host'): 29 | defining = True 30 | host = {} 31 | 32 | fout.write(json.dumps(hosts, sort_keys=True, indent=4)) 33 | fout.close() 34 | args.hostf.close() 35 | -------------------------------------------------------------------------------- /examples/karen/data/karen-nodedata.php: -------------------------------------------------------------------------------- 1 | Array( 5 | // name that should be displayed everywhere for this node 6 | "fullname" => "Auckland", 7 | // position given in x,y coords from the top left of screen 8 | "position" => "250 220", 9 | // position around node the label should be anchored 10 | "labeloffset" => "E", 11 | "icon" => "/home/httpd/weathermap.karen.net.nz/config/images/large-blue-node.png", 12 | // all nodes that this one is connected to 13 | "graphlinks" => Array( 14 | // nodename 15 | "anx11-masc" => Array( 16 | // bandwidth of link 17 | "bw" => "10G", 18 | // suffix applied to top level node to create rrd name 19 | // eg, for this link the rrd is 'anx1-waun_6.1-masc' 20 | "rrd" => "2001-anx11-masc", 21 | ), 22 | "anx12-tsnp" => Array( 23 | "bw" => "10G", 24 | "rrd" => "4001-anx12-tsnp", 25 | "linkoffset" => "N70", 26 | ), 27 | "waun-tsnp2" => Array( 28 | "realtarget" => "anx12-tsnp", 29 | "bw" => "10G", 30 | "rrd" => "2.4-qeen", 31 | "linkoffset" => "S70", 32 | ), 33 | "anx14-innp" => Array( 34 | "bw" => "10G", 35 | "rrd" => "2004-anx14-innp", 36 | ), 37 | "anx15-hepn" => Array( 38 | "bw" => "10G", 39 | "rrd" => "4004-hepn", 40 | ), 41 | "lax" => Array( 42 | "bw" => "655M", 43 | "rrd" => "3.1-lax", 44 | ), 45 | "sydney" => Array( 46 | "bw" => "122M", 47 | "rrd" => "3.1-sydney", 48 | ), 49 | ), 50 | ), 51 | /***************************************/ 52 | "anx2-lmtn" => Array( 53 | "fullname" => "Wellington", 54 | "position" => "650 300", 55 | "labeloffset" => "NW", 56 | "icon" => "/home/httpd/weathermap.karen.net.nz/config/images/large-blue-node.png", 57 | "graphlinks" => Array( 58 | "anx3-cscc" => Array( 59 | "bw" => "10G", 60 | "rrd" => "4.4-cscc", 61 | ), 62 | "anx4-otun" => Array( 63 | "bw" => "1G", 64 | "rrd" => "4.4-cscc", 65 | ), 66 | "anx15-hepn" => Array( 67 | "bw" => "10G", 68 | "rrd" => "4.1-hepn", 69 | ), 70 | "anx17-nfuw" => Array( 71 | "bw" => "10G", 72 | "rrd" => "4.1-nfuw", 73 | ), 74 | "anx18-neln" => Array( 75 | "bw" => "10G", 76 | "rrd" => "2.4-neln", 77 | ), 78 | ), 79 | ), 80 | /***************************************/ 81 | "anx3-cscc" => Array( 82 | "fullname" => "Christchurch", 83 | "position" => "800 300", 84 | "labeloffset" => "N", 85 | "graphlinks" => Array( 86 | "anx2-lmtn" => Array( 87 | "bw" => "10G", 88 | "rrd" => "4.1-lmtn", 89 | ), 90 | "anx20-linu" => Array( 91 | "bw" => "10G", 92 | "rrd" => "6.1-linu", 93 | ), 94 | "anx18-neln" => Array( 95 | "bw" => "10G", 96 | "rrd" => "2.1-neln", 97 | ), 98 | ), 99 | ), 100 | /***************************************/ 101 | "anx4-otun" => Array( 102 | "fullname" => "Dunedin", 103 | "position" => "800 200", 104 | "labeloffset" => "W", 105 | "icon" => "/home/httpd/weathermap.karen.net.nz/config/images/large-blue-node.png", 106 | "graphlinks" => Array( 107 | "anx2-lmtn" => Array( 108 | "bw" => "10G", 109 | "rrd" => "4.1-lmtn", 110 | ), 111 | "anx20-linu" => Array( 112 | "bw" => "10G", 113 | "rrd" => "6.1-linu", 114 | ), 115 | "anx21-resz" => Array( 116 | "bw" => "10G", 117 | "rrd" => "6.1-resz", 118 | ), 119 | "inv" => Array( 120 | "bw" => "1G", 121 | "rrd" => "6.1-inv", 122 | ), 123 | ), 124 | ), 125 | /***************************************/ 126 | "anx11-masc" => Array( 127 | "fullname" => "Mount Albert", 128 | "position" => "250 375", 129 | "labeloffset" => "S", 130 | "graphlinks" => Array( 131 | "anx1-waun" => Array( 132 | "bw" => "10G", 133 | "rrd" => "1025-waun", 134 | ), 135 | ), 136 | ), 137 | /***************************************/ 138 | "anx12-tsnp" => Array( 139 | "fullname" => "North Shore", 140 | "position" => "100 220", 141 | "labeloffset" => "NW", 142 | "graphlinks" => Array( 143 | "anx1-waun" => Array( 144 | "bw" => "10G", 145 | "rrd" => "25-waun", 146 | "linkoffset" => "N", 147 | ), 148 | "waun-tsnp2" => Array( 149 | "bw" => "10G", 150 | "rrd" => "25-waun", 151 | "realtarget" => "anx1-waun", 152 | "linkoffset" => "S", 153 | ), 154 | "wkka" => Array( 155 | "bw" => "1G", 156 | "rrd" => "4-and23-wkka", 157 | ), 158 | ), 159 | ), 160 | /***************************************/ 161 | "anx13-frir" => Array( 162 | "fullname" => "Rotorua", 163 | "position" => "400 200", 164 | "labeloffset" => "S", 165 | "graphlinks" => Array( 166 | "anx14-innp" => Array( 167 | "bw" => "10G", 168 | "rrd" => "25-innp", 169 | ), 170 | "anx22-napr" => Array( 171 | "bw" => "10G", 172 | "rrd" => "26-napr", 173 | ), 174 | "tau" => Array( 175 | "bw" => "1G", 176 | "rrd" => "26-tau", 177 | ), 178 | ), 179 | ), 180 | /***************************************/ 181 | "anx14-innp" => Array( 182 | "fullname" => "Hamilton", 183 | "position" => "300 100", 184 | "labeloffset" => "N", 185 | "graphlinks" => Array( 186 | "anx1-waun" => Array( 187 | "bw" => "10G", 188 | "rrd" => "25-waun", 189 | ), 190 | "anx13-frir" => Array( 191 | "bw" => "10G", 192 | "rrd" => "26-frir", 193 | ), 194 | ), 195 | ), 196 | /***************************************/ 197 | "anx15-hepn" => Array( 198 | "fullname" => "Palmerston North", 199 | "position" => "450 350", 200 | "labeloffset" => "W", 201 | "icon" => "/home/httpd/weathermap.karen.net.nz/config/images/large-blue-node.png", 202 | "graphlinks" => Array( 203 | "anx1-waun" => Array( 204 | "bw" => "10G", 205 | "rrd" => "25-waun", 206 | ), 207 | "anx2-lmtn" => Array( 208 | "bw" => "10G", 209 | "rrd" => "26-lmtn", 210 | ), 211 | "anx16-mass" => Array( 212 | "bw" => "10G", 213 | "rrd" => "26-mass", 214 | ), 215 | "npl" => Array( 216 | "bw" => "1G", 217 | "rrd" => "26-npl", 218 | ), 219 | "wag" => Array( 220 | "bw" => "1G", 221 | "rrd" => "26-wag", 222 | ), 223 | ), 224 | ), 225 | /***************************************/ 226 | "anx16-mass" => Array( 227 | "fullname" => "Massey", 228 | "position" => "550 230", 229 | "labeloffset" => "W", 230 | "graphlinks" => Array( 231 | "anx15-hepn" => Array( 232 | "bw" => "10G", 233 | "rrd" => "25-hepn", 234 | ), 235 | "anx17-nfuw" => Array( 236 | "bw" => "10G", 237 | "rrd" => "25-nfuw", 238 | ), 239 | "anx22-napr" => Array( 240 | "bw" => "10G", 241 | "rrd" => "26-napr", 242 | ), 243 | ), 244 | ), 245 | /***************************************/ 246 | "anx17-nfuw" => Array( 247 | "fullname" => "Lower Hutt", 248 | "position" => "650 125", 249 | "labeloffset" => "E", 250 | "graphlinks" => Array( 251 | "anx2-lmtn" => Array( 252 | "bw" => "10G", 253 | "rrd" => "26-lmtn", 254 | ), 255 | "anx16-mass" => Array( 256 | "bw" => "10G", 257 | "rrd" => "25-mass", 258 | ), 259 | "por" => Array( 260 | "bw" => "1G", 261 | "rrd" => "25-por", 262 | ), 263 | ), 264 | ), 265 | /***************************************/ 266 | "anx18-neln" => Array( 267 | "fullname" => "Nelson", 268 | "position" => "650 450", 269 | "labeloffset" => "S", 270 | "graphlinks" => Array( 271 | "anx2-lmtn" => Array( 272 | "bw" => "10G", 273 | "rrd" => "25-lmtn", 274 | ), 275 | "anx3-cscc" => Array( 276 | "bw" => "10G", 277 | "rrd" => "26-cscc", 278 | ), 279 | ), 280 | ), 281 | /***************************************/ 282 | /* 283 | "anx19-crof" => Array( 284 | "fullname" => "Havelock North", 285 | "position" => "500 50", 286 | "labeloffset" => "E", 287 | "graphlinks" => Array( 288 | // this one won't be a return link 289 | "anx22-napr" => Array( 290 | "bw" => "10G", 291 | "rrd" => "25-napr", 292 | ), 293 | ), 294 | ), 295 | */ 296 | /***************************************/ 297 | "anx20-linu" => Array( 298 | "fullname" => "Lincoln", 299 | "position" => "950 300", 300 | "labeloffset" => "E", 301 | "graphlinks" => Array( 302 | "anx3-cscc" => Array( 303 | "bw" => "10G", 304 | "rrd" => "25-cscc", 305 | ), 306 | "anx4-otun" => Array( 307 | "bw" => "10G", 308 | "rrd" => "25-otun", 309 | ), 310 | "tpo" => Array( 311 | "bw" => "1G", 312 | "rrd" => "25-tpo", 313 | ), 314 | ), 315 | 316 | ), 317 | /***************************************/ 318 | "anx21-resz" => Array( 319 | "fullname" => "Invermay", 320 | "position" => "800 50", 321 | "labeloffset" => "N", 322 | "graphlinks" => Array( 323 | "anx4-otun" => Array( 324 | "bw" => "10G", 325 | "rrd" => "25-otun", 326 | ), 327 | ), 328 | ), 329 | /***************************************/ 330 | "anx22-napr" => Array( 331 | "fullname" => "Napier", 332 | "position" => "500 125", 333 | "labeloffset" => "E", 334 | "graphlinks" => Array( 335 | "anx13-frir" => Array( 336 | "bw" => "10G", 337 | "rrd" => "1.25-frir", 338 | ), 339 | "anx16-mass" => Array( 340 | "bw" => "10G", 341 | "rrd" => "1.26-mass", 342 | ), 343 | "gis" => Array( 344 | "bw" => "1G", 345 | "rrd" => "2.26-gis", 346 | ), 347 | ), 348 | ), 349 | /***************************************/ 350 | "wkka" => Array( 351 | "fullname" => "Warkworth", 352 | "position" => "50 310", 353 | "labeloffset" => "S", 354 | "graphlinks" => Array( 355 | "anx12-tsnp" => Array( 356 | "bw" => "1G", 357 | /*"rrd" => "",*/ 358 | ), 359 | ), 360 | ), 361 | /***************************************/ 362 | "tau" => Array( 363 | "fullname" => "Tauranga", 364 | "position" => "400 25", 365 | "labeloffset" => "N", 366 | "graphlinks" => Array( 367 | "anx13-frir" => Array( 368 | "bw" => "1G", 369 | "rrd" => "2.26-frir", 370 | ), 371 | ), 372 | ), 373 | /***************************************/ 374 | "gis" => Array( 375 | "fullname" => "Gisborne", 376 | "position" => "500 25", 377 | "labeloffset" => "N", 378 | "graphlinks" => Array( 379 | "anx22-napr" => Array( 380 | "bw" => "1G", 381 | "rrd" => "2.26-napr", 382 | ), 383 | ), 384 | ), 385 | /***************************************/ 386 | "npl" => Array( 387 | "fullname" => "New Plymouth", 388 | "position" => "350 450", 389 | "labeloffset" => "S", 390 | "graphlinks" => Array( 391 | "anx15-hepn" => Array( 392 | "bw" => "1G", 393 | "rrd" => "2.26-hepn", 394 | ), 395 | ), 396 | ), 397 | /***************************************/ 398 | "wag" => Array( 399 | "fullname" => "Wanganui", 400 | "position" => "550 450", 401 | "labeloffset" => "S", 402 | "graphlinks" => Array( 403 | "anx15-hepn" => Array( 404 | "bw" => "1G", 405 | "rrd" => "2.26-hepn", 406 | ), 407 | ), 408 | ), 409 | /***************************************/ 410 | "por" => Array( 411 | "fullname" => "Porirua", 412 | "position" => "650 25", 413 | "labeloffset" => "N", 414 | "graphlinks" => Array( 415 | "anx17-nfuw" => Array( 416 | "bw" => "1G", 417 | "rrd" => "2.26-nfuw", 418 | ), 419 | ), 420 | ), 421 | /***************************************/ 422 | "tpo" => Array( 423 | "fullname" => "Tekapo", 424 | "position" => "950 175", 425 | "labeloffset" => "E", 426 | "graphlinks" => Array( 427 | "anx20-linu" => Array( 428 | "bw" => "1G", 429 | "rrd" => "2.26-linu", 430 | ), 431 | ), 432 | ), 433 | /***************************************/ 434 | "inv" => Array( 435 | "fullname" => "Inverness", 436 | "position" => "950 100", 437 | "labeloffset" => "N", 438 | "graphlinks" => Array( 439 | "anx4-otun" => Array( 440 | "bw" => "1G", 441 | "rrd" => "2.26-otun", 442 | ), 443 | ), 444 | ), 445 | /***************************************/ 446 | /* 447 | "qeen" => Array( 448 | "fullname" => "", 449 | "position" => "970 300", 450 | "labeloffset" => "S", 451 | "graphlinks" => Array( 452 | "anx3-cscc" => Array( 453 | "bw" => "10G", 454 | "linkoffset" => "NW", 455 | ), 456 | ), 457 | ), 458 | */ 459 | /***************************************/ 460 | /* 461 | "qeen" => Array( 462 | "fullname" => "Queenstown", 463 | "position" => "900 450", 464 | "labeloffset" => "S", 465 | "graphlinks" => Array( 466 | "anx3-cscc" => Array( 467 | "bw" => "10G", 468 | ), 469 | "anx4-otun" => Array( 470 | "bw" => "10G", 471 | ), 472 | ), 473 | ), 474 | */ 475 | /***************************************/ 476 | /* 477 | "international" => Array( 478 | "fullname" => "International", 479 | //"position" => "30 150", 480 | "position" => "50 150", 481 | "labeloffset" => "NE", 482 | "graphlinks" => Array( 483 | "anx12-tsnp" => Array( 484 | "bw" => "1G", 485 | // no rrd in this direction 486 | ), 487 | ), 488 | ), 489 | */ 490 | /***************************************/ 491 | /* 492 | "vzb" => Array( 493 | "fullname" => "Verizon", 494 | "position" => "60 150", 495 | "labeloffset" => "NE", 496 | "graphlinks" => Array( 497 | "anx12-tsnp" => Array( 498 | "bw" => "1G", 499 | // no rrd in this direction 500 | ), 501 | "anx1-waun" => Array( 502 | "bw" => "1G", 503 | // no rrd in this direction 504 | ), 505 | "seattle" => Array( 506 | "bw" => "622M", 507 | ), 508 | "sydney" => Array( 509 | "bw" => "155M", 510 | "linkoffset" => "W", 511 | ), 512 | "equinix" => Array( 513 | "bw" => "155M", 514 | "linkoffset" => "E", 515 | ), 516 | ), 517 | ), 518 | */ 519 | /***************************************/ 520 | "sydney" => Array( 521 | "fullname" => "Sydney", 522 | "position" => "50 75", 523 | "labeloffset" => "S", 524 | "graphlinks" => Array( 525 | "anx1-waun" => Array( 526 | "bw" => "155M", 527 | "rrd" => "equinix", 528 | ), 529 | ), 530 | ), 531 | /***************************************/ 532 | "lax" => Array( 533 | "fullname" => "Los Angeles", 534 | "position" => "125 45", 535 | "labeloffset" => "N", 536 | "graphlinks" => Array( 537 | "anx1-waun" => Array( 538 | "bw" => "622M", 539 | "rrd" => "pacwave", 540 | ), 541 | ), 542 | ), 543 | /***************************************/ 544 | ); 545 | 546 | ?> 547 | -------------------------------------------------------------------------------- /examples/karen/data/rrd/lasttime: -------------------------------------------------------------------------------- 1 | 201012082202.new -------------------------------------------------------------------------------- /examples/karen/data/vlan910.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "VLAN910", 4 | "devices": { 5 | "WLG": { "links": [ "ANR2-WLG", "WELLINGTON LOOP", "DUD", "AVL", "WELLINGTON DISTRIBUTION", "PMR", "CHC" ] }, 6 | "NSH": { "links": [ "//TODO: and23-wrk", "AKL" ] }, 7 | "PMR": { "links": [ "INSPIRE NET", "NPL", "WAG", "AKL", "MUP", "WLG" ] }, 8 | "AVL": { "links": [ "POR", "MUP", "WLG" ] }, 9 | "LCN": { "links": [ "CHC", "DUD" ] }, 10 | "ROT": { "links": [ "HLZ", "NPE", "TRG" ] }, 11 | "HLZ": { "links": [ "WINTEC", "AKL", "ROT" ] }, 12 | "DUD": { "links": [ "IVC", "WLG", "LCN", "DUD" ] } 13 | } 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /examples/karen/karen-detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Karen Weathermap 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |

Use mouse wheel to zoom in / out. Click and drag to pan. Right click on node to zoom and center.

27 |
28 |
29 |
30 |
31 |
32 |
33 | VLAN Overlay: 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /examples/karen/karen-detail.js: -------------------------------------------------------------------------------- 1 | var labelType, useGradients, nativeTextSupport, animate; 2 | 3 | (function() { 4 | var ua = navigator.userAgent, 5 | iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i), 6 | typeOfCanvas = typeof HTMLCanvasElement, 7 | nativeCanvasSupport = (typeOfCanvas == 'object' || typeOfCanvas == 'function'), 8 | textSupport = nativeCanvasSupport 9 | && (typeof document.createElement('canvas').getContext('2d').fillText == 'function'); 10 | //I'm setting this based on the fact that ExCanvas provides text support for IE 11 | //and that as of today iPhone/iPad current text support is lame 12 | labelType = (!nativeCanvasSupport || (textSupport && !iStuff))? 'Native' : 'HTML'; 13 | nativeTextSupport = labelType == 'Native'; 14 | useGradients = nativeCanvasSupport; 15 | animate = !(iStuff || !nativeCanvasSupport); 16 | })(); 17 | 18 | function init(){ 19 | // init ForceDirected 20 | var fd = new $jit.NetworkMap({ 21 | //id of the visualization container 22 | injectInto: 'infovis', 23 | //Enable zooming and panning 24 | //by scrolling and DnD 25 | Navigation: { 26 | enable: true, 27 | //Enable panning events only if we're dragging the empty 28 | //canvas (and not a node). 29 | panning: true, //'avoid nodes', 30 | zooming: 80 //zoom speed. higher is more sensible 31 | }, 32 | // Change node and edge styles such as 33 | // color and width. 34 | // These properties are also set per node 35 | // with dollar prefixed data-properties in the 36 | // JSON structure. 37 | Node: { 38 | overridable: true, 39 | dim: 20 40 | }, 41 | Edge: { 42 | overridable: true, 43 | color: '#23A4FF', 44 | lineWidth: 1, 45 | type: 'arrowpipe' 46 | }, 47 | //Native canvas text styling 48 | Label: { 49 | type: 'HTML', //Native or HTML 50 | // TODO: can't move nodes properly with HTML labels - may need to overide navigation class 51 | size: 10, 52 | style: 'bold' 53 | }, 54 | // Add node events 55 | Events: { 56 | enable: true, 57 | type: 'Native', // use the default events system 58 | onMouseMove: function(node, eventInfo, e) { 59 | var edge = eventInfo.getEdge(); 60 | 61 | if (this.current) this.current.remove(); 62 | if (!edge) return; 63 | 64 | var n1 = edge.nodeFrom, 65 | n2 = edge.nodeTo, 66 | n1f = fd.fitsInCanvas(fd.p2c(n1.getPos())), 67 | n2f = fd.fitsInCanvas(fd.p2c(n2.getPos())); 68 | 69 | if (n1f && n2f || !n1f && !n2f) { 70 | return; 71 | } 72 | 73 | var to = n1f ? n2 : n1; 74 | var from = n1f ? n1 : n2; 75 | 76 | this.current = jQuery('
To ' + to.name + '
') 77 | .css({ position: 'absolute', left: e.clientX, top: e.clientY - 30, color: '#ddd' }) 78 | .appendTo(document.body); 79 | }, 80 | onMouseWheel: function() { 81 | }, 82 | //Change cursor style when hovering a node 83 | onMouseEnter: function() { 84 | fd.canvas.getElement().style.cursor = 'move'; 85 | }, 86 | onMouseLeave: function() { 87 | fd.canvas.getElement().style.cursor = ''; 88 | }, 89 | //Update node positions when dragged 90 | onDragMove: function(node, eventInfo, e) { 91 | //var pos = eventInfo.getPos(); 92 | //node.pos.setc(pos.x, pos.y); 93 | //fd.plot(); 94 | }, 95 | //Implement the same handler for touchscreens 96 | onTouchMove: function(node, eventInfo, e) { 97 | //$jit.util.event.stop(e); //stop default touchmove event 98 | //this.onDragMove(node, eventInfo, e); 99 | }, 100 | //Add also a click handler to nodes 101 | onClick: function(node, eventInfo, e) { 102 | var edge = eventInfo.getEdge(); 103 | 104 | if (!edge) return; 105 | 106 | var n1 = edge.nodeFrom, 107 | n2 = edge.nodeTo, 108 | n1f = fd.fitsInCanvas(fd.p2c(n1.getPos())), 109 | n2f = fd.fitsInCanvas(fd.p2c(n2.getPos())); 110 | 111 | if (n1f && n2f || !n1f && !n2f) { 112 | return; 113 | } 114 | 115 | var from = n1f ? n1 : n2; 116 | var to = n1f ? n2 : n1; 117 | 118 | fd.followEdge(from, to, 2); 119 | }, 120 | onRightClick: function(node, eventInfo, e) { 121 | if (node) fd.zoomNode(node, 1, 30); 122 | } 123 | }, 124 | bgAlpha: 0.25, 125 | onCreateLabel: function(domElement, node){ 126 | if (node.data.parentID) { 127 | domElement.innerHTML = node.name; 128 | } else { 129 | domElement.innerHTML = node.id.substr(4); 130 | } 131 | 132 | var style = domElement.style; 133 | style.fontSize = "0.8em"; 134 | style.color = "#000"; 135 | style.backgroundColor = "rgba(255,255,255,0.90)"; 136 | style.padding = "1px"; 137 | style.whiteSpace= "nowrap"; 138 | }, 139 | // Change node styles when DOM labels are placed 140 | // or moved. 141 | onPlaceLabel: function(domElement, node){ 142 | var style = domElement.style; 143 | var left = parseInt(style.left); 144 | var top = parseInt(style.top); 145 | var w = domElement.offsetWidth; 146 | style.left = (left - w / 2) + 'px'; 147 | style.top = top + 'px'; 148 | } 149 | }); 150 | 151 | // load JSON data. 152 | $NetworkMap.Json.load('data/karen-detail.json', function(json) { 153 | var tx = 35, ty = 50, sx = 1.1, sy = 1.1; 154 | 155 | $NetworkMap.Utils.Metrics.initJSON(json); 156 | fd.loadJSON(json); 157 | $NetworkMap.Utils.Metrics.updateMetrics(fd); 158 | fd.refresh(); 159 | fd.canvas.scale(sx, sy); 160 | fd.canvas.translate(tx, ty); 161 | 162 | // overview test 163 | var over = new $NetworkMap.Views.OverviewManager(fd, jQuery('#overview'), 180, 150, {}, tx, ty); 164 | 165 | // overlay test 166 | var m = new $NetworkMap.Overlays.OverlayManager(fd); 167 | 168 | jQuery.getJSON('data/vlan910.json', function(vlans) { 169 | var vlan = vlans[0]; 170 | var select = jQuery('#selectVLAN'); 171 | 172 | var o = new $NetworkMap.Overlays.Overlay('vlans', function(viz, graph, canvas) { 173 | var ctx = canvas.getCtx(); 174 | ctx.save(); 175 | ctx.strokeStyle = 'fuchsia'; 176 | ctx.lineWidth = 2 / canvas.scaleOffsetX; 177 | 178 | graph.eachNode(function(n) { 179 | n.eachAdjacency(function(adj) { 180 | var nodeFrom = adj.nodeFrom, nodeTo = adj.nodeTo, 181 | posFrom = nodeFrom.getPos(), posTo = nodeTo.getPos(); 182 | 183 | if (vlan.devices[nodeFrom.id]) { 184 | if (vlan.devices[nodeFrom.id].links.indexOf(nodeTo.id) != -1) { 185 | ctx.beginPath(); 186 | ctx.moveTo(posFrom.x, posFrom.y); 187 | ctx.lineTo(posTo.x, posTo.y); 188 | ctx.closePath(); 189 | ctx.stroke(); 190 | } 191 | } 192 | }); 193 | }); 194 | 195 | ctx.restore(); 196 | }); 197 | m.add(o); 198 | o.stop(); 199 | 200 | select.append( 201 | jQuery('