Minor cleanup
This commit is contained in:
@@ -40,14 +40,14 @@ const { categorize, isolate, animate, resetFilters } = useViewer()
|
|||||||
const levels = ref()
|
const levels = ref()
|
||||||
|
|
||||||
// Get all the properties with the key 'properties.Instance Parameters.Constraints.Level.value'
|
// Get all the properties with the key 'properties.Instance Parameters.Constraints.Level.value'
|
||||||
const getLevels = async () => {
|
const getLevels = () => {
|
||||||
if (!properties) return
|
if (!properties) return
|
||||||
levels.value = properties.find((property: PropertyInfo) => property.key === 'properties.Instance Parameters.Constraints.Level.value')
|
levels.value = properties.find((property: PropertyInfo) => property.key === 'properties.Instance Parameters.Constraints.Level.value')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Categorize the levels and isolate the objects
|
// Categorize the levels and isolate the objects
|
||||||
const categorizeLevels = async () => {
|
const categorizeLevels = async () => {
|
||||||
await getLevels()
|
getLevels()
|
||||||
categorize(levels.value.valueGroups)
|
categorize(levels.value.valueGroups)
|
||||||
isolate(levels.value.valueGroups.flatMap((group: StringPropertyInfo['valueGroups']) => group.ids))
|
isolate(levels.value.valueGroups.flatMap((group: StringPropertyInfo['valueGroups']) => group.ids))
|
||||||
animate()
|
animate()
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default function useViewer() {
|
|||||||
* Initialize the viewer
|
* Initialize the viewer
|
||||||
* @param element - DOM element to initialize the viewer on
|
* @param element - DOM element to initialize the viewer on
|
||||||
*/
|
*/
|
||||||
async function init(element: HTMLDivElement) {
|
const init = async (element: HTMLDivElement) => {
|
||||||
const params = {
|
const params = {
|
||||||
...DefaultViewerParams,
|
...DefaultViewerParams,
|
||||||
showStats: false,
|
showStats: false,
|
||||||
@@ -57,7 +57,7 @@ export default function useViewer() {
|
|||||||
* The viewer can be extended with additional functionality by adding extensions
|
* The viewer can be extended with additional functionality by adding extensions
|
||||||
* You can use extensions provided by the viewer, or create your own
|
* You can use extensions provided by the viewer, or create your own
|
||||||
*/
|
*/
|
||||||
function addExtensions() {
|
const addExtensions = () => {
|
||||||
if (!viewer) return
|
if (!viewer) return
|
||||||
viewer.createExtension(CameraController)
|
viewer.createExtension(CameraController)
|
||||||
viewer.createExtension(SelectionExtension)
|
viewer.createExtension(SelectionExtension)
|
||||||
|
|||||||
Reference in New Issue
Block a user