Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import GenericViewer from 'paraviewweb/src/React/Viewers/ImageBuilderViewer';
import QueryDataModel from 'paraviewweb/src/IO/Core/QueryDataModel';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import ImageQueryDataModelViewer from 'arctic-viewer/lib/types/ImageQueryDataModel';
import SortedCompositeViewer from 'arctic-viewer/lib/types/SortedComposite';
// Resource images -----------------------------------------------------------
import link from './tomvizLink.png';
// Global variables -----------------------------------------------------------
const iOS = /iPad|iPhone|iPod/.test(window.navigator.platform);
const lookupTableManager = new LookupTableManager();
const dataViewers = [
ImageQueryDataModelViewer,
SortedCompositeViewer,
];
// Add class to body if iOS device --------------------------------------------
if (iOS) {
document.querySelector('body').classList.add('is-ios-device');
}
// ----------------------------------------------------------------------------
function viewerBuilder(basepath, data, config, callback) {
var foundViewer = false;
var viewerCount = dataViewers.length;
import ImageBuilder from 'paraviewweb/src/Rendering/Image/DataProberImageBuilder';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import Probe3DViewer from 'paraviewweb/src/React/Viewers/Probe3DViewer';
import QueryDataModel from 'paraviewweb/src/IO/Core/QueryDataModel';
const bodyElement = document.querySelector('.content');
// Fix dimension
jsonData.metadata.dimensions = [50, 50, 50];
const dataModel = new QueryDataModel(jsonData, `${__BASE_PATH__}/data/probe/`);
ReactDOM.render(
React.createElement(Probe3DViewer, {
queryDataModel: dataModel,
imageBuilder: new ImageBuilder(dataModel, new LookupTableManager()),
probe: true,
}),
bodyElement
);
setImmediate(() => {
dataModel.fetchData();
});
import 'normalize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import equals from 'mout/src/array/equals';
import jsonData from 'tonic-arctic-sample-data/data/probe/index.json';
import MultiLayoutRenderer from 'paraviewweb/src/React/Renderers/MultiLayoutRenderer';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import QueryDataModel from 'paraviewweb/src/IO/Core/QueryDataModel';
import ImageBuilder from 'paraviewweb/src/Rendering/Image/DataProberImageBuilder';
const container = document.querySelector('.content');
const dataModel = new QueryDataModel(jsonData, `${__BASE_PATH__}/data/probe/`);
const lutManager = new LookupTableManager();
const imageBuilderA = new ImageBuilder(dataModel, lutManager);
const imageBuilderB = new ImageBuilder(dataModel, lutManager);
const imageBuilderC = new ImageBuilder(dataModel, lutManager);
// Configure Image builders
const field = imageBuilderA.getFields()[0];
imageBuilderA.setField(field);
imageBuilderB.setField(field);
imageBuilderC.setField(field);
imageBuilderA.setProbe(10, 10, 10);
imageBuilderB.setProbe(10, 10, 10);
imageBuilderC.setProbe(10, 10, 10);
imageBuilderA.renderMethod = 'XY';
imageBuilderB.renderMethod = 'ZY';
import React from 'react';
import ReactDOM from 'react-dom';
import jsonData from 'tonic-arctic-sample-data/data/probe/index.json';
import ImageBuilder from 'paraviewweb/src/Rendering/Image/DataProberImageBuilder';
import PixelOperatorImageBuilder from 'paraviewweb/src/Rendering/Image/PixelOperatorImageBuilder';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import MultiLayoutViewer from 'paraviewweb/src/React/Viewers/MultiLayoutViewer';
import QueryDataModel from 'paraviewweb/src/IO/Core/QueryDataModel';
const bodyElement = document.querySelector('.content');
const dataModelA = new QueryDataModel(jsonData, `${__BASE_PATH__}/data/probe/`);
const dataModelB = new QueryDataModel(jsonData, `${__BASE_PATH__}/data/probe/`);
const dataModelC = new QueryDataModel(jsonData, `${__BASE_PATH__}/data/probe/`);
const lutManager = new LookupTableManager();
const imageBuilderA = new ImageBuilder(dataModelA, lutManager);
const imageBuilderB = new ImageBuilder(dataModelB, lutManager);
const imageBuilderC = new ImageBuilder(dataModelC, lutManager);
const diffImageBuilder = new PixelOperatorImageBuilder();
// Handling Diff computation
imageBuilderA.onImageReady((data, envelope) => {
diffImageBuilder.updateData('a', data);
});
imageBuilderB.onImageReady((data, envelope) => {
diffImageBuilder.updateData('b', data);
});
imageBuilderC.onImageReady((data, envelope) => {
diffImageBuilder.updateData('c', data);
});
ViewerE,
ViewerF,
ViewerG,
ViewerH,
ViewerI,
ViewerJ,
ViewerK,
ViewerL,
ViewerM,
ViewerN,
ViewerO,
ViewerP,
ViewerQ,
];
const lookupTableManager = new LookupTableManager();
export default function build(basepath, data, config, callback) {
let foundViewer = false;
let viewerCount = dataViewers.length;
const dataType = data.type;
const viewer = {
ui: 'GenericViewer',
config,
allowMagicLens: true,
};
// Initializer shared variables
config.lookupTableManager = lookupTableManager;
// Update background if available
import React from 'react';
import ReactDOM from 'react-dom';
import equals from 'mout/src/array/equals';
import jsonData from 'tonic-arctic-sample-data/data/probe/index.json';
import ImageBuilder from 'paraviewweb/src/Rendering/Image/DataProberImageBuilder';
import LineChartPainter from 'paraviewweb/src/Rendering/Painter/LineChartPainter';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import MultiLayoutViewer from 'paraviewweb/src/React/Viewers/MultiLayoutViewer';
import QueryDataModel from 'paraviewweb/src/IO/Core/QueryDataModel';
const bodyElement = document.querySelector('.content');
const dataModel = new QueryDataModel(jsonData, `${__BASE_PATH__}/data/probe/`);
const lutManager = new LookupTableManager();
const imageBuilderA = new ImageBuilder(dataModel, lutManager);
const imageBuilderB = new ImageBuilder(dataModel, lutManager);
const imageBuilderC = new ImageBuilder(dataModel, lutManager);
const xChartPainter = new LineChartPainter('X: {x}');
const yChartPainter = new LineChartPainter('Y: {x}');
const zChartPainter = new LineChartPainter('Z: {x}');
const dimensions = dataModel.originalData.InSituDataProber.dimensions;
// Configure Image builders
imageBuilderA.setRenderMethod(imageBuilderA.getRenderMethods()[0]);
imageBuilderB.setRenderMethod(imageBuilderA.getRenderMethods()[1]);
imageBuilderC.setRenderMethod(imageBuilderA.getRenderMethods()[2]);
imageBuilderA.setRenderMethodImutable();
imageBuilderB.setRenderMethodImutable();
imageBuilderC.setRenderMethodImutable();
import 'normalize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import LookupTableWidget from 'paraviewweb/src/React/Widgets/LookupTableWidget';
// Get react component
const lookupTableManager = new LookupTableManager();
const lookupTable = lookupTableManager.addLookupTable(
'demo',
[-5, 15],
'spectral'
);
document.body.style.padding = '10px';
const component = ReactDOM.render( // eslint-disable-line
React.createElement(LookupTableWidget, {
lookupTable,
originalRange: [-5, 15],
inverse: true,
lookupTableManager,
}),
document.querySelector('.content')
import 'normalize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import LookupTableManagerControl from 'paraviewweb/src/React/CollapsibleControls/LookupTableManagerControl';
document.body.style.padding = '10px';
// Create needed property
const lookupTableManager = new LookupTableManager();
// Add several LookupTables
lookupTableManager.addLookupTable('Temperature', [-5, 25], 'cold2warm');
lookupTableManager.addLookupTable('Pressure', [0, 15000], 'spectral');
lookupTableManager.addLookupTable('Velocity', [5, 150], 'rainbow');
// Render
ReactDOM.render(
,
document.querySelector('.content')
);
import 'normalize.css';
import React from 'react';
import ReactDOM from 'react-dom';
import EqualizerState from 'paraviewweb/src/Common/State/EqualizerState';
import LookupTableManager from 'paraviewweb/src/Common/Core/LookupTableManager';
import ToggleState from 'paraviewweb/src/Common/State/ToggleState';
import VolumeControl from 'paraviewweb/src/React/CollapsibleControls/VolumeControl';
const computation = new ToggleState();
const intensity = new ToggleState();
const equalizer = new EqualizerState({ size: 26 });
const lookupTableManager = new LookupTableManager();
const lookupTable = {
originalRange: [-5, 15],
lookupTableManager,
lookupTable: lookupTableManager.addLookupTable('demo', [-5, 15], 'spectral'),
};
const container = document.querySelector('.content');
ReactDOM.render(
React.createElement(VolumeControl, {
computation,
equalizer,
intensity,
lookupTable,
}),
container
);