@moderneinc/react-charts 1.6.0-next.ebd481 → 1.7.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.
|
@@ -130,6 +130,23 @@ export type CampaignTimelineProps = {
|
|
|
130
130
|
* overriding one.
|
|
131
131
|
*/
|
|
132
132
|
horizonEnd?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Fraction of the plot width at which the newest data sits. `2/3` leaves the
|
|
135
|
+
* last third empty; `1` runs the data flush to the right edge.
|
|
136
|
+
*
|
|
137
|
+
* Trailing room is what a flag's label needs: the last event's banner is
|
|
138
|
+
* drawn to the RIGHT of its pole, so a pole at the edge has nowhere to put
|
|
139
|
+
* its text and the label flips to a chip on the other side. Reserving space
|
|
140
|
+
* here keeps the newest - usually most interesting - event reading like
|
|
141
|
+
* every other one.
|
|
142
|
+
*
|
|
143
|
+
* Applies to whatever right edge the domain settled on, so it composes with
|
|
144
|
+
* `horizonEnd` and with `complete={false}`'s wall-clock edge rather than
|
|
145
|
+
* fighting them. Clamped to (0, 1].
|
|
146
|
+
*
|
|
147
|
+
* @default 1
|
|
148
|
+
*/
|
|
149
|
+
trailingRatio?: number;
|
|
133
150
|
/** Ids of events drawn in the selected state. */
|
|
134
151
|
selectedEventIds?: string[];
|
|
135
152
|
/** Called when an event flag is clicked. */
|
|
@@ -11,11 +11,12 @@ type UseCampaignTimelineProps = {
|
|
|
11
11
|
complete: boolean;
|
|
12
12
|
now?: number;
|
|
13
13
|
horizonEnd?: number;
|
|
14
|
+
trailingRatio: number;
|
|
14
15
|
width?: number;
|
|
15
16
|
fontFamily: string;
|
|
16
17
|
formatDate?: (timestamp: number) => string;
|
|
17
18
|
};
|
|
18
|
-
export declare const useCampaignTimeline: ({ events, burndown, time, defaultTime, onTimeChange, snapToEvents, enableScrubbing, complete, now, horizonEnd, width: widthProp, fontFamily, formatDate }: UseCampaignTimelineProps) => {
|
|
19
|
+
export declare const useCampaignTimeline: ({ events, burndown, time, defaultTime, onTimeChange, snapToEvents, enableScrubbing, complete, now, horizonEnd, trailingRatio, width: widthProp, fontFamily, formatDate }: UseCampaignTimelineProps) => {
|
|
19
20
|
containerRef: import('react').RefObject<HTMLDivElement>;
|
|
20
21
|
width: number;
|
|
21
22
|
plotWidth: number;
|