UNPKG

awv3

Version:
1,290 lines (1,289 loc) 247 kB
{ "type": "File", "start": 0, "end": 900, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 22, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 900, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 22, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 31, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 31 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 12, "end": 17, "loc": { "start": { "line": 1, "column": 12 }, "end": { "line": 1, "column": 17 }, "identifierName": "THREE" }, "name": "THREE" } } ], "source": { "type": "StringLiteral", "start": 23, "end": 30, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 30 } }, "extra": { "rawValue": "three", "raw": "'three'" }, "value": "three" } }, { "type": "ImportDeclaration", "start": 32, "end": 66, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 39, "end": 51, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 } }, "local": { "type": "Identifier", "start": 39, "end": 51, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 }, "identifierName": "BaseGraphics" }, "name": "BaseGraphics" } } ], "source": { "type": "StringLiteral", "start": 57, "end": 65, "loc": { "start": { "line": 2, "column": 25 }, "end": { "line": 2, "column": 33 } }, "extra": { "rawValue": "./base", "raw": "'./base'" }, "value": "./base" } }, { "type": "ExportDefaultDeclaration", "start": 68, "end": 899, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 21, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 83, "end": 899, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 21, "column": 1 } }, "id": { "type": "Identifier", "start": 89, "end": 95, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 27 }, "identifierName": "Linear" }, "name": "Linear" }, "superClass": { "type": "Identifier", "start": 104, "end": 116, "loc": { "start": { "line": 4, "column": 36 }, "end": { "line": 4, "column": 48 }, "identifierName": "BaseGraphics" }, "name": "BaseGraphics" }, "body": { "type": "ClassBody", "start": 117, "end": 899, "loc": { "start": { "line": 4, "column": 49 }, "end": { "line": 21, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 123, "end": 184, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 7, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 123, "end": 134, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "RestElement", "start": 135, "end": 142, "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 23 } }, "argument": { "type": "Identifier", "start": 138, "end": 142, "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 23 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 144, "end": 184, "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 7, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 154, "end": 178, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 32 } }, "expression": { "type": "CallExpression", "start": 154, "end": 177, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 31 } }, "callee": { "type": "Super", "start": 154, "end": 159, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 13 } } }, "arguments": [ { "type": "SpreadElement", "start": 160, "end": 167, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 21 } }, "argument": { "type": "Identifier", "start": 163, "end": 167, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 21 }, "identifierName": "args" }, "name": "args" } }, { "type": "NumericLiteral", "start": 169, "end": 170, "loc": { "start": { "line": 6, "column": 23 }, "end": { "line": 6, "column": 24 } }, "extra": { "rawValue": 4, "raw": "4" }, "value": 4 }, { "type": "NumericLiteral", "start": 172, "end": 173, "loc": { "start": { "line": 6, "column": 26 }, "end": { "line": 6, "column": 27 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 175, "end": 176, "loc": { "start": { "line": 6, "column": 29 }, "end": { "line": 6, "column": 30 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 } ] } } ], "directives": [] } }, { "type": "ClassMethod", "start": 190, "end": 897, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 20, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 190, "end": 205, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 19 }, "identifierName": "updateFromState" }, "name": "updateFromState" }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 206, "end": 211, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 25 }, "identifierName": "state" }, "name": "state" }, { "type": "Identifier", "start": 213, "end": 217, "loc": { "start": { "line": 9, "column": 27 }, "end": { "line": 9, "column": 31 }, "identifierName": "tree" }, "name": "tree" } ], "body": { "type": "BlockStatement", "start": 219, "end": 897, "loc": { "start": { "line": 9, "column": 33 }, "end": { "line": 20, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 229, "end": 349, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 128 } }, "declarations": [ { "type": "VariableDeclarator", "start": 235, "end": 348, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 127 } }, "id": { "type": "ArrayPattern", "start": 235, "end": 252, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 31 } }, "elements": [ { "type": "Identifier", "start": 236, "end": 241, "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 10, "column": 20 }, "identifierName": "start" }, "name": "start" }, { "type": "Identifier", "start": 243, "end": 246, "loc": { "start": { "line": 10, "column": 22 }, "end": { "line": 10, "column": 25 }, "identifierName": "end" }, "name": "end" }, { "type": "Identifier", "start": 248, "end": 251, "loc": { "start": { "line": 10, "column": 27 }, "end": { "line": 10, "column": 30 }, "identifierName": "dim" }, "name": "dim" } ] }, "init": { "type": "CallExpression", "start": 255, "end": 348, "loc": { "start": { "line": 10, "column": 34 }, "end": { "line": 10, "column": 127 } }, "callee": { "type": "MemberExpression", "start": 255, "end": 288, "loc": { "start": { "line": 10, "column": 34 }, "end": { "line": 10, "column": 67 } }, "object": { "type": "ArrayExpression", "start": 255, "end": 284, "loc": { "start": { "line": 10, "column": 34 }, "end": { "line": 10, "column": 63 } }, "elements": [ { "type": "StringLiteral", "start": 256, "end": 265, "loc": { "start": { "line": 10, "column": 35 }, "end": { "line": 10, "column": 44 } }, "extra": { "rawValue": "startPt", "raw": "'startPt'" }, "value": "startPt" }, { "type": "StringLiteral", "start": 267, "end": 274, "loc": { "start": { "line": 10, "column": 46 }, "end": { "line": 10, "column": 53 } }, "extra": { "rawValue": "endPt", "raw": "'endPt'" }, "value": "endPt" }, { "type": "StringLiteral", "start": 276, "end": 283, "loc": { "start": { "line": 10, "column": 55 }, "end": { "line": 10, "column": 62 } }, "extra": { "rawValue": "dimPt", "raw": "'dimPt'" }, "value": "dimPt" } ] }, "property": { "type": "Identifier", "start": 285, "end": 288, "loc": { "start": { "line": 10, "column": 64 }, "end": { "line": 10, "column": 67 }, "identifierName": "map" }, "name": "map" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 289, "end": 347, "loc": { "start": { "line": 10, "column": 68 }, "end": { "line": 10, "column": 126 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 289, "end": 290, "loc": { "start": { "line": 10, "column": 68 }, "end": { "line": 10, "column": 69 }, "identifierName": "x" }, "name": "x" } ], "body": { "type": "CallExpression", "start": 294, "end": 347, "loc": { "start": { "line": 10, "column": 73 }, "end": { "line": 10, "column": 126 } }, "callee": { "type": "MemberExpression", "start": 294, "end": 323, "loc": { "start": { "line": 10, "column": 73 }, "end": { "line": 10, "column": 102 } }, "object": { "type": "NewExpression", "start": 294, "end": 313, "loc": { "start": { "line": 10, "column": 73 }, "end": { "line": 10, "column": 92 } }, "callee": { "type": "MemberExpression", "start": 298, "end": 311, "loc": { "start": { "line": 10, "column": 77 }, "end": { "line": 10, "column": 90 } }, "object": { "type": "Identifier", "start": 298, "end": 303, "loc": { "start": { "line": 10, "column": 77 }, "end": { "line": 10, "column": 82 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 304, "end": 311, "loc": { "start": { "line": 10, "column": 83 }, "end": { "line": 10, "column": 90 }, "identifierName": "Vector3" }, "name": "Vector3" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 314, "end": 323, "loc": { "start": { "line": 10, "column": 93 }, "end": { "line": 10, "column": 102 }, "identifierName": "fromArray" }, "name": "fromArray" }, "computed": false }, "arguments": [ { "type": "MemberExpression", "start": 324, "end": 346, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 125 } }, "object": { "type": "MemberExpression", "start": 324, "end": 340, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 119 } }, "object": { "type": "MemberExpression", "start": 324, "end": 337, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 116 } }, "object": { "type": "Identifier", "start": 324, "end": 329, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 108 }, "identifierName": "state" }, "name": "state" }, "property": { "type": "Identifier", "start": 330, "end": 337, "loc": { "start": { "line": 10, "column": 109 }, "end": { "line": 10, "column": 116 }, "identifierName": "members" }, "name": "members" }, "computed": false }, "property": { "type": "Identifier", "start": 338, "end": 339, "loc": { "start": { "line": 10, "column": 117 }, "end": { "line": 10, "column": 118 }, "identifierName": "x" }, "name": "x" }, "computed": true }, "property": { "type": "Identifier", "start": 341, "end": 346, "loc": { "start": { "line": 10, "column": 120 }, "end": { "line": 10, "column": 125 }, "identifierName": "value" }, "name": "value" }, "computed": false } ] } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 358, "end": 465, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 115 } }, "declarations": [ { "type": "VariableDeclarator", "start": 364, "end": 464, "loc": { "start": { "line": 11, "column": 14 }, "end": { "line": 11, "column": 114 } }, "id": { "type": "Identifier", "start": 364, "end": 367, "loc": { "start": { "line": 11, "column": 14 }, "end": { "line": 11, "column": 17 }, "identifierName": "dir" }, "name": "dir" }, "init": { "type": "NewExpression", "start": 370, "end": 464, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 114 } }, "callee": { "type": "MemberExpression", "start": 374, "end": 387, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 37 } }, "object": { "type": "Identifier", "start": 374, "end": 379, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 29 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 380, "end": 387, "loc": { "start": { "line": 11, "column": 30 }, "end": { "line": 11, "column": 37 }, "identifierName": "Vector3" }, "name": "Vector3" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 388, "end": 423, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 73 } }, "callee": { "type": "MemberExpression", "start": 388, "end": 396, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 46 } }, "object": { "type": "Identifier", "start": 388, "end": 392, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 42 }, "identifierName": "Math" }, "name": "Math" }, "property": { "type": "Identifier", "start": 393, "end": 396, "loc": { "start": { "line": 11, "column": 43 }, "end": { "line": 11, "column": 46 }, "identifierName": "cos" }, "name": "cos" }, "computed": false }, "arguments": [ { "type": "MemberExpression", "start": 397, "end": 422, "loc": { "start": { "line": 11, "column": 47 }, "end": { "line": 11, "column": 72 } }, "object": { "type": "MemberExpression", "start": 397, "end": 416, "loc": { "start": { "line": 11, "column": 47 }, "end": { "line": 11, "column": 66 } }, "object": { "type": "MemberExpression", "start": 397, "end": 410, "loc": { "start": { "line": 11, "column": 47 }, "end": { "line": 11, "column": 60 } }, "object": { "type": "Identifier", "start": 397, "end": 402, "loc": { "start": { "line": 11, "column": 47 },