Skip to content

Commit 13df3c8

Browse files
committed
Add basic example JSON files
1 parent 49f7956 commit 13df3c8

File tree

4 files changed

+477
-10
lines changed

4 files changed

+477
-10
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ There are some environment variables which can be used to control the app in bui
163163

164164
## Common data sources
165165

166+
### Websocket
167+
166168
Quad9 has had great success using Vector (http://vector.dev) to create streaming data via the "websocket" sink. Authentication is a bit non-obvious, so here is a complete example "sink" for a Vector-based data source using random data as an input, with authenticated websocket. Upon loading the globe page, set the "Websocket url:" to be ws://your.host:5007 and username/password as indicated in the sample file.
167169

168170
```
@@ -241,5 +243,14 @@ Username,Password
241243
testuser,ABadPasswordChoice123
242244
```
243245

244-
### Credits
246+
### Data download
247+
248+
The [examples](./examples/data) directory contains some JSON data files that can be directly consumed by the application. Pick a file that you are interested in, copy it over to [public/assets/data/](./public/assets/data) directory and point the `dataDownloadUrl` (or `VITE_DATA_DOWNLOAD_URL`) to it:
249+
```sh
250+
# For example, lets pick the file demonstrating all supported types
251+
cp examples/data/all-types.json public/assets/data/
252+
VITE_DATA_DOWNLOAD_URL=assets/data/all-types.json npm run dev
253+
```
254+
255+
## Credits
245256
most development by Ensar Sarajčić <dev@ensarsarajcic.com>; ongoing feature development, original concept and code by John Todd <jtodd@quad9.net>

examples/data/all-types.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[
2+
{
3+
"type": "settings_command",
4+
"settings": {
5+
"autoRotateGlobe": "false"
6+
}
7+
},
8+
{
9+
"type": "view_command",
10+
"view_lat": 45,
11+
"view_lon": 15,
12+
"view_zoom": 7,
13+
"view_speed": 0.2,
14+
"command_delay": 1000
15+
},
16+
{
17+
"type": "circle",
18+
"lat": 50,
19+
"lon": 5,
20+
"circle_radius": 100
21+
},
22+
{
23+
"type": "pointer",
24+
"lat": 50,
25+
"lon": 30,
26+
"display_text": "Click here to go to\nthe Globe of Wonder GitHub page!",
27+
"link_url": "https://github.com/Quad9DNS/globeofwonder"
28+
},
29+
{
30+
"type": "pointer",
31+
"lat": 55,
32+
"lon": 35,
33+
"display_text": "Test label on hover only",
34+
"display_text_hover_only": true
35+
},
36+
{
37+
"type": "explosion",
38+
"lat": 30,
39+
"lon": 15,
40+
"ttl": 10000,
41+
"counter": 20,
42+
"draw_delay": 5000
43+
},
44+
{
45+
"type": "bar",
46+
"lat": 40,
47+
"lon": -5,
48+
"bar_height": 1000
49+
},
50+
{
51+
"type": "arc",
52+
"lat": 30,
53+
"lon": 15,
54+
"ttl": 10000,
55+
"draw_delay": 5000,
56+
"point2_lat": 50,
57+
"point2_lon": 5,
58+
"arc_draw_duration": 1000
59+
},
60+
{
61+
"type": "downloaded",
62+
"lat": 40,
63+
"lon": 10,
64+
"downloaded_object_url": "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
65+
"downloaded_object_scale": 2,
66+
"hover_text": "Click here to open wikipedia",
67+
"link_url": "https://wikipedia.org"
68+
}
69+
]

0 commit comments

Comments
 (0)