bimdata / documentation Goto Github PK
View Code? Open in Web Editor NEWBIMData Documentation
Home Page: https://developers.bimdata.io
License: Other
BIMData Documentation
Home Page: https://developers.bimdata.io
License: Other
When looking for events, I go check on the Hub section first, but the event list is somewhere else.
A link could be useful
Add a section or a paragraph to show how to add a "Button Plugin" on the 3D Viewer window by mean of the addToWindows
option.
Example:
const viewer = makeBIMDataViewer({ /* viewer config */ });
viewer.registerPlugin({
name: 'buttonPlugin',
component: {
name: 'ButtonPluginComponent',
template: '<div>Hello World !</div>'
},
button: {
position: 'right',
content: 'simple',
},
addToWindows: [ '3d' ] // <-- Here is the trick :)
});
viewer.mount('#viewerId', '3d');
When we use Xeokit functions, often we need object IDs (like in https://xeokit.io/blog_explosions.html).
But in the viewer we need to use the UUIDs. The documentation do not make it very clear.
https://developers.bimdata.io/viewer/tutorials/state.html#resulting-viewer
Explain that it is important to call hub.off("sub ID")
method when a component is "destroyed".
Example:
const viewer = makeBIMDataViewer({ /* viewer config */ });
viewer.registerPlugin({
name: 'windowPlugin',
component: {
name: 'WindowPluginComponent',
template: `
<div style="
height: 100%;
display: flex;
justify-content:center;
align-items:center;
overflow-y: scroll;
">
<ul>
<li v-for="obj in objects" :key="obj.id">{{ obj.uuid }}</li>
</ul>
</div>`,
data() {
return {
objects: []
};
},
created() {
this.subSelect = this.$viewer.state.hub.on('objects-selected', () => {
this.objects = this.$viewer.state.selectedObjects;
});
this.subUnselect = this.$viewer.state.hub.on('objects-deselected', () => {
this.objects = this.$viewer.state.selectedObjects;
});
},
// THIS IS IMPORTANT
destroyed() {
this.$viewer.state.hub.off(this.subSelect);
this.$viewer.state.hub.off(this.subUnselect);
}
// ================
}
});
viewer.registerWindow({
name: 'my-window',
plugins: [
'windowPlugin',
],
});
viewer.mount('#viewerId', {
ratios: [ 50, 50 ],
children: [
'3d',
'my-window'
],
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.