@pioneer-code/pioneer-charts 22.2.20 → 22.2.22
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
|
|
@@ -91,9 +91,22 @@ declare class PcacAxisConfig {
|
|
|
91
91
|
* margins grow or shrink by the same amount so the plot area makes room for them - a longer
|
|
92
92
|
* tick means a slightly smaller plot, never labels pushed off the edge. Only the per-tick marks
|
|
93
93
|
* change; the axis line's two end-caps keep their default length. Colored by `tickColor`, the
|
|
94
|
-
* theme's `$gray-900` (like the axis line) by default.
|
|
94
|
+
* theme's `$gray-900` (like the axis line) by default. Ignored while `autoTickSize` is on.
|
|
95
95
|
*/
|
|
96
96
|
tickSize?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Size the tick marks from the chart's points instead of `tickSize`: half the largest mark
|
|
99
|
+
* toward this axis, so a point sitting on the axis ends where its tick does and never covers a
|
|
100
|
+
* tick label (D3's 3px tick padding is the gap left between them). This **overrides**
|
|
101
|
+
* `tickSize` - with it on, any `tickSize` given is ignored - and turns the marks on the same
|
|
102
|
+
* way a `tickSize` does. The largest mark is measured as drawn: a hovered dot, an image's box
|
|
103
|
+
* (its height for the x axis, its width for the y axis), and a gauge ring around either,
|
|
104
|
+
* after any shrinking to fit (dot plot). Honored by the charts that draw points - line, area,
|
|
105
|
+
* plot and dot plot; ignored elsewhere. On the dot plot the marks never reach the axis (its
|
|
106
|
+
* bottom row sits a `gap` above it), so there it only spaces the labels to the marks' size.
|
|
107
|
+
* Default false.
|
|
108
|
+
*/
|
|
109
|
+
autoTickSize?: boolean;
|
|
97
110
|
/**
|
|
98
111
|
* Tick mark color (`--pcac-axis-tick-color`), shown once `tickSize` has turned the marks on.
|
|
99
112
|
* Theme default `$gray-900`.
|
|
@@ -560,10 +573,16 @@ declare class PcacReferenceLine {
|
|
|
560
573
|
*/
|
|
561
574
|
value: number | string;
|
|
562
575
|
/**
|
|
563
|
-
* A few words drawn at the line
|
|
564
|
-
*
|
|
576
|
+
* A few words drawn at one end of the line, inside the plot (see `labelPosition`). Styled by the
|
|
577
|
+
* theme's `.reference-line-label` rule.
|
|
565
578
|
*/
|
|
566
579
|
label?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Which end of the line `label` sits at. `'end'`, the default, is above the right end of a
|
|
582
|
+
* horizontal line and beside the top of a vertical one; `'start'` is above its left end and beside
|
|
583
|
+
* its bottom - for when the far end is crowded, say by a corner label.
|
|
584
|
+
*/
|
|
585
|
+
labelPosition: 'start' | 'end';
|
|
567
586
|
/**
|
|
568
587
|
* Any CSS color for the line and its label. Theme default `$gray-500`. Applied as
|
|
569
588
|
* `--pcac-reference-line-color` on the line's group, so a stylesheet can set it on an ancestor
|
|
@@ -575,8 +594,8 @@ declare class PcacReferenceLine {
|
|
|
575
594
|
* Text pinned to the plot area's corners (see `PcacLineAreaChartConfig.cornerLabels`) - names for
|
|
576
595
|
* the regions the plot divides into, such as the quadrants between two reference lines. Pinned to
|
|
577
596
|
* 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.
|
|
597
|
+
* series, so a point in the corner covers its label rather than the other way round, unless the
|
|
598
|
+
* chart sets `labelsOnTop`. Any corner left unset is left empty.
|
|
580
599
|
*/
|
|
581
600
|
declare class PcacCornerLabels {
|
|
582
601
|
topLeft?: string;
|
|
@@ -643,6 +662,15 @@ declare class PcacLineAreaChartConfig extends PcacAxisChartConfig {
|
|
|
643
662
|
* screen readers like the grid, so when they carry meaning, say so in the chart's `ariaLabel`.
|
|
644
663
|
*/
|
|
645
664
|
cornerLabels?: PcacCornerLabels;
|
|
665
|
+
/**
|
|
666
|
+
* Draw the corner labels and reference-line labels over the series instead of under it, each
|
|
667
|
+
* outlined in a halo so it stays readable on whatever it crosses - for a chart whose points crowd
|
|
668
|
+
* the corners or the lines' ends, where they'd otherwise hide the labels. Default false. The halo
|
|
669
|
+
* is `--pcac-label-halo-color`, the theme's `$white` by default: set it to the chart's background
|
|
670
|
+
* (a dark one, say) on the chart or any ancestor. The labels never take the pointer, so a point
|
|
671
|
+
* under one can still be hovered and clicked. The reference lines themselves stay under the series.
|
|
672
|
+
*/
|
|
673
|
+
labelsOnTop?: boolean;
|
|
646
674
|
}
|
|
647
675
|
|
|
648
676
|
/**
|