{"_id":"@alphabetabc/threejs-app","_rev":"3-12a7a0a199f2cc7309df3b5d0208bb8d","name":"@alphabetabc/threejs-app","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@alphabetabc/threejs-app","version":"0.0.1","keywords":[],"author":"","license":"MIT","_id":"@alphabetabc/threejs-app@0.0.1","maintainers":[{"name":"alphabet_vis","email":"alphabetabctcba@163.com"}],"homepage":"https://github.com/alphabetabcZclub/alphabetabc.open.dev#readme","bugs":{"url":"https://github.com/alphabetabcZclub/alphabetabc.open.dev/issues"},"dist":{"shasum":"795e3293230d6b72fc388d5920ea119d8f595d9d","tarball":"https://registry.npmjs.org/@alphabetabc/threejs-app/-/threejs-app-0.0.1.tgz","fileCount":5,"integrity":"sha512-C+dPyhCcc5gx720GbDcJHvGV0Np+gyJvc/BVHUV4p+fXuDEEKbZSavhLVu0+VjUBqSiz7EyLdn20RYecoDNJ6Q==","signatures":[{"sig":"MEQCIBQ1pvkCSZ301vX5alJWGHCns3CLuHlHPpKX9drA1vddAiAuO+ZWDiBdg+C331Q743OihaEK9OurR+i/ImWDzpQcDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43435},"main":"dist/index.js","_from":"file:alphabetabc-threejs-app-0.0.1.tgz","types":"dist/index.d.ts","module":"dist/index.es.js","scripts":{"test":"node ./dist/index.js","build":"run-s clean build:package build:types -l","clean":"rimraf types dist","build:dts":"rollup -c ../../scripts/rollup.config.dts.mjs","prepublish":"pnpm build","build:types":"run-s build:types-temp build:dts clean:types-temp","build:package":"cross-env NODE_ENV=production rollup -c ../../scripts/rollup.config.mjs","build:types-temp":"tsc -p ./tsconfig.d.json","clean:types-temp":"rimraf types"},"_npmUser":{"name":"alphabet_vis","email":"alphabetabctcba@163.com"},"_resolved":"C:\\Users\\xiemi\\AppData\\Local\\Temp\\32b895e02a18397ef9068be596e0064b\\alphabetabc-threejs-app-0.0.1.tgz","_integrity":"sha512-C+dPyhCcc5gx720GbDcJHvGV0Np+gyJvc/BVHUV4p+fXuDEEKbZSavhLVu0+VjUBqSiz7EyLdn20RYecoDNJ6Q==","repository":{"url":"git+https://github.com/alphabetabcZclub/alphabetabc.open.dev.git"},"_npmVersion":"10.5.0","description":"```ts\r import * as THREE from 'three';\r import { ThreeApp, internalPlugin } from '@alphabetabc/threejs-app';","directories":{},"_nodeVersion":"20.12.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"three":"0.163.0","@types/three":"0.163.0","@alphabetabc/core2":"0.1.4","@alphabetabc/threejs-plugins":"0.0.6"},"peerDependencies":{"three":"*","@alphabetabc/threejs-plugins":"*"},"_npmOperationalInternal":{"tmp":"tmp/threejs-app_0.0.1_1712468887059_0.8572798471952285","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@alphabetabc/threejs-app","version":"0.0.2","keywords":[],"author":"","license":"MIT","_id":"@alphabetabc/threejs-app@0.0.2","maintainers":[{"name":"alphabet_vis","email":"alphabetabctcba@163.com"}],"homepage":"https://github.com/alphabetabcZclub/alphabetabc.open.dev#readme","bugs":{"url":"https://github.com/alphabetabcZclub/alphabetabc.open.dev/issues"},"dist":{"shasum":"0372711c52b1949c1144b80b234f1d803993ea57","tarball":"https://registry.npmjs.org/@alphabetabc/threejs-app/-/threejs-app-0.0.2.tgz","fileCount":6,"integrity":"sha512-bx0P9W6NWGIco9w9IICGbFhmOewqn6xMPJgUV8539s6eDLHslWSb6Cuv7nxjTzkShH01hQ05ybsXfqullVIyBQ==","signatures":[{"sig":"MEUCIQDXkIkGpcnJqWHfPRc/F8FvhCJ4tsMjEBMwbaYWzn27EAIgf8ph0MuUZzhXDWLVWMxH4WtcaDvBf4JkFMZZXOyJlhs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":410520},"main":"dist/index.js","_from":"file:alphabetabc-threejs-app-0.0.2.tgz","types":"dist/index.d.ts","unpkg":"dist/index.umd.js","module":"dist/index.es.js","scripts":{"test":"node ./dist/index.js","build":"run-s clean build:package build:types -l","clean":"rimraf types dist","prepublish":"pnpm build","build:types":"node ../../scripts/rollup.build.dts.mjs","build:package":"cross-env NODE_ENV=production rollup -c ../../scripts/rollup.config.mjs"},"_npmUser":{"name":"alphabet_vis","email":"alphabetabctcba@163.com"},"_resolved":"C:\\Users\\xiemi\\AppData\\Local\\Temp\\ee734b297ae1d51231632478b566890e\\alphabetabc-threejs-app-0.0.2.tgz","_integrity":"sha512-bx0P9W6NWGIco9w9IICGbFhmOewqn6xMPJgUV8539s6eDLHslWSb6Cuv7nxjTzkShH01hQ05ybsXfqullVIyBQ==","repository":{"url":"git+https://github.com/alphabetabcZclub/alphabetabc.open.dev.git"},"_npmVersion":"10.5.0","description":"```ts\r import * as THREE from 'three';\r import { ThreeApp, ThreeAppExtended, usePlugin } from '@alphabetabc/threejs-app';","directories":{},"_nodeVersion":"20.12.1","dependencies":{"@alphabetabc/threejs-plugins":"0.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"three":"0.163.0","@types/three":"0.163.0","@alphabetabc/core2":"0.1.5"},"peerDependencies":{"three":"*","@alphabetabc/threejs-plugins":"*"},"_npmOperationalInternal":{"tmp":"tmp/threejs-app_0.0.2_1712883950626_0.32541439446938614","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@alphabetabc/threejs-app","version":"0.0.3","keywords":[],"author":"","license":"MIT","_id":"@alphabetabc/threejs-app@0.0.3","maintainers":[{"name":"alphabet_vis","email":"alphabetabctcba@163.com"}],"homepage":"https://github.com/alphabetabcZclub/alphabetabc.open.dev#readme","bugs":{"url":"https://github.com/alphabetabcZclub/alphabetabc.open.dev/issues"},"dist":{"shasum":"b6e7c6ea04cbd9d256b4e674cd1286c4fe2fde79","tarball":"https://registry.npmjs.org/@alphabetabc/threejs-app/-/threejs-app-0.0.3.tgz","fileCount":6,"integrity":"sha512-wWHmcD5GhSubRdHQrdNV5eiuOTss1VIqet6c8Jd0Ra45EvBq3cpdIsDEEE376Zl3YbEhEZJGYDCwizMsjcxvLA==","signatures":[{"sig":"MEQCIDJHORT9cCAq7AaeeBcFqLgWAfvSwAGHGzzEN0SFsnPEAiBMPQtlv/a9Jx6ZUxBjPHoZxZcsPVCKqB3RiRIWTbmkmg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":411467},"main":"dist/index.js","_from":"file:alphabetabc-threejs-app-0.0.3.tgz","types":"dist/index.d.ts","unpkg":"dist/index.umd.js","module":"dist/index.es.js","scripts":{"test":"node ./dist/index.js","build":"run-s clean build:package build:types -l","clean":"rimraf types dist","prepublish":"pnpm build","build:types":"node ../../scripts/rollup.build.dts.mjs","build:package":"cross-env NODE_ENV=production rollup -c ../../scripts/rollup.config.mjs"},"_npmUser":{"name":"alphabet_vis","email":"alphabetabctcba@163.com"},"_resolved":"C:\\Users\\xiemi\\AppData\\Local\\Temp\\a4cebcd337974fb63dc8c9376d1c32ad\\alphabetabc-threejs-app-0.0.3.tgz","_integrity":"sha512-wWHmcD5GhSubRdHQrdNV5eiuOTss1VIqet6c8Jd0Ra45EvBq3cpdIsDEEE376Zl3YbEhEZJGYDCwizMsjcxvLA==","repository":{"url":"git+https://github.com/alphabetabcZclub/alphabetabc.open.dev.git"},"_npmVersion":"10.5.2","description":"```ts\r import {\r     ThreeApp,\r     ThreeAppLifecycleEvent,\r     ThreeAppExtended,\r     context,\r     usePlugin,\r     defineThreeAppPlugin,\r     type ThreeAppType,\r     type ThreeAppInstance,\r } from '@alphabetabc/threejs-app';\r ```","directories":{},"_nodeVersion":"20.13.1","dependencies":{"@alphabetabc/threejs-plugins":"0.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"three":"0.163.0","@types/three":"0.163.0","@alphabetabc/core2":"0.1.5"},"peerDependencies":{"three":"*","@alphabetabc/threejs-plugins":"*"},"_npmOperationalInternal":{"tmp":"tmp/threejs-app_0.0.3_1715388385589_0.9445126416850844","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@alphabetabc/threejs-app","version":"0.0.4","description":"```ts\r import {\r     ThreeApp,\r     ThreeAppLifecycleEvent,\r     ThreeAppExtended,\r     context,\r     usePlugin,\r     defineThreeAppPlugin,\r     type ThreeAppType,\r     type ThreeAppInstance,\r } from '@alphabetabc/threejs-app';\r ```","main":"dist/index.js","module":"dist/index.es.js","types":"dist/index.d.ts","unpkg":"dist/index.umd.js","keywords":[],"author":"","license":"MIT","publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/alphabetabcZclub/alphabetabc.open.dev.git"},"dependencies":{"@alphabetabc/threejs-plugins":"0.0.6"},"devDependencies":{"three":"0.164.1","@types/three":"0.164.0","@alphabetabc/core2":"0.1.6"},"peerDependencies":{"three":"*","@alphabetabc/threejs-plugins":"*"},"scripts":{"clean":"rimraf types dist","build:package":"cross-env NODE_ENV=production rollup -c ../../scripts/rollup.config.mjs","build:types":"node ../../scripts/rollup.build.dts.mjs","build":"run-s clean build:package build:types -l","build:dev":"cross-env BUILD_ENV=development pnpm build","prepublish":"pnpm build","test":"node ./dist/index.js"},"_id":"@alphabetabc/threejs-app@0.0.4","bugs":{"url":"https://github.com/alphabetabcZclub/alphabetabc.open.dev/issues"},"homepage":"https://github.com/alphabetabcZclub/alphabetabc.open.dev#readme","_integrity":"sha512-i1QJX86DilQS5xD57UprmCCMFyXyYV028LqyJ6yd6n1NObAOa3LK3rhEjgh2f1B46HaJWRHFzOu8I5FLg+g4dg==","_resolved":"C:\\Users\\xiemi\\AppData\\Local\\Temp\\a223165959cfbb2f8a3c144894042156\\alphabetabc-threejs-app-0.0.4.tgz","_from":"file:alphabetabc-threejs-app-0.0.4.tgz","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-i1QJX86DilQS5xD57UprmCCMFyXyYV028LqyJ6yd6n1NObAOa3LK3rhEjgh2f1B46HaJWRHFzOu8I5FLg+g4dg==","shasum":"8a644f0ccc219f021b69db58fb70e6cecae76f0c","tarball":"https://registry.npmjs.org/@alphabetabc/threejs-app/-/threejs-app-0.0.4.tgz","fileCount":6,"unpackedSize":442201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEsz9CnHV8g4Vhfalx58+8GieiP2esUJFznFPnNTlGcdAiEA3AzI6MBW/cLMcufkxX2iW63rHOqcBzkizspk90pmzGE="}]},"_npmUser":{"name":"alphabet_vis","email":"alphabetabctcba@163.com"},"directories":{},"maintainers":[{"name":"alphabet_vis","email":"alphabetabctcba@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/threejs-app_0.0.4_1725347672881_0.1880186853348349"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-07T05:48:06.972Z","modified":"2024-09-03T07:14:33.435Z","0.0.1":"2024-04-07T05:48:07.245Z","0.0.2":"2024-04-12T01:05:50.840Z","0.0.3":"2024-05-11T00:46:25.758Z","0.0.4":"2024-09-03T07:14:33.134Z"},"bugs":{"url":"https://github.com/alphabetabcZclub/alphabetabc.open.dev/issues"},"license":"MIT","homepage":"https://github.com/alphabetabcZclub/alphabetabc.open.dev#readme","keywords":[],"repository":{"url":"git+https://github.com/alphabetabcZclub/alphabetabc.open.dev.git"},"description":"```ts\r import {\r     ThreeApp,\r     ThreeAppLifecycleEvent,\r     ThreeAppExtended,\r     context,\r     usePlugin,\r     defineThreeAppPlugin,\r     type ThreeAppType,\r     type ThreeAppInstance,\r } from '@alphabetabc/threejs-app';\r ```","maintainers":[{"name":"alphabet_vis","email":"alphabetabctcba@163.com"}],"readme":"# `@alphabetabc/threejs-app`\r\n\r\n## exports\r\n\r\n```ts\r\nimport {\r\n    ThreeApp,\r\n    ThreeAppLifecycleEvent,\r\n    ThreeAppExtended,\r\n    context,\r\n    usePlugin,\r\n    defineThreeAppPlugin,\r\n    type ThreeAppType,\r\n    type ThreeAppInstance,\r\n} from '@alphabetabc/threejs-app';\r\n```\r\n\r\n## Usage\r\n\r\n```ts\r\nimport * as THREE from 'three';\r\nimport { ThreeApp, ThreeAppExtended, usePlugin } from '@alphabetabc/threejs-app';\r\n\r\nconst box = (position = [0, 0, 0], name = 'box', color = 0xff0000) => {\r\n    const box = new THREE.BoxGeometry(10, 10, 10);\r\n    const material = new THREE.MeshBasicMaterial({ color });\r\n    const mesh = new THREE.Mesh(box, material);\r\n    // @ts-ignore\r\n    mesh.position.set(...position);\r\n    mesh.userData['name'] = name;\r\n    return mesh;\r\n};\r\n\r\nconst app = new ThreeApp({\r\n    cameraPosition: [-26.393285211449594, 44.52250436214678, 66.03408987185966],\r\n    plugins: [],\r\n});\r\n\r\napp.context.object3d.scene.background = new THREE.Color(0x000000);\r\n\r\nconst box1 = box(undefined, undefined, 0x0000ff);\r\nconst box2 = box([-20, 0, 0], 'box2', 0x00ff00);\r\nconst box3 = box([20, 0, 0], 'box3');\r\nconst box4 = box([20, 20, 0], 'box4', 0xff00ff);\r\n\r\nconst groupBox_1_2 = new THREE.Group();\r\n\r\ngroupBox_1_2.add(box1, box2);\r\n\r\nconst group = new THREE.Group();\r\ngroup.add(groupBox_1_2, box3, box4);\r\n\r\napp.addObject(group);\r\napp.renderTo(document.querySelector('#container'));\r\napp.startRender();\r\n\r\napp.addInteraction(box1, 'click', (info) => {\r\n    console.log('log---------------box1-------click', info);\r\n});\r\n\r\napp.addInteraction(box1, 'click', (info) => {\r\n    console.log('log---------------box1-------click-2', info);\r\n});\r\n\r\napp.addInteraction(box3, 'dblclick', (info) => {\r\n    console.log('log---------------box3-------dblclick', info.target);\r\n});\r\n\r\nlet beforeColor = null;\r\n\r\napp.addInteraction(box1, 'mouseover', (info) => {\r\n    beforeColor = box1.material.color;\r\n    box1.material.color = new THREE.Color(0xff0000);\r\n});\r\n\r\n// 获取执行的插件实例\r\nThreeAppExtended.Plugin.Interaction.getPluginInstance(app).addInteraction(box1, 'mouseout', (info) => {\r\n    box1.material.color = beforeColor;\r\n    console.log('log---------------interaction-------mouseover', info.nativeEvent);\r\n});\r\n\r\n// 调用插件实现的方法\r\napp.call(ThreeAppExtended.ExtendMethod.FitToViewport, box3);\r\n```\r\n\r\n# plugin development\r\n\r\n```ts\r\nimport { defineThreeAppPlugin } from '@alphabetabc/threejs-app';\r\n\r\nexport const PluginHelperLight = defineThreeAppPlugin({\r\n    getPluginName() {\r\n        return 'PluginHelperLight';\r\n    },\r\n    creator(...args) {\r\n        return {\r\n            init(app) {},\r\n            destroy(_app) {},\r\n        };\r\n    },\r\n});\r\n\r\nexport { PluginHelperLight };\r\n```\r\n","readmeFilename":"README.md"}