Socket
Socket
Sign inDemoInstall

@shapediver/viewer.shared.types

Package Overview
Dependencies
Maintainers
5
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shapediver/viewer.shared.types - npm Package Compare versions

Comparing version 1.8.14 to 1.9.0

7

dist/data/sdtf/SDTFAttributeVisualization.d.ts

@@ -19,8 +19,5 @@ import { mat4 } from "gl-matrix";

export declare const SDTFAttributeVisualization: {
numberVisualization: (value: number, min: number, max: number, type: ATTRIBUTEVISUALIZATION) => SDTFAttributeVisualizationData;
stringVisualization: (value: string, values: string[], type: ATTRIBUTEVISUALIZATION) => SDTFAttributeVisualizationData;
stringOpacityVisualization: (value: string, opacities: {
[key: string]: number;
}) => SDTFAttributeVisualizationData;
numberVisualization: (value: number, min: number, max: number, type: ATTRIBUTEVISUALIZATION, defaultMaterial?: MaterialData | undefined) => SDTFAttributeVisualizationData;
stringVisualization: (value: string, values: string[], type: ATTRIBUTEVISUALIZATION, defaultMaterial?: MaterialData | undefined) => SDTFAttributeVisualizationData;
};
//# sourceMappingURL=SDTFAttributeVisualization.d.ts.map

@@ -21,9 +21,9 @@ "use strict";

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + color + ', ' + color + ', ' + color + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + color + ', ' + color + ', ' + color + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()
};
};
const opacityVisualization = (factor) => {
const opacityVisualization = (factor, defaultMaterial) => {
return {
material: new MaterialData_1.MaterialData({ color: '#00fff7', opacity: factor }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: (defaultMaterial === null || defaultMaterial === void 0 ? void 0 : defaultMaterial.color) || '#00fff7', opacity: factor }),
matrix: gl_matrix_1.mat4.create()

@@ -36,3 +36,3 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(0) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(0) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()

@@ -56,3 +56,3 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()

@@ -65,3 +65,3 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(0) + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(0) + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()

@@ -85,3 +85,3 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()

@@ -105,3 +105,3 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()

@@ -143,3 +143,3 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()

@@ -151,8 +151,9 @@ };

return {
material: new MaterialData_1.MaterialData({ color: 'hsl(' + Math.floor(hue) + ', 100%, 50%)', opacity: 1 }),
material: new MaterialData_1.MaterialData({ KHR_materials_unlit: true, color: 'hsl(' + Math.floor(hue) + ', 100%, 50%)', opacity: 1 }),
matrix: gl_matrix_1.mat4.create()
};
};
const numberVisualization = (value, min, max, type) => {
const factor = (value - min) / (max - min);
const numberVisualization = (value, min, max, type, defaultMaterial) => {
let factor = (value - min) / (max - min);
factor = Math.min(1, Math.max(0, factor));
switch (type) {

@@ -162,3 +163,3 @@ case ATTRIBUTEVISUALIZATION.GRAYSCALE:

case ATTRIBUTEVISUALIZATION.OPACITY:
return opacityVisualization(factor);
return opacityVisualization(factor, defaultMaterial);
case ATTRIBUTEVISUALIZATION.BLUE_RED:

@@ -180,15 +181,5 @@ return blueRedVisualization(factor);

};
const stringOpacityVisualization = (value, opacities) => {
if (!opacities[value])
return {
material: new MaterialData_1.MaterialData({ color: '#00fff7', opacity: 0 }),
matrix: gl_matrix_1.mat4.create()
};
return {
material: new MaterialData_1.MaterialData({ color: '#00fff7', opacity: opacities[value] }),
matrix: gl_matrix_1.mat4.create()
};
};
const stringVisualization = (value, values, type) => {
const factor = values.indexOf(value) / (values.length - 1);
const stringVisualization = (value, values, type, defaultMaterial) => {
let factor = values.indexOf(value) / (values.length - 1);
factor = Math.min(1, Math.max(0, factor));
switch (type) {

@@ -198,3 +189,3 @@ case ATTRIBUTEVISUALIZATION.GRAYSCALE:

case ATTRIBUTEVISUALIZATION.OPACITY:
return opacityVisualization(factor);
return opacityVisualization(factor, defaultMaterial);
case ATTRIBUTEVISUALIZATION.BLUE_RED:

@@ -218,5 +209,4 @@ return blueRedVisualization(factor);

numberVisualization,
stringVisualization,
stringOpacityVisualization
stringVisualization
};
//# sourceMappingURL=SDTFAttributeVisualization.js.map
{
"name": "@shapediver/viewer.shared.types",
"version": "1.8.14",
"version": "1.9.0",
"description": "",

@@ -39,9 +39,9 @@ "keywords": [],

"dependencies": {
"@shapediver/viewer.shared.math": "^1.8.14",
"@shapediver/viewer.shared.node-tree": "^1.8.14",
"@shapediver/viewer.shared.services": "^1.8.14",
"@shapediver/viewer.shared.math": "^1.9.0",
"@shapediver/viewer.shared.node-tree": "^1.9.0",
"@shapediver/viewer.shared.services": "^1.9.0",
"gl-matrix": "3.3.0",
"tsyringe": "^4.5.0"
},
"gitHead": "db4b8714e087e716c875ab642d7b69779562b641"
"gitHead": "fe27c1e7a529779c4476b683101a5bf69c521d1b"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc