tangram-globe 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <div class="globe-toggle">
3
+ <button
4
+ :class="{ active: isGlobeView }"
5
+ :title="isGlobeView ? 'Switch to mercator view' : 'Switch to globe view'"
6
+ @click="toggleGlobe"
7
+ >
8
+ <span class="fa fa-globe"></span>
9
+ </button>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { ref, inject } from "vue";
15
+ import type { TangramApi } from "@open-aviation/tangram-core/api";
16
+
17
+ const tangramApi = inject<TangramApi>("tangramApi");
18
+ if (!tangramApi) {
19
+ throw new Error("assert: tangram api not provided");
20
+ }
21
+
22
+ const isGlobeView = ref(false);
23
+
24
+ const toggleGlobe = () => {
25
+ if (!tangramApi.map.isReady.value) return;
26
+
27
+ const mapInstance = tangramApi.map.getMapInstance();
28
+ const newGlobeState = !isGlobeView.value;
29
+
30
+ mapInstance.setProjection(newGlobeState ? { type: "globe" } : { type: "mercator" });
31
+
32
+ isGlobeView.value = newGlobeState;
33
+ };
34
+ </script>
35
+
36
+ <style scoped>
37
+ .globe-toggle button {
38
+ background: white;
39
+ border: 1px solid #ddd;
40
+ border-radius: 4px;
41
+ padding: 8px 12px;
42
+ cursor: pointer;
43
+ font-size: 16px;
44
+ transition: all 0.2s ease;
45
+ color: #333;
46
+ }
47
+
48
+ .globe-toggle button:hover {
49
+ background: #f5f5f5;
50
+ border-color: #bbb;
51
+ }
52
+
53
+ .globe-toggle button.active {
54
+ background: oklch(0.72 0.075 245);
55
+ color: white;
56
+ border-color: oklch(0.59 0.075 245);
57
+ }
58
+ </style>
@@ -0,0 +1,16 @@
1
+ from dataclasses import dataclass
2
+ from typing import Annotated
3
+
4
+ import tangram_core
5
+ from tangram_core.config import ExposeField
6
+
7
+
8
+ @dataclass
9
+ class GlobeConfig(tangram_core.config.HasSidebarUiConfig):
10
+ topbar_order: Annotated[int, ExposeField()] = 1000
11
+
12
+
13
+ plugin = tangram_core.Plugin(
14
+ frontend_path="dist-frontend",
15
+ config_class=GlobeConfig,
16
+ )
@@ -0,0 +1 @@
1
+ .globe-toggle button[data-v-871c94ae]{background:#fff;border:1px solid #ddd;border-radius:4px;padding:8px 12px;cursor:pointer;font-size:16px;transition:all .2s ease;color:#333}.globe-toggle button[data-v-871c94ae]:hover{background:#f5f5f5;border-color:#bbb}.globe-toggle button.active[data-v-871c94ae]{background:#7daad1;color:#fff;border-color:#5682a7}
@@ -0,0 +1,37 @@
1
+ import { defineComponent as s, inject as c, ref as i, createElementBlock as p, openBlock as g, createElementVNode as l, normalizeClass as _ } from "vue";
2
+ const m = { class: "globe-toggle" }, u = ["title"], v = /* @__PURE__ */ s({
3
+ __name: "GlobeToggle",
4
+ setup(o) {
5
+ const e = c("tangramApi");
6
+ if (!e)
7
+ throw new Error("assert: tangram api not provided");
8
+ const t = i(!1), r = () => {
9
+ if (!e.map.isReady.value) return;
10
+ const n = e.map.getMapInstance(), a = !t.value;
11
+ n.setProjection(a ? { type: "globe" } : { type: "mercator" }), t.value = a;
12
+ };
13
+ return (n, a) => (g(), p("div", m, [
14
+ l("button", {
15
+ class: _({ active: t.value }),
16
+ title: t.value ? "Switch to mercator view" : "Switch to globe view",
17
+ onClick: r
18
+ }, [...a[0] || (a[0] = [
19
+ l("span", { class: "fa fa-globe" }, null, -1)
20
+ ])], 10, u)
21
+ ]));
22
+ }
23
+ }), b = (o, e) => {
24
+ const t = o.__vccOpts || o;
25
+ for (const [r, n] of e)
26
+ t[r] = n;
27
+ return t;
28
+ }, d = /* @__PURE__ */ b(v, [["__scopeId", "data-v-871c94ae"]]);
29
+ function w(o, e) {
30
+ o.ui.registerWidget("globe-toggle", "TopBar", d, {
31
+ priority: e?.topbar_order
32
+ });
33
+ }
34
+ export {
35
+ w as install
36
+ };
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/tangram_globe/GlobeToggle.vue","../src/tangram_globe/index.ts"],"sourcesContent":["<template>\n <div class=\"globe-toggle\">\n <button\n :class=\"{ active: isGlobeView }\"\n :title=\"isGlobeView ? 'Switch to mercator view' : 'Switch to globe view'\"\n @click=\"toggleGlobe\"\n >\n <span class=\"fa fa-globe\"></span>\n </button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, inject } from \"vue\";\nimport type { TangramApi } from \"@open-aviation/tangram-core/api\";\n\nconst tangramApi = inject<TangramApi>(\"tangramApi\");\nif (!tangramApi) {\n throw new Error(\"assert: tangram api not provided\");\n}\n\nconst isGlobeView = ref(false);\n\nconst toggleGlobe = () => {\n if (!tangramApi.map.isReady.value) return;\n\n const mapInstance = tangramApi.map.getMapInstance();\n const newGlobeState = !isGlobeView.value;\n\n mapInstance.setProjection(newGlobeState ? { type: \"globe\" } : { type: \"mercator\" });\n\n isGlobeView.value = newGlobeState;\n};\n</script>\n\n<style scoped>\n.globe-toggle button {\n background: white;\n border: 1px solid #ddd;\n border-radius: 4px;\n padding: 8px 12px;\n cursor: pointer;\n font-size: 16px;\n transition: all 0.2s ease;\n color: #333;\n}\n\n.globe-toggle button:hover {\n background: #f5f5f5;\n border-color: #bbb;\n}\n\n.globe-toggle button.active {\n background: oklch(0.72 0.075 245);\n color: white;\n border-color: oklch(0.59 0.075 245);\n}\n</style>\n","import type { TangramApi } from \"@open-aviation/tangram-core/api\";\nimport GlobeToggle from \"./GlobeToggle.vue\";\n\nexport function install(api: TangramApi, config?: SystemConfig) {\n api.ui.registerWidget(\"globe-toggle\", \"TopBar\", GlobeToggle, {\n priority: config?.topbar_order\n });\n}\n"],"names":["tangramApi","inject","isGlobeView","ref","toggleGlobe","mapInstance","newGlobeState","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","install","api","config","GlobeToggle"],"mappings":";;;;AAgBA,UAAMA,IAAaC,EAAmB,YAAY;AAClD,QAAI,CAACD;AACH,YAAM,IAAI,MAAM,kCAAkC;AAGpD,UAAME,IAAcC,EAAI,EAAK,GAEvBC,IAAc,MAAM;AACxB,UAAI,CAACJ,EAAW,IAAI,QAAQ,MAAO;AAEnC,YAAMK,IAAcL,EAAW,IAAI,eAAA,GAC7BM,IAAgB,CAACJ,EAAY;AAEnC,MAAAG,EAAY,cAAcC,IAAgB,EAAE,MAAM,YAAY,EAAE,MAAM,YAAY,GAElFJ,EAAY,QAAQI;AAAA,IACtB;sBA/BEC,EAAA,GAAAC,EAQM,OARNC,GAQM;AAAA,MAPJC,EAMS,UAAA;AAAA,QALN,mBAAiBR,EAAA,OAAW;AAAA,QAC5B,OAAOA,EAAA,QAAW,4BAAA;AAAA,QAClB,SAAOE;AAAA,MAAA;QAERM,EAAiC,QAAA,EAA3B,OAAM,cAAA,GAAa,MAAA,EAAA;AAAA,MAAA;;;;;;;;;ACJxB,SAASC,EAAQC,GAAiBC,GAAuB;AAC9D,EAAAD,EAAI,GAAG,eAAe,gBAAgB,UAAUE,GAAa;AAAA,IAC3D,UAAUD,GAAQ;AAAA,EAAA,CACnB;AACH;"}
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@open-aviation/tangram-globe",
3
+ "main": "index.js",
4
+ "style": "index.css"
5
+ }
tangram_globe/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ import type { TangramApi } from "@open-aviation/tangram-core/api";
2
+ import GlobeToggle from "./GlobeToggle.vue";
3
+
4
+ export function install(api: TangramApi, config?: SystemConfig) {
5
+ api.ui.registerWidget("globe-toggle", "TopBar", GlobeToggle, {
6
+ priority: config?.topbar_order
7
+ });
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@open-aviation/tangram-globe",
3
+ "version": "0.3.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "src/tangram_globe/index.ts",
7
+ "scripts": {
8
+ "build": "vite build"
9
+ },
10
+ "dependencies": {
11
+ "@open-aviation/tangram-core": "workspace:*"
12
+ },
13
+ "devDependencies": {
14
+ "vue": "^3.5.27"
15
+ }
16
+ }
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: tangram_globe
3
+ Version: 0.3.0
4
+ Summary: Globe view toggle plugin for tangram
5
+ Author: Andres Morfin Veytia
6
+ License-Expression: AGPL-3.0
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Science/Research
9
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Topic :: Scientific/Engineering :: Visualization
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: tangram-core>=0.2.1
19
+ Description-Content-Type: text/markdown
20
+
21
+ # tangram_globe
22
+
23
+ The `tangram_globe` plugin adds a toggle to switch in the top navigatio bar to switch between Mercator and globe view
24
+
25
+
26
+ ## About Tangram
27
+
28
+ `tangram_globe` is a plugin for `tangram`, an open framework for modular, real-time air traffic management research.
29
+
30
+ - Documentation: <https://mode-s.org/tangram/>
31
+ - Repository: <https://github.com/open-aviation/tangram>
32
+
33
+ Installation:
34
+
35
+ ```sh
36
+ # cli via uv
37
+ uv tool install --with tangram-globe tangram-core
38
+ # with pip
39
+ pip install tangram-core tangram-globe
40
+ ```
@@ -0,0 +1,12 @@
1
+ tangram_globe/GlobeToggle.vue,sha256=sv1BwoELo8geTmMt97z49jAgxjPEnClDkoczLWnNx18,1307
2
+ tangram_globe/__init__.py,sha256=FbuSZ2QtWcL8gSt7w3LjFvIxaOFYDZsFxryePm5E5zs,354
3
+ tangram_globe/index.ts,sha256=4Dkom8x_QFxJtMX-iqo0l7mJA46RVlOcIHRAFDIlfws,287
4
+ tangram_globe/dist-frontend/index.css,sha256=FCsgMwLYcH92yNpoXcDsEml2B5VGPxXxCaZhY5Ot_Ss,354
5
+ tangram_globe/dist-frontend/index.js,sha256=A_dwKJDluzk5sXUN9Vt3E_PnvTC51psaW0mC-7ofvPU,1236
6
+ tangram_globe/dist-frontend/index.js.map,sha256=X2uKxzQNQN2sKWnsCfi5CDvhrrKqBq_nC1FlKaIYqpo,2683
7
+ tangram_globe/dist-frontend/plugin.json,sha256=8HaRCyE8bMHo8zl_YDjZS8rSzsSoWI1BAeFMe0UmFCw,90
8
+ tangram_globe/package.json,sha256=4HRiKtho7_BSobn6gvPBVjPnhhGI_obT5hIm9DPJQ0I,314
9
+ tangram_globe-0.3.0.dist-info/METADATA,sha256=vWedovs9hEGZdxHKYGm7Epz0jw9WW9Vd3aSbee9UdNU,1310
10
+ tangram_globe-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
11
+ tangram_globe-0.3.0.dist-info/entry_points.txt,sha256=XRFuHtmIgj66E_Awq3Vc_TfE7ecXqpTQjp7yXQDdtQE,60
12
+ tangram_globe-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [tangram_core.plugins]
2
+ tangram_globe = tangram_globe:plugin