UNPKG

awv3

Version:
1,689 lines (1,688 loc) 1.68 MB
{ "type": "Program", "start": 0, "end": 15482, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 391, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 26, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "local": { "type": "Identifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 18, "end": 25, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ImportDeclaration", "start": 27, "end": 66, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 39 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 34, "end": 44, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 17 } }, "local": { "type": "Identifier", "start": 39, "end": 44, "loc": { "start": { "line": 2, "column": 12 }, "end": { "line": 2, "column": 17 } }, "name": "Error" } } ], "importKind": "value", "source": { "type": "Literal", "start": 50, "end": 65, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 38 } }, "value": "../core/error", "rawValue": "../core/error", "raw": "'../core/error'" } }, { "type": "ImportDeclaration", "start": 67, "end": 134, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 67 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 76, "end": 80, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 13 } }, "imported": { "type": "Identifier", "start": 76, "end": 80, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 13 } }, "name": "guid" }, "local": { "type": "Identifier", "start": 76, "end": 80, "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 13 } }, "name": "guid" } }, { "type": "ImportSpecifier", "start": 82, "end": 90, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 23 } }, "imported": { "type": "Identifier", "start": 82, "end": 90, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 23 } }, "name": "queryDom" }, "local": { "type": "Identifier", "start": 82, "end": 90, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 23 } }, "name": "queryDom" } }, { "type": "ImportSpecifier", "start": 92, "end": 108, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 41 } }, "imported": { "type": "Identifier", "start": 92, "end": 108, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 41 } }, "name": "setPrefixedValue" }, "local": { "type": "Identifier", "start": 92, "end": 108, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 41 } }, "name": "setPrefixedValue" } } ], "importKind": "value", "source": { "type": "Literal", "start": 116, "end": 133, "loc": { "start": { "line": 3, "column": 49 }, "end": { "line": 3, "column": 66 } }, "value": "../core/helpers", "rawValue": "../core/helpers", "raw": "'../core/helpers'" } }, { "type": "ImportDeclaration", "start": 135, "end": 180, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 45 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 144, "end": 155, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } }, "imported": { "type": "Identifier", "start": 144, "end": 155, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } }, "name": "lastCreated" }, "local": { "type": "Identifier", "start": 144, "end": 155, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } }, "name": "lastCreated" } } ], "importKind": "value", "source": { "type": "Literal", "start": 163, "end": 179, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 44 } }, "value": "../core/canvas", "rawValue": "../core/canvas", "raw": "'../core/canvas'" } }, { "type": "ImportDeclaration", "start": 181, "end": 217, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 188, "end": 197, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 16 } }, "local": { "type": "Identifier", "start": 188, "end": 197, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 16 } }, "name": "DomEvents" } } ], "importKind": "value", "source": { "type": "Literal", "start": 203, "end": 216, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 35 } }, "value": "../core/dom", "rawValue": "../core/dom", "raw": "'../core/dom'" } }, { "type": "ImportDeclaration", "start": 218, "end": 264, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 46 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 225, "end": 236, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 18 } }, "local": { "type": "Identifier", "start": 225, "end": 236, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 18 } }, "name": "Interaction" } } ], "importKind": "value", "source": { "type": "Literal", "start": 242, "end": 263, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 45 } }, "value": "../core/interaction", "rawValue": "../core/interaction", "raw": "'../core/interaction'" } }, { "type": "ImportDeclaration", "start": 265, "end": 299, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 272, "end": 277, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 12 } }, "local": { "type": "Identifier", "start": 272, "end": 277, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 12 } }, "name": "Stats" } } ], "importKind": "value", "source": { "type": "Literal", "start": 283, "end": 298, "loc": { "start": { "line": 7, "column": 18 }, "end": { "line": 7, "column": 33 } }, "value": "../core/stats", "rawValue": "../core/stats", "raw": "'../core/stats'" } }, { "type": "ImportDeclaration", "start": 300, "end": 338, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 38 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 307, "end": 312, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 12 } }, "local": { "type": "Identifier", "start": 307, "end": 312, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 12 } }, "name": "Orbit" } } ], "importKind": "value", "source": { "type": "Literal", "start": 318, "end": 337, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 8, "column": 37 } }, "value": "../controls/orbit", "rawValue": "../controls/orbit", "raw": "'../controls/orbit'" } }, { "type": "ImportDeclaration", "start": 339, "end": 386, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 47 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 346, "end": 357, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 18 } }, "local": { "type": "Identifier", "start": 346, "end": 357, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 18 } }, "name": "Perspective" } } ], "importKind": "value", "source": { "type": "Literal", "start": 363, "end": 385, "loc": { "start": { "line": 9, "column": 24 }, "end": { "line": 9, "column": 46 } }, "value": "../three/perspective", "rawValue": "../three/perspective", "raw": "'../three/perspective'" }, "trailingComments": [ { "type": "Block", "value": "* A view represents a portion of canvas on which webGL can draw.\n The view is defined and tracked by a dom node on which the drawing take place. ", "start": 388, "end": 540, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 12, "column": 85 } }, "range": [ 388, 540 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 541, "end": 15481, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 390, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 556, "end": 15481, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 390, "column": 1 } }, "id": { "type": "Identifier", "start": 562, "end": 566, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 25 } }, "name": "View", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 567, "end": 15481, "loc": { "start": { "line": 13, "column": 26 }, "end": { "line": 390, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 2046, "end": 6801, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 145, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 2046, "end": 2057, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 15 } }, "name": "constructor", "leadingComments": null }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 2057, "end": 6801, "loc": { "start": { "line": 36, "column": 15 }, "end": { "line": 145, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 2058, "end": 2078, "loc": { "start": { "line": 36, "column": 16 }, "end": { "line": 36, "column": 36 } }, "operator": "=", "left": { "type": "Identifier", "start": 2058, "end": 2064, "loc": { "start": { "line": 36, "column": 16 }, "end": { "line": 36, "column": 22 } }, "name": "canvas" }, "right": { "type": "Identifier", "start": 2067, "end": 2078, "loc": { "start": { "line": 36, "column": 25 }, "end": { "line": 36, "column": 36 } }, "name": "lastCreated" } }, { "type": "AssignmentPattern", "start": 2080, "end": 2099, "loc": { "start": { "line": 36, "column": 38 }, "end": { "line": 36, "column": 57 } }, "operator": "=", "left": { "type": "Identifier", "start": 2080, "end": 2087, "loc": { "start": { "line": 36, "column": 38 }, "end": { "line": 36, "column": 45 } }, "name": "options" }, "right": { "type": "Identifier", "start": 2090, "end": 2099, "loc": { "start": { "line": 36, "column": 48 }, "end": { "line": 36, "column": 57 } }, "name": "undefined" } } ], "body": { "type": "BlockStatement", "start": 2101, "end": 6801, "loc": { "start": { "line": 36, "column": 59 }, "end": { "line": 145, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 2151, "end": 2212, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 41, "column": 10 } }, "expression": { "type": "AssignmentExpression", "start": 2151, "end": 2211, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 41, "column": 9 } }, "operator": "=", "left": { "type": "Identifier", "start": 2151, "end": 2158, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 39, "column": 15 } }, "name": "options", "leadingComments": null }, "right": { "type": "LogicalExpression", "start": 2161, "end": 2211, "loc": { "start": { "line": 39, "column": 18 }, "end": { "line": 41, "column": 9 } }, "left": { "type": "Identifier", "start": 2161, "end": 2168, "loc": { "start": { "line": 39, "column": 18 }, "end": { "line": 39, "column": 25 } }, "name": "options" }, "operator": "||", "right": { "type": "ObjectExpression", "start": 2172, "end": 2211, "loc": { "start": { "line": 39, "column": 29 }, "end": { "line": 41, "column": 9 } }, "properties": [ { "type": "Property", "start": 2186, "end": 2201, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 27 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 2186, "end": 2189, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 15 } }, "name": "dom" }, "value": { "type": "MemberExpression", "start": 2191, "end": 2201, "loc": { "start": { "line": 40, "column": 17 }, "end": { "line": 40, "column": 27 } }, "object": { "type": "Identifier", "start": 2191, "end": 2197, "loc": { "start": { "line": 40, "column": 17 }, "end": { "line": 40, "column": 23 } }, "name": "canvas" }, "property": { "type": "Identifier", "start": 2198, "end": 2201, "loc": { "start": { "line": 40, "column": 24 }, "end": { "line": 40, "column": 27 } }, "name": "dom" }, "computed": false }, "kind": "init" } ] } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": " Default to the canvases dom", "start": 2112, "end": 2142, "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 38 } }, "range": [ 2112, 2142 ] } ] }, { "type": "ExpressionStatement", "start": 2222, "end": 2239, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 2222, "end": 2238, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2222, "end": 2229, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 15 } }, "object": { "type": "ThisExpression", "start": 2222, "end": 2226, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 12 } } }, "property": { "type": "Identifier", "start": 2227, "end": 2229, "loc": { "start": { "line": 43, "column": 13 }, "end": { "line": 43, "column": 15 } }, "name": "id" }, "computed": false }, "right": { "type": "CallExpression", "start": 2232, "end": 2238, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 24 } }, "callee": { "type": "Identifier", "start": 2232, "end": 2236, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 22 } }, "name": "guid" }, "arguments": [] } } }, { "type": "ExpressionStatement", "start": 2248, "end": 2269, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 2248, "end": 2268, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2248, "end": 2259, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 19 } }, "object": { "type": "ThisExpression", "start": 2248, "end": 2252, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 12 } } }, "property": { "type": "Identifier", "start": 2253, "end": 2259, "loc": { "start": { "line": 44, "column": 13 }, "end": { "line": 44, "column": 19 } }, "name": "canvas" }, "computed": false }, "right": { "type": "Identifier", "start": 2262, "end": 2268, "loc": { "start": { "line": 44, "column": 22 }, "end": { "line": 44, "column": 28 } }, "name": "canvas" } } }, { "type": "ExpressionStatement", "start": 2278, "end": 2310, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 40 } }, "expression": { "type": "AssignmentExpression", "start": 2278, "end": 2309, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 39 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2278, "end": 2291, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 21 } }, "object": { "type": "ThisExpression", "start": 2278, "end": 2282, "loc": { "start": { "line": 45, "column": 8 }, "end": { "line": 45, "column": 12 } } }, "property": { "type": "Identifier", "start": 2283, "end": 2291, "loc": { "start": { "line": 45, "column": 13 }, "end": { "line": 45, "column": 21 } }, "name": "renderer" }, "computed": false }, "right": { "type": "MemberExpression", "start": 2294, "end": 2309, "loc": { "start": { "line": 45, "column": 24 }, "end": { "line": 45, "column": 39 } }, "object": { "type": "Identifier", "start": 2294, "end": 2300, "loc": { "start": { "line": 45, "column": 24 }, "end": { "line": 45, "column": 30 } }, "name": "canvas" }, "property": { "type": "Identifier", "start": 2301, "end": 2309, "loc": { "start": { "line": 45, "column": 31 }, "end": { "line": 45, "column": 39 } }, "name": "renderer" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 2319, "end": 2379, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 68 } }, "expression": { "type": "AssignmentExpression", "start": 2319, "end": 2378, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 67 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 2319, "end": 2327, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 16 } }, "object": { "type": "ThisExpression", "start": 2319, "end": 2323, "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 12 } } }, "property": { "type": "Identifier", "start": 2324, "end": 2327, "loc": { "start": { "line": 46, "column": 13 }, "end": { "line": 46, "column": 16 } }, "name": "dom" }, "computed": false }, "right": { "type": "ConditionalExpression", "start": 2330, "end": 2378, "loc": { "start": { "line": 46, "column": 19 }, "end": { "line": 46, "column": 67 } }, "test": { "type": "MemberExpression", "start": 2330, "end": 2341, "loc": { "start": { "line": 46, "column": 19 }, "end": { "line": 46, "column": 30 } }, "object": { "type": "Identifier", "start": 2330, "end": 2337, "loc": { "start": { "line": 46, "column": 19 }, "end": { "line": 46, "column": 26 } }, "name": "options" }, "property": { "type": "Identifier", "start": 2338, "end": 2341, "loc": { "start": { "line": 46, "column": 27 }, "end": { "line": 46, "column": 30 } }, "name": "dom" }, "computed": false }, "consequent": { "type": "CallExpression", "start": 2344, "end": 2365, "loc": { "start": { "line": 46, "column": 33 }, "end": { "line": 46, "column": 54 } }, "callee": { "type": "Identifier", "start": 2344, "end": 2352, "loc": { "start": { "line": 46, "column": 33 }, "end": {