Skip to main content
torch.jstorch.jstorch.js
Getting StartedPlaygroundContact
Login
torch.jstorch.jstorch.js
Documentation
IntroductionType SafetyTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformance
IntroductionRenderersAnalysis
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. viz
  3. index

viz API Reference

Complete API documentation for viz.

viz.analysis

Functions

  • computeQuantiles - Compute quantiles (percentiles) of a tensor.
  • computePercentiles - Compute common percentiles (5th, 25th, 50th, 75th, 95th).
  • computeCorrelation - Compute Pearson correlation matrix for multiple variables.
  • computeCovariance - Compute covariance matrix for multiple variables.
  • detectOutliers - Detect outliers using the Interquartile Range (IQR) method.
  • detectOutliersZScore - Detect outliers using Z-score method.
  • computeExtendedStats - Compute extended statistics including skewness and kurtosis.
  • describeExtendedStats - Describe extended statistics as a formatted string.
  • createDBSCAN - Create a new DBSCAN instance.
  • dbscan - Convenience function for one-shot DBSCAN clustering.
  • ...and 20 more

Methods

  • DBSCAN.fit - Fit DBSCAN clustering on data.
  • DBSCAN.destroy - Clean up GPU resources.
  • HierarchicalClustering.fit - Fit hierarchical clustering on data.
  • HierarchicalClustering.destroy - Clean up GPU resources.
  • KDE.fit - Compute KDE (Kernel Density Estimation) for 1D data.
  • KDE.destroy - Clean up GPU resources.
  • KMeans.fit - Fit k-means clustering to data.
  • KMeans.destroy - Clean up GPU resources.
  • PCA.fit - Fit PCA and transform data to lower dimensions.
  • PCA.destroy - Clean up GPU resources.
  • ...and 4 more

viz.colormaps

Functions

  • getColormapShaderCode - Get the WGSL colormap shader code.

viz.core

Functions

  • animate - Animate a single value from 0 to 1.
  • lerp - Interpolate between two numbers.
  • lerpArray - Interpolate between two number arrays.
  • lerpFloat32Array - Interpolate between two Float32Arrays.
  • transitionNumber - Transition between two number values.
  • transitionArray - Transition between two number arrays.
  • transitionFloat32Array - Transition between two Float32Arrays.
  • createAnimationLoop - Create an animation loop that runs continuously.
  • sequence - Chain multiple animations sequentially.
  • parallel - Run multiple animations in parallel.
  • ...and 17 more

Methods

  • InteractiveCanvas.resetView - Reset view to original state.
  • InteractiveCanvas.getTransform - Get current view transform.
  • InteractiveCanvas.setTransform - Set view transform.
  • InteractiveCanvas.zoomToRect - Zoom to fit a specific region.
  • InteractiveCanvas.destroy - Clean up resources.
  • HitTester.clear - Clear all registered regions.
  • HitTester.addRegion - Add a clickable/hoverable region.
  • HitTester.addRegions - Add multiple regions at once.
  • HitTester.hitTest - Test if a point hits any region.
  • HitTester.hitTestAll - Get all regions that contain a point.
  • ...and 25 more

viz.renderers

Functions

  • createAttentionFlowRenderer - Create a new AttentionFlowRenderer instance.
  • computeBoxPlotStats - Compute box plot statistics from raw data.
  • createBoxPlotRenderer - Create a new BoxPlotRenderer instance.
  • createConfusionMatrixRenderer - Create a new ConfusionMatrixRenderer instance.
  • computeConfusionMatrix - Compute confusion matrix from predictions and ground truth.
  • computeROCCurve - Compute ROC curve from predictions and labels.
  • computePRCurve - Compute Precision-Recall curve from predictions and labels.
  • createCurveRenderer - Create a new CurveRenderer instance.
  • createDendrogramRenderer - Create a new DendrogramRenderer instance.
  • createEmbeddingRenderer - Create a new EmbeddingRenderer instance.
  • ...and 15 more

Methods

  • AttentionFlowRenderer.render - Render attention patterns as flowing arcs.
  • AttentionFlowRenderer.renderToCanvas - Render directly to a canvas element.
  • AttentionFlowRenderer.renderToBlob - Render and export to Blob.
  • AttentionFlowRenderer.destroy - Clean up GPU resources.
  • BoxPlotRenderer.render - Render box plots.
  • BoxPlotRenderer.renderToCanvas - Render directly to a canvas element.
  • BoxPlotRenderer.destroy - Clean up resources.
  • ConfusionMatrixRenderer.render - Render confusion matrix from a 2D tensor [num_classes, num_classes].
  • ConfusionMatrixRenderer.renderToCanvas - Render to canvas.
  • ConfusionMatrixRenderer.destroy - Clean up GPU resources.
  • ...and 78 more