Skip to content

Commit 1655775

Browse files
committed
📈Updated google analytics tracking code
1 parent 0f94766 commit 1655775

5 files changed

Lines changed: 190 additions & 28 deletions

File tree

examples.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
<html>
33

44
<head>
5-
<!-- Global site tag (gtag.js) - Google Analytics -->
6-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-161822888-1"></script>
5+
<!-- Google tag (gtag.js) -->
6+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-50W6WV16DJ"></script>
77
<script>
88
window.dataLayer = window.dataLayer || [];
9-
10-
function gtag() {
11-
dataLayer.push(arguments);
12-
}
9+
function gtag(){dataLayer.push(arguments);}
1310
gtag('js', new Date());
14-
gtag('config', 'UA-161822888-1');
11+
12+
gtag('config', 'G-50W6WV16DJ');
1513
</script>
1614

1715
<meta charset='utf-8'>
@@ -51,6 +49,7 @@
5149
<a class="nav-item nav-link" href="/index.html">Home</a>
5250
<a class="nav-item nav-link" href="/upload.html">Your files</a>
5351
<a class="nav-item nav-link active" href="/examples.html">Examples <span class="sr-only">(current)</span></a>
52+
<a class="nav-item nav-link" href="/blog.html">Ideas</a>
5453
</div>
5554
</div>
5655
</nav>
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# ImmersivePoints - Inline Point Cloud Visualization\n",
8+
"\n",
9+
"This notebook demonstrates how to render point clouds directly in Jupyter notebooks using the `immersivePoints` package."
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"# Install the package (run once)\n",
19+
"# !pip install -e .."
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": null,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"import numpy as np\n",
29+
"import immersivePoints as ip"
30+
]
31+
},
32+
{
33+
"cell_type": "markdown",
34+
"metadata": {},
35+
"source": [
36+
"## Example 1: Random Point Cloud with XYZI Format\n",
37+
"\n",
38+
"Create a random point cloud with position (X, Y, Z) and intensity/hue (I)."
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": null,
44+
"metadata": {},
45+
"outputs": [],
46+
"source": [
47+
"# Generate random points with XYZI format\n",
48+
"n_points = 5000\n",
49+
"points = np.random.randn(n_points, 4).astype(np.float32)\n",
50+
"points[:, :3] *= 5 # Scale positions\n",
51+
"points[:, 3] = np.abs(points[:, 3]) % 1.0 # Hue should be 0-1\n",
52+
"\n",
53+
"# Render inline\n",
54+
"ip.renderPoints(points)"
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"## Example 2: Point Cloud with RGB Colors\n",
62+
"\n",
63+
"Create a point cloud with full RGB color control."
64+
]
65+
},
66+
{
67+
"cell_type": "code",
68+
"execution_count": null,
69+
"metadata": {},
70+
"outputs": [],
71+
"source": [
72+
"# Create a colorful sphere\n",
73+
"n_points = 10000\n",
74+
"\n",
75+
"# Generate points on a sphere surface\n",
76+
"theta = np.random.uniform(0, 2 * np.pi, n_points)\n",
77+
"phi = np.random.uniform(0, np.pi, n_points)\n",
78+
"r = 5\n",
79+
"\n",
80+
"x = r * np.sin(phi) * np.cos(theta)\n",
81+
"y = r * np.sin(phi) * np.sin(theta)\n",
82+
"z = r * np.cos(phi)\n",
83+
"\n",
84+
"# Color based on position\n",
85+
"red = (x - x.min()) / (x.max() - x.min())\n",
86+
"green = (y - y.min()) / (y.max() - y.min())\n",
87+
"blue = (z - z.min()) / (z.max() - z.min())\n",
88+
"\n",
89+
"# Combine into XYZRGB array\n",
90+
"points_rgb = np.column_stack([x, y, z, red, green, blue]).astype(np.float32)\n",
91+
"\n",
92+
"# Render with custom settings\n",
93+
"ip.renderPoints(points_rgb, point_size=0.1, background_color=0x1a1a2e, height=500)"
94+
]
95+
},
96+
{
97+
"cell_type": "markdown",
98+
"metadata": {},
99+
"source": [
100+
"## Example 3: Simple XYZ Points\n",
101+
"\n",
102+
"If you only have XYZ coordinates, the package will automatically add a default color."
103+
]
104+
},
105+
{
106+
"cell_type": "code",
107+
"execution_count": null,
108+
"metadata": {},
109+
"outputs": [],
110+
"source": [
111+
"# Create a spiral\n",
112+
"t = np.linspace(0, 10 * np.pi, 5000)\n",
113+
"x = t * np.cos(t) * 0.2\n",
114+
"y = t * 0.5\n",
115+
"z = t * np.sin(t) * 0.2\n",
116+
"\n",
117+
"# Just XYZ - will get default color\n",
118+
"points_xyz = np.column_stack([x, y, z]).astype(np.float32)\n",
119+
"\n",
120+
"ip.renderPoints(points_xyz, point_size=0.08)"
121+
]
122+
},
123+
{
124+
"cell_type": "markdown",
125+
"metadata": {},
126+
"source": [
127+
"## Example 4: Generate VR Link\n",
128+
"\n",
129+
"Generate a link to view the point cloud in VR on immersivepoints.com."
130+
]
131+
},
132+
{
133+
"cell_type": "code",
134+
"execution_count": null,
135+
"metadata": {},
136+
"outputs": [],
137+
"source": [
138+
"# Show a clickable VR link\n",
139+
"ip.showVR(points_rgb)"
140+
]
141+
},
142+
{
143+
"cell_type": "code",
144+
"execution_count": null,
145+
"metadata": {},
146+
"outputs": [],
147+
"source": [
148+
"# Or get just the URL string\n",
149+
"vr_url = ip.renderPointsVR(points_rgb)\n",
150+
"print(\"VR URL:\", vr_url[:100] + \"...\")"
151+
]
152+
}
153+
],
154+
"metadata": {
155+
"kernelspec": {
156+
"display_name": "Python 3",
157+
"language": "python",
158+
"name": "python3"
159+
},
160+
"language_info": {
161+
"name": "python",
162+
"version": "3.9.0"
163+
}
164+
},
165+
"nbformat": 4,
166+
"nbformat_minor": 4
167+
}

