advanced-rendering
Master high-performance rendering for large datasets with Datashader. Use this skill when working with datasets exceeding 100M+ points, optimizing visualization performance, or implementing efficient rendering strategies with rasterization and colormapping techniques.
Best use case
advanced-rendering is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Master high-performance rendering for large datasets with Datashader. Use this skill when working with datasets exceeding 100M+ points, optimizing visualization performance, or implementing efficient rendering strategies with rasterization and colormapping techniques.
Teams using advanced-rendering should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/advanced-rendering/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How advanced-rendering Compares
| Feature / Agent | advanced-rendering | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Master high-performance rendering for large datasets with Datashader. Use this skill when working with datasets exceeding 100M+ points, optimizing visualization performance, or implementing efficient rendering strategies with rasterization and colormapping techniques.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Advanced Rendering Skill
## Overview
Master high-performance rendering for large datasets with Datashader and optimization techniques. This skill covers handling 100M+ point datasets, performance tuning, and efficient visualization strategies.
## Dependencies
- datashader >= 0.15.0
- colorcet >= 3.1.0
- holoviews >= 1.18.0
- pandas >= 1.0.0
- numpy >= 1.15.0
## Core Capabilities
### 1. Datashader Fundamentals
Datashader is designed for rasterizing large datasets:
```python
import datashader as ds
from datashader.mpl_ext import _colorize
import holoviews as hv
# Load large dataset (can handle 100M+ points)
df = pd.read_csv('large_dataset.csv') # Millions or billions of rows
# Create datashader canvas
canvas = ds.Canvas(plot_width=800, plot_height=600)
# Rasterize aggregation
agg = canvas.points(df, 'x', 'y')
# Convert to image
img = agg.to_array(True)
```
### 2. Efficient Point Rendering
```python
from holoviews.operation.datashader import datashade, aggregate, shade
# Quick datashading with HoloViews
scatter = hv.Scatter(df, 'x', 'y')
shaded = datashade(scatter)
# With custom aggregation
agg = aggregate(scatter, width=800, height=600)
colored = shade(agg, cmap='viridis')
# Control rasterization
from holoviews.operation import rasterize
rasterized = rasterize(
scatter,
aggregator=ds.count(),
pixel_ratio=2,
upsample_method='interp'
)
```
### 3. Color Mapping and Aggregation
```python
import datashader as ds
from colorcet import cm
# Count aggregation (heatmap)
canvas = ds.Canvas()
agg = canvas.points(df, 'x', 'y', agg=ds.count())
# Weighted aggregation
agg = canvas.points(df, 'x', 'y', agg=ds.sum('value'))
# Mean aggregation
agg = canvas.points(df, 'x', 'y', agg=ds.mean('value'))
# Custom colormapping
import datashader.transfer_functions as tf
shaded = tf.shade(agg, cmap=cm['viridis'])
shaded_with_spread = tf.spread(shaded, px=2)
```
### 4. Image Compositing
```python
# Combine multiple datasets
canvas = ds.Canvas(x_range=(0, 100), y_range=(0, 100))
agg1 = canvas.points(df1, 'x', 'y')
agg2 = canvas.points(df2, 'x', 'y')
# Shade separately
shaded1 = tf.shade(agg1, cmap=cm['reds'])
shaded2 = tf.shade(agg2, cmap=cm['blues'])
# Composite
import datashader.transfer_functions as tf
composite = tf.composite(shaded1, shaded2)
```
### 5. Interactive Datashader with HoloViews
```python
from holoviews.operation.datashader import datashade
from holoviews import streams
# Interactive scatter with zooming
def create_datashaded_plot(data):
scatter = hv.Scatter(data, 'x', 'y')
return datashade(scatter, cmap='viridis')
# Add interaction
range_stream = streams.RangeXY()
interactive_plot = hv.DynamicMap(
create_datashaded_plot,
streams=[range_stream]
)
```
### 6. Time Series Data Streaming
```python
# Efficient streaming plot for time series
from holoviews.operation.datashader import rasterize
from holoviews import streams
def create_timeseries_plot(df_window):
curve = hv.Curve(df_window, 'timestamp', 'value')
return curve
# Rasterize for efficiency
rasterized = rasterize(
hv.Curve(df, 'timestamp', 'value'),
aggregator=ds.mean('value'),
width=1000,
height=400
)
```
## Performance Optimization Strategies
### 1. Memory Optimization
```python
# Use data types efficiently
df = pd.read_csv(
'large_file.csv',
dtype={
'x': 'float32',
'y': 'float32',
'value': 'float32',
'category': 'category'
}
)
# Chunk processing for extremely large files
chunk_size = 1_000_000
aggregations = []
for chunk in pd.read_csv('huge.csv', chunksize=chunk_size):
canvas = ds.Canvas()
agg = canvas.points(chunk, 'x', 'y')
aggregations.append(agg)
# Combine results
combined_agg = aggregations[0]
for agg in aggregations[1:]:
combined_agg = combined_agg + agg
```
### 2. Resolution and Pixel Ratio
```python
# Adjust canvas resolution based on data density
def auto_canvas(df, target_pixels=500000):
data_points = len(df)
aspect_ratio = (df['x'].max() - df['x'].min()) / (df['y'].max() - df['y'].min())
pixels = int(np.sqrt(target_pixels / aspect_ratio))
height = pixels
width = int(pixels * aspect_ratio)
return ds.Canvas(
plot_width=width,
plot_height=height,
x_range=(df['x'].min(), df['x'].max()),
y_range=(df['y'].min(), df['y'].max())
)
canvas = auto_canvas(df)
agg = canvas.points(df, 'x', 'y')
```
### 3. Aggregation Selection
```python
# Choose appropriate aggregation for your data
canvas = ds.Canvas()
# For counting: count()
agg_count = canvas.points(df, 'x', 'y', agg=ds.count())
# For averages: mean()
agg_mean = canvas.points(df, 'x', 'y', agg=ds.mean('value'))
# For sums: sum()
agg_sum = canvas.points(df, 'x', 'y', agg=ds.sum('value'))
# For max/min
agg_max = canvas.points(df, 'x', 'y', agg=ds.max('value'))
# For percentiles
agg_p95 = canvas.points(df, 'x', 'y', agg=ds.count_cat('category'))
```
## Colormapping with Colorcet
### 1. Perceptually Uniform Colormaps
```python
from colorcet import cm, cmap_d
import datashader.transfer_functions as tf
# Use perceptually uniform colormaps
canvas = ds.Canvas()
agg = canvas.points(df, 'x', 'y', agg=ds.count())
# Gray scale
shaded_gray = tf.shade(agg, cmap=cm['gray'])
# Perceptual colormaps
shaded_viridis = tf.shade(agg, cmap=cm['viridis'])
shaded_turbo = tf.shade(agg, cmap=cm['turbo'])
# Category colormaps
shaded_color = tf.shade(agg, cmap=cm['cet_c5'])
```
### 2. Custom Color Normalization
```python
# Logarithmic normalization
from datashader.transfer_functions import Log
canvas = ds.Canvas()
agg = canvas.points(df, 'x', 'y', agg=ds.sum('value'))
# Log transform for better visualization
shaded = tf.shade(agg, norm='log', cmap=cm['viridis'])
# Power law normalization
shaded_power = tf.shade(agg, norm=ds.transfer_functions.eq_hist, cmap=cm['plasma'])
```
### 3. Multi-Band Compositing
```python
# Separate visualization of multiple datasets
canvas = ds.Canvas()
agg_red = canvas.points(df_red, 'x', 'y')
agg_green = canvas.points(df_green, 'x', 'y')
agg_blue = canvas.points(df_blue, 'x', 'y')
# Stack as RGB
from datashader.colors import rgb
result = rgb(agg_red, agg_green, agg_blue)
```
## Integration with Panel and HoloViews
```python
import panel as pn
from holoviews.operation.datashader import datashade
# Create interactive dashboard with datashader
class LargeDataViewer(param.Parameterized):
cmap = param.Selector(default='viridis', objects=list(cm.keys()))
show_spread = param.Boolean(default=False)
def __init__(self, data):
super().__init__()
self.data = data
@param.depends('cmap', 'show_spread')
def plot(self):
scatter = hv.Scatter(self.data, 'x', 'y')
shaded = datashade(scatter, cmap=cm[self.cmap])
if self.show_spread:
shaded = tf.spread(shaded, px=2)
return shaded
viewer = LargeDataViewer(large_df)
pn.extension('material')
app = pn.Column(
pn.param.ParamMethod.from_param(viewer.param),
viewer.plot
)
app.servable()
```
## Best Practices
### 1. Choose the Right Tool
```
< 10k points: Use standard HoloViews/hvPlot
10k - 1M points: Use rasterize() for dense plots
1M - 100M points: Use Datashader
> 100M points: Use Datashader with chunking
```
### 2. Appropriate Canvas Size
```python
# General rule: 400-1000 pixels on each axis
# Too small: loses detail
# Too large: slow rendering, memory waste
canvas = ds.Canvas(plot_width=800, plot_height=600) # Good default
```
### 3. Normalize Large Value Ranges
```python
# When data has extreme outliers
canvas = ds.Canvas()
agg = canvas.points(df, 'x', 'y', agg=ds.mean('value'))
# Use appropriate normalization
shaded = tf.shade(agg, norm='log', cmap=cm['viridis'])
```
## Common Patterns
### Pattern 1: Progressive Disclosure
```python
def create_progressive_plot(df):
# Start with aggregated view
agg = canvas.points(df, 'x', 'y')
return tf.shade(agg, cmap='viridis')
# User can zoom to see more detail
# Datashader automatically recalculates at new resolution
```
### Pattern 2: Categorical Visualization
```python
canvas = ds.Canvas()
# Aggregate by category
for category in df['category'].unique():
subset = df[df['category'] == category]
agg = canvas.points(subset, 'x', 'y', agg=ds.count())
shaded = tf.shade(agg, cmap=cm[f'category_{category}'])
```
### Pattern 3: Time Series Aggregation
```python
def aggregate_time_series(df, time_bucket):
df['time_bucket'] = pd.cut(df['timestamp'], bins=time_bucket)
aggregated = df.groupby('time_bucket').agg({
'x': 'mean',
'y': 'mean',
'value': 'sum'
})
return aggregated
```
## Common Use Cases
1. **Scatter Plot Analysis**: 100M+ point clouds
2. **Time Series Visualization**: High-frequency trading data
3. **Geospatial Heat Maps**: Global-scale location data
4. **Scientific Visualization**: Climate model outputs
5. **Network Analysis**: Large graph layouts
6. **Financial Analytics**: Tick-by-tick market data
## Troubleshooting
### Issue: Poor Color Differentiation
- Use perceptually uniform colormaps from colorcet
- Apply appropriate normalization (log, power law)
- Adjust canvas size for better resolution
### Issue: Memory Issues with Large Data
- Use chunk processing for files larger than RAM
- Reduce data type precision (float64 → float32)
- Aggregate before visualization
- Use categorical data type for strings
### Issue: Slow Performance
- Reduce canvas size (fewer pixels)
- Use simpler aggregation functions
- Enable GPU acceleration if available
- Profile with Python profilers to find bottlenecks
## Resources
- [Datashader Documentation](https://datashader.org)
- [Colorcet Documentation](https://colorcet.holoviz.org)
- [Datashader Examples](https://datashader.org/getting_started/index.html)
- [Large Data Visualization Guide](https://holoviews.org/user_guide/Large_Data.html)Related Skills
advanced-skill-creator
Meta-skill that generates domain-specific skills using advanced reasoning techniques. PROACTIVELY activate for: (1) Create/build/make skills, (2) Generate expert panels for any domain, (3) Design evaluation frameworks, (4) Create research workflows, (5) Structure complex multi-step processes, (6) Instantiate templates with parameters. Triggers: "create a skill for", "build evaluation for", "design workflow for", "generate expert panel for", "how should I approach [complex task]", "create skill", "new skill for", "skill template", "generate skill"
Advanced React Clean Integration
Integrate React with clean architecture without framework leakage using hooks as adapters and presenters. Use when connecting React to domain logic, designing hook-based DI, or isolating UI from business rules.
Advanced RE Analysis
Specialized reverse engineering analysis workflows for binary analysis, pattern recognition, and vulnerability assessment
advanced-patterns
Advanced T-SQL patterns and techniques for SQL Server. Use this skill when: (1) User needs help with CTEs or recursive queries, (2) User asks about APPLY operator, (3) User wants MERGE or OUTPUT clause help, (4) User works with temporal tables, (5) User needs In-Memory OLTP guidance, (6) User asks about advanced grouping (ROLLUP, CUBE, GROUPING SETS).
advanced-oscal-validator
Perform comprehensive OSCAL validation using community-inspired patterns including JSON schema validation, business rule validation, cross-reference checking, and best practices from IBM Trestle, oscal-pydantic, and Lula. Use for thorough document quality assurance.
Advanced Modular Library Design
Design modular libraries with clear package boundaries, feature-first organization, and clean API surfaces. Use when structuring monorepos, defining module boundaries, or designing library APIs.
advanced-memory-skill-creator
Use when planning, scaffolding, validating, or packaging Claude skills inside Advanced Memory MCP.
advanced-memoization-strategies
Apply principled memoization techniques to reduce re-rendering without introducing correctness bugs.
advanced-math-trading/robustness-risk
Tail risk, EVT, regularization, validation guardrails, and common pitfalls.
advanced-math-trading/portfolio-factors
Factor modeling and portfolio construction (Markowitz, Black-Litterman, constraints, turnover).
advanced-math-trading/foundations-core
Probability, moments/tails, Bayes, and statistical learning foundations for systematic trading.
advanced-kubernetes
Custom Resource Definitions (CRDs) extend Kubernetes API with custom object types. Operators are controllers that manage these custom resources using domain-specific logic.