├── .gitignore ├── LICENSE.txt ├── README.md ├── docs ├── globe.png └── mapster.png ├── index.js ├── package.json └── public ├── img ├── explosion.gif ├── particle.png └── world.jpg ├── lib ├── globe.js ├── latlon-geohash.js ├── map.js ├── map.topo.json ├── mapster_controller.js ├── mapster_directive.js ├── three.min.js └── topojson.min.js ├── mapster.html ├── mapster.js ├── mapster.less ├── mapster_params_editor.html └── mapster_params_editor.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .idea/ 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU 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 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mapster 2 | 3 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/893661b4aa2f45378d96c21768b7ea8b)](https://www.codacy.com/app/xarkes/mapster) 4 | 5 | Mapster is a real-time event map implemented as a [Kibana](https://github.com/elastic/kibana) [visualization](https://www.elastic.co/guide/en/kibana/current/visualize.html). 6 | 7 | # How does it work 8 | Mapster is not truely in real-time. It fetches the events from ElasticSearch using Kibana and replays the events in real 9 | time with a lag corresponding to the Kibana refresh time. 10 | 11 | For best performances, Kibana dashboard should be set to collect events from last 30 seconds and to refresh every 30 seconds too. 12 | The refresh rate should be equal to the window time. 13 | 14 | To draw the 2D map, Mapster uses [d3js](https://d3js.org/) and it uses [threejs](https://threejs.org/) to draw the 3D globe. 15 | 16 | # Installation 17 | ## Requirements 18 | - Kibana 4.5.0 (the only supported version for now) 19 | 20 | ## Instructions 21 | Simply clone the repository into your Kibana plugins folder: 22 | ```sh 23 | cd installedPlugins && git clone https://github.com/xarkes/mapster 24 | ``` 25 | 26 | If you are using Kibana from git and starting it in `dev` mode, Kibana will automatically refresh its cache and the plugin 27 | will be successfully loaded. 28 | Otherwise you can force it by stopping kibana, deleting the cache and starting kibana again. 29 | ```sh 30 | rm -r optimize/bundles 31 | ./bin/kibana 32 | ``` 33 | 34 | From now, you should see that Mapster is available in the Visualization tab of Kibana. Now set your kibana events to 35 | last 30 seconds, enable auto-refresh and enjoy ! 36 | 37 | # Configuration 38 | To add Mapster to a dashboard, first create a new [visualization](https://www.elastic.co/guide/en/kibana/current/visualize.html). 39 | 40 | ## Important information 41 | Notice that when customizing the visualization some options are not automatically refreshed and you might need to do a manual refresh (F5). 42 | 43 | ## Choosing correct aggregations 44 | The metric should be set to `Count`. 45 | 46 | The first aggregation is as described the timestamp matching the event. You should use a `Date Histogram` with the Interval set to `Seconds`. 47 | 48 | The second aggregation is the event coordinates so you have to use a `Geohash` matching the event's origin. 49 | 50 | The third aggregation is the target IP. It is used to aggregate multiple events from the same IP on the map. 51 | 52 | The fourth aggregation is the sensor. The sensor is used to differentiate event types on the map. 53 | 54 | Then you can add any other aggregation if you need to filter your events using the kibana search field. 55 | 56 | ## Plugin options 57 | | Option name | Meaning | 58 | |-------------------------------|--------------------------------------------------------------------------------------------| 59 | | Use a 3D Map ? | Well ... do you prefer a 2D plan or a 3D globe ? | 60 | | Object shape | The svg shape of the object thrown from the origin to the target. | 61 | | Object scale | The scale of the above shape. | 62 | | Object rotation | The object rotation. If the object is looking to the top, the rotation is 90 degrees. | 63 | | Target coords | This is the location on the map of the target. | 64 | | Special effects | The sensor field used to display the event as a special effect. | 65 | | Special effects scale | The scale of the special effects. | 66 | | Special shape | Shape used to mark a special event on the map. | 67 | | Special scale | The scale of the above shape. | 68 | | Special remaining time | The duration the special shape stays on the map. | 69 | | Origin default size | The default size of a circle (origin). | 70 | | Origin maximum size | The maximum size of a circle. | 71 | | Origin dying time | The time the origin dies. | 72 | | Hide events at (0,0) | If some of your data are located at (0,0) you can choose to hide them or not. | 73 | | Enable explosions | Do you want explosions ?! | 74 | | Explosion file | The name of your explosion file (GIF format). It should be located under the img/ folder. | 75 | | Explosion height | The height of the explosion file (if you want to resize it). | 76 | | Explosion width | The width of the explosion file (if you want to resize it too). | 77 | | Explosion delay (in ms) | The duration in ms of the gif. | 78 | | Number of events in the logs | Number of lines in the event logs table. | 79 | | | | 80 | 81 | 82 | # Screenshots 83 | ![Mapster](/docs/mapster.png?raw=true "Mapster map") 84 | ![Mapster](/docs/globe.png?raw=true "Mapster globe") 85 | -------------------------------------------------------------------------------- /docs/globe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbs-system/mapster/ebe733cdd6f0eaa63c0a0f7b35ca43bfe2d8acc1/docs/globe.png -------------------------------------------------------------------------------- /docs/mapster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbs-system/mapster/ebe733cdd6f0eaa63c0a0f7b35ca43bfe2d8acc1/docs/mapster.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (kibana) { 2 | return new kibana.Plugin({ 3 | uiExports: { 4 | visTypes: ["plugins/mapster/mapster"] 5 | } 6 | /*init: function(server, options) { 7 | server.exposeStaticDir('/testlol/{path*}', 'plugins/mapster/lib'); 8 | }*/ 9 | }); 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mapster", 3 | "version": "0.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /public/img/explosion.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbs-system/mapster/ebe733cdd6f0eaa63c0a0f7b35ca43bfe2d8acc1/public/img/explosion.gif -------------------------------------------------------------------------------- /public/img/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbs-system/mapster/ebe733cdd6f0eaa63c0a0f7b35ca43bfe2d8acc1/public/img/particle.png -------------------------------------------------------------------------------- /public/img/world.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbs-system/mapster/ebe733cdd6f0eaa63c0a0f7b35ca43bfe2d8acc1/public/img/world.jpg -------------------------------------------------------------------------------- /public/lib/globe.js: -------------------------------------------------------------------------------- 1 | var THREE = require("plugins/mapster/lib/three.min.js"); 2 | var moment = require("moment"); 3 | 4 | var Globe = function () { 5 | 6 | var Shaders = { 7 | 'earth': { 8 | uniforms: { 9 | 'texture': {type: 't', value: null} 10 | }, 11 | vertexShader: [ 12 | 'varying vec3 vNormal;', 13 | 'varying vec2 vUv;', 14 | 'void main() {', 15 | 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', 16 | 'vNormal = normalize( normalMatrix * normal );', 17 | 'vUv = uv;', 18 | '}' 19 | ].join('\n'), 20 | fragmentShader: [ 21 | 'uniform sampler2D texture;', 22 | 'varying vec3 vNormal;', 23 | 'varying vec2 vUv;', 24 | 'void main() {', 25 | 'vec3 diffuse = texture2D( texture, vUv ).xyz;', 26 | 'float intensity = 1.05 - dot( vNormal, vec3( 0.0, 0.0, 1.0 ) );', 27 | 'vec3 atmosphere = vec3( 1.0, 1.0, 1.0 ) * pow( intensity, 3.0 );', 28 | 'gl_FragColor = vec4( diffuse + atmosphere, 1.0 );', 29 | '}' 30 | ].join('\n') 31 | }, 32 | 'atmosphere': { 33 | uniforms: {}, 34 | vertexShader: [ 35 | 'varying vec3 vNormal;', 36 | 'void main() {', 37 | 'vNormal = normalize( normalMatrix * normal );', 38 | 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', 39 | '}' 40 | ].join('\n'), 41 | fragmentShader: [ 42 | 'varying vec3 vNormal;', 43 | 'void main() {', 44 | 'float intensity = pow( 0.8 - dot( vNormal, vec3( 0, 0, 1.0 ) ), 12.0 );', 45 | 'gl_FragColor = vec4( 1.0, 1.0, 1.0, 1.0 ) * intensity;', 46 | '}' 47 | ].join('\n') 48 | } 49 | }; 50 | 51 | var config; 52 | var $timeout; 53 | 54 | var PI_HALF = Math.PI / 2; 55 | 56 | var scene, camera, renderer; 57 | var sphere, atmosphere; 58 | var mouseOnDown = {x: 0, y: 0}; 59 | var mouse = {x: 0, y: 0}; 60 | var targetOnDown = {x: 0, y: 0}; 61 | var target = {x: PI_HALF + 0.2, y: Math.PI / 6.0}; 62 | var rotation = {x: 0, y: 0}; 63 | var overRenderer; 64 | 65 | var textureLoader; 66 | var origins = {}; 67 | 68 | var distance = 100000; 69 | var distanceTarget = 100000; 70 | 71 | var sphereRadius = 200; 72 | var MAX_POINTS = 100; 73 | 74 | var container; 75 | 76 | var idleTime = 0; 77 | 78 | function setConfig(c, t) { 79 | config = c; 80 | $timeout = t; 81 | } 82 | 83 | function init(container) { 84 | /* TODO Merge with render ? */ 85 | var w = container.offsetWidth || window.innerWidth; 86 | var h = container.offsetHeight || window.innerHeight; 87 | 88 | scene = new THREE.Scene(); 89 | 90 | camera = new THREE.PerspectiveCamera(30, w / h, 1, 10000); 91 | camera.position.z = 1000; 92 | 93 | renderer = new THREE.WebGLRenderer(); 94 | renderer.setSize(w, h); 95 | container.appendChild(renderer.domElement); 96 | 97 | addSphere(); 98 | 99 | /* Sphere controls */ 100 | container.addEventListener('mousedown', onMouseDown, false); 101 | 102 | /* Support for chrome and firefox */ 103 | container.addEventListener('mousewheel', onMouseWheel, false); 104 | container.addEventListener('DOMMouseScroll', onMouseWheel, false); 105 | 106 | container.addEventListener('mouseover', function () { 107 | overRenderer = true; 108 | }, false); 109 | 110 | container.addEventListener('mouseout', function () { 111 | overRenderer = false; 112 | }, false); 113 | } 114 | 115 | function addSphere() { 116 | // Add sphere 117 | var geometry = new THREE.SphereGeometry(sphereRadius, 40, 30); 118 | textureLoader = new THREE.TextureLoader(); 119 | 120 | var uniforms = THREE.UniformsUtils.clone(Shaders['earth'].uniforms); 121 | uniforms['texture'].value = textureLoader.load('/plugins/mapster/img/world.jpg'); 122 | 123 | var material = new THREE.ShaderMaterial({ 124 | uniforms: uniforms, 125 | vertexShader: Shaders['earth'].vertexShader, 126 | fragmentShader: Shaders['earth'].fragmentShader 127 | }); 128 | 129 | sphere = new THREE.Mesh(geometry, material); 130 | //sphere.rotation.y = Math.PI; 131 | scene.add(sphere); 132 | 133 | // Add atmosphere 134 | uniforms = THREE.UniformsUtils.clone(Shaders['atmosphere'].uniforms); 135 | material = new THREE.ShaderMaterial({ 136 | uniforms: uniforms, 137 | vertexShader: Shaders['atmosphere'].vertexShader, 138 | fragmentShader: Shaders['atmosphere'].fragmentShader, 139 | side: THREE.BackSide, 140 | blending: THREE.AdditiveBlending, 141 | transparent: true 142 | }); 143 | atmosphere = new THREE.Mesh(geometry, material); 144 | atmosphere.scale.set(1.1, 1.1, 1.1); 145 | scene.add(atmosphere); 146 | } 147 | 148 | // Get the point in space on surface of sphere radius radius from lat lng (in degrees) 149 | function latlngPosFromLatLng(lat, lng, radius) { 150 | var phi = (90 - lat) * Math.PI / 180; 151 | var theta = (360 - lng) * Math.PI / 180; 152 | var x = radius * Math.sin(phi) * Math.cos(theta); 153 | var y = radius * Math.cos(phi); 154 | var z = radius * Math.sin(phi) * Math.sin(theta); 155 | 156 | return { 157 | phi: phi, 158 | theta: theta, 159 | x: x, 160 | y: y, 161 | z: z 162 | }; 163 | } 164 | 165 | // Find intermediate points on sphere between two lat/lngs 166 | // lat and lng are in degrees 167 | // offset goes from 0 (lat/lng1) to 1 (lat/lng2) 168 | // formula from http://williams.best.vwh.net/avform.htm#Intermediate 169 | function latlngInterPoint(lat1, lng1, lat2, lng2, offset) { 170 | lat1 = THREE.Math.degToRad(lat1); 171 | lng1 = THREE.Math.degToRad(lng1); 172 | lat2 = THREE.Math.degToRad(lat2); 173 | lng2 = THREE.Math.degToRad(lng2); 174 | 175 | var d = 2 * Math.asin(Math.sqrt(Math.pow((Math.sin((lat1 - lat2) / 2)), 2) + 176 | Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin((lng1 - lng2) / 2), 2))); 177 | var A = Math.sin((1 - offset) * d) / Math.sin(d); 178 | var B = Math.sin(offset * d) / Math.sin(d); 179 | var x = A * Math.cos(lat1) * Math.cos(lng1) + B * Math.cos(lat2) * Math.cos(lng2); 180 | var y = A * Math.cos(lat1) * Math.sin(lng1) + B * Math.cos(lat2) * Math.sin(lng2); 181 | var z = A * Math.sin(lat1) + B * Math.sin(lat2); 182 | var lat = Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))) * 180 / Math.PI; 183 | var lng = Math.atan2(y, x) * 180 / Math.PI; 184 | 185 | return { 186 | lat: lat, 187 | lng: lng 188 | }; 189 | } 190 | 191 | function getDistance(lat1, lon1, lat2, lon2) { 192 | lat1 = THREE.Math.degToRad(lat1); 193 | lon1 = THREE.Math.degToRad(lon1); 194 | lat2 = THREE.Math.degToRad(lat2); 195 | lon2 = THREE.Math.degToRad(lon2); 196 | 197 | var a = Math.pow(Math.sin(( lon2 - lon1 ) / 2.0), 2); 198 | var b = Math.pow(Math.sin(( lat2 - lat1 ) / 2.0), 2); 199 | var c = Math.sqrt(a + Math.cos(lon2) * Math.cos(lon1) * b); 200 | 201 | return 2 * Math.asin(c) * sphereRadius; 202 | } 203 | 204 | function showEvent(lat1, lon1, lat2, lon2, radius, color, diff) { 205 | // TODO You can surely optimize and refactor this :) 206 | $timeout(function () { 207 | var num_control_points = 8; 208 | var dist = getDistance(lat1, lon1, lat2, lon2); 209 | var max_altitude = 30 / (sphereRadius * 2) * dist; // The longuest the highest 210 | max_altitude = max_altitude + (Math.random() - 0.5) * (max_altitude / 2); // Add some randomness above and below 211 | 212 | var points = []; 213 | var i; 214 | var pos; 215 | for (i = 0; i < num_control_points + 1; i++) { 216 | var arc_angle = i * 180.0 / num_control_points; 217 | var arc_radius = radius + (Math.sin(THREE.Math.degToRad(arc_angle))) * max_altitude; 218 | var latlng = latlngInterPoint(lat1, lon1, lat2, lon2, i / num_control_points); 219 | pos = latlngPosFromLatLng(latlng.lat, latlng.lng, arc_radius); 220 | 221 | points.push(new THREE.Vector3(pos.x, pos.y, pos.z)); 222 | } 223 | 224 | var spline = new THREE.CatmullRomCurve3(points); 225 | var _class = "" + lat1 + lon1 + lat2 + lon2; 226 | 227 | if (origins[_class]) { 228 | // Make it bigger now :) 229 | var size = origins[_class].material.size; 230 | if (size < config.OriginDefaultSize*2) { 231 | size = config.OriginDefaultSize; 232 | } else if (size > config.OriginMaximumSize*2) { 233 | size = config.OriginMaximumSize*2; 234 | } else { 235 | size += config.OriginDefaultSize*4; 236 | } 237 | origins[_class].material.size = size; 238 | } else { 239 | var originGeometry = new THREE.Geometry(); 240 | originGeometry.vertices.push(points[0]); 241 | var originMaterial = new THREE.PointsMaterial({ 242 | color: color, 243 | size: config.OriginDefaultSize*4, 244 | map: textureLoader.load("/plugins/mapster/img/particle.png"), 245 | depthWrite: false, 246 | blending: THREE.AdditiveBlending, 247 | transparent: true 248 | }); 249 | var originMesh = new THREE.Points(originGeometry, originMaterial); 250 | scene.add(originMesh); 251 | origins[_class] = originMesh; 252 | } 253 | 254 | /* Add alternate points */ 255 | var num_coords = MAX_POINTS * 3; 256 | var geometry = new THREE.BufferGeometry(); 257 | var positions = new Float32Array(num_coords); 258 | 259 | for (i = 0; i < num_coords; i += 3) { 260 | pos = spline.getPoint(i / num_coords); 261 | positions[i] = pos.x; 262 | positions[i + 1] = pos.y; 263 | positions[i + 2] = pos.z; 264 | } 265 | 266 | geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); 267 | geometry.setDrawRange(0, 1); 268 | 269 | var material = new THREE.LineBasicMaterial({color: color, linewidth: 2}); 270 | var line = new THREE.Line(geometry, material); 271 | line.name = "line"; 272 | scene.add(line); 273 | }, diff); 274 | } 275 | 276 | function showSpecialEvent(lat1, lon1, lat2, lon2, radius, color, diff) { 277 | // TODO You can surely optimize and refactor this :) 278 | $timeout(function () { 279 | var num_control_points = 8; 280 | var dist = getDistance(lat1, lon1, lat2, lon2); 281 | var max_altitude = 30 / (sphereRadius * 2) * dist; // The longuest the highest 282 | max_altitude = max_altitude + (Math.random() - 0.5) * (max_altitude / 2); // Add some randomness above and below 283 | 284 | var points = []; 285 | var i; 286 | var pos; 287 | for (i = 0; i < num_control_points + 1; i++) { 288 | var arc_angle = i * 180.0 / num_control_points; 289 | var arc_radius = radius + (Math.sin(THREE.Math.degToRad(arc_angle))) * max_altitude; 290 | var latlng = latlngInterPoint(lat1, lon1, lat2, lon2, i / num_control_points); 291 | pos = latlngPosFromLatLng(latlng.lat, latlng.lng, arc_radius); 292 | 293 | points.push(new THREE.Vector3(pos.x, pos.y, pos.z)); 294 | } 295 | 296 | var spline = new THREE.CatmullRomCurve3(points); 297 | 298 | /* Add alternate points */ 299 | var num_coords = MAX_POINTS * 3; 300 | var geometry = new THREE.BufferGeometry(); 301 | var positions = new Float32Array(num_coords); 302 | 303 | for (i = 0; i < num_coords; i += 3) { 304 | pos = spline.getPoint(i / num_coords); 305 | positions[i] = pos.x; 306 | positions[i + 1] = pos.y; 307 | positions[i + 2] = pos.z; 308 | } 309 | 310 | geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); 311 | geometry.setDrawRange(0, 1); 312 | 313 | var material = new THREE.LineBasicMaterial({color: color, linewidth: 5}); 314 | var line = new THREE.Line(geometry, material); 315 | line.name = "line"; 316 | scene.add(line); 317 | }, diff); 318 | } 319 | 320 | /* Show the event in the log list */ 321 | function showEventLog(event, color, diff) { 322 | $timeout(function () { 323 | // Create new row 324 | var logs = document.getElementById("logs"); 325 | if (logs === null) { 326 | console.error("Logs table does not exists."); 327 | return; 328 | } 329 | var tr = logs.insertRow(); 330 | tr.innerHTML = ("" + moment(event.timestamp).format('YYYY-MM-DD HH:mm:ss') + "" + event.coords.lat + "," 331 | + event.coords.lon + "" + event.peer_ip + "" + event.sensor + ""); 332 | 333 | // Remove extra elements 334 | if (logs.children.length >= config.maximumEvents) { 335 | logs.deleteRow(0); 336 | } 337 | }, diff); 338 | } 339 | 340 | function renderEvents(list, colors) { 341 | if (list === null || typeof list == "undefined") { 342 | return; 343 | } 344 | 345 | /* Tmp */ 346 | var f = list[0]["timestamp"]; 347 | f = new Date(f); // Remove the +02 348 | var l = list[list.length - 1]["timestamp"]; 349 | l = new Date(l); // Remove the +02 350 | var wsize = l - f; 351 | console.log("Window time size:", wsize); 352 | /* Tmp */ 353 | 354 | var RefDate = new Date(list[0]["timestamp"]); 355 | var LastDate = RefDate; 356 | var count = 0; 357 | var index = 0; 358 | 359 | for (var i = 0; i < list.length; i++) { 360 | var date = new Date(list[i]["timestamp"]); 361 | 362 | /* Count should be at 0 when the condition is triggered */ 363 | if (date > LastDate) { 364 | LastDate = date; 365 | index = 0; 366 | } 367 | 368 | /* Recount events with same timestamp */ 369 | if (count === 0) { 370 | for (var j = i; j < list.length - 1; j++) { 371 | if (new Date(list[j]["timestamp"]) > LastDate) { 372 | break; 373 | } 374 | count++; 375 | } 376 | } 377 | 378 | /* Make events with same timestamp appear smoothly/distributively on 1 second */ 379 | var diff = date - RefDate; 380 | diff = diff + 1000 / count * index; 381 | 382 | var color = colors[list[i]["sensor"]].color; 383 | var coords = list[i]["coords"]; 384 | 385 | /* Should we display unlocated events ? */ 386 | if ($.inArray(list[i]["sensor"], config.SpecialEffects) > -1) { 387 | showSpecialEvent(config.TargetCoords[0], config.TargetCoords[1], coords.lat, coords.lon, sphereRadius, color, diff); 388 | showEventLog(list[i], color, diff); 389 | } else { 390 | if (config.HideUnlocated) { 391 | var unlocated = (coords.lat | 0) === 0 && (coords.lon | 0) === 0; 392 | if (!unlocated) { 393 | showEvent(coords.lat, coords.lon, config.TargetCoords[0], config.TargetCoords[1], sphereRadius, color, diff); 394 | showEventLog(list[i], color, diff); 395 | } 396 | } else { 397 | showEvent(coords.lat, coords.lon, config.TargetCoords[0], config.TargetCoords[1], sphereRadius, color, diff); 398 | showEventLog(list[i], color, diff); 399 | } 400 | } 401 | index++; 402 | } 403 | } 404 | 405 | //TODO Move it in the render() one ? And rename render() to animate() ? 406 | function animateLines() { 407 | var lines = scene.children; 408 | for (var i = 0; i < lines.length; i++) { 409 | if (lines[i].name != "line") { 410 | continue; 411 | } 412 | 413 | var range = lines[i].geometry.drawRange; 414 | if (range.start >= MAX_POINTS - 1) { 415 | scene.remove(lines[i]); 416 | } else if (range.count >= MAX_POINTS) { 417 | lines[i].geometry.setDrawRange(range.start + 1, MAX_POINTS); 418 | } else { 419 | lines[i].geometry.setDrawRange(0, range.count + 1); 420 | } 421 | } 422 | } 423 | 424 | function animateOrigins() { 425 | for (var o in origins) { 426 | origins[o].material.size -= 0.05; 427 | if (origins[o].material.size <= 0) { 428 | // TODO Remove origins array use scene 429 | scene.remove(origins[o]); 430 | delete origins[o]; 431 | } 432 | } 433 | } 434 | 435 | function zoom(delta) { 436 | distanceTarget -= delta; 437 | distanceTarget = distanceTarget > 1000 ? 1000 : distanceTarget; 438 | distanceTarget = distanceTarget < 350 ? 350 : distanceTarget; 439 | } 440 | 441 | function onMouseDown(event) { 442 | event.preventDefault(); 443 | 444 | container.addEventListener('mousemove', onMouseMove, false); 445 | container.addEventListener('mouseup', onMouseUp, false); 446 | container.addEventListener('mouseout', onMouseOut, false); 447 | 448 | mouseOnDown.x = -event.clientX; 449 | mouseOnDown.y = event.clientY; 450 | 451 | targetOnDown.x = target.x; 452 | targetOnDown.y = target.y; 453 | 454 | container.style.cursor = 'move'; 455 | idleTime = 0; 456 | } 457 | 458 | function onMouseMove(event) { 459 | mouse.x = -event.clientX; 460 | mouse.y = event.clientY; 461 | 462 | var zoomDamp = distance / 1000; 463 | 464 | target.x = targetOnDown.x + (mouse.x - mouseOnDown.x) * 0.005 * zoomDamp; 465 | target.y = targetOnDown.y + (mouse.y - mouseOnDown.y) * 0.005 * zoomDamp; 466 | 467 | target.y = target.y > PI_HALF ? PI_HALF : target.y; 468 | target.y = target.y < -PI_HALF ? -PI_HALF : target.y; 469 | } 470 | 471 | function onMouseUp() { 472 | container.removeEventListener('mousemove', onMouseMove, false); 473 | container.removeEventListener('mouseup', onMouseUp, false); 474 | container.removeEventListener('mouseout', onMouseOut, false); 475 | container.style.cursor = 'auto'; 476 | } 477 | 478 | function onMouseOut() { 479 | container.removeEventListener('mousemove', onMouseMove, false); 480 | container.removeEventListener('mouseup', onMouseUp, false); 481 | container.removeEventListener('mouseout', onMouseOut, false); 482 | } 483 | 484 | function onMouseWheel(event) { 485 | event.preventDefault(); 486 | if (overRenderer) { 487 | /* Support for chrome and firefox */ 488 | var delta = event.wheelDeltaY ? event.wheelDeltaY * 0.3 : -event.detail * 10; 489 | zoom(delta); 490 | } 491 | return false; 492 | } 493 | 494 | function render() { 495 | requestAnimationFrame(render); 496 | zoom(0); 497 | 498 | if (idleTime > 150) { 499 | /* Auto rotate when idling */ 500 | rotation.x = (rotation.x + 0.005) % (2*Math.PI); 501 | rotation.y += (Math.PI / 6.0 - rotation.y) * 0.01; 502 | distance += (distanceTarget - distance) * 0.3; 503 | } else { 504 | /* Small rotation and zoom when creating the sphere + mouse move handle */ 505 | rotation.x += (target.x - rotation.x) * 0.1; 506 | rotation.y += (target.y - rotation.y) * 0.1; 507 | distance += (distanceTarget - distance) * 0.3; 508 | idleTime++; 509 | } 510 | 511 | camera.position.x = distance * Math.sin(rotation.x) * Math.cos(rotation.y); 512 | camera.position.y = distance * Math.sin(rotation.y); 513 | camera.position.z = distance * Math.cos(rotation.x) * Math.cos(rotation.y); 514 | 515 | camera.lookAt(sphere.position); 516 | 517 | animateLines(); 518 | animateOrigins(); 519 | renderer.render(scene, camera); 520 | } 521 | 522 | this.init = init; 523 | this.setConfig = setConfig; 524 | this.renderEvents = renderEvents; 525 | this.render = render; 526 | 527 | return this; 528 | }; 529 | 530 | module.exports = new Globe(); 531 | -------------------------------------------------------------------------------- /public/lib/latlon-geohash.js: -------------------------------------------------------------------------------- 1 | /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 2 | /* Geohash encoding/decoding and associated functions (c) Chris Veness 2014 / MIT Licence */ 3 | /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 4 | 5 | /* jshint node:true, bitwise:false *//* global define */ 6 | 'use strict'; 7 | 8 | 9 | /** 10 | * Geohash encode, decode, bounds, neighbours. 11 | * 12 | * @namespace 13 | */ 14 | var Geohash = {}; 15 | 16 | /* (Geohash-specific) Base32 map */ 17 | Geohash.base32 = '0123456789bcdefghjkmnpqrstuvwxyz'; 18 | 19 | /** 20 | * Encodes latitude/longitude to geohash, either to specified precision or to automatically 21 | * evaluated precision. 22 | * 23 | * @param {number} lat - Latitude in degrees. 24 | * @param {number} lon - Longitude in degrees. 25 | * @param {number} [precision] - Number of characters in resulting geohash. 26 | * @returns {string} Geohash of supplied latitude/longitude. 27 | * @throws Invalid geohash. 28 | * 29 | * @example 30 | * var geohash = Geohash.encode(52.205, 0.119, 7); // geohash: 'u120fxw' 31 | */ 32 | Geohash.encode = function(lat, lon, precision) { 33 | // infer precision? 34 | if (typeof precision == 'undefined') { 35 | // refine geohash until it matches precision of supplied lat/lon 36 | for (var p=1; p<=12; p++) { 37 | var hash = Geohash.encode(lat, lon, p); 38 | var posn = Geohash.decode(hash); 39 | if (posn.lat==lat && posn.lon==lon) return hash; 40 | } 41 | precision = 12; // set to maximum 42 | } 43 | 44 | lat = Number(lat); 45 | lon = Number(lon); 46 | precision = Number(precision); 47 | 48 | if (isNaN(lat) || isNaN(lon) || isNaN(precision)) throw new Error('Invalid geohash'); 49 | 50 | var idx = 0; // index into base32 map 51 | var bit = 0; // each char holds 5 bits 52 | var evenBit = true; 53 | var geohash = ''; 54 | 55 | var latMin = -90, latMax = 90; 56 | var lonMin = -180, lonMax = 180; 57 | 58 | while (geohash.length < precision) { 59 | if (evenBit) { 60 | // bisect E-W longitude 61 | var lonMid = (lonMin + lonMax) / 2; 62 | if (lon > lonMid) { 63 | idx = idx*2 + 1; 64 | lonMin = lonMid; 65 | } else { 66 | idx = idx*2; 67 | lonMax = lonMid; 68 | } 69 | } else { 70 | // bisect N-S latitude 71 | var latMid = (latMin + latMax) / 2; 72 | if (lat > latMid) { 73 | idx = idx*2 + 1; 74 | latMin = latMid; 75 | } else { 76 | idx = idx*2; 77 | latMax = latMid; 78 | } 79 | } 80 | evenBit = !evenBit; 81 | 82 | if (++bit == 5) { 83 | // 5 bits gives us a character: append it and start over 84 | geohash += Geohash.base32.charAt(idx); 85 | bit = 0; 86 | idx = 0; 87 | } 88 | } 89 | 90 | return geohash; 91 | }; 92 | 93 | 94 | /** 95 | * Decode geohash to latitude/longitude (location is approximate centre of geohash cell, 96 | * to reasonable precision). 97 | * 98 | * @param {string} geohash - Geohash string to be converted to latitude/longitude. 99 | * @returns {{lat:number, lon:number}} (Center of) geohashed location. 100 | * @throws Invalid geohash. 101 | * 102 | * @example 103 | * var latlon = Geohash.decode('u120fxw'); // latlon: { lat: 52.205, lon: 0.1188 } 104 | */ 105 | Geohash.decode = function(geohash) { 106 | 107 | var bounds = Geohash.bounds(geohash); // <-- the hard work 108 | // now just determine the centre of the cell... 109 | 110 | var latMin = bounds.sw.lat, lonMin = bounds.sw.lon; 111 | var latMax = bounds.ne.lat, lonMax = bounds.ne.lon; 112 | 113 | // cell centre 114 | var lat = (latMin + latMax)/2; 115 | var lon = (lonMin + lonMax)/2; 116 | 117 | // round to close to centre without excessive precision: ⌊2-log10(Δ°)⌋ decimal places 118 | lat = lat.toFixed(Math.floor(2-Math.log(latMax-latMin)/Math.LN10)); 119 | lon = lon.toFixed(Math.floor(2-Math.log(lonMax-lonMin)/Math.LN10)); 120 | 121 | return { lat: Number(lat), lon: Number(lon) }; 122 | }; 123 | 124 | 125 | /** 126 | * Returns SW/NE latitude/longitude bounds of specified geohash. 127 | * 128 | * @param {string} geohash - Cell that bounds are required of. 129 | * @returns {{sw: {lat: number, lon: number}, ne: {lat: number, lon: number}}} 130 | * @throws Invalid geohash. 131 | */ 132 | Geohash.bounds = function(geohash) { 133 | if (geohash.length === 0) throw new Error('Invalid geohash'); 134 | 135 | geohash = geohash.toLowerCase(); 136 | 137 | var evenBit = true; 138 | var latMin = -90, latMax = 90; 139 | var lonMin = -180, lonMax = 180; 140 | 141 | for (var i=0; i=0; n--) { 147 | var bitN = idx >> n & 1; 148 | if (evenBit) { 149 | // longitude 150 | var lonMid = (lonMin+lonMax) / 2; 151 | if (bitN == 1) { 152 | lonMin = lonMid; 153 | } else { 154 | lonMax = lonMid; 155 | } 156 | } else { 157 | // latitude 158 | var latMid = (latMin+latMax) / 2; 159 | if (bitN == 1) { 160 | latMin = latMid; 161 | } else { 162 | latMax = latMid; 163 | } 164 | } 165 | evenBit = !evenBit; 166 | } 167 | } 168 | 169 | var bounds = { 170 | sw: { lat: latMin, lon: lonMin }, 171 | ne: { lat: latMax, lon: lonMax } 172 | }; 173 | 174 | return bounds; 175 | }; 176 | 177 | 178 | /** 179 | * Determines adjacent cell in given direction. 180 | * 181 | * @param geohash - Cell to which adjacent cell is required. 182 | * @param direction - Direction from geohash (N/S/E/W). 183 | * @returns {string} Geocode of adjacent cell. 184 | * @throws Invalid geohash. 185 | */ 186 | Geohash.adjacent = function(geohash, direction) { 187 | // based on github.com/davetroy/geohash-js 188 | 189 | geohash = geohash.toLowerCase(); 190 | direction = direction.toLowerCase(); 191 | 192 | if (geohash.length === 0) throw new Error('Invalid geohash'); 193 | if ('nsew'.indexOf(direction) == -1) throw new Error('Invalid direction'); 194 | 195 | var neighbour = { 196 | n: [ 'p0r21436x8zb9dcf5h7kjnmqesgutwvy', 'bc01fg45238967deuvhjyznpkmstqrwx' ], 197 | s: [ '14365h7k9dcfesgujnmqp0r2twvyx8zb', '238967debc01fg45kmstqrwxuvhjyznp' ], 198 | e: [ 'bc01fg45238967deuvhjyznpkmstqrwx', 'p0r21436x8zb9dcf5h7kjnmqesgutwvy' ], 199 | w: [ '238967debc01fg45kmstqrwxuvhjyznp', '14365h7k9dcfesgujnmqp0r2twvyx8zb' ] 200 | }; 201 | var border = { 202 | n: [ 'prxz', 'bcfguvyz' ], 203 | s: [ '028b', '0145hjnp' ], 204 | e: [ 'bcfguvyz', 'prxz' ], 205 | w: [ '0145hjnp', '028b' ] 206 | }; 207 | 208 | var lastCh = geohash.slice(-1); // last character of hash 209 | var parent = geohash.slice(0, -1); // hash without last character 210 | 211 | var type = geohash.length % 2; 212 | 213 | // check for edge-cases which don't share common prefix 214 | if (border[direction][type].indexOf(lastCh) != -1 && parent !== '') { 215 | parent = Geohash.adjacent(parent, direction); 216 | } 217 | 218 | // append letter for direction to parent 219 | return parent + Geohash.base32.charAt(neighbour[direction][type].indexOf(lastCh)); 220 | }; 221 | 222 | 223 | /** 224 | * Returns all 8 adjacent cells to specified geohash. 225 | * 226 | * @param {string} geohash - Geohash neighbours are required of. 227 | * @returns {{n,ne,e,se,s,sw,w,nw: string}} 228 | * @throws Invalid geohash. 229 | */ 230 | Geohash.neighbours = function(geohash) { 231 | return { 232 | 'n': Geohash.adjacent(geohash, 'n'), 233 | 'ne': Geohash.adjacent(Geohash.adjacent(geohash, 'n'), 'e'), 234 | 'e': Geohash.adjacent(geohash, 'e'), 235 | 'se': Geohash.adjacent(Geohash.adjacent(geohash, 's'), 'e'), 236 | 's': Geohash.adjacent(geohash, 's'), 237 | 'sw': Geohash.adjacent(Geohash.adjacent(geohash, 's'), 'w'), 238 | 'w': Geohash.adjacent(geohash, 'w'), 239 | 'nw': Geohash.adjacent(Geohash.adjacent(geohash, 'n'), 'w') 240 | }; 241 | }; 242 | 243 | 244 | /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 245 | if (typeof module != 'undefined' && module.exports) module.exports = Geohash; // CommonJS, node.js 246 | if (typeof define == 'function' && define.amd) define([], function() { return Geohash; }); // AMD 247 | -------------------------------------------------------------------------------- /public/lib/map.js: -------------------------------------------------------------------------------- 1 | var _ = require("lodash"); 2 | var $ = require("jquery"); 3 | var moment = require("moment"); 4 | var d3 = require("d3"); 5 | 6 | var Map = function () { 7 | /* Attributes */ 8 | var svg, projection, path, logs; 9 | var OriginDeath = []; 10 | var ObjectBox = null; 11 | var SpecialBox = null; 12 | var config; 13 | var $timeout; 14 | var map; 15 | 16 | function setConfig(c, t) { 17 | config = c; 18 | $timeout = t; 19 | } 20 | 21 | /* Revert lat/lon to lon/lat (math view vs world view) */ 22 | function getCoords(coords) { 23 | return [coords[1], coords[0]]; 24 | } 25 | 26 | /* Transform the object rotation/position etc. */ 27 | function delta(node) { 28 | var l = node.getTotalLength(); 29 | return function (i) { 30 | return function (t) { 31 | var p = node.getPointAtLength(t * l); 32 | var t2 = Math.min(t + 0.05, 1); 33 | var p2 = node.getPointAtLength(t2 * l); 34 | 35 | var x = p2.x - p.x; 36 | var y = p2.y - p.y; 37 | var r = config.ObjectRotation - Math.atan2(-y, x) * 180 / Math.PI; 38 | 39 | return "translate(" + p.x + "," + p.y + ") rotate(" + r + ")"; 40 | }; 41 | }; 42 | 43 | } 44 | 45 | /* Set a timeout to remove an origin */ 46 | function removeOrigin(origin, time, delay) { 47 | return $timeout(function () { 48 | origin.transition() 49 | .ease("linear") 50 | .attr("r", 0) 51 | .duration(time) 52 | .each("end", function () { 53 | // Remove IPs from OriginDeath array (free memory) 54 | var ClassIp = origin[0][0].classList[1]; 55 | delete OriginDeath[ClassIp]; 56 | }) 57 | .remove(); 58 | }, delay); 59 | } 60 | 61 | function removeExplosion(explosion, delay) { 62 | $timeout(function () { 63 | explosion.remove(); 64 | }, delay); 65 | } 66 | 67 | /* Set a timeout to display a specific event */ 68 | function showEvent(event, color, diff) { 69 | $timeout(function () { 70 | var coords = getCoords([event.coords.lat, event.coords.lon]); 71 | 72 | var ClassIp = "ip-" + event.peer_ip.replace(/\./g, "_"); 73 | var origin = d3.select("." + ClassIp); 74 | var size; 75 | 76 | if (origin[0][0]) { 77 | // Already exists, stop dying ! 78 | $timeout.cancel(OriginDeath[ClassIp]); 79 | delete OriginDeath[ClassIp]; 80 | 81 | // Make it bigger now :) 82 | size = parseInt(origin.attr("r")); 83 | if (size < config.OriginDefaultSize / 2) { 84 | size = config.OriginDefaultSize; 85 | } else if (size > config.OriginMaximumSize) { 86 | size = config.OriginMaximumSize; 87 | } else { 88 | size += config.OriginDefaultSize; 89 | } 90 | 91 | origin.attr("r", size); 92 | } else { 93 | // Create origin 94 | origin = svg.append("circle") 95 | .attr("r", config.OriginDefaultSize) 96 | .attr("cx", projection(coords)[0]) 97 | .attr("cy", projection(coords)[1]) 98 | .attr("class", "origin " + ClassIp) 99 | .style("fill", color) 100 | .style("stroke", "#333") 101 | .style("stroke-width", 1); 102 | size = parseInt(origin.attr("r")); 103 | } 104 | 105 | // Create a halo 106 | var halo = svg.append("circle") 107 | .attr("r", config.OriginDefaultSize) 108 | .attr("cx", projection(coords)[0]) 109 | .attr("cy", projection(coords)[1]) 110 | .attr("class", "halo " + ClassIp); 111 | 112 | // Make the halo grow and disappear 113 | halo.transition() 114 | .duration(2000) 115 | .attr("r", config.OriginDefaultSize * 4) 116 | .ease("linear") 117 | .each("end", function () { 118 | var halo = d3.select(this); 119 | halo.transition() 120 | .ease("linear") 121 | .duration(1000) 122 | .attr("r", config.OriginDefaultSize * 5) 123 | .style("opacity", 0) 124 | .remove(); 125 | }); 126 | 127 | // Make the origin die slowly 128 | var time = config.OriginDyingTime * size / config.OriginDefaultSize * 1000; 129 | OriginDeath[ClassIp] = removeOrigin(origin, time, 0); 130 | 131 | // Draw the path and the object 132 | if (config.multipleTargets) { 133 | var targetCoords = getCoords([event.target.lat, event.target.lon]); 134 | } else { 135 | var targetCoords = getCoords(config.TargetCoords); 136 | } 137 | if (ObjectBox !== null) { 138 | var route = svg.append("path") 139 | .datum({type: "LineString", coordinates: [coords, targetCoords]}) 140 | .style("stroke", color) 141 | .attr("class", "route") 142 | .attr("d", path); 143 | 144 | var width = config.ObjectScale * ObjectBox.width / -2; 145 | var height = config.ObjectScale * ObjectBox.height / -2; 146 | 147 | // Container is used to move origin to the center of the object 148 | var container = svg.append("g"); 149 | var object = container.append("path") 150 | .style("fill", color) 151 | .style("stroke", "black") 152 | .style("stroke-width", 1) 153 | .attr("transform", "translate(" + width + "," + height + ") scale(" + config.ObjectScale + ")") 154 | .attr("d", config.ObjectShape); 155 | 156 | var duration = 2000; 157 | 158 | // Animate the route 159 | var MaxLength = route.node().getTotalLength(); 160 | route.transition() 161 | .duration(duration) 162 | .attrTween("stroke-dasharray", function () { 163 | var i = d3.interpolateString("0," + MaxLength, MaxLength + "," + MaxLength); 164 | return function (t) { 165 | return i(t); 166 | }; 167 | }) 168 | .transition() 169 | .duration(duration * 0.4) 170 | .ease("linear") 171 | .attrTween("stroke-dasharray", function () { 172 | var i = d3.interpolateString(MaxLength + "," + MaxLength, "0," + MaxLength); 173 | return function (t) { 174 | return i(t); 175 | }; 176 | }) 177 | .attrTween("stroke-dashoffset", function () { 178 | return function (t) { 179 | return (1 - t) * MaxLength - MaxLength; 180 | }; 181 | }) 182 | .remove(); 183 | 184 | // Animate the object 185 | container.transition() 186 | .duration(duration) 187 | .attrTween("transform", delta(route.node())) 188 | .remove(); 189 | 190 | } 191 | }, diff); 192 | } 193 | 194 | function showSpecialEvent(event, diff) { 195 | $timeout(function () { 196 | var coords = getCoords([event.coords.lat, event.coords.lon]); 197 | 198 | // Draw the path and the object 199 | if (config.multipleTargets) { 200 | var targetCoords = getCoords([event.target.lat, event.target.lon]); 201 | } else { 202 | var targetCoords = getCoords(config.TargetCoords); 203 | } 204 | if (ObjectBox !== null) { 205 | var route = svg.append("path") 206 | .datum({type: "LineString", coordinates: [targetCoords, coords]}) 207 | .attr("class", "route") 208 | .attr("d", path); 209 | 210 | var width = config.SpecialEffectsScale * ObjectBox.width / -2; 211 | var height = config.SpecialEffectsScale * ObjectBox.height / -2; 212 | 213 | // Container is used to move origin to the center of the object 214 | var container = svg.append("g"); 215 | var object = container.append("path") 216 | .style("fill", "orange") 217 | .style("stroke", "black") 218 | .style("stroke-width", 1) 219 | .attr("transform", "translate(" + width + "," + height + ") scale(" + config.SpecialEffectsScale + ")") 220 | .attr("d", config.ObjectShape); 221 | 222 | // Animate the object 223 | var PathDuration = 4000; 224 | container.transition() 225 | .ease("linear") 226 | .duration(PathDuration) 227 | .attrTween("transform", delta(route.node())) 228 | .remove(); 229 | 230 | } 231 | 232 | var ClassIp = "ban_ip-" + event.peer_ip.replace(/\./g, "_"); 233 | 234 | $timeout(function () { 235 | // Create origin cross 236 | var width = config.SpecialShapeScale * SpecialBox.width / -2; 237 | var height = config.SpecialShapeScale * SpecialBox.height / -2; 238 | 239 | // Container is used to move origin to the center of the object 240 | var container = svg.append("g"); 241 | var origin = container.append("path") 242 | .style("fill", "red") 243 | .style("stroke", "black") 244 | .style("stroke-width", 1) 245 | .attr("transform", "translate(" + width + "," + height + ") scale(" + config.SpecialShapeScale + ")") 246 | .attr("d", config.SpecialShape); 247 | container.attr("transform", "translate(" + projection(coords)[0] + "," + projection(coords)[1] + ")"); 248 | 249 | // Create a halo 250 | var halo = svg.append("circle") 251 | .attr("r", 10) 252 | .style("stroke", "red") 253 | .style("stroke-width", 2) 254 | .attr("cx", projection(coords)[0]) 255 | .attr("cy", projection(coords)[1]) 256 | .attr("class", "halo " + ClassIp); 257 | 258 | // Make the halo grow and disappear 259 | halo.transition() 260 | .duration(3000) 261 | .attr("r", 25) 262 | .ease("linear") 263 | .each("end", function () { 264 | var halo = d3.select(this); 265 | halo.transition() 266 | .ease("linear") 267 | .duration(1000) 268 | .attr("r", 30) 269 | .style("opacity", 0) 270 | .remove(); 271 | }); 272 | 273 | // Tell it to die in the future 274 | OriginDeath[ClassIp] = removeOrigin(origin, 5000, config.SpecialShapeRemaining); 275 | 276 | // Create explosion 277 | if (config.EnableExplosion) { 278 | var explosion = svg.append("svg:image") 279 | .attr("class", "explosion") 280 | .attr("xlink:href", "/plugins/mapster/img/" + config.ExplosionFile + "?" + Date.now()) // ?param is a little trick to force gif to reload 281 | .attr("width", config.ExplosionWidth) 282 | .attr("height", config.ExplosionHeight) 283 | .attr("x", projection(coords)[0] - config.ExplosionWidth / 2) 284 | .attr("y", projection(coords)[1] - config.ExplosionHeight); 285 | removeExplosion(explosion, config.ExplosionDelay); 286 | } 287 | 288 | // Remove route 289 | route.remove(); 290 | }, PathDuration); 291 | 292 | }, diff); 293 | } 294 | 295 | /* Show the event in the log list */ 296 | function showEventLog(event, color, diff) { 297 | $timeout(function () { 298 | // Create new row 299 | var tr = logs.append("tr"); 300 | tr.html("" + moment(event.timestamp).format('YYYY-MM-DD HH:mm:ss') + "" + event.coords.lat + "," 301 | + event.coords.lon + "" + event.peer_ip + "" + event.sensor + ""); 302 | 303 | // Remove extra elements 304 | var l = logs[0][0]; 305 | if (l.children.length >= config.maximumEvents) { 306 | l.deleteRow(0); 307 | } 308 | }, diff); 309 | } 310 | 311 | 312 | /* Render events in the data scope */ 313 | function renderEvents(list, colors) { 314 | if (list === null || typeof list == "undefined") { 315 | return; 316 | } 317 | 318 | /* Tmp */ 319 | var f = list[0]["timestamp"]; 320 | f = new Date(f); // Remove the +02 321 | var l = list[list.length - 1]["timestamp"]; 322 | l = new Date(l); // Remove the +02 323 | var wsize = l - f; 324 | console.log("Window time size:", wsize); 325 | /* Tmp */ 326 | 327 | var RefDate = new Date(list[0]["timestamp"]); 328 | var LastDate = RefDate; 329 | var count = 0; 330 | var index = 0; 331 | 332 | for (var i = 0; i < list.length; i++) { 333 | var date = new Date(list[i]["timestamp"]); 334 | 335 | /* Count should be at 0 when the condition is triggered */ 336 | if (date > LastDate) { 337 | LastDate = date; 338 | index = 0; 339 | } 340 | 341 | /* Recount events with same timestamp */ 342 | if (count === 0) { 343 | for (var j = i; j < list.length - 1; j++) { 344 | if (new Date(list[j]["timestamp"]) > LastDate) { 345 | break; 346 | } 347 | count++; 348 | } 349 | } 350 | 351 | /* Make events with same timestamp appear smoothly/distributively on 1 second */ 352 | // TODO Improve this (it pauses before switching to another second 353 | var diff = date - RefDate; 354 | diff = diff + 1000 / count * index; 355 | 356 | var color = colors[list[i]["sensor"]].color; 357 | 358 | if ($.inArray(list[i]["sensor"], config.SpecialEffects) > -1) { 359 | showSpecialEvent(list[i], diff); 360 | showEventLog(list[i], color, diff); 361 | } else { 362 | /* Should we display unlocated events ? */ 363 | if (config.HideUnlocated) { 364 | var coords = list[i]["coords"]; 365 | var unlocated = (coords.lat | 0) === 0 && (coords.lon | 0) === 0; 366 | if (!unlocated) { 367 | showEvent(list[i], color, diff); 368 | showEventLog(list[i], color, diff); 369 | } 370 | } else { 371 | showEvent(list[i], color, diff); 372 | showEventLog(list[i], color, diff); 373 | } 374 | } 375 | index++; 376 | } 377 | } 378 | 379 | function init(container) { 380 | /* TODO Merge with render ? */ 381 | if (container === null || typeof container == "undefined") { 382 | console.error("Could not draw the map, the container is missing !"); 383 | return; 384 | } 385 | 386 | container.css({ 387 | height: container.parent().height(), 388 | width: "100%" 389 | }); 390 | 391 | var height = container.height(); 392 | var width = container.width(); 393 | 394 | var scale = (height / 300) * 100; 395 | 396 | projection = d3.geo.equirectangular() 397 | .scale(scale) 398 | .translate([width / 2, height / 2]); 399 | 400 | path = d3.geo.path() 401 | .projection(projection); 402 | 403 | svg = d3.select("mapster").append("svg") 404 | .attr("width", "100%") 405 | .attr("height", "99%"); 406 | 407 | /* Declare svg elem to make objects appear above the map */ 408 | map = svg.append("svg") 409 | .attr("width", container.parent().width()) 410 | .attr("height", container.parent().height()); 411 | 412 | /* Draw a sample object to get its size */ 413 | var object = svg.append("path") 414 | .attr("d", config.ObjectShape); 415 | ObjectBox = object.node().getBBox(); 416 | object.remove(); 417 | 418 | /* Draw a sample special object to get its size */ 419 | var special = svg.append("path") 420 | .attr("d", config.SpecialShape); 421 | SpecialBox = special.node().getBBox(); 422 | special.remove(); 423 | } 424 | 425 | /* Render the map */ 426 | function render() { 427 | /* Draw d3 map */ 428 | /* The first "/" in the url below is required to really access http://url/plugins/... and not app/plugins */ 429 | d3.json("/plugins/mapster/lib/map.topo.json", function (error, world) { 430 | var countries = require("plugins/mapster/lib/topojson.min.js").feature(world, world.objects.collection).features; 431 | map.selectAll(".country") 432 | .data(countries) 433 | .enter() 434 | .append("path") 435 | .attr("class", "country") 436 | .attr("d", path); 437 | }); 438 | 439 | /* Get log table */ 440 | logs = d3.select("#logs"); 441 | } 442 | 443 | this.init = init; 444 | this.setConfig = setConfig; 445 | this.renderEvents = renderEvents; 446 | this.render = render; 447 | 448 | return this; 449 | }; 450 | 451 | module.exports = new Map(); 452 | -------------------------------------------------------------------------------- /public/lib/map.topo.json: -------------------------------------------------------------------------------- 1 | {"type":"Topology","objects":{"collection":{"type":"GeometryCollection","geometries":[{"type":"Polygon","arcs":[[0,1,2,3,4]]},{"type":"Polygon","arcs":[[5,6,7,8,9]]},{"type":"Polygon","arcs":[[10,11,12,13,14,15]]},{"type":"Polygon","arcs":[[16,17,18]]},{"type":"MultiPolygon","arcs":[[[19,-4]],[[20,21,-2,22,23]]]},{"type":"Polygon","arcs":[[24,25]]},{"type":"Polygon","arcs":[[26,27]]},{"type":"Polygon","arcs":[[28,29]]},{"type":"MultiPolygon","arcs":[[[30]],[[31,32,33,34,35,36,-28,37,38,39,40,-14,41,42,43,44,45,46]]]},{"type":"Polygon","arcs":[[47,-30]]},{"type":"Polygon","arcs":[[48,49,-23,-1,50]]},{"type":"MultiPolygon","arcs":[[[51]],[[52,53]],[[54]],[[55]],[[56]],[[57]],[[58]],[[59]],[[60,61]],[[62]],[[63]],[[64,65]],[[66]]]},{"type":"Polygon","arcs":[[-40,67,-38,-27,-37,68,-19,69,70]]},{"type":"Polygon","arcs":[[71,-16,72,73,74,75,-20,-3,-22,76]]},{"type":"Polygon","arcs":[[77,78,79,80,81,82,-75]]},{"type":"Polygon","arcs":[[83,84,85,86,87,88,89]]},{"type":"Polygon","arcs":[[-84,90,-81,91,92,-86,93]]},{"type":"MultiPolygon","arcs":[[[94]],[[95]],[[96]]]},{"type":"Polygon","arcs":[[97,98,99,100,-44,101]]},{"type":"Polygon","arcs":[[-102,-43,102,103]]},{"type":"Polygon","arcs":[[104,105,106,107]]},{"type":"Polygon","arcs":[[108,109,-79]]},{"type":"Polygon","arcs":[[110,111]]},{"type":"Polygon","arcs":[[112,113,-35,114,-106]]},{"type":"Polygon","arcs":[[115]]},{"type":"Polygon","arcs":[[-89,116,117]]},{"type":"Polygon","arcs":[[118,-46]]},{"type":"MultiPolygon","arcs":[[[119,120]],[[-65,121,-26,122]]]},{"type":"Polygon","arcs":[[123,-17,-69,-36,-114,124]]},{"type":"Polygon","arcs":[[-68,-39]]},{"type":"MultiPolygon","arcs":[[[125,126,-9,127]],[[-7,128]]]},{"type":"Polygon","arcs":[[-41,-71,129,-73,-15]]},{"type":"MultiPolygon","arcs":[[[130]],[[131]],[[132]],[[133]],[[134]],[[135]],[[136]]]},{"type":"Polygon","arcs":[[137,138,-112,139,-32]]},{"type":"Polygon","arcs":[[-94,-85]]},{"type":"Polygon","arcs":[[140,141]]},{"type":"Polygon","arcs":[[142,-92,-80,-110,143,-142,144,-10,-127,145]]},{"type":"Polygon","arcs":[[-91,-90,-118,146,147,-82]]},{"type":"Polygon","arcs":[[148,-121,149,-125,-113,-105]]},{"type":"Polygon","arcs":[[-103,-42,-13,150]]},{"type":"Polygon","arcs":[[-72,151,-99,152,-11]]},{"type":"Polygon","arcs":[[153,-53]]},{"type":"MultiPolygon","arcs":[[[-51,-5,-76,-83,-148,154]],[[155,156,157]]]},{"type":"Polygon","arcs":[[158]]},{"type":"Polygon","arcs":[[-153,-98,-104,-151,-12]]},{"type":"Polygon","arcs":[[159,-107,-115,-34]]},{"type":"Polygon","arcs":[[160,-146,-126]]},{"type":"MultiPolygon","arcs":[[[161,162]],[[163,164,165,166,167,168]]]},{"type":"Polygon","arcs":[[169,170,171,172,-169]]},{"type":"Polygon","arcs":[[-165,173,-172,174,175,176,177,178,179,180,181]]},{"type":"MultiPolygon","arcs":[[[-162,182]],[[-168,183,184,-170]]]},{"type":"Polygon","arcs":[[185,186,187,188,189,-176,190]]},{"type":"Polygon","arcs":[[191,-186,192]]},{"type":"Polygon","arcs":[[193]]},{"type":"Polygon","arcs":[[194,195,-178,196]]},{"type":"Polygon","arcs":[[-173,-174,-164]]},{"type":"Polygon","arcs":[[-185,197,-193,-191,-175,-171]]},{"type":"Polygon","arcs":[[198,199,200,-179,-196]]},{"type":"Polygon","arcs":[[-182,201,-166]]},{"type":"Polygon","arcs":[[202,-197,-177,-190]]},{"type":"MultiPolygon","arcs":[[[203]],[[204]],[[205]]]},{"type":"Polygon","arcs":[[206,207,208]]},{"type":"MultiPolygon","arcs":[[[209]],[[210]],[[211]],[[212]],[[213]],[[214]],[[215]],[[216]],[[217]],[[218]],[[219,220,221,222]],[[223]],[[224]],[[225]],[[226]],[[227]],[[228]],[[229]],[[230]],[[231]],[[232]],[[233]],[[234]],[[235]],[[236]],[[237]],[[238]],[[239]],[[240]],[[241]]]},{"type":"Polygon","arcs":[[242,243,244,245]]},{"type":"Polygon","arcs":[[246]]},{"type":"Polygon","arcs":[[247,248]]},{"type":"Polygon","arcs":[[249]]},{"type":"Polygon","arcs":[[250,251,-209,252,253,254]]},{"type":"Polygon","arcs":[[255,256,-254,257,258]]},{"type":"Polygon","arcs":[[-249,259]]},{"type":"Polygon","arcs":[[260]]},{"type":"Polygon","arcs":[[261,-207,-252,262,263]]},{"type":"Polygon","arcs":[[264,-259,265,-244]]},{"type":"Polygon","arcs":[[266,-246,267,-188]]},{"type":"Polygon","arcs":[[268]]},{"type":"Polygon","arcs":[[269,-255,-257]]},{"type":"Polygon","arcs":[[270]]},{"type":"MultiPolygon","arcs":[[[271]],[[272]],[[273]],[[274]],[[275]],[[276,-264,277,-220]],[[278]],[[279]],[[280]],[[-222,281]]]},{"type":"MultiPolygon","arcs":[[[282,283,284,285]],[[286,287,288]]]},{"type":"Polygon","arcs":[[289,290,291]]},{"type":"Polygon","arcs":[[292,293,294,295,296]]},{"type":"Polygon","arcs":[[297,298,299,-295,300,301]]},{"type":"Polygon","arcs":[[302,303,304,305]]},{"type":"Polygon","arcs":[[306,307,308,309,310,311,312]]},{"type":"Polygon","arcs":[[313,314,315,316,-298,317]]},{"type":"Polygon","arcs":[[318,319,320,321,322,323,-313,324]]},{"type":"Polygon","arcs":[[325,326,-290,327,328,-286,329,-289,330,-311,331]]},{"type":"Polygon","arcs":[[-288,332,333,-325,-312,-331]]},{"type":"Polygon","arcs":[[334,335,336,337]]},{"type":"Polygon","arcs":[[338,339,340,341,342,343,344,345]]},{"type":"Polygon","arcs":[[346,347,348,349,-87]]},{"type":"Polygon","arcs":[[350,351,352,-338]]},{"type":"Polygon","arcs":[[-337,353,354,355,356,357,358,-351]]},{"type":"Polygon","arcs":[[359,360,361,362,363,364,-316]]},{"type":"Polygon","arcs":[[365,-318,-302,366]]},{"type":"Polygon","arcs":[[367,368,-319,-334]]},{"type":"Polygon","arcs":[[369,370]]},{"type":"Polygon","arcs":[[371,372,-363]]},{"type":"Polygon","arcs":[[373,-320,-369]]},{"type":"Polygon","arcs":[[374,375,376,377,-356,378]]},{"type":"Polygon","arcs":[[379,380,-360,-315]]},{"type":"Polygon","arcs":[[381,-346,382,383,-349,384,385]]},{"type":"Polygon","arcs":[[386]]},{"type":"Polygon","arcs":[[387]]},{"type":"Polygon","arcs":[[388,-340,389,-299,-317,-365,390]]},{"type":"Polygon","arcs":[[-343,391,392]]},{"type":"Polygon","arcs":[[393,394,395,396,397,398,399,400]]},{"type":"Polygon","arcs":[[401,402,403,-341,-389]]},{"type":"Polygon","arcs":[[-401,404,405]]},{"type":"Polygon","arcs":[[406,-284,407,-304,408]]},{"type":"Polygon","arcs":[[-300,-390,-339,-382,409,-323,410,-296]]},{"type":"Polygon","arcs":[[411,-297,-411,-322]]},{"type":"Polygon","arcs":[[412,-291,-327,413]]},{"type":"Polygon","arcs":[[-342,-404,414,-392]]},{"type":"Polygon","arcs":[[415,416,-308,417,-385,-348,418,-352,-359,419]]},{"type":"Polygon","arcs":[[420,-357,-378,421,-332,-310,422,-416]]},{"type":"Polygon","arcs":[[423,-402,-391,-364,-373,424,-371]]},{"type":"Polygon","arcs":[[425,-361,-381]]},{"type":"Polygon","arcs":[[-354,-336,426,427]]},{"type":"Polygon","arcs":[[-379,-355,-428,428]]},{"type":"Polygon","arcs":[[429,-397]]},{"type":"Polygon","arcs":[[-410,-386,-418,-307,-324]]},{"type":"Polygon","arcs":[[430,-367,-301,-294]]},{"type":"Polygon","arcs":[[-345,431,-383]]},{"type":"Polygon","arcs":[[-376,432,-394,-406,433,-328,-292,-413,434]]},{"type":"Polygon","arcs":[[-414,-326,-422,-377,-435]]},{"type":"Polygon","arcs":[[-409,-303,435,-398,-430,-396,436],[-387]]},{"type":"Polygon","arcs":[[-405,-400,437,-305,-408,-283,-329,-434]]},{"type":"Polygon","arcs":[[-436,-306,-438,-399]]},{"type":"MultiPolygon","arcs":[[[438]],[[439]]]},{"type":"MultiPolygon","arcs":[[[440]],[[441,442]],[[443,-443]]]},{"type":"Polygon","arcs":[[444]]},{"type":"MultiPolygon","arcs":[[[445]],[[446]]]},{"type":"MultiPolygon","arcs":[[[447]],[[448]],[[-61,449]],[[450]]]},{"type":"MultiPolygon","arcs":[[[451]],[[452]],[[453]],[[454]],[[455]]]},{"type":"MultiPolygon","arcs":[[[456]],[[457]]]},{"type":"Polygon","arcs":[[458,459,460,461,462]]},{"type":"Polygon","arcs":[[463,464,465,466,467,468,469]]},{"type":"Polygon","arcs":[[470,471,472,473,474]]},{"type":"Polygon","arcs":[[475,476,-157,477,478,479]]},{"type":"Polygon","arcs":[[480,481,482]]},{"type":"Polygon","arcs":[[483,484,485,486,487]]},{"type":"Polygon","arcs":[[-467,488,489,490]]},{"type":"Polygon","arcs":[[-469,491,492,493]]},{"type":"MultiPolygon","arcs":[[[494]],[[495,496]]]},{"type":"Polygon","arcs":[[497,498,-492,-468,-491,499,500,-472,501,502,-496]]},{"type":"Polygon","arcs":[[503,504,505,506]]},{"type":"Polygon","arcs":[[507,508,509]]},{"type":"Polygon","arcs":[[510,511,512,513]]},{"type":"MultiPolygon","arcs":[[[514,-200,515,-180]],[[516]],[[517,-500,-490,518,519,-505,520,-474]]]},{"type":"MultiPolygon","arcs":[[[521,522]],[[523]]]},{"type":"MultiPolygon","arcs":[[[524]],[[525,-460,526,-478,-156]]]},{"type":"Polygon","arcs":[[527,-483,528,529,530,531]]},{"type":"Polygon","arcs":[[-464,532,533,534,535,-532,536]]},{"type":"Polygon","arcs":[[537,-522]]},{"type":"Polygon","arcs":[[538]]},{"type":"MultiPolygon","arcs":[[[539]],[[540]],[[541,542,-519,-489,-466]]]},{"type":"Polygon","arcs":[[-463,543,544,545]]},{"type":"Polygon","arcs":[[546,547,548,-484,549]]},{"type":"Polygon","arcs":[[-501,-518,-473]]},{"type":"Polygon","arcs":[[550,-510,551,-485,-549]]},{"type":"Polygon","arcs":[[552,553]]},{"type":"Polygon","arcs":[[-546,554,-479,-527,-459]]},{"type":"Polygon","arcs":[[555,-529,-482,556,-544,-462]]},{"type":"Polygon","arcs":[[-502,-471,557]]},{"type":"MultiPolygon","arcs":[[[558,-514,559,560]],[[561]],[[562]],[[563]]]},{"type":"Polygon","arcs":[[-499,564,565,-550,-488,566,567,-493]]},{"type":"Polygon","arcs":[[-507,568]]},{"type":"Polygon","arcs":[[569,-554,570,571,-476,572,-535]]},{"type":"Polygon","arcs":[[-480,-555,-545,-557,-481,-528,-536,-573]]},{"type":"MultiPolygon","arcs":[[[573]],[[-566,574,-547]],[[575]],[[576]],[[577]],[[578]],[[579]],[[580]],[[581]],[[-138,-47,-119,-45,-101,582,-24,-50,583,584,-486,-552,-509,585,-511,-559,586,587]],[[588]],[[589]],[[590]]]},{"type":"Polygon","arcs":[[-568,591,-533,-470,-494]]},{"type":"Polygon","arcs":[[-465,-537,-531,592,-542]]},{"type":"Polygon","arcs":[[-560,-513,593]]},{"type":"Polygon","arcs":[[-585,594,-571,-553,-570,-534,-592,-567,-487]]}]}},"arcs":[[[6210,6944],[39,11]],[[6249,6955],[5,-19],[11,-13],[-6,-18],[15,-24],[-8,-23],[12,-20],[13,-11],[0,-50]],[[6291,6777],[-10,-2]],[[6281,6775],[-11,41],[0,11],[-12,0],[-9,20],[-5,-2]],[[6244,6845],[-11,21],[-21,17],[3,35],[-5,26]],[[6432,5734],[5,3],[1,-19],[22,11],[23,-2],[17,-2],[19,49],[20,46],[18,44]],[[6557,5864],[5,-25]],[[6562,5839],[4,-56]],[[6566,5783],[-14,-1],[-3,-46],[5,-10],[-12,-14],[0,-30],[-8,-30],[-1,-28]],[[6533,5624],[-6,-16],[-83,37],[-11,72],[-1,17]],[[6700,6553],[28,-27],[21,9],[6,33],[22,11],[15,21],[6,58],[23,14],[5,25],[13,-19],[8,-2]],[[6847,6676],[16,-1],[20,-15]],[[6883,6660],[9,-9],[20,23],[9,-13],[9,32],[17,-1],[4,11],[3,29],[12,24],[15,-16],[-3,-22],[9,-3],[-3,-61],[11,-23],[10,15],[12,7],[17,32],[19,-5],[29,0]],[[7082,6680],[5,-21]],[[7087,6659],[-16,-8],[-14,-13],[-32,-8],[-30,-15],[-16,-32],[6,-30],[4,-36],[-14,-30],[1,-28],[-8,-25],[-26,2],[11,-48],[-18,-18],[-12,-43],[2,-43],[-11,-21],[-10,7],[-22,-9],[-3,-20],[-20,0],[-16,-41],[-1,-61],[-36,-30],[-19,7],[-6,-16],[-16,9],[-28,-11],[-47,37]],[[6690,6135],[25,65],[-2,46],[-21,12],[-2,46],[-9,57],[12,40],[-12,10],[7,52],[12,90]],[[7573,5576],[0,-52],[-10,11],[2,-58]],[[7565,5477],[-8,38],[-1,36],[-6,35],[-11,42],[-26,3],[3,-30],[-9,-40],[-12,15],[-4,-14],[-8,8],[-11,7]],[[7472,5577],[-4,59],[-10,54],[5,43],[-17,19],[6,27],[18,26],[-20,38],[9,49],[22,-31],[14,-4],[2,-49],[26,-10],[26,1],[16,-13],[-13,-60],[-12,-4],[-9,-41],[16,-38],[4,46],[8,1],[14,-114]],[[6281,6775],[-19,9],[-14,33],[-4,28]],[[6349,6995],[15,-38],[14,-51],[13,-3],[8,-19],[-23,-6],[-5,-56],[-4,-25],[-11,-17],[1,-35]],[[6357,6745],[-7,-4],[-17,38],[10,35],[-9,21],[-10,-5],[-33,-53]],[[6249,6955],[6,12],[21,-21],[15,-4],[4,8],[-14,39],[7,10]],[[6288,6999],[8,-3],[19,-43],[13,-5],[4,18],[17,29]],[[8172,4318],[11,27],[23,39]],[[8206,4384],[-1,-35],[-2,-46],[-13,2],[-6,-24],[-12,37]],[[7546,5987],[12,-23],[-2,-44],[-23,-2],[-23,5],[-18,-11],[-25,27],[-1,14]],[[7466,5953],[19,54],[15,18],[20,-17],[14,-2],[12,-19]],[[5909,6516],[2,1],[4,17],[20,-1],[25,21],[-19,-30],[2,-14]],[[5943,6510],[-3,3],[-5,-6],[-4,2],[-2,-3],[0,7],[-2,5],[-6,1],[-7,-7],[-5,4]],[[8064,5334],[-24,-34],[-23,22],[0,62],[13,32],[31,20],[16,-1],[6,-28],[-12,-31],[-7,-42]],[[8628,7037],[-18,43],[-11,-41],[-43,-31],[4,-38],[-24,3],[-13,23],[-19,-51],[-30,-39],[-23,-46]],[[8451,6860],[-39,-21],[-20,-33],[-30,-20],[15,33],[-6,28],[22,49],[-15,37],[-24,-25],[-32,-50],[-17,-47],[-27,-3],[-14,-33],[15,-49],[22,-12],[1,-32],[22,-21],[31,51],[25,-28],[18,-2],[4,-37],[-39,-20],[-13,-39],[-27,-36],[-14,-50],[30,-40],[11,-70],[17,-66],[18,-55],[0,-54],[-17,-19],[6,-39],[17,-22],[-5,-58],[-7,-57],[-15,-7],[-21,-77],[-22,-95],[-26,-85],[-38,-67],[-39,-60],[-31,-8],[-17,-32],[-10,23],[-15,-36],[-39,-36],[-29,-11],[-10,-75],[-15,-5],[-8,53],[7,27],[-37,23],[-13,-11]],[[8001,5541],[-28,18],[-14,29],[5,42],[-26,13],[-13,27],[-24,-38],[-27,-9],[-22,1],[-15,-18]],[[7837,5606],[-14,-10],[4,-83],[-15,2],[-2,17]],[[7810,5532],[-1,30],[-20,-21],[-12,13],[-21,27],[8,60],[-18,14],[-6,66],[-30,-12],[4,85],[26,60],[1,59],[-1,55],[-12,17],[-9,43],[-16,-6]],[[7703,6022],[-30,11],[9,30],[-13,45],[-20,-30],[-23,17],[-32,-45],[-25,-54],[-23,-9]],[[7466,5953],[-2,57],[-17,-15]],[[7447,5995],[-32,7],[-32,16],[-22,32],[-22,14],[-9,34],[-16,11],[-28,46],[-22,22],[-12,-17]],[[7252,6160],[-38,51],[-28,45],[-7,79],[20,-10],[1,37],[-12,37],[3,58],[-30,85]],[[7161,6542],[-45,29],[-8,55],[-21,33]],[[7082,6680],[-4,41],[1,28],[-17,16],[-9,-7],[-7,66]],[[7046,6824],[8,17],[-4,17],[26,33],[20,15],[29,-10],[11,46],[35,8],[10,29],[44,39],[4,16]],[[7229,7034],[-2,41],[19,19],[-25,124],[55,29],[14,16],[20,128],[55,-23],[15,32],[2,72],[23,7],[21,48]],[[7426,7527],[11,6]],[[7437,7533],[7,-50],[23,-38],[40,-27],[19,-58],[-10,-84],[10,-31],[33,-13],[37,-10],[33,-44],[18,-8],[12,-66],[17,-43],[30,2],[58,-17],[36,10],[28,-10],[41,-44],[34,0],[12,-22],[32,38],[45,25],[42,3],[32,25],[20,39],[20,24],[-5,24],[-9,27],[15,47],[15,-7],[29,-15],[28,39],[42,27],[20,48],[20,20],[40,10],[22,-8],[3,25],[-25,50],[-22,23],[-22,-26],[-27,11],[-16,-9],[-7,29],[20,72],[13,54]],[[8240,7575],[34,-27],[39,45],[-1,32],[26,76],[15,23],[0,40],[-16,17],[23,36],[35,13],[37,2],[41,-22],[25,-26],[17,-73],[10,-31],[10,-44],[10,-70],[49,-23],[32,-51],[12,-67],[42,-1],[24,29],[46,21],[-15,-65],[-11,-26],[-9,-79],[-19,-69],[-33,12],[-24,-25],[7,-62],[-4,-84],[-14,-2],[0,-37]],[[5943,6510],[1,-5],[-28,-30],[-14,10],[-7,29],[14,2]],[[6154,6975],[4,31],[-7,49],[-16,27],[-16,8],[-10,22]],[[6109,7112],[4,8],[23,-12],[41,-12],[38,-34],[5,-13],[17,11],[25,-15],[9,-30],[17,-16]],[[6210,6944],[-27,35],[-29,-4]],[[8352,3258],[-11,-2],[-37,51],[26,14],[14,-22],[10,-22],[-2,-19]],[[8471,3355],[2,-15],[1,-21]],[[8474,3319],[-18,-54],[-24,-16],[-3,9],[2,24],[12,44],[28,29]],[[8274,3412],[10,-19],[17,5],[7,-30],[-32,-14],[-19,-10],[-15,0],[10,42],[15,0],[7,26]],[[8413,3412],[-4,-40],[-42,-20],[-37,8],[0,27],[22,15],[18,-22],[18,6],[25,26]],[[8017,3506],[53,-7],[6,30],[51,-35],[10,-46],[42,-13],[34,-43],[-31,-27],[-31,29],[-25,-2],[-29,5],[-26,13],[-32,27],[-21,7],[-11,-9],[-51,30],[-5,31],[-25,5],[19,69],[34,-5],[22,-28],[12,-5],[4,-26]],[[8741,3547],[-14,-49],[-3,54],[5,26],[6,24],[7,-21],[-1,-34]],[[8534,3745],[-11,-24],[-19,13],[-5,31],[28,3],[7,-23]],[[8623,3771],[10,-55],[-23,30],[-23,6],[-16,-5],[-19,2],[6,40],[35,3],[30,-21]],[[8916,3806],[0,-234],[1,-234]],[[8917,3338],[-25,59],[-28,15],[-7,-21],[-35,-2],[12,59],[17,19],[-7,79],[-14,60],[-53,61],[-23,6],[-42,66],[-8,-35],[-11,-6],[-6,26],[0,31],[-21,36],[29,25],[20,-1],[-2,19],[-41,0],[-11,43],[-25,13],[-11,36],[37,17],[14,24],[45,-30],[4,-27],[8,-116],[29,-43],[23,76],[32,44],[25,0],[23,-25],[21,-26],[30,-14]],[[8478,4095],[-22,-71],[-21,-14],[-27,14],[-46,-4],[-24,-10],[-4,-54],[24,-64],[15,32],[52,25],[-2,-33],[-12,10],[-12,-42],[-25,-28],[27,-92],[-5,-24],[25,-83],[-1,-47],[-14,-22],[-11,26],[13,59],[-27,-28],[-7,20],[3,27],[-20,42],[3,70],[-19,-21],[2,-84],[1,-103],[-17,-10],[-12,21],[8,66],[-4,69],[-12,1],[-9,49],[12,47],[4,57],[14,108],[5,30],[24,53],[22,-21],[35,-10],[32,3],[27,52],[5,-16]],[[8574,4074],[-2,-62],[-14,7],[-4,-44],[11,-38],[-8,-9],[-11,46],[-8,92],[6,57],[9,26],[2,-39],[16,-6],[3,-30]],[[8045,4137],[5,-48],[19,-40],[18,14],[18,-5],[16,36],[13,7],[26,-21],[23,16],[14,100],[11,25],[10,81],[32,0],[24,-12]],[[8274,4290],[-16,-65],[20,-68],[-5,-33],[32,-66],[-33,-9],[-10,-49],[2,-65],[-27,-49],[-1,-71],[-10,-110],[-5,25],[-31,-32],[-11,44],[-20,4],[-14,23],[-33,-26],[-10,35],[-18,-4],[-23,8],[-4,97],[-14,20],[-13,61],[-4,63],[3,66],[16,48]],[[7939,3573],[-31,-2],[-24,60],[-35,59],[-12,44],[-21,58],[-14,54],[-21,100],[-24,60],[-9,62],[-10,56],[-25,45],[-14,62],[-21,40],[-29,79],[-3,37],[18,-3],[43,-14],[25,-70],[21,-49],[16,-30],[26,-77],[28,-1],[23,-50],[16,-60],[22,-32],[-12,-59],[16,-25],[10,-2],[5,-50],[10,-40],[20,-6],[14,-46],[-7,-89],[-1,-111]],[[7252,6160],[-17,-32],[-11,-67],[27,-28],[26,-35],[36,-40],[38,-9],[16,-37],[22,-7],[33,-16],[23,1],[4,28],[-4,46],[2,31]],[[7703,6022],[2,-27],[-10,-13],[2,-44],[-19,13],[-36,-50],[0,-41],[-15,-60],[-1,-35],[-13,-59],[-21,16],[-1,-74],[-7,-25],[3,-30],[-14,-17]],[[7472,5577],[-4,-26],[-19,0],[-34,-14],[2,-55],[-15,-42],[-40,-48],[-31,-85],[-21,-45],[-28,-47],[0,-33],[-13,-18],[-26,-26],[-12,-3],[-9,-55],[6,-93],[1,-60],[-11,-68],[0,-122],[-15,-4],[-12,-54],[8,-24],[-25,-21],[-10,-48],[-11,-21],[-26,67],[-13,101],[-11,72],[-9,34],[-15,69],[-7,90],[-5,45],[-25,98],[-12,139],[-8,92],[0,87],[-5,67],[-41,-42],[-19,8],[-36,87],[13,26],[-8,28],[-33,61]],[[6893,5694],[19,48],[61,0],[-6,62],[-15,36],[-4,55],[-18,32],[31,76],[32,-6],[29,76],[18,72],[27,72],[-1,52],[24,41],[-23,36],[-9,48],[-10,63],[14,31],[42,-17],[31,10],[26,61]],[[6497,6664],[25,14],[19,41],[19,-2],[12,13],[20,-6],[31,-37],[22,-8],[31,-63],[21,-3],[3,-60]],[[6690,6135],[14,-38],[11,-43],[27,-32],[1,-63],[13,-12],[2,-33],[-40,-37],[-10,-83]],[[6708,5794],[-53,21],[-30,17],[-31,9],[-12,88],[-13,13],[-22,-13],[-28,-35],[-34,24],[-28,55],[-27,21],[-18,68],[-21,96],[-15,-12],[-17,24],[-11,-28]],[[6348,6142],[-15,38],[0,38],[-9,0],[5,52],[-15,54],[-34,40],[-19,68],[6,56],[14,25],[-2,42],[-18,21],[-18,86]],[[6243,6662],[-15,58],[5,22],[-8,82],[19,21]],[[6357,6745],[9,-53],[26,-15],[20,-36],[39,-13],[44,19],[2,17]],[[6348,6142],[-16,3]],[[6332,6145],[-19,6],[-20,-69]],[[6293,6082],[-52,6],[-78,145],[-41,50],[-34,19]],[[6088,6302],[-11,88]],[[6077,6390],[61,74],[11,87],[-3,53],[16,17],[14,45]],[[6176,6666],[12,11],[32,-9],[10,-18],[13,12]],[[5992,6342],[-5,-23]],[[5987,6319],[-10,10],[-6,-48],[7,-8],[-7,-10],[-1,-19],[13,10]],[[5983,6254],[0,-28],[-14,-115]],[[5969,6111],[-18,124]],[[5951,6235],[8,23],[-2,4],[8,34],[5,54],[4,18],[1,1]],[[5975,6369],[9,0],[3,13],[7,0]],[[5994,6382],[1,-29],[-4,-11],[1,0]],[[5992,6342],[31,-29],[54,77]],[[6088,6302],[-5,-11],[-56,-36],[28,-71],[-9,-13],[-5,-24],[-21,-10],[-7,-25],[-12,-22],[-31,11]],[[5970,6101],[-1,10]],[[5983,6254],[4,21],[0,44]],[[8739,6445],[4,-25],[-16,-43],[-11,23],[-15,-17],[-7,-42],[-18,21],[0,34],[15,43],[16,-9],[12,31],[20,-16]],[[8915,6660],[-10,-57],[4,-36],[-14,-51],[-35,-34],[-49,-4],[-40,-82],[-19,28],[-1,53],[-48,-16],[-33,-33],[-32,-2],[28,-53],[-19,-122],[-18,-30],[-13,28],[7,65],[-18,21],[-11,49],[26,22],[15,45],[28,37],[20,49],[55,22],[30,-15],[29,128],[19,-35],[40,72],[16,28],[18,88],[-5,81],[11,45],[30,13],[15,-99],[-1,-59],[-25,-72],[0,-74]],[[8997,7165],[19,-15],[20,30],[6,-81],[-41,-19],[-25,-72],[-43,50],[-15,-79],[-31,-1],[-4,71],[14,56],[29,3],[8,100],[9,56],[32,-75],[22,-24]],[[6970,7028],[-15,-13],[-37,-50],[-12,-52],[-11,0],[-7,34],[-36,2],[-5,59],[-14,0],[2,72],[-33,53],[-48,-6],[-32,-10],[-27,65],[-22,27],[-43,51],[-6,6],[-71,-42],[1,-265]],[[6554,6959],[-14,-3],[-20,56],[-18,20],[-32,-15],[-12,-24]],[[6458,6993],[-2,18],[7,30],[-5,25],[-32,24],[-13,65],[-15,18],[-1,23],[27,-7],[1,53],[23,12],[25,-11],[5,70],[-5,44],[-28,-3],[-24,17],[-32,-31],[-26,-15]],[[6363,7325],[-14,11],[3,37],[-18,48],[-20,-2],[-24,49],[16,54],[-8,15],[22,79],[29,-42],[3,53],[58,78],[43,2],[61,-50],[33,-29],[30,30],[44,2],[35,-38],[8,22],[39,-3],[7,34],[-45,49],[27,35],[-5,19],[26,19],[-20,49],[13,25],[104,25],[13,18],[70,26],[25,30],[50,-16],[9,-74],[29,17],[35,-24],[-2,-39],[27,4],[69,68],[-10,-23],[35,-55],[62,-183],[15,38],[39,-41],[39,18],[16,-13],[13,-41],[20,-14],[11,-31],[36,10],[15,-44]],[[7229,7034],[-17,10],[-14,26],[-42,8],[-46,2],[-10,-8],[-39,30],[-16,-15],[-4,-42],[-46,24],[-18,-10],[-7,-31]],[[7046,6824],[-53,-11],[-34,24],[-30,-6],[3,42],[30,-12],[10,22]],[[6972,6883],[21,-7],[36,51],[-33,38],[-20,-18],[-21,27],[24,47],[-9,7]],[[7849,4868],[-7,87],[18,60],[36,13],[26,-10]],[[7922,5018],[23,-28],[12,49],[25,-26]],[[7982,5013],[6,-48],[-3,-86],[-47,-55],[13,-44],[-30,-5],[-24,-29]],[[7897,4746],[-23,11],[-11,37],[-14,74]],[[6332,6145],[6,-31],[-3,-17],[9,-54]],[[6344,6043],[-19,-2],[-7,35],[-25,6]],[[8564,6766],[24,-85],[7,-47],[0,-82],[-10,-40],[-25,-14],[-22,-29],[-25,-7],[-3,39],[5,54],[-13,75],[21,12],[-19,62]],[[8504,6704],[2,6],[12,-2],[11,32],[20,3],[11,5],[4,18]],[[7922,5018],[9,32],[1,61],[-22,63],[-2,71],[-21,58],[-21,5],[-6,-25],[-16,-2],[-8,12],[-30,-42],[0,64],[7,76],[-19,3],[-2,43],[-12,22]],[[7780,5459],[6,27],[24,46]],[[7837,5606],[17,-57],[12,-65],[34,0],[11,-63],[-18,-19],[-8,-26],[34,-43],[23,-84],[17,-64],[21,-50],[7,-50],[-5,-72]],[[7271,4533],[-4,-75],[-12,-20],[-24,-16],[-13,57],[-5,103],[13,116],[19,-39],[13,-51],[13,-75]],[[5975,6369],[10,59],[14,50],[0,3]],[[5999,6481],[13,-4],[4,-28],[-15,-27],[-7,-40]],[[7437,7533],[29,12],[53,62],[42,34],[24,-22],[29,-1],[19,-34],[28,-2],[40,-18],[27,50],[-11,42],[28,74],[31,-29],[26,-9],[32,-18],[6,-54],[39,-30],[26,13],[36,9],[27,-9],[28,-35],[16,-36],[26,0],[35,-11],[26,18],[36,11],[41,51],[17,-8],[14,-24],[33,6]],[[7836,4440],[7,-7],[16,-43],[12,-48],[2,-49],[-3,-32],[2,-25],[2,-43],[10,-19],[11,-64],[-1,-24],[-19,-5],[-27,53],[-32,57],[-4,37],[-16,48],[-4,59],[-10,40],[4,52],[-7,30]],[[7779,4457],[5,13],[23,-31],[2,-37],[18,8],[9,30]],[[8045,4137],[21,-24],[21,13],[6,61],[12,13],[33,16],[20,57],[14,45]],[[8206,4384],[22,50],[14,56],[11,1],[14,-37],[1,-31],[19,-20],[23,-22],[-2,-28],[-19,-3],[5,-35],[-20,-25]],[[7737,4706],[-3,54],[9,55],[-10,42],[3,78],[-12,37],[-9,86],[-5,91],[-12,60],[-18,-36],[-32,-52],[-15,7],[-17,17],[9,89],[-6,67],[-21,83],[3,26],[-16,9],[-20,58]],[[7780,5459],[-16,-16],[-16,-32],[-20,-3],[-12,-77],[-12,-14],[14,-63],[17,-52],[12,-47],[-11,-63],[-9,-13],[6,-36],[19,-57],[3,-40],[0,-34],[11,-65],[-16,-67],[-13,-74]],[[6475,5189],[-9,50],[-22,118]],[[6444,5357],[83,72],[19,144],[-13,51]],[[6566,5783],[12,-49],[16,-26],[20,-10],[17,-13],[12,-41],[8,-24],[10,-9],[0,-16],[-10,-43],[-5,-20],[-12,-23],[-10,-49],[-13,4],[-5,-17],[-5,-37],[4,-48],[-3,-9],[-13,1],[-17,-27],[-3,-35],[-6,-15],[-18,0],[-10,-18],[0,-29],[-14,-20],[-15,7],[-19,-24],[-12,-4]],[[6557,5864],[8,24],[3,-6],[-2,-30],[-4,-13]],[[6893,5694],[-20,18],[-9,52],[-21,55],[-51,-14],[-45,-1],[-39,-10]],[[8510,4597],[2,-47],[2,-41],[-9,-65],[-11,73],[-13,-37],[9,-53],[-8,-33],[-32,41],[-8,52],[8,35],[-17,34],[-9,-30],[-13,3],[-21,-41],[-4,21],[11,61],[17,20],[15,27],[10,-32],[21,19],[5,32],[19,2],[-1,56],[22,-34],[3,-36],[2,-27]],[[8443,4731],[-10,-23],[-9,-46],[-8,-21],[-17,50],[5,19],[7,20],[3,44],[16,5],[-5,-49],[21,70],[-3,-69]],[[8291,4662],[-37,-68],[14,50],[20,44],[16,50],[15,71],[5,-58],[-18,-40],[-15,-49]],[[8385,4847],[16,-22],[18,0],[0,-30],[-13,-31],[-18,-21],[-1,33],[2,37],[-4,34]],[[8485,4866],[8,-80],[-21,19],[0,-24],[7,-44],[-13,-16],[-1,50],[-9,4],[-4,43],[16,-5],[0,27],[-17,55],[27,-2],[7,-27]],[[8375,4931],[-7,-62],[-12,36],[-15,55],[24,-3],[10,-26]],[[8369,5322],[17,-21],[9,19],[2,-18],[-4,-30],[9,-52],[-7,-59],[-16,-24],[-5,-58],[7,-57],[14,-8],[13,8],[34,-39],[-2,-39],[9,-18],[-3,-33],[-22,35],[-10,38],[-7,-26],[-18,43],[-25,-11],[-14,16],[1,30],[9,18],[-8,17],[-4,-26],[-14,41],[-4,31],[-1,69],[11,-24],[3,113],[9,65],[17,0]],[[8628,7037],[4,-12]],[[8632,7025],[-11,4],[-12,-24],[-8,-25],[1,-51],[-14,-16],[-5,-13],[-11,-21],[-18,-12],[-12,-19],[-1,-31],[-3,-8],[11,-12],[15,-31]],[[8504,6704],[-13,13],[-4,-13],[-8,-6],[-1,13],[-7,7],[-8,11],[8,32],[7,8],[-3,13],[7,39],[-2,12],[-16,8],[-13,19]],[[6411,5771],[-2,52],[7,37],[8,8],[8,-22],[1,-42],[-6,-43]],[[6427,5761],[-8,-5],[-8,15]],[[6188,5167],[-4,31],[-8,21],[-2,29],[-15,26],[-15,60],[-7,58],[-20,50],[-12,11],[-18,69],[-4,50],[2,42],[-16,80],[-13,28],[-15,15],[-10,41],[2,16],[-8,37],[-8,16],[-11,54],[-17,58],[-14,49],[-14,0],[5,39],[1,25],[3,29]],[[6344,6043],[11,-62],[14,-16],[5,-25],[18,-31],[2,-29],[-3,-24],[4,-24],[8,-20],[4,-24],[4,-17]],[[6427,5761],[5,-27]],[[6444,5357],[-80,-27],[-26,-33],[-20,-75],[-13,-12],[-7,24],[-11,-4],[-27,8],[-5,7],[-32,-2],[-7,-6],[-12,18],[-7,-35],[3,-30],[-12,-23]],[[5999,6481],[-2,55],[7,29]],[[6004,6565],[7,16],[7,16],[2,40],[9,-14],[31,20],[14,-14],[23,0],[32,27],[15,-1],[32,11]],[[7849,4868],[-25,33],[-24,-1],[4,56],[-24,0],[-2,-79],[-15,-105],[-10,-64],[2,-52],[18,-2],[12,-65],[5,-62],[15,-42],[17,-8],[14,-37]],[[7779,4457],[-11,28],[-4,35],[-15,41],[-14,34],[-4,-42],[-5,40],[3,44],[8,69]],[[6883,6660],[16,73],[-6,53],[-20,17],[7,32],[23,-3],[13,39],[9,46],[37,17],[-6,-33],[4,-20],[12,2]],[[6497,6664],[-5,51],[4,75],[-22,24],[8,49],[-19,5],[6,60],[26,-18],[25,23],[-20,44],[-8,41],[-23,-19],[-3,-52],[-8,46]],[[6554,6959],[31,1],[-4,36],[24,25],[23,42],[37,-38],[3,-58],[11,-14],[30,3],[9,-13],[14,-74],[32,-50],[18,-33],[29,-36],[37,-30],[-1,-44]],[[8471,3355],[3,16],[24,17],[19,2],[9,9],[10,-9],[-10,-19],[-29,-32],[-23,-20]],[[6004,6565],[-11,33],[11,27],[-17,-6],[-23,16],[-19,-41],[-43,-8],[-22,38],[-30,3],[-6,-30],[-20,-9],[-26,39],[-31,-2],[-16,72],[-21,40],[14,55],[-18,35],[31,68],[43,3],[12,55],[53,-10],[33,47],[32,20],[46,2],[49,-51],[40,-28],[32,11],[24,-6],[33,37]],[[5723,6924],[7,8],[8,45],[-13,19]],[[5725,6996],[28,23],[24,-10]],[[5777,7009],[3,-27],[25,-23],[-5,-18],[-33,-4],[-12,-22],[-23,-39],[-9,34],[0,14]],[[8382,5745],[-17,-115],[-12,-59],[-14,60],[-4,53],[17,71],[22,54],[13,-21],[-5,-43]],[[8001,5541],[-37,-62],[-24,-68],[-6,-50],[22,-75],[25,-94],[26,-44],[17,-58],[12,-133],[-3,-126],[-24,-48],[-31,-46],[-23,-60],[-35,-66],[-10,46],[8,48],[-21,41]],[[6475,5189],[-21,-20],[-5,-32],[-1,-24],[-27,-30],[-45,-34],[-24,-50],[-13,-4],[-8,4],[-16,-30],[-18,-14],[-23,-4],[-7,-4],[-6,-19],[-8,-5],[-4,-18],[-14,2],[-9,-10],[-19,3],[-7,42],[1,40],[-5,21],[-5,53],[-8,29],[5,4],[-2,33],[3,14],[-1,31]],[[3140,51],[-17,2],[-30,0],[0,161]],[[3093,214],[11,-34],[14,-53],[36,-44],[39,-18],[-13,-35],[-26,-4],[-14,25]],[[3258,2396],[51,-118],[23,-11],[34,-53],[29,-28],[4,-31],[-28,-109],[28,-20],[32,-11],[22,12],[25,55],[4,63]],[[3482,2145],[14,14],[14,-42],[-1,-57],[-23,-40],[-19,-29],[-31,-70],[-37,-98]],[[3399,1823],[-7,-57],[-7,-74],[0,-71],[-6,-16],[-2,-47]],[[3377,1558],[-2,-37],[35,-62],[-4,-49],[18,-31],[-2,-36],[-26,-92],[-42,-38],[-55,-15],[-31,7],[6,-43],[-6,-53],[5,-37],[-16,-25],[-29,-10],[-26,26],[-11,-18],[4,-72],[18,-21],[16,22],[8,-37],[-26,-22],[-22,-45],[-4,-72],[-7,-39],[-26,0],[-22,-37],[-8,-54],[28,-52],[26,-15],[-9,-64],[-33,-41],[-18,-84],[-25,-28],[-12,-34],[9,-74],[19,-42],[-12,4]],[[3095,238],[-26,11],[-67,10],[-11,42],[0,53],[-18,-4],[-10,26],[-3,76],[22,31],[9,46],[-4,36],[15,62],[10,95],[-3,42],[12,13],[-3,27],[-13,15],[10,30],[-13,27],[-6,83],[11,15],[-5,87],[7,74],[7,64],[17,26],[-9,70],[0,66],[21,47],[-1,60],[16,70],[0,66],[-7,13],[-13,124],[17,74],[-2,69],[10,66],[18,67],[20,45],[-9,28],[6,23],[-1,120],[30,35],[10,75],[-3,18]],[[3136,2361],[23,64],[36,-17],[16,-52],[11,58],[32,-3],[4,-15]],[[3136,2361],[-20,-10],[-11,99],[-15,80],[9,70],[-15,30],[-4,52],[-13,49]],[[3067,2731],[17,77],[-12,61],[7,24],[-5,26],[10,36],[1,61],[1,51],[6,24],[-24,116]],[[3068,3207],[21,-6],[14,1],[6,22],[25,29],[14,27],[37,12],[-3,-54],[3,-27],[-2,-48],[30,-65],[31,-12],[11,-26],[19,-15],[11,-20],[18,0],[16,-21],[1,-42],[6,-21],[0,-31],[-8,-1],[11,-83],[53,-3],[-4,-42],[3,-28],[15,-20],[6,-45],[-4,-56],[-8,-32],[3,-41],[-9,-15]],[[3384,2544],[-1,22],[-25,37],[-26,1],[-49,-21],[-13,-63],[-1,-38],[-11,-86]],[[3482,2145],[6,41],[3,43],[1,39],[-10,13],[-11,-11],[-10,3],[-4,28],[-2,65],[-5,22],[-19,19],[-11,-14],[-30,14],[2,97],[-8,40]],[[3068,3207],[-15,-13],[-13,9],[2,109],[-23,-43],[-24,2],[-11,38],[-18,5],[5,30],[-15,44],[-11,65],[7,13],[0,30],[17,21],[-3,39],[7,25],[2,33],[32,49],[22,14],[4,11],[25,-4]],[[3058,3684],[13,197],[0,31],[-4,42],[-12,26],[0,52],[15,12],[6,-8],[1,28],[-16,7],[-1,45],[54,-1],[10,24],[7,-22],[6,-43],[5,9]],[[3142,4083],[15,-38],[22,5],[5,22],[21,16],[11,12],[4,31],[19,20],[-1,15],[-24,6],[-3,46],[1,48],[-13,18],[5,7],[21,-9],[22,-18],[8,17],[20,11],[31,27],[10,27],[-3,20]],[[3313,4366],[14,4],[7,-17],[-4,-31],[9,-11],[7,-34],[-8,-25],[-4,-61],[7,-36],[2,-34],[17,-33],[14,-4],[3,14],[8,3],[13,13],[9,19],[15,-6],[7,2]],[[3429,4129],[15,-5],[3,14],[-5,15],[3,20],[11,-6],[13,7],[16,-15]],[[3485,4159],[12,-15],[9,20],[6,-3],[4,-20],[13,5],[11,27],[8,53],[17,65]],[[3565,4291],[9,4],[7,-40],[16,-125],[14,-12],[1,-50],[-21,-59],[9,-22],[49,-11],[1,-72],[21,47],[35,-25],[46,-44],[14,-42],[-5,-40],[33,22],[54,-38],[41,3],[41,-60],[36,-80],[21,-21],[24,-3],[10,-22],[9,-92],[5,-43],[-11,-119],[-14,-47],[-39,-100],[-18,-81],[-21,-62],[-7,-2],[-7,-52],[2,-135],[-8,-111],[-3,-47],[-9,-28],[-5,-96],[-28,-94],[-5,-74],[-22,-31],[-7,-43],[-30,0],[-44,-28],[-19,-32],[-31,-21],[-33,-57],[-23,-71],[-5,-54],[5,-39],[-5,-73],[-6,-35],[-20,-39],[-31,-127],[-24,-57],[-19,-33],[-13,-69],[-18,-41]],[[3517,1568],[-8,41],[13,34],[-16,49],[-22,40],[-29,46],[-10,-2],[-28,55],[-18,-8]],[[3140,51],[-10,-29],[-23,-22],[-14,2],[-16,6],[-21,22],[-29,10],[-35,40],[-28,39],[-38,80],[23,-15],[39,-48],[36,-26],[15,33],[9,49],[25,30],[20,-8]],[[3095,238],[-25,0],[-13,-17],[-25,-26],[-5,-67],[-11,-2],[-32,23],[-32,50],[-34,41],[-9,46],[8,42],[-14,48],[-4,122],[12,69],[30,56],[-43,21],[27,63],[9,119],[31,-25],[15,149],[-19,19],[-9,-90],[-17,10],[9,103],[9,133],[13,49],[-8,70],[-2,81],[11,2],[17,116],[20,115],[11,107],[-6,108],[8,59],[-3,89],[16,87],[5,139],[9,149],[9,161],[-2,118],[-6,101]],[[3045,2676],[14,18],[8,37]],[[2906,3982],[-12,17],[-14,24],[-7,-11],[-24,9],[-7,31],[-5,-1],[-28,41]],[[2809,4092],[-3,23],[10,5],[-1,36],[6,26],[14,5],[12,45],[10,37],[-10,18],[5,41],[-6,66],[6,19],[-4,61],[-12,38]],[[2836,4512],[4,35],[9,-5],[5,21],[-6,42],[3,11]],[[2851,4616],[14,-3],[21,50],[12,8],[0,24],[5,61],[16,33],[17,1],[3,15],[21,-6],[22,36],[11,17],[14,34],[9,-4],[8,-19],[-6,-24]],[[3018,4839],[-18,-12],[-7,-36],[-10,-21],[-8,-27],[-4,-51],[-8,-42],[15,-5],[3,-33],[6,-15],[3,-29],[-4,-27],[1,-15],[7,-6],[7,-25],[36,7],[16,-9],[19,-62],[11,8],[20,-4],[16,8],[10,-12],[-5,-39],[-6,-24],[-2,-52],[5,-47],[8,-22],[1,-16],[-14,-35],[10,-16],[8,-25],[8,-72]],[[3058,3684],[-14,39],[-8,1],[18,73],[-21,34],[-17,-6],[-10,12],[-15,-19],[-21,9],[-16,76],[-13,18],[-9,34],[-19,34],[-7,-7]],[[2769,3749],[15,53],[-6,32],[-11,-34],[-16,32],[5,20],[-4,65],[9,11],[5,45],[11,46],[-2,29],[15,16],[19,28]],[[2906,3982],[4,-54],[-9,-47],[-30,-75],[-33,-29],[-17,-62],[-6,-48],[-15,-30],[-12,36],[-11,8],[-12,-6],[-1,27],[8,17],[-3,30]],[[3300,270],[33,43],[24,-18],[16,29],[22,-32],[-8,-25],[-37,-22],[-13,25],[-23,-32],[-14,32]],[[3340,4594],[18,-27],[17,-46],[1,-37],[10,-2],[15,-35],[11,-25]],[[3412,4422],[-4,-65],[-17,-18],[1,-17],[-5,-37],[13,-52],[9,-1],[3,-40],[17,-63]],[[3313,4366],[-19,55],[7,20],[0,33],[17,11],[7,14],[-10,26],[3,27],[22,42]],[[3045,2676],[-28,41],[-2,29],[-55,72],[-50,79],[-22,44],[-11,60],[4,20],[-23,94],[-28,133],[-26,143],[-11,33],[-9,52],[-21,47],[-20,29],[9,32],[-14,69],[9,50],[22,46]],[[3412,4422],[34,-14],[2,13],[23,5],[30,-20]],[[3501,4406],[-15,-61],[3,-49],[10,-43],[-4,-31]],[[3495,4222],[-3,-33],[-7,-30]],[[3517,1568],[-12,-45],[-31,-40],[-21,15],[-15,-8],[-26,31],[-18,-2],[-17,39]],[[3018,4839],[-1,-17],[-16,-9],[9,-32],[0,-38],[-12,-42],[10,-57],[12,5],[6,52],[-8,25],[-2,55],[35,29],[-4,34],[10,22],[10,-50],[19,-1],[18,-40],[1,-24],[25,-1],[30,8],[16,-32],[21,-9],[16,22],[0,18],[34,4],[34,1],[-24,-21],[10,-34],[22,-5],[21,-35],[4,-58],[15,2],[11,-17]],[[2846,5699],[-7,-3],[-7,41],[-10,21],[6,45],[8,-3],[10,-59],[0,-42]],[[2838,5902],[-30,-12],[-2,27],[13,5],[18,-2],[1,-18]],[[2861,5902],[-5,-51],[-5,9],[0,38],[-12,28],[0,9],[22,-33]],[[2524,5272],[-1,10],[4,4],[5,-9],[10,43],[5,1]],[[2547,5321],[0,-10],[5,0],[0,-20],[-5,-31],[3,-11],[-3,-26],[2,-7],[-4,-36],[-5,-19],[-5,-2],[-6,-25]],[[2529,5134],[-8,0],[2,81],[1,57]],[[3231,7335],[20,-9],[26,2],[-14,-30],[-10,-4],[-35,30],[-7,24],[10,22],[10,-35]],[[3283,7519],[-14,-1],[-36,22],[-26,34],[10,6],[37,-18],[28,-30],[1,-13]],[[1569,7476],[-14,-10],[-46,33],[-8,25],[-25,25],[-5,21],[-28,13],[-11,39],[2,17],[30,-16],[17,-11],[26,-8],[9,-24],[14,-34],[28,-30],[11,-40]],[[3440,7633],[-18,-63],[18,24],[19,-15],[-10,-25],[25,-20],[12,17],[28,-22],[-8,-52],[19,12],[4,-38],[8,-45],[-11,-63],[-13,-3],[-18,14],[6,59],[-8,9],[-32,-62],[-17,2],[20,34],[-27,17],[-30,-4],[-54,2],[-4,21],[17,26],[-12,19],[24,43],[28,115],[18,41],[24,24],[13,-3],[-6,-19],[-15,-45]],[[1300,7883],[13,-10],[27,6],[-8,-82],[24,-57],[-11,0],[-17,33],[-10,33],[-14,22],[-5,32],[1,23]],[[2798,8456],[-11,-38],[-12,7],[-8,21],[2,5],[10,22],[12,-2],[7,-15]],[[2725,8496],[-33,-40],[-19,2],[-6,19],[20,33],[38,0],[0,-14]],[[2634,8707],[5,-31],[15,11],[16,-19],[30,-25],[32,-22],[2,-34],[21,6],[20,-24],[-25,-23],[-43,17],[-16,33],[-27,-38],[-40,-38],[-9,42],[-38,-7],[24,36],[4,57],[9,65],[20,-6]],[[2892,8815],[-31,-4],[-7,35],[12,40],[26,10],[21,-20],[1,-30],[-4,-10],[-18,-21]],[[2343,8955],[-17,-25],[-38,22],[-22,-8],[-38,32],[24,22],[19,32],[30,-21],[17,-13],[8,-13],[17,-28]],[[3135,7234],[-18,41],[0,98],[-13,20],[-18,-12],[-10,19],[-21,-54],[-8,-56],[-10,-33],[-12,-11],[-9,-4],[-3,-17],[-51,0],[-42,-1],[-12,-13],[-30,-52],[-3,-5],[-9,-28],[-26,0],[-27,-1],[-12,-11],[4,-14],[2,-22],[0,-7],[-36,-36],[-29,-11],[-32,-39],[-7,0],[-10,12],[-3,10],[1,8],[6,25],[13,39],[8,43],[-5,62],[-6,65],[-29,34],[3,13],[-4,8],[-8,0],[-5,12],[-2,17],[-5,-8],[-7,3],[1,7],[-6,7],[-3,19],[-21,23],[-23,24],[-27,27],[-26,26],[-25,-20],[-9,-1],[-34,19],[-23,-9],[-27,22],[-28,11],[-19,5],[-9,12],[-5,39],[-9,0],[-1,-28],[-57,0],[-95,0],[-94,0],[-84,0],[-83,0],[-82,0],[-85,0],[-27,0],[-82,0],[-79,0]],[[1588,7511],[-4,1],[-54,70],[-20,31],[-50,30],[-15,63],[3,44],[-35,31],[-5,58],[-34,52],[0,37]],[[1374,7928],[15,35],[0,45],[-48,46],[-28,82],[-17,51],[-26,32],[-19,30],[-14,37],[-28,-23],[-27,-40],[-25,47],[-19,31],[-27,20],[-28,2],[0,409],[1,267]],[[1084,8999],[51,-18],[44,-34],[29,-7],[24,30],[34,22],[41,-8],[42,31],[45,18],[20,-30],[20,17],[6,34],[20,-8],[47,-64],[37,49],[3,-55],[34,12],[11,21],[34,-4],[42,-30],[65,-27],[38,-12],[28,5],[37,-37],[-39,-35],[50,-16],[75,9],[24,12],[29,-43],[31,37],[-29,30],[18,25],[34,3],[22,7],[23,-17],[28,-39],[31,6],[49,-33],[43,12],[40,-2],[-3,45],[25,12],[43,-24],[0,-68],[17,57],[23,-2],[12,72],[-30,45],[-32,29],[2,79],[33,52],[37,-11],[28,-32],[38,-81],[-25,-35],[52,-15],[-1,-73],[38,56],[33,-46],[-9,-53],[27,-49],[29,52],[21,62],[1,79],[40,-6],[41,-10],[37,-36],[2,-36],[-21,-38],[20,-38],[-4,-35],[-54,-50],[-39,-11],[-29,21],[-8,-36],[-27,-60],[-8,-32],[-32,-48],[-40,-5],[-22,-31],[-2,-46],[-32,-9],[-34,-58],[-30,-81],[-11,-57],[-1,-83],[40,-12],[13,-67],[13,-55],[39,14],[51,-31],[28,-27],[20,-34],[35,-20],[29,-30],[46,-4],[30,-7],[-4,-62],[8,-73],[21,-80],[41,-68],[21,23],[15,74],[-14,114],[-20,37],[45,34],[31,50],[16,50],[-3,48],[-19,61],[-33,54],[32,76],[-12,65],[-9,112],[19,16],[48,-19],[29,-7],[23,19],[25,-25],[35,-41],[8,-28],[50,-6],[-1,-60],[9,-91],[25,-11],[21,-42],[40,40],[26,79],[19,33],[21,-64],[36,-91],[31,-87],[-11,-45],[37,-40],[25,-41],[44,-19],[18,-23],[11,-60],[22,-10],[11,-27],[2,-81],[-20,-27],[-20,-25],[-46,-25],[-35,-59],[-47,-12],[-59,15],[-42,1],[-29,-5],[-23,-52],[-35,-32],[-40,-95],[-32,-66],[23,12],[45,94],[58,60],[42,7],[24,-35],[-26,-48],[9,-78],[9,-54],[36,-36],[46,11],[28,80],[2,-52],[17,-26],[-34,-47],[-61,-43],[-28,-29],[-31,-51],[-21,5],[-1,61],[48,59],[-44,-2],[-31,-9]],[[1829,9243],[-14,-33],[61,21],[39,-36],[31,37],[26,-24],[23,-70],[14,30],[-20,73],[24,11],[28,-12],[31,-29],[17,-70],[9,-50],[47,-36],[50,-34],[-3,-32],[-46,-5],[18,-28],[-9,-26],[-51,11],[-48,19],[-32,-4],[-52,-24],[-70,-11],[-50,-7],[-15,34],[-38,20],[-24,-8],[-35,56],[19,8],[43,12],[39,-3],[36,13],[-54,16],[-59,-5],[-39,1],[-15,27],[64,28],[-42,-1],[-49,19],[23,54],[20,29],[74,43],[29,-14]],[[2097,9265],[-24,-48],[-44,51],[10,10],[37,3],[21,-16]],[[2879,9242],[3,-20],[-30,2],[-30,2],[-30,-10],[-8,5],[-31,38],[1,25],[14,5],[63,-8],[48,-39]],[[2595,9246],[22,-45],[26,58],[70,30],[48,-75],[-4,-47],[55,21],[26,29],[62,-37],[38,-34],[3,-31],[52,16],[29,-46],[67,-28],[24,-29],[26,-67],[-51,-34],[66,-47],[44,-15],[40,-66],[44,-5],[-9,-50],[-49,-84],[-34,31],[-44,69],[-36,-9],[-3,-41],[29,-42],[38,-33],[11,-19],[18,-71],[-9,-52],[-35,20],[-70,57],[39,-62],[29,-43],[5,-25],[-76,29],[-59,41],[-34,35],[10,20],[-42,37],[-40,35],[0,-21],[-80,-11],[-23,25],[18,52],[52,2],[57,9],[-9,26],[10,35],[36,70],[-8,32],[-11,25],[-42,34],[-57,25],[18,18],[-29,45],[-25,4],[-22,24],[-14,-21],[-51,-9],[-101,16],[-59,21],[-45,11],[-23,25],[29,33],[-39,0],[-9,73],[21,64],[29,29],[72,19],[-21,-46]],[[2212,9295],[33,-15],[50,9],[7,-21],[-26,-34],[42,-31],[-5,-65],[-45,-27],[-27,6],[-19,27],[-69,55],[0,23],[57,-8],[-31,47],[33,34]],[[2411,9218],[-30,-53],[-32,2],[-17,63],[1,36],[14,31],[28,19],[58,-2],[53,-18],[-42,-64],[-33,-14]],[[1654,9119],[-73,-35],[-15,31],[-64,38],[12,31],[19,52],[24,47],[-27,44],[94,12],[39,-15],[71,-4],[27,-21],[30,-30],[-35,-18],[-68,-51],[-34,-50],[0,-31]],[[2399,9377],[-15,-28],[-40,5],[-34,19],[15,32],[40,20],[24,-25],[10,-23]],[[2264,9502],[21,-34],[1,-36],[-13,-54],[-46,-7],[-30,11],[1,42],[-45,-5],[-2,55],[30,-2],[41,24],[40,-4],[2,10]],[[1994,9465],[11,-26],[25,12],[29,-3],[5,-35],[-17,-34],[-94,-12],[-70,-31],[-43,-1],[-3,23],[57,32],[-125,-9],[-39,13],[38,70],[26,20],[78,-24],[50,-42],[48,-6],[-40,69],[26,26],[29,-8],[9,-34]],[[2370,9529],[30,-23],[55,0],[24,-24],[-6,-27],[32,-16],[17,-17],[38,-3],[40,-6],[44,15],[57,7],[45,-5],[30,-28],[6,-29],[-17,-19],[-42,-16],[-35,9],[-80,-11],[-57,-1],[-45,8],[-74,24],[-9,39],[-4,36],[-27,31],[-58,9],[-32,22],[10,29],[58,-4]],[[1772,9568],[-4,-55],[-21,-25],[-26,-3],[-52,-31],[-44,-11],[-38,15],[47,54],[57,47],[43,-1],[38,10]],[[2393,9559],[-13,-2],[-52,5],[-7,20],[56,-1],[19,-14],[-3,-8]],[[1939,9572],[-52,-21],[-41,23],[23,23],[40,8],[39,-12],[-9,-21]],[[1954,9637],[-34,-14],[-46,0],[0,10],[29,22],[14,-4],[37,-14]],[[2338,9598],[-41,-15],[-23,17],[-12,27],[-2,29],[36,-3],[16,-4],[33,-25],[-7,-26]],[[2220,9617],[11,-30],[-45,8],[-46,23],[-62,3],[27,21],[-34,18],[-2,27],[55,-10],[75,-26],[21,-34]],[[2583,9713],[33,-23],[-38,-22],[-51,-54],[-50,-5],[-57,9],[-30,30],[0,26],[22,19],[-50,-1],[-31,24],[-18,33],[20,32],[19,21],[28,5],[-12,17],[65,4],[35,-39],[47,-15],[46,-14],[22,-47]],[[3097,9960],[74,-5],[60,-10],[51,-19],[-2,-19],[-67,-31],[-68,-15],[-25,-16],[61,0],[-66,-43],[-45,-20],[-48,-59],[-57,-12],[-18,-15],[-84,-7],[39,-9],[-20,-13],[23,-36],[-26,-24],[-43,-21],[-13,-28],[-39,-21],[4,-16],[48,2],[0,-17],[-74,-43],[-73,20],[-81,-11],[-42,8],[-52,4],[-4,34],[52,17],[-14,51],[17,6],[74,-31],[-38,46],[-45,13],[23,28],[49,17],[8,25],[-39,28],[-12,37],[76,-3],[22,-8],[43,27],[-62,8],[-98,-5],[-49,25],[-23,29],[-32,21],[-6,24],[41,14],[32,2],[55,12],[41,27],[34,-4],[30,-20],[21,39],[37,11],[50,8],[85,3],[14,-8],[81,12],[60,-4],[60,-5]],[[2695,4584],[-15,16],[-6,15],[4,12],[-1,16],[-8,17],[-11,14],[-10,9],[-1,21],[-8,13],[2,-21],[-5,-17],[-7,20],[-9,7],[-4,15],[1,22],[3,22],[-8,10],[7,14]],[[2619,4789],[4,9],[18,-19],[7,10],[9,-6],[4,-15],[8,-5],[7,16]],[[2676,4779],[7,-40],[11,-28],[13,-31]],[[2707,4680],[-11,-6],[0,-29],[6,-11],[-4,-9],[1,-13],[-2,-14],[-2,-14]],[[2715,5658],[23,-5],[22,-1],[26,-24],[11,-27],[26,8],[10,-16],[24,-45],[17,-32],[9,1],[17,-15],[-2,-20],[20,-3],[21,-29],[-3,-17],[-19,-9],[-18,-4],[-19,6],[-40,-7],[18,40],[-11,18],[-18,5],[-9,21],[-7,41],[-16,-3],[-26,19],[-8,15],[-36,12],[-10,14],[11,17],[-28,4],[-20,-37],[-11,-1],[-4,-18],[-14,-8],[-12,7],[15,22],[6,26],[13,16],[14,14],[21,7],[7,8]],[[3008,5409],[3,12],[22,0],[16,-19],[8,2],[5,-26],[15,2],[-1,-22],[12,-2],[14,-27],[-10,-29],[-14,16],[-12,-3],[-9,3],[-5,-13],[-11,-4],[-4,17],[-10,-10],[-11,-49],[-7,11],[-1,21]],[[3008,5289],[0,19],[-7,22],[7,12],[2,28],[-2,39]],[[3701,9926],[93,43],[97,-3],[36,26],[98,7],[222,-9],[174,-57],[-52,-28],[-106,-3],[-150,-7],[14,-13],[99,8],[83,-24],[54,22],[23,-26],[-30,-42],[71,27],[135,28],[83,-14],[15,-31],[-113,-51],[-16,-17],[-88,-12],[64,-3],[-32,-53],[-23,-46],[1,-80],[33,-47],[-43,-3],[-46,-23],[52,-38],[6,-61],[-30,-7],[36,-61],[-61,-5],[32,-30],[-9,-25],[-39,-11],[-39,0],[35,-49],[0,-32],[-55,30],[-14,-19],[37,-18],[37,-44],[10,-58],[-49,-14],[-22,28],[-34,41],[10,-49],[-33,-37],[73,-4],[39,-3],[-75,-63],[-75,-57],[-81,-24],[-31,-1],[-29,-27],[-38,-76],[-60,-50],[-19,-3],[-37,-18],[-40,-17],[-24,-44],[0,-51],[-15,-47],[-45,-57],[11,-56],[-12,-60],[-14,-70],[-39,-4],[-41,58],[-56,1],[-27,39],[-18,70],[-49,90],[-14,46],[-3,65],[-39,66],[10,53],[-18,25],[27,84],[42,27],[11,30],[6,56],[-32,-25],[-15,-11],[-25,-10],[-34,23],[-2,49],[11,38],[25,1],[57,-19],[-48,46],[-24,24],[-28,-10],[-23,18],[31,67],[-17,27],[-22,49],[-34,76],[-35,28],[0,30],[-74,42],[-59,6],[-74,-3],[-68,-6],[-32,23],[-49,45],[73,23],[56,4],[-119,19],[-62,29],[3,28],[106,34],[101,35],[11,26],[-75,26],[24,28],[97,50],[40,8],[-12,32],[66,19],[86,12],[85,0],[30,-22],[74,39],[66,-26],[39,-6],[58,-23],[-66,38],[4,31]],[[2497,4979],[-14,13],[-17,1],[-13,14],[-15,30]],[[2438,5037],[1,21],[3,17],[-4,13],[13,59],[36,0],[1,24],[-5,5],[-3,15],[-10,17],[-11,24],[13,0],[0,40],[26,1],[26,-1]],[[2529,5134],[10,-13],[2,11],[8,-10]],[[2549,5122],[-13,-27],[-13,-20],[-2,-14],[2,-14],[-5,-18]],[[2518,5029],[-7,-5],[2,-8],[-6,-8],[-9,-18],[-1,-11]],[[2574,4925],[-5,23],[-8,6]],[[2561,4954],[2,29],[-4,8],[-6,5],[-12,-9],[-1,10],[-8,11],[-6,15],[-8,6]],[[2549,5122],[3,-2],[6,12],[8,1],[3,-6],[4,4],[13,-7],[13,2],[9,8],[3,8],[9,-3],[6,-5],[8,1],[5,7],[13,-10],[4,-2],[9,-13],[8,-16],[10,-11],[7,-20]],[[2690,5070],[-9,1],[-4,-10],[-10,-9],[-7,0],[-6,-9],[-6,3],[-4,11],[-3,-2],[-4,-17],[-3,1],[0,-15],[-10,-20],[-5,-9],[-3,-8],[-8,14],[-6,-19],[-6,0],[-6,-1],[0,-36],[-4,0],[-3,-17],[-9,-3]],[[3008,5289],[-19,12],[-13,-5],[-17,5],[-13,-13],[-15,22],[3,23],[25,-10],[21,-5],[10,16],[-12,31],[0,27],[-18,11],[7,20],[17,-3],[24,-11]],[[2845,5321],[19,-7],[14,-17],[5,-20],[-19,-1],[-9,-12],[-15,12],[-16,26],[3,16],[12,5],[6,-2]],[[2301,5851],[-10,-63],[-5,-52],[-2,-96],[-3,-35],[5,-40],[9,-35],[5,-55],[19,-54],[6,-41],[11,-35],[29,-19],[12,-30],[24,20],[21,7],[21,13],[18,12],[17,30],[7,42],[2,60],[5,21],[19,19],[29,16],[25,-2],[17,6],[6,-15],[-1,-35],[-15,-43],[-6,-43],[5,-13],[-4,-31],[-7,-56],[-7,19],[-6,-2]],[[2438,5037],[-32,77],[-14,24],[-23,18],[-15,-5],[-22,-27],[-14,-7],[-20,19],[-21,14],[-26,33],[-21,10],[-31,33],[-23,34],[-7,19],[-16,5],[-28,23],[-12,32],[-30,41],[-14,45],[-6,35],[9,7],[-3,21],[7,18],[0,25],[-10,32],[-2,29],[-9,36],[-25,72],[-28,56],[-13,45],[-24,29],[-5,17],[4,45],[-14,16],[-17,35],[-7,50],[-14,6],[-17,38],[-13,35],[-1,23],[-15,54],[-10,55],[1,27],[-20,29],[-10,-3],[-15,19],[-5,-29],[5,-34],[2,-54],[10,-30],[21,-49],[4,-17],[4,-5],[4,-25],[5,1],[6,-46],[8,-19],[6,-25],[17,-36],[10,-67],[8,-32],[8,-33],[1,-38],[13,-3],[12,-32],[10,-32],[-1,-13],[-12,-27],[-5,1],[-7,43],[-18,41],[-20,35],[-14,18],[1,53],[-5,39],[-13,22],[-19,32],[-4,-9],[-7,19],[-17,17],[-16,42],[2,5],[11,-4],[11,27],[1,32],[-22,51],[-16,20],[-10,45],[-11,47],[-12,58],[-12,64]],[[1746,6329],[32,6],[35,8],[-2,-15],[41,-34],[64,-51],[55,0],[22,1],[0,29],[48,0],[10,-25],[15,-23],[16,-32],[9,-37],[7,-40],[15,-21],[23,-22],[17,57],[23,1],[19,-28],[14,-49],[10,-43],[16,-40],[6,-51],[8,-33],[22,-23],[20,-16],[10,3]],[[2619,4789],[-10,23],[-13,29],[-6,24],[-12,23],[-13,32],[3,11],[4,-11],[2,5]],[[2690,5070],[-2,-7],[-2,-16],[3,-26],[-6,-25],[-3,-29],[-1,-31],[1,-19],[1,-32],[-4,-7],[-3,-31],[2,-19],[-6,-18],[2,-20],[4,-11]],[[2836,4512],[-9,20],[-6,39],[7,19],[-7,5],[-5,24],[-14,20],[-12,-5],[-6,-25],[-11,-18],[-6,-2],[-3,-15],[13,-39],[-7,-9],[-4,-11],[-13,-3],[-5,42],[-4,-12],[-9,4],[-5,29],[-12,5],[-7,8],[-12,0],[-1,-15],[-3,11]],[[2707,4680],[10,-26],[-1,-15],[11,-3],[3,6],[8,-18],[13,5],[12,18],[17,15],[9,21],[16,-4],[-1,-7],[15,-3],[12,-12],[10,-22],[10,-19]],[[3159,5322],[14,-6],[5,-14],[-7,-18],[-21,0],[-17,-2],[-1,30],[4,11],[23,-1]],[[2561,4954],[-3,-17],[-16,1],[-10,7],[-12,14],[-15,5],[-8,15]],[[3286,4766],[16,9],[6,-3],[-1,-53],[-23,-8],[-5,7],[8,19],[-1,29]],[[679,5363],[-4,-12],[-7,11],[1,20],[-4,26],[1,8],[5,11],[-2,15],[1,6],[3,-1],[10,-12],[5,-6],[5,-10],[7,-25],[-1,-4],[-11,-15],[-9,-12]],[[664,5475],[-9,-5],[-5,15],[-3,6],[0,5],[3,6],[9,-7],[8,-11],[-3,-9]],[[646,5514],[-1,-8],[-15,2],[2,9],[14,-3]],[[621,5524],[-2,-4],[-2,1],[-9,2],[-4,17],[-1,3],[7,9],[3,-4],[8,-24]],[[574,5571],[-4,-7],[-9,13],[1,6],[5,7],[6,-2],[1,-17]],[[3135,7234],[5,-23],[-30,-35],[-29,-25],[-29,-21],[-15,-43],[-4,-16],[-1,-38],[10,-38],[11,-2],[-3,26],[8,-16],[-2,-20],[-19,-12],[-13,1],[-20,-12],[-12,-4],[-17,-3],[-23,-21],[41,14],[8,-14],[-39,-22],[-17,0],[0,9],[-8,-20],[8,-3],[-6,-52],[-20,-55],[-2,18],[-6,4],[-9,18],[5,-39],[7,-12],[1,-27],[-9,-28],[-16,-58],[-2,3],[8,49],[-14,27],[-3,60],[-5,-31],[5,-45],[-18,11],[19,-23],[1,-69],[8,-5],[3,-24],[4,-72],[-17,-54],[-29,-21],[-18,-42],[-14,-5],[-14,-26],[-4,-24],[-31,-47],[-16,-34],[-13,-42],[-4,-51],[5,-50],[9,-62],[13,-51],[0,-31],[13,-83],[-1,-48],[-1,-28],[-7,-44],[-8,-9],[-14,9],[-4,31],[-11,17],[-15,61],[-13,55],[-4,28],[6,48],[-8,40],[-22,60],[-10,11],[-28,-33],[-5,4],[-14,33],[-17,18],[-32,-9],[-24,8],[-21,-5],[-12,-11],[5,-19],[0,-30],[5,-14],[-5,-9],[-10,10],[-11,-13],[-20,2],[-20,38],[-25,-9],[-20,17],[-17,-5],[-24,-17],[-25,-53],[-27,-31],[-16,-35],[-6,-32],[0,-50],[1,-34],[5,-24]],[[1746,6329],[-4,37],[-18,41],[-13,9],[-3,20],[-16,4],[-10,19],[-26,7],[-7,12],[-3,39],[-27,73],[-23,99],[1,17],[-13,24],[-21,60],[-4,58],[-15,40],[6,59],[-1,62],[-8,55],[10,67],[4,66],[3,65],[-5,96],[-9,61],[-8,34],[4,14],[40,-25],[15,-67],[7,19],[-5,59],[-9,58]],[[750,8094],[-28,-27],[-14,18],[-4,34],[25,25],[15,11],[18,-4],[12,-23],[-24,-34]],[[401,8295],[-18,-11],[-18,13],[-17,20],[28,12],[22,-7],[3,-27]],[[230,8573],[17,-14],[17,8],[23,-19],[27,-10],[-2,-8],[-21,-15],[-21,16],[-11,13],[-24,-5],[-7,7],[2,27]],[[1374,7928],[-15,27],[-25,23],[-8,63],[-36,58],[-15,67],[-26,5],[-44,2],[-33,21],[-57,74],[-27,14],[-49,25],[-38,-6],[-55,33],[-33,31],[-30,-15],[5,-50],[-15,-5],[-32,-15],[-25,-24],[-30,-15],[-4,42],[12,70],[30,22],[-8,18],[-35,-40],[-19,-47],[-40,-51],[20,-35],[-26,-52],[-30,-30],[-28,-22],[-7,-32],[-43,-37],[-9,-33],[-32,-31],[-20,5],[-25,-20],[-29,-24],[-23,-24],[-47,-21],[-5,12],[31,34],[27,22],[29,39],[35,9],[14,29],[38,43],[6,14],[21,26],[5,54],[14,43],[-32,-22],[-9,12],[-15,-26],[-18,36],[-8,-25],[-10,36],[-28,-29],[-17,0],[-3,43],[5,26],[-17,25],[-37,-13],[-23,33],[-19,18],[0,40],[-22,31],[11,41],[23,40],[10,37],[22,5],[19,-11],[23,35],[20,-7],[21,23],[-5,32],[-16,13],[21,28],[-17,-1],[-30,-15],[-8,-16],[-22,16],[-39,-8],[-41,17],[-12,29],[-35,41],[39,30],[62,35],[23,0],[-4,-35],[59,2],[-23,45],[-34,27],[-20,36],[-26,31],[-38,22],[15,38],[49,2],[35,33],[7,35],[28,34],[28,8],[52,32],[26,-5],[42,39],[42,-15],[21,-33],[12,14],[47,-4],[-2,-17],[43,-12],[28,7],[59,-22],[53,-7],[21,-9],[37,11],[42,-21],[31,-10]],[[5664,3208],[3,-22],[-4,-35],[5,-33],[-4,-27],[3,-25],[-58,1],[-2,-229],[19,-58],[18,-45]],[[5644,2735],[-51,-29],[-67,10],[-19,34],[-113,-3],[-4,-5],[-17,32],[-18,3],[-16,-13],[-14,-13]],[[5325,2751],[-2,45],[4,63],[9,66],[2,31],[9,64],[6,30],[16,47],[9,32],[3,53],[-1,41],[-9,25],[-7,44],[-7,43],[2,15],[8,28],[-8,70],[-6,48],[-14,45],[3,14]],[[5342,3555],[11,10],[8,-2],[10,9],[82,-1],[7,-53],[8,-44],[6,-23],[11,-37],[18,6],[9,10],[16,-11],[4,18],[7,42],[17,3],[2,13],[14,0],[-3,-26],[34,1],[1,-46],[5,-27],[-4,-44],[2,-44],[9,-26],[-1,-86],[7,7],[12,-2],[17,11],[13,-5]],[[5338,3577],[-8,54]],[[5330,3631],[12,31],[8,12],[10,-24]],[[5360,3650],[-10,-15],[-4,-19],[-1,-31],[-7,-8]],[[5814,3670],[-1,87],[-7,32]],[[5806,3789],[17,-5],[8,40],[15,-4]],[[5846,3820],[1,-29],[6,-16],[1,-23],[-7,-15],[-11,-38],[-10,-26],[-12,-3]],[[5074,4442],[-23,-8]],[[5051,4434],[-7,50],[2,165],[-6,14],[-1,36],[-10,25],[-8,21],[3,38]],[[5024,4783],[10,8],[6,31],[13,7],[6,21]],[[5059,4850],[10,21],[10,1],[21,-42]],[[5100,4830],[-1,-24],[6,-42],[-6,-29],[3,-19],[-13,-45],[-9,-22],[-5,-45],[1,-46],[-2,-116]],[[4921,4685],[-19,19],[-13,-3],[-10,-18],[-12,15],[-5,24],[-13,16]],[[4849,4738],[-1,41],[7,31],[-1,24],[23,60],[4,49],[7,17],[14,-9],[11,14],[4,19],[22,32],[5,22],[26,30],[15,10],[7,-13],[18,0]],[[5010,5065],[-2,-35],[3,-33],[16,-46],[1,-35],[32,-16],[-1,-50]],[[5024,4783],[-24,1]],[[5000,4784],[-13,6],[-9,-12],[-12,6],[-48,-4],[-1,-41],[4,-54]],[[5817,2407],[-39,-53],[-25,-54],[-10,-47],[-8,-27],[-15,-6],[-5,-35],[-3,-22],[-17,-17],[-23,4],[-13,20],[-12,9],[-14,-17],[-6,-34],[-14,-22],[-13,-32],[-20,-7],[-6,25],[2,44],[-16,68],[-8,11]],[[5552,2215],[0,209],[27,3],[1,256],[21,2],[43,25],[10,-30],[18,29],[9,0],[15,16]],[[5696,2725],[5,-5]],[[5701,2720],[11,-58],[5,-13],[9,-41],[32,-79],[12,-8],[0,-25],[8,-46],[21,-11],[18,-32]],[[5424,4526],[23,5],[5,19],[5,-2],[7,-16],[34,28],[12,28],[15,25],[-3,25],[8,7],[27,-5],[26,33],[20,79],[14,29],[18,12]],[[5635,4793],[3,-31],[16,-44],[0,-30],[-5,-30],[2,-22],[10,-21]],[[5661,4615],[21,-31]],[[5682,4584],[15,-29],[0,-23],[19,-38],[12,-31],[7,-43],[20,-28],[5,-23]],[[5760,4369],[-9,-8],[-18,2],[-21,7],[-10,-6],[-5,-17],[-9,-2],[-10,15],[-31,-36],[-13,7],[-4,-5],[-8,-44],[-21,14],[-20,7],[-18,27],[-23,24],[-15,-23],[-10,-36],[-3,-50]],[[5512,4245],[-18,4],[-19,12],[-16,-38],[-15,-67]],[[5444,4156],[-3,21],[-1,32],[-13,24],[-10,37],[-2,25],[-13,38],[2,21],[-3,31],[2,55],[7,13],[14,73]],[[4920,4352],[-12,-1],[-20,14],[-18,-1],[-33,-12],[-19,-21],[-27,-26],[-6,1]],[[4785,4306],[2,60],[3,9],[-1,28],[-12,30],[-8,5],[-8,19],[6,32],[-3,35],[1,21]],[[4765,4545],[5,0],[1,31],[-2,14],[3,10],[10,9],[-7,57],[-6,30],[2,24],[5,6]],[[4776,4726],[4,6],[8,-10],[21,-1],[5,21],[5,-1],[8,8],[4,-31],[7,9],[11,11]],[[4921,4685],[7,-102],[-11,-60],[-8,-81],[12,-62],[-1,-28]],[[5363,4156],[-4,4],[-16,-9],[-17,9],[-13,-5]],[[5313,4155],[-45,2]],[[5268,4157],[4,57],[-11,47],[-13,12],[-6,33],[-7,10],[1,20]],[[5236,4336],[7,51],[13,69],[8,0],[17,42],[10,2],[16,-30],[19,24],[2,30],[7,29],[4,36],[15,30],[5,50],[6,16],[4,38],[7,45],[24,56],[1,24],[3,13],[-11,28]],[[5393,4889],[1,23],[8,4]],[[5402,4916],[11,-46],[2,-47],[-1,-48],[15,-65],[-15,1],[-8,-6],[-13,8],[-6,-34],[16,-42],[13,-12],[3,-30],[9,-50],[-4,-19]],[[5444,4156],[-2,-39],[-22,17],[-22,19],[-35,3]],[[5856,4245],[-2,-84],[11,-10],[-9,-25],[-10,-19],[-11,-38],[-6,-33],[-1,-58],[-7,-27],[0,-54]],[[5821,3897],[-8,-20],[-1,-43],[-4,-6],[-2,-39]],[[5814,3670],[5,-66],[-2,-37],[5,-42],[16,-40],[15,-91]],[[5853,3394],[-11,8],[-37,-13],[-7,-8],[-8,-46],[6,-32],[-5,-85],[-3,-72],[7,-13],[19,-27],[8,13],[2,-78],[-21,1],[-11,39],[-10,31],[-22,10],[-6,38],[-17,-23],[-22,10],[-10,32],[-17,7],[-13,-2],[-2,23],[-9,1]],[[5342,3555],[-4,22]],[[5360,3650],[8,-8],[9,28],[15,-1],[2,-20],[11,-13],[16,45],[16,35],[7,23],[-1,59],[12,70],[13,37],[18,35],[3,23],[1,26],[5,25],[-2,41],[4,63],[5,45],[8,38],[2,44]],[[5760,4369],[17,-59],[12,-9],[8,12],[12,-5],[16,15],[6,-30],[25,-48]],[[5330,3631],[-22,76]],[[5308,3707],[21,40],[-11,47],[10,19],[19,8],[2,32],[15,-34],[24,-3],[9,34],[3,47],[-3,56],[-13,43],[12,83],[-7,14],[-21,-6],[-7,38],[2,31]],[[6196,4905],[7,-22],[-1,-30],[-16,-17],[12,-20]],[[6198,4816],[-10,-38]],[[6188,4778],[-7,12],[-6,-5],[-16,2],[0,21],[-2,20],[9,34],[10,32]],[[6176,4894],[12,-7],[8,18]],[[5333,5678],[-95,-136],[-81,-142],[-39,-32]],[[5118,5368],[-31,-7],[0,46],[-13,12],[-17,20],[-7,34],[-94,157],[-93,156]],[[4863,5786],[-105,174]],[[4758,5960],[1,14],[0,5]],[[4759,5979],[0,85],[44,53],[28,11],[23,19],[11,36],[32,29],[1,53],[16,6],[13,27],[36,12],[5,28],[-7,15],[-10,76],[-1,43],[-11,46]],[[4939,6518],[27,39],[30,13],[17,30],[27,21],[47,13],[46,6],[14,-11],[26,29],[30,0],[11,-16],[19,4]],[[5233,6646],[-5,-37],[4,-68],[-6,-60],[-18,-40],[3,-54],[23,-43],[0,-17],[17,-29],[12,-129]],[[5263,6169],[9,-63],[1,-34],[-5,-58],[2,-33],[-3,-39],[2,-45],[-11,-30],[17,-53],[1,-30],[10,-40],[13,13],[22,-34],[12,-45]],[[5969,6111],[-7,-29],[-6,-54],[-8,-37],[-6,-13],[-10,23],[-12,33],[-20,102],[-3,-6],[12,-76],[17,-72],[21,-112],[10,-39],[9,-40],[25,-80],[-6,-12],[1,-47],[33,-65],[4,-14]],[[6023,5573],[-110,0],[-107,0],[-112,0]],[[5694,5573],[0,264],[0,255],[-8,58],[7,45],[-5,30],[10,35]],[[5698,6260],[37,1],[27,-19],[28,-21],[13,-11],[21,22],[11,21],[25,6],[20,-9],[7,-36],[7,24],[22,-17],[22,-4],[13,18]],[[6176,4894],[-10,23],[-11,42],[-12,23],[-8,25],[-24,29],[-19,0],[-7,15],[-16,-16],[-17,32],[-8,-53],[-33,15]],[[6011,5029],[-3,28],[12,106],[3,48],[9,22],[20,11],[14,41]],[[6066,5285],[16,-83],[8,-66],[15,-35],[38,-67],[16,-41],[15,-42],[8,-24],[14,-22]],[[6188,4778],[-6,-26],[10,-39],[10,-35],[11,-26],[90,-85],[24,1]],[[6327,4568],[-79,-216],[-36,-3],[-25,-51],[-17,-1],[-8,-23]],[[6162,4274],[-19,0],[-11,25],[-26,-30],[-8,-30],[-18,5],[-6,9],[-7,-2],[-9,0],[-35,61],[-19,0],[-10,24],[0,40],[-14,12]],[[5980,4388],[-17,79],[-12,16],[-5,29],[-14,35],[-17,5],[9,41],[15,2],[4,22]],[[5943,4617],[0,64]],[[5943,4681],[8,75],[13,20],[3,30],[12,55],[17,35],[11,71],[4,62]],[[4765,4545],[-8,2],[-5,-29],[-8,0],[-6,16],[2,28],[-11,44],[-8,-8],[-6,-1]],[[4715,4597],[-7,-4],[0,26],[-4,19],[0,21],[-6,30],[-7,25],[-23,0],[-6,-13],[-8,-2],[-4,-15],[-4,-20],[-14,-32]],[[4632,4632],[-13,43],[-10,28],[-8,9],[-6,14],[-4,32],[-4,16],[-8,12]],[[4579,4786],[13,35],[8,-2],[7,13],[6,0],[5,9],[-3,24],[3,7],[1,25]],[[4619,4897],[13,-1],[20,-17],[6,1],[3,8],[15,-6],[4,5]],[[4680,4887],[1,-27],[5,0],[7,10],[5,-3],[7,-18],[12,-5],[8,15],[9,10],[6,10],[6,-2],[6,-16],[3,-20],[12,-30],[-6,-18],[-1,-24],[6,7],[3,-8],[-1,-21],[8,-21]],[[5029,4419],[-44,-42],[-15,-25],[-25,-21],[-25,21]],[[5000,4784],[-2,-22],[12,-37],[0,-52],[2,-57],[7,-26],[-6,-65],[2,-35],[8,-46],[6,-25]],[[5308,3707],[-29,73],[-18,59],[-17,74],[1,24],[6,23],[7,52],[5,54]],[[5263,4066],[10,4],[40,-1],[0,86]],[[4532,4937],[3,32]],[[4535,4969],[31,2],[6,17],[9,1],[11,-17],[8,-1],[9,13],[6,-21],[-12,-16],[-12,1],[-12,15],[-10,-16],[-5,-1],[-7,-10],[-25,1]],[[4579,4786],[-15,30],[-11,5],[-7,20],[1,11],[-9,15],[-2,15]],[[4536,4882],[15,12],[9,-2],[8,8],[51,-3]],[[5263,4066],[-5,10],[10,81]],[[6155,3872],[-20,-28],[-7,-30],[-10,-6],[-4,-50],[-9,-29],[-5,-48],[-12,-24]],[[6088,3657],[-40,72],[-1,42],[-101,146],[-5,8]],[[5941,3925],[0,76],[8,29],[14,48],[10,52],[-13,82],[-3,36],[-13,50]],[[5944,4298],[17,43],[19,47]],[[6162,4274],[-24,-81],[0,-262],[17,-59]],[[4785,4306],[-7,0],[-29,34],[-25,55],[-24,39],[-18,46]],[[4682,4480],[6,23],[2,21],[12,39],[13,34]],[[5412,5635],[-20,-27],[-15,39],[-44,31]],[[5263,6169],[13,17],[3,30],[-3,30],[19,28],[8,23],[14,20],[2,55]],[[5319,6372],[32,-24],[12,6],[23,-12],[37,-32],[13,-64],[25,-14],[39,-30],[30,-36],[13,19],[13,33],[-6,55],[9,35],[20,33],[19,10],[37,-14],[10,-33],[10,0],[9,-12],[28,-8],[6,-24]],[[5694,5573],[0,-144],[-32,0],[0,-30]],[[5662,5399],[-111,137],[-111,138],[-28,-39]],[[5804,1914],[10,-22],[-9,-35],[-4,-23],[-16,-11],[-5,-23],[-10,-7],[-21,55],[15,45],[15,28],[13,15],[12,-22]],[[6376,3098],[7,-31],[7,-47],[4,-87],[7,-33],[-2,-35],[-5,-21],[-10,42],[-5,-21],[5,-53],[-2,-31],[-8,-16],[-1,-61],[-11,-84],[-14,-99],[-17,-136],[-11,-100],[-12,-83],[-23,-17],[-24,-30],[-16,18],[-22,26],[-8,38],[-2,63],[-10,58],[-2,51],[5,52],[13,12],[0,24],[13,55],[2,46],[-6,34],[-5,45],[-2,66],[9,40],[4,46],[14,2],[15,15],[11,13],[12,1],[16,41],[23,44],[8,36],[-4,31],[12,-9],[15,50],[1,43],[9,33],[10,-31]],[[4661,5043],[10,13],[4,42],[9,2],[20,-20],[15,14],[11,-5],[4,16],[112,1],[6,50],[-5,9],[-13,310],[-14,310],[43,1]],[[5118,5368],[0,-165],[-15,-48],[-2,-44],[-25,-11],[-38,-7],[-10,-25],[-18,-3]],[[4680,4887],[1,22],[-2,28],[-11,20],[-5,41],[-2,45]],[[4759,5979],[-4,0],[0,-39],[-17,-2],[-9,-16],[-13,0],[-10,9],[-23,-8],[-9,-56],[-9,-5],[-13,-90],[-38,-78],[-9,-99],[-12,-32],[-3,-26],[-63,-6]],[[4527,5531],[1,34],[11,19],[9,38],[-2,24],[10,50],[15,46],[9,12],[8,42],[0,38],[10,44],[19,26],[18,74],[0,1],[14,27],[26,8],[22,49],[14,19],[23,60],[-7,90],[10,61],[4,38],[18,49],[28,33],[21,29],[18,75],[9,44],[20,-1],[17,-30],[26,5],[29,-16],[12,-1]],[[5959,3166],[21,6],[34,-21],[7,10],[19,1],[10,22],[17,-1],[30,28],[22,41]],[[6119,3252],[5,-32],[-1,-71],[3,-63],[1,-113],[5,-35],[-8,-51],[-11,-50],[-18,-45],[-25,-27],[-31,-35],[-32,-77],[-10,-13],[-20,-51],[-11,-16],[-3,-52],[14,-54],[5,-42],[0,-22],[5,4],[-1,-70],[-4,-34],[6,-12],[-4,-30],[-11,-26],[-23,-24],[-34,-39],[-12,-26],[3,-30],[7,-5],[-3,-38]],[[5911,2073],[-21,1]],[[5890,2074],[-2,31],[-4,32]],[[5884,2137],[-3,26],[5,80],[-7,51],[-13,101]],[[5866,2395],[29,82],[7,52],[5,6],[3,42],[-5,22],[1,53],[6,50],[0,91],[-15,23],[-13,5],[-6,18],[-13,15],[-23,-1],[-2,27]],[[5840,2880],[-2,51],[84,59]],[[5922,2990],[16,-35],[8,7],[11,-18],[1,-29],[-6,-33],[2,-51],[19,-44],[8,50],[12,15],[-2,92],[-12,52],[-10,23],[-10,-1],[-7,93],[7,55]],[[4661,5043],[-18,49],[-17,53],[-18,19],[-13,21],[-16,-1],[-13,-16],[-14,7],[-10,-23]],[[4542,5152],[-2,38],[8,36],[3,67],[-3,71],[-3,36],[2,36],[-7,34],[-14,31]],[[4526,5501],[6,24],[108,-1],[-5,104],[7,37],[26,6],[-1,184],[91,-4],[0,109]],[[5922,2990],[-15,18],[9,67],[9,25],[-6,60],[6,58],[5,19],[-7,61],[-14,32]],[[5909,3330],[28,-13],[5,-20],[10,-33],[7,-98]],[[5453,1941],[-20,54],[-11,53],[-6,70],[-7,52],[-9,110],[-1,86],[-3,39],[-11,30],[-15,59],[-14,86],[-6,46],[-23,70],[-2,55]],[[5644,2735],[23,16],[18,-4],[11,-16],[0,-6]],[[5552,2215],[0,-266],[-25,-36],[-15,-5],[-17,13],[-13,5],[-4,31],[-11,20],[-14,-36]],[[5412,5635],[7,-112],[10,-19],[1,-22],[11,-25],[-6,-31],[-11,-146],[-1,-93],[-35,-68],[-12,-94],[11,-27],[0,-46],[18,-2],[-3,-34]],[[5393,4889],[-5,-1],[-19,78],[-6,3],[-22,-40],[-21,21],[-15,4],[-8,-10],[-17,2],[-16,-30],[-14,-2],[-34,37],[-13,-17],[-14,1],[-10,27],[-28,27],[-30,-9],[-7,-15],[-4,-42],[-8,-29],[-2,-64]],[[5236,4336],[-29,-26],[-11,4],[-10,-16],[-23,1],[-15,45],[-9,52],[-19,47],[-21,-1],[-25,0]],[[5844,3912],[11,-41],[-1,-42],[-8,-9]],[[5821,3897],[7,-8],[16,23]],[[4526,5501],[1,30]],[[5943,4673],[-4,1],[0,36],[-3,24],[-14,29],[-4,52],[4,53],[-13,5],[-2,-17],[-17,-3],[7,-21],[2,-43],[-15,-40],[-14,-52],[-14,-7],[-23,42],[-11,-15],[-3,-21],[-14,-13],[-1,-15],[-28,0],[-3,15],[-20,2],[-10,-12],[-8,6],[-14,42],[-5,20],[-20,-10],[-8,-34],[-7,-64],[-10,-13],[-8,-8]],[[5663,4612],[-2,3]],[[5635,4793],[0,18],[-10,21],[-1,41],[-5,28],[-10,-4],[3,26],[7,30],[-3,30],[9,22],[-6,17],[7,44],[13,53],[24,-5],[-1,285]],[[6023,5573],[9,-71],[-6,-13],[4,-74],[11,-85],[10,-18],[15,-27]],[[5943,4681],[0,-8]],[[5943,4673],[0,-56]],[[5944,4298],[-17,-33],[-20,0],[-22,-16],[-18,16],[-11,-20]],[[5682,4584],[-19,28]],[[4535,4969],[-11,56],[-14,26],[12,13],[14,51],[6,37]],[[4536,4882],[-4,55]],[[4682,4480],[-8,6],[-20,29],[-14,38],[-5,26],[-3,53]],[[6198,4816],[9,-13],[5,-30],[13,-30],[14,0],[26,18],[30,9],[25,22],[13,5],[10,13],[16,2]],[[6359,4812],[0,-1],[0,-29],[0,-73],[0,-37],[-13,-44],[-19,-60]],[[6359,4812],[9,2],[13,10],[14,8],[14,24],[10,0],[1,-19],[-3,-42],[0,-38],[-6,-26],[-7,-77],[-14,-81],[-17,-91],[-24,-106],[-23,-80],[-33,-98],[-28,-58],[-42,-71],[-25,-55],[-31,-87],[-6,-38],[-6,-17]],[[5890,2074],[-5,-32],[-17,-8],[-16,39],[0,25],[7,27],[3,20],[8,6],[14,-14]],[[5051,4434],[-22,-15]],[[5233,6646],[31,29],[19,-9],[-1,-36],[24,26],[2,-13],[-14,-36],[0,-33],[9,-18],[-3,-62],[-19,-36],[6,-39],[14,-1],[7,-34],[11,-12]],[[6088,3657],[-12,-88],[1,-41],[18,-26],[1,-19],[-8,-43],[2,-22],[-2,-34],[10,-45],[11,-71],[10,-16]],[[5909,3330],[-15,22],[-18,12],[-11,12],[-12,18]],[[5844,3912],[10,8],[31,-1],[56,6]],[[5817,2407],[11,-1],[14,-12],[9,9],[15,-8]],[[5911,2073],[-7,-52],[-3,-60],[-7,-32],[-19,-37],[-5,-10],[-12,-37],[-8,-36],[-16,-52],[-31,-74],[-20,-43],[-21,-33],[-29,-28],[-14,-3],[-3,-20],[-17,10],[-14,-13],[-30,14],[-17,-9],[-12,4],[-28,-29],[-24,-11],[-17,-27],[-13,-2],[-11,26],[-10,1],[-12,32],[-1,-10],[-4,19],[0,42],[-9,48],[9,14],[0,55],[-19,67],[-14,61],[-20,93]],[[5840,2880],[-21,-10],[-15,-29],[-4,-25],[-10,-5],[-24,-59],[-15,-47],[-10,-2],[-9,9],[-31,8]],[[9038,1064],[27,-25],[15,10],[22,14],[16,-5],[2,-85],[-9,-25],[-3,-58],[-10,20],[-19,-50],[-6,4],[-17,2],[-17,62],[-4,47],[-16,62],[1,33],[18,-6]],[[8987,3005],[10,-57],[18,28],[9,-31],[13,-28],[-3,-32],[6,-61],[5,-36],[7,-9],[7,-61],[-3,-37],[9,-49],[31,-38],[19,-34],[19,-31],[-4,-17],[16,-45],[11,-78],[11,16],[11,-32],[7,12],[5,-77],[19,-44],[13,-27],[22,-58],[8,-58],[1,-41],[-2,-44],[13,-61],[-2,-64],[-5,-33],[-7,-64],[1,-41],[-6,-52],[-12,-65],[-21,-35],[-10,-56],[-9,-36],[-8,-61],[-11,-36],[-7,-54],[-4,-49],[2,-23],[-16,-25],[-31,-3],[-26,-29],[-13,-28],[-17,-31],[-23,32],[-17,13],[5,37],[-15,-14],[-25,-52],[-24,20],[-15,11],[-16,5],[-27,21],[-18,44],[-5,55],[-7,36],[-13,29],[-27,9],[9,35],[-7,53],[-13,-50],[-25,-13],[14,40],[5,41],[10,36],[-2,53],[-22,-61],[-18,-25],[-10,-57],[-22,29],[1,39],[-18,52],[-14,26],[5,17],[-36,44],[-19,2],[-27,35],[-50,-7],[-36,-26],[-31,-24],[-27,5],[-29,-37],[-24,-17],[-6,-37],[-10,-29],[-23,-2],[-18,-6],[-24,13],[-20,-8],[-19,-3],[-17,-39],[-8,3],[-14,-20],[-13,-23],[-21,3],[-18,0],[-30,46],[-15,14],[1,41],[14,10],[4,16],[-1,26],[4,50],[-3,42],[-15,73],[-4,41],[1,41],[-11,46],[-1,22],[-12,28],[-4,56],[-16,57],[-4,31],[13,-31],[-10,66],[14,-20],[8,-28],[0,37],[-14,56],[-3,23],[-6,21],[3,42],[6,17],[4,36],[-3,42],[11,52],[2,-55],[12,50],[22,24],[14,30],[21,27],[13,5],[7,-9],[22,27],[17,8],[4,16],[8,6],[15,-1],[29,21],[15,32],[7,38],[17,36],[1,29],[1,39],[19,61],[12,-62],[12,14],[-10,34],[9,35],[12,-15],[3,54],[15,36],[7,28],[14,12],[0,20],[13,-8],[0,18],[12,10],[14,10],[20,-33],[16,-43],[17,0],[18,-7],[-6,40],[13,57],[13,19],[-5,18],[12,41],[17,25],[14,-8],[24,13],[-1,37],[-20,24],[15,10],[18,-18],[15,-29],[23,-19],[8,8],[17,-22],[17,20],[10,-6],[7,14],[12,-36],[-7,-38],[-11,-29],[-9,-3],[3,-28],[-8,-36],[-10,-36],[2,-20],[22,-39],[21,-23],[15,-25],[20,-43],[8,0],[14,-18],[4,-22],[27,-25],[18,25],[6,38],[5,32],[4,40],[8,57],[-4,35],[2,20],[-3,42],[4,54],[5,14],[-4,24],[7,38],[5,40],[1,20],[10,27],[8,-35],[2,-45],[7,-9],[1,-30],[10,-36],[2,-41],[-1,-26]],[[9954,2748],[9,-21],[-4,-37],[-17,-10],[-16,9],[-2,31],[10,25],[13,-9],[7,12]],[[0,2804],[9981,-17],[-17,-15],[-4,26],[14,15],[9,4],[-9983,22]],[[0,2839],[0,-35]],[[0,2839],[6,4],[-4,-35],[-2,-4]],[[9604,2479],[23,-44],[14,-33],[-10,-17],[-16,19],[-19,32],[-18,38],[-19,51],[-4,24],[12,-1],[16,-24],[12,-24],[9,-21]],[[9805,1055],[6,-30],[20,29],[8,-30],[0,-30],[-10,-33],[-18,-53],[-14,-29],[10,-35],[-22,-1],[-23,-27],[-8,-47],[-16,-72],[-21,-32],[-14,-21],[-26,2],[-18,23],[-30,5],[-5,27],[15,53],[35,71],[18,13],[20,28],[24,37],[16,38],[13,53],[10,18],[5,40],[19,34],[6,-31]],[[9849,1397],[20,-76],[1,49],[13,-19],[4,-55],[22,-23],[19,-6],[16,28],[14,-9],[-7,-63],[-8,-42],[-22,1],[-7,-22],[3,-30],[-4,-14],[-11,-38],[-14,-50],[-21,-28],[-5,19],[-12,10],[16,59],[-9,40],[-30,28],[1,26],[20,25],[5,56],[-1,46],[-12,48],[1,13],[-13,29],[-22,64],[-12,51],[11,5],[15,-39],[21,-19],[8,-64]],[[9329,3503],[-8,-7],[-12,28],[-12,45],[-6,55],[4,7],[3,-21],[8,-17],[14,-45],[13,-25],[-4,-20]],[[9221,3600],[-15,-6],[-4,-20],[-15,-18],[-15,-17],[-14,1],[-23,20],[-16,20],[2,23],[25,-11],[15,6],[5,34],[4,2],[2,-38],[16,5],[8,25],[16,25],[-4,43],[17,1],[6,-12],[-1,-39],[-9,-44]],[[8916,3806],[48,-49],[51,-41],[19,-37],[16,-36],[4,-42],[46,-45],[7,-38],[-25,-8],[6,-47],[25,-48],[18,-76],[15,3],[-1,-32],[22,-12],[-9,-14],[30,-30],[-3,-21],[-18,-5],[-7,19],[-24,8],[-28,11],[-22,45],[-16,40],[-14,63],[-36,31],[-24,-20],[-17,-24],[4,-53],[-22,-25],[-16,12],[-28,3]],[[9253,3670],[-9,-19],[-5,42],[-6,28],[-13,23],[-16,31],[-20,21],[8,18],[15,-21],[9,-15],[12,-18],[11,-30],[11,-23],[3,-37]],[[9502,3240],[8,-24],[-19,0],[-11,44],[17,-17],[5,-3]],[[9467,3284],[-11,-1],[-17,7],[-5,11],[1,28],[19,-11],[9,-15],[4,-19]],[[9490,3304],[-4,-13],[-21,62],[-5,43],[9,0],[10,-58],[11,-34]],[[9440,3394],[1,-14],[-22,30],[-15,26],[-10,24],[4,7],[13,-17],[23,-33],[6,-23]],[[9375,3465],[-5,-4],[-13,17],[-11,29],[1,12],[17,-30],[11,-24]],[[9661,2811],[-9,-10],[-9,32],[1,19],[17,-41]],[[9641,2921],[4,-58],[-7,9],[-6,-4],[-4,20],[0,55],[13,-22]],[[5571,6998],[-3,-24],[4,-31],[11,-17]],[[5583,6926],[0,-19],[-9,-11],[-2,-23],[-13,-35]],[[5559,6838],[-5,5],[0,16],[-15,24],[-3,34],[2,49],[4,23],[-4,11]],[[5538,7000],[-2,23],[12,35],[1,-13],[8,6]],[[5557,7051],[6,-19],[7,-8],[1,-26]],[[5471,7448],[-2,-29],[-16,0],[6,-16],[-9,-46]],[[5450,7357],[-6,-12],[-24,-2],[-14,-16],[-23,6]],[[5383,7333],[-40,18],[-6,25],[-27,-12],[-4,-14],[-16,10]],[[5290,7360],[-15,2],[-12,13],[4,18],[-1,12]],[[5266,7405],[8,4],[14,-19],[4,18],[25,-3],[20,13],[13,-2],[9,-15],[2,13],[-4,46],[10,9],[10,34]],[[5377,7503],[21,-24],[15,30],[10,5],[22,-22],[13,4],[13,-14]],[[5471,7482],[-3,-9],[3,-25]],[[5092,7680],[20,-6],[26,15],[17,-31],[16,-17]],[[5171,7641],[-4,-49]],[[5167,7592],[-7,-2],[-3,-41]],[[5157,7549],[-24,33],[-14,-5],[-20,33],[-13,29],[-13,1],[-4,26]],[[5069,7666],[23,14]],[[5629,7169],[8,-29],[11,5],[21,-11],[41,-4],[13,18],[33,17],[20,-26],[17,-8]],[[5793,7131],[-15,-29],[-10,-52],[9,-41]],[[5725,6996],[0,-35],[-26,-7],[-19,25],[-22,-20],[-21,2]],[[5637,6961],[-2,48],[-14,23]],[[5621,7032],[5,10],[-3,8],[4,23],[11,23],[-14,31],[-2,26],[7,16]],[[5527,7214],[10,0],[-7,-31],[14,-28],[-4,-34],[-7,-3]],[[5533,7118],[-5,-6],[-9,-17],[-4,-40]],[[5515,7055],[-25,28],[-10,30],[-11,16],[-12,26],[-6,23],[-14,33],[6,30],[10,-17],[6,15],[13,2],[24,-12],[19,1],[12,-16]],[[5652,7864],[27,0],[30,27],[6,40],[23,23],[-3,32]],[[5735,7986],[17,12],[30,28]],[[5782,8026],[29,-18],[4,-18],[15,9],[27,-17],[3,-34],[-6,-19],[17,-47],[12,-13],[-2,-13],[19,-13],[8,-19],[-11,-16],[-23,3],[-5,-7],[7,-24],[6,-46]],[[5882,7734],[-23,-4],[-9,-16],[-2,-36],[-11,7],[-25,-4],[-7,17],[-11,-12],[-10,10],[-22,2],[-31,17],[-28,5],[-22,-1],[-15,-20],[-13,-2]],[[5653,7697],[-1,31],[-8,34],[17,14],[0,29],[-8,27],[-1,32]],[[5290,7360],[-3,-29],[-12,-12],[-20,9],[-6,-29],[-14,-3],[-5,12],[-15,-25],[-13,-3],[-12,15]],[[5190,7295],[-10,32],[-13,-11],[0,32],[21,40],[-1,19],[12,-7],[8,12]],[[5207,7412],[24,0],[5,15],[30,-22]],[[5377,7503],[-16,30],[-14,18],[-3,30],[-5,21],[21,16],[10,18],[20,14],[7,13],[7,-8],[13,8]],[[5417,7663],[13,-23],[21,-7],[-2,-19],[15,-15],[4,18],[19,-8],[3,-22],[20,-5],[13,-35]],[[5523,7547],[-8,0],[-4,-13],[-7,-3],[-2,-16],[-5,-4],[-1,-7],[-9,-7],[-12,1],[-4,-16]],[[5352,7986],[-17,-58],[-29,40],[-4,30],[41,24],[9,-36]],[[5275,7941],[-18,-11],[-21,10]],[[5236,7940],[-11,39],[-1,74],[5,19],[8,22],[24,4],[10,20],[22,20],[-1,-37],[-8,-23],[4,-20],[15,-11],[-7,-27],[-8,8],[-20,-52],[7,-35]],[[5275,7941],[1,-28],[28,-16],[-1,-26],[29,14],[15,19],[32,-28],[13,-23]],[[5392,7853],[6,-37],[-8,-19],[11,-25],[6,-39],[-2,-24],[12,-46]],[[5207,7412],[3,52],[14,49],[-40,13],[-13,19]],[[5171,7545],[2,31],[-6,16]],[[5171,7641],[-5,75],[17,0],[7,27],[6,66],[-5,24]],[[5191,7833],[6,15],[23,4],[5,-16],[19,36],[-6,27],[-2,41]],[[4749,7000],[1,51],[-11,31],[39,52],[34,-13],[37,1],[30,-12],[23,3],[45,-2]],[[4947,7111],[11,-28],[51,-33],[10,16],[31,-33],[32,10]],[[5082,7043],[2,-42],[-26,-48],[-36,-15],[-2,-24],[-18,-40],[-10,-58],[11,-41],[-16,-32],[-6,-47],[-21,-14],[-20,-56],[-35,-1],[-27,2],[-17,-26],[-11,-27],[-13,6],[-11,24],[-8,42],[-26,11]],[[4792,6657],[-2,24],[10,26],[4,20],[-9,21],[7,48],[-11,43],[12,5],[1,34],[5,11],[0,56],[13,19],[-8,36],[-16,3],[-5,-9],[-16,0],[-7,35],[-11,-11],[-10,-18]],[[5675,8143],[3,42],[-10,-9],[-18,26],[-2,41],[35,20],[35,10],[30,-12],[29,3]],[[5777,8264],[4,-13],[-20,-41],[8,-67],[-12,-23]],[[5757,8120],[-22,0],[-24,27],[-13,8],[-23,-12]],[[5794,8952],[-4,-50],[42,-48],[-26,-54],[33,-82],[-19,-61],[25,-54],[-11,-47],[41,-49],[-11,-36],[-25,-42],[-60,-92]],[[5779,8337],[-50,-5],[-49,-27],[-45,-15],[-16,39],[-27,24],[6,71],[-14,64],[14,42],[25,45],[63,78],[19,15],[-3,31],[-39,34]],[[5663,8733],[-9,27],[-1,111],[-43,49],[-37,35]],[[5573,8955],[17,19],[30,-38],[37,4],[30,-18],[26,32],[14,53],[43,24],[35,-29],[-11,-50]],[[3485,4159],[7,31],[3,32]],[[3501,4406],[9,-7],[21,-17],[29,-61],[5,-30]],[[5265,7020],[-9,-56],[-13,15],[-6,48],[5,27],[18,27],[5,-61]],[[5157,7549],[6,-6],[8,2]],[[5190,7295],[-2,-20],[9,-27],[-10,-22],[7,-55],[15,-9],[-3,-32]],[[5206,7130],[-25,-40],[-55,19],[-40,-23],[-4,-43]],[[4947,7111],[14,43],[5,143],[-28,75],[-21,37],[-42,27],[-3,53],[36,15],[47,-18],[-9,81],[26,-31],[65,56],[8,59],[24,15]],[[4827,7861],[-21,15],[-17,-1],[6,38],[-6,39]],[[4789,7952],[23,3],[30,-45],[-15,-49]],[[4916,8203],[-30,-77],[29,9],[30,0],[-7,-59],[-25,-64],[29,-4],[2,-8],[25,-85],[19,-11],[17,-82],[8,-28],[33,-14],[-3,-46],[-14,-21],[11,-37],[-25,-38],[-37,1],[-48,-20],[-13,14],[-18,-33],[-26,8],[-19,-28],[-15,15],[41,75],[25,16],[-1,0],[-43,12],[-8,28],[29,22],[-15,39],[5,47],[42,-6],[4,41],[-19,45],[0,1],[-34,12],[-7,20],[10,32],[-9,19],[-15,-33],[-1,69],[-14,36],[10,75],[21,58],[23,-6],[33,6]],[[5658,6557],[15,-24],[22,4],[20,-5],[0,-13],[15,9],[-4,-21],[-40,-7],[1,12],[-34,14],[5,31]],[[5723,6924],[-17,2],[-14,7],[-34,-18],[19,-41],[-14,-12],[-15,0],[-15,37],[-5,-15],[6,-43],[14,-34],[-10,-16],[15,-33],[14,-21],[0,-40],[-25,19],[8,-37],[-18,-7],[11,-64],[-19,-1],[-23,32],[-10,57],[-5,48],[-11,33],[-14,41],[-2,20]],[[5583,6926],[18,6],[11,16],[15,-2],[5,13],[5,2]],[[5522,7289],[7,-27],[9,-21],[-11,-27]],[[5515,7055],[-3,-12]],[[5512,7043],[-26,27],[-16,26],[-26,21],[-23,53],[6,5],[-13,30],[-1,25],[-17,11],[-9,-31],[-8,24],[0,25],[1,1]],[[5380,7260],[20,-2],[5,12],[9,-12],[11,-1],[0,20],[10,7],[2,29],[23,19]],[[5460,7332],[8,-9],[21,-30],[23,-14],[10,10]],[[5471,7448],[14,-18],[10,-8],[24,9],[2,14],[11,3],[14,11],[3,-5],[13,9],[6,17],[9,4],[30,-21],[6,7]],[[5613,7470],[15,-20],[2,-19]],[[5630,7431],[-17,-15],[-13,-49],[-17,-48],[-22,-14]],[[5561,7305],[-17,3],[-22,-19]],[[5460,7332],[-6,24],[-4,1]],[[4827,7861],[5,-51],[-21,-65],[-49,-42],[-40,11],[23,75],[-15,73],[38,56],[21,34]],[[4597,8765],[-7,-47],[31,-49],[-36,-54],[-80,-50],[-24,-13],[-36,11],[-78,23],[28,31],[-61,35],[49,14],[-1,21],[-58,17],[19,47],[42,11],[43,-49],[42,39],[35,-20],[45,38],[47,-5]],[[5431,6738],[-10,-56],[4,-23],[-6,-37],[-21,28],[-14,7],[-39,37],[4,37],[32,-7],[28,8],[22,6]],[[5255,6952],[17,-51],[-4,-95],[-13,5],[-11,-24],[-10,19],[-2,86],[-6,41],[15,-3],[14,22]],[[5383,7333],[-3,-36],[7,-30]],[[5387,7267],[-22,10],[-23,-25],[1,-36],[-3,-21],[9,-36],[26,-36],[14,-60],[31,-57],[22,0],[7,-16],[-8,-14],[25,-26],[20,-22],[24,-37],[3,-14],[-5,-25],[-16,33],[-24,12],[-12,-47],[20,-26],[-3,-38],[-11,-4],[-15,-61],[-12,-6],[0,22],[6,38],[6,16],[-11,41],[-8,37],[-12,9],[-8,31],[-18,13],[-12,28],[-21,5],[-21,33],[-26,46],[-19,42],[-8,71],[-14,8],[-23,24],[-12,-10],[-16,-33],[-12,-6]],[[5557,7051],[5,16]],[[5562,7067],[7,5],[4,24],[5,4],[4,-10],[5,-4],[3,-12],[5,-3],[5,-14],[4,1],[-3,-18],[-3,-8],[1,-6]],[[5599,7026],[-6,-2],[-17,-12],[-1,-14],[-4,0]],[[5631,7894],[-2,18],[3,20],[-13,11],[-29,13]],[[5590,7956],[-6,60]],[[5584,8016],[32,22],[47,-4],[27,7],[4,-15],[15,-5],[26,-35]],[[5652,7864],[-7,22],[-14,8]],[[5584,8016],[1,54],[14,45],[26,25],[22,-54],[22,2],[6,55]],[[5757,8120],[14,-17],[2,-34],[9,-43]],[[5739,7455],[6,11],[19,7],[20,-22],[12,-3],[12,-19],[-2,-25],[11,-11],[4,-30],[9,-19],[-2,-10],[5,-8],[-7,-5],[-16,2],[-3,10],[-6,-6],[2,-12],[-7,-23],[-5,-25],[-7,-8]],[[5784,7259],[-5,33],[3,31],[-1,31],[-16,43],[-9,30],[-9,21],[-8,7]],[[5599,7026],[9,5],[13,1]],[[5538,7000],[-6,6],[-8,23],[-12,14]],[[5533,7118],[8,-12],[4,-10],[9,-8],[10,-15],[-2,-6]],[[5092,7680],[14,20],[24,105],[38,30],[23,-2]],[[5863,8988],[-47,-29],[-22,-7]],[[5573,8955],[-17,-3],[-4,-47],[-53,11],[-7,-40],[-27,1],[-18,-51],[-28,-80],[-43,-101],[10,-25],[-10,-28],[-27,1],[-18,-67],[2,-96],[17,-36],[-9,-84],[-23,-50],[-12,-41]],[[5306,8219],[-19,44],[-55,-83],[-37,-17],[-38,37],[-10,77],[-9,166],[26,46],[73,60],[55,74],[51,100],[66,139],[47,54],[76,90],[61,32],[46,-4],[42,59],[51,-3],[50,14],[87,-52],[-36,-19],[30,-45]],[[5686,9583],[-62,-29],[-49,16],[19,19],[-16,23],[57,14],[11,-27],[40,-16]],[[5506,9716],[92,-54],[-70,-28],[-15,-53],[-25,-13],[-13,-60],[-34,-3],[-59,44],[25,26],[-42,20],[-54,61],[-21,56],[75,26],[16,-25],[39,1],[11,24],[40,3],[35,-25]],[[5706,9767],[55,-26],[-41,-38],[-81,-9],[-82,12],[-5,20],[-40,1],[-30,33],[86,20],[40,-17],[28,21],[70,-17]],[[5392,7853],[19,21],[43,33],[35,25],[28,-13],[2,-17],[27,-1]],[[5546,7901],[34,-8],[51,1]],[[5653,7697],[14,-63],[-3,-20],[-14,-9],[-25,-59],[7,-33],[-6,5]],[[5626,7518],[-26,27],[-20,-10],[-13,7],[-17,-15],[-14,25],[-11,-9],[-2,4]],[[4792,6657],[-11,-19],[-14,10],[-15,-8],[5,57],[-3,44],[-12,6],[-7,28],[2,47],[11,26],[2,29],[6,43],[-1,30],[-5,26],[-1,24]],[[5630,7431],[12,16],[17,-8],[18,-1],[13,-17],[10,11],[20,7],[7,16],[12,0]],[[5784,7259],[12,-13],[13,12],[13,-13]],[[5822,7245],[0,-18],[-13,-16],[-9,7],[-7,-87]],[[5629,7169],[-5,13],[6,12],[-7,9],[-8,-16],[-17,21],[-2,29],[-17,17],[-3,23],[-15,28]],[[8989,7637],[28,-127],[-41,23],[-17,-103],[27,-74],[-1,-50],[-21,43],[-18,-55],[-5,60],[3,70],[-3,77],[6,55],[2,96],[-17,70],[3,98],[25,33],[-11,34],[13,10],[7,-48],[10,-69],[-1,-71],[11,-72]],[[5546,7901],[6,32],[38,23]],[[0,8945],[68,-55],[73,-71],[-3,-45],[19,-18],[-6,52],[75,-10],[55,-68],[-28,-31],[-46,-7],[0,-70],[-11,-15],[-26,2],[-22,25],[-36,21],[-7,31],[-28,12],[-31,-10],[-16,25],[6,27],[-33,-17],[13,-34],[-16,-30],[0,286]],[[0,9128],[9999,-49],[-30,-4],[-5,23],[-9964,30]],[[0,9128],[4,3],[23,0],[40,-21],[-2,-9],[-29,-18],[-36,-4],[0,49]],[[8988,9250],[-42,-1],[-57,8],[-5,4],[27,29],[34,6],[40,-27],[3,-19]],[[9186,9384],[-32,-28],[-44,6],[-52,29],[7,23],[51,-11],[70,-19]],[[9029,9419],[-22,-54],[-102,2],[-46,-17],[-55,47],[15,49],[37,14],[73,-3],[100,-38]],[[6598,9071],[-17,-6],[-91,9],[-7,32],[-50,19],[-4,39],[28,15],[-1,39],[55,62],[-25,8],[66,64],[-7,32],[62,38],[91,46],[93,14],[48,26],[54,10],[19,-29],[-19,-22],[-98,-36],[-85,-34],[-86,-68],[-42,-70],[-43,-69],[5,-60],[54,-59]],[[6363,7325],[-12,-43],[-27,-12],[-28,-74],[25,-68],[-2,-48],[30,-85]],[[6109,7112],[-35,60],[-32,28],[-24,42],[20,11],[23,60],[-15,29],[41,29],[-1,16],[-25,-12]],[[6061,7375],[1,32],[14,20],[27,5],[5,24],[-7,40],[12,37],[-1,22],[-41,23],[-16,-1],[-17,34],[-21,-12],[-35,26],[0,14],[-10,31],[-22,3],[-2,23],[7,14],[-18,41],[-29,-7],[-8,4],[-7,-17],[-11,3]],[[5777,8264],[31,39],[-29,34]],[[5863,8988],[29,24],[46,-43],[76,-17],[105,-81],[21,-34],[2,-48],[-31,-38],[-45,-19],[-124,55],[-21,-10],[45,-52],[2,-33],[2,-74],[36,-22],[22,-18],[3,34],[-17,31],[18,28],[67,-45],[24,17],[-19,53],[65,70],[25,-4],[26,-25],[16,49],[-23,43],[14,43],[-21,45],[78,-23],[16,-41],[-35,-8],[0,-40],[22,-25],[43,16],[7,45],[58,35],[97,61],[20,-3],[-27,-44],[35,-7],[19,24],[52,2],[42,30],[31,-43],[32,47],[-29,42],[14,23],[82,-21],[39,-23],[100,-82],[19,38],[-28,38],[-1,15],[-34,7],[10,34],[-15,56],[-1,23],[51,65],[18,65],[21,15],[74,-19],[5,-40],[-26,-59],[17,-22],[9,-51],[-6,-98],[31,-44],[-12,-48],[-55,-102],[32,-11],[11,26],[31,19],[7,35],[24,34],[-16,41],[13,48],[-31,6],[-6,40],[22,72],[-36,58],[50,49],[-7,51],[14,1],[15,-40],[-11,-69],[29,-13],[-12,52],[46,28],[58,4],[51,-41],[-25,60],[-2,76],[48,15],[67,-3],[60,9],[-23,37],[33,48],[31,2],[54,35],[74,10],[9,19],[73,7],[23,-16],[62,38],[51,-1],[8,31],[26,31],[66,29],[48,-23],[-38,-18],[63,-11],[7,-35],[25,17],[82,-1],[62,-35],[23,-27],[-7,-37],[-31,-21],[-73,-40],[-21,-22],[35,-10],[41,-18],[25,14],[14,-46],[12,18],[44,12],[90,-12],[6,-34],[116,-10],[2,54],[59,-12],[44,0],[45,-38],[13,-46],[-17,-30],[35,-56],[44,-29],[27,75],[44,-32],[48,19],[53,-22],[21,20],[45,-10],[-20,67],[37,31],[251,-47],[24,-42],[72,-55],[112,13],[56,-12],[23,-29],[-4,-53],[35,-20],[37,15],[49,1],[52,-14],[53,8],[49,-64],[34,23],[-23,46],[13,32],[88,-20],[58,4],[80,-34],[-9960,-31]],[[0,8945],[0,-287],[9963,-31],[-36,5],[25,-38],[17,-59],[13,-20],[3,-29],[-7,-19],[-52,15],[-78,-54],[-25,-8],[-42,-51],[-40,-44],[-11,-32],[-39,49],[-73,-56],[-12,27],[-27,-31],[-37,10],[-9,-47],[-33,-70],[1,-29],[31,-16],[-4,-105],[-25,-2],[-12,-60],[11,-31],[-48,-37],[-10,-82],[-41,-17],[-9,-73],[-40,-67],[-10,49],[-12,105],[-15,160],[13,99],[23,43],[2,34],[43,16],[50,90],[47,74],[50,57],[23,101],[-34,-6],[-17,-59],[-70,-79],[-23,89],[-72,-25],[-69,-120],[23,-44],[-62,-19],[-43,-7],[2,52],[-43,11],[-35,-36],[-85,13],[-91,-22],[-90,-140],[-106,-169],[43,-9],[14,-45],[27,-16],[18,36],[30,-5],[40,-79],[1,-61],[-21,-72],[-3,-86],[-12,-114],[-42,-104],[-9,-50],[-38,-84],[-38,-82],[-18,-43],[-37,-42],[-17,-1],[-17,35],[-38,-53],[-4,-23]],[[7918,9616],[-157,-28],[51,94],[23,8],[21,-4],[70,-41],[-8,-29]],[[6420,9777],[-37,-10],[-25,-5],[-4,-12],[-33,-12],[-30,17],[16,22],[-62,3],[54,13],[43,1],[5,-20],[16,17],[26,12],[42,-15],[-11,-11]],[[7775,9657],[-60,-9],[-78,21],[-46,27],[-21,52],[-38,14],[72,49],[60,16],[54,-36],[64,-70],[-7,-64]],[[5626,7518],[-8,-19],[-5,-29]],[[5380,7260],[7,7]],[[5663,8733],[-47,-21],[-27,-50],[4,-44],[-44,-58],[-54,-61],[-20,-101],[20,-51],[26,-40],[-25,-81],[-29,-17],[-11,-120],[-15,-68],[-34,7],[-16,-57],[-32,-3],[-9,68],[-23,82],[-21,101]],[[6061,7375],[-22,-6],[-18,-23],[-26,-4],[-24,-26],[1,-45],[14,-17],[28,4],[-5,-26],[-31,-12],[-37,-42],[-16,15],[6,34],[-30,21],[5,13],[26,24],[-8,17],[-43,18],[-2,27],[-25,-9],[-11,-40],[-21,-53]]],"bbox":[-180,-55.61183,180,83.64513],"transform":{"scale":[0.036003600360036005,0.013927088708870888],"translate":[-180,-55.61183]}} 2 | -------------------------------------------------------------------------------- /public/lib/mapster_controller.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var geohash = require('plugins/mapster/lib/latlon-geohash.js'); 3 | 4 | import AggResponseTabifyTabifyProvider from 'ui/agg_response/tabify/tabify'; 5 | 6 | var module = require('ui/modules').get('mapster'); 7 | 8 | module.controller('MapsterController', function ($scope, Private) { 9 | const tabifyAggResponse = Private(AggResponseTabifyTabifyProvider); 10 | const palette = ['#DC143C', '#FFD700', '#228B22', '#20B2AA', '#FF00FF', '#D2691E', '#FA8072', '#006400', '#0000CD', '#9400D3', '#A0522D', '#00BFFF', '#3CB371', '#7CFC00', '#8B0000', '#EEE8AA', '#00FF7F','#87CEFA', '#FF69B4', '#B0C4DE']; 11 | 12 | $scope.$watch('esResponse', function (resp) { 13 | if (resp) { 14 | const vis = $scope.vis; 15 | const params = vis.params; 16 | 17 | // Get the column numbers 18 | try { 19 | var timestampAggId = vis.aggs.bySchemaName['timestamp'][0].id; 20 | var coordsAggId = vis.aggs.bySchemaName['coords'][0].id; 21 | var peerIpAggId = vis.aggs.bySchemaName['peer_ip'][0].id; 22 | var sensorAggId = vis.aggs.bySchemaName['sensor'][0].id; 23 | } catch (err) { 24 | console.error("One of the required agregations is not set."); 25 | } 26 | 27 | var targetAggId; 28 | try { 29 | targetAggId = vis.aggs.bySchemaName['target'][0].id; 30 | } catch (err) { 31 | console.log("Target location is not set."); 32 | } 33 | 34 | var timestampColumn = -1; 35 | var coordsColumn = -1; 36 | var peerIpColumn = -1; 37 | var sensorColumn = -1; 38 | var targetColumn = -1; 39 | 40 | // Tabify response 41 | var table = tabifyAggResponse(vis, resp, { 42 | partialRows: params.showPatialRows, 43 | minimalColumns: vis.isHierarchical() && !params.showMeticsAtAllLevels, 44 | asAggConfigResults: true 45 | }); 46 | 47 | table = table.tables[0]; 48 | if (table === undefined) { 49 | $scope.data = null; 50 | return; 51 | } 52 | 53 | for (var i = 0; i < table.columns.length; i++) { 54 | var id = table.columns[i].aggConfig.id; 55 | switch (id) { 56 | case timestampAggId: 57 | timestampColumn = i; 58 | break; 59 | case coordsAggId: 60 | coordsColumn = i; 61 | break; 62 | case peerIpAggId: 63 | peerIpColumn = i; 64 | break; 65 | case sensorAggId: 66 | sensorColumn = i; 67 | break; 68 | case targetAggId: 69 | targetColumn = i; 70 | break; 71 | } 72 | } 73 | 74 | var colors = {}; 75 | 76 | $scope.data = table.rows.map(function(row) { 77 | var sensor = row[sensorColumn].key; 78 | // Fill the colors array 79 | if (colors[sensor] === undefined) { 80 | colors[sensor] = 0; 81 | } else { 82 | colors[sensor] += 1; 83 | } 84 | 85 | // Return data rows 86 | // TODO Add extra information from extra buckets 87 | // FIXME Maybe extra buckets are useless actually. 88 | var data = {}; 89 | data['timestamp'] = row[timestampColumn].key; 90 | data['coords'] = geohash.decode(row[coordsColumn].key); 91 | data['peer_ip'] = row[peerIpColumn].key; 92 | data['sensor'] = sensor; 93 | data['count'] = row[4].key; 94 | if (targetColumn >= 0) { 95 | data['target'] = geohash.decode(row[targetColumn].key); 96 | } 97 | 98 | return data; 99 | }); 100 | 101 | // We sort it so the most used sensors have always the same color 102 | var sorted = []; 103 | for (var c in colors) { 104 | sorted.push([c, colors[c]]); 105 | } 106 | sorted.sort(function(a, b) { return b[1] - a[1]; }); 107 | 108 | // Attribute colors 109 | for (i = 0; i < sorted.length; i++) { 110 | colors[sorted[i][0]] = {name: sorted[i][0], color: palette[i]}; 111 | } 112 | $scope.colors = colors; 113 | 114 | } 115 | 116 | }); 117 | }); 118 | 119 | -------------------------------------------------------------------------------- /public/lib/mapster_directive.js: -------------------------------------------------------------------------------- 1 | var module = require("ui/modules").get("mapster"); 2 | 3 | module.directive("mapster", function (es, $timeout) { 4 | 5 | function link($scope, $element) { 6 | 7 | /* (re)load the configuration */ 8 | function loadConfig() { 9 | return { 10 | /* Global */ 11 | "globe": $scope.vis.params.globe, 12 | "multipleTargets": $scope.vis.params.multipleTargets, 13 | "TargetCoords": JSON.parse($scope.vis.params.TargetCoords), 14 | /* Map */ 15 | "OriginDefaultSize": parseInt($scope.vis.params.OriginDefaultSize), 16 | "OriginMaximumSize": parseInt($scope.vis.params.OriginMaximumSize), 17 | "OriginDyingTime": parseInt($scope.vis.params.OriginDyingTime), 18 | "ObjectShape": $scope.vis.params.ObjectShape, 19 | "ObjectScale": parseFloat($scope.vis.params.ObjectScale), 20 | "ObjectRotation": parseInt($scope.vis.params.ObjectRotation), 21 | "SpecialEffects": $scope.vis.params.SpecialEffects, 22 | "SpecialEffectsScale": parseFloat($scope.vis.params.SpecialEffectsScale), 23 | "SpecialShape": $scope.vis.params.SpecialShape, 24 | "SpecialShapeScale": parseFloat($scope.vis.params.SpecialShapeScale), 25 | "SpecialShapeRemaining": parseInt($scope.vis.params.SpecialShapeRemaining), 26 | "HideUnlocated": $scope.vis.params.HideUnlocated, 27 | "EnableExplosion": $scope.vis.params.EnableExplosion, 28 | "ExplosionFile": $scope.vis.params.ExplosionFile, 29 | "ExplosionHeight": parseInt($scope.vis.params.ExplosionHeight), 30 | "ExplosionWidth": parseInt($scope.vis.params.ExplosionWidth), 31 | "ExplosionDelay": parseInt($scope.vis.params.ExplosionDelay), 32 | "maximumEvents": parseInt($scope.vis.params.maximumEvents) 33 | }; 34 | } 35 | 36 | var config = loadConfig(); 37 | var renderer; 38 | 39 | $scope.open = $scope.open || true; 40 | 41 | $scope.toggleLegend = function () { 42 | $scope.open = !$scope.open; 43 | }; 44 | 45 | if (config.globe === true) { 46 | renderer = require("plugins/mapster/lib/globe.js"); 47 | $element = $element[0]; 48 | } else { 49 | renderer = require("plugins/mapster/lib/map.js"); 50 | } 51 | 52 | renderer.setConfig(config, $timeout); 53 | 54 | /* Render events each time kibana fetches new data */ 55 | $scope.$watch("data", function () { 56 | renderer.renderEvents($scope.data, $scope.colors); 57 | }); 58 | 59 | /* Redraw everything when options are modified */ 60 | $scope.$watch("vis.params", function () { 61 | config = loadConfig(); 62 | renderer.setConfig(config, $timeout); 63 | }); 64 | 65 | /* First map render is a bit postponed otherwise it does not work */ 66 | $timeout(function () { 67 | /* TODO Merge both functions ? */ 68 | renderer.init($element); 69 | renderer.render(); 70 | }, 100) 71 | } 72 | 73 | return { 74 | restrict: "E", 75 | link: link 76 | }; 77 | }); 78 | 79 | -------------------------------------------------------------------------------- /public/lib/topojson.min.js: -------------------------------------------------------------------------------- 1 | !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.topojson=n.topojson||{})}(this,function(n){"use strict";function t(){}function r(n){if(!n)return t;var r,e,o=n.scale[0],i=n.scale[1],u=n.translate[0],f=n.translate[1];return function(n,t){t||(r=e=0),n[0]=(r+=n[0])*o+u,n[1]=(e+=n[1])*i+f}}function e(n){if(!n)return t;var r,e,o=n.scale[0],i=n.scale[1],u=n.translate[0],f=n.translate[1];return function(n,t){t||(r=e=0);var c=Math.round((n[0]-u)/o),a=Math.round((n[1]-f)/i);n[0]=c-r,n[1]=a-e,r=c,e=a}}function o(n,t){for(var r,e=n.length,o=e-t;o<--e;)r=n[o],n[o++]=n[e],n[e]=r}function i(n,t){for(var r=0,e=n.length;e>r;){var o=r+e>>>1;n[o]n?~n:n],i=0,u=e.length;u>i;++i)t.push(r=e[i].slice()),s(r,i);0>n&&o(t,u)}function i(n){return n=n.slice(),s(n,0),n}function u(n){for(var t=[],r=0,o=n.length;o>r;++r)e(n[r],t);return t.length<2&&t.push(t[0].slice()),t}function f(n){for(var t=u(n);t.length<4;)t.push(t[0].slice());return t}function c(n){return n.map(f)}function a(n){var t=n.type;return"GeometryCollection"===t?{type:t,geometries:n.geometries.map(a)}:t in h?{type:t,coordinates:h[t](n)}:null}var s=r(n.transform),l=n.arcs,h={Point:function(n){return i(n.coordinates)},MultiPoint:function(n){return n.coordinates.map(i)},LineString:function(n){return u(n.arcs)},MultiLineString:function(n){return n.arcs.map(u)},Polygon:function(n){return c(n.arcs)},MultiPolygon:function(n){return n.arcs.map(c)}};return a(t)}function a(n,t){function r(t){var r,e=n.arcs[0>t?~t:t],o=e[0];return n.transform?(r=[0,0],e.forEach(function(n){r[0]+=n[0],r[1]+=n[1]})):r=e[e.length-1],0>t?[r,o]:[o,r]}function e(n,t){for(var r in n){var e=n[r];delete t[e.start],delete e.start,delete e.end,e.forEach(function(n){o[0>n?~n:n]=1}),f.push(e)}}var o={},i={},u={},f=[],c=-1;return t.forEach(function(r,e){var o,i=n.arcs[0>r?~r:r];i.length<3&&!i[1][0]&&!i[1][1]&&(o=t[++c],t[c]=r,t[e]=o)}),t.forEach(function(n){var t,e,o=r(n),f=o[0],c=o[1];if(t=u[f])if(delete u[t.end],t.push(n),t.end=c,e=i[c]){delete i[e.start];var a=e===t?t:t.concat(e);i[a.start=t.start]=u[a.end=e.end]=a}else i[t.start]=u[t.end]=t;else if(t=i[c])if(delete i[t.start],t.unshift(n),t.start=f,e=u[f]){delete u[e.end];var s=e===t?t:e.concat(t);i[s.start=e.start]=u[s.end=t.end]=s}else i[t.start]=u[t.end]=t;else t=[n],i[t.start=f]=u[t.end=c]=t}),e(u,i),e(i,u),t.forEach(function(n){o[0>n?~n:n]||f.push([n])}),f}function s(n){return c(n,l.apply(this,arguments))}function l(n,t,r){function e(n){var t=0>n?~n:n;(s[t]||(s[t]=[])).push({i:n,g:c})}function o(n){n.forEach(e)}function i(n){n.forEach(o)}function u(n){"GeometryCollection"===n.type?n.geometries.forEach(u):n.type in l&&(c=n,l[n.type](n.arcs))}var f=[];if(arguments.length>1){var c,s=[],l={LineString:o,MultiLineString:i,Polygon:i,MultiPolygon:function(n){n.forEach(i)}};u(t),s.forEach(arguments.length<3?function(n){f.push(n[0].i)}:function(n){r(n[0].g,n[n.length-1].g)&&f.push(n[0].i)})}else for(var h=0,p=n.arcs.length;p>h;++h)f.push(h);return{type:"MultiLineString",arcs:a(n,f)}}function h(n){var t=n[0],r=n[1],e=n[2];return Math.abs((t[0]-e[0])*(r[1]-t[1])-(t[0]-r[0])*(e[1]-t[1]))}function p(n){for(var t,r=-1,e=n.length,o=n[e-1],i=0;++rt?~t:t]||(o[t]=[])).push(n)})}),i.push(n)}function e(t){return Math.abs(p(c(n,{type:"Polygon",arcs:[t]}).coordinates[0]))}var o={},i=[],u=[];return t.forEach(function(n){"Polygon"===n.type?r(n.arcs):"MultiPolygon"===n.type&&n.arcs.forEach(r)}),i.forEach(function(n){if(!n._){var t=[],r=[n];for(n._=1,u.push(t);n=r.pop();)t.push(n),n.forEach(function(n){n.forEach(function(n){o[0>n?~n:n].forEach(function(n){n._||(n._=1,r.push(n))})})})}}),i.forEach(function(n){delete n._}),{type:"MultiPolygon",arcs:u.map(function(t){var r,i=[];if(t.forEach(function(n){n.forEach(function(n){n.forEach(function(n){o[0>n?~n:n].length<2&&i.push(n)})})}),i=a(n,i),(r=i.length)>1)for(var u,f,c=1,s=e(i[0]);r>c;++c)(u=e(i[c]))>s&&(f=i[0],i[0]=i[c],i[c]=f,s=u);return i})}}function y(n){function t(n,t){n.forEach(function(n){0>n&&(n=~n);var r=o[n];r?r.push(t):o[n]=[t]})}function r(n,r){n.forEach(function(n){t(n,r)})}function e(n,t){"GeometryCollection"===n.type?n.geometries.forEach(function(n){e(n,t)}):n.type in f&&f[n.type](n.arcs,t)}var o={},u=n.map(function(){return[]}),f={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(n,t){n.forEach(function(n){r(n,t)})}};n.forEach(e);for(var c in o)for(var a=o[c],s=a.length,l=0;s>l;++l)for(var h=l+1;s>h;++h){var p,v=a[l],g=a[h];(p=u[v])[c=i(p,g)]!==g&&p.splice(c,0,g),(p=u[g])[c=i(p,v)]!==v&&p.splice(c,0,v)}return u}function d(n,t){return n[1][2]-t[1][2]}function m(){function n(n,t){for(;t>0;){var r=(t+1>>1)-1,o=e[r];if(d(n,o)>=0)break;e[o._=t]=o,e[n._=t=r]=n}}function t(n,t){for(;;){var r=t+1<<1,i=r-1,u=t,f=e[u];if(o>i&&d(e[i],f)<0&&(f=e[u=i]),o>r&&d(e[r],f)<0&&(f=e[u=r]),u===t)break;e[f._=t]=f,e[n._=t=u]=n}}var r={},e=[],o=0;return r.push=function(t){return n(e[t._=o]=t,o++),o},r.pop=function(){if(!(0>=o)){var n,r=e[0];return--o>0&&(n=e[o],t(e[n._=0]=n,0)),r}},r.remove=function(r){var i,u=r._;if(e[u]===r)return u!==--o&&(i=e[o],(d(i,r)<0?n:t)(e[i._=u]=i,u)),u},r}function E(n,t){function o(n){f.remove(n),n[1][2]=t(n),f.push(n)}var i=r(n.transform),u=e(n.transform),f=m();return t||(t=h),n.arcs.forEach(function(n){var r,e,c,a,s=[],l=0;for(e=0,c=n.length;c>e;++e)a=n[e],i(n[e]=[a[0],a[1],1/0],e);for(e=1,c=n.length-1;c>e;++e)r=n.slice(e-1,e+2),r[1][2]=t(r),s.push(r),f.push(r);for(e=0,c=s.length;c>e;++e)r=s[e],r.previous=s[e-1],r.next=s[e+1];for(;r=f.pop();){var h=r.previous,p=r.next;r[1][2] 2 | 3 |
4 |
5 | 6 |
7 |
    8 |
  • 12 | 13 |
    14 |
    17 | {{event.name}} 18 |
    19 |
    20 |
  • 21 |
22 |
23 |
24 | 25 | 26 | 27 | 28 |
TimestampLocationIpAttack type
29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /public/mapster.js: -------------------------------------------------------------------------------- 1 | require('plugins/mapster/mapster.less'); 2 | require('plugins/mapster/lib/mapster_controller.js'); 3 | require('plugins/mapster/lib/mapster_directive.js'); 4 | require('plugins/mapster/mapster_params_editor.js'); 5 | import 'ui/visualize/visualize_legend'; 6 | 7 | function mapsterProvider(Private) { 8 | var TemplateVisType = Private(require('ui/template_vis_type/TemplateVisType')); 9 | var Schemas = Private(require('ui/Vis/Schemas')); 10 | 11 | return new TemplateVisType({ 12 | name: 'mapster', 13 | title: 'Mapster', 14 | description: 'MAPSTER MUCH PIEW MUCH WOW', 15 | icon: 'fa-globe', 16 | template: require('plugins/mapster/mapster.html'), 17 | params: { 18 | defaults: { 19 | /* GENERAL */ 20 | globe: true, 21 | /* 2D MAP */ 22 | ObjectShape: "M7.411 21.39l-4.054 2.61-.266-1.053c-.187-.744-.086-1.534.282-2.199l2.617-4.729c.387 1.6.848 3.272 1.421 5.371zm13.215-.642l-2.646-4.784c-.391 1.656-.803 3.22-1.369 5.441l4.032 2.595.266-1.053c.186-.743.085-1.533-.283-2.199zm-10.073 3.252h2.895l.552-2h-4l.553 2zm1.447-24c-3.489 2.503-5 5.488-5 9.191 0 3.34 1.146 7.275 2.38 11.809h5.273c1.181-4.668 2.312-8.577 2.347-11.844.04-3.731-1.441-6.639-5-9.156zm.012 2.543c1.379 1.201 2.236 2.491 2.662 3.996-.558.304-1.607.461-2.674.461-1.039 0-2.072-.145-2.641-.433.442-1.512 1.304-2.824 2.653-4.024z", 23 | ObjectScale: 0.65, 24 | ObjectRotation: 90, 25 | multipleTargets: false, 26 | TargetCoords: "[48.85, 2.34]", 27 | SpecialShape: "M412.861,78.976c3.404-6.636,2.831-14.159-0.15-20.404c0.84-7.106-1.02-14.321-7.746-19.855c-6.262-5.151-12.523-10.305-18.781-15.457c-11.005-9.055-28.237-11.913-38.941,0c-48.619,54.103-99.461,105.856-152.167,155.725c-39.185-36.605-78.846-72.713-118.223-108.868c-13.82-12.693-33.824-8.71-42.519,6.411c-12.665,6.286-22.931,14.481-31.42,28.468c-4.042,6.664-3.727,15.076,0,21.764c25.421,45.578,74.557,85.651,114.957,122.529c-5.406,4.839-10.772,9.724-16.287,14.461c-54.43,46.742-91.144,76.399-23.029,124.325c0.919,0.647,1.856,0.504,2.789,0.882c1.305,0.602,2.557,1.026,4.004,1.264c0.45,0.017,0.87,0.093,1.313,0.058c1.402,0.114,2.774,0.471,4.195,0.192c36.621-7.18,70.677-35.878,101.576-67.48c30.1,29.669,62.151,58.013,97.395,74.831c8.391,4.005,18.395,1.671,24.855-3.931c10.832,0.818,20.708-5.913,25.665-15.586c0.734-0.454,1.207-0.713,2.002-1.21c15.748-9.838,17.187-29.431,5.534-42.936c-26.313-30.492-54.284-59.478-82.798-87.95C316.426,196.043,380.533,141.939,412.861,78.976z", 28 | SpecialEffects: ['ban_manager_legacy'], 29 | SpecialEffectsScale: 1, 30 | SpecialShapeScale: 0.04, 31 | SpecialShapeRemaining: 600000, 32 | OriginDefaultSize: 4, 33 | OriginMaximumSize: 14, 34 | OriginDyingTime: 10, 35 | HideUnlocated: true, 36 | EnableExplosion: true, 37 | ExplosionFile: "explosion.gif", 38 | ExplosionHeight: 60, 39 | ExplosionWidth: 60, 40 | ExplosionDelay: 2700, 41 | maximumEvents: 10 42 | }, 43 | editor: require('plugins/mapster/mapster_params_editor.html') 44 | }, 45 | schemas: new Schemas([ 46 | { 47 | group: 'metrics', 48 | name: 'count', 49 | title: 'Count', 50 | aggFilter: ['count'], 51 | min: 1, 52 | max: 1 53 | }, 54 | { 55 | group: 'buckets', 56 | name: 'timestamp', 57 | icon: 'fa fa-clock-o', 58 | title: 'Timestamp', 59 | min: 1, 60 | max: 1 61 | }, 62 | { 63 | group: 'buckets', 64 | name: 'coords', 65 | icon: 'fa fa-map-marker', 66 | title: 'Coordinates', 67 | aggFilter: 'geohash_grid', 68 | min: 1, 69 | max: 1 70 | }, 71 | { 72 | group: 'buckets', 73 | name: 'peer_ip', 74 | icon: 'fa fa-server', 75 | title: 'IP', 76 | min: 1, 77 | max: 1 78 | }, 79 | { 80 | group: 'buckets', 81 | name: 'sensor', 82 | icon: 'fa fa-signal', 83 | title: 'Sensor', 84 | min: 1, 85 | max: 1 86 | }, 87 | { 88 | group: 'buckets', 89 | name: 'target', 90 | title: 'Target location', 91 | icon: 'fa fa-dot-circle-o', 92 | min: 0, 93 | max: 1 94 | }, 95 | //FIXME I don't know why but it looks like extra buckets are useless to filter with another field. 96 | { 97 | group: 'buckets', 98 | name: 'extra', 99 | title: 'Extra data to filter', 100 | icon: 'fa fa-database', 101 | min: 0, 102 | max: 10 103 | } 104 | ]) 105 | }); 106 | } 107 | 108 | require('ui/registry/vis_types').register(mapsterProvider); 109 | 110 | -------------------------------------------------------------------------------- /public/mapster.less: -------------------------------------------------------------------------------- 1 | /****************** 2 | ******* Map ******* 3 | ******************/ 4 | .map { 5 | display: flex; 6 | flex: 1 1 100%; 7 | position: relative; 8 | } 9 | 10 | #mapster-legend { 11 | position: absolute; 12 | bottom: 0; 13 | } 14 | 15 | mapster { 16 | border: 1px solid black; 17 | width: 99%; 18 | height: 99%; 19 | } 20 | 21 | .country { 22 | fill: #555; 23 | stroke: white; 24 | stroke-width: 0.5; 25 | } 26 | 27 | .country:hover { 28 | fill: #fb4; 29 | } 30 | 31 | .route { 32 | opacity: 1; 33 | fill: none; 34 | stroke-width: 1; 35 | } 36 | 37 | .origin { 38 | opacity: 1; 39 | } 40 | 41 | .halo { 42 | opacity: 1; 43 | fill: none; 44 | stroke: white; 45 | stroke-width: 1; 46 | } 47 | 48 | /****************** 49 | *** Logs table *** 50 | ******************/ 51 | .logs { 52 | position: absolute; 53 | bottom: 0; 54 | right: 0; 55 | font-family: Montserrat, sans-serif; 56 | width: 50%; 57 | } 58 | 59 | .logs table { 60 | table-layout: fixed; 61 | width: 100%; 62 | } 63 | 64 | .logs thead { 65 | color: #dd5; 66 | } 67 | 68 | .logs td { 69 | padding-right: 10px; 70 | } 71 | 72 | /**************** 73 | * Params editor * 74 | ****************/ 75 | .mapster_helper { 76 | font-weight: normal; 77 | color: #31708f; 78 | background-color: #d9edf7; 79 | border-color: #bcdff1; 80 | padding: 5px; 81 | } 82 | 83 | .help_icon { 84 | color: #31708f; 85 | font-size: 15px; 86 | } 87 | 88 | .help_icon:hover { 89 | color: #ee8811; 90 | } 91 | 92 | -------------------------------------------------------------------------------- /public/mapster_params_editor.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | {{param.title}} 5 | 6 |
7 |
8 | {{param.help}} 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /public/mapster_params_editor.js: -------------------------------------------------------------------------------- 1 | var module = require('ui/modules').get('mapster'); 2 | 3 | module.controller('MapsterParamsEditor', function MapsterParamsEditor($scope) { 4 | $scope.params = [ 5 | { 6 | param: 'globe', 7 | title: 'Use a 3D map', 8 | help: 'Two maps are available. You can select a 2D world map or a 3D globe. Values true: use a 3D globe false: use a 2D world map', 9 | type: 'checkbox' 10 | }, 11 | { 12 | param: 'ObjectShape', 13 | title: 'Object shape', 14 | help: 'This is an svg path as "M150 0 L75 200 L225 200 Z" without quotes. Type string', 15 | type: 'text' 16 | }, 17 | { 18 | param: 'ObjectScale', 19 | title: 'Object scale', 20 | help: 'The scale of your svg path. Depends on the option above. Type float', 21 | type: 'text' 22 | }, 23 | { 24 | param: 'ObjectRotation', 25 | title: 'Object rotation', 26 | help: 'This is the rotation of your object. If the default path is looking at the top, then the value is 90. ', 27 | type: 'text' 28 | }, 29 | { 30 | param: 'multipleTargets', 31 | title: 'Multiple targets', 32 | help: 'If the attacks should point to different targets, then select this. If you uncheck it, then the targets will point to the same unique location. Values true: use multiple directions false: use only one direction', 33 | type: 'checkbox' 34 | }, 35 | { 36 | param: 'TargetCoords', 37 | title: 'Target coordinates', 38 | help: 'If the above option is false (only one target) then the format is like so: [lat, lon]. Otherwise you have to specify multiple locations like this: {"loc1", [lat, lon], "loc2", [lat, lon]}', 39 | type: 'text' 40 | }, 41 | { 42 | param: 'SpecialShape', 43 | title: 'Special shape', 44 | help: 'The svg path marking special events on the map. Type string', 45 | type: 'text' 46 | }, 47 | { 48 | param: 'SpecialEffects', 49 | title: 'Special events', 50 | help: 'The name of the special events. List as ["name", "name2"]. Type list', 51 | type: 'text' 52 | }, 53 | { 54 | param: 'SpecialEffectsScale', 55 | title: 'Special shape scale', 56 | help: 'The scale of your sepcial shape. Type float', 57 | type: 'text' 58 | }, 59 | { 60 | param: 'SpecialShapeRemaining', 61 | title: 'Special shape remaining', 62 | help: 'The time the special shape marking a special events stays on the map in ms. Type integer', 63 | type: 'text' 64 | }, 65 | { 66 | param: 'OriginDefaultSize', 67 | title: 'Default size of origins', 68 | help: 'Events have a small circle near their origin. This is their default size. Type integer', 69 | type: 'text' 70 | }, 71 | { 72 | param: 'OriginMaximumSize', 73 | title: 'Maximum size of origins', 74 | help: 'The maximum size the circle near an event origin can have. Type float', 75 | type: 'text' 76 | }, 77 | { 78 | param: 'OriginDyingTime', 79 | title: 'Origin dying time', 80 | help: 'The time the origin dies in seconds. Type integer', 81 | type: 'text' 82 | }, 83 | { 84 | param: 'HideUnlocated', 85 | title: 'Hide unlocated events', 86 | help: 'If you have unlocated events (0,0) and you want to hide from the map, check this box. Values true: hide events false: show events', 87 | type: 'checkbox' 88 | }, 89 | { 90 | param: 'EnableExplosion', 91 | title: 'Enable explosions', 92 | help: 'If you want to enable explosions for special events. Values true: show explosions false: hide explosions', 93 | type: 'checkbox' 94 | }, 95 | { 96 | param: 'ExplosionFile', 97 | title: 'Explosion file', 98 | help: 'Explosions are shown with a gif file. This is the path to the gif file. The file must be inside the public/img/ folder. Type string', 99 | type: 'text' 100 | }, 101 | { 102 | param: 'ExplosionHeight', 103 | title: 'Explosion height', 104 | help: 'Set the gif height. Type integer', 105 | type: 'text' 106 | }, 107 | { 108 | param: 'ExplosionWidth', 109 | title: 'Explosion width', 110 | help: 'Set the gif width. Type integer', 111 | type: 'text' 112 | }, 113 | { 114 | param: 'ExplosionDelay', 115 | title: 'Explosion duration', 116 | help: 'The duration of the gif animation in ms. Type integer', 117 | type: 'text' 118 | }, 119 | { 120 | param: 'maximumEvents', 121 | title: 'Log table event nb', 122 | help: 'The number of events you want to show in the log table. Type integer', 123 | type: 'text' 124 | } 125 | ]; 126 | 127 | $scope.showhelp = {}; 128 | 129 | }); 130 | 131 | --------------------------------------------------------------------------------