@pioneer-code/pioneer-charts 22.2.19 → 22.2.21
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
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
// `referenceLines` (see PcacReferenceLine) and `cornerLabels` (PcacCornerLabels): guides, drawn
|
|
27
27
|
// as quietly as the fan-out anchors. `color` overrides them through `--pcac-reference-line-color`
|
|
28
|
-
// (on each line's group) and `--pcac-corner-label-color` (on the labels' group), as
|
|
28
|
+
// (on each line's group and its label) and `--pcac-corner-label-color` (on the labels' group), as
|
|
29
|
+
// above.
|
|
29
30
|
.reference-line-stroke {
|
|
30
31
|
stroke: var(--pcac-reference-line-color, #{imports.$gray-500});
|
|
31
32
|
stroke-width: 1px;
|
|
@@ -56,6 +57,23 @@
|
|
|
56
57
|
fill: var(--pcac-corner-label-color, #{imports.$gray-600});
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
// Labels are decoration: a point under one still takes the hover and the click.
|
|
61
|
+
.corner-labels,
|
|
62
|
+
.reference-line-labels {
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// `labelsOnTop`: the labels are raised over the series, so each is outlined in a halo that keeps
|
|
67
|
+
// it readable on a point it crosses - stroked behind the fill, like the proximity chart's names.
|
|
68
|
+
// `--pcac-label-halo-color` should match the chart's background.
|
|
69
|
+
.pcac-labels-on-top .corner-label,
|
|
70
|
+
.pcac-labels-on-top .reference-line-label {
|
|
71
|
+
paint-order: stroke;
|
|
72
|
+
stroke: var(--pcac-label-halo-color, #{imports.$white});
|
|
73
|
+
stroke-width: 3px;
|
|
74
|
+
stroke-linejoin: round;
|
|
75
|
+
}
|
|
76
|
+
|
|
59
77
|
// `pointRange` (see PcacPointRangeConfig): each point's `range`, drawn by the builder into a
|
|
60
78
|
// `.point-range` group per point, a `.point-range-series` group per series, and one
|
|
61
79
|
// `.point-ranges` group for the chart. Color is the config's `color` when set
|
|
@@ -205,6 +205,16 @@ declare class PcacData {
|
|
|
205
205
|
* Optional for the same reason as `image`.
|
|
206
206
|
*/
|
|
207
207
|
gauge?: number;
|
|
208
|
+
/**
|
|
209
|
+
* The consumer's own identifier for this item - a record's primary key, say. Nothing draws or
|
|
210
|
+
* labels it; it's carried through untouched so a click output (`dotClicked`, `barClicked`,
|
|
211
|
+
* `sliceClicked`, `itemClicked`) can be traced back to the record it came from. Click outputs
|
|
212
|
+
* emit a copy of the item (the chart works on a copy of its config), so matching by object
|
|
213
|
+
* identity doesn't work, and matching by `key` or `image` breaks as soon as two items share one.
|
|
214
|
+
*
|
|
215
|
+
* Optional for the same reason as `image`.
|
|
216
|
+
*/
|
|
217
|
+
id?: string | number;
|
|
208
218
|
}
|
|
209
219
|
/**
|
|
210
220
|
* One side of a `PcacDataRange`. `min` above `max` is read as the other way round; `min` equal to
|
|
@@ -550,10 +560,16 @@ declare class PcacReferenceLine {
|
|
|
550
560
|
*/
|
|
551
561
|
value: number | string;
|
|
552
562
|
/**
|
|
553
|
-
* A few words drawn at the line
|
|
554
|
-
*
|
|
563
|
+
* A few words drawn at one end of the line, inside the plot (see `labelPosition`). Styled by the
|
|
564
|
+
* theme's `.reference-line-label` rule.
|
|
555
565
|
*/
|
|
556
566
|
label?: string;
|
|
567
|
+
/**
|
|
568
|
+
* Which end of the line `label` sits at. `'end'`, the default, is above the right end of a
|
|
569
|
+
* horizontal line and beside the top of a vertical one; `'start'` is above its left end and beside
|
|
570
|
+
* its bottom - for when the far end is crowded, say by a corner label.
|
|
571
|
+
*/
|
|
572
|
+
labelPosition: 'start' | 'end';
|
|
557
573
|
/**
|
|
558
574
|
* Any CSS color for the line and its label. Theme default `$gray-500`. Applied as
|
|
559
575
|
* `--pcac-reference-line-color` on the line's group, so a stylesheet can set it on an ancestor
|
|
@@ -565,8 +581,8 @@ declare class PcacReferenceLine {
|
|
|
565
581
|
* Text pinned to the plot area's corners (see `PcacLineAreaChartConfig.cornerLabels`) - names for
|
|
566
582
|
* the regions the plot divides into, such as the quadrants between two reference lines. Pinned to
|
|
567
583
|
* the plot's frame rather than to data, so they stay put when the chart is zoomed. Drawn under the
|
|
568
|
-
* series, so a point in the corner covers its label rather than the other way round
|
|
569
|
-
* left unset is left empty.
|
|
584
|
+
* series, so a point in the corner covers its label rather than the other way round, unless the
|
|
585
|
+
* chart sets `labelsOnTop`. Any corner left unset is left empty.
|
|
570
586
|
*/
|
|
571
587
|
declare class PcacCornerLabels {
|
|
572
588
|
topLeft?: string;
|
|
@@ -633,6 +649,15 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
|
|
|
633
649
|
* screen readers like the grid, so when they carry meaning, say so in the chart's `ariaLabel`.
|
|
634
650
|
*/
|
|
635
651
|
cornerLabels?: PcacCornerLabels;
|
|
652
|
+
/**
|
|
653
|
+
* Draw the corner labels and reference-line labels over the series instead of under it, each
|
|
654
|
+
* outlined in a halo so it stays readable on whatever it crosses - for a chart whose points crowd
|
|
655
|
+
* the corners or the lines' ends, where they'd otherwise hide the labels. Default false. The halo
|
|
656
|
+
* is `--pcac-label-halo-color`, the theme's `$white` by default: set it to the chart's background
|
|
657
|
+
* (a dark one, say) on the chart or any ancestor. The labels never take the pointer, so a point
|
|
658
|
+
* under one can still be hovered and clicked. The reference lines themselves stay under the series.
|
|
659
|
+
*/
|
|
660
|
+
labelsOnTop?: boolean;
|
|
636
661
|
}
|
|
637
662
|
|
|
638
663
|
/**
|