@pioneer-code/pioneer-charts 22.2.20 → 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
|
|
@@ -560,10 +560,16 @@ declare class PcacReferenceLine {
|
|
|
560
560
|
*/
|
|
561
561
|
value: number | string;
|
|
562
562
|
/**
|
|
563
|
-
* A few words drawn at the line
|
|
564
|
-
*
|
|
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.
|
|
565
565
|
*/
|
|
566
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';
|
|
567
573
|
/**
|
|
568
574
|
* Any CSS color for the line and its label. Theme default `$gray-500`. Applied as
|
|
569
575
|
* `--pcac-reference-line-color` on the line's group, so a stylesheet can set it on an ancestor
|
|
@@ -575,8 +581,8 @@ declare class PcacReferenceLine {
|
|
|
575
581
|
* Text pinned to the plot area's corners (see `PcacLineAreaChartConfig.cornerLabels`) - names for
|
|
576
582
|
* the regions the plot divides into, such as the quadrants between two reference lines. Pinned to
|
|
577
583
|
* the plot's frame rather than to data, so they stay put when the chart is zoomed. Drawn under the
|
|
578
|
-
* series, so a point in the corner covers its label rather than the other way round
|
|
579
|
-
* 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.
|
|
580
586
|
*/
|
|
581
587
|
declare class PcacCornerLabels {
|
|
582
588
|
topLeft?: string;
|
|
@@ -643,6 +649,15 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
|
|
|
643
649
|
* screen readers like the grid, so when they carry meaning, say so in the chart's `ariaLabel`.
|
|
644
650
|
*/
|
|
645
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;
|
|
646
661
|
}
|
|
647
662
|
|
|
648
663
|
/**
|