canvasxpress 71.6.0 → 71.8.0

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/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./package.json": "./package.json"
21
21
  },
22
22
  "title": "CanvasXpress",
23
- "version": "71.6.0",
23
+ "version": "71.8.0",
24
24
  "license": "SEE LICENSE IN LICENSE",
25
25
  "files": [
26
26
  "src",
@@ -31,12 +31,34 @@ export interface CXData {
31
31
  [key: string]: unknown;
32
32
  }
33
33
 
34
- /** The four supported event hooks. `o` is the resolved data object under the cursor. */
34
+ /**
35
+ * User-event hooks fired by the engine. Each handler is called with
36
+ * `this` bound to the chart instance and three arguments: `o` (the resolved
37
+ * data object under the cursor, or null off any element), `e` (the native DOM
38
+ * event) and `t` (the chart instance — prefer this over `this`).
39
+ */
35
40
  export interface CXEvents {
41
+ /** A data element is clicked. */
36
42
  click?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
43
+ /** A legend item is clicked. */
44
+ clicklegend?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
45
+ /** A data element is double-clicked. */
37
46
  dblclick?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
47
+ /** Fired continuously during a drag operation. */
48
+ drag?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
49
+ /** Network graphs: a node drag has finished. */
50
+ enddragnode?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
51
+ /** Fired once after rendering completes. */
52
+ enddraw?: (o: any, e: Event, t: CanvasXpressInstance) => void;
38
53
  mousemove?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
39
54
  mouseout?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
55
+ mouseover?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
56
+ mouseup?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
57
+ /** The chart was updated by a remote source. */
58
+ remoteupdate?: (o: any, e: Event, t: CanvasXpressInstance) => void;
59
+ /** Fired after a selection of data points has been made. */
60
+ select?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
61
+ wheel?: (o: any, e: WheelEvent, t: CanvasXpressInstance) => void;
40
62
  [key: string]: ((o: any, e: any, t: CanvasXpressInstance) => void) | undefined;
41
63
  }
42
64
 
@@ -123,7 +145,7 @@ export type CXGraphType =
123
145
 
124
146
  /**
125
147
  * Full chart configuration — one property per parameter in the CanvasXpress
126
- * config schema (1779 keys). String enums become open literal
148
+ * config schema (1782 keys). String enums become open literal
127
149
  * unions (except `graphType`, which is closed); `@graphTypes` in a key's JSDoc
128
150
  * lists the graph types it applies to (absent = all). The index signature keeps
129
151
  * obfuscation aliases and any newer key valid. See `CXConfigFor<G>` for the
@@ -1587,10 +1609,13 @@ export interface CXConfig {
1587
1609
  dataPipeline?: unknown[] | boolean | string | number;
1588
1610
  /**
1589
1611
  * Approximate pixel size for the data points in scatter plots, dotplots and boxplots. The
1590
- * size will be adjusted according to the dimensions of the graph
1612
+ * size will be adjusted according to the dimensions of the graph. Boxplots and dotplots
1613
+ * default to 15 (to match ggplot2 geom_point) unless set explicitly. Set to the string
1614
+ * "auto" to size scatter points from the plot area, damped by the number of points (larger
1615
+ * dots on sparse/large panels, smaller on dense ones)
1591
1616
  * @default 10
1592
1617
  */
1593
- dataPointSize?: number | boolean;
1618
+ dataPointSize?: number | boolean | "auto";
1594
1619
  /**
1595
1620
  * Factor used to adjust the size of the dataPointSize
1596
1621
  * @default 1
@@ -6423,6 +6448,16 @@ export interface CXConfig {
6423
6448
  * @default false
6424
6449
  */
6425
6450
  sankeyColorNodesByValue?: boolean;
6451
+ /**
6452
+ * Name of a sample annotation that flags a link (row) to be hidden from the Sankey/alluvial
6453
+ * diagram. A truthy value (true/1/"yes") suppresses that flow ribbon WITHOUT removing it
6454
+ * from the data, so the node values, box heights and the showDataValues number still count
6455
+ * it. Use it to drop a noise branch visually while keeping each node total correct (issue
6456
+ * #320)
6457
+ * @graphTypes Sankey
6458
+ * @default false
6459
+ */
6460
+ sankeyHide?: string | boolean;
6426
6461
  /**
6427
6462
  * Outline width (px) for the Sankey/alluvial flow ribbons. Left null the ribbons use the
6428
6463
  * default outlineWidth, which inflates a thin (low-value) flow into a solid ~1px line in its
@@ -6807,6 +6842,14 @@ export interface CXConfig {
6807
6842
  * @default []
6808
6843
  */
6809
6844
  segregateVariablesBy?: unknown[] | boolean | string | number;
6845
+ /**
6846
+ * Flag to make fit lines and confidence areas (regression, loess, forecast, Kaplan-Meier
6847
+ * curves/bands, area/ribbon) clickable: a click selects and broadcasts the data the
6848
+ * fit/curve was computed over (e.g. a KM arm selects its whole cohort)
6849
+ * @graphTypes Scatter2D
6850
+ * @default true
6851
+ */
6852
+ selectableFits?: boolean;
6810
6853
  /**
6811
6854
  * Variable / Sample names of data points (in the data object) to initially select
6812
6855
  * @default []
@@ -8012,6 +8055,14 @@ export interface CXConfig {
8012
8055
  * @default 0
8013
8056
  */
8014
8057
  smpTextRotate?: number | boolean;
8058
+ /**
8059
+ * Flag to automatically keep the sample (or grouping-factor) labels of vertical
8060
+ * one-dimensional plots horizontal when the longest label fits its band, falling back to
8061
+ * smpTextRotate otherwise. Re-evaluated on resize
8062
+ * @graphTypes Alluvial, Area, AreaLine, Bar, BarLine, Boxplot … (65 types; see CXGraphTypeKeys)
8063
+ * @default true
8064
+ */
8065
+ smpTextRotateAuto?: boolean;
8015
8066
  /**
8016
8067
  * Scaling factor used to increase or decrease the sample labels font size in the canvas
8017
8068
  * @graphTypes Alluvial, Area, AreaLine, Bar, BarLine, Boxplot … (65 types; see CXGraphTypeKeys)
@@ -11316,6 +11367,7 @@ export type CXKeysConfidenceIntervals =
11316
11367
  | "confidenceIntervalColorCoordinate"
11317
11368
  | "confidenceIntervalsMax"
11318
11369
  | "confidenceLevel"
11370
+ | "selectableFits"
11319
11371
  | "showConfidenceIntervals";
11320
11372
  /** Config keys in the "Context Menu" category. */
11321
11373
  export type CXKeysContextMenu =
@@ -12575,6 +12627,7 @@ export type CXKeysSamples =
12575
12627
  | "smpTextFontStyle"
12576
12628
  | "smpTextMargin"
12577
12629
  | "smpTextRotate"
12630
+ | "smpTextRotateAuto"
12578
12631
  | "smpTextScaleFontFactor"
12579
12632
  | "smpTitle"
12580
12633
  | "smpTitleAlign"
@@ -12590,6 +12643,7 @@ export type CXKeysSankeyDiagrams =
12590
12643
  | "sankeyAxes"
12591
12644
  | "sankeyAxesOrder"
12592
12645
  | "sankeyColorNodesByValue"
12646
+ | "sankeyHide"
12593
12647
  | "sankeyLinkLineWidth"
12594
12648
  | "sankeyLinkOrder"
12595
12649
  | "sankeyLinksColor"
@@ -40,12 +40,34 @@ declare namespace CanvasXpress {
40
40
  [key: string]: unknown;
41
41
  }
42
42
 
43
- /** The four supported event hooks. `o` is the resolved data object under the cursor. */
43
+ /**
44
+ * User-event hooks fired by the engine. Each handler is called with
45
+ * `this` bound to the chart instance and three arguments: `o` (the resolved
46
+ * data object under the cursor, or null off any element), `e` (the native DOM
47
+ * event) and `t` (the chart instance — prefer this over `this`).
48
+ */
44
49
  export interface CXEvents {
50
+ /** A data element is clicked. */
45
51
  click?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
52
+ /** A legend item is clicked. */
53
+ clicklegend?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
54
+ /** A data element is double-clicked. */
46
55
  dblclick?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
56
+ /** Fired continuously during a drag operation. */
57
+ drag?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
58
+ /** Network graphs: a node drag has finished. */
59
+ enddragnode?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
60
+ /** Fired once after rendering completes. */
61
+ enddraw?: (o: any, e: Event, t: CanvasXpressInstance) => void;
47
62
  mousemove?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
48
63
  mouseout?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
64
+ mouseover?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
65
+ mouseup?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
66
+ /** The chart was updated by a remote source. */
67
+ remoteupdate?: (o: any, e: Event, t: CanvasXpressInstance) => void;
68
+ /** Fired after a selection of data points has been made. */
69
+ select?: (o: any, e: MouseEvent, t: CanvasXpressInstance) => void;
70
+ wheel?: (o: any, e: WheelEvent, t: CanvasXpressInstance) => void;
49
71
  [key: string]: ((o: any, e: any, t: CanvasXpressInstance) => void) | undefined;
50
72
  }
51
73
 
@@ -132,7 +154,7 @@ declare namespace CanvasXpress {
132
154
 
133
155
  /**
134
156
  * Full chart configuration — one property per parameter in the CanvasXpress
135
- * config schema (1779 keys). String enums become open literal
157
+ * config schema (1782 keys). String enums become open literal
136
158
  * unions (except `graphType`, which is closed); `@graphTypes` in a key's JSDoc
137
159
  * lists the graph types it applies to (absent = all). The index signature keeps
138
160
  * obfuscation aliases and any newer key valid. See `CXConfigFor<G>` for the
@@ -1596,10 +1618,13 @@ declare namespace CanvasXpress {
1596
1618
  dataPipeline?: unknown[] | boolean | string | number;
1597
1619
  /**
1598
1620
  * Approximate pixel size for the data points in scatter plots, dotplots and boxplots. The
1599
- * size will be adjusted according to the dimensions of the graph
1621
+ * size will be adjusted according to the dimensions of the graph. Boxplots and dotplots
1622
+ * default to 15 (to match ggplot2 geom_point) unless set explicitly. Set to the string
1623
+ * "auto" to size scatter points from the plot area, damped by the number of points (larger
1624
+ * dots on sparse/large panels, smaller on dense ones)
1600
1625
  * @default 10
1601
1626
  */
1602
- dataPointSize?: number | boolean;
1627
+ dataPointSize?: number | boolean | "auto";
1603
1628
  /**
1604
1629
  * Factor used to adjust the size of the dataPointSize
1605
1630
  * @default 1
@@ -6432,6 +6457,16 @@ declare namespace CanvasXpress {
6432
6457
  * @default false
6433
6458
  */
6434
6459
  sankeyColorNodesByValue?: boolean;
6460
+ /**
6461
+ * Name of a sample annotation that flags a link (row) to be hidden from the Sankey/alluvial
6462
+ * diagram. A truthy value (true/1/"yes") suppresses that flow ribbon WITHOUT removing it
6463
+ * from the data, so the node values, box heights and the showDataValues number still count
6464
+ * it. Use it to drop a noise branch visually while keeping each node total correct (issue
6465
+ * #320)
6466
+ * @graphTypes Sankey
6467
+ * @default false
6468
+ */
6469
+ sankeyHide?: string | boolean;
6435
6470
  /**
6436
6471
  * Outline width (px) for the Sankey/alluvial flow ribbons. Left null the ribbons use the
6437
6472
  * default outlineWidth, which inflates a thin (low-value) flow into a solid ~1px line in its
@@ -6816,6 +6851,14 @@ declare namespace CanvasXpress {
6816
6851
  * @default []
6817
6852
  */
6818
6853
  segregateVariablesBy?: unknown[] | boolean | string | number;
6854
+ /**
6855
+ * Flag to make fit lines and confidence areas (regression, loess, forecast, Kaplan-Meier
6856
+ * curves/bands, area/ribbon) clickable: a click selects and broadcasts the data the
6857
+ * fit/curve was computed over (e.g. a KM arm selects its whole cohort)
6858
+ * @graphTypes Scatter2D
6859
+ * @default true
6860
+ */
6861
+ selectableFits?: boolean;
6819
6862
  /**
6820
6863
  * Variable / Sample names of data points (in the data object) to initially select
6821
6864
  * @default []
@@ -8021,6 +8064,14 @@ declare namespace CanvasXpress {
8021
8064
  * @default 0
8022
8065
  */
8023
8066
  smpTextRotate?: number | boolean;
8067
+ /**
8068
+ * Flag to automatically keep the sample (or grouping-factor) labels of vertical
8069
+ * one-dimensional plots horizontal when the longest label fits its band, falling back to
8070
+ * smpTextRotate otherwise. Re-evaluated on resize
8071
+ * @graphTypes Alluvial, Area, AreaLine, Bar, BarLine, Boxplot … (65 types; see CXGraphTypeKeys)
8072
+ * @default true
8073
+ */
8074
+ smpTextRotateAuto?: boolean;
8024
8075
  /**
8025
8076
  * Scaling factor used to increase or decrease the sample labels font size in the canvas
8026
8077
  * @graphTypes Alluvial, Area, AreaLine, Bar, BarLine, Boxplot … (65 types; see CXGraphTypeKeys)
@@ -11325,6 +11376,7 @@ declare namespace CanvasXpress {
11325
11376
  | "confidenceIntervalColorCoordinate"
11326
11377
  | "confidenceIntervalsMax"
11327
11378
  | "confidenceLevel"
11379
+ | "selectableFits"
11328
11380
  | "showConfidenceIntervals";
11329
11381
  /** Config keys in the "Context Menu" category. */
11330
11382
  export type CXKeysContextMenu =
@@ -12584,6 +12636,7 @@ declare namespace CanvasXpress {
12584
12636
  | "smpTextFontStyle"
12585
12637
  | "smpTextMargin"
12586
12638
  | "smpTextRotate"
12639
+ | "smpTextRotateAuto"
12587
12640
  | "smpTextScaleFontFactor"
12588
12641
  | "smpTitle"
12589
12642
  | "smpTitleAlign"
@@ -12599,6 +12652,7 @@ declare namespace CanvasXpress {
12599
12652
  | "sankeyAxes"
12600
12653
  | "sankeyAxesOrder"
12601
12654
  | "sankeyColorNodesByValue"
12655
+ | "sankeyHide"
12602
12656
  | "sankeyLinkLineWidth"
12603
12657
  | "sankeyLinkOrder"
12604
12658
  | "sankeyLinksColor"