canvasxpress 74.1.0 → 74.1.2

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": "74.1.0",
23
+ "version": "74.1.2",
24
24
  "license": "SEE LICENSE IN LICENSE",
25
25
  "files": [
26
26
  "src",
@@ -9815,14 +9815,16 @@ body.has-fullscreen {
9815
9815
  * paints its root with the dark surface: the HTML widgets, primitives and translucent tints around
9816
9816
  * the canvas would otherwise sit on the host page (usually white). Only the chart's OWN theme does
9817
9817
  * this; inside a dark container (a dark dashboard) the container provides the backdrop.
9818
+ * The fill is the chart's own background (--cx-chart-bg, set at draw) so no strip of a second
9819
+ * colour shows beside the canvas, and a transparent chart background lets the host page through.
9818
9820
  */
9819
9821
  .cX-DOM[data-cx-ui-theme="dark"] {
9820
- background-color: var(--cx-ui-surface);
9822
+ background-color: var(--cx-chart-bg, var(--cx-ui-surface));
9821
9823
  }
9822
9824
 
9823
9825
  @media (prefers-color-scheme: dark) {
9824
9826
  .cX-DOM[data-cx-ui-theme="auto"] {
9825
- background-color: var(--cx-ui-surface);
9827
+ background-color: var(--cx-chart-bg, var(--cx-ui-surface));
9826
9828
  }
9827
9829
  }
9828
9830
 
@@ -145,7 +145,7 @@ export type CXGraphType =
145
145
 
146
146
  /**
147
147
  * Full chart configuration — one property per parameter in the CanvasXpress
148
- * config schema (1802 keys). String enums become open literal
148
+ * config schema (1807 keys). String enums become open literal
149
149
  * unions (except `graphType`, which is closed); `@graphTypes` in a key's JSDoc
150
150
  * lists the graph types it applies to (absent = all). The index signature keeps
151
151
  * obfuscation aliases and any newer key valid. See `CXConfigFor<G>` for the
@@ -412,6 +412,24 @@ export interface CXConfig {
412
412
  * @default "center"
413
413
  */
414
414
  binAlignment?: "left" | "center" | "right" | false | (string & {});
415
+ /**
416
+ * How binned data points are grouped into stacks. dotdensity is the Wilkinson algorithm R
417
+ * geom_dotplot uses (a bin starts at the first value that does not fit the previous one, and
418
+ * every dot in it is drawn at the bin centre); histodot uses fixed-width bins from the data
419
+ * minimum; exact stacks only values that are strictly equal, leaving every dot on its own
420
+ * value
421
+ * @graphTypes Area, AreaLine, Bar, BarLine, Boxplot, Bullet … (31 types; see CXGraphTypeKeys)
422
+ * @default "dotdensity"
423
+ */
424
+ binMethod?: "dotdensity" | "histodot" | "exact" | false | (string & {});
425
+ /**
426
+ * Width of a bin, in data units, when binned data points are grouped with binMethod
427
+ * dotdensity or histodot. Zero (the default) derives it from the data as the R geom_dotplot
428
+ * default does: the value range divided by 30
429
+ * @graphTypes Area, AreaLine, Bar, BarLine, Boxplot, Bullet … (31 types; see CXGraphTypeKeys)
430
+ * @default 0
431
+ */
432
+ binWidth?: number | boolean;
415
433
  /**
416
434
  * Flag to bin the data points in dotplots and boxplots
417
435
  * @graphTypes Area, AreaLine, Bar, BarLine, Boxplot, Bullet … (31 types; see CXGraphTypeKeys)
@@ -4093,6 +4111,15 @@ export interface CXConfig {
4093
4111
  * @default true
4094
4112
  */
4095
4113
  layoutRemoveEmpty?: boolean;
4114
+ /**
4115
+ * Flag to give each facet of a single-column layout a height proportional to the data it
4116
+ * holds, the way ggplot2 facet_grid(space = "free") sizes its panels, instead of splitting
4117
+ * the canvas into equal rows. A facet whose values span a small range is drawn short and a
4118
+ * busy one tall, so no facet wastes empty space. Ignored when the layout has more than one
4119
+ * column, and for heatmap, DOE and scatter-plot-matrix layouts
4120
+ * @default false
4121
+ */
4122
+ layoutSpaceFree?: boolean;
4096
4123
  /**
4097
4124
  * Spacing between layout graphs
4098
4125
  * @default 8
@@ -4202,7 +4229,9 @@ export interface CXConfig {
4202
4229
  */
4203
4230
  legendDirection?: "vertical" | "horizontal" | false | (string & {});
4204
4231
  /**
4205
- * Horizontal justification for legends when legend are in top or bottom positions
4232
+ * Horizontal justification (0 left, 0.5 centre, 1 right) for a legend in the top or bottom
4233
+ * position. A corner legendPosition supplies its own justification and ignores this. The
4234
+ * edge it is measured from is set by legendJustifyTo
4206
4235
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4207
4236
  * @default 0.5
4208
4237
  */
@@ -4214,9 +4243,9 @@ export interface CXConfig {
4214
4243
  */
4215
4244
  legendInside?: boolean;
4216
4245
  /**
4217
- * What a left/right-justified top or bottom legend (legendHorizontalJustification 0 or 1)
4218
- * aligns to: the panel (plot area) edge or the whole plot (canvas) edge, like titleAlign
4219
- * plot::0
4246
+ * What a justified legend aligns to: the panel (plot area) edge or the whole plot (canvas)
4247
+ * edge, like titleAlign plot::0. Applies to every justification of a top or bottom legend,
4248
+ * centred included, and to the corner positions
4220
4249
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4221
4250
  * @default "panel"
4222
4251
  */
@@ -4288,11 +4317,26 @@ export interface CXConfig {
4288
4317
  */
4289
4318
  legendOrderByCols?: boolean;
4290
4319
  /**
4291
- * Position for the the legend
4320
+ * Position for the legend. All eight positions work whether the legend is inside or outside
4321
+ * the plot. Inside, a corner anchors the legend to that corner of the plotting panel.
4322
+ * Outside, the legend gets one band or one column, so a corner is the top or bottom band
4323
+ * flush with that side: topLeft / bottomLeft are justified left and topRight / bottomRight
4324
+ * right, overriding legendHorizontalJustification; left and right are a column justified by
4325
+ * legendVerticalJustification
4292
4326
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4293
4327
  * @default "right"
4294
4328
  */
4295
4329
  legendPosition?: "topRight" | "right" | "bottomRight" | "bottom" | "bottomLeft" | "left" | "topLeft" | "top" | false | (string & {});
4330
+ /**
4331
+ * Flag to automatically select the legend position (top or right) that maximizes the area
4332
+ * available for the plot. When true the legend dimensions are computed for both candidates
4333
+ * and the one that leaves the larger plotting area wins. Ignored when legendPosition is set
4334
+ * explicitly in the configuration, when legendInside is true, for a faceted (layout) chart
4335
+ * or for cxplot / ggplot specifications
4336
+ * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4337
+ * @default true
4338
+ */
4339
+ legendPositionAuto?: boolean;
4296
4340
  /**
4297
4341
  * Number of rows in legends
4298
4342
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
@@ -4406,7 +4450,9 @@ export interface CXConfig {
4406
4450
  */
4407
4451
  legendTitleScaleFontFactor?: number | boolean;
4408
4452
  /**
4409
- * Vertical justification for legends when legend are in left or right positions
4453
+ * Vertical justification (0 top, 0.5 middle, 1 bottom) for a legend in the left or right
4454
+ * position, down the column the legend reserves. The mirror of legendHorizontalJustification
4455
+ * for a side legend
4410
4456
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4411
4457
  * @default 0.5
4412
4458
  */
@@ -6943,6 +6989,16 @@ export interface CXConfig {
6943
6989
  * @default "#aaaaaa"
6944
6990
  */
6945
6991
  scrollbarThumbHoverColor?: string | boolean;
6992
+ /**
6993
+ * Object giving the explicit order of the facet levels, keyed by the annotation used in
6994
+ * segregateSamplesBy / segregateVariablesBy, i.e. {"parameter": ["depicted", "speech",
6995
+ * "thought", "narrative"]}. The facets are drawn in the order the array lists, the way an
6996
+ * ordered factor fixes the panel order in R; a level the array omits keeps its natural order
6997
+ * after the listed ones. Without it the levels are sorted (numerically when they are
6998
+ * numbers, otherwise alphabetically)
6999
+ * @default false
7000
+ */
7001
+ segregateLevelOrder?: Record<string, unknown> | boolean;
6946
7002
  /**
6947
7003
  * An array that holds the annotation(s) used to segregate the samples ala Facet way in R. It
6948
7004
  * must be categories in the data.x object
@@ -11617,6 +11673,8 @@ export type CXKeysDataCustomizer =
11617
11673
  | "maxDataCustomizerEntries";
11618
11674
  /** Config keys in the "Data Faceting" category. */
11619
11675
  export type CXKeysDataFaceting =
11676
+ | "layoutSpaceFree"
11677
+ | "segregateLevelOrder"
11620
11678
  | "segregateSamplesBy"
11621
11679
  | "segregateVariablesBy"
11622
11680
  | "splitSamplesBy"
@@ -12279,6 +12337,7 @@ export type CXKeysLegends =
12279
12337
  | "legendOrder"
12280
12338
  | "legendOrderByCols"
12281
12339
  | "legendPosition"
12340
+ | "legendPositionAuto"
12282
12341
  | "legendRows"
12283
12342
  | "legendStyleGgplot"
12284
12343
  | "legendTextAlign"
@@ -12632,6 +12691,8 @@ export type CXKeysPieCharts =
12632
12691
  /** Config keys in the "Plot Area" category. */
12633
12692
  export type CXKeysPlotArea =
12634
12693
  | "binAlignment"
12694
+ | "binMethod"
12695
+ | "binWidth"
12635
12696
  | "binned"
12636
12697
  | "blockContrast"
12637
12698
  | "dataValuesFrequency"
@@ -154,7 +154,7 @@ declare namespace CanvasXpress {
154
154
 
155
155
  /**
156
156
  * Full chart configuration — one property per parameter in the CanvasXpress
157
- * config schema (1802 keys). String enums become open literal
157
+ * config schema (1807 keys). String enums become open literal
158
158
  * unions (except `graphType`, which is closed); `@graphTypes` in a key's JSDoc
159
159
  * lists the graph types it applies to (absent = all). The index signature keeps
160
160
  * obfuscation aliases and any newer key valid. See `CXConfigFor<G>` for the
@@ -421,6 +421,24 @@ declare namespace CanvasXpress {
421
421
  * @default "center"
422
422
  */
423
423
  binAlignment?: "left" | "center" | "right" | false | (string & {});
424
+ /**
425
+ * How binned data points are grouped into stacks. dotdensity is the Wilkinson algorithm R
426
+ * geom_dotplot uses (a bin starts at the first value that does not fit the previous one, and
427
+ * every dot in it is drawn at the bin centre); histodot uses fixed-width bins from the data
428
+ * minimum; exact stacks only values that are strictly equal, leaving every dot on its own
429
+ * value
430
+ * @graphTypes Area, AreaLine, Bar, BarLine, Boxplot, Bullet … (31 types; see CXGraphTypeKeys)
431
+ * @default "dotdensity"
432
+ */
433
+ binMethod?: "dotdensity" | "histodot" | "exact" | false | (string & {});
434
+ /**
435
+ * Width of a bin, in data units, when binned data points are grouped with binMethod
436
+ * dotdensity or histodot. Zero (the default) derives it from the data as the R geom_dotplot
437
+ * default does: the value range divided by 30
438
+ * @graphTypes Area, AreaLine, Bar, BarLine, Boxplot, Bullet … (31 types; see CXGraphTypeKeys)
439
+ * @default 0
440
+ */
441
+ binWidth?: number | boolean;
424
442
  /**
425
443
  * Flag to bin the data points in dotplots and boxplots
426
444
  * @graphTypes Area, AreaLine, Bar, BarLine, Boxplot, Bullet … (31 types; see CXGraphTypeKeys)
@@ -4102,6 +4120,15 @@ declare namespace CanvasXpress {
4102
4120
  * @default true
4103
4121
  */
4104
4122
  layoutRemoveEmpty?: boolean;
4123
+ /**
4124
+ * Flag to give each facet of a single-column layout a height proportional to the data it
4125
+ * holds, the way ggplot2 facet_grid(space = "free") sizes its panels, instead of splitting
4126
+ * the canvas into equal rows. A facet whose values span a small range is drawn short and a
4127
+ * busy one tall, so no facet wastes empty space. Ignored when the layout has more than one
4128
+ * column, and for heatmap, DOE and scatter-plot-matrix layouts
4129
+ * @default false
4130
+ */
4131
+ layoutSpaceFree?: boolean;
4105
4132
  /**
4106
4133
  * Spacing between layout graphs
4107
4134
  * @default 8
@@ -4211,7 +4238,9 @@ declare namespace CanvasXpress {
4211
4238
  */
4212
4239
  legendDirection?: "vertical" | "horizontal" | false | (string & {});
4213
4240
  /**
4214
- * Horizontal justification for legends when legend are in top or bottom positions
4241
+ * Horizontal justification (0 left, 0.5 centre, 1 right) for a legend in the top or bottom
4242
+ * position. A corner legendPosition supplies its own justification and ignores this. The
4243
+ * edge it is measured from is set by legendJustifyTo
4215
4244
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4216
4245
  * @default 0.5
4217
4246
  */
@@ -4223,9 +4252,9 @@ declare namespace CanvasXpress {
4223
4252
  */
4224
4253
  legendInside?: boolean;
4225
4254
  /**
4226
- * What a left/right-justified top or bottom legend (legendHorizontalJustification 0 or 1)
4227
- * aligns to: the panel (plot area) edge or the whole plot (canvas) edge, like titleAlign
4228
- * plot::0
4255
+ * What a justified legend aligns to: the panel (plot area) edge or the whole plot (canvas)
4256
+ * edge, like titleAlign plot::0. Applies to every justification of a top or bottom legend,
4257
+ * centred included, and to the corner positions
4229
4258
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4230
4259
  * @default "panel"
4231
4260
  */
@@ -4297,11 +4326,26 @@ declare namespace CanvasXpress {
4297
4326
  */
4298
4327
  legendOrderByCols?: boolean;
4299
4328
  /**
4300
- * Position for the the legend
4329
+ * Position for the legend. All eight positions work whether the legend is inside or outside
4330
+ * the plot. Inside, a corner anchors the legend to that corner of the plotting panel.
4331
+ * Outside, the legend gets one band or one column, so a corner is the top or bottom band
4332
+ * flush with that side: topLeft / bottomLeft are justified left and topRight / bottomRight
4333
+ * right, overriding legendHorizontalJustification; left and right are a column justified by
4334
+ * legendVerticalJustification
4301
4335
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4302
4336
  * @default "right"
4303
4337
  */
4304
4338
  legendPosition?: "topRight" | "right" | "bottomRight" | "bottom" | "bottomLeft" | "left" | "topLeft" | "top" | false | (string & {});
4339
+ /**
4340
+ * Flag to automatically select the legend position (top or right) that maximizes the area
4341
+ * available for the plot. When true the legend dimensions are computed for both candidates
4342
+ * and the one that leaves the larger plotting area wins. Ignored when legendPosition is set
4343
+ * explicitly in the configuration, when legendInside is true, for a faceted (layout) chart
4344
+ * or for cxplot / ggplot specifications
4345
+ * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4346
+ * @default true
4347
+ */
4348
+ legendPositionAuto?: boolean;
4305
4349
  /**
4306
4350
  * Number of rows in legends
4307
4351
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
@@ -4415,7 +4459,9 @@ declare namespace CanvasXpress {
4415
4459
  */
4416
4460
  legendTitleScaleFontFactor?: number | boolean;
4417
4461
  /**
4418
- * Vertical justification for legends when legend are in left or right positions
4462
+ * Vertical justification (0 top, 0.5 middle, 1 bottom) for a legend in the left or right
4463
+ * position, down the column the legend reserves. The mirror of legendHorizontalJustification
4464
+ * for a side legend
4419
4465
  * @graphTypes Bar, BarLine, Boxplot, Bullet, Cleveland, DotLine … (19 types; see CXGraphTypeKeys)
4420
4466
  * @default 0.5
4421
4467
  */
@@ -6952,6 +6998,16 @@ declare namespace CanvasXpress {
6952
6998
  * @default "#aaaaaa"
6953
6999
  */
6954
7000
  scrollbarThumbHoverColor?: string | boolean;
7001
+ /**
7002
+ * Object giving the explicit order of the facet levels, keyed by the annotation used in
7003
+ * segregateSamplesBy / segregateVariablesBy, i.e. {"parameter": ["depicted", "speech",
7004
+ * "thought", "narrative"]}. The facets are drawn in the order the array lists, the way an
7005
+ * ordered factor fixes the panel order in R; a level the array omits keeps its natural order
7006
+ * after the listed ones. Without it the levels are sorted (numerically when they are
7007
+ * numbers, otherwise alphabetically)
7008
+ * @default false
7009
+ */
7010
+ segregateLevelOrder?: Record<string, unknown> | boolean;
6955
7011
  /**
6956
7012
  * An array that holds the annotation(s) used to segregate the samples ala Facet way in R. It
6957
7013
  * must be categories in the data.x object
@@ -11626,6 +11682,8 @@ declare namespace CanvasXpress {
11626
11682
  | "maxDataCustomizerEntries";
11627
11683
  /** Config keys in the "Data Faceting" category. */
11628
11684
  export type CXKeysDataFaceting =
11685
+ | "layoutSpaceFree"
11686
+ | "segregateLevelOrder"
11629
11687
  | "segregateSamplesBy"
11630
11688
  | "segregateVariablesBy"
11631
11689
  | "splitSamplesBy"
@@ -12288,6 +12346,7 @@ declare namespace CanvasXpress {
12288
12346
  | "legendOrder"
12289
12347
  | "legendOrderByCols"
12290
12348
  | "legendPosition"
12349
+ | "legendPositionAuto"
12291
12350
  | "legendRows"
12292
12351
  | "legendStyleGgplot"
12293
12352
  | "legendTextAlign"
@@ -12641,6 +12700,8 @@ declare namespace CanvasXpress {
12641
12700
  /** Config keys in the "Plot Area" category. */
12642
12701
  export type CXKeysPlotArea =
12643
12702
  | "binAlignment"
12703
+ | "binMethod"
12704
+ | "binWidth"
12644
12705
  | "binned"
12645
12706
  | "blockContrast"
12646
12707
  | "dataValuesFrequency"