How to use the paraview-lite/src/proxyHelper.generateComponentWithServerBinding function in paraview-lite

To help you get started, we’ve selected a few paraview-lite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kitware / paraview-lite / src / components / core / GlobalSettings / script.js View on Github external
defaultValue: 80,
    variable: 'interactiveQuality',
  },
};

// function purgeLocalStorage() {
//   Object.values(KEYS).forEach(({ name }) => {
//     localStorage.removeItem(`paraview.lite.config.${name}`);
//   });
// }

// ----------------------------------------------------------------------------
// Component API
// ----------------------------------------------------------------------------

export default generateComponentWithServerBinding(
  null, // We don't aim to create proxy
  'View',
  {
    bg: { name: 'Background', noAutoApply: true },
    bg2: { name: 'Background2', noAutoApply: true },
    gradient: { name: 'UseGradientBackground', noAutoApply: true },
  },
  {
    name: 'GlobalSettings',
    components: {
      PalettePicker,
    },
    data() {
      return {
        palette: [
          '#000000',
github Kitware / light-viz / src / components / core / GlobalSettings / script.js View on Github external
import PalettePicker from 'paraview-lite/src/components/widgets/PalettePicker';
import vtkMath from 'vtk.js/Sources/Common/Core/Math';

import { Actions, Mutations } from 'paraview-lite/src/stores/types';

import {
  generateComponentWithServerBinding,
  bool2int,
  toBoolean,
} from 'paraview-lite/src/proxyHelper';

// ----------------------------------------------------------------------------
// Component API
// ----------------------------------------------------------------------------

export default generateComponentWithServerBinding(
  null, // We don't aim to create proxy
  'View',
  {
    bg: { name: 'Background', noAutoApply: true },
    bg2: { name: 'Background2', noAutoApply: true },
    gradient: { name: 'UseGradientBackground', noAutoApply: true },
    axis: {
      name: 'OrientationAxesVisibility',
      clientToServer: bool2int,
      serverToClient: toBoolean,
      autoApply: true,
    },
  },
  {
    name: 'GlobalSettings',
    components: {
github Kitware / light-viz / src / modules / Threshold / script.js View on Github external
import {
  generateComponentWithServerBinding,
  bool2int,
  toBoolean,
} from 'paraview-lite/src/proxyHelper';

import module from './module';

const SEPARATOR = ':|:';
const DEFAULT_RANGE = { min: 0, max: 1 };

export default generateComponentWithServerBinding(
  'Threshold',
  'Source',
  {
    thresholdBy: {
      name: 'SelectInputScalars',
      label: 'Scalars',
      clientToServer: ({ value }) => value.split(SEPARATOR),
      serverToClient: (v) => ({ text: v[1], value: v.join(SEPARATOR) }),
      autoApply: false,
      default: ['POINTS', ''],
    },
    thresholdRange: {
      name: 'ThresholdBetween',
      label: 'ThresholdRange',
      autoApply: false,
      default: [0, 1],
github Kitware / paraview-lite / src / modules / StreamTracer / script.js View on Github external
{ text: 'Forward', value: 0 },
    { text: 'Backward', value: 1 },
    { text: 'Both', value: 2 },
  ],
  integratorType: [
    { text: 'Runge-Kutta 2', value: 0 },
    { text: 'Runge-Kutta 4', value: 1 },
    { text: 'Runge-Kutta 4-5', value: 2 },
  ],
  integrationStepUnit: [
    { text: 'Length', value: 1 },
    { text: 'Cell Length', value: 2 },
  ],
};

export default generateComponentWithServerBinding(
  'StreamTracer',
  'Source',
  {
    inputVector: {
      name: 'SelectInputVectors',
      label: 'Vectors',
      clientToServer: ({ value }) => value.split(SEPARATOR),
      serverToClient: (v) => ({ text: v[1], value: v.join(SEPARATOR) }),
      autoApply: false,
      default: ['POINTS', ''],
    },
    interpolatorType: {
      name: 'InterpolatorType',
      clientToServer: ({ value }) => Number(value),
      serverToClient: (v) => ITEMS.interpolatorType[v],
      autoApply: false,
github Kitware / light-viz / src / modules / Clip / script.js View on Github external
import {
  generateComponentWithServerBinding,
  bool2int,
  toBoolean,
} from 'paraview-lite/src/proxyHelper';

import module from './module';

export default generateComponentWithServerBinding(
  'Clip',
  'Source',
  {
    crinkleclip: {
      name: 'PreserveInputCells',
      label: 'Crinkleclip',
      clientToServer: bool2int,
      serverToClient: toBoolean,
      autoApply: false,
      default: 0,
    },
    invert: {
      name: 'Invert',
      clientToServer: bool2int,
      serverToClient: toBoolean,
      autoApply: false,
github Kitware / light-viz / src / modules / Cone / script.js View on Github external
import { generateComponentWithServerBinding } from 'paraview-lite/src/proxyHelper';

import module from './module';

export default generateComponentWithServerBinding(
  'Cone',
  'Source',
  {
    radius: {
      name: 'Radius',
      autoApply: true,
      default: 0.5,
      clientToServer: Number,
    },
    resolution: {
      name: 'Resolution',
      autoApply: true,
      default: 6,
      clientToServer: Number,
    },
    height: {
github Kitware / light-viz / src / components / core / RepresentationToolbar / script.js View on Github external
import vtkMath from 'vtk.js/Sources/Common/Core/Math';

import { generateComponentWithServerBinding } from 'paraview-lite/src/proxyHelper';
import { Getters, Actions } from 'paraview-lite/src/stores/types';

import CollapsableItem from 'paraview-lite/src/components/widgets/CollapsableItem';
import LookupTableToolbar from 'paraview-lite/src/components/widgets/LookupTableToolbar';
import PalettePicker from 'paraview-lite/src/components/widgets/PalettePicker';

const SEPARATOR = ':|:';
const SOLID_COLOR_ITEM = {
  text: 'Solid Color',
  value: `SOLID${SEPARATOR}${SEPARATOR}`,
};

export default generateComponentWithServerBinding(
  null,
  'Representation',
  {
    representation: {
      name: 'Representation',
      autoApply: true,
      default: 'Surface',
    },
    opacity: {
      name: 'Opacity',
      autoApply: true,
      default: 1,
    },
    pointSize: {
      name: 'PointSize',
      clientToServer: Number,
github Kitware / light-viz / src / modules / Contour / script.js View on Github external
import {
  generateComponentWithServerBinding,
  bool2int,
  toBoolean,
} from 'paraview-lite/src/proxyHelper';

import module from './module';

export default generateComponentWithServerBinding(
  'Contour',
  'Source',
  {
    computeNormals: {
      name: 'ComputeNormals',
      clientToServer: bool2int,
      serverToClient: toBoolean,
      autoApply: false,
      default: 1,
    },
    computeGradients: {
      name: 'ComputeGradients',
      clientToServer: bool2int,
      serverToClient: toBoolean,
      autoApply: false,
      default: 0,
github Kitware / light-viz / src / modules / Sphere / script.js View on Github external
import { generateComponentWithServerBinding } from 'paraview-lite/src/proxyHelper';

import module from './module';

export default generateComponentWithServerBinding(
  'Sphere',
  'Source',
  {
    startPhi: {
      name: 'StartPhi',
      autoApply: false,
      default: 0,
    },
    endPhi: {
      name: 'EndPhi',
      autoApply: false,
      default: 180,
    },
    phiResolution: {
      name: 'PhiResolution',
      autoApply: false,
github Kitware / light-viz / src / modules / Slice / script.js View on Github external
import {
  generateComponentWithServerBinding,
  bool2int,
  toBoolean,
} from 'paraview-lite/src/proxyHelper';

import module from './module';

export default generateComponentWithServerBinding(
  'Slice',
  'Source',
  {
    crinkleslice: {
      name: 'PreserveInputCells',
      label: 'Crinkleslice',
      clientToServer: bool2int,
      serverToClient: toBoolean,
      autoApply: false,
      default: 0,
    },
    origin: {
      name: 'Origin',
      autoApply: false,
      default: [0, 0, 0],
      subProxy: 'SliceType',