Spreadjs Advanced Api
by hewliyang
Access advanced SpreadJS functionality not covered by the standard API. Use when you need low-level spreadsheet operations like sparklines, slicers, cell buttons, advanced conditional formatting, outline groups, or any SpreadJS-specific features.
Skill Details
Repository Files
2 files in this skill directory
name: spreadjs-advanced-api description: Access advanced SpreadJS functionality not covered by the standard API. Use when you need low-level spreadsheet operations like sparklines, slicers, cell buttons, advanced conditional formatting, outline groups, or any SpreadJS-specific features. platform: web ui_visibility: summary
SpreadJS Advanced API
Raw Objects
Access the underlying SpreadJS objects:
const rawWorkbook = workbook.originalWorkbook; // GC.Spread.Sheets.Workbook
const rawSheet = workbook.getActiveSheet().originalSheet; // GC.Spread.Sheets.Worksheet
// GC.Spread.Sheets.* namespace available for enums, constructors, etc.
API Reference Structure
The type definitions in api-reference.ts are organized as nested modules under GC:
GC
├── Data (line ~2) - DataManager, Table, View, data binding
├── Pivot (line ~3978) - Pivot table types and enums
└── Spread
├── CalcEngine (line ~4704) - Formula engine, custom functions
├── Commands (line ~5179) - Command system, key bindings
├── Common (line ~5424) - Shared interfaces, culture info
├── Formatter (line ~5949) - Number/date formatting
├── Pivot (line ~6225) - Pivot table implementation
├── Report (line ~11188) - Report templates
├── Sheets (line ~12641) - Core spreadsheet (Workbook, Worksheet, Range, Style, etc.)
└── Slicers (line ~60687) - Table/pivot slicers
Searching the API
# Find a class and its methods
grep -n "export class Worksheet" api-reference.ts -A 200 | head -100
# Search for method names
grep -n "setSparkline\|getSparkline" api-reference.ts
# Find enums and their values
grep -n "export enum" api-reference.ts | head -30
grep -n "enum ChartType" api-reference.ts -A 50
# Search by keyword
grep -in "outline\|group" api-reference.ts | head -30
# Find interfaces for options/config objects
grep -n "export interface.*Options\|export type.*Options" api-reference.ts
Creating Reusable Skills
When building a skill with helper functions, use the loader pattern:
1. Create loader.js
// /files/skills/my-skill/loader.js
const _loadMySkill = new Function('GC', 'workbook', `
function myHelper(sheet, arg1, arg2) {
const rawSheet = sheet.originalSheet;
// Use GC.Spread.Sheets.* APIs here
return rawSheet.someMethod(arg1, arg2);
}
function anotherHelper(sheet, arg) {
// ...
}
return { myHelper, anotherHelper };
`);
Object.assign(store, _loadMySkill(GC, workbook));
Why new Function()? Regular functions defined in eval() don't persist. The Function constructor creates functions that can be assigned to store.
Note: Escape backslashes in regex inside the template string: \\d+ not \d+
2. Load and Use
# Step 1: Read loader into store (bash_command)
cat /files/skills/my-skill/loader.js
# Set to_store: "my_skill_loader"
// Step 2: Initialize (execute_code) - only needed once per session
eval(store.my_skill_loader);
// Step 3: Use the helpers
store.myHelper(sheet, "arg1", "arg2");
3. Document in SKILL.md
## Loading
1. bash: `cat /files/skills/my-skill/loader.js` → store
2. execute_code: `eval(store.my_skill_loader)`
3. Use: `store.myHelper(sheet, ...)`
## API
**myHelper(sheet, arg1, arg2)** - Description of what it does
Cautions
- Raw API changes may bypass dirty cell tracking (won't appear in review diff)
- Prefer standard
workbook/sheetAPI when available - Always search
api-reference.tsfor exact method signatures
Reference
- Type definitions:
/skills/default/spreadjs-advanced-api/api-reference.ts - Online docs: https://developer.mescius.com/spreadjs/api/
Related Skills
Reactome Database
Query Reactome REST API for pathway analysis, enrichment, gene-pathway mapping, disease pathways, molecular interactions, expression analysis, for systems biology studies.
Mermaid Diagrams
Comprehensive guide for creating software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams (domain modeling, object-oriented design), sequence diagrams (application flows, API interactions, code execution), flowcharts (processes, algorithms, user journeys), entity relationship diagrams (database schemas), C4 architecture diagrams (system context, containers, components), state diagrams, git graphs, pie charts,
Polars
Fast DataFrame library (Apache Arrow). Select, filter, group_by, joins, lazy evaluation, CSV/Parquet I/O, expression API, for high-performance data analysis workflows.
Reactome Database
Query Reactome REST API for pathway analysis, enrichment, gene-pathway mapping, disease pathways, molecular interactions, expression analysis, for systems biology studies.
Mermaidjs V11
Create diagrams and visualizations using Mermaid.js v11 syntax. Use when generating flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, user journeys, timelines, architecture diagrams, or any of 24+ diagram types. Supports JavaScript API integration, CLI rendering to SVG/PNG/PDF, theming, configuration, and accessibility features. Essential for documentation, technical diagrams, project planning, system architecture, and visual communication.
Monitoring Apis
|
Validating Performance Budgets
Validate application performance against defined budgets to identify regressions early. Use when checking page load times, bundle sizes, or API response times against thresholds. Trigger with phrases like "validate performance budget", "check performance metrics", or "detect performance regression".
Tracking Application Response Times
Track and optimize application response times across API endpoints, database queries, and service calls. Use when monitoring performance or identifying bottlenecks. Trigger with phrases like "track response times", "monitor API performance", or "analyze latency".
Databuddy
Integrate Databuddy analytics into applications using the SDK or REST API. Use when implementing analytics tracking, feature flags, custom events, Web Vitals, error tracking, LLM observability, or querying analytics data programmatically.
Datasette Plugin Writer
Guide for writing Datasette plugins. This skill should be used when users want to create or develop plugins for Datasette, including information about plugin hooks, the cookiecutter template, database APIs, request/response handling, and plugin configuration.
