Skip to content

Commit 96dec40

Browse files
committed
cleaned up examples
1 parent 154ee98 commit 96dec40

File tree

8 files changed

+31
-5
lines changed

8 files changed

+31
-5
lines changed

src/examples/docString/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8">

src/examples/docString/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function collectResults(responseJson) {
8888
const values = responseJson.values
8989
console.log(responseJson)
9090

91-
const str = values[0].InnerTree['{ 0; }'][0].data
91+
const str = values[0].InnerTree['{0}'][0].data
9292
const data = JSON.parse(str)
9393
const arr = _base64ToArrayBuffer(data)
9494
doc = rhino.File3dm.fromByteArray(arr)

src/examples/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ <h1>AppServer Examples</h1>
2929
<td><a href="./panels/">panels</a></td>
3030
<td>This example how to use numeric output to add more information in the UI.</td>
3131
</tr>
32+
<tr>
33+
<td><a href="./metaballTable/">metaball table</a></td>
34+
<td>Example which uses interaction to move input points around.</td>
35+
</tr>
36+
<tr>
37+
<td><a href="./bendy/">bendy</a></td>
38+
<td>Example which uses the Kangaroo solver.</td>
39+
</tr>
40+
<tr>
41+
<td><a href="./docString/">docString</a></td>
42+
<td>Example which shows how to return a rhinoDoc from Grasshopper and parse it in the browser.</td>
43+
</tr>
44+
<tr>
45+
<td><a href="./multi/">multi</a></td>
46+
<td>Example which shows how to select the GH file to solve.</td>
47+
</tr>
48+
<tr>
49+
<td><a href="./upload/">upload</a></td>
50+
<td>Example which shows how upload a file as input.</td>
51+
</tr>
3252
</table>
3353
</body>
3454
</html>

src/examples/metaballTable/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8">

src/examples/panels/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8">

src/examples/panels/script.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async function compute(){
7171
document.getElementById('loader').style.display = 'none'
7272

7373
// process mesh
74-
let mesh_data = JSON.parse(responseJson.values[0].InnerTree['{ 0; }'][0].data)
74+
let mesh_data = JSON.parse(responseJson.values[0].InnerTree['{0}'][0].data)
7575
let mesh = rhino.CommonObject.decode(mesh_data)
7676

7777
if (!_threeMaterial) {
@@ -82,11 +82,12 @@ async function compute(){
8282
replaceCurrentMesh(threeMesh)
8383

8484
//process data
85-
let cluster_data = responseJson.values[1].InnerTree['{ 0; }'].map(d=>d.data)
85+
//console.log(responseJson.values[1])
86+
let cluster_data = responseJson.values[1].InnerTree['{0;0}'].map(d=>d.data)
8687
console.log(cluster_data)
8788

8889
//process colors
89-
let color_data = responseJson.values[2].InnerTree['{ 0; }'].map( d=> {
90+
let color_data = responseJson.values[2].InnerTree['{0}'].map( d=> {
9091

9192
return 'rgb(' + JSON.parse(d.data) + ')'
9293

src/examples/spikyThing/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8">

src/examples/spikyThing/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ async function compute(){
7373

7474
// hide spinner
7575
document.getElementById('loader').style.display = 'none'
76-
let data = JSON.parse(responseJson.values[0].InnerTree['{ 0; }'][0].data)
76+
//console.log(responseJson.values[0])
77+
let data = JSON.parse(responseJson.values[0].InnerTree['{0}'][0].data)
7778
let mesh = rhino.DracoCompression.decompressBase64String(data)
7879

7980
t1 = performance.now()

0 commit comments

Comments
 (0)