This page demonstrates the key features of interactive PivotTable plots in JSPlots.
Basic pivot: Simple data aggregation with drag-and-drop
Custom heatmaps: Color-coded matrices with custom color scales
Different renderers: Table, Bar Chart, Line Chart, and more
Data filtering: Inclusions and exclusions to focus on specific data
Aggregations: Sum, Average, Count, and other aggregation functions
Combined with other plots: Mix PivotTables with LineCharts and 3D plots
Tip: Drag and drop fields between Rows, Columns, and Values to reorganize!
sales_pivot
Basic pivot table - drag fields to reorganize rows and columns
performance_heatmap
Custom color scale heatmap - green indicates good performance, red needs improvement
revenue_by_category
Bar chart renderer - switch renderer in the dropdown to see other visualizations
customer_revenue
Exclusions feature - 'Test' country data is automatically filtered out
survey_results
Inclusions feature - only showing ages 18-45, filtering out older demographics
transaction_analysis
Count aggregation - showing transaction counts rather than sums or averages
Returns_Over_Last_Few_Days
Stock returns heatmap with MSFT excluded
Correlation_Matrix
Correlation matrix with custom red-white-blue color scale
Dataset Selection Feature
This example demonstrates the new dataset selection feature in PivotTable. When multiple datasets are provided, a dropdown appears allowing you to switch between them dynamically.
How it works:
Struct with DataFrames: We defined a struct ExampleFrame with fields aa::DataFrame and bb::Union{Missing,DataFrame}
Automatic extraction: When you pass the struct to JSPlotPage, the DataFrames are automatically extracted with dot-prefixed names (e.g., Symbol("multi_data.aa"), Symbol("multi_data.bb"))
Multiple datasets: The PivotTable accepts a Vector{Symbol} of dataset labels instead of a single Symbol
Dynamic switching: Changing the dataset reloads the pivot table while preserving your current configuration
Try switching between the three datasets using the dropdown above the pivot table!
dataset_selector_demo
Dataset selection demo - use the dropdown above to switch between three different datasets. The pivot table will reload with the new data while preserving your row/column selections where possible.
Key Features Summary
Drag-and-drop interface: Reorganize data dynamically by dragging fields
Multiple renderers: Table, Heatmap, Bar Chart, Line Chart, and more
Custom color scales: Define your own color gradients for heatmaps
Aggregation functions: Sum, Average, Count, Median, Min, Max, etc.
Data filtering: Include or exclude specific values
Multi-level grouping: Use multiple row or column dimensions
Dataset selection: Switch between multiple datasets with a dropdown
Struct support: Automatically extract DataFrames from structs
Integration: Combine PivotTables with LineCharts, 3D plots, and more
Tip: Try dragging unused fields from the top into Rows or Columns!