web.protocols Module¶
paraviewweb_protocols is a module that contains a set of ParaViewWeb related protocols that can be combined together to provide a flexible way to define very specific web application.
- class paraview.web.protocols.ParaViewWebColorManager(pathToColorMaps=None, showBuiltin=True, **kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- colorBy(representation, colorMode, arrayLocation='POINTS', arrayName='', vectorMode='Magnitude', vectorComponent=0, rescale=False)[source]¶
Choose the array to color by, and optionally specify magnitude or a vector component in the case of vector array.
- getScalarBarVisibilities(proxyIdList)[source]¶
Returns whether or not each specified scalar bar is visible.
- listColorMapNames()[source]¶
List the names of all color map presets available on the server. This list will contain the names of any presets you provided in the file you supplied to the constructor of this protocol.
- rescaleTransferFunction(options)[source]¶
Rescale the color transfer function to fit either the data range, the data range over time, or to a custom range, for the array by which the representation is currently being colored.
- selectColorMap(representation, paletteName)[source]¶
Choose the color map preset to use when coloring by an array.
- class paraview.web.protocols.ParaViewWebFileListing(basePath, name, excludeRegex='^\\.|~$|^\\$', groupRegex='[0-9]+\\.', **kwargs)[source]¶
- class paraview.web.protocols.ParaViewWebProgressUpdate(**kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- progressObserverTag = None¶
- class paraview.web.protocols.ParaViewWebProtocol[source]¶
Bases:
vtkmodules.web.protocols.vtkWebProtocol
- getView(vid)[source]¶
Returns the view for a given view ID, if vid is None then return the current active view. :param vid: The view ID :type vid: str
- class paraview.web.protocols.ParaViewWebProxyManager(allowedProxiesFile=None, baseDir=None, fileToLoad=None, allowUnconfiguredReaders=True, groupProxyEditorWidgets=True, respectPropertyGroups=True, **kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- VTK_DATA_TYPES = ['void', 'bit', 'char', 'unsigned_char', 'short', 'unsigned_short', 'int', 'unsigned_int', 'long', 'unsigned_long', 'float', 'double', 'id_type', 'unspecified', 'unspecified', 'signed_char', 'long_long', 'unsigned_long_long']¶
- applyDomains(parentProxy, proxy_id)[source]¶
This function is used to apply the domains so that queries for specific values like range min and max retrieve something useful.
- available(typeOfProxy)[source]¶
Returns a list of the available sources or filters, depending on the argument typeOfProxy, which can be either ‘filters’ or ‘sources’. If typeOfProxy is anything other than ‘filter’ or ‘source’, the empty list will be returned.
Any attempt to create a source or filter not returned by this method will result in an error response. The returned list has the following form:
[ ‘Wavelet’, ‘Cone’, ‘Sphere’, … ]
or
[ ‘Contour’, ‘Clip’, ‘Slice’, … ]
- create(functionName, parentId, initialValues={}, skipDomain=False, subProxyValues={})[source]¶
Creates a new filter/source proxy as a child of the specified parent proxy. Returns the proxy state for the newly created proxy as a JSON object.
- delete(proxyId)[source]¶
Checks if the proxy can be deleted (it is not the input to another proxy), and then deletes it if so. Returns True if the proxy was deleted, False otherwise.
- getColorInformation(proxy)[source]¶
Generates a block of color information, given a representation proxy.
Example output format:
"colorBy": { "representation": "652", "scalarBar": 0, "mode": "color", # 'array' "color": [0.5, 1.0, 1.0], "array": ["POINTS", "RTData", -1], "colorMap": "Blue to Red" }
- getProxyListFromProperty(proxy, proxyPropElement, inPropGroup, group, parentGroup, detailsKey)[source]¶
- getUiProperties(proxyId, proxyProperties)[source]¶
Generates an array of objects, parallel to the properties, containing the information needed to render UI for each property. Not all of the following attributes will always be present.
- Parameters
proxyId (str) – The ID of the proxy.
proxyProperties (list) – The properties of the proxy.
Example output format:
"ui": [ { "name": "Clip Type", "advanced": 1, # 0 "doc": "Documentation string for the property", "dependency": "498:ClipFunction:Sphere:1", "values": { "Plane": "456", "Box": "457", "Scalar": "458", "Sphere": "459" }, "type": "int", # 'float', 'int', 'str', 'proxy', 'input', ... "widget": "textfield", # 'checkbox', 'textarea', 'list-1', 'list-n' "size": -1, # -1, 0, 2, 3, 6 "range": [ { "min": 0, "max": 1 }, { "min": 4, "max": 7 } ] } # More objects... ]
- list(viewId=None)[source]¶
Returns the current proxy list, specifying for each proxy it’s name, id, and parent (input) proxy id. A ‘parent’ of ‘0’ means the proxy has no input.
- open(relativePath)[source]¶
Open relative file paths, attempting to use the file extension to select from the configured readers.
- processXmlElement(proxy, xmlElement, inPropGroup, group, parentGroup, belongsToProxyProperty=None)[source]¶
- class paraview.web.protocols.ParaViewWebRemoteConnection[source]¶
- class paraview.web.protocols.ParaViewWebSaveData(baseSavePath='', **kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- saveData(filePath, options=None)[source]¶
Save some data on the server side. Can save data from a proxy, a screenshot, or else the current state. Options may be different depending on the type of data to be saved. Saving a screenshot can take an optional size array indicating the desired width and height of the saved image. Saving data can take an optional proxy id specifying which filter or source to save output from.
- Parameters
filePath (str) – The path where the data will be saved.
options (dict) – Optional parameters to customize the save operation.
Example usage of options:
{ "proxyId": "426", "size": [800, 600] }
- class paraview.web.protocols.ParaViewWebSelectionHandler(**kwargs)[source]¶
- class paraview.web.protocols.ParaViewWebStartupPluginLoader(plugins=None, pathSeparator=':', **kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- loaded = False¶
- class paraview.web.protocols.ParaViewWebStartupRemoteConnection(dsHost=None, dsPort=11111, rsHost=None, rsPort=22221, rcPort=- 1, **kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- connected = False¶
- class paraview.web.protocols.ParaViewWebViewPort(scale=1.0, maxWidth=2560, maxHeight=1440, **kwargs)[source]¶
Bases:
paraview.web.protocols.ParaViewWebProtocol
- updateCenterAxesVisibility(viewId, showAxis)[source]¶
RPC callback to show/hide CenterAxesVisibility.