Skip to content

Your personal intelligence agent. Watches the world from multiple data sources and pings you when something changes.

feat: add 3D WebGL globe, CelesTrak space tracking, and switch to AGPLv3

calesthiocfa9515e4cbe
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..be3f7b2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<https://www.gnu.org/licenses/>.
diff --git a/README.md b/README.md
index bae405a..875a86d 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,12 @@
# Crucix
-**Your own intelligence terminal. 26 sources. One command. Zero cloud.**
+**Your own intelligence terminal. 27 sources. One command. Zero cloud.**
[![Node.js 22+](https://img.shields.io/badge/node-22%2B-brightgreen)](#quick-start)
-[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
+[![License: AGPL v3](https://img.shields.io/badge/license-AGPLv3-blue.svg)](LICENSE)
[![Dependencies](https://img.shields.io/badge/dependencies-1%20(express)-orange)](#architecture)
-[![Sources](https://img.shields.io/badge/OSINT%20sources-26-cyan)](#data-sources-26)
+[![Sources](https://img.shields.io/badge/OSINT%20sources-27-cyan)](#data-sources-27)
[![Docker](https://img.shields.io/badge/docker-ready-blue?logo=docker)](#docker)
![Crucix Dashboard](docs/dashboard.png)
@@ -19,11 +19,15 @@
|:---:|:---:|
| ![Boot](docs/boot.png) | ![Map](docs/map.png) |
+| 3D Globe View |
+|:---:|
+| ![Globe](docs/globe.png) |
+
</details>
</div>
-Crucix pulls satellite fire detection, flight tracking, radiation monitoring, economic indicators, live market prices, conflict data, sanctions lists, and social sentiment from 26 open-source intelligence feeds — in parallel, every 15 minutes — and renders everything on a single self-contained Jarvis-style dashboard.
+Crucix pulls satellite fire detection, flight tracking, radiation monitoring, satellite constellation tracking, economic indicators, live market prices, conflict data, sanctions lists, and social sentiment from 27 open-source intelligence feeds — in parallel, every 15 minutes — and renders everything on a single self-contained Jarvis-style dashboard.
Hook it up to an LLM and it becomes a **two-way intelligence assistant** — pushing multi-tier alerts to Telegram and Discord when something meaningful changes, responding to commands like `/brief` and `/sweep` from your phone, and generating actionable trade ideas grounded in real cross-domain data. Your own analyst that watches the world while you sleep.
@@ -64,7 +68,7 @@ npm run dev
> ```
> This bypasses npm's script runner, which can swallow errors on some systems (particularly PowerShell on Windows). You can also run `node diag.mjs` to diagnose the exact issue — it checks your Node version, tests each module import individually, and verifies port availability. See [Troubleshooting](#troubleshooting) for more.
-The dashboard opens automatically at `http://localhost:3117` and immediately begins its first intelligence sweep. This initial sweep queries all 26 sources in parallel and typically takes 30–60 seconds — the dashboard will appear empty until the sweep completes and pushes the first data update. After that, it auto-refreshes every 15 minutes via SSE (Server-Sent Events). No manual page refresh needed.
+The dashboard opens automatically at `http://localhost:3117` and immediately begins its first intelligence sweep. This initial sweep queries all 27 sources in parallel and typically takes 30–60 seconds — the dashboard will appear empty until the sweep completes and pushes the first data update. After that, it auto-refreshes every 15 minutes via SSE (Server-Sent Events). No manual page refresh needed.
**Requirements:** Node.js 22+ (uses native `fetch`, top-level `await`, ESM)
@@ -85,8 +89,10 @@ Dashboard at `http://localhost:3117`. Sweep data persists in `./runs/` via volum
### Live Dashboard
A self-contained Jarvis-style HUD with:
-- **D3 world map** with 7 marker types (fire detections, air traffic, radiation sites, maritime chokepoints, SDR receivers, OSINT events, health alerts, geolocated news)
-- **Region filters** (World, Americas, Europe, Middle East, Asia Pacific, Africa) with smooth zoom transitions
+- **3D WebGL globe** (Globe.gl) with atmosphere glow, star field, and smooth rotation — plus a classic flat map toggle
+- **9 marker types** across both views: fire detections, air traffic, radiation sites, maritime chokepoints, SDR receivers, OSINT events, health alerts, geolocated news, conflict events
+- **Animated 3D flight corridor arcs** between air traffic hotspots and global hubs
+- **Region filters** (World, Americas, Europe, Middle East, Asia Pacific, Africa) — rotates the globe or zooms the flat map
- **Live market data** — indexes, crypto, energy, commodities via Yahoo Finance (no API key needed)
- **Risk gauges** — VIX, high-yield spread, supply chain pressure index
- **OSINT feed** — English-language posts from 17 Telegram intelligence channels (expandable)
@@ -94,11 +100,12 @@ A self-contained Jarvis-style HUD with:
- **Sweep delta** — live panel showing what changed since last sweep (new signals, escalations, de-escalations with severity)
- **Cross-source signals** — correlated intelligence across satellite, economic, conflict, and social domains
- **Nuclear watch** — real-time radiation readings from Safecast + EPA RadNet
+- **Space watch** — CelesTrak satellite tracking: recent launches, ISS, military constellations, Starlink/OneWeb counts
- **Leverageable ideas** — AI-generated trade ideas (with LLM) or signal-correlated ideas (without)
### Auto-Refresh
The server runs a sweep cycle every 15 minutes (configurable). Each cycle:
-1. Queries all 26 sources in parallel (~30s)
+1. Queries all 27 sources in parallel (~30s)
2. Synthesizes raw data into dashboard format
3. Computes delta from previous run (what changed, escalated, de-escalated) — visible in the **Sweep Delta** panel on the dashboard
4. Generates LLM trade ideas (if configured)
@@ -234,16 +241,17 @@ crucix/
├── docs/ # Screenshots for README
│
├── apis/
-│ ├── briefing.mjs # Master orchestrator — runs all 26 sources in parallel
+│ ├── briefing.mjs # Master orchestrator — runs all 27 sources in parallel
│ ├── save-briefing.mjs # CLI: save timestamped + latest.json
│ ├── BRIEFING_PROMPT.md # Intelligence synthesis protocol
│ ├── BRIEFING_TEMPLATE.md # Briefing output structure
│ ├── utils/
│ │ ├── fetch.mjs # safeFetch() — timeout, retries, abort, auto-JSON
│ │ └── env.mjs # .env loader (no dotenv dependency)
-│ └── sources/ # 26 self-contained source modules
+│ └── sources/ # 27 self-contained source modules
│ ├── gdelt.mjs # Each exports briefing() → structured data
│ ├── fred.mjs # Can run standalone: node apis/sources/fred.mjs
+│ ├── space.mjs # CelesTrak satellite tracking
│ ├── yfinance.mjs # Yahoo Finance — free live market data
│ └── ... # 23 more
│
@@ -277,14 +285,14 @@ crucix/
### Design Principles
- **Pure ESM** — every file is `.mjs` with explicit imports
- **Minimal dependencies** — Express is the only runtime dependency. `discord.js` is optional (for Discord bot). LLM providers use raw `fetch()`, no SDKs.
-- **Parallel execution** — `Promise.allSettled()` fires all 26 sources simultaneously
+- **Parallel execution** — `Promise.allSettled()` fires all 27 sources simultaneously
- **Graceful degradation** — missing keys produce errors, not crashes. LLM failures don't kill sweeps.
- **Each source is standalone** — run `node apis/sources/gdelt.mjs` to test any source independently
- **Self-contained dashboard** — the HTML file works with or without the server
---
-## Data Sources (26)
+## Data Sources (27)
### Tier 1: Core OSINT & Geopolitical (11)
@@ -326,7 +334,13 @@ crucix/
| **Telegram** | 17 curated OSINT/conflict/finance channels (web scraping, expandable via config) | None |
| **KiwiSDR** | Global HF radio receiver network (~600 receivers) | None |
-### Tier 4: Live Market Data (1)
+### Tier 4: Space & Satellites (1)
+
+| Source | What It Tracks | Auth |
+|--------|---------------|------|
+| **CelesTrak** | Satellite launches, ISS tracking, military constellations, Starlink/OneWeb counts | None |
+
+### Tier 5: Live Market Data (1)
| Source | What It Tracks | Auth |
|--------|---------------|------|
@@ -429,7 +443,7 @@ Crucix requires Node.js 22 or later. If you have an older version, download the
### Dashboard shows empty panels after first start
-This is normal — the first sweep takes 30–60 seconds to query all 26 sources. The dashboard will populate automatically once the sweep completes. Check the terminal for sweep progress logs.
+This is normal — the first sweep takes 30–60 seconds to query all 27 sources. The dashboard will populate automatically once the sweep completes. Check the terminal for sweep progress logs.
### Some sources show errors
@@ -460,6 +474,7 @@ The `docs/` folder contains dashboard screenshots referenced by this README:
| `docs/dashboard.png` | Full dashboard — hero image at the top of this README |
| `docs/boot.png` | Cinematic boot sequence animation |
| `docs/map.png` | D3 world map with marker types and flight arcs |
+| `docs/globe.png` | 3D WebGL globe view with atmosphere glow and markers |
To update them: run the dashboard, wait for a sweep to complete, then use your browser's DevTools (`F12` → `Ctrl+Shift+P` → "Capture full size screenshot") or a tool like [LICEcap](https://www.cockos.com/licecap/) for GIFs.
@@ -467,7 +482,7 @@ To update them: run the dashboard, wait for a sweep to complete, then use your b
## Contributing
-Found a bug? Want to add a 27th source? PRs welcome. Each source is a standalone module in `apis/sources/` — just export a `briefing()` function that returns structured data and add it to the orchestrator in `apis/briefing.mjs`.
+Found a bug? Want to add a 28th source? PRs welcome. Each source is a standalone module in `apis/sources/` — just export a `briefing()` function that returns structured data and add it to the orchestrator in `apis/briefing.mjs`.
If you find this useful, a star helps others find it too.
@@ -475,4 +490,4 @@ If you find this useful, a star helps others find it too.
## License
-MIT
+AGPL-3.0
diff --git a/dashboard/inject.mjs b/dashboard/inject.mjs
index 15e6b44..38464ac 100644
--- a/dashboard/inject.mjs
+++ b/dashboard/inject.mjs
@@ -46,6 +46,37 @@ const geoKeywords = {
'Peru':[-10,-76],'Ecuador':[-2,-78],'Bolivia':[-17,-65],
'Singapore':[1.35,103.8],'Malaysia':[4.2,101.9],'Vietnam':[16,108],
'Algeria':[28,3],'Tunisia':[34,9],'Zimbabwe':[-20,30],'Mozambique':[-18,35],
+ // Americas expansion
+ 'Texas':[31,-100],'Florida':[28,-82],'Chicago':[41.9,-87.6],'Los Angeles':[34,-118],
+ 'San Francisco':[37.8,-122.4],'Seattle':[47.6,-122.3],'Miami':[25.8,-80.2],
+ 'Toronto':[43.7,-79.4],'Ottawa':[45.4,-75.7],'Vancouver':[49.3,-123.1],
+ 'São Paulo':[-23.5,-46.6],'Rio':[-22.9,-43.2],'Buenos Aires':[-34.6,-58.4],
+ 'Bogotá':[4.7,-74.1],'Lima':[-12,-77],'Santiago':[-33.4,-70.7],
+ 'Caracas':[10.5,-66.9],'Havana':[23.1,-82.4],'Panama':[9,-79.5],
+ 'Guatemala':[14.6,-90.5],'Honduras':[14.1,-87.2],'El Salvador':[13.7,-89.2],
+ 'Costa Rica':[10,-84],'Jamaica':[18.1,-77.3],'Haiti':[19,-72],
+ 'Dominican':[18.5,-70],'Puerto Rico':[18.2,-66.5],
+ // More Asia-Pacific
+ 'Sri Lanka':[7,80],'Hong Kong':[22.3,114.2],'Taipei':[25,121.5],
+ 'Seoul':[37.6,127],'Osaka':[34.7,135.5],'Mumbai':[19.1,72.9],
+ 'Delhi':[28.6,77.2],'Shanghai':[31.2,121.5],'Shenzhen':[22.5,114.1],
+ 'Auckland':[-36.8,174.8],'Papua New Guinea':[-6.3,147],
+ // More Europe
+ 'Berlin':[52.5,13.4],'Paris':[48.9,2.3],'Madrid':[40.4,-3.7],
+ 'Rome':[41.9,12.5],'Warsaw':[52.2,21],'Prague':[50.1,14.4],
+ 'Vienna':[48.2,16.4],'Budapest':[47.5,19.1],'Bucharest':[44.4,26.1],
+ 'Kyiv':[50.4,30.5],'Oslo':[59.9,10.7],'Copenhagen':[55.7,12.6],
+ 'Brussels':[50.8,4.4],'Zurich':[47.4,8.5],'Dublin':[53.3,-6.3],
+ 'Lisbon':[38.7,-9.1],'Athens':[37.9,23.7],'Minsk':[53.9,27.6],
+ // More Africa
+ 'Nairobi':[-1.3,36.8],'Lagos':[6.5,3.4],'Accra':[5.6,-0.2],
+ 'Addis Ababa':[9,38.7],'Cape Town':[-33.9,18.4],'Johannesburg':[-26.2,28],
+ 'Kinshasa':[-4.3,15.3],'Khartoum':[15.6,32.5],'Mogadishu':[2.1,45.3],
+ 'Dakar':[14.7,-17.5],'Abuja':[9.1,7.5],
+ // Tech/Economy keywords with US locations
+ 'Fed':[38.9,-77],'Congress':[38.9,-77],'Senate':[38.9,-77],
+ 'Silicon Valley':[37.4,-122],'NASA':[28.6,-80.6],'Pentagon':[38.9,-77],
+ 'IMF':[38.9,-77],'World Bank':[38.9,-77],'UN':[40.7,-74],
};
function geoTagText(text) {
@@ -84,6 +115,10 @@ export async function fetchAllNews() {
['http://feeds.bbci.co.uk/news/world/rss.xml', 'BBC'],
['https://rss.nytimes.com/services/xml/rss/nyt/World.xml', 'NYT'],
['https://feeds.aljazeera.com/xml/rss/all.xml', 'Al Jazeera'],
+ ['https://rss.nytimes.com/services/xml/rss/nyt/Americas.xml', 'NYT Americas'],
+ ['https://rss.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml', 'NYT Asia'],
+ ['https://feeds.bbci.co.uk/news/technology/rss.xml', 'BBC Tech'],
+ ['http://feeds.bbci.co.uk/news/science_and_environment/rss.xml', 'BBC Science'],
];
const results = await Promise.allSettled(
@@ -115,7 +150,7 @@ export async function fetchAllNews() {
}
geoNews.sort((a, b) => new Date(b.date || 0) - new Date(a.date || 0));
- return geoNews.slice(0, 30);
+ return geoNews.slice(0, 50);
}
// === Leverageable Ideas from Signals ===
diff --git a/dashboard/public/jarvis.html b/dashboard/public/jarvis.html
index 2a9bfeb..4300112 100644
--- a/dashboard/public/jarvis.html
+++ b/dashboard/public/jarvis.html
@@ -9,6 +9,8 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="https://d3js.org/topojson.v3.min.js"></script>
+<script src="https://unpkg.com/[email protected]/build/three.min.js"></script>
+<script src="https://unpkg.com/[email protected]"></script>
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
@@ -91,17 +93,23 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--s
.econ-row .eval{font-family:var(--mono);font-weight:600}
/* CENTER: MAP */
-.map-container{flex:1;min-height:560px;border:1px solid var(--border);background:linear-gradient(180deg,rgba(8,16,24,0.95),rgba(4,10,16,0.98));position:relative;overflow:hidden}
-#mapSvg{width:100%;height:100%;display:block;cursor:grab}
-#mapSvg:active{cursor:grabbing}
-#mapSvg .land{fill:rgba(180,200,210,0.08);stroke:rgba(200,220,230,0.15);stroke-width:0.5}
-#mapSvg .land:hover{fill:rgba(100,240,200,0.08)}
-#mapSvg .graticule{fill:none;stroke:rgba(100,240,200,0.04);stroke-width:0.4}
-#mapSvg .border{fill:none;stroke:rgba(200,220,230,0.08);stroke-width:0.3}
+.map-container{flex:1;min-height:560px;border:1px solid var(--border);background:radial-gradient(ellipse at center,rgba(4,12,20,1),rgba(2,4,8,1));position:relative;overflow:hidden}
+#globeViz{width:100%;height:100%;cursor:grab}
+#globeViz:active{cursor:grabbing}
+#globeViz canvas{outline:none}
+#flatMapSvg .land{fill:rgba(180,200,210,0.08);stroke:rgba(200,220,230,0.15);stroke-width:0.5}
+#flatMapSvg .land:hover{fill:rgba(100,240,200,0.08)}
+#flatMapSvg .graticule{fill:none;stroke:rgba(100,240,200,0.04);stroke-width:0.4}
+#flatMapSvg .border{fill:none;stroke:rgba(200,220,230,0.08);stroke-width:0.3}
+@keyframes pulse-conflict{0%,100%{opacity:0.5;stroke-width:1.5}50%{opacity:0.9;stroke-width:2.5}}
+.conflict-ring{animation:pulse-conflict 2.5s ease-in-out infinite}
+@keyframes dash-flow{to{stroke-dashoffset:-20}}
+.corridor-flow{animation:dash-flow 2s linear infinite}
.map-legend{position:absolute;bottom:10px;left:12px;display:flex;gap:14px;font-family:var(--mono);font-size:10px;color:var(--dim);letter-spacing:0.06em;text-transform:uppercase;z-index:5;flex-wrap:wrap}
.leg-item{display:flex;align-items:center;gap:5px}
.leg-dot{width:8px;height:8px;border-radius:50%}
.map-hint{position:absolute;top:8px;right:12px;font-family:var(--mono);font-size:9px;color:var(--dim);z-index:5;opacity:0.6;letter-spacing:0.05em}
+.map-hint-id{position:absolute;top:8px;right:12px}
.map-controls{position:absolute;top:8px;left:12px;z-index:6;display:flex;flex-direction:column;gap:4px}
.map-ctrl-btn{width:28px;height:28px;border:1px solid var(--border);background:rgba(0,0,0,0.6);color:var(--dim);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(8px);transition:all 0.2s;font-family:var(--mono)}
.map-ctrl-btn:hover{color:var(--accent);border-color:var(--border-bright);background:rgba(100,240,200,0.06)}
@@ -234,10 +242,12 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--s
.spark-bad{stroke:var(--danger)}
.spark-dot{r:2}
-/* GLOBE TOGGLE */
-.proj-toggle{position:absolute;top:8px;right:180px;z-index:6;padding:5px 10px;border:1px solid var(--border);background:rgba(255,255,255,0.03);font-family:var(--mono);font-size:9px;cursor:pointer;color:var(--dim);letter-spacing:0.08em;text-transform:uppercase;transition:all 0.2s;backdrop-filter:blur(8px)}
+/* FLAT/GLOBE TOGGLE */
+.proj-toggle{position:absolute;top:8px;left:48px;z-index:6;padding:5px 10px;border:1px solid var(--border);background:rgba(0,0,0,0.6);font-family:var(--mono);font-size:9px;cursor:pointer;color:var(--dim);letter-spacing:0.08em;text-transform:uppercase;transition:all 0.2s;backdrop-filter:blur(8px)}
.proj-toggle:hover{border-color:var(--accent);color:var(--accent)}
.proj-toggle.active{color:var(--bg);background:var(--accent);border-color:var(--accent)}
+/* GLOBE.GL overrides */
+#globeViz .scene-tooltip{font-family:var(--mono)!important;font-size:10px!important;background:rgba(6,10,14,0.9)!important;border:1px solid rgba(100,240,200,0.3)!important;color:var(--text)!important;padding:4px 8px!important;letter-spacing:0.05em}
/* IDEA HORIZON BADGE */
.idea-horizon{font-family:var(--mono);font-size:8px;letter-spacing:0.08em;text-transform:uppercase;padding:1px 5px;border:1px solid rgba(100,240,200,0.15);color:var(--dim);margin-left:6px}
@@ -258,15 +268,16 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--s
<div class="col" id="leftRail"></div>
<div class="col" id="centerCol">
<div class="map-container" id="mapContainer">
- <svg id="mapSvg"></svg>
+ <div id="globeViz"></div>
+ <svg id="flatMapSvg" style="display:none;width:100%;height:100%;position:absolute;top:0;left:0;cursor:grab"></svg>
<div class="map-legend" id="mapLegend"></div>
- <div class="map-hint">SCROLL TO ZOOM · DRAG TO PAN</div>
+ <div class="map-hint" id="mapHint">SCROLL TO ZOOM · DRAG TO PAN</div>
<div class="map-controls">
<button class="map-ctrl-btn" onclick="mapZoom(1.5)" title="Zoom in">+</button>
<button class="map-ctrl-btn" onclick="mapZoom(0.67)" title="Zoom out">&minus;</button>
<button class="map-ctrl-btn map-toggle" id="flightToggle" onclick="toggleFlights()" title="Toggle flight routes">&#9992;</button>
</div>
- <button class="proj-toggle" id="projToggle" onclick="toggleProjection()">GLOBE MODE</button>
+ <button class="proj-toggle" id="projToggle" onclick="toggleMapMode()">GLOBE MODE</button>
<div class="map-popup" id="mapPopup"><button class="pp-close" onclick="closePopup()">&times;</button><div class="pp-head"></div><div class="pp-text"></div><div class="pp-meta"></div></div>
</div>
<div class="lower" id="lowerGrid"></div>
@@ -278,14 +289,17 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--s
// === DATA ===
let D = null;
// === GLOBALS ===
-let projection, path, svg, allG, zoomBehavior, mapW, mapH;
-const regionBounds = {
- world: [[-180,-60],[180,80]],
- americas: [[-170,-56],[-30,72]],
- europe: [[-12,34],[45,72]],
- middleEast: [[24,10],[65,45]],
- asiaPacific: [[60,-12],[180,55]],
- africa: [[-20,-36],[55,38]]
+let globe = null;
+let flightsVisible = true;
+let isFlat = true;
+let flatSvg, flatProjection, flatPath, flatG, flatZoom, flatW, flatH;
+const regionPOV = {
+ world: { lat: 20, lng: 20, altitude: 2.5 },
+ americas: { lat: 15, lng: -80, altitude: 1.6 },
+ europe: { lat: 50, lng: 15, altitude: 1.2 },
+ middleEast: { lat: 28, lng: 45, altitude: 1.4 },
+ asiaPacific: { lat: 25, lng: 110, altitude: 1.6 },
+ africa: { lat: 5, lng: 20, altitude: 1.5 }
};
// === TOPBAR ===
@@ -378,367 +392,477 @@ function renderLeftRail(){
// === MAP ===
function initMap(){
const container = document.getElementById('mapContainer');
- mapW = container.clientWidth; mapH = container.clientHeight || 480;
- svg = d3.select('#mapSvg').attr('viewBox',`0 0 ${mapW} ${mapH}`).attr('preserveAspectRatio','xMidYMid meet');
- projection = d3.geoNaturalEarth1().fitSize([mapW-20,mapH-20],{type:'Sphere'}).translate([mapW/2,mapH/2]);
- path = d3.geoPath(projection);
-
- // Master group for zoom
- allG = svg.append('g');
-
- // Graticule
- allG.append('path').datum(d3.geoGraticule()()).attr('class','graticule').attr('d',path);
-
- // D3 zoom behavior
- zoomBehavior = d3.zoom()
- .scaleExtent([1, 12])
- .on('zoom', (event) => {
- allG.attr('transform', event.transform);
- // Scale down text and markers at high zoom to avoid clutter
- const k = event.transform.k;
- allG.selectAll('.marker-circle').attr('r', function(){ return +this.dataset.baseR / Math.sqrt(k); });
- allG.selectAll('.marker-label').style('font-size', Math.max(7, 9/Math.sqrt(k))+'px');
- allG.selectAll('.news-icon').attr('stroke-width', Math.max(0.8, 1.2/Math.sqrt(k)));
- });
- svg.call(zoomBehavior);
+ const w = container.clientWidth;
+ const h = container.clientHeight || 560;
+
+ globe = Globe()
+ .width(w)
+ .height(h)
+ .globeImageUrl('//unpkg.com/[email protected]/example/img/earth-night.jpg')
+ .bumpImageUrl('//unpkg.com/[email protected]/example/img/earth-topology.png')
+ .backgroundImageUrl('')
+ .backgroundColor('rgba(0,0,0,0)')
+ .atmosphereColor('#64f0c8')
+ .atmosphereAltitude(0.18)
+ .showGraticules(true)
+ // Points layer (main markers)
+ .pointAltitude(d => d.alt || 0.01)
+ .pointRadius(d => d.size || 0.3)
+ .pointColor(d => d.color)
+ .pointLabel(d => `<b>${d.popHead||''}</b><br><span style="opacity:0.7">${d.popMeta||''}</span>`)
+ .onPointClick((pt, ev) => { showPopup(ev, pt.popHead, pt.popText, pt.popMeta); })
+ .onPointHover(pt => { document.getElementById('globeViz').style.cursor = pt ? 'pointer' : 'grab'; })
+ // Arcs layer (flight corridors)
+ .arcColor(d => d.color)
+ .arcStroke(d => d.stroke || 0.4)
+ .arcDashLength(0.4)
+ .arcDashGap(0.2)
+ .arcDashAnimateTime(2000)
+ .arcAltitudeAutoScale(0.3)
+ .arcLabel(d => d.label || '')
+ // Rings layer (pulsing conflict events)
+ .ringColor(d => t => `rgba(255,120,80,${1-t})`)
+ .ringMaxRadius(d => d.maxR || 3)
+ .ringPropagationSpeed(d => d.speed || 2)
+ .ringRepeatPeriod(d => d.period || 800)
+ // Labels layer
+ .labelText(d => d.text)
+ .labelSize(d => d.size || 0.4)
+ .labelColor(d => d.color || 'rgba(106,138,130,0.9)')
+ .labelDotRadius(0)
+ .labelAltitude(0.012)
+ .labelResolution(2)
+ (document.getElementById('globeViz'));
+
+ // Style the WebGL scene
+ const scene = globe.scene();
+ const renderer = globe.renderer();
+ renderer.setClearColor(0x000000, 0);
+
+ // Add subtle stars background
+ const starGeom = new THREE.BufferGeometry();
+ const starVerts = [];
+ for(let i=0; i<2000; i++){
+ const r = 800 + Math.random()*200;
+ const theta = Math.random()*Math.PI*2;
+ const phi = Math.acos(2*Math.random()-1);
+ starVerts.push(r*Math.sin(phi)*Math.cos(theta), r*Math.sin(phi)*Math.sin(theta), r*Math.cos(phi));
+ }
+ starGeom.setAttribute('position', new THREE.Float32BufferAttribute(starVerts, 3));
+ const starMat = new THREE.PointsMaterial({color:0x88bbaa, size:0.8, transparent:true, opacity:0.6});
+ scene.add(new THREE.Points(starGeom, starMat));
+
+ // Customize graticule color
+ scene.traverse(obj => {
+ if(obj.material && obj.type === 'Line'){
+ obj.material.color.set(0x1a3a2a);
+ obj.material.opacity = 0.3;
+ obj.material.transparent = true;
+ }
+ });
- // Load world
- fetch('https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json')
- .then(r=>r.json()).then(world=>{
- const countries = topojson.feature(world, world.objects.countries);
- allG.selectAll('path.land').data(countries.features).enter()
- .append('path').attr('class','land').attr('d',path);
- allG.append('path').datum(topojson.mesh(world,world.objects.countries,(a,b)=>a!==b))
- .attr('class','border').attr('d',path);
- plotMarkers();
- });
+ // Set initial POV
+ globe.pointOfView(regionPOV.world, 0);
+
+ // Auto-rotate slowly
+ globe.controls().autoRotate = true;
+ globe.controls().autoRotateSpeed = 0.3;
+ globe.controls().enableDamping = true;
+ globe.controls().dampingFactor = 0.1;
+
+ // Stop auto-rotate on interaction, resume after 10s
+ let rotateTimeout;
+ const el = document.getElementById('globeViz');
+ el.addEventListener('mousedown', () => {
+ globe.controls().autoRotate = false;
+ clearTimeout(rotateTimeout);
+ });
+ el.addEventListener('mouseup', () => {
+ rotateTimeout = setTimeout(() => { globe.controls().autoRotate = true; }, 10000);
+ });
+
+ // Resize handler
+ window.addEventListener('resize', () => {
+ const c = document.getElementById('mapContainer');
+ globe.width(c.clientWidth).height(c.clientHeight || 560);
+ });
+
+ // Plot globe markers (preloaded but hidden)
+ plotMarkers();
+
+ // Start in flat mode — hide globe, show flat map
+ document.getElementById('globeViz').style.display = 'none';
+ document.getElementById('flatMapSvg').style.display = 'block';
+ initFlatMap();
// Legend
document.getElementById('mapLegend').innerHTML=
- [{c:'var(--accent)',l:'Air Traffic'},{c:'var(--danger)',l:'Thermal/Fire'},{c:'rgba(255,120,80,0.8)',l:'Conflict'},{c:'var(--accent2)',l:'SDR Receiver'},
- {c:'#ffe082',l:'Nuclear Site'},{c:'#b388ff',l:'Chokepoint'},{c:'var(--warn)',l:'OSINT Event'},{c:'#69f0ae',l:'Health Alert'},{c:'#81d4fa',l:'World News'}]
+ [{c:'#64f0c8',l:'Air Traffic'},{c:'#ff5f63',l:'Thermal/Fire'},{c:'rgba(255,120,80,0.8)',l:'Conflict'},{c:'#44ccff',l:'SDR Receiver'},
+ {c:'#ffe082',l:'Nuclear Site'},{c:'#b388ff',l:'Chokepoint'},{c:'#ffb84c',l:'OSINT Event'},{c:'#69f0ae',l:'Health Alert'},{c:'#81d4fa',l:'World News'}]
.map(x=>`<div class="leg-item"><div class="leg-dot" style="background:${x.c}"></div>${x.l}</div>`).join('');
}
function plotMarkers(){
- const markersG = allG.append('g').attr('class','markers');
+ const points = [];
+ const labels = [];
- // Air hotspots (green)
+ // === Air hotspots (green) ===
const airCoords=[{lat:30,lon:44},{lat:24,lon:120},{lat:49,lon:32},{lat:57,lon:24},{lat:14,lon:114},{lat:37,lon:127}];
D.air.forEach((a,i)=>{
const c=airCoords[i]; if(!c) return;
- const [x,y]=projection([c.lon,c.lat]);
- const r=4+a.total/40;
- const g=markersG.append('g').attr('class','air-marker').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,a.region,`${a.total} aircraft tracked<br>No callsign: ${a.noCallsign}<br>High altitude: ${a.highAlt}<br>Top: ${a.top.slice(0,3).map(t=>t[0]+' ('+t[1]+')').join(', ')}`,`Air Activity`)});
- g.append('circle').attr('class','marker-circle').attr('r',r).attr('data-base-r',r).attr('fill','rgba(100,240,200,0.7)').attr('stroke','rgba(100,240,200,0.3)').attr('stroke-width',1);
- g.append('text').attr('class','marker-label').attr('x',10).attr('y',3).attr('fill','var(--dim)').attr('font-size','9px').attr('font-family','var(--mono)').text(a.region.replace(' Region','')+ ' '+a.total);
+ points.push({
+ lat:c.lat, lng:c.lon, size:0.25+a.total/200, alt:0.015,
+ color:'rgba(100,240,200,0.8)', type:'air',
+ label: a.region.replace(' Region','')+' '+a.total,
+ popHead: a.region, popMeta: 'Air Activity',
+ popText: `${a.total} aircraft tracked<br>No callsign: ${a.noCallsign}<br>High altitude: ${a.highAlt}<br>Top: ${a.top.slice(0,3).map(t=>t[0]+' ('+t[1]+')').join(', ')}`
+ });
+ labels.push({lat:c.lat, lng:c.lon+2, text:a.region.replace(' Region','')+' '+a.total, size:0.35, color:'rgba(106,138,130,0.8)'});
});
- // Thermal (red)
+ // === Thermal/fire (red) ===
D.thermal.forEach(t=>{
t.fires.forEach(f=>{
- const [x,y]=projection([f.lon,f.lat]);
- if(!x||!y) return;
- const r=2+Math.min(f.frp/50,5);
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,'Thermal Detection',`Region: ${t.region}<br>FRP: ${f.frp.toFixed(1)} MW<br>Total: ${t.det.toLocaleString()}<br>Night: ${t.night.toLocaleString()}`,'FIRMS Satellite')});
- g.append('circle').attr('class','marker-circle').attr('r',r).attr('data-base-r',r).attr('fill','rgba(255,95,99,0.6)').attr('stroke','rgba(255,95,99,0.2)').attr('stroke-width',0.5);
+ points.push({
+ lat:f.lat, lng:f.lon, size:0.12+Math.min(f.frp/200,0.3), alt:0.008,
+ color:'rgba(255,95,99,0.7)', type:'thermal',
+ popHead:'Thermal Detection', popMeta:'FIRMS Satellite',
+ popText:`Region: ${t.region}<br>FRP: ${f.frp.toFixed(1)} MW<br>Total: ${t.det.toLocaleString()}<br>Night: ${t.night.toLocaleString()}`
+ });
});
});
- // Maritime chokepoints (purple diamonds)
+ // === Maritime chokepoints (purple) ===
D.chokepoints.forEach(cp=>{
- const [x,y]=projection([cp.lon,cp.lat]);
- if(!x||!y) return;
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,cp.label,cp.note,'Maritime Intelligence')});
- g.append('rect').attr('x',-4).attr('y',-4).attr('width',8).attr('height',8).attr('fill','rgba(179,136,255,0.7)').attr('stroke','rgba(179,136,255,0.3)').attr('stroke-width',0.5).attr('transform','rotate(45)');
- g.append('text').attr('class','marker-label').attr('x',8).attr('y',3).attr('fill','var(--dim)').attr('font-size','8px').attr('font-family','var(--mono)').text(cp.label);
+ points.push({
+ lat:cp.lat, lng:cp.lon, size:0.35, alt:0.02,
+ color:'rgba(179,136,255,0.8)', type:'maritime',
+ popHead:cp.label, popMeta:'Maritime Intelligence', popText:cp.note
+ });
+ labels.push({lat:cp.lat, lng:cp.lon+1.5, text:cp.label, size:0.3, color:'rgba(179,136,255,0.6)'});
});
- // Nuclear sites (yellow)
+ // === Nuclear sites (yellow) ===
const nukeCoords=[{lat:47.5,lon:34.6},{lat:51.4,lon:30.1},{lat:28.8,lon:50.9},{lat:39.8,lon:125.8},{lat:37.4,lon:141},{lat:31.0,lon:35.1}];
D.nuke.forEach((n,i)=>{
const c=nukeCoords[i]; if(!c) return;
- const [x,y]=projection([c.lon,c.lat]); if(!x||!y) return;
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,n.site,`Status: ${n.anom?'ANOMALY':'Normal'}<br>Avg CPM: ${n.cpm?.toFixed(1)||'No data'}<br>Readings: ${n.n}`,'Radiation Monitoring')});
- g.append('circle').attr('class','marker-circle').attr('r',4).attr('data-base-r',4).attr('fill','rgba(255,224,130,0.7)').attr('stroke','rgba(255,224,130,0.3)').attr('stroke-width',1);
+ points.push({
+ lat:c.lat, lng:c.lon, size:0.3, alt:0.012,
+ color: n.anom ? 'rgba(255,95,99,0.9)' : 'rgba(255,224,130,0.8)', type:'nuke',
+ popHead:n.site, popMeta:'Radiation Monitoring',
+ popText:`Status: ${n.anom?'ANOMALY':'Normal'}<br>Avg CPM: ${n.cpm?.toFixed(1)||'No data'}<br>Readings: ${n.n}`
+ });
});
- // SDR receivers in conflict zones (cyan)
+ // === SDR receivers (cyan) ===
D.sdr.zones.forEach(z=>{
z.receivers.forEach(r=>{
- const [x,y]=projection([r.lon,r.lat]); if(!x||!y) return;
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,'SDR Receiver',`${r.name}<br>Zone: ${z.region}<br>${z.count} in zone`,'KiwiSDR Network')});
- g.append('circle').attr('class','marker-circle').attr('r',2.5).attr('data-base-r',2.5).attr('fill','rgba(68,204,255,0.5)').attr('stroke','rgba(68,204,255,0.2)').attr('stroke-width',0.5);
+ points.push({
+ lat:r.lat, lng:r.lon, size:0.15, alt:0.005,
+ color:'rgba(68,204,255,0.6)', type:'sdr',
+ popHead:'SDR Receiver', popMeta:'KiwiSDR Network',
+ popText:`${r.name}<br>Zone: ${z.region}<br>${z.count} in zone`
+ });
});
});
- // OSINT events (orange) - from urgent Telegram
+ // === OSINT events from Telegram (orange) ===
const osintGeo=[{lat:45,lon:41,idx:0},{lat:48,lon:37,idx:1},{lat:48.5,lon:37.5,idx:2},{lat:45,lon:40.2,idx:3},{lat:50.6,lon:36.6,idx:5},{lat:48.5,lon:35,idx:6}];
osintGeo.forEach(o=>{
const post=D.tg.urgent[o.idx]; if(!post) return;
- const [x,y]=projection([o.lon,o.lat]); if(!x||!y) return;
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,(post.channel||'').toUpperCase(),cleanText(post.text?.substring(0,200)||''),`${post.views?.toLocaleString()||'?'} views`)});
- g.append('circle').attr('class','marker-circle').attr('r',4).attr('data-base-r',4).attr('fill','rgba(255,184,76,0.7)').attr('stroke','rgba(255,184,76,0.3)').attr('stroke-width',1);
+ points.push({
+ lat:o.lat, lng:o.lon, size:0.3, alt:0.018,
+ color:'rgba(255,184,76,0.8)', type:'osint',
+ popHead:(post.channel||'').toUpperCase(), popMeta:`${post.views?.toLocaleString()||'?'} views`,
+ popText:cleanText(post.text?.substring(0,200)||'')
+ });
});
- // WHO health alerts (green)
+ // === WHO health alerts (green) ===
const whoGeo=[{lat:0.3,lon:32.6},{lat:-6.2,lon:106.8},{lat:-4.3,lon:15.3},{lat:35,lon:105},{lat:12.5,lon:105},{lat:35,lon:105},{lat:28,lon:84},{lat:24,lon:45},{lat:30,lon:70},{lat:-0.8,lon:11.6}];
D.who.slice(0,10).forEach((w,i)=>{
const c=whoGeo[i]; if(!c) return;
- const [x,y]=projection([c.lon,c.lat]); if(!x||!y) return;
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,w.title,w.summary||'','WHO Outbreak')});
- g.append('circle').attr('class','marker-circle').attr('r',3.5).attr('data-base-r',3.5).attr('fill','rgba(105,240,174,0.6)').attr('stroke','rgba(105,240,174,0.2)').attr('stroke-width',0.5);
+ points.push({
+ lat:c.lat, lng:c.lon, size:0.25, alt:0.01,
+ color:'rgba(105,240,174,0.7)', type:'health',
+ popHead:w.title, popMeta:'WHO Outbreak', popText:w.summary||''
+ });
});
- // NEWS markers (broadcast icon) - from RSS feeds
+ // === News markers (light blue) ===
(D.news||[]).forEach(n=>{
- const [x,y]=projection([n.lon,n.lat]); if(!x||!y) return;
- const g=markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev,n.source+' NEWS',cleanText(n.title),n.region+' · '+getAge(n.date))});
- // Broadcast/signal icon instead of text label
- const s=5;
- g.append('path').attr('class','news-icon marker-circle').attr('data-base-r',s)
- .attr('d',`M0,${s*0.3} L${-s*0.25},${s*0.5} L${-s*0.25},${-s*0.5} L0,${-s*0.3} Z M${s*0.15},${-s*0.55} A${s*0.55},${s*0.55} 0 0,1 ${s*0.15},${s*0.55} M${s*0.3},${-s*0.75} A${s*0.8},${s*0.8} 0 0,1 ${s*0.3},${s*0.75}`)
- .attr('fill','none').attr('stroke','rgba(129,212,250,0.8)').attr('stroke-width',1.2).attr('stroke-linecap','round');
+ points.push({
+ lat:n.lat, lng:n.lon, size:0.2, alt:0.008,
+ color:'rgba(129,212,250,0.7)', type:'news',
+ popHead:n.source+' NEWS', popMeta:n.region+' · '+getAge(n.date),
+ popText:cleanText(n.title)
+ });
});
- // === ACLED CONFLICT EVENTS (pulsing red-orange rings) ===
- const conflictEvents = (D.acled?.deadliestEvents || []).filter(e => e.lat && e.lon);
- conflictEvents.forEach(e => {
- const [x,y] = projection([e.lon, e.lat]);
- if(!x || !y) return;
+ // Set points on globe
+ globe.pointsData(points);
+ globe.labelsData(labels);
+
+ // === ACLED CONFLICT EVENTS (pulsing rings) ===
+ const conflictRings = (D.acled?.deadliestEvents || []).filter(e => e.lat && e.lon).map(e => {
const logFatal = Math.log2(Math.max(e.fatalities, 1));
- const r = Math.max(4, Math.min(14, 2 + logFatal * 1.5));
- const g = markersG.append('g').attr('transform',`translate(${x},${y})`)
- .style('cursor','pointer')
- .on('click',(ev)=>{ev.stopPropagation();showPopup(ev, e.type || 'CONFLICT', `${e.fatalities} fatalities<br>${e.location}, ${e.country}<br>Date: ${e.date}`, 'ACLED Conflict Data')});
- g.append('circle').attr('class','conflict-ring marker-circle').attr('r',r).attr('data-base-r',r)
- .attr('fill','none').attr('stroke','rgba(255,120,80,0.7)').attr('stroke-width',1.5);
- g.append('circle').attr('r',r*0.4).attr('fill','rgba(255,120,80,0.3)');
+ return {
+ lat: e.lat, lng: e.lon,
+ maxR: Math.max(2, Math.min(6, 1 + logFatal)),
+ speed: 1.5 + Math.random(),
+ period: 600 + Math.random()*600,
+ popHead: e.type || 'CONFLICT', popMeta: 'ACLED Conflict Data',
+ popText: `${e.fatalities} fatalities<br>${e.location}, ${e.country}<br>Date: ${e.date}`
+ };
});
+ globe.ringsData(conflictRings);
- // === FLIGHT CORRIDORS (great circle arcs between air traffic regions + global hubs) ===
+ // === FLIGHT CORRIDORS (3D arcs) ===
const airCoordsFlight = [
{region:'Middle East',lat:30,lon:44}, {region:'Taiwan Strait',lat:24,lon:120},
{region:'Ukraine Region',lat:49,lon:32}, {region:'Baltic Region',lat:57,lon:24},
{region:'South China Sea',lat:14,lon:114}, {region:'Korean Peninsula',lat:37,lon:127}
];
- // Global destination hubs for worldwide corridor distribution
const globalHubs = [
- {lat:40.6,lon:-73.8}, // New York
- {lat:51.5,lon:-0.5}, // London
- {lat:25.3,lon:55.4}, // Dubai
- {lat:1.4,lon:103.8}, // Singapore
- {lat:-33.9,lon:151.2},// Sydney
- {lat:-23.4,lon:-46.5} // São Paulo
+ {lat:40.6,lon:-73.8},{lat:51.5,lon:-0.5},{lat:25.3,lon:55.4},
+ {lat:1.4,lon:103.8},{lat:-33.9,lon:151.2},{lat:-23.4,lon:-46.5}
];
- const corridors = [];
+ const arcs = [];
// Inter-hotspot corridors
for(let i=0; i<D.air.length; i++){
for(let j=i+1; j<D.air.length; j++){
- const a = D.air[i], b = D.air[j];
- const from = airCoordsFlight[i], to = airCoordsFlight[j];
- if(!from || !to) continue;
- const traffic = a.total + b.total;
- if(traffic < 30) continue;
- corridors.push({from, to, traffic, ncRatio:(a.noCallsign+b.noCallsign)/Math.max(traffic,1)});
+ const a=D.air[i], b=D.air[j];
+ const from=airCoordsFlight[i], to=airCoordsFlight[j];
+ if(!from||!to) continue;
+ const traffic=a.total+b.total;
+ if(traffic<30) continue;
+ const ncRatio=(a.noCallsign+b.noCallsign)/Math.max(traffic,1);
+ const color = ncRatio>0.15 ? ['rgba(255,95,99,0.6)','rgba(255,95,99,0.15)'] :
+ ncRatio>0.05 ? ['rgba(255,184,76,0.5)','rgba(255,184,76,0.1)'] :
+ ['rgba(100,240,200,0.4)','rgba(100,240,200,0.08)'];
+ arcs.push({
+ startLat:from.lat, startLng:from.lon, endLat:to.lat, endLng:to.lon,
+ color, stroke:Math.max(0.3, Math.min(1.2, traffic/120)),
+ label:`${from.region} ↔ ${to.region}: ${traffic} aircraft`
+ });
}
}
- // Hub corridors from high-traffic hotspots to global destinations
+ // Hub corridors
D.air.forEach((a,i)=>{
- if(!airCoordsFlight[i] || a.total < 25) return;
+ if(!airCoordsFlight[i]||a.total<25) return;
globalHubs.forEach(hub=>{
- // Skip very short routes (hub near the hotspot)
- const dLat = Math.abs(airCoordsFlight[i].lat - hub.lat);
- const dLon = Math.abs(airCoordsFlight[i].lon - hub.lon);
- if(dLat + dLon < 20) return;
- corridors.push({from:airCoordsFlight[i], to:hub, traffic:a.total*0.4, ncRatio:0});
+ const dLat=Math.abs(airCoordsFlight[i].lat-hub.lat);
+ const dLon=Math.abs(airCoordsFlight[i].lon-hub.lon);
+ if(dLat+dLon<20) return;
+ arcs.push({
+ startLat:airCoordsFlight[i].lat, startLng:airCoordsFlight[i].lon,
+ endLat:hub.lat, endLng:hub.lon,
+ color:['rgba(100,240,200,0.2)','rgba(100,240,200,0.05)'],
+ stroke:0.3
+ });
});
});
- // Render corridors using d3.geoPath for correct globe projection + clipping
- const corridorG = allG.append('g').attr('class','corridors-layer');
- corridors.forEach(c => {
- const interp = d3.geoInterpolate([c.from.lon, c.from.lat], [c.to.lon, c.to.lat]);
- const coords = [];
- for(let i=0; i<=40; i++) coords.push(interp(i/40));
- const feature = {type:'Feature', geometry:{type:'LineString', coordinates:coords}};
- const color = c.ncRatio > 0.15 ? 'rgba(255,95,99,0.4)' :
- c.ncRatio > 0.05 ? 'rgba(255,184,76,0.35)' : 'rgba(100,240,200,0.25)';
- const sw = Math.max(0.8, Math.min(3, c.traffic / 80));
- corridorG.append('path').datum(feature).attr('d', path)
- .attr('class','corridor-line').attr('stroke', color).attr('stroke-width', sw);
- corridorG.append('path').datum(feature).attr('d', path)
- .attr('class','corridor-flow').attr('fill','none')
- .attr('stroke', color.replace(/[\d.]+\)$/,'0.6)'))
- .attr('stroke-width', Math.max(0.5, sw * 0.5))
- .attr('stroke-dasharray','4 16');
- });
-
- // === GHOST FLIGHTS (flickering markers for no-callsign aircraft) ===
- D.air.forEach((a,i) => {
- if(a.noCallsign < 1) return;
- const center = airCoordsFlight[i];
- if(!center) return;
- const ghostCount = Math.min(a.noCallsign, 8); // cap visual clutter
- for(let g=0; g<ghostCount; g++){
- const lat = center.lat + (Math.random() - 0.5) * 6;
- const lon = center.lon + (Math.random() - 0.5) * 6;
- const [x,y] = projection([lon, lat]);
- if(!x || !y) continue;
- markersG.append('rect').attr('class','ghost-marker marker-circle')
- .attr('x', x-2).attr('y', y-2).attr('width',4).attr('height',4)
- .attr('data-base-r', 2)
- .attr('fill','rgba(100,240,200,0.15)').attr('stroke','rgba(100,240,200,0.3)')
- .attr('stroke-width',0.5).attr('stroke-dasharray','1 1')
- .style('animation-delay', (Math.random() * 2).toFixed(1) + 's');
- }
- });
+ globe.arcsData(arcs);
}
function showPopup(event,head,text,meta){
const popup=document.getElementById('mapPopup');
const container=document.getElementById('mapContainer');
const rect=container.getBoundingClientRect();
- // Use mouse position relative to container
- let left=event.clientX - rect.left + 10;
- let top=event.clientY - rect.top - 10;
+ let left, top;
+ if(event && event.clientX != null){
+ left=event.clientX - rect.left + 10;
+ top=event.clientY - rect.top - 10;
+ } else {
+ left=rect.width/2 - 140; top=rect.height/2 - 60;
+ }
if(left+290>rect.width) left=left-300;
if(top+150>rect.height) top=top-160;
if(left<0) left=10;
if(top<0) top=10;
popup.style.left=left+'px';popup.style.top=top+'px';
- popup.querySelector('.pp-head').textContent=head;
- popup.querySelector('.pp-text').innerHTML=text;
- popup.querySelector('.pp-meta').textContent=meta;
+ popup.querySelector('.pp-head').textContent=head||'';
+ popup.querySelector('.pp-text').innerHTML=text||'';
+ popup.querySelector('.pp-meta').textContent=meta||'';
popup.classList.add('show');
}
function closePopup(){document.getElementById('mapPopup').classList.remove('show')}
-function setRegion(r){
- document.querySelectorAll('.region-btn').forEach(b=>b.classList.toggle('active',b.dataset.region===r));
- closePopup();
- if(r==='world'){
- svg.transition().duration(750).call(zoomBehavior.transform, d3.zoomIdentity);
- return;
- }
- const bounds=regionBounds[r];
- const p0=projection(bounds[0]), p1=projection(bounds[1]);
- if(!p0||!p1) return;
- const dx=Math.abs(p1[0]-p0[0]), dy=Math.abs(p1[1]-p0[1]);
- const cx=(p0[0]+p1[0])/2, cy=(p0[1]+p1[1])/2;
- const scale=Math.min(mapW/dx, mapH/dy)*0.85;
- const tx=mapW/2-scale*cx, ty=mapH/2-scale*cy;
- svg.transition().duration(750).call(
- zoomBehavior.transform,
- d3.zoomIdentity.translate(tx,ty).scale(scale)
- );
-}
-
// === MAP CONTROLS ===
-let flightsVisible = true;
-function mapZoom(factor) {
- if (!svg || !zoomBehavior) return;
- svg.transition().duration(300).call(zoomBehavior.scaleBy, factor);
-}
function toggleFlights() {
flightsVisible = !flightsVisible;
const btn = document.getElementById('flightToggle');
btn.classList.toggle('off', !flightsVisible);
- // Toggle corridors, air markers, and ghost flights
- allG.selectAll('.corridors-layer').style('display', flightsVisible ? null : 'none');
- allG.selectAll('.ghost-marker').style('display', flightsVisible ? null : 'none');
- // Air hotspot circles — they share markersG with other markers, so we tag them
- allG.selectAll('.air-marker').style('display', flightsVisible ? null : 'none');
+ if(flightsVisible) {
+ plotMarkers(); // re-render with arcs
+ } else {
+ globe.arcsData([]); // hide arcs
+ // Remove air-type points
+ const pts = globe.pointsData().filter(p => p.type !== 'air');
+ globe.pointsData(pts);
+ const lbls = globe.labelsData().filter(l => l.text && !l.text.match(/\d+$/));
+ globe.labelsData(lbls);
+ }
}
-// === GLOBE TOGGLE ===
-let isGlobe = false;
-let globeProjection;
+// === FLAT/GLOBE TOGGLE ===
+const flatRegionBounds = {
+ world:[[-180,-60],[180,80]], americas:[[-170,-56],[-30,72]], europe:[[-12,34],[45,72]],
+ middleEast:[[24,10],[65,45]], asiaPacific:[[60,-12],[180,55]], africa:[[-20,-36],[55,38]]
+};
-function toggleProjection(){
- isGlobe = !isGlobe;
+function toggleMapMode(){
+ isFlat = !isFlat;
const btn = document.getElementById('projToggle');
- btn.textContent = isGlobe ? 'FLAT MODE' : 'GLOBE MODE';
- btn.classList.toggle('active', isGlobe);
-
- if(isGlobe){
- globeProjection = d3.geoOrthographic()
- .translate([mapW/2, mapH/2])
- .scale(Math.min(mapW, mapH) / 2.3)
- .clipAngle(90)
- .rotate([-40, -20, 0]);
- projection = globeProjection;
+ const hint = document.getElementById('mapHint');
+ btn.textContent = isFlat ? 'GLOBE MODE' : 'FLAT MODE';
+ hint.textContent = isFlat ? 'SCROLL TO ZOOM · DRAG TO PAN' : 'DRAG TO ROTATE · SCROLL TO ZOOM';
+ const globeEl = document.getElementById('globeViz');
+ const flatEl = document.getElementById('flatMapSvg');
+ if(isFlat){
+ globeEl.style.display = 'none';
+ flatEl.style.display = 'block';
+ if(!flatSvg) initFlatMap();
+ else { flatG.selectAll('*').remove(); drawFlatMap(); }
} else {
- projection = d3.geoNaturalEarth1().fitSize([mapW-20, mapH-20], {type:'Sphere'}).translate([mapW/2, mapH/2]);
- }
- path = d3.geoPath(projection);
-
- // Clear and redraw everything
- allG.attr('transform', null); // reset any stale flat-mode zoom transform
- allG.selectAll('*').remove();
- allG.append('path').datum(d3.geoGraticule()()).attr('class','graticule').attr('d',path);
-
- if(isGlobe){
- // Add sphere outline for globe
- allG.insert('path',':first-child').datum({type:'Sphere'})
- .attr('d',path).attr('fill','rgba(4,12,20,0.9)').attr('stroke','rgba(100,240,200,0.15)').attr('stroke-width',0.5);
- // Enable drag rotation for globe
- svg.on('.zoom', null); // remove existing zoom
- svg.call(d3.drag().on('drag',(event)=>{
- const r = globeProjection.rotate();
- const k = 0.5;
- globeProjection.rotate([r[0]+event.dx*k, r[1]-event.dy*k, r[2]]);
- redrawGlobe();
- }));
- // Add zoom for globe scale
- svg.call(d3.zoom().scaleExtent([0.5,4]).on('zoom',(event)=>{
- globeProjection.scale(Math.min(mapW,mapH)/2.3 * event.transform.k);
- redrawGlobe();
- }));
- } else {
- // Restore flat map zoom
- svg.on('.drag', null);
- svg.call(zoomBehavior);
- svg.call(zoomBehavior.transform, d3.zoomIdentity);
+ globeEl.style.display = 'block';
+ flatEl.style.display = 'none';
}
+}
- // Reload countries
+function initFlatMap(){
+ const container = document.getElementById('mapContainer');
+ flatW = container.clientWidth; flatH = container.clientHeight || 560;
+ flatSvg = d3.select('#flatMapSvg').attr('viewBox',`0 0 ${flatW} ${flatH}`).attr('preserveAspectRatio','xMidYMid meet');
+ flatProjection = d3.geoNaturalEarth1().fitSize([flatW-20,flatH-20],{type:'Sphere'}).translate([flatW/2,flatH/2]);
+ flatPath = d3.geoPath(flatProjection);
+ flatG = flatSvg.append('g');
+ flatZoom = d3.zoom().scaleExtent([1,12]).on('zoom',(event)=>{
+ flatG.attr('transform',event.transform);
+ const k=event.transform.k;
+ flatG.selectAll('.marker-circle').attr('r',function(){return +this.dataset.baseR/Math.sqrt(k)});
+ flatG.selectAll('.marker-label').style('font-size',Math.max(7,9/Math.sqrt(k))+'px');
+ });
+ flatSvg.call(flatZoom);
+ drawFlatMap();
+}
+
+function drawFlatMap(){
+ flatG.append('path').datum(d3.geoGraticule()()).attr('class','graticule').attr('d',flatPath);
fetch('https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json')
.then(r=>r.json()).then(world=>{
- const countries = topojson.feature(world, world.objects.countries);
- allG.selectAll('path.land').data(countries.features).enter()
- .append('path').attr('class','land').attr('d',path);
- allG.append('path').datum(topojson.mesh(world,world.objects.countries,(a,b)=>a!==b))
- .attr('class','border').attr('d',path);
- plotMarkers();
+ const countries=topojson.feature(world,world.objects.countries);
+ flatG.selectAll('path.land').data(countries.features).enter().append('path').attr('class','land').attr('d',flatPath);
+ flatG.append('path').datum(topojson.mesh(world,world.objects.countries,(a,b)=>a!==b)).attr('class','border').attr('d',flatPath);
+ plotFlatMarkers();
});
}
-function redrawGlobe(){
- path = d3.geoPath(globeProjection);
- allG.selectAll('path.land').attr('d',path);
- allG.selectAll('path.border').attr('d',path);
- allG.selectAll('.graticule').attr('d',path);
- allG.select('path:first-child').attr('d', path({type:'Sphere'}));
- // Remove and replot markers + corridors with updated projection
- allG.selectAll('.corridors-layer').remove();
- allG.selectAll('.markers').remove();
- plotMarkers();
+function plotFlatMarkers(){
+ const mg=flatG.append('g').attr('class','markers');
+ const proj=flatProjection;
+ const addPt=(lat,lon,r,fill,stroke,onClick)=>{
+ const[x,y]=proj([lon,lat]);if(!x||!y)return null;
+ const g=mg.append('g').attr('transform',`translate(${x},${y})`).style('cursor','pointer');
+ if(onClick) g.on('click',ev=>{ev.stopPropagation();onClick(ev)});
+ g.append('circle').attr('class','marker-circle').attr('r',r).attr('data-base-r',r).attr('fill',fill).attr('stroke',stroke).attr('stroke-width',0.8);
+ return g;
+ };
+ // Air
+ const airCoords=[{lat:30,lon:44},{lat:24,lon:120},{lat:49,lon:32},{lat:57,lon:24},{lat:14,lon:114},{lat:37,lon:127}];
+ D.air.forEach((a,i)=>{
+ const c=airCoords[i];if(!c)return;
+ const g=addPt(c.lat,c.lon,4+a.total/40,'rgba(100,240,200,0.7)','rgba(100,240,200,0.3)',
+ ev=>showPopup(ev,a.region,`${a.total} aircraft<br>No callsign: ${a.noCallsign}<br>High alt: ${a.highAlt}`,'Air Activity'));
+ if(g) g.append('text').attr('class','marker-label').attr('x',10).attr('y',3).attr('fill','var(--dim)').attr('font-size','9px').attr('font-family','var(--mono)').text(a.region.replace(' Region','')+' '+a.total);
+ });
+ // Thermal
+ D.thermal.forEach(t=>t.fires.forEach(f=>{
+ addPt(f.lat,f.lon,2+Math.min(f.frp/50,5),'rgba(255,95,99,0.6)','rgba(255,95,99,0.2)',
+ ev=>showPopup(ev,'Thermal',`${t.region}<br>FRP: ${f.frp.toFixed(1)} MW`,'FIRMS'));
+ }));
+ // Chokepoints
+ D.chokepoints.forEach(cp=>{
+ const[x,y]=proj([cp.lon,cp.lat]);if(!x||!y)return;
+ const g=mg.append('g').attr('transform',`translate(${x},${y})`).style('cursor','pointer')
+ .on('click',ev=>{ev.stopPropagation();showPopup(ev,cp.label,cp.note,'Maritime')});
+ g.append('rect').attr('x',-4).attr('y',-4).attr('width',8).attr('height',8).attr('fill','rgba(179,136,255,0.7)').attr('stroke','rgba(179,136,255,0.3)').attr('stroke-width',0.5).attr('transform','rotate(45)');
+ g.append('text').attr('class','marker-label').attr('x',8).attr('y',3).attr('fill','var(--dim)').attr('font-size','8px').attr('font-family','var(--mono)').text(cp.label);
+ });
+ // Nuclear
+ const nukeCoords=[{lat:47.5,lon:34.6},{lat:51.4,lon:30.1},{lat:28.8,lon:50.9},{lat:39.8,lon:125.8},{lat:37.4,lon:141},{lat:31.0,lon:35.1}];
+ D.nuke.forEach((n,i)=>{const c=nukeCoords[i];if(!c)return;addPt(c.lat,c.lon,4,'rgba(255,224,130,0.7)','rgba(255,224,130,0.3)',ev=>showPopup(ev,n.site,`CPM: ${n.cpm?.toFixed(1)||'--'}`,'Radiation'))});
+ // SDR
+ D.sdr.zones.forEach(z=>z.receivers.forEach(r=>{addPt(r.lat,r.lon,2.5,'rgba(68,204,255,0.5)','rgba(68,204,255,0.2)',ev=>showPopup(ev,'SDR',`${r.name}<br>${z.region}`,'KiwiSDR'))}));
+ // OSINT
+ const osintGeo=[{lat:45,lon:41,idx:0},{lat:48,lon:37,idx:1},{lat:48.5,lon:37.5,idx:2},{lat:45,lon:40.2,idx:3},{lat:50.6,lon:36.6,idx:5},{lat:48.5,lon:35,idx:6}];
+ osintGeo.forEach(o=>{const p=D.tg.urgent[o.idx];if(!p)return;addPt(o.lat,o.lon,4,'rgba(255,184,76,0.7)','rgba(255,184,76,0.3)',ev=>showPopup(ev,(p.channel||'').toUpperCase(),cleanText(p.text?.substring(0,200)||''),`${p.views||'?'} views`))});
+ // WHO
+ const whoGeo=[{lat:0.3,lon:32.6},{lat:-6.2,lon:106.8},{lat:-4.3,lon:15.3},{lat:35,lon:105},{lat:12.5,lon:105},{lat:35,lon:105},{lat:28,lon:84},{lat:24,lon:45},{lat:30,lon:70},{lat:-0.8,lon:11.6}];
+ D.who.slice(0,10).forEach((w,i)=>{const c=whoGeo[i];if(!c)return;addPt(c.lat,c.lon,3.5,'rgba(105,240,174,0.6)','rgba(105,240,174,0.2)',ev=>showPopup(ev,w.title,w.summary||'','WHO'))});
+ // News
+ (D.news||[]).forEach(n=>{addPt(n.lat,n.lon,3,'rgba(129,212,250,0.6)','rgba(129,212,250,0.2)',ev=>showPopup(ev,n.source+' NEWS',cleanText(n.title),n.region))});
+ // ACLED
+ (D.acled?.deadliestEvents||[]).filter(e=>e.lat&&e.lon).forEach(e=>{
+ const[x,y]=proj([e.lon,e.lat]);if(!x||!y)return;
+ const r=Math.max(4,Math.min(14,2+Math.log2(Math.max(e.fatalities,1))*1.5));
+ const g=mg.append('g').attr('transform',`translate(${x},${y})`).style('cursor','pointer')
+ .on('click',ev=>{ev.stopPropagation();showPopup(ev,e.type||'CONFLICT',`${e.fatalities} fatalities<br>${e.location}, ${e.country}`,'ACLED')});
+ g.append('circle').attr('class','conflict-ring marker-circle').attr('r',r).attr('data-base-r',r).attr('fill','none').attr('stroke','rgba(255,120,80,0.7)').attr('stroke-width',1.5);
+ g.append('circle').attr('r',r*0.4).attr('fill','rgba(255,120,80,0.3)');
+ });
+ // Flight corridors
+ const airCoordsFlight=[{lat:30,lon:44},{lat:24,lon:120},{lat:49,lon:32},{lat:57,lon:24},{lat:14,lon:114},{lat:37,lon:127}];
+ const hubs=[{lat:40.6,lon:-73.8},{lat:51.5,lon:-0.5},{lat:25.3,lon:55.4},{lat:1.4,lon:103.8},{lat:-33.9,lon:151.2},{lat:-23.4,lon:-46.5}];
+ const cG=flatG.append('g').attr('class','corridors-layer');
+ for(let i=0;i<D.air.length;i++){for(let j=i+1;j<D.air.length;j++){
+ const a=D.air[i],b=D.air[j],from=airCoordsFlight[i],to=airCoordsFlight[j];
+ if(!from||!to)continue;const traffic=a.total+b.total;if(traffic<30)continue;
+ const ncR=(a.noCallsign+b.noCallsign)/Math.max(traffic,1);
+ const clr=ncR>0.15?'rgba(255,95,99,0.4)':ncR>0.05?'rgba(255,184,76,0.35)':'rgba(100,240,200,0.25)';
+ const interp=d3.geoInterpolate([from.lon,from.lat],[to.lon,to.lat]);
+ const coords=[];for(let k=0;k<=40;k++)coords.push(interp(k/40));
+ const feat={type:'Feature',geometry:{type:'LineString',coordinates:coords}};
+ cG.append('path').datum(feat).attr('d',flatPath).attr('fill','none').attr('stroke',clr).attr('stroke-width',Math.max(0.8,Math.min(3,traffic/80)));
+ }}
+ D.air.forEach((a,i)=>{if(!airCoordsFlight[i]||a.total<25)return;hubs.forEach(hub=>{
+ if(Math.abs(airCoordsFlight[i].lat-hub.lat)+Math.abs(airCoordsFlight[i].lon-hub.lon)<20)return;
+ const interp=d3.geoInterpolate([airCoordsFlight[i].lon,airCoordsFlight[i].lat],[hub.lon,hub.lat]);
+ const coords=[];for(let k=0;k<=40;k++)coords.push(interp(k/40));
+ cG.append('path').datum({type:'Feature',geometry:{type:'LineString',coordinates:coords}}).attr('d',flatPath).attr('fill','none').attr('stroke','rgba(100,240,200,0.15)').attr('stroke-width',0.6);
+ })});
+}
+
+// Update setRegion for flat mode
+const _origSetRegion = setRegion;
+
+// Override mapZoom for flat mode
+const _origMapZoom = mapZoom;
+
+function setRegion(r){
+ document.querySelectorAll('.region-btn').forEach(b=>b.classList.toggle('active',b.dataset.region===r));
+ closePopup();
+ if(isFlat && flatSvg && flatZoom){
+ if(r==='world'){flatSvg.transition().duration(750).call(flatZoom.transform,d3.zoomIdentity);return;}
+ const bounds=flatRegionBounds[r];
+ const p0=flatProjection(bounds[0]),p1=flatProjection(bounds[1]);if(!p0||!p1)return;
+ const dx=Math.abs(p1[0]-p0[0]),dy=Math.abs(p1[1]-p0[1]);
+ const cx=(p0[0]+p1[0])/2,cy=(p0[1]+p1[1])/2;
+ const scale=Math.min(flatW/dx,flatH/dy)*0.85;
+ flatSvg.transition().duration(750).call(flatZoom.transform,d3.zoomIdentity.translate(flatW/2-scale*cx,flatH/2-scale*cy).scale(scale));
+ } else {
+ const pov=regionPOV[r]||regionPOV.world;
+ globe.pointOfView(pov,1000);
+ }
+}
+
+function mapZoom(factor){
+ if(isFlat && flatSvg && flatZoom){
+ flatSvg.transition().duration(300).call(flatZoom.scaleBy,factor);
+ } else if(globe){
+ const pov=globe.pointOfView();
+ globe.pointOfView({altitude:pov.altitude/factor},300);
+ }
}
// Sparkline SVG generator
diff --git a/docs/globe.png b/docs/globe.png
new file mode 100644
index 0000000..71e6eeb
Binary files /dev/null and b/docs/globe.png differ
diff --git a/package.json b/package.json
index 5d9085e..92c3c20 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
},
"keywords": ["osint", "intelligence", "dashboard", "geopolitical"],
"author": "Crucix",
- "license": "ISC",
+ "license": "AGPL-3.0-only",
"engines": {
"node": ">=22",
"npm": ">=10"