@barchart/chart-lib 2.384.3 → 2.385.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chart-lib/barchart.chart.d.ts +60 -1
- chart-lib/barchart.chart.js +23 -23
- chart-lib/package.json +1 -1
chart-lib/barchart.chart.d.ts
CHANGED
|
@@ -1374,6 +1374,63 @@ declare module "@barchart/chart-lib" {
|
|
|
1374
1374
|
};
|
|
1375
1375
|
};
|
|
1376
1376
|
|
|
1377
|
+
export type ExportOptions = {
|
|
1378
|
+
/** Exclude the chart and field header rows from CSV exports. */
|
|
1379
|
+
excludeHeader?: boolean;
|
|
1380
|
+
/** Number of decimal places to use for numeric values in CSV exports. */
|
|
1381
|
+
numDecimals?: number;
|
|
1382
|
+
/** Field ids to omit from exported curve data. */
|
|
1383
|
+
excludeFields?: string[];
|
|
1384
|
+
/** Sort exported data sources before columns are built. */
|
|
1385
|
+
sourceOrder?: (a: ExportSource, b: ExportSource) => number;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
export type ExportSource = {
|
|
1389
|
+
/** Unique id for this exported source. Seasonal and forward runtime sources include their offset. */
|
|
1390
|
+
id: string;
|
|
1391
|
+
/** Stable chart plot uid when available. Multiple runtime sources can share the same plot uid. */
|
|
1392
|
+
plotUid?: string;
|
|
1393
|
+
/** Public plot type name. */
|
|
1394
|
+
plotType: string;
|
|
1395
|
+
/** Public plot title. */
|
|
1396
|
+
plotTitle: string;
|
|
1397
|
+
/** Field ids exported for this source, in column order. */
|
|
1398
|
+
fieldIds: string[];
|
|
1399
|
+
/** Runtime seasonal offset when this source comes from a seasonal plot. */
|
|
1400
|
+
seasonalOffset?: number;
|
|
1401
|
+
/** Pane index in chart order. */
|
|
1402
|
+
paneIndex: number;
|
|
1403
|
+
/** Axis index within the pane. */
|
|
1404
|
+
axisIndex: number;
|
|
1405
|
+
/** Plot index within the axis. */
|
|
1406
|
+
plotIndex: number;
|
|
1407
|
+
/** Whether this source is the main chart plot. */
|
|
1408
|
+
main: boolean;
|
|
1409
|
+
};
|
|
1410
|
+
|
|
1411
|
+
export type ExportColumn = {
|
|
1412
|
+
/** Unique key used for row values. */
|
|
1413
|
+
id: string;
|
|
1414
|
+
/** Human-readable field name. */
|
|
1415
|
+
name: string;
|
|
1416
|
+
/** Chart field id. */
|
|
1417
|
+
fieldId: string;
|
|
1418
|
+
/** Public source metadata for this column. */
|
|
1419
|
+
source: ExportSource;
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
export type ExportCellValue = Date | number | string | boolean | null | undefined;
|
|
1423
|
+
|
|
1424
|
+
export type ExportRow = Record<string, ExportCellValue>;
|
|
1425
|
+
|
|
1426
|
+
export type ExportTable = {
|
|
1427
|
+
columns: ExportColumn[];
|
|
1428
|
+
rows: ExportRow[];
|
|
1429
|
+
dateFormatHint?: string;
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
export function convertTableToCsv(table: ExportTable, options?: ExportOptions): string;
|
|
1433
|
+
|
|
1377
1434
|
export type ExportImageOptions = {
|
|
1378
1435
|
/** Override the width of the exported image (pixels). By default exports the chart's width as-is currently on the screen. */
|
|
1379
1436
|
width?: number;
|
|
@@ -2093,7 +2150,9 @@ declare module "@barchart/chart-lib" {
|
|
|
2093
2150
|
/** Set the title for the chart. Not used often. Is ephemeral - does not get saved with the chart. */
|
|
2094
2151
|
setTitle(titleOptions: TitleOptions): void;
|
|
2095
2152
|
/** Exports all the data currently loaded in the chart as a CSV. Best viewed as a spreadsheet in, say, Microsoft Excel. */
|
|
2096
|
-
exportData(): string;
|
|
2153
|
+
exportData(options?: ExportOptions): string;
|
|
2154
|
+
/** Exports all the data currently loaded in the chart as a structured table. */
|
|
2155
|
+
exportTable(options?: ExportOptions): ExportTable;
|
|
2097
2156
|
/** Export the currently visible portion of the chart into a PNG image. */
|
|
2098
2157
|
exportImage(options: ExportImageOptions): ExportedImage | null;
|
|
2099
2158
|
/** Prints the chart, optionally adding a title (for the print-out only, reverts back to no title when the printing is over). */
|