@pivot-blitz/pro
v0.1.0
Published
PivotBlitz Professional - Premium features for pivot tables
Maintainers
Readme
@pivotblitz/pro
Premium features for PivotBlitz — Excel/PDF/image export, preset conditional formatting rules, and licensing.
Installation
pnpm add @pivotblitz/pro
# or
npm install @pivotblitz/proPeer dependencies are installed automatically:
xlsx— Excel exportjspdf+jspdf-autotable— PDF exporthtml2canvas— Image/screenshot export
License Activation
import { initPivotBlitzPro } from '@pivotblitz/pro';
initPivotBlitzPro('YOUR_LICENSE_KEY');Features
Excel Export
import { exportToExcel } from '@pivotblitz/pro';
await exportToExcel(store.pivotData, {
filename: 'report',
sheetName: 'Sales Data',
includeFilters: true,
styles: {
headerBackground: '#1e293b',
headerColor: '#ffffff',
alternateRowBackground: '#f8fafc',
},
});Functions: exportToExcel(), exportToExcelBuffer(), exportToExcelBase64(), exportMultiSheet()
PDF Export
import { exportToPDF } from '@pivotblitz/pro';
await exportToPDF(store.pivotData, {
filename: 'report',
title: 'Sales Analysis',
orientation: 'landscape',
pageSize: 'a4',
styles: {
headerBackground: '#1e293b',
fontSize: 10,
},
});Functions: exportToPDF(), exportToPDFBuffer(), exportToPDFBase64(), exportToPDFBlob()
Image Export
import { exportToImage } from '@pivotblitz/pro';
const result = await exportToImage(element, {
format: 'png',
scale: 2,
quality: 0.95,
});Functions: exportToImage(), captureElement(), exportSVGToImage(), getImageDataUrl(), getImageBlob()
Preset Formatting Rules
import { presetRules } from '@pivotblitz/pro';
// Traffic light: red < 50000, yellow 50000-150000, green > 150000
const rules = presetRules.trafficLight(50000, 150000);
// Heatmap gradient
const heatmap = presetRules.heatmapGYR();
// Data bars
const bars = presetRules.dataBarsBlue();
// Top/bottom highlighting
const topN = presetRules.highlightTopN(5, { backgroundColor: '#dcfce7' });
// Above/below average
const avgRules = presetRules.aboveBelowAverage();
// Positive/negative
const posNeg = presetRules.positiveNegative();Conditional Formatting Helpers
import { evaluateCondition, calculateHeatmapColor, calculateDataBarWidth, getIconForValue, interpolateColor } from '@pivotblitz/pro';API
Licensing
| Function | Description |
|----------|-------------|
| initPivotBlitzPro(key) | Activate with license key |
| isLicensed() | Check license status |
| getLicenseInfo() | Get license details |
| isFeatureEnabled(feature) | Check specific feature availability |
Export Types
| Type | Description |
|------|-------------|
| ExcelExportOptions | Excel export configuration |
| ExcelStyleOptions | Excel cell styling (headerBackground, headerColor, etc.) |
| PDFExportOptions | PDF export configuration |
| PDFStyleOptions | PDF styling (fontSize, fontFamily, colors) |
| ImageExportOptions | Image export configuration (format, scale, quality) |
Documentation
License
Commercial
