2.12.8 • Published 1 month ago

@shapediver/viewer.features.attribute-visualization v2.12.8

Weekly downloads
-
License
polyform-noncomme...
Repository
github
Last release
1 month ago

@shapediver/viewer.features.attribute-visualization

This is the npm package for the ShapeDiver Viewer attribute visualization features. Please have a look at our help desk section for this feature.

For more information on ShapeDiver, please visit our homepage. If you need help, have a look at our help desk.

This feature is already implemented on our Platform. Just go to any model with attribute and click on the attributes tab.

Installation

npm install --save @shapediver/viewer.features.attribute-visualization

Usage

As this is an additional package to the @shapediver/viewer package, we omit the initial setup. Please have a look here.

AttributeVisualizationEngine

After creating a Viewport and a Session, you can create an AttributeVisualizationEngine, which is the central hub for all attribute visualization related behavior. Additionally, you have to switch the viewport mode to visualize the attributes. You can switch forth and back to see the normal rendering again. This can easily done with the code below.

import { RENDERER_TYPE } from "@shapediver/viewer";
import { AttributeVisualizationEngine } from "@shapediver/viewer.features.attribute-visualization";

// switch the viewport rendering typoe
viewport.type = RENDERER_TYPE.ATTRIBUTES;

// create the AttributeVisualizationEngine
const attributeVisualizationEngine = new AttributeVisualizationEngine(viewport);

Once an AttributeVisualizationEngine has been created, Layers and Attributes can be visualized. Please see the following sections for the description of these features.

Layers

Layers are a special kind of attributes. They are internally stored exactly the same as all other attributes, but get a special treatment for visualization purposes. In the example below you can see how the opacity and color of layers are change via their name.

// change the opacity
attributeVisualizationEngine.layers["pinky"].opacity = 0.5;

// change the color
attributeVisualizationEngine.layers["brain"].color = "#ff0000";

// apply the changes
attributeVisualizationEngine.updateLayers(attributeVisualizationEngine.layers);

Attributes

Attributes can have different types, therefore the visualization is not always the same. In the code example below we show the code for visualizing a string attribute. You can also visualize multiple attributes at the same time by adding them to the array. If however an object contains multiple attributes that should be visualized, only the first one will be.

import { SDTF_TYPEHINT } from "@shapediver/viewer";
import { IStringAttribute, ATTRIBUTE_VISUALIZATION } from "@shapediver/viewer.features.attribute-visualization";


attributeVisualizationEngine.updateAttributes([
    <IStringAttribute>{
        key: "x+y, string",
        type: SDTF_TYPEHINT.STRING,
        visualization: ATTRIBUTE_VISUALIZATION.GREEN_WHITE_RED
    }
]);

Please make sure to visit our help desk where there are many more examples linked.

2.12.8

1 month ago

2.12.7

2 months ago

2.12.6

2 months ago

2.12.5

3 months ago

2.12.4

3 months ago

2.12.3

3 months ago

2.12.2

3 months ago

2.11.0

7 months ago

2.9.9

8 months ago

2.9.5

10 months ago

2.9.12

5 months ago

2.9.13

5 months ago

2.9.10

8 months ago

2.9.11

8 months ago

2.10.0

8 months ago

2.12.0

5 months ago

2.10.1-rc.0

7 months ago

2.12.1

5 months ago

2.9.2

11 months ago

2.9.1

11 months ago

2.9.4

10 months ago

2.9.3

11 months ago

2.8.5

12 months ago

2.9.0

11 months ago

2.8.1

1 year ago

2.8.0

1 year ago

2.8.3

1 year ago

2.8.2

1 year ago

2.8.4

1 year ago

2.7.10

1 year ago

2.7.4

1 year ago

2.7.6

1 year ago

2.7.5

1 year ago

2.7.8

1 year ago

2.7.7

1 year ago

2.7.9

1 year ago

2.7.0

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

2.6.1

1 year ago

2.6.3

1 year ago

2.6.2

1 year ago

2.7.3

1 year ago

2.6.5

1 year ago

2.6.4

1 year ago

2.4.1

1 year ago

2.4.0

2 years ago

2.4.2

1 year ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.5

2 years ago

2.6.0

1 year ago

2.5.0

1 year ago

2.5.1

1 year ago

2.3.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.1

2 years ago

2.0.3

2 years ago

2.2.0

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.2.2

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.15.7

2 years ago

1.15.6

2 years ago

1.15.5

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.6

2 years ago

2.0.11

2 years ago

2.1.5

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.1.0

2 years ago

1.15.0

2 years ago

1.15.4

2 years ago

1.15.3

2 years ago

1.15.2

2 years ago

1.15.1

2 years ago

1.14.10

2 years ago

1.14.11

2 years ago

1.14.12

2 years ago

1.14.13

2 years ago

1.14.14

2 years ago

1.14.15

2 years ago

1.14.16

2 years ago

1.14.1

2 years ago

1.14.0

2 years ago

1.14.5

2 years ago

1.14.4

2 years ago

1.14.3

2 years ago

1.14.2

2 years ago

1.14.9

2 years ago

1.14.8

2 years ago

1.14.7

2 years ago

1.14.6

2 years ago

1.13.10

2 years ago

1.13.9

2 years ago

1.13.8

2 years ago

1.13.7

2 years ago

1.13.2

2 years ago

1.13.1

2 years ago

1.13.6

2 years ago

1.13.5

2 years ago

1.13.4

2 years ago

1.13.3

2 years ago

1.13.0

2 years ago

1.12.6

2 years ago

1.12.5

2 years ago

1.12.3

2 years ago

1.11.4

2 years ago

1.12.2

2 years ago

1.11.3

2 years ago

1.12.1

2 years ago

1.11.2

2 years ago

1.12.0

2 years ago

1.11.8

2 years ago

1.10.9

2 years ago

1.11.7

2 years ago

1.10.8

2 years ago

1.11.6

2 years ago

1.12.4

2 years ago

1.11.5

2 years ago

1.11.9

2 years ago

1.11.12

2 years ago

1.11.10

2 years ago

1.11.11

2 years ago

1.11.0-alpha.0

2 years ago

1.10.15

2 years ago

1.10.13

2 years ago

1.10.14

2 years ago

1.10.11

2 years ago

1.10.12

2 years ago

1.10.10

2 years ago

1.10.7

2 years ago

1.10.6

2 years ago

1.10.5

2 years ago

1.10.4

2 years ago

1.10.1

2 years ago

1.9.0

2 years ago