index.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33

44
<head>
55

6-
<!-- Global site tag (gtag.js) - Google Analytics -->
7-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-161822888-1"></script>
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-50W6WV16DJ"></script>
88
<script>
99
window.dataLayer = window.dataLayer || [];
10-
11-
function gtag() {
12-
dataLayer.push(arguments);
13-
}
10+
function gtag(){dataLayer.push(arguments);}
1411
gtag('js', new Date());
15-
gtag('config', 'UA-161822888-1');
1612

13+
gtag('config', 'G-50W6WV16DJ');
1714
</script>
1815

1916
<meta charset='utf-8'>
@@ -62,6 +59,8 @@
6259
<div class="navbar-nav">
6360
<a class="nav-item nav-link active" href="/index.html">Home <span class="sr-only">(current)</span></a>
6461
<a class="nav-item nav-link" href="/upload.html">Your files</a>
62+
<a class="nav-item nav-link" href="/examples.html">Examples</a>
63+
<a class="nav-item nav-link" href="/blog.html">Ideas</a>
6564
</div>
6665
</nav>
6766
</header>

oculus.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33

44
<head>
55

6-
<!-- Global site tag (gtag.js) - Google Analytics -->
7-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-161822888-1"></script>
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-50W6WV16DJ"></script>
88
<script>
99
window.dataLayer = window.dataLayer || [];
10-
11-
function gtag() {
12-
dataLayer.push(arguments);
13-
}
10+
function gtag(){dataLayer.push(arguments);}
1411
gtag('js', new Date());
15-
gtag('config', 'UA-161822888-1');
12+
13+
gtag('config', 'G-50W6WV16DJ');
1614
</script>
1715

1816
<title>Oculus example</title>

upload.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
<head>
44
<meta charset="utf-8">
5-
<!-- Global site tag (gtag.js) - Google Analytics -->
6-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-161822888-1"></script>
5+
<!-- Google tag (gtag.js) -->
6+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-50W6WV16DJ"></script>
77
<script>
88
window.dataLayer = window.dataLayer || [];
9-
10-
function gtag() {
11-
dataLayer.push(arguments);
12-
}
9+
function gtag(){dataLayer.push(arguments);}
1310
gtag('js', new Date());
14-
gtag('config', 'UA-161822888-1');
1511

12+
gtag('config', 'G-50W6WV16DJ');
1613
</script>
1714
<meta name="viewport" content="width=device-width, initial-scale=1">
1815

@@ -139,6 +136,8 @@
139136
<div class="navbar-nav">
140137
<a class="nav-item nav-link" href="/index.html">Home</a>
141138
<a class="nav-item nav-link active" href="/upload.html">Your files <span class="sr-only">(current)</span></a>
139+
<a class="nav-item nav-link" href="/examples.html">Examples</a>
140+
<a class="nav-item nav-link" href="/blog.html">Ideas</a>
142141
</div>
143142
</nav>
144143
</header>

0 commit comments

Comments
 (0)