canvas-globe 1.0.2 → 1.1.1
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.
- package/CHANGELOG.md +15 -0
- package/README.md +23 -6
- package/codemeta.json +1 -1
- package/dist/canvas-globe.umd.js +12 -2
- package/package.json +18 -4
- package/src/license.js +11 -1
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,21 @@ All notable changes to this package are documented here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.1.1] - 2026-09-17
|
|
10
|
+
|
|
11
|
+
- Prevented the production licensing presentation from covering live globes on
|
|
12
|
+
the official CanvasGlobe website and its Cloudflare preview deployments.
|
|
13
|
+
- Kept the licensing presentation unchanged for customer production domains.
|
|
14
|
+
|
|
15
|
+
## [1.1.0] - 2026-09-17
|
|
16
|
+
|
|
17
|
+
- Added official Vue, Angular, Svelte, and Web Component packages that keep
|
|
18
|
+
framework lifecycle code separate while sharing the CanvasGlobe renderer.
|
|
19
|
+
- Added `3d-globe-map` as an official discovery package that re-exports the
|
|
20
|
+
canonical `canvas-globe` implementation without duplicating source code.
|
|
21
|
+
- Extended companion-package release checks and publishing automation so all
|
|
22
|
+
official package entry points stay version-aligned.
|
|
23
|
+
|
|
9
24
|
## [1.0.2] - 2026-09-17
|
|
10
25
|
|
|
11
26
|
- Added a prominent commercial-license notice near the top of the npm README,
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
`canvas-globe` is a zero-dependency JavaScript library for an interactive
|
|
43
43
|
**3D globe** and **flat world map** on Canvas 2D. It works with
|
|
44
|
-
vanilla JavaScript, React, or a Web Component and requires no WebGL, map API
|
|
44
|
+
vanilla JavaScript, React, Vue, Angular, Svelte, or a Web Component and requires no WebGL, map API
|
|
45
45
|
key, tile service, or runtime network request.
|
|
46
46
|
|
|
47
47
|
- **Zero dependencies:** no WebGL, D3, map tiles, or API keys
|
|
@@ -60,7 +60,7 @@ key, tile service, or runtime network request.
|
|
|
60
60
|
- **Day and night:** calculate the solar terminator for a given time
|
|
61
61
|
- **Four projections:** orthographic, equirectangular, Mercator, and Natural Earth
|
|
62
62
|
- **Accessibility:** keyboard controls, a live region, and reduced-motion support
|
|
63
|
-
- **Bindings:** vanilla JavaScript,
|
|
63
|
+
- **Bindings:** vanilla JavaScript, React, Vue, Angular, Svelte, and a custom element
|
|
64
64
|
|
|
65
65
|
Common uses include audience dashboards, launch pages, status boards, and share graphics.
|
|
66
66
|
|
|
@@ -135,19 +135,19 @@ your existing application rather than installing a second React copy.
|
|
|
135
135
|
For a plain `<script>` installation, use the versioned UMD build:
|
|
136
136
|
|
|
137
137
|
```html
|
|
138
|
-
<script src="https://cdn.jsdelivr.net/npm/canvas-globe@1.
|
|
138
|
+
<script src="https://cdn.jsdelivr.net/npm/canvas-globe@1.1.1/dist/canvas-globe.umd.js"></script>
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
The same npm release is also available from UNPKG:
|
|
142
142
|
|
|
143
143
|
```html
|
|
144
|
-
<script src="https://unpkg.com/canvas-globe@1.
|
|
144
|
+
<script src="https://unpkg.com/canvas-globe@1.1.1/dist/canvas-globe.umd.js"></script>
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
Modern browsers can import the package through an ESM CDN:
|
|
148
148
|
|
|
149
149
|
```js
|
|
150
|
-
import { createGlobe } from "https://esm.sh/canvas-globe@1.
|
|
150
|
+
import { createGlobe } from "https://esm.sh/canvas-globe@1.1.1";
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
Pin an exact version in production so a future release cannot change a deployed page unexpectedly.
|
|
@@ -167,7 +167,7 @@ import { createGlobe } from "canvas-globe";
|
|
|
167
167
|
Or drop the UMD build on a page with no build step at all:
|
|
168
168
|
|
|
169
169
|
```html
|
|
170
|
-
<script src="https://cdn.jsdelivr.net/npm/canvas-globe@1.
|
|
170
|
+
<script src="https://cdn.jsdelivr.net/npm/canvas-globe@1.1.1/dist/canvas-globe.umd.js"></script>
|
|
171
171
|
<canvas id="globe" style="width:520px;aspect-ratio:1"></canvas>
|
|
172
172
|
<script>
|
|
173
173
|
CanvasGlobe.createGlobe(document.getElementById("globe"), {
|
|
@@ -250,6 +250,23 @@ For a dedicated React package name, install the thin companion entry point:
|
|
|
250
250
|
npm install react-canvas-globe
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
+
### Framework and discovery packages
|
|
254
|
+
|
|
255
|
+
Every official package uses the same CanvasGlobe renderer and commercial
|
|
256
|
+
license. Framework packages add native lifecycle and event integration, while
|
|
257
|
+
`3d-globe-map` is an alternate discovery entry for the canonical API.
|
|
258
|
+
|
|
259
|
+
| Package | Use it for |
|
|
260
|
+
| --- | --- |
|
|
261
|
+
| [`canvas-globe`](https://www.npmjs.com/package/canvas-globe) | Canonical JavaScript and Canvas 2D API |
|
|
262
|
+
| [`react-canvas-globe`](https://www.npmjs.com/package/react-canvas-globe) | React component |
|
|
263
|
+
| [`canvas-globe-vue`](https://www.npmjs.com/package/canvas-globe-vue) | Vue 3 component |
|
|
264
|
+
| [`canvas-globe-angular`](https://www.npmjs.com/package/canvas-globe-angular) | Angular standalone component |
|
|
265
|
+
| [`canvas-globe-svelte`](https://www.npmjs.com/package/canvas-globe-svelte) | Svelte and SvelteKit component |
|
|
266
|
+
| [`canvas-globe-web-component`](https://www.npmjs.com/package/canvas-globe-web-component) | Framework-independent custom element |
|
|
267
|
+
| [`3d-globe-map`](https://www.npmjs.com/package/3d-globe-map) | Search-friendly alternate package entry |
|
|
268
|
+
| [`create-canvas-globe`](https://www.npmjs.com/package/create-canvas-globe) | Project scaffolder and starter templates |
|
|
269
|
+
|
|
253
270
|
To scaffold a complete starter for React, Next.js, Vue, SvelteKit, Vanilla
|
|
254
271
|
JavaScript, or Web Components, run:
|
|
255
272
|
|
package/codemeta.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"identifier": "canvas-globe",
|
|
6
6
|
"description": "CanvasGlobe helps developers add interactive 3D globes and flat world maps to JavaScript and React apps with Canvas 2D, without WebGL, map tiles, API keys, or runtime network calls.",
|
|
7
7
|
"url": "https://canvasglobe.swiftools.com/",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.1.1",
|
|
9
9
|
"codeRepository": "https://github.com/Shree-hari/canvas-globe",
|
|
10
10
|
"issueTracker": "https://github.com/Shree-hari/canvas-globe/issues",
|
|
11
11
|
"downloadUrl": "https://www.npmjs.com/package/canvas-globe",
|
package/dist/canvas-globe.umd.js
CHANGED
|
@@ -1314,7 +1314,7 @@ function drawFitted(ctx, media, box) {
|
|
|
1314
1314
|
}
|
|
1315
1315
|
|
|
1316
1316
|
// Keep in sync with package.json. Release checks enforce this value.
|
|
1317
|
-
const CANVAS_GLOBE_VERSION = "1.
|
|
1317
|
+
const CANVAS_GLOBE_VERSION = "1.1.1";
|
|
1318
1318
|
|
|
1319
1319
|
/** Local license-key checks and production-use presentation helpers. */
|
|
1320
1320
|
|
|
@@ -1342,9 +1342,18 @@ const PRIVATE_HOST_PATTERNS = [
|
|
|
1342
1342
|
/^::1$/,
|
|
1343
1343
|
];
|
|
1344
1344
|
|
|
1345
|
+
const OFFICIAL_SITE_HOSTS = new Set([
|
|
1346
|
+
"canvasglobe.swiftools.com",
|
|
1347
|
+
"canvas-globe-website.pages.dev",
|
|
1348
|
+
]);
|
|
1349
|
+
const OFFICIAL_PREVIEW_SUFFIX = ".canvas-globe-website.pages.dev";
|
|
1350
|
+
|
|
1345
1351
|
const normalizeLicenseKey = (value) =>
|
|
1346
1352
|
typeof value === "string" ? value.trim() : "";
|
|
1347
1353
|
|
|
1354
|
+
const isOfficialSiteHost = (hostname) =>
|
|
1355
|
+
OFFICIAL_SITE_HOSTS.has(hostname) || hostname.endsWith(OFFICIAL_PREVIEW_SUFFIX);
|
|
1356
|
+
|
|
1348
1357
|
/** Returns development, production or unknown for a browser location. */
|
|
1349
1358
|
function inspectRuntime(locationValue = globalThis.location) {
|
|
1350
1359
|
if (!locationValue) return { kind: "unknown", hostname: "", public: false };
|
|
@@ -1391,7 +1400,7 @@ function getLicensePresentation(
|
|
|
1391
1400
|
) {
|
|
1392
1401
|
const status = inspectLicenseKey(value, mode);
|
|
1393
1402
|
const runtime = inspectRuntime(locationValue);
|
|
1394
|
-
if (!mode || status.valid || !runtime.public) {
|
|
1403
|
+
if (!mode || status.valid || !runtime.public || isOfficialSiteHost(runtime.hostname)) {
|
|
1395
1404
|
return { status, runtime, notice: null };
|
|
1396
1405
|
}
|
|
1397
1406
|
return {
|
|
@@ -1411,6 +1420,7 @@ function reportLicenseStatus(value, mode = COMMERCIAL_LICENSE_MODE) {
|
|
|
1411
1420
|
const presentation = getLicensePresentation(value, globalThis.location, mode);
|
|
1412
1421
|
const { status } = presentation;
|
|
1413
1422
|
if (typeof location === "undefined") return status;
|
|
1423
|
+
if (!presentation.notice) return status;
|
|
1414
1424
|
if (status.kind === "missing") {
|
|
1415
1425
|
console.error(
|
|
1416
1426
|
mode
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvas-globe",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Build interactive 3D globes and flat world maps in JavaScript
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Build interactive 3D globes and flat world maps in JavaScript, React, Vue, Angular, or Svelte with Canvas 2D and no WebGL.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harsh Jhunjhunuwala"
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
"map",
|
|
25
25
|
"world-map",
|
|
26
26
|
"react-globe",
|
|
27
|
+
"vue-globe",
|
|
28
|
+
"angular-globe",
|
|
29
|
+
"svelte-globe",
|
|
30
|
+
"web-component-globe",
|
|
31
|
+
"3d-globe-map",
|
|
27
32
|
"react",
|
|
28
33
|
"globe-visualization",
|
|
29
34
|
"data-visualization",
|
|
@@ -97,7 +102,8 @@
|
|
|
97
102
|
"build:registry": "shadcn build --output .registry-build",
|
|
98
103
|
"capture:readme": "node scripts/capture-readme-demo.mjs",
|
|
99
104
|
"test": "node --test",
|
|
100
|
-
"
|
|
105
|
+
"build:companions": "npm --prefix packages/canvas-globe-angular run build",
|
|
106
|
+
"test:ecosystem": "npm run build:companions && npm run build:registry && node scripts/validate-ecosystem.mjs && npm --prefix packages/create-canvas-globe test",
|
|
101
107
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
102
108
|
"typecheck:ecosystem": "tsc --noEmit -p tsconfig.ecosystem.json",
|
|
103
109
|
"smoke:package": "node scripts/package-smoke.mjs",
|
|
@@ -115,18 +121,26 @@
|
|
|
115
121
|
}
|
|
116
122
|
},
|
|
117
123
|
"devDependencies": {
|
|
124
|
+
"@angular/compiler": "^21.2.23",
|
|
125
|
+
"@angular/compiler-cli": "^21.2.23",
|
|
126
|
+
"@angular/core": "^21.2.23",
|
|
118
127
|
"@storybook/addon-a11y": "^10.6.0",
|
|
119
128
|
"@storybook/html-vite": "^10.6.0",
|
|
129
|
+
"@sveltejs/package": "^2.5.8",
|
|
120
130
|
"@types/react": "^19.3.0",
|
|
121
131
|
"chromatic": "^18.8.1",
|
|
122
132
|
"gifenc": "^1.0.3",
|
|
123
133
|
"playwright-core": "^1.63.0",
|
|
124
134
|
"pngjs": "^7.0.0",
|
|
125
135
|
"polygon-clipping": "^0.15.7",
|
|
136
|
+
"rxjs": "^7.8.2",
|
|
126
137
|
"shadcn": "^4.21.0",
|
|
127
138
|
"storybook": "^10.6.0",
|
|
139
|
+
"svelte": "^5.57.0",
|
|
128
140
|
"topojson-client": "^3.1.0",
|
|
129
|
-
"typescript": "^5.5.0"
|
|
141
|
+
"typescript": "^5.5.0",
|
|
142
|
+
"vue": "^3.5.43",
|
|
143
|
+
"zone.js": "^0.16.0"
|
|
130
144
|
},
|
|
131
145
|
"engines": {
|
|
132
146
|
"node": ">=18"
|
package/src/license.js
CHANGED
|
@@ -24,9 +24,18 @@ const PRIVATE_HOST_PATTERNS = [
|
|
|
24
24
|
/^::1$/,
|
|
25
25
|
];
|
|
26
26
|
|
|
27
|
+
const OFFICIAL_SITE_HOSTS = new Set([
|
|
28
|
+
"canvasglobe.swiftools.com",
|
|
29
|
+
"canvas-globe-website.pages.dev",
|
|
30
|
+
]);
|
|
31
|
+
const OFFICIAL_PREVIEW_SUFFIX = ".canvas-globe-website.pages.dev";
|
|
32
|
+
|
|
27
33
|
const normalizeLicenseKey = (value) =>
|
|
28
34
|
typeof value === "string" ? value.trim() : "";
|
|
29
35
|
|
|
36
|
+
const isOfficialSiteHost = (hostname) =>
|
|
37
|
+
OFFICIAL_SITE_HOSTS.has(hostname) || hostname.endsWith(OFFICIAL_PREVIEW_SUFFIX);
|
|
38
|
+
|
|
30
39
|
/** Returns development, production or unknown for a browser location. */
|
|
31
40
|
export function inspectRuntime(locationValue = globalThis.location) {
|
|
32
41
|
if (!locationValue) return { kind: "unknown", hostname: "", public: false };
|
|
@@ -73,7 +82,7 @@ export function getLicensePresentation(
|
|
|
73
82
|
) {
|
|
74
83
|
const status = inspectLicenseKey(value, mode);
|
|
75
84
|
const runtime = inspectRuntime(locationValue);
|
|
76
|
-
if (!mode || status.valid || !runtime.public) {
|
|
85
|
+
if (!mode || status.valid || !runtime.public || isOfficialSiteHost(runtime.hostname)) {
|
|
77
86
|
return { status, runtime, notice: null };
|
|
78
87
|
}
|
|
79
88
|
return {
|
|
@@ -93,6 +102,7 @@ export function reportLicenseStatus(value, mode = COMMERCIAL_LICENSE_MODE) {
|
|
|
93
102
|
const presentation = getLicensePresentation(value, globalThis.location, mode);
|
|
94
103
|
const { status } = presentation;
|
|
95
104
|
if (typeof location === "undefined") return status;
|
|
105
|
+
if (!presentation.notice) return status;
|
|
96
106
|
if (status.kind === "missing") {
|
|
97
107
|
console.error(
|
|
98
108
|
mode
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Keep in sync with package.json. Release checks enforce this value.
|
|
2
|
-
export const CANVAS_GLOBE_VERSION = "1.
|
|
2
|
+
export const CANVAS_GLOBE_VERSION = "1.1.1";
|