web.helper Module

web_helper is a module that provides access to functions that helps to build new protocols and process ParaView data structure into web friendly ones.

class paraview.web.helper.Pipeline(name)[source]

Bases: object

Define a data structure that represent a pipeline as a tree. This provide also methods to get the data structure for the web environment

addNode(parent_id, node_id)[source]

Add node into the pipeline tree.

clear()[source]

Clear the pipeline tree.

getRootNode(view=None)[source]

Create a tree structure of the pipeline with the current proxy state.

isEmpty()[source]
removeNode(id)[source]

Remove a node from the pipeline tree.

paraview.web.helper.apply_domains(parentProxy, proxy_id)[source]

Handle bounds domain

paraview.web.helper.extractDomain(proxy, propertyName, xmlDomainElement)[source]
paraview.web.helper.extractProperty(proxy, xmlPropertyElement)[source]
paraview.web.helper.getParentProxyId(proxy)[source]

Return ‘0’ if the given proxy has no Input otherwise will return the parent proxy id as a String.

paraview.web.helper.getProxyAsPipelineNode(id, view=None)[source]

Create a representation for that proxy so it can be used within a pipeline browser.

paraview.web.helper.getProxyAsState(id)[source]

Return a json representation of the given proxy state.

Example of the state of the Clip filter:

{
    "proxy_id": 234,
    "ClipType": {
        "proxy_id": 235,
        "Normal": [0, 0, 1],
        "Origin": [0, 0, 0],
        "InsideOut": 0
    }
}
paraview.web.helper.getProxyDomains(id)[source]

Return a json based structured based on the proxy XML.

paraview.web.helper.idToProxy(id)[source]

Return the proxy that match the given proxy ID.

paraview.web.helper.listFiles(pathToList)[source]

Create a tree structure of the given directory that will be understood by the pipelineBrowser widget. The provided path should not have a trailing ‘/’.

 {
    children: [
        { name: 'fileName.vtk', path: '/full_path/to_file/fileName.vtk' },
        { name: 'directoryName', path: '/full_path/to_file/directoryName', children: [] }
    ]
}
paraview.web.helper.removeUnicode(value)[source]
paraview.web.helper.updateProxyProperties(proxy, properties)[source]

Loop over the properties object and update the mapping properties to the given proxy.