Export
The event scheduler exports data from the current projection, so filters, visible resources, conflicts, coverage, and utilization match what the user is reviewing.
const scheduler = (await grid.getPlugins()).find( (plugin) => plugin.constructor?.name === 'EventSchedulerPlugin',);
const projection = scheduler.getProjection();
const eventsCsv = scheduler.exportEvents({ format: 'csv' });const workloadJson = scheduler.exportResourceWorkload({ format: 'json' });const conflictsCsv = scheduler.exportConflicts({ format: 'csv' });const coverageCsv = scheduler.exportCoverage({ format: 'csv', gapsOnly: true });const visibleCsv = scheduler.exportVisibleSchedule({ format: 'csv' });
download(eventsCsv.content, eventsCsv.fileName, eventsCsv.mimeType);For printable schedules, create an HTML view from the same projection.
const print = scheduler.createPrintView({ title: 'Weekly Staff Schedule', includeEvents: true, includeWorkload: true, includeConflicts: true, includeCoverage: true,});
const printWindow = window.open('', '_blank');printWindow?.document.write(print.html);printWindow?.print();Production Checklist
Section titled “Production Checklist”- Use stable ids for events, resources, assignments, templates, and coverage requirements.
- Store scheduler datetimes as ISO strings and define a product time-zone policy before persisting user edits.
- Keep
sourcecontrolled by app state and persist every created, changed, and deleted event array. - Enable
allowCreateintentionally. It defaults to false. - Add permission rules for locked resources, read-only events, completed statuses, and protected date ranges.
- Choose conflict policy deliberately. Use
preventor error rules for hard booking constraints. - Use availability for real scheduling constraints and
nonWorkingTimefor visual closed-time guidance. - Use
resourceGrouping,filters, andsavedViewsfor planner navigation instead of mutating source arrays. - Use
coverageandutilizationonly when the resource metadata needed for planning is present. - Add remote validation and rollback for server-backed schedulers.
- Keep keyboard shortcuts enabled unless the host app owns all scheduler keyboard behavior.
- Expose export or print workflows from the plugin projection when planners need to share schedules.
- Test drag-create, move, resize, delete, selection, keyboard shortcuts, conflicts, and remote failure paths in the target framework.
Graphical Resource Timeline export
Section titled “Graphical Resource Timeline export”Graphical export is additive: CSV/JSON and createPrintView() keep their existing contracts. The graphical methods wait for pending saves, dispatch/reconciliation and persisted history replay, then capture all matching logical rows in the current native sort/filter/collapse order, including unmounted rows. No source, selection, scroll, history or live view is changed.
import { EventSchedulerPlugin, ExportSchedulerPlugin } from '@revolist/scheduler';
grid.plugins = [EventSchedulerPlugin, ExportSchedulerPlugin];const exporter = (await grid.getPlugins()).find( plugin => plugin instanceof ExportSchedulerPlugin,)!;
const images = await exporter.exportImages({ format: 'svg', // or 'png'; PNG supports pixelRatio: 1 | 2 title: 'Client schedule',});if (images.ok) { // Each tile is a separate file. Present individual links rather than assuming // the browser permits several automatic downloads. for (const tile of images.tiles) { const url = URL.createObjectURL(tile.blob); // Use url in a preview/download link; revoke it when replaced or disposed. }} else { console.error(images.error.code, images.error.message);}
const pdf = await exporter.exportPdf({ paper: 'a4', // 'letter' also supported orientation: 'landscape', title: 'Client schedule',});// pdf.ok => pdf.blob is application/pdf, with fileName, pageCount and metadata.// No print dialog or application-supplied PDF encoder is required.For a ready-made preview with explicit download links and cancellation:
import { mountScheduleExportPreview } from '@revolist/scheduler';const dispose = mountScheduleExportPreview(container, exporter);// Call dispose() on unmount to cancel work and revoke owned preview URLs.The equipment and machine example includes the controls and portable equivalents for its custom content in Vue, TypeScript, React and Angular.
Scope and timezones
Section titled “Scope and timezones”The default includes current visible resource columns, their retained order/width, filters, collapsed groups, authored event colors, progress and conflict/availability markers. An explicit resourceColumns subset can omit visible columns; it cannot expose hidden columns. resourceIds intersects the visible resource scope and preserves its order. Unknown resource ids fail. Collapsed child payloads are excluded. There is no automatic privacy redaction: applications control authorization.
An optional range: { startDateTime, endDateTime } uses absolute ISO instants and an exclusive end. Export can project another date range from supplied canonical data without changing the grid; the existing visible-day/time-window policy still applies. The exporting browser’s IANA timezone is captured once. Axis windows are split at browser midnight and offset transitions, and repeated hours are labeled with offsets. Event instants, elapsed durations, membership, schedule-timezone calendars and conflict policy remain unchanged. Each page/tile labels its timezone and converted range.
Custom content and supplied images
Section titled “Custom content and supplied images”Custom event, resource, header, group or timeline-cell presentation requires its matching templates renderer. Export blocks with missing-export-template for a rendered instance without one; it does not fall back to incomplete built-in text. Templates receive immutable context and return portable text, rect, line or image nodes in the provided box. No HTML, raw SVG, external CSS, scripts or network URLs are accepted. Export-only renderers must include the information your custom UI makes visible.
import type { ScheduleExportOptions } from '@revolist/scheduler';
const exportOptions: ScheduleExportOptions = { templates: { event: ({ width, height, text }) => width < 12 ? [] : [ { kind: 'rect', x: 0, y: 0, width, height, fill: '#2563eb' }, { kind: 'text', x: 4, y: 16, text, fill: '#ffffff' }, ], },};Images must be explicitly supplied in assets as keyed { blob, width, height } PNG/JPEG records, then referenced by image nodes through asset. Bytes and dimensions are decoded and checked before any successful artifact set is returned. Existing avatar URLs are never fetched implicitly; provide a portable resource renderer and approved image assets where applicable.
System fonts are used. Unicode and emoji appearance depends on the platform’s installed system fonts. SVG is self-contained, with concrete styles and embedded supplied images; system typography can vary when opened on another OS. PNG and PDF preserve the rendering browser’s appearance. PDF pages are rasterized at 192 DPI; searchable/selectable text and tagged PDF accessibility are not promised.
Complete snapshots, limits and errors
Section titled “Complete snapshots, limits and errors”Remote or lazy data requires loadSnapshot(request). The request contains captured configuration (including native collapse), resource-column filters/sorting, instant range, schedule/export timezones, request token and cancellation signal. resourceIds is undefined for the full filtered scope; visibleResourceIds identifies currently loaded visible resources. An explicit resourceIds subset remains intersected with that scope. The application translates its filters and enforces authorization; it must return an isolated schedule-timezone projection and explicit coverage: { startDateTime, endDateTime, resourceIds, complete: true, requestToken, allMatchingResources: true }, with an optional server revision. Build that projection using createEventSchedulerProjection and the captured schedule settings with all authorized overlapping events, assignments and availability. The adapter must apply the captured native filter/sort contract to its returned rows, including matching resources not yet loaded by the grid. allMatchingResources: true is required for default scope, and requestToken must echo the captured request. Canonical projection/collapse rules are reapplied before adapter row membership/order is accepted, so collapsed child payloads cannot appear in the output. Missing or partial coverage blocks export; no partial-success option exists. Data is never inserted into live stores. Cross-page database consistency is the adapter’s responsibility.
The default preparation timeout is 30 seconds (preparationTimeoutMs overrides it). Changed state during loading retries twice, then returns stale-snapshot. signal cancels preparation/encoding; destroying the Scheduler cancels its exports. Error results include an actionable code/message, including incomplete-data, settle-timeout, invalid-template, asset-unavailable, export-too-large, encoding-failed and aborted.
Images default to 1600 × 1000 CSS-pixel tiles (tileWidth/tileHeight override); PDF uses A4/Letter portrait/landscape with 32 CSS-pixel margins (margin overrides). Resource columns and time headers repeat; dense rows continue across lane slices. Geometry uses 96 CSS pixels/inch; PNG pixel ratio and PDF DPI change resolution, not layout. Export rejects pages too narrow for their resource columns rather than silently dropping columns or shrinking text.
Limits per export: 200 pages/tiles, 250,000 scene nodes, 32 MiB per SVG tile and 128 MiB aggregate artifacts. PNG tiles are limited to 16,384 pixels per side and 64 megapixels after scaling. Encoding is sequential. Reduce the range, selected resources, visible column subset or image quality when a budget is exceeded. Other Scheduler layouts and layout-preserving XLSX export are outside this graphical API.
The PDF runtime (pdfmake, MIT license) is included in the Scheduler bundle. Export itself creates no download, popup or print dialog; applications own those actions and their object URL lifecycle.
A local production-build comparison with the exporter removed from the same source measured the UMD bundle at 1,097,163 → 2,117,568 bytes, or 301,232 → 661,100 bytes with Node gzip defaults: an increase of 359,868 bytes (about 351 KiB gzip). The sum of emitted ESM modules increased by 1,335,364 bytes (385,813 bytes when each module is gzipped separately). These measurements include the PDF runtime and exporter UI; emitted-module totals are not a tree-shaken application’s download size. No PDF font VFS is bundled because these PDF pages contain raster images.
The separate ExportSchedulerPlugin follows the grid exporter convention: register it in grid.plugins, retrieve its instance, and call its export methods. exportBlob(options) provides the Core PDF-style convenience (PDF Blob, null on cancellation, rejection on error). getDocumentDefinition(options) exposes the same raster-page pdfmake definition used by exportPdf() for inspection or customization. The cancelable event-scheduler-before-export event receives the format, captured metadata/options and, for PDF, the document definition. It runs before artifact delivery; call preventDefault() to cancel. No exporter methods or PDF engine are installed on the Scheduler instance or grid element.