@sheetxl/sdk 0.8.0-beta.16 → 0.8.0-beta.18
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.
- package/browser/esm/{B6BdiHigbUdbZp3J.mjs → -P0fym6eh9hn9row.mjs} +2 -2
- package/browser/esm/{DlVnybrgwZWxWN3_.mjs → -nOfWMHdlTb9ShjF.mjs} +9 -9
- package/browser/esm/{CMChv-fCFh68VQQt.mjs → 0Mw5Ew_7tAiWgc5J.mjs} +14 -14
- package/browser/esm/{JV9Szh5qTssjxJoE.mjs → 1ktaHvjuYL6stU4C.mjs} +1 -1
- package/browser/esm/{HV0FkJ6k3Ils318J.mjs → B3ifnlsuky2L9HmB.mjs} +33 -33
- package/browser/esm/{BtNuoQIrrHw_jnbJ.mjs → B67q5ZrwyKvm3d6W.mjs} +3 -3
- package/browser/esm/{KpuD1kEcWB7cT0VM.mjs → BQSd_URWugiyNoNj.mjs} +2 -2
- package/browser/esm/{ad9PX897hYE4Srkc.mjs → BWHHWC6H2JgG11Kq.mjs} +2 -2
- package/browser/esm/{BlMYYQZP-QM-iBHz.mjs → BYbb2weYQCb_7KI3.mjs} +21 -21
- package/browser/esm/{WLlpmgLN5OVLoLrC.mjs → B_hrmyuWaH5VIFpV.mjs} +2 -2
- package/browser/esm/{d_t-7d5BD1AdHg3u.mjs → Bql31KGUYo0SCMwZ.mjs} +392 -392
- package/browser/esm/{D807piM0VSokWz-L.mjs → BtVpErObXYKJCwHG.mjs} +1 -1
- package/browser/esm/{BWY1qiidTUBVPJoD.mjs → By7_c19Kv2YQaDVF.mjs} +475 -475
- package/browser/esm/{Zp5-cTJ0Llb6EfGi.mjs → C6M_XM08QtHuaInQ.mjs} +3 -3
- package/browser/esm/{BxYuRTSF9ykc-Tpz.mjs → CBHwju4PYiv85_jD.mjs} +2 -2
- package/browser/esm/{D-iHJ3q4nwOLcn1D.mjs → CJhYhZtsey3OnWKd.mjs} +1 -1
- package/browser/esm/{Dx9Fya60meMpuHqm.mjs → CQlxAbhdxgfu0ERF.mjs} +1 -1
- package/browser/esm/{C3JOjQwdG9kAig7i.mjs → CVXOtvee4oFImGyR.mjs} +504 -504
- package/browser/esm/{9YWdxmSjzLN4j_ts.mjs → CXQLYHAhE5MLKxZ4.mjs} +37 -37
- package/browser/esm/{CUu3zeHqcwMRYiov.mjs → CZiJYw94Yt7xslXS.mjs} +1 -1
- package/browser/esm/{BxFzcCYhvo9NXFjC.mjs → ChRUNekYurtOtrP1.mjs} +113 -113
- package/browser/esm/{dwGdnbV-CykjNrlm.mjs → CnobgPLHEsTPTFY5.mjs} +1 -1
- package/browser/esm/{WR146UAqrsUsL39e.mjs → CxNnMvwtOf76r7yY.mjs} +1 -1
- package/browser/esm/{U4FL-QeC0bRUhTEo.mjs → CzmmdfrOYDUGx-Yh.mjs} +1 -1
- package/browser/esm/{4MbBwfmW2hDXk9_w.mjs → D2P43UD6TGSXErhr.mjs} +2 -2
- package/browser/esm/{Bf80epSsm_RyAOb9.mjs → DH8NuKmZAC9EaqwP.mjs} +18 -18
- package/browser/esm/{WcHfawW2lkTHtWUd.mjs → DJuiV0Y8olnwuqB-.mjs} +21 -21
- package/browser/esm/{DcB52JPBPmkc3l1m.mjs → DKFaQ2QOyUPCk0sD.mjs} +3 -3
- package/browser/esm/{CRbQATfI0yZxe1kX.mjs → DLR8g1DkooIBl8S1.mjs} +2 -2
- package/browser/esm/{BF_QwkZ_hs2rFoTT.mjs → DNAXbbB8DGE2xeHy.mjs} +2 -2
- package/browser/esm/{BMo2_9Ul36IwRm3S.mjs → DQTUUXcERWI4l0to.mjs} +2 -2
- package/browser/esm/{C2PvZwqK-uvsugVS.mjs → DpFowFtk9AeU-89B.mjs} +1 -1
- package/browser/esm/{r-o0UCm7KtluNmyK.mjs → DyRVg5YJn7voOO6z.mjs} +2 -2
- package/browser/esm/{DW3oQ39IF0bsc_lm.mjs → Pn5Jc-47dk16sYQ4.mjs} +1 -1
- package/browser/esm/{BfoE6Dn_GQCIkQD3.mjs → _WWjW2f-YW-AVqAL.mjs} +1 -1
- package/browser/esm/{CkZoDPUCK5jMUaeJ.mjs → _lh_Rr5SwLthmbmu.mjs} +7924 -5938
- package/browser/esm/index.mjs +367 -366
- package/browser/esm/{DvVhatd0J1ch3OCO.mjs → mecFApGwMvcIzlpd.mjs} +36 -36
- package/browser/esm/{BqT-ASHP0NVSUUnY.mjs → n4LOSiYtWTzqQa4w.mjs} +661 -661
- package/{node/esm/CgdNA3B_GFG_yJiN.mjs → browser/esm/tJB0V8fKbukOYt9U.mjs} +2 -2
- package/browser/esm/{C5x0EzqElYGTiTQc.mjs → yRhetuEQfV7moa4B.mjs} +1 -1
- package/browser/esm/{e69NcYnKMLnAmqyA.mjs → ybFoQ6IijUJnBeCF.mjs} +1 -1
- package/node/esm/{BywIhvYkWk2o7MSW.mjs → 0313aQKBU4DE3v2j.mjs} +1 -1
- package/node/esm/{C884edhUf9yMqpPp.mjs → 3gjEEXV2aSt7cKeD.mjs} +1 -1
- package/node/esm/{BfPBiAgVmWhuFgFP.mjs → 3smtwEJ0ASF0tKBY.mjs} +2 -2
- package/node/esm/{_RIAmJI98l6bIFfZ.mjs → 4k3KKByrUw2Wr2TX.mjs} +1 -1
- package/node/esm/{Bknw7zWZhl2-w1pi.mjs → 90jp-mCVEr43zZTj.mjs} +2 -2
- package/node/esm/{DfWc3nW_Z_qqc_Wf.mjs → BAEmzj0gb8Cbgz7p.mjs} +3293 -3293
- package/node/esm/{CERNLhFrAwtu_p-q.mjs → BBC5dL9bXzOrQDGY.mjs} +1 -1
- package/node/esm/{CDHY-0OyQ9348Brb.mjs → BV0cJ_YP_0qzJuPt.mjs} +180 -180
- package/node/esm/{DvtyKKzOnoOM80NB.mjs → BcxcYoF_4GFL7Zkl.mjs} +15 -15
- package/node/esm/{DOt3t-13tsnM7Fj6.mjs → BesaVk0x7UyfLDk2.mjs} +1 -1
- package/node/esm/{Dhv9JymnXqcF54oo.mjs → C-LmDC9oNcbENOK1.mjs} +1 -1
- package/node/esm/{BvIPsPiHhMclZ1kH.mjs → CDkUQn5AwYGomlsT.mjs} +36 -36
- package/node/esm/{BH8J6vKSO5zI_TWo.mjs → CE4I5qfVmUBf7mED.mjs} +1 -1
- package/node/esm/{C_fYuynP2a_70WdL.mjs → CO0UDgbkHGwyTfev.mjs} +1 -1
- package/node/esm/{DgnwKbUEyQN5_gWT.mjs → CTWihjVB5uFX7U4j.mjs} +2 -2
- package/node/esm/{Cxak8i2NidZ4Uv6v.mjs → CUNaLYCntlclipWu.mjs} +497 -497
- package/node/esm/{RTwm9ge1KoPdlBNt.mjs → CY9JqXFJTt5pGhC3.mjs} +1 -1
- package/node/esm/{DELfV5HQZo1mInBd.mjs → C_Sqy290v4uzyi1E.mjs} +3 -3
- package/node/esm/{BLmdKnkLwkb3wWe6.mjs → Cf-cK3yPe9bjK6o2.mjs} +561 -561
- package/node/esm/{CVPieTgKCwkL21nD.mjs → CpvUwhAeDmdEpdR-.mjs} +10662 -8680
- package/{browser/esm/C_jLGkFemj55_BP3.mjs → node/esm/Crhg3srH-O5sJERh.mjs} +2 -2
- package/node/esm/{CJDV8P3hI8lu--3Z.mjs → Cx2U91jhiTDz600y.mjs} +116 -116
- package/node/esm/{BZSxu_ZqX8-Uczzn.mjs → CyWWKan_uk4dHZ6P.mjs} +1 -1
- package/node/esm/{CLtUMJfKsy4SevWE.mjs → D48MjKzkj37XsVm1.mjs} +2 -2
- package/node/esm/{kaiXmn0AA5WDsLPo.mjs → D7c0zfLVoG7EEln5.mjs} +43 -43
- package/node/esm/{A3PEHO1HJvkHfb5n.mjs → D8J4JmOPwG_Yr2GD.mjs} +1 -1
- package/node/esm/{By2TFKOjA1HekZap.mjs → D91qb21TrJX98Rw8.mjs} +3 -3
- package/node/esm/{D88A3UpCyGRjcX3U.mjs → D9D2NyyKbWXpTj5I.mjs} +2 -2
- package/node/esm/{mTIhoz1gEcaEm7s1.mjs → DBF7pIpitcmhi65H.mjs} +2 -2
- package/node/esm/{KDGrIa9R5XzWfjM2.mjs → DLPVrV723TSxkXqL.mjs} +1 -1
- package/node/esm/{Cs3ibv6YHCDwLRlk.mjs → DWsnb-a-9dfRn5jJ.mjs} +24 -24
- package/node/esm/{B4WUGzJBkQu7BXRm.mjs → Dj1pybJRqeZiP1Z6.mjs} +1 -1
- package/node/esm/{DBIUe2BC9xU7qMHR.mjs → DtNJOImWtsXVrQps.mjs} +2 -2
- package/node/esm/{5OfKfTRX2_y2NwpU.mjs → DxROQlX1KHLb9tHS.mjs} +1 -1
- package/node/esm/{446KYBjJQa8g-8Gg.mjs → dp4LxzOEkfTbVX_1.mjs} +21 -21
- package/node/esm/{C3zyhnMwQ2hRQBz7.mjs → ee_DgHTffiVTOiU2.mjs} +21 -21
- package/node/esm/{CFkX_Cn6avQqQiVC.mjs → fMFapG4AGMQKX8c5.mjs} +33 -33
- package/node/esm/index.mjs +545 -544
- package/node/esm/{CKwiipdPJGzAiPjg.mjs → jmElgIMAkpc2Ab1m.mjs} +1 -1
- package/node/esm/{bIGdvfpnijWeCac6.mjs → yVJ2lEYZob1gwiRZ.mjs} +14 -14
- package/package.json +6 -6
- package/resources/locales/de/model.msg.json +15 -0
- package/resources/locales/en/model.msg.json +15 -0
- package/types/scripting-api.json +11445 -11299
- package/types/scripting-enums.json +22 -1
- package/types/scripting.d.ts +623 -0
- package/types/src/address/index.d.ts +2 -0
- package/types/src/anomalies/_Anomalies.d.ts +34 -0
- package/types/src/anomalies/_CompletenessChecks.d.ts +32 -0
- package/types/src/cell/ICell.d.ts +36 -1
- package/types/src/cellRange/ICellRange.d.ts +106 -0
- package/types/src/index.d.ts +1 -0
- package/types/src/license/runtime.browser.d.ts +3 -1
- package/types/src/sheet/IWorksheet.d.ts +17 -0
- package/types/src/sheet/SheetCell.d.ts +3 -0
- package/types/src/sheet/SheetRange.d.ts +6 -0
- package/types/src/sheet/Worksheet.d.ts +103 -1
- package/types/src/sheet/_ListenerAnchor.d.ts +14 -0
- package/types/src/sheet/_SheetStateTypes.d.ts +13 -0
- package/types/src/sparkline/ISparklineGroup.d.ts +338 -0
- package/types/src/sparkline/ISparklineGroupCollection.d.ts +68 -0
- package/types/src/sparkline/SparklineGroup.d.ts +271 -0
- package/types/src/sparkline/SparklineGroupCollection.d.ts +25 -0
- package/types/src/sparkline/SparklineRanges.d.ts +195 -0
- package/types/src/sparkline/index.d.ts +4 -0
- package/types/src/sparkline/layout/SparklineLayout.d.ts +71 -0
- package/types/src/sparkline/layout/_layoutSparkline.d.ts +42 -0
- package/types/src/sparkline/layout/index.d.ts +2 -0
|
@@ -4,6 +4,7 @@ import { IListener } from '../listener';
|
|
|
4
4
|
import { IAnchored } from '../anchored/IAnchored';
|
|
5
5
|
import { Anchored } from '../anchored/Anchored';
|
|
6
6
|
import { ICellRange, ICellRanges } from '../cellRange';
|
|
7
|
+
import { IWorksheet } from './IWorksheet';
|
|
7
8
|
/**
|
|
8
9
|
* The reference a range listener watches, as an entry in a versioned anchored map.
|
|
9
10
|
*
|
|
@@ -44,6 +45,19 @@ export declare class ListenerAnchor implements IAnchored {
|
|
|
44
45
|
/**
|
|
45
46
|
* What the listener asked for when it registered.
|
|
46
47
|
*/
|
|
48
|
+
/** The edits since the last `'address'` delivery, for a listener that asked for them. */
|
|
49
|
+
protected _edits: ICellRange.Edit[];
|
|
50
|
+
/**
|
|
51
|
+
* Told of each band of a structural edit that reaches the node, before the map moves it; kept
|
|
52
|
+
* for a listener that asked for the edits ({@link ICellRange.ListenerOptions.edits}).
|
|
53
|
+
*/
|
|
54
|
+
noteShift(details: ISpatialMap.ShiftDetails): void;
|
|
55
|
+
/** Told of a cut that takes some or all of the node's cells; `toSheet` when it went to another sheet. */
|
|
56
|
+
noteMove(from: IRange.Coords, to: IRange.Coords, toSheet?: IWorksheet): void;
|
|
57
|
+
/** Whether edits wait to be delivered, so a cut that left the reference where it was is told. */
|
|
58
|
+
hasEdits(): boolean;
|
|
59
|
+
/** The edits waiting, handed over once. */
|
|
60
|
+
takeEdits(): readonly ICellRange.Edit[];
|
|
47
61
|
getListenerOptions(): ICellRange.ListenerOptions;
|
|
48
62
|
/** {@inheritDoc IAnchored.getRanges} */
|
|
49
63
|
getRanges(): ICellRanges;
|
|
@@ -14,6 +14,7 @@ import { IConditionalFormat } from '../conditionalFormat';
|
|
|
14
14
|
import { IDataValidation } from '../dataValidation';
|
|
15
15
|
import { IProtectedRange } from '../protectedRange';
|
|
16
16
|
import { ICellControl } from '../cellControl';
|
|
17
|
+
import { ISparklineGroup } from '../sparkline';
|
|
17
18
|
import { IPivotTable } from '../pivot';
|
|
18
19
|
import { ICell } from '../cell';
|
|
19
20
|
import { IgnoredErrors } from './_IgnoredErrors';
|
|
@@ -165,6 +166,10 @@ export declare namespace RangeState {
|
|
|
165
166
|
* first wins (`ICell.getControl`).
|
|
166
167
|
*/
|
|
167
168
|
cellControls?: ICellControl | ICellControl[];
|
|
169
|
+
/**
|
|
170
|
+
* The cell's sparkline group. A cell has at most one sparkline.
|
|
171
|
+
*/
|
|
172
|
+
sparklineGroups?: ISparklineGroup | ISparklineGroup[];
|
|
168
173
|
/**
|
|
169
174
|
* The per-feature direct styles for a collection of cells (SHEET-STYLE-SPLIT). These are the
|
|
170
175
|
* user-authored style, kept DISCRETE — `borderStyle` carries `borders`, `fillStyle` carries `fill`,
|
|
@@ -296,6 +301,7 @@ export declare namespace RangeState {
|
|
|
296
301
|
readonly Contentful: "contentful";
|
|
297
302
|
readonly Conditionals: "conditionals";
|
|
298
303
|
readonly CellControls: "cellControls";
|
|
304
|
+
readonly Sparklines: "sparklineGroups";
|
|
299
305
|
/**
|
|
300
306
|
* Has a formula
|
|
301
307
|
*/
|
|
@@ -480,6 +486,13 @@ export interface State {
|
|
|
480
486
|
* Read through `RangeState.Type.CellControls` — see {@link RangeState.Intersection.cellControls}.
|
|
481
487
|
*/
|
|
482
488
|
cellControls: IAnchoredMap<ICellControl, ICellControl.JSON>;
|
|
489
|
+
/**
|
|
490
|
+
* The sparkline groups.
|
|
491
|
+
*
|
|
492
|
+
* @remarks
|
|
493
|
+
* Read through `RangeState.Type.Sparklines` — see {@link RangeState.Intersection.sparklineGroups}.
|
|
494
|
+
*/
|
|
495
|
+
sparklineGroups: IAnchoredMap<ISparklineGroup, ISparklineGroup.JSON>;
|
|
483
496
|
/**
|
|
484
497
|
* The reference each range listener watches.
|
|
485
498
|
*
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { Size } from '@sheetxl/utils';
|
|
2
|
+
import { ITransaction } from '../transaction';
|
|
3
|
+
import { IAnchored } from '../anchored';
|
|
4
|
+
import { ICellRange, ICellRanges } from '../cellRange';
|
|
5
|
+
import { IColor } from '../color';
|
|
6
|
+
import { IListener } from '../listener';
|
|
7
|
+
import { SparklineLayout } from './layout';
|
|
8
|
+
/**
|
|
9
|
+
* A group of sparklines drawn with the same properties: Excel's sparkline group.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* A sparkline is a small chart drawn in a cell, over the cell's own value. A group shares one
|
|
13
|
+
* type, one set of colors and markers, and one axis rule (`'group'` scales its sparklines
|
|
14
|
+
* together). It is anchored to its sparklines' cells, and moves and shrinks with them as rows and
|
|
15
|
+
* columns are inserted and deleted; each sparkline's data follows its own cells the way a formula
|
|
16
|
+
* does.
|
|
17
|
+
*
|
|
18
|
+
* * A cell has at most one sparkline.
|
|
19
|
+
* * The data is kept per range, relative to each cell: a column of 10,000 sparklines each reading
|
|
20
|
+
* the five cells to its left is one range, and {@link getSparklines} answers each cell's own data.
|
|
21
|
+
*/
|
|
22
|
+
export interface ISparklineGroup extends IAnchored {
|
|
23
|
+
/**
|
|
24
|
+
* The kind of chart the group draws.
|
|
25
|
+
*/
|
|
26
|
+
getType(): ISparklineGroup.Type;
|
|
27
|
+
/**
|
|
28
|
+
* The properties every sparkline of the group draws with. Absent properties are their defaults.
|
|
29
|
+
*/
|
|
30
|
+
getProperties(): Readonly<ISparklineGroup.Properties>;
|
|
31
|
+
/**
|
|
32
|
+
* The first range the group covers.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* See {@link IAnchored.getRanges} for all of them.
|
|
36
|
+
*/
|
|
37
|
+
getRange(): ICellRange;
|
|
38
|
+
/**
|
|
39
|
+
* One sparkline per cell, in the order of the group's ranges.
|
|
40
|
+
*/
|
|
41
|
+
getSparklines(): readonly ISparklineGroup.ISparkline[];
|
|
42
|
+
/**
|
|
43
|
+
* The sparkline at `index` in {@link getSparklines}, or `null` past the end.
|
|
44
|
+
*/
|
|
45
|
+
getSparklineAt(index: number): ISparklineGroup.ISparkline | null;
|
|
46
|
+
/**
|
|
47
|
+
* The sparkline in `cell`, or `null` when the group has none there.
|
|
48
|
+
*/
|
|
49
|
+
getSparkline(cell: ICellRange.Address): ISparklineGroup.ISparkline | null;
|
|
50
|
+
/**
|
|
51
|
+
* Changes the properties every sparkline of the group draws with.
|
|
52
|
+
*
|
|
53
|
+
* @param properties The properties to change; a property left out is left as it is, and `null`
|
|
54
|
+
* returns one to its default.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Excel's Sparkline tab edits a group this way: a type, a color or a marker is the group's, never
|
|
58
|
+
* one sparkline's. Refused on a protected sheet unless formatting cells is allowed.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* group.update({ type: 'column', high: true, colorHigh: 'accent2' });
|
|
63
|
+
* group.update({ colorHigh: null }); // back to the default
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
update(properties: ISparklineGroup.Modifiers, options?: ITransaction.OperationOptions): this;
|
|
67
|
+
/**
|
|
68
|
+
* The cells the first range's sparklines draw.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* See {@link getDataRanges} for all of them.
|
|
72
|
+
*/
|
|
73
|
+
getDataRange(): ICellRange;
|
|
74
|
+
/**
|
|
75
|
+
* The cells each range's sparklines draw, paired by position with {@link IAnchored.getRanges}:
|
|
76
|
+
* the cells they read together (`A2:E4` for `F2:F4` reading a row each), as Excel's Edit
|
|
77
|
+
* Sparklines dialog shows them.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* * **Never `null` entries.** Data whose cells are deleted is an *invalid* range; ask
|
|
81
|
+
* {@link ICellRange.isInvalid}.
|
|
82
|
+
* * Each range is on its own sheet: one may read this sheet and another a different one.
|
|
83
|
+
* * {@link setDataRanges} and {@link setRanges} take this list back.
|
|
84
|
+
*/
|
|
85
|
+
getDataRanges(): readonly ICellRange[];
|
|
86
|
+
/**
|
|
87
|
+
* Gives the group's cells new data, as Excel's `ModifySourceData` does.
|
|
88
|
+
*
|
|
89
|
+
* @param data The cells to draw, paired with the group's cells as {@link setRanges} pairs them.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* The group keeps its cells and properties. Refused, and the group left as it was, when the data
|
|
93
|
+
* does not pair with its cells.
|
|
94
|
+
*/
|
|
95
|
+
setDataRanges(data: ICellRanges.Address, options?: ITransaction.OperationOptions): this;
|
|
96
|
+
/**
|
|
97
|
+
* Moves the group's sparklines to new cells, and optionally gives them new data, as Excel's Edit
|
|
98
|
+
* Sparklines dialog does (`ModifyLocation`, `Modify`).
|
|
99
|
+
*
|
|
100
|
+
* @param address The cells to draw in: one or more areas, each a cell, a row or a column of cells.
|
|
101
|
+
* @param data The cells to draw. Left out, the group's own data ({@link getDataRanges}) is paired
|
|
102
|
+
* with the new cells. Give both to change both at once: growing `F2:F4` reading `A2:E4` to `F2:F5`
|
|
103
|
+
* reading `A2:E5` pairs as one change and as neither change alone.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* The location's cells are taken in order, and the data pairs with them in one of three ways:
|
|
107
|
+
*
|
|
108
|
+
* * **One data area** goes to all of them together, as {@link ICellRange.setSparkline} pairs it:
|
|
109
|
+
* `F2:F3,G5` with `A2:E4` reads a row each.
|
|
110
|
+
* * **One data area per location area**: `F2:F4,H6` with `A2:E4,A6:E6`.
|
|
111
|
+
* * **One data area per cell**: `F2:F4` with `A2:E2,A9:E9,A4:E4`.
|
|
112
|
+
*
|
|
113
|
+
* The group keeps its properties. A cell has one sparkline, so the new cells leave any other
|
|
114
|
+
* group they were in. Refused, and the group left as it was, when the data does not pair with the
|
|
115
|
+
* cells; refused on a protected sheet unless formatting cells is allowed.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* group.setRanges('H2:H4'); // the same data, drawn in H2:H4
|
|
120
|
+
* group.setRanges('F2:F5', 'A2:E5'); // one more sparkline
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
setRanges(address: ICellRanges.Address, data?: ICellRanges.Address | null, options?: ITransaction.OperationOptions): this;
|
|
124
|
+
/**
|
|
125
|
+
* Add Listeners.
|
|
126
|
+
*
|
|
127
|
+
* @see
|
|
128
|
+
* {@link IListener.ISource.addListeners}
|
|
129
|
+
*/
|
|
130
|
+
addListeners(listeners: ISparklineGroup.IListeners, options?: IListener.Options): IListener.Remove;
|
|
131
|
+
/**
|
|
132
|
+
* The group as JSON: its properties and the data of each of its ranges, in order.
|
|
133
|
+
*/
|
|
134
|
+
toJSON(): ISparklineGroup.JSON;
|
|
135
|
+
/**
|
|
136
|
+
* For runtime type checking.
|
|
137
|
+
*/
|
|
138
|
+
readonly isISparklineGroup: true;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* {@inheritDoc ISparklineGroup}
|
|
142
|
+
* @see
|
|
143
|
+
* ### **Interface**
|
|
144
|
+
*
|
|
145
|
+
* {@link ISparklineGroup}
|
|
146
|
+
*
|
|
147
|
+
* **Additional Interfaces**
|
|
148
|
+
* * {@link ISparklineGroup.ISparkline}
|
|
149
|
+
* * {@link ISparklineGroupCollection}
|
|
150
|
+
*/
|
|
151
|
+
export declare namespace ISparklineGroup {
|
|
152
|
+
/**
|
|
153
|
+
* The kind of chart a group draws.
|
|
154
|
+
*/
|
|
155
|
+
const Type: {
|
|
156
|
+
/** A line through the points. */
|
|
157
|
+
readonly Line: "line";
|
|
158
|
+
/** A column per point. */
|
|
159
|
+
readonly Column: "column";
|
|
160
|
+
/** A column up for a positive point and down for a negative one, all the same height. Excel's file calls it `stacked`. */
|
|
161
|
+
readonly WinLoss: "winLoss";
|
|
162
|
+
};
|
|
163
|
+
type Type = typeof Type[keyof typeof Type];
|
|
164
|
+
/**
|
|
165
|
+
* How the minimum or maximum of the vertical axis is chosen.
|
|
166
|
+
*/
|
|
167
|
+
const AxisType: {
|
|
168
|
+
/** Each sparkline's own data. */
|
|
169
|
+
readonly Individual: "individual";
|
|
170
|
+
/** The data of every sparkline in the group, so they scale together. */
|
|
171
|
+
readonly Group: "group";
|
|
172
|
+
/** The value in `manualMin` or `manualMax`. */
|
|
173
|
+
readonly Custom: "custom";
|
|
174
|
+
};
|
|
175
|
+
type AxisType = typeof AxisType[keyof typeof AxisType];
|
|
176
|
+
/**
|
|
177
|
+
* How an empty cell in the data draws.
|
|
178
|
+
*/
|
|
179
|
+
const EmptyCellsAs: {
|
|
180
|
+
/** A gap in the line. */
|
|
181
|
+
readonly Gap: "gap";
|
|
182
|
+
/** A zero. */
|
|
183
|
+
readonly Zero: "zero";
|
|
184
|
+
/** A line straight across to the next point. */
|
|
185
|
+
readonly Span: "span";
|
|
186
|
+
};
|
|
187
|
+
type EmptyCellsAs = typeof EmptyCellsAs[keyof typeof EmptyCellsAs];
|
|
188
|
+
/**
|
|
189
|
+
* What a group draws with. Every property is optional; an absent one is its default.
|
|
190
|
+
*
|
|
191
|
+
* @remarks
|
|
192
|
+
* The names are the file's (`CT_SparklineGroup`). Colors are color strings, theme-aware as the
|
|
193
|
+
* file is (`accent1 tint 0.4`).
|
|
194
|
+
*/
|
|
195
|
+
interface Properties {
|
|
196
|
+
/** @defaultValue `'line'` */
|
|
197
|
+
type?: Type;
|
|
198
|
+
/** The line's weight in points. @defaultValue `0.75` */
|
|
199
|
+
lineWeight?: number;
|
|
200
|
+
/** @defaultValue `'zero'` */
|
|
201
|
+
displayEmptyCellsAs?: EmptyCellsAs;
|
|
202
|
+
/** A marker on every point of a line. @defaultValue `false` */
|
|
203
|
+
markers?: boolean;
|
|
204
|
+
/** The highest point in `colorHigh`. @defaultValue `false` */
|
|
205
|
+
high?: boolean;
|
|
206
|
+
/** The lowest point in `colorLow`. @defaultValue `false` */
|
|
207
|
+
low?: boolean;
|
|
208
|
+
/** The first point in `colorFirst`. @defaultValue `false` */
|
|
209
|
+
first?: boolean;
|
|
210
|
+
/** The last point in `colorLast`. @defaultValue `false` */
|
|
211
|
+
last?: boolean;
|
|
212
|
+
/** Negative points in `colorNegative`. @defaultValue `false` */
|
|
213
|
+
negative?: boolean;
|
|
214
|
+
/** A horizontal axis at zero, when zero is within the vertical range. @defaultValue `false` */
|
|
215
|
+
displayXAxis?: boolean;
|
|
216
|
+
/** Draw the values of hidden rows and columns. @defaultValue `false` */
|
|
217
|
+
displayHidden?: boolean;
|
|
218
|
+
/** Draw from right to left. @defaultValue `false` */
|
|
219
|
+
rightToLeft?: boolean;
|
|
220
|
+
/** @defaultValue `'individual'` */
|
|
221
|
+
minAxisType?: AxisType;
|
|
222
|
+
/** @defaultValue `'individual'` */
|
|
223
|
+
maxAxisType?: AxisType;
|
|
224
|
+
/** The minimum, when `minAxisType` is `'custom'`. */
|
|
225
|
+
manualMin?: number;
|
|
226
|
+
/** The maximum, when `maxAxisType` is `'custom'`. */
|
|
227
|
+
manualMax?: number;
|
|
228
|
+
/** Space the points by the dates in `dateRange`. @defaultValue `false` */
|
|
229
|
+
dateAxis?: boolean;
|
|
230
|
+
/** The cells holding the date of each point, as a formula; read when `dateAxis` is on. */
|
|
231
|
+
dateRange?: string;
|
|
232
|
+
colorSeries?: string;
|
|
233
|
+
colorNegative?: string;
|
|
234
|
+
colorAxis?: string;
|
|
235
|
+
colorMarkers?: string;
|
|
236
|
+
colorFirst?: string;
|
|
237
|
+
colorLast?: string;
|
|
238
|
+
colorHigh?: string;
|
|
239
|
+
colorLow?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Attributes a file gave the group that are not modeled here, kept so a resave writes them back.
|
|
242
|
+
*/
|
|
243
|
+
rest?: Record<string, string>;
|
|
244
|
+
}
|
|
245
|
+
/** The properties that are colors. */
|
|
246
|
+
type ColorKey = 'colorSeries' | 'colorNegative' | 'colorAxis' | 'colorMarkers' | 'colorFirst' | 'colorLast' | 'colorHigh' | 'colorLow';
|
|
247
|
+
/**
|
|
248
|
+
* What {@link ISparklineGroup.update} and a new group take: any of the {@link Properties}, a
|
|
249
|
+
* color as an {@link IColor} or a color string, and `null` to return a property to its default.
|
|
250
|
+
*/
|
|
251
|
+
type Modifiers = {
|
|
252
|
+
[K in Exclude<keyof Properties, ColorKey | 'rest'>]?: Properties[K] | null;
|
|
253
|
+
} & {
|
|
254
|
+
[K in ColorKey]?: IColor | string | null;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* A sparkline: one cell's view of its group.
|
|
258
|
+
*
|
|
259
|
+
* @remarks
|
|
260
|
+
* Transient and read-only, as `ITable.IColumn` is: it answers for the group as the group is when
|
|
261
|
+
* asked, and changes go through the group.
|
|
262
|
+
*/
|
|
263
|
+
interface ISparkline {
|
|
264
|
+
/**
|
|
265
|
+
* The cell the sparkline draws in.
|
|
266
|
+
*/
|
|
267
|
+
getRange(): ICellRange;
|
|
268
|
+
/**
|
|
269
|
+
* The cells the sparkline draws.
|
|
270
|
+
*
|
|
271
|
+
* @remarks
|
|
272
|
+
* * **Never `null`.** Once its cells are deleted it is an *invalid* range; ask
|
|
273
|
+
* {@link ICellRange.isInvalid}.
|
|
274
|
+
* * The data follows its cells as a formula does, so this answers where they are now.
|
|
275
|
+
*/
|
|
276
|
+
getDataRange(): ICellRange;
|
|
277
|
+
/**
|
|
278
|
+
* The sparkline laid out in a box: its line or columns, markers and axis, in px, with every
|
|
279
|
+
* color concrete. What a painter draws.
|
|
280
|
+
*
|
|
281
|
+
* @param size The box in px, unzoomed: the cell's.
|
|
282
|
+
*
|
|
283
|
+
* @remarks
|
|
284
|
+
* Read from its data now: the hidden rows and columns left out unless the group shows them,
|
|
285
|
+
* text and errors as empty cells. An axis whose type is `'group'` reads the data of the whole
|
|
286
|
+
* group.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* const layout = sheet.getSparklineGroups().getItems()[0].getSparklineAt(0)!.getLayout({ width: 64, height: 20 });
|
|
291
|
+
* console.log(layout.min, layout.max, layout.line?.runs.length);
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
getLayout(size: Size): SparklineLayout;
|
|
295
|
+
/**
|
|
296
|
+
* The group whose properties the sparkline draws with.
|
|
297
|
+
*/
|
|
298
|
+
getGroup(): ISparklineGroup;
|
|
299
|
+
/**
|
|
300
|
+
* For runtime type checking.
|
|
301
|
+
*/
|
|
302
|
+
readonly isISparkline: true;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* A group as JSON.
|
|
306
|
+
*/
|
|
307
|
+
interface JSON extends Properties {
|
|
308
|
+
/**
|
|
309
|
+
* The data, as a list of areas paired by position with the group's ranges: each the data the
|
|
310
|
+
* range's first cell draws (`A2:E2,A9:E9` for `F2:F4,G3`).
|
|
311
|
+
*
|
|
312
|
+
* @remarks
|
|
313
|
+
* Every other cell of a range draws the same area moved by its offset from the first cell, as a
|
|
314
|
+
* conditional format's formula is written for the first cell of its range: in `F2:F4` reading
|
|
315
|
+
* `A2:E2`, F3 draws `A3:E3`. An area on the group's own sheet is written without a sheet name.
|
|
316
|
+
* An empty area is a range with no data, which draws nothing (`F2:F4,G5` with `A2:E2,`).
|
|
317
|
+
*/
|
|
318
|
+
data: string;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* IListener for {@link ISparklineGroup} events.
|
|
322
|
+
*/
|
|
323
|
+
interface Events extends IAnchored.Events<ISparklineGroup> {
|
|
324
|
+
/**
|
|
325
|
+
* Called when what {@link ISparklineGroup.ISparkline.getLayout} returns may have changed for any
|
|
326
|
+
* sparkline of the group: the group changed, a cell it reads changed (its value, or whether its
|
|
327
|
+
* row or column is hidden), or its theme changed. Call `getLayout` again to see the new layout.
|
|
328
|
+
*
|
|
329
|
+
* @remarks
|
|
330
|
+
* Cell changes are announced once per commit, after every cell of it has landed, so a
|
|
331
|
+
* `getLayout` from the listener reads the new values.
|
|
332
|
+
*/
|
|
333
|
+
onLayoutChange?(source: ISparklineGroup): void;
|
|
334
|
+
}
|
|
335
|
+
interface IListeners extends IListener.Callbacks<ISparklineGroup, ISparklineGroup.Events> {
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=ISparklineGroup.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ICellRange, ICellRanges } from '../cellRange';
|
|
2
|
+
import { ICollection } from '../type';
|
|
3
|
+
import { ITransaction } from '../transaction';
|
|
4
|
+
import { ISparklineGroup } from './ISparklineGroup';
|
|
5
|
+
/**
|
|
6
|
+
* Holds a sheet's {@link ISparklineGroup}s.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Most code reaches sparklines through the range instead: {@link ICellRange.setSparkline} puts them
|
|
10
|
+
* on cells. The collection is for listing every group, and for adding one at an address.
|
|
11
|
+
*/
|
|
12
|
+
export interface ISparklineGroupCollection extends ICollection<ISparklineGroup> {
|
|
13
|
+
/**
|
|
14
|
+
* Adds a group of sparklines in the cells of `location`, each drawing its share of `data`, and
|
|
15
|
+
* returns it.
|
|
16
|
+
*
|
|
17
|
+
* @param location The cells the sparklines draw in: one row or one column of cells, or one cell.
|
|
18
|
+
* @param data The cells they draw. See {@link ICellRange.setSparkline} for how they pair.
|
|
19
|
+
* @param properties How they draw. A new group starts as Excel's does: empty cells as gaps,
|
|
20
|
+
* Excel's colors, and negative points colored for win/loss.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* The same write as {@link ICellRange.setSparkline}. A cell has one sparkline, so the cells leave
|
|
24
|
+
* any group they were in.
|
|
25
|
+
*/
|
|
26
|
+
add(location: ICellRanges.Address, data: ICellRange.Address, properties?: ISparklineGroup.Modifiers, options?: ITransaction.OperationOptions): ISparklineGroup;
|
|
27
|
+
/**
|
|
28
|
+
* Returns items that match the filter criteria.
|
|
29
|
+
*
|
|
30
|
+
* If no filter criteria is provided, all items will be returned.
|
|
31
|
+
*
|
|
32
|
+
* @param options {@link ISparklineGroupCollection.GetItemsOptions}
|
|
33
|
+
*/
|
|
34
|
+
getItems(options?: ISparklineGroupCollection.GetItemsOptions): ISparklineGroup[];
|
|
35
|
+
/** For runtime type checking. */
|
|
36
|
+
readonly isISparklineGroupCollection: true;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* {@inheritDoc ISparklineGroupCollection}
|
|
40
|
+
* @see
|
|
41
|
+
* ### **Interface**
|
|
42
|
+
*
|
|
43
|
+
* {@link ISparklineGroupCollection}
|
|
44
|
+
*/
|
|
45
|
+
export declare namespace ISparklineGroupCollection {
|
|
46
|
+
/**
|
|
47
|
+
* Options for searching for {@link ISparklineGroup}s.
|
|
48
|
+
*/
|
|
49
|
+
interface GetItemsOptions extends ICollection.GetItemsOptions {
|
|
50
|
+
/**
|
|
51
|
+
* If provided, the search will be limited to groups with a sparkline in the range.
|
|
52
|
+
*/
|
|
53
|
+
address?: ICellRange.Address;
|
|
54
|
+
/**
|
|
55
|
+
* Indicate if items that are in hidden headers should be returned.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue false
|
|
58
|
+
*/
|
|
59
|
+
ignoreHidden?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Only return items that are completely contained with the search bounds.
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue false
|
|
64
|
+
*/
|
|
65
|
+
fullyContained?: boolean;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=ISparklineGroupCollection.d.ts.map
